resources_js_pages_Sales_Index_vue.js 695KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391
  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: PJNxxx, 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: 'Penjualan',
  1103. icon: 'pi pi-tag',
  1104. to: '/sales',
  1105. component: 'Sales/Index'
  1106. }, {
  1107. label: 'Stok Barang',
  1108. icon: 'pi pi-box',
  1109. to: '/stock-products',
  1110. component: 'StockProducts/Index'
  1111. }]
  1112. }],
  1113. // Operator
  1114. 3: [{
  1115. label: 'Home',
  1116. items: [{
  1117. label: 'Dashboard',
  1118. icon: 'pi pi-chart-bar',
  1119. to: '/dashboards',
  1120. component: 'Dashboards/Index'
  1121. }]
  1122. }, {
  1123. label: 'Master',
  1124. items: [{
  1125. label: 'Supplier',
  1126. icon: 'pi pi-shopping-cart',
  1127. to: '/suppliers',
  1128. component: 'Suppliers/Index'
  1129. }, {
  1130. label: 'Produk',
  1131. icon: 'pi pi-th-large',
  1132. to: '/products',
  1133. component: 'Products/Index'
  1134. }, {
  1135. label: 'Pembelian',
  1136. icon: 'pi pi-shopping-cart',
  1137. to: '/purchases',
  1138. component: 'Purchases/Index'
  1139. }, {
  1140. label: 'Stok Barang',
  1141. icon: 'pi pi-box',
  1142. to: '/stock-products',
  1143. component: 'StockProducts/Index'
  1144. }]
  1145. }]
  1146. });
  1147. /***/ }),
  1148. /***/ "./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":
  1149. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1150. !*** ./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 ***!
  1151. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1152. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1153. "use strict";
  1154. __webpack_require__.r(__webpack_exports__);
  1155. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1156. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1157. /* harmony export */ });
  1158. /* 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");
  1159. /* 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__);
  1160. // Imports
  1161. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1162. // Module
  1163. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-5b49aa22] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1164. // Exports
  1165. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1166. /***/ }),
  1167. /***/ "./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":
  1168. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1169. !*** ./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 ***!
  1170. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1171. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1172. "use strict";
  1173. __webpack_require__.r(__webpack_exports__);
  1174. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1175. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1176. /* harmony export */ });
  1177. /* 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");
  1178. /* 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__);
  1179. // Imports
  1180. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1181. // Module
  1182. ___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}", ""]);
  1183. // Exports
  1184. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1185. /***/ }),
  1186. /***/ "./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":
  1187. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1188. !*** ./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 ***!
  1189. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1190. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1191. "use strict";
  1192. __webpack_require__.r(__webpack_exports__);
  1193. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1194. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1195. /* harmony export */ });
  1196. /* 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");
  1197. /* 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__);
  1198. // Imports
  1199. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1200. // Module
  1201. ___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}", ""]);
  1202. // Exports
  1203. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1204. /***/ }),
  1205. /***/ "./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":
  1206. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1207. !*** ./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 ***!
  1208. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1209. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1210. "use strict";
  1211. __webpack_require__.r(__webpack_exports__);
  1212. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1213. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1214. /* harmony export */ });
  1215. /* 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");
  1216. /* 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__);
  1217. // Imports
  1218. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1219. // Module
  1220. ___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}", ""]);
  1221. // Exports
  1222. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1223. /***/ }),
  1224. /***/ "./node_modules/lodash/lodash.js":
  1225. /*!***************************************!*\
  1226. !*** ./node_modules/lodash/lodash.js ***!
  1227. \***************************************/
  1228. /***/ (function(module, exports, __webpack_require__) {
  1229. /* module decorator */ module = __webpack_require__.nmd(module);
  1230. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1231. * @license
  1232. * Lodash <https://lodash.com/>
  1233. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1234. * Released under MIT license <https://lodash.com/license>
  1235. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1236. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1237. */
  1238. ;(function() {
  1239. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1240. var undefined;
  1241. /** Used as the semantic version number. */
  1242. var VERSION = '4.17.21';
  1243. /** Used as the size to enable large array optimizations. */
  1244. var LARGE_ARRAY_SIZE = 200;
  1245. /** Error message constants. */
  1246. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1247. FUNC_ERROR_TEXT = 'Expected a function',
  1248. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1249. /** Used to stand-in for `undefined` hash values. */
  1250. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1251. /** Used as the maximum memoize cache size. */
  1252. var MAX_MEMOIZE_SIZE = 500;
  1253. /** Used as the internal argument placeholder. */
  1254. var PLACEHOLDER = '__lodash_placeholder__';
  1255. /** Used to compose bitmasks for cloning. */
  1256. var CLONE_DEEP_FLAG = 1,
  1257. CLONE_FLAT_FLAG = 2,
  1258. CLONE_SYMBOLS_FLAG = 4;
  1259. /** Used to compose bitmasks for value comparisons. */
  1260. var COMPARE_PARTIAL_FLAG = 1,
  1261. COMPARE_UNORDERED_FLAG = 2;
  1262. /** Used to compose bitmasks for function metadata. */
  1263. var WRAP_BIND_FLAG = 1,
  1264. WRAP_BIND_KEY_FLAG = 2,
  1265. WRAP_CURRY_BOUND_FLAG = 4,
  1266. WRAP_CURRY_FLAG = 8,
  1267. WRAP_CURRY_RIGHT_FLAG = 16,
  1268. WRAP_PARTIAL_FLAG = 32,
  1269. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1270. WRAP_ARY_FLAG = 128,
  1271. WRAP_REARG_FLAG = 256,
  1272. WRAP_FLIP_FLAG = 512;
  1273. /** Used as default options for `_.truncate`. */
  1274. var DEFAULT_TRUNC_LENGTH = 30,
  1275. DEFAULT_TRUNC_OMISSION = '...';
  1276. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1277. var HOT_COUNT = 800,
  1278. HOT_SPAN = 16;
  1279. /** Used to indicate the type of lazy iteratees. */
  1280. var LAZY_FILTER_FLAG = 1,
  1281. LAZY_MAP_FLAG = 2,
  1282. LAZY_WHILE_FLAG = 3;
  1283. /** Used as references for various `Number` constants. */
  1284. var INFINITY = 1 / 0,
  1285. MAX_SAFE_INTEGER = 9007199254740991,
  1286. MAX_INTEGER = 1.7976931348623157e+308,
  1287. NAN = 0 / 0;
  1288. /** Used as references for the maximum length and index of an array. */
  1289. var MAX_ARRAY_LENGTH = 4294967295,
  1290. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1291. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1292. /** Used to associate wrap methods with their bit flags. */
  1293. var wrapFlags = [
  1294. ['ary', WRAP_ARY_FLAG],
  1295. ['bind', WRAP_BIND_FLAG],
  1296. ['bindKey', WRAP_BIND_KEY_FLAG],
  1297. ['curry', WRAP_CURRY_FLAG],
  1298. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1299. ['flip', WRAP_FLIP_FLAG],
  1300. ['partial', WRAP_PARTIAL_FLAG],
  1301. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1302. ['rearg', WRAP_REARG_FLAG]
  1303. ];
  1304. /** `Object#toString` result references. */
  1305. var argsTag = '[object Arguments]',
  1306. arrayTag = '[object Array]',
  1307. asyncTag = '[object AsyncFunction]',
  1308. boolTag = '[object Boolean]',
  1309. dateTag = '[object Date]',
  1310. domExcTag = '[object DOMException]',
  1311. errorTag = '[object Error]',
  1312. funcTag = '[object Function]',
  1313. genTag = '[object GeneratorFunction]',
  1314. mapTag = '[object Map]',
  1315. numberTag = '[object Number]',
  1316. nullTag = '[object Null]',
  1317. objectTag = '[object Object]',
  1318. promiseTag = '[object Promise]',
  1319. proxyTag = '[object Proxy]',
  1320. regexpTag = '[object RegExp]',
  1321. setTag = '[object Set]',
  1322. stringTag = '[object String]',
  1323. symbolTag = '[object Symbol]',
  1324. undefinedTag = '[object Undefined]',
  1325. weakMapTag = '[object WeakMap]',
  1326. weakSetTag = '[object WeakSet]';
  1327. var arrayBufferTag = '[object ArrayBuffer]',
  1328. dataViewTag = '[object DataView]',
  1329. float32Tag = '[object Float32Array]',
  1330. float64Tag = '[object Float64Array]',
  1331. int8Tag = '[object Int8Array]',
  1332. int16Tag = '[object Int16Array]',
  1333. int32Tag = '[object Int32Array]',
  1334. uint8Tag = '[object Uint8Array]',
  1335. uint8ClampedTag = '[object Uint8ClampedArray]',
  1336. uint16Tag = '[object Uint16Array]',
  1337. uint32Tag = '[object Uint32Array]';
  1338. /** Used to match empty string literals in compiled template source. */
  1339. var reEmptyStringLeading = /\b__p \+= '';/g,
  1340. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1341. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1342. /** Used to match HTML entities and HTML characters. */
  1343. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1344. reUnescapedHtml = /[&<>"']/g,
  1345. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1346. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1347. /** Used to match template delimiters. */
  1348. var reEscape = /<%-([\s\S]+?)%>/g,
  1349. reEvaluate = /<%([\s\S]+?)%>/g,
  1350. reInterpolate = /<%=([\s\S]+?)%>/g;
  1351. /** Used to match property names within property paths. */
  1352. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1353. reIsPlainProp = /^\w*$/,
  1354. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1355. /**
  1356. * Used to match `RegExp`
  1357. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1358. */
  1359. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1360. reHasRegExpChar = RegExp(reRegExpChar.source);
  1361. /** Used to match leading whitespace. */
  1362. var reTrimStart = /^\s+/;
  1363. /** Used to match a single whitespace character. */
  1364. var reWhitespace = /\s/;
  1365. /** Used to match wrap detail comments. */
  1366. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1367. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1368. reSplitDetails = /,? & /;
  1369. /** Used to match words composed of alphanumeric characters. */
  1370. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1371. /**
  1372. * Used to validate the `validate` option in `_.template` variable.
  1373. *
  1374. * Forbids characters which could potentially change the meaning of the function argument definition:
  1375. * - "()," (modification of function parameters)
  1376. * - "=" (default value)
  1377. * - "[]{}" (destructuring of function parameters)
  1378. * - "/" (beginning of a comment)
  1379. * - whitespace
  1380. */
  1381. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1382. /** Used to match backslashes in property paths. */
  1383. var reEscapeChar = /\\(\\)?/g;
  1384. /**
  1385. * Used to match
  1386. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1387. */
  1388. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1389. /** Used to match `RegExp` flags from their coerced string values. */
  1390. var reFlags = /\w*$/;
  1391. /** Used to detect bad signed hexadecimal string values. */
  1392. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1393. /** Used to detect binary string values. */
  1394. var reIsBinary = /^0b[01]+$/i;
  1395. /** Used to detect host constructors (Safari). */
  1396. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1397. /** Used to detect octal string values. */
  1398. var reIsOctal = /^0o[0-7]+$/i;
  1399. /** Used to detect unsigned integer values. */
  1400. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1401. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1402. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1403. /** Used to ensure capturing order of template delimiters. */
  1404. var reNoMatch = /($^)/;
  1405. /** Used to match unescaped characters in compiled string literals. */
  1406. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1407. /** Used to compose unicode character classes. */
  1408. var rsAstralRange = '\\ud800-\\udfff',
  1409. rsComboMarksRange = '\\u0300-\\u036f',
  1410. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1411. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1412. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1413. rsDingbatRange = '\\u2700-\\u27bf',
  1414. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1415. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1416. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1417. rsPunctuationRange = '\\u2000-\\u206f',
  1418. 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',
  1419. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1420. rsVarRange = '\\ufe0e\\ufe0f',
  1421. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1422. /** Used to compose unicode capture groups. */
  1423. var rsApos = "['\u2019]",
  1424. rsAstral = '[' + rsAstralRange + ']',
  1425. rsBreak = '[' + rsBreakRange + ']',
  1426. rsCombo = '[' + rsComboRange + ']',
  1427. rsDigits = '\\d+',
  1428. rsDingbat = '[' + rsDingbatRange + ']',
  1429. rsLower = '[' + rsLowerRange + ']',
  1430. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1431. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1432. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1433. rsNonAstral = '[^' + rsAstralRange + ']',
  1434. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1435. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1436. rsUpper = '[' + rsUpperRange + ']',
  1437. rsZWJ = '\\u200d';
  1438. /** Used to compose unicode regexes. */
  1439. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1440. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1441. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1442. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1443. reOptMod = rsModifier + '?',
  1444. rsOptVar = '[' + rsVarRange + ']?',
  1445. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1446. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1447. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1448. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1449. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1450. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1451. /** Used to match apostrophes. */
  1452. var reApos = RegExp(rsApos, 'g');
  1453. /**
  1454. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1455. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1456. */
  1457. var reComboMark = RegExp(rsCombo, 'g');
  1458. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1459. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1460. /** Used to match complex or compound words. */
  1461. var reUnicodeWord = RegExp([
  1462. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1463. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1464. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1465. rsUpper + '+' + rsOptContrUpper,
  1466. rsOrdUpper,
  1467. rsOrdLower,
  1468. rsDigits,
  1469. rsEmoji
  1470. ].join('|'), 'g');
  1471. /** 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/). */
  1472. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1473. /** Used to detect strings that need a more robust regexp to match words. */
  1474. 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 ]/;
  1475. /** Used to assign default `context` object properties. */
  1476. var contextProps = [
  1477. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1478. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1479. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1480. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1481. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1482. ];
  1483. /** Used to make template sourceURLs easier to identify. */
  1484. var templateCounter = -1;
  1485. /** Used to identify `toStringTag` values of typed arrays. */
  1486. var typedArrayTags = {};
  1487. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1488. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1489. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1490. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1491. typedArrayTags[uint32Tag] = true;
  1492. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1493. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1494. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1495. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1496. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1497. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1498. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1499. typedArrayTags[weakMapTag] = false;
  1500. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1501. var cloneableTags = {};
  1502. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1503. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1504. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1505. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1506. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1507. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1508. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1509. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1510. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1511. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1512. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1513. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1514. cloneableTags[weakMapTag] = false;
  1515. /** Used to map Latin Unicode letters to basic Latin letters. */
  1516. var deburredLetters = {
  1517. // Latin-1 Supplement block.
  1518. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1519. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1520. '\xc7': 'C', '\xe7': 'c',
  1521. '\xd0': 'D', '\xf0': 'd',
  1522. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1523. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1524. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1525. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1526. '\xd1': 'N', '\xf1': 'n',
  1527. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1528. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1529. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1530. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1531. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1532. '\xc6': 'Ae', '\xe6': 'ae',
  1533. '\xde': 'Th', '\xfe': 'th',
  1534. '\xdf': 'ss',
  1535. // Latin Extended-A block.
  1536. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1537. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1538. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1539. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1540. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1541. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1542. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1543. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1544. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1545. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1546. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1547. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1548. '\u0134': 'J', '\u0135': 'j',
  1549. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1550. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1551. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1552. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1553. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1554. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1555. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1556. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1557. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1558. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1559. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1560. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1561. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1562. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1563. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1564. '\u0174': 'W', '\u0175': 'w',
  1565. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1566. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1567. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1568. '\u0132': 'IJ', '\u0133': 'ij',
  1569. '\u0152': 'Oe', '\u0153': 'oe',
  1570. '\u0149': "'n", '\u017f': 's'
  1571. };
  1572. /** Used to map characters to HTML entities. */
  1573. var htmlEscapes = {
  1574. '&': '&amp;',
  1575. '<': '&lt;',
  1576. '>': '&gt;',
  1577. '"': '&quot;',
  1578. "'": '&#39;'
  1579. };
  1580. /** Used to map HTML entities to characters. */
  1581. var htmlUnescapes = {
  1582. '&amp;': '&',
  1583. '&lt;': '<',
  1584. '&gt;': '>',
  1585. '&quot;': '"',
  1586. '&#39;': "'"
  1587. };
  1588. /** Used to escape characters for inclusion in compiled string literals. */
  1589. var stringEscapes = {
  1590. '\\': '\\',
  1591. "'": "'",
  1592. '\n': 'n',
  1593. '\r': 'r',
  1594. '\u2028': 'u2028',
  1595. '\u2029': 'u2029'
  1596. };
  1597. /** Built-in method references without a dependency on `root`. */
  1598. var freeParseFloat = parseFloat,
  1599. freeParseInt = parseInt;
  1600. /** Detect free variable `global` from Node.js. */
  1601. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1602. /** Detect free variable `self`. */
  1603. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1604. /** Used as a reference to the global object. */
  1605. var root = freeGlobal || freeSelf || Function('return this')();
  1606. /** Detect free variable `exports`. */
  1607. var freeExports = true && exports && !exports.nodeType && exports;
  1608. /** Detect free variable `module`. */
  1609. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1610. /** Detect the popular CommonJS extension `module.exports`. */
  1611. var moduleExports = freeModule && freeModule.exports === freeExports;
  1612. /** Detect free variable `process` from Node.js. */
  1613. var freeProcess = moduleExports && freeGlobal.process;
  1614. /** Used to access faster Node.js helpers. */
  1615. var nodeUtil = (function() {
  1616. try {
  1617. // Use `util.types` for Node.js 10+.
  1618. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1619. if (types) {
  1620. return types;
  1621. }
  1622. // Legacy `process.binding('util')` for Node.js < 10.
  1623. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1624. } catch (e) {}
  1625. }());
  1626. /* Node.js helper references. */
  1627. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1628. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1629. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1630. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1631. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1632. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1633. /*--------------------------------------------------------------------------*/
  1634. /**
  1635. * A faster alternative to `Function#apply`, this function invokes `func`
  1636. * with the `this` binding of `thisArg` and the arguments of `args`.
  1637. *
  1638. * @private
  1639. * @param {Function} func The function to invoke.
  1640. * @param {*} thisArg The `this` binding of `func`.
  1641. * @param {Array} args The arguments to invoke `func` with.
  1642. * @returns {*} Returns the result of `func`.
  1643. */
  1644. function apply(func, thisArg, args) {
  1645. switch (args.length) {
  1646. case 0: return func.call(thisArg);
  1647. case 1: return func.call(thisArg, args[0]);
  1648. case 2: return func.call(thisArg, args[0], args[1]);
  1649. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1650. }
  1651. return func.apply(thisArg, args);
  1652. }
  1653. /**
  1654. * A specialized version of `baseAggregator` for arrays.
  1655. *
  1656. * @private
  1657. * @param {Array} [array] The array to iterate over.
  1658. * @param {Function} setter The function to set `accumulator` values.
  1659. * @param {Function} iteratee The iteratee to transform keys.
  1660. * @param {Object} accumulator The initial aggregated object.
  1661. * @returns {Function} Returns `accumulator`.
  1662. */
  1663. function arrayAggregator(array, setter, iteratee, accumulator) {
  1664. var index = -1,
  1665. length = array == null ? 0 : array.length;
  1666. while (++index < length) {
  1667. var value = array[index];
  1668. setter(accumulator, value, iteratee(value), array);
  1669. }
  1670. return accumulator;
  1671. }
  1672. /**
  1673. * A specialized version of `_.forEach` for arrays without support for
  1674. * iteratee shorthands.
  1675. *
  1676. * @private
  1677. * @param {Array} [array] The array to iterate over.
  1678. * @param {Function} iteratee The function invoked per iteration.
  1679. * @returns {Array} Returns `array`.
  1680. */
  1681. function arrayEach(array, iteratee) {
  1682. var index = -1,
  1683. length = array == null ? 0 : array.length;
  1684. while (++index < length) {
  1685. if (iteratee(array[index], index, array) === false) {
  1686. break;
  1687. }
  1688. }
  1689. return array;
  1690. }
  1691. /**
  1692. * A specialized version of `_.forEachRight` for arrays without support for
  1693. * iteratee shorthands.
  1694. *
  1695. * @private
  1696. * @param {Array} [array] The array to iterate over.
  1697. * @param {Function} iteratee The function invoked per iteration.
  1698. * @returns {Array} Returns `array`.
  1699. */
  1700. function arrayEachRight(array, iteratee) {
  1701. var length = array == null ? 0 : array.length;
  1702. while (length--) {
  1703. if (iteratee(array[length], length, array) === false) {
  1704. break;
  1705. }
  1706. }
  1707. return array;
  1708. }
  1709. /**
  1710. * A specialized version of `_.every` for arrays without support for
  1711. * iteratee shorthands.
  1712. *
  1713. * @private
  1714. * @param {Array} [array] The array to iterate over.
  1715. * @param {Function} predicate The function invoked per iteration.
  1716. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1717. * else `false`.
  1718. */
  1719. function arrayEvery(array, predicate) {
  1720. var index = -1,
  1721. length = array == null ? 0 : array.length;
  1722. while (++index < length) {
  1723. if (!predicate(array[index], index, array)) {
  1724. return false;
  1725. }
  1726. }
  1727. return true;
  1728. }
  1729. /**
  1730. * A specialized version of `_.filter` for arrays without support for
  1731. * iteratee shorthands.
  1732. *
  1733. * @private
  1734. * @param {Array} [array] The array to iterate over.
  1735. * @param {Function} predicate The function invoked per iteration.
  1736. * @returns {Array} Returns the new filtered array.
  1737. */
  1738. function arrayFilter(array, predicate) {
  1739. var index = -1,
  1740. length = array == null ? 0 : array.length,
  1741. resIndex = 0,
  1742. result = [];
  1743. while (++index < length) {
  1744. var value = array[index];
  1745. if (predicate(value, index, array)) {
  1746. result[resIndex++] = value;
  1747. }
  1748. }
  1749. return result;
  1750. }
  1751. /**
  1752. * A specialized version of `_.includes` for arrays without support for
  1753. * specifying an index to search from.
  1754. *
  1755. * @private
  1756. * @param {Array} [array] The array to inspect.
  1757. * @param {*} target The value to search for.
  1758. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1759. */
  1760. function arrayIncludes(array, value) {
  1761. var length = array == null ? 0 : array.length;
  1762. return !!length && baseIndexOf(array, value, 0) > -1;
  1763. }
  1764. /**
  1765. * This function is like `arrayIncludes` except that it accepts a comparator.
  1766. *
  1767. * @private
  1768. * @param {Array} [array] The array to inspect.
  1769. * @param {*} target The value to search for.
  1770. * @param {Function} comparator The comparator invoked per element.
  1771. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1772. */
  1773. function arrayIncludesWith(array, value, comparator) {
  1774. var index = -1,
  1775. length = array == null ? 0 : array.length;
  1776. while (++index < length) {
  1777. if (comparator(value, array[index])) {
  1778. return true;
  1779. }
  1780. }
  1781. return false;
  1782. }
  1783. /**
  1784. * A specialized version of `_.map` for arrays without support for iteratee
  1785. * shorthands.
  1786. *
  1787. * @private
  1788. * @param {Array} [array] The array to iterate over.
  1789. * @param {Function} iteratee The function invoked per iteration.
  1790. * @returns {Array} Returns the new mapped array.
  1791. */
  1792. function arrayMap(array, iteratee) {
  1793. var index = -1,
  1794. length = array == null ? 0 : array.length,
  1795. result = Array(length);
  1796. while (++index < length) {
  1797. result[index] = iteratee(array[index], index, array);
  1798. }
  1799. return result;
  1800. }
  1801. /**
  1802. * Appends the elements of `values` to `array`.
  1803. *
  1804. * @private
  1805. * @param {Array} array The array to modify.
  1806. * @param {Array} values The values to append.
  1807. * @returns {Array} Returns `array`.
  1808. */
  1809. function arrayPush(array, values) {
  1810. var index = -1,
  1811. length = values.length,
  1812. offset = array.length;
  1813. while (++index < length) {
  1814. array[offset + index] = values[index];
  1815. }
  1816. return array;
  1817. }
  1818. /**
  1819. * A specialized version of `_.reduce` for arrays without support for
  1820. * iteratee shorthands.
  1821. *
  1822. * @private
  1823. * @param {Array} [array] The array to iterate over.
  1824. * @param {Function} iteratee The function invoked per iteration.
  1825. * @param {*} [accumulator] The initial value.
  1826. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1827. * the initial value.
  1828. * @returns {*} Returns the accumulated value.
  1829. */
  1830. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1831. var index = -1,
  1832. length = array == null ? 0 : array.length;
  1833. if (initAccum && length) {
  1834. accumulator = array[++index];
  1835. }
  1836. while (++index < length) {
  1837. accumulator = iteratee(accumulator, array[index], index, array);
  1838. }
  1839. return accumulator;
  1840. }
  1841. /**
  1842. * A specialized version of `_.reduceRight` for arrays without support for
  1843. * iteratee shorthands.
  1844. *
  1845. * @private
  1846. * @param {Array} [array] The array to iterate over.
  1847. * @param {Function} iteratee The function invoked per iteration.
  1848. * @param {*} [accumulator] The initial value.
  1849. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1850. * the initial value.
  1851. * @returns {*} Returns the accumulated value.
  1852. */
  1853. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1854. var length = array == null ? 0 : array.length;
  1855. if (initAccum && length) {
  1856. accumulator = array[--length];
  1857. }
  1858. while (length--) {
  1859. accumulator = iteratee(accumulator, array[length], length, array);
  1860. }
  1861. return accumulator;
  1862. }
  1863. /**
  1864. * A specialized version of `_.some` for arrays without support for iteratee
  1865. * shorthands.
  1866. *
  1867. * @private
  1868. * @param {Array} [array] The array to iterate over.
  1869. * @param {Function} predicate The function invoked per iteration.
  1870. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1871. * else `false`.
  1872. */
  1873. function arraySome(array, predicate) {
  1874. var index = -1,
  1875. length = array == null ? 0 : array.length;
  1876. while (++index < length) {
  1877. if (predicate(array[index], index, array)) {
  1878. return true;
  1879. }
  1880. }
  1881. return false;
  1882. }
  1883. /**
  1884. * Gets the size of an ASCII `string`.
  1885. *
  1886. * @private
  1887. * @param {string} string The string inspect.
  1888. * @returns {number} Returns the string size.
  1889. */
  1890. var asciiSize = baseProperty('length');
  1891. /**
  1892. * Converts an ASCII `string` to an array.
  1893. *
  1894. * @private
  1895. * @param {string} string The string to convert.
  1896. * @returns {Array} Returns the converted array.
  1897. */
  1898. function asciiToArray(string) {
  1899. return string.split('');
  1900. }
  1901. /**
  1902. * Splits an ASCII `string` into an array of its words.
  1903. *
  1904. * @private
  1905. * @param {string} The string to inspect.
  1906. * @returns {Array} Returns the words of `string`.
  1907. */
  1908. function asciiWords(string) {
  1909. return string.match(reAsciiWord) || [];
  1910. }
  1911. /**
  1912. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1913. * without support for iteratee shorthands, which iterates over `collection`
  1914. * using `eachFunc`.
  1915. *
  1916. * @private
  1917. * @param {Array|Object} collection The collection to inspect.
  1918. * @param {Function} predicate The function invoked per iteration.
  1919. * @param {Function} eachFunc The function to iterate over `collection`.
  1920. * @returns {*} Returns the found element or its key, else `undefined`.
  1921. */
  1922. function baseFindKey(collection, predicate, eachFunc) {
  1923. var result;
  1924. eachFunc(collection, function(value, key, collection) {
  1925. if (predicate(value, key, collection)) {
  1926. result = key;
  1927. return false;
  1928. }
  1929. });
  1930. return result;
  1931. }
  1932. /**
  1933. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1934. * support for iteratee shorthands.
  1935. *
  1936. * @private
  1937. * @param {Array} array The array to inspect.
  1938. * @param {Function} predicate The function invoked per iteration.
  1939. * @param {number} fromIndex The index to search from.
  1940. * @param {boolean} [fromRight] Specify iterating from right to left.
  1941. * @returns {number} Returns the index of the matched value, else `-1`.
  1942. */
  1943. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1944. var length = array.length,
  1945. index = fromIndex + (fromRight ? 1 : -1);
  1946. while ((fromRight ? index-- : ++index < length)) {
  1947. if (predicate(array[index], index, array)) {
  1948. return index;
  1949. }
  1950. }
  1951. return -1;
  1952. }
  1953. /**
  1954. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1955. *
  1956. * @private
  1957. * @param {Array} array The array to inspect.
  1958. * @param {*} value The value to search for.
  1959. * @param {number} fromIndex The index to search from.
  1960. * @returns {number} Returns the index of the matched value, else `-1`.
  1961. */
  1962. function baseIndexOf(array, value, fromIndex) {
  1963. return value === value
  1964. ? strictIndexOf(array, value, fromIndex)
  1965. : baseFindIndex(array, baseIsNaN, fromIndex);
  1966. }
  1967. /**
  1968. * This function is like `baseIndexOf` except that it accepts a comparator.
  1969. *
  1970. * @private
  1971. * @param {Array} array The array to inspect.
  1972. * @param {*} value The value to search for.
  1973. * @param {number} fromIndex The index to search from.
  1974. * @param {Function} comparator The comparator invoked per element.
  1975. * @returns {number} Returns the index of the matched value, else `-1`.
  1976. */
  1977. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1978. var index = fromIndex - 1,
  1979. length = array.length;
  1980. while (++index < length) {
  1981. if (comparator(array[index], value)) {
  1982. return index;
  1983. }
  1984. }
  1985. return -1;
  1986. }
  1987. /**
  1988. * The base implementation of `_.isNaN` without support for number objects.
  1989. *
  1990. * @private
  1991. * @param {*} value The value to check.
  1992. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1993. */
  1994. function baseIsNaN(value) {
  1995. return value !== value;
  1996. }
  1997. /**
  1998. * The base implementation of `_.mean` and `_.meanBy` without support for
  1999. * iteratee shorthands.
  2000. *
  2001. * @private
  2002. * @param {Array} array The array to iterate over.
  2003. * @param {Function} iteratee The function invoked per iteration.
  2004. * @returns {number} Returns the mean.
  2005. */
  2006. function baseMean(array, iteratee) {
  2007. var length = array == null ? 0 : array.length;
  2008. return length ? (baseSum(array, iteratee) / length) : NAN;
  2009. }
  2010. /**
  2011. * The base implementation of `_.property` without support for deep paths.
  2012. *
  2013. * @private
  2014. * @param {string} key The key of the property to get.
  2015. * @returns {Function} Returns the new accessor function.
  2016. */
  2017. function baseProperty(key) {
  2018. return function(object) {
  2019. return object == null ? undefined : object[key];
  2020. };
  2021. }
  2022. /**
  2023. * The base implementation of `_.propertyOf` without support for deep paths.
  2024. *
  2025. * @private
  2026. * @param {Object} object The object to query.
  2027. * @returns {Function} Returns the new accessor function.
  2028. */
  2029. function basePropertyOf(object) {
  2030. return function(key) {
  2031. return object == null ? undefined : object[key];
  2032. };
  2033. }
  2034. /**
  2035. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2036. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2037. *
  2038. * @private
  2039. * @param {Array|Object} collection The collection to iterate over.
  2040. * @param {Function} iteratee The function invoked per iteration.
  2041. * @param {*} accumulator The initial value.
  2042. * @param {boolean} initAccum Specify using the first or last element of
  2043. * `collection` as the initial value.
  2044. * @param {Function} eachFunc The function to iterate over `collection`.
  2045. * @returns {*} Returns the accumulated value.
  2046. */
  2047. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2048. eachFunc(collection, function(value, index, collection) {
  2049. accumulator = initAccum
  2050. ? (initAccum = false, value)
  2051. : iteratee(accumulator, value, index, collection);
  2052. });
  2053. return accumulator;
  2054. }
  2055. /**
  2056. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2057. * sort order of `array` and replaces criteria objects with their corresponding
  2058. * values.
  2059. *
  2060. * @private
  2061. * @param {Array} array The array to sort.
  2062. * @param {Function} comparer The function to define sort order.
  2063. * @returns {Array} Returns `array`.
  2064. */
  2065. function baseSortBy(array, comparer) {
  2066. var length = array.length;
  2067. array.sort(comparer);
  2068. while (length--) {
  2069. array[length] = array[length].value;
  2070. }
  2071. return array;
  2072. }
  2073. /**
  2074. * The base implementation of `_.sum` and `_.sumBy` without support for
  2075. * iteratee shorthands.
  2076. *
  2077. * @private
  2078. * @param {Array} array The array to iterate over.
  2079. * @param {Function} iteratee The function invoked per iteration.
  2080. * @returns {number} Returns the sum.
  2081. */
  2082. function baseSum(array, iteratee) {
  2083. var result,
  2084. index = -1,
  2085. length = array.length;
  2086. while (++index < length) {
  2087. var current = iteratee(array[index]);
  2088. if (current !== undefined) {
  2089. result = result === undefined ? current : (result + current);
  2090. }
  2091. }
  2092. return result;
  2093. }
  2094. /**
  2095. * The base implementation of `_.times` without support for iteratee shorthands
  2096. * or max array length checks.
  2097. *
  2098. * @private
  2099. * @param {number} n The number of times to invoke `iteratee`.
  2100. * @param {Function} iteratee The function invoked per iteration.
  2101. * @returns {Array} Returns the array of results.
  2102. */
  2103. function baseTimes(n, iteratee) {
  2104. var index = -1,
  2105. result = Array(n);
  2106. while (++index < n) {
  2107. result[index] = iteratee(index);
  2108. }
  2109. return result;
  2110. }
  2111. /**
  2112. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2113. * of key-value pairs for `object` corresponding to the property names of `props`.
  2114. *
  2115. * @private
  2116. * @param {Object} object The object to query.
  2117. * @param {Array} props The property names to get values for.
  2118. * @returns {Object} Returns the key-value pairs.
  2119. */
  2120. function baseToPairs(object, props) {
  2121. return arrayMap(props, function(key) {
  2122. return [key, object[key]];
  2123. });
  2124. }
  2125. /**
  2126. * The base implementation of `_.trim`.
  2127. *
  2128. * @private
  2129. * @param {string} string The string to trim.
  2130. * @returns {string} Returns the trimmed string.
  2131. */
  2132. function baseTrim(string) {
  2133. return string
  2134. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2135. : string;
  2136. }
  2137. /**
  2138. * The base implementation of `_.unary` without support for storing metadata.
  2139. *
  2140. * @private
  2141. * @param {Function} func The function to cap arguments for.
  2142. * @returns {Function} Returns the new capped function.
  2143. */
  2144. function baseUnary(func) {
  2145. return function(value) {
  2146. return func(value);
  2147. };
  2148. }
  2149. /**
  2150. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2151. * array of `object` property values corresponding to the property names
  2152. * of `props`.
  2153. *
  2154. * @private
  2155. * @param {Object} object The object to query.
  2156. * @param {Array} props The property names to get values for.
  2157. * @returns {Object} Returns the array of property values.
  2158. */
  2159. function baseValues(object, props) {
  2160. return arrayMap(props, function(key) {
  2161. return object[key];
  2162. });
  2163. }
  2164. /**
  2165. * Checks if a `cache` value for `key` exists.
  2166. *
  2167. * @private
  2168. * @param {Object} cache The cache to query.
  2169. * @param {string} key The key of the entry to check.
  2170. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2171. */
  2172. function cacheHas(cache, key) {
  2173. return cache.has(key);
  2174. }
  2175. /**
  2176. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2177. * that is not found in the character symbols.
  2178. *
  2179. * @private
  2180. * @param {Array} strSymbols The string symbols to inspect.
  2181. * @param {Array} chrSymbols The character symbols to find.
  2182. * @returns {number} Returns the index of the first unmatched string symbol.
  2183. */
  2184. function charsStartIndex(strSymbols, chrSymbols) {
  2185. var index = -1,
  2186. length = strSymbols.length;
  2187. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2188. return index;
  2189. }
  2190. /**
  2191. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2192. * that is not found in the character symbols.
  2193. *
  2194. * @private
  2195. * @param {Array} strSymbols The string symbols to inspect.
  2196. * @param {Array} chrSymbols The character symbols to find.
  2197. * @returns {number} Returns the index of the last unmatched string symbol.
  2198. */
  2199. function charsEndIndex(strSymbols, chrSymbols) {
  2200. var index = strSymbols.length;
  2201. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2202. return index;
  2203. }
  2204. /**
  2205. * Gets the number of `placeholder` occurrences in `array`.
  2206. *
  2207. * @private
  2208. * @param {Array} array The array to inspect.
  2209. * @param {*} placeholder The placeholder to search for.
  2210. * @returns {number} Returns the placeholder count.
  2211. */
  2212. function countHolders(array, placeholder) {
  2213. var length = array.length,
  2214. result = 0;
  2215. while (length--) {
  2216. if (array[length] === placeholder) {
  2217. ++result;
  2218. }
  2219. }
  2220. return result;
  2221. }
  2222. /**
  2223. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2224. * letters to basic Latin letters.
  2225. *
  2226. * @private
  2227. * @param {string} letter The matched letter to deburr.
  2228. * @returns {string} Returns the deburred letter.
  2229. */
  2230. var deburrLetter = basePropertyOf(deburredLetters);
  2231. /**
  2232. * Used by `_.escape` to convert characters to HTML entities.
  2233. *
  2234. * @private
  2235. * @param {string} chr The matched character to escape.
  2236. * @returns {string} Returns the escaped character.
  2237. */
  2238. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2239. /**
  2240. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2241. *
  2242. * @private
  2243. * @param {string} chr The matched character to escape.
  2244. * @returns {string} Returns the escaped character.
  2245. */
  2246. function escapeStringChar(chr) {
  2247. return '\\' + stringEscapes[chr];
  2248. }
  2249. /**
  2250. * Gets the value at `key` of `object`.
  2251. *
  2252. * @private
  2253. * @param {Object} [object] The object to query.
  2254. * @param {string} key The key of the property to get.
  2255. * @returns {*} Returns the property value.
  2256. */
  2257. function getValue(object, key) {
  2258. return object == null ? undefined : object[key];
  2259. }
  2260. /**
  2261. * Checks if `string` contains Unicode symbols.
  2262. *
  2263. * @private
  2264. * @param {string} string The string to inspect.
  2265. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2266. */
  2267. function hasUnicode(string) {
  2268. return reHasUnicode.test(string);
  2269. }
  2270. /**
  2271. * Checks if `string` contains a word composed of Unicode symbols.
  2272. *
  2273. * @private
  2274. * @param {string} string The string to inspect.
  2275. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2276. */
  2277. function hasUnicodeWord(string) {
  2278. return reHasUnicodeWord.test(string);
  2279. }
  2280. /**
  2281. * Converts `iterator` to an array.
  2282. *
  2283. * @private
  2284. * @param {Object} iterator The iterator to convert.
  2285. * @returns {Array} Returns the converted array.
  2286. */
  2287. function iteratorToArray(iterator) {
  2288. var data,
  2289. result = [];
  2290. while (!(data = iterator.next()).done) {
  2291. result.push(data.value);
  2292. }
  2293. return result;
  2294. }
  2295. /**
  2296. * Converts `map` to its key-value pairs.
  2297. *
  2298. * @private
  2299. * @param {Object} map The map to convert.
  2300. * @returns {Array} Returns the key-value pairs.
  2301. */
  2302. function mapToArray(map) {
  2303. var index = -1,
  2304. result = Array(map.size);
  2305. map.forEach(function(value, key) {
  2306. result[++index] = [key, value];
  2307. });
  2308. return result;
  2309. }
  2310. /**
  2311. * Creates a unary function that invokes `func` with its argument transformed.
  2312. *
  2313. * @private
  2314. * @param {Function} func The function to wrap.
  2315. * @param {Function} transform The argument transform.
  2316. * @returns {Function} Returns the new function.
  2317. */
  2318. function overArg(func, transform) {
  2319. return function(arg) {
  2320. return func(transform(arg));
  2321. };
  2322. }
  2323. /**
  2324. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2325. * and returns an array of their indexes.
  2326. *
  2327. * @private
  2328. * @param {Array} array The array to modify.
  2329. * @param {*} placeholder The placeholder to replace.
  2330. * @returns {Array} Returns the new array of placeholder indexes.
  2331. */
  2332. function replaceHolders(array, placeholder) {
  2333. var index = -1,
  2334. length = array.length,
  2335. resIndex = 0,
  2336. result = [];
  2337. while (++index < length) {
  2338. var value = array[index];
  2339. if (value === placeholder || value === PLACEHOLDER) {
  2340. array[index] = PLACEHOLDER;
  2341. result[resIndex++] = index;
  2342. }
  2343. }
  2344. return result;
  2345. }
  2346. /**
  2347. * Converts `set` to an array of its values.
  2348. *
  2349. * @private
  2350. * @param {Object} set The set to convert.
  2351. * @returns {Array} Returns the values.
  2352. */
  2353. function setToArray(set) {
  2354. var index = -1,
  2355. result = Array(set.size);
  2356. set.forEach(function(value) {
  2357. result[++index] = value;
  2358. });
  2359. return result;
  2360. }
  2361. /**
  2362. * Converts `set` to its value-value pairs.
  2363. *
  2364. * @private
  2365. * @param {Object} set The set to convert.
  2366. * @returns {Array} Returns the value-value pairs.
  2367. */
  2368. function setToPairs(set) {
  2369. var index = -1,
  2370. result = Array(set.size);
  2371. set.forEach(function(value) {
  2372. result[++index] = [value, value];
  2373. });
  2374. return result;
  2375. }
  2376. /**
  2377. * A specialized version of `_.indexOf` which performs strict equality
  2378. * comparisons of values, i.e. `===`.
  2379. *
  2380. * @private
  2381. * @param {Array} array The array to inspect.
  2382. * @param {*} value The value to search for.
  2383. * @param {number} fromIndex The index to search from.
  2384. * @returns {number} Returns the index of the matched value, else `-1`.
  2385. */
  2386. function strictIndexOf(array, value, fromIndex) {
  2387. var index = fromIndex - 1,
  2388. length = array.length;
  2389. while (++index < length) {
  2390. if (array[index] === value) {
  2391. return index;
  2392. }
  2393. }
  2394. return -1;
  2395. }
  2396. /**
  2397. * A specialized version of `_.lastIndexOf` which performs strict equality
  2398. * comparisons of values, i.e. `===`.
  2399. *
  2400. * @private
  2401. * @param {Array} array The array to inspect.
  2402. * @param {*} value The value to search for.
  2403. * @param {number} fromIndex The index to search from.
  2404. * @returns {number} Returns the index of the matched value, else `-1`.
  2405. */
  2406. function strictLastIndexOf(array, value, fromIndex) {
  2407. var index = fromIndex + 1;
  2408. while (index--) {
  2409. if (array[index] === value) {
  2410. return index;
  2411. }
  2412. }
  2413. return index;
  2414. }
  2415. /**
  2416. * Gets the number of symbols in `string`.
  2417. *
  2418. * @private
  2419. * @param {string} string The string to inspect.
  2420. * @returns {number} Returns the string size.
  2421. */
  2422. function stringSize(string) {
  2423. return hasUnicode(string)
  2424. ? unicodeSize(string)
  2425. : asciiSize(string);
  2426. }
  2427. /**
  2428. * Converts `string` to an array.
  2429. *
  2430. * @private
  2431. * @param {string} string The string to convert.
  2432. * @returns {Array} Returns the converted array.
  2433. */
  2434. function stringToArray(string) {
  2435. return hasUnicode(string)
  2436. ? unicodeToArray(string)
  2437. : asciiToArray(string);
  2438. }
  2439. /**
  2440. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2441. * character of `string`.
  2442. *
  2443. * @private
  2444. * @param {string} string The string to inspect.
  2445. * @returns {number} Returns the index of the last non-whitespace character.
  2446. */
  2447. function trimmedEndIndex(string) {
  2448. var index = string.length;
  2449. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2450. return index;
  2451. }
  2452. /**
  2453. * Used by `_.unescape` to convert HTML entities to characters.
  2454. *
  2455. * @private
  2456. * @param {string} chr The matched character to unescape.
  2457. * @returns {string} Returns the unescaped character.
  2458. */
  2459. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2460. /**
  2461. * Gets the size of a Unicode `string`.
  2462. *
  2463. * @private
  2464. * @param {string} string The string inspect.
  2465. * @returns {number} Returns the string size.
  2466. */
  2467. function unicodeSize(string) {
  2468. var result = reUnicode.lastIndex = 0;
  2469. while (reUnicode.test(string)) {
  2470. ++result;
  2471. }
  2472. return result;
  2473. }
  2474. /**
  2475. * Converts a Unicode `string` to an array.
  2476. *
  2477. * @private
  2478. * @param {string} string The string to convert.
  2479. * @returns {Array} Returns the converted array.
  2480. */
  2481. function unicodeToArray(string) {
  2482. return string.match(reUnicode) || [];
  2483. }
  2484. /**
  2485. * Splits a Unicode `string` into an array of its words.
  2486. *
  2487. * @private
  2488. * @param {string} The string to inspect.
  2489. * @returns {Array} Returns the words of `string`.
  2490. */
  2491. function unicodeWords(string) {
  2492. return string.match(reUnicodeWord) || [];
  2493. }
  2494. /*--------------------------------------------------------------------------*/
  2495. /**
  2496. * Create a new pristine `lodash` function using the `context` object.
  2497. *
  2498. * @static
  2499. * @memberOf _
  2500. * @since 1.1.0
  2501. * @category Util
  2502. * @param {Object} [context=root] The context object.
  2503. * @returns {Function} Returns a new `lodash` function.
  2504. * @example
  2505. *
  2506. * _.mixin({ 'foo': _.constant('foo') });
  2507. *
  2508. * var lodash = _.runInContext();
  2509. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2510. *
  2511. * _.isFunction(_.foo);
  2512. * // => true
  2513. * _.isFunction(_.bar);
  2514. * // => false
  2515. *
  2516. * lodash.isFunction(lodash.foo);
  2517. * // => false
  2518. * lodash.isFunction(lodash.bar);
  2519. * // => true
  2520. *
  2521. * // Create a suped-up `defer` in Node.js.
  2522. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2523. */
  2524. var runInContext = (function runInContext(context) {
  2525. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2526. /** Built-in constructor references. */
  2527. var Array = context.Array,
  2528. Date = context.Date,
  2529. Error = context.Error,
  2530. Function = context.Function,
  2531. Math = context.Math,
  2532. Object = context.Object,
  2533. RegExp = context.RegExp,
  2534. String = context.String,
  2535. TypeError = context.TypeError;
  2536. /** Used for built-in method references. */
  2537. var arrayProto = Array.prototype,
  2538. funcProto = Function.prototype,
  2539. objectProto = Object.prototype;
  2540. /** Used to detect overreaching core-js shims. */
  2541. var coreJsData = context['__core-js_shared__'];
  2542. /** Used to resolve the decompiled source of functions. */
  2543. var funcToString = funcProto.toString;
  2544. /** Used to check objects for own properties. */
  2545. var hasOwnProperty = objectProto.hasOwnProperty;
  2546. /** Used to generate unique IDs. */
  2547. var idCounter = 0;
  2548. /** Used to detect methods masquerading as native. */
  2549. var maskSrcKey = (function() {
  2550. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2551. return uid ? ('Symbol(src)_1.' + uid) : '';
  2552. }());
  2553. /**
  2554. * Used to resolve the
  2555. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2556. * of values.
  2557. */
  2558. var nativeObjectToString = objectProto.toString;
  2559. /** Used to infer the `Object` constructor. */
  2560. var objectCtorString = funcToString.call(Object);
  2561. /** Used to restore the original `_` reference in `_.noConflict`. */
  2562. var oldDash = root._;
  2563. /** Used to detect if a method is native. */
  2564. var reIsNative = RegExp('^' +
  2565. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2566. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2567. );
  2568. /** Built-in value references. */
  2569. var Buffer = moduleExports ? context.Buffer : undefined,
  2570. Symbol = context.Symbol,
  2571. Uint8Array = context.Uint8Array,
  2572. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2573. getPrototype = overArg(Object.getPrototypeOf, Object),
  2574. objectCreate = Object.create,
  2575. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2576. splice = arrayProto.splice,
  2577. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2578. symIterator = Symbol ? Symbol.iterator : undefined,
  2579. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2580. var defineProperty = (function() {
  2581. try {
  2582. var func = getNative(Object, 'defineProperty');
  2583. func({}, '', {});
  2584. return func;
  2585. } catch (e) {}
  2586. }());
  2587. /** Mocked built-ins. */
  2588. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2589. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2590. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2591. /* Built-in method references for those with the same name as other `lodash` methods. */
  2592. var nativeCeil = Math.ceil,
  2593. nativeFloor = Math.floor,
  2594. nativeGetSymbols = Object.getOwnPropertySymbols,
  2595. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2596. nativeIsFinite = context.isFinite,
  2597. nativeJoin = arrayProto.join,
  2598. nativeKeys = overArg(Object.keys, Object),
  2599. nativeMax = Math.max,
  2600. nativeMin = Math.min,
  2601. nativeNow = Date.now,
  2602. nativeParseInt = context.parseInt,
  2603. nativeRandom = Math.random,
  2604. nativeReverse = arrayProto.reverse;
  2605. /* Built-in method references that are verified to be native. */
  2606. var DataView = getNative(context, 'DataView'),
  2607. Map = getNative(context, 'Map'),
  2608. Promise = getNative(context, 'Promise'),
  2609. Set = getNative(context, 'Set'),
  2610. WeakMap = getNative(context, 'WeakMap'),
  2611. nativeCreate = getNative(Object, 'create');
  2612. /** Used to store function metadata. */
  2613. var metaMap = WeakMap && new WeakMap;
  2614. /** Used to lookup unminified function names. */
  2615. var realNames = {};
  2616. /** Used to detect maps, sets, and weakmaps. */
  2617. var dataViewCtorString = toSource(DataView),
  2618. mapCtorString = toSource(Map),
  2619. promiseCtorString = toSource(Promise),
  2620. setCtorString = toSource(Set),
  2621. weakMapCtorString = toSource(WeakMap);
  2622. /** Used to convert symbols to primitives and strings. */
  2623. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2624. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2625. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2626. /*------------------------------------------------------------------------*/
  2627. /**
  2628. * Creates a `lodash` object which wraps `value` to enable implicit method
  2629. * chain sequences. Methods that operate on and return arrays, collections,
  2630. * and functions can be chained together. Methods that retrieve a single value
  2631. * or may return a primitive value will automatically end the chain sequence
  2632. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2633. * with `_#value`.
  2634. *
  2635. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2636. * enabled using `_.chain`.
  2637. *
  2638. * The execution of chained methods is lazy, that is, it's deferred until
  2639. * `_#value` is implicitly or explicitly called.
  2640. *
  2641. * Lazy evaluation allows several methods to support shortcut fusion.
  2642. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2643. * the creation of intermediate arrays and can greatly reduce the number of
  2644. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2645. * fusion if the section is applied to an array and iteratees accept only
  2646. * one argument. The heuristic for whether a section qualifies for shortcut
  2647. * fusion is subject to change.
  2648. *
  2649. * Chaining is supported in custom builds as long as the `_#value` method is
  2650. * directly or indirectly included in the build.
  2651. *
  2652. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2653. *
  2654. * The wrapper `Array` methods are:
  2655. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2656. *
  2657. * The wrapper `String` methods are:
  2658. * `replace` and `split`
  2659. *
  2660. * The wrapper methods that support shortcut fusion are:
  2661. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2662. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2663. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2664. *
  2665. * The chainable wrapper methods are:
  2666. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2667. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2668. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2669. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2670. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2671. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2672. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2673. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2674. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2675. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2676. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2677. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2678. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2679. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2680. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2681. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2682. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2683. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2684. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2685. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2686. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2687. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2688. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2689. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2690. *
  2691. * The wrapper methods that are **not** chainable by default are:
  2692. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2693. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2694. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2695. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2696. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2697. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2698. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2699. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2700. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2701. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2702. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2703. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2704. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2705. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2706. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2707. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2708. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2709. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2710. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2711. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2712. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2713. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2714. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2715. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2716. * `upperFirst`, `value`, and `words`
  2717. *
  2718. * @name _
  2719. * @constructor
  2720. * @category Seq
  2721. * @param {*} value The value to wrap in a `lodash` instance.
  2722. * @returns {Object} Returns the new `lodash` wrapper instance.
  2723. * @example
  2724. *
  2725. * function square(n) {
  2726. * return n * n;
  2727. * }
  2728. *
  2729. * var wrapped = _([1, 2, 3]);
  2730. *
  2731. * // Returns an unwrapped value.
  2732. * wrapped.reduce(_.add);
  2733. * // => 6
  2734. *
  2735. * // Returns a wrapped value.
  2736. * var squares = wrapped.map(square);
  2737. *
  2738. * _.isArray(squares);
  2739. * // => false
  2740. *
  2741. * _.isArray(squares.value());
  2742. * // => true
  2743. */
  2744. function lodash(value) {
  2745. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2746. if (value instanceof LodashWrapper) {
  2747. return value;
  2748. }
  2749. if (hasOwnProperty.call(value, '__wrapped__')) {
  2750. return wrapperClone(value);
  2751. }
  2752. }
  2753. return new LodashWrapper(value);
  2754. }
  2755. /**
  2756. * The base implementation of `_.create` without support for assigning
  2757. * properties to the created object.
  2758. *
  2759. * @private
  2760. * @param {Object} proto The object to inherit from.
  2761. * @returns {Object} Returns the new object.
  2762. */
  2763. var baseCreate = (function() {
  2764. function object() {}
  2765. return function(proto) {
  2766. if (!isObject(proto)) {
  2767. return {};
  2768. }
  2769. if (objectCreate) {
  2770. return objectCreate(proto);
  2771. }
  2772. object.prototype = proto;
  2773. var result = new object;
  2774. object.prototype = undefined;
  2775. return result;
  2776. };
  2777. }());
  2778. /**
  2779. * The function whose prototype chain sequence wrappers inherit from.
  2780. *
  2781. * @private
  2782. */
  2783. function baseLodash() {
  2784. // No operation performed.
  2785. }
  2786. /**
  2787. * The base constructor for creating `lodash` wrapper objects.
  2788. *
  2789. * @private
  2790. * @param {*} value The value to wrap.
  2791. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2792. */
  2793. function LodashWrapper(value, chainAll) {
  2794. this.__wrapped__ = value;
  2795. this.__actions__ = [];
  2796. this.__chain__ = !!chainAll;
  2797. this.__index__ = 0;
  2798. this.__values__ = undefined;
  2799. }
  2800. /**
  2801. * By default, the template delimiters used by lodash are like those in
  2802. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2803. * following template settings to use alternative delimiters.
  2804. *
  2805. * @static
  2806. * @memberOf _
  2807. * @type {Object}
  2808. */
  2809. lodash.templateSettings = {
  2810. /**
  2811. * Used to detect `data` property values to be HTML-escaped.
  2812. *
  2813. * @memberOf _.templateSettings
  2814. * @type {RegExp}
  2815. */
  2816. 'escape': reEscape,
  2817. /**
  2818. * Used to detect code to be evaluated.
  2819. *
  2820. * @memberOf _.templateSettings
  2821. * @type {RegExp}
  2822. */
  2823. 'evaluate': reEvaluate,
  2824. /**
  2825. * Used to detect `data` property values to inject.
  2826. *
  2827. * @memberOf _.templateSettings
  2828. * @type {RegExp}
  2829. */
  2830. 'interpolate': reInterpolate,
  2831. /**
  2832. * Used to reference the data object in the template text.
  2833. *
  2834. * @memberOf _.templateSettings
  2835. * @type {string}
  2836. */
  2837. 'variable': '',
  2838. /**
  2839. * Used to import variables into the compiled template.
  2840. *
  2841. * @memberOf _.templateSettings
  2842. * @type {Object}
  2843. */
  2844. 'imports': {
  2845. /**
  2846. * A reference to the `lodash` function.
  2847. *
  2848. * @memberOf _.templateSettings.imports
  2849. * @type {Function}
  2850. */
  2851. '_': lodash
  2852. }
  2853. };
  2854. // Ensure wrappers are instances of `baseLodash`.
  2855. lodash.prototype = baseLodash.prototype;
  2856. lodash.prototype.constructor = lodash;
  2857. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2858. LodashWrapper.prototype.constructor = LodashWrapper;
  2859. /*------------------------------------------------------------------------*/
  2860. /**
  2861. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2862. *
  2863. * @private
  2864. * @constructor
  2865. * @param {*} value The value to wrap.
  2866. */
  2867. function LazyWrapper(value) {
  2868. this.__wrapped__ = value;
  2869. this.__actions__ = [];
  2870. this.__dir__ = 1;
  2871. this.__filtered__ = false;
  2872. this.__iteratees__ = [];
  2873. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2874. this.__views__ = [];
  2875. }
  2876. /**
  2877. * Creates a clone of the lazy wrapper object.
  2878. *
  2879. * @private
  2880. * @name clone
  2881. * @memberOf LazyWrapper
  2882. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2883. */
  2884. function lazyClone() {
  2885. var result = new LazyWrapper(this.__wrapped__);
  2886. result.__actions__ = copyArray(this.__actions__);
  2887. result.__dir__ = this.__dir__;
  2888. result.__filtered__ = this.__filtered__;
  2889. result.__iteratees__ = copyArray(this.__iteratees__);
  2890. result.__takeCount__ = this.__takeCount__;
  2891. result.__views__ = copyArray(this.__views__);
  2892. return result;
  2893. }
  2894. /**
  2895. * Reverses the direction of lazy iteration.
  2896. *
  2897. * @private
  2898. * @name reverse
  2899. * @memberOf LazyWrapper
  2900. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2901. */
  2902. function lazyReverse() {
  2903. if (this.__filtered__) {
  2904. var result = new LazyWrapper(this);
  2905. result.__dir__ = -1;
  2906. result.__filtered__ = true;
  2907. } else {
  2908. result = this.clone();
  2909. result.__dir__ *= -1;
  2910. }
  2911. return result;
  2912. }
  2913. /**
  2914. * Extracts the unwrapped value from its lazy wrapper.
  2915. *
  2916. * @private
  2917. * @name value
  2918. * @memberOf LazyWrapper
  2919. * @returns {*} Returns the unwrapped value.
  2920. */
  2921. function lazyValue() {
  2922. var array = this.__wrapped__.value(),
  2923. dir = this.__dir__,
  2924. isArr = isArray(array),
  2925. isRight = dir < 0,
  2926. arrLength = isArr ? array.length : 0,
  2927. view = getView(0, arrLength, this.__views__),
  2928. start = view.start,
  2929. end = view.end,
  2930. length = end - start,
  2931. index = isRight ? end : (start - 1),
  2932. iteratees = this.__iteratees__,
  2933. iterLength = iteratees.length,
  2934. resIndex = 0,
  2935. takeCount = nativeMin(length, this.__takeCount__);
  2936. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2937. return baseWrapperValue(array, this.__actions__);
  2938. }
  2939. var result = [];
  2940. outer:
  2941. while (length-- && resIndex < takeCount) {
  2942. index += dir;
  2943. var iterIndex = -1,
  2944. value = array[index];
  2945. while (++iterIndex < iterLength) {
  2946. var data = iteratees[iterIndex],
  2947. iteratee = data.iteratee,
  2948. type = data.type,
  2949. computed = iteratee(value);
  2950. if (type == LAZY_MAP_FLAG) {
  2951. value = computed;
  2952. } else if (!computed) {
  2953. if (type == LAZY_FILTER_FLAG) {
  2954. continue outer;
  2955. } else {
  2956. break outer;
  2957. }
  2958. }
  2959. }
  2960. result[resIndex++] = value;
  2961. }
  2962. return result;
  2963. }
  2964. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2965. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2966. LazyWrapper.prototype.constructor = LazyWrapper;
  2967. /*------------------------------------------------------------------------*/
  2968. /**
  2969. * Creates a hash object.
  2970. *
  2971. * @private
  2972. * @constructor
  2973. * @param {Array} [entries] The key-value pairs to cache.
  2974. */
  2975. function Hash(entries) {
  2976. var index = -1,
  2977. length = entries == null ? 0 : entries.length;
  2978. this.clear();
  2979. while (++index < length) {
  2980. var entry = entries[index];
  2981. this.set(entry[0], entry[1]);
  2982. }
  2983. }
  2984. /**
  2985. * Removes all key-value entries from the hash.
  2986. *
  2987. * @private
  2988. * @name clear
  2989. * @memberOf Hash
  2990. */
  2991. function hashClear() {
  2992. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2993. this.size = 0;
  2994. }
  2995. /**
  2996. * Removes `key` and its value from the hash.
  2997. *
  2998. * @private
  2999. * @name delete
  3000. * @memberOf Hash
  3001. * @param {Object} hash The hash to modify.
  3002. * @param {string} key The key of the value to remove.
  3003. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3004. */
  3005. function hashDelete(key) {
  3006. var result = this.has(key) && delete this.__data__[key];
  3007. this.size -= result ? 1 : 0;
  3008. return result;
  3009. }
  3010. /**
  3011. * Gets the hash value for `key`.
  3012. *
  3013. * @private
  3014. * @name get
  3015. * @memberOf Hash
  3016. * @param {string} key The key of the value to get.
  3017. * @returns {*} Returns the entry value.
  3018. */
  3019. function hashGet(key) {
  3020. var data = this.__data__;
  3021. if (nativeCreate) {
  3022. var result = data[key];
  3023. return result === HASH_UNDEFINED ? undefined : result;
  3024. }
  3025. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3026. }
  3027. /**
  3028. * Checks if a hash value for `key` exists.
  3029. *
  3030. * @private
  3031. * @name has
  3032. * @memberOf Hash
  3033. * @param {string} key The key of the entry to check.
  3034. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3035. */
  3036. function hashHas(key) {
  3037. var data = this.__data__;
  3038. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3039. }
  3040. /**
  3041. * Sets the hash `key` to `value`.
  3042. *
  3043. * @private
  3044. * @name set
  3045. * @memberOf Hash
  3046. * @param {string} key The key of the value to set.
  3047. * @param {*} value The value to set.
  3048. * @returns {Object} Returns the hash instance.
  3049. */
  3050. function hashSet(key, value) {
  3051. var data = this.__data__;
  3052. this.size += this.has(key) ? 0 : 1;
  3053. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3054. return this;
  3055. }
  3056. // Add methods to `Hash`.
  3057. Hash.prototype.clear = hashClear;
  3058. Hash.prototype['delete'] = hashDelete;
  3059. Hash.prototype.get = hashGet;
  3060. Hash.prototype.has = hashHas;
  3061. Hash.prototype.set = hashSet;
  3062. /*------------------------------------------------------------------------*/
  3063. /**
  3064. * Creates an list cache object.
  3065. *
  3066. * @private
  3067. * @constructor
  3068. * @param {Array} [entries] The key-value pairs to cache.
  3069. */
  3070. function ListCache(entries) {
  3071. var index = -1,
  3072. length = entries == null ? 0 : entries.length;
  3073. this.clear();
  3074. while (++index < length) {
  3075. var entry = entries[index];
  3076. this.set(entry[0], entry[1]);
  3077. }
  3078. }
  3079. /**
  3080. * Removes all key-value entries from the list cache.
  3081. *
  3082. * @private
  3083. * @name clear
  3084. * @memberOf ListCache
  3085. */
  3086. function listCacheClear() {
  3087. this.__data__ = [];
  3088. this.size = 0;
  3089. }
  3090. /**
  3091. * Removes `key` and its value from the list cache.
  3092. *
  3093. * @private
  3094. * @name delete
  3095. * @memberOf ListCache
  3096. * @param {string} key The key of the value to remove.
  3097. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3098. */
  3099. function listCacheDelete(key) {
  3100. var data = this.__data__,
  3101. index = assocIndexOf(data, key);
  3102. if (index < 0) {
  3103. return false;
  3104. }
  3105. var lastIndex = data.length - 1;
  3106. if (index == lastIndex) {
  3107. data.pop();
  3108. } else {
  3109. splice.call(data, index, 1);
  3110. }
  3111. --this.size;
  3112. return true;
  3113. }
  3114. /**
  3115. * Gets the list cache value for `key`.
  3116. *
  3117. * @private
  3118. * @name get
  3119. * @memberOf ListCache
  3120. * @param {string} key The key of the value to get.
  3121. * @returns {*} Returns the entry value.
  3122. */
  3123. function listCacheGet(key) {
  3124. var data = this.__data__,
  3125. index = assocIndexOf(data, key);
  3126. return index < 0 ? undefined : data[index][1];
  3127. }
  3128. /**
  3129. * Checks if a list cache value for `key` exists.
  3130. *
  3131. * @private
  3132. * @name has
  3133. * @memberOf ListCache
  3134. * @param {string} key The key of the entry to check.
  3135. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3136. */
  3137. function listCacheHas(key) {
  3138. return assocIndexOf(this.__data__, key) > -1;
  3139. }
  3140. /**
  3141. * Sets the list cache `key` to `value`.
  3142. *
  3143. * @private
  3144. * @name set
  3145. * @memberOf ListCache
  3146. * @param {string} key The key of the value to set.
  3147. * @param {*} value The value to set.
  3148. * @returns {Object} Returns the list cache instance.
  3149. */
  3150. function listCacheSet(key, value) {
  3151. var data = this.__data__,
  3152. index = assocIndexOf(data, key);
  3153. if (index < 0) {
  3154. ++this.size;
  3155. data.push([key, value]);
  3156. } else {
  3157. data[index][1] = value;
  3158. }
  3159. return this;
  3160. }
  3161. // Add methods to `ListCache`.
  3162. ListCache.prototype.clear = listCacheClear;
  3163. ListCache.prototype['delete'] = listCacheDelete;
  3164. ListCache.prototype.get = listCacheGet;
  3165. ListCache.prototype.has = listCacheHas;
  3166. ListCache.prototype.set = listCacheSet;
  3167. /*------------------------------------------------------------------------*/
  3168. /**
  3169. * Creates a map cache object to store key-value pairs.
  3170. *
  3171. * @private
  3172. * @constructor
  3173. * @param {Array} [entries] The key-value pairs to cache.
  3174. */
  3175. function MapCache(entries) {
  3176. var index = -1,
  3177. length = entries == null ? 0 : entries.length;
  3178. this.clear();
  3179. while (++index < length) {
  3180. var entry = entries[index];
  3181. this.set(entry[0], entry[1]);
  3182. }
  3183. }
  3184. /**
  3185. * Removes all key-value entries from the map.
  3186. *
  3187. * @private
  3188. * @name clear
  3189. * @memberOf MapCache
  3190. */
  3191. function mapCacheClear() {
  3192. this.size = 0;
  3193. this.__data__ = {
  3194. 'hash': new Hash,
  3195. 'map': new (Map || ListCache),
  3196. 'string': new Hash
  3197. };
  3198. }
  3199. /**
  3200. * Removes `key` and its value from the map.
  3201. *
  3202. * @private
  3203. * @name delete
  3204. * @memberOf MapCache
  3205. * @param {string} key The key of the value to remove.
  3206. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3207. */
  3208. function mapCacheDelete(key) {
  3209. var result = getMapData(this, key)['delete'](key);
  3210. this.size -= result ? 1 : 0;
  3211. return result;
  3212. }
  3213. /**
  3214. * Gets the map value for `key`.
  3215. *
  3216. * @private
  3217. * @name get
  3218. * @memberOf MapCache
  3219. * @param {string} key The key of the value to get.
  3220. * @returns {*} Returns the entry value.
  3221. */
  3222. function mapCacheGet(key) {
  3223. return getMapData(this, key).get(key);
  3224. }
  3225. /**
  3226. * Checks if a map value for `key` exists.
  3227. *
  3228. * @private
  3229. * @name has
  3230. * @memberOf MapCache
  3231. * @param {string} key The key of the entry to check.
  3232. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3233. */
  3234. function mapCacheHas(key) {
  3235. return getMapData(this, key).has(key);
  3236. }
  3237. /**
  3238. * Sets the map `key` to `value`.
  3239. *
  3240. * @private
  3241. * @name set
  3242. * @memberOf MapCache
  3243. * @param {string} key The key of the value to set.
  3244. * @param {*} value The value to set.
  3245. * @returns {Object} Returns the map cache instance.
  3246. */
  3247. function mapCacheSet(key, value) {
  3248. var data = getMapData(this, key),
  3249. size = data.size;
  3250. data.set(key, value);
  3251. this.size += data.size == size ? 0 : 1;
  3252. return this;
  3253. }
  3254. // Add methods to `MapCache`.
  3255. MapCache.prototype.clear = mapCacheClear;
  3256. MapCache.prototype['delete'] = mapCacheDelete;
  3257. MapCache.prototype.get = mapCacheGet;
  3258. MapCache.prototype.has = mapCacheHas;
  3259. MapCache.prototype.set = mapCacheSet;
  3260. /*------------------------------------------------------------------------*/
  3261. /**
  3262. *
  3263. * Creates an array cache object to store unique values.
  3264. *
  3265. * @private
  3266. * @constructor
  3267. * @param {Array} [values] The values to cache.
  3268. */
  3269. function SetCache(values) {
  3270. var index = -1,
  3271. length = values == null ? 0 : values.length;
  3272. this.__data__ = new MapCache;
  3273. while (++index < length) {
  3274. this.add(values[index]);
  3275. }
  3276. }
  3277. /**
  3278. * Adds `value` to the array cache.
  3279. *
  3280. * @private
  3281. * @name add
  3282. * @memberOf SetCache
  3283. * @alias push
  3284. * @param {*} value The value to cache.
  3285. * @returns {Object} Returns the cache instance.
  3286. */
  3287. function setCacheAdd(value) {
  3288. this.__data__.set(value, HASH_UNDEFINED);
  3289. return this;
  3290. }
  3291. /**
  3292. * Checks if `value` is in the array cache.
  3293. *
  3294. * @private
  3295. * @name has
  3296. * @memberOf SetCache
  3297. * @param {*} value The value to search for.
  3298. * @returns {number} Returns `true` if `value` is found, else `false`.
  3299. */
  3300. function setCacheHas(value) {
  3301. return this.__data__.has(value);
  3302. }
  3303. // Add methods to `SetCache`.
  3304. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3305. SetCache.prototype.has = setCacheHas;
  3306. /*------------------------------------------------------------------------*/
  3307. /**
  3308. * Creates a stack cache object to store key-value pairs.
  3309. *
  3310. * @private
  3311. * @constructor
  3312. * @param {Array} [entries] The key-value pairs to cache.
  3313. */
  3314. function Stack(entries) {
  3315. var data = this.__data__ = new ListCache(entries);
  3316. this.size = data.size;
  3317. }
  3318. /**
  3319. * Removes all key-value entries from the stack.
  3320. *
  3321. * @private
  3322. * @name clear
  3323. * @memberOf Stack
  3324. */
  3325. function stackClear() {
  3326. this.__data__ = new ListCache;
  3327. this.size = 0;
  3328. }
  3329. /**
  3330. * Removes `key` and its value from the stack.
  3331. *
  3332. * @private
  3333. * @name delete
  3334. * @memberOf Stack
  3335. * @param {string} key The key of the value to remove.
  3336. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3337. */
  3338. function stackDelete(key) {
  3339. var data = this.__data__,
  3340. result = data['delete'](key);
  3341. this.size = data.size;
  3342. return result;
  3343. }
  3344. /**
  3345. * Gets the stack value for `key`.
  3346. *
  3347. * @private
  3348. * @name get
  3349. * @memberOf Stack
  3350. * @param {string} key The key of the value to get.
  3351. * @returns {*} Returns the entry value.
  3352. */
  3353. function stackGet(key) {
  3354. return this.__data__.get(key);
  3355. }
  3356. /**
  3357. * Checks if a stack value for `key` exists.
  3358. *
  3359. * @private
  3360. * @name has
  3361. * @memberOf Stack
  3362. * @param {string} key The key of the entry to check.
  3363. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3364. */
  3365. function stackHas(key) {
  3366. return this.__data__.has(key);
  3367. }
  3368. /**
  3369. * Sets the stack `key` to `value`.
  3370. *
  3371. * @private
  3372. * @name set
  3373. * @memberOf Stack
  3374. * @param {string} key The key of the value to set.
  3375. * @param {*} value The value to set.
  3376. * @returns {Object} Returns the stack cache instance.
  3377. */
  3378. function stackSet(key, value) {
  3379. var data = this.__data__;
  3380. if (data instanceof ListCache) {
  3381. var pairs = data.__data__;
  3382. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3383. pairs.push([key, value]);
  3384. this.size = ++data.size;
  3385. return this;
  3386. }
  3387. data = this.__data__ = new MapCache(pairs);
  3388. }
  3389. data.set(key, value);
  3390. this.size = data.size;
  3391. return this;
  3392. }
  3393. // Add methods to `Stack`.
  3394. Stack.prototype.clear = stackClear;
  3395. Stack.prototype['delete'] = stackDelete;
  3396. Stack.prototype.get = stackGet;
  3397. Stack.prototype.has = stackHas;
  3398. Stack.prototype.set = stackSet;
  3399. /*------------------------------------------------------------------------*/
  3400. /**
  3401. * Creates an array of the enumerable property names of the array-like `value`.
  3402. *
  3403. * @private
  3404. * @param {*} value The value to query.
  3405. * @param {boolean} inherited Specify returning inherited property names.
  3406. * @returns {Array} Returns the array of property names.
  3407. */
  3408. function arrayLikeKeys(value, inherited) {
  3409. var isArr = isArray(value),
  3410. isArg = !isArr && isArguments(value),
  3411. isBuff = !isArr && !isArg && isBuffer(value),
  3412. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3413. skipIndexes = isArr || isArg || isBuff || isType,
  3414. result = skipIndexes ? baseTimes(value.length, String) : [],
  3415. length = result.length;
  3416. for (var key in value) {
  3417. if ((inherited || hasOwnProperty.call(value, key)) &&
  3418. !(skipIndexes && (
  3419. // Safari 9 has enumerable `arguments.length` in strict mode.
  3420. key == 'length' ||
  3421. // Node.js 0.10 has enumerable non-index properties on buffers.
  3422. (isBuff && (key == 'offset' || key == 'parent')) ||
  3423. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3424. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3425. // Skip index properties.
  3426. isIndex(key, length)
  3427. ))) {
  3428. result.push(key);
  3429. }
  3430. }
  3431. return result;
  3432. }
  3433. /**
  3434. * A specialized version of `_.sample` for arrays.
  3435. *
  3436. * @private
  3437. * @param {Array} array The array to sample.
  3438. * @returns {*} Returns the random element.
  3439. */
  3440. function arraySample(array) {
  3441. var length = array.length;
  3442. return length ? array[baseRandom(0, length - 1)] : undefined;
  3443. }
  3444. /**
  3445. * A specialized version of `_.sampleSize` for arrays.
  3446. *
  3447. * @private
  3448. * @param {Array} array The array to sample.
  3449. * @param {number} n The number of elements to sample.
  3450. * @returns {Array} Returns the random elements.
  3451. */
  3452. function arraySampleSize(array, n) {
  3453. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3454. }
  3455. /**
  3456. * A specialized version of `_.shuffle` for arrays.
  3457. *
  3458. * @private
  3459. * @param {Array} array The array to shuffle.
  3460. * @returns {Array} Returns the new shuffled array.
  3461. */
  3462. function arrayShuffle(array) {
  3463. return shuffleSelf(copyArray(array));
  3464. }
  3465. /**
  3466. * This function is like `assignValue` except that it doesn't assign
  3467. * `undefined` values.
  3468. *
  3469. * @private
  3470. * @param {Object} object The object to modify.
  3471. * @param {string} key The key of the property to assign.
  3472. * @param {*} value The value to assign.
  3473. */
  3474. function assignMergeValue(object, key, value) {
  3475. if ((value !== undefined && !eq(object[key], value)) ||
  3476. (value === undefined && !(key in object))) {
  3477. baseAssignValue(object, key, value);
  3478. }
  3479. }
  3480. /**
  3481. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3482. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3483. * for equality comparisons.
  3484. *
  3485. * @private
  3486. * @param {Object} object The object to modify.
  3487. * @param {string} key The key of the property to assign.
  3488. * @param {*} value The value to assign.
  3489. */
  3490. function assignValue(object, key, value) {
  3491. var objValue = object[key];
  3492. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3493. (value === undefined && !(key in object))) {
  3494. baseAssignValue(object, key, value);
  3495. }
  3496. }
  3497. /**
  3498. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3499. *
  3500. * @private
  3501. * @param {Array} array The array to inspect.
  3502. * @param {*} key The key to search for.
  3503. * @returns {number} Returns the index of the matched value, else `-1`.
  3504. */
  3505. function assocIndexOf(array, key) {
  3506. var length = array.length;
  3507. while (length--) {
  3508. if (eq(array[length][0], key)) {
  3509. return length;
  3510. }
  3511. }
  3512. return -1;
  3513. }
  3514. /**
  3515. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3516. * by `iteratee` and values set by `setter`.
  3517. *
  3518. * @private
  3519. * @param {Array|Object} collection The collection to iterate over.
  3520. * @param {Function} setter The function to set `accumulator` values.
  3521. * @param {Function} iteratee The iteratee to transform keys.
  3522. * @param {Object} accumulator The initial aggregated object.
  3523. * @returns {Function} Returns `accumulator`.
  3524. */
  3525. function baseAggregator(collection, setter, iteratee, accumulator) {
  3526. baseEach(collection, function(value, key, collection) {
  3527. setter(accumulator, value, iteratee(value), collection);
  3528. });
  3529. return accumulator;
  3530. }
  3531. /**
  3532. * The base implementation of `_.assign` without support for multiple sources
  3533. * or `customizer` functions.
  3534. *
  3535. * @private
  3536. * @param {Object} object The destination object.
  3537. * @param {Object} source The source object.
  3538. * @returns {Object} Returns `object`.
  3539. */
  3540. function baseAssign(object, source) {
  3541. return object && copyObject(source, keys(source), object);
  3542. }
  3543. /**
  3544. * The base implementation of `_.assignIn` without support for multiple sources
  3545. * or `customizer` functions.
  3546. *
  3547. * @private
  3548. * @param {Object} object The destination object.
  3549. * @param {Object} source The source object.
  3550. * @returns {Object} Returns `object`.
  3551. */
  3552. function baseAssignIn(object, source) {
  3553. return object && copyObject(source, keysIn(source), object);
  3554. }
  3555. /**
  3556. * The base implementation of `assignValue` and `assignMergeValue` without
  3557. * value checks.
  3558. *
  3559. * @private
  3560. * @param {Object} object The object to modify.
  3561. * @param {string} key The key of the property to assign.
  3562. * @param {*} value The value to assign.
  3563. */
  3564. function baseAssignValue(object, key, value) {
  3565. if (key == '__proto__' && defineProperty) {
  3566. defineProperty(object, key, {
  3567. 'configurable': true,
  3568. 'enumerable': true,
  3569. 'value': value,
  3570. 'writable': true
  3571. });
  3572. } else {
  3573. object[key] = value;
  3574. }
  3575. }
  3576. /**
  3577. * The base implementation of `_.at` without support for individual paths.
  3578. *
  3579. * @private
  3580. * @param {Object} object The object to iterate over.
  3581. * @param {string[]} paths The property paths to pick.
  3582. * @returns {Array} Returns the picked elements.
  3583. */
  3584. function baseAt(object, paths) {
  3585. var index = -1,
  3586. length = paths.length,
  3587. result = Array(length),
  3588. skip = object == null;
  3589. while (++index < length) {
  3590. result[index] = skip ? undefined : get(object, paths[index]);
  3591. }
  3592. return result;
  3593. }
  3594. /**
  3595. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3596. *
  3597. * @private
  3598. * @param {number} number The number to clamp.
  3599. * @param {number} [lower] The lower bound.
  3600. * @param {number} upper The upper bound.
  3601. * @returns {number} Returns the clamped number.
  3602. */
  3603. function baseClamp(number, lower, upper) {
  3604. if (number === number) {
  3605. if (upper !== undefined) {
  3606. number = number <= upper ? number : upper;
  3607. }
  3608. if (lower !== undefined) {
  3609. number = number >= lower ? number : lower;
  3610. }
  3611. }
  3612. return number;
  3613. }
  3614. /**
  3615. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3616. * traversed objects.
  3617. *
  3618. * @private
  3619. * @param {*} value The value to clone.
  3620. * @param {boolean} bitmask The bitmask flags.
  3621. * 1 - Deep clone
  3622. * 2 - Flatten inherited properties
  3623. * 4 - Clone symbols
  3624. * @param {Function} [customizer] The function to customize cloning.
  3625. * @param {string} [key] The key of `value`.
  3626. * @param {Object} [object] The parent object of `value`.
  3627. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3628. * @returns {*} Returns the cloned value.
  3629. */
  3630. function baseClone(value, bitmask, customizer, key, object, stack) {
  3631. var result,
  3632. isDeep = bitmask & CLONE_DEEP_FLAG,
  3633. isFlat = bitmask & CLONE_FLAT_FLAG,
  3634. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3635. if (customizer) {
  3636. result = object ? customizer(value, key, object, stack) : customizer(value);
  3637. }
  3638. if (result !== undefined) {
  3639. return result;
  3640. }
  3641. if (!isObject(value)) {
  3642. return value;
  3643. }
  3644. var isArr = isArray(value);
  3645. if (isArr) {
  3646. result = initCloneArray(value);
  3647. if (!isDeep) {
  3648. return copyArray(value, result);
  3649. }
  3650. } else {
  3651. var tag = getTag(value),
  3652. isFunc = tag == funcTag || tag == genTag;
  3653. if (isBuffer(value)) {
  3654. return cloneBuffer(value, isDeep);
  3655. }
  3656. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3657. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3658. if (!isDeep) {
  3659. return isFlat
  3660. ? copySymbolsIn(value, baseAssignIn(result, value))
  3661. : copySymbols(value, baseAssign(result, value));
  3662. }
  3663. } else {
  3664. if (!cloneableTags[tag]) {
  3665. return object ? value : {};
  3666. }
  3667. result = initCloneByTag(value, tag, isDeep);
  3668. }
  3669. }
  3670. // Check for circular references and return its corresponding clone.
  3671. stack || (stack = new Stack);
  3672. var stacked = stack.get(value);
  3673. if (stacked) {
  3674. return stacked;
  3675. }
  3676. stack.set(value, result);
  3677. if (isSet(value)) {
  3678. value.forEach(function(subValue) {
  3679. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3680. });
  3681. } else if (isMap(value)) {
  3682. value.forEach(function(subValue, key) {
  3683. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3684. });
  3685. }
  3686. var keysFunc = isFull
  3687. ? (isFlat ? getAllKeysIn : getAllKeys)
  3688. : (isFlat ? keysIn : keys);
  3689. var props = isArr ? undefined : keysFunc(value);
  3690. arrayEach(props || value, function(subValue, key) {
  3691. if (props) {
  3692. key = subValue;
  3693. subValue = value[key];
  3694. }
  3695. // Recursively populate clone (susceptible to call stack limits).
  3696. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3697. });
  3698. return result;
  3699. }
  3700. /**
  3701. * The base implementation of `_.conforms` which doesn't clone `source`.
  3702. *
  3703. * @private
  3704. * @param {Object} source The object of property predicates to conform to.
  3705. * @returns {Function} Returns the new spec function.
  3706. */
  3707. function baseConforms(source) {
  3708. var props = keys(source);
  3709. return function(object) {
  3710. return baseConformsTo(object, source, props);
  3711. };
  3712. }
  3713. /**
  3714. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3715. *
  3716. * @private
  3717. * @param {Object} object The object to inspect.
  3718. * @param {Object} source The object of property predicates to conform to.
  3719. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3720. */
  3721. function baseConformsTo(object, source, props) {
  3722. var length = props.length;
  3723. if (object == null) {
  3724. return !length;
  3725. }
  3726. object = Object(object);
  3727. while (length--) {
  3728. var key = props[length],
  3729. predicate = source[key],
  3730. value = object[key];
  3731. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3732. return false;
  3733. }
  3734. }
  3735. return true;
  3736. }
  3737. /**
  3738. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3739. * to provide to `func`.
  3740. *
  3741. * @private
  3742. * @param {Function} func The function to delay.
  3743. * @param {number} wait The number of milliseconds to delay invocation.
  3744. * @param {Array} args The arguments to provide to `func`.
  3745. * @returns {number|Object} Returns the timer id or timeout object.
  3746. */
  3747. function baseDelay(func, wait, args) {
  3748. if (typeof func != 'function') {
  3749. throw new TypeError(FUNC_ERROR_TEXT);
  3750. }
  3751. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3752. }
  3753. /**
  3754. * The base implementation of methods like `_.difference` without support
  3755. * for excluding multiple arrays or iteratee shorthands.
  3756. *
  3757. * @private
  3758. * @param {Array} array The array to inspect.
  3759. * @param {Array} values The values to exclude.
  3760. * @param {Function} [iteratee] The iteratee invoked per element.
  3761. * @param {Function} [comparator] The comparator invoked per element.
  3762. * @returns {Array} Returns the new array of filtered values.
  3763. */
  3764. function baseDifference(array, values, iteratee, comparator) {
  3765. var index = -1,
  3766. includes = arrayIncludes,
  3767. isCommon = true,
  3768. length = array.length,
  3769. result = [],
  3770. valuesLength = values.length;
  3771. if (!length) {
  3772. return result;
  3773. }
  3774. if (iteratee) {
  3775. values = arrayMap(values, baseUnary(iteratee));
  3776. }
  3777. if (comparator) {
  3778. includes = arrayIncludesWith;
  3779. isCommon = false;
  3780. }
  3781. else if (values.length >= LARGE_ARRAY_SIZE) {
  3782. includes = cacheHas;
  3783. isCommon = false;
  3784. values = new SetCache(values);
  3785. }
  3786. outer:
  3787. while (++index < length) {
  3788. var value = array[index],
  3789. computed = iteratee == null ? value : iteratee(value);
  3790. value = (comparator || value !== 0) ? value : 0;
  3791. if (isCommon && computed === computed) {
  3792. var valuesIndex = valuesLength;
  3793. while (valuesIndex--) {
  3794. if (values[valuesIndex] === computed) {
  3795. continue outer;
  3796. }
  3797. }
  3798. result.push(value);
  3799. }
  3800. else if (!includes(values, computed, comparator)) {
  3801. result.push(value);
  3802. }
  3803. }
  3804. return result;
  3805. }
  3806. /**
  3807. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3808. *
  3809. * @private
  3810. * @param {Array|Object} collection The collection to iterate over.
  3811. * @param {Function} iteratee The function invoked per iteration.
  3812. * @returns {Array|Object} Returns `collection`.
  3813. */
  3814. var baseEach = createBaseEach(baseForOwn);
  3815. /**
  3816. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3817. *
  3818. * @private
  3819. * @param {Array|Object} collection The collection to iterate over.
  3820. * @param {Function} iteratee The function invoked per iteration.
  3821. * @returns {Array|Object} Returns `collection`.
  3822. */
  3823. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3824. /**
  3825. * The base implementation of `_.every` without support for iteratee shorthands.
  3826. *
  3827. * @private
  3828. * @param {Array|Object} collection The collection to iterate over.
  3829. * @param {Function} predicate The function invoked per iteration.
  3830. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3831. * else `false`
  3832. */
  3833. function baseEvery(collection, predicate) {
  3834. var result = true;
  3835. baseEach(collection, function(value, index, collection) {
  3836. result = !!predicate(value, index, collection);
  3837. return result;
  3838. });
  3839. return result;
  3840. }
  3841. /**
  3842. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3843. * `comparator` to determine the extremum value.
  3844. *
  3845. * @private
  3846. * @param {Array} array The array to iterate over.
  3847. * @param {Function} iteratee The iteratee invoked per iteration.
  3848. * @param {Function} comparator The comparator used to compare values.
  3849. * @returns {*} Returns the extremum value.
  3850. */
  3851. function baseExtremum(array, iteratee, comparator) {
  3852. var index = -1,
  3853. length = array.length;
  3854. while (++index < length) {
  3855. var value = array[index],
  3856. current = iteratee(value);
  3857. if (current != null && (computed === undefined
  3858. ? (current === current && !isSymbol(current))
  3859. : comparator(current, computed)
  3860. )) {
  3861. var computed = current,
  3862. result = value;
  3863. }
  3864. }
  3865. return result;
  3866. }
  3867. /**
  3868. * The base implementation of `_.fill` without an iteratee call guard.
  3869. *
  3870. * @private
  3871. * @param {Array} array The array to fill.
  3872. * @param {*} value The value to fill `array` with.
  3873. * @param {number} [start=0] The start position.
  3874. * @param {number} [end=array.length] The end position.
  3875. * @returns {Array} Returns `array`.
  3876. */
  3877. function baseFill(array, value, start, end) {
  3878. var length = array.length;
  3879. start = toInteger(start);
  3880. if (start < 0) {
  3881. start = -start > length ? 0 : (length + start);
  3882. }
  3883. end = (end === undefined || end > length) ? length : toInteger(end);
  3884. if (end < 0) {
  3885. end += length;
  3886. }
  3887. end = start > end ? 0 : toLength(end);
  3888. while (start < end) {
  3889. array[start++] = value;
  3890. }
  3891. return array;
  3892. }
  3893. /**
  3894. * The base implementation of `_.filter` without support for iteratee shorthands.
  3895. *
  3896. * @private
  3897. * @param {Array|Object} collection The collection to iterate over.
  3898. * @param {Function} predicate The function invoked per iteration.
  3899. * @returns {Array} Returns the new filtered array.
  3900. */
  3901. function baseFilter(collection, predicate) {
  3902. var result = [];
  3903. baseEach(collection, function(value, index, collection) {
  3904. if (predicate(value, index, collection)) {
  3905. result.push(value);
  3906. }
  3907. });
  3908. return result;
  3909. }
  3910. /**
  3911. * The base implementation of `_.flatten` with support for restricting flattening.
  3912. *
  3913. * @private
  3914. * @param {Array} array The array to flatten.
  3915. * @param {number} depth The maximum recursion depth.
  3916. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3917. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3918. * @param {Array} [result=[]] The initial result value.
  3919. * @returns {Array} Returns the new flattened array.
  3920. */
  3921. function baseFlatten(array, depth, predicate, isStrict, result) {
  3922. var index = -1,
  3923. length = array.length;
  3924. predicate || (predicate = isFlattenable);
  3925. result || (result = []);
  3926. while (++index < length) {
  3927. var value = array[index];
  3928. if (depth > 0 && predicate(value)) {
  3929. if (depth > 1) {
  3930. // Recursively flatten arrays (susceptible to call stack limits).
  3931. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3932. } else {
  3933. arrayPush(result, value);
  3934. }
  3935. } else if (!isStrict) {
  3936. result[result.length] = value;
  3937. }
  3938. }
  3939. return result;
  3940. }
  3941. /**
  3942. * The base implementation of `baseForOwn` which iterates over `object`
  3943. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3944. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3945. *
  3946. * @private
  3947. * @param {Object} object The object to iterate over.
  3948. * @param {Function} iteratee The function invoked per iteration.
  3949. * @param {Function} keysFunc The function to get the keys of `object`.
  3950. * @returns {Object} Returns `object`.
  3951. */
  3952. var baseFor = createBaseFor();
  3953. /**
  3954. * This function is like `baseFor` except that it iterates over properties
  3955. * in the opposite order.
  3956. *
  3957. * @private
  3958. * @param {Object} object The object to iterate over.
  3959. * @param {Function} iteratee The function invoked per iteration.
  3960. * @param {Function} keysFunc The function to get the keys of `object`.
  3961. * @returns {Object} Returns `object`.
  3962. */
  3963. var baseForRight = createBaseFor(true);
  3964. /**
  3965. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3966. *
  3967. * @private
  3968. * @param {Object} object The object to iterate over.
  3969. * @param {Function} iteratee The function invoked per iteration.
  3970. * @returns {Object} Returns `object`.
  3971. */
  3972. function baseForOwn(object, iteratee) {
  3973. return object && baseFor(object, iteratee, keys);
  3974. }
  3975. /**
  3976. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3977. *
  3978. * @private
  3979. * @param {Object} object The object to iterate over.
  3980. * @param {Function} iteratee The function invoked per iteration.
  3981. * @returns {Object} Returns `object`.
  3982. */
  3983. function baseForOwnRight(object, iteratee) {
  3984. return object && baseForRight(object, iteratee, keys);
  3985. }
  3986. /**
  3987. * The base implementation of `_.functions` which creates an array of
  3988. * `object` function property names filtered from `props`.
  3989. *
  3990. * @private
  3991. * @param {Object} object The object to inspect.
  3992. * @param {Array} props The property names to filter.
  3993. * @returns {Array} Returns the function names.
  3994. */
  3995. function baseFunctions(object, props) {
  3996. return arrayFilter(props, function(key) {
  3997. return isFunction(object[key]);
  3998. });
  3999. }
  4000. /**
  4001. * The base implementation of `_.get` without support for default values.
  4002. *
  4003. * @private
  4004. * @param {Object} object The object to query.
  4005. * @param {Array|string} path The path of the property to get.
  4006. * @returns {*} Returns the resolved value.
  4007. */
  4008. function baseGet(object, path) {
  4009. path = castPath(path, object);
  4010. var index = 0,
  4011. length = path.length;
  4012. while (object != null && index < length) {
  4013. object = object[toKey(path[index++])];
  4014. }
  4015. return (index && index == length) ? object : undefined;
  4016. }
  4017. /**
  4018. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4019. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4020. * symbols of `object`.
  4021. *
  4022. * @private
  4023. * @param {Object} object The object to query.
  4024. * @param {Function} keysFunc The function to get the keys of `object`.
  4025. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4026. * @returns {Array} Returns the array of property names and symbols.
  4027. */
  4028. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4029. var result = keysFunc(object);
  4030. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4031. }
  4032. /**
  4033. * The base implementation of `getTag` without fallbacks for buggy environments.
  4034. *
  4035. * @private
  4036. * @param {*} value The value to query.
  4037. * @returns {string} Returns the `toStringTag`.
  4038. */
  4039. function baseGetTag(value) {
  4040. if (value == null) {
  4041. return value === undefined ? undefinedTag : nullTag;
  4042. }
  4043. return (symToStringTag && symToStringTag in Object(value))
  4044. ? getRawTag(value)
  4045. : objectToString(value);
  4046. }
  4047. /**
  4048. * The base implementation of `_.gt` which doesn't coerce arguments.
  4049. *
  4050. * @private
  4051. * @param {*} value The value to compare.
  4052. * @param {*} other The other value to compare.
  4053. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4054. * else `false`.
  4055. */
  4056. function baseGt(value, other) {
  4057. return value > other;
  4058. }
  4059. /**
  4060. * The base implementation of `_.has` without support for deep paths.
  4061. *
  4062. * @private
  4063. * @param {Object} [object] The object to query.
  4064. * @param {Array|string} key The key to check.
  4065. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4066. */
  4067. function baseHas(object, key) {
  4068. return object != null && hasOwnProperty.call(object, key);
  4069. }
  4070. /**
  4071. * The base implementation of `_.hasIn` without support for deep paths.
  4072. *
  4073. * @private
  4074. * @param {Object} [object] The object to query.
  4075. * @param {Array|string} key The key to check.
  4076. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4077. */
  4078. function baseHasIn(object, key) {
  4079. return object != null && key in Object(object);
  4080. }
  4081. /**
  4082. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4083. *
  4084. * @private
  4085. * @param {number} number The number to check.
  4086. * @param {number} start The start of the range.
  4087. * @param {number} end The end of the range.
  4088. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4089. */
  4090. function baseInRange(number, start, end) {
  4091. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4092. }
  4093. /**
  4094. * The base implementation of methods like `_.intersection`, without support
  4095. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4096. *
  4097. * @private
  4098. * @param {Array} arrays The arrays to inspect.
  4099. * @param {Function} [iteratee] The iteratee invoked per element.
  4100. * @param {Function} [comparator] The comparator invoked per element.
  4101. * @returns {Array} Returns the new array of shared values.
  4102. */
  4103. function baseIntersection(arrays, iteratee, comparator) {
  4104. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4105. length = arrays[0].length,
  4106. othLength = arrays.length,
  4107. othIndex = othLength,
  4108. caches = Array(othLength),
  4109. maxLength = Infinity,
  4110. result = [];
  4111. while (othIndex--) {
  4112. var array = arrays[othIndex];
  4113. if (othIndex && iteratee) {
  4114. array = arrayMap(array, baseUnary(iteratee));
  4115. }
  4116. maxLength = nativeMin(array.length, maxLength);
  4117. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4118. ? new SetCache(othIndex && array)
  4119. : undefined;
  4120. }
  4121. array = arrays[0];
  4122. var index = -1,
  4123. seen = caches[0];
  4124. outer:
  4125. while (++index < length && result.length < maxLength) {
  4126. var value = array[index],
  4127. computed = iteratee ? iteratee(value) : value;
  4128. value = (comparator || value !== 0) ? value : 0;
  4129. if (!(seen
  4130. ? cacheHas(seen, computed)
  4131. : includes(result, computed, comparator)
  4132. )) {
  4133. othIndex = othLength;
  4134. while (--othIndex) {
  4135. var cache = caches[othIndex];
  4136. if (!(cache
  4137. ? cacheHas(cache, computed)
  4138. : includes(arrays[othIndex], computed, comparator))
  4139. ) {
  4140. continue outer;
  4141. }
  4142. }
  4143. if (seen) {
  4144. seen.push(computed);
  4145. }
  4146. result.push(value);
  4147. }
  4148. }
  4149. return result;
  4150. }
  4151. /**
  4152. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4153. * `object` with values transformed by `iteratee` and set by `setter`.
  4154. *
  4155. * @private
  4156. * @param {Object} object The object to iterate over.
  4157. * @param {Function} setter The function to set `accumulator` values.
  4158. * @param {Function} iteratee The iteratee to transform values.
  4159. * @param {Object} accumulator The initial inverted object.
  4160. * @returns {Function} Returns `accumulator`.
  4161. */
  4162. function baseInverter(object, setter, iteratee, accumulator) {
  4163. baseForOwn(object, function(value, key, object) {
  4164. setter(accumulator, iteratee(value), key, object);
  4165. });
  4166. return accumulator;
  4167. }
  4168. /**
  4169. * The base implementation of `_.invoke` without support for individual
  4170. * method arguments.
  4171. *
  4172. * @private
  4173. * @param {Object} object The object to query.
  4174. * @param {Array|string} path The path of the method to invoke.
  4175. * @param {Array} args The arguments to invoke the method with.
  4176. * @returns {*} Returns the result of the invoked method.
  4177. */
  4178. function baseInvoke(object, path, args) {
  4179. path = castPath(path, object);
  4180. object = parent(object, path);
  4181. var func = object == null ? object : object[toKey(last(path))];
  4182. return func == null ? undefined : apply(func, object, args);
  4183. }
  4184. /**
  4185. * The base implementation of `_.isArguments`.
  4186. *
  4187. * @private
  4188. * @param {*} value The value to check.
  4189. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4190. */
  4191. function baseIsArguments(value) {
  4192. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4193. }
  4194. /**
  4195. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4196. *
  4197. * @private
  4198. * @param {*} value The value to check.
  4199. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4200. */
  4201. function baseIsArrayBuffer(value) {
  4202. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4203. }
  4204. /**
  4205. * The base implementation of `_.isDate` without Node.js optimizations.
  4206. *
  4207. * @private
  4208. * @param {*} value The value to check.
  4209. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4210. */
  4211. function baseIsDate(value) {
  4212. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4213. }
  4214. /**
  4215. * The base implementation of `_.isEqual` which supports partial comparisons
  4216. * and tracks traversed objects.
  4217. *
  4218. * @private
  4219. * @param {*} value The value to compare.
  4220. * @param {*} other The other value to compare.
  4221. * @param {boolean} bitmask The bitmask flags.
  4222. * 1 - Unordered comparison
  4223. * 2 - Partial comparison
  4224. * @param {Function} [customizer] The function to customize comparisons.
  4225. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4226. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4227. */
  4228. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4229. if (value === other) {
  4230. return true;
  4231. }
  4232. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4233. return value !== value && other !== other;
  4234. }
  4235. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4236. }
  4237. /**
  4238. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4239. * deep comparisons and tracks traversed objects enabling objects with circular
  4240. * references to be compared.
  4241. *
  4242. * @private
  4243. * @param {Object} object The object to compare.
  4244. * @param {Object} other The other object to compare.
  4245. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4246. * @param {Function} customizer The function to customize comparisons.
  4247. * @param {Function} equalFunc The function to determine equivalents of values.
  4248. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4249. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4250. */
  4251. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4252. var objIsArr = isArray(object),
  4253. othIsArr = isArray(other),
  4254. objTag = objIsArr ? arrayTag : getTag(object),
  4255. othTag = othIsArr ? arrayTag : getTag(other);
  4256. objTag = objTag == argsTag ? objectTag : objTag;
  4257. othTag = othTag == argsTag ? objectTag : othTag;
  4258. var objIsObj = objTag == objectTag,
  4259. othIsObj = othTag == objectTag,
  4260. isSameTag = objTag == othTag;
  4261. if (isSameTag && isBuffer(object)) {
  4262. if (!isBuffer(other)) {
  4263. return false;
  4264. }
  4265. objIsArr = true;
  4266. objIsObj = false;
  4267. }
  4268. if (isSameTag && !objIsObj) {
  4269. stack || (stack = new Stack);
  4270. return (objIsArr || isTypedArray(object))
  4271. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4272. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4273. }
  4274. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4275. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4276. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4277. if (objIsWrapped || othIsWrapped) {
  4278. var objUnwrapped = objIsWrapped ? object.value() : object,
  4279. othUnwrapped = othIsWrapped ? other.value() : other;
  4280. stack || (stack = new Stack);
  4281. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4282. }
  4283. }
  4284. if (!isSameTag) {
  4285. return false;
  4286. }
  4287. stack || (stack = new Stack);
  4288. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4289. }
  4290. /**
  4291. * The base implementation of `_.isMap` without Node.js optimizations.
  4292. *
  4293. * @private
  4294. * @param {*} value The value to check.
  4295. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4296. */
  4297. function baseIsMap(value) {
  4298. return isObjectLike(value) && getTag(value) == mapTag;
  4299. }
  4300. /**
  4301. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4302. *
  4303. * @private
  4304. * @param {Object} object The object to inspect.
  4305. * @param {Object} source The object of property values to match.
  4306. * @param {Array} matchData The property names, values, and compare flags to match.
  4307. * @param {Function} [customizer] The function to customize comparisons.
  4308. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4309. */
  4310. function baseIsMatch(object, source, matchData, customizer) {
  4311. var index = matchData.length,
  4312. length = index,
  4313. noCustomizer = !customizer;
  4314. if (object == null) {
  4315. return !length;
  4316. }
  4317. object = Object(object);
  4318. while (index--) {
  4319. var data = matchData[index];
  4320. if ((noCustomizer && data[2])
  4321. ? data[1] !== object[data[0]]
  4322. : !(data[0] in object)
  4323. ) {
  4324. return false;
  4325. }
  4326. }
  4327. while (++index < length) {
  4328. data = matchData[index];
  4329. var key = data[0],
  4330. objValue = object[key],
  4331. srcValue = data[1];
  4332. if (noCustomizer && data[2]) {
  4333. if (objValue === undefined && !(key in object)) {
  4334. return false;
  4335. }
  4336. } else {
  4337. var stack = new Stack;
  4338. if (customizer) {
  4339. var result = customizer(objValue, srcValue, key, object, source, stack);
  4340. }
  4341. if (!(result === undefined
  4342. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4343. : result
  4344. )) {
  4345. return false;
  4346. }
  4347. }
  4348. }
  4349. return true;
  4350. }
  4351. /**
  4352. * The base implementation of `_.isNative` without bad shim checks.
  4353. *
  4354. * @private
  4355. * @param {*} value The value to check.
  4356. * @returns {boolean} Returns `true` if `value` is a native function,
  4357. * else `false`.
  4358. */
  4359. function baseIsNative(value) {
  4360. if (!isObject(value) || isMasked(value)) {
  4361. return false;
  4362. }
  4363. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4364. return pattern.test(toSource(value));
  4365. }
  4366. /**
  4367. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4368. *
  4369. * @private
  4370. * @param {*} value The value to check.
  4371. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4372. */
  4373. function baseIsRegExp(value) {
  4374. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4375. }
  4376. /**
  4377. * The base implementation of `_.isSet` without Node.js optimizations.
  4378. *
  4379. * @private
  4380. * @param {*} value The value to check.
  4381. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4382. */
  4383. function baseIsSet(value) {
  4384. return isObjectLike(value) && getTag(value) == setTag;
  4385. }
  4386. /**
  4387. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4388. *
  4389. * @private
  4390. * @param {*} value The value to check.
  4391. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4392. */
  4393. function baseIsTypedArray(value) {
  4394. return isObjectLike(value) &&
  4395. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4396. }
  4397. /**
  4398. * The base implementation of `_.iteratee`.
  4399. *
  4400. * @private
  4401. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4402. * @returns {Function} Returns the iteratee.
  4403. */
  4404. function baseIteratee(value) {
  4405. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4406. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4407. if (typeof value == 'function') {
  4408. return value;
  4409. }
  4410. if (value == null) {
  4411. return identity;
  4412. }
  4413. if (typeof value == 'object') {
  4414. return isArray(value)
  4415. ? baseMatchesProperty(value[0], value[1])
  4416. : baseMatches(value);
  4417. }
  4418. return property(value);
  4419. }
  4420. /**
  4421. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4422. *
  4423. * @private
  4424. * @param {Object} object The object to query.
  4425. * @returns {Array} Returns the array of property names.
  4426. */
  4427. function baseKeys(object) {
  4428. if (!isPrototype(object)) {
  4429. return nativeKeys(object);
  4430. }
  4431. var result = [];
  4432. for (var key in Object(object)) {
  4433. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4434. result.push(key);
  4435. }
  4436. }
  4437. return result;
  4438. }
  4439. /**
  4440. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4441. *
  4442. * @private
  4443. * @param {Object} object The object to query.
  4444. * @returns {Array} Returns the array of property names.
  4445. */
  4446. function baseKeysIn(object) {
  4447. if (!isObject(object)) {
  4448. return nativeKeysIn(object);
  4449. }
  4450. var isProto = isPrototype(object),
  4451. result = [];
  4452. for (var key in object) {
  4453. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4454. result.push(key);
  4455. }
  4456. }
  4457. return result;
  4458. }
  4459. /**
  4460. * The base implementation of `_.lt` which doesn't coerce arguments.
  4461. *
  4462. * @private
  4463. * @param {*} value The value to compare.
  4464. * @param {*} other The other value to compare.
  4465. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4466. * else `false`.
  4467. */
  4468. function baseLt(value, other) {
  4469. return value < other;
  4470. }
  4471. /**
  4472. * The base implementation of `_.map` without support for iteratee shorthands.
  4473. *
  4474. * @private
  4475. * @param {Array|Object} collection The collection to iterate over.
  4476. * @param {Function} iteratee The function invoked per iteration.
  4477. * @returns {Array} Returns the new mapped array.
  4478. */
  4479. function baseMap(collection, iteratee) {
  4480. var index = -1,
  4481. result = isArrayLike(collection) ? Array(collection.length) : [];
  4482. baseEach(collection, function(value, key, collection) {
  4483. result[++index] = iteratee(value, key, collection);
  4484. });
  4485. return result;
  4486. }
  4487. /**
  4488. * The base implementation of `_.matches` which doesn't clone `source`.
  4489. *
  4490. * @private
  4491. * @param {Object} source The object of property values to match.
  4492. * @returns {Function} Returns the new spec function.
  4493. */
  4494. function baseMatches(source) {
  4495. var matchData = getMatchData(source);
  4496. if (matchData.length == 1 && matchData[0][2]) {
  4497. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4498. }
  4499. return function(object) {
  4500. return object === source || baseIsMatch(object, source, matchData);
  4501. };
  4502. }
  4503. /**
  4504. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4505. *
  4506. * @private
  4507. * @param {string} path The path of the property to get.
  4508. * @param {*} srcValue The value to match.
  4509. * @returns {Function} Returns the new spec function.
  4510. */
  4511. function baseMatchesProperty(path, srcValue) {
  4512. if (isKey(path) && isStrictComparable(srcValue)) {
  4513. return matchesStrictComparable(toKey(path), srcValue);
  4514. }
  4515. return function(object) {
  4516. var objValue = get(object, path);
  4517. return (objValue === undefined && objValue === srcValue)
  4518. ? hasIn(object, path)
  4519. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4520. };
  4521. }
  4522. /**
  4523. * The base implementation of `_.merge` without support for multiple sources.
  4524. *
  4525. * @private
  4526. * @param {Object} object The destination object.
  4527. * @param {Object} source The source object.
  4528. * @param {number} srcIndex The index of `source`.
  4529. * @param {Function} [customizer] The function to customize merged values.
  4530. * @param {Object} [stack] Tracks traversed source values and their merged
  4531. * counterparts.
  4532. */
  4533. function baseMerge(object, source, srcIndex, customizer, stack) {
  4534. if (object === source) {
  4535. return;
  4536. }
  4537. baseFor(source, function(srcValue, key) {
  4538. stack || (stack = new Stack);
  4539. if (isObject(srcValue)) {
  4540. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4541. }
  4542. else {
  4543. var newValue = customizer
  4544. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4545. : undefined;
  4546. if (newValue === undefined) {
  4547. newValue = srcValue;
  4548. }
  4549. assignMergeValue(object, key, newValue);
  4550. }
  4551. }, keysIn);
  4552. }
  4553. /**
  4554. * A specialized version of `baseMerge` for arrays and objects which performs
  4555. * deep merges and tracks traversed objects enabling objects with circular
  4556. * references to be merged.
  4557. *
  4558. * @private
  4559. * @param {Object} object The destination object.
  4560. * @param {Object} source The source object.
  4561. * @param {string} key The key of the value to merge.
  4562. * @param {number} srcIndex The index of `source`.
  4563. * @param {Function} mergeFunc The function to merge values.
  4564. * @param {Function} [customizer] The function to customize assigned values.
  4565. * @param {Object} [stack] Tracks traversed source values and their merged
  4566. * counterparts.
  4567. */
  4568. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4569. var objValue = safeGet(object, key),
  4570. srcValue = safeGet(source, key),
  4571. stacked = stack.get(srcValue);
  4572. if (stacked) {
  4573. assignMergeValue(object, key, stacked);
  4574. return;
  4575. }
  4576. var newValue = customizer
  4577. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4578. : undefined;
  4579. var isCommon = newValue === undefined;
  4580. if (isCommon) {
  4581. var isArr = isArray(srcValue),
  4582. isBuff = !isArr && isBuffer(srcValue),
  4583. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4584. newValue = srcValue;
  4585. if (isArr || isBuff || isTyped) {
  4586. if (isArray(objValue)) {
  4587. newValue = objValue;
  4588. }
  4589. else if (isArrayLikeObject(objValue)) {
  4590. newValue = copyArray(objValue);
  4591. }
  4592. else if (isBuff) {
  4593. isCommon = false;
  4594. newValue = cloneBuffer(srcValue, true);
  4595. }
  4596. else if (isTyped) {
  4597. isCommon = false;
  4598. newValue = cloneTypedArray(srcValue, true);
  4599. }
  4600. else {
  4601. newValue = [];
  4602. }
  4603. }
  4604. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4605. newValue = objValue;
  4606. if (isArguments(objValue)) {
  4607. newValue = toPlainObject(objValue);
  4608. }
  4609. else if (!isObject(objValue) || isFunction(objValue)) {
  4610. newValue = initCloneObject(srcValue);
  4611. }
  4612. }
  4613. else {
  4614. isCommon = false;
  4615. }
  4616. }
  4617. if (isCommon) {
  4618. // Recursively merge objects and arrays (susceptible to call stack limits).
  4619. stack.set(srcValue, newValue);
  4620. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4621. stack['delete'](srcValue);
  4622. }
  4623. assignMergeValue(object, key, newValue);
  4624. }
  4625. /**
  4626. * The base implementation of `_.nth` which doesn't coerce arguments.
  4627. *
  4628. * @private
  4629. * @param {Array} array The array to query.
  4630. * @param {number} n The index of the element to return.
  4631. * @returns {*} Returns the nth element of `array`.
  4632. */
  4633. function baseNth(array, n) {
  4634. var length = array.length;
  4635. if (!length) {
  4636. return;
  4637. }
  4638. n += n < 0 ? length : 0;
  4639. return isIndex(n, length) ? array[n] : undefined;
  4640. }
  4641. /**
  4642. * The base implementation of `_.orderBy` without param guards.
  4643. *
  4644. * @private
  4645. * @param {Array|Object} collection The collection to iterate over.
  4646. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4647. * @param {string[]} orders The sort orders of `iteratees`.
  4648. * @returns {Array} Returns the new sorted array.
  4649. */
  4650. function baseOrderBy(collection, iteratees, orders) {
  4651. if (iteratees.length) {
  4652. iteratees = arrayMap(iteratees, function(iteratee) {
  4653. if (isArray(iteratee)) {
  4654. return function(value) {
  4655. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4656. }
  4657. }
  4658. return iteratee;
  4659. });
  4660. } else {
  4661. iteratees = [identity];
  4662. }
  4663. var index = -1;
  4664. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4665. var result = baseMap(collection, function(value, key, collection) {
  4666. var criteria = arrayMap(iteratees, function(iteratee) {
  4667. return iteratee(value);
  4668. });
  4669. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4670. });
  4671. return baseSortBy(result, function(object, other) {
  4672. return compareMultiple(object, other, orders);
  4673. });
  4674. }
  4675. /**
  4676. * The base implementation of `_.pick` without support for individual
  4677. * property identifiers.
  4678. *
  4679. * @private
  4680. * @param {Object} object The source object.
  4681. * @param {string[]} paths The property paths to pick.
  4682. * @returns {Object} Returns the new object.
  4683. */
  4684. function basePick(object, paths) {
  4685. return basePickBy(object, paths, function(value, path) {
  4686. return hasIn(object, path);
  4687. });
  4688. }
  4689. /**
  4690. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4691. *
  4692. * @private
  4693. * @param {Object} object The source object.
  4694. * @param {string[]} paths The property paths to pick.
  4695. * @param {Function} predicate The function invoked per property.
  4696. * @returns {Object} Returns the new object.
  4697. */
  4698. function basePickBy(object, paths, predicate) {
  4699. var index = -1,
  4700. length = paths.length,
  4701. result = {};
  4702. while (++index < length) {
  4703. var path = paths[index],
  4704. value = baseGet(object, path);
  4705. if (predicate(value, path)) {
  4706. baseSet(result, castPath(path, object), value);
  4707. }
  4708. }
  4709. return result;
  4710. }
  4711. /**
  4712. * A specialized version of `baseProperty` which supports deep paths.
  4713. *
  4714. * @private
  4715. * @param {Array|string} path The path of the property to get.
  4716. * @returns {Function} Returns the new accessor function.
  4717. */
  4718. function basePropertyDeep(path) {
  4719. return function(object) {
  4720. return baseGet(object, path);
  4721. };
  4722. }
  4723. /**
  4724. * The base implementation of `_.pullAllBy` without support for iteratee
  4725. * shorthands.
  4726. *
  4727. * @private
  4728. * @param {Array} array The array to modify.
  4729. * @param {Array} values The values to remove.
  4730. * @param {Function} [iteratee] The iteratee invoked per element.
  4731. * @param {Function} [comparator] The comparator invoked per element.
  4732. * @returns {Array} Returns `array`.
  4733. */
  4734. function basePullAll(array, values, iteratee, comparator) {
  4735. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4736. index = -1,
  4737. length = values.length,
  4738. seen = array;
  4739. if (array === values) {
  4740. values = copyArray(values);
  4741. }
  4742. if (iteratee) {
  4743. seen = arrayMap(array, baseUnary(iteratee));
  4744. }
  4745. while (++index < length) {
  4746. var fromIndex = 0,
  4747. value = values[index],
  4748. computed = iteratee ? iteratee(value) : value;
  4749. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4750. if (seen !== array) {
  4751. splice.call(seen, fromIndex, 1);
  4752. }
  4753. splice.call(array, fromIndex, 1);
  4754. }
  4755. }
  4756. return array;
  4757. }
  4758. /**
  4759. * The base implementation of `_.pullAt` without support for individual
  4760. * indexes or capturing the removed elements.
  4761. *
  4762. * @private
  4763. * @param {Array} array The array to modify.
  4764. * @param {number[]} indexes The indexes of elements to remove.
  4765. * @returns {Array} Returns `array`.
  4766. */
  4767. function basePullAt(array, indexes) {
  4768. var length = array ? indexes.length : 0,
  4769. lastIndex = length - 1;
  4770. while (length--) {
  4771. var index = indexes[length];
  4772. if (length == lastIndex || index !== previous) {
  4773. var previous = index;
  4774. if (isIndex(index)) {
  4775. splice.call(array, index, 1);
  4776. } else {
  4777. baseUnset(array, index);
  4778. }
  4779. }
  4780. }
  4781. return array;
  4782. }
  4783. /**
  4784. * The base implementation of `_.random` without support for returning
  4785. * floating-point numbers.
  4786. *
  4787. * @private
  4788. * @param {number} lower The lower bound.
  4789. * @param {number} upper The upper bound.
  4790. * @returns {number} Returns the random number.
  4791. */
  4792. function baseRandom(lower, upper) {
  4793. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4794. }
  4795. /**
  4796. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4797. * coerce arguments.
  4798. *
  4799. * @private
  4800. * @param {number} start The start of the range.
  4801. * @param {number} end The end of the range.
  4802. * @param {number} step The value to increment or decrement by.
  4803. * @param {boolean} [fromRight] Specify iterating from right to left.
  4804. * @returns {Array} Returns the range of numbers.
  4805. */
  4806. function baseRange(start, end, step, fromRight) {
  4807. var index = -1,
  4808. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4809. result = Array(length);
  4810. while (length--) {
  4811. result[fromRight ? length : ++index] = start;
  4812. start += step;
  4813. }
  4814. return result;
  4815. }
  4816. /**
  4817. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4818. *
  4819. * @private
  4820. * @param {string} string The string to repeat.
  4821. * @param {number} n The number of times to repeat the string.
  4822. * @returns {string} Returns the repeated string.
  4823. */
  4824. function baseRepeat(string, n) {
  4825. var result = '';
  4826. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4827. return result;
  4828. }
  4829. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4830. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4831. do {
  4832. if (n % 2) {
  4833. result += string;
  4834. }
  4835. n = nativeFloor(n / 2);
  4836. if (n) {
  4837. string += string;
  4838. }
  4839. } while (n);
  4840. return result;
  4841. }
  4842. /**
  4843. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4844. *
  4845. * @private
  4846. * @param {Function} func The function to apply a rest parameter to.
  4847. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4848. * @returns {Function} Returns the new function.
  4849. */
  4850. function baseRest(func, start) {
  4851. return setToString(overRest(func, start, identity), func + '');
  4852. }
  4853. /**
  4854. * The base implementation of `_.sample`.
  4855. *
  4856. * @private
  4857. * @param {Array|Object} collection The collection to sample.
  4858. * @returns {*} Returns the random element.
  4859. */
  4860. function baseSample(collection) {
  4861. return arraySample(values(collection));
  4862. }
  4863. /**
  4864. * The base implementation of `_.sampleSize` without param guards.
  4865. *
  4866. * @private
  4867. * @param {Array|Object} collection The collection to sample.
  4868. * @param {number} n The number of elements to sample.
  4869. * @returns {Array} Returns the random elements.
  4870. */
  4871. function baseSampleSize(collection, n) {
  4872. var array = values(collection);
  4873. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4874. }
  4875. /**
  4876. * The base implementation of `_.set`.
  4877. *
  4878. * @private
  4879. * @param {Object} object The object to modify.
  4880. * @param {Array|string} path The path of the property to set.
  4881. * @param {*} value The value to set.
  4882. * @param {Function} [customizer] The function to customize path creation.
  4883. * @returns {Object} Returns `object`.
  4884. */
  4885. function baseSet(object, path, value, customizer) {
  4886. if (!isObject(object)) {
  4887. return object;
  4888. }
  4889. path = castPath(path, object);
  4890. var index = -1,
  4891. length = path.length,
  4892. lastIndex = length - 1,
  4893. nested = object;
  4894. while (nested != null && ++index < length) {
  4895. var key = toKey(path[index]),
  4896. newValue = value;
  4897. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4898. return object;
  4899. }
  4900. if (index != lastIndex) {
  4901. var objValue = nested[key];
  4902. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4903. if (newValue === undefined) {
  4904. newValue = isObject(objValue)
  4905. ? objValue
  4906. : (isIndex(path[index + 1]) ? [] : {});
  4907. }
  4908. }
  4909. assignValue(nested, key, newValue);
  4910. nested = nested[key];
  4911. }
  4912. return object;
  4913. }
  4914. /**
  4915. * The base implementation of `setData` without support for hot loop shorting.
  4916. *
  4917. * @private
  4918. * @param {Function} func The function to associate metadata with.
  4919. * @param {*} data The metadata.
  4920. * @returns {Function} Returns `func`.
  4921. */
  4922. var baseSetData = !metaMap ? identity : function(func, data) {
  4923. metaMap.set(func, data);
  4924. return func;
  4925. };
  4926. /**
  4927. * The base implementation of `setToString` without support for hot loop shorting.
  4928. *
  4929. * @private
  4930. * @param {Function} func The function to modify.
  4931. * @param {Function} string The `toString` result.
  4932. * @returns {Function} Returns `func`.
  4933. */
  4934. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4935. return defineProperty(func, 'toString', {
  4936. 'configurable': true,
  4937. 'enumerable': false,
  4938. 'value': constant(string),
  4939. 'writable': true
  4940. });
  4941. };
  4942. /**
  4943. * The base implementation of `_.shuffle`.
  4944. *
  4945. * @private
  4946. * @param {Array|Object} collection The collection to shuffle.
  4947. * @returns {Array} Returns the new shuffled array.
  4948. */
  4949. function baseShuffle(collection) {
  4950. return shuffleSelf(values(collection));
  4951. }
  4952. /**
  4953. * The base implementation of `_.slice` without an iteratee call guard.
  4954. *
  4955. * @private
  4956. * @param {Array} array The array to slice.
  4957. * @param {number} [start=0] The start position.
  4958. * @param {number} [end=array.length] The end position.
  4959. * @returns {Array} Returns the slice of `array`.
  4960. */
  4961. function baseSlice(array, start, end) {
  4962. var index = -1,
  4963. length = array.length;
  4964. if (start < 0) {
  4965. start = -start > length ? 0 : (length + start);
  4966. }
  4967. end = end > length ? length : end;
  4968. if (end < 0) {
  4969. end += length;
  4970. }
  4971. length = start > end ? 0 : ((end - start) >>> 0);
  4972. start >>>= 0;
  4973. var result = Array(length);
  4974. while (++index < length) {
  4975. result[index] = array[index + start];
  4976. }
  4977. return result;
  4978. }
  4979. /**
  4980. * The base implementation of `_.some` without support for iteratee shorthands.
  4981. *
  4982. * @private
  4983. * @param {Array|Object} collection The collection to iterate over.
  4984. * @param {Function} predicate The function invoked per iteration.
  4985. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4986. * else `false`.
  4987. */
  4988. function baseSome(collection, predicate) {
  4989. var result;
  4990. baseEach(collection, function(value, index, collection) {
  4991. result = predicate(value, index, collection);
  4992. return !result;
  4993. });
  4994. return !!result;
  4995. }
  4996. /**
  4997. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4998. * performs a binary search of `array` to determine the index at which `value`
  4999. * should be inserted into `array` in order to maintain its sort order.
  5000. *
  5001. * @private
  5002. * @param {Array} array The sorted array to inspect.
  5003. * @param {*} value The value to evaluate.
  5004. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5005. * @returns {number} Returns the index at which `value` should be inserted
  5006. * into `array`.
  5007. */
  5008. function baseSortedIndex(array, value, retHighest) {
  5009. var low = 0,
  5010. high = array == null ? low : array.length;
  5011. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5012. while (low < high) {
  5013. var mid = (low + high) >>> 1,
  5014. computed = array[mid];
  5015. if (computed !== null && !isSymbol(computed) &&
  5016. (retHighest ? (computed <= value) : (computed < value))) {
  5017. low = mid + 1;
  5018. } else {
  5019. high = mid;
  5020. }
  5021. }
  5022. return high;
  5023. }
  5024. return baseSortedIndexBy(array, value, identity, retHighest);
  5025. }
  5026. /**
  5027. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5028. * which invokes `iteratee` for `value` and each element of `array` to compute
  5029. * their sort ranking. The iteratee is invoked with one argument; (value).
  5030. *
  5031. * @private
  5032. * @param {Array} array The sorted array to inspect.
  5033. * @param {*} value The value to evaluate.
  5034. * @param {Function} iteratee The iteratee invoked per element.
  5035. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5036. * @returns {number} Returns the index at which `value` should be inserted
  5037. * into `array`.
  5038. */
  5039. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5040. var low = 0,
  5041. high = array == null ? 0 : array.length;
  5042. if (high === 0) {
  5043. return 0;
  5044. }
  5045. value = iteratee(value);
  5046. var valIsNaN = value !== value,
  5047. valIsNull = value === null,
  5048. valIsSymbol = isSymbol(value),
  5049. valIsUndefined = value === undefined;
  5050. while (low < high) {
  5051. var mid = nativeFloor((low + high) / 2),
  5052. computed = iteratee(array[mid]),
  5053. othIsDefined = computed !== undefined,
  5054. othIsNull = computed === null,
  5055. othIsReflexive = computed === computed,
  5056. othIsSymbol = isSymbol(computed);
  5057. if (valIsNaN) {
  5058. var setLow = retHighest || othIsReflexive;
  5059. } else if (valIsUndefined) {
  5060. setLow = othIsReflexive && (retHighest || othIsDefined);
  5061. } else if (valIsNull) {
  5062. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5063. } else if (valIsSymbol) {
  5064. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5065. } else if (othIsNull || othIsSymbol) {
  5066. setLow = false;
  5067. } else {
  5068. setLow = retHighest ? (computed <= value) : (computed < value);
  5069. }
  5070. if (setLow) {
  5071. low = mid + 1;
  5072. } else {
  5073. high = mid;
  5074. }
  5075. }
  5076. return nativeMin(high, MAX_ARRAY_INDEX);
  5077. }
  5078. /**
  5079. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5080. * support for iteratee shorthands.
  5081. *
  5082. * @private
  5083. * @param {Array} array The array to inspect.
  5084. * @param {Function} [iteratee] The iteratee invoked per element.
  5085. * @returns {Array} Returns the new duplicate free array.
  5086. */
  5087. function baseSortedUniq(array, iteratee) {
  5088. var index = -1,
  5089. length = array.length,
  5090. resIndex = 0,
  5091. result = [];
  5092. while (++index < length) {
  5093. var value = array[index],
  5094. computed = iteratee ? iteratee(value) : value;
  5095. if (!index || !eq(computed, seen)) {
  5096. var seen = computed;
  5097. result[resIndex++] = value === 0 ? 0 : value;
  5098. }
  5099. }
  5100. return result;
  5101. }
  5102. /**
  5103. * The base implementation of `_.toNumber` which doesn't ensure correct
  5104. * conversions of binary, hexadecimal, or octal string values.
  5105. *
  5106. * @private
  5107. * @param {*} value The value to process.
  5108. * @returns {number} Returns the number.
  5109. */
  5110. function baseToNumber(value) {
  5111. if (typeof value == 'number') {
  5112. return value;
  5113. }
  5114. if (isSymbol(value)) {
  5115. return NAN;
  5116. }
  5117. return +value;
  5118. }
  5119. /**
  5120. * The base implementation of `_.toString` which doesn't convert nullish
  5121. * values to empty strings.
  5122. *
  5123. * @private
  5124. * @param {*} value The value to process.
  5125. * @returns {string} Returns the string.
  5126. */
  5127. function baseToString(value) {
  5128. // Exit early for strings to avoid a performance hit in some environments.
  5129. if (typeof value == 'string') {
  5130. return value;
  5131. }
  5132. if (isArray(value)) {
  5133. // Recursively convert values (susceptible to call stack limits).
  5134. return arrayMap(value, baseToString) + '';
  5135. }
  5136. if (isSymbol(value)) {
  5137. return symbolToString ? symbolToString.call(value) : '';
  5138. }
  5139. var result = (value + '');
  5140. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5141. }
  5142. /**
  5143. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5144. *
  5145. * @private
  5146. * @param {Array} array The array to inspect.
  5147. * @param {Function} [iteratee] The iteratee invoked per element.
  5148. * @param {Function} [comparator] The comparator invoked per element.
  5149. * @returns {Array} Returns the new duplicate free array.
  5150. */
  5151. function baseUniq(array, iteratee, comparator) {
  5152. var index = -1,
  5153. includes = arrayIncludes,
  5154. length = array.length,
  5155. isCommon = true,
  5156. result = [],
  5157. seen = result;
  5158. if (comparator) {
  5159. isCommon = false;
  5160. includes = arrayIncludesWith;
  5161. }
  5162. else if (length >= LARGE_ARRAY_SIZE) {
  5163. var set = iteratee ? null : createSet(array);
  5164. if (set) {
  5165. return setToArray(set);
  5166. }
  5167. isCommon = false;
  5168. includes = cacheHas;
  5169. seen = new SetCache;
  5170. }
  5171. else {
  5172. seen = iteratee ? [] : result;
  5173. }
  5174. outer:
  5175. while (++index < length) {
  5176. var value = array[index],
  5177. computed = iteratee ? iteratee(value) : value;
  5178. value = (comparator || value !== 0) ? value : 0;
  5179. if (isCommon && computed === computed) {
  5180. var seenIndex = seen.length;
  5181. while (seenIndex--) {
  5182. if (seen[seenIndex] === computed) {
  5183. continue outer;
  5184. }
  5185. }
  5186. if (iteratee) {
  5187. seen.push(computed);
  5188. }
  5189. result.push(value);
  5190. }
  5191. else if (!includes(seen, computed, comparator)) {
  5192. if (seen !== result) {
  5193. seen.push(computed);
  5194. }
  5195. result.push(value);
  5196. }
  5197. }
  5198. return result;
  5199. }
  5200. /**
  5201. * The base implementation of `_.unset`.
  5202. *
  5203. * @private
  5204. * @param {Object} object The object to modify.
  5205. * @param {Array|string} path The property path to unset.
  5206. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5207. */
  5208. function baseUnset(object, path) {
  5209. path = castPath(path, object);
  5210. object = parent(object, path);
  5211. return object == null || delete object[toKey(last(path))];
  5212. }
  5213. /**
  5214. * The base implementation of `_.update`.
  5215. *
  5216. * @private
  5217. * @param {Object} object The object to modify.
  5218. * @param {Array|string} path The path of the property to update.
  5219. * @param {Function} updater The function to produce the updated value.
  5220. * @param {Function} [customizer] The function to customize path creation.
  5221. * @returns {Object} Returns `object`.
  5222. */
  5223. function baseUpdate(object, path, updater, customizer) {
  5224. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5225. }
  5226. /**
  5227. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5228. * without support for iteratee shorthands.
  5229. *
  5230. * @private
  5231. * @param {Array} array The array to query.
  5232. * @param {Function} predicate The function invoked per iteration.
  5233. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5234. * @param {boolean} [fromRight] Specify iterating from right to left.
  5235. * @returns {Array} Returns the slice of `array`.
  5236. */
  5237. function baseWhile(array, predicate, isDrop, fromRight) {
  5238. var length = array.length,
  5239. index = fromRight ? length : -1;
  5240. while ((fromRight ? index-- : ++index < length) &&
  5241. predicate(array[index], index, array)) {}
  5242. return isDrop
  5243. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5244. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5245. }
  5246. /**
  5247. * The base implementation of `wrapperValue` which returns the result of
  5248. * performing a sequence of actions on the unwrapped `value`, where each
  5249. * successive action is supplied the return value of the previous.
  5250. *
  5251. * @private
  5252. * @param {*} value The unwrapped value.
  5253. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5254. * @returns {*} Returns the resolved value.
  5255. */
  5256. function baseWrapperValue(value, actions) {
  5257. var result = value;
  5258. if (result instanceof LazyWrapper) {
  5259. result = result.value();
  5260. }
  5261. return arrayReduce(actions, function(result, action) {
  5262. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5263. }, result);
  5264. }
  5265. /**
  5266. * The base implementation of methods like `_.xor`, without support for
  5267. * iteratee shorthands, that accepts an array of arrays to inspect.
  5268. *
  5269. * @private
  5270. * @param {Array} arrays The arrays to inspect.
  5271. * @param {Function} [iteratee] The iteratee invoked per element.
  5272. * @param {Function} [comparator] The comparator invoked per element.
  5273. * @returns {Array} Returns the new array of values.
  5274. */
  5275. function baseXor(arrays, iteratee, comparator) {
  5276. var length = arrays.length;
  5277. if (length < 2) {
  5278. return length ? baseUniq(arrays[0]) : [];
  5279. }
  5280. var index = -1,
  5281. result = Array(length);
  5282. while (++index < length) {
  5283. var array = arrays[index],
  5284. othIndex = -1;
  5285. while (++othIndex < length) {
  5286. if (othIndex != index) {
  5287. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5288. }
  5289. }
  5290. }
  5291. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5292. }
  5293. /**
  5294. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5295. *
  5296. * @private
  5297. * @param {Array} props The property identifiers.
  5298. * @param {Array} values The property values.
  5299. * @param {Function} assignFunc The function to assign values.
  5300. * @returns {Object} Returns the new object.
  5301. */
  5302. function baseZipObject(props, values, assignFunc) {
  5303. var index = -1,
  5304. length = props.length,
  5305. valsLength = values.length,
  5306. result = {};
  5307. while (++index < length) {
  5308. var value = index < valsLength ? values[index] : undefined;
  5309. assignFunc(result, props[index], value);
  5310. }
  5311. return result;
  5312. }
  5313. /**
  5314. * Casts `value` to an empty array if it's not an array like object.
  5315. *
  5316. * @private
  5317. * @param {*} value The value to inspect.
  5318. * @returns {Array|Object} Returns the cast array-like object.
  5319. */
  5320. function castArrayLikeObject(value) {
  5321. return isArrayLikeObject(value) ? value : [];
  5322. }
  5323. /**
  5324. * Casts `value` to `identity` if it's not a function.
  5325. *
  5326. * @private
  5327. * @param {*} value The value to inspect.
  5328. * @returns {Function} Returns cast function.
  5329. */
  5330. function castFunction(value) {
  5331. return typeof value == 'function' ? value : identity;
  5332. }
  5333. /**
  5334. * Casts `value` to a path array if it's not one.
  5335. *
  5336. * @private
  5337. * @param {*} value The value to inspect.
  5338. * @param {Object} [object] The object to query keys on.
  5339. * @returns {Array} Returns the cast property path array.
  5340. */
  5341. function castPath(value, object) {
  5342. if (isArray(value)) {
  5343. return value;
  5344. }
  5345. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5346. }
  5347. /**
  5348. * A `baseRest` alias which can be replaced with `identity` by module
  5349. * replacement plugins.
  5350. *
  5351. * @private
  5352. * @type {Function}
  5353. * @param {Function} func The function to apply a rest parameter to.
  5354. * @returns {Function} Returns the new function.
  5355. */
  5356. var castRest = baseRest;
  5357. /**
  5358. * Casts `array` to a slice if it's needed.
  5359. *
  5360. * @private
  5361. * @param {Array} array The array to inspect.
  5362. * @param {number} start The start position.
  5363. * @param {number} [end=array.length] The end position.
  5364. * @returns {Array} Returns the cast slice.
  5365. */
  5366. function castSlice(array, start, end) {
  5367. var length = array.length;
  5368. end = end === undefined ? length : end;
  5369. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5370. }
  5371. /**
  5372. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5373. *
  5374. * @private
  5375. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5376. */
  5377. var clearTimeout = ctxClearTimeout || function(id) {
  5378. return root.clearTimeout(id);
  5379. };
  5380. /**
  5381. * Creates a clone of `buffer`.
  5382. *
  5383. * @private
  5384. * @param {Buffer} buffer The buffer to clone.
  5385. * @param {boolean} [isDeep] Specify a deep clone.
  5386. * @returns {Buffer} Returns the cloned buffer.
  5387. */
  5388. function cloneBuffer(buffer, isDeep) {
  5389. if (isDeep) {
  5390. return buffer.slice();
  5391. }
  5392. var length = buffer.length,
  5393. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5394. buffer.copy(result);
  5395. return result;
  5396. }
  5397. /**
  5398. * Creates a clone of `arrayBuffer`.
  5399. *
  5400. * @private
  5401. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5402. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5403. */
  5404. function cloneArrayBuffer(arrayBuffer) {
  5405. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5406. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5407. return result;
  5408. }
  5409. /**
  5410. * Creates a clone of `dataView`.
  5411. *
  5412. * @private
  5413. * @param {Object} dataView The data view to clone.
  5414. * @param {boolean} [isDeep] Specify a deep clone.
  5415. * @returns {Object} Returns the cloned data view.
  5416. */
  5417. function cloneDataView(dataView, isDeep) {
  5418. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5419. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5420. }
  5421. /**
  5422. * Creates a clone of `regexp`.
  5423. *
  5424. * @private
  5425. * @param {Object} regexp The regexp to clone.
  5426. * @returns {Object} Returns the cloned regexp.
  5427. */
  5428. function cloneRegExp(regexp) {
  5429. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5430. result.lastIndex = regexp.lastIndex;
  5431. return result;
  5432. }
  5433. /**
  5434. * Creates a clone of the `symbol` object.
  5435. *
  5436. * @private
  5437. * @param {Object} symbol The symbol object to clone.
  5438. * @returns {Object} Returns the cloned symbol object.
  5439. */
  5440. function cloneSymbol(symbol) {
  5441. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5442. }
  5443. /**
  5444. * Creates a clone of `typedArray`.
  5445. *
  5446. * @private
  5447. * @param {Object} typedArray The typed array to clone.
  5448. * @param {boolean} [isDeep] Specify a deep clone.
  5449. * @returns {Object} Returns the cloned typed array.
  5450. */
  5451. function cloneTypedArray(typedArray, isDeep) {
  5452. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5453. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5454. }
  5455. /**
  5456. * Compares values to sort them in ascending order.
  5457. *
  5458. * @private
  5459. * @param {*} value The value to compare.
  5460. * @param {*} other The other value to compare.
  5461. * @returns {number} Returns the sort order indicator for `value`.
  5462. */
  5463. function compareAscending(value, other) {
  5464. if (value !== other) {
  5465. var valIsDefined = value !== undefined,
  5466. valIsNull = value === null,
  5467. valIsReflexive = value === value,
  5468. valIsSymbol = isSymbol(value);
  5469. var othIsDefined = other !== undefined,
  5470. othIsNull = other === null,
  5471. othIsReflexive = other === other,
  5472. othIsSymbol = isSymbol(other);
  5473. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5474. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5475. (valIsNull && othIsDefined && othIsReflexive) ||
  5476. (!valIsDefined && othIsReflexive) ||
  5477. !valIsReflexive) {
  5478. return 1;
  5479. }
  5480. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5481. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5482. (othIsNull && valIsDefined && valIsReflexive) ||
  5483. (!othIsDefined && valIsReflexive) ||
  5484. !othIsReflexive) {
  5485. return -1;
  5486. }
  5487. }
  5488. return 0;
  5489. }
  5490. /**
  5491. * Used by `_.orderBy` to compare multiple properties of a value to another
  5492. * and stable sort them.
  5493. *
  5494. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5495. * specify an order of "desc" for descending or "asc" for ascending sort order
  5496. * of corresponding values.
  5497. *
  5498. * @private
  5499. * @param {Object} object The object to compare.
  5500. * @param {Object} other The other object to compare.
  5501. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5502. * @returns {number} Returns the sort order indicator for `object`.
  5503. */
  5504. function compareMultiple(object, other, orders) {
  5505. var index = -1,
  5506. objCriteria = object.criteria,
  5507. othCriteria = other.criteria,
  5508. length = objCriteria.length,
  5509. ordersLength = orders.length;
  5510. while (++index < length) {
  5511. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5512. if (result) {
  5513. if (index >= ordersLength) {
  5514. return result;
  5515. }
  5516. var order = orders[index];
  5517. return result * (order == 'desc' ? -1 : 1);
  5518. }
  5519. }
  5520. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5521. // that causes it, under certain circumstances, to provide the same value for
  5522. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5523. // for more details.
  5524. //
  5525. // This also ensures a stable sort in V8 and other engines.
  5526. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5527. return object.index - other.index;
  5528. }
  5529. /**
  5530. * Creates an array that is the composition of partially applied arguments,
  5531. * placeholders, and provided arguments into a single array of arguments.
  5532. *
  5533. * @private
  5534. * @param {Array} args The provided arguments.
  5535. * @param {Array} partials The arguments to prepend to those provided.
  5536. * @param {Array} holders The `partials` placeholder indexes.
  5537. * @params {boolean} [isCurried] Specify composing for a curried function.
  5538. * @returns {Array} Returns the new array of composed arguments.
  5539. */
  5540. function composeArgs(args, partials, holders, isCurried) {
  5541. var argsIndex = -1,
  5542. argsLength = args.length,
  5543. holdersLength = holders.length,
  5544. leftIndex = -1,
  5545. leftLength = partials.length,
  5546. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5547. result = Array(leftLength + rangeLength),
  5548. isUncurried = !isCurried;
  5549. while (++leftIndex < leftLength) {
  5550. result[leftIndex] = partials[leftIndex];
  5551. }
  5552. while (++argsIndex < holdersLength) {
  5553. if (isUncurried || argsIndex < argsLength) {
  5554. result[holders[argsIndex]] = args[argsIndex];
  5555. }
  5556. }
  5557. while (rangeLength--) {
  5558. result[leftIndex++] = args[argsIndex++];
  5559. }
  5560. return result;
  5561. }
  5562. /**
  5563. * This function is like `composeArgs` except that the arguments composition
  5564. * is tailored for `_.partialRight`.
  5565. *
  5566. * @private
  5567. * @param {Array} args The provided arguments.
  5568. * @param {Array} partials The arguments to append to those provided.
  5569. * @param {Array} holders The `partials` placeholder indexes.
  5570. * @params {boolean} [isCurried] Specify composing for a curried function.
  5571. * @returns {Array} Returns the new array of composed arguments.
  5572. */
  5573. function composeArgsRight(args, partials, holders, isCurried) {
  5574. var argsIndex = -1,
  5575. argsLength = args.length,
  5576. holdersIndex = -1,
  5577. holdersLength = holders.length,
  5578. rightIndex = -1,
  5579. rightLength = partials.length,
  5580. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5581. result = Array(rangeLength + rightLength),
  5582. isUncurried = !isCurried;
  5583. while (++argsIndex < rangeLength) {
  5584. result[argsIndex] = args[argsIndex];
  5585. }
  5586. var offset = argsIndex;
  5587. while (++rightIndex < rightLength) {
  5588. result[offset + rightIndex] = partials[rightIndex];
  5589. }
  5590. while (++holdersIndex < holdersLength) {
  5591. if (isUncurried || argsIndex < argsLength) {
  5592. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5593. }
  5594. }
  5595. return result;
  5596. }
  5597. /**
  5598. * Copies the values of `source` to `array`.
  5599. *
  5600. * @private
  5601. * @param {Array} source The array to copy values from.
  5602. * @param {Array} [array=[]] The array to copy values to.
  5603. * @returns {Array} Returns `array`.
  5604. */
  5605. function copyArray(source, array) {
  5606. var index = -1,
  5607. length = source.length;
  5608. array || (array = Array(length));
  5609. while (++index < length) {
  5610. array[index] = source[index];
  5611. }
  5612. return array;
  5613. }
  5614. /**
  5615. * Copies properties of `source` to `object`.
  5616. *
  5617. * @private
  5618. * @param {Object} source The object to copy properties from.
  5619. * @param {Array} props The property identifiers to copy.
  5620. * @param {Object} [object={}] The object to copy properties to.
  5621. * @param {Function} [customizer] The function to customize copied values.
  5622. * @returns {Object} Returns `object`.
  5623. */
  5624. function copyObject(source, props, object, customizer) {
  5625. var isNew = !object;
  5626. object || (object = {});
  5627. var index = -1,
  5628. length = props.length;
  5629. while (++index < length) {
  5630. var key = props[index];
  5631. var newValue = customizer
  5632. ? customizer(object[key], source[key], key, object, source)
  5633. : undefined;
  5634. if (newValue === undefined) {
  5635. newValue = source[key];
  5636. }
  5637. if (isNew) {
  5638. baseAssignValue(object, key, newValue);
  5639. } else {
  5640. assignValue(object, key, newValue);
  5641. }
  5642. }
  5643. return object;
  5644. }
  5645. /**
  5646. * Copies own symbols of `source` to `object`.
  5647. *
  5648. * @private
  5649. * @param {Object} source The object to copy symbols from.
  5650. * @param {Object} [object={}] The object to copy symbols to.
  5651. * @returns {Object} Returns `object`.
  5652. */
  5653. function copySymbols(source, object) {
  5654. return copyObject(source, getSymbols(source), object);
  5655. }
  5656. /**
  5657. * Copies own and inherited symbols of `source` to `object`.
  5658. *
  5659. * @private
  5660. * @param {Object} source The object to copy symbols from.
  5661. * @param {Object} [object={}] The object to copy symbols to.
  5662. * @returns {Object} Returns `object`.
  5663. */
  5664. function copySymbolsIn(source, object) {
  5665. return copyObject(source, getSymbolsIn(source), object);
  5666. }
  5667. /**
  5668. * Creates a function like `_.groupBy`.
  5669. *
  5670. * @private
  5671. * @param {Function} setter The function to set accumulator values.
  5672. * @param {Function} [initializer] The accumulator object initializer.
  5673. * @returns {Function} Returns the new aggregator function.
  5674. */
  5675. function createAggregator(setter, initializer) {
  5676. return function(collection, iteratee) {
  5677. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5678. accumulator = initializer ? initializer() : {};
  5679. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5680. };
  5681. }
  5682. /**
  5683. * Creates a function like `_.assign`.
  5684. *
  5685. * @private
  5686. * @param {Function} assigner The function to assign values.
  5687. * @returns {Function} Returns the new assigner function.
  5688. */
  5689. function createAssigner(assigner) {
  5690. return baseRest(function(object, sources) {
  5691. var index = -1,
  5692. length = sources.length,
  5693. customizer = length > 1 ? sources[length - 1] : undefined,
  5694. guard = length > 2 ? sources[2] : undefined;
  5695. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5696. ? (length--, customizer)
  5697. : undefined;
  5698. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5699. customizer = length < 3 ? undefined : customizer;
  5700. length = 1;
  5701. }
  5702. object = Object(object);
  5703. while (++index < length) {
  5704. var source = sources[index];
  5705. if (source) {
  5706. assigner(object, source, index, customizer);
  5707. }
  5708. }
  5709. return object;
  5710. });
  5711. }
  5712. /**
  5713. * Creates a `baseEach` or `baseEachRight` function.
  5714. *
  5715. * @private
  5716. * @param {Function} eachFunc The function to iterate over a collection.
  5717. * @param {boolean} [fromRight] Specify iterating from right to left.
  5718. * @returns {Function} Returns the new base function.
  5719. */
  5720. function createBaseEach(eachFunc, fromRight) {
  5721. return function(collection, iteratee) {
  5722. if (collection == null) {
  5723. return collection;
  5724. }
  5725. if (!isArrayLike(collection)) {
  5726. return eachFunc(collection, iteratee);
  5727. }
  5728. var length = collection.length,
  5729. index = fromRight ? length : -1,
  5730. iterable = Object(collection);
  5731. while ((fromRight ? index-- : ++index < length)) {
  5732. if (iteratee(iterable[index], index, iterable) === false) {
  5733. break;
  5734. }
  5735. }
  5736. return collection;
  5737. };
  5738. }
  5739. /**
  5740. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5741. *
  5742. * @private
  5743. * @param {boolean} [fromRight] Specify iterating from right to left.
  5744. * @returns {Function} Returns the new base function.
  5745. */
  5746. function createBaseFor(fromRight) {
  5747. return function(object, iteratee, keysFunc) {
  5748. var index = -1,
  5749. iterable = Object(object),
  5750. props = keysFunc(object),
  5751. length = props.length;
  5752. while (length--) {
  5753. var key = props[fromRight ? length : ++index];
  5754. if (iteratee(iterable[key], key, iterable) === false) {
  5755. break;
  5756. }
  5757. }
  5758. return object;
  5759. };
  5760. }
  5761. /**
  5762. * Creates a function that wraps `func` to invoke it with the optional `this`
  5763. * binding of `thisArg`.
  5764. *
  5765. * @private
  5766. * @param {Function} func The function to wrap.
  5767. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5768. * @param {*} [thisArg] The `this` binding of `func`.
  5769. * @returns {Function} Returns the new wrapped function.
  5770. */
  5771. function createBind(func, bitmask, thisArg) {
  5772. var isBind = bitmask & WRAP_BIND_FLAG,
  5773. Ctor = createCtor(func);
  5774. function wrapper() {
  5775. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5776. return fn.apply(isBind ? thisArg : this, arguments);
  5777. }
  5778. return wrapper;
  5779. }
  5780. /**
  5781. * Creates a function like `_.lowerFirst`.
  5782. *
  5783. * @private
  5784. * @param {string} methodName The name of the `String` case method to use.
  5785. * @returns {Function} Returns the new case function.
  5786. */
  5787. function createCaseFirst(methodName) {
  5788. return function(string) {
  5789. string = toString(string);
  5790. var strSymbols = hasUnicode(string)
  5791. ? stringToArray(string)
  5792. : undefined;
  5793. var chr = strSymbols
  5794. ? strSymbols[0]
  5795. : string.charAt(0);
  5796. var trailing = strSymbols
  5797. ? castSlice(strSymbols, 1).join('')
  5798. : string.slice(1);
  5799. return chr[methodName]() + trailing;
  5800. };
  5801. }
  5802. /**
  5803. * Creates a function like `_.camelCase`.
  5804. *
  5805. * @private
  5806. * @param {Function} callback The function to combine each word.
  5807. * @returns {Function} Returns the new compounder function.
  5808. */
  5809. function createCompounder(callback) {
  5810. return function(string) {
  5811. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5812. };
  5813. }
  5814. /**
  5815. * Creates a function that produces an instance of `Ctor` regardless of
  5816. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5817. *
  5818. * @private
  5819. * @param {Function} Ctor The constructor to wrap.
  5820. * @returns {Function} Returns the new wrapped function.
  5821. */
  5822. function createCtor(Ctor) {
  5823. return function() {
  5824. // Use a `switch` statement to work with class constructors. See
  5825. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5826. // for more details.
  5827. var args = arguments;
  5828. switch (args.length) {
  5829. case 0: return new Ctor;
  5830. case 1: return new Ctor(args[0]);
  5831. case 2: return new Ctor(args[0], args[1]);
  5832. case 3: return new Ctor(args[0], args[1], args[2]);
  5833. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5834. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5835. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5836. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5837. }
  5838. var thisBinding = baseCreate(Ctor.prototype),
  5839. result = Ctor.apply(thisBinding, args);
  5840. // Mimic the constructor's `return` behavior.
  5841. // See https://es5.github.io/#x13.2.2 for more details.
  5842. return isObject(result) ? result : thisBinding;
  5843. };
  5844. }
  5845. /**
  5846. * Creates a function that wraps `func` to enable currying.
  5847. *
  5848. * @private
  5849. * @param {Function} func The function to wrap.
  5850. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5851. * @param {number} arity The arity of `func`.
  5852. * @returns {Function} Returns the new wrapped function.
  5853. */
  5854. function createCurry(func, bitmask, arity) {
  5855. var Ctor = createCtor(func);
  5856. function wrapper() {
  5857. var length = arguments.length,
  5858. args = Array(length),
  5859. index = length,
  5860. placeholder = getHolder(wrapper);
  5861. while (index--) {
  5862. args[index] = arguments[index];
  5863. }
  5864. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5865. ? []
  5866. : replaceHolders(args, placeholder);
  5867. length -= holders.length;
  5868. if (length < arity) {
  5869. return createRecurry(
  5870. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5871. args, holders, undefined, undefined, arity - length);
  5872. }
  5873. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5874. return apply(fn, this, args);
  5875. }
  5876. return wrapper;
  5877. }
  5878. /**
  5879. * Creates a `_.find` or `_.findLast` function.
  5880. *
  5881. * @private
  5882. * @param {Function} findIndexFunc The function to find the collection index.
  5883. * @returns {Function} Returns the new find function.
  5884. */
  5885. function createFind(findIndexFunc) {
  5886. return function(collection, predicate, fromIndex) {
  5887. var iterable = Object(collection);
  5888. if (!isArrayLike(collection)) {
  5889. var iteratee = getIteratee(predicate, 3);
  5890. collection = keys(collection);
  5891. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5892. }
  5893. var index = findIndexFunc(collection, predicate, fromIndex);
  5894. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5895. };
  5896. }
  5897. /**
  5898. * Creates a `_.flow` or `_.flowRight` function.
  5899. *
  5900. * @private
  5901. * @param {boolean} [fromRight] Specify iterating from right to left.
  5902. * @returns {Function} Returns the new flow function.
  5903. */
  5904. function createFlow(fromRight) {
  5905. return flatRest(function(funcs) {
  5906. var length = funcs.length,
  5907. index = length,
  5908. prereq = LodashWrapper.prototype.thru;
  5909. if (fromRight) {
  5910. funcs.reverse();
  5911. }
  5912. while (index--) {
  5913. var func = funcs[index];
  5914. if (typeof func != 'function') {
  5915. throw new TypeError(FUNC_ERROR_TEXT);
  5916. }
  5917. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5918. var wrapper = new LodashWrapper([], true);
  5919. }
  5920. }
  5921. index = wrapper ? index : length;
  5922. while (++index < length) {
  5923. func = funcs[index];
  5924. var funcName = getFuncName(func),
  5925. data = funcName == 'wrapper' ? getData(func) : undefined;
  5926. if (data && isLaziable(data[0]) &&
  5927. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5928. !data[4].length && data[9] == 1
  5929. ) {
  5930. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5931. } else {
  5932. wrapper = (func.length == 1 && isLaziable(func))
  5933. ? wrapper[funcName]()
  5934. : wrapper.thru(func);
  5935. }
  5936. }
  5937. return function() {
  5938. var args = arguments,
  5939. value = args[0];
  5940. if (wrapper && args.length == 1 && isArray(value)) {
  5941. return wrapper.plant(value).value();
  5942. }
  5943. var index = 0,
  5944. result = length ? funcs[index].apply(this, args) : value;
  5945. while (++index < length) {
  5946. result = funcs[index].call(this, result);
  5947. }
  5948. return result;
  5949. };
  5950. });
  5951. }
  5952. /**
  5953. * Creates a function that wraps `func` to invoke it with optional `this`
  5954. * binding of `thisArg`, partial application, and currying.
  5955. *
  5956. * @private
  5957. * @param {Function|string} func The function or method name to wrap.
  5958. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5959. * @param {*} [thisArg] The `this` binding of `func`.
  5960. * @param {Array} [partials] The arguments to prepend to those provided to
  5961. * the new function.
  5962. * @param {Array} [holders] The `partials` placeholder indexes.
  5963. * @param {Array} [partialsRight] The arguments to append to those provided
  5964. * to the new function.
  5965. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5966. * @param {Array} [argPos] The argument positions of the new function.
  5967. * @param {number} [ary] The arity cap of `func`.
  5968. * @param {number} [arity] The arity of `func`.
  5969. * @returns {Function} Returns the new wrapped function.
  5970. */
  5971. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5972. var isAry = bitmask & WRAP_ARY_FLAG,
  5973. isBind = bitmask & WRAP_BIND_FLAG,
  5974. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5975. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5976. isFlip = bitmask & WRAP_FLIP_FLAG,
  5977. Ctor = isBindKey ? undefined : createCtor(func);
  5978. function wrapper() {
  5979. var length = arguments.length,
  5980. args = Array(length),
  5981. index = length;
  5982. while (index--) {
  5983. args[index] = arguments[index];
  5984. }
  5985. if (isCurried) {
  5986. var placeholder = getHolder(wrapper),
  5987. holdersCount = countHolders(args, placeholder);
  5988. }
  5989. if (partials) {
  5990. args = composeArgs(args, partials, holders, isCurried);
  5991. }
  5992. if (partialsRight) {
  5993. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5994. }
  5995. length -= holdersCount;
  5996. if (isCurried && length < arity) {
  5997. var newHolders = replaceHolders(args, placeholder);
  5998. return createRecurry(
  5999. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6000. args, newHolders, argPos, ary, arity - length
  6001. );
  6002. }
  6003. var thisBinding = isBind ? thisArg : this,
  6004. fn = isBindKey ? thisBinding[func] : func;
  6005. length = args.length;
  6006. if (argPos) {
  6007. args = reorder(args, argPos);
  6008. } else if (isFlip && length > 1) {
  6009. args.reverse();
  6010. }
  6011. if (isAry && ary < length) {
  6012. args.length = ary;
  6013. }
  6014. if (this && this !== root && this instanceof wrapper) {
  6015. fn = Ctor || createCtor(fn);
  6016. }
  6017. return fn.apply(thisBinding, args);
  6018. }
  6019. return wrapper;
  6020. }
  6021. /**
  6022. * Creates a function like `_.invertBy`.
  6023. *
  6024. * @private
  6025. * @param {Function} setter The function to set accumulator values.
  6026. * @param {Function} toIteratee The function to resolve iteratees.
  6027. * @returns {Function} Returns the new inverter function.
  6028. */
  6029. function createInverter(setter, toIteratee) {
  6030. return function(object, iteratee) {
  6031. return baseInverter(object, setter, toIteratee(iteratee), {});
  6032. };
  6033. }
  6034. /**
  6035. * Creates a function that performs a mathematical operation on two values.
  6036. *
  6037. * @private
  6038. * @param {Function} operator The function to perform the operation.
  6039. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6040. * @returns {Function} Returns the new mathematical operation function.
  6041. */
  6042. function createMathOperation(operator, defaultValue) {
  6043. return function(value, other) {
  6044. var result;
  6045. if (value === undefined && other === undefined) {
  6046. return defaultValue;
  6047. }
  6048. if (value !== undefined) {
  6049. result = value;
  6050. }
  6051. if (other !== undefined) {
  6052. if (result === undefined) {
  6053. return other;
  6054. }
  6055. if (typeof value == 'string' || typeof other == 'string') {
  6056. value = baseToString(value);
  6057. other = baseToString(other);
  6058. } else {
  6059. value = baseToNumber(value);
  6060. other = baseToNumber(other);
  6061. }
  6062. result = operator(value, other);
  6063. }
  6064. return result;
  6065. };
  6066. }
  6067. /**
  6068. * Creates a function like `_.over`.
  6069. *
  6070. * @private
  6071. * @param {Function} arrayFunc The function to iterate over iteratees.
  6072. * @returns {Function} Returns the new over function.
  6073. */
  6074. function createOver(arrayFunc) {
  6075. return flatRest(function(iteratees) {
  6076. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6077. return baseRest(function(args) {
  6078. var thisArg = this;
  6079. return arrayFunc(iteratees, function(iteratee) {
  6080. return apply(iteratee, thisArg, args);
  6081. });
  6082. });
  6083. });
  6084. }
  6085. /**
  6086. * Creates the padding for `string` based on `length`. The `chars` string
  6087. * is truncated if the number of characters exceeds `length`.
  6088. *
  6089. * @private
  6090. * @param {number} length The padding length.
  6091. * @param {string} [chars=' '] The string used as padding.
  6092. * @returns {string} Returns the padding for `string`.
  6093. */
  6094. function createPadding(length, chars) {
  6095. chars = chars === undefined ? ' ' : baseToString(chars);
  6096. var charsLength = chars.length;
  6097. if (charsLength < 2) {
  6098. return charsLength ? baseRepeat(chars, length) : chars;
  6099. }
  6100. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6101. return hasUnicode(chars)
  6102. ? castSlice(stringToArray(result), 0, length).join('')
  6103. : result.slice(0, length);
  6104. }
  6105. /**
  6106. * Creates a function that wraps `func` to invoke it with the `this` binding
  6107. * of `thisArg` and `partials` prepended to the arguments it receives.
  6108. *
  6109. * @private
  6110. * @param {Function} func The function to wrap.
  6111. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6112. * @param {*} thisArg The `this` binding of `func`.
  6113. * @param {Array} partials The arguments to prepend to those provided to
  6114. * the new function.
  6115. * @returns {Function} Returns the new wrapped function.
  6116. */
  6117. function createPartial(func, bitmask, thisArg, partials) {
  6118. var isBind = bitmask & WRAP_BIND_FLAG,
  6119. Ctor = createCtor(func);
  6120. function wrapper() {
  6121. var argsIndex = -1,
  6122. argsLength = arguments.length,
  6123. leftIndex = -1,
  6124. leftLength = partials.length,
  6125. args = Array(leftLength + argsLength),
  6126. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6127. while (++leftIndex < leftLength) {
  6128. args[leftIndex] = partials[leftIndex];
  6129. }
  6130. while (argsLength--) {
  6131. args[leftIndex++] = arguments[++argsIndex];
  6132. }
  6133. return apply(fn, isBind ? thisArg : this, args);
  6134. }
  6135. return wrapper;
  6136. }
  6137. /**
  6138. * Creates a `_.range` or `_.rangeRight` function.
  6139. *
  6140. * @private
  6141. * @param {boolean} [fromRight] Specify iterating from right to left.
  6142. * @returns {Function} Returns the new range function.
  6143. */
  6144. function createRange(fromRight) {
  6145. return function(start, end, step) {
  6146. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6147. end = step = undefined;
  6148. }
  6149. // Ensure the sign of `-0` is preserved.
  6150. start = toFinite(start);
  6151. if (end === undefined) {
  6152. end = start;
  6153. start = 0;
  6154. } else {
  6155. end = toFinite(end);
  6156. }
  6157. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6158. return baseRange(start, end, step, fromRight);
  6159. };
  6160. }
  6161. /**
  6162. * Creates a function that performs a relational operation on two values.
  6163. *
  6164. * @private
  6165. * @param {Function} operator The function to perform the operation.
  6166. * @returns {Function} Returns the new relational operation function.
  6167. */
  6168. function createRelationalOperation(operator) {
  6169. return function(value, other) {
  6170. if (!(typeof value == 'string' && typeof other == 'string')) {
  6171. value = toNumber(value);
  6172. other = toNumber(other);
  6173. }
  6174. return operator(value, other);
  6175. };
  6176. }
  6177. /**
  6178. * Creates a function that wraps `func` to continue currying.
  6179. *
  6180. * @private
  6181. * @param {Function} func The function to wrap.
  6182. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6183. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6184. * @param {*} placeholder The placeholder value.
  6185. * @param {*} [thisArg] The `this` binding of `func`.
  6186. * @param {Array} [partials] The arguments to prepend to those provided to
  6187. * the new function.
  6188. * @param {Array} [holders] The `partials` placeholder indexes.
  6189. * @param {Array} [argPos] The argument positions of the new function.
  6190. * @param {number} [ary] The arity cap of `func`.
  6191. * @param {number} [arity] The arity of `func`.
  6192. * @returns {Function} Returns the new wrapped function.
  6193. */
  6194. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6195. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6196. newHolders = isCurry ? holders : undefined,
  6197. newHoldersRight = isCurry ? undefined : holders,
  6198. newPartials = isCurry ? partials : undefined,
  6199. newPartialsRight = isCurry ? undefined : partials;
  6200. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6201. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6202. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6203. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6204. }
  6205. var newData = [
  6206. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6207. newHoldersRight, argPos, ary, arity
  6208. ];
  6209. var result = wrapFunc.apply(undefined, newData);
  6210. if (isLaziable(func)) {
  6211. setData(result, newData);
  6212. }
  6213. result.placeholder = placeholder;
  6214. return setWrapToString(result, func, bitmask);
  6215. }
  6216. /**
  6217. * Creates a function like `_.round`.
  6218. *
  6219. * @private
  6220. * @param {string} methodName The name of the `Math` method to use when rounding.
  6221. * @returns {Function} Returns the new round function.
  6222. */
  6223. function createRound(methodName) {
  6224. var func = Math[methodName];
  6225. return function(number, precision) {
  6226. number = toNumber(number);
  6227. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6228. if (precision && nativeIsFinite(number)) {
  6229. // Shift with exponential notation to avoid floating-point issues.
  6230. // See [MDN](https://mdn.io/round#Examples) for more details.
  6231. var pair = (toString(number) + 'e').split('e'),
  6232. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6233. pair = (toString(value) + 'e').split('e');
  6234. return +(pair[0] + 'e' + (+pair[1] - precision));
  6235. }
  6236. return func(number);
  6237. };
  6238. }
  6239. /**
  6240. * Creates a set object of `values`.
  6241. *
  6242. * @private
  6243. * @param {Array} values The values to add to the set.
  6244. * @returns {Object} Returns the new set.
  6245. */
  6246. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6247. return new Set(values);
  6248. };
  6249. /**
  6250. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6251. *
  6252. * @private
  6253. * @param {Function} keysFunc The function to get the keys of a given object.
  6254. * @returns {Function} Returns the new pairs function.
  6255. */
  6256. function createToPairs(keysFunc) {
  6257. return function(object) {
  6258. var tag = getTag(object);
  6259. if (tag == mapTag) {
  6260. return mapToArray(object);
  6261. }
  6262. if (tag == setTag) {
  6263. return setToPairs(object);
  6264. }
  6265. return baseToPairs(object, keysFunc(object));
  6266. };
  6267. }
  6268. /**
  6269. * Creates a function that either curries or invokes `func` with optional
  6270. * `this` binding and partially applied arguments.
  6271. *
  6272. * @private
  6273. * @param {Function|string} func The function or method name to wrap.
  6274. * @param {number} bitmask The bitmask flags.
  6275. * 1 - `_.bind`
  6276. * 2 - `_.bindKey`
  6277. * 4 - `_.curry` or `_.curryRight` of a bound function
  6278. * 8 - `_.curry`
  6279. * 16 - `_.curryRight`
  6280. * 32 - `_.partial`
  6281. * 64 - `_.partialRight`
  6282. * 128 - `_.rearg`
  6283. * 256 - `_.ary`
  6284. * 512 - `_.flip`
  6285. * @param {*} [thisArg] The `this` binding of `func`.
  6286. * @param {Array} [partials] The arguments to be partially applied.
  6287. * @param {Array} [holders] The `partials` placeholder indexes.
  6288. * @param {Array} [argPos] The argument positions of the new function.
  6289. * @param {number} [ary] The arity cap of `func`.
  6290. * @param {number} [arity] The arity of `func`.
  6291. * @returns {Function} Returns the new wrapped function.
  6292. */
  6293. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6294. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6295. if (!isBindKey && typeof func != 'function') {
  6296. throw new TypeError(FUNC_ERROR_TEXT);
  6297. }
  6298. var length = partials ? partials.length : 0;
  6299. if (!length) {
  6300. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6301. partials = holders = undefined;
  6302. }
  6303. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6304. arity = arity === undefined ? arity : toInteger(arity);
  6305. length -= holders ? holders.length : 0;
  6306. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6307. var partialsRight = partials,
  6308. holdersRight = holders;
  6309. partials = holders = undefined;
  6310. }
  6311. var data = isBindKey ? undefined : getData(func);
  6312. var newData = [
  6313. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6314. argPos, ary, arity
  6315. ];
  6316. if (data) {
  6317. mergeData(newData, data);
  6318. }
  6319. func = newData[0];
  6320. bitmask = newData[1];
  6321. thisArg = newData[2];
  6322. partials = newData[3];
  6323. holders = newData[4];
  6324. arity = newData[9] = newData[9] === undefined
  6325. ? (isBindKey ? 0 : func.length)
  6326. : nativeMax(newData[9] - length, 0);
  6327. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6328. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6329. }
  6330. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6331. var result = createBind(func, bitmask, thisArg);
  6332. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6333. result = createCurry(func, bitmask, arity);
  6334. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6335. result = createPartial(func, bitmask, thisArg, partials);
  6336. } else {
  6337. result = createHybrid.apply(undefined, newData);
  6338. }
  6339. var setter = data ? baseSetData : setData;
  6340. return setWrapToString(setter(result, newData), func, bitmask);
  6341. }
  6342. /**
  6343. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6344. * of source objects to the destination object for all destination properties
  6345. * that resolve to `undefined`.
  6346. *
  6347. * @private
  6348. * @param {*} objValue The destination value.
  6349. * @param {*} srcValue The source value.
  6350. * @param {string} key The key of the property to assign.
  6351. * @param {Object} object The parent object of `objValue`.
  6352. * @returns {*} Returns the value to assign.
  6353. */
  6354. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6355. if (objValue === undefined ||
  6356. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6357. return srcValue;
  6358. }
  6359. return objValue;
  6360. }
  6361. /**
  6362. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6363. * objects into destination objects that are passed thru.
  6364. *
  6365. * @private
  6366. * @param {*} objValue The destination value.
  6367. * @param {*} srcValue The source value.
  6368. * @param {string} key The key of the property to merge.
  6369. * @param {Object} object The parent object of `objValue`.
  6370. * @param {Object} source The parent object of `srcValue`.
  6371. * @param {Object} [stack] Tracks traversed source values and their merged
  6372. * counterparts.
  6373. * @returns {*} Returns the value to assign.
  6374. */
  6375. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6376. if (isObject(objValue) && isObject(srcValue)) {
  6377. // Recursively merge objects and arrays (susceptible to call stack limits).
  6378. stack.set(srcValue, objValue);
  6379. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6380. stack['delete'](srcValue);
  6381. }
  6382. return objValue;
  6383. }
  6384. /**
  6385. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6386. * objects.
  6387. *
  6388. * @private
  6389. * @param {*} value The value to inspect.
  6390. * @param {string} key The key of the property to inspect.
  6391. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6392. */
  6393. function customOmitClone(value) {
  6394. return isPlainObject(value) ? undefined : value;
  6395. }
  6396. /**
  6397. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6398. * partial deep comparisons.
  6399. *
  6400. * @private
  6401. * @param {Array} array The array to compare.
  6402. * @param {Array} other The other array to compare.
  6403. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6404. * @param {Function} customizer The function to customize comparisons.
  6405. * @param {Function} equalFunc The function to determine equivalents of values.
  6406. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6407. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6408. */
  6409. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6410. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6411. arrLength = array.length,
  6412. othLength = other.length;
  6413. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6414. return false;
  6415. }
  6416. // Check that cyclic values are equal.
  6417. var arrStacked = stack.get(array);
  6418. var othStacked = stack.get(other);
  6419. if (arrStacked && othStacked) {
  6420. return arrStacked == other && othStacked == array;
  6421. }
  6422. var index = -1,
  6423. result = true,
  6424. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6425. stack.set(array, other);
  6426. stack.set(other, array);
  6427. // Ignore non-index properties.
  6428. while (++index < arrLength) {
  6429. var arrValue = array[index],
  6430. othValue = other[index];
  6431. if (customizer) {
  6432. var compared = isPartial
  6433. ? customizer(othValue, arrValue, index, other, array, stack)
  6434. : customizer(arrValue, othValue, index, array, other, stack);
  6435. }
  6436. if (compared !== undefined) {
  6437. if (compared) {
  6438. continue;
  6439. }
  6440. result = false;
  6441. break;
  6442. }
  6443. // Recursively compare arrays (susceptible to call stack limits).
  6444. if (seen) {
  6445. if (!arraySome(other, function(othValue, othIndex) {
  6446. if (!cacheHas(seen, othIndex) &&
  6447. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6448. return seen.push(othIndex);
  6449. }
  6450. })) {
  6451. result = false;
  6452. break;
  6453. }
  6454. } else if (!(
  6455. arrValue === othValue ||
  6456. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6457. )) {
  6458. result = false;
  6459. break;
  6460. }
  6461. }
  6462. stack['delete'](array);
  6463. stack['delete'](other);
  6464. return result;
  6465. }
  6466. /**
  6467. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6468. * the same `toStringTag`.
  6469. *
  6470. * **Note:** This function only supports comparing values with tags of
  6471. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6472. *
  6473. * @private
  6474. * @param {Object} object The object to compare.
  6475. * @param {Object} other The other object to compare.
  6476. * @param {string} tag The `toStringTag` of the objects to compare.
  6477. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6478. * @param {Function} customizer The function to customize comparisons.
  6479. * @param {Function} equalFunc The function to determine equivalents of values.
  6480. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6481. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6482. */
  6483. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6484. switch (tag) {
  6485. case dataViewTag:
  6486. if ((object.byteLength != other.byteLength) ||
  6487. (object.byteOffset != other.byteOffset)) {
  6488. return false;
  6489. }
  6490. object = object.buffer;
  6491. other = other.buffer;
  6492. case arrayBufferTag:
  6493. if ((object.byteLength != other.byteLength) ||
  6494. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6495. return false;
  6496. }
  6497. return true;
  6498. case boolTag:
  6499. case dateTag:
  6500. case numberTag:
  6501. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6502. // Invalid dates are coerced to `NaN`.
  6503. return eq(+object, +other);
  6504. case errorTag:
  6505. return object.name == other.name && object.message == other.message;
  6506. case regexpTag:
  6507. case stringTag:
  6508. // Coerce regexes to strings and treat strings, primitives and objects,
  6509. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6510. // for more details.
  6511. return object == (other + '');
  6512. case mapTag:
  6513. var convert = mapToArray;
  6514. case setTag:
  6515. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6516. convert || (convert = setToArray);
  6517. if (object.size != other.size && !isPartial) {
  6518. return false;
  6519. }
  6520. // Assume cyclic values are equal.
  6521. var stacked = stack.get(object);
  6522. if (stacked) {
  6523. return stacked == other;
  6524. }
  6525. bitmask |= COMPARE_UNORDERED_FLAG;
  6526. // Recursively compare objects (susceptible to call stack limits).
  6527. stack.set(object, other);
  6528. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6529. stack['delete'](object);
  6530. return result;
  6531. case symbolTag:
  6532. if (symbolValueOf) {
  6533. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6534. }
  6535. }
  6536. return false;
  6537. }
  6538. /**
  6539. * A specialized version of `baseIsEqualDeep` for objects with support for
  6540. * partial deep comparisons.
  6541. *
  6542. * @private
  6543. * @param {Object} object The object to compare.
  6544. * @param {Object} other The other object to compare.
  6545. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6546. * @param {Function} customizer The function to customize comparisons.
  6547. * @param {Function} equalFunc The function to determine equivalents of values.
  6548. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6549. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6550. */
  6551. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6552. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6553. objProps = getAllKeys(object),
  6554. objLength = objProps.length,
  6555. othProps = getAllKeys(other),
  6556. othLength = othProps.length;
  6557. if (objLength != othLength && !isPartial) {
  6558. return false;
  6559. }
  6560. var index = objLength;
  6561. while (index--) {
  6562. var key = objProps[index];
  6563. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6564. return false;
  6565. }
  6566. }
  6567. // Check that cyclic values are equal.
  6568. var objStacked = stack.get(object);
  6569. var othStacked = stack.get(other);
  6570. if (objStacked && othStacked) {
  6571. return objStacked == other && othStacked == object;
  6572. }
  6573. var result = true;
  6574. stack.set(object, other);
  6575. stack.set(other, object);
  6576. var skipCtor = isPartial;
  6577. while (++index < objLength) {
  6578. key = objProps[index];
  6579. var objValue = object[key],
  6580. othValue = other[key];
  6581. if (customizer) {
  6582. var compared = isPartial
  6583. ? customizer(othValue, objValue, key, other, object, stack)
  6584. : customizer(objValue, othValue, key, object, other, stack);
  6585. }
  6586. // Recursively compare objects (susceptible to call stack limits).
  6587. if (!(compared === undefined
  6588. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6589. : compared
  6590. )) {
  6591. result = false;
  6592. break;
  6593. }
  6594. skipCtor || (skipCtor = key == 'constructor');
  6595. }
  6596. if (result && !skipCtor) {
  6597. var objCtor = object.constructor,
  6598. othCtor = other.constructor;
  6599. // Non `Object` object instances with different constructors are not equal.
  6600. if (objCtor != othCtor &&
  6601. ('constructor' in object && 'constructor' in other) &&
  6602. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6603. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6604. result = false;
  6605. }
  6606. }
  6607. stack['delete'](object);
  6608. stack['delete'](other);
  6609. return result;
  6610. }
  6611. /**
  6612. * A specialized version of `baseRest` which flattens the rest array.
  6613. *
  6614. * @private
  6615. * @param {Function} func The function to apply a rest parameter to.
  6616. * @returns {Function} Returns the new function.
  6617. */
  6618. function flatRest(func) {
  6619. return setToString(overRest(func, undefined, flatten), func + '');
  6620. }
  6621. /**
  6622. * Creates an array of own enumerable property names and symbols of `object`.
  6623. *
  6624. * @private
  6625. * @param {Object} object The object to query.
  6626. * @returns {Array} Returns the array of property names and symbols.
  6627. */
  6628. function getAllKeys(object) {
  6629. return baseGetAllKeys(object, keys, getSymbols);
  6630. }
  6631. /**
  6632. * Creates an array of own and inherited enumerable property names and
  6633. * symbols of `object`.
  6634. *
  6635. * @private
  6636. * @param {Object} object The object to query.
  6637. * @returns {Array} Returns the array of property names and symbols.
  6638. */
  6639. function getAllKeysIn(object) {
  6640. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6641. }
  6642. /**
  6643. * Gets metadata for `func`.
  6644. *
  6645. * @private
  6646. * @param {Function} func The function to query.
  6647. * @returns {*} Returns the metadata for `func`.
  6648. */
  6649. var getData = !metaMap ? noop : function(func) {
  6650. return metaMap.get(func);
  6651. };
  6652. /**
  6653. * Gets the name of `func`.
  6654. *
  6655. * @private
  6656. * @param {Function} func The function to query.
  6657. * @returns {string} Returns the function name.
  6658. */
  6659. function getFuncName(func) {
  6660. var result = (func.name + ''),
  6661. array = realNames[result],
  6662. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6663. while (length--) {
  6664. var data = array[length],
  6665. otherFunc = data.func;
  6666. if (otherFunc == null || otherFunc == func) {
  6667. return data.name;
  6668. }
  6669. }
  6670. return result;
  6671. }
  6672. /**
  6673. * Gets the argument placeholder value for `func`.
  6674. *
  6675. * @private
  6676. * @param {Function} func The function to inspect.
  6677. * @returns {*} Returns the placeholder value.
  6678. */
  6679. function getHolder(func) {
  6680. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6681. return object.placeholder;
  6682. }
  6683. /**
  6684. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6685. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6686. * If arguments are provided, the chosen function is invoked with them and
  6687. * its result is returned.
  6688. *
  6689. * @private
  6690. * @param {*} [value] The value to convert to an iteratee.
  6691. * @param {number} [arity] The arity of the created iteratee.
  6692. * @returns {Function} Returns the chosen function or its result.
  6693. */
  6694. function getIteratee() {
  6695. var result = lodash.iteratee || iteratee;
  6696. result = result === iteratee ? baseIteratee : result;
  6697. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6698. }
  6699. /**
  6700. * Gets the data for `map`.
  6701. *
  6702. * @private
  6703. * @param {Object} map The map to query.
  6704. * @param {string} key The reference key.
  6705. * @returns {*} Returns the map data.
  6706. */
  6707. function getMapData(map, key) {
  6708. var data = map.__data__;
  6709. return isKeyable(key)
  6710. ? data[typeof key == 'string' ? 'string' : 'hash']
  6711. : data.map;
  6712. }
  6713. /**
  6714. * Gets the property names, values, and compare flags of `object`.
  6715. *
  6716. * @private
  6717. * @param {Object} object The object to query.
  6718. * @returns {Array} Returns the match data of `object`.
  6719. */
  6720. function getMatchData(object) {
  6721. var result = keys(object),
  6722. length = result.length;
  6723. while (length--) {
  6724. var key = result[length],
  6725. value = object[key];
  6726. result[length] = [key, value, isStrictComparable(value)];
  6727. }
  6728. return result;
  6729. }
  6730. /**
  6731. * Gets the native function at `key` of `object`.
  6732. *
  6733. * @private
  6734. * @param {Object} object The object to query.
  6735. * @param {string} key The key of the method to get.
  6736. * @returns {*} Returns the function if it's native, else `undefined`.
  6737. */
  6738. function getNative(object, key) {
  6739. var value = getValue(object, key);
  6740. return baseIsNative(value) ? value : undefined;
  6741. }
  6742. /**
  6743. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6744. *
  6745. * @private
  6746. * @param {*} value The value to query.
  6747. * @returns {string} Returns the raw `toStringTag`.
  6748. */
  6749. function getRawTag(value) {
  6750. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6751. tag = value[symToStringTag];
  6752. try {
  6753. value[symToStringTag] = undefined;
  6754. var unmasked = true;
  6755. } catch (e) {}
  6756. var result = nativeObjectToString.call(value);
  6757. if (unmasked) {
  6758. if (isOwn) {
  6759. value[symToStringTag] = tag;
  6760. } else {
  6761. delete value[symToStringTag];
  6762. }
  6763. }
  6764. return result;
  6765. }
  6766. /**
  6767. * Creates an array of the own enumerable symbols of `object`.
  6768. *
  6769. * @private
  6770. * @param {Object} object The object to query.
  6771. * @returns {Array} Returns the array of symbols.
  6772. */
  6773. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6774. if (object == null) {
  6775. return [];
  6776. }
  6777. object = Object(object);
  6778. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6779. return propertyIsEnumerable.call(object, symbol);
  6780. });
  6781. };
  6782. /**
  6783. * Creates an array of the own and inherited enumerable symbols of `object`.
  6784. *
  6785. * @private
  6786. * @param {Object} object The object to query.
  6787. * @returns {Array} Returns the array of symbols.
  6788. */
  6789. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6790. var result = [];
  6791. while (object) {
  6792. arrayPush(result, getSymbols(object));
  6793. object = getPrototype(object);
  6794. }
  6795. return result;
  6796. };
  6797. /**
  6798. * Gets the `toStringTag` of `value`.
  6799. *
  6800. * @private
  6801. * @param {*} value The value to query.
  6802. * @returns {string} Returns the `toStringTag`.
  6803. */
  6804. var getTag = baseGetTag;
  6805. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6806. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6807. (Map && getTag(new Map) != mapTag) ||
  6808. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6809. (Set && getTag(new Set) != setTag) ||
  6810. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6811. getTag = function(value) {
  6812. var result = baseGetTag(value),
  6813. Ctor = result == objectTag ? value.constructor : undefined,
  6814. ctorString = Ctor ? toSource(Ctor) : '';
  6815. if (ctorString) {
  6816. switch (ctorString) {
  6817. case dataViewCtorString: return dataViewTag;
  6818. case mapCtorString: return mapTag;
  6819. case promiseCtorString: return promiseTag;
  6820. case setCtorString: return setTag;
  6821. case weakMapCtorString: return weakMapTag;
  6822. }
  6823. }
  6824. return result;
  6825. };
  6826. }
  6827. /**
  6828. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6829. *
  6830. * @private
  6831. * @param {number} start The start of the view.
  6832. * @param {number} end The end of the view.
  6833. * @param {Array} transforms The transformations to apply to the view.
  6834. * @returns {Object} Returns an object containing the `start` and `end`
  6835. * positions of the view.
  6836. */
  6837. function getView(start, end, transforms) {
  6838. var index = -1,
  6839. length = transforms.length;
  6840. while (++index < length) {
  6841. var data = transforms[index],
  6842. size = data.size;
  6843. switch (data.type) {
  6844. case 'drop': start += size; break;
  6845. case 'dropRight': end -= size; break;
  6846. case 'take': end = nativeMin(end, start + size); break;
  6847. case 'takeRight': start = nativeMax(start, end - size); break;
  6848. }
  6849. }
  6850. return { 'start': start, 'end': end };
  6851. }
  6852. /**
  6853. * Extracts wrapper details from the `source` body comment.
  6854. *
  6855. * @private
  6856. * @param {string} source The source to inspect.
  6857. * @returns {Array} Returns the wrapper details.
  6858. */
  6859. function getWrapDetails(source) {
  6860. var match = source.match(reWrapDetails);
  6861. return match ? match[1].split(reSplitDetails) : [];
  6862. }
  6863. /**
  6864. * Checks if `path` exists on `object`.
  6865. *
  6866. * @private
  6867. * @param {Object} object The object to query.
  6868. * @param {Array|string} path The path to check.
  6869. * @param {Function} hasFunc The function to check properties.
  6870. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6871. */
  6872. function hasPath(object, path, hasFunc) {
  6873. path = castPath(path, object);
  6874. var index = -1,
  6875. length = path.length,
  6876. result = false;
  6877. while (++index < length) {
  6878. var key = toKey(path[index]);
  6879. if (!(result = object != null && hasFunc(object, key))) {
  6880. break;
  6881. }
  6882. object = object[key];
  6883. }
  6884. if (result || ++index != length) {
  6885. return result;
  6886. }
  6887. length = object == null ? 0 : object.length;
  6888. return !!length && isLength(length) && isIndex(key, length) &&
  6889. (isArray(object) || isArguments(object));
  6890. }
  6891. /**
  6892. * Initializes an array clone.
  6893. *
  6894. * @private
  6895. * @param {Array} array The array to clone.
  6896. * @returns {Array} Returns the initialized clone.
  6897. */
  6898. function initCloneArray(array) {
  6899. var length = array.length,
  6900. result = new array.constructor(length);
  6901. // Add properties assigned by `RegExp#exec`.
  6902. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6903. result.index = array.index;
  6904. result.input = array.input;
  6905. }
  6906. return result;
  6907. }
  6908. /**
  6909. * Initializes an object clone.
  6910. *
  6911. * @private
  6912. * @param {Object} object The object to clone.
  6913. * @returns {Object} Returns the initialized clone.
  6914. */
  6915. function initCloneObject(object) {
  6916. return (typeof object.constructor == 'function' && !isPrototype(object))
  6917. ? baseCreate(getPrototype(object))
  6918. : {};
  6919. }
  6920. /**
  6921. * Initializes an object clone based on its `toStringTag`.
  6922. *
  6923. * **Note:** This function only supports cloning values with tags of
  6924. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6925. *
  6926. * @private
  6927. * @param {Object} object The object to clone.
  6928. * @param {string} tag The `toStringTag` of the object to clone.
  6929. * @param {boolean} [isDeep] Specify a deep clone.
  6930. * @returns {Object} Returns the initialized clone.
  6931. */
  6932. function initCloneByTag(object, tag, isDeep) {
  6933. var Ctor = object.constructor;
  6934. switch (tag) {
  6935. case arrayBufferTag:
  6936. return cloneArrayBuffer(object);
  6937. case boolTag:
  6938. case dateTag:
  6939. return new Ctor(+object);
  6940. case dataViewTag:
  6941. return cloneDataView(object, isDeep);
  6942. case float32Tag: case float64Tag:
  6943. case int8Tag: case int16Tag: case int32Tag:
  6944. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6945. return cloneTypedArray(object, isDeep);
  6946. case mapTag:
  6947. return new Ctor;
  6948. case numberTag:
  6949. case stringTag:
  6950. return new Ctor(object);
  6951. case regexpTag:
  6952. return cloneRegExp(object);
  6953. case setTag:
  6954. return new Ctor;
  6955. case symbolTag:
  6956. return cloneSymbol(object);
  6957. }
  6958. }
  6959. /**
  6960. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6961. *
  6962. * @private
  6963. * @param {string} source The source to modify.
  6964. * @returns {Array} details The details to insert.
  6965. * @returns {string} Returns the modified source.
  6966. */
  6967. function insertWrapDetails(source, details) {
  6968. var length = details.length;
  6969. if (!length) {
  6970. return source;
  6971. }
  6972. var lastIndex = length - 1;
  6973. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6974. details = details.join(length > 2 ? ', ' : ' ');
  6975. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6976. }
  6977. /**
  6978. * Checks if `value` is a flattenable `arguments` object or array.
  6979. *
  6980. * @private
  6981. * @param {*} value The value to check.
  6982. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6983. */
  6984. function isFlattenable(value) {
  6985. return isArray(value) || isArguments(value) ||
  6986. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6987. }
  6988. /**
  6989. * Checks if `value` is a valid array-like index.
  6990. *
  6991. * @private
  6992. * @param {*} value The value to check.
  6993. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6994. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6995. */
  6996. function isIndex(value, length) {
  6997. var type = typeof value;
  6998. length = length == null ? MAX_SAFE_INTEGER : length;
  6999. return !!length &&
  7000. (type == 'number' ||
  7001. (type != 'symbol' && reIsUint.test(value))) &&
  7002. (value > -1 && value % 1 == 0 && value < length);
  7003. }
  7004. /**
  7005. * Checks if the given arguments are from an iteratee call.
  7006. *
  7007. * @private
  7008. * @param {*} value The potential iteratee value argument.
  7009. * @param {*} index The potential iteratee index or key argument.
  7010. * @param {*} object The potential iteratee object argument.
  7011. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7012. * else `false`.
  7013. */
  7014. function isIterateeCall(value, index, object) {
  7015. if (!isObject(object)) {
  7016. return false;
  7017. }
  7018. var type = typeof index;
  7019. if (type == 'number'
  7020. ? (isArrayLike(object) && isIndex(index, object.length))
  7021. : (type == 'string' && index in object)
  7022. ) {
  7023. return eq(object[index], value);
  7024. }
  7025. return false;
  7026. }
  7027. /**
  7028. * Checks if `value` is a property name and not a property path.
  7029. *
  7030. * @private
  7031. * @param {*} value The value to check.
  7032. * @param {Object} [object] The object to query keys on.
  7033. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7034. */
  7035. function isKey(value, object) {
  7036. if (isArray(value)) {
  7037. return false;
  7038. }
  7039. var type = typeof value;
  7040. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7041. value == null || isSymbol(value)) {
  7042. return true;
  7043. }
  7044. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7045. (object != null && value in Object(object));
  7046. }
  7047. /**
  7048. * Checks if `value` is suitable for use as unique object key.
  7049. *
  7050. * @private
  7051. * @param {*} value The value to check.
  7052. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7053. */
  7054. function isKeyable(value) {
  7055. var type = typeof value;
  7056. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7057. ? (value !== '__proto__')
  7058. : (value === null);
  7059. }
  7060. /**
  7061. * Checks if `func` has a lazy counterpart.
  7062. *
  7063. * @private
  7064. * @param {Function} func The function to check.
  7065. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7066. * else `false`.
  7067. */
  7068. function isLaziable(func) {
  7069. var funcName = getFuncName(func),
  7070. other = lodash[funcName];
  7071. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7072. return false;
  7073. }
  7074. if (func === other) {
  7075. return true;
  7076. }
  7077. var data = getData(other);
  7078. return !!data && func === data[0];
  7079. }
  7080. /**
  7081. * Checks if `func` has its source masked.
  7082. *
  7083. * @private
  7084. * @param {Function} func The function to check.
  7085. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7086. */
  7087. function isMasked(func) {
  7088. return !!maskSrcKey && (maskSrcKey in func);
  7089. }
  7090. /**
  7091. * Checks if `func` is capable of being masked.
  7092. *
  7093. * @private
  7094. * @param {*} value The value to check.
  7095. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7096. */
  7097. var isMaskable = coreJsData ? isFunction : stubFalse;
  7098. /**
  7099. * Checks if `value` is likely a prototype object.
  7100. *
  7101. * @private
  7102. * @param {*} value The value to check.
  7103. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7104. */
  7105. function isPrototype(value) {
  7106. var Ctor = value && value.constructor,
  7107. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7108. return value === proto;
  7109. }
  7110. /**
  7111. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7112. *
  7113. * @private
  7114. * @param {*} value The value to check.
  7115. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7116. * equality comparisons, else `false`.
  7117. */
  7118. function isStrictComparable(value) {
  7119. return value === value && !isObject(value);
  7120. }
  7121. /**
  7122. * A specialized version of `matchesProperty` for source values suitable
  7123. * for strict equality comparisons, i.e. `===`.
  7124. *
  7125. * @private
  7126. * @param {string} key The key of the property to get.
  7127. * @param {*} srcValue The value to match.
  7128. * @returns {Function} Returns the new spec function.
  7129. */
  7130. function matchesStrictComparable(key, srcValue) {
  7131. return function(object) {
  7132. if (object == null) {
  7133. return false;
  7134. }
  7135. return object[key] === srcValue &&
  7136. (srcValue !== undefined || (key in Object(object)));
  7137. };
  7138. }
  7139. /**
  7140. * A specialized version of `_.memoize` which clears the memoized function's
  7141. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7142. *
  7143. * @private
  7144. * @param {Function} func The function to have its output memoized.
  7145. * @returns {Function} Returns the new memoized function.
  7146. */
  7147. function memoizeCapped(func) {
  7148. var result = memoize(func, function(key) {
  7149. if (cache.size === MAX_MEMOIZE_SIZE) {
  7150. cache.clear();
  7151. }
  7152. return key;
  7153. });
  7154. var cache = result.cache;
  7155. return result;
  7156. }
  7157. /**
  7158. * Merges the function metadata of `source` into `data`.
  7159. *
  7160. * Merging metadata reduces the number of wrappers used to invoke a function.
  7161. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7162. * may be applied regardless of execution order. Methods like `_.ary` and
  7163. * `_.rearg` modify function arguments, making the order in which they are
  7164. * executed important, preventing the merging of metadata. However, we make
  7165. * an exception for a safe combined case where curried functions have `_.ary`
  7166. * and or `_.rearg` applied.
  7167. *
  7168. * @private
  7169. * @param {Array} data The destination metadata.
  7170. * @param {Array} source The source metadata.
  7171. * @returns {Array} Returns `data`.
  7172. */
  7173. function mergeData(data, source) {
  7174. var bitmask = data[1],
  7175. srcBitmask = source[1],
  7176. newBitmask = bitmask | srcBitmask,
  7177. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7178. var isCombo =
  7179. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7180. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7181. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7182. // Exit early if metadata can't be merged.
  7183. if (!(isCommon || isCombo)) {
  7184. return data;
  7185. }
  7186. // Use source `thisArg` if available.
  7187. if (srcBitmask & WRAP_BIND_FLAG) {
  7188. data[2] = source[2];
  7189. // Set when currying a bound function.
  7190. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7191. }
  7192. // Compose partial arguments.
  7193. var value = source[3];
  7194. if (value) {
  7195. var partials = data[3];
  7196. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7197. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7198. }
  7199. // Compose partial right arguments.
  7200. value = source[5];
  7201. if (value) {
  7202. partials = data[5];
  7203. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7204. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7205. }
  7206. // Use source `argPos` if available.
  7207. value = source[7];
  7208. if (value) {
  7209. data[7] = value;
  7210. }
  7211. // Use source `ary` if it's smaller.
  7212. if (srcBitmask & WRAP_ARY_FLAG) {
  7213. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7214. }
  7215. // Use source `arity` if one is not provided.
  7216. if (data[9] == null) {
  7217. data[9] = source[9];
  7218. }
  7219. // Use source `func` and merge bitmasks.
  7220. data[0] = source[0];
  7221. data[1] = newBitmask;
  7222. return data;
  7223. }
  7224. /**
  7225. * This function is like
  7226. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7227. * except that it includes inherited enumerable properties.
  7228. *
  7229. * @private
  7230. * @param {Object} object The object to query.
  7231. * @returns {Array} Returns the array of property names.
  7232. */
  7233. function nativeKeysIn(object) {
  7234. var result = [];
  7235. if (object != null) {
  7236. for (var key in Object(object)) {
  7237. result.push(key);
  7238. }
  7239. }
  7240. return result;
  7241. }
  7242. /**
  7243. * Converts `value` to a string using `Object.prototype.toString`.
  7244. *
  7245. * @private
  7246. * @param {*} value The value to convert.
  7247. * @returns {string} Returns the converted string.
  7248. */
  7249. function objectToString(value) {
  7250. return nativeObjectToString.call(value);
  7251. }
  7252. /**
  7253. * A specialized version of `baseRest` which transforms the rest array.
  7254. *
  7255. * @private
  7256. * @param {Function} func The function to apply a rest parameter to.
  7257. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7258. * @param {Function} transform The rest array transform.
  7259. * @returns {Function} Returns the new function.
  7260. */
  7261. function overRest(func, start, transform) {
  7262. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7263. return function() {
  7264. var args = arguments,
  7265. index = -1,
  7266. length = nativeMax(args.length - start, 0),
  7267. array = Array(length);
  7268. while (++index < length) {
  7269. array[index] = args[start + index];
  7270. }
  7271. index = -1;
  7272. var otherArgs = Array(start + 1);
  7273. while (++index < start) {
  7274. otherArgs[index] = args[index];
  7275. }
  7276. otherArgs[start] = transform(array);
  7277. return apply(func, this, otherArgs);
  7278. };
  7279. }
  7280. /**
  7281. * Gets the parent value at `path` of `object`.
  7282. *
  7283. * @private
  7284. * @param {Object} object The object to query.
  7285. * @param {Array} path The path to get the parent value of.
  7286. * @returns {*} Returns the parent value.
  7287. */
  7288. function parent(object, path) {
  7289. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7290. }
  7291. /**
  7292. * Reorder `array` according to the specified indexes where the element at
  7293. * the first index is assigned as the first element, the element at
  7294. * the second index is assigned as the second element, and so on.
  7295. *
  7296. * @private
  7297. * @param {Array} array The array to reorder.
  7298. * @param {Array} indexes The arranged array indexes.
  7299. * @returns {Array} Returns `array`.
  7300. */
  7301. function reorder(array, indexes) {
  7302. var arrLength = array.length,
  7303. length = nativeMin(indexes.length, arrLength),
  7304. oldArray = copyArray(array);
  7305. while (length--) {
  7306. var index = indexes[length];
  7307. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7308. }
  7309. return array;
  7310. }
  7311. /**
  7312. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7313. *
  7314. * @private
  7315. * @param {Object} object The object to query.
  7316. * @param {string} key The key of the property to get.
  7317. * @returns {*} Returns the property value.
  7318. */
  7319. function safeGet(object, key) {
  7320. if (key === 'constructor' && typeof object[key] === 'function') {
  7321. return;
  7322. }
  7323. if (key == '__proto__') {
  7324. return;
  7325. }
  7326. return object[key];
  7327. }
  7328. /**
  7329. * Sets metadata for `func`.
  7330. *
  7331. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7332. * period of time, it will trip its breaker and transition to an identity
  7333. * function to avoid garbage collection pauses in V8. See
  7334. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7335. * for more details.
  7336. *
  7337. * @private
  7338. * @param {Function} func The function to associate metadata with.
  7339. * @param {*} data The metadata.
  7340. * @returns {Function} Returns `func`.
  7341. */
  7342. var setData = shortOut(baseSetData);
  7343. /**
  7344. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7345. *
  7346. * @private
  7347. * @param {Function} func The function to delay.
  7348. * @param {number} wait The number of milliseconds to delay invocation.
  7349. * @returns {number|Object} Returns the timer id or timeout object.
  7350. */
  7351. var setTimeout = ctxSetTimeout || function(func, wait) {
  7352. return root.setTimeout(func, wait);
  7353. };
  7354. /**
  7355. * Sets the `toString` method of `func` to return `string`.
  7356. *
  7357. * @private
  7358. * @param {Function} func The function to modify.
  7359. * @param {Function} string The `toString` result.
  7360. * @returns {Function} Returns `func`.
  7361. */
  7362. var setToString = shortOut(baseSetToString);
  7363. /**
  7364. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7365. * with wrapper details in a comment at the top of the source body.
  7366. *
  7367. * @private
  7368. * @param {Function} wrapper The function to modify.
  7369. * @param {Function} reference The reference function.
  7370. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7371. * @returns {Function} Returns `wrapper`.
  7372. */
  7373. function setWrapToString(wrapper, reference, bitmask) {
  7374. var source = (reference + '');
  7375. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7376. }
  7377. /**
  7378. * Creates a function that'll short out and invoke `identity` instead
  7379. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7380. * milliseconds.
  7381. *
  7382. * @private
  7383. * @param {Function} func The function to restrict.
  7384. * @returns {Function} Returns the new shortable function.
  7385. */
  7386. function shortOut(func) {
  7387. var count = 0,
  7388. lastCalled = 0;
  7389. return function() {
  7390. var stamp = nativeNow(),
  7391. remaining = HOT_SPAN - (stamp - lastCalled);
  7392. lastCalled = stamp;
  7393. if (remaining > 0) {
  7394. if (++count >= HOT_COUNT) {
  7395. return arguments[0];
  7396. }
  7397. } else {
  7398. count = 0;
  7399. }
  7400. return func.apply(undefined, arguments);
  7401. };
  7402. }
  7403. /**
  7404. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7405. *
  7406. * @private
  7407. * @param {Array} array The array to shuffle.
  7408. * @param {number} [size=array.length] The size of `array`.
  7409. * @returns {Array} Returns `array`.
  7410. */
  7411. function shuffleSelf(array, size) {
  7412. var index = -1,
  7413. length = array.length,
  7414. lastIndex = length - 1;
  7415. size = size === undefined ? length : size;
  7416. while (++index < size) {
  7417. var rand = baseRandom(index, lastIndex),
  7418. value = array[rand];
  7419. array[rand] = array[index];
  7420. array[index] = value;
  7421. }
  7422. array.length = size;
  7423. return array;
  7424. }
  7425. /**
  7426. * Converts `string` to a property path array.
  7427. *
  7428. * @private
  7429. * @param {string} string The string to convert.
  7430. * @returns {Array} Returns the property path array.
  7431. */
  7432. var stringToPath = memoizeCapped(function(string) {
  7433. var result = [];
  7434. if (string.charCodeAt(0) === 46 /* . */) {
  7435. result.push('');
  7436. }
  7437. string.replace(rePropName, function(match, number, quote, subString) {
  7438. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7439. });
  7440. return result;
  7441. });
  7442. /**
  7443. * Converts `value` to a string key if it's not a string or symbol.
  7444. *
  7445. * @private
  7446. * @param {*} value The value to inspect.
  7447. * @returns {string|symbol} Returns the key.
  7448. */
  7449. function toKey(value) {
  7450. if (typeof value == 'string' || isSymbol(value)) {
  7451. return value;
  7452. }
  7453. var result = (value + '');
  7454. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7455. }
  7456. /**
  7457. * Converts `func` to its source code.
  7458. *
  7459. * @private
  7460. * @param {Function} func The function to convert.
  7461. * @returns {string} Returns the source code.
  7462. */
  7463. function toSource(func) {
  7464. if (func != null) {
  7465. try {
  7466. return funcToString.call(func);
  7467. } catch (e) {}
  7468. try {
  7469. return (func + '');
  7470. } catch (e) {}
  7471. }
  7472. return '';
  7473. }
  7474. /**
  7475. * Updates wrapper `details` based on `bitmask` flags.
  7476. *
  7477. * @private
  7478. * @returns {Array} details The details to modify.
  7479. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7480. * @returns {Array} Returns `details`.
  7481. */
  7482. function updateWrapDetails(details, bitmask) {
  7483. arrayEach(wrapFlags, function(pair) {
  7484. var value = '_.' + pair[0];
  7485. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7486. details.push(value);
  7487. }
  7488. });
  7489. return details.sort();
  7490. }
  7491. /**
  7492. * Creates a clone of `wrapper`.
  7493. *
  7494. * @private
  7495. * @param {Object} wrapper The wrapper to clone.
  7496. * @returns {Object} Returns the cloned wrapper.
  7497. */
  7498. function wrapperClone(wrapper) {
  7499. if (wrapper instanceof LazyWrapper) {
  7500. return wrapper.clone();
  7501. }
  7502. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7503. result.__actions__ = copyArray(wrapper.__actions__);
  7504. result.__index__ = wrapper.__index__;
  7505. result.__values__ = wrapper.__values__;
  7506. return result;
  7507. }
  7508. /*------------------------------------------------------------------------*/
  7509. /**
  7510. * Creates an array of elements split into groups the length of `size`.
  7511. * If `array` can't be split evenly, the final chunk will be the remaining
  7512. * elements.
  7513. *
  7514. * @static
  7515. * @memberOf _
  7516. * @since 3.0.0
  7517. * @category Array
  7518. * @param {Array} array The array to process.
  7519. * @param {number} [size=1] The length of each chunk
  7520. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7521. * @returns {Array} Returns the new array of chunks.
  7522. * @example
  7523. *
  7524. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7525. * // => [['a', 'b'], ['c', 'd']]
  7526. *
  7527. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7528. * // => [['a', 'b', 'c'], ['d']]
  7529. */
  7530. function chunk(array, size, guard) {
  7531. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7532. size = 1;
  7533. } else {
  7534. size = nativeMax(toInteger(size), 0);
  7535. }
  7536. var length = array == null ? 0 : array.length;
  7537. if (!length || size < 1) {
  7538. return [];
  7539. }
  7540. var index = 0,
  7541. resIndex = 0,
  7542. result = Array(nativeCeil(length / size));
  7543. while (index < length) {
  7544. result[resIndex++] = baseSlice(array, index, (index += size));
  7545. }
  7546. return result;
  7547. }
  7548. /**
  7549. * Creates an array with all falsey values removed. The values `false`, `null`,
  7550. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7551. *
  7552. * @static
  7553. * @memberOf _
  7554. * @since 0.1.0
  7555. * @category Array
  7556. * @param {Array} array The array to compact.
  7557. * @returns {Array} Returns the new array of filtered values.
  7558. * @example
  7559. *
  7560. * _.compact([0, 1, false, 2, '', 3]);
  7561. * // => [1, 2, 3]
  7562. */
  7563. function compact(array) {
  7564. var index = -1,
  7565. length = array == null ? 0 : array.length,
  7566. resIndex = 0,
  7567. result = [];
  7568. while (++index < length) {
  7569. var value = array[index];
  7570. if (value) {
  7571. result[resIndex++] = value;
  7572. }
  7573. }
  7574. return result;
  7575. }
  7576. /**
  7577. * Creates a new array concatenating `array` with any additional arrays
  7578. * and/or values.
  7579. *
  7580. * @static
  7581. * @memberOf _
  7582. * @since 4.0.0
  7583. * @category Array
  7584. * @param {Array} array The array to concatenate.
  7585. * @param {...*} [values] The values to concatenate.
  7586. * @returns {Array} Returns the new concatenated array.
  7587. * @example
  7588. *
  7589. * var array = [1];
  7590. * var other = _.concat(array, 2, [3], [[4]]);
  7591. *
  7592. * console.log(other);
  7593. * // => [1, 2, 3, [4]]
  7594. *
  7595. * console.log(array);
  7596. * // => [1]
  7597. */
  7598. function concat() {
  7599. var length = arguments.length;
  7600. if (!length) {
  7601. return [];
  7602. }
  7603. var args = Array(length - 1),
  7604. array = arguments[0],
  7605. index = length;
  7606. while (index--) {
  7607. args[index - 1] = arguments[index];
  7608. }
  7609. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7610. }
  7611. /**
  7612. * Creates an array of `array` values not included in the other given arrays
  7613. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7614. * for equality comparisons. The order and references of result values are
  7615. * determined by the first array.
  7616. *
  7617. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7618. *
  7619. * @static
  7620. * @memberOf _
  7621. * @since 0.1.0
  7622. * @category Array
  7623. * @param {Array} array The array to inspect.
  7624. * @param {...Array} [values] The values to exclude.
  7625. * @returns {Array} Returns the new array of filtered values.
  7626. * @see _.without, _.xor
  7627. * @example
  7628. *
  7629. * _.difference([2, 1], [2, 3]);
  7630. * // => [1]
  7631. */
  7632. var difference = baseRest(function(array, values) {
  7633. return isArrayLikeObject(array)
  7634. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7635. : [];
  7636. });
  7637. /**
  7638. * This method is like `_.difference` except that it accepts `iteratee` which
  7639. * is invoked for each element of `array` and `values` to generate the criterion
  7640. * by which they're compared. The order and references of result values are
  7641. * determined by the first array. The iteratee is invoked with one argument:
  7642. * (value).
  7643. *
  7644. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7645. *
  7646. * @static
  7647. * @memberOf _
  7648. * @since 4.0.0
  7649. * @category Array
  7650. * @param {Array} array The array to inspect.
  7651. * @param {...Array} [values] The values to exclude.
  7652. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7653. * @returns {Array} Returns the new array of filtered values.
  7654. * @example
  7655. *
  7656. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7657. * // => [1.2]
  7658. *
  7659. * // The `_.property` iteratee shorthand.
  7660. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7661. * // => [{ 'x': 2 }]
  7662. */
  7663. var differenceBy = baseRest(function(array, values) {
  7664. var iteratee = last(values);
  7665. if (isArrayLikeObject(iteratee)) {
  7666. iteratee = undefined;
  7667. }
  7668. return isArrayLikeObject(array)
  7669. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7670. : [];
  7671. });
  7672. /**
  7673. * This method is like `_.difference` except that it accepts `comparator`
  7674. * which is invoked to compare elements of `array` to `values`. The order and
  7675. * references of result values are determined by the first array. The comparator
  7676. * is invoked with two arguments: (arrVal, othVal).
  7677. *
  7678. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7679. *
  7680. * @static
  7681. * @memberOf _
  7682. * @since 4.0.0
  7683. * @category Array
  7684. * @param {Array} array The array to inspect.
  7685. * @param {...Array} [values] The values to exclude.
  7686. * @param {Function} [comparator] The comparator invoked per element.
  7687. * @returns {Array} Returns the new array of filtered values.
  7688. * @example
  7689. *
  7690. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7691. *
  7692. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7693. * // => [{ 'x': 2, 'y': 1 }]
  7694. */
  7695. var differenceWith = baseRest(function(array, values) {
  7696. var comparator = last(values);
  7697. if (isArrayLikeObject(comparator)) {
  7698. comparator = undefined;
  7699. }
  7700. return isArrayLikeObject(array)
  7701. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7702. : [];
  7703. });
  7704. /**
  7705. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7706. *
  7707. * @static
  7708. * @memberOf _
  7709. * @since 0.5.0
  7710. * @category Array
  7711. * @param {Array} array The array to query.
  7712. * @param {number} [n=1] The number of elements to drop.
  7713. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7714. * @returns {Array} Returns the slice of `array`.
  7715. * @example
  7716. *
  7717. * _.drop([1, 2, 3]);
  7718. * // => [2, 3]
  7719. *
  7720. * _.drop([1, 2, 3], 2);
  7721. * // => [3]
  7722. *
  7723. * _.drop([1, 2, 3], 5);
  7724. * // => []
  7725. *
  7726. * _.drop([1, 2, 3], 0);
  7727. * // => [1, 2, 3]
  7728. */
  7729. function drop(array, n, guard) {
  7730. var length = array == null ? 0 : array.length;
  7731. if (!length) {
  7732. return [];
  7733. }
  7734. n = (guard || n === undefined) ? 1 : toInteger(n);
  7735. return baseSlice(array, n < 0 ? 0 : n, length);
  7736. }
  7737. /**
  7738. * Creates a slice of `array` with `n` elements dropped from the end.
  7739. *
  7740. * @static
  7741. * @memberOf _
  7742. * @since 3.0.0
  7743. * @category Array
  7744. * @param {Array} array The array to query.
  7745. * @param {number} [n=1] The number of elements to drop.
  7746. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7747. * @returns {Array} Returns the slice of `array`.
  7748. * @example
  7749. *
  7750. * _.dropRight([1, 2, 3]);
  7751. * // => [1, 2]
  7752. *
  7753. * _.dropRight([1, 2, 3], 2);
  7754. * // => [1]
  7755. *
  7756. * _.dropRight([1, 2, 3], 5);
  7757. * // => []
  7758. *
  7759. * _.dropRight([1, 2, 3], 0);
  7760. * // => [1, 2, 3]
  7761. */
  7762. function dropRight(array, n, guard) {
  7763. var length = array == null ? 0 : array.length;
  7764. if (!length) {
  7765. return [];
  7766. }
  7767. n = (guard || n === undefined) ? 1 : toInteger(n);
  7768. n = length - n;
  7769. return baseSlice(array, 0, n < 0 ? 0 : n);
  7770. }
  7771. /**
  7772. * Creates a slice of `array` excluding elements dropped from the end.
  7773. * Elements are dropped until `predicate` returns falsey. The predicate is
  7774. * invoked with three arguments: (value, index, array).
  7775. *
  7776. * @static
  7777. * @memberOf _
  7778. * @since 3.0.0
  7779. * @category Array
  7780. * @param {Array} array The array to query.
  7781. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7782. * @returns {Array} Returns the slice of `array`.
  7783. * @example
  7784. *
  7785. * var users = [
  7786. * { 'user': 'barney', 'active': true },
  7787. * { 'user': 'fred', 'active': false },
  7788. * { 'user': 'pebbles', 'active': false }
  7789. * ];
  7790. *
  7791. * _.dropRightWhile(users, function(o) { return !o.active; });
  7792. * // => objects for ['barney']
  7793. *
  7794. * // The `_.matches` iteratee shorthand.
  7795. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7796. * // => objects for ['barney', 'fred']
  7797. *
  7798. * // The `_.matchesProperty` iteratee shorthand.
  7799. * _.dropRightWhile(users, ['active', false]);
  7800. * // => objects for ['barney']
  7801. *
  7802. * // The `_.property` iteratee shorthand.
  7803. * _.dropRightWhile(users, 'active');
  7804. * // => objects for ['barney', 'fred', 'pebbles']
  7805. */
  7806. function dropRightWhile(array, predicate) {
  7807. return (array && array.length)
  7808. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7809. : [];
  7810. }
  7811. /**
  7812. * Creates a slice of `array` excluding elements dropped from the beginning.
  7813. * Elements are dropped until `predicate` returns falsey. The predicate is
  7814. * invoked with three arguments: (value, index, array).
  7815. *
  7816. * @static
  7817. * @memberOf _
  7818. * @since 3.0.0
  7819. * @category Array
  7820. * @param {Array} array The array to query.
  7821. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7822. * @returns {Array} Returns the slice of `array`.
  7823. * @example
  7824. *
  7825. * var users = [
  7826. * { 'user': 'barney', 'active': false },
  7827. * { 'user': 'fred', 'active': false },
  7828. * { 'user': 'pebbles', 'active': true }
  7829. * ];
  7830. *
  7831. * _.dropWhile(users, function(o) { return !o.active; });
  7832. * // => objects for ['pebbles']
  7833. *
  7834. * // The `_.matches` iteratee shorthand.
  7835. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7836. * // => objects for ['fred', 'pebbles']
  7837. *
  7838. * // The `_.matchesProperty` iteratee shorthand.
  7839. * _.dropWhile(users, ['active', false]);
  7840. * // => objects for ['pebbles']
  7841. *
  7842. * // The `_.property` iteratee shorthand.
  7843. * _.dropWhile(users, 'active');
  7844. * // => objects for ['barney', 'fred', 'pebbles']
  7845. */
  7846. function dropWhile(array, predicate) {
  7847. return (array && array.length)
  7848. ? baseWhile(array, getIteratee(predicate, 3), true)
  7849. : [];
  7850. }
  7851. /**
  7852. * Fills elements of `array` with `value` from `start` up to, but not
  7853. * including, `end`.
  7854. *
  7855. * **Note:** This method mutates `array`.
  7856. *
  7857. * @static
  7858. * @memberOf _
  7859. * @since 3.2.0
  7860. * @category Array
  7861. * @param {Array} array The array to fill.
  7862. * @param {*} value The value to fill `array` with.
  7863. * @param {number} [start=0] The start position.
  7864. * @param {number} [end=array.length] The end position.
  7865. * @returns {Array} Returns `array`.
  7866. * @example
  7867. *
  7868. * var array = [1, 2, 3];
  7869. *
  7870. * _.fill(array, 'a');
  7871. * console.log(array);
  7872. * // => ['a', 'a', 'a']
  7873. *
  7874. * _.fill(Array(3), 2);
  7875. * // => [2, 2, 2]
  7876. *
  7877. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7878. * // => [4, '*', '*', 10]
  7879. */
  7880. function fill(array, value, start, end) {
  7881. var length = array == null ? 0 : array.length;
  7882. if (!length) {
  7883. return [];
  7884. }
  7885. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7886. start = 0;
  7887. end = length;
  7888. }
  7889. return baseFill(array, value, start, end);
  7890. }
  7891. /**
  7892. * This method is like `_.find` except that it returns the index of the first
  7893. * element `predicate` returns truthy for instead of the element itself.
  7894. *
  7895. * @static
  7896. * @memberOf _
  7897. * @since 1.1.0
  7898. * @category Array
  7899. * @param {Array} array The array to inspect.
  7900. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7901. * @param {number} [fromIndex=0] The index to search from.
  7902. * @returns {number} Returns the index of the found element, else `-1`.
  7903. * @example
  7904. *
  7905. * var users = [
  7906. * { 'user': 'barney', 'active': false },
  7907. * { 'user': 'fred', 'active': false },
  7908. * { 'user': 'pebbles', 'active': true }
  7909. * ];
  7910. *
  7911. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7912. * // => 0
  7913. *
  7914. * // The `_.matches` iteratee shorthand.
  7915. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7916. * // => 1
  7917. *
  7918. * // The `_.matchesProperty` iteratee shorthand.
  7919. * _.findIndex(users, ['active', false]);
  7920. * // => 0
  7921. *
  7922. * // The `_.property` iteratee shorthand.
  7923. * _.findIndex(users, 'active');
  7924. * // => 2
  7925. */
  7926. function findIndex(array, predicate, fromIndex) {
  7927. var length = array == null ? 0 : array.length;
  7928. if (!length) {
  7929. return -1;
  7930. }
  7931. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7932. if (index < 0) {
  7933. index = nativeMax(length + index, 0);
  7934. }
  7935. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7936. }
  7937. /**
  7938. * This method is like `_.findIndex` except that it iterates over elements
  7939. * of `collection` from right to left.
  7940. *
  7941. * @static
  7942. * @memberOf _
  7943. * @since 2.0.0
  7944. * @category Array
  7945. * @param {Array} array The array to inspect.
  7946. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7947. * @param {number} [fromIndex=array.length-1] The index to search from.
  7948. * @returns {number} Returns the index of the found element, else `-1`.
  7949. * @example
  7950. *
  7951. * var users = [
  7952. * { 'user': 'barney', 'active': true },
  7953. * { 'user': 'fred', 'active': false },
  7954. * { 'user': 'pebbles', 'active': false }
  7955. * ];
  7956. *
  7957. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7958. * // => 2
  7959. *
  7960. * // The `_.matches` iteratee shorthand.
  7961. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7962. * // => 0
  7963. *
  7964. * // The `_.matchesProperty` iteratee shorthand.
  7965. * _.findLastIndex(users, ['active', false]);
  7966. * // => 2
  7967. *
  7968. * // The `_.property` iteratee shorthand.
  7969. * _.findLastIndex(users, 'active');
  7970. * // => 0
  7971. */
  7972. function findLastIndex(array, predicate, fromIndex) {
  7973. var length = array == null ? 0 : array.length;
  7974. if (!length) {
  7975. return -1;
  7976. }
  7977. var index = length - 1;
  7978. if (fromIndex !== undefined) {
  7979. index = toInteger(fromIndex);
  7980. index = fromIndex < 0
  7981. ? nativeMax(length + index, 0)
  7982. : nativeMin(index, length - 1);
  7983. }
  7984. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7985. }
  7986. /**
  7987. * Flattens `array` a single level deep.
  7988. *
  7989. * @static
  7990. * @memberOf _
  7991. * @since 0.1.0
  7992. * @category Array
  7993. * @param {Array} array The array to flatten.
  7994. * @returns {Array} Returns the new flattened array.
  7995. * @example
  7996. *
  7997. * _.flatten([1, [2, [3, [4]], 5]]);
  7998. * // => [1, 2, [3, [4]], 5]
  7999. */
  8000. function flatten(array) {
  8001. var length = array == null ? 0 : array.length;
  8002. return length ? baseFlatten(array, 1) : [];
  8003. }
  8004. /**
  8005. * Recursively flattens `array`.
  8006. *
  8007. * @static
  8008. * @memberOf _
  8009. * @since 3.0.0
  8010. * @category Array
  8011. * @param {Array} array The array to flatten.
  8012. * @returns {Array} Returns the new flattened array.
  8013. * @example
  8014. *
  8015. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8016. * // => [1, 2, 3, 4, 5]
  8017. */
  8018. function flattenDeep(array) {
  8019. var length = array == null ? 0 : array.length;
  8020. return length ? baseFlatten(array, INFINITY) : [];
  8021. }
  8022. /**
  8023. * Recursively flatten `array` up to `depth` times.
  8024. *
  8025. * @static
  8026. * @memberOf _
  8027. * @since 4.4.0
  8028. * @category Array
  8029. * @param {Array} array The array to flatten.
  8030. * @param {number} [depth=1] The maximum recursion depth.
  8031. * @returns {Array} Returns the new flattened array.
  8032. * @example
  8033. *
  8034. * var array = [1, [2, [3, [4]], 5]];
  8035. *
  8036. * _.flattenDepth(array, 1);
  8037. * // => [1, 2, [3, [4]], 5]
  8038. *
  8039. * _.flattenDepth(array, 2);
  8040. * // => [1, 2, 3, [4], 5]
  8041. */
  8042. function flattenDepth(array, depth) {
  8043. var length = array == null ? 0 : array.length;
  8044. if (!length) {
  8045. return [];
  8046. }
  8047. depth = depth === undefined ? 1 : toInteger(depth);
  8048. return baseFlatten(array, depth);
  8049. }
  8050. /**
  8051. * The inverse of `_.toPairs`; this method returns an object composed
  8052. * from key-value `pairs`.
  8053. *
  8054. * @static
  8055. * @memberOf _
  8056. * @since 4.0.0
  8057. * @category Array
  8058. * @param {Array} pairs The key-value pairs.
  8059. * @returns {Object} Returns the new object.
  8060. * @example
  8061. *
  8062. * _.fromPairs([['a', 1], ['b', 2]]);
  8063. * // => { 'a': 1, 'b': 2 }
  8064. */
  8065. function fromPairs(pairs) {
  8066. var index = -1,
  8067. length = pairs == null ? 0 : pairs.length,
  8068. result = {};
  8069. while (++index < length) {
  8070. var pair = pairs[index];
  8071. result[pair[0]] = pair[1];
  8072. }
  8073. return result;
  8074. }
  8075. /**
  8076. * Gets the first element of `array`.
  8077. *
  8078. * @static
  8079. * @memberOf _
  8080. * @since 0.1.0
  8081. * @alias first
  8082. * @category Array
  8083. * @param {Array} array The array to query.
  8084. * @returns {*} Returns the first element of `array`.
  8085. * @example
  8086. *
  8087. * _.head([1, 2, 3]);
  8088. * // => 1
  8089. *
  8090. * _.head([]);
  8091. * // => undefined
  8092. */
  8093. function head(array) {
  8094. return (array && array.length) ? array[0] : undefined;
  8095. }
  8096. /**
  8097. * Gets the index at which the first occurrence of `value` is found in `array`
  8098. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8099. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8100. * offset from the end of `array`.
  8101. *
  8102. * @static
  8103. * @memberOf _
  8104. * @since 0.1.0
  8105. * @category Array
  8106. * @param {Array} array The array to inspect.
  8107. * @param {*} value The value to search for.
  8108. * @param {number} [fromIndex=0] The index to search from.
  8109. * @returns {number} Returns the index of the matched value, else `-1`.
  8110. * @example
  8111. *
  8112. * _.indexOf([1, 2, 1, 2], 2);
  8113. * // => 1
  8114. *
  8115. * // Search from the `fromIndex`.
  8116. * _.indexOf([1, 2, 1, 2], 2, 2);
  8117. * // => 3
  8118. */
  8119. function indexOf(array, value, fromIndex) {
  8120. var length = array == null ? 0 : array.length;
  8121. if (!length) {
  8122. return -1;
  8123. }
  8124. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8125. if (index < 0) {
  8126. index = nativeMax(length + index, 0);
  8127. }
  8128. return baseIndexOf(array, value, index);
  8129. }
  8130. /**
  8131. * Gets all but the last element of `array`.
  8132. *
  8133. * @static
  8134. * @memberOf _
  8135. * @since 0.1.0
  8136. * @category Array
  8137. * @param {Array} array The array to query.
  8138. * @returns {Array} Returns the slice of `array`.
  8139. * @example
  8140. *
  8141. * _.initial([1, 2, 3]);
  8142. * // => [1, 2]
  8143. */
  8144. function initial(array) {
  8145. var length = array == null ? 0 : array.length;
  8146. return length ? baseSlice(array, 0, -1) : [];
  8147. }
  8148. /**
  8149. * Creates an array of unique values that are included in all given arrays
  8150. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8151. * for equality comparisons. The order and references of result values are
  8152. * determined by the first array.
  8153. *
  8154. * @static
  8155. * @memberOf _
  8156. * @since 0.1.0
  8157. * @category Array
  8158. * @param {...Array} [arrays] The arrays to inspect.
  8159. * @returns {Array} Returns the new array of intersecting values.
  8160. * @example
  8161. *
  8162. * _.intersection([2, 1], [2, 3]);
  8163. * // => [2]
  8164. */
  8165. var intersection = baseRest(function(arrays) {
  8166. var mapped = arrayMap(arrays, castArrayLikeObject);
  8167. return (mapped.length && mapped[0] === arrays[0])
  8168. ? baseIntersection(mapped)
  8169. : [];
  8170. });
  8171. /**
  8172. * This method is like `_.intersection` except that it accepts `iteratee`
  8173. * which is invoked for each element of each `arrays` to generate the criterion
  8174. * by which they're compared. The order and references of result values are
  8175. * determined by the first array. The iteratee is invoked with one argument:
  8176. * (value).
  8177. *
  8178. * @static
  8179. * @memberOf _
  8180. * @since 4.0.0
  8181. * @category Array
  8182. * @param {...Array} [arrays] The arrays to inspect.
  8183. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8184. * @returns {Array} Returns the new array of intersecting values.
  8185. * @example
  8186. *
  8187. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8188. * // => [2.1]
  8189. *
  8190. * // The `_.property` iteratee shorthand.
  8191. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8192. * // => [{ 'x': 1 }]
  8193. */
  8194. var intersectionBy = baseRest(function(arrays) {
  8195. var iteratee = last(arrays),
  8196. mapped = arrayMap(arrays, castArrayLikeObject);
  8197. if (iteratee === last(mapped)) {
  8198. iteratee = undefined;
  8199. } else {
  8200. mapped.pop();
  8201. }
  8202. return (mapped.length && mapped[0] === arrays[0])
  8203. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8204. : [];
  8205. });
  8206. /**
  8207. * This method is like `_.intersection` except that it accepts `comparator`
  8208. * which is invoked to compare elements of `arrays`. The order and references
  8209. * of result values are determined by the first array. The comparator is
  8210. * invoked with two arguments: (arrVal, othVal).
  8211. *
  8212. * @static
  8213. * @memberOf _
  8214. * @since 4.0.0
  8215. * @category Array
  8216. * @param {...Array} [arrays] The arrays to inspect.
  8217. * @param {Function} [comparator] The comparator invoked per element.
  8218. * @returns {Array} Returns the new array of intersecting values.
  8219. * @example
  8220. *
  8221. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8222. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8223. *
  8224. * _.intersectionWith(objects, others, _.isEqual);
  8225. * // => [{ 'x': 1, 'y': 2 }]
  8226. */
  8227. var intersectionWith = baseRest(function(arrays) {
  8228. var comparator = last(arrays),
  8229. mapped = arrayMap(arrays, castArrayLikeObject);
  8230. comparator = typeof comparator == 'function' ? comparator : undefined;
  8231. if (comparator) {
  8232. mapped.pop();
  8233. }
  8234. return (mapped.length && mapped[0] === arrays[0])
  8235. ? baseIntersection(mapped, undefined, comparator)
  8236. : [];
  8237. });
  8238. /**
  8239. * Converts all elements in `array` into a string separated by `separator`.
  8240. *
  8241. * @static
  8242. * @memberOf _
  8243. * @since 4.0.0
  8244. * @category Array
  8245. * @param {Array} array The array to convert.
  8246. * @param {string} [separator=','] The element separator.
  8247. * @returns {string} Returns the joined string.
  8248. * @example
  8249. *
  8250. * _.join(['a', 'b', 'c'], '~');
  8251. * // => 'a~b~c'
  8252. */
  8253. function join(array, separator) {
  8254. return array == null ? '' : nativeJoin.call(array, separator);
  8255. }
  8256. /**
  8257. * Gets the last element of `array`.
  8258. *
  8259. * @static
  8260. * @memberOf _
  8261. * @since 0.1.0
  8262. * @category Array
  8263. * @param {Array} array The array to query.
  8264. * @returns {*} Returns the last element of `array`.
  8265. * @example
  8266. *
  8267. * _.last([1, 2, 3]);
  8268. * // => 3
  8269. */
  8270. function last(array) {
  8271. var length = array == null ? 0 : array.length;
  8272. return length ? array[length - 1] : undefined;
  8273. }
  8274. /**
  8275. * This method is like `_.indexOf` except that it iterates over elements of
  8276. * `array` from right to left.
  8277. *
  8278. * @static
  8279. * @memberOf _
  8280. * @since 0.1.0
  8281. * @category Array
  8282. * @param {Array} array The array to inspect.
  8283. * @param {*} value The value to search for.
  8284. * @param {number} [fromIndex=array.length-1] The index to search from.
  8285. * @returns {number} Returns the index of the matched value, else `-1`.
  8286. * @example
  8287. *
  8288. * _.lastIndexOf([1, 2, 1, 2], 2);
  8289. * // => 3
  8290. *
  8291. * // Search from the `fromIndex`.
  8292. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8293. * // => 1
  8294. */
  8295. function lastIndexOf(array, value, fromIndex) {
  8296. var length = array == null ? 0 : array.length;
  8297. if (!length) {
  8298. return -1;
  8299. }
  8300. var index = length;
  8301. if (fromIndex !== undefined) {
  8302. index = toInteger(fromIndex);
  8303. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8304. }
  8305. return value === value
  8306. ? strictLastIndexOf(array, value, index)
  8307. : baseFindIndex(array, baseIsNaN, index, true);
  8308. }
  8309. /**
  8310. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8311. * element from the end is returned.
  8312. *
  8313. * @static
  8314. * @memberOf _
  8315. * @since 4.11.0
  8316. * @category Array
  8317. * @param {Array} array The array to query.
  8318. * @param {number} [n=0] The index of the element to return.
  8319. * @returns {*} Returns the nth element of `array`.
  8320. * @example
  8321. *
  8322. * var array = ['a', 'b', 'c', 'd'];
  8323. *
  8324. * _.nth(array, 1);
  8325. * // => 'b'
  8326. *
  8327. * _.nth(array, -2);
  8328. * // => 'c';
  8329. */
  8330. function nth(array, n) {
  8331. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8332. }
  8333. /**
  8334. * Removes all given values from `array` using
  8335. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8336. * for equality comparisons.
  8337. *
  8338. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8339. * to remove elements from an array by predicate.
  8340. *
  8341. * @static
  8342. * @memberOf _
  8343. * @since 2.0.0
  8344. * @category Array
  8345. * @param {Array} array The array to modify.
  8346. * @param {...*} [values] The values to remove.
  8347. * @returns {Array} Returns `array`.
  8348. * @example
  8349. *
  8350. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8351. *
  8352. * _.pull(array, 'a', 'c');
  8353. * console.log(array);
  8354. * // => ['b', 'b']
  8355. */
  8356. var pull = baseRest(pullAll);
  8357. /**
  8358. * This method is like `_.pull` except that it accepts an array of values to remove.
  8359. *
  8360. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8361. *
  8362. * @static
  8363. * @memberOf _
  8364. * @since 4.0.0
  8365. * @category Array
  8366. * @param {Array} array The array to modify.
  8367. * @param {Array} values The values to remove.
  8368. * @returns {Array} Returns `array`.
  8369. * @example
  8370. *
  8371. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8372. *
  8373. * _.pullAll(array, ['a', 'c']);
  8374. * console.log(array);
  8375. * // => ['b', 'b']
  8376. */
  8377. function pullAll(array, values) {
  8378. return (array && array.length && values && values.length)
  8379. ? basePullAll(array, values)
  8380. : array;
  8381. }
  8382. /**
  8383. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8384. * invoked for each element of `array` and `values` to generate the criterion
  8385. * by which they're compared. The iteratee is invoked with one argument: (value).
  8386. *
  8387. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8388. *
  8389. * @static
  8390. * @memberOf _
  8391. * @since 4.0.0
  8392. * @category Array
  8393. * @param {Array} array The array to modify.
  8394. * @param {Array} values The values to remove.
  8395. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8396. * @returns {Array} Returns `array`.
  8397. * @example
  8398. *
  8399. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8400. *
  8401. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8402. * console.log(array);
  8403. * // => [{ 'x': 2 }]
  8404. */
  8405. function pullAllBy(array, values, iteratee) {
  8406. return (array && array.length && values && values.length)
  8407. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8408. : array;
  8409. }
  8410. /**
  8411. * This method is like `_.pullAll` except that it accepts `comparator` which
  8412. * is invoked to compare elements of `array` to `values`. The comparator is
  8413. * invoked with two arguments: (arrVal, othVal).
  8414. *
  8415. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8416. *
  8417. * @static
  8418. * @memberOf _
  8419. * @since 4.6.0
  8420. * @category Array
  8421. * @param {Array} array The array to modify.
  8422. * @param {Array} values The values to remove.
  8423. * @param {Function} [comparator] The comparator invoked per element.
  8424. * @returns {Array} Returns `array`.
  8425. * @example
  8426. *
  8427. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8428. *
  8429. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8430. * console.log(array);
  8431. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8432. */
  8433. function pullAllWith(array, values, comparator) {
  8434. return (array && array.length && values && values.length)
  8435. ? basePullAll(array, values, undefined, comparator)
  8436. : array;
  8437. }
  8438. /**
  8439. * Removes elements from `array` corresponding to `indexes` and returns an
  8440. * array of removed elements.
  8441. *
  8442. * **Note:** Unlike `_.at`, this method mutates `array`.
  8443. *
  8444. * @static
  8445. * @memberOf _
  8446. * @since 3.0.0
  8447. * @category Array
  8448. * @param {Array} array The array to modify.
  8449. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8450. * @returns {Array} Returns the new array of removed elements.
  8451. * @example
  8452. *
  8453. * var array = ['a', 'b', 'c', 'd'];
  8454. * var pulled = _.pullAt(array, [1, 3]);
  8455. *
  8456. * console.log(array);
  8457. * // => ['a', 'c']
  8458. *
  8459. * console.log(pulled);
  8460. * // => ['b', 'd']
  8461. */
  8462. var pullAt = flatRest(function(array, indexes) {
  8463. var length = array == null ? 0 : array.length,
  8464. result = baseAt(array, indexes);
  8465. basePullAt(array, arrayMap(indexes, function(index) {
  8466. return isIndex(index, length) ? +index : index;
  8467. }).sort(compareAscending));
  8468. return result;
  8469. });
  8470. /**
  8471. * Removes all elements from `array` that `predicate` returns truthy for
  8472. * and returns an array of the removed elements. The predicate is invoked
  8473. * with three arguments: (value, index, array).
  8474. *
  8475. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8476. * to pull elements from an array by value.
  8477. *
  8478. * @static
  8479. * @memberOf _
  8480. * @since 2.0.0
  8481. * @category Array
  8482. * @param {Array} array The array to modify.
  8483. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8484. * @returns {Array} Returns the new array of removed elements.
  8485. * @example
  8486. *
  8487. * var array = [1, 2, 3, 4];
  8488. * var evens = _.remove(array, function(n) {
  8489. * return n % 2 == 0;
  8490. * });
  8491. *
  8492. * console.log(array);
  8493. * // => [1, 3]
  8494. *
  8495. * console.log(evens);
  8496. * // => [2, 4]
  8497. */
  8498. function remove(array, predicate) {
  8499. var result = [];
  8500. if (!(array && array.length)) {
  8501. return result;
  8502. }
  8503. var index = -1,
  8504. indexes = [],
  8505. length = array.length;
  8506. predicate = getIteratee(predicate, 3);
  8507. while (++index < length) {
  8508. var value = array[index];
  8509. if (predicate(value, index, array)) {
  8510. result.push(value);
  8511. indexes.push(index);
  8512. }
  8513. }
  8514. basePullAt(array, indexes);
  8515. return result;
  8516. }
  8517. /**
  8518. * Reverses `array` so that the first element becomes the last, the second
  8519. * element becomes the second to last, and so on.
  8520. *
  8521. * **Note:** This method mutates `array` and is based on
  8522. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8523. *
  8524. * @static
  8525. * @memberOf _
  8526. * @since 4.0.0
  8527. * @category Array
  8528. * @param {Array} array The array to modify.
  8529. * @returns {Array} Returns `array`.
  8530. * @example
  8531. *
  8532. * var array = [1, 2, 3];
  8533. *
  8534. * _.reverse(array);
  8535. * // => [3, 2, 1]
  8536. *
  8537. * console.log(array);
  8538. * // => [3, 2, 1]
  8539. */
  8540. function reverse(array) {
  8541. return array == null ? array : nativeReverse.call(array);
  8542. }
  8543. /**
  8544. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8545. *
  8546. * **Note:** This method is used instead of
  8547. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8548. * returned.
  8549. *
  8550. * @static
  8551. * @memberOf _
  8552. * @since 3.0.0
  8553. * @category Array
  8554. * @param {Array} array The array to slice.
  8555. * @param {number} [start=0] The start position.
  8556. * @param {number} [end=array.length] The end position.
  8557. * @returns {Array} Returns the slice of `array`.
  8558. */
  8559. function slice(array, start, end) {
  8560. var length = array == null ? 0 : array.length;
  8561. if (!length) {
  8562. return [];
  8563. }
  8564. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8565. start = 0;
  8566. end = length;
  8567. }
  8568. else {
  8569. start = start == null ? 0 : toInteger(start);
  8570. end = end === undefined ? length : toInteger(end);
  8571. }
  8572. return baseSlice(array, start, end);
  8573. }
  8574. /**
  8575. * Uses a binary search to determine the lowest index at which `value`
  8576. * should be inserted into `array` in order to maintain its sort order.
  8577. *
  8578. * @static
  8579. * @memberOf _
  8580. * @since 0.1.0
  8581. * @category Array
  8582. * @param {Array} array The sorted array to inspect.
  8583. * @param {*} value The value to evaluate.
  8584. * @returns {number} Returns the index at which `value` should be inserted
  8585. * into `array`.
  8586. * @example
  8587. *
  8588. * _.sortedIndex([30, 50], 40);
  8589. * // => 1
  8590. */
  8591. function sortedIndex(array, value) {
  8592. return baseSortedIndex(array, value);
  8593. }
  8594. /**
  8595. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8596. * which is invoked for `value` and each element of `array` to compute their
  8597. * sort ranking. The iteratee is invoked with one argument: (value).
  8598. *
  8599. * @static
  8600. * @memberOf _
  8601. * @since 4.0.0
  8602. * @category Array
  8603. * @param {Array} array The sorted array to inspect.
  8604. * @param {*} value The value to evaluate.
  8605. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8606. * @returns {number} Returns the index at which `value` should be inserted
  8607. * into `array`.
  8608. * @example
  8609. *
  8610. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8611. *
  8612. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8613. * // => 0
  8614. *
  8615. * // The `_.property` iteratee shorthand.
  8616. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8617. * // => 0
  8618. */
  8619. function sortedIndexBy(array, value, iteratee) {
  8620. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8621. }
  8622. /**
  8623. * This method is like `_.indexOf` except that it performs a binary
  8624. * search on a sorted `array`.
  8625. *
  8626. * @static
  8627. * @memberOf _
  8628. * @since 4.0.0
  8629. * @category Array
  8630. * @param {Array} array The array to inspect.
  8631. * @param {*} value The value to search for.
  8632. * @returns {number} Returns the index of the matched value, else `-1`.
  8633. * @example
  8634. *
  8635. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8636. * // => 1
  8637. */
  8638. function sortedIndexOf(array, value) {
  8639. var length = array == null ? 0 : array.length;
  8640. if (length) {
  8641. var index = baseSortedIndex(array, value);
  8642. if (index < length && eq(array[index], value)) {
  8643. return index;
  8644. }
  8645. }
  8646. return -1;
  8647. }
  8648. /**
  8649. * This method is like `_.sortedIndex` except that it returns the highest
  8650. * index at which `value` should be inserted into `array` in order to
  8651. * maintain its sort order.
  8652. *
  8653. * @static
  8654. * @memberOf _
  8655. * @since 3.0.0
  8656. * @category Array
  8657. * @param {Array} array The sorted array to inspect.
  8658. * @param {*} value The value to evaluate.
  8659. * @returns {number} Returns the index at which `value` should be inserted
  8660. * into `array`.
  8661. * @example
  8662. *
  8663. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8664. * // => 4
  8665. */
  8666. function sortedLastIndex(array, value) {
  8667. return baseSortedIndex(array, value, true);
  8668. }
  8669. /**
  8670. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8671. * which is invoked for `value` and each element of `array` to compute their
  8672. * sort ranking. The iteratee is invoked with one argument: (value).
  8673. *
  8674. * @static
  8675. * @memberOf _
  8676. * @since 4.0.0
  8677. * @category Array
  8678. * @param {Array} array The sorted array to inspect.
  8679. * @param {*} value The value to evaluate.
  8680. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8681. * @returns {number} Returns the index at which `value` should be inserted
  8682. * into `array`.
  8683. * @example
  8684. *
  8685. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8686. *
  8687. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8688. * // => 1
  8689. *
  8690. * // The `_.property` iteratee shorthand.
  8691. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8692. * // => 1
  8693. */
  8694. function sortedLastIndexBy(array, value, iteratee) {
  8695. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8696. }
  8697. /**
  8698. * This method is like `_.lastIndexOf` except that it performs a binary
  8699. * search on a sorted `array`.
  8700. *
  8701. * @static
  8702. * @memberOf _
  8703. * @since 4.0.0
  8704. * @category Array
  8705. * @param {Array} array The array to inspect.
  8706. * @param {*} value The value to search for.
  8707. * @returns {number} Returns the index of the matched value, else `-1`.
  8708. * @example
  8709. *
  8710. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8711. * // => 3
  8712. */
  8713. function sortedLastIndexOf(array, value) {
  8714. var length = array == null ? 0 : array.length;
  8715. if (length) {
  8716. var index = baseSortedIndex(array, value, true) - 1;
  8717. if (eq(array[index], value)) {
  8718. return index;
  8719. }
  8720. }
  8721. return -1;
  8722. }
  8723. /**
  8724. * This method is like `_.uniq` except that it's designed and optimized
  8725. * for sorted arrays.
  8726. *
  8727. * @static
  8728. * @memberOf _
  8729. * @since 4.0.0
  8730. * @category Array
  8731. * @param {Array} array The array to inspect.
  8732. * @returns {Array} Returns the new duplicate free array.
  8733. * @example
  8734. *
  8735. * _.sortedUniq([1, 1, 2]);
  8736. * // => [1, 2]
  8737. */
  8738. function sortedUniq(array) {
  8739. return (array && array.length)
  8740. ? baseSortedUniq(array)
  8741. : [];
  8742. }
  8743. /**
  8744. * This method is like `_.uniqBy` except that it's designed and optimized
  8745. * for sorted arrays.
  8746. *
  8747. * @static
  8748. * @memberOf _
  8749. * @since 4.0.0
  8750. * @category Array
  8751. * @param {Array} array The array to inspect.
  8752. * @param {Function} [iteratee] The iteratee invoked per element.
  8753. * @returns {Array} Returns the new duplicate free array.
  8754. * @example
  8755. *
  8756. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8757. * // => [1.1, 2.3]
  8758. */
  8759. function sortedUniqBy(array, iteratee) {
  8760. return (array && array.length)
  8761. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8762. : [];
  8763. }
  8764. /**
  8765. * Gets all but the first element of `array`.
  8766. *
  8767. * @static
  8768. * @memberOf _
  8769. * @since 4.0.0
  8770. * @category Array
  8771. * @param {Array} array The array to query.
  8772. * @returns {Array} Returns the slice of `array`.
  8773. * @example
  8774. *
  8775. * _.tail([1, 2, 3]);
  8776. * // => [2, 3]
  8777. */
  8778. function tail(array) {
  8779. var length = array == null ? 0 : array.length;
  8780. return length ? baseSlice(array, 1, length) : [];
  8781. }
  8782. /**
  8783. * Creates a slice of `array` with `n` elements taken from the beginning.
  8784. *
  8785. * @static
  8786. * @memberOf _
  8787. * @since 0.1.0
  8788. * @category Array
  8789. * @param {Array} array The array to query.
  8790. * @param {number} [n=1] The number of elements to take.
  8791. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8792. * @returns {Array} Returns the slice of `array`.
  8793. * @example
  8794. *
  8795. * _.take([1, 2, 3]);
  8796. * // => [1]
  8797. *
  8798. * _.take([1, 2, 3], 2);
  8799. * // => [1, 2]
  8800. *
  8801. * _.take([1, 2, 3], 5);
  8802. * // => [1, 2, 3]
  8803. *
  8804. * _.take([1, 2, 3], 0);
  8805. * // => []
  8806. */
  8807. function take(array, n, guard) {
  8808. if (!(array && array.length)) {
  8809. return [];
  8810. }
  8811. n = (guard || n === undefined) ? 1 : toInteger(n);
  8812. return baseSlice(array, 0, n < 0 ? 0 : n);
  8813. }
  8814. /**
  8815. * Creates a slice of `array` with `n` elements taken from the end.
  8816. *
  8817. * @static
  8818. * @memberOf _
  8819. * @since 3.0.0
  8820. * @category Array
  8821. * @param {Array} array The array to query.
  8822. * @param {number} [n=1] The number of elements to take.
  8823. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8824. * @returns {Array} Returns the slice of `array`.
  8825. * @example
  8826. *
  8827. * _.takeRight([1, 2, 3]);
  8828. * // => [3]
  8829. *
  8830. * _.takeRight([1, 2, 3], 2);
  8831. * // => [2, 3]
  8832. *
  8833. * _.takeRight([1, 2, 3], 5);
  8834. * // => [1, 2, 3]
  8835. *
  8836. * _.takeRight([1, 2, 3], 0);
  8837. * // => []
  8838. */
  8839. function takeRight(array, n, guard) {
  8840. var length = array == null ? 0 : array.length;
  8841. if (!length) {
  8842. return [];
  8843. }
  8844. n = (guard || n === undefined) ? 1 : toInteger(n);
  8845. n = length - n;
  8846. return baseSlice(array, n < 0 ? 0 : n, length);
  8847. }
  8848. /**
  8849. * Creates a slice of `array` with elements taken from the end. Elements are
  8850. * taken until `predicate` returns falsey. The predicate is invoked with
  8851. * three arguments: (value, index, array).
  8852. *
  8853. * @static
  8854. * @memberOf _
  8855. * @since 3.0.0
  8856. * @category Array
  8857. * @param {Array} array The array to query.
  8858. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8859. * @returns {Array} Returns the slice of `array`.
  8860. * @example
  8861. *
  8862. * var users = [
  8863. * { 'user': 'barney', 'active': true },
  8864. * { 'user': 'fred', 'active': false },
  8865. * { 'user': 'pebbles', 'active': false }
  8866. * ];
  8867. *
  8868. * _.takeRightWhile(users, function(o) { return !o.active; });
  8869. * // => objects for ['fred', 'pebbles']
  8870. *
  8871. * // The `_.matches` iteratee shorthand.
  8872. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8873. * // => objects for ['pebbles']
  8874. *
  8875. * // The `_.matchesProperty` iteratee shorthand.
  8876. * _.takeRightWhile(users, ['active', false]);
  8877. * // => objects for ['fred', 'pebbles']
  8878. *
  8879. * // The `_.property` iteratee shorthand.
  8880. * _.takeRightWhile(users, 'active');
  8881. * // => []
  8882. */
  8883. function takeRightWhile(array, predicate) {
  8884. return (array && array.length)
  8885. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8886. : [];
  8887. }
  8888. /**
  8889. * Creates a slice of `array` with elements taken from the beginning. Elements
  8890. * are taken until `predicate` returns falsey. The predicate is invoked with
  8891. * three arguments: (value, index, array).
  8892. *
  8893. * @static
  8894. * @memberOf _
  8895. * @since 3.0.0
  8896. * @category Array
  8897. * @param {Array} array The array to query.
  8898. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8899. * @returns {Array} Returns the slice of `array`.
  8900. * @example
  8901. *
  8902. * var users = [
  8903. * { 'user': 'barney', 'active': false },
  8904. * { 'user': 'fred', 'active': false },
  8905. * { 'user': 'pebbles', 'active': true }
  8906. * ];
  8907. *
  8908. * _.takeWhile(users, function(o) { return !o.active; });
  8909. * // => objects for ['barney', 'fred']
  8910. *
  8911. * // The `_.matches` iteratee shorthand.
  8912. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8913. * // => objects for ['barney']
  8914. *
  8915. * // The `_.matchesProperty` iteratee shorthand.
  8916. * _.takeWhile(users, ['active', false]);
  8917. * // => objects for ['barney', 'fred']
  8918. *
  8919. * // The `_.property` iteratee shorthand.
  8920. * _.takeWhile(users, 'active');
  8921. * // => []
  8922. */
  8923. function takeWhile(array, predicate) {
  8924. return (array && array.length)
  8925. ? baseWhile(array, getIteratee(predicate, 3))
  8926. : [];
  8927. }
  8928. /**
  8929. * Creates an array of unique values, in order, from all given arrays using
  8930. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8931. * for equality comparisons.
  8932. *
  8933. * @static
  8934. * @memberOf _
  8935. * @since 0.1.0
  8936. * @category Array
  8937. * @param {...Array} [arrays] The arrays to inspect.
  8938. * @returns {Array} Returns the new array of combined values.
  8939. * @example
  8940. *
  8941. * _.union([2], [1, 2]);
  8942. * // => [2, 1]
  8943. */
  8944. var union = baseRest(function(arrays) {
  8945. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8946. });
  8947. /**
  8948. * This method is like `_.union` except that it accepts `iteratee` which is
  8949. * invoked for each element of each `arrays` to generate the criterion by
  8950. * which uniqueness is computed. Result values are chosen from the first
  8951. * array in which the value occurs. The iteratee is invoked with one argument:
  8952. * (value).
  8953. *
  8954. * @static
  8955. * @memberOf _
  8956. * @since 4.0.0
  8957. * @category Array
  8958. * @param {...Array} [arrays] The arrays to inspect.
  8959. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8960. * @returns {Array} Returns the new array of combined values.
  8961. * @example
  8962. *
  8963. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8964. * // => [2.1, 1.2]
  8965. *
  8966. * // The `_.property` iteratee shorthand.
  8967. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8968. * // => [{ 'x': 1 }, { 'x': 2 }]
  8969. */
  8970. var unionBy = baseRest(function(arrays) {
  8971. var iteratee = last(arrays);
  8972. if (isArrayLikeObject(iteratee)) {
  8973. iteratee = undefined;
  8974. }
  8975. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8976. });
  8977. /**
  8978. * This method is like `_.union` except that it accepts `comparator` which
  8979. * is invoked to compare elements of `arrays`. Result values are chosen from
  8980. * the first array in which the value occurs. The comparator is invoked
  8981. * with two arguments: (arrVal, othVal).
  8982. *
  8983. * @static
  8984. * @memberOf _
  8985. * @since 4.0.0
  8986. * @category Array
  8987. * @param {...Array} [arrays] The arrays to inspect.
  8988. * @param {Function} [comparator] The comparator invoked per element.
  8989. * @returns {Array} Returns the new array of combined values.
  8990. * @example
  8991. *
  8992. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8993. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8994. *
  8995. * _.unionWith(objects, others, _.isEqual);
  8996. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8997. */
  8998. var unionWith = baseRest(function(arrays) {
  8999. var comparator = last(arrays);
  9000. comparator = typeof comparator == 'function' ? comparator : undefined;
  9001. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9002. });
  9003. /**
  9004. * Creates a duplicate-free version of an array, using
  9005. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9006. * for equality comparisons, in which only the first occurrence of each element
  9007. * is kept. The order of result values is determined by the order they occur
  9008. * in the array.
  9009. *
  9010. * @static
  9011. * @memberOf _
  9012. * @since 0.1.0
  9013. * @category Array
  9014. * @param {Array} array The array to inspect.
  9015. * @returns {Array} Returns the new duplicate free array.
  9016. * @example
  9017. *
  9018. * _.uniq([2, 1, 2]);
  9019. * // => [2, 1]
  9020. */
  9021. function uniq(array) {
  9022. return (array && array.length) ? baseUniq(array) : [];
  9023. }
  9024. /**
  9025. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9026. * invoked for each element in `array` to generate the criterion by which
  9027. * uniqueness is computed. The order of result values is determined by the
  9028. * order they occur in the array. The iteratee is invoked with one argument:
  9029. * (value).
  9030. *
  9031. * @static
  9032. * @memberOf _
  9033. * @since 4.0.0
  9034. * @category Array
  9035. * @param {Array} array The array to inspect.
  9036. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9037. * @returns {Array} Returns the new duplicate free array.
  9038. * @example
  9039. *
  9040. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9041. * // => [2.1, 1.2]
  9042. *
  9043. * // The `_.property` iteratee shorthand.
  9044. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9045. * // => [{ 'x': 1 }, { 'x': 2 }]
  9046. */
  9047. function uniqBy(array, iteratee) {
  9048. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9049. }
  9050. /**
  9051. * This method is like `_.uniq` except that it accepts `comparator` which
  9052. * is invoked to compare elements of `array`. The order of result values is
  9053. * determined by the order they occur in the array.The comparator is invoked
  9054. * with two arguments: (arrVal, othVal).
  9055. *
  9056. * @static
  9057. * @memberOf _
  9058. * @since 4.0.0
  9059. * @category Array
  9060. * @param {Array} array The array to inspect.
  9061. * @param {Function} [comparator] The comparator invoked per element.
  9062. * @returns {Array} Returns the new duplicate free array.
  9063. * @example
  9064. *
  9065. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9066. *
  9067. * _.uniqWith(objects, _.isEqual);
  9068. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9069. */
  9070. function uniqWith(array, comparator) {
  9071. comparator = typeof comparator == 'function' ? comparator : undefined;
  9072. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9073. }
  9074. /**
  9075. * This method is like `_.zip` except that it accepts an array of grouped
  9076. * elements and creates an array regrouping the elements to their pre-zip
  9077. * configuration.
  9078. *
  9079. * @static
  9080. * @memberOf _
  9081. * @since 1.2.0
  9082. * @category Array
  9083. * @param {Array} array The array of grouped elements to process.
  9084. * @returns {Array} Returns the new array of regrouped elements.
  9085. * @example
  9086. *
  9087. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9088. * // => [['a', 1, true], ['b', 2, false]]
  9089. *
  9090. * _.unzip(zipped);
  9091. * // => [['a', 'b'], [1, 2], [true, false]]
  9092. */
  9093. function unzip(array) {
  9094. if (!(array && array.length)) {
  9095. return [];
  9096. }
  9097. var length = 0;
  9098. array = arrayFilter(array, function(group) {
  9099. if (isArrayLikeObject(group)) {
  9100. length = nativeMax(group.length, length);
  9101. return true;
  9102. }
  9103. });
  9104. return baseTimes(length, function(index) {
  9105. return arrayMap(array, baseProperty(index));
  9106. });
  9107. }
  9108. /**
  9109. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9110. * how regrouped values should be combined. The iteratee is invoked with the
  9111. * elements of each group: (...group).
  9112. *
  9113. * @static
  9114. * @memberOf _
  9115. * @since 3.8.0
  9116. * @category Array
  9117. * @param {Array} array The array of grouped elements to process.
  9118. * @param {Function} [iteratee=_.identity] The function to combine
  9119. * regrouped values.
  9120. * @returns {Array} Returns the new array of regrouped elements.
  9121. * @example
  9122. *
  9123. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9124. * // => [[1, 10, 100], [2, 20, 200]]
  9125. *
  9126. * _.unzipWith(zipped, _.add);
  9127. * // => [3, 30, 300]
  9128. */
  9129. function unzipWith(array, iteratee) {
  9130. if (!(array && array.length)) {
  9131. return [];
  9132. }
  9133. var result = unzip(array);
  9134. if (iteratee == null) {
  9135. return result;
  9136. }
  9137. return arrayMap(result, function(group) {
  9138. return apply(iteratee, undefined, group);
  9139. });
  9140. }
  9141. /**
  9142. * Creates an array excluding all given values using
  9143. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9144. * for equality comparisons.
  9145. *
  9146. * **Note:** Unlike `_.pull`, this method returns a new array.
  9147. *
  9148. * @static
  9149. * @memberOf _
  9150. * @since 0.1.0
  9151. * @category Array
  9152. * @param {Array} array The array to inspect.
  9153. * @param {...*} [values] The values to exclude.
  9154. * @returns {Array} Returns the new array of filtered values.
  9155. * @see _.difference, _.xor
  9156. * @example
  9157. *
  9158. * _.without([2, 1, 2, 3], 1, 2);
  9159. * // => [3]
  9160. */
  9161. var without = baseRest(function(array, values) {
  9162. return isArrayLikeObject(array)
  9163. ? baseDifference(array, values)
  9164. : [];
  9165. });
  9166. /**
  9167. * Creates an array of unique values that is the
  9168. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9169. * of the given arrays. The order of result values is determined by the order
  9170. * they occur in the arrays.
  9171. *
  9172. * @static
  9173. * @memberOf _
  9174. * @since 2.4.0
  9175. * @category Array
  9176. * @param {...Array} [arrays] The arrays to inspect.
  9177. * @returns {Array} Returns the new array of filtered values.
  9178. * @see _.difference, _.without
  9179. * @example
  9180. *
  9181. * _.xor([2, 1], [2, 3]);
  9182. * // => [1, 3]
  9183. */
  9184. var xor = baseRest(function(arrays) {
  9185. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9186. });
  9187. /**
  9188. * This method is like `_.xor` except that it accepts `iteratee` which is
  9189. * invoked for each element of each `arrays` to generate the criterion by
  9190. * which by which they're compared. The order of result values is determined
  9191. * by the order they occur in the arrays. The iteratee is invoked with one
  9192. * argument: (value).
  9193. *
  9194. * @static
  9195. * @memberOf _
  9196. * @since 4.0.0
  9197. * @category Array
  9198. * @param {...Array} [arrays] The arrays to inspect.
  9199. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9200. * @returns {Array} Returns the new array of filtered values.
  9201. * @example
  9202. *
  9203. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9204. * // => [1.2, 3.4]
  9205. *
  9206. * // The `_.property` iteratee shorthand.
  9207. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9208. * // => [{ 'x': 2 }]
  9209. */
  9210. var xorBy = baseRest(function(arrays) {
  9211. var iteratee = last(arrays);
  9212. if (isArrayLikeObject(iteratee)) {
  9213. iteratee = undefined;
  9214. }
  9215. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9216. });
  9217. /**
  9218. * This method is like `_.xor` except that it accepts `comparator` which is
  9219. * invoked to compare elements of `arrays`. The order of result values is
  9220. * determined by the order they occur in the arrays. The comparator is invoked
  9221. * with two arguments: (arrVal, othVal).
  9222. *
  9223. * @static
  9224. * @memberOf _
  9225. * @since 4.0.0
  9226. * @category Array
  9227. * @param {...Array} [arrays] The arrays to inspect.
  9228. * @param {Function} [comparator] The comparator invoked per element.
  9229. * @returns {Array} Returns the new array of filtered values.
  9230. * @example
  9231. *
  9232. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9233. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9234. *
  9235. * _.xorWith(objects, others, _.isEqual);
  9236. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9237. */
  9238. var xorWith = baseRest(function(arrays) {
  9239. var comparator = last(arrays);
  9240. comparator = typeof comparator == 'function' ? comparator : undefined;
  9241. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9242. });
  9243. /**
  9244. * Creates an array of grouped elements, the first of which contains the
  9245. * first elements of the given arrays, the second of which contains the
  9246. * second elements of the given arrays, and so on.
  9247. *
  9248. * @static
  9249. * @memberOf _
  9250. * @since 0.1.0
  9251. * @category Array
  9252. * @param {...Array} [arrays] The arrays to process.
  9253. * @returns {Array} Returns the new array of grouped elements.
  9254. * @example
  9255. *
  9256. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9257. * // => [['a', 1, true], ['b', 2, false]]
  9258. */
  9259. var zip = baseRest(unzip);
  9260. /**
  9261. * This method is like `_.fromPairs` except that it accepts two arrays,
  9262. * one of property identifiers and one of corresponding values.
  9263. *
  9264. * @static
  9265. * @memberOf _
  9266. * @since 0.4.0
  9267. * @category Array
  9268. * @param {Array} [props=[]] The property identifiers.
  9269. * @param {Array} [values=[]] The property values.
  9270. * @returns {Object} Returns the new object.
  9271. * @example
  9272. *
  9273. * _.zipObject(['a', 'b'], [1, 2]);
  9274. * // => { 'a': 1, 'b': 2 }
  9275. */
  9276. function zipObject(props, values) {
  9277. return baseZipObject(props || [], values || [], assignValue);
  9278. }
  9279. /**
  9280. * This method is like `_.zipObject` except that it supports property paths.
  9281. *
  9282. * @static
  9283. * @memberOf _
  9284. * @since 4.1.0
  9285. * @category Array
  9286. * @param {Array} [props=[]] The property identifiers.
  9287. * @param {Array} [values=[]] The property values.
  9288. * @returns {Object} Returns the new object.
  9289. * @example
  9290. *
  9291. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9292. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9293. */
  9294. function zipObjectDeep(props, values) {
  9295. return baseZipObject(props || [], values || [], baseSet);
  9296. }
  9297. /**
  9298. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9299. * how grouped values should be combined. The iteratee is invoked with the
  9300. * elements of each group: (...group).
  9301. *
  9302. * @static
  9303. * @memberOf _
  9304. * @since 3.8.0
  9305. * @category Array
  9306. * @param {...Array} [arrays] The arrays to process.
  9307. * @param {Function} [iteratee=_.identity] The function to combine
  9308. * grouped values.
  9309. * @returns {Array} Returns the new array of grouped elements.
  9310. * @example
  9311. *
  9312. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9313. * return a + b + c;
  9314. * });
  9315. * // => [111, 222]
  9316. */
  9317. var zipWith = baseRest(function(arrays) {
  9318. var length = arrays.length,
  9319. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9320. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9321. return unzipWith(arrays, iteratee);
  9322. });
  9323. /*------------------------------------------------------------------------*/
  9324. /**
  9325. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9326. * chain sequences enabled. The result of such sequences must be unwrapped
  9327. * with `_#value`.
  9328. *
  9329. * @static
  9330. * @memberOf _
  9331. * @since 1.3.0
  9332. * @category Seq
  9333. * @param {*} value The value to wrap.
  9334. * @returns {Object} Returns the new `lodash` wrapper instance.
  9335. * @example
  9336. *
  9337. * var users = [
  9338. * { 'user': 'barney', 'age': 36 },
  9339. * { 'user': 'fred', 'age': 40 },
  9340. * { 'user': 'pebbles', 'age': 1 }
  9341. * ];
  9342. *
  9343. * var youngest = _
  9344. * .chain(users)
  9345. * .sortBy('age')
  9346. * .map(function(o) {
  9347. * return o.user + ' is ' + o.age;
  9348. * })
  9349. * .head()
  9350. * .value();
  9351. * // => 'pebbles is 1'
  9352. */
  9353. function chain(value) {
  9354. var result = lodash(value);
  9355. result.__chain__ = true;
  9356. return result;
  9357. }
  9358. /**
  9359. * This method invokes `interceptor` and returns `value`. The interceptor
  9360. * is invoked with one argument; (value). The purpose of this method is to
  9361. * "tap into" a method chain sequence in order to modify intermediate results.
  9362. *
  9363. * @static
  9364. * @memberOf _
  9365. * @since 0.1.0
  9366. * @category Seq
  9367. * @param {*} value The value to provide to `interceptor`.
  9368. * @param {Function} interceptor The function to invoke.
  9369. * @returns {*} Returns `value`.
  9370. * @example
  9371. *
  9372. * _([1, 2, 3])
  9373. * .tap(function(array) {
  9374. * // Mutate input array.
  9375. * array.pop();
  9376. * })
  9377. * .reverse()
  9378. * .value();
  9379. * // => [2, 1]
  9380. */
  9381. function tap(value, interceptor) {
  9382. interceptor(value);
  9383. return value;
  9384. }
  9385. /**
  9386. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9387. * The purpose of this method is to "pass thru" values replacing intermediate
  9388. * results in a method chain sequence.
  9389. *
  9390. * @static
  9391. * @memberOf _
  9392. * @since 3.0.0
  9393. * @category Seq
  9394. * @param {*} value The value to provide to `interceptor`.
  9395. * @param {Function} interceptor The function to invoke.
  9396. * @returns {*} Returns the result of `interceptor`.
  9397. * @example
  9398. *
  9399. * _(' abc ')
  9400. * .chain()
  9401. * .trim()
  9402. * .thru(function(value) {
  9403. * return [value];
  9404. * })
  9405. * .value();
  9406. * // => ['abc']
  9407. */
  9408. function thru(value, interceptor) {
  9409. return interceptor(value);
  9410. }
  9411. /**
  9412. * This method is the wrapper version of `_.at`.
  9413. *
  9414. * @name at
  9415. * @memberOf _
  9416. * @since 1.0.0
  9417. * @category Seq
  9418. * @param {...(string|string[])} [paths] The property paths to pick.
  9419. * @returns {Object} Returns the new `lodash` wrapper instance.
  9420. * @example
  9421. *
  9422. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9423. *
  9424. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9425. * // => [3, 4]
  9426. */
  9427. var wrapperAt = flatRest(function(paths) {
  9428. var length = paths.length,
  9429. start = length ? paths[0] : 0,
  9430. value = this.__wrapped__,
  9431. interceptor = function(object) { return baseAt(object, paths); };
  9432. if (length > 1 || this.__actions__.length ||
  9433. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9434. return this.thru(interceptor);
  9435. }
  9436. value = value.slice(start, +start + (length ? 1 : 0));
  9437. value.__actions__.push({
  9438. 'func': thru,
  9439. 'args': [interceptor],
  9440. 'thisArg': undefined
  9441. });
  9442. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9443. if (length && !array.length) {
  9444. array.push(undefined);
  9445. }
  9446. return array;
  9447. });
  9448. });
  9449. /**
  9450. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9451. *
  9452. * @name chain
  9453. * @memberOf _
  9454. * @since 0.1.0
  9455. * @category Seq
  9456. * @returns {Object} Returns the new `lodash` wrapper instance.
  9457. * @example
  9458. *
  9459. * var users = [
  9460. * { 'user': 'barney', 'age': 36 },
  9461. * { 'user': 'fred', 'age': 40 }
  9462. * ];
  9463. *
  9464. * // A sequence without explicit chaining.
  9465. * _(users).head();
  9466. * // => { 'user': 'barney', 'age': 36 }
  9467. *
  9468. * // A sequence with explicit chaining.
  9469. * _(users)
  9470. * .chain()
  9471. * .head()
  9472. * .pick('user')
  9473. * .value();
  9474. * // => { 'user': 'barney' }
  9475. */
  9476. function wrapperChain() {
  9477. return chain(this);
  9478. }
  9479. /**
  9480. * Executes the chain sequence and returns the wrapped result.
  9481. *
  9482. * @name commit
  9483. * @memberOf _
  9484. * @since 3.2.0
  9485. * @category Seq
  9486. * @returns {Object} Returns the new `lodash` wrapper instance.
  9487. * @example
  9488. *
  9489. * var array = [1, 2];
  9490. * var wrapped = _(array).push(3);
  9491. *
  9492. * console.log(array);
  9493. * // => [1, 2]
  9494. *
  9495. * wrapped = wrapped.commit();
  9496. * console.log(array);
  9497. * // => [1, 2, 3]
  9498. *
  9499. * wrapped.last();
  9500. * // => 3
  9501. *
  9502. * console.log(array);
  9503. * // => [1, 2, 3]
  9504. */
  9505. function wrapperCommit() {
  9506. return new LodashWrapper(this.value(), this.__chain__);
  9507. }
  9508. /**
  9509. * Gets the next value on a wrapped object following the
  9510. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9511. *
  9512. * @name next
  9513. * @memberOf _
  9514. * @since 4.0.0
  9515. * @category Seq
  9516. * @returns {Object} Returns the next iterator value.
  9517. * @example
  9518. *
  9519. * var wrapped = _([1, 2]);
  9520. *
  9521. * wrapped.next();
  9522. * // => { 'done': false, 'value': 1 }
  9523. *
  9524. * wrapped.next();
  9525. * // => { 'done': false, 'value': 2 }
  9526. *
  9527. * wrapped.next();
  9528. * // => { 'done': true, 'value': undefined }
  9529. */
  9530. function wrapperNext() {
  9531. if (this.__values__ === undefined) {
  9532. this.__values__ = toArray(this.value());
  9533. }
  9534. var done = this.__index__ >= this.__values__.length,
  9535. value = done ? undefined : this.__values__[this.__index__++];
  9536. return { 'done': done, 'value': value };
  9537. }
  9538. /**
  9539. * Enables the wrapper to be iterable.
  9540. *
  9541. * @name Symbol.iterator
  9542. * @memberOf _
  9543. * @since 4.0.0
  9544. * @category Seq
  9545. * @returns {Object} Returns the wrapper object.
  9546. * @example
  9547. *
  9548. * var wrapped = _([1, 2]);
  9549. *
  9550. * wrapped[Symbol.iterator]() === wrapped;
  9551. * // => true
  9552. *
  9553. * Array.from(wrapped);
  9554. * // => [1, 2]
  9555. */
  9556. function wrapperToIterator() {
  9557. return this;
  9558. }
  9559. /**
  9560. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9561. *
  9562. * @name plant
  9563. * @memberOf _
  9564. * @since 3.2.0
  9565. * @category Seq
  9566. * @param {*} value The value to plant.
  9567. * @returns {Object} Returns the new `lodash` wrapper instance.
  9568. * @example
  9569. *
  9570. * function square(n) {
  9571. * return n * n;
  9572. * }
  9573. *
  9574. * var wrapped = _([1, 2]).map(square);
  9575. * var other = wrapped.plant([3, 4]);
  9576. *
  9577. * other.value();
  9578. * // => [9, 16]
  9579. *
  9580. * wrapped.value();
  9581. * // => [1, 4]
  9582. */
  9583. function wrapperPlant(value) {
  9584. var result,
  9585. parent = this;
  9586. while (parent instanceof baseLodash) {
  9587. var clone = wrapperClone(parent);
  9588. clone.__index__ = 0;
  9589. clone.__values__ = undefined;
  9590. if (result) {
  9591. previous.__wrapped__ = clone;
  9592. } else {
  9593. result = clone;
  9594. }
  9595. var previous = clone;
  9596. parent = parent.__wrapped__;
  9597. }
  9598. previous.__wrapped__ = value;
  9599. return result;
  9600. }
  9601. /**
  9602. * This method is the wrapper version of `_.reverse`.
  9603. *
  9604. * **Note:** This method mutates the wrapped array.
  9605. *
  9606. * @name reverse
  9607. * @memberOf _
  9608. * @since 0.1.0
  9609. * @category Seq
  9610. * @returns {Object} Returns the new `lodash` wrapper instance.
  9611. * @example
  9612. *
  9613. * var array = [1, 2, 3];
  9614. *
  9615. * _(array).reverse().value()
  9616. * // => [3, 2, 1]
  9617. *
  9618. * console.log(array);
  9619. * // => [3, 2, 1]
  9620. */
  9621. function wrapperReverse() {
  9622. var value = this.__wrapped__;
  9623. if (value instanceof LazyWrapper) {
  9624. var wrapped = value;
  9625. if (this.__actions__.length) {
  9626. wrapped = new LazyWrapper(this);
  9627. }
  9628. wrapped = wrapped.reverse();
  9629. wrapped.__actions__.push({
  9630. 'func': thru,
  9631. 'args': [reverse],
  9632. 'thisArg': undefined
  9633. });
  9634. return new LodashWrapper(wrapped, this.__chain__);
  9635. }
  9636. return this.thru(reverse);
  9637. }
  9638. /**
  9639. * Executes the chain sequence to resolve the unwrapped value.
  9640. *
  9641. * @name value
  9642. * @memberOf _
  9643. * @since 0.1.0
  9644. * @alias toJSON, valueOf
  9645. * @category Seq
  9646. * @returns {*} Returns the resolved unwrapped value.
  9647. * @example
  9648. *
  9649. * _([1, 2, 3]).value();
  9650. * // => [1, 2, 3]
  9651. */
  9652. function wrapperValue() {
  9653. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9654. }
  9655. /*------------------------------------------------------------------------*/
  9656. /**
  9657. * Creates an object composed of keys generated from the results of running
  9658. * each element of `collection` thru `iteratee`. The corresponding value of
  9659. * each key is the number of times the key was returned by `iteratee`. The
  9660. * iteratee is invoked with one argument: (value).
  9661. *
  9662. * @static
  9663. * @memberOf _
  9664. * @since 0.5.0
  9665. * @category Collection
  9666. * @param {Array|Object} collection The collection to iterate over.
  9667. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9668. * @returns {Object} Returns the composed aggregate object.
  9669. * @example
  9670. *
  9671. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9672. * // => { '4': 1, '6': 2 }
  9673. *
  9674. * // The `_.property` iteratee shorthand.
  9675. * _.countBy(['one', 'two', 'three'], 'length');
  9676. * // => { '3': 2, '5': 1 }
  9677. */
  9678. var countBy = createAggregator(function(result, value, key) {
  9679. if (hasOwnProperty.call(result, key)) {
  9680. ++result[key];
  9681. } else {
  9682. baseAssignValue(result, key, 1);
  9683. }
  9684. });
  9685. /**
  9686. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9687. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9688. * invoked with three arguments: (value, index|key, collection).
  9689. *
  9690. * **Note:** This method returns `true` for
  9691. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9692. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9693. * elements of empty collections.
  9694. *
  9695. * @static
  9696. * @memberOf _
  9697. * @since 0.1.0
  9698. * @category Collection
  9699. * @param {Array|Object} collection The collection to iterate over.
  9700. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9701. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9702. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9703. * else `false`.
  9704. * @example
  9705. *
  9706. * _.every([true, 1, null, 'yes'], Boolean);
  9707. * // => false
  9708. *
  9709. * var users = [
  9710. * { 'user': 'barney', 'age': 36, 'active': false },
  9711. * { 'user': 'fred', 'age': 40, 'active': false }
  9712. * ];
  9713. *
  9714. * // The `_.matches` iteratee shorthand.
  9715. * _.every(users, { 'user': 'barney', 'active': false });
  9716. * // => false
  9717. *
  9718. * // The `_.matchesProperty` iteratee shorthand.
  9719. * _.every(users, ['active', false]);
  9720. * // => true
  9721. *
  9722. * // The `_.property` iteratee shorthand.
  9723. * _.every(users, 'active');
  9724. * // => false
  9725. */
  9726. function every(collection, predicate, guard) {
  9727. var func = isArray(collection) ? arrayEvery : baseEvery;
  9728. if (guard && isIterateeCall(collection, predicate, guard)) {
  9729. predicate = undefined;
  9730. }
  9731. return func(collection, getIteratee(predicate, 3));
  9732. }
  9733. /**
  9734. * Iterates over elements of `collection`, returning an array of all elements
  9735. * `predicate` returns truthy for. The predicate is invoked with three
  9736. * arguments: (value, index|key, collection).
  9737. *
  9738. * **Note:** Unlike `_.remove`, this method returns a new array.
  9739. *
  9740. * @static
  9741. * @memberOf _
  9742. * @since 0.1.0
  9743. * @category Collection
  9744. * @param {Array|Object} collection The collection to iterate over.
  9745. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9746. * @returns {Array} Returns the new filtered array.
  9747. * @see _.reject
  9748. * @example
  9749. *
  9750. * var users = [
  9751. * { 'user': 'barney', 'age': 36, 'active': true },
  9752. * { 'user': 'fred', 'age': 40, 'active': false }
  9753. * ];
  9754. *
  9755. * _.filter(users, function(o) { return !o.active; });
  9756. * // => objects for ['fred']
  9757. *
  9758. * // The `_.matches` iteratee shorthand.
  9759. * _.filter(users, { 'age': 36, 'active': true });
  9760. * // => objects for ['barney']
  9761. *
  9762. * // The `_.matchesProperty` iteratee shorthand.
  9763. * _.filter(users, ['active', false]);
  9764. * // => objects for ['fred']
  9765. *
  9766. * // The `_.property` iteratee shorthand.
  9767. * _.filter(users, 'active');
  9768. * // => objects for ['barney']
  9769. *
  9770. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9771. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9772. * // => objects for ['fred', 'barney']
  9773. */
  9774. function filter(collection, predicate) {
  9775. var func = isArray(collection) ? arrayFilter : baseFilter;
  9776. return func(collection, getIteratee(predicate, 3));
  9777. }
  9778. /**
  9779. * Iterates over elements of `collection`, returning the first element
  9780. * `predicate` returns truthy for. The predicate is invoked with three
  9781. * arguments: (value, index|key, collection).
  9782. *
  9783. * @static
  9784. * @memberOf _
  9785. * @since 0.1.0
  9786. * @category Collection
  9787. * @param {Array|Object} collection The collection to inspect.
  9788. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9789. * @param {number} [fromIndex=0] The index to search from.
  9790. * @returns {*} Returns the matched element, else `undefined`.
  9791. * @example
  9792. *
  9793. * var users = [
  9794. * { 'user': 'barney', 'age': 36, 'active': true },
  9795. * { 'user': 'fred', 'age': 40, 'active': false },
  9796. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9797. * ];
  9798. *
  9799. * _.find(users, function(o) { return o.age < 40; });
  9800. * // => object for 'barney'
  9801. *
  9802. * // The `_.matches` iteratee shorthand.
  9803. * _.find(users, { 'age': 1, 'active': true });
  9804. * // => object for 'pebbles'
  9805. *
  9806. * // The `_.matchesProperty` iteratee shorthand.
  9807. * _.find(users, ['active', false]);
  9808. * // => object for 'fred'
  9809. *
  9810. * // The `_.property` iteratee shorthand.
  9811. * _.find(users, 'active');
  9812. * // => object for 'barney'
  9813. */
  9814. var find = createFind(findIndex);
  9815. /**
  9816. * This method is like `_.find` except that it iterates over elements of
  9817. * `collection` from right to left.
  9818. *
  9819. * @static
  9820. * @memberOf _
  9821. * @since 2.0.0
  9822. * @category Collection
  9823. * @param {Array|Object} collection The collection to inspect.
  9824. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9825. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9826. * @returns {*} Returns the matched element, else `undefined`.
  9827. * @example
  9828. *
  9829. * _.findLast([1, 2, 3, 4], function(n) {
  9830. * return n % 2 == 1;
  9831. * });
  9832. * // => 3
  9833. */
  9834. var findLast = createFind(findLastIndex);
  9835. /**
  9836. * Creates a flattened array of values by running each element in `collection`
  9837. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9838. * with three arguments: (value, index|key, collection).
  9839. *
  9840. * @static
  9841. * @memberOf _
  9842. * @since 4.0.0
  9843. * @category Collection
  9844. * @param {Array|Object} collection The collection to iterate over.
  9845. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9846. * @returns {Array} Returns the new flattened array.
  9847. * @example
  9848. *
  9849. * function duplicate(n) {
  9850. * return [n, n];
  9851. * }
  9852. *
  9853. * _.flatMap([1, 2], duplicate);
  9854. * // => [1, 1, 2, 2]
  9855. */
  9856. function flatMap(collection, iteratee) {
  9857. return baseFlatten(map(collection, iteratee), 1);
  9858. }
  9859. /**
  9860. * This method is like `_.flatMap` except that it recursively flattens the
  9861. * mapped results.
  9862. *
  9863. * @static
  9864. * @memberOf _
  9865. * @since 4.7.0
  9866. * @category Collection
  9867. * @param {Array|Object} collection The collection to iterate over.
  9868. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9869. * @returns {Array} Returns the new flattened array.
  9870. * @example
  9871. *
  9872. * function duplicate(n) {
  9873. * return [[[n, n]]];
  9874. * }
  9875. *
  9876. * _.flatMapDeep([1, 2], duplicate);
  9877. * // => [1, 1, 2, 2]
  9878. */
  9879. function flatMapDeep(collection, iteratee) {
  9880. return baseFlatten(map(collection, iteratee), INFINITY);
  9881. }
  9882. /**
  9883. * This method is like `_.flatMap` except that it recursively flattens the
  9884. * mapped results up to `depth` times.
  9885. *
  9886. * @static
  9887. * @memberOf _
  9888. * @since 4.7.0
  9889. * @category Collection
  9890. * @param {Array|Object} collection The collection to iterate over.
  9891. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9892. * @param {number} [depth=1] The maximum recursion depth.
  9893. * @returns {Array} Returns the new flattened array.
  9894. * @example
  9895. *
  9896. * function duplicate(n) {
  9897. * return [[[n, n]]];
  9898. * }
  9899. *
  9900. * _.flatMapDepth([1, 2], duplicate, 2);
  9901. * // => [[1, 1], [2, 2]]
  9902. */
  9903. function flatMapDepth(collection, iteratee, depth) {
  9904. depth = depth === undefined ? 1 : toInteger(depth);
  9905. return baseFlatten(map(collection, iteratee), depth);
  9906. }
  9907. /**
  9908. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9909. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9910. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9911. *
  9912. * **Note:** As with other "Collections" methods, objects with a "length"
  9913. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9914. * or `_.forOwn` for object iteration.
  9915. *
  9916. * @static
  9917. * @memberOf _
  9918. * @since 0.1.0
  9919. * @alias each
  9920. * @category Collection
  9921. * @param {Array|Object} collection The collection to iterate over.
  9922. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9923. * @returns {Array|Object} Returns `collection`.
  9924. * @see _.forEachRight
  9925. * @example
  9926. *
  9927. * _.forEach([1, 2], function(value) {
  9928. * console.log(value);
  9929. * });
  9930. * // => Logs `1` then `2`.
  9931. *
  9932. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9933. * console.log(key);
  9934. * });
  9935. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9936. */
  9937. function forEach(collection, iteratee) {
  9938. var func = isArray(collection) ? arrayEach : baseEach;
  9939. return func(collection, getIteratee(iteratee, 3));
  9940. }
  9941. /**
  9942. * This method is like `_.forEach` except that it iterates over elements of
  9943. * `collection` from right to left.
  9944. *
  9945. * @static
  9946. * @memberOf _
  9947. * @since 2.0.0
  9948. * @alias eachRight
  9949. * @category Collection
  9950. * @param {Array|Object} collection The collection to iterate over.
  9951. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9952. * @returns {Array|Object} Returns `collection`.
  9953. * @see _.forEach
  9954. * @example
  9955. *
  9956. * _.forEachRight([1, 2], function(value) {
  9957. * console.log(value);
  9958. * });
  9959. * // => Logs `2` then `1`.
  9960. */
  9961. function forEachRight(collection, iteratee) {
  9962. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9963. return func(collection, getIteratee(iteratee, 3));
  9964. }
  9965. /**
  9966. * Creates an object composed of keys generated from the results of running
  9967. * each element of `collection` thru `iteratee`. The order of grouped values
  9968. * is determined by the order they occur in `collection`. The corresponding
  9969. * value of each key is an array of elements responsible for generating the
  9970. * key. The iteratee is invoked with one argument: (value).
  9971. *
  9972. * @static
  9973. * @memberOf _
  9974. * @since 0.1.0
  9975. * @category Collection
  9976. * @param {Array|Object} collection The collection to iterate over.
  9977. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9978. * @returns {Object} Returns the composed aggregate object.
  9979. * @example
  9980. *
  9981. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9982. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9983. *
  9984. * // The `_.property` iteratee shorthand.
  9985. * _.groupBy(['one', 'two', 'three'], 'length');
  9986. * // => { '3': ['one', 'two'], '5': ['three'] }
  9987. */
  9988. var groupBy = createAggregator(function(result, value, key) {
  9989. if (hasOwnProperty.call(result, key)) {
  9990. result[key].push(value);
  9991. } else {
  9992. baseAssignValue(result, key, [value]);
  9993. }
  9994. });
  9995. /**
  9996. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9997. * checked for a substring of `value`, otherwise
  9998. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9999. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10000. * the offset from the end of `collection`.
  10001. *
  10002. * @static
  10003. * @memberOf _
  10004. * @since 0.1.0
  10005. * @category Collection
  10006. * @param {Array|Object|string} collection The collection to inspect.
  10007. * @param {*} value The value to search for.
  10008. * @param {number} [fromIndex=0] The index to search from.
  10009. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10010. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10011. * @example
  10012. *
  10013. * _.includes([1, 2, 3], 1);
  10014. * // => true
  10015. *
  10016. * _.includes([1, 2, 3], 1, 2);
  10017. * // => false
  10018. *
  10019. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10020. * // => true
  10021. *
  10022. * _.includes('abcd', 'bc');
  10023. * // => true
  10024. */
  10025. function includes(collection, value, fromIndex, guard) {
  10026. collection = isArrayLike(collection) ? collection : values(collection);
  10027. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10028. var length = collection.length;
  10029. if (fromIndex < 0) {
  10030. fromIndex = nativeMax(length + fromIndex, 0);
  10031. }
  10032. return isString(collection)
  10033. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10034. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10035. }
  10036. /**
  10037. * Invokes the method at `path` of each element in `collection`, returning
  10038. * an array of the results of each invoked method. Any additional arguments
  10039. * are provided to each invoked method. If `path` is a function, it's invoked
  10040. * for, and `this` bound to, each element in `collection`.
  10041. *
  10042. * @static
  10043. * @memberOf _
  10044. * @since 4.0.0
  10045. * @category Collection
  10046. * @param {Array|Object} collection The collection to iterate over.
  10047. * @param {Array|Function|string} path The path of the method to invoke or
  10048. * the function invoked per iteration.
  10049. * @param {...*} [args] The arguments to invoke each method with.
  10050. * @returns {Array} Returns the array of results.
  10051. * @example
  10052. *
  10053. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10054. * // => [[1, 5, 7], [1, 2, 3]]
  10055. *
  10056. * _.invokeMap([123, 456], String.prototype.split, '');
  10057. * // => [['1', '2', '3'], ['4', '5', '6']]
  10058. */
  10059. var invokeMap = baseRest(function(collection, path, args) {
  10060. var index = -1,
  10061. isFunc = typeof path == 'function',
  10062. result = isArrayLike(collection) ? Array(collection.length) : [];
  10063. baseEach(collection, function(value) {
  10064. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10065. });
  10066. return result;
  10067. });
  10068. /**
  10069. * Creates an object composed of keys generated from the results of running
  10070. * each element of `collection` thru `iteratee`. The corresponding value of
  10071. * each key is the last element responsible for generating the key. The
  10072. * iteratee is invoked with one argument: (value).
  10073. *
  10074. * @static
  10075. * @memberOf _
  10076. * @since 4.0.0
  10077. * @category Collection
  10078. * @param {Array|Object} collection The collection to iterate over.
  10079. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10080. * @returns {Object} Returns the composed aggregate object.
  10081. * @example
  10082. *
  10083. * var array = [
  10084. * { 'dir': 'left', 'code': 97 },
  10085. * { 'dir': 'right', 'code': 100 }
  10086. * ];
  10087. *
  10088. * _.keyBy(array, function(o) {
  10089. * return String.fromCharCode(o.code);
  10090. * });
  10091. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10092. *
  10093. * _.keyBy(array, 'dir');
  10094. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10095. */
  10096. var keyBy = createAggregator(function(result, value, key) {
  10097. baseAssignValue(result, key, value);
  10098. });
  10099. /**
  10100. * Creates an array of values by running each element in `collection` thru
  10101. * `iteratee`. The iteratee is invoked with three arguments:
  10102. * (value, index|key, collection).
  10103. *
  10104. * Many lodash methods are guarded to work as iteratees for methods like
  10105. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10106. *
  10107. * The guarded methods are:
  10108. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10109. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10110. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10111. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10112. *
  10113. * @static
  10114. * @memberOf _
  10115. * @since 0.1.0
  10116. * @category Collection
  10117. * @param {Array|Object} collection The collection to iterate over.
  10118. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10119. * @returns {Array} Returns the new mapped array.
  10120. * @example
  10121. *
  10122. * function square(n) {
  10123. * return n * n;
  10124. * }
  10125. *
  10126. * _.map([4, 8], square);
  10127. * // => [16, 64]
  10128. *
  10129. * _.map({ 'a': 4, 'b': 8 }, square);
  10130. * // => [16, 64] (iteration order is not guaranteed)
  10131. *
  10132. * var users = [
  10133. * { 'user': 'barney' },
  10134. * { 'user': 'fred' }
  10135. * ];
  10136. *
  10137. * // The `_.property` iteratee shorthand.
  10138. * _.map(users, 'user');
  10139. * // => ['barney', 'fred']
  10140. */
  10141. function map(collection, iteratee) {
  10142. var func = isArray(collection) ? arrayMap : baseMap;
  10143. return func(collection, getIteratee(iteratee, 3));
  10144. }
  10145. /**
  10146. * This method is like `_.sortBy` except that it allows specifying the sort
  10147. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10148. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10149. * descending or "asc" for ascending sort order of corresponding values.
  10150. *
  10151. * @static
  10152. * @memberOf _
  10153. * @since 4.0.0
  10154. * @category Collection
  10155. * @param {Array|Object} collection The collection to iterate over.
  10156. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10157. * The iteratees to sort by.
  10158. * @param {string[]} [orders] The sort orders of `iteratees`.
  10159. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10160. * @returns {Array} Returns the new sorted array.
  10161. * @example
  10162. *
  10163. * var users = [
  10164. * { 'user': 'fred', 'age': 48 },
  10165. * { 'user': 'barney', 'age': 34 },
  10166. * { 'user': 'fred', 'age': 40 },
  10167. * { 'user': 'barney', 'age': 36 }
  10168. * ];
  10169. *
  10170. * // Sort by `user` in ascending order and by `age` in descending order.
  10171. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10172. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10173. */
  10174. function orderBy(collection, iteratees, orders, guard) {
  10175. if (collection == null) {
  10176. return [];
  10177. }
  10178. if (!isArray(iteratees)) {
  10179. iteratees = iteratees == null ? [] : [iteratees];
  10180. }
  10181. orders = guard ? undefined : orders;
  10182. if (!isArray(orders)) {
  10183. orders = orders == null ? [] : [orders];
  10184. }
  10185. return baseOrderBy(collection, iteratees, orders);
  10186. }
  10187. /**
  10188. * Creates an array of elements split into two groups, the first of which
  10189. * contains elements `predicate` returns truthy for, the second of which
  10190. * contains elements `predicate` returns falsey for. The predicate is
  10191. * invoked with one argument: (value).
  10192. *
  10193. * @static
  10194. * @memberOf _
  10195. * @since 3.0.0
  10196. * @category Collection
  10197. * @param {Array|Object} collection The collection to iterate over.
  10198. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10199. * @returns {Array} Returns the array of grouped elements.
  10200. * @example
  10201. *
  10202. * var users = [
  10203. * { 'user': 'barney', 'age': 36, 'active': false },
  10204. * { 'user': 'fred', 'age': 40, 'active': true },
  10205. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10206. * ];
  10207. *
  10208. * _.partition(users, function(o) { return o.active; });
  10209. * // => objects for [['fred'], ['barney', 'pebbles']]
  10210. *
  10211. * // The `_.matches` iteratee shorthand.
  10212. * _.partition(users, { 'age': 1, 'active': false });
  10213. * // => objects for [['pebbles'], ['barney', 'fred']]
  10214. *
  10215. * // The `_.matchesProperty` iteratee shorthand.
  10216. * _.partition(users, ['active', false]);
  10217. * // => objects for [['barney', 'pebbles'], ['fred']]
  10218. *
  10219. * // The `_.property` iteratee shorthand.
  10220. * _.partition(users, 'active');
  10221. * // => objects for [['fred'], ['barney', 'pebbles']]
  10222. */
  10223. var partition = createAggregator(function(result, value, key) {
  10224. result[key ? 0 : 1].push(value);
  10225. }, function() { return [[], []]; });
  10226. /**
  10227. * Reduces `collection` to a value which is the accumulated result of running
  10228. * each element in `collection` thru `iteratee`, where each successive
  10229. * invocation is supplied the return value of the previous. If `accumulator`
  10230. * is not given, the first element of `collection` is used as the initial
  10231. * value. The iteratee is invoked with four arguments:
  10232. * (accumulator, value, index|key, collection).
  10233. *
  10234. * Many lodash methods are guarded to work as iteratees for methods like
  10235. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10236. *
  10237. * The guarded methods are:
  10238. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10239. * and `sortBy`
  10240. *
  10241. * @static
  10242. * @memberOf _
  10243. * @since 0.1.0
  10244. * @category Collection
  10245. * @param {Array|Object} collection The collection to iterate over.
  10246. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10247. * @param {*} [accumulator] The initial value.
  10248. * @returns {*} Returns the accumulated value.
  10249. * @see _.reduceRight
  10250. * @example
  10251. *
  10252. * _.reduce([1, 2], function(sum, n) {
  10253. * return sum + n;
  10254. * }, 0);
  10255. * // => 3
  10256. *
  10257. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10258. * (result[value] || (result[value] = [])).push(key);
  10259. * return result;
  10260. * }, {});
  10261. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10262. */
  10263. function reduce(collection, iteratee, accumulator) {
  10264. var func = isArray(collection) ? arrayReduce : baseReduce,
  10265. initAccum = arguments.length < 3;
  10266. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10267. }
  10268. /**
  10269. * This method is like `_.reduce` except that it iterates over elements of
  10270. * `collection` from right to left.
  10271. *
  10272. * @static
  10273. * @memberOf _
  10274. * @since 0.1.0
  10275. * @category Collection
  10276. * @param {Array|Object} collection The collection to iterate over.
  10277. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10278. * @param {*} [accumulator] The initial value.
  10279. * @returns {*} Returns the accumulated value.
  10280. * @see _.reduce
  10281. * @example
  10282. *
  10283. * var array = [[0, 1], [2, 3], [4, 5]];
  10284. *
  10285. * _.reduceRight(array, function(flattened, other) {
  10286. * return flattened.concat(other);
  10287. * }, []);
  10288. * // => [4, 5, 2, 3, 0, 1]
  10289. */
  10290. function reduceRight(collection, iteratee, accumulator) {
  10291. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10292. initAccum = arguments.length < 3;
  10293. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10294. }
  10295. /**
  10296. * The opposite of `_.filter`; this method returns the elements of `collection`
  10297. * that `predicate` does **not** return truthy for.
  10298. *
  10299. * @static
  10300. * @memberOf _
  10301. * @since 0.1.0
  10302. * @category Collection
  10303. * @param {Array|Object} collection The collection to iterate over.
  10304. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10305. * @returns {Array} Returns the new filtered array.
  10306. * @see _.filter
  10307. * @example
  10308. *
  10309. * var users = [
  10310. * { 'user': 'barney', 'age': 36, 'active': false },
  10311. * { 'user': 'fred', 'age': 40, 'active': true }
  10312. * ];
  10313. *
  10314. * _.reject(users, function(o) { return !o.active; });
  10315. * // => objects for ['fred']
  10316. *
  10317. * // The `_.matches` iteratee shorthand.
  10318. * _.reject(users, { 'age': 40, 'active': true });
  10319. * // => objects for ['barney']
  10320. *
  10321. * // The `_.matchesProperty` iteratee shorthand.
  10322. * _.reject(users, ['active', false]);
  10323. * // => objects for ['fred']
  10324. *
  10325. * // The `_.property` iteratee shorthand.
  10326. * _.reject(users, 'active');
  10327. * // => objects for ['barney']
  10328. */
  10329. function reject(collection, predicate) {
  10330. var func = isArray(collection) ? arrayFilter : baseFilter;
  10331. return func(collection, negate(getIteratee(predicate, 3)));
  10332. }
  10333. /**
  10334. * Gets a random element from `collection`.
  10335. *
  10336. * @static
  10337. * @memberOf _
  10338. * @since 2.0.0
  10339. * @category Collection
  10340. * @param {Array|Object} collection The collection to sample.
  10341. * @returns {*} Returns the random element.
  10342. * @example
  10343. *
  10344. * _.sample([1, 2, 3, 4]);
  10345. * // => 2
  10346. */
  10347. function sample(collection) {
  10348. var func = isArray(collection) ? arraySample : baseSample;
  10349. return func(collection);
  10350. }
  10351. /**
  10352. * Gets `n` random elements at unique keys from `collection` up to the
  10353. * size of `collection`.
  10354. *
  10355. * @static
  10356. * @memberOf _
  10357. * @since 4.0.0
  10358. * @category Collection
  10359. * @param {Array|Object} collection The collection to sample.
  10360. * @param {number} [n=1] The number of elements to sample.
  10361. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10362. * @returns {Array} Returns the random elements.
  10363. * @example
  10364. *
  10365. * _.sampleSize([1, 2, 3], 2);
  10366. * // => [3, 1]
  10367. *
  10368. * _.sampleSize([1, 2, 3], 4);
  10369. * // => [2, 3, 1]
  10370. */
  10371. function sampleSize(collection, n, guard) {
  10372. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10373. n = 1;
  10374. } else {
  10375. n = toInteger(n);
  10376. }
  10377. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10378. return func(collection, n);
  10379. }
  10380. /**
  10381. * Creates an array of shuffled values, using a version of the
  10382. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10383. *
  10384. * @static
  10385. * @memberOf _
  10386. * @since 0.1.0
  10387. * @category Collection
  10388. * @param {Array|Object} collection The collection to shuffle.
  10389. * @returns {Array} Returns the new shuffled array.
  10390. * @example
  10391. *
  10392. * _.shuffle([1, 2, 3, 4]);
  10393. * // => [4, 1, 3, 2]
  10394. */
  10395. function shuffle(collection) {
  10396. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10397. return func(collection);
  10398. }
  10399. /**
  10400. * Gets the size of `collection` by returning its length for array-like
  10401. * values or the number of own enumerable string keyed properties for objects.
  10402. *
  10403. * @static
  10404. * @memberOf _
  10405. * @since 0.1.0
  10406. * @category Collection
  10407. * @param {Array|Object|string} collection The collection to inspect.
  10408. * @returns {number} Returns the collection size.
  10409. * @example
  10410. *
  10411. * _.size([1, 2, 3]);
  10412. * // => 3
  10413. *
  10414. * _.size({ 'a': 1, 'b': 2 });
  10415. * // => 2
  10416. *
  10417. * _.size('pebbles');
  10418. * // => 7
  10419. */
  10420. function size(collection) {
  10421. if (collection == null) {
  10422. return 0;
  10423. }
  10424. if (isArrayLike(collection)) {
  10425. return isString(collection) ? stringSize(collection) : collection.length;
  10426. }
  10427. var tag = getTag(collection);
  10428. if (tag == mapTag || tag == setTag) {
  10429. return collection.size;
  10430. }
  10431. return baseKeys(collection).length;
  10432. }
  10433. /**
  10434. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10435. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10436. * invoked with three arguments: (value, index|key, collection).
  10437. *
  10438. * @static
  10439. * @memberOf _
  10440. * @since 0.1.0
  10441. * @category Collection
  10442. * @param {Array|Object} collection The collection to iterate over.
  10443. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10444. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10445. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10446. * else `false`.
  10447. * @example
  10448. *
  10449. * _.some([null, 0, 'yes', false], Boolean);
  10450. * // => true
  10451. *
  10452. * var users = [
  10453. * { 'user': 'barney', 'active': true },
  10454. * { 'user': 'fred', 'active': false }
  10455. * ];
  10456. *
  10457. * // The `_.matches` iteratee shorthand.
  10458. * _.some(users, { 'user': 'barney', 'active': false });
  10459. * // => false
  10460. *
  10461. * // The `_.matchesProperty` iteratee shorthand.
  10462. * _.some(users, ['active', false]);
  10463. * // => true
  10464. *
  10465. * // The `_.property` iteratee shorthand.
  10466. * _.some(users, 'active');
  10467. * // => true
  10468. */
  10469. function some(collection, predicate, guard) {
  10470. var func = isArray(collection) ? arraySome : baseSome;
  10471. if (guard && isIterateeCall(collection, predicate, guard)) {
  10472. predicate = undefined;
  10473. }
  10474. return func(collection, getIteratee(predicate, 3));
  10475. }
  10476. /**
  10477. * Creates an array of elements, sorted in ascending order by the results of
  10478. * running each element in a collection thru each iteratee. This method
  10479. * performs a stable sort, that is, it preserves the original sort order of
  10480. * equal elements. The iteratees are invoked with one argument: (value).
  10481. *
  10482. * @static
  10483. * @memberOf _
  10484. * @since 0.1.0
  10485. * @category Collection
  10486. * @param {Array|Object} collection The collection to iterate over.
  10487. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10488. * The iteratees to sort by.
  10489. * @returns {Array} Returns the new sorted array.
  10490. * @example
  10491. *
  10492. * var users = [
  10493. * { 'user': 'fred', 'age': 48 },
  10494. * { 'user': 'barney', 'age': 36 },
  10495. * { 'user': 'fred', 'age': 30 },
  10496. * { 'user': 'barney', 'age': 34 }
  10497. * ];
  10498. *
  10499. * _.sortBy(users, [function(o) { return o.user; }]);
  10500. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10501. *
  10502. * _.sortBy(users, ['user', 'age']);
  10503. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10504. */
  10505. var sortBy = baseRest(function(collection, iteratees) {
  10506. if (collection == null) {
  10507. return [];
  10508. }
  10509. var length = iteratees.length;
  10510. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10511. iteratees = [];
  10512. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10513. iteratees = [iteratees[0]];
  10514. }
  10515. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10516. });
  10517. /*------------------------------------------------------------------------*/
  10518. /**
  10519. * Gets the timestamp of the number of milliseconds that have elapsed since
  10520. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10521. *
  10522. * @static
  10523. * @memberOf _
  10524. * @since 2.4.0
  10525. * @category Date
  10526. * @returns {number} Returns the timestamp.
  10527. * @example
  10528. *
  10529. * _.defer(function(stamp) {
  10530. * console.log(_.now() - stamp);
  10531. * }, _.now());
  10532. * // => Logs the number of milliseconds it took for the deferred invocation.
  10533. */
  10534. var now = ctxNow || function() {
  10535. return root.Date.now();
  10536. };
  10537. /*------------------------------------------------------------------------*/
  10538. /**
  10539. * The opposite of `_.before`; this method creates a function that invokes
  10540. * `func` once it's called `n` or more times.
  10541. *
  10542. * @static
  10543. * @memberOf _
  10544. * @since 0.1.0
  10545. * @category Function
  10546. * @param {number} n The number of calls before `func` is invoked.
  10547. * @param {Function} func The function to restrict.
  10548. * @returns {Function} Returns the new restricted function.
  10549. * @example
  10550. *
  10551. * var saves = ['profile', 'settings'];
  10552. *
  10553. * var done = _.after(saves.length, function() {
  10554. * console.log('done saving!');
  10555. * });
  10556. *
  10557. * _.forEach(saves, function(type) {
  10558. * asyncSave({ 'type': type, 'complete': done });
  10559. * });
  10560. * // => Logs 'done saving!' after the two async saves have completed.
  10561. */
  10562. function after(n, func) {
  10563. if (typeof func != 'function') {
  10564. throw new TypeError(FUNC_ERROR_TEXT);
  10565. }
  10566. n = toInteger(n);
  10567. return function() {
  10568. if (--n < 1) {
  10569. return func.apply(this, arguments);
  10570. }
  10571. };
  10572. }
  10573. /**
  10574. * Creates a function that invokes `func`, with up to `n` arguments,
  10575. * ignoring any additional arguments.
  10576. *
  10577. * @static
  10578. * @memberOf _
  10579. * @since 3.0.0
  10580. * @category Function
  10581. * @param {Function} func The function to cap arguments for.
  10582. * @param {number} [n=func.length] The arity cap.
  10583. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10584. * @returns {Function} Returns the new capped function.
  10585. * @example
  10586. *
  10587. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10588. * // => [6, 8, 10]
  10589. */
  10590. function ary(func, n, guard) {
  10591. n = guard ? undefined : n;
  10592. n = (func && n == null) ? func.length : n;
  10593. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10594. }
  10595. /**
  10596. * Creates a function that invokes `func`, with the `this` binding and arguments
  10597. * of the created function, while it's called less than `n` times. Subsequent
  10598. * calls to the created function return the result of the last `func` invocation.
  10599. *
  10600. * @static
  10601. * @memberOf _
  10602. * @since 3.0.0
  10603. * @category Function
  10604. * @param {number} n The number of calls at which `func` is no longer invoked.
  10605. * @param {Function} func The function to restrict.
  10606. * @returns {Function} Returns the new restricted function.
  10607. * @example
  10608. *
  10609. * jQuery(element).on('click', _.before(5, addContactToList));
  10610. * // => Allows adding up to 4 contacts to the list.
  10611. */
  10612. function before(n, func) {
  10613. var result;
  10614. if (typeof func != 'function') {
  10615. throw new TypeError(FUNC_ERROR_TEXT);
  10616. }
  10617. n = toInteger(n);
  10618. return function() {
  10619. if (--n > 0) {
  10620. result = func.apply(this, arguments);
  10621. }
  10622. if (n <= 1) {
  10623. func = undefined;
  10624. }
  10625. return result;
  10626. };
  10627. }
  10628. /**
  10629. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10630. * and `partials` prepended to the arguments it receives.
  10631. *
  10632. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10633. * may be used as a placeholder for partially applied arguments.
  10634. *
  10635. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10636. * property of bound functions.
  10637. *
  10638. * @static
  10639. * @memberOf _
  10640. * @since 0.1.0
  10641. * @category Function
  10642. * @param {Function} func The function to bind.
  10643. * @param {*} thisArg The `this` binding of `func`.
  10644. * @param {...*} [partials] The arguments to be partially applied.
  10645. * @returns {Function} Returns the new bound function.
  10646. * @example
  10647. *
  10648. * function greet(greeting, punctuation) {
  10649. * return greeting + ' ' + this.user + punctuation;
  10650. * }
  10651. *
  10652. * var object = { 'user': 'fred' };
  10653. *
  10654. * var bound = _.bind(greet, object, 'hi');
  10655. * bound('!');
  10656. * // => 'hi fred!'
  10657. *
  10658. * // Bound with placeholders.
  10659. * var bound = _.bind(greet, object, _, '!');
  10660. * bound('hi');
  10661. * // => 'hi fred!'
  10662. */
  10663. var bind = baseRest(function(func, thisArg, partials) {
  10664. var bitmask = WRAP_BIND_FLAG;
  10665. if (partials.length) {
  10666. var holders = replaceHolders(partials, getHolder(bind));
  10667. bitmask |= WRAP_PARTIAL_FLAG;
  10668. }
  10669. return createWrap(func, bitmask, thisArg, partials, holders);
  10670. });
  10671. /**
  10672. * Creates a function that invokes the method at `object[key]` with `partials`
  10673. * prepended to the arguments it receives.
  10674. *
  10675. * This method differs from `_.bind` by allowing bound functions to reference
  10676. * methods that may be redefined or don't yet exist. See
  10677. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10678. * for more details.
  10679. *
  10680. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10681. * builds, may be used as a placeholder for partially applied arguments.
  10682. *
  10683. * @static
  10684. * @memberOf _
  10685. * @since 0.10.0
  10686. * @category Function
  10687. * @param {Object} object The object to invoke the method on.
  10688. * @param {string} key The key of the method.
  10689. * @param {...*} [partials] The arguments to be partially applied.
  10690. * @returns {Function} Returns the new bound function.
  10691. * @example
  10692. *
  10693. * var object = {
  10694. * 'user': 'fred',
  10695. * 'greet': function(greeting, punctuation) {
  10696. * return greeting + ' ' + this.user + punctuation;
  10697. * }
  10698. * };
  10699. *
  10700. * var bound = _.bindKey(object, 'greet', 'hi');
  10701. * bound('!');
  10702. * // => 'hi fred!'
  10703. *
  10704. * object.greet = function(greeting, punctuation) {
  10705. * return greeting + 'ya ' + this.user + punctuation;
  10706. * };
  10707. *
  10708. * bound('!');
  10709. * // => 'hiya fred!'
  10710. *
  10711. * // Bound with placeholders.
  10712. * var bound = _.bindKey(object, 'greet', _, '!');
  10713. * bound('hi');
  10714. * // => 'hiya fred!'
  10715. */
  10716. var bindKey = baseRest(function(object, key, partials) {
  10717. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10718. if (partials.length) {
  10719. var holders = replaceHolders(partials, getHolder(bindKey));
  10720. bitmask |= WRAP_PARTIAL_FLAG;
  10721. }
  10722. return createWrap(key, bitmask, object, partials, holders);
  10723. });
  10724. /**
  10725. * Creates a function that accepts arguments of `func` and either invokes
  10726. * `func` returning its result, if at least `arity` number of arguments have
  10727. * been provided, or returns a function that accepts the remaining `func`
  10728. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10729. * is not sufficient.
  10730. *
  10731. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10732. * may be used as a placeholder for provided arguments.
  10733. *
  10734. * **Note:** This method doesn't set the "length" property of curried functions.
  10735. *
  10736. * @static
  10737. * @memberOf _
  10738. * @since 2.0.0
  10739. * @category Function
  10740. * @param {Function} func The function to curry.
  10741. * @param {number} [arity=func.length] The arity of `func`.
  10742. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10743. * @returns {Function} Returns the new curried function.
  10744. * @example
  10745. *
  10746. * var abc = function(a, b, c) {
  10747. * return [a, b, c];
  10748. * };
  10749. *
  10750. * var curried = _.curry(abc);
  10751. *
  10752. * curried(1)(2)(3);
  10753. * // => [1, 2, 3]
  10754. *
  10755. * curried(1, 2)(3);
  10756. * // => [1, 2, 3]
  10757. *
  10758. * curried(1, 2, 3);
  10759. * // => [1, 2, 3]
  10760. *
  10761. * // Curried with placeholders.
  10762. * curried(1)(_, 3)(2);
  10763. * // => [1, 2, 3]
  10764. */
  10765. function curry(func, arity, guard) {
  10766. arity = guard ? undefined : arity;
  10767. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10768. result.placeholder = curry.placeholder;
  10769. return result;
  10770. }
  10771. /**
  10772. * This method is like `_.curry` except that arguments are applied to `func`
  10773. * in the manner of `_.partialRight` instead of `_.partial`.
  10774. *
  10775. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10776. * builds, may be used as a placeholder for provided arguments.
  10777. *
  10778. * **Note:** This method doesn't set the "length" property of curried functions.
  10779. *
  10780. * @static
  10781. * @memberOf _
  10782. * @since 3.0.0
  10783. * @category Function
  10784. * @param {Function} func The function to curry.
  10785. * @param {number} [arity=func.length] The arity of `func`.
  10786. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10787. * @returns {Function} Returns the new curried function.
  10788. * @example
  10789. *
  10790. * var abc = function(a, b, c) {
  10791. * return [a, b, c];
  10792. * };
  10793. *
  10794. * var curried = _.curryRight(abc);
  10795. *
  10796. * curried(3)(2)(1);
  10797. * // => [1, 2, 3]
  10798. *
  10799. * curried(2, 3)(1);
  10800. * // => [1, 2, 3]
  10801. *
  10802. * curried(1, 2, 3);
  10803. * // => [1, 2, 3]
  10804. *
  10805. * // Curried with placeholders.
  10806. * curried(3)(1, _)(2);
  10807. * // => [1, 2, 3]
  10808. */
  10809. function curryRight(func, arity, guard) {
  10810. arity = guard ? undefined : arity;
  10811. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10812. result.placeholder = curryRight.placeholder;
  10813. return result;
  10814. }
  10815. /**
  10816. * Creates a debounced function that delays invoking `func` until after `wait`
  10817. * milliseconds have elapsed since the last time the debounced function was
  10818. * invoked. The debounced function comes with a `cancel` method to cancel
  10819. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10820. * Provide `options` to indicate whether `func` should be invoked on the
  10821. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10822. * with the last arguments provided to the debounced function. Subsequent
  10823. * calls to the debounced function return the result of the last `func`
  10824. * invocation.
  10825. *
  10826. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10827. * invoked on the trailing edge of the timeout only if the debounced function
  10828. * is invoked more than once during the `wait` timeout.
  10829. *
  10830. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10831. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10832. *
  10833. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10834. * for details over the differences between `_.debounce` and `_.throttle`.
  10835. *
  10836. * @static
  10837. * @memberOf _
  10838. * @since 0.1.0
  10839. * @category Function
  10840. * @param {Function} func The function to debounce.
  10841. * @param {number} [wait=0] The number of milliseconds to delay.
  10842. * @param {Object} [options={}] The options object.
  10843. * @param {boolean} [options.leading=false]
  10844. * Specify invoking on the leading edge of the timeout.
  10845. * @param {number} [options.maxWait]
  10846. * The maximum time `func` is allowed to be delayed before it's invoked.
  10847. * @param {boolean} [options.trailing=true]
  10848. * Specify invoking on the trailing edge of the timeout.
  10849. * @returns {Function} Returns the new debounced function.
  10850. * @example
  10851. *
  10852. * // Avoid costly calculations while the window size is in flux.
  10853. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10854. *
  10855. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10856. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10857. * 'leading': true,
  10858. * 'trailing': false
  10859. * }));
  10860. *
  10861. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10862. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10863. * var source = new EventSource('/stream');
  10864. * jQuery(source).on('message', debounced);
  10865. *
  10866. * // Cancel the trailing debounced invocation.
  10867. * jQuery(window).on('popstate', debounced.cancel);
  10868. */
  10869. function debounce(func, wait, options) {
  10870. var lastArgs,
  10871. lastThis,
  10872. maxWait,
  10873. result,
  10874. timerId,
  10875. lastCallTime,
  10876. lastInvokeTime = 0,
  10877. leading = false,
  10878. maxing = false,
  10879. trailing = true;
  10880. if (typeof func != 'function') {
  10881. throw new TypeError(FUNC_ERROR_TEXT);
  10882. }
  10883. wait = toNumber(wait) || 0;
  10884. if (isObject(options)) {
  10885. leading = !!options.leading;
  10886. maxing = 'maxWait' in options;
  10887. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10888. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10889. }
  10890. function invokeFunc(time) {
  10891. var args = lastArgs,
  10892. thisArg = lastThis;
  10893. lastArgs = lastThis = undefined;
  10894. lastInvokeTime = time;
  10895. result = func.apply(thisArg, args);
  10896. return result;
  10897. }
  10898. function leadingEdge(time) {
  10899. // Reset any `maxWait` timer.
  10900. lastInvokeTime = time;
  10901. // Start the timer for the trailing edge.
  10902. timerId = setTimeout(timerExpired, wait);
  10903. // Invoke the leading edge.
  10904. return leading ? invokeFunc(time) : result;
  10905. }
  10906. function remainingWait(time) {
  10907. var timeSinceLastCall = time - lastCallTime,
  10908. timeSinceLastInvoke = time - lastInvokeTime,
  10909. timeWaiting = wait - timeSinceLastCall;
  10910. return maxing
  10911. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10912. : timeWaiting;
  10913. }
  10914. function shouldInvoke(time) {
  10915. var timeSinceLastCall = time - lastCallTime,
  10916. timeSinceLastInvoke = time - lastInvokeTime;
  10917. // Either this is the first call, activity has stopped and we're at the
  10918. // trailing edge, the system time has gone backwards and we're treating
  10919. // it as the trailing edge, or we've hit the `maxWait` limit.
  10920. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10921. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10922. }
  10923. function timerExpired() {
  10924. var time = now();
  10925. if (shouldInvoke(time)) {
  10926. return trailingEdge(time);
  10927. }
  10928. // Restart the timer.
  10929. timerId = setTimeout(timerExpired, remainingWait(time));
  10930. }
  10931. function trailingEdge(time) {
  10932. timerId = undefined;
  10933. // Only invoke if we have `lastArgs` which means `func` has been
  10934. // debounced at least once.
  10935. if (trailing && lastArgs) {
  10936. return invokeFunc(time);
  10937. }
  10938. lastArgs = lastThis = undefined;
  10939. return result;
  10940. }
  10941. function cancel() {
  10942. if (timerId !== undefined) {
  10943. clearTimeout(timerId);
  10944. }
  10945. lastInvokeTime = 0;
  10946. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10947. }
  10948. function flush() {
  10949. return timerId === undefined ? result : trailingEdge(now());
  10950. }
  10951. function debounced() {
  10952. var time = now(),
  10953. isInvoking = shouldInvoke(time);
  10954. lastArgs = arguments;
  10955. lastThis = this;
  10956. lastCallTime = time;
  10957. if (isInvoking) {
  10958. if (timerId === undefined) {
  10959. return leadingEdge(lastCallTime);
  10960. }
  10961. if (maxing) {
  10962. // Handle invocations in a tight loop.
  10963. clearTimeout(timerId);
  10964. timerId = setTimeout(timerExpired, wait);
  10965. return invokeFunc(lastCallTime);
  10966. }
  10967. }
  10968. if (timerId === undefined) {
  10969. timerId = setTimeout(timerExpired, wait);
  10970. }
  10971. return result;
  10972. }
  10973. debounced.cancel = cancel;
  10974. debounced.flush = flush;
  10975. return debounced;
  10976. }
  10977. /**
  10978. * Defers invoking the `func` until the current call stack has cleared. Any
  10979. * additional arguments are provided to `func` when it's invoked.
  10980. *
  10981. * @static
  10982. * @memberOf _
  10983. * @since 0.1.0
  10984. * @category Function
  10985. * @param {Function} func The function to defer.
  10986. * @param {...*} [args] The arguments to invoke `func` with.
  10987. * @returns {number} Returns the timer id.
  10988. * @example
  10989. *
  10990. * _.defer(function(text) {
  10991. * console.log(text);
  10992. * }, 'deferred');
  10993. * // => Logs 'deferred' after one millisecond.
  10994. */
  10995. var defer = baseRest(function(func, args) {
  10996. return baseDelay(func, 1, args);
  10997. });
  10998. /**
  10999. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11000. * provided to `func` when it's invoked.
  11001. *
  11002. * @static
  11003. * @memberOf _
  11004. * @since 0.1.0
  11005. * @category Function
  11006. * @param {Function} func The function to delay.
  11007. * @param {number} wait The number of milliseconds to delay invocation.
  11008. * @param {...*} [args] The arguments to invoke `func` with.
  11009. * @returns {number} Returns the timer id.
  11010. * @example
  11011. *
  11012. * _.delay(function(text) {
  11013. * console.log(text);
  11014. * }, 1000, 'later');
  11015. * // => Logs 'later' after one second.
  11016. */
  11017. var delay = baseRest(function(func, wait, args) {
  11018. return baseDelay(func, toNumber(wait) || 0, args);
  11019. });
  11020. /**
  11021. * Creates a function that invokes `func` with arguments reversed.
  11022. *
  11023. * @static
  11024. * @memberOf _
  11025. * @since 4.0.0
  11026. * @category Function
  11027. * @param {Function} func The function to flip arguments for.
  11028. * @returns {Function} Returns the new flipped function.
  11029. * @example
  11030. *
  11031. * var flipped = _.flip(function() {
  11032. * return _.toArray(arguments);
  11033. * });
  11034. *
  11035. * flipped('a', 'b', 'c', 'd');
  11036. * // => ['d', 'c', 'b', 'a']
  11037. */
  11038. function flip(func) {
  11039. return createWrap(func, WRAP_FLIP_FLAG);
  11040. }
  11041. /**
  11042. * Creates a function that memoizes the result of `func`. If `resolver` is
  11043. * provided, it determines the cache key for storing the result based on the
  11044. * arguments provided to the memoized function. By default, the first argument
  11045. * provided to the memoized function is used as the map cache key. The `func`
  11046. * is invoked with the `this` binding of the memoized function.
  11047. *
  11048. * **Note:** The cache is exposed as the `cache` property on the memoized
  11049. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11050. * constructor with one whose instances implement the
  11051. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11052. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11053. *
  11054. * @static
  11055. * @memberOf _
  11056. * @since 0.1.0
  11057. * @category Function
  11058. * @param {Function} func The function to have its output memoized.
  11059. * @param {Function} [resolver] The function to resolve the cache key.
  11060. * @returns {Function} Returns the new memoized function.
  11061. * @example
  11062. *
  11063. * var object = { 'a': 1, 'b': 2 };
  11064. * var other = { 'c': 3, 'd': 4 };
  11065. *
  11066. * var values = _.memoize(_.values);
  11067. * values(object);
  11068. * // => [1, 2]
  11069. *
  11070. * values(other);
  11071. * // => [3, 4]
  11072. *
  11073. * object.a = 2;
  11074. * values(object);
  11075. * // => [1, 2]
  11076. *
  11077. * // Modify the result cache.
  11078. * values.cache.set(object, ['a', 'b']);
  11079. * values(object);
  11080. * // => ['a', 'b']
  11081. *
  11082. * // Replace `_.memoize.Cache`.
  11083. * _.memoize.Cache = WeakMap;
  11084. */
  11085. function memoize(func, resolver) {
  11086. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11087. throw new TypeError(FUNC_ERROR_TEXT);
  11088. }
  11089. var memoized = function() {
  11090. var args = arguments,
  11091. key = resolver ? resolver.apply(this, args) : args[0],
  11092. cache = memoized.cache;
  11093. if (cache.has(key)) {
  11094. return cache.get(key);
  11095. }
  11096. var result = func.apply(this, args);
  11097. memoized.cache = cache.set(key, result) || cache;
  11098. return result;
  11099. };
  11100. memoized.cache = new (memoize.Cache || MapCache);
  11101. return memoized;
  11102. }
  11103. // Expose `MapCache`.
  11104. memoize.Cache = MapCache;
  11105. /**
  11106. * Creates a function that negates the result of the predicate `func`. The
  11107. * `func` predicate is invoked with the `this` binding and arguments of the
  11108. * created function.
  11109. *
  11110. * @static
  11111. * @memberOf _
  11112. * @since 3.0.0
  11113. * @category Function
  11114. * @param {Function} predicate The predicate to negate.
  11115. * @returns {Function} Returns the new negated function.
  11116. * @example
  11117. *
  11118. * function isEven(n) {
  11119. * return n % 2 == 0;
  11120. * }
  11121. *
  11122. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11123. * // => [1, 3, 5]
  11124. */
  11125. function negate(predicate) {
  11126. if (typeof predicate != 'function') {
  11127. throw new TypeError(FUNC_ERROR_TEXT);
  11128. }
  11129. return function() {
  11130. var args = arguments;
  11131. switch (args.length) {
  11132. case 0: return !predicate.call(this);
  11133. case 1: return !predicate.call(this, args[0]);
  11134. case 2: return !predicate.call(this, args[0], args[1]);
  11135. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11136. }
  11137. return !predicate.apply(this, args);
  11138. };
  11139. }
  11140. /**
  11141. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11142. * to the function return the value of the first invocation. The `func` is
  11143. * invoked with the `this` binding and arguments of the created function.
  11144. *
  11145. * @static
  11146. * @memberOf _
  11147. * @since 0.1.0
  11148. * @category Function
  11149. * @param {Function} func The function to restrict.
  11150. * @returns {Function} Returns the new restricted function.
  11151. * @example
  11152. *
  11153. * var initialize = _.once(createApplication);
  11154. * initialize();
  11155. * initialize();
  11156. * // => `createApplication` is invoked once
  11157. */
  11158. function once(func) {
  11159. return before(2, func);
  11160. }
  11161. /**
  11162. * Creates a function that invokes `func` with its arguments transformed.
  11163. *
  11164. * @static
  11165. * @since 4.0.0
  11166. * @memberOf _
  11167. * @category Function
  11168. * @param {Function} func The function to wrap.
  11169. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11170. * The argument transforms.
  11171. * @returns {Function} Returns the new function.
  11172. * @example
  11173. *
  11174. * function doubled(n) {
  11175. * return n * 2;
  11176. * }
  11177. *
  11178. * function square(n) {
  11179. * return n * n;
  11180. * }
  11181. *
  11182. * var func = _.overArgs(function(x, y) {
  11183. * return [x, y];
  11184. * }, [square, doubled]);
  11185. *
  11186. * func(9, 3);
  11187. * // => [81, 6]
  11188. *
  11189. * func(10, 5);
  11190. * // => [100, 10]
  11191. */
  11192. var overArgs = castRest(function(func, transforms) {
  11193. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11194. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11195. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11196. var funcsLength = transforms.length;
  11197. return baseRest(function(args) {
  11198. var index = -1,
  11199. length = nativeMin(args.length, funcsLength);
  11200. while (++index < length) {
  11201. args[index] = transforms[index].call(this, args[index]);
  11202. }
  11203. return apply(func, this, args);
  11204. });
  11205. });
  11206. /**
  11207. * Creates a function that invokes `func` with `partials` prepended to the
  11208. * arguments it receives. This method is like `_.bind` except it does **not**
  11209. * alter the `this` binding.
  11210. *
  11211. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11212. * builds, may be used as a placeholder for partially applied arguments.
  11213. *
  11214. * **Note:** This method doesn't set the "length" property of partially
  11215. * applied functions.
  11216. *
  11217. * @static
  11218. * @memberOf _
  11219. * @since 0.2.0
  11220. * @category Function
  11221. * @param {Function} func The function to partially apply arguments to.
  11222. * @param {...*} [partials] The arguments to be partially applied.
  11223. * @returns {Function} Returns the new partially applied function.
  11224. * @example
  11225. *
  11226. * function greet(greeting, name) {
  11227. * return greeting + ' ' + name;
  11228. * }
  11229. *
  11230. * var sayHelloTo = _.partial(greet, 'hello');
  11231. * sayHelloTo('fred');
  11232. * // => 'hello fred'
  11233. *
  11234. * // Partially applied with placeholders.
  11235. * var greetFred = _.partial(greet, _, 'fred');
  11236. * greetFred('hi');
  11237. * // => 'hi fred'
  11238. */
  11239. var partial = baseRest(function(func, partials) {
  11240. var holders = replaceHolders(partials, getHolder(partial));
  11241. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11242. });
  11243. /**
  11244. * This method is like `_.partial` except that partially applied arguments
  11245. * are appended to the arguments it receives.
  11246. *
  11247. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11248. * builds, may be used as a placeholder for partially applied arguments.
  11249. *
  11250. * **Note:** This method doesn't set the "length" property of partially
  11251. * applied functions.
  11252. *
  11253. * @static
  11254. * @memberOf _
  11255. * @since 1.0.0
  11256. * @category Function
  11257. * @param {Function} func The function to partially apply arguments to.
  11258. * @param {...*} [partials] The arguments to be partially applied.
  11259. * @returns {Function} Returns the new partially applied function.
  11260. * @example
  11261. *
  11262. * function greet(greeting, name) {
  11263. * return greeting + ' ' + name;
  11264. * }
  11265. *
  11266. * var greetFred = _.partialRight(greet, 'fred');
  11267. * greetFred('hi');
  11268. * // => 'hi fred'
  11269. *
  11270. * // Partially applied with placeholders.
  11271. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11272. * sayHelloTo('fred');
  11273. * // => 'hello fred'
  11274. */
  11275. var partialRight = baseRest(function(func, partials) {
  11276. var holders = replaceHolders(partials, getHolder(partialRight));
  11277. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11278. });
  11279. /**
  11280. * Creates a function that invokes `func` with arguments arranged according
  11281. * to the specified `indexes` where the argument value at the first index is
  11282. * provided as the first argument, the argument value at the second index is
  11283. * provided as the second argument, and so on.
  11284. *
  11285. * @static
  11286. * @memberOf _
  11287. * @since 3.0.0
  11288. * @category Function
  11289. * @param {Function} func The function to rearrange arguments for.
  11290. * @param {...(number|number[])} indexes The arranged argument indexes.
  11291. * @returns {Function} Returns the new function.
  11292. * @example
  11293. *
  11294. * var rearged = _.rearg(function(a, b, c) {
  11295. * return [a, b, c];
  11296. * }, [2, 0, 1]);
  11297. *
  11298. * rearged('b', 'c', 'a')
  11299. * // => ['a', 'b', 'c']
  11300. */
  11301. var rearg = flatRest(function(func, indexes) {
  11302. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11303. });
  11304. /**
  11305. * Creates a function that invokes `func` with the `this` binding of the
  11306. * created function and arguments from `start` and beyond provided as
  11307. * an array.
  11308. *
  11309. * **Note:** This method is based on the
  11310. * [rest parameter](https://mdn.io/rest_parameters).
  11311. *
  11312. * @static
  11313. * @memberOf _
  11314. * @since 4.0.0
  11315. * @category Function
  11316. * @param {Function} func The function to apply a rest parameter to.
  11317. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11318. * @returns {Function} Returns the new function.
  11319. * @example
  11320. *
  11321. * var say = _.rest(function(what, names) {
  11322. * return what + ' ' + _.initial(names).join(', ') +
  11323. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11324. * });
  11325. *
  11326. * say('hello', 'fred', 'barney', 'pebbles');
  11327. * // => 'hello fred, barney, & pebbles'
  11328. */
  11329. function rest(func, start) {
  11330. if (typeof func != 'function') {
  11331. throw new TypeError(FUNC_ERROR_TEXT);
  11332. }
  11333. start = start === undefined ? start : toInteger(start);
  11334. return baseRest(func, start);
  11335. }
  11336. /**
  11337. * Creates a function that invokes `func` with the `this` binding of the
  11338. * create function and an array of arguments much like
  11339. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11340. *
  11341. * **Note:** This method is based on the
  11342. * [spread operator](https://mdn.io/spread_operator).
  11343. *
  11344. * @static
  11345. * @memberOf _
  11346. * @since 3.2.0
  11347. * @category Function
  11348. * @param {Function} func The function to spread arguments over.
  11349. * @param {number} [start=0] The start position of the spread.
  11350. * @returns {Function} Returns the new function.
  11351. * @example
  11352. *
  11353. * var say = _.spread(function(who, what) {
  11354. * return who + ' says ' + what;
  11355. * });
  11356. *
  11357. * say(['fred', 'hello']);
  11358. * // => 'fred says hello'
  11359. *
  11360. * var numbers = Promise.all([
  11361. * Promise.resolve(40),
  11362. * Promise.resolve(36)
  11363. * ]);
  11364. *
  11365. * numbers.then(_.spread(function(x, y) {
  11366. * return x + y;
  11367. * }));
  11368. * // => a Promise of 76
  11369. */
  11370. function spread(func, start) {
  11371. if (typeof func != 'function') {
  11372. throw new TypeError(FUNC_ERROR_TEXT);
  11373. }
  11374. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11375. return baseRest(function(args) {
  11376. var array = args[start],
  11377. otherArgs = castSlice(args, 0, start);
  11378. if (array) {
  11379. arrayPush(otherArgs, array);
  11380. }
  11381. return apply(func, this, otherArgs);
  11382. });
  11383. }
  11384. /**
  11385. * Creates a throttled function that only invokes `func` at most once per
  11386. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11387. * method to cancel delayed `func` invocations and a `flush` method to
  11388. * immediately invoke them. Provide `options` to indicate whether `func`
  11389. * should be invoked on the leading and/or trailing edge of the `wait`
  11390. * timeout. The `func` is invoked with the last arguments provided to the
  11391. * throttled function. Subsequent calls to the throttled function return the
  11392. * result of the last `func` invocation.
  11393. *
  11394. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11395. * invoked on the trailing edge of the timeout only if the throttled function
  11396. * is invoked more than once during the `wait` timeout.
  11397. *
  11398. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11399. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11400. *
  11401. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11402. * for details over the differences between `_.throttle` and `_.debounce`.
  11403. *
  11404. * @static
  11405. * @memberOf _
  11406. * @since 0.1.0
  11407. * @category Function
  11408. * @param {Function} func The function to throttle.
  11409. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11410. * @param {Object} [options={}] The options object.
  11411. * @param {boolean} [options.leading=true]
  11412. * Specify invoking on the leading edge of the timeout.
  11413. * @param {boolean} [options.trailing=true]
  11414. * Specify invoking on the trailing edge of the timeout.
  11415. * @returns {Function} Returns the new throttled function.
  11416. * @example
  11417. *
  11418. * // Avoid excessively updating the position while scrolling.
  11419. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11420. *
  11421. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11422. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11423. * jQuery(element).on('click', throttled);
  11424. *
  11425. * // Cancel the trailing throttled invocation.
  11426. * jQuery(window).on('popstate', throttled.cancel);
  11427. */
  11428. function throttle(func, wait, options) {
  11429. var leading = true,
  11430. trailing = true;
  11431. if (typeof func != 'function') {
  11432. throw new TypeError(FUNC_ERROR_TEXT);
  11433. }
  11434. if (isObject(options)) {
  11435. leading = 'leading' in options ? !!options.leading : leading;
  11436. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11437. }
  11438. return debounce(func, wait, {
  11439. 'leading': leading,
  11440. 'maxWait': wait,
  11441. 'trailing': trailing
  11442. });
  11443. }
  11444. /**
  11445. * Creates a function that accepts up to one argument, ignoring any
  11446. * additional arguments.
  11447. *
  11448. * @static
  11449. * @memberOf _
  11450. * @since 4.0.0
  11451. * @category Function
  11452. * @param {Function} func The function to cap arguments for.
  11453. * @returns {Function} Returns the new capped function.
  11454. * @example
  11455. *
  11456. * _.map(['6', '8', '10'], _.unary(parseInt));
  11457. * // => [6, 8, 10]
  11458. */
  11459. function unary(func) {
  11460. return ary(func, 1);
  11461. }
  11462. /**
  11463. * Creates a function that provides `value` to `wrapper` as its first
  11464. * argument. Any additional arguments provided to the function are appended
  11465. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11466. * binding of the created function.
  11467. *
  11468. * @static
  11469. * @memberOf _
  11470. * @since 0.1.0
  11471. * @category Function
  11472. * @param {*} value The value to wrap.
  11473. * @param {Function} [wrapper=identity] The wrapper function.
  11474. * @returns {Function} Returns the new function.
  11475. * @example
  11476. *
  11477. * var p = _.wrap(_.escape, function(func, text) {
  11478. * return '<p>' + func(text) + '</p>';
  11479. * });
  11480. *
  11481. * p('fred, barney, & pebbles');
  11482. * // => '<p>fred, barney, &amp; pebbles</p>'
  11483. */
  11484. function wrap(value, wrapper) {
  11485. return partial(castFunction(wrapper), value);
  11486. }
  11487. /*------------------------------------------------------------------------*/
  11488. /**
  11489. * Casts `value` as an array if it's not one.
  11490. *
  11491. * @static
  11492. * @memberOf _
  11493. * @since 4.4.0
  11494. * @category Lang
  11495. * @param {*} value The value to inspect.
  11496. * @returns {Array} Returns the cast array.
  11497. * @example
  11498. *
  11499. * _.castArray(1);
  11500. * // => [1]
  11501. *
  11502. * _.castArray({ 'a': 1 });
  11503. * // => [{ 'a': 1 }]
  11504. *
  11505. * _.castArray('abc');
  11506. * // => ['abc']
  11507. *
  11508. * _.castArray(null);
  11509. * // => [null]
  11510. *
  11511. * _.castArray(undefined);
  11512. * // => [undefined]
  11513. *
  11514. * _.castArray();
  11515. * // => []
  11516. *
  11517. * var array = [1, 2, 3];
  11518. * console.log(_.castArray(array) === array);
  11519. * // => true
  11520. */
  11521. function castArray() {
  11522. if (!arguments.length) {
  11523. return [];
  11524. }
  11525. var value = arguments[0];
  11526. return isArray(value) ? value : [value];
  11527. }
  11528. /**
  11529. * Creates a shallow clone of `value`.
  11530. *
  11531. * **Note:** This method is loosely based on the
  11532. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11533. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11534. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11535. * arrays. The own enumerable properties of `arguments` objects are cloned
  11536. * as plain objects. An empty object is returned for uncloneable values such
  11537. * as error objects, functions, DOM nodes, and WeakMaps.
  11538. *
  11539. * @static
  11540. * @memberOf _
  11541. * @since 0.1.0
  11542. * @category Lang
  11543. * @param {*} value The value to clone.
  11544. * @returns {*} Returns the cloned value.
  11545. * @see _.cloneDeep
  11546. * @example
  11547. *
  11548. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11549. *
  11550. * var shallow = _.clone(objects);
  11551. * console.log(shallow[0] === objects[0]);
  11552. * // => true
  11553. */
  11554. function clone(value) {
  11555. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11556. }
  11557. /**
  11558. * This method is like `_.clone` except that it accepts `customizer` which
  11559. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11560. * cloning is handled by the method instead. The `customizer` is invoked with
  11561. * up to four arguments; (value [, index|key, object, stack]).
  11562. *
  11563. * @static
  11564. * @memberOf _
  11565. * @since 4.0.0
  11566. * @category Lang
  11567. * @param {*} value The value to clone.
  11568. * @param {Function} [customizer] The function to customize cloning.
  11569. * @returns {*} Returns the cloned value.
  11570. * @see _.cloneDeepWith
  11571. * @example
  11572. *
  11573. * function customizer(value) {
  11574. * if (_.isElement(value)) {
  11575. * return value.cloneNode(false);
  11576. * }
  11577. * }
  11578. *
  11579. * var el = _.cloneWith(document.body, customizer);
  11580. *
  11581. * console.log(el === document.body);
  11582. * // => false
  11583. * console.log(el.nodeName);
  11584. * // => 'BODY'
  11585. * console.log(el.childNodes.length);
  11586. * // => 0
  11587. */
  11588. function cloneWith(value, customizer) {
  11589. customizer = typeof customizer == 'function' ? customizer : undefined;
  11590. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11591. }
  11592. /**
  11593. * This method is like `_.clone` except that it recursively clones `value`.
  11594. *
  11595. * @static
  11596. * @memberOf _
  11597. * @since 1.0.0
  11598. * @category Lang
  11599. * @param {*} value The value to recursively clone.
  11600. * @returns {*} Returns the deep cloned value.
  11601. * @see _.clone
  11602. * @example
  11603. *
  11604. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11605. *
  11606. * var deep = _.cloneDeep(objects);
  11607. * console.log(deep[0] === objects[0]);
  11608. * // => false
  11609. */
  11610. function cloneDeep(value) {
  11611. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11612. }
  11613. /**
  11614. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11615. *
  11616. * @static
  11617. * @memberOf _
  11618. * @since 4.0.0
  11619. * @category Lang
  11620. * @param {*} value The value to recursively clone.
  11621. * @param {Function} [customizer] The function to customize cloning.
  11622. * @returns {*} Returns the deep cloned value.
  11623. * @see _.cloneWith
  11624. * @example
  11625. *
  11626. * function customizer(value) {
  11627. * if (_.isElement(value)) {
  11628. * return value.cloneNode(true);
  11629. * }
  11630. * }
  11631. *
  11632. * var el = _.cloneDeepWith(document.body, customizer);
  11633. *
  11634. * console.log(el === document.body);
  11635. * // => false
  11636. * console.log(el.nodeName);
  11637. * // => 'BODY'
  11638. * console.log(el.childNodes.length);
  11639. * // => 20
  11640. */
  11641. function cloneDeepWith(value, customizer) {
  11642. customizer = typeof customizer == 'function' ? customizer : undefined;
  11643. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11644. }
  11645. /**
  11646. * Checks if `object` conforms to `source` by invoking the predicate
  11647. * properties of `source` with the corresponding property values of `object`.
  11648. *
  11649. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11650. * partially applied.
  11651. *
  11652. * @static
  11653. * @memberOf _
  11654. * @since 4.14.0
  11655. * @category Lang
  11656. * @param {Object} object The object to inspect.
  11657. * @param {Object} source The object of property predicates to conform to.
  11658. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11659. * @example
  11660. *
  11661. * var object = { 'a': 1, 'b': 2 };
  11662. *
  11663. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11664. * // => true
  11665. *
  11666. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11667. * // => false
  11668. */
  11669. function conformsTo(object, source) {
  11670. return source == null || baseConformsTo(object, source, keys(source));
  11671. }
  11672. /**
  11673. * Performs a
  11674. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11675. * comparison between two values to determine if they are equivalent.
  11676. *
  11677. * @static
  11678. * @memberOf _
  11679. * @since 4.0.0
  11680. * @category Lang
  11681. * @param {*} value The value to compare.
  11682. * @param {*} other The other value to compare.
  11683. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11684. * @example
  11685. *
  11686. * var object = { 'a': 1 };
  11687. * var other = { 'a': 1 };
  11688. *
  11689. * _.eq(object, object);
  11690. * // => true
  11691. *
  11692. * _.eq(object, other);
  11693. * // => false
  11694. *
  11695. * _.eq('a', 'a');
  11696. * // => true
  11697. *
  11698. * _.eq('a', Object('a'));
  11699. * // => false
  11700. *
  11701. * _.eq(NaN, NaN);
  11702. * // => true
  11703. */
  11704. function eq(value, other) {
  11705. return value === other || (value !== value && other !== other);
  11706. }
  11707. /**
  11708. * Checks if `value` is greater than `other`.
  11709. *
  11710. * @static
  11711. * @memberOf _
  11712. * @since 3.9.0
  11713. * @category Lang
  11714. * @param {*} value The value to compare.
  11715. * @param {*} other The other value to compare.
  11716. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11717. * else `false`.
  11718. * @see _.lt
  11719. * @example
  11720. *
  11721. * _.gt(3, 1);
  11722. * // => true
  11723. *
  11724. * _.gt(3, 3);
  11725. * // => false
  11726. *
  11727. * _.gt(1, 3);
  11728. * // => false
  11729. */
  11730. var gt = createRelationalOperation(baseGt);
  11731. /**
  11732. * Checks if `value` is greater than or equal to `other`.
  11733. *
  11734. * @static
  11735. * @memberOf _
  11736. * @since 3.9.0
  11737. * @category Lang
  11738. * @param {*} value The value to compare.
  11739. * @param {*} other The other value to compare.
  11740. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11741. * `other`, else `false`.
  11742. * @see _.lte
  11743. * @example
  11744. *
  11745. * _.gte(3, 1);
  11746. * // => true
  11747. *
  11748. * _.gte(3, 3);
  11749. * // => true
  11750. *
  11751. * _.gte(1, 3);
  11752. * // => false
  11753. */
  11754. var gte = createRelationalOperation(function(value, other) {
  11755. return value >= other;
  11756. });
  11757. /**
  11758. * Checks if `value` is likely an `arguments` object.
  11759. *
  11760. * @static
  11761. * @memberOf _
  11762. * @since 0.1.0
  11763. * @category Lang
  11764. * @param {*} value The value to check.
  11765. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11766. * else `false`.
  11767. * @example
  11768. *
  11769. * _.isArguments(function() { return arguments; }());
  11770. * // => true
  11771. *
  11772. * _.isArguments([1, 2, 3]);
  11773. * // => false
  11774. */
  11775. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11776. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11777. !propertyIsEnumerable.call(value, 'callee');
  11778. };
  11779. /**
  11780. * Checks if `value` is classified as an `Array` object.
  11781. *
  11782. * @static
  11783. * @memberOf _
  11784. * @since 0.1.0
  11785. * @category Lang
  11786. * @param {*} value The value to check.
  11787. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11788. * @example
  11789. *
  11790. * _.isArray([1, 2, 3]);
  11791. * // => true
  11792. *
  11793. * _.isArray(document.body.children);
  11794. * // => false
  11795. *
  11796. * _.isArray('abc');
  11797. * // => false
  11798. *
  11799. * _.isArray(_.noop);
  11800. * // => false
  11801. */
  11802. var isArray = Array.isArray;
  11803. /**
  11804. * Checks if `value` is classified as an `ArrayBuffer` object.
  11805. *
  11806. * @static
  11807. * @memberOf _
  11808. * @since 4.3.0
  11809. * @category Lang
  11810. * @param {*} value The value to check.
  11811. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11812. * @example
  11813. *
  11814. * _.isArrayBuffer(new ArrayBuffer(2));
  11815. * // => true
  11816. *
  11817. * _.isArrayBuffer(new Array(2));
  11818. * // => false
  11819. */
  11820. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11821. /**
  11822. * Checks if `value` is array-like. A value is considered array-like if it's
  11823. * not a function and has a `value.length` that's an integer greater than or
  11824. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11825. *
  11826. * @static
  11827. * @memberOf _
  11828. * @since 4.0.0
  11829. * @category Lang
  11830. * @param {*} value The value to check.
  11831. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11832. * @example
  11833. *
  11834. * _.isArrayLike([1, 2, 3]);
  11835. * // => true
  11836. *
  11837. * _.isArrayLike(document.body.children);
  11838. * // => true
  11839. *
  11840. * _.isArrayLike('abc');
  11841. * // => true
  11842. *
  11843. * _.isArrayLike(_.noop);
  11844. * // => false
  11845. */
  11846. function isArrayLike(value) {
  11847. return value != null && isLength(value.length) && !isFunction(value);
  11848. }
  11849. /**
  11850. * This method is like `_.isArrayLike` except that it also checks if `value`
  11851. * is an object.
  11852. *
  11853. * @static
  11854. * @memberOf _
  11855. * @since 4.0.0
  11856. * @category Lang
  11857. * @param {*} value The value to check.
  11858. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11859. * else `false`.
  11860. * @example
  11861. *
  11862. * _.isArrayLikeObject([1, 2, 3]);
  11863. * // => true
  11864. *
  11865. * _.isArrayLikeObject(document.body.children);
  11866. * // => true
  11867. *
  11868. * _.isArrayLikeObject('abc');
  11869. * // => false
  11870. *
  11871. * _.isArrayLikeObject(_.noop);
  11872. * // => false
  11873. */
  11874. function isArrayLikeObject(value) {
  11875. return isObjectLike(value) && isArrayLike(value);
  11876. }
  11877. /**
  11878. * Checks if `value` is classified as a boolean primitive or object.
  11879. *
  11880. * @static
  11881. * @memberOf _
  11882. * @since 0.1.0
  11883. * @category Lang
  11884. * @param {*} value The value to check.
  11885. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11886. * @example
  11887. *
  11888. * _.isBoolean(false);
  11889. * // => true
  11890. *
  11891. * _.isBoolean(null);
  11892. * // => false
  11893. */
  11894. function isBoolean(value) {
  11895. return value === true || value === false ||
  11896. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11897. }
  11898. /**
  11899. * Checks if `value` is a buffer.
  11900. *
  11901. * @static
  11902. * @memberOf _
  11903. * @since 4.3.0
  11904. * @category Lang
  11905. * @param {*} value The value to check.
  11906. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11907. * @example
  11908. *
  11909. * _.isBuffer(new Buffer(2));
  11910. * // => true
  11911. *
  11912. * _.isBuffer(new Uint8Array(2));
  11913. * // => false
  11914. */
  11915. var isBuffer = nativeIsBuffer || stubFalse;
  11916. /**
  11917. * Checks if `value` is classified as a `Date` object.
  11918. *
  11919. * @static
  11920. * @memberOf _
  11921. * @since 0.1.0
  11922. * @category Lang
  11923. * @param {*} value The value to check.
  11924. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11925. * @example
  11926. *
  11927. * _.isDate(new Date);
  11928. * // => true
  11929. *
  11930. * _.isDate('Mon April 23 2012');
  11931. * // => false
  11932. */
  11933. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11934. /**
  11935. * Checks if `value` is likely a DOM element.
  11936. *
  11937. * @static
  11938. * @memberOf _
  11939. * @since 0.1.0
  11940. * @category Lang
  11941. * @param {*} value The value to check.
  11942. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11943. * @example
  11944. *
  11945. * _.isElement(document.body);
  11946. * // => true
  11947. *
  11948. * _.isElement('<body>');
  11949. * // => false
  11950. */
  11951. function isElement(value) {
  11952. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11953. }
  11954. /**
  11955. * Checks if `value` is an empty object, collection, map, or set.
  11956. *
  11957. * Objects are considered empty if they have no own enumerable string keyed
  11958. * properties.
  11959. *
  11960. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11961. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11962. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11963. *
  11964. * @static
  11965. * @memberOf _
  11966. * @since 0.1.0
  11967. * @category Lang
  11968. * @param {*} value The value to check.
  11969. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11970. * @example
  11971. *
  11972. * _.isEmpty(null);
  11973. * // => true
  11974. *
  11975. * _.isEmpty(true);
  11976. * // => true
  11977. *
  11978. * _.isEmpty(1);
  11979. * // => true
  11980. *
  11981. * _.isEmpty([1, 2, 3]);
  11982. * // => false
  11983. *
  11984. * _.isEmpty({ 'a': 1 });
  11985. * // => false
  11986. */
  11987. function isEmpty(value) {
  11988. if (value == null) {
  11989. return true;
  11990. }
  11991. if (isArrayLike(value) &&
  11992. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11993. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11994. return !value.length;
  11995. }
  11996. var tag = getTag(value);
  11997. if (tag == mapTag || tag == setTag) {
  11998. return !value.size;
  11999. }
  12000. if (isPrototype(value)) {
  12001. return !baseKeys(value).length;
  12002. }
  12003. for (var key in value) {
  12004. if (hasOwnProperty.call(value, key)) {
  12005. return false;
  12006. }
  12007. }
  12008. return true;
  12009. }
  12010. /**
  12011. * Performs a deep comparison between two values to determine if they are
  12012. * equivalent.
  12013. *
  12014. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12015. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12016. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12017. * by their own, not inherited, enumerable properties. Functions and DOM
  12018. * nodes are compared by strict equality, i.e. `===`.
  12019. *
  12020. * @static
  12021. * @memberOf _
  12022. * @since 0.1.0
  12023. * @category Lang
  12024. * @param {*} value The value to compare.
  12025. * @param {*} other The other value to compare.
  12026. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12027. * @example
  12028. *
  12029. * var object = { 'a': 1 };
  12030. * var other = { 'a': 1 };
  12031. *
  12032. * _.isEqual(object, other);
  12033. * // => true
  12034. *
  12035. * object === other;
  12036. * // => false
  12037. */
  12038. function isEqual(value, other) {
  12039. return baseIsEqual(value, other);
  12040. }
  12041. /**
  12042. * This method is like `_.isEqual` except that it accepts `customizer` which
  12043. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12044. * are handled by the method instead. The `customizer` is invoked with up to
  12045. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12046. *
  12047. * @static
  12048. * @memberOf _
  12049. * @since 4.0.0
  12050. * @category Lang
  12051. * @param {*} value The value to compare.
  12052. * @param {*} other The other value to compare.
  12053. * @param {Function} [customizer] The function to customize comparisons.
  12054. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12055. * @example
  12056. *
  12057. * function isGreeting(value) {
  12058. * return /^h(?:i|ello)$/.test(value);
  12059. * }
  12060. *
  12061. * function customizer(objValue, othValue) {
  12062. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12063. * return true;
  12064. * }
  12065. * }
  12066. *
  12067. * var array = ['hello', 'goodbye'];
  12068. * var other = ['hi', 'goodbye'];
  12069. *
  12070. * _.isEqualWith(array, other, customizer);
  12071. * // => true
  12072. */
  12073. function isEqualWith(value, other, customizer) {
  12074. customizer = typeof customizer == 'function' ? customizer : undefined;
  12075. var result = customizer ? customizer(value, other) : undefined;
  12076. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12077. }
  12078. /**
  12079. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12080. * `SyntaxError`, `TypeError`, or `URIError` object.
  12081. *
  12082. * @static
  12083. * @memberOf _
  12084. * @since 3.0.0
  12085. * @category Lang
  12086. * @param {*} value The value to check.
  12087. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12088. * @example
  12089. *
  12090. * _.isError(new Error);
  12091. * // => true
  12092. *
  12093. * _.isError(Error);
  12094. * // => false
  12095. */
  12096. function isError(value) {
  12097. if (!isObjectLike(value)) {
  12098. return false;
  12099. }
  12100. var tag = baseGetTag(value);
  12101. return tag == errorTag || tag == domExcTag ||
  12102. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12103. }
  12104. /**
  12105. * Checks if `value` is a finite primitive number.
  12106. *
  12107. * **Note:** This method is based on
  12108. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12109. *
  12110. * @static
  12111. * @memberOf _
  12112. * @since 0.1.0
  12113. * @category Lang
  12114. * @param {*} value The value to check.
  12115. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12116. * @example
  12117. *
  12118. * _.isFinite(3);
  12119. * // => true
  12120. *
  12121. * _.isFinite(Number.MIN_VALUE);
  12122. * // => true
  12123. *
  12124. * _.isFinite(Infinity);
  12125. * // => false
  12126. *
  12127. * _.isFinite('3');
  12128. * // => false
  12129. */
  12130. function isFinite(value) {
  12131. return typeof value == 'number' && nativeIsFinite(value);
  12132. }
  12133. /**
  12134. * Checks if `value` is classified as a `Function` object.
  12135. *
  12136. * @static
  12137. * @memberOf _
  12138. * @since 0.1.0
  12139. * @category Lang
  12140. * @param {*} value The value to check.
  12141. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12142. * @example
  12143. *
  12144. * _.isFunction(_);
  12145. * // => true
  12146. *
  12147. * _.isFunction(/abc/);
  12148. * // => false
  12149. */
  12150. function isFunction(value) {
  12151. if (!isObject(value)) {
  12152. return false;
  12153. }
  12154. // The use of `Object#toString` avoids issues with the `typeof` operator
  12155. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12156. var tag = baseGetTag(value);
  12157. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12158. }
  12159. /**
  12160. * Checks if `value` is an integer.
  12161. *
  12162. * **Note:** This method is based on
  12163. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12164. *
  12165. * @static
  12166. * @memberOf _
  12167. * @since 4.0.0
  12168. * @category Lang
  12169. * @param {*} value The value to check.
  12170. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12171. * @example
  12172. *
  12173. * _.isInteger(3);
  12174. * // => true
  12175. *
  12176. * _.isInteger(Number.MIN_VALUE);
  12177. * // => false
  12178. *
  12179. * _.isInteger(Infinity);
  12180. * // => false
  12181. *
  12182. * _.isInteger('3');
  12183. * // => false
  12184. */
  12185. function isInteger(value) {
  12186. return typeof value == 'number' && value == toInteger(value);
  12187. }
  12188. /**
  12189. * Checks if `value` is a valid array-like length.
  12190. *
  12191. * **Note:** This method is loosely based on
  12192. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12193. *
  12194. * @static
  12195. * @memberOf _
  12196. * @since 4.0.0
  12197. * @category Lang
  12198. * @param {*} value The value to check.
  12199. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12200. * @example
  12201. *
  12202. * _.isLength(3);
  12203. * // => true
  12204. *
  12205. * _.isLength(Number.MIN_VALUE);
  12206. * // => false
  12207. *
  12208. * _.isLength(Infinity);
  12209. * // => false
  12210. *
  12211. * _.isLength('3');
  12212. * // => false
  12213. */
  12214. function isLength(value) {
  12215. return typeof value == 'number' &&
  12216. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12217. }
  12218. /**
  12219. * Checks if `value` is the
  12220. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12221. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12222. *
  12223. * @static
  12224. * @memberOf _
  12225. * @since 0.1.0
  12226. * @category Lang
  12227. * @param {*} value The value to check.
  12228. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12229. * @example
  12230. *
  12231. * _.isObject({});
  12232. * // => true
  12233. *
  12234. * _.isObject([1, 2, 3]);
  12235. * // => true
  12236. *
  12237. * _.isObject(_.noop);
  12238. * // => true
  12239. *
  12240. * _.isObject(null);
  12241. * // => false
  12242. */
  12243. function isObject(value) {
  12244. var type = typeof value;
  12245. return value != null && (type == 'object' || type == 'function');
  12246. }
  12247. /**
  12248. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12249. * and has a `typeof` result of "object".
  12250. *
  12251. * @static
  12252. * @memberOf _
  12253. * @since 4.0.0
  12254. * @category Lang
  12255. * @param {*} value The value to check.
  12256. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12257. * @example
  12258. *
  12259. * _.isObjectLike({});
  12260. * // => true
  12261. *
  12262. * _.isObjectLike([1, 2, 3]);
  12263. * // => true
  12264. *
  12265. * _.isObjectLike(_.noop);
  12266. * // => false
  12267. *
  12268. * _.isObjectLike(null);
  12269. * // => false
  12270. */
  12271. function isObjectLike(value) {
  12272. return value != null && typeof value == 'object';
  12273. }
  12274. /**
  12275. * Checks if `value` is classified as a `Map` object.
  12276. *
  12277. * @static
  12278. * @memberOf _
  12279. * @since 4.3.0
  12280. * @category Lang
  12281. * @param {*} value The value to check.
  12282. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12283. * @example
  12284. *
  12285. * _.isMap(new Map);
  12286. * // => true
  12287. *
  12288. * _.isMap(new WeakMap);
  12289. * // => false
  12290. */
  12291. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12292. /**
  12293. * Performs a partial deep comparison between `object` and `source` to
  12294. * determine if `object` contains equivalent property values.
  12295. *
  12296. * **Note:** This method is equivalent to `_.matches` when `source` is
  12297. * partially applied.
  12298. *
  12299. * Partial comparisons will match empty array and empty object `source`
  12300. * values against any array or object value, respectively. See `_.isEqual`
  12301. * for a list of supported value comparisons.
  12302. *
  12303. * @static
  12304. * @memberOf _
  12305. * @since 3.0.0
  12306. * @category Lang
  12307. * @param {Object} object The object to inspect.
  12308. * @param {Object} source The object of property values to match.
  12309. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12310. * @example
  12311. *
  12312. * var object = { 'a': 1, 'b': 2 };
  12313. *
  12314. * _.isMatch(object, { 'b': 2 });
  12315. * // => true
  12316. *
  12317. * _.isMatch(object, { 'b': 1 });
  12318. * // => false
  12319. */
  12320. function isMatch(object, source) {
  12321. return object === source || baseIsMatch(object, source, getMatchData(source));
  12322. }
  12323. /**
  12324. * This method is like `_.isMatch` except that it accepts `customizer` which
  12325. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12326. * are handled by the method instead. The `customizer` is invoked with five
  12327. * arguments: (objValue, srcValue, index|key, object, source).
  12328. *
  12329. * @static
  12330. * @memberOf _
  12331. * @since 4.0.0
  12332. * @category Lang
  12333. * @param {Object} object The object to inspect.
  12334. * @param {Object} source The object of property values to match.
  12335. * @param {Function} [customizer] The function to customize comparisons.
  12336. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12337. * @example
  12338. *
  12339. * function isGreeting(value) {
  12340. * return /^h(?:i|ello)$/.test(value);
  12341. * }
  12342. *
  12343. * function customizer(objValue, srcValue) {
  12344. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12345. * return true;
  12346. * }
  12347. * }
  12348. *
  12349. * var object = { 'greeting': 'hello' };
  12350. * var source = { 'greeting': 'hi' };
  12351. *
  12352. * _.isMatchWith(object, source, customizer);
  12353. * // => true
  12354. */
  12355. function isMatchWith(object, source, customizer) {
  12356. customizer = typeof customizer == 'function' ? customizer : undefined;
  12357. return baseIsMatch(object, source, getMatchData(source), customizer);
  12358. }
  12359. /**
  12360. * Checks if `value` is `NaN`.
  12361. *
  12362. * **Note:** This method is based on
  12363. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12364. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12365. * `undefined` and other non-number values.
  12366. *
  12367. * @static
  12368. * @memberOf _
  12369. * @since 0.1.0
  12370. * @category Lang
  12371. * @param {*} value The value to check.
  12372. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12373. * @example
  12374. *
  12375. * _.isNaN(NaN);
  12376. * // => true
  12377. *
  12378. * _.isNaN(new Number(NaN));
  12379. * // => true
  12380. *
  12381. * isNaN(undefined);
  12382. * // => true
  12383. *
  12384. * _.isNaN(undefined);
  12385. * // => false
  12386. */
  12387. function isNaN(value) {
  12388. // An `NaN` primitive is the only value that is not equal to itself.
  12389. // Perform the `toStringTag` check first to avoid errors with some
  12390. // ActiveX objects in IE.
  12391. return isNumber(value) && value != +value;
  12392. }
  12393. /**
  12394. * Checks if `value` is a pristine native function.
  12395. *
  12396. * **Note:** This method can't reliably detect native functions in the presence
  12397. * of the core-js package because core-js circumvents this kind of detection.
  12398. * Despite multiple requests, the core-js maintainer has made it clear: any
  12399. * attempt to fix the detection will be obstructed. As a result, we're left
  12400. * with little choice but to throw an error. Unfortunately, this also affects
  12401. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12402. * which rely on core-js.
  12403. *
  12404. * @static
  12405. * @memberOf _
  12406. * @since 3.0.0
  12407. * @category Lang
  12408. * @param {*} value The value to check.
  12409. * @returns {boolean} Returns `true` if `value` is a native function,
  12410. * else `false`.
  12411. * @example
  12412. *
  12413. * _.isNative(Array.prototype.push);
  12414. * // => true
  12415. *
  12416. * _.isNative(_);
  12417. * // => false
  12418. */
  12419. function isNative(value) {
  12420. if (isMaskable(value)) {
  12421. throw new Error(CORE_ERROR_TEXT);
  12422. }
  12423. return baseIsNative(value);
  12424. }
  12425. /**
  12426. * Checks if `value` is `null`.
  12427. *
  12428. * @static
  12429. * @memberOf _
  12430. * @since 0.1.0
  12431. * @category Lang
  12432. * @param {*} value The value to check.
  12433. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12434. * @example
  12435. *
  12436. * _.isNull(null);
  12437. * // => true
  12438. *
  12439. * _.isNull(void 0);
  12440. * // => false
  12441. */
  12442. function isNull(value) {
  12443. return value === null;
  12444. }
  12445. /**
  12446. * Checks if `value` is `null` or `undefined`.
  12447. *
  12448. * @static
  12449. * @memberOf _
  12450. * @since 4.0.0
  12451. * @category Lang
  12452. * @param {*} value The value to check.
  12453. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12454. * @example
  12455. *
  12456. * _.isNil(null);
  12457. * // => true
  12458. *
  12459. * _.isNil(void 0);
  12460. * // => true
  12461. *
  12462. * _.isNil(NaN);
  12463. * // => false
  12464. */
  12465. function isNil(value) {
  12466. return value == null;
  12467. }
  12468. /**
  12469. * Checks if `value` is classified as a `Number` primitive or object.
  12470. *
  12471. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12472. * classified as numbers, use the `_.isFinite` method.
  12473. *
  12474. * @static
  12475. * @memberOf _
  12476. * @since 0.1.0
  12477. * @category Lang
  12478. * @param {*} value The value to check.
  12479. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12480. * @example
  12481. *
  12482. * _.isNumber(3);
  12483. * // => true
  12484. *
  12485. * _.isNumber(Number.MIN_VALUE);
  12486. * // => true
  12487. *
  12488. * _.isNumber(Infinity);
  12489. * // => true
  12490. *
  12491. * _.isNumber('3');
  12492. * // => false
  12493. */
  12494. function isNumber(value) {
  12495. return typeof value == 'number' ||
  12496. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12497. }
  12498. /**
  12499. * Checks if `value` is a plain object, that is, an object created by the
  12500. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12501. *
  12502. * @static
  12503. * @memberOf _
  12504. * @since 0.8.0
  12505. * @category Lang
  12506. * @param {*} value The value to check.
  12507. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12508. * @example
  12509. *
  12510. * function Foo() {
  12511. * this.a = 1;
  12512. * }
  12513. *
  12514. * _.isPlainObject(new Foo);
  12515. * // => false
  12516. *
  12517. * _.isPlainObject([1, 2, 3]);
  12518. * // => false
  12519. *
  12520. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12521. * // => true
  12522. *
  12523. * _.isPlainObject(Object.create(null));
  12524. * // => true
  12525. */
  12526. function isPlainObject(value) {
  12527. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12528. return false;
  12529. }
  12530. var proto = getPrototype(value);
  12531. if (proto === null) {
  12532. return true;
  12533. }
  12534. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12535. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12536. funcToString.call(Ctor) == objectCtorString;
  12537. }
  12538. /**
  12539. * Checks if `value` is classified as a `RegExp` object.
  12540. *
  12541. * @static
  12542. * @memberOf _
  12543. * @since 0.1.0
  12544. * @category Lang
  12545. * @param {*} value The value to check.
  12546. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12547. * @example
  12548. *
  12549. * _.isRegExp(/abc/);
  12550. * // => true
  12551. *
  12552. * _.isRegExp('/abc/');
  12553. * // => false
  12554. */
  12555. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12556. /**
  12557. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12558. * double precision number which isn't the result of a rounded unsafe integer.
  12559. *
  12560. * **Note:** This method is based on
  12561. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12562. *
  12563. * @static
  12564. * @memberOf _
  12565. * @since 4.0.0
  12566. * @category Lang
  12567. * @param {*} value The value to check.
  12568. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12569. * @example
  12570. *
  12571. * _.isSafeInteger(3);
  12572. * // => true
  12573. *
  12574. * _.isSafeInteger(Number.MIN_VALUE);
  12575. * // => false
  12576. *
  12577. * _.isSafeInteger(Infinity);
  12578. * // => false
  12579. *
  12580. * _.isSafeInteger('3');
  12581. * // => false
  12582. */
  12583. function isSafeInteger(value) {
  12584. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12585. }
  12586. /**
  12587. * Checks if `value` is classified as a `Set` object.
  12588. *
  12589. * @static
  12590. * @memberOf _
  12591. * @since 4.3.0
  12592. * @category Lang
  12593. * @param {*} value The value to check.
  12594. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12595. * @example
  12596. *
  12597. * _.isSet(new Set);
  12598. * // => true
  12599. *
  12600. * _.isSet(new WeakSet);
  12601. * // => false
  12602. */
  12603. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12604. /**
  12605. * Checks if `value` is classified as a `String` primitive or object.
  12606. *
  12607. * @static
  12608. * @since 0.1.0
  12609. * @memberOf _
  12610. * @category Lang
  12611. * @param {*} value The value to check.
  12612. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12613. * @example
  12614. *
  12615. * _.isString('abc');
  12616. * // => true
  12617. *
  12618. * _.isString(1);
  12619. * // => false
  12620. */
  12621. function isString(value) {
  12622. return typeof value == 'string' ||
  12623. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12624. }
  12625. /**
  12626. * Checks if `value` is classified as a `Symbol` primitive or object.
  12627. *
  12628. * @static
  12629. * @memberOf _
  12630. * @since 4.0.0
  12631. * @category Lang
  12632. * @param {*} value The value to check.
  12633. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12634. * @example
  12635. *
  12636. * _.isSymbol(Symbol.iterator);
  12637. * // => true
  12638. *
  12639. * _.isSymbol('abc');
  12640. * // => false
  12641. */
  12642. function isSymbol(value) {
  12643. return typeof value == 'symbol' ||
  12644. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12645. }
  12646. /**
  12647. * Checks if `value` is classified as a typed array.
  12648. *
  12649. * @static
  12650. * @memberOf _
  12651. * @since 3.0.0
  12652. * @category Lang
  12653. * @param {*} value The value to check.
  12654. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12655. * @example
  12656. *
  12657. * _.isTypedArray(new Uint8Array);
  12658. * // => true
  12659. *
  12660. * _.isTypedArray([]);
  12661. * // => false
  12662. */
  12663. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12664. /**
  12665. * Checks if `value` is `undefined`.
  12666. *
  12667. * @static
  12668. * @since 0.1.0
  12669. * @memberOf _
  12670. * @category Lang
  12671. * @param {*} value The value to check.
  12672. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12673. * @example
  12674. *
  12675. * _.isUndefined(void 0);
  12676. * // => true
  12677. *
  12678. * _.isUndefined(null);
  12679. * // => false
  12680. */
  12681. function isUndefined(value) {
  12682. return value === undefined;
  12683. }
  12684. /**
  12685. * Checks if `value` is classified as a `WeakMap` object.
  12686. *
  12687. * @static
  12688. * @memberOf _
  12689. * @since 4.3.0
  12690. * @category Lang
  12691. * @param {*} value The value to check.
  12692. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12693. * @example
  12694. *
  12695. * _.isWeakMap(new WeakMap);
  12696. * // => true
  12697. *
  12698. * _.isWeakMap(new Map);
  12699. * // => false
  12700. */
  12701. function isWeakMap(value) {
  12702. return isObjectLike(value) && getTag(value) == weakMapTag;
  12703. }
  12704. /**
  12705. * Checks if `value` is classified as a `WeakSet` object.
  12706. *
  12707. * @static
  12708. * @memberOf _
  12709. * @since 4.3.0
  12710. * @category Lang
  12711. * @param {*} value The value to check.
  12712. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12713. * @example
  12714. *
  12715. * _.isWeakSet(new WeakSet);
  12716. * // => true
  12717. *
  12718. * _.isWeakSet(new Set);
  12719. * // => false
  12720. */
  12721. function isWeakSet(value) {
  12722. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12723. }
  12724. /**
  12725. * Checks if `value` is less than `other`.
  12726. *
  12727. * @static
  12728. * @memberOf _
  12729. * @since 3.9.0
  12730. * @category Lang
  12731. * @param {*} value The value to compare.
  12732. * @param {*} other The other value to compare.
  12733. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12734. * else `false`.
  12735. * @see _.gt
  12736. * @example
  12737. *
  12738. * _.lt(1, 3);
  12739. * // => true
  12740. *
  12741. * _.lt(3, 3);
  12742. * // => false
  12743. *
  12744. * _.lt(3, 1);
  12745. * // => false
  12746. */
  12747. var lt = createRelationalOperation(baseLt);
  12748. /**
  12749. * Checks if `value` is less than or equal to `other`.
  12750. *
  12751. * @static
  12752. * @memberOf _
  12753. * @since 3.9.0
  12754. * @category Lang
  12755. * @param {*} value The value to compare.
  12756. * @param {*} other The other value to compare.
  12757. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12758. * `other`, else `false`.
  12759. * @see _.gte
  12760. * @example
  12761. *
  12762. * _.lte(1, 3);
  12763. * // => true
  12764. *
  12765. * _.lte(3, 3);
  12766. * // => true
  12767. *
  12768. * _.lte(3, 1);
  12769. * // => false
  12770. */
  12771. var lte = createRelationalOperation(function(value, other) {
  12772. return value <= other;
  12773. });
  12774. /**
  12775. * Converts `value` to an array.
  12776. *
  12777. * @static
  12778. * @since 0.1.0
  12779. * @memberOf _
  12780. * @category Lang
  12781. * @param {*} value The value to convert.
  12782. * @returns {Array} Returns the converted array.
  12783. * @example
  12784. *
  12785. * _.toArray({ 'a': 1, 'b': 2 });
  12786. * // => [1, 2]
  12787. *
  12788. * _.toArray('abc');
  12789. * // => ['a', 'b', 'c']
  12790. *
  12791. * _.toArray(1);
  12792. * // => []
  12793. *
  12794. * _.toArray(null);
  12795. * // => []
  12796. */
  12797. function toArray(value) {
  12798. if (!value) {
  12799. return [];
  12800. }
  12801. if (isArrayLike(value)) {
  12802. return isString(value) ? stringToArray(value) : copyArray(value);
  12803. }
  12804. if (symIterator && value[symIterator]) {
  12805. return iteratorToArray(value[symIterator]());
  12806. }
  12807. var tag = getTag(value),
  12808. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12809. return func(value);
  12810. }
  12811. /**
  12812. * Converts `value` to a finite number.
  12813. *
  12814. * @static
  12815. * @memberOf _
  12816. * @since 4.12.0
  12817. * @category Lang
  12818. * @param {*} value The value to convert.
  12819. * @returns {number} Returns the converted number.
  12820. * @example
  12821. *
  12822. * _.toFinite(3.2);
  12823. * // => 3.2
  12824. *
  12825. * _.toFinite(Number.MIN_VALUE);
  12826. * // => 5e-324
  12827. *
  12828. * _.toFinite(Infinity);
  12829. * // => 1.7976931348623157e+308
  12830. *
  12831. * _.toFinite('3.2');
  12832. * // => 3.2
  12833. */
  12834. function toFinite(value) {
  12835. if (!value) {
  12836. return value === 0 ? value : 0;
  12837. }
  12838. value = toNumber(value);
  12839. if (value === INFINITY || value === -INFINITY) {
  12840. var sign = (value < 0 ? -1 : 1);
  12841. return sign * MAX_INTEGER;
  12842. }
  12843. return value === value ? value : 0;
  12844. }
  12845. /**
  12846. * Converts `value` to an integer.
  12847. *
  12848. * **Note:** This method is loosely based on
  12849. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12850. *
  12851. * @static
  12852. * @memberOf _
  12853. * @since 4.0.0
  12854. * @category Lang
  12855. * @param {*} value The value to convert.
  12856. * @returns {number} Returns the converted integer.
  12857. * @example
  12858. *
  12859. * _.toInteger(3.2);
  12860. * // => 3
  12861. *
  12862. * _.toInteger(Number.MIN_VALUE);
  12863. * // => 0
  12864. *
  12865. * _.toInteger(Infinity);
  12866. * // => 1.7976931348623157e+308
  12867. *
  12868. * _.toInteger('3.2');
  12869. * // => 3
  12870. */
  12871. function toInteger(value) {
  12872. var result = toFinite(value),
  12873. remainder = result % 1;
  12874. return result === result ? (remainder ? result - remainder : result) : 0;
  12875. }
  12876. /**
  12877. * Converts `value` to an integer suitable for use as the length of an
  12878. * array-like object.
  12879. *
  12880. * **Note:** This method is based on
  12881. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12882. *
  12883. * @static
  12884. * @memberOf _
  12885. * @since 4.0.0
  12886. * @category Lang
  12887. * @param {*} value The value to convert.
  12888. * @returns {number} Returns the converted integer.
  12889. * @example
  12890. *
  12891. * _.toLength(3.2);
  12892. * // => 3
  12893. *
  12894. * _.toLength(Number.MIN_VALUE);
  12895. * // => 0
  12896. *
  12897. * _.toLength(Infinity);
  12898. * // => 4294967295
  12899. *
  12900. * _.toLength('3.2');
  12901. * // => 3
  12902. */
  12903. function toLength(value) {
  12904. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12905. }
  12906. /**
  12907. * Converts `value` to a number.
  12908. *
  12909. * @static
  12910. * @memberOf _
  12911. * @since 4.0.0
  12912. * @category Lang
  12913. * @param {*} value The value to process.
  12914. * @returns {number} Returns the number.
  12915. * @example
  12916. *
  12917. * _.toNumber(3.2);
  12918. * // => 3.2
  12919. *
  12920. * _.toNumber(Number.MIN_VALUE);
  12921. * // => 5e-324
  12922. *
  12923. * _.toNumber(Infinity);
  12924. * // => Infinity
  12925. *
  12926. * _.toNumber('3.2');
  12927. * // => 3.2
  12928. */
  12929. function toNumber(value) {
  12930. if (typeof value == 'number') {
  12931. return value;
  12932. }
  12933. if (isSymbol(value)) {
  12934. return NAN;
  12935. }
  12936. if (isObject(value)) {
  12937. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12938. value = isObject(other) ? (other + '') : other;
  12939. }
  12940. if (typeof value != 'string') {
  12941. return value === 0 ? value : +value;
  12942. }
  12943. value = baseTrim(value);
  12944. var isBinary = reIsBinary.test(value);
  12945. return (isBinary || reIsOctal.test(value))
  12946. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12947. : (reIsBadHex.test(value) ? NAN : +value);
  12948. }
  12949. /**
  12950. * Converts `value` to a plain object flattening inherited enumerable string
  12951. * keyed properties of `value` to own properties of the plain object.
  12952. *
  12953. * @static
  12954. * @memberOf _
  12955. * @since 3.0.0
  12956. * @category Lang
  12957. * @param {*} value The value to convert.
  12958. * @returns {Object} Returns the converted plain object.
  12959. * @example
  12960. *
  12961. * function Foo() {
  12962. * this.b = 2;
  12963. * }
  12964. *
  12965. * Foo.prototype.c = 3;
  12966. *
  12967. * _.assign({ 'a': 1 }, new Foo);
  12968. * // => { 'a': 1, 'b': 2 }
  12969. *
  12970. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12971. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12972. */
  12973. function toPlainObject(value) {
  12974. return copyObject(value, keysIn(value));
  12975. }
  12976. /**
  12977. * Converts `value` to a safe integer. A safe integer can be compared and
  12978. * represented correctly.
  12979. *
  12980. * @static
  12981. * @memberOf _
  12982. * @since 4.0.0
  12983. * @category Lang
  12984. * @param {*} value The value to convert.
  12985. * @returns {number} Returns the converted integer.
  12986. * @example
  12987. *
  12988. * _.toSafeInteger(3.2);
  12989. * // => 3
  12990. *
  12991. * _.toSafeInteger(Number.MIN_VALUE);
  12992. * // => 0
  12993. *
  12994. * _.toSafeInteger(Infinity);
  12995. * // => 9007199254740991
  12996. *
  12997. * _.toSafeInteger('3.2');
  12998. * // => 3
  12999. */
  13000. function toSafeInteger(value) {
  13001. return value
  13002. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13003. : (value === 0 ? value : 0);
  13004. }
  13005. /**
  13006. * Converts `value` to a string. An empty string is returned for `null`
  13007. * and `undefined` values. The sign of `-0` is preserved.
  13008. *
  13009. * @static
  13010. * @memberOf _
  13011. * @since 4.0.0
  13012. * @category Lang
  13013. * @param {*} value The value to convert.
  13014. * @returns {string} Returns the converted string.
  13015. * @example
  13016. *
  13017. * _.toString(null);
  13018. * // => ''
  13019. *
  13020. * _.toString(-0);
  13021. * // => '-0'
  13022. *
  13023. * _.toString([1, 2, 3]);
  13024. * // => '1,2,3'
  13025. */
  13026. function toString(value) {
  13027. return value == null ? '' : baseToString(value);
  13028. }
  13029. /*------------------------------------------------------------------------*/
  13030. /**
  13031. * Assigns own enumerable string keyed properties of source objects to the
  13032. * destination object. Source objects are applied from left to right.
  13033. * Subsequent sources overwrite property assignments of previous sources.
  13034. *
  13035. * **Note:** This method mutates `object` and is loosely based on
  13036. * [`Object.assign`](https://mdn.io/Object/assign).
  13037. *
  13038. * @static
  13039. * @memberOf _
  13040. * @since 0.10.0
  13041. * @category Object
  13042. * @param {Object} object The destination object.
  13043. * @param {...Object} [sources] The source objects.
  13044. * @returns {Object} Returns `object`.
  13045. * @see _.assignIn
  13046. * @example
  13047. *
  13048. * function Foo() {
  13049. * this.a = 1;
  13050. * }
  13051. *
  13052. * function Bar() {
  13053. * this.c = 3;
  13054. * }
  13055. *
  13056. * Foo.prototype.b = 2;
  13057. * Bar.prototype.d = 4;
  13058. *
  13059. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13060. * // => { 'a': 1, 'c': 3 }
  13061. */
  13062. var assign = createAssigner(function(object, source) {
  13063. if (isPrototype(source) || isArrayLike(source)) {
  13064. copyObject(source, keys(source), object);
  13065. return;
  13066. }
  13067. for (var key in source) {
  13068. if (hasOwnProperty.call(source, key)) {
  13069. assignValue(object, key, source[key]);
  13070. }
  13071. }
  13072. });
  13073. /**
  13074. * This method is like `_.assign` except that it iterates over own and
  13075. * inherited source properties.
  13076. *
  13077. * **Note:** This method mutates `object`.
  13078. *
  13079. * @static
  13080. * @memberOf _
  13081. * @since 4.0.0
  13082. * @alias extend
  13083. * @category Object
  13084. * @param {Object} object The destination object.
  13085. * @param {...Object} [sources] The source objects.
  13086. * @returns {Object} Returns `object`.
  13087. * @see _.assign
  13088. * @example
  13089. *
  13090. * function Foo() {
  13091. * this.a = 1;
  13092. * }
  13093. *
  13094. * function Bar() {
  13095. * this.c = 3;
  13096. * }
  13097. *
  13098. * Foo.prototype.b = 2;
  13099. * Bar.prototype.d = 4;
  13100. *
  13101. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13102. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13103. */
  13104. var assignIn = createAssigner(function(object, source) {
  13105. copyObject(source, keysIn(source), object);
  13106. });
  13107. /**
  13108. * This method is like `_.assignIn` except that it accepts `customizer`
  13109. * which is invoked to produce the assigned values. If `customizer` returns
  13110. * `undefined`, assignment is handled by the method instead. The `customizer`
  13111. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13112. *
  13113. * **Note:** This method mutates `object`.
  13114. *
  13115. * @static
  13116. * @memberOf _
  13117. * @since 4.0.0
  13118. * @alias extendWith
  13119. * @category Object
  13120. * @param {Object} object The destination object.
  13121. * @param {...Object} sources The source objects.
  13122. * @param {Function} [customizer] The function to customize assigned values.
  13123. * @returns {Object} Returns `object`.
  13124. * @see _.assignWith
  13125. * @example
  13126. *
  13127. * function customizer(objValue, srcValue) {
  13128. * return _.isUndefined(objValue) ? srcValue : objValue;
  13129. * }
  13130. *
  13131. * var defaults = _.partialRight(_.assignInWith, customizer);
  13132. *
  13133. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13134. * // => { 'a': 1, 'b': 2 }
  13135. */
  13136. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13137. copyObject(source, keysIn(source), object, customizer);
  13138. });
  13139. /**
  13140. * This method is like `_.assign` except that it accepts `customizer`
  13141. * which is invoked to produce the assigned values. If `customizer` returns
  13142. * `undefined`, assignment is handled by the method instead. The `customizer`
  13143. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13144. *
  13145. * **Note:** This method mutates `object`.
  13146. *
  13147. * @static
  13148. * @memberOf _
  13149. * @since 4.0.0
  13150. * @category Object
  13151. * @param {Object} object The destination object.
  13152. * @param {...Object} sources The source objects.
  13153. * @param {Function} [customizer] The function to customize assigned values.
  13154. * @returns {Object} Returns `object`.
  13155. * @see _.assignInWith
  13156. * @example
  13157. *
  13158. * function customizer(objValue, srcValue) {
  13159. * return _.isUndefined(objValue) ? srcValue : objValue;
  13160. * }
  13161. *
  13162. * var defaults = _.partialRight(_.assignWith, customizer);
  13163. *
  13164. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13165. * // => { 'a': 1, 'b': 2 }
  13166. */
  13167. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13168. copyObject(source, keys(source), object, customizer);
  13169. });
  13170. /**
  13171. * Creates an array of values corresponding to `paths` of `object`.
  13172. *
  13173. * @static
  13174. * @memberOf _
  13175. * @since 1.0.0
  13176. * @category Object
  13177. * @param {Object} object The object to iterate over.
  13178. * @param {...(string|string[])} [paths] The property paths to pick.
  13179. * @returns {Array} Returns the picked values.
  13180. * @example
  13181. *
  13182. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13183. *
  13184. * _.at(object, ['a[0].b.c', 'a[1]']);
  13185. * // => [3, 4]
  13186. */
  13187. var at = flatRest(baseAt);
  13188. /**
  13189. * Creates an object that inherits from the `prototype` object. If a
  13190. * `properties` object is given, its own enumerable string keyed properties
  13191. * are assigned to the created object.
  13192. *
  13193. * @static
  13194. * @memberOf _
  13195. * @since 2.3.0
  13196. * @category Object
  13197. * @param {Object} prototype The object to inherit from.
  13198. * @param {Object} [properties] The properties to assign to the object.
  13199. * @returns {Object} Returns the new object.
  13200. * @example
  13201. *
  13202. * function Shape() {
  13203. * this.x = 0;
  13204. * this.y = 0;
  13205. * }
  13206. *
  13207. * function Circle() {
  13208. * Shape.call(this);
  13209. * }
  13210. *
  13211. * Circle.prototype = _.create(Shape.prototype, {
  13212. * 'constructor': Circle
  13213. * });
  13214. *
  13215. * var circle = new Circle;
  13216. * circle instanceof Circle;
  13217. * // => true
  13218. *
  13219. * circle instanceof Shape;
  13220. * // => true
  13221. */
  13222. function create(prototype, properties) {
  13223. var result = baseCreate(prototype);
  13224. return properties == null ? result : baseAssign(result, properties);
  13225. }
  13226. /**
  13227. * Assigns own and inherited enumerable string keyed properties of source
  13228. * objects to the destination object for all destination properties that
  13229. * resolve to `undefined`. Source objects are applied from left to right.
  13230. * Once a property is set, additional values of the same property are ignored.
  13231. *
  13232. * **Note:** This method mutates `object`.
  13233. *
  13234. * @static
  13235. * @since 0.1.0
  13236. * @memberOf _
  13237. * @category Object
  13238. * @param {Object} object The destination object.
  13239. * @param {...Object} [sources] The source objects.
  13240. * @returns {Object} Returns `object`.
  13241. * @see _.defaultsDeep
  13242. * @example
  13243. *
  13244. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13245. * // => { 'a': 1, 'b': 2 }
  13246. */
  13247. var defaults = baseRest(function(object, sources) {
  13248. object = Object(object);
  13249. var index = -1;
  13250. var length = sources.length;
  13251. var guard = length > 2 ? sources[2] : undefined;
  13252. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13253. length = 1;
  13254. }
  13255. while (++index < length) {
  13256. var source = sources[index];
  13257. var props = keysIn(source);
  13258. var propsIndex = -1;
  13259. var propsLength = props.length;
  13260. while (++propsIndex < propsLength) {
  13261. var key = props[propsIndex];
  13262. var value = object[key];
  13263. if (value === undefined ||
  13264. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13265. object[key] = source[key];
  13266. }
  13267. }
  13268. }
  13269. return object;
  13270. });
  13271. /**
  13272. * This method is like `_.defaults` except that it recursively assigns
  13273. * default properties.
  13274. *
  13275. * **Note:** This method mutates `object`.
  13276. *
  13277. * @static
  13278. * @memberOf _
  13279. * @since 3.10.0
  13280. * @category Object
  13281. * @param {Object} object The destination object.
  13282. * @param {...Object} [sources] The source objects.
  13283. * @returns {Object} Returns `object`.
  13284. * @see _.defaults
  13285. * @example
  13286. *
  13287. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13288. * // => { 'a': { 'b': 2, 'c': 3 } }
  13289. */
  13290. var defaultsDeep = baseRest(function(args) {
  13291. args.push(undefined, customDefaultsMerge);
  13292. return apply(mergeWith, undefined, args);
  13293. });
  13294. /**
  13295. * This method is like `_.find` except that it returns the key of the first
  13296. * element `predicate` returns truthy for instead of the element itself.
  13297. *
  13298. * @static
  13299. * @memberOf _
  13300. * @since 1.1.0
  13301. * @category Object
  13302. * @param {Object} object The object to inspect.
  13303. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13304. * @returns {string|undefined} Returns the key of the matched element,
  13305. * else `undefined`.
  13306. * @example
  13307. *
  13308. * var users = {
  13309. * 'barney': { 'age': 36, 'active': true },
  13310. * 'fred': { 'age': 40, 'active': false },
  13311. * 'pebbles': { 'age': 1, 'active': true }
  13312. * };
  13313. *
  13314. * _.findKey(users, function(o) { return o.age < 40; });
  13315. * // => 'barney' (iteration order is not guaranteed)
  13316. *
  13317. * // The `_.matches` iteratee shorthand.
  13318. * _.findKey(users, { 'age': 1, 'active': true });
  13319. * // => 'pebbles'
  13320. *
  13321. * // The `_.matchesProperty` iteratee shorthand.
  13322. * _.findKey(users, ['active', false]);
  13323. * // => 'fred'
  13324. *
  13325. * // The `_.property` iteratee shorthand.
  13326. * _.findKey(users, 'active');
  13327. * // => 'barney'
  13328. */
  13329. function findKey(object, predicate) {
  13330. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13331. }
  13332. /**
  13333. * This method is like `_.findKey` except that it iterates over elements of
  13334. * a collection in the opposite order.
  13335. *
  13336. * @static
  13337. * @memberOf _
  13338. * @since 2.0.0
  13339. * @category Object
  13340. * @param {Object} object The object to inspect.
  13341. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13342. * @returns {string|undefined} Returns the key of the matched element,
  13343. * else `undefined`.
  13344. * @example
  13345. *
  13346. * var users = {
  13347. * 'barney': { 'age': 36, 'active': true },
  13348. * 'fred': { 'age': 40, 'active': false },
  13349. * 'pebbles': { 'age': 1, 'active': true }
  13350. * };
  13351. *
  13352. * _.findLastKey(users, function(o) { return o.age < 40; });
  13353. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13354. *
  13355. * // The `_.matches` iteratee shorthand.
  13356. * _.findLastKey(users, { 'age': 36, 'active': true });
  13357. * // => 'barney'
  13358. *
  13359. * // The `_.matchesProperty` iteratee shorthand.
  13360. * _.findLastKey(users, ['active', false]);
  13361. * // => 'fred'
  13362. *
  13363. * // The `_.property` iteratee shorthand.
  13364. * _.findLastKey(users, 'active');
  13365. * // => 'pebbles'
  13366. */
  13367. function findLastKey(object, predicate) {
  13368. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13369. }
  13370. /**
  13371. * Iterates over own and inherited enumerable string keyed properties of an
  13372. * object and invokes `iteratee` for each property. The iteratee is invoked
  13373. * with three arguments: (value, key, object). Iteratee functions may exit
  13374. * iteration early by explicitly returning `false`.
  13375. *
  13376. * @static
  13377. * @memberOf _
  13378. * @since 0.3.0
  13379. * @category Object
  13380. * @param {Object} object The object to iterate over.
  13381. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13382. * @returns {Object} Returns `object`.
  13383. * @see _.forInRight
  13384. * @example
  13385. *
  13386. * function Foo() {
  13387. * this.a = 1;
  13388. * this.b = 2;
  13389. * }
  13390. *
  13391. * Foo.prototype.c = 3;
  13392. *
  13393. * _.forIn(new Foo, function(value, key) {
  13394. * console.log(key);
  13395. * });
  13396. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13397. */
  13398. function forIn(object, iteratee) {
  13399. return object == null
  13400. ? object
  13401. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13402. }
  13403. /**
  13404. * This method is like `_.forIn` except that it iterates over properties of
  13405. * `object` in the opposite order.
  13406. *
  13407. * @static
  13408. * @memberOf _
  13409. * @since 2.0.0
  13410. * @category Object
  13411. * @param {Object} object The object to iterate over.
  13412. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13413. * @returns {Object} Returns `object`.
  13414. * @see _.forIn
  13415. * @example
  13416. *
  13417. * function Foo() {
  13418. * this.a = 1;
  13419. * this.b = 2;
  13420. * }
  13421. *
  13422. * Foo.prototype.c = 3;
  13423. *
  13424. * _.forInRight(new Foo, function(value, key) {
  13425. * console.log(key);
  13426. * });
  13427. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13428. */
  13429. function forInRight(object, iteratee) {
  13430. return object == null
  13431. ? object
  13432. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13433. }
  13434. /**
  13435. * Iterates over own enumerable string keyed properties of an object and
  13436. * invokes `iteratee` for each property. The iteratee is invoked with three
  13437. * arguments: (value, key, object). Iteratee functions may exit iteration
  13438. * early by explicitly returning `false`.
  13439. *
  13440. * @static
  13441. * @memberOf _
  13442. * @since 0.3.0
  13443. * @category Object
  13444. * @param {Object} object The object to iterate over.
  13445. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13446. * @returns {Object} Returns `object`.
  13447. * @see _.forOwnRight
  13448. * @example
  13449. *
  13450. * function Foo() {
  13451. * this.a = 1;
  13452. * this.b = 2;
  13453. * }
  13454. *
  13455. * Foo.prototype.c = 3;
  13456. *
  13457. * _.forOwn(new Foo, function(value, key) {
  13458. * console.log(key);
  13459. * });
  13460. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13461. */
  13462. function forOwn(object, iteratee) {
  13463. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13464. }
  13465. /**
  13466. * This method is like `_.forOwn` except that it iterates over properties of
  13467. * `object` in the opposite order.
  13468. *
  13469. * @static
  13470. * @memberOf _
  13471. * @since 2.0.0
  13472. * @category Object
  13473. * @param {Object} object The object to iterate over.
  13474. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13475. * @returns {Object} Returns `object`.
  13476. * @see _.forOwn
  13477. * @example
  13478. *
  13479. * function Foo() {
  13480. * this.a = 1;
  13481. * this.b = 2;
  13482. * }
  13483. *
  13484. * Foo.prototype.c = 3;
  13485. *
  13486. * _.forOwnRight(new Foo, function(value, key) {
  13487. * console.log(key);
  13488. * });
  13489. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13490. */
  13491. function forOwnRight(object, iteratee) {
  13492. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13493. }
  13494. /**
  13495. * Creates an array of function property names from own enumerable properties
  13496. * of `object`.
  13497. *
  13498. * @static
  13499. * @since 0.1.0
  13500. * @memberOf _
  13501. * @category Object
  13502. * @param {Object} object The object to inspect.
  13503. * @returns {Array} Returns the function names.
  13504. * @see _.functionsIn
  13505. * @example
  13506. *
  13507. * function Foo() {
  13508. * this.a = _.constant('a');
  13509. * this.b = _.constant('b');
  13510. * }
  13511. *
  13512. * Foo.prototype.c = _.constant('c');
  13513. *
  13514. * _.functions(new Foo);
  13515. * // => ['a', 'b']
  13516. */
  13517. function functions(object) {
  13518. return object == null ? [] : baseFunctions(object, keys(object));
  13519. }
  13520. /**
  13521. * Creates an array of function property names from own and inherited
  13522. * enumerable properties of `object`.
  13523. *
  13524. * @static
  13525. * @memberOf _
  13526. * @since 4.0.0
  13527. * @category Object
  13528. * @param {Object} object The object to inspect.
  13529. * @returns {Array} Returns the function names.
  13530. * @see _.functions
  13531. * @example
  13532. *
  13533. * function Foo() {
  13534. * this.a = _.constant('a');
  13535. * this.b = _.constant('b');
  13536. * }
  13537. *
  13538. * Foo.prototype.c = _.constant('c');
  13539. *
  13540. * _.functionsIn(new Foo);
  13541. * // => ['a', 'b', 'c']
  13542. */
  13543. function functionsIn(object) {
  13544. return object == null ? [] : baseFunctions(object, keysIn(object));
  13545. }
  13546. /**
  13547. * Gets the value at `path` of `object`. If the resolved value is
  13548. * `undefined`, the `defaultValue` is returned in its place.
  13549. *
  13550. * @static
  13551. * @memberOf _
  13552. * @since 3.7.0
  13553. * @category Object
  13554. * @param {Object} object The object to query.
  13555. * @param {Array|string} path The path of the property to get.
  13556. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13557. * @returns {*} Returns the resolved value.
  13558. * @example
  13559. *
  13560. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13561. *
  13562. * _.get(object, 'a[0].b.c');
  13563. * // => 3
  13564. *
  13565. * _.get(object, ['a', '0', 'b', 'c']);
  13566. * // => 3
  13567. *
  13568. * _.get(object, 'a.b.c', 'default');
  13569. * // => 'default'
  13570. */
  13571. function get(object, path, defaultValue) {
  13572. var result = object == null ? undefined : baseGet(object, path);
  13573. return result === undefined ? defaultValue : result;
  13574. }
  13575. /**
  13576. * Checks if `path` is a direct property of `object`.
  13577. *
  13578. * @static
  13579. * @since 0.1.0
  13580. * @memberOf _
  13581. * @category Object
  13582. * @param {Object} object The object to query.
  13583. * @param {Array|string} path The path to check.
  13584. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13585. * @example
  13586. *
  13587. * var object = { 'a': { 'b': 2 } };
  13588. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13589. *
  13590. * _.has(object, 'a');
  13591. * // => true
  13592. *
  13593. * _.has(object, 'a.b');
  13594. * // => true
  13595. *
  13596. * _.has(object, ['a', 'b']);
  13597. * // => true
  13598. *
  13599. * _.has(other, 'a');
  13600. * // => false
  13601. */
  13602. function has(object, path) {
  13603. return object != null && hasPath(object, path, baseHas);
  13604. }
  13605. /**
  13606. * Checks if `path` is a direct or inherited property of `object`.
  13607. *
  13608. * @static
  13609. * @memberOf _
  13610. * @since 4.0.0
  13611. * @category Object
  13612. * @param {Object} object The object to query.
  13613. * @param {Array|string} path The path to check.
  13614. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13615. * @example
  13616. *
  13617. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13618. *
  13619. * _.hasIn(object, 'a');
  13620. * // => true
  13621. *
  13622. * _.hasIn(object, 'a.b');
  13623. * // => true
  13624. *
  13625. * _.hasIn(object, ['a', 'b']);
  13626. * // => true
  13627. *
  13628. * _.hasIn(object, 'b');
  13629. * // => false
  13630. */
  13631. function hasIn(object, path) {
  13632. return object != null && hasPath(object, path, baseHasIn);
  13633. }
  13634. /**
  13635. * Creates an object composed of the inverted keys and values of `object`.
  13636. * If `object` contains duplicate values, subsequent values overwrite
  13637. * property assignments of previous values.
  13638. *
  13639. * @static
  13640. * @memberOf _
  13641. * @since 0.7.0
  13642. * @category Object
  13643. * @param {Object} object The object to invert.
  13644. * @returns {Object} Returns the new inverted object.
  13645. * @example
  13646. *
  13647. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13648. *
  13649. * _.invert(object);
  13650. * // => { '1': 'c', '2': 'b' }
  13651. */
  13652. var invert = createInverter(function(result, value, key) {
  13653. if (value != null &&
  13654. typeof value.toString != 'function') {
  13655. value = nativeObjectToString.call(value);
  13656. }
  13657. result[value] = key;
  13658. }, constant(identity));
  13659. /**
  13660. * This method is like `_.invert` except that the inverted object is generated
  13661. * from the results of running each element of `object` thru `iteratee`. The
  13662. * corresponding inverted value of each inverted key is an array of keys
  13663. * responsible for generating the inverted value. The iteratee is invoked
  13664. * with one argument: (value).
  13665. *
  13666. * @static
  13667. * @memberOf _
  13668. * @since 4.1.0
  13669. * @category Object
  13670. * @param {Object} object The object to invert.
  13671. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13672. * @returns {Object} Returns the new inverted object.
  13673. * @example
  13674. *
  13675. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13676. *
  13677. * _.invertBy(object);
  13678. * // => { '1': ['a', 'c'], '2': ['b'] }
  13679. *
  13680. * _.invertBy(object, function(value) {
  13681. * return 'group' + value;
  13682. * });
  13683. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13684. */
  13685. var invertBy = createInverter(function(result, value, key) {
  13686. if (value != null &&
  13687. typeof value.toString != 'function') {
  13688. value = nativeObjectToString.call(value);
  13689. }
  13690. if (hasOwnProperty.call(result, value)) {
  13691. result[value].push(key);
  13692. } else {
  13693. result[value] = [key];
  13694. }
  13695. }, getIteratee);
  13696. /**
  13697. * Invokes the method at `path` of `object`.
  13698. *
  13699. * @static
  13700. * @memberOf _
  13701. * @since 4.0.0
  13702. * @category Object
  13703. * @param {Object} object The object to query.
  13704. * @param {Array|string} path The path of the method to invoke.
  13705. * @param {...*} [args] The arguments to invoke the method with.
  13706. * @returns {*} Returns the result of the invoked method.
  13707. * @example
  13708. *
  13709. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13710. *
  13711. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13712. * // => [2, 3]
  13713. */
  13714. var invoke = baseRest(baseInvoke);
  13715. /**
  13716. * Creates an array of the own enumerable property names of `object`.
  13717. *
  13718. * **Note:** Non-object values are coerced to objects. See the
  13719. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13720. * for more details.
  13721. *
  13722. * @static
  13723. * @since 0.1.0
  13724. * @memberOf _
  13725. * @category Object
  13726. * @param {Object} object The object to query.
  13727. * @returns {Array} Returns the array of property names.
  13728. * @example
  13729. *
  13730. * function Foo() {
  13731. * this.a = 1;
  13732. * this.b = 2;
  13733. * }
  13734. *
  13735. * Foo.prototype.c = 3;
  13736. *
  13737. * _.keys(new Foo);
  13738. * // => ['a', 'b'] (iteration order is not guaranteed)
  13739. *
  13740. * _.keys('hi');
  13741. * // => ['0', '1']
  13742. */
  13743. function keys(object) {
  13744. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13745. }
  13746. /**
  13747. * Creates an array of the own and inherited enumerable property names of `object`.
  13748. *
  13749. * **Note:** Non-object values are coerced to objects.
  13750. *
  13751. * @static
  13752. * @memberOf _
  13753. * @since 3.0.0
  13754. * @category Object
  13755. * @param {Object} object The object to query.
  13756. * @returns {Array} Returns the array of property names.
  13757. * @example
  13758. *
  13759. * function Foo() {
  13760. * this.a = 1;
  13761. * this.b = 2;
  13762. * }
  13763. *
  13764. * Foo.prototype.c = 3;
  13765. *
  13766. * _.keysIn(new Foo);
  13767. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13768. */
  13769. function keysIn(object) {
  13770. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13771. }
  13772. /**
  13773. * The opposite of `_.mapValues`; this method creates an object with the
  13774. * same values as `object` and keys generated by running each own enumerable
  13775. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13776. * with three arguments: (value, key, object).
  13777. *
  13778. * @static
  13779. * @memberOf _
  13780. * @since 3.8.0
  13781. * @category Object
  13782. * @param {Object} object The object to iterate over.
  13783. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13784. * @returns {Object} Returns the new mapped object.
  13785. * @see _.mapValues
  13786. * @example
  13787. *
  13788. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13789. * return key + value;
  13790. * });
  13791. * // => { 'a1': 1, 'b2': 2 }
  13792. */
  13793. function mapKeys(object, iteratee) {
  13794. var result = {};
  13795. iteratee = getIteratee(iteratee, 3);
  13796. baseForOwn(object, function(value, key, object) {
  13797. baseAssignValue(result, iteratee(value, key, object), value);
  13798. });
  13799. return result;
  13800. }
  13801. /**
  13802. * Creates an object with the same keys as `object` and values generated
  13803. * by running each own enumerable string keyed property of `object` thru
  13804. * `iteratee`. The iteratee is invoked with three arguments:
  13805. * (value, key, object).
  13806. *
  13807. * @static
  13808. * @memberOf _
  13809. * @since 2.4.0
  13810. * @category Object
  13811. * @param {Object} object The object to iterate over.
  13812. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13813. * @returns {Object} Returns the new mapped object.
  13814. * @see _.mapKeys
  13815. * @example
  13816. *
  13817. * var users = {
  13818. * 'fred': { 'user': 'fred', 'age': 40 },
  13819. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13820. * };
  13821. *
  13822. * _.mapValues(users, function(o) { return o.age; });
  13823. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13824. *
  13825. * // The `_.property` iteratee shorthand.
  13826. * _.mapValues(users, 'age');
  13827. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13828. */
  13829. function mapValues(object, iteratee) {
  13830. var result = {};
  13831. iteratee = getIteratee(iteratee, 3);
  13832. baseForOwn(object, function(value, key, object) {
  13833. baseAssignValue(result, key, iteratee(value, key, object));
  13834. });
  13835. return result;
  13836. }
  13837. /**
  13838. * This method is like `_.assign` except that it recursively merges own and
  13839. * inherited enumerable string keyed properties of source objects into the
  13840. * destination object. Source properties that resolve to `undefined` are
  13841. * skipped if a destination value exists. Array and plain object properties
  13842. * are merged recursively. Other objects and value types are overridden by
  13843. * assignment. Source objects are applied from left to right. Subsequent
  13844. * sources overwrite property assignments of previous sources.
  13845. *
  13846. * **Note:** This method mutates `object`.
  13847. *
  13848. * @static
  13849. * @memberOf _
  13850. * @since 0.5.0
  13851. * @category Object
  13852. * @param {Object} object The destination object.
  13853. * @param {...Object} [sources] The source objects.
  13854. * @returns {Object} Returns `object`.
  13855. * @example
  13856. *
  13857. * var object = {
  13858. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13859. * };
  13860. *
  13861. * var other = {
  13862. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13863. * };
  13864. *
  13865. * _.merge(object, other);
  13866. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13867. */
  13868. var merge = createAssigner(function(object, source, srcIndex) {
  13869. baseMerge(object, source, srcIndex);
  13870. });
  13871. /**
  13872. * This method is like `_.merge` except that it accepts `customizer` which
  13873. * is invoked to produce the merged values of the destination and source
  13874. * properties. If `customizer` returns `undefined`, merging is handled by the
  13875. * method instead. The `customizer` is invoked with six arguments:
  13876. * (objValue, srcValue, key, object, source, stack).
  13877. *
  13878. * **Note:** This method mutates `object`.
  13879. *
  13880. * @static
  13881. * @memberOf _
  13882. * @since 4.0.0
  13883. * @category Object
  13884. * @param {Object} object The destination object.
  13885. * @param {...Object} sources The source objects.
  13886. * @param {Function} customizer The function to customize assigned values.
  13887. * @returns {Object} Returns `object`.
  13888. * @example
  13889. *
  13890. * function customizer(objValue, srcValue) {
  13891. * if (_.isArray(objValue)) {
  13892. * return objValue.concat(srcValue);
  13893. * }
  13894. * }
  13895. *
  13896. * var object = { 'a': [1], 'b': [2] };
  13897. * var other = { 'a': [3], 'b': [4] };
  13898. *
  13899. * _.mergeWith(object, other, customizer);
  13900. * // => { 'a': [1, 3], 'b': [2, 4] }
  13901. */
  13902. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13903. baseMerge(object, source, srcIndex, customizer);
  13904. });
  13905. /**
  13906. * The opposite of `_.pick`; this method creates an object composed of the
  13907. * own and inherited enumerable property paths of `object` that are not omitted.
  13908. *
  13909. * **Note:** This method is considerably slower than `_.pick`.
  13910. *
  13911. * @static
  13912. * @since 0.1.0
  13913. * @memberOf _
  13914. * @category Object
  13915. * @param {Object} object The source object.
  13916. * @param {...(string|string[])} [paths] The property paths to omit.
  13917. * @returns {Object} Returns the new object.
  13918. * @example
  13919. *
  13920. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13921. *
  13922. * _.omit(object, ['a', 'c']);
  13923. * // => { 'b': '2' }
  13924. */
  13925. var omit = flatRest(function(object, paths) {
  13926. var result = {};
  13927. if (object == null) {
  13928. return result;
  13929. }
  13930. var isDeep = false;
  13931. paths = arrayMap(paths, function(path) {
  13932. path = castPath(path, object);
  13933. isDeep || (isDeep = path.length > 1);
  13934. return path;
  13935. });
  13936. copyObject(object, getAllKeysIn(object), result);
  13937. if (isDeep) {
  13938. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13939. }
  13940. var length = paths.length;
  13941. while (length--) {
  13942. baseUnset(result, paths[length]);
  13943. }
  13944. return result;
  13945. });
  13946. /**
  13947. * The opposite of `_.pickBy`; this method creates an object composed of
  13948. * the own and inherited enumerable string keyed properties of `object` that
  13949. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13950. * arguments: (value, key).
  13951. *
  13952. * @static
  13953. * @memberOf _
  13954. * @since 4.0.0
  13955. * @category Object
  13956. * @param {Object} object The source object.
  13957. * @param {Function} [predicate=_.identity] The function invoked per property.
  13958. * @returns {Object} Returns the new object.
  13959. * @example
  13960. *
  13961. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13962. *
  13963. * _.omitBy(object, _.isNumber);
  13964. * // => { 'b': '2' }
  13965. */
  13966. function omitBy(object, predicate) {
  13967. return pickBy(object, negate(getIteratee(predicate)));
  13968. }
  13969. /**
  13970. * Creates an object composed of the picked `object` properties.
  13971. *
  13972. * @static
  13973. * @since 0.1.0
  13974. * @memberOf _
  13975. * @category Object
  13976. * @param {Object} object The source object.
  13977. * @param {...(string|string[])} [paths] The property paths to pick.
  13978. * @returns {Object} Returns the new object.
  13979. * @example
  13980. *
  13981. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13982. *
  13983. * _.pick(object, ['a', 'c']);
  13984. * // => { 'a': 1, 'c': 3 }
  13985. */
  13986. var pick = flatRest(function(object, paths) {
  13987. return object == null ? {} : basePick(object, paths);
  13988. });
  13989. /**
  13990. * Creates an object composed of the `object` properties `predicate` returns
  13991. * truthy for. The predicate is invoked with two arguments: (value, key).
  13992. *
  13993. * @static
  13994. * @memberOf _
  13995. * @since 4.0.0
  13996. * @category Object
  13997. * @param {Object} object The source object.
  13998. * @param {Function} [predicate=_.identity] The function invoked per property.
  13999. * @returns {Object} Returns the new object.
  14000. * @example
  14001. *
  14002. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14003. *
  14004. * _.pickBy(object, _.isNumber);
  14005. * // => { 'a': 1, 'c': 3 }
  14006. */
  14007. function pickBy(object, predicate) {
  14008. if (object == null) {
  14009. return {};
  14010. }
  14011. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14012. return [prop];
  14013. });
  14014. predicate = getIteratee(predicate);
  14015. return basePickBy(object, props, function(value, path) {
  14016. return predicate(value, path[0]);
  14017. });
  14018. }
  14019. /**
  14020. * This method is like `_.get` except that if the resolved value is a
  14021. * function it's invoked with the `this` binding of its parent object and
  14022. * its result is returned.
  14023. *
  14024. * @static
  14025. * @since 0.1.0
  14026. * @memberOf _
  14027. * @category Object
  14028. * @param {Object} object The object to query.
  14029. * @param {Array|string} path The path of the property to resolve.
  14030. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14031. * @returns {*} Returns the resolved value.
  14032. * @example
  14033. *
  14034. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14035. *
  14036. * _.result(object, 'a[0].b.c1');
  14037. * // => 3
  14038. *
  14039. * _.result(object, 'a[0].b.c2');
  14040. * // => 4
  14041. *
  14042. * _.result(object, 'a[0].b.c3', 'default');
  14043. * // => 'default'
  14044. *
  14045. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14046. * // => 'default'
  14047. */
  14048. function result(object, path, defaultValue) {
  14049. path = castPath(path, object);
  14050. var index = -1,
  14051. length = path.length;
  14052. // Ensure the loop is entered when path is empty.
  14053. if (!length) {
  14054. length = 1;
  14055. object = undefined;
  14056. }
  14057. while (++index < length) {
  14058. var value = object == null ? undefined : object[toKey(path[index])];
  14059. if (value === undefined) {
  14060. index = length;
  14061. value = defaultValue;
  14062. }
  14063. object = isFunction(value) ? value.call(object) : value;
  14064. }
  14065. return object;
  14066. }
  14067. /**
  14068. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14069. * it's created. Arrays are created for missing index properties while objects
  14070. * are created for all other missing properties. Use `_.setWith` to customize
  14071. * `path` creation.
  14072. *
  14073. * **Note:** This method mutates `object`.
  14074. *
  14075. * @static
  14076. * @memberOf _
  14077. * @since 3.7.0
  14078. * @category Object
  14079. * @param {Object} object The object to modify.
  14080. * @param {Array|string} path The path of the property to set.
  14081. * @param {*} value The value to set.
  14082. * @returns {Object} Returns `object`.
  14083. * @example
  14084. *
  14085. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14086. *
  14087. * _.set(object, 'a[0].b.c', 4);
  14088. * console.log(object.a[0].b.c);
  14089. * // => 4
  14090. *
  14091. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14092. * console.log(object.x[0].y.z);
  14093. * // => 5
  14094. */
  14095. function set(object, path, value) {
  14096. return object == null ? object : baseSet(object, path, value);
  14097. }
  14098. /**
  14099. * This method is like `_.set` except that it accepts `customizer` which is
  14100. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14101. * path creation is handled by the method instead. The `customizer` is invoked
  14102. * with three arguments: (nsValue, key, nsObject).
  14103. *
  14104. * **Note:** This method mutates `object`.
  14105. *
  14106. * @static
  14107. * @memberOf _
  14108. * @since 4.0.0
  14109. * @category Object
  14110. * @param {Object} object The object to modify.
  14111. * @param {Array|string} path The path of the property to set.
  14112. * @param {*} value The value to set.
  14113. * @param {Function} [customizer] The function to customize assigned values.
  14114. * @returns {Object} Returns `object`.
  14115. * @example
  14116. *
  14117. * var object = {};
  14118. *
  14119. * _.setWith(object, '[0][1]', 'a', Object);
  14120. * // => { '0': { '1': 'a' } }
  14121. */
  14122. function setWith(object, path, value, customizer) {
  14123. customizer = typeof customizer == 'function' ? customizer : undefined;
  14124. return object == null ? object : baseSet(object, path, value, customizer);
  14125. }
  14126. /**
  14127. * Creates an array of own enumerable string keyed-value pairs for `object`
  14128. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14129. * entries are returned.
  14130. *
  14131. * @static
  14132. * @memberOf _
  14133. * @since 4.0.0
  14134. * @alias entries
  14135. * @category Object
  14136. * @param {Object} object The object to query.
  14137. * @returns {Array} Returns the key-value pairs.
  14138. * @example
  14139. *
  14140. * function Foo() {
  14141. * this.a = 1;
  14142. * this.b = 2;
  14143. * }
  14144. *
  14145. * Foo.prototype.c = 3;
  14146. *
  14147. * _.toPairs(new Foo);
  14148. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14149. */
  14150. var toPairs = createToPairs(keys);
  14151. /**
  14152. * Creates an array of own and inherited enumerable string keyed-value pairs
  14153. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14154. * or set, its entries are returned.
  14155. *
  14156. * @static
  14157. * @memberOf _
  14158. * @since 4.0.0
  14159. * @alias entriesIn
  14160. * @category Object
  14161. * @param {Object} object The object to query.
  14162. * @returns {Array} Returns the key-value pairs.
  14163. * @example
  14164. *
  14165. * function Foo() {
  14166. * this.a = 1;
  14167. * this.b = 2;
  14168. * }
  14169. *
  14170. * Foo.prototype.c = 3;
  14171. *
  14172. * _.toPairsIn(new Foo);
  14173. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14174. */
  14175. var toPairsIn = createToPairs(keysIn);
  14176. /**
  14177. * An alternative to `_.reduce`; this method transforms `object` to a new
  14178. * `accumulator` object which is the result of running each of its own
  14179. * enumerable string keyed properties thru `iteratee`, with each invocation
  14180. * potentially mutating the `accumulator` object. If `accumulator` is not
  14181. * provided, a new object with the same `[[Prototype]]` will be used. The
  14182. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14183. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14184. *
  14185. * @static
  14186. * @memberOf _
  14187. * @since 1.3.0
  14188. * @category Object
  14189. * @param {Object} object The object to iterate over.
  14190. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14191. * @param {*} [accumulator] The custom accumulator value.
  14192. * @returns {*} Returns the accumulated value.
  14193. * @example
  14194. *
  14195. * _.transform([2, 3, 4], function(result, n) {
  14196. * result.push(n *= n);
  14197. * return n % 2 == 0;
  14198. * }, []);
  14199. * // => [4, 9]
  14200. *
  14201. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14202. * (result[value] || (result[value] = [])).push(key);
  14203. * }, {});
  14204. * // => { '1': ['a', 'c'], '2': ['b'] }
  14205. */
  14206. function transform(object, iteratee, accumulator) {
  14207. var isArr = isArray(object),
  14208. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14209. iteratee = getIteratee(iteratee, 4);
  14210. if (accumulator == null) {
  14211. var Ctor = object && object.constructor;
  14212. if (isArrLike) {
  14213. accumulator = isArr ? new Ctor : [];
  14214. }
  14215. else if (isObject(object)) {
  14216. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14217. }
  14218. else {
  14219. accumulator = {};
  14220. }
  14221. }
  14222. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14223. return iteratee(accumulator, value, index, object);
  14224. });
  14225. return accumulator;
  14226. }
  14227. /**
  14228. * Removes the property at `path` of `object`.
  14229. *
  14230. * **Note:** This method mutates `object`.
  14231. *
  14232. * @static
  14233. * @memberOf _
  14234. * @since 4.0.0
  14235. * @category Object
  14236. * @param {Object} object The object to modify.
  14237. * @param {Array|string} path The path of the property to unset.
  14238. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14239. * @example
  14240. *
  14241. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14242. * _.unset(object, 'a[0].b.c');
  14243. * // => true
  14244. *
  14245. * console.log(object);
  14246. * // => { 'a': [{ 'b': {} }] };
  14247. *
  14248. * _.unset(object, ['a', '0', 'b', 'c']);
  14249. * // => true
  14250. *
  14251. * console.log(object);
  14252. * // => { 'a': [{ 'b': {} }] };
  14253. */
  14254. function unset(object, path) {
  14255. return object == null ? true : baseUnset(object, path);
  14256. }
  14257. /**
  14258. * This method is like `_.set` except that accepts `updater` to produce the
  14259. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14260. * is invoked with one argument: (value).
  14261. *
  14262. * **Note:** This method mutates `object`.
  14263. *
  14264. * @static
  14265. * @memberOf _
  14266. * @since 4.6.0
  14267. * @category Object
  14268. * @param {Object} object The object to modify.
  14269. * @param {Array|string} path The path of the property to set.
  14270. * @param {Function} updater The function to produce the updated value.
  14271. * @returns {Object} Returns `object`.
  14272. * @example
  14273. *
  14274. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14275. *
  14276. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14277. * console.log(object.a[0].b.c);
  14278. * // => 9
  14279. *
  14280. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14281. * console.log(object.x[0].y.z);
  14282. * // => 0
  14283. */
  14284. function update(object, path, updater) {
  14285. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14286. }
  14287. /**
  14288. * This method is like `_.update` except that it accepts `customizer` which is
  14289. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14290. * path creation is handled by the method instead. The `customizer` is invoked
  14291. * with three arguments: (nsValue, key, nsObject).
  14292. *
  14293. * **Note:** This method mutates `object`.
  14294. *
  14295. * @static
  14296. * @memberOf _
  14297. * @since 4.6.0
  14298. * @category Object
  14299. * @param {Object} object The object to modify.
  14300. * @param {Array|string} path The path of the property to set.
  14301. * @param {Function} updater The function to produce the updated value.
  14302. * @param {Function} [customizer] The function to customize assigned values.
  14303. * @returns {Object} Returns `object`.
  14304. * @example
  14305. *
  14306. * var object = {};
  14307. *
  14308. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14309. * // => { '0': { '1': 'a' } }
  14310. */
  14311. function updateWith(object, path, updater, customizer) {
  14312. customizer = typeof customizer == 'function' ? customizer : undefined;
  14313. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14314. }
  14315. /**
  14316. * Creates an array of the own enumerable string keyed property values of `object`.
  14317. *
  14318. * **Note:** Non-object values are coerced to objects.
  14319. *
  14320. * @static
  14321. * @since 0.1.0
  14322. * @memberOf _
  14323. * @category Object
  14324. * @param {Object} object The object to query.
  14325. * @returns {Array} Returns the array of property values.
  14326. * @example
  14327. *
  14328. * function Foo() {
  14329. * this.a = 1;
  14330. * this.b = 2;
  14331. * }
  14332. *
  14333. * Foo.prototype.c = 3;
  14334. *
  14335. * _.values(new Foo);
  14336. * // => [1, 2] (iteration order is not guaranteed)
  14337. *
  14338. * _.values('hi');
  14339. * // => ['h', 'i']
  14340. */
  14341. function values(object) {
  14342. return object == null ? [] : baseValues(object, keys(object));
  14343. }
  14344. /**
  14345. * Creates an array of the own and inherited enumerable string keyed property
  14346. * values of `object`.
  14347. *
  14348. * **Note:** Non-object values are coerced to objects.
  14349. *
  14350. * @static
  14351. * @memberOf _
  14352. * @since 3.0.0
  14353. * @category Object
  14354. * @param {Object} object The object to query.
  14355. * @returns {Array} Returns the array of property values.
  14356. * @example
  14357. *
  14358. * function Foo() {
  14359. * this.a = 1;
  14360. * this.b = 2;
  14361. * }
  14362. *
  14363. * Foo.prototype.c = 3;
  14364. *
  14365. * _.valuesIn(new Foo);
  14366. * // => [1, 2, 3] (iteration order is not guaranteed)
  14367. */
  14368. function valuesIn(object) {
  14369. return object == null ? [] : baseValues(object, keysIn(object));
  14370. }
  14371. /*------------------------------------------------------------------------*/
  14372. /**
  14373. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14374. *
  14375. * @static
  14376. * @memberOf _
  14377. * @since 4.0.0
  14378. * @category Number
  14379. * @param {number} number The number to clamp.
  14380. * @param {number} [lower] The lower bound.
  14381. * @param {number} upper The upper bound.
  14382. * @returns {number} Returns the clamped number.
  14383. * @example
  14384. *
  14385. * _.clamp(-10, -5, 5);
  14386. * // => -5
  14387. *
  14388. * _.clamp(10, -5, 5);
  14389. * // => 5
  14390. */
  14391. function clamp(number, lower, upper) {
  14392. if (upper === undefined) {
  14393. upper = lower;
  14394. lower = undefined;
  14395. }
  14396. if (upper !== undefined) {
  14397. upper = toNumber(upper);
  14398. upper = upper === upper ? upper : 0;
  14399. }
  14400. if (lower !== undefined) {
  14401. lower = toNumber(lower);
  14402. lower = lower === lower ? lower : 0;
  14403. }
  14404. return baseClamp(toNumber(number), lower, upper);
  14405. }
  14406. /**
  14407. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14408. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14409. * If `start` is greater than `end` the params are swapped to support
  14410. * negative ranges.
  14411. *
  14412. * @static
  14413. * @memberOf _
  14414. * @since 3.3.0
  14415. * @category Number
  14416. * @param {number} number The number to check.
  14417. * @param {number} [start=0] The start of the range.
  14418. * @param {number} end The end of the range.
  14419. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14420. * @see _.range, _.rangeRight
  14421. * @example
  14422. *
  14423. * _.inRange(3, 2, 4);
  14424. * // => true
  14425. *
  14426. * _.inRange(4, 8);
  14427. * // => true
  14428. *
  14429. * _.inRange(4, 2);
  14430. * // => false
  14431. *
  14432. * _.inRange(2, 2);
  14433. * // => false
  14434. *
  14435. * _.inRange(1.2, 2);
  14436. * // => true
  14437. *
  14438. * _.inRange(5.2, 4);
  14439. * // => false
  14440. *
  14441. * _.inRange(-3, -2, -6);
  14442. * // => true
  14443. */
  14444. function inRange(number, start, end) {
  14445. start = toFinite(start);
  14446. if (end === undefined) {
  14447. end = start;
  14448. start = 0;
  14449. } else {
  14450. end = toFinite(end);
  14451. }
  14452. number = toNumber(number);
  14453. return baseInRange(number, start, end);
  14454. }
  14455. /**
  14456. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14457. * If only one argument is provided a number between `0` and the given number
  14458. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14459. * floats, a floating-point number is returned instead of an integer.
  14460. *
  14461. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14462. * floating-point values which can produce unexpected results.
  14463. *
  14464. * @static
  14465. * @memberOf _
  14466. * @since 0.7.0
  14467. * @category Number
  14468. * @param {number} [lower=0] The lower bound.
  14469. * @param {number} [upper=1] The upper bound.
  14470. * @param {boolean} [floating] Specify returning a floating-point number.
  14471. * @returns {number} Returns the random number.
  14472. * @example
  14473. *
  14474. * _.random(0, 5);
  14475. * // => an integer between 0 and 5
  14476. *
  14477. * _.random(5);
  14478. * // => also an integer between 0 and 5
  14479. *
  14480. * _.random(5, true);
  14481. * // => a floating-point number between 0 and 5
  14482. *
  14483. * _.random(1.2, 5.2);
  14484. * // => a floating-point number between 1.2 and 5.2
  14485. */
  14486. function random(lower, upper, floating) {
  14487. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14488. upper = floating = undefined;
  14489. }
  14490. if (floating === undefined) {
  14491. if (typeof upper == 'boolean') {
  14492. floating = upper;
  14493. upper = undefined;
  14494. }
  14495. else if (typeof lower == 'boolean') {
  14496. floating = lower;
  14497. lower = undefined;
  14498. }
  14499. }
  14500. if (lower === undefined && upper === undefined) {
  14501. lower = 0;
  14502. upper = 1;
  14503. }
  14504. else {
  14505. lower = toFinite(lower);
  14506. if (upper === undefined) {
  14507. upper = lower;
  14508. lower = 0;
  14509. } else {
  14510. upper = toFinite(upper);
  14511. }
  14512. }
  14513. if (lower > upper) {
  14514. var temp = lower;
  14515. lower = upper;
  14516. upper = temp;
  14517. }
  14518. if (floating || lower % 1 || upper % 1) {
  14519. var rand = nativeRandom();
  14520. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14521. }
  14522. return baseRandom(lower, upper);
  14523. }
  14524. /*------------------------------------------------------------------------*/
  14525. /**
  14526. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14527. *
  14528. * @static
  14529. * @memberOf _
  14530. * @since 3.0.0
  14531. * @category String
  14532. * @param {string} [string=''] The string to convert.
  14533. * @returns {string} Returns the camel cased string.
  14534. * @example
  14535. *
  14536. * _.camelCase('Foo Bar');
  14537. * // => 'fooBar'
  14538. *
  14539. * _.camelCase('--foo-bar--');
  14540. * // => 'fooBar'
  14541. *
  14542. * _.camelCase('__FOO_BAR__');
  14543. * // => 'fooBar'
  14544. */
  14545. var camelCase = createCompounder(function(result, word, index) {
  14546. word = word.toLowerCase();
  14547. return result + (index ? capitalize(word) : word);
  14548. });
  14549. /**
  14550. * Converts the first character of `string` to upper case and the remaining
  14551. * to lower case.
  14552. *
  14553. * @static
  14554. * @memberOf _
  14555. * @since 3.0.0
  14556. * @category String
  14557. * @param {string} [string=''] The string to capitalize.
  14558. * @returns {string} Returns the capitalized string.
  14559. * @example
  14560. *
  14561. * _.capitalize('FRED');
  14562. * // => 'Fred'
  14563. */
  14564. function capitalize(string) {
  14565. return upperFirst(toString(string).toLowerCase());
  14566. }
  14567. /**
  14568. * Deburrs `string` by converting
  14569. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14570. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14571. * letters to basic Latin letters and removing
  14572. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14573. *
  14574. * @static
  14575. * @memberOf _
  14576. * @since 3.0.0
  14577. * @category String
  14578. * @param {string} [string=''] The string to deburr.
  14579. * @returns {string} Returns the deburred string.
  14580. * @example
  14581. *
  14582. * _.deburr('déjà vu');
  14583. * // => 'deja vu'
  14584. */
  14585. function deburr(string) {
  14586. string = toString(string);
  14587. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14588. }
  14589. /**
  14590. * Checks if `string` ends with the given target string.
  14591. *
  14592. * @static
  14593. * @memberOf _
  14594. * @since 3.0.0
  14595. * @category String
  14596. * @param {string} [string=''] The string to inspect.
  14597. * @param {string} [target] The string to search for.
  14598. * @param {number} [position=string.length] The position to search up to.
  14599. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14600. * else `false`.
  14601. * @example
  14602. *
  14603. * _.endsWith('abc', 'c');
  14604. * // => true
  14605. *
  14606. * _.endsWith('abc', 'b');
  14607. * // => false
  14608. *
  14609. * _.endsWith('abc', 'b', 2);
  14610. * // => true
  14611. */
  14612. function endsWith(string, target, position) {
  14613. string = toString(string);
  14614. target = baseToString(target);
  14615. var length = string.length;
  14616. position = position === undefined
  14617. ? length
  14618. : baseClamp(toInteger(position), 0, length);
  14619. var end = position;
  14620. position -= target.length;
  14621. return position >= 0 && string.slice(position, end) == target;
  14622. }
  14623. /**
  14624. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14625. * corresponding HTML entities.
  14626. *
  14627. * **Note:** No other characters are escaped. To escape additional
  14628. * characters use a third-party library like [_he_](https://mths.be/he).
  14629. *
  14630. * Though the ">" character is escaped for symmetry, characters like
  14631. * ">" and "/" don't need escaping in HTML and have no special meaning
  14632. * unless they're part of a tag or unquoted attribute value. See
  14633. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14634. * (under "semi-related fun fact") for more details.
  14635. *
  14636. * When working with HTML you should always
  14637. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14638. * XSS vectors.
  14639. *
  14640. * @static
  14641. * @since 0.1.0
  14642. * @memberOf _
  14643. * @category String
  14644. * @param {string} [string=''] The string to escape.
  14645. * @returns {string} Returns the escaped string.
  14646. * @example
  14647. *
  14648. * _.escape('fred, barney, & pebbles');
  14649. * // => 'fred, barney, &amp; pebbles'
  14650. */
  14651. function escape(string) {
  14652. string = toString(string);
  14653. return (string && reHasUnescapedHtml.test(string))
  14654. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14655. : string;
  14656. }
  14657. /**
  14658. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14659. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14660. *
  14661. * @static
  14662. * @memberOf _
  14663. * @since 3.0.0
  14664. * @category String
  14665. * @param {string} [string=''] The string to escape.
  14666. * @returns {string} Returns the escaped string.
  14667. * @example
  14668. *
  14669. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14670. * // => '\[lodash\]\(https://lodash\.com/\)'
  14671. */
  14672. function escapeRegExp(string) {
  14673. string = toString(string);
  14674. return (string && reHasRegExpChar.test(string))
  14675. ? string.replace(reRegExpChar, '\\$&')
  14676. : string;
  14677. }
  14678. /**
  14679. * Converts `string` to
  14680. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14681. *
  14682. * @static
  14683. * @memberOf _
  14684. * @since 3.0.0
  14685. * @category String
  14686. * @param {string} [string=''] The string to convert.
  14687. * @returns {string} Returns the kebab cased string.
  14688. * @example
  14689. *
  14690. * _.kebabCase('Foo Bar');
  14691. * // => 'foo-bar'
  14692. *
  14693. * _.kebabCase('fooBar');
  14694. * // => 'foo-bar'
  14695. *
  14696. * _.kebabCase('__FOO_BAR__');
  14697. * // => 'foo-bar'
  14698. */
  14699. var kebabCase = createCompounder(function(result, word, index) {
  14700. return result + (index ? '-' : '') + word.toLowerCase();
  14701. });
  14702. /**
  14703. * Converts `string`, as space separated words, to lower case.
  14704. *
  14705. * @static
  14706. * @memberOf _
  14707. * @since 4.0.0
  14708. * @category String
  14709. * @param {string} [string=''] The string to convert.
  14710. * @returns {string} Returns the lower cased string.
  14711. * @example
  14712. *
  14713. * _.lowerCase('--Foo-Bar--');
  14714. * // => 'foo bar'
  14715. *
  14716. * _.lowerCase('fooBar');
  14717. * // => 'foo bar'
  14718. *
  14719. * _.lowerCase('__FOO_BAR__');
  14720. * // => 'foo bar'
  14721. */
  14722. var lowerCase = createCompounder(function(result, word, index) {
  14723. return result + (index ? ' ' : '') + word.toLowerCase();
  14724. });
  14725. /**
  14726. * Converts the first character of `string` to lower case.
  14727. *
  14728. * @static
  14729. * @memberOf _
  14730. * @since 4.0.0
  14731. * @category String
  14732. * @param {string} [string=''] The string to convert.
  14733. * @returns {string} Returns the converted string.
  14734. * @example
  14735. *
  14736. * _.lowerFirst('Fred');
  14737. * // => 'fred'
  14738. *
  14739. * _.lowerFirst('FRED');
  14740. * // => 'fRED'
  14741. */
  14742. var lowerFirst = createCaseFirst('toLowerCase');
  14743. /**
  14744. * Pads `string` on the left and right sides if it's shorter than `length`.
  14745. * Padding characters are truncated if they can't be evenly divided by `length`.
  14746. *
  14747. * @static
  14748. * @memberOf _
  14749. * @since 3.0.0
  14750. * @category String
  14751. * @param {string} [string=''] The string to pad.
  14752. * @param {number} [length=0] The padding length.
  14753. * @param {string} [chars=' '] The string used as padding.
  14754. * @returns {string} Returns the padded string.
  14755. * @example
  14756. *
  14757. * _.pad('abc', 8);
  14758. * // => ' abc '
  14759. *
  14760. * _.pad('abc', 8, '_-');
  14761. * // => '_-abc_-_'
  14762. *
  14763. * _.pad('abc', 3);
  14764. * // => 'abc'
  14765. */
  14766. function pad(string, length, chars) {
  14767. string = toString(string);
  14768. length = toInteger(length);
  14769. var strLength = length ? stringSize(string) : 0;
  14770. if (!length || strLength >= length) {
  14771. return string;
  14772. }
  14773. var mid = (length - strLength) / 2;
  14774. return (
  14775. createPadding(nativeFloor(mid), chars) +
  14776. string +
  14777. createPadding(nativeCeil(mid), chars)
  14778. );
  14779. }
  14780. /**
  14781. * Pads `string` on the right side if it's shorter than `length`. Padding
  14782. * characters are truncated if they exceed `length`.
  14783. *
  14784. * @static
  14785. * @memberOf _
  14786. * @since 4.0.0
  14787. * @category String
  14788. * @param {string} [string=''] The string to pad.
  14789. * @param {number} [length=0] The padding length.
  14790. * @param {string} [chars=' '] The string used as padding.
  14791. * @returns {string} Returns the padded string.
  14792. * @example
  14793. *
  14794. * _.padEnd('abc', 6);
  14795. * // => 'abc '
  14796. *
  14797. * _.padEnd('abc', 6, '_-');
  14798. * // => 'abc_-_'
  14799. *
  14800. * _.padEnd('abc', 3);
  14801. * // => 'abc'
  14802. */
  14803. function padEnd(string, length, chars) {
  14804. string = toString(string);
  14805. length = toInteger(length);
  14806. var strLength = length ? stringSize(string) : 0;
  14807. return (length && strLength < length)
  14808. ? (string + createPadding(length - strLength, chars))
  14809. : string;
  14810. }
  14811. /**
  14812. * Pads `string` on the left side if it's shorter than `length`. Padding
  14813. * characters are truncated if they exceed `length`.
  14814. *
  14815. * @static
  14816. * @memberOf _
  14817. * @since 4.0.0
  14818. * @category String
  14819. * @param {string} [string=''] The string to pad.
  14820. * @param {number} [length=0] The padding length.
  14821. * @param {string} [chars=' '] The string used as padding.
  14822. * @returns {string} Returns the padded string.
  14823. * @example
  14824. *
  14825. * _.padStart('abc', 6);
  14826. * // => ' abc'
  14827. *
  14828. * _.padStart('abc', 6, '_-');
  14829. * // => '_-_abc'
  14830. *
  14831. * _.padStart('abc', 3);
  14832. * // => 'abc'
  14833. */
  14834. function padStart(string, length, chars) {
  14835. string = toString(string);
  14836. length = toInteger(length);
  14837. var strLength = length ? stringSize(string) : 0;
  14838. return (length && strLength < length)
  14839. ? (createPadding(length - strLength, chars) + string)
  14840. : string;
  14841. }
  14842. /**
  14843. * Converts `string` to an integer of the specified radix. If `radix` is
  14844. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14845. * hexadecimal, in which case a `radix` of `16` is used.
  14846. *
  14847. * **Note:** This method aligns with the
  14848. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14849. *
  14850. * @static
  14851. * @memberOf _
  14852. * @since 1.1.0
  14853. * @category String
  14854. * @param {string} string The string to convert.
  14855. * @param {number} [radix=10] The radix to interpret `value` by.
  14856. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14857. * @returns {number} Returns the converted integer.
  14858. * @example
  14859. *
  14860. * _.parseInt('08');
  14861. * // => 8
  14862. *
  14863. * _.map(['6', '08', '10'], _.parseInt);
  14864. * // => [6, 8, 10]
  14865. */
  14866. function parseInt(string, radix, guard) {
  14867. if (guard || radix == null) {
  14868. radix = 0;
  14869. } else if (radix) {
  14870. radix = +radix;
  14871. }
  14872. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14873. }
  14874. /**
  14875. * Repeats the given string `n` times.
  14876. *
  14877. * @static
  14878. * @memberOf _
  14879. * @since 3.0.0
  14880. * @category String
  14881. * @param {string} [string=''] The string to repeat.
  14882. * @param {number} [n=1] The number of times to repeat the string.
  14883. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14884. * @returns {string} Returns the repeated string.
  14885. * @example
  14886. *
  14887. * _.repeat('*', 3);
  14888. * // => '***'
  14889. *
  14890. * _.repeat('abc', 2);
  14891. * // => 'abcabc'
  14892. *
  14893. * _.repeat('abc', 0);
  14894. * // => ''
  14895. */
  14896. function repeat(string, n, guard) {
  14897. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14898. n = 1;
  14899. } else {
  14900. n = toInteger(n);
  14901. }
  14902. return baseRepeat(toString(string), n);
  14903. }
  14904. /**
  14905. * Replaces matches for `pattern` in `string` with `replacement`.
  14906. *
  14907. * **Note:** This method is based on
  14908. * [`String#replace`](https://mdn.io/String/replace).
  14909. *
  14910. * @static
  14911. * @memberOf _
  14912. * @since 4.0.0
  14913. * @category String
  14914. * @param {string} [string=''] The string to modify.
  14915. * @param {RegExp|string} pattern The pattern to replace.
  14916. * @param {Function|string} replacement The match replacement.
  14917. * @returns {string} Returns the modified string.
  14918. * @example
  14919. *
  14920. * _.replace('Hi Fred', 'Fred', 'Barney');
  14921. * // => 'Hi Barney'
  14922. */
  14923. function replace() {
  14924. var args = arguments,
  14925. string = toString(args[0]);
  14926. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14927. }
  14928. /**
  14929. * Converts `string` to
  14930. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14931. *
  14932. * @static
  14933. * @memberOf _
  14934. * @since 3.0.0
  14935. * @category String
  14936. * @param {string} [string=''] The string to convert.
  14937. * @returns {string} Returns the snake cased string.
  14938. * @example
  14939. *
  14940. * _.snakeCase('Foo Bar');
  14941. * // => 'foo_bar'
  14942. *
  14943. * _.snakeCase('fooBar');
  14944. * // => 'foo_bar'
  14945. *
  14946. * _.snakeCase('--FOO-BAR--');
  14947. * // => 'foo_bar'
  14948. */
  14949. var snakeCase = createCompounder(function(result, word, index) {
  14950. return result + (index ? '_' : '') + word.toLowerCase();
  14951. });
  14952. /**
  14953. * Splits `string` by `separator`.
  14954. *
  14955. * **Note:** This method is based on
  14956. * [`String#split`](https://mdn.io/String/split).
  14957. *
  14958. * @static
  14959. * @memberOf _
  14960. * @since 4.0.0
  14961. * @category String
  14962. * @param {string} [string=''] The string to split.
  14963. * @param {RegExp|string} separator The separator pattern to split by.
  14964. * @param {number} [limit] The length to truncate results to.
  14965. * @returns {Array} Returns the string segments.
  14966. * @example
  14967. *
  14968. * _.split('a-b-c', '-', 2);
  14969. * // => ['a', 'b']
  14970. */
  14971. function split(string, separator, limit) {
  14972. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14973. separator = limit = undefined;
  14974. }
  14975. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14976. if (!limit) {
  14977. return [];
  14978. }
  14979. string = toString(string);
  14980. if (string && (
  14981. typeof separator == 'string' ||
  14982. (separator != null && !isRegExp(separator))
  14983. )) {
  14984. separator = baseToString(separator);
  14985. if (!separator && hasUnicode(string)) {
  14986. return castSlice(stringToArray(string), 0, limit);
  14987. }
  14988. }
  14989. return string.split(separator, limit);
  14990. }
  14991. /**
  14992. * Converts `string` to
  14993. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14994. *
  14995. * @static
  14996. * @memberOf _
  14997. * @since 3.1.0
  14998. * @category String
  14999. * @param {string} [string=''] The string to convert.
  15000. * @returns {string} Returns the start cased string.
  15001. * @example
  15002. *
  15003. * _.startCase('--foo-bar--');
  15004. * // => 'Foo Bar'
  15005. *
  15006. * _.startCase('fooBar');
  15007. * // => 'Foo Bar'
  15008. *
  15009. * _.startCase('__FOO_BAR__');
  15010. * // => 'FOO BAR'
  15011. */
  15012. var startCase = createCompounder(function(result, word, index) {
  15013. return result + (index ? ' ' : '') + upperFirst(word);
  15014. });
  15015. /**
  15016. * Checks if `string` starts with the given target string.
  15017. *
  15018. * @static
  15019. * @memberOf _
  15020. * @since 3.0.0
  15021. * @category String
  15022. * @param {string} [string=''] The string to inspect.
  15023. * @param {string} [target] The string to search for.
  15024. * @param {number} [position=0] The position to search from.
  15025. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15026. * else `false`.
  15027. * @example
  15028. *
  15029. * _.startsWith('abc', 'a');
  15030. * // => true
  15031. *
  15032. * _.startsWith('abc', 'b');
  15033. * // => false
  15034. *
  15035. * _.startsWith('abc', 'b', 1);
  15036. * // => true
  15037. */
  15038. function startsWith(string, target, position) {
  15039. string = toString(string);
  15040. position = position == null
  15041. ? 0
  15042. : baseClamp(toInteger(position), 0, string.length);
  15043. target = baseToString(target);
  15044. return string.slice(position, position + target.length) == target;
  15045. }
  15046. /**
  15047. * Creates a compiled template function that can interpolate data properties
  15048. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15049. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15050. * properties may be accessed as free variables in the template. If a setting
  15051. * object is given, it takes precedence over `_.templateSettings` values.
  15052. *
  15053. * **Note:** In the development build `_.template` utilizes
  15054. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15055. * for easier debugging.
  15056. *
  15057. * For more information on precompiling templates see
  15058. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15059. *
  15060. * For more information on Chrome extension sandboxes see
  15061. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15062. *
  15063. * @static
  15064. * @since 0.1.0
  15065. * @memberOf _
  15066. * @category String
  15067. * @param {string} [string=''] The template string.
  15068. * @param {Object} [options={}] The options object.
  15069. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15070. * The HTML "escape" delimiter.
  15071. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15072. * The "evaluate" delimiter.
  15073. * @param {Object} [options.imports=_.templateSettings.imports]
  15074. * An object to import into the template as free variables.
  15075. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15076. * The "interpolate" delimiter.
  15077. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15078. * The sourceURL of the compiled template.
  15079. * @param {string} [options.variable='obj']
  15080. * The data object variable name.
  15081. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15082. * @returns {Function} Returns the compiled template function.
  15083. * @example
  15084. *
  15085. * // Use the "interpolate" delimiter to create a compiled template.
  15086. * var compiled = _.template('hello <%= user %>!');
  15087. * compiled({ 'user': 'fred' });
  15088. * // => 'hello fred!'
  15089. *
  15090. * // Use the HTML "escape" delimiter to escape data property values.
  15091. * var compiled = _.template('<b><%- value %></b>');
  15092. * compiled({ 'value': '<script>' });
  15093. * // => '<b>&lt;script&gt;</b>'
  15094. *
  15095. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15096. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15097. * compiled({ 'users': ['fred', 'barney'] });
  15098. * // => '<li>fred</li><li>barney</li>'
  15099. *
  15100. * // Use the internal `print` function in "evaluate" delimiters.
  15101. * var compiled = _.template('<% print("hello " + user); %>!');
  15102. * compiled({ 'user': 'barney' });
  15103. * // => 'hello barney!'
  15104. *
  15105. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15106. * // Disable support by replacing the "interpolate" delimiter.
  15107. * var compiled = _.template('hello ${ user }!');
  15108. * compiled({ 'user': 'pebbles' });
  15109. * // => 'hello pebbles!'
  15110. *
  15111. * // Use backslashes to treat delimiters as plain text.
  15112. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15113. * compiled({ 'value': 'ignored' });
  15114. * // => '<%- value %>'
  15115. *
  15116. * // Use the `imports` option to import `jQuery` as `jq`.
  15117. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15118. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15119. * compiled({ 'users': ['fred', 'barney'] });
  15120. * // => '<li>fred</li><li>barney</li>'
  15121. *
  15122. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15123. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15124. * compiled(data);
  15125. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15126. *
  15127. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15128. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15129. * compiled.source;
  15130. * // => function(data) {
  15131. * // var __t, __p = '';
  15132. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15133. * // return __p;
  15134. * // }
  15135. *
  15136. * // Use custom template delimiters.
  15137. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15138. * var compiled = _.template('hello {{ user }}!');
  15139. * compiled({ 'user': 'mustache' });
  15140. * // => 'hello mustache!'
  15141. *
  15142. * // Use the `source` property to inline compiled templates for meaningful
  15143. * // line numbers in error messages and stack traces.
  15144. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15145. * var JST = {\
  15146. * "main": ' + _.template(mainText).source + '\
  15147. * };\
  15148. * ');
  15149. */
  15150. function template(string, options, guard) {
  15151. // Based on John Resig's `tmpl` implementation
  15152. // (http://ejohn.org/blog/javascript-micro-templating/)
  15153. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15154. var settings = lodash.templateSettings;
  15155. if (guard && isIterateeCall(string, options, guard)) {
  15156. options = undefined;
  15157. }
  15158. string = toString(string);
  15159. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15160. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15161. importsKeys = keys(imports),
  15162. importsValues = baseValues(imports, importsKeys);
  15163. var isEscaping,
  15164. isEvaluating,
  15165. index = 0,
  15166. interpolate = options.interpolate || reNoMatch,
  15167. source = "__p += '";
  15168. // Compile the regexp to match each delimiter.
  15169. var reDelimiters = RegExp(
  15170. (options.escape || reNoMatch).source + '|' +
  15171. interpolate.source + '|' +
  15172. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15173. (options.evaluate || reNoMatch).source + '|$'
  15174. , 'g');
  15175. // Use a sourceURL for easier debugging.
  15176. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15177. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15178. // and escape the comment, thus injecting code that gets evaled.
  15179. var sourceURL = '//# sourceURL=' +
  15180. (hasOwnProperty.call(options, 'sourceURL')
  15181. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15182. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15183. ) + '\n';
  15184. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15185. interpolateValue || (interpolateValue = esTemplateValue);
  15186. // Escape characters that can't be included in string literals.
  15187. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15188. // Replace delimiters with snippets.
  15189. if (escapeValue) {
  15190. isEscaping = true;
  15191. source += "' +\n__e(" + escapeValue + ") +\n'";
  15192. }
  15193. if (evaluateValue) {
  15194. isEvaluating = true;
  15195. source += "';\n" + evaluateValue + ";\n__p += '";
  15196. }
  15197. if (interpolateValue) {
  15198. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15199. }
  15200. index = offset + match.length;
  15201. // The JS engine embedded in Adobe products needs `match` returned in
  15202. // order to produce the correct `offset` value.
  15203. return match;
  15204. });
  15205. source += "';\n";
  15206. // If `variable` is not specified wrap a with-statement around the generated
  15207. // code to add the data object to the top of the scope chain.
  15208. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15209. if (!variable) {
  15210. source = 'with (obj) {\n' + source + '\n}\n';
  15211. }
  15212. // Throw an error if a forbidden character was found in `variable`, to prevent
  15213. // potential command injection attacks.
  15214. else if (reForbiddenIdentifierChars.test(variable)) {
  15215. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15216. }
  15217. // Cleanup code by stripping empty strings.
  15218. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15219. .replace(reEmptyStringMiddle, '$1')
  15220. .replace(reEmptyStringTrailing, '$1;');
  15221. // Frame code as the function body.
  15222. source = 'function(' + (variable || 'obj') + ') {\n' +
  15223. (variable
  15224. ? ''
  15225. : 'obj || (obj = {});\n'
  15226. ) +
  15227. "var __t, __p = ''" +
  15228. (isEscaping
  15229. ? ', __e = _.escape'
  15230. : ''
  15231. ) +
  15232. (isEvaluating
  15233. ? ', __j = Array.prototype.join;\n' +
  15234. "function print() { __p += __j.call(arguments, '') }\n"
  15235. : ';\n'
  15236. ) +
  15237. source +
  15238. 'return __p\n}';
  15239. var result = attempt(function() {
  15240. return Function(importsKeys, sourceURL + 'return ' + source)
  15241. .apply(undefined, importsValues);
  15242. });
  15243. // Provide the compiled function's source by its `toString` method or
  15244. // the `source` property as a convenience for inlining compiled templates.
  15245. result.source = source;
  15246. if (isError(result)) {
  15247. throw result;
  15248. }
  15249. return result;
  15250. }
  15251. /**
  15252. * Converts `string`, as a whole, to lower case just like
  15253. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15254. *
  15255. * @static
  15256. * @memberOf _
  15257. * @since 4.0.0
  15258. * @category String
  15259. * @param {string} [string=''] The string to convert.
  15260. * @returns {string} Returns the lower cased string.
  15261. * @example
  15262. *
  15263. * _.toLower('--Foo-Bar--');
  15264. * // => '--foo-bar--'
  15265. *
  15266. * _.toLower('fooBar');
  15267. * // => 'foobar'
  15268. *
  15269. * _.toLower('__FOO_BAR__');
  15270. * // => '__foo_bar__'
  15271. */
  15272. function toLower(value) {
  15273. return toString(value).toLowerCase();
  15274. }
  15275. /**
  15276. * Converts `string`, as a whole, to upper case just like
  15277. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15278. *
  15279. * @static
  15280. * @memberOf _
  15281. * @since 4.0.0
  15282. * @category String
  15283. * @param {string} [string=''] The string to convert.
  15284. * @returns {string} Returns the upper cased string.
  15285. * @example
  15286. *
  15287. * _.toUpper('--foo-bar--');
  15288. * // => '--FOO-BAR--'
  15289. *
  15290. * _.toUpper('fooBar');
  15291. * // => 'FOOBAR'
  15292. *
  15293. * _.toUpper('__foo_bar__');
  15294. * // => '__FOO_BAR__'
  15295. */
  15296. function toUpper(value) {
  15297. return toString(value).toUpperCase();
  15298. }
  15299. /**
  15300. * Removes leading and trailing whitespace or specified characters from `string`.
  15301. *
  15302. * @static
  15303. * @memberOf _
  15304. * @since 3.0.0
  15305. * @category String
  15306. * @param {string} [string=''] The string to trim.
  15307. * @param {string} [chars=whitespace] The characters to trim.
  15308. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15309. * @returns {string} Returns the trimmed string.
  15310. * @example
  15311. *
  15312. * _.trim(' abc ');
  15313. * // => 'abc'
  15314. *
  15315. * _.trim('-_-abc-_-', '_-');
  15316. * // => 'abc'
  15317. *
  15318. * _.map([' foo ', ' bar '], _.trim);
  15319. * // => ['foo', 'bar']
  15320. */
  15321. function trim(string, chars, guard) {
  15322. string = toString(string);
  15323. if (string && (guard || chars === undefined)) {
  15324. return baseTrim(string);
  15325. }
  15326. if (!string || !(chars = baseToString(chars))) {
  15327. return string;
  15328. }
  15329. var strSymbols = stringToArray(string),
  15330. chrSymbols = stringToArray(chars),
  15331. start = charsStartIndex(strSymbols, chrSymbols),
  15332. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15333. return castSlice(strSymbols, start, end).join('');
  15334. }
  15335. /**
  15336. * Removes trailing whitespace or specified characters from `string`.
  15337. *
  15338. * @static
  15339. * @memberOf _
  15340. * @since 4.0.0
  15341. * @category String
  15342. * @param {string} [string=''] The string to trim.
  15343. * @param {string} [chars=whitespace] The characters to trim.
  15344. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15345. * @returns {string} Returns the trimmed string.
  15346. * @example
  15347. *
  15348. * _.trimEnd(' abc ');
  15349. * // => ' abc'
  15350. *
  15351. * _.trimEnd('-_-abc-_-', '_-');
  15352. * // => '-_-abc'
  15353. */
  15354. function trimEnd(string, chars, guard) {
  15355. string = toString(string);
  15356. if (string && (guard || chars === undefined)) {
  15357. return string.slice(0, trimmedEndIndex(string) + 1);
  15358. }
  15359. if (!string || !(chars = baseToString(chars))) {
  15360. return string;
  15361. }
  15362. var strSymbols = stringToArray(string),
  15363. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15364. return castSlice(strSymbols, 0, end).join('');
  15365. }
  15366. /**
  15367. * Removes leading whitespace or specified characters from `string`.
  15368. *
  15369. * @static
  15370. * @memberOf _
  15371. * @since 4.0.0
  15372. * @category String
  15373. * @param {string} [string=''] The string to trim.
  15374. * @param {string} [chars=whitespace] The characters to trim.
  15375. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15376. * @returns {string} Returns the trimmed string.
  15377. * @example
  15378. *
  15379. * _.trimStart(' abc ');
  15380. * // => 'abc '
  15381. *
  15382. * _.trimStart('-_-abc-_-', '_-');
  15383. * // => 'abc-_-'
  15384. */
  15385. function trimStart(string, chars, guard) {
  15386. string = toString(string);
  15387. if (string && (guard || chars === undefined)) {
  15388. return string.replace(reTrimStart, '');
  15389. }
  15390. if (!string || !(chars = baseToString(chars))) {
  15391. return string;
  15392. }
  15393. var strSymbols = stringToArray(string),
  15394. start = charsStartIndex(strSymbols, stringToArray(chars));
  15395. return castSlice(strSymbols, start).join('');
  15396. }
  15397. /**
  15398. * Truncates `string` if it's longer than the given maximum string length.
  15399. * The last characters of the truncated string are replaced with the omission
  15400. * string which defaults to "...".
  15401. *
  15402. * @static
  15403. * @memberOf _
  15404. * @since 4.0.0
  15405. * @category String
  15406. * @param {string} [string=''] The string to truncate.
  15407. * @param {Object} [options={}] The options object.
  15408. * @param {number} [options.length=30] The maximum string length.
  15409. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15410. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15411. * @returns {string} Returns the truncated string.
  15412. * @example
  15413. *
  15414. * _.truncate('hi-diddly-ho there, neighborino');
  15415. * // => 'hi-diddly-ho there, neighbo...'
  15416. *
  15417. * _.truncate('hi-diddly-ho there, neighborino', {
  15418. * 'length': 24,
  15419. * 'separator': ' '
  15420. * });
  15421. * // => 'hi-diddly-ho there,...'
  15422. *
  15423. * _.truncate('hi-diddly-ho there, neighborino', {
  15424. * 'length': 24,
  15425. * 'separator': /,? +/
  15426. * });
  15427. * // => 'hi-diddly-ho there...'
  15428. *
  15429. * _.truncate('hi-diddly-ho there, neighborino', {
  15430. * 'omission': ' [...]'
  15431. * });
  15432. * // => 'hi-diddly-ho there, neig [...]'
  15433. */
  15434. function truncate(string, options) {
  15435. var length = DEFAULT_TRUNC_LENGTH,
  15436. omission = DEFAULT_TRUNC_OMISSION;
  15437. if (isObject(options)) {
  15438. var separator = 'separator' in options ? options.separator : separator;
  15439. length = 'length' in options ? toInteger(options.length) : length;
  15440. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15441. }
  15442. string = toString(string);
  15443. var strLength = string.length;
  15444. if (hasUnicode(string)) {
  15445. var strSymbols = stringToArray(string);
  15446. strLength = strSymbols.length;
  15447. }
  15448. if (length >= strLength) {
  15449. return string;
  15450. }
  15451. var end = length - stringSize(omission);
  15452. if (end < 1) {
  15453. return omission;
  15454. }
  15455. var result = strSymbols
  15456. ? castSlice(strSymbols, 0, end).join('')
  15457. : string.slice(0, end);
  15458. if (separator === undefined) {
  15459. return result + omission;
  15460. }
  15461. if (strSymbols) {
  15462. end += (result.length - end);
  15463. }
  15464. if (isRegExp(separator)) {
  15465. if (string.slice(end).search(separator)) {
  15466. var match,
  15467. substring = result;
  15468. if (!separator.global) {
  15469. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15470. }
  15471. separator.lastIndex = 0;
  15472. while ((match = separator.exec(substring))) {
  15473. var newEnd = match.index;
  15474. }
  15475. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15476. }
  15477. } else if (string.indexOf(baseToString(separator), end) != end) {
  15478. var index = result.lastIndexOf(separator);
  15479. if (index > -1) {
  15480. result = result.slice(0, index);
  15481. }
  15482. }
  15483. return result + omission;
  15484. }
  15485. /**
  15486. * The inverse of `_.escape`; this method converts the HTML entities
  15487. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15488. * their corresponding characters.
  15489. *
  15490. * **Note:** No other HTML entities are unescaped. To unescape additional
  15491. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15492. *
  15493. * @static
  15494. * @memberOf _
  15495. * @since 0.6.0
  15496. * @category String
  15497. * @param {string} [string=''] The string to unescape.
  15498. * @returns {string} Returns the unescaped string.
  15499. * @example
  15500. *
  15501. * _.unescape('fred, barney, &amp; pebbles');
  15502. * // => 'fred, barney, & pebbles'
  15503. */
  15504. function unescape(string) {
  15505. string = toString(string);
  15506. return (string && reHasEscapedHtml.test(string))
  15507. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15508. : string;
  15509. }
  15510. /**
  15511. * Converts `string`, as space separated words, to upper case.
  15512. *
  15513. * @static
  15514. * @memberOf _
  15515. * @since 4.0.0
  15516. * @category String
  15517. * @param {string} [string=''] The string to convert.
  15518. * @returns {string} Returns the upper cased string.
  15519. * @example
  15520. *
  15521. * _.upperCase('--foo-bar');
  15522. * // => 'FOO BAR'
  15523. *
  15524. * _.upperCase('fooBar');
  15525. * // => 'FOO BAR'
  15526. *
  15527. * _.upperCase('__foo_bar__');
  15528. * // => 'FOO BAR'
  15529. */
  15530. var upperCase = createCompounder(function(result, word, index) {
  15531. return result + (index ? ' ' : '') + word.toUpperCase();
  15532. });
  15533. /**
  15534. * Converts the first character of `string` to upper case.
  15535. *
  15536. * @static
  15537. * @memberOf _
  15538. * @since 4.0.0
  15539. * @category String
  15540. * @param {string} [string=''] The string to convert.
  15541. * @returns {string} Returns the converted string.
  15542. * @example
  15543. *
  15544. * _.upperFirst('fred');
  15545. * // => 'Fred'
  15546. *
  15547. * _.upperFirst('FRED');
  15548. * // => 'FRED'
  15549. */
  15550. var upperFirst = createCaseFirst('toUpperCase');
  15551. /**
  15552. * Splits `string` into an array of its words.
  15553. *
  15554. * @static
  15555. * @memberOf _
  15556. * @since 3.0.0
  15557. * @category String
  15558. * @param {string} [string=''] The string to inspect.
  15559. * @param {RegExp|string} [pattern] The pattern to match words.
  15560. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15561. * @returns {Array} Returns the words of `string`.
  15562. * @example
  15563. *
  15564. * _.words('fred, barney, & pebbles');
  15565. * // => ['fred', 'barney', 'pebbles']
  15566. *
  15567. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15568. * // => ['fred', 'barney', '&', 'pebbles']
  15569. */
  15570. function words(string, pattern, guard) {
  15571. string = toString(string);
  15572. pattern = guard ? undefined : pattern;
  15573. if (pattern === undefined) {
  15574. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15575. }
  15576. return string.match(pattern) || [];
  15577. }
  15578. /*------------------------------------------------------------------------*/
  15579. /**
  15580. * Attempts to invoke `func`, returning either the result or the caught error
  15581. * object. Any additional arguments are provided to `func` when it's invoked.
  15582. *
  15583. * @static
  15584. * @memberOf _
  15585. * @since 3.0.0
  15586. * @category Util
  15587. * @param {Function} func The function to attempt.
  15588. * @param {...*} [args] The arguments to invoke `func` with.
  15589. * @returns {*} Returns the `func` result or error object.
  15590. * @example
  15591. *
  15592. * // Avoid throwing errors for invalid selectors.
  15593. * var elements = _.attempt(function(selector) {
  15594. * return document.querySelectorAll(selector);
  15595. * }, '>_>');
  15596. *
  15597. * if (_.isError(elements)) {
  15598. * elements = [];
  15599. * }
  15600. */
  15601. var attempt = baseRest(function(func, args) {
  15602. try {
  15603. return apply(func, undefined, args);
  15604. } catch (e) {
  15605. return isError(e) ? e : new Error(e);
  15606. }
  15607. });
  15608. /**
  15609. * Binds methods of an object to the object itself, overwriting the existing
  15610. * method.
  15611. *
  15612. * **Note:** This method doesn't set the "length" property of bound functions.
  15613. *
  15614. * @static
  15615. * @since 0.1.0
  15616. * @memberOf _
  15617. * @category Util
  15618. * @param {Object} object The object to bind and assign the bound methods to.
  15619. * @param {...(string|string[])} methodNames The object method names to bind.
  15620. * @returns {Object} Returns `object`.
  15621. * @example
  15622. *
  15623. * var view = {
  15624. * 'label': 'docs',
  15625. * 'click': function() {
  15626. * console.log('clicked ' + this.label);
  15627. * }
  15628. * };
  15629. *
  15630. * _.bindAll(view, ['click']);
  15631. * jQuery(element).on('click', view.click);
  15632. * // => Logs 'clicked docs' when clicked.
  15633. */
  15634. var bindAll = flatRest(function(object, methodNames) {
  15635. arrayEach(methodNames, function(key) {
  15636. key = toKey(key);
  15637. baseAssignValue(object, key, bind(object[key], object));
  15638. });
  15639. return object;
  15640. });
  15641. /**
  15642. * Creates a function that iterates over `pairs` and invokes the corresponding
  15643. * function of the first predicate to return truthy. The predicate-function
  15644. * pairs are invoked with the `this` binding and arguments of the created
  15645. * function.
  15646. *
  15647. * @static
  15648. * @memberOf _
  15649. * @since 4.0.0
  15650. * @category Util
  15651. * @param {Array} pairs The predicate-function pairs.
  15652. * @returns {Function} Returns the new composite function.
  15653. * @example
  15654. *
  15655. * var func = _.cond([
  15656. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15657. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15658. * [_.stubTrue, _.constant('no match')]
  15659. * ]);
  15660. *
  15661. * func({ 'a': 1, 'b': 2 });
  15662. * // => 'matches A'
  15663. *
  15664. * func({ 'a': 0, 'b': 1 });
  15665. * // => 'matches B'
  15666. *
  15667. * func({ 'a': '1', 'b': '2' });
  15668. * // => 'no match'
  15669. */
  15670. function cond(pairs) {
  15671. var length = pairs == null ? 0 : pairs.length,
  15672. toIteratee = getIteratee();
  15673. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15674. if (typeof pair[1] != 'function') {
  15675. throw new TypeError(FUNC_ERROR_TEXT);
  15676. }
  15677. return [toIteratee(pair[0]), pair[1]];
  15678. });
  15679. return baseRest(function(args) {
  15680. var index = -1;
  15681. while (++index < length) {
  15682. var pair = pairs[index];
  15683. if (apply(pair[0], this, args)) {
  15684. return apply(pair[1], this, args);
  15685. }
  15686. }
  15687. });
  15688. }
  15689. /**
  15690. * Creates a function that invokes the predicate properties of `source` with
  15691. * the corresponding property values of a given object, returning `true` if
  15692. * all predicates return truthy, else `false`.
  15693. *
  15694. * **Note:** The created function is equivalent to `_.conformsTo` with
  15695. * `source` partially applied.
  15696. *
  15697. * @static
  15698. * @memberOf _
  15699. * @since 4.0.0
  15700. * @category Util
  15701. * @param {Object} source The object of property predicates to conform to.
  15702. * @returns {Function} Returns the new spec function.
  15703. * @example
  15704. *
  15705. * var objects = [
  15706. * { 'a': 2, 'b': 1 },
  15707. * { 'a': 1, 'b': 2 }
  15708. * ];
  15709. *
  15710. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15711. * // => [{ 'a': 1, 'b': 2 }]
  15712. */
  15713. function conforms(source) {
  15714. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15715. }
  15716. /**
  15717. * Creates a function that returns `value`.
  15718. *
  15719. * @static
  15720. * @memberOf _
  15721. * @since 2.4.0
  15722. * @category Util
  15723. * @param {*} value The value to return from the new function.
  15724. * @returns {Function} Returns the new constant function.
  15725. * @example
  15726. *
  15727. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15728. *
  15729. * console.log(objects);
  15730. * // => [{ 'a': 1 }, { 'a': 1 }]
  15731. *
  15732. * console.log(objects[0] === objects[1]);
  15733. * // => true
  15734. */
  15735. function constant(value) {
  15736. return function() {
  15737. return value;
  15738. };
  15739. }
  15740. /**
  15741. * Checks `value` to determine whether a default value should be returned in
  15742. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15743. * or `undefined`.
  15744. *
  15745. * @static
  15746. * @memberOf _
  15747. * @since 4.14.0
  15748. * @category Util
  15749. * @param {*} value The value to check.
  15750. * @param {*} defaultValue The default value.
  15751. * @returns {*} Returns the resolved value.
  15752. * @example
  15753. *
  15754. * _.defaultTo(1, 10);
  15755. * // => 1
  15756. *
  15757. * _.defaultTo(undefined, 10);
  15758. * // => 10
  15759. */
  15760. function defaultTo(value, defaultValue) {
  15761. return (value == null || value !== value) ? defaultValue : value;
  15762. }
  15763. /**
  15764. * Creates a function that returns the result of invoking the given functions
  15765. * with the `this` binding of the created function, where each successive
  15766. * invocation is supplied the return value of the previous.
  15767. *
  15768. * @static
  15769. * @memberOf _
  15770. * @since 3.0.0
  15771. * @category Util
  15772. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15773. * @returns {Function} Returns the new composite function.
  15774. * @see _.flowRight
  15775. * @example
  15776. *
  15777. * function square(n) {
  15778. * return n * n;
  15779. * }
  15780. *
  15781. * var addSquare = _.flow([_.add, square]);
  15782. * addSquare(1, 2);
  15783. * // => 9
  15784. */
  15785. var flow = createFlow();
  15786. /**
  15787. * This method is like `_.flow` except that it creates a function that
  15788. * invokes the given functions from right to left.
  15789. *
  15790. * @static
  15791. * @since 3.0.0
  15792. * @memberOf _
  15793. * @category Util
  15794. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15795. * @returns {Function} Returns the new composite function.
  15796. * @see _.flow
  15797. * @example
  15798. *
  15799. * function square(n) {
  15800. * return n * n;
  15801. * }
  15802. *
  15803. * var addSquare = _.flowRight([square, _.add]);
  15804. * addSquare(1, 2);
  15805. * // => 9
  15806. */
  15807. var flowRight = createFlow(true);
  15808. /**
  15809. * This method returns the first argument it receives.
  15810. *
  15811. * @static
  15812. * @since 0.1.0
  15813. * @memberOf _
  15814. * @category Util
  15815. * @param {*} value Any value.
  15816. * @returns {*} Returns `value`.
  15817. * @example
  15818. *
  15819. * var object = { 'a': 1 };
  15820. *
  15821. * console.log(_.identity(object) === object);
  15822. * // => true
  15823. */
  15824. function identity(value) {
  15825. return value;
  15826. }
  15827. /**
  15828. * Creates a function that invokes `func` with the arguments of the created
  15829. * function. If `func` is a property name, the created function returns the
  15830. * property value for a given element. If `func` is an array or object, the
  15831. * created function returns `true` for elements that contain the equivalent
  15832. * source properties, otherwise it returns `false`.
  15833. *
  15834. * @static
  15835. * @since 4.0.0
  15836. * @memberOf _
  15837. * @category Util
  15838. * @param {*} [func=_.identity] The value to convert to a callback.
  15839. * @returns {Function} Returns the callback.
  15840. * @example
  15841. *
  15842. * var users = [
  15843. * { 'user': 'barney', 'age': 36, 'active': true },
  15844. * { 'user': 'fred', 'age': 40, 'active': false }
  15845. * ];
  15846. *
  15847. * // The `_.matches` iteratee shorthand.
  15848. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15849. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15850. *
  15851. * // The `_.matchesProperty` iteratee shorthand.
  15852. * _.filter(users, _.iteratee(['user', 'fred']));
  15853. * // => [{ 'user': 'fred', 'age': 40 }]
  15854. *
  15855. * // The `_.property` iteratee shorthand.
  15856. * _.map(users, _.iteratee('user'));
  15857. * // => ['barney', 'fred']
  15858. *
  15859. * // Create custom iteratee shorthands.
  15860. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15861. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15862. * return func.test(string);
  15863. * };
  15864. * });
  15865. *
  15866. * _.filter(['abc', 'def'], /ef/);
  15867. * // => ['def']
  15868. */
  15869. function iteratee(func) {
  15870. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15871. }
  15872. /**
  15873. * Creates a function that performs a partial deep comparison between a given
  15874. * object and `source`, returning `true` if the given object has equivalent
  15875. * property values, else `false`.
  15876. *
  15877. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15878. * partially applied.
  15879. *
  15880. * Partial comparisons will match empty array and empty object `source`
  15881. * values against any array or object value, respectively. See `_.isEqual`
  15882. * for a list of supported value comparisons.
  15883. *
  15884. * **Note:** Multiple values can be checked by combining several matchers
  15885. * using `_.overSome`
  15886. *
  15887. * @static
  15888. * @memberOf _
  15889. * @since 3.0.0
  15890. * @category Util
  15891. * @param {Object} source The object of property values to match.
  15892. * @returns {Function} Returns the new spec function.
  15893. * @example
  15894. *
  15895. * var objects = [
  15896. * { 'a': 1, 'b': 2, 'c': 3 },
  15897. * { 'a': 4, 'b': 5, 'c': 6 }
  15898. * ];
  15899. *
  15900. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15901. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15902. *
  15903. * // Checking for several possible values
  15904. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15905. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15906. */
  15907. function matches(source) {
  15908. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15909. }
  15910. /**
  15911. * Creates a function that performs a partial deep comparison between the
  15912. * value at `path` of a given object to `srcValue`, returning `true` if the
  15913. * object value is equivalent, else `false`.
  15914. *
  15915. * **Note:** Partial comparisons will match empty array and empty object
  15916. * `srcValue` values against any array or object value, respectively. See
  15917. * `_.isEqual` for a list of supported value comparisons.
  15918. *
  15919. * **Note:** Multiple values can be checked by combining several matchers
  15920. * using `_.overSome`
  15921. *
  15922. * @static
  15923. * @memberOf _
  15924. * @since 3.2.0
  15925. * @category Util
  15926. * @param {Array|string} path The path of the property to get.
  15927. * @param {*} srcValue The value to match.
  15928. * @returns {Function} Returns the new spec function.
  15929. * @example
  15930. *
  15931. * var objects = [
  15932. * { 'a': 1, 'b': 2, 'c': 3 },
  15933. * { 'a': 4, 'b': 5, 'c': 6 }
  15934. * ];
  15935. *
  15936. * _.find(objects, _.matchesProperty('a', 4));
  15937. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15938. *
  15939. * // Checking for several possible values
  15940. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15941. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15942. */
  15943. function matchesProperty(path, srcValue) {
  15944. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15945. }
  15946. /**
  15947. * Creates a function that invokes the method at `path` of a given object.
  15948. * Any additional arguments are provided to the invoked method.
  15949. *
  15950. * @static
  15951. * @memberOf _
  15952. * @since 3.7.0
  15953. * @category Util
  15954. * @param {Array|string} path The path of the method to invoke.
  15955. * @param {...*} [args] The arguments to invoke the method with.
  15956. * @returns {Function} Returns the new invoker function.
  15957. * @example
  15958. *
  15959. * var objects = [
  15960. * { 'a': { 'b': _.constant(2) } },
  15961. * { 'a': { 'b': _.constant(1) } }
  15962. * ];
  15963. *
  15964. * _.map(objects, _.method('a.b'));
  15965. * // => [2, 1]
  15966. *
  15967. * _.map(objects, _.method(['a', 'b']));
  15968. * // => [2, 1]
  15969. */
  15970. var method = baseRest(function(path, args) {
  15971. return function(object) {
  15972. return baseInvoke(object, path, args);
  15973. };
  15974. });
  15975. /**
  15976. * The opposite of `_.method`; this method creates a function that invokes
  15977. * the method at a given path of `object`. Any additional arguments are
  15978. * provided to the invoked method.
  15979. *
  15980. * @static
  15981. * @memberOf _
  15982. * @since 3.7.0
  15983. * @category Util
  15984. * @param {Object} object The object to query.
  15985. * @param {...*} [args] The arguments to invoke the method with.
  15986. * @returns {Function} Returns the new invoker function.
  15987. * @example
  15988. *
  15989. * var array = _.times(3, _.constant),
  15990. * object = { 'a': array, 'b': array, 'c': array };
  15991. *
  15992. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15993. * // => [2, 0]
  15994. *
  15995. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15996. * // => [2, 0]
  15997. */
  15998. var methodOf = baseRest(function(object, args) {
  15999. return function(path) {
  16000. return baseInvoke(object, path, args);
  16001. };
  16002. });
  16003. /**
  16004. * Adds all own enumerable string keyed function properties of a source
  16005. * object to the destination object. If `object` is a function, then methods
  16006. * are added to its prototype as well.
  16007. *
  16008. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16009. * avoid conflicts caused by modifying the original.
  16010. *
  16011. * @static
  16012. * @since 0.1.0
  16013. * @memberOf _
  16014. * @category Util
  16015. * @param {Function|Object} [object=lodash] The destination object.
  16016. * @param {Object} source The object of functions to add.
  16017. * @param {Object} [options={}] The options object.
  16018. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16019. * @returns {Function|Object} Returns `object`.
  16020. * @example
  16021. *
  16022. * function vowels(string) {
  16023. * return _.filter(string, function(v) {
  16024. * return /[aeiou]/i.test(v);
  16025. * });
  16026. * }
  16027. *
  16028. * _.mixin({ 'vowels': vowels });
  16029. * _.vowels('fred');
  16030. * // => ['e']
  16031. *
  16032. * _('fred').vowels().value();
  16033. * // => ['e']
  16034. *
  16035. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16036. * _('fred').vowels();
  16037. * // => ['e']
  16038. */
  16039. function mixin(object, source, options) {
  16040. var props = keys(source),
  16041. methodNames = baseFunctions(source, props);
  16042. if (options == null &&
  16043. !(isObject(source) && (methodNames.length || !props.length))) {
  16044. options = source;
  16045. source = object;
  16046. object = this;
  16047. methodNames = baseFunctions(source, keys(source));
  16048. }
  16049. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16050. isFunc = isFunction(object);
  16051. arrayEach(methodNames, function(methodName) {
  16052. var func = source[methodName];
  16053. object[methodName] = func;
  16054. if (isFunc) {
  16055. object.prototype[methodName] = function() {
  16056. var chainAll = this.__chain__;
  16057. if (chain || chainAll) {
  16058. var result = object(this.__wrapped__),
  16059. actions = result.__actions__ = copyArray(this.__actions__);
  16060. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16061. result.__chain__ = chainAll;
  16062. return result;
  16063. }
  16064. return func.apply(object, arrayPush([this.value()], arguments));
  16065. };
  16066. }
  16067. });
  16068. return object;
  16069. }
  16070. /**
  16071. * Reverts the `_` variable to its previous value and returns a reference to
  16072. * the `lodash` function.
  16073. *
  16074. * @static
  16075. * @since 0.1.0
  16076. * @memberOf _
  16077. * @category Util
  16078. * @returns {Function} Returns the `lodash` function.
  16079. * @example
  16080. *
  16081. * var lodash = _.noConflict();
  16082. */
  16083. function noConflict() {
  16084. if (root._ === this) {
  16085. root._ = oldDash;
  16086. }
  16087. return this;
  16088. }
  16089. /**
  16090. * This method returns `undefined`.
  16091. *
  16092. * @static
  16093. * @memberOf _
  16094. * @since 2.3.0
  16095. * @category Util
  16096. * @example
  16097. *
  16098. * _.times(2, _.noop);
  16099. * // => [undefined, undefined]
  16100. */
  16101. function noop() {
  16102. // No operation performed.
  16103. }
  16104. /**
  16105. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16106. * the nth argument from the end is returned.
  16107. *
  16108. * @static
  16109. * @memberOf _
  16110. * @since 4.0.0
  16111. * @category Util
  16112. * @param {number} [n=0] The index of the argument to return.
  16113. * @returns {Function} Returns the new pass-thru function.
  16114. * @example
  16115. *
  16116. * var func = _.nthArg(1);
  16117. * func('a', 'b', 'c', 'd');
  16118. * // => 'b'
  16119. *
  16120. * var func = _.nthArg(-2);
  16121. * func('a', 'b', 'c', 'd');
  16122. * // => 'c'
  16123. */
  16124. function nthArg(n) {
  16125. n = toInteger(n);
  16126. return baseRest(function(args) {
  16127. return baseNth(args, n);
  16128. });
  16129. }
  16130. /**
  16131. * Creates a function that invokes `iteratees` with the arguments it receives
  16132. * and returns their results.
  16133. *
  16134. * @static
  16135. * @memberOf _
  16136. * @since 4.0.0
  16137. * @category Util
  16138. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16139. * The iteratees to invoke.
  16140. * @returns {Function} Returns the new function.
  16141. * @example
  16142. *
  16143. * var func = _.over([Math.max, Math.min]);
  16144. *
  16145. * func(1, 2, 3, 4);
  16146. * // => [4, 1]
  16147. */
  16148. var over = createOver(arrayMap);
  16149. /**
  16150. * Creates a function that checks if **all** of the `predicates` return
  16151. * truthy when invoked with the arguments it receives.
  16152. *
  16153. * Following shorthands are possible for providing predicates.
  16154. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16155. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16156. *
  16157. * @static
  16158. * @memberOf _
  16159. * @since 4.0.0
  16160. * @category Util
  16161. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16162. * The predicates to check.
  16163. * @returns {Function} Returns the new function.
  16164. * @example
  16165. *
  16166. * var func = _.overEvery([Boolean, isFinite]);
  16167. *
  16168. * func('1');
  16169. * // => true
  16170. *
  16171. * func(null);
  16172. * // => false
  16173. *
  16174. * func(NaN);
  16175. * // => false
  16176. */
  16177. var overEvery = createOver(arrayEvery);
  16178. /**
  16179. * Creates a function that checks if **any** of the `predicates` return
  16180. * truthy when invoked with the arguments it receives.
  16181. *
  16182. * Following shorthands are possible for providing predicates.
  16183. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16184. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16185. *
  16186. * @static
  16187. * @memberOf _
  16188. * @since 4.0.0
  16189. * @category Util
  16190. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16191. * The predicates to check.
  16192. * @returns {Function} Returns the new function.
  16193. * @example
  16194. *
  16195. * var func = _.overSome([Boolean, isFinite]);
  16196. *
  16197. * func('1');
  16198. * // => true
  16199. *
  16200. * func(null);
  16201. * // => true
  16202. *
  16203. * func(NaN);
  16204. * // => false
  16205. *
  16206. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16207. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16208. */
  16209. var overSome = createOver(arraySome);
  16210. /**
  16211. * Creates a function that returns the value at `path` of a given object.
  16212. *
  16213. * @static
  16214. * @memberOf _
  16215. * @since 2.4.0
  16216. * @category Util
  16217. * @param {Array|string} path The path of the property to get.
  16218. * @returns {Function} Returns the new accessor function.
  16219. * @example
  16220. *
  16221. * var objects = [
  16222. * { 'a': { 'b': 2 } },
  16223. * { 'a': { 'b': 1 } }
  16224. * ];
  16225. *
  16226. * _.map(objects, _.property('a.b'));
  16227. * // => [2, 1]
  16228. *
  16229. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16230. * // => [1, 2]
  16231. */
  16232. function property(path) {
  16233. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16234. }
  16235. /**
  16236. * The opposite of `_.property`; this method creates a function that returns
  16237. * the value at a given path of `object`.
  16238. *
  16239. * @static
  16240. * @memberOf _
  16241. * @since 3.0.0
  16242. * @category Util
  16243. * @param {Object} object The object to query.
  16244. * @returns {Function} Returns the new accessor function.
  16245. * @example
  16246. *
  16247. * var array = [0, 1, 2],
  16248. * object = { 'a': array, 'b': array, 'c': array };
  16249. *
  16250. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16251. * // => [2, 0]
  16252. *
  16253. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16254. * // => [2, 0]
  16255. */
  16256. function propertyOf(object) {
  16257. return function(path) {
  16258. return object == null ? undefined : baseGet(object, path);
  16259. };
  16260. }
  16261. /**
  16262. * Creates an array of numbers (positive and/or negative) progressing from
  16263. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16264. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16265. * it's set to `start` with `start` then set to `0`.
  16266. *
  16267. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16268. * floating-point values which can produce unexpected results.
  16269. *
  16270. * @static
  16271. * @since 0.1.0
  16272. * @memberOf _
  16273. * @category Util
  16274. * @param {number} [start=0] The start of the range.
  16275. * @param {number} end The end of the range.
  16276. * @param {number} [step=1] The value to increment or decrement by.
  16277. * @returns {Array} Returns the range of numbers.
  16278. * @see _.inRange, _.rangeRight
  16279. * @example
  16280. *
  16281. * _.range(4);
  16282. * // => [0, 1, 2, 3]
  16283. *
  16284. * _.range(-4);
  16285. * // => [0, -1, -2, -3]
  16286. *
  16287. * _.range(1, 5);
  16288. * // => [1, 2, 3, 4]
  16289. *
  16290. * _.range(0, 20, 5);
  16291. * // => [0, 5, 10, 15]
  16292. *
  16293. * _.range(0, -4, -1);
  16294. * // => [0, -1, -2, -3]
  16295. *
  16296. * _.range(1, 4, 0);
  16297. * // => [1, 1, 1]
  16298. *
  16299. * _.range(0);
  16300. * // => []
  16301. */
  16302. var range = createRange();
  16303. /**
  16304. * This method is like `_.range` except that it populates values in
  16305. * descending order.
  16306. *
  16307. * @static
  16308. * @memberOf _
  16309. * @since 4.0.0
  16310. * @category Util
  16311. * @param {number} [start=0] The start of the range.
  16312. * @param {number} end The end of the range.
  16313. * @param {number} [step=1] The value to increment or decrement by.
  16314. * @returns {Array} Returns the range of numbers.
  16315. * @see _.inRange, _.range
  16316. * @example
  16317. *
  16318. * _.rangeRight(4);
  16319. * // => [3, 2, 1, 0]
  16320. *
  16321. * _.rangeRight(-4);
  16322. * // => [-3, -2, -1, 0]
  16323. *
  16324. * _.rangeRight(1, 5);
  16325. * // => [4, 3, 2, 1]
  16326. *
  16327. * _.rangeRight(0, 20, 5);
  16328. * // => [15, 10, 5, 0]
  16329. *
  16330. * _.rangeRight(0, -4, -1);
  16331. * // => [-3, -2, -1, 0]
  16332. *
  16333. * _.rangeRight(1, 4, 0);
  16334. * // => [1, 1, 1]
  16335. *
  16336. * _.rangeRight(0);
  16337. * // => []
  16338. */
  16339. var rangeRight = createRange(true);
  16340. /**
  16341. * This method returns a new empty array.
  16342. *
  16343. * @static
  16344. * @memberOf _
  16345. * @since 4.13.0
  16346. * @category Util
  16347. * @returns {Array} Returns the new empty array.
  16348. * @example
  16349. *
  16350. * var arrays = _.times(2, _.stubArray);
  16351. *
  16352. * console.log(arrays);
  16353. * // => [[], []]
  16354. *
  16355. * console.log(arrays[0] === arrays[1]);
  16356. * // => false
  16357. */
  16358. function stubArray() {
  16359. return [];
  16360. }
  16361. /**
  16362. * This method returns `false`.
  16363. *
  16364. * @static
  16365. * @memberOf _
  16366. * @since 4.13.0
  16367. * @category Util
  16368. * @returns {boolean} Returns `false`.
  16369. * @example
  16370. *
  16371. * _.times(2, _.stubFalse);
  16372. * // => [false, false]
  16373. */
  16374. function stubFalse() {
  16375. return false;
  16376. }
  16377. /**
  16378. * This method returns a new empty object.
  16379. *
  16380. * @static
  16381. * @memberOf _
  16382. * @since 4.13.0
  16383. * @category Util
  16384. * @returns {Object} Returns the new empty object.
  16385. * @example
  16386. *
  16387. * var objects = _.times(2, _.stubObject);
  16388. *
  16389. * console.log(objects);
  16390. * // => [{}, {}]
  16391. *
  16392. * console.log(objects[0] === objects[1]);
  16393. * // => false
  16394. */
  16395. function stubObject() {
  16396. return {};
  16397. }
  16398. /**
  16399. * This method returns an empty string.
  16400. *
  16401. * @static
  16402. * @memberOf _
  16403. * @since 4.13.0
  16404. * @category Util
  16405. * @returns {string} Returns the empty string.
  16406. * @example
  16407. *
  16408. * _.times(2, _.stubString);
  16409. * // => ['', '']
  16410. */
  16411. function stubString() {
  16412. return '';
  16413. }
  16414. /**
  16415. * This method returns `true`.
  16416. *
  16417. * @static
  16418. * @memberOf _
  16419. * @since 4.13.0
  16420. * @category Util
  16421. * @returns {boolean} Returns `true`.
  16422. * @example
  16423. *
  16424. * _.times(2, _.stubTrue);
  16425. * // => [true, true]
  16426. */
  16427. function stubTrue() {
  16428. return true;
  16429. }
  16430. /**
  16431. * Invokes the iteratee `n` times, returning an array of the results of
  16432. * each invocation. The iteratee is invoked with one argument; (index).
  16433. *
  16434. * @static
  16435. * @since 0.1.0
  16436. * @memberOf _
  16437. * @category Util
  16438. * @param {number} n The number of times to invoke `iteratee`.
  16439. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16440. * @returns {Array} Returns the array of results.
  16441. * @example
  16442. *
  16443. * _.times(3, String);
  16444. * // => ['0', '1', '2']
  16445. *
  16446. * _.times(4, _.constant(0));
  16447. * // => [0, 0, 0, 0]
  16448. */
  16449. function times(n, iteratee) {
  16450. n = toInteger(n);
  16451. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16452. return [];
  16453. }
  16454. var index = MAX_ARRAY_LENGTH,
  16455. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16456. iteratee = getIteratee(iteratee);
  16457. n -= MAX_ARRAY_LENGTH;
  16458. var result = baseTimes(length, iteratee);
  16459. while (++index < n) {
  16460. iteratee(index);
  16461. }
  16462. return result;
  16463. }
  16464. /**
  16465. * Converts `value` to a property path array.
  16466. *
  16467. * @static
  16468. * @memberOf _
  16469. * @since 4.0.0
  16470. * @category Util
  16471. * @param {*} value The value to convert.
  16472. * @returns {Array} Returns the new property path array.
  16473. * @example
  16474. *
  16475. * _.toPath('a.b.c');
  16476. * // => ['a', 'b', 'c']
  16477. *
  16478. * _.toPath('a[0].b.c');
  16479. * // => ['a', '0', 'b', 'c']
  16480. */
  16481. function toPath(value) {
  16482. if (isArray(value)) {
  16483. return arrayMap(value, toKey);
  16484. }
  16485. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16486. }
  16487. /**
  16488. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16489. *
  16490. * @static
  16491. * @since 0.1.0
  16492. * @memberOf _
  16493. * @category Util
  16494. * @param {string} [prefix=''] The value to prefix the ID with.
  16495. * @returns {string} Returns the unique ID.
  16496. * @example
  16497. *
  16498. * _.uniqueId('contact_');
  16499. * // => 'contact_104'
  16500. *
  16501. * _.uniqueId();
  16502. * // => '105'
  16503. */
  16504. function uniqueId(prefix) {
  16505. var id = ++idCounter;
  16506. return toString(prefix) + id;
  16507. }
  16508. /*------------------------------------------------------------------------*/
  16509. /**
  16510. * Adds two numbers.
  16511. *
  16512. * @static
  16513. * @memberOf _
  16514. * @since 3.4.0
  16515. * @category Math
  16516. * @param {number} augend The first number in an addition.
  16517. * @param {number} addend The second number in an addition.
  16518. * @returns {number} Returns the total.
  16519. * @example
  16520. *
  16521. * _.add(6, 4);
  16522. * // => 10
  16523. */
  16524. var add = createMathOperation(function(augend, addend) {
  16525. return augend + addend;
  16526. }, 0);
  16527. /**
  16528. * Computes `number` rounded up to `precision`.
  16529. *
  16530. * @static
  16531. * @memberOf _
  16532. * @since 3.10.0
  16533. * @category Math
  16534. * @param {number} number The number to round up.
  16535. * @param {number} [precision=0] The precision to round up to.
  16536. * @returns {number} Returns the rounded up number.
  16537. * @example
  16538. *
  16539. * _.ceil(4.006);
  16540. * // => 5
  16541. *
  16542. * _.ceil(6.004, 2);
  16543. * // => 6.01
  16544. *
  16545. * _.ceil(6040, -2);
  16546. * // => 6100
  16547. */
  16548. var ceil = createRound('ceil');
  16549. /**
  16550. * Divide two numbers.
  16551. *
  16552. * @static
  16553. * @memberOf _
  16554. * @since 4.7.0
  16555. * @category Math
  16556. * @param {number} dividend The first number in a division.
  16557. * @param {number} divisor The second number in a division.
  16558. * @returns {number} Returns the quotient.
  16559. * @example
  16560. *
  16561. * _.divide(6, 4);
  16562. * // => 1.5
  16563. */
  16564. var divide = createMathOperation(function(dividend, divisor) {
  16565. return dividend / divisor;
  16566. }, 1);
  16567. /**
  16568. * Computes `number` rounded down to `precision`.
  16569. *
  16570. * @static
  16571. * @memberOf _
  16572. * @since 3.10.0
  16573. * @category Math
  16574. * @param {number} number The number to round down.
  16575. * @param {number} [precision=0] The precision to round down to.
  16576. * @returns {number} Returns the rounded down number.
  16577. * @example
  16578. *
  16579. * _.floor(4.006);
  16580. * // => 4
  16581. *
  16582. * _.floor(0.046, 2);
  16583. * // => 0.04
  16584. *
  16585. * _.floor(4060, -2);
  16586. * // => 4000
  16587. */
  16588. var floor = createRound('floor');
  16589. /**
  16590. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16591. * `undefined` is returned.
  16592. *
  16593. * @static
  16594. * @since 0.1.0
  16595. * @memberOf _
  16596. * @category Math
  16597. * @param {Array} array The array to iterate over.
  16598. * @returns {*} Returns the maximum value.
  16599. * @example
  16600. *
  16601. * _.max([4, 2, 8, 6]);
  16602. * // => 8
  16603. *
  16604. * _.max([]);
  16605. * // => undefined
  16606. */
  16607. function max(array) {
  16608. return (array && array.length)
  16609. ? baseExtremum(array, identity, baseGt)
  16610. : undefined;
  16611. }
  16612. /**
  16613. * This method is like `_.max` except that it accepts `iteratee` which is
  16614. * invoked for each element in `array` to generate the criterion by which
  16615. * the value is ranked. The iteratee is invoked with one argument: (value).
  16616. *
  16617. * @static
  16618. * @memberOf _
  16619. * @since 4.0.0
  16620. * @category Math
  16621. * @param {Array} array The array to iterate over.
  16622. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16623. * @returns {*} Returns the maximum value.
  16624. * @example
  16625. *
  16626. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16627. *
  16628. * _.maxBy(objects, function(o) { return o.n; });
  16629. * // => { 'n': 2 }
  16630. *
  16631. * // The `_.property` iteratee shorthand.
  16632. * _.maxBy(objects, 'n');
  16633. * // => { 'n': 2 }
  16634. */
  16635. function maxBy(array, iteratee) {
  16636. return (array && array.length)
  16637. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16638. : undefined;
  16639. }
  16640. /**
  16641. * Computes the mean of the values in `array`.
  16642. *
  16643. * @static
  16644. * @memberOf _
  16645. * @since 4.0.0
  16646. * @category Math
  16647. * @param {Array} array The array to iterate over.
  16648. * @returns {number} Returns the mean.
  16649. * @example
  16650. *
  16651. * _.mean([4, 2, 8, 6]);
  16652. * // => 5
  16653. */
  16654. function mean(array) {
  16655. return baseMean(array, identity);
  16656. }
  16657. /**
  16658. * This method is like `_.mean` except that it accepts `iteratee` which is
  16659. * invoked for each element in `array` to generate the value to be averaged.
  16660. * The iteratee is invoked with one argument: (value).
  16661. *
  16662. * @static
  16663. * @memberOf _
  16664. * @since 4.7.0
  16665. * @category Math
  16666. * @param {Array} array The array to iterate over.
  16667. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16668. * @returns {number} Returns the mean.
  16669. * @example
  16670. *
  16671. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16672. *
  16673. * _.meanBy(objects, function(o) { return o.n; });
  16674. * // => 5
  16675. *
  16676. * // The `_.property` iteratee shorthand.
  16677. * _.meanBy(objects, 'n');
  16678. * // => 5
  16679. */
  16680. function meanBy(array, iteratee) {
  16681. return baseMean(array, getIteratee(iteratee, 2));
  16682. }
  16683. /**
  16684. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16685. * `undefined` is returned.
  16686. *
  16687. * @static
  16688. * @since 0.1.0
  16689. * @memberOf _
  16690. * @category Math
  16691. * @param {Array} array The array to iterate over.
  16692. * @returns {*} Returns the minimum value.
  16693. * @example
  16694. *
  16695. * _.min([4, 2, 8, 6]);
  16696. * // => 2
  16697. *
  16698. * _.min([]);
  16699. * // => undefined
  16700. */
  16701. function min(array) {
  16702. return (array && array.length)
  16703. ? baseExtremum(array, identity, baseLt)
  16704. : undefined;
  16705. }
  16706. /**
  16707. * This method is like `_.min` except that it accepts `iteratee` which is
  16708. * invoked for each element in `array` to generate the criterion by which
  16709. * the value is ranked. The iteratee is invoked with one argument: (value).
  16710. *
  16711. * @static
  16712. * @memberOf _
  16713. * @since 4.0.0
  16714. * @category Math
  16715. * @param {Array} array The array to iterate over.
  16716. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16717. * @returns {*} Returns the minimum value.
  16718. * @example
  16719. *
  16720. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16721. *
  16722. * _.minBy(objects, function(o) { return o.n; });
  16723. * // => { 'n': 1 }
  16724. *
  16725. * // The `_.property` iteratee shorthand.
  16726. * _.minBy(objects, 'n');
  16727. * // => { 'n': 1 }
  16728. */
  16729. function minBy(array, iteratee) {
  16730. return (array && array.length)
  16731. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16732. : undefined;
  16733. }
  16734. /**
  16735. * Multiply two numbers.
  16736. *
  16737. * @static
  16738. * @memberOf _
  16739. * @since 4.7.0
  16740. * @category Math
  16741. * @param {number} multiplier The first number in a multiplication.
  16742. * @param {number} multiplicand The second number in a multiplication.
  16743. * @returns {number} Returns the product.
  16744. * @example
  16745. *
  16746. * _.multiply(6, 4);
  16747. * // => 24
  16748. */
  16749. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16750. return multiplier * multiplicand;
  16751. }, 1);
  16752. /**
  16753. * Computes `number` rounded to `precision`.
  16754. *
  16755. * @static
  16756. * @memberOf _
  16757. * @since 3.10.0
  16758. * @category Math
  16759. * @param {number} number The number to round.
  16760. * @param {number} [precision=0] The precision to round to.
  16761. * @returns {number} Returns the rounded number.
  16762. * @example
  16763. *
  16764. * _.round(4.006);
  16765. * // => 4
  16766. *
  16767. * _.round(4.006, 2);
  16768. * // => 4.01
  16769. *
  16770. * _.round(4060, -2);
  16771. * // => 4100
  16772. */
  16773. var round = createRound('round');
  16774. /**
  16775. * Subtract two numbers.
  16776. *
  16777. * @static
  16778. * @memberOf _
  16779. * @since 4.0.0
  16780. * @category Math
  16781. * @param {number} minuend The first number in a subtraction.
  16782. * @param {number} subtrahend The second number in a subtraction.
  16783. * @returns {number} Returns the difference.
  16784. * @example
  16785. *
  16786. * _.subtract(6, 4);
  16787. * // => 2
  16788. */
  16789. var subtract = createMathOperation(function(minuend, subtrahend) {
  16790. return minuend - subtrahend;
  16791. }, 0);
  16792. /**
  16793. * Computes the sum of the values in `array`.
  16794. *
  16795. * @static
  16796. * @memberOf _
  16797. * @since 3.4.0
  16798. * @category Math
  16799. * @param {Array} array The array to iterate over.
  16800. * @returns {number} Returns the sum.
  16801. * @example
  16802. *
  16803. * _.sum([4, 2, 8, 6]);
  16804. * // => 20
  16805. */
  16806. function sum(array) {
  16807. return (array && array.length)
  16808. ? baseSum(array, identity)
  16809. : 0;
  16810. }
  16811. /**
  16812. * This method is like `_.sum` except that it accepts `iteratee` which is
  16813. * invoked for each element in `array` to generate the value to be summed.
  16814. * The iteratee is invoked with one argument: (value).
  16815. *
  16816. * @static
  16817. * @memberOf _
  16818. * @since 4.0.0
  16819. * @category Math
  16820. * @param {Array} array The array to iterate over.
  16821. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16822. * @returns {number} Returns the sum.
  16823. * @example
  16824. *
  16825. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16826. *
  16827. * _.sumBy(objects, function(o) { return o.n; });
  16828. * // => 20
  16829. *
  16830. * // The `_.property` iteratee shorthand.
  16831. * _.sumBy(objects, 'n');
  16832. * // => 20
  16833. */
  16834. function sumBy(array, iteratee) {
  16835. return (array && array.length)
  16836. ? baseSum(array, getIteratee(iteratee, 2))
  16837. : 0;
  16838. }
  16839. /*------------------------------------------------------------------------*/
  16840. // Add methods that return wrapped values in chain sequences.
  16841. lodash.after = after;
  16842. lodash.ary = ary;
  16843. lodash.assign = assign;
  16844. lodash.assignIn = assignIn;
  16845. lodash.assignInWith = assignInWith;
  16846. lodash.assignWith = assignWith;
  16847. lodash.at = at;
  16848. lodash.before = before;
  16849. lodash.bind = bind;
  16850. lodash.bindAll = bindAll;
  16851. lodash.bindKey = bindKey;
  16852. lodash.castArray = castArray;
  16853. lodash.chain = chain;
  16854. lodash.chunk = chunk;
  16855. lodash.compact = compact;
  16856. lodash.concat = concat;
  16857. lodash.cond = cond;
  16858. lodash.conforms = conforms;
  16859. lodash.constant = constant;
  16860. lodash.countBy = countBy;
  16861. lodash.create = create;
  16862. lodash.curry = curry;
  16863. lodash.curryRight = curryRight;
  16864. lodash.debounce = debounce;
  16865. lodash.defaults = defaults;
  16866. lodash.defaultsDeep = defaultsDeep;
  16867. lodash.defer = defer;
  16868. lodash.delay = delay;
  16869. lodash.difference = difference;
  16870. lodash.differenceBy = differenceBy;
  16871. lodash.differenceWith = differenceWith;
  16872. lodash.drop = drop;
  16873. lodash.dropRight = dropRight;
  16874. lodash.dropRightWhile = dropRightWhile;
  16875. lodash.dropWhile = dropWhile;
  16876. lodash.fill = fill;
  16877. lodash.filter = filter;
  16878. lodash.flatMap = flatMap;
  16879. lodash.flatMapDeep = flatMapDeep;
  16880. lodash.flatMapDepth = flatMapDepth;
  16881. lodash.flatten = flatten;
  16882. lodash.flattenDeep = flattenDeep;
  16883. lodash.flattenDepth = flattenDepth;
  16884. lodash.flip = flip;
  16885. lodash.flow = flow;
  16886. lodash.flowRight = flowRight;
  16887. lodash.fromPairs = fromPairs;
  16888. lodash.functions = functions;
  16889. lodash.functionsIn = functionsIn;
  16890. lodash.groupBy = groupBy;
  16891. lodash.initial = initial;
  16892. lodash.intersection = intersection;
  16893. lodash.intersectionBy = intersectionBy;
  16894. lodash.intersectionWith = intersectionWith;
  16895. lodash.invert = invert;
  16896. lodash.invertBy = invertBy;
  16897. lodash.invokeMap = invokeMap;
  16898. lodash.iteratee = iteratee;
  16899. lodash.keyBy = keyBy;
  16900. lodash.keys = keys;
  16901. lodash.keysIn = keysIn;
  16902. lodash.map = map;
  16903. lodash.mapKeys = mapKeys;
  16904. lodash.mapValues = mapValues;
  16905. lodash.matches = matches;
  16906. lodash.matchesProperty = matchesProperty;
  16907. lodash.memoize = memoize;
  16908. lodash.merge = merge;
  16909. lodash.mergeWith = mergeWith;
  16910. lodash.method = method;
  16911. lodash.methodOf = methodOf;
  16912. lodash.mixin = mixin;
  16913. lodash.negate = negate;
  16914. lodash.nthArg = nthArg;
  16915. lodash.omit = omit;
  16916. lodash.omitBy = omitBy;
  16917. lodash.once = once;
  16918. lodash.orderBy = orderBy;
  16919. lodash.over = over;
  16920. lodash.overArgs = overArgs;
  16921. lodash.overEvery = overEvery;
  16922. lodash.overSome = overSome;
  16923. lodash.partial = partial;
  16924. lodash.partialRight = partialRight;
  16925. lodash.partition = partition;
  16926. lodash.pick = pick;
  16927. lodash.pickBy = pickBy;
  16928. lodash.property = property;
  16929. lodash.propertyOf = propertyOf;
  16930. lodash.pull = pull;
  16931. lodash.pullAll = pullAll;
  16932. lodash.pullAllBy = pullAllBy;
  16933. lodash.pullAllWith = pullAllWith;
  16934. lodash.pullAt = pullAt;
  16935. lodash.range = range;
  16936. lodash.rangeRight = rangeRight;
  16937. lodash.rearg = rearg;
  16938. lodash.reject = reject;
  16939. lodash.remove = remove;
  16940. lodash.rest = rest;
  16941. lodash.reverse = reverse;
  16942. lodash.sampleSize = sampleSize;
  16943. lodash.set = set;
  16944. lodash.setWith = setWith;
  16945. lodash.shuffle = shuffle;
  16946. lodash.slice = slice;
  16947. lodash.sortBy = sortBy;
  16948. lodash.sortedUniq = sortedUniq;
  16949. lodash.sortedUniqBy = sortedUniqBy;
  16950. lodash.split = split;
  16951. lodash.spread = spread;
  16952. lodash.tail = tail;
  16953. lodash.take = take;
  16954. lodash.takeRight = takeRight;
  16955. lodash.takeRightWhile = takeRightWhile;
  16956. lodash.takeWhile = takeWhile;
  16957. lodash.tap = tap;
  16958. lodash.throttle = throttle;
  16959. lodash.thru = thru;
  16960. lodash.toArray = toArray;
  16961. lodash.toPairs = toPairs;
  16962. lodash.toPairsIn = toPairsIn;
  16963. lodash.toPath = toPath;
  16964. lodash.toPlainObject = toPlainObject;
  16965. lodash.transform = transform;
  16966. lodash.unary = unary;
  16967. lodash.union = union;
  16968. lodash.unionBy = unionBy;
  16969. lodash.unionWith = unionWith;
  16970. lodash.uniq = uniq;
  16971. lodash.uniqBy = uniqBy;
  16972. lodash.uniqWith = uniqWith;
  16973. lodash.unset = unset;
  16974. lodash.unzip = unzip;
  16975. lodash.unzipWith = unzipWith;
  16976. lodash.update = update;
  16977. lodash.updateWith = updateWith;
  16978. lodash.values = values;
  16979. lodash.valuesIn = valuesIn;
  16980. lodash.without = without;
  16981. lodash.words = words;
  16982. lodash.wrap = wrap;
  16983. lodash.xor = xor;
  16984. lodash.xorBy = xorBy;
  16985. lodash.xorWith = xorWith;
  16986. lodash.zip = zip;
  16987. lodash.zipObject = zipObject;
  16988. lodash.zipObjectDeep = zipObjectDeep;
  16989. lodash.zipWith = zipWith;
  16990. // Add aliases.
  16991. lodash.entries = toPairs;
  16992. lodash.entriesIn = toPairsIn;
  16993. lodash.extend = assignIn;
  16994. lodash.extendWith = assignInWith;
  16995. // Add methods to `lodash.prototype`.
  16996. mixin(lodash, lodash);
  16997. /*------------------------------------------------------------------------*/
  16998. // Add methods that return unwrapped values in chain sequences.
  16999. lodash.add = add;
  17000. lodash.attempt = attempt;
  17001. lodash.camelCase = camelCase;
  17002. lodash.capitalize = capitalize;
  17003. lodash.ceil = ceil;
  17004. lodash.clamp = clamp;
  17005. lodash.clone = clone;
  17006. lodash.cloneDeep = cloneDeep;
  17007. lodash.cloneDeepWith = cloneDeepWith;
  17008. lodash.cloneWith = cloneWith;
  17009. lodash.conformsTo = conformsTo;
  17010. lodash.deburr = deburr;
  17011. lodash.defaultTo = defaultTo;
  17012. lodash.divide = divide;
  17013. lodash.endsWith = endsWith;
  17014. lodash.eq = eq;
  17015. lodash.escape = escape;
  17016. lodash.escapeRegExp = escapeRegExp;
  17017. lodash.every = every;
  17018. lodash.find = find;
  17019. lodash.findIndex = findIndex;
  17020. lodash.findKey = findKey;
  17021. lodash.findLast = findLast;
  17022. lodash.findLastIndex = findLastIndex;
  17023. lodash.findLastKey = findLastKey;
  17024. lodash.floor = floor;
  17025. lodash.forEach = forEach;
  17026. lodash.forEachRight = forEachRight;
  17027. lodash.forIn = forIn;
  17028. lodash.forInRight = forInRight;
  17029. lodash.forOwn = forOwn;
  17030. lodash.forOwnRight = forOwnRight;
  17031. lodash.get = get;
  17032. lodash.gt = gt;
  17033. lodash.gte = gte;
  17034. lodash.has = has;
  17035. lodash.hasIn = hasIn;
  17036. lodash.head = head;
  17037. lodash.identity = identity;
  17038. lodash.includes = includes;
  17039. lodash.indexOf = indexOf;
  17040. lodash.inRange = inRange;
  17041. lodash.invoke = invoke;
  17042. lodash.isArguments = isArguments;
  17043. lodash.isArray = isArray;
  17044. lodash.isArrayBuffer = isArrayBuffer;
  17045. lodash.isArrayLike = isArrayLike;
  17046. lodash.isArrayLikeObject = isArrayLikeObject;
  17047. lodash.isBoolean = isBoolean;
  17048. lodash.isBuffer = isBuffer;
  17049. lodash.isDate = isDate;
  17050. lodash.isElement = isElement;
  17051. lodash.isEmpty = isEmpty;
  17052. lodash.isEqual = isEqual;
  17053. lodash.isEqualWith = isEqualWith;
  17054. lodash.isError = isError;
  17055. lodash.isFinite = isFinite;
  17056. lodash.isFunction = isFunction;
  17057. lodash.isInteger = isInteger;
  17058. lodash.isLength = isLength;
  17059. lodash.isMap = isMap;
  17060. lodash.isMatch = isMatch;
  17061. lodash.isMatchWith = isMatchWith;
  17062. lodash.isNaN = isNaN;
  17063. lodash.isNative = isNative;
  17064. lodash.isNil = isNil;
  17065. lodash.isNull = isNull;
  17066. lodash.isNumber = isNumber;
  17067. lodash.isObject = isObject;
  17068. lodash.isObjectLike = isObjectLike;
  17069. lodash.isPlainObject = isPlainObject;
  17070. lodash.isRegExp = isRegExp;
  17071. lodash.isSafeInteger = isSafeInteger;
  17072. lodash.isSet = isSet;
  17073. lodash.isString = isString;
  17074. lodash.isSymbol = isSymbol;
  17075. lodash.isTypedArray = isTypedArray;
  17076. lodash.isUndefined = isUndefined;
  17077. lodash.isWeakMap = isWeakMap;
  17078. lodash.isWeakSet = isWeakSet;
  17079. lodash.join = join;
  17080. lodash.kebabCase = kebabCase;
  17081. lodash.last = last;
  17082. lodash.lastIndexOf = lastIndexOf;
  17083. lodash.lowerCase = lowerCase;
  17084. lodash.lowerFirst = lowerFirst;
  17085. lodash.lt = lt;
  17086. lodash.lte = lte;
  17087. lodash.max = max;
  17088. lodash.maxBy = maxBy;
  17089. lodash.mean = mean;
  17090. lodash.meanBy = meanBy;
  17091. lodash.min = min;
  17092. lodash.minBy = minBy;
  17093. lodash.stubArray = stubArray;
  17094. lodash.stubFalse = stubFalse;
  17095. lodash.stubObject = stubObject;
  17096. lodash.stubString = stubString;
  17097. lodash.stubTrue = stubTrue;
  17098. lodash.multiply = multiply;
  17099. lodash.nth = nth;
  17100. lodash.noConflict = noConflict;
  17101. lodash.noop = noop;
  17102. lodash.now = now;
  17103. lodash.pad = pad;
  17104. lodash.padEnd = padEnd;
  17105. lodash.padStart = padStart;
  17106. lodash.parseInt = parseInt;
  17107. lodash.random = random;
  17108. lodash.reduce = reduce;
  17109. lodash.reduceRight = reduceRight;
  17110. lodash.repeat = repeat;
  17111. lodash.replace = replace;
  17112. lodash.result = result;
  17113. lodash.round = round;
  17114. lodash.runInContext = runInContext;
  17115. lodash.sample = sample;
  17116. lodash.size = size;
  17117. lodash.snakeCase = snakeCase;
  17118. lodash.some = some;
  17119. lodash.sortedIndex = sortedIndex;
  17120. lodash.sortedIndexBy = sortedIndexBy;
  17121. lodash.sortedIndexOf = sortedIndexOf;
  17122. lodash.sortedLastIndex = sortedLastIndex;
  17123. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17124. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17125. lodash.startCase = startCase;
  17126. lodash.startsWith = startsWith;
  17127. lodash.subtract = subtract;
  17128. lodash.sum = sum;
  17129. lodash.sumBy = sumBy;
  17130. lodash.template = template;
  17131. lodash.times = times;
  17132. lodash.toFinite = toFinite;
  17133. lodash.toInteger = toInteger;
  17134. lodash.toLength = toLength;
  17135. lodash.toLower = toLower;
  17136. lodash.toNumber = toNumber;
  17137. lodash.toSafeInteger = toSafeInteger;
  17138. lodash.toString = toString;
  17139. lodash.toUpper = toUpper;
  17140. lodash.trim = trim;
  17141. lodash.trimEnd = trimEnd;
  17142. lodash.trimStart = trimStart;
  17143. lodash.truncate = truncate;
  17144. lodash.unescape = unescape;
  17145. lodash.uniqueId = uniqueId;
  17146. lodash.upperCase = upperCase;
  17147. lodash.upperFirst = upperFirst;
  17148. // Add aliases.
  17149. lodash.each = forEach;
  17150. lodash.eachRight = forEachRight;
  17151. lodash.first = head;
  17152. mixin(lodash, (function() {
  17153. var source = {};
  17154. baseForOwn(lodash, function(func, methodName) {
  17155. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17156. source[methodName] = func;
  17157. }
  17158. });
  17159. return source;
  17160. }()), { 'chain': false });
  17161. /*------------------------------------------------------------------------*/
  17162. /**
  17163. * The semantic version number.
  17164. *
  17165. * @static
  17166. * @memberOf _
  17167. * @type {string}
  17168. */
  17169. lodash.VERSION = VERSION;
  17170. // Assign default placeholders.
  17171. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17172. lodash[methodName].placeholder = lodash;
  17173. });
  17174. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17175. arrayEach(['drop', 'take'], function(methodName, index) {
  17176. LazyWrapper.prototype[methodName] = function(n) {
  17177. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17178. var result = (this.__filtered__ && !index)
  17179. ? new LazyWrapper(this)
  17180. : this.clone();
  17181. if (result.__filtered__) {
  17182. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17183. } else {
  17184. result.__views__.push({
  17185. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17186. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17187. });
  17188. }
  17189. return result;
  17190. };
  17191. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17192. return this.reverse()[methodName](n).reverse();
  17193. };
  17194. });
  17195. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17196. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17197. var type = index + 1,
  17198. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17199. LazyWrapper.prototype[methodName] = function(iteratee) {
  17200. var result = this.clone();
  17201. result.__iteratees__.push({
  17202. 'iteratee': getIteratee(iteratee, 3),
  17203. 'type': type
  17204. });
  17205. result.__filtered__ = result.__filtered__ || isFilter;
  17206. return result;
  17207. };
  17208. });
  17209. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17210. arrayEach(['head', 'last'], function(methodName, index) {
  17211. var takeName = 'take' + (index ? 'Right' : '');
  17212. LazyWrapper.prototype[methodName] = function() {
  17213. return this[takeName](1).value()[0];
  17214. };
  17215. });
  17216. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17217. arrayEach(['initial', 'tail'], function(methodName, index) {
  17218. var dropName = 'drop' + (index ? '' : 'Right');
  17219. LazyWrapper.prototype[methodName] = function() {
  17220. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17221. };
  17222. });
  17223. LazyWrapper.prototype.compact = function() {
  17224. return this.filter(identity);
  17225. };
  17226. LazyWrapper.prototype.find = function(predicate) {
  17227. return this.filter(predicate).head();
  17228. };
  17229. LazyWrapper.prototype.findLast = function(predicate) {
  17230. return this.reverse().find(predicate);
  17231. };
  17232. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17233. if (typeof path == 'function') {
  17234. return new LazyWrapper(this);
  17235. }
  17236. return this.map(function(value) {
  17237. return baseInvoke(value, path, args);
  17238. });
  17239. });
  17240. LazyWrapper.prototype.reject = function(predicate) {
  17241. return this.filter(negate(getIteratee(predicate)));
  17242. };
  17243. LazyWrapper.prototype.slice = function(start, end) {
  17244. start = toInteger(start);
  17245. var result = this;
  17246. if (result.__filtered__ && (start > 0 || end < 0)) {
  17247. return new LazyWrapper(result);
  17248. }
  17249. if (start < 0) {
  17250. result = result.takeRight(-start);
  17251. } else if (start) {
  17252. result = result.drop(start);
  17253. }
  17254. if (end !== undefined) {
  17255. end = toInteger(end);
  17256. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17257. }
  17258. return result;
  17259. };
  17260. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17261. return this.reverse().takeWhile(predicate).reverse();
  17262. };
  17263. LazyWrapper.prototype.toArray = function() {
  17264. return this.take(MAX_ARRAY_LENGTH);
  17265. };
  17266. // Add `LazyWrapper` methods to `lodash.prototype`.
  17267. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17268. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17269. isTaker = /^(?:head|last)$/.test(methodName),
  17270. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17271. retUnwrapped = isTaker || /^find/.test(methodName);
  17272. if (!lodashFunc) {
  17273. return;
  17274. }
  17275. lodash.prototype[methodName] = function() {
  17276. var value = this.__wrapped__,
  17277. args = isTaker ? [1] : arguments,
  17278. isLazy = value instanceof LazyWrapper,
  17279. iteratee = args[0],
  17280. useLazy = isLazy || isArray(value);
  17281. var interceptor = function(value) {
  17282. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17283. return (isTaker && chainAll) ? result[0] : result;
  17284. };
  17285. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17286. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17287. isLazy = useLazy = false;
  17288. }
  17289. var chainAll = this.__chain__,
  17290. isHybrid = !!this.__actions__.length,
  17291. isUnwrapped = retUnwrapped && !chainAll,
  17292. onlyLazy = isLazy && !isHybrid;
  17293. if (!retUnwrapped && useLazy) {
  17294. value = onlyLazy ? value : new LazyWrapper(this);
  17295. var result = func.apply(value, args);
  17296. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17297. return new LodashWrapper(result, chainAll);
  17298. }
  17299. if (isUnwrapped && onlyLazy) {
  17300. return func.apply(this, args);
  17301. }
  17302. result = this.thru(interceptor);
  17303. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17304. };
  17305. });
  17306. // Add `Array` methods to `lodash.prototype`.
  17307. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17308. var func = arrayProto[methodName],
  17309. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17310. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17311. lodash.prototype[methodName] = function() {
  17312. var args = arguments;
  17313. if (retUnwrapped && !this.__chain__) {
  17314. var value = this.value();
  17315. return func.apply(isArray(value) ? value : [], args);
  17316. }
  17317. return this[chainName](function(value) {
  17318. return func.apply(isArray(value) ? value : [], args);
  17319. });
  17320. };
  17321. });
  17322. // Map minified method names to their real names.
  17323. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17324. var lodashFunc = lodash[methodName];
  17325. if (lodashFunc) {
  17326. var key = lodashFunc.name + '';
  17327. if (!hasOwnProperty.call(realNames, key)) {
  17328. realNames[key] = [];
  17329. }
  17330. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17331. }
  17332. });
  17333. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17334. 'name': 'wrapper',
  17335. 'func': undefined
  17336. }];
  17337. // Add methods to `LazyWrapper`.
  17338. LazyWrapper.prototype.clone = lazyClone;
  17339. LazyWrapper.prototype.reverse = lazyReverse;
  17340. LazyWrapper.prototype.value = lazyValue;
  17341. // Add chain sequence methods to the `lodash` wrapper.
  17342. lodash.prototype.at = wrapperAt;
  17343. lodash.prototype.chain = wrapperChain;
  17344. lodash.prototype.commit = wrapperCommit;
  17345. lodash.prototype.next = wrapperNext;
  17346. lodash.prototype.plant = wrapperPlant;
  17347. lodash.prototype.reverse = wrapperReverse;
  17348. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17349. // Add lazy aliases.
  17350. lodash.prototype.first = lodash.prototype.head;
  17351. if (symIterator) {
  17352. lodash.prototype[symIterator] = wrapperToIterator;
  17353. }
  17354. return lodash;
  17355. });
  17356. /*--------------------------------------------------------------------------*/
  17357. // Export lodash.
  17358. var _ = runInContext();
  17359. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17360. if (true) {
  17361. // Expose Lodash on the global object to prevent errors when Lodash is
  17362. // loaded by a script tag in the presence of an AMD loader.
  17363. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17364. // Use `_.noConflict` to remove Lodash from the global object.
  17365. root._ = _;
  17366. // Define as an anonymous module so, through path mapping, it can be
  17367. // referenced as the "underscore" module.
  17368. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17369. return _;
  17370. }).call(exports, __webpack_require__, exports, module),
  17371. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17372. }
  17373. // Check for `exports` after `define` in case a build optimizer adds it.
  17374. else {}
  17375. }.call(this));
  17376. /***/ }),
  17377. /***/ "./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":
  17378. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17379. !*** ./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 ***!
  17380. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17381. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17382. "use strict";
  17383. __webpack_require__.r(__webpack_exports__);
  17384. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17385. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17386. /* harmony export */ });
  17387. /* 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");
  17388. /* 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__);
  17389. /* 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");
  17390. var options = {};
  17391. options.insert = "head";
  17392. options.singleton = false;
  17393. 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);
  17394. /* 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 || {});
  17395. /***/ }),
  17396. /***/ "./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":
  17397. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17398. !*** ./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 ***!
  17399. \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17400. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17401. "use strict";
  17402. __webpack_require__.r(__webpack_exports__);
  17403. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17404. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17405. /* harmony export */ });
  17406. /* 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");
  17407. /* 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__);
  17408. /* 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");
  17409. var options = {};
  17410. options.insert = "head";
  17411. options.singleton = false;
  17412. 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);
  17413. /* 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 || {});
  17414. /***/ }),
  17415. /***/ "./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":
  17416. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17417. !*** ./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 ***!
  17418. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17419. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17420. "use strict";
  17421. __webpack_require__.r(__webpack_exports__);
  17422. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17423. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17424. /* harmony export */ });
  17425. /* 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");
  17426. /* 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__);
  17427. /* 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");
  17428. var options = {};
  17429. options.insert = "head";
  17430. options.singleton = false;
  17431. 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);
  17432. /* 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 || {});
  17433. /***/ }),
  17434. /***/ "./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":
  17435. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17436. !*** ./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 ***!
  17437. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17438. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17439. "use strict";
  17440. __webpack_require__.r(__webpack_exports__);
  17441. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17442. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17443. /* harmony export */ });
  17444. /* 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");
  17445. /* 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__);
  17446. /* 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");
  17447. var options = {};
  17448. options.insert = "head";
  17449. options.singleton = false;
  17450. 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);
  17451. /* 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 || {});
  17452. /***/ }),
  17453. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17454. /*!******************************************************!*\
  17455. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17456. \******************************************************/
  17457. /***/ ((__unused_webpack_module, exports) => {
  17458. "use strict";
  17459. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17460. // runtime helper for setting properties on components
  17461. // in a tree-shakable way
  17462. exports["default"] = (sfc, props) => {
  17463. const target = sfc.__vccOpts || sfc;
  17464. for (const [key, val] of props) {
  17465. target[key] = val;
  17466. }
  17467. return target;
  17468. };
  17469. /***/ }),
  17470. /***/ "./resources/js/components/AppButtonLink.vue":
  17471. /*!***************************************************!*\
  17472. !*** ./resources/js/components/AppButtonLink.vue ***!
  17473. \***************************************************/
  17474. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17475. "use strict";
  17476. __webpack_require__.r(__webpack_exports__);
  17477. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17478. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17479. /* harmony export */ });
  17480. /* 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");
  17481. /* 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");
  17482. /* 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");
  17483. ;
  17484. 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"]])
  17485. /* hot reload */
  17486. if (false) {}
  17487. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17488. /***/ }),
  17489. /***/ "./resources/js/components/AppMessage.vue":
  17490. /*!************************************************!*\
  17491. !*** ./resources/js/components/AppMessage.vue ***!
  17492. \************************************************/
  17493. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17494. "use strict";
  17495. __webpack_require__.r(__webpack_exports__);
  17496. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17497. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17498. /* harmony export */ });
  17499. /* 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");
  17500. /* 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");
  17501. /* 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");
  17502. ;
  17503. 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"]])
  17504. /* hot reload */
  17505. if (false) {}
  17506. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17507. /***/ }),
  17508. /***/ "./resources/js/components/AppPagination.vue":
  17509. /*!***************************************************!*\
  17510. !*** ./resources/js/components/AppPagination.vue ***!
  17511. \***************************************************/
  17512. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17513. "use strict";
  17514. __webpack_require__.r(__webpack_exports__);
  17515. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17516. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17517. /* harmony export */ });
  17518. /* 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");
  17519. /* 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");
  17520. /* 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");
  17521. ;
  17522. 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"]])
  17523. /* hot reload */
  17524. if (false) {}
  17525. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17526. /***/ }),
  17527. /***/ "./resources/js/components/AppSearch.vue":
  17528. /*!***********************************************!*\
  17529. !*** ./resources/js/components/AppSearch.vue ***!
  17530. \***********************************************/
  17531. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17532. "use strict";
  17533. __webpack_require__.r(__webpack_exports__);
  17534. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17535. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17536. /* harmony export */ });
  17537. /* 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");
  17538. /* 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");
  17539. /* 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");
  17540. ;
  17541. 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"]])
  17542. /* hot reload */
  17543. if (false) {}
  17544. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17545. /***/ }),
  17546. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue":
  17547. /*!**************************************************************!*\
  17548. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue ***!
  17549. \**************************************************************/
  17550. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17551. "use strict";
  17552. __webpack_require__.r(__webpack_exports__);
  17553. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17554. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17555. /* harmony export */ });
  17556. /* 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");
  17557. /* 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");
  17558. const script = {}
  17559. ;
  17560. 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"]])
  17561. /* hot reload */
  17562. if (false) {}
  17563. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17564. /***/ }),
  17565. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue":
  17566. /*!***************************************************************!*\
  17567. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue ***!
  17568. \***************************************************************/
  17569. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17570. "use strict";
  17571. __webpack_require__.r(__webpack_exports__);
  17572. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17573. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17574. /* harmony export */ });
  17575. /* 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");
  17576. /* 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");
  17577. /* 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");
  17578. /* 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");
  17579. ;
  17580. 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"]])
  17581. /* hot reload */
  17582. if (false) {}
  17583. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17584. /***/ }),
  17585. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue":
  17586. /*!******************************************************************!*\
  17587. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue ***!
  17588. \******************************************************************/
  17589. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17590. "use strict";
  17591. __webpack_require__.r(__webpack_exports__);
  17592. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17593. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17594. /* harmony export */ });
  17595. /* 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");
  17596. /* 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");
  17597. /* 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");
  17598. /* 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");
  17599. ;
  17600. 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"]])
  17601. /* hot reload */
  17602. if (false) {}
  17603. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17604. /***/ }),
  17605. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue":
  17606. /*!**************************************************************!*\
  17607. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue ***!
  17608. \**************************************************************/
  17609. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17610. "use strict";
  17611. __webpack_require__.r(__webpack_exports__);
  17612. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17613. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17614. /* harmony export */ });
  17615. /* 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");
  17616. /* 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");
  17617. /* 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");
  17618. /* 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");
  17619. ;
  17620. 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"]])
  17621. /* hot reload */
  17622. if (false) {}
  17623. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17624. /***/ }),
  17625. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue":
  17626. /*!************************************************************!*\
  17627. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue ***!
  17628. \************************************************************/
  17629. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17630. "use strict";
  17631. __webpack_require__.r(__webpack_exports__);
  17632. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17633. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17634. /* harmony export */ });
  17635. /* 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");
  17636. /* 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");
  17637. /* 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");
  17638. /* 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");
  17639. ;
  17640. 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"]])
  17641. /* hot reload */
  17642. if (false) {}
  17643. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17644. /***/ }),
  17645. /***/ "./resources/js/pages/Sales/Index.vue":
  17646. /*!********************************************!*\
  17647. !*** ./resources/js/pages/Sales/Index.vue ***!
  17648. \********************************************/
  17649. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17650. "use strict";
  17651. __webpack_require__.r(__webpack_exports__);
  17652. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17653. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17654. /* harmony export */ });
  17655. /* 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");
  17656. /* 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");
  17657. /* 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");
  17658. ;
  17659. 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"]])
  17660. /* hot reload */
  17661. if (false) {}
  17662. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17663. /***/ }),
  17664. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17665. /*!**************************************************************************************!*\
  17666. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17667. \**************************************************************************************/
  17668. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17669. "use strict";
  17670. __webpack_require__.r(__webpack_exports__);
  17671. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17672. /* 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"])
  17673. /* harmony export */ });
  17674. /* 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");
  17675. /***/ }),
  17676. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17677. /*!***********************************************************************************!*\
  17678. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17679. \***********************************************************************************/
  17680. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17681. "use strict";
  17682. __webpack_require__.r(__webpack_exports__);
  17683. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17684. /* 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"])
  17685. /* harmony export */ });
  17686. /* 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");
  17687. /***/ }),
  17688. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17689. /*!**************************************************************************************!*\
  17690. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17691. \**************************************************************************************/
  17692. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17693. "use strict";
  17694. __webpack_require__.r(__webpack_exports__);
  17695. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17696. /* 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"])
  17697. /* harmony export */ });
  17698. /* 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");
  17699. /***/ }),
  17700. /***/ "./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js":
  17701. /*!**********************************************************************************!*\
  17702. !*** ./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js ***!
  17703. \**********************************************************************************/
  17704. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17705. "use strict";
  17706. __webpack_require__.r(__webpack_exports__);
  17707. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17708. /* 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"])
  17709. /* harmony export */ });
  17710. /* 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");
  17711. /***/ }),
  17712. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js":
  17713. /*!**************************************************************************************************!*\
  17714. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js ***!
  17715. \**************************************************************************************************/
  17716. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17717. "use strict";
  17718. __webpack_require__.r(__webpack_exports__);
  17719. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17720. /* 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"])
  17721. /* harmony export */ });
  17722. /* 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");
  17723. /***/ }),
  17724. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js":
  17725. /*!*****************************************************************************************************!*\
  17726. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17727. \*****************************************************************************************************/
  17728. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17729. "use strict";
  17730. __webpack_require__.r(__webpack_exports__);
  17731. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17732. /* 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"])
  17733. /* harmony export */ });
  17734. /* 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");
  17735. /***/ }),
  17736. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js":
  17737. /*!*************************************************************************************************!*\
  17738. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js ***!
  17739. \*************************************************************************************************/
  17740. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17741. "use strict";
  17742. __webpack_require__.r(__webpack_exports__);
  17743. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17744. /* 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"])
  17745. /* harmony export */ });
  17746. /* 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");
  17747. /***/ }),
  17748. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17749. /*!***********************************************************************************************!*\
  17750. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17751. \***********************************************************************************************/
  17752. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17753. "use strict";
  17754. __webpack_require__.r(__webpack_exports__);
  17755. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17756. /* 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"])
  17757. /* harmony export */ });
  17758. /* 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");
  17759. /***/ }),
  17760. /***/ "./resources/js/pages/Sales/Index.vue?vue&type=script&setup=true&lang=js":
  17761. /*!*******************************************************************************!*\
  17762. !*** ./resources/js/pages/Sales/Index.vue?vue&type=script&setup=true&lang=js ***!
  17763. \*******************************************************************************/
  17764. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17765. "use strict";
  17766. __webpack_require__.r(__webpack_exports__);
  17767. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17768. /* 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"])
  17769. /* harmony export */ });
  17770. /* 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");
  17771. /***/ }),
  17772. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17773. /*!*********************************************************************************!*\
  17774. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17775. \*********************************************************************************/
  17776. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17777. "use strict";
  17778. __webpack_require__.r(__webpack_exports__);
  17779. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17780. /* 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)
  17781. /* harmony export */ });
  17782. /* 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");
  17783. /***/ }),
  17784. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17785. /*!******************************************************************************!*\
  17786. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17787. \******************************************************************************/
  17788. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17789. "use strict";
  17790. __webpack_require__.r(__webpack_exports__);
  17791. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17792. /* 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)
  17793. /* harmony export */ });
  17794. /* 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");
  17795. /***/ }),
  17796. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17797. /*!*********************************************************************************!*\
  17798. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17799. \*********************************************************************************/
  17800. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17801. "use strict";
  17802. __webpack_require__.r(__webpack_exports__);
  17803. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17804. /* 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)
  17805. /* harmony export */ });
  17806. /* 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");
  17807. /***/ }),
  17808. /***/ "./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce":
  17809. /*!*****************************************************************************!*\
  17810. !*** ./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce ***!
  17811. \*****************************************************************************/
  17812. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17813. "use strict";
  17814. __webpack_require__.r(__webpack_exports__);
  17815. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17816. /* 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)
  17817. /* harmony export */ });
  17818. /* 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");
  17819. /***/ }),
  17820. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76":
  17821. /*!********************************************************************************************!*\
  17822. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76 ***!
  17823. \********************************************************************************************/
  17824. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17825. "use strict";
  17826. __webpack_require__.r(__webpack_exports__);
  17827. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17828. /* 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)
  17829. /* harmony export */ });
  17830. /* 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");
  17831. /***/ }),
  17832. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true":
  17833. /*!*********************************************************************************************************!*\
  17834. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true ***!
  17835. \*********************************************************************************************************/
  17836. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17837. "use strict";
  17838. __webpack_require__.r(__webpack_exports__);
  17839. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17840. /* 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)
  17841. /* harmony export */ });
  17842. /* 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");
  17843. /***/ }),
  17844. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true":
  17845. /*!************************************************************************************************************!*\
  17846. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true ***!
  17847. \************************************************************************************************************/
  17848. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17849. "use strict";
  17850. __webpack_require__.r(__webpack_exports__);
  17851. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17852. /* 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)
  17853. /* harmony export */ });
  17854. /* 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");
  17855. /***/ }),
  17856. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true":
  17857. /*!********************************************************************************************************!*\
  17858. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true ***!
  17859. \********************************************************************************************************/
  17860. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17861. "use strict";
  17862. __webpack_require__.r(__webpack_exports__);
  17863. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17864. /* 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)
  17865. /* harmony export */ });
  17866. /* 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");
  17867. /***/ }),
  17868. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true":
  17869. /*!******************************************************************************************************!*\
  17870. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true ***!
  17871. \******************************************************************************************************/
  17872. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17873. "use strict";
  17874. __webpack_require__.r(__webpack_exports__);
  17875. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17876. /* 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)
  17877. /* harmony export */ });
  17878. /* 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");
  17879. /***/ }),
  17880. /***/ "./resources/js/pages/Sales/Index.vue?vue&type=template&id=7c234776":
  17881. /*!**************************************************************************!*\
  17882. !*** ./resources/js/pages/Sales/Index.vue?vue&type=template&id=7c234776 ***!
  17883. \**************************************************************************/
  17884. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17885. "use strict";
  17886. __webpack_require__.r(__webpack_exports__);
  17887. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17888. /* 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)
  17889. /* harmony export */ });
  17890. /* 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");
  17891. /***/ }),
  17892. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  17893. /*!************************************************************************************************************************!*\
  17894. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  17895. \************************************************************************************************************************/
  17896. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17897. "use strict";
  17898. __webpack_require__.r(__webpack_exports__);
  17899. /* 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");
  17900. /***/ }),
  17901. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  17902. /*!***************************************************************************************************************************!*\
  17903. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  17904. \***************************************************************************************************************************/
  17905. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17906. "use strict";
  17907. __webpack_require__.r(__webpack_exports__);
  17908. /* 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");
  17909. /***/ }),
  17910. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  17911. /*!***********************************************************************************************************************!*\
  17912. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  17913. \***********************************************************************************************************************/
  17914. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17915. "use strict";
  17916. __webpack_require__.r(__webpack_exports__);
  17917. /* 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");
  17918. /***/ }),
  17919. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  17920. /*!*********************************************************************************************************************!*\
  17921. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  17922. \*********************************************************************************************************************/
  17923. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17924. "use strict";
  17925. __webpack_require__.r(__webpack_exports__);
  17926. /* 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");
  17927. /***/ })
  17928. }]);