resources_js_pages_topup_Index_vue.js 704KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_topup_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. props: {
  15. inertiaLink: {
  16. type: Boolean,
  17. "default": true
  18. },
  19. icon: String,
  20. label: String,
  21. classButton: String
  22. },
  23. setup: function setup(__props, _ref) {
  24. var expose = _ref.expose;
  25. expose();
  26. var __returned__ = {
  27. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  28. };
  29. Object.defineProperty(__returned__, '__isScriptSetup', {
  30. enumerable: false,
  31. value: true
  32. });
  33. return __returned__;
  34. }
  35. });
  36. /***/ }),
  37. /***/ "./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":
  38. /*!***************************************************************************************************************************************************************************************************************!*\
  39. !*** ./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 ***!
  40. \***************************************************************************************************************************************************************************************************************/
  41. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  42. "use strict";
  43. __webpack_require__.r(__webpack_exports__);
  44. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  45. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  46. /* harmony export */ });
  47. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  48. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  49. setup: function setup(__props, _ref) {
  50. var expose = _ref.expose;
  51. expose();
  52. var onClose = function onClose() {
  53. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  54. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  55. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  56. };
  57. var __returned__ = {
  58. onClose: onClose,
  59. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  60. };
  61. Object.defineProperty(__returned__, '__isScriptSetup', {
  62. enumerable: false,
  63. value: true
  64. });
  65. return __returned__;
  66. }
  67. });
  68. /***/ }),
  69. /***/ "./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":
  70. /*!******************************************************************************************************************************************************************************************************************!*\
  71. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  72. \******************************************************************************************************************************************************************************************************************/
  73. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  74. "use strict";
  75. __webpack_require__.r(__webpack_exports__);
  76. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  77. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  78. /* harmony export */ });
  79. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  80. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  81. props: {
  82. links: Array
  83. },
  84. setup: function setup(__props, _ref) {
  85. var expose = _ref.expose;
  86. expose();
  87. var __returned__ = {
  88. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  89. };
  90. Object.defineProperty(__returned__, '__isScriptSetup', {
  91. enumerable: false,
  92. value: true
  93. });
  94. return __returned__;
  95. }
  96. });
  97. /***/ }),
  98. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  99. /*!***************************************************************************************************************************************************************************************************************!*\
  100. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  101. \***************************************************************************************************************************************************************************************************************/
  102. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  103. "use strict";
  104. __webpack_require__.r(__webpack_exports__);
  105. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  106. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  107. /* harmony export */ });
  108. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  109. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  110. props: {
  111. menu: Array
  112. },
  113. setup: function setup(__props, _ref) {
  114. var expose = _ref.expose;
  115. expose();
  116. var __returned__ = {
  117. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  118. };
  119. Object.defineProperty(__returned__, '__isScriptSetup', {
  120. enumerable: false,
  121. value: true
  122. });
  123. return __returned__;
  124. }
  125. });
  126. /***/ }),
  127. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  128. /*!******************************************************************************************************************************************************************************************************************!*\
  129. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  130. \******************************************************************************************************************************************************************************************************************/
  131. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  132. "use strict";
  133. __webpack_require__.r(__webpack_exports__);
  134. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  135. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  136. /* harmony export */ });
  137. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  138. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  139. props: {
  140. items: Array,
  141. root: {
  142. type: Boolean,
  143. "default": false
  144. }
  145. },
  146. setup: function setup(__props, _ref) {
  147. var expose = _ref.expose;
  148. expose();
  149. var __returned__ = {
  150. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  151. };
  152. Object.defineProperty(__returned__, '__isScriptSetup', {
  153. enumerable: false,
  154. value: true
  155. });
  156. return __returned__;
  157. }
  158. });
  159. /***/ }),
  160. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  161. /*!**************************************************************************************************************************************************************************************************************!*\
  162. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  163. \**************************************************************************************************************************************************************************************************************/
  164. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  165. "use strict";
  166. __webpack_require__.r(__webpack_exports__);
  167. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  168. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  169. /* harmony export */ });
  170. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  171. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  172. emits: ['menu-toggle'],
  173. setup: function setup(__props, _ref) {
  174. var expose = _ref.expose;
  175. expose();
  176. var __returned__ = {
  177. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  178. };
  179. Object.defineProperty(__returned__, '__isScriptSetup', {
  180. enumerable: false,
  181. value: true
  182. });
  183. return __returned__;
  184. }
  185. });
  186. /***/ }),
  187. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  188. /*!*****************************************************************************************************************************************************************************************************************!*\
  189. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  190. \*****************************************************************************************************************************************************************************************************************/
  191. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  192. "use strict";
  193. __webpack_require__.r(__webpack_exports__);
  194. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  195. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  196. /* harmony export */ });
  197. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  198. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  199. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  200. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  201. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  202. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  203. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  204. setup: function setup(__props, _ref) {
  205. var expose = _ref.expose;
  206. expose();
  207. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  208. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  209. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  210. var isDesktop = function isDesktop() {
  211. return window.innerWidth >= 992;
  212. };
  213. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  214. return ['layout-wrapper', {
  215. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  216. 'layout-mobile-sidebar-active': mobileMenuActive.value
  217. }];
  218. });
  219. var onWrapperClick = function onWrapperClick() {
  220. if (!menuClick.value) {
  221. mobileMenuActive.value = false;
  222. }
  223. menuClick.value = false;
  224. };
  225. var onMenuToggle = function onMenuToggle(event) {
  226. menuClick.value = true;
  227. if (isDesktop()) {
  228. staticMenuInactive.value = !staticMenuInactive.value;
  229. } else {
  230. mobileMenuActive.value = !mobileMenuActive.value;
  231. }
  232. event.preventDefault();
  233. };
  234. var __returned__ = {
  235. mobileMenuActive: mobileMenuActive,
  236. staticMenuInactive: staticMenuInactive,
  237. menuClick: menuClick,
  238. isDesktop: isDesktop,
  239. containerClass: containerClass,
  240. onWrapperClick: onWrapperClick,
  241. onMenuToggle: onMenuToggle,
  242. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  243. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  244. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  245. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  246. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  247. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  248. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  249. };
  250. Object.defineProperty(__returned__, '__isScriptSetup', {
  251. enumerable: false,
  252. value: true
  253. });
  254. return __returned__;
  255. }
  256. });
  257. /***/ }),
  258. /***/ "./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/topup/Index.vue?vue&type=script&setup=true&lang=js":
  259. /*!***********************************************************************************************************************************************************************************************************!*\
  260. !*** ./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/topup/Index.vue?vue&type=script&setup=true&lang=js ***!
  261. \***********************************************************************************************************************************************************************************************************/
  262. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  263. "use strict";
  264. __webpack_require__.r(__webpack_exports__);
  265. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  266. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  267. /* harmony export */ });
  268. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  269. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  270. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  271. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  272. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
  273. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/topup/tableHeader.js");
  274. /* harmony import */ var _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/useSearchText */ "./resources/js/components/useSearchText.js");
  275. /* harmony import */ var _components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/useDateRangeFilter */ "./resources/js/components/useDateRangeFilter.js");
  276. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  277. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  278. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  279. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  280. props: {
  281. topUp: Object,
  282. initialSearch: String,
  283. initialDateRange: Array
  284. },
  285. setup: function setup(__props, _ref) {
  286. var expose = _ref.expose;
  287. expose();
  288. var props = __props;
  289. var _useSearchText = (0,_components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText)(props),
  290. search = _useSearchText.search;
  291. var _useDateRangeFilter = (0,_components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_6__.useDateRangeFilter)(props),
  292. dates = _useDateRangeFilter.dates,
  293. startDate = _useDateRangeFilter.startDate,
  294. endDate = _useDateRangeFilter.endDate;
  295. (0,vue__WEBPACK_IMPORTED_MODULE_1__.watch)([dates, search], function () {
  296. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia.get('/top-ups', (0,lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy)({
  297. startDate: startDate.value,
  298. endDate: endDate.value,
  299. search: search.value
  300. }), {
  301. preserveState: true
  302. });
  303. });
  304. var filterReset = function filterReset() {
  305. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia.get('/top-ups');
  306. };
  307. var __returned__ = {
  308. props: props,
  309. search: search,
  310. dates: dates,
  311. startDate: startDate,
  312. endDate: endDate,
  313. filterReset: filterReset,
  314. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia,
  315. watch: vue__WEBPACK_IMPORTED_MODULE_1__.watch,
  316. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
  317. pickBy: lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy,
  318. indexTable: _tableHeader__WEBPACK_IMPORTED_MODULE_4__.indexTable,
  319. useSearchText: _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText,
  320. useDateRangeFilter: _components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_6__.useDateRangeFilter,
  321. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  322. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__["default"],
  323. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_9__["default"]
  324. };
  325. Object.defineProperty(__returned__, '__isScriptSetup', {
  326. enumerable: false,
  327. value: true
  328. });
  329. return __returned__;
  330. }
  331. });
  332. /***/ }),
  333. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  334. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  335. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  336. \***********************************************************************************************************************************************************************************************************************************************************************************/
  337. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  338. "use strict";
  339. __webpack_require__.r(__webpack_exports__);
  340. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  341. /* harmony export */ "render": () => (/* binding */ render)
  342. /* harmony export */ });
  343. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  344. var _hoisted_1 = {
  345. key: 1,
  346. "class": "p-button-label"
  347. };
  348. var _hoisted_2 = {
  349. key: 1,
  350. "class": "p-button-label"
  351. };
  352. function render(_ctx, _cache, $props, $setup, $data, $options) {
  353. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  354. key: 0,
  355. "class": "p-button p-component",
  356. as: "button",
  357. type: "button"
  358. }, {
  359. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  360. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  361. key: 0,
  362. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  363. }, null, 2
  364. /* CLASS */
  365. )) : (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
  366. /* TEXT */
  367. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  368. }),
  369. _: 1
  370. /* STABLE */
  371. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  372. key: 1,
  373. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([$props.classButton, "p-button p-component"])
  374. }, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  375. key: 0,
  376. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  377. }, null, 2
  378. /* CLASS */
  379. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_2, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  380. /* TEXT */
  381. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 2
  382. /* CLASS */
  383. ));
  384. }
  385. /***/ }),
  386. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  387. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  388. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  389. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  390. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  391. "use strict";
  392. __webpack_require__.r(__webpack_exports__);
  393. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  394. /* harmony export */ "render": () => (/* binding */ render)
  395. /* harmony export */ });
  396. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  397. var _withScopeId = function _withScopeId(n) {
  398. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  399. };
  400. var _hoisted_1 = {
  401. "class": "layout-footer"
  402. };
  403. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  404. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  405. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  406. href: "https://dijitalcode.com",
  407. target: "_blank",
  408. "class": "font-medium ml-2"
  409. }, "DijitalCODE", -1
  410. /* HOISTED */
  411. );
  412. });
  413. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  414. function render(_ctx, _cache) {
  415. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  416. }
  417. /***/ }),
  418. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  419. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  420. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  421. \********************************************************************************************************************************************************************************************************************************************************************************/
  422. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  423. "use strict";
  424. __webpack_require__.r(__webpack_exports__);
  425. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  426. /* harmony export */ "render": () => (/* binding */ render)
  427. /* harmony export */ });
  428. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  429. var _hoisted_1 = {
  430. key: 0
  431. };
  432. var _hoisted_2 = {
  433. key: 1
  434. };
  435. function render(_ctx, _cache, $props, $setup, $data, $options) {
  436. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  437. 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, {
  438. key: 0,
  439. severity: "success",
  440. onClose: $setup.onClose
  441. }, {
  442. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  443. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  444. /* TEXT */
  445. )];
  446. }),
  447. _: 1
  448. /* STABLE */
  449. })) : (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, {
  450. key: 1,
  451. severity: "error",
  452. onClose: $setup.onClose
  453. }, {
  454. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  455. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  456. /* TEXT */
  457. )];
  458. }),
  459. _: 1
  460. /* STABLE */
  461. })) : (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, {
  462. key: 2,
  463. severity: "error",
  464. onClose: $setup.onClose
  465. }, {
  466. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  467. 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
  468. /* TEXT */
  469. ))];
  470. }),
  471. _: 1
  472. /* STABLE */
  473. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  474. /* STABLE_FRAGMENT */
  475. );
  476. }
  477. /***/ }),
  478. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  479. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  480. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  481. \***********************************************************************************************************************************************************************************************************************************************************************************/
  482. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  483. "use strict";
  484. __webpack_require__.r(__webpack_exports__);
  485. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  486. /* harmony export */ "render": () => (/* binding */ render)
  487. /* harmony export */ });
  488. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  489. var _hoisted_1 = {
  490. key: 0,
  491. "class": "p-paginator p-component flex justify-content-start"
  492. };
  493. var _hoisted_2 = {
  494. "class": "p-paginator-pages"
  495. };
  496. var _hoisted_3 = ["innerHTML"];
  497. function render(_ctx, _cache, $props, $setup, $data, $options) {
  498. 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) {
  499. 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", {
  500. key: "link-".concat(key),
  501. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  502. 'p-disabled': link
  503. }]),
  504. innerHTML: link.label
  505. }, null, 10
  506. /* CLASS, PROPS */
  507. , _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"], {
  508. key: "link-".concat(key),
  509. href: link.url,
  510. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  511. 'p-highlight': link.active
  512. }, "p-paginator-page p-paginator-element p-link"]),
  513. innerHTML: link.label
  514. }, null, 8
  515. /* PROPS */
  516. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  517. /* STABLE_FRAGMENT */
  518. );
  519. }), 256
  520. /* UNKEYED_FRAGMENT */
  521. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  522. }
  523. /***/ }),
  524. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  525. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  526. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  527. \********************************************************************************************************************************************************************************************************************************************************************************************/
  528. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  529. "use strict";
  530. __webpack_require__.r(__webpack_exports__);
  531. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  532. /* harmony export */ "render": () => (/* binding */ render)
  533. /* harmony export */ });
  534. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  535. function render(_ctx, _cache, $props, $setup, $data, $options) {
  536. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSubSidebar"], {
  537. "class": "layout-menu",
  538. items: $props.menu,
  539. root: true
  540. }, null, 8
  541. /* PROPS */
  542. , ["items"])]);
  543. }
  544. /***/ }),
  545. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  546. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  547. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  548. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  549. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  550. "use strict";
  551. __webpack_require__.r(__webpack_exports__);
  552. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  553. /* harmony export */ "render": () => (/* binding */ render)
  554. /* harmony export */ });
  555. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  556. var _withScopeId = function _withScopeId(n) {
  557. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  558. };
  559. var _hoisted_1 = {
  560. key: 0
  561. };
  562. var _hoisted_2 = ["aria-label"];
  563. var _hoisted_3 = ["aria-label"];
  564. function render(_ctx, _cache, $props, $setup, $data, $options) {
  565. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  566. 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) {
  567. 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", {
  568. key: i,
  569. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  570. 'layout-menuitem-category': $props.root
  571. }]),
  572. role: "none"
  573. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  574. key: 0
  575. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  576. "class": "layout-menuitem-root-text",
  577. "aria-label": item.label
  578. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  579. /* TEXT, PROPS */
  580. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  581. items: item.items
  582. }, null, 8
  583. /* PROPS */
  584. , ["items"])], 64
  585. /* STABLE_FRAGMENT */
  586. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  587. key: 1
  588. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  589. key: 0,
  590. role: "menuitem",
  591. href: item.to,
  592. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  593. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  594. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  595. }]),
  596. "aria-label": item.label
  597. }, {
  598. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  599. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  600. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  601. }, null, 2
  602. /* CLASS */
  603. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  604. /* TEXT */
  605. )];
  606. }),
  607. _: 2
  608. /* DYNAMIC */
  609. }, 1032
  610. /* PROPS, DYNAMIC_SLOTS */
  611. , ["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", {
  612. key: 1,
  613. href: "#",
  614. role: "menuitem",
  615. "aria-label": item.label
  616. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  617. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  618. }, null, 2
  619. /* CLASS */
  620. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  621. /* TEXT */
  622. )], 8
  623. /* PROPS */
  624. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  625. items: item.items
  626. }, null, 8
  627. /* PROPS */
  628. , ["items"])], 64
  629. /* STABLE_FRAGMENT */
  630. ))], 2
  631. /* CLASS */
  632. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  633. /* STABLE_FRAGMENT */
  634. );
  635. }), 256
  636. /* UNKEYED_FRAGMENT */
  637. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  638. }
  639. /***/ }),
  640. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  641. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  642. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  643. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  644. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  645. "use strict";
  646. __webpack_require__.r(__webpack_exports__);
  647. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  648. /* harmony export */ "render": () => (/* binding */ render)
  649. /* harmony export */ });
  650. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  651. var _withScopeId = function _withScopeId(n) {
  652. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  653. };
  654. var _hoisted_1 = {
  655. "class": "layout-topbar"
  656. };
  657. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  658. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  659. alt: "Logo",
  660. src: "/images/logo.svg",
  661. "class": "md:mr-3"
  662. }, null, -1
  663. /* HOISTED */
  664. );
  665. });
  666. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  667. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  668. /* HOISTED */
  669. );
  670. });
  671. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  672. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  673. "class": "pi pi-bars"
  674. }, null, -1
  675. /* HOISTED */
  676. );
  677. });
  678. var _hoisted_5 = [_hoisted_4];
  679. var _hoisted_6 = {
  680. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  681. };
  682. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  683. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  684. "class": "pi pi-ellipsis-v"
  685. }, null, -1
  686. /* HOISTED */
  687. );
  688. });
  689. var _hoisted_8 = [_hoisted_7];
  690. var _hoisted_9 = {
  691. "class": "layout-topbar-menu hidden lg:flex origin-top"
  692. };
  693. var _hoisted_10 = {
  694. "class": "align-self-center"
  695. };
  696. var _hoisted_11 = {
  697. "class": "hidden lg:inline"
  698. };
  699. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  700. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  701. "class": "pi pi-user"
  702. }, null, -1
  703. /* HOISTED */
  704. );
  705. });
  706. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  707. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Profil Saya", -1
  708. /* HOISTED */
  709. );
  710. });
  711. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  712. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  713. "class": "pi pi-sign-out"
  714. }, null, -1
  715. /* HOISTED */
  716. );
  717. });
  718. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  719. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Sign Out", -1
  720. /* HOISTED */
  721. );
  722. });
  723. function render(_ctx, _cache, $props, $setup, $data, $options) {
  724. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  725. 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"], {
  726. href: "/",
  727. "class": "layout-topbar-logo"
  728. }, {
  729. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  730. return [_hoisted_2, _hoisted_3];
  731. }),
  732. _: 1
  733. /* STABLE */
  734. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  735. "class": "p-link layout-menu-button layout-topbar-button",
  736. onClick: _cache[0] || (_cache[0] = function ($event) {
  737. return _ctx.$emit('menu-toggle', $event);
  738. })
  739. }, _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, {
  740. selector: '@next',
  741. enterClass: 'hidden',
  742. enterActiveClass: 'scalein',
  743. leaveToClass: 'hidden',
  744. leaveActiveClass: 'fadeout',
  745. hideOnOutsideClick: true
  746. }]]), (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
  747. /* TEXT */
  748. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  749. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  750. "class": "p-link layout-topbar-button"
  751. }, {
  752. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  753. return [_hoisted_12, _hoisted_13];
  754. }),
  755. _: 1
  756. /* STABLE */
  757. }, 8
  758. /* PROPS */
  759. , ["href"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  760. href: _ctx.route('logout'),
  761. as: "button",
  762. method: "post",
  763. "class": "p-link layout-topbar-button"
  764. }, {
  765. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  766. return [_hoisted_14, _hoisted_15];
  767. }),
  768. _: 1
  769. /* STABLE */
  770. }, 8
  771. /* PROPS */
  772. , ["href"])])])]);
  773. }
  774. /***/ }),
  775. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  776. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  777. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  778. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  779. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  780. "use strict";
  781. __webpack_require__.r(__webpack_exports__);
  782. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  783. /* harmony export */ "render": () => (/* binding */ render)
  784. /* harmony export */ });
  785. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  786. var _withScopeId = function _withScopeId(n) {
  787. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  788. };
  789. var _hoisted_1 = {
  790. "class": "layout-sidebar"
  791. };
  792. var _hoisted_2 = {
  793. "class": "layout-main-container"
  794. };
  795. var _hoisted_3 = {
  796. "class": "layout-main"
  797. };
  798. var _hoisted_4 = {
  799. key: 0,
  800. "class": "layout-mask p-component-overlay"
  801. };
  802. function render(_ctx, _cache, $props, $setup, $data, $options) {
  803. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  804. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  805. onClick: $setup.onWrapperClick
  806. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  807. onMenuToggle: $setup.onMenuToggle
  808. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  809. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  810. }, null, 8
  811. /* PROPS */
  812. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppFooter"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  813. name: "layout-mask"
  814. }, {
  815. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  816. return [$setup.mobileMenuActive ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  817. }),
  818. _: 1
  819. /* STABLE */
  820. })], 2
  821. /* CLASS */
  822. );
  823. }
  824. /***/ }),
  825. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/topup/Index.vue?vue&type=template&id=3bf54f8c":
  826. /*!****************************************************************************************************************************************************************************************************************************************************************************!*\
  827. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/topup/Index.vue?vue&type=template&id=3bf54f8c ***!
  828. \****************************************************************************************************************************************************************************************************************************************************************************/
  829. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  830. "use strict";
  831. __webpack_require__.r(__webpack_exports__);
  832. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  833. /* harmony export */ "render": () => (/* binding */ render)
  834. /* harmony export */ });
  835. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  836. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Top Up", -1
  837. /* HOISTED */
  838. );
  839. var _hoisted_2 = {
  840. "class": "grid"
  841. };
  842. var _hoisted_3 = {
  843. "class": "col-12 md:col-8"
  844. };
  845. var _hoisted_4 = {
  846. "class": "grid"
  847. };
  848. var _hoisted_5 = {
  849. "class": "col-12 md:col-3"
  850. };
  851. var _hoisted_6 = {
  852. "class": "col-12 md:col-3"
  853. };
  854. var _hoisted_7 = {
  855. "class": "col-auto mt-2 ml-2"
  856. };
  857. var _hoisted_8 = {
  858. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  859. };
  860. function render(_ctx, _cache, $props, $setup, $data, $options) {
  861. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  862. var _component_Calendar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Calendar");
  863. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  864. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  865. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  866. 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"], {
  867. title: "Top Up"
  868. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  869. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  870. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  871. "responsive-layout": "scroll",
  872. "column-resize-mode": "expand",
  873. value: $props.topUp.data,
  874. "row-hover": true,
  875. "striped-rows": true
  876. }, {
  877. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  878. 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__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_InputText, {
  879. "class": "w-full",
  880. placeholder: "cari, contoh: 08xx, tina",
  881. modelValue: $setup.search,
  882. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  883. return $setup.search = $event;
  884. })
  885. }, null, 8
  886. /* PROPS */
  887. , ["modelValue"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Calendar, {
  888. "touch-u-i": "",
  889. "class": "w-full",
  890. modelValue: $setup.dates,
  891. "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) {
  892. return $setup.dates = $event;
  893. }),
  894. "selection-mode": "range",
  895. placeholder: "filter waktu...",
  896. "date-format": "dd/mm/yy",
  897. "manual-input": false
  898. }, null, 8
  899. /* PROPS */
  900. , ["modelValue"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_7, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  901. label: "reset",
  902. "class": "p-button-link",
  903. onClick: $setup.filterReset
  904. })])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_8, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  905. label: "Top Up",
  906. "class": "p-button-outlined",
  907. icon: "pi pi-pencil",
  908. href: _ctx.route('top-ups.create')
  909. }, null, 8
  910. /* PROPS */
  911. , ["href"])])])];
  912. }),
  913. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  914. 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) {
  915. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  916. field: value.field,
  917. header: value.header,
  918. key: value.field
  919. }, null, 8
  920. /* PROPS */
  921. , ["field", "header"]);
  922. }), 128
  923. /* KEYED_FRAGMENT */
  924. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  925. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  926. var data = _ref.data;
  927. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  928. icon: "pi pi-eye",
  929. "class": "p-button-text p-button-icon-only p-button-rounded p-button-text",
  930. href: _ctx.route('top-ups.show', data.id)
  931. }, null, 8
  932. /* PROPS */
  933. , ["href"])];
  934. }),
  935. _: 1
  936. /* STABLE */
  937. })];
  938. }),
  939. _: 1
  940. /* STABLE */
  941. }, 8
  942. /* PROPS */
  943. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  944. links: $props.topUp.links
  945. }, null, 8
  946. /* PROPS */
  947. , ["links"])];
  948. }),
  949. _: 1
  950. /* STABLE */
  951. })], 64
  952. /* STABLE_FRAGMENT */
  953. );
  954. }
  955. /***/ }),
  956. /***/ "./resources/js/components/useDateRangeFilter.js":
  957. /*!*******************************************************!*\
  958. !*** ./resources/js/components/useDateRangeFilter.js ***!
  959. \*******************************************************/
  960. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  961. "use strict";
  962. __webpack_require__.r(__webpack_exports__);
  963. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  964. /* harmony export */ "useDateRangeFilter": () => (/* binding */ useDateRangeFilter)
  965. /* harmony export */ });
  966. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  967. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dayjs */ "./node_modules/dayjs/dayjs.min.js");
  968. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_1__);
  969. function useDateRangeFilter(props) {
  970. var dates = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  971. var startDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  972. var endDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  973. (0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
  974. if (!props.initialDateRange) {
  975. return;
  976. }
  977. if (props.initialDateRange[0] || props.initialDateRange[1]) {
  978. if (props.initialDateRange[1]) {
  979. dates.value = [new Date(props.initialDateRange[0]), new Date(props.initialDateRange[1])];
  980. } else {
  981. dates.value = [new Date(props.props.initialDateRange[1]), null];
  982. }
  983. }
  984. });
  985. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(dates, function () {
  986. if (dates.value[1]) {
  987. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  988. endDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[1]).format('YYYY-MM-DD');
  989. } else if (dates.value[0]) {
  990. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  991. endDate.value = null;
  992. }
  993. });
  994. return {
  995. dates: dates,
  996. startDate: startDate,
  997. endDate: endDate
  998. };
  999. }
  1000. /***/ }),
  1001. /***/ "./resources/js/components/useSearchText.js":
  1002. /*!**************************************************!*\
  1003. !*** ./resources/js/components/useSearchText.js ***!
  1004. \**************************************************/
  1005. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1006. "use strict";
  1007. __webpack_require__.r(__webpack_exports__);
  1008. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1009. /* harmony export */ "useSearchText": () => (/* binding */ useSearchText)
  1010. /* harmony export */ });
  1011. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1012. function useSearchText(props) {
  1013. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  1014. return {
  1015. search: search
  1016. };
  1017. }
  1018. /***/ }),
  1019. /***/ "./resources/js/pages/topup/tableHeader.js":
  1020. /*!*************************************************!*\
  1021. !*** ./resources/js/pages/topup/tableHeader.js ***!
  1022. \*************************************************/
  1023. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1024. "use strict";
  1025. __webpack_require__.r(__webpack_exports__);
  1026. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1027. /* harmony export */ "indexTable": () => (/* binding */ indexTable),
  1028. /* harmony export */ "topUpTable": () => (/* binding */ topUpTable)
  1029. /* harmony export */ });
  1030. var indexTable = [{
  1031. field: 'updatedAt',
  1032. header: 'Diperbaharui'
  1033. }, {
  1034. field: 'name',
  1035. header: 'Nama'
  1036. }, {
  1037. field: 'phone',
  1038. header: 'Nomor HP'
  1039. }, {
  1040. field: 'platNumber',
  1041. header: 'Plat Kendaraan'
  1042. }, {
  1043. field: 'type',
  1044. header: 'Jenis Member'
  1045. }, {
  1046. field: 'amount',
  1047. header: 'Tarif Member'
  1048. }, {
  1049. field: 'expDate',
  1050. header: 'Berakhir'
  1051. }];
  1052. var topUpTable = [{
  1053. field: 'updatedAt',
  1054. header: 'Diperbaharui'
  1055. }, {
  1056. field: 'name',
  1057. header: 'Nama User'
  1058. }, {
  1059. field: 'phone',
  1060. header: 'Nomor HP User'
  1061. }, {
  1062. field: 'platNumber',
  1063. header: 'Plat Kendaraan'
  1064. }, {
  1065. field: 'type',
  1066. header: 'Jenis Member'
  1067. }, {
  1068. field: 'amount',
  1069. header: 'Tarif Member'
  1070. }, {
  1071. field: 'expDate',
  1072. header: 'Berakhir'
  1073. }];
  1074. /***/ }),
  1075. /***/ "./resources/js/utils/menu.js":
  1076. /*!************************************!*\
  1077. !*** ./resources/js/utils/menu.js ***!
  1078. \************************************/
  1079. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1080. "use strict";
  1081. __webpack_require__.r(__webpack_exports__);
  1082. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1083. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1084. /* harmony export */ });
  1085. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1086. // Admin
  1087. 1: [{
  1088. label: 'Home',
  1089. items: [{
  1090. label: 'Dashboard',
  1091. icon: 'pi pi-home',
  1092. to: '/dashboards',
  1093. component: 'home/Index'
  1094. }]
  1095. }, {
  1096. label: 'Master',
  1097. items: [{
  1098. label: 'User',
  1099. icon: 'pi pi-user',
  1100. to: '/users',
  1101. component: 'user/Index'
  1102. }]
  1103. }],
  1104. // Supervisor
  1105. 2: [{
  1106. label: 'Home',
  1107. items: [{
  1108. label: 'Dashboard',
  1109. icon: 'pi pi-home',
  1110. to: '/dashboards',
  1111. component: 'home/Index'
  1112. }]
  1113. }, {
  1114. label: 'Menu',
  1115. items: [{
  1116. label: 'Pengeluaran',
  1117. icon: 'pi pi-wallet',
  1118. to: '/expenses',
  1119. component: 'expense/Index'
  1120. }, {
  1121. label: 'Laporan',
  1122. icon: 'pi pi-book',
  1123. items: [{
  1124. label: 'Mutasi',
  1125. icon: 'pi pi-circle',
  1126. to: '/reports/mutations',
  1127. component: 'mutation/Report'
  1128. }]
  1129. }]
  1130. }, {
  1131. label: 'Master',
  1132. items: [{
  1133. label: 'Jenis Kendaraan',
  1134. icon: 'pi pi-car',
  1135. to: '/type-vehicles',
  1136. component: 'typevehicle/Index'
  1137. }, {
  1138. label: 'Jenis Member',
  1139. icon: 'pi pi-id-card',
  1140. to: '/type-members',
  1141. component: 'typemember/Index'
  1142. }]
  1143. }, {
  1144. label: 'Pengaturan',
  1145. items: [{
  1146. label: 'Tarif Parkir',
  1147. icon: 'pi pi-car',
  1148. to: '/parking-fees/create',
  1149. component: 'parkingfee/Create'
  1150. }]
  1151. }],
  1152. // Operator
  1153. 3: [{
  1154. label: 'Home',
  1155. items: [{
  1156. label: 'Dashboard',
  1157. icon: 'pi pi-home',
  1158. to: '/dashboards',
  1159. component: 'home/Index'
  1160. }]
  1161. }, {
  1162. label: 'Menu',
  1163. items: [{
  1164. label: 'Pengeluaran',
  1165. icon: 'pi pi-wallet',
  1166. to: '/expenses',
  1167. component: 'expense/Index'
  1168. }, {
  1169. label: 'Member',
  1170. icon: 'pi pi-id-card',
  1171. to: '/members',
  1172. component: 'member/Index'
  1173. }, {
  1174. label: 'Top Up',
  1175. icon: 'pi pi-car',
  1176. to: '/top-ups',
  1177. component: 'topup/Index'
  1178. }]
  1179. }]
  1180. });
  1181. /***/ }),
  1182. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  1183. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1184. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  1185. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1186. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1187. "use strict";
  1188. __webpack_require__.r(__webpack_exports__);
  1189. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1190. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1191. /* harmony export */ });
  1192. /* 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");
  1193. /* 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__);
  1194. // Imports
  1195. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1196. // Module
  1197. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-footer[data-v-4ab6097e] {\n transition: margin-left 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-top: 1rem;\n border-top: 1px solid var(--surface-border);\n}", ""]);
  1198. // Exports
  1199. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1200. /***/ }),
  1201. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  1202. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1203. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  1204. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1205. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1206. "use strict";
  1207. __webpack_require__.r(__webpack_exports__);
  1208. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1209. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1210. /* harmony export */ });
  1211. /* 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");
  1212. /* 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__);
  1213. // Imports
  1214. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1215. // Module
  1216. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1217. // Exports
  1218. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1219. /***/ }),
  1220. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  1221. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1222. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  1223. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1224. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1225. "use strict";
  1226. __webpack_require__.r(__webpack_exports__);
  1227. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1228. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1229. /* harmony export */ });
  1230. /* 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");
  1231. /* 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__);
  1232. // Imports
  1233. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1234. // Module
  1235. ___CSS_LOADER_EXPORT___.push([module.id, "li.layout-menuitem-category[data-v-0addd9bc] {\n margin-top: 0.75rem;\n}\nli.layout-menuitem-category[data-v-0addd9bc]:first-child {\n margin-top: 0;\n}\nli .layout-menuitem-root-text[data-v-0addd9bc] {\n text-transform: uppercase;\n color: var(--surface-900);\n font-weight: 600;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n}\nli a[data-v-0addd9bc] {\n cursor: pointer;\n text-decoration: none;\n display: flex;\n align-items: center;\n color: var(--text-color);\n transition: color 0.2s;\n border-radius: 12px;\n padding: 0.75rem 1rem;\n transition: background-color 0.15s;\n}\nli a span[data-v-0addd9bc] {\n margin-left: 0.5rem;\n}\nli a .menuitem-toggle-icon[data-v-0addd9bc] {\n margin-left: auto;\n}\nli a[data-v-0addd9bc]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: inset var(--focus-ring);\n}\nli a[data-v-0addd9bc]:hover {\n background-color: var(--surface-hover);\n}\nli a.router-link-exact-active[data-v-0addd9bc] {\n font-weight: 700;\n color: var(--primary-color);\n}\nli ul[data-v-0addd9bc] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\nli ul ul[data-v-0addd9bc] {\n padding-left: 1rem;\n}", ""]);
  1236. // Exports
  1237. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1238. /***/ }),
  1239. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  1240. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1241. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  1242. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1243. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1244. "use strict";
  1245. __webpack_require__.r(__webpack_exports__);
  1246. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1247. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1248. /* harmony export */ });
  1249. /* 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");
  1250. /* 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__);
  1251. // Imports
  1252. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1253. // Module
  1254. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 997;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1255. // Exports
  1256. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1257. /***/ }),
  1258. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  1259. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1260. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  1261. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1262. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1263. "use strict";
  1264. __webpack_require__.r(__webpack_exports__);
  1265. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1266. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1267. /* harmony export */ });
  1268. /* 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");
  1269. /* 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__);
  1270. // Imports
  1271. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1272. // Module
  1273. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-549bf5ac] {\n position: fixed;\n width: 300px;\n height: calc(100vh - 9rem);\n z-index: 999;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-549bf5ac] {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n justify-content: space-between;\n padding: 7rem 2rem 2rem 4rem;\n transition: margin-left 0.2s;\n}\n.layout-main[data-v-549bf5ac] {\n flex: 1 1 auto;\n}\n@media (min-width: 992px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n top: 0;\n height: 100vh;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n z-index: 998;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-549bf5ac], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-549bf5ac] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-549bf5ac] {\n display: block;\n}\n}", ""]);
  1274. // Exports
  1275. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1276. /***/ }),
  1277. /***/ "./node_modules/dayjs/dayjs.min.js":
  1278. /*!*****************************************!*\
  1279. !*** ./node_modules/dayjs/dayjs.min.js ***!
  1280. \*****************************************/
  1281. /***/ (function(module) {
  1282. !function(t,e){ true?module.exports=e():0}(this,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},v="en",D={};D[v]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return v;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(v=i),i||!r&&v},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var v=this.$locale().weekStart||0,D=(y<v?y+7:y)-v;return $(r?m-D:m+(6-D),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,v=O.m(this,M);return v=(l={},l[c]=v/12,l[f]=v,l[h]=v/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?v:O.a(v)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[v],w.Ls=D,w.p={},w}));
  1283. /***/ }),
  1284. /***/ "./node_modules/lodash/lodash.js":
  1285. /*!***************************************!*\
  1286. !*** ./node_modules/lodash/lodash.js ***!
  1287. \***************************************/
  1288. /***/ (function(module, exports, __webpack_require__) {
  1289. /* module decorator */ module = __webpack_require__.nmd(module);
  1290. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1291. * @license
  1292. * Lodash <https://lodash.com/>
  1293. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1294. * Released under MIT license <https://lodash.com/license>
  1295. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1296. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1297. */
  1298. ;(function() {
  1299. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1300. var undefined;
  1301. /** Used as the semantic version number. */
  1302. var VERSION = '4.17.21';
  1303. /** Used as the size to enable large array optimizations. */
  1304. var LARGE_ARRAY_SIZE = 200;
  1305. /** Error message constants. */
  1306. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1307. FUNC_ERROR_TEXT = 'Expected a function',
  1308. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1309. /** Used to stand-in for `undefined` hash values. */
  1310. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1311. /** Used as the maximum memoize cache size. */
  1312. var MAX_MEMOIZE_SIZE = 500;
  1313. /** Used as the internal argument placeholder. */
  1314. var PLACEHOLDER = '__lodash_placeholder__';
  1315. /** Used to compose bitmasks for cloning. */
  1316. var CLONE_DEEP_FLAG = 1,
  1317. CLONE_FLAT_FLAG = 2,
  1318. CLONE_SYMBOLS_FLAG = 4;
  1319. /** Used to compose bitmasks for value comparisons. */
  1320. var COMPARE_PARTIAL_FLAG = 1,
  1321. COMPARE_UNORDERED_FLAG = 2;
  1322. /** Used to compose bitmasks for function metadata. */
  1323. var WRAP_BIND_FLAG = 1,
  1324. WRAP_BIND_KEY_FLAG = 2,
  1325. WRAP_CURRY_BOUND_FLAG = 4,
  1326. WRAP_CURRY_FLAG = 8,
  1327. WRAP_CURRY_RIGHT_FLAG = 16,
  1328. WRAP_PARTIAL_FLAG = 32,
  1329. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1330. WRAP_ARY_FLAG = 128,
  1331. WRAP_REARG_FLAG = 256,
  1332. WRAP_FLIP_FLAG = 512;
  1333. /** Used as default options for `_.truncate`. */
  1334. var DEFAULT_TRUNC_LENGTH = 30,
  1335. DEFAULT_TRUNC_OMISSION = '...';
  1336. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1337. var HOT_COUNT = 800,
  1338. HOT_SPAN = 16;
  1339. /** Used to indicate the type of lazy iteratees. */
  1340. var LAZY_FILTER_FLAG = 1,
  1341. LAZY_MAP_FLAG = 2,
  1342. LAZY_WHILE_FLAG = 3;
  1343. /** Used as references for various `Number` constants. */
  1344. var INFINITY = 1 / 0,
  1345. MAX_SAFE_INTEGER = 9007199254740991,
  1346. MAX_INTEGER = 1.7976931348623157e+308,
  1347. NAN = 0 / 0;
  1348. /** Used as references for the maximum length and index of an array. */
  1349. var MAX_ARRAY_LENGTH = 4294967295,
  1350. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1351. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1352. /** Used to associate wrap methods with their bit flags. */
  1353. var wrapFlags = [
  1354. ['ary', WRAP_ARY_FLAG],
  1355. ['bind', WRAP_BIND_FLAG],
  1356. ['bindKey', WRAP_BIND_KEY_FLAG],
  1357. ['curry', WRAP_CURRY_FLAG],
  1358. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1359. ['flip', WRAP_FLIP_FLAG],
  1360. ['partial', WRAP_PARTIAL_FLAG],
  1361. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1362. ['rearg', WRAP_REARG_FLAG]
  1363. ];
  1364. /** `Object#toString` result references. */
  1365. var argsTag = '[object Arguments]',
  1366. arrayTag = '[object Array]',
  1367. asyncTag = '[object AsyncFunction]',
  1368. boolTag = '[object Boolean]',
  1369. dateTag = '[object Date]',
  1370. domExcTag = '[object DOMException]',
  1371. errorTag = '[object Error]',
  1372. funcTag = '[object Function]',
  1373. genTag = '[object GeneratorFunction]',
  1374. mapTag = '[object Map]',
  1375. numberTag = '[object Number]',
  1376. nullTag = '[object Null]',
  1377. objectTag = '[object Object]',
  1378. promiseTag = '[object Promise]',
  1379. proxyTag = '[object Proxy]',
  1380. regexpTag = '[object RegExp]',
  1381. setTag = '[object Set]',
  1382. stringTag = '[object String]',
  1383. symbolTag = '[object Symbol]',
  1384. undefinedTag = '[object Undefined]',
  1385. weakMapTag = '[object WeakMap]',
  1386. weakSetTag = '[object WeakSet]';
  1387. var arrayBufferTag = '[object ArrayBuffer]',
  1388. dataViewTag = '[object DataView]',
  1389. float32Tag = '[object Float32Array]',
  1390. float64Tag = '[object Float64Array]',
  1391. int8Tag = '[object Int8Array]',
  1392. int16Tag = '[object Int16Array]',
  1393. int32Tag = '[object Int32Array]',
  1394. uint8Tag = '[object Uint8Array]',
  1395. uint8ClampedTag = '[object Uint8ClampedArray]',
  1396. uint16Tag = '[object Uint16Array]',
  1397. uint32Tag = '[object Uint32Array]';
  1398. /** Used to match empty string literals in compiled template source. */
  1399. var reEmptyStringLeading = /\b__p \+= '';/g,
  1400. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1401. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1402. /** Used to match HTML entities and HTML characters. */
  1403. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1404. reUnescapedHtml = /[&<>"']/g,
  1405. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1406. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1407. /** Used to match template delimiters. */
  1408. var reEscape = /<%-([\s\S]+?)%>/g,
  1409. reEvaluate = /<%([\s\S]+?)%>/g,
  1410. reInterpolate = /<%=([\s\S]+?)%>/g;
  1411. /** Used to match property names within property paths. */
  1412. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1413. reIsPlainProp = /^\w*$/,
  1414. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1415. /**
  1416. * Used to match `RegExp`
  1417. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1418. */
  1419. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1420. reHasRegExpChar = RegExp(reRegExpChar.source);
  1421. /** Used to match leading whitespace. */
  1422. var reTrimStart = /^\s+/;
  1423. /** Used to match a single whitespace character. */
  1424. var reWhitespace = /\s/;
  1425. /** Used to match wrap detail comments. */
  1426. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1427. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1428. reSplitDetails = /,? & /;
  1429. /** Used to match words composed of alphanumeric characters. */
  1430. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1431. /**
  1432. * Used to validate the `validate` option in `_.template` variable.
  1433. *
  1434. * Forbids characters which could potentially change the meaning of the function argument definition:
  1435. * - "()," (modification of function parameters)
  1436. * - "=" (default value)
  1437. * - "[]{}" (destructuring of function parameters)
  1438. * - "/" (beginning of a comment)
  1439. * - whitespace
  1440. */
  1441. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1442. /** Used to match backslashes in property paths. */
  1443. var reEscapeChar = /\\(\\)?/g;
  1444. /**
  1445. * Used to match
  1446. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1447. */
  1448. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1449. /** Used to match `RegExp` flags from their coerced string values. */
  1450. var reFlags = /\w*$/;
  1451. /** Used to detect bad signed hexadecimal string values. */
  1452. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1453. /** Used to detect binary string values. */
  1454. var reIsBinary = /^0b[01]+$/i;
  1455. /** Used to detect host constructors (Safari). */
  1456. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1457. /** Used to detect octal string values. */
  1458. var reIsOctal = /^0o[0-7]+$/i;
  1459. /** Used to detect unsigned integer values. */
  1460. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1461. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1462. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1463. /** Used to ensure capturing order of template delimiters. */
  1464. var reNoMatch = /($^)/;
  1465. /** Used to match unescaped characters in compiled string literals. */
  1466. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1467. /** Used to compose unicode character classes. */
  1468. var rsAstralRange = '\\ud800-\\udfff',
  1469. rsComboMarksRange = '\\u0300-\\u036f',
  1470. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1471. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1472. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1473. rsDingbatRange = '\\u2700-\\u27bf',
  1474. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1475. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1476. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1477. rsPunctuationRange = '\\u2000-\\u206f',
  1478. 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',
  1479. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1480. rsVarRange = '\\ufe0e\\ufe0f',
  1481. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1482. /** Used to compose unicode capture groups. */
  1483. var rsApos = "['\u2019]",
  1484. rsAstral = '[' + rsAstralRange + ']',
  1485. rsBreak = '[' + rsBreakRange + ']',
  1486. rsCombo = '[' + rsComboRange + ']',
  1487. rsDigits = '\\d+',
  1488. rsDingbat = '[' + rsDingbatRange + ']',
  1489. rsLower = '[' + rsLowerRange + ']',
  1490. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1491. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1492. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1493. rsNonAstral = '[^' + rsAstralRange + ']',
  1494. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1495. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1496. rsUpper = '[' + rsUpperRange + ']',
  1497. rsZWJ = '\\u200d';
  1498. /** Used to compose unicode regexes. */
  1499. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1500. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1501. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1502. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1503. reOptMod = rsModifier + '?',
  1504. rsOptVar = '[' + rsVarRange + ']?',
  1505. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1506. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1507. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1508. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1509. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1510. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1511. /** Used to match apostrophes. */
  1512. var reApos = RegExp(rsApos, 'g');
  1513. /**
  1514. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1515. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1516. */
  1517. var reComboMark = RegExp(rsCombo, 'g');
  1518. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1519. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1520. /** Used to match complex or compound words. */
  1521. var reUnicodeWord = RegExp([
  1522. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1523. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1524. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1525. rsUpper + '+' + rsOptContrUpper,
  1526. rsOrdUpper,
  1527. rsOrdLower,
  1528. rsDigits,
  1529. rsEmoji
  1530. ].join('|'), 'g');
  1531. /** 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/). */
  1532. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1533. /** Used to detect strings that need a more robust regexp to match words. */
  1534. 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 ]/;
  1535. /** Used to assign default `context` object properties. */
  1536. var contextProps = [
  1537. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1538. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1539. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1540. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1541. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1542. ];
  1543. /** Used to make template sourceURLs easier to identify. */
  1544. var templateCounter = -1;
  1545. /** Used to identify `toStringTag` values of typed arrays. */
  1546. var typedArrayTags = {};
  1547. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1548. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1549. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1550. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1551. typedArrayTags[uint32Tag] = true;
  1552. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1553. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1554. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1555. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1556. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1557. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1558. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1559. typedArrayTags[weakMapTag] = false;
  1560. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1561. var cloneableTags = {};
  1562. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1563. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1564. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1565. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1566. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1567. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1568. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1569. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1570. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1571. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1572. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1573. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1574. cloneableTags[weakMapTag] = false;
  1575. /** Used to map Latin Unicode letters to basic Latin letters. */
  1576. var deburredLetters = {
  1577. // Latin-1 Supplement block.
  1578. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1579. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1580. '\xc7': 'C', '\xe7': 'c',
  1581. '\xd0': 'D', '\xf0': 'd',
  1582. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1583. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1584. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1585. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1586. '\xd1': 'N', '\xf1': 'n',
  1587. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1588. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1589. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1590. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1591. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1592. '\xc6': 'Ae', '\xe6': 'ae',
  1593. '\xde': 'Th', '\xfe': 'th',
  1594. '\xdf': 'ss',
  1595. // Latin Extended-A block.
  1596. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1597. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1598. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1599. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1600. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1601. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1602. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1603. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1604. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1605. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1606. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1607. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1608. '\u0134': 'J', '\u0135': 'j',
  1609. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1610. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1611. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1612. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1613. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1614. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1615. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1616. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1617. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1618. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1619. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1620. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1621. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1622. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1623. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1624. '\u0174': 'W', '\u0175': 'w',
  1625. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1626. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1627. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1628. '\u0132': 'IJ', '\u0133': 'ij',
  1629. '\u0152': 'Oe', '\u0153': 'oe',
  1630. '\u0149': "'n", '\u017f': 's'
  1631. };
  1632. /** Used to map characters to HTML entities. */
  1633. var htmlEscapes = {
  1634. '&': '&amp;',
  1635. '<': '&lt;',
  1636. '>': '&gt;',
  1637. '"': '&quot;',
  1638. "'": '&#39;'
  1639. };
  1640. /** Used to map HTML entities to characters. */
  1641. var htmlUnescapes = {
  1642. '&amp;': '&',
  1643. '&lt;': '<',
  1644. '&gt;': '>',
  1645. '&quot;': '"',
  1646. '&#39;': "'"
  1647. };
  1648. /** Used to escape characters for inclusion in compiled string literals. */
  1649. var stringEscapes = {
  1650. '\\': '\\',
  1651. "'": "'",
  1652. '\n': 'n',
  1653. '\r': 'r',
  1654. '\u2028': 'u2028',
  1655. '\u2029': 'u2029'
  1656. };
  1657. /** Built-in method references without a dependency on `root`. */
  1658. var freeParseFloat = parseFloat,
  1659. freeParseInt = parseInt;
  1660. /** Detect free variable `global` from Node.js. */
  1661. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1662. /** Detect free variable `self`. */
  1663. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1664. /** Used as a reference to the global object. */
  1665. var root = freeGlobal || freeSelf || Function('return this')();
  1666. /** Detect free variable `exports`. */
  1667. var freeExports = true && exports && !exports.nodeType && exports;
  1668. /** Detect free variable `module`. */
  1669. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1670. /** Detect the popular CommonJS extension `module.exports`. */
  1671. var moduleExports = freeModule && freeModule.exports === freeExports;
  1672. /** Detect free variable `process` from Node.js. */
  1673. var freeProcess = moduleExports && freeGlobal.process;
  1674. /** Used to access faster Node.js helpers. */
  1675. var nodeUtil = (function() {
  1676. try {
  1677. // Use `util.types` for Node.js 10+.
  1678. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1679. if (types) {
  1680. return types;
  1681. }
  1682. // Legacy `process.binding('util')` for Node.js < 10.
  1683. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1684. } catch (e) {}
  1685. }());
  1686. /* Node.js helper references. */
  1687. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1688. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1689. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1690. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1691. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1692. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1693. /*--------------------------------------------------------------------------*/
  1694. /**
  1695. * A faster alternative to `Function#apply`, this function invokes `func`
  1696. * with the `this` binding of `thisArg` and the arguments of `args`.
  1697. *
  1698. * @private
  1699. * @param {Function} func The function to invoke.
  1700. * @param {*} thisArg The `this` binding of `func`.
  1701. * @param {Array} args The arguments to invoke `func` with.
  1702. * @returns {*} Returns the result of `func`.
  1703. */
  1704. function apply(func, thisArg, args) {
  1705. switch (args.length) {
  1706. case 0: return func.call(thisArg);
  1707. case 1: return func.call(thisArg, args[0]);
  1708. case 2: return func.call(thisArg, args[0], args[1]);
  1709. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1710. }
  1711. return func.apply(thisArg, args);
  1712. }
  1713. /**
  1714. * A specialized version of `baseAggregator` for arrays.
  1715. *
  1716. * @private
  1717. * @param {Array} [array] The array to iterate over.
  1718. * @param {Function} setter The function to set `accumulator` values.
  1719. * @param {Function} iteratee The iteratee to transform keys.
  1720. * @param {Object} accumulator The initial aggregated object.
  1721. * @returns {Function} Returns `accumulator`.
  1722. */
  1723. function arrayAggregator(array, setter, iteratee, accumulator) {
  1724. var index = -1,
  1725. length = array == null ? 0 : array.length;
  1726. while (++index < length) {
  1727. var value = array[index];
  1728. setter(accumulator, value, iteratee(value), array);
  1729. }
  1730. return accumulator;
  1731. }
  1732. /**
  1733. * A specialized version of `_.forEach` for arrays without support for
  1734. * iteratee shorthands.
  1735. *
  1736. * @private
  1737. * @param {Array} [array] The array to iterate over.
  1738. * @param {Function} iteratee The function invoked per iteration.
  1739. * @returns {Array} Returns `array`.
  1740. */
  1741. function arrayEach(array, iteratee) {
  1742. var index = -1,
  1743. length = array == null ? 0 : array.length;
  1744. while (++index < length) {
  1745. if (iteratee(array[index], index, array) === false) {
  1746. break;
  1747. }
  1748. }
  1749. return array;
  1750. }
  1751. /**
  1752. * A specialized version of `_.forEachRight` for arrays without support for
  1753. * iteratee shorthands.
  1754. *
  1755. * @private
  1756. * @param {Array} [array] The array to iterate over.
  1757. * @param {Function} iteratee The function invoked per iteration.
  1758. * @returns {Array} Returns `array`.
  1759. */
  1760. function arrayEachRight(array, iteratee) {
  1761. var length = array == null ? 0 : array.length;
  1762. while (length--) {
  1763. if (iteratee(array[length], length, array) === false) {
  1764. break;
  1765. }
  1766. }
  1767. return array;
  1768. }
  1769. /**
  1770. * A specialized version of `_.every` for arrays without support for
  1771. * iteratee shorthands.
  1772. *
  1773. * @private
  1774. * @param {Array} [array] The array to iterate over.
  1775. * @param {Function} predicate The function invoked per iteration.
  1776. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1777. * else `false`.
  1778. */
  1779. function arrayEvery(array, predicate) {
  1780. var index = -1,
  1781. length = array == null ? 0 : array.length;
  1782. while (++index < length) {
  1783. if (!predicate(array[index], index, array)) {
  1784. return false;
  1785. }
  1786. }
  1787. return true;
  1788. }
  1789. /**
  1790. * A specialized version of `_.filter` for arrays without support for
  1791. * iteratee shorthands.
  1792. *
  1793. * @private
  1794. * @param {Array} [array] The array to iterate over.
  1795. * @param {Function} predicate The function invoked per iteration.
  1796. * @returns {Array} Returns the new filtered array.
  1797. */
  1798. function arrayFilter(array, predicate) {
  1799. var index = -1,
  1800. length = array == null ? 0 : array.length,
  1801. resIndex = 0,
  1802. result = [];
  1803. while (++index < length) {
  1804. var value = array[index];
  1805. if (predicate(value, index, array)) {
  1806. result[resIndex++] = value;
  1807. }
  1808. }
  1809. return result;
  1810. }
  1811. /**
  1812. * A specialized version of `_.includes` for arrays without support for
  1813. * specifying an index to search from.
  1814. *
  1815. * @private
  1816. * @param {Array} [array] The array to inspect.
  1817. * @param {*} target The value to search for.
  1818. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1819. */
  1820. function arrayIncludes(array, value) {
  1821. var length = array == null ? 0 : array.length;
  1822. return !!length && baseIndexOf(array, value, 0) > -1;
  1823. }
  1824. /**
  1825. * This function is like `arrayIncludes` except that it accepts a comparator.
  1826. *
  1827. * @private
  1828. * @param {Array} [array] The array to inspect.
  1829. * @param {*} target The value to search for.
  1830. * @param {Function} comparator The comparator invoked per element.
  1831. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1832. */
  1833. function arrayIncludesWith(array, value, comparator) {
  1834. var index = -1,
  1835. length = array == null ? 0 : array.length;
  1836. while (++index < length) {
  1837. if (comparator(value, array[index])) {
  1838. return true;
  1839. }
  1840. }
  1841. return false;
  1842. }
  1843. /**
  1844. * A specialized version of `_.map` for arrays without support for iteratee
  1845. * shorthands.
  1846. *
  1847. * @private
  1848. * @param {Array} [array] The array to iterate over.
  1849. * @param {Function} iteratee The function invoked per iteration.
  1850. * @returns {Array} Returns the new mapped array.
  1851. */
  1852. function arrayMap(array, iteratee) {
  1853. var index = -1,
  1854. length = array == null ? 0 : array.length,
  1855. result = Array(length);
  1856. while (++index < length) {
  1857. result[index] = iteratee(array[index], index, array);
  1858. }
  1859. return result;
  1860. }
  1861. /**
  1862. * Appends the elements of `values` to `array`.
  1863. *
  1864. * @private
  1865. * @param {Array} array The array to modify.
  1866. * @param {Array} values The values to append.
  1867. * @returns {Array} Returns `array`.
  1868. */
  1869. function arrayPush(array, values) {
  1870. var index = -1,
  1871. length = values.length,
  1872. offset = array.length;
  1873. while (++index < length) {
  1874. array[offset + index] = values[index];
  1875. }
  1876. return array;
  1877. }
  1878. /**
  1879. * A specialized version of `_.reduce` for arrays without support for
  1880. * iteratee shorthands.
  1881. *
  1882. * @private
  1883. * @param {Array} [array] The array to iterate over.
  1884. * @param {Function} iteratee The function invoked per iteration.
  1885. * @param {*} [accumulator] The initial value.
  1886. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1887. * the initial value.
  1888. * @returns {*} Returns the accumulated value.
  1889. */
  1890. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1891. var index = -1,
  1892. length = array == null ? 0 : array.length;
  1893. if (initAccum && length) {
  1894. accumulator = array[++index];
  1895. }
  1896. while (++index < length) {
  1897. accumulator = iteratee(accumulator, array[index], index, array);
  1898. }
  1899. return accumulator;
  1900. }
  1901. /**
  1902. * A specialized version of `_.reduceRight` for arrays without support for
  1903. * iteratee shorthands.
  1904. *
  1905. * @private
  1906. * @param {Array} [array] The array to iterate over.
  1907. * @param {Function} iteratee The function invoked per iteration.
  1908. * @param {*} [accumulator] The initial value.
  1909. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1910. * the initial value.
  1911. * @returns {*} Returns the accumulated value.
  1912. */
  1913. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1914. var length = array == null ? 0 : array.length;
  1915. if (initAccum && length) {
  1916. accumulator = array[--length];
  1917. }
  1918. while (length--) {
  1919. accumulator = iteratee(accumulator, array[length], length, array);
  1920. }
  1921. return accumulator;
  1922. }
  1923. /**
  1924. * A specialized version of `_.some` for arrays without support for iteratee
  1925. * shorthands.
  1926. *
  1927. * @private
  1928. * @param {Array} [array] The array to iterate over.
  1929. * @param {Function} predicate The function invoked per iteration.
  1930. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1931. * else `false`.
  1932. */
  1933. function arraySome(array, predicate) {
  1934. var index = -1,
  1935. length = array == null ? 0 : array.length;
  1936. while (++index < length) {
  1937. if (predicate(array[index], index, array)) {
  1938. return true;
  1939. }
  1940. }
  1941. return false;
  1942. }
  1943. /**
  1944. * Gets the size of an ASCII `string`.
  1945. *
  1946. * @private
  1947. * @param {string} string The string inspect.
  1948. * @returns {number} Returns the string size.
  1949. */
  1950. var asciiSize = baseProperty('length');
  1951. /**
  1952. * Converts an ASCII `string` to an array.
  1953. *
  1954. * @private
  1955. * @param {string} string The string to convert.
  1956. * @returns {Array} Returns the converted array.
  1957. */
  1958. function asciiToArray(string) {
  1959. return string.split('');
  1960. }
  1961. /**
  1962. * Splits an ASCII `string` into an array of its words.
  1963. *
  1964. * @private
  1965. * @param {string} The string to inspect.
  1966. * @returns {Array} Returns the words of `string`.
  1967. */
  1968. function asciiWords(string) {
  1969. return string.match(reAsciiWord) || [];
  1970. }
  1971. /**
  1972. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1973. * without support for iteratee shorthands, which iterates over `collection`
  1974. * using `eachFunc`.
  1975. *
  1976. * @private
  1977. * @param {Array|Object} collection The collection to inspect.
  1978. * @param {Function} predicate The function invoked per iteration.
  1979. * @param {Function} eachFunc The function to iterate over `collection`.
  1980. * @returns {*} Returns the found element or its key, else `undefined`.
  1981. */
  1982. function baseFindKey(collection, predicate, eachFunc) {
  1983. var result;
  1984. eachFunc(collection, function(value, key, collection) {
  1985. if (predicate(value, key, collection)) {
  1986. result = key;
  1987. return false;
  1988. }
  1989. });
  1990. return result;
  1991. }
  1992. /**
  1993. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1994. * support for iteratee shorthands.
  1995. *
  1996. * @private
  1997. * @param {Array} array The array to inspect.
  1998. * @param {Function} predicate The function invoked per iteration.
  1999. * @param {number} fromIndex The index to search from.
  2000. * @param {boolean} [fromRight] Specify iterating from right to left.
  2001. * @returns {number} Returns the index of the matched value, else `-1`.
  2002. */
  2003. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  2004. var length = array.length,
  2005. index = fromIndex + (fromRight ? 1 : -1);
  2006. while ((fromRight ? index-- : ++index < length)) {
  2007. if (predicate(array[index], index, array)) {
  2008. return index;
  2009. }
  2010. }
  2011. return -1;
  2012. }
  2013. /**
  2014. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  2015. *
  2016. * @private
  2017. * @param {Array} array The array to inspect.
  2018. * @param {*} value The value to search for.
  2019. * @param {number} fromIndex The index to search from.
  2020. * @returns {number} Returns the index of the matched value, else `-1`.
  2021. */
  2022. function baseIndexOf(array, value, fromIndex) {
  2023. return value === value
  2024. ? strictIndexOf(array, value, fromIndex)
  2025. : baseFindIndex(array, baseIsNaN, fromIndex);
  2026. }
  2027. /**
  2028. * This function is like `baseIndexOf` except that it accepts a comparator.
  2029. *
  2030. * @private
  2031. * @param {Array} array The array to inspect.
  2032. * @param {*} value The value to search for.
  2033. * @param {number} fromIndex The index to search from.
  2034. * @param {Function} comparator The comparator invoked per element.
  2035. * @returns {number} Returns the index of the matched value, else `-1`.
  2036. */
  2037. function baseIndexOfWith(array, value, fromIndex, comparator) {
  2038. var index = fromIndex - 1,
  2039. length = array.length;
  2040. while (++index < length) {
  2041. if (comparator(array[index], value)) {
  2042. return index;
  2043. }
  2044. }
  2045. return -1;
  2046. }
  2047. /**
  2048. * The base implementation of `_.isNaN` without support for number objects.
  2049. *
  2050. * @private
  2051. * @param {*} value The value to check.
  2052. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  2053. */
  2054. function baseIsNaN(value) {
  2055. return value !== value;
  2056. }
  2057. /**
  2058. * The base implementation of `_.mean` and `_.meanBy` without support for
  2059. * iteratee shorthands.
  2060. *
  2061. * @private
  2062. * @param {Array} array The array to iterate over.
  2063. * @param {Function} iteratee The function invoked per iteration.
  2064. * @returns {number} Returns the mean.
  2065. */
  2066. function baseMean(array, iteratee) {
  2067. var length = array == null ? 0 : array.length;
  2068. return length ? (baseSum(array, iteratee) / length) : NAN;
  2069. }
  2070. /**
  2071. * The base implementation of `_.property` without support for deep paths.
  2072. *
  2073. * @private
  2074. * @param {string} key The key of the property to get.
  2075. * @returns {Function} Returns the new accessor function.
  2076. */
  2077. function baseProperty(key) {
  2078. return function(object) {
  2079. return object == null ? undefined : object[key];
  2080. };
  2081. }
  2082. /**
  2083. * The base implementation of `_.propertyOf` without support for deep paths.
  2084. *
  2085. * @private
  2086. * @param {Object} object The object to query.
  2087. * @returns {Function} Returns the new accessor function.
  2088. */
  2089. function basePropertyOf(object) {
  2090. return function(key) {
  2091. return object == null ? undefined : object[key];
  2092. };
  2093. }
  2094. /**
  2095. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2096. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2097. *
  2098. * @private
  2099. * @param {Array|Object} collection The collection to iterate over.
  2100. * @param {Function} iteratee The function invoked per iteration.
  2101. * @param {*} accumulator The initial value.
  2102. * @param {boolean} initAccum Specify using the first or last element of
  2103. * `collection` as the initial value.
  2104. * @param {Function} eachFunc The function to iterate over `collection`.
  2105. * @returns {*} Returns the accumulated value.
  2106. */
  2107. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2108. eachFunc(collection, function(value, index, collection) {
  2109. accumulator = initAccum
  2110. ? (initAccum = false, value)
  2111. : iteratee(accumulator, value, index, collection);
  2112. });
  2113. return accumulator;
  2114. }
  2115. /**
  2116. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2117. * sort order of `array` and replaces criteria objects with their corresponding
  2118. * values.
  2119. *
  2120. * @private
  2121. * @param {Array} array The array to sort.
  2122. * @param {Function} comparer The function to define sort order.
  2123. * @returns {Array} Returns `array`.
  2124. */
  2125. function baseSortBy(array, comparer) {
  2126. var length = array.length;
  2127. array.sort(comparer);
  2128. while (length--) {
  2129. array[length] = array[length].value;
  2130. }
  2131. return array;
  2132. }
  2133. /**
  2134. * The base implementation of `_.sum` and `_.sumBy` without support for
  2135. * iteratee shorthands.
  2136. *
  2137. * @private
  2138. * @param {Array} array The array to iterate over.
  2139. * @param {Function} iteratee The function invoked per iteration.
  2140. * @returns {number} Returns the sum.
  2141. */
  2142. function baseSum(array, iteratee) {
  2143. var result,
  2144. index = -1,
  2145. length = array.length;
  2146. while (++index < length) {
  2147. var current = iteratee(array[index]);
  2148. if (current !== undefined) {
  2149. result = result === undefined ? current : (result + current);
  2150. }
  2151. }
  2152. return result;
  2153. }
  2154. /**
  2155. * The base implementation of `_.times` without support for iteratee shorthands
  2156. * or max array length checks.
  2157. *
  2158. * @private
  2159. * @param {number} n The number of times to invoke `iteratee`.
  2160. * @param {Function} iteratee The function invoked per iteration.
  2161. * @returns {Array} Returns the array of results.
  2162. */
  2163. function baseTimes(n, iteratee) {
  2164. var index = -1,
  2165. result = Array(n);
  2166. while (++index < n) {
  2167. result[index] = iteratee(index);
  2168. }
  2169. return result;
  2170. }
  2171. /**
  2172. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2173. * of key-value pairs for `object` corresponding to the property names of `props`.
  2174. *
  2175. * @private
  2176. * @param {Object} object The object to query.
  2177. * @param {Array} props The property names to get values for.
  2178. * @returns {Object} Returns the key-value pairs.
  2179. */
  2180. function baseToPairs(object, props) {
  2181. return arrayMap(props, function(key) {
  2182. return [key, object[key]];
  2183. });
  2184. }
  2185. /**
  2186. * The base implementation of `_.trim`.
  2187. *
  2188. * @private
  2189. * @param {string} string The string to trim.
  2190. * @returns {string} Returns the trimmed string.
  2191. */
  2192. function baseTrim(string) {
  2193. return string
  2194. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2195. : string;
  2196. }
  2197. /**
  2198. * The base implementation of `_.unary` without support for storing metadata.
  2199. *
  2200. * @private
  2201. * @param {Function} func The function to cap arguments for.
  2202. * @returns {Function} Returns the new capped function.
  2203. */
  2204. function baseUnary(func) {
  2205. return function(value) {
  2206. return func(value);
  2207. };
  2208. }
  2209. /**
  2210. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2211. * array of `object` property values corresponding to the property names
  2212. * of `props`.
  2213. *
  2214. * @private
  2215. * @param {Object} object The object to query.
  2216. * @param {Array} props The property names to get values for.
  2217. * @returns {Object} Returns the array of property values.
  2218. */
  2219. function baseValues(object, props) {
  2220. return arrayMap(props, function(key) {
  2221. return object[key];
  2222. });
  2223. }
  2224. /**
  2225. * Checks if a `cache` value for `key` exists.
  2226. *
  2227. * @private
  2228. * @param {Object} cache The cache to query.
  2229. * @param {string} key The key of the entry to check.
  2230. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2231. */
  2232. function cacheHas(cache, key) {
  2233. return cache.has(key);
  2234. }
  2235. /**
  2236. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2237. * that is not found in the character symbols.
  2238. *
  2239. * @private
  2240. * @param {Array} strSymbols The string symbols to inspect.
  2241. * @param {Array} chrSymbols The character symbols to find.
  2242. * @returns {number} Returns the index of the first unmatched string symbol.
  2243. */
  2244. function charsStartIndex(strSymbols, chrSymbols) {
  2245. var index = -1,
  2246. length = strSymbols.length;
  2247. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2248. return index;
  2249. }
  2250. /**
  2251. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2252. * that is not found in the character symbols.
  2253. *
  2254. * @private
  2255. * @param {Array} strSymbols The string symbols to inspect.
  2256. * @param {Array} chrSymbols The character symbols to find.
  2257. * @returns {number} Returns the index of the last unmatched string symbol.
  2258. */
  2259. function charsEndIndex(strSymbols, chrSymbols) {
  2260. var index = strSymbols.length;
  2261. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2262. return index;
  2263. }
  2264. /**
  2265. * Gets the number of `placeholder` occurrences in `array`.
  2266. *
  2267. * @private
  2268. * @param {Array} array The array to inspect.
  2269. * @param {*} placeholder The placeholder to search for.
  2270. * @returns {number} Returns the placeholder count.
  2271. */
  2272. function countHolders(array, placeholder) {
  2273. var length = array.length,
  2274. result = 0;
  2275. while (length--) {
  2276. if (array[length] === placeholder) {
  2277. ++result;
  2278. }
  2279. }
  2280. return result;
  2281. }
  2282. /**
  2283. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2284. * letters to basic Latin letters.
  2285. *
  2286. * @private
  2287. * @param {string} letter The matched letter to deburr.
  2288. * @returns {string} Returns the deburred letter.
  2289. */
  2290. var deburrLetter = basePropertyOf(deburredLetters);
  2291. /**
  2292. * Used by `_.escape` to convert characters to HTML entities.
  2293. *
  2294. * @private
  2295. * @param {string} chr The matched character to escape.
  2296. * @returns {string} Returns the escaped character.
  2297. */
  2298. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2299. /**
  2300. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2301. *
  2302. * @private
  2303. * @param {string} chr The matched character to escape.
  2304. * @returns {string} Returns the escaped character.
  2305. */
  2306. function escapeStringChar(chr) {
  2307. return '\\' + stringEscapes[chr];
  2308. }
  2309. /**
  2310. * Gets the value at `key` of `object`.
  2311. *
  2312. * @private
  2313. * @param {Object} [object] The object to query.
  2314. * @param {string} key The key of the property to get.
  2315. * @returns {*} Returns the property value.
  2316. */
  2317. function getValue(object, key) {
  2318. return object == null ? undefined : object[key];
  2319. }
  2320. /**
  2321. * Checks if `string` contains Unicode symbols.
  2322. *
  2323. * @private
  2324. * @param {string} string The string to inspect.
  2325. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2326. */
  2327. function hasUnicode(string) {
  2328. return reHasUnicode.test(string);
  2329. }
  2330. /**
  2331. * Checks if `string` contains a word composed of Unicode symbols.
  2332. *
  2333. * @private
  2334. * @param {string} string The string to inspect.
  2335. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2336. */
  2337. function hasUnicodeWord(string) {
  2338. return reHasUnicodeWord.test(string);
  2339. }
  2340. /**
  2341. * Converts `iterator` to an array.
  2342. *
  2343. * @private
  2344. * @param {Object} iterator The iterator to convert.
  2345. * @returns {Array} Returns the converted array.
  2346. */
  2347. function iteratorToArray(iterator) {
  2348. var data,
  2349. result = [];
  2350. while (!(data = iterator.next()).done) {
  2351. result.push(data.value);
  2352. }
  2353. return result;
  2354. }
  2355. /**
  2356. * Converts `map` to its key-value pairs.
  2357. *
  2358. * @private
  2359. * @param {Object} map The map to convert.
  2360. * @returns {Array} Returns the key-value pairs.
  2361. */
  2362. function mapToArray(map) {
  2363. var index = -1,
  2364. result = Array(map.size);
  2365. map.forEach(function(value, key) {
  2366. result[++index] = [key, value];
  2367. });
  2368. return result;
  2369. }
  2370. /**
  2371. * Creates a unary function that invokes `func` with its argument transformed.
  2372. *
  2373. * @private
  2374. * @param {Function} func The function to wrap.
  2375. * @param {Function} transform The argument transform.
  2376. * @returns {Function} Returns the new function.
  2377. */
  2378. function overArg(func, transform) {
  2379. return function(arg) {
  2380. return func(transform(arg));
  2381. };
  2382. }
  2383. /**
  2384. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2385. * and returns an array of their indexes.
  2386. *
  2387. * @private
  2388. * @param {Array} array The array to modify.
  2389. * @param {*} placeholder The placeholder to replace.
  2390. * @returns {Array} Returns the new array of placeholder indexes.
  2391. */
  2392. function replaceHolders(array, placeholder) {
  2393. var index = -1,
  2394. length = array.length,
  2395. resIndex = 0,
  2396. result = [];
  2397. while (++index < length) {
  2398. var value = array[index];
  2399. if (value === placeholder || value === PLACEHOLDER) {
  2400. array[index] = PLACEHOLDER;
  2401. result[resIndex++] = index;
  2402. }
  2403. }
  2404. return result;
  2405. }
  2406. /**
  2407. * Converts `set` to an array of its values.
  2408. *
  2409. * @private
  2410. * @param {Object} set The set to convert.
  2411. * @returns {Array} Returns the values.
  2412. */
  2413. function setToArray(set) {
  2414. var index = -1,
  2415. result = Array(set.size);
  2416. set.forEach(function(value) {
  2417. result[++index] = value;
  2418. });
  2419. return result;
  2420. }
  2421. /**
  2422. * Converts `set` to its value-value pairs.
  2423. *
  2424. * @private
  2425. * @param {Object} set The set to convert.
  2426. * @returns {Array} Returns the value-value pairs.
  2427. */
  2428. function setToPairs(set) {
  2429. var index = -1,
  2430. result = Array(set.size);
  2431. set.forEach(function(value) {
  2432. result[++index] = [value, value];
  2433. });
  2434. return result;
  2435. }
  2436. /**
  2437. * A specialized version of `_.indexOf` which performs strict equality
  2438. * comparisons of values, i.e. `===`.
  2439. *
  2440. * @private
  2441. * @param {Array} array The array to inspect.
  2442. * @param {*} value The value to search for.
  2443. * @param {number} fromIndex The index to search from.
  2444. * @returns {number} Returns the index of the matched value, else `-1`.
  2445. */
  2446. function strictIndexOf(array, value, fromIndex) {
  2447. var index = fromIndex - 1,
  2448. length = array.length;
  2449. while (++index < length) {
  2450. if (array[index] === value) {
  2451. return index;
  2452. }
  2453. }
  2454. return -1;
  2455. }
  2456. /**
  2457. * A specialized version of `_.lastIndexOf` which performs strict equality
  2458. * comparisons of values, i.e. `===`.
  2459. *
  2460. * @private
  2461. * @param {Array} array The array to inspect.
  2462. * @param {*} value The value to search for.
  2463. * @param {number} fromIndex The index to search from.
  2464. * @returns {number} Returns the index of the matched value, else `-1`.
  2465. */
  2466. function strictLastIndexOf(array, value, fromIndex) {
  2467. var index = fromIndex + 1;
  2468. while (index--) {
  2469. if (array[index] === value) {
  2470. return index;
  2471. }
  2472. }
  2473. return index;
  2474. }
  2475. /**
  2476. * Gets the number of symbols in `string`.
  2477. *
  2478. * @private
  2479. * @param {string} string The string to inspect.
  2480. * @returns {number} Returns the string size.
  2481. */
  2482. function stringSize(string) {
  2483. return hasUnicode(string)
  2484. ? unicodeSize(string)
  2485. : asciiSize(string);
  2486. }
  2487. /**
  2488. * Converts `string` to an array.
  2489. *
  2490. * @private
  2491. * @param {string} string The string to convert.
  2492. * @returns {Array} Returns the converted array.
  2493. */
  2494. function stringToArray(string) {
  2495. return hasUnicode(string)
  2496. ? unicodeToArray(string)
  2497. : asciiToArray(string);
  2498. }
  2499. /**
  2500. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2501. * character of `string`.
  2502. *
  2503. * @private
  2504. * @param {string} string The string to inspect.
  2505. * @returns {number} Returns the index of the last non-whitespace character.
  2506. */
  2507. function trimmedEndIndex(string) {
  2508. var index = string.length;
  2509. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2510. return index;
  2511. }
  2512. /**
  2513. * Used by `_.unescape` to convert HTML entities to characters.
  2514. *
  2515. * @private
  2516. * @param {string} chr The matched character to unescape.
  2517. * @returns {string} Returns the unescaped character.
  2518. */
  2519. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2520. /**
  2521. * Gets the size of a Unicode `string`.
  2522. *
  2523. * @private
  2524. * @param {string} string The string inspect.
  2525. * @returns {number} Returns the string size.
  2526. */
  2527. function unicodeSize(string) {
  2528. var result = reUnicode.lastIndex = 0;
  2529. while (reUnicode.test(string)) {
  2530. ++result;
  2531. }
  2532. return result;
  2533. }
  2534. /**
  2535. * Converts a Unicode `string` to an array.
  2536. *
  2537. * @private
  2538. * @param {string} string The string to convert.
  2539. * @returns {Array} Returns the converted array.
  2540. */
  2541. function unicodeToArray(string) {
  2542. return string.match(reUnicode) || [];
  2543. }
  2544. /**
  2545. * Splits a Unicode `string` into an array of its words.
  2546. *
  2547. * @private
  2548. * @param {string} The string to inspect.
  2549. * @returns {Array} Returns the words of `string`.
  2550. */
  2551. function unicodeWords(string) {
  2552. return string.match(reUnicodeWord) || [];
  2553. }
  2554. /*--------------------------------------------------------------------------*/
  2555. /**
  2556. * Create a new pristine `lodash` function using the `context` object.
  2557. *
  2558. * @static
  2559. * @memberOf _
  2560. * @since 1.1.0
  2561. * @category Util
  2562. * @param {Object} [context=root] The context object.
  2563. * @returns {Function} Returns a new `lodash` function.
  2564. * @example
  2565. *
  2566. * _.mixin({ 'foo': _.constant('foo') });
  2567. *
  2568. * var lodash = _.runInContext();
  2569. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2570. *
  2571. * _.isFunction(_.foo);
  2572. * // => true
  2573. * _.isFunction(_.bar);
  2574. * // => false
  2575. *
  2576. * lodash.isFunction(lodash.foo);
  2577. * // => false
  2578. * lodash.isFunction(lodash.bar);
  2579. * // => true
  2580. *
  2581. * // Create a suped-up `defer` in Node.js.
  2582. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2583. */
  2584. var runInContext = (function runInContext(context) {
  2585. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2586. /** Built-in constructor references. */
  2587. var Array = context.Array,
  2588. Date = context.Date,
  2589. Error = context.Error,
  2590. Function = context.Function,
  2591. Math = context.Math,
  2592. Object = context.Object,
  2593. RegExp = context.RegExp,
  2594. String = context.String,
  2595. TypeError = context.TypeError;
  2596. /** Used for built-in method references. */
  2597. var arrayProto = Array.prototype,
  2598. funcProto = Function.prototype,
  2599. objectProto = Object.prototype;
  2600. /** Used to detect overreaching core-js shims. */
  2601. var coreJsData = context['__core-js_shared__'];
  2602. /** Used to resolve the decompiled source of functions. */
  2603. var funcToString = funcProto.toString;
  2604. /** Used to check objects for own properties. */
  2605. var hasOwnProperty = objectProto.hasOwnProperty;
  2606. /** Used to generate unique IDs. */
  2607. var idCounter = 0;
  2608. /** Used to detect methods masquerading as native. */
  2609. var maskSrcKey = (function() {
  2610. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2611. return uid ? ('Symbol(src)_1.' + uid) : '';
  2612. }());
  2613. /**
  2614. * Used to resolve the
  2615. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2616. * of values.
  2617. */
  2618. var nativeObjectToString = objectProto.toString;
  2619. /** Used to infer the `Object` constructor. */
  2620. var objectCtorString = funcToString.call(Object);
  2621. /** Used to restore the original `_` reference in `_.noConflict`. */
  2622. var oldDash = root._;
  2623. /** Used to detect if a method is native. */
  2624. var reIsNative = RegExp('^' +
  2625. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2626. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2627. );
  2628. /** Built-in value references. */
  2629. var Buffer = moduleExports ? context.Buffer : undefined,
  2630. Symbol = context.Symbol,
  2631. Uint8Array = context.Uint8Array,
  2632. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2633. getPrototype = overArg(Object.getPrototypeOf, Object),
  2634. objectCreate = Object.create,
  2635. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2636. splice = arrayProto.splice,
  2637. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2638. symIterator = Symbol ? Symbol.iterator : undefined,
  2639. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2640. var defineProperty = (function() {
  2641. try {
  2642. var func = getNative(Object, 'defineProperty');
  2643. func({}, '', {});
  2644. return func;
  2645. } catch (e) {}
  2646. }());
  2647. /** Mocked built-ins. */
  2648. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2649. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2650. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2651. /* Built-in method references for those with the same name as other `lodash` methods. */
  2652. var nativeCeil = Math.ceil,
  2653. nativeFloor = Math.floor,
  2654. nativeGetSymbols = Object.getOwnPropertySymbols,
  2655. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2656. nativeIsFinite = context.isFinite,
  2657. nativeJoin = arrayProto.join,
  2658. nativeKeys = overArg(Object.keys, Object),
  2659. nativeMax = Math.max,
  2660. nativeMin = Math.min,
  2661. nativeNow = Date.now,
  2662. nativeParseInt = context.parseInt,
  2663. nativeRandom = Math.random,
  2664. nativeReverse = arrayProto.reverse;
  2665. /* Built-in method references that are verified to be native. */
  2666. var DataView = getNative(context, 'DataView'),
  2667. Map = getNative(context, 'Map'),
  2668. Promise = getNative(context, 'Promise'),
  2669. Set = getNative(context, 'Set'),
  2670. WeakMap = getNative(context, 'WeakMap'),
  2671. nativeCreate = getNative(Object, 'create');
  2672. /** Used to store function metadata. */
  2673. var metaMap = WeakMap && new WeakMap;
  2674. /** Used to lookup unminified function names. */
  2675. var realNames = {};
  2676. /** Used to detect maps, sets, and weakmaps. */
  2677. var dataViewCtorString = toSource(DataView),
  2678. mapCtorString = toSource(Map),
  2679. promiseCtorString = toSource(Promise),
  2680. setCtorString = toSource(Set),
  2681. weakMapCtorString = toSource(WeakMap);
  2682. /** Used to convert symbols to primitives and strings. */
  2683. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2684. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2685. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2686. /*------------------------------------------------------------------------*/
  2687. /**
  2688. * Creates a `lodash` object which wraps `value` to enable implicit method
  2689. * chain sequences. Methods that operate on and return arrays, collections,
  2690. * and functions can be chained together. Methods that retrieve a single value
  2691. * or may return a primitive value will automatically end the chain sequence
  2692. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2693. * with `_#value`.
  2694. *
  2695. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2696. * enabled using `_.chain`.
  2697. *
  2698. * The execution of chained methods is lazy, that is, it's deferred until
  2699. * `_#value` is implicitly or explicitly called.
  2700. *
  2701. * Lazy evaluation allows several methods to support shortcut fusion.
  2702. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2703. * the creation of intermediate arrays and can greatly reduce the number of
  2704. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2705. * fusion if the section is applied to an array and iteratees accept only
  2706. * one argument. The heuristic for whether a section qualifies for shortcut
  2707. * fusion is subject to change.
  2708. *
  2709. * Chaining is supported in custom builds as long as the `_#value` method is
  2710. * directly or indirectly included in the build.
  2711. *
  2712. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2713. *
  2714. * The wrapper `Array` methods are:
  2715. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2716. *
  2717. * The wrapper `String` methods are:
  2718. * `replace` and `split`
  2719. *
  2720. * The wrapper methods that support shortcut fusion are:
  2721. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2722. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2723. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2724. *
  2725. * The chainable wrapper methods are:
  2726. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2727. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2728. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2729. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2730. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2731. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2732. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2733. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2734. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2735. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2736. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2737. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2738. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2739. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2740. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2741. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2742. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2743. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2744. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2745. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2746. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2747. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2748. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2749. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2750. *
  2751. * The wrapper methods that are **not** chainable by default are:
  2752. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2753. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2754. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2755. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2756. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2757. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2758. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2759. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2760. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2761. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2762. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2763. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2764. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2765. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2766. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2767. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2768. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2769. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2770. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2771. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2772. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2773. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2774. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2775. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2776. * `upperFirst`, `value`, and `words`
  2777. *
  2778. * @name _
  2779. * @constructor
  2780. * @category Seq
  2781. * @param {*} value The value to wrap in a `lodash` instance.
  2782. * @returns {Object} Returns the new `lodash` wrapper instance.
  2783. * @example
  2784. *
  2785. * function square(n) {
  2786. * return n * n;
  2787. * }
  2788. *
  2789. * var wrapped = _([1, 2, 3]);
  2790. *
  2791. * // Returns an unwrapped value.
  2792. * wrapped.reduce(_.add);
  2793. * // => 6
  2794. *
  2795. * // Returns a wrapped value.
  2796. * var squares = wrapped.map(square);
  2797. *
  2798. * _.isArray(squares);
  2799. * // => false
  2800. *
  2801. * _.isArray(squares.value());
  2802. * // => true
  2803. */
  2804. function lodash(value) {
  2805. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2806. if (value instanceof LodashWrapper) {
  2807. return value;
  2808. }
  2809. if (hasOwnProperty.call(value, '__wrapped__')) {
  2810. return wrapperClone(value);
  2811. }
  2812. }
  2813. return new LodashWrapper(value);
  2814. }
  2815. /**
  2816. * The base implementation of `_.create` without support for assigning
  2817. * properties to the created object.
  2818. *
  2819. * @private
  2820. * @param {Object} proto The object to inherit from.
  2821. * @returns {Object} Returns the new object.
  2822. */
  2823. var baseCreate = (function() {
  2824. function object() {}
  2825. return function(proto) {
  2826. if (!isObject(proto)) {
  2827. return {};
  2828. }
  2829. if (objectCreate) {
  2830. return objectCreate(proto);
  2831. }
  2832. object.prototype = proto;
  2833. var result = new object;
  2834. object.prototype = undefined;
  2835. return result;
  2836. };
  2837. }());
  2838. /**
  2839. * The function whose prototype chain sequence wrappers inherit from.
  2840. *
  2841. * @private
  2842. */
  2843. function baseLodash() {
  2844. // No operation performed.
  2845. }
  2846. /**
  2847. * The base constructor for creating `lodash` wrapper objects.
  2848. *
  2849. * @private
  2850. * @param {*} value The value to wrap.
  2851. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2852. */
  2853. function LodashWrapper(value, chainAll) {
  2854. this.__wrapped__ = value;
  2855. this.__actions__ = [];
  2856. this.__chain__ = !!chainAll;
  2857. this.__index__ = 0;
  2858. this.__values__ = undefined;
  2859. }
  2860. /**
  2861. * By default, the template delimiters used by lodash are like those in
  2862. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2863. * following template settings to use alternative delimiters.
  2864. *
  2865. * @static
  2866. * @memberOf _
  2867. * @type {Object}
  2868. */
  2869. lodash.templateSettings = {
  2870. /**
  2871. * Used to detect `data` property values to be HTML-escaped.
  2872. *
  2873. * @memberOf _.templateSettings
  2874. * @type {RegExp}
  2875. */
  2876. 'escape': reEscape,
  2877. /**
  2878. * Used to detect code to be evaluated.
  2879. *
  2880. * @memberOf _.templateSettings
  2881. * @type {RegExp}
  2882. */
  2883. 'evaluate': reEvaluate,
  2884. /**
  2885. * Used to detect `data` property values to inject.
  2886. *
  2887. * @memberOf _.templateSettings
  2888. * @type {RegExp}
  2889. */
  2890. 'interpolate': reInterpolate,
  2891. /**
  2892. * Used to reference the data object in the template text.
  2893. *
  2894. * @memberOf _.templateSettings
  2895. * @type {string}
  2896. */
  2897. 'variable': '',
  2898. /**
  2899. * Used to import variables into the compiled template.
  2900. *
  2901. * @memberOf _.templateSettings
  2902. * @type {Object}
  2903. */
  2904. 'imports': {
  2905. /**
  2906. * A reference to the `lodash` function.
  2907. *
  2908. * @memberOf _.templateSettings.imports
  2909. * @type {Function}
  2910. */
  2911. '_': lodash
  2912. }
  2913. };
  2914. // Ensure wrappers are instances of `baseLodash`.
  2915. lodash.prototype = baseLodash.prototype;
  2916. lodash.prototype.constructor = lodash;
  2917. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2918. LodashWrapper.prototype.constructor = LodashWrapper;
  2919. /*------------------------------------------------------------------------*/
  2920. /**
  2921. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2922. *
  2923. * @private
  2924. * @constructor
  2925. * @param {*} value The value to wrap.
  2926. */
  2927. function LazyWrapper(value) {
  2928. this.__wrapped__ = value;
  2929. this.__actions__ = [];
  2930. this.__dir__ = 1;
  2931. this.__filtered__ = false;
  2932. this.__iteratees__ = [];
  2933. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2934. this.__views__ = [];
  2935. }
  2936. /**
  2937. * Creates a clone of the lazy wrapper object.
  2938. *
  2939. * @private
  2940. * @name clone
  2941. * @memberOf LazyWrapper
  2942. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2943. */
  2944. function lazyClone() {
  2945. var result = new LazyWrapper(this.__wrapped__);
  2946. result.__actions__ = copyArray(this.__actions__);
  2947. result.__dir__ = this.__dir__;
  2948. result.__filtered__ = this.__filtered__;
  2949. result.__iteratees__ = copyArray(this.__iteratees__);
  2950. result.__takeCount__ = this.__takeCount__;
  2951. result.__views__ = copyArray(this.__views__);
  2952. return result;
  2953. }
  2954. /**
  2955. * Reverses the direction of lazy iteration.
  2956. *
  2957. * @private
  2958. * @name reverse
  2959. * @memberOf LazyWrapper
  2960. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2961. */
  2962. function lazyReverse() {
  2963. if (this.__filtered__) {
  2964. var result = new LazyWrapper(this);
  2965. result.__dir__ = -1;
  2966. result.__filtered__ = true;
  2967. } else {
  2968. result = this.clone();
  2969. result.__dir__ *= -1;
  2970. }
  2971. return result;
  2972. }
  2973. /**
  2974. * Extracts the unwrapped value from its lazy wrapper.
  2975. *
  2976. * @private
  2977. * @name value
  2978. * @memberOf LazyWrapper
  2979. * @returns {*} Returns the unwrapped value.
  2980. */
  2981. function lazyValue() {
  2982. var array = this.__wrapped__.value(),
  2983. dir = this.__dir__,
  2984. isArr = isArray(array),
  2985. isRight = dir < 0,
  2986. arrLength = isArr ? array.length : 0,
  2987. view = getView(0, arrLength, this.__views__),
  2988. start = view.start,
  2989. end = view.end,
  2990. length = end - start,
  2991. index = isRight ? end : (start - 1),
  2992. iteratees = this.__iteratees__,
  2993. iterLength = iteratees.length,
  2994. resIndex = 0,
  2995. takeCount = nativeMin(length, this.__takeCount__);
  2996. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2997. return baseWrapperValue(array, this.__actions__);
  2998. }
  2999. var result = [];
  3000. outer:
  3001. while (length-- && resIndex < takeCount) {
  3002. index += dir;
  3003. var iterIndex = -1,
  3004. value = array[index];
  3005. while (++iterIndex < iterLength) {
  3006. var data = iteratees[iterIndex],
  3007. iteratee = data.iteratee,
  3008. type = data.type,
  3009. computed = iteratee(value);
  3010. if (type == LAZY_MAP_FLAG) {
  3011. value = computed;
  3012. } else if (!computed) {
  3013. if (type == LAZY_FILTER_FLAG) {
  3014. continue outer;
  3015. } else {
  3016. break outer;
  3017. }
  3018. }
  3019. }
  3020. result[resIndex++] = value;
  3021. }
  3022. return result;
  3023. }
  3024. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  3025. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  3026. LazyWrapper.prototype.constructor = LazyWrapper;
  3027. /*------------------------------------------------------------------------*/
  3028. /**
  3029. * Creates a hash object.
  3030. *
  3031. * @private
  3032. * @constructor
  3033. * @param {Array} [entries] The key-value pairs to cache.
  3034. */
  3035. function Hash(entries) {
  3036. var index = -1,
  3037. length = entries == null ? 0 : entries.length;
  3038. this.clear();
  3039. while (++index < length) {
  3040. var entry = entries[index];
  3041. this.set(entry[0], entry[1]);
  3042. }
  3043. }
  3044. /**
  3045. * Removes all key-value entries from the hash.
  3046. *
  3047. * @private
  3048. * @name clear
  3049. * @memberOf Hash
  3050. */
  3051. function hashClear() {
  3052. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3053. this.size = 0;
  3054. }
  3055. /**
  3056. * Removes `key` and its value from the hash.
  3057. *
  3058. * @private
  3059. * @name delete
  3060. * @memberOf Hash
  3061. * @param {Object} hash The hash to modify.
  3062. * @param {string} key The key of the value to remove.
  3063. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3064. */
  3065. function hashDelete(key) {
  3066. var result = this.has(key) && delete this.__data__[key];
  3067. this.size -= result ? 1 : 0;
  3068. return result;
  3069. }
  3070. /**
  3071. * Gets the hash value for `key`.
  3072. *
  3073. * @private
  3074. * @name get
  3075. * @memberOf Hash
  3076. * @param {string} key The key of the value to get.
  3077. * @returns {*} Returns the entry value.
  3078. */
  3079. function hashGet(key) {
  3080. var data = this.__data__;
  3081. if (nativeCreate) {
  3082. var result = data[key];
  3083. return result === HASH_UNDEFINED ? undefined : result;
  3084. }
  3085. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3086. }
  3087. /**
  3088. * Checks if a hash value for `key` exists.
  3089. *
  3090. * @private
  3091. * @name has
  3092. * @memberOf Hash
  3093. * @param {string} key The key of the entry to check.
  3094. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3095. */
  3096. function hashHas(key) {
  3097. var data = this.__data__;
  3098. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3099. }
  3100. /**
  3101. * Sets the hash `key` to `value`.
  3102. *
  3103. * @private
  3104. * @name set
  3105. * @memberOf Hash
  3106. * @param {string} key The key of the value to set.
  3107. * @param {*} value The value to set.
  3108. * @returns {Object} Returns the hash instance.
  3109. */
  3110. function hashSet(key, value) {
  3111. var data = this.__data__;
  3112. this.size += this.has(key) ? 0 : 1;
  3113. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3114. return this;
  3115. }
  3116. // Add methods to `Hash`.
  3117. Hash.prototype.clear = hashClear;
  3118. Hash.prototype['delete'] = hashDelete;
  3119. Hash.prototype.get = hashGet;
  3120. Hash.prototype.has = hashHas;
  3121. Hash.prototype.set = hashSet;
  3122. /*------------------------------------------------------------------------*/
  3123. /**
  3124. * Creates an list cache object.
  3125. *
  3126. * @private
  3127. * @constructor
  3128. * @param {Array} [entries] The key-value pairs to cache.
  3129. */
  3130. function ListCache(entries) {
  3131. var index = -1,
  3132. length = entries == null ? 0 : entries.length;
  3133. this.clear();
  3134. while (++index < length) {
  3135. var entry = entries[index];
  3136. this.set(entry[0], entry[1]);
  3137. }
  3138. }
  3139. /**
  3140. * Removes all key-value entries from the list cache.
  3141. *
  3142. * @private
  3143. * @name clear
  3144. * @memberOf ListCache
  3145. */
  3146. function listCacheClear() {
  3147. this.__data__ = [];
  3148. this.size = 0;
  3149. }
  3150. /**
  3151. * Removes `key` and its value from the list cache.
  3152. *
  3153. * @private
  3154. * @name delete
  3155. * @memberOf ListCache
  3156. * @param {string} key The key of the value to remove.
  3157. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3158. */
  3159. function listCacheDelete(key) {
  3160. var data = this.__data__,
  3161. index = assocIndexOf(data, key);
  3162. if (index < 0) {
  3163. return false;
  3164. }
  3165. var lastIndex = data.length - 1;
  3166. if (index == lastIndex) {
  3167. data.pop();
  3168. } else {
  3169. splice.call(data, index, 1);
  3170. }
  3171. --this.size;
  3172. return true;
  3173. }
  3174. /**
  3175. * Gets the list cache value for `key`.
  3176. *
  3177. * @private
  3178. * @name get
  3179. * @memberOf ListCache
  3180. * @param {string} key The key of the value to get.
  3181. * @returns {*} Returns the entry value.
  3182. */
  3183. function listCacheGet(key) {
  3184. var data = this.__data__,
  3185. index = assocIndexOf(data, key);
  3186. return index < 0 ? undefined : data[index][1];
  3187. }
  3188. /**
  3189. * Checks if a list cache value for `key` exists.
  3190. *
  3191. * @private
  3192. * @name has
  3193. * @memberOf ListCache
  3194. * @param {string} key The key of the entry to check.
  3195. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3196. */
  3197. function listCacheHas(key) {
  3198. return assocIndexOf(this.__data__, key) > -1;
  3199. }
  3200. /**
  3201. * Sets the list cache `key` to `value`.
  3202. *
  3203. * @private
  3204. * @name set
  3205. * @memberOf ListCache
  3206. * @param {string} key The key of the value to set.
  3207. * @param {*} value The value to set.
  3208. * @returns {Object} Returns the list cache instance.
  3209. */
  3210. function listCacheSet(key, value) {
  3211. var data = this.__data__,
  3212. index = assocIndexOf(data, key);
  3213. if (index < 0) {
  3214. ++this.size;
  3215. data.push([key, value]);
  3216. } else {
  3217. data[index][1] = value;
  3218. }
  3219. return this;
  3220. }
  3221. // Add methods to `ListCache`.
  3222. ListCache.prototype.clear = listCacheClear;
  3223. ListCache.prototype['delete'] = listCacheDelete;
  3224. ListCache.prototype.get = listCacheGet;
  3225. ListCache.prototype.has = listCacheHas;
  3226. ListCache.prototype.set = listCacheSet;
  3227. /*------------------------------------------------------------------------*/
  3228. /**
  3229. * Creates a map cache object to store key-value pairs.
  3230. *
  3231. * @private
  3232. * @constructor
  3233. * @param {Array} [entries] The key-value pairs to cache.
  3234. */
  3235. function MapCache(entries) {
  3236. var index = -1,
  3237. length = entries == null ? 0 : entries.length;
  3238. this.clear();
  3239. while (++index < length) {
  3240. var entry = entries[index];
  3241. this.set(entry[0], entry[1]);
  3242. }
  3243. }
  3244. /**
  3245. * Removes all key-value entries from the map.
  3246. *
  3247. * @private
  3248. * @name clear
  3249. * @memberOf MapCache
  3250. */
  3251. function mapCacheClear() {
  3252. this.size = 0;
  3253. this.__data__ = {
  3254. 'hash': new Hash,
  3255. 'map': new (Map || ListCache),
  3256. 'string': new Hash
  3257. };
  3258. }
  3259. /**
  3260. * Removes `key` and its value from the map.
  3261. *
  3262. * @private
  3263. * @name delete
  3264. * @memberOf MapCache
  3265. * @param {string} key The key of the value to remove.
  3266. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3267. */
  3268. function mapCacheDelete(key) {
  3269. var result = getMapData(this, key)['delete'](key);
  3270. this.size -= result ? 1 : 0;
  3271. return result;
  3272. }
  3273. /**
  3274. * Gets the map value for `key`.
  3275. *
  3276. * @private
  3277. * @name get
  3278. * @memberOf MapCache
  3279. * @param {string} key The key of the value to get.
  3280. * @returns {*} Returns the entry value.
  3281. */
  3282. function mapCacheGet(key) {
  3283. return getMapData(this, key).get(key);
  3284. }
  3285. /**
  3286. * Checks if a map value for `key` exists.
  3287. *
  3288. * @private
  3289. * @name has
  3290. * @memberOf MapCache
  3291. * @param {string} key The key of the entry to check.
  3292. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3293. */
  3294. function mapCacheHas(key) {
  3295. return getMapData(this, key).has(key);
  3296. }
  3297. /**
  3298. * Sets the map `key` to `value`.
  3299. *
  3300. * @private
  3301. * @name set
  3302. * @memberOf MapCache
  3303. * @param {string} key The key of the value to set.
  3304. * @param {*} value The value to set.
  3305. * @returns {Object} Returns the map cache instance.
  3306. */
  3307. function mapCacheSet(key, value) {
  3308. var data = getMapData(this, key),
  3309. size = data.size;
  3310. data.set(key, value);
  3311. this.size += data.size == size ? 0 : 1;
  3312. return this;
  3313. }
  3314. // Add methods to `MapCache`.
  3315. MapCache.prototype.clear = mapCacheClear;
  3316. MapCache.prototype['delete'] = mapCacheDelete;
  3317. MapCache.prototype.get = mapCacheGet;
  3318. MapCache.prototype.has = mapCacheHas;
  3319. MapCache.prototype.set = mapCacheSet;
  3320. /*------------------------------------------------------------------------*/
  3321. /**
  3322. *
  3323. * Creates an array cache object to store unique values.
  3324. *
  3325. * @private
  3326. * @constructor
  3327. * @param {Array} [values] The values to cache.
  3328. */
  3329. function SetCache(values) {
  3330. var index = -1,
  3331. length = values == null ? 0 : values.length;
  3332. this.__data__ = new MapCache;
  3333. while (++index < length) {
  3334. this.add(values[index]);
  3335. }
  3336. }
  3337. /**
  3338. * Adds `value` to the array cache.
  3339. *
  3340. * @private
  3341. * @name add
  3342. * @memberOf SetCache
  3343. * @alias push
  3344. * @param {*} value The value to cache.
  3345. * @returns {Object} Returns the cache instance.
  3346. */
  3347. function setCacheAdd(value) {
  3348. this.__data__.set(value, HASH_UNDEFINED);
  3349. return this;
  3350. }
  3351. /**
  3352. * Checks if `value` is in the array cache.
  3353. *
  3354. * @private
  3355. * @name has
  3356. * @memberOf SetCache
  3357. * @param {*} value The value to search for.
  3358. * @returns {number} Returns `true` if `value` is found, else `false`.
  3359. */
  3360. function setCacheHas(value) {
  3361. return this.__data__.has(value);
  3362. }
  3363. // Add methods to `SetCache`.
  3364. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3365. SetCache.prototype.has = setCacheHas;
  3366. /*------------------------------------------------------------------------*/
  3367. /**
  3368. * Creates a stack cache object to store key-value pairs.
  3369. *
  3370. * @private
  3371. * @constructor
  3372. * @param {Array} [entries] The key-value pairs to cache.
  3373. */
  3374. function Stack(entries) {
  3375. var data = this.__data__ = new ListCache(entries);
  3376. this.size = data.size;
  3377. }
  3378. /**
  3379. * Removes all key-value entries from the stack.
  3380. *
  3381. * @private
  3382. * @name clear
  3383. * @memberOf Stack
  3384. */
  3385. function stackClear() {
  3386. this.__data__ = new ListCache;
  3387. this.size = 0;
  3388. }
  3389. /**
  3390. * Removes `key` and its value from the stack.
  3391. *
  3392. * @private
  3393. * @name delete
  3394. * @memberOf Stack
  3395. * @param {string} key The key of the value to remove.
  3396. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3397. */
  3398. function stackDelete(key) {
  3399. var data = this.__data__,
  3400. result = data['delete'](key);
  3401. this.size = data.size;
  3402. return result;
  3403. }
  3404. /**
  3405. * Gets the stack value for `key`.
  3406. *
  3407. * @private
  3408. * @name get
  3409. * @memberOf Stack
  3410. * @param {string} key The key of the value to get.
  3411. * @returns {*} Returns the entry value.
  3412. */
  3413. function stackGet(key) {
  3414. return this.__data__.get(key);
  3415. }
  3416. /**
  3417. * Checks if a stack value for `key` exists.
  3418. *
  3419. * @private
  3420. * @name has
  3421. * @memberOf Stack
  3422. * @param {string} key The key of the entry to check.
  3423. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3424. */
  3425. function stackHas(key) {
  3426. return this.__data__.has(key);
  3427. }
  3428. /**
  3429. * Sets the stack `key` to `value`.
  3430. *
  3431. * @private
  3432. * @name set
  3433. * @memberOf Stack
  3434. * @param {string} key The key of the value to set.
  3435. * @param {*} value The value to set.
  3436. * @returns {Object} Returns the stack cache instance.
  3437. */
  3438. function stackSet(key, value) {
  3439. var data = this.__data__;
  3440. if (data instanceof ListCache) {
  3441. var pairs = data.__data__;
  3442. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3443. pairs.push([key, value]);
  3444. this.size = ++data.size;
  3445. return this;
  3446. }
  3447. data = this.__data__ = new MapCache(pairs);
  3448. }
  3449. data.set(key, value);
  3450. this.size = data.size;
  3451. return this;
  3452. }
  3453. // Add methods to `Stack`.
  3454. Stack.prototype.clear = stackClear;
  3455. Stack.prototype['delete'] = stackDelete;
  3456. Stack.prototype.get = stackGet;
  3457. Stack.prototype.has = stackHas;
  3458. Stack.prototype.set = stackSet;
  3459. /*------------------------------------------------------------------------*/
  3460. /**
  3461. * Creates an array of the enumerable property names of the array-like `value`.
  3462. *
  3463. * @private
  3464. * @param {*} value The value to query.
  3465. * @param {boolean} inherited Specify returning inherited property names.
  3466. * @returns {Array} Returns the array of property names.
  3467. */
  3468. function arrayLikeKeys(value, inherited) {
  3469. var isArr = isArray(value),
  3470. isArg = !isArr && isArguments(value),
  3471. isBuff = !isArr && !isArg && isBuffer(value),
  3472. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3473. skipIndexes = isArr || isArg || isBuff || isType,
  3474. result = skipIndexes ? baseTimes(value.length, String) : [],
  3475. length = result.length;
  3476. for (var key in value) {
  3477. if ((inherited || hasOwnProperty.call(value, key)) &&
  3478. !(skipIndexes && (
  3479. // Safari 9 has enumerable `arguments.length` in strict mode.
  3480. key == 'length' ||
  3481. // Node.js 0.10 has enumerable non-index properties on buffers.
  3482. (isBuff && (key == 'offset' || key == 'parent')) ||
  3483. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3484. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3485. // Skip index properties.
  3486. isIndex(key, length)
  3487. ))) {
  3488. result.push(key);
  3489. }
  3490. }
  3491. return result;
  3492. }
  3493. /**
  3494. * A specialized version of `_.sample` for arrays.
  3495. *
  3496. * @private
  3497. * @param {Array} array The array to sample.
  3498. * @returns {*} Returns the random element.
  3499. */
  3500. function arraySample(array) {
  3501. var length = array.length;
  3502. return length ? array[baseRandom(0, length - 1)] : undefined;
  3503. }
  3504. /**
  3505. * A specialized version of `_.sampleSize` for arrays.
  3506. *
  3507. * @private
  3508. * @param {Array} array The array to sample.
  3509. * @param {number} n The number of elements to sample.
  3510. * @returns {Array} Returns the random elements.
  3511. */
  3512. function arraySampleSize(array, n) {
  3513. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3514. }
  3515. /**
  3516. * A specialized version of `_.shuffle` for arrays.
  3517. *
  3518. * @private
  3519. * @param {Array} array The array to shuffle.
  3520. * @returns {Array} Returns the new shuffled array.
  3521. */
  3522. function arrayShuffle(array) {
  3523. return shuffleSelf(copyArray(array));
  3524. }
  3525. /**
  3526. * This function is like `assignValue` except that it doesn't assign
  3527. * `undefined` values.
  3528. *
  3529. * @private
  3530. * @param {Object} object The object to modify.
  3531. * @param {string} key The key of the property to assign.
  3532. * @param {*} value The value to assign.
  3533. */
  3534. function assignMergeValue(object, key, value) {
  3535. if ((value !== undefined && !eq(object[key], value)) ||
  3536. (value === undefined && !(key in object))) {
  3537. baseAssignValue(object, key, value);
  3538. }
  3539. }
  3540. /**
  3541. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3542. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3543. * for equality comparisons.
  3544. *
  3545. * @private
  3546. * @param {Object} object The object to modify.
  3547. * @param {string} key The key of the property to assign.
  3548. * @param {*} value The value to assign.
  3549. */
  3550. function assignValue(object, key, value) {
  3551. var objValue = object[key];
  3552. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3553. (value === undefined && !(key in object))) {
  3554. baseAssignValue(object, key, value);
  3555. }
  3556. }
  3557. /**
  3558. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3559. *
  3560. * @private
  3561. * @param {Array} array The array to inspect.
  3562. * @param {*} key The key to search for.
  3563. * @returns {number} Returns the index of the matched value, else `-1`.
  3564. */
  3565. function assocIndexOf(array, key) {
  3566. var length = array.length;
  3567. while (length--) {
  3568. if (eq(array[length][0], key)) {
  3569. return length;
  3570. }
  3571. }
  3572. return -1;
  3573. }
  3574. /**
  3575. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3576. * by `iteratee` and values set by `setter`.
  3577. *
  3578. * @private
  3579. * @param {Array|Object} collection The collection to iterate over.
  3580. * @param {Function} setter The function to set `accumulator` values.
  3581. * @param {Function} iteratee The iteratee to transform keys.
  3582. * @param {Object} accumulator The initial aggregated object.
  3583. * @returns {Function} Returns `accumulator`.
  3584. */
  3585. function baseAggregator(collection, setter, iteratee, accumulator) {
  3586. baseEach(collection, function(value, key, collection) {
  3587. setter(accumulator, value, iteratee(value), collection);
  3588. });
  3589. return accumulator;
  3590. }
  3591. /**
  3592. * The base implementation of `_.assign` without support for multiple sources
  3593. * or `customizer` functions.
  3594. *
  3595. * @private
  3596. * @param {Object} object The destination object.
  3597. * @param {Object} source The source object.
  3598. * @returns {Object} Returns `object`.
  3599. */
  3600. function baseAssign(object, source) {
  3601. return object && copyObject(source, keys(source), object);
  3602. }
  3603. /**
  3604. * The base implementation of `_.assignIn` without support for multiple sources
  3605. * or `customizer` functions.
  3606. *
  3607. * @private
  3608. * @param {Object} object The destination object.
  3609. * @param {Object} source The source object.
  3610. * @returns {Object} Returns `object`.
  3611. */
  3612. function baseAssignIn(object, source) {
  3613. return object && copyObject(source, keysIn(source), object);
  3614. }
  3615. /**
  3616. * The base implementation of `assignValue` and `assignMergeValue` without
  3617. * value checks.
  3618. *
  3619. * @private
  3620. * @param {Object} object The object to modify.
  3621. * @param {string} key The key of the property to assign.
  3622. * @param {*} value The value to assign.
  3623. */
  3624. function baseAssignValue(object, key, value) {
  3625. if (key == '__proto__' && defineProperty) {
  3626. defineProperty(object, key, {
  3627. 'configurable': true,
  3628. 'enumerable': true,
  3629. 'value': value,
  3630. 'writable': true
  3631. });
  3632. } else {
  3633. object[key] = value;
  3634. }
  3635. }
  3636. /**
  3637. * The base implementation of `_.at` without support for individual paths.
  3638. *
  3639. * @private
  3640. * @param {Object} object The object to iterate over.
  3641. * @param {string[]} paths The property paths to pick.
  3642. * @returns {Array} Returns the picked elements.
  3643. */
  3644. function baseAt(object, paths) {
  3645. var index = -1,
  3646. length = paths.length,
  3647. result = Array(length),
  3648. skip = object == null;
  3649. while (++index < length) {
  3650. result[index] = skip ? undefined : get(object, paths[index]);
  3651. }
  3652. return result;
  3653. }
  3654. /**
  3655. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3656. *
  3657. * @private
  3658. * @param {number} number The number to clamp.
  3659. * @param {number} [lower] The lower bound.
  3660. * @param {number} upper The upper bound.
  3661. * @returns {number} Returns the clamped number.
  3662. */
  3663. function baseClamp(number, lower, upper) {
  3664. if (number === number) {
  3665. if (upper !== undefined) {
  3666. number = number <= upper ? number : upper;
  3667. }
  3668. if (lower !== undefined) {
  3669. number = number >= lower ? number : lower;
  3670. }
  3671. }
  3672. return number;
  3673. }
  3674. /**
  3675. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3676. * traversed objects.
  3677. *
  3678. * @private
  3679. * @param {*} value The value to clone.
  3680. * @param {boolean} bitmask The bitmask flags.
  3681. * 1 - Deep clone
  3682. * 2 - Flatten inherited properties
  3683. * 4 - Clone symbols
  3684. * @param {Function} [customizer] The function to customize cloning.
  3685. * @param {string} [key] The key of `value`.
  3686. * @param {Object} [object] The parent object of `value`.
  3687. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3688. * @returns {*} Returns the cloned value.
  3689. */
  3690. function baseClone(value, bitmask, customizer, key, object, stack) {
  3691. var result,
  3692. isDeep = bitmask & CLONE_DEEP_FLAG,
  3693. isFlat = bitmask & CLONE_FLAT_FLAG,
  3694. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3695. if (customizer) {
  3696. result = object ? customizer(value, key, object, stack) : customizer(value);
  3697. }
  3698. if (result !== undefined) {
  3699. return result;
  3700. }
  3701. if (!isObject(value)) {
  3702. return value;
  3703. }
  3704. var isArr = isArray(value);
  3705. if (isArr) {
  3706. result = initCloneArray(value);
  3707. if (!isDeep) {
  3708. return copyArray(value, result);
  3709. }
  3710. } else {
  3711. var tag = getTag(value),
  3712. isFunc = tag == funcTag || tag == genTag;
  3713. if (isBuffer(value)) {
  3714. return cloneBuffer(value, isDeep);
  3715. }
  3716. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3717. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3718. if (!isDeep) {
  3719. return isFlat
  3720. ? copySymbolsIn(value, baseAssignIn(result, value))
  3721. : copySymbols(value, baseAssign(result, value));
  3722. }
  3723. } else {
  3724. if (!cloneableTags[tag]) {
  3725. return object ? value : {};
  3726. }
  3727. result = initCloneByTag(value, tag, isDeep);
  3728. }
  3729. }
  3730. // Check for circular references and return its corresponding clone.
  3731. stack || (stack = new Stack);
  3732. var stacked = stack.get(value);
  3733. if (stacked) {
  3734. return stacked;
  3735. }
  3736. stack.set(value, result);
  3737. if (isSet(value)) {
  3738. value.forEach(function(subValue) {
  3739. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3740. });
  3741. } else if (isMap(value)) {
  3742. value.forEach(function(subValue, key) {
  3743. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3744. });
  3745. }
  3746. var keysFunc = isFull
  3747. ? (isFlat ? getAllKeysIn : getAllKeys)
  3748. : (isFlat ? keysIn : keys);
  3749. var props = isArr ? undefined : keysFunc(value);
  3750. arrayEach(props || value, function(subValue, key) {
  3751. if (props) {
  3752. key = subValue;
  3753. subValue = value[key];
  3754. }
  3755. // Recursively populate clone (susceptible to call stack limits).
  3756. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3757. });
  3758. return result;
  3759. }
  3760. /**
  3761. * The base implementation of `_.conforms` which doesn't clone `source`.
  3762. *
  3763. * @private
  3764. * @param {Object} source The object of property predicates to conform to.
  3765. * @returns {Function} Returns the new spec function.
  3766. */
  3767. function baseConforms(source) {
  3768. var props = keys(source);
  3769. return function(object) {
  3770. return baseConformsTo(object, source, props);
  3771. };
  3772. }
  3773. /**
  3774. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3775. *
  3776. * @private
  3777. * @param {Object} object The object to inspect.
  3778. * @param {Object} source The object of property predicates to conform to.
  3779. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3780. */
  3781. function baseConformsTo(object, source, props) {
  3782. var length = props.length;
  3783. if (object == null) {
  3784. return !length;
  3785. }
  3786. object = Object(object);
  3787. while (length--) {
  3788. var key = props[length],
  3789. predicate = source[key],
  3790. value = object[key];
  3791. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3792. return false;
  3793. }
  3794. }
  3795. return true;
  3796. }
  3797. /**
  3798. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3799. * to provide to `func`.
  3800. *
  3801. * @private
  3802. * @param {Function} func The function to delay.
  3803. * @param {number} wait The number of milliseconds to delay invocation.
  3804. * @param {Array} args The arguments to provide to `func`.
  3805. * @returns {number|Object} Returns the timer id or timeout object.
  3806. */
  3807. function baseDelay(func, wait, args) {
  3808. if (typeof func != 'function') {
  3809. throw new TypeError(FUNC_ERROR_TEXT);
  3810. }
  3811. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3812. }
  3813. /**
  3814. * The base implementation of methods like `_.difference` without support
  3815. * for excluding multiple arrays or iteratee shorthands.
  3816. *
  3817. * @private
  3818. * @param {Array} array The array to inspect.
  3819. * @param {Array} values The values to exclude.
  3820. * @param {Function} [iteratee] The iteratee invoked per element.
  3821. * @param {Function} [comparator] The comparator invoked per element.
  3822. * @returns {Array} Returns the new array of filtered values.
  3823. */
  3824. function baseDifference(array, values, iteratee, comparator) {
  3825. var index = -1,
  3826. includes = arrayIncludes,
  3827. isCommon = true,
  3828. length = array.length,
  3829. result = [],
  3830. valuesLength = values.length;
  3831. if (!length) {
  3832. return result;
  3833. }
  3834. if (iteratee) {
  3835. values = arrayMap(values, baseUnary(iteratee));
  3836. }
  3837. if (comparator) {
  3838. includes = arrayIncludesWith;
  3839. isCommon = false;
  3840. }
  3841. else if (values.length >= LARGE_ARRAY_SIZE) {
  3842. includes = cacheHas;
  3843. isCommon = false;
  3844. values = new SetCache(values);
  3845. }
  3846. outer:
  3847. while (++index < length) {
  3848. var value = array[index],
  3849. computed = iteratee == null ? value : iteratee(value);
  3850. value = (comparator || value !== 0) ? value : 0;
  3851. if (isCommon && computed === computed) {
  3852. var valuesIndex = valuesLength;
  3853. while (valuesIndex--) {
  3854. if (values[valuesIndex] === computed) {
  3855. continue outer;
  3856. }
  3857. }
  3858. result.push(value);
  3859. }
  3860. else if (!includes(values, computed, comparator)) {
  3861. result.push(value);
  3862. }
  3863. }
  3864. return result;
  3865. }
  3866. /**
  3867. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3868. *
  3869. * @private
  3870. * @param {Array|Object} collection The collection to iterate over.
  3871. * @param {Function} iteratee The function invoked per iteration.
  3872. * @returns {Array|Object} Returns `collection`.
  3873. */
  3874. var baseEach = createBaseEach(baseForOwn);
  3875. /**
  3876. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3877. *
  3878. * @private
  3879. * @param {Array|Object} collection The collection to iterate over.
  3880. * @param {Function} iteratee The function invoked per iteration.
  3881. * @returns {Array|Object} Returns `collection`.
  3882. */
  3883. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3884. /**
  3885. * The base implementation of `_.every` without support for iteratee shorthands.
  3886. *
  3887. * @private
  3888. * @param {Array|Object} collection The collection to iterate over.
  3889. * @param {Function} predicate The function invoked per iteration.
  3890. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3891. * else `false`
  3892. */
  3893. function baseEvery(collection, predicate) {
  3894. var result = true;
  3895. baseEach(collection, function(value, index, collection) {
  3896. result = !!predicate(value, index, collection);
  3897. return result;
  3898. });
  3899. return result;
  3900. }
  3901. /**
  3902. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3903. * `comparator` to determine the extremum value.
  3904. *
  3905. * @private
  3906. * @param {Array} array The array to iterate over.
  3907. * @param {Function} iteratee The iteratee invoked per iteration.
  3908. * @param {Function} comparator The comparator used to compare values.
  3909. * @returns {*} Returns the extremum value.
  3910. */
  3911. function baseExtremum(array, iteratee, comparator) {
  3912. var index = -1,
  3913. length = array.length;
  3914. while (++index < length) {
  3915. var value = array[index],
  3916. current = iteratee(value);
  3917. if (current != null && (computed === undefined
  3918. ? (current === current && !isSymbol(current))
  3919. : comparator(current, computed)
  3920. )) {
  3921. var computed = current,
  3922. result = value;
  3923. }
  3924. }
  3925. return result;
  3926. }
  3927. /**
  3928. * The base implementation of `_.fill` without an iteratee call guard.
  3929. *
  3930. * @private
  3931. * @param {Array} array The array to fill.
  3932. * @param {*} value The value to fill `array` with.
  3933. * @param {number} [start=0] The start position.
  3934. * @param {number} [end=array.length] The end position.
  3935. * @returns {Array} Returns `array`.
  3936. */
  3937. function baseFill(array, value, start, end) {
  3938. var length = array.length;
  3939. start = toInteger(start);
  3940. if (start < 0) {
  3941. start = -start > length ? 0 : (length + start);
  3942. }
  3943. end = (end === undefined || end > length) ? length : toInteger(end);
  3944. if (end < 0) {
  3945. end += length;
  3946. }
  3947. end = start > end ? 0 : toLength(end);
  3948. while (start < end) {
  3949. array[start++] = value;
  3950. }
  3951. return array;
  3952. }
  3953. /**
  3954. * The base implementation of `_.filter` without support for iteratee shorthands.
  3955. *
  3956. * @private
  3957. * @param {Array|Object} collection The collection to iterate over.
  3958. * @param {Function} predicate The function invoked per iteration.
  3959. * @returns {Array} Returns the new filtered array.
  3960. */
  3961. function baseFilter(collection, predicate) {
  3962. var result = [];
  3963. baseEach(collection, function(value, index, collection) {
  3964. if (predicate(value, index, collection)) {
  3965. result.push(value);
  3966. }
  3967. });
  3968. return result;
  3969. }
  3970. /**
  3971. * The base implementation of `_.flatten` with support for restricting flattening.
  3972. *
  3973. * @private
  3974. * @param {Array} array The array to flatten.
  3975. * @param {number} depth The maximum recursion depth.
  3976. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3977. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3978. * @param {Array} [result=[]] The initial result value.
  3979. * @returns {Array} Returns the new flattened array.
  3980. */
  3981. function baseFlatten(array, depth, predicate, isStrict, result) {
  3982. var index = -1,
  3983. length = array.length;
  3984. predicate || (predicate = isFlattenable);
  3985. result || (result = []);
  3986. while (++index < length) {
  3987. var value = array[index];
  3988. if (depth > 0 && predicate(value)) {
  3989. if (depth > 1) {
  3990. // Recursively flatten arrays (susceptible to call stack limits).
  3991. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3992. } else {
  3993. arrayPush(result, value);
  3994. }
  3995. } else if (!isStrict) {
  3996. result[result.length] = value;
  3997. }
  3998. }
  3999. return result;
  4000. }
  4001. /**
  4002. * The base implementation of `baseForOwn` which iterates over `object`
  4003. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  4004. * Iteratee functions may exit iteration early by explicitly returning `false`.
  4005. *
  4006. * @private
  4007. * @param {Object} object The object to iterate over.
  4008. * @param {Function} iteratee The function invoked per iteration.
  4009. * @param {Function} keysFunc The function to get the keys of `object`.
  4010. * @returns {Object} Returns `object`.
  4011. */
  4012. var baseFor = createBaseFor();
  4013. /**
  4014. * This function is like `baseFor` except that it iterates over properties
  4015. * in the opposite order.
  4016. *
  4017. * @private
  4018. * @param {Object} object The object to iterate over.
  4019. * @param {Function} iteratee The function invoked per iteration.
  4020. * @param {Function} keysFunc The function to get the keys of `object`.
  4021. * @returns {Object} Returns `object`.
  4022. */
  4023. var baseForRight = createBaseFor(true);
  4024. /**
  4025. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  4026. *
  4027. * @private
  4028. * @param {Object} object The object to iterate over.
  4029. * @param {Function} iteratee The function invoked per iteration.
  4030. * @returns {Object} Returns `object`.
  4031. */
  4032. function baseForOwn(object, iteratee) {
  4033. return object && baseFor(object, iteratee, keys);
  4034. }
  4035. /**
  4036. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  4037. *
  4038. * @private
  4039. * @param {Object} object The object to iterate over.
  4040. * @param {Function} iteratee The function invoked per iteration.
  4041. * @returns {Object} Returns `object`.
  4042. */
  4043. function baseForOwnRight(object, iteratee) {
  4044. return object && baseForRight(object, iteratee, keys);
  4045. }
  4046. /**
  4047. * The base implementation of `_.functions` which creates an array of
  4048. * `object` function property names filtered from `props`.
  4049. *
  4050. * @private
  4051. * @param {Object} object The object to inspect.
  4052. * @param {Array} props The property names to filter.
  4053. * @returns {Array} Returns the function names.
  4054. */
  4055. function baseFunctions(object, props) {
  4056. return arrayFilter(props, function(key) {
  4057. return isFunction(object[key]);
  4058. });
  4059. }
  4060. /**
  4061. * The base implementation of `_.get` without support for default values.
  4062. *
  4063. * @private
  4064. * @param {Object} object The object to query.
  4065. * @param {Array|string} path The path of the property to get.
  4066. * @returns {*} Returns the resolved value.
  4067. */
  4068. function baseGet(object, path) {
  4069. path = castPath(path, object);
  4070. var index = 0,
  4071. length = path.length;
  4072. while (object != null && index < length) {
  4073. object = object[toKey(path[index++])];
  4074. }
  4075. return (index && index == length) ? object : undefined;
  4076. }
  4077. /**
  4078. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4079. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4080. * symbols of `object`.
  4081. *
  4082. * @private
  4083. * @param {Object} object The object to query.
  4084. * @param {Function} keysFunc The function to get the keys of `object`.
  4085. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4086. * @returns {Array} Returns the array of property names and symbols.
  4087. */
  4088. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4089. var result = keysFunc(object);
  4090. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4091. }
  4092. /**
  4093. * The base implementation of `getTag` without fallbacks for buggy environments.
  4094. *
  4095. * @private
  4096. * @param {*} value The value to query.
  4097. * @returns {string} Returns the `toStringTag`.
  4098. */
  4099. function baseGetTag(value) {
  4100. if (value == null) {
  4101. return value === undefined ? undefinedTag : nullTag;
  4102. }
  4103. return (symToStringTag && symToStringTag in Object(value))
  4104. ? getRawTag(value)
  4105. : objectToString(value);
  4106. }
  4107. /**
  4108. * The base implementation of `_.gt` which doesn't coerce arguments.
  4109. *
  4110. * @private
  4111. * @param {*} value The value to compare.
  4112. * @param {*} other The other value to compare.
  4113. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4114. * else `false`.
  4115. */
  4116. function baseGt(value, other) {
  4117. return value > other;
  4118. }
  4119. /**
  4120. * The base implementation of `_.has` without support for deep paths.
  4121. *
  4122. * @private
  4123. * @param {Object} [object] The object to query.
  4124. * @param {Array|string} key The key to check.
  4125. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4126. */
  4127. function baseHas(object, key) {
  4128. return object != null && hasOwnProperty.call(object, key);
  4129. }
  4130. /**
  4131. * The base implementation of `_.hasIn` without support for deep paths.
  4132. *
  4133. * @private
  4134. * @param {Object} [object] The object to query.
  4135. * @param {Array|string} key The key to check.
  4136. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4137. */
  4138. function baseHasIn(object, key) {
  4139. return object != null && key in Object(object);
  4140. }
  4141. /**
  4142. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4143. *
  4144. * @private
  4145. * @param {number} number The number to check.
  4146. * @param {number} start The start of the range.
  4147. * @param {number} end The end of the range.
  4148. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4149. */
  4150. function baseInRange(number, start, end) {
  4151. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4152. }
  4153. /**
  4154. * The base implementation of methods like `_.intersection`, without support
  4155. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4156. *
  4157. * @private
  4158. * @param {Array} arrays The arrays to inspect.
  4159. * @param {Function} [iteratee] The iteratee invoked per element.
  4160. * @param {Function} [comparator] The comparator invoked per element.
  4161. * @returns {Array} Returns the new array of shared values.
  4162. */
  4163. function baseIntersection(arrays, iteratee, comparator) {
  4164. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4165. length = arrays[0].length,
  4166. othLength = arrays.length,
  4167. othIndex = othLength,
  4168. caches = Array(othLength),
  4169. maxLength = Infinity,
  4170. result = [];
  4171. while (othIndex--) {
  4172. var array = arrays[othIndex];
  4173. if (othIndex && iteratee) {
  4174. array = arrayMap(array, baseUnary(iteratee));
  4175. }
  4176. maxLength = nativeMin(array.length, maxLength);
  4177. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4178. ? new SetCache(othIndex && array)
  4179. : undefined;
  4180. }
  4181. array = arrays[0];
  4182. var index = -1,
  4183. seen = caches[0];
  4184. outer:
  4185. while (++index < length && result.length < maxLength) {
  4186. var value = array[index],
  4187. computed = iteratee ? iteratee(value) : value;
  4188. value = (comparator || value !== 0) ? value : 0;
  4189. if (!(seen
  4190. ? cacheHas(seen, computed)
  4191. : includes(result, computed, comparator)
  4192. )) {
  4193. othIndex = othLength;
  4194. while (--othIndex) {
  4195. var cache = caches[othIndex];
  4196. if (!(cache
  4197. ? cacheHas(cache, computed)
  4198. : includes(arrays[othIndex], computed, comparator))
  4199. ) {
  4200. continue outer;
  4201. }
  4202. }
  4203. if (seen) {
  4204. seen.push(computed);
  4205. }
  4206. result.push(value);
  4207. }
  4208. }
  4209. return result;
  4210. }
  4211. /**
  4212. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4213. * `object` with values transformed by `iteratee` and set by `setter`.
  4214. *
  4215. * @private
  4216. * @param {Object} object The object to iterate over.
  4217. * @param {Function} setter The function to set `accumulator` values.
  4218. * @param {Function} iteratee The iteratee to transform values.
  4219. * @param {Object} accumulator The initial inverted object.
  4220. * @returns {Function} Returns `accumulator`.
  4221. */
  4222. function baseInverter(object, setter, iteratee, accumulator) {
  4223. baseForOwn(object, function(value, key, object) {
  4224. setter(accumulator, iteratee(value), key, object);
  4225. });
  4226. return accumulator;
  4227. }
  4228. /**
  4229. * The base implementation of `_.invoke` without support for individual
  4230. * method arguments.
  4231. *
  4232. * @private
  4233. * @param {Object} object The object to query.
  4234. * @param {Array|string} path The path of the method to invoke.
  4235. * @param {Array} args The arguments to invoke the method with.
  4236. * @returns {*} Returns the result of the invoked method.
  4237. */
  4238. function baseInvoke(object, path, args) {
  4239. path = castPath(path, object);
  4240. object = parent(object, path);
  4241. var func = object == null ? object : object[toKey(last(path))];
  4242. return func == null ? undefined : apply(func, object, args);
  4243. }
  4244. /**
  4245. * The base implementation of `_.isArguments`.
  4246. *
  4247. * @private
  4248. * @param {*} value The value to check.
  4249. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4250. */
  4251. function baseIsArguments(value) {
  4252. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4253. }
  4254. /**
  4255. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4256. *
  4257. * @private
  4258. * @param {*} value The value to check.
  4259. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4260. */
  4261. function baseIsArrayBuffer(value) {
  4262. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4263. }
  4264. /**
  4265. * The base implementation of `_.isDate` without Node.js optimizations.
  4266. *
  4267. * @private
  4268. * @param {*} value The value to check.
  4269. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4270. */
  4271. function baseIsDate(value) {
  4272. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4273. }
  4274. /**
  4275. * The base implementation of `_.isEqual` which supports partial comparisons
  4276. * and tracks traversed objects.
  4277. *
  4278. * @private
  4279. * @param {*} value The value to compare.
  4280. * @param {*} other The other value to compare.
  4281. * @param {boolean} bitmask The bitmask flags.
  4282. * 1 - Unordered comparison
  4283. * 2 - Partial comparison
  4284. * @param {Function} [customizer] The function to customize comparisons.
  4285. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4286. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4287. */
  4288. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4289. if (value === other) {
  4290. return true;
  4291. }
  4292. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4293. return value !== value && other !== other;
  4294. }
  4295. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4296. }
  4297. /**
  4298. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4299. * deep comparisons and tracks traversed objects enabling objects with circular
  4300. * references to be compared.
  4301. *
  4302. * @private
  4303. * @param {Object} object The object to compare.
  4304. * @param {Object} other The other object to compare.
  4305. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4306. * @param {Function} customizer The function to customize comparisons.
  4307. * @param {Function} equalFunc The function to determine equivalents of values.
  4308. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4309. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4310. */
  4311. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4312. var objIsArr = isArray(object),
  4313. othIsArr = isArray(other),
  4314. objTag = objIsArr ? arrayTag : getTag(object),
  4315. othTag = othIsArr ? arrayTag : getTag(other);
  4316. objTag = objTag == argsTag ? objectTag : objTag;
  4317. othTag = othTag == argsTag ? objectTag : othTag;
  4318. var objIsObj = objTag == objectTag,
  4319. othIsObj = othTag == objectTag,
  4320. isSameTag = objTag == othTag;
  4321. if (isSameTag && isBuffer(object)) {
  4322. if (!isBuffer(other)) {
  4323. return false;
  4324. }
  4325. objIsArr = true;
  4326. objIsObj = false;
  4327. }
  4328. if (isSameTag && !objIsObj) {
  4329. stack || (stack = new Stack);
  4330. return (objIsArr || isTypedArray(object))
  4331. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4332. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4333. }
  4334. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4335. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4336. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4337. if (objIsWrapped || othIsWrapped) {
  4338. var objUnwrapped = objIsWrapped ? object.value() : object,
  4339. othUnwrapped = othIsWrapped ? other.value() : other;
  4340. stack || (stack = new Stack);
  4341. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4342. }
  4343. }
  4344. if (!isSameTag) {
  4345. return false;
  4346. }
  4347. stack || (stack = new Stack);
  4348. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4349. }
  4350. /**
  4351. * The base implementation of `_.isMap` without Node.js optimizations.
  4352. *
  4353. * @private
  4354. * @param {*} value The value to check.
  4355. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4356. */
  4357. function baseIsMap(value) {
  4358. return isObjectLike(value) && getTag(value) == mapTag;
  4359. }
  4360. /**
  4361. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4362. *
  4363. * @private
  4364. * @param {Object} object The object to inspect.
  4365. * @param {Object} source The object of property values to match.
  4366. * @param {Array} matchData The property names, values, and compare flags to match.
  4367. * @param {Function} [customizer] The function to customize comparisons.
  4368. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4369. */
  4370. function baseIsMatch(object, source, matchData, customizer) {
  4371. var index = matchData.length,
  4372. length = index,
  4373. noCustomizer = !customizer;
  4374. if (object == null) {
  4375. return !length;
  4376. }
  4377. object = Object(object);
  4378. while (index--) {
  4379. var data = matchData[index];
  4380. if ((noCustomizer && data[2])
  4381. ? data[1] !== object[data[0]]
  4382. : !(data[0] in object)
  4383. ) {
  4384. return false;
  4385. }
  4386. }
  4387. while (++index < length) {
  4388. data = matchData[index];
  4389. var key = data[0],
  4390. objValue = object[key],
  4391. srcValue = data[1];
  4392. if (noCustomizer && data[2]) {
  4393. if (objValue === undefined && !(key in object)) {
  4394. return false;
  4395. }
  4396. } else {
  4397. var stack = new Stack;
  4398. if (customizer) {
  4399. var result = customizer(objValue, srcValue, key, object, source, stack);
  4400. }
  4401. if (!(result === undefined
  4402. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4403. : result
  4404. )) {
  4405. return false;
  4406. }
  4407. }
  4408. }
  4409. return true;
  4410. }
  4411. /**
  4412. * The base implementation of `_.isNative` without bad shim checks.
  4413. *
  4414. * @private
  4415. * @param {*} value The value to check.
  4416. * @returns {boolean} Returns `true` if `value` is a native function,
  4417. * else `false`.
  4418. */
  4419. function baseIsNative(value) {
  4420. if (!isObject(value) || isMasked(value)) {
  4421. return false;
  4422. }
  4423. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4424. return pattern.test(toSource(value));
  4425. }
  4426. /**
  4427. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4428. *
  4429. * @private
  4430. * @param {*} value The value to check.
  4431. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4432. */
  4433. function baseIsRegExp(value) {
  4434. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4435. }
  4436. /**
  4437. * The base implementation of `_.isSet` without Node.js optimizations.
  4438. *
  4439. * @private
  4440. * @param {*} value The value to check.
  4441. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4442. */
  4443. function baseIsSet(value) {
  4444. return isObjectLike(value) && getTag(value) == setTag;
  4445. }
  4446. /**
  4447. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4448. *
  4449. * @private
  4450. * @param {*} value The value to check.
  4451. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4452. */
  4453. function baseIsTypedArray(value) {
  4454. return isObjectLike(value) &&
  4455. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4456. }
  4457. /**
  4458. * The base implementation of `_.iteratee`.
  4459. *
  4460. * @private
  4461. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4462. * @returns {Function} Returns the iteratee.
  4463. */
  4464. function baseIteratee(value) {
  4465. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4466. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4467. if (typeof value == 'function') {
  4468. return value;
  4469. }
  4470. if (value == null) {
  4471. return identity;
  4472. }
  4473. if (typeof value == 'object') {
  4474. return isArray(value)
  4475. ? baseMatchesProperty(value[0], value[1])
  4476. : baseMatches(value);
  4477. }
  4478. return property(value);
  4479. }
  4480. /**
  4481. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4482. *
  4483. * @private
  4484. * @param {Object} object The object to query.
  4485. * @returns {Array} Returns the array of property names.
  4486. */
  4487. function baseKeys(object) {
  4488. if (!isPrototype(object)) {
  4489. return nativeKeys(object);
  4490. }
  4491. var result = [];
  4492. for (var key in Object(object)) {
  4493. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4494. result.push(key);
  4495. }
  4496. }
  4497. return result;
  4498. }
  4499. /**
  4500. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4501. *
  4502. * @private
  4503. * @param {Object} object The object to query.
  4504. * @returns {Array} Returns the array of property names.
  4505. */
  4506. function baseKeysIn(object) {
  4507. if (!isObject(object)) {
  4508. return nativeKeysIn(object);
  4509. }
  4510. var isProto = isPrototype(object),
  4511. result = [];
  4512. for (var key in object) {
  4513. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4514. result.push(key);
  4515. }
  4516. }
  4517. return result;
  4518. }
  4519. /**
  4520. * The base implementation of `_.lt` which doesn't coerce arguments.
  4521. *
  4522. * @private
  4523. * @param {*} value The value to compare.
  4524. * @param {*} other The other value to compare.
  4525. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4526. * else `false`.
  4527. */
  4528. function baseLt(value, other) {
  4529. return value < other;
  4530. }
  4531. /**
  4532. * The base implementation of `_.map` without support for iteratee shorthands.
  4533. *
  4534. * @private
  4535. * @param {Array|Object} collection The collection to iterate over.
  4536. * @param {Function} iteratee The function invoked per iteration.
  4537. * @returns {Array} Returns the new mapped array.
  4538. */
  4539. function baseMap(collection, iteratee) {
  4540. var index = -1,
  4541. result = isArrayLike(collection) ? Array(collection.length) : [];
  4542. baseEach(collection, function(value, key, collection) {
  4543. result[++index] = iteratee(value, key, collection);
  4544. });
  4545. return result;
  4546. }
  4547. /**
  4548. * The base implementation of `_.matches` which doesn't clone `source`.
  4549. *
  4550. * @private
  4551. * @param {Object} source The object of property values to match.
  4552. * @returns {Function} Returns the new spec function.
  4553. */
  4554. function baseMatches(source) {
  4555. var matchData = getMatchData(source);
  4556. if (matchData.length == 1 && matchData[0][2]) {
  4557. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4558. }
  4559. return function(object) {
  4560. return object === source || baseIsMatch(object, source, matchData);
  4561. };
  4562. }
  4563. /**
  4564. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4565. *
  4566. * @private
  4567. * @param {string} path The path of the property to get.
  4568. * @param {*} srcValue The value to match.
  4569. * @returns {Function} Returns the new spec function.
  4570. */
  4571. function baseMatchesProperty(path, srcValue) {
  4572. if (isKey(path) && isStrictComparable(srcValue)) {
  4573. return matchesStrictComparable(toKey(path), srcValue);
  4574. }
  4575. return function(object) {
  4576. var objValue = get(object, path);
  4577. return (objValue === undefined && objValue === srcValue)
  4578. ? hasIn(object, path)
  4579. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4580. };
  4581. }
  4582. /**
  4583. * The base implementation of `_.merge` without support for multiple sources.
  4584. *
  4585. * @private
  4586. * @param {Object} object The destination object.
  4587. * @param {Object} source The source object.
  4588. * @param {number} srcIndex The index of `source`.
  4589. * @param {Function} [customizer] The function to customize merged values.
  4590. * @param {Object} [stack] Tracks traversed source values and their merged
  4591. * counterparts.
  4592. */
  4593. function baseMerge(object, source, srcIndex, customizer, stack) {
  4594. if (object === source) {
  4595. return;
  4596. }
  4597. baseFor(source, function(srcValue, key) {
  4598. stack || (stack = new Stack);
  4599. if (isObject(srcValue)) {
  4600. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4601. }
  4602. else {
  4603. var newValue = customizer
  4604. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4605. : undefined;
  4606. if (newValue === undefined) {
  4607. newValue = srcValue;
  4608. }
  4609. assignMergeValue(object, key, newValue);
  4610. }
  4611. }, keysIn);
  4612. }
  4613. /**
  4614. * A specialized version of `baseMerge` for arrays and objects which performs
  4615. * deep merges and tracks traversed objects enabling objects with circular
  4616. * references to be merged.
  4617. *
  4618. * @private
  4619. * @param {Object} object The destination object.
  4620. * @param {Object} source The source object.
  4621. * @param {string} key The key of the value to merge.
  4622. * @param {number} srcIndex The index of `source`.
  4623. * @param {Function} mergeFunc The function to merge values.
  4624. * @param {Function} [customizer] The function to customize assigned values.
  4625. * @param {Object} [stack] Tracks traversed source values and their merged
  4626. * counterparts.
  4627. */
  4628. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4629. var objValue = safeGet(object, key),
  4630. srcValue = safeGet(source, key),
  4631. stacked = stack.get(srcValue);
  4632. if (stacked) {
  4633. assignMergeValue(object, key, stacked);
  4634. return;
  4635. }
  4636. var newValue = customizer
  4637. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4638. : undefined;
  4639. var isCommon = newValue === undefined;
  4640. if (isCommon) {
  4641. var isArr = isArray(srcValue),
  4642. isBuff = !isArr && isBuffer(srcValue),
  4643. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4644. newValue = srcValue;
  4645. if (isArr || isBuff || isTyped) {
  4646. if (isArray(objValue)) {
  4647. newValue = objValue;
  4648. }
  4649. else if (isArrayLikeObject(objValue)) {
  4650. newValue = copyArray(objValue);
  4651. }
  4652. else if (isBuff) {
  4653. isCommon = false;
  4654. newValue = cloneBuffer(srcValue, true);
  4655. }
  4656. else if (isTyped) {
  4657. isCommon = false;
  4658. newValue = cloneTypedArray(srcValue, true);
  4659. }
  4660. else {
  4661. newValue = [];
  4662. }
  4663. }
  4664. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4665. newValue = objValue;
  4666. if (isArguments(objValue)) {
  4667. newValue = toPlainObject(objValue);
  4668. }
  4669. else if (!isObject(objValue) || isFunction(objValue)) {
  4670. newValue = initCloneObject(srcValue);
  4671. }
  4672. }
  4673. else {
  4674. isCommon = false;
  4675. }
  4676. }
  4677. if (isCommon) {
  4678. // Recursively merge objects and arrays (susceptible to call stack limits).
  4679. stack.set(srcValue, newValue);
  4680. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4681. stack['delete'](srcValue);
  4682. }
  4683. assignMergeValue(object, key, newValue);
  4684. }
  4685. /**
  4686. * The base implementation of `_.nth` which doesn't coerce arguments.
  4687. *
  4688. * @private
  4689. * @param {Array} array The array to query.
  4690. * @param {number} n The index of the element to return.
  4691. * @returns {*} Returns the nth element of `array`.
  4692. */
  4693. function baseNth(array, n) {
  4694. var length = array.length;
  4695. if (!length) {
  4696. return;
  4697. }
  4698. n += n < 0 ? length : 0;
  4699. return isIndex(n, length) ? array[n] : undefined;
  4700. }
  4701. /**
  4702. * The base implementation of `_.orderBy` without param guards.
  4703. *
  4704. * @private
  4705. * @param {Array|Object} collection The collection to iterate over.
  4706. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4707. * @param {string[]} orders The sort orders of `iteratees`.
  4708. * @returns {Array} Returns the new sorted array.
  4709. */
  4710. function baseOrderBy(collection, iteratees, orders) {
  4711. if (iteratees.length) {
  4712. iteratees = arrayMap(iteratees, function(iteratee) {
  4713. if (isArray(iteratee)) {
  4714. return function(value) {
  4715. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4716. }
  4717. }
  4718. return iteratee;
  4719. });
  4720. } else {
  4721. iteratees = [identity];
  4722. }
  4723. var index = -1;
  4724. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4725. var result = baseMap(collection, function(value, key, collection) {
  4726. var criteria = arrayMap(iteratees, function(iteratee) {
  4727. return iteratee(value);
  4728. });
  4729. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4730. });
  4731. return baseSortBy(result, function(object, other) {
  4732. return compareMultiple(object, other, orders);
  4733. });
  4734. }
  4735. /**
  4736. * The base implementation of `_.pick` without support for individual
  4737. * property identifiers.
  4738. *
  4739. * @private
  4740. * @param {Object} object The source object.
  4741. * @param {string[]} paths The property paths to pick.
  4742. * @returns {Object} Returns the new object.
  4743. */
  4744. function basePick(object, paths) {
  4745. return basePickBy(object, paths, function(value, path) {
  4746. return hasIn(object, path);
  4747. });
  4748. }
  4749. /**
  4750. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4751. *
  4752. * @private
  4753. * @param {Object} object The source object.
  4754. * @param {string[]} paths The property paths to pick.
  4755. * @param {Function} predicate The function invoked per property.
  4756. * @returns {Object} Returns the new object.
  4757. */
  4758. function basePickBy(object, paths, predicate) {
  4759. var index = -1,
  4760. length = paths.length,
  4761. result = {};
  4762. while (++index < length) {
  4763. var path = paths[index],
  4764. value = baseGet(object, path);
  4765. if (predicate(value, path)) {
  4766. baseSet(result, castPath(path, object), value);
  4767. }
  4768. }
  4769. return result;
  4770. }
  4771. /**
  4772. * A specialized version of `baseProperty` which supports deep paths.
  4773. *
  4774. * @private
  4775. * @param {Array|string} path The path of the property to get.
  4776. * @returns {Function} Returns the new accessor function.
  4777. */
  4778. function basePropertyDeep(path) {
  4779. return function(object) {
  4780. return baseGet(object, path);
  4781. };
  4782. }
  4783. /**
  4784. * The base implementation of `_.pullAllBy` without support for iteratee
  4785. * shorthands.
  4786. *
  4787. * @private
  4788. * @param {Array} array The array to modify.
  4789. * @param {Array} values The values to remove.
  4790. * @param {Function} [iteratee] The iteratee invoked per element.
  4791. * @param {Function} [comparator] The comparator invoked per element.
  4792. * @returns {Array} Returns `array`.
  4793. */
  4794. function basePullAll(array, values, iteratee, comparator) {
  4795. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4796. index = -1,
  4797. length = values.length,
  4798. seen = array;
  4799. if (array === values) {
  4800. values = copyArray(values);
  4801. }
  4802. if (iteratee) {
  4803. seen = arrayMap(array, baseUnary(iteratee));
  4804. }
  4805. while (++index < length) {
  4806. var fromIndex = 0,
  4807. value = values[index],
  4808. computed = iteratee ? iteratee(value) : value;
  4809. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4810. if (seen !== array) {
  4811. splice.call(seen, fromIndex, 1);
  4812. }
  4813. splice.call(array, fromIndex, 1);
  4814. }
  4815. }
  4816. return array;
  4817. }
  4818. /**
  4819. * The base implementation of `_.pullAt` without support for individual
  4820. * indexes or capturing the removed elements.
  4821. *
  4822. * @private
  4823. * @param {Array} array The array to modify.
  4824. * @param {number[]} indexes The indexes of elements to remove.
  4825. * @returns {Array} Returns `array`.
  4826. */
  4827. function basePullAt(array, indexes) {
  4828. var length = array ? indexes.length : 0,
  4829. lastIndex = length - 1;
  4830. while (length--) {
  4831. var index = indexes[length];
  4832. if (length == lastIndex || index !== previous) {
  4833. var previous = index;
  4834. if (isIndex(index)) {
  4835. splice.call(array, index, 1);
  4836. } else {
  4837. baseUnset(array, index);
  4838. }
  4839. }
  4840. }
  4841. return array;
  4842. }
  4843. /**
  4844. * The base implementation of `_.random` without support for returning
  4845. * floating-point numbers.
  4846. *
  4847. * @private
  4848. * @param {number} lower The lower bound.
  4849. * @param {number} upper The upper bound.
  4850. * @returns {number} Returns the random number.
  4851. */
  4852. function baseRandom(lower, upper) {
  4853. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4854. }
  4855. /**
  4856. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4857. * coerce arguments.
  4858. *
  4859. * @private
  4860. * @param {number} start The start of the range.
  4861. * @param {number} end The end of the range.
  4862. * @param {number} step The value to increment or decrement by.
  4863. * @param {boolean} [fromRight] Specify iterating from right to left.
  4864. * @returns {Array} Returns the range of numbers.
  4865. */
  4866. function baseRange(start, end, step, fromRight) {
  4867. var index = -1,
  4868. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4869. result = Array(length);
  4870. while (length--) {
  4871. result[fromRight ? length : ++index] = start;
  4872. start += step;
  4873. }
  4874. return result;
  4875. }
  4876. /**
  4877. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4878. *
  4879. * @private
  4880. * @param {string} string The string to repeat.
  4881. * @param {number} n The number of times to repeat the string.
  4882. * @returns {string} Returns the repeated string.
  4883. */
  4884. function baseRepeat(string, n) {
  4885. var result = '';
  4886. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4887. return result;
  4888. }
  4889. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4890. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4891. do {
  4892. if (n % 2) {
  4893. result += string;
  4894. }
  4895. n = nativeFloor(n / 2);
  4896. if (n) {
  4897. string += string;
  4898. }
  4899. } while (n);
  4900. return result;
  4901. }
  4902. /**
  4903. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4904. *
  4905. * @private
  4906. * @param {Function} func The function to apply a rest parameter to.
  4907. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4908. * @returns {Function} Returns the new function.
  4909. */
  4910. function baseRest(func, start) {
  4911. return setToString(overRest(func, start, identity), func + '');
  4912. }
  4913. /**
  4914. * The base implementation of `_.sample`.
  4915. *
  4916. * @private
  4917. * @param {Array|Object} collection The collection to sample.
  4918. * @returns {*} Returns the random element.
  4919. */
  4920. function baseSample(collection) {
  4921. return arraySample(values(collection));
  4922. }
  4923. /**
  4924. * The base implementation of `_.sampleSize` without param guards.
  4925. *
  4926. * @private
  4927. * @param {Array|Object} collection The collection to sample.
  4928. * @param {number} n The number of elements to sample.
  4929. * @returns {Array} Returns the random elements.
  4930. */
  4931. function baseSampleSize(collection, n) {
  4932. var array = values(collection);
  4933. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4934. }
  4935. /**
  4936. * The base implementation of `_.set`.
  4937. *
  4938. * @private
  4939. * @param {Object} object The object to modify.
  4940. * @param {Array|string} path The path of the property to set.
  4941. * @param {*} value The value to set.
  4942. * @param {Function} [customizer] The function to customize path creation.
  4943. * @returns {Object} Returns `object`.
  4944. */
  4945. function baseSet(object, path, value, customizer) {
  4946. if (!isObject(object)) {
  4947. return object;
  4948. }
  4949. path = castPath(path, object);
  4950. var index = -1,
  4951. length = path.length,
  4952. lastIndex = length - 1,
  4953. nested = object;
  4954. while (nested != null && ++index < length) {
  4955. var key = toKey(path[index]),
  4956. newValue = value;
  4957. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4958. return object;
  4959. }
  4960. if (index != lastIndex) {
  4961. var objValue = nested[key];
  4962. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4963. if (newValue === undefined) {
  4964. newValue = isObject(objValue)
  4965. ? objValue
  4966. : (isIndex(path[index + 1]) ? [] : {});
  4967. }
  4968. }
  4969. assignValue(nested, key, newValue);
  4970. nested = nested[key];
  4971. }
  4972. return object;
  4973. }
  4974. /**
  4975. * The base implementation of `setData` without support for hot loop shorting.
  4976. *
  4977. * @private
  4978. * @param {Function} func The function to associate metadata with.
  4979. * @param {*} data The metadata.
  4980. * @returns {Function} Returns `func`.
  4981. */
  4982. var baseSetData = !metaMap ? identity : function(func, data) {
  4983. metaMap.set(func, data);
  4984. return func;
  4985. };
  4986. /**
  4987. * The base implementation of `setToString` without support for hot loop shorting.
  4988. *
  4989. * @private
  4990. * @param {Function} func The function to modify.
  4991. * @param {Function} string The `toString` result.
  4992. * @returns {Function} Returns `func`.
  4993. */
  4994. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4995. return defineProperty(func, 'toString', {
  4996. 'configurable': true,
  4997. 'enumerable': false,
  4998. 'value': constant(string),
  4999. 'writable': true
  5000. });
  5001. };
  5002. /**
  5003. * The base implementation of `_.shuffle`.
  5004. *
  5005. * @private
  5006. * @param {Array|Object} collection The collection to shuffle.
  5007. * @returns {Array} Returns the new shuffled array.
  5008. */
  5009. function baseShuffle(collection) {
  5010. return shuffleSelf(values(collection));
  5011. }
  5012. /**
  5013. * The base implementation of `_.slice` without an iteratee call guard.
  5014. *
  5015. * @private
  5016. * @param {Array} array The array to slice.
  5017. * @param {number} [start=0] The start position.
  5018. * @param {number} [end=array.length] The end position.
  5019. * @returns {Array} Returns the slice of `array`.
  5020. */
  5021. function baseSlice(array, start, end) {
  5022. var index = -1,
  5023. length = array.length;
  5024. if (start < 0) {
  5025. start = -start > length ? 0 : (length + start);
  5026. }
  5027. end = end > length ? length : end;
  5028. if (end < 0) {
  5029. end += length;
  5030. }
  5031. length = start > end ? 0 : ((end - start) >>> 0);
  5032. start >>>= 0;
  5033. var result = Array(length);
  5034. while (++index < length) {
  5035. result[index] = array[index + start];
  5036. }
  5037. return result;
  5038. }
  5039. /**
  5040. * The base implementation of `_.some` without support for iteratee shorthands.
  5041. *
  5042. * @private
  5043. * @param {Array|Object} collection The collection to iterate over.
  5044. * @param {Function} predicate The function invoked per iteration.
  5045. * @returns {boolean} Returns `true` if any element passes the predicate check,
  5046. * else `false`.
  5047. */
  5048. function baseSome(collection, predicate) {
  5049. var result;
  5050. baseEach(collection, function(value, index, collection) {
  5051. result = predicate(value, index, collection);
  5052. return !result;
  5053. });
  5054. return !!result;
  5055. }
  5056. /**
  5057. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5058. * performs a binary search of `array` to determine the index at which `value`
  5059. * should be inserted into `array` in order to maintain its sort order.
  5060. *
  5061. * @private
  5062. * @param {Array} array The sorted array to inspect.
  5063. * @param {*} value The value to evaluate.
  5064. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5065. * @returns {number} Returns the index at which `value` should be inserted
  5066. * into `array`.
  5067. */
  5068. function baseSortedIndex(array, value, retHighest) {
  5069. var low = 0,
  5070. high = array == null ? low : array.length;
  5071. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5072. while (low < high) {
  5073. var mid = (low + high) >>> 1,
  5074. computed = array[mid];
  5075. if (computed !== null && !isSymbol(computed) &&
  5076. (retHighest ? (computed <= value) : (computed < value))) {
  5077. low = mid + 1;
  5078. } else {
  5079. high = mid;
  5080. }
  5081. }
  5082. return high;
  5083. }
  5084. return baseSortedIndexBy(array, value, identity, retHighest);
  5085. }
  5086. /**
  5087. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5088. * which invokes `iteratee` for `value` and each element of `array` to compute
  5089. * their sort ranking. The iteratee is invoked with one argument; (value).
  5090. *
  5091. * @private
  5092. * @param {Array} array The sorted array to inspect.
  5093. * @param {*} value The value to evaluate.
  5094. * @param {Function} iteratee The iteratee invoked per element.
  5095. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5096. * @returns {number} Returns the index at which `value` should be inserted
  5097. * into `array`.
  5098. */
  5099. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5100. var low = 0,
  5101. high = array == null ? 0 : array.length;
  5102. if (high === 0) {
  5103. return 0;
  5104. }
  5105. value = iteratee(value);
  5106. var valIsNaN = value !== value,
  5107. valIsNull = value === null,
  5108. valIsSymbol = isSymbol(value),
  5109. valIsUndefined = value === undefined;
  5110. while (low < high) {
  5111. var mid = nativeFloor((low + high) / 2),
  5112. computed = iteratee(array[mid]),
  5113. othIsDefined = computed !== undefined,
  5114. othIsNull = computed === null,
  5115. othIsReflexive = computed === computed,
  5116. othIsSymbol = isSymbol(computed);
  5117. if (valIsNaN) {
  5118. var setLow = retHighest || othIsReflexive;
  5119. } else if (valIsUndefined) {
  5120. setLow = othIsReflexive && (retHighest || othIsDefined);
  5121. } else if (valIsNull) {
  5122. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5123. } else if (valIsSymbol) {
  5124. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5125. } else if (othIsNull || othIsSymbol) {
  5126. setLow = false;
  5127. } else {
  5128. setLow = retHighest ? (computed <= value) : (computed < value);
  5129. }
  5130. if (setLow) {
  5131. low = mid + 1;
  5132. } else {
  5133. high = mid;
  5134. }
  5135. }
  5136. return nativeMin(high, MAX_ARRAY_INDEX);
  5137. }
  5138. /**
  5139. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5140. * support for iteratee shorthands.
  5141. *
  5142. * @private
  5143. * @param {Array} array The array to inspect.
  5144. * @param {Function} [iteratee] The iteratee invoked per element.
  5145. * @returns {Array} Returns the new duplicate free array.
  5146. */
  5147. function baseSortedUniq(array, iteratee) {
  5148. var index = -1,
  5149. length = array.length,
  5150. resIndex = 0,
  5151. result = [];
  5152. while (++index < length) {
  5153. var value = array[index],
  5154. computed = iteratee ? iteratee(value) : value;
  5155. if (!index || !eq(computed, seen)) {
  5156. var seen = computed;
  5157. result[resIndex++] = value === 0 ? 0 : value;
  5158. }
  5159. }
  5160. return result;
  5161. }
  5162. /**
  5163. * The base implementation of `_.toNumber` which doesn't ensure correct
  5164. * conversions of binary, hexadecimal, or octal string values.
  5165. *
  5166. * @private
  5167. * @param {*} value The value to process.
  5168. * @returns {number} Returns the number.
  5169. */
  5170. function baseToNumber(value) {
  5171. if (typeof value == 'number') {
  5172. return value;
  5173. }
  5174. if (isSymbol(value)) {
  5175. return NAN;
  5176. }
  5177. return +value;
  5178. }
  5179. /**
  5180. * The base implementation of `_.toString` which doesn't convert nullish
  5181. * values to empty strings.
  5182. *
  5183. * @private
  5184. * @param {*} value The value to process.
  5185. * @returns {string} Returns the string.
  5186. */
  5187. function baseToString(value) {
  5188. // Exit early for strings to avoid a performance hit in some environments.
  5189. if (typeof value == 'string') {
  5190. return value;
  5191. }
  5192. if (isArray(value)) {
  5193. // Recursively convert values (susceptible to call stack limits).
  5194. return arrayMap(value, baseToString) + '';
  5195. }
  5196. if (isSymbol(value)) {
  5197. return symbolToString ? symbolToString.call(value) : '';
  5198. }
  5199. var result = (value + '');
  5200. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5201. }
  5202. /**
  5203. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5204. *
  5205. * @private
  5206. * @param {Array} array The array to inspect.
  5207. * @param {Function} [iteratee] The iteratee invoked per element.
  5208. * @param {Function} [comparator] The comparator invoked per element.
  5209. * @returns {Array} Returns the new duplicate free array.
  5210. */
  5211. function baseUniq(array, iteratee, comparator) {
  5212. var index = -1,
  5213. includes = arrayIncludes,
  5214. length = array.length,
  5215. isCommon = true,
  5216. result = [],
  5217. seen = result;
  5218. if (comparator) {
  5219. isCommon = false;
  5220. includes = arrayIncludesWith;
  5221. }
  5222. else if (length >= LARGE_ARRAY_SIZE) {
  5223. var set = iteratee ? null : createSet(array);
  5224. if (set) {
  5225. return setToArray(set);
  5226. }
  5227. isCommon = false;
  5228. includes = cacheHas;
  5229. seen = new SetCache;
  5230. }
  5231. else {
  5232. seen = iteratee ? [] : result;
  5233. }
  5234. outer:
  5235. while (++index < length) {
  5236. var value = array[index],
  5237. computed = iteratee ? iteratee(value) : value;
  5238. value = (comparator || value !== 0) ? value : 0;
  5239. if (isCommon && computed === computed) {
  5240. var seenIndex = seen.length;
  5241. while (seenIndex--) {
  5242. if (seen[seenIndex] === computed) {
  5243. continue outer;
  5244. }
  5245. }
  5246. if (iteratee) {
  5247. seen.push(computed);
  5248. }
  5249. result.push(value);
  5250. }
  5251. else if (!includes(seen, computed, comparator)) {
  5252. if (seen !== result) {
  5253. seen.push(computed);
  5254. }
  5255. result.push(value);
  5256. }
  5257. }
  5258. return result;
  5259. }
  5260. /**
  5261. * The base implementation of `_.unset`.
  5262. *
  5263. * @private
  5264. * @param {Object} object The object to modify.
  5265. * @param {Array|string} path The property path to unset.
  5266. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5267. */
  5268. function baseUnset(object, path) {
  5269. path = castPath(path, object);
  5270. object = parent(object, path);
  5271. return object == null || delete object[toKey(last(path))];
  5272. }
  5273. /**
  5274. * The base implementation of `_.update`.
  5275. *
  5276. * @private
  5277. * @param {Object} object The object to modify.
  5278. * @param {Array|string} path The path of the property to update.
  5279. * @param {Function} updater The function to produce the updated value.
  5280. * @param {Function} [customizer] The function to customize path creation.
  5281. * @returns {Object} Returns `object`.
  5282. */
  5283. function baseUpdate(object, path, updater, customizer) {
  5284. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5285. }
  5286. /**
  5287. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5288. * without support for iteratee shorthands.
  5289. *
  5290. * @private
  5291. * @param {Array} array The array to query.
  5292. * @param {Function} predicate The function invoked per iteration.
  5293. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5294. * @param {boolean} [fromRight] Specify iterating from right to left.
  5295. * @returns {Array} Returns the slice of `array`.
  5296. */
  5297. function baseWhile(array, predicate, isDrop, fromRight) {
  5298. var length = array.length,
  5299. index = fromRight ? length : -1;
  5300. while ((fromRight ? index-- : ++index < length) &&
  5301. predicate(array[index], index, array)) {}
  5302. return isDrop
  5303. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5304. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5305. }
  5306. /**
  5307. * The base implementation of `wrapperValue` which returns the result of
  5308. * performing a sequence of actions on the unwrapped `value`, where each
  5309. * successive action is supplied the return value of the previous.
  5310. *
  5311. * @private
  5312. * @param {*} value The unwrapped value.
  5313. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5314. * @returns {*} Returns the resolved value.
  5315. */
  5316. function baseWrapperValue(value, actions) {
  5317. var result = value;
  5318. if (result instanceof LazyWrapper) {
  5319. result = result.value();
  5320. }
  5321. return arrayReduce(actions, function(result, action) {
  5322. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5323. }, result);
  5324. }
  5325. /**
  5326. * The base implementation of methods like `_.xor`, without support for
  5327. * iteratee shorthands, that accepts an array of arrays to inspect.
  5328. *
  5329. * @private
  5330. * @param {Array} arrays The arrays to inspect.
  5331. * @param {Function} [iteratee] The iteratee invoked per element.
  5332. * @param {Function} [comparator] The comparator invoked per element.
  5333. * @returns {Array} Returns the new array of values.
  5334. */
  5335. function baseXor(arrays, iteratee, comparator) {
  5336. var length = arrays.length;
  5337. if (length < 2) {
  5338. return length ? baseUniq(arrays[0]) : [];
  5339. }
  5340. var index = -1,
  5341. result = Array(length);
  5342. while (++index < length) {
  5343. var array = arrays[index],
  5344. othIndex = -1;
  5345. while (++othIndex < length) {
  5346. if (othIndex != index) {
  5347. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5348. }
  5349. }
  5350. }
  5351. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5352. }
  5353. /**
  5354. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5355. *
  5356. * @private
  5357. * @param {Array} props The property identifiers.
  5358. * @param {Array} values The property values.
  5359. * @param {Function} assignFunc The function to assign values.
  5360. * @returns {Object} Returns the new object.
  5361. */
  5362. function baseZipObject(props, values, assignFunc) {
  5363. var index = -1,
  5364. length = props.length,
  5365. valsLength = values.length,
  5366. result = {};
  5367. while (++index < length) {
  5368. var value = index < valsLength ? values[index] : undefined;
  5369. assignFunc(result, props[index], value);
  5370. }
  5371. return result;
  5372. }
  5373. /**
  5374. * Casts `value` to an empty array if it's not an array like object.
  5375. *
  5376. * @private
  5377. * @param {*} value The value to inspect.
  5378. * @returns {Array|Object} Returns the cast array-like object.
  5379. */
  5380. function castArrayLikeObject(value) {
  5381. return isArrayLikeObject(value) ? value : [];
  5382. }
  5383. /**
  5384. * Casts `value` to `identity` if it's not a function.
  5385. *
  5386. * @private
  5387. * @param {*} value The value to inspect.
  5388. * @returns {Function} Returns cast function.
  5389. */
  5390. function castFunction(value) {
  5391. return typeof value == 'function' ? value : identity;
  5392. }
  5393. /**
  5394. * Casts `value` to a path array if it's not one.
  5395. *
  5396. * @private
  5397. * @param {*} value The value to inspect.
  5398. * @param {Object} [object] The object to query keys on.
  5399. * @returns {Array} Returns the cast property path array.
  5400. */
  5401. function castPath(value, object) {
  5402. if (isArray(value)) {
  5403. return value;
  5404. }
  5405. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5406. }
  5407. /**
  5408. * A `baseRest` alias which can be replaced with `identity` by module
  5409. * replacement plugins.
  5410. *
  5411. * @private
  5412. * @type {Function}
  5413. * @param {Function} func The function to apply a rest parameter to.
  5414. * @returns {Function} Returns the new function.
  5415. */
  5416. var castRest = baseRest;
  5417. /**
  5418. * Casts `array` to a slice if it's needed.
  5419. *
  5420. * @private
  5421. * @param {Array} array The array to inspect.
  5422. * @param {number} start The start position.
  5423. * @param {number} [end=array.length] The end position.
  5424. * @returns {Array} Returns the cast slice.
  5425. */
  5426. function castSlice(array, start, end) {
  5427. var length = array.length;
  5428. end = end === undefined ? length : end;
  5429. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5430. }
  5431. /**
  5432. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5433. *
  5434. * @private
  5435. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5436. */
  5437. var clearTimeout = ctxClearTimeout || function(id) {
  5438. return root.clearTimeout(id);
  5439. };
  5440. /**
  5441. * Creates a clone of `buffer`.
  5442. *
  5443. * @private
  5444. * @param {Buffer} buffer The buffer to clone.
  5445. * @param {boolean} [isDeep] Specify a deep clone.
  5446. * @returns {Buffer} Returns the cloned buffer.
  5447. */
  5448. function cloneBuffer(buffer, isDeep) {
  5449. if (isDeep) {
  5450. return buffer.slice();
  5451. }
  5452. var length = buffer.length,
  5453. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5454. buffer.copy(result);
  5455. return result;
  5456. }
  5457. /**
  5458. * Creates a clone of `arrayBuffer`.
  5459. *
  5460. * @private
  5461. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5462. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5463. */
  5464. function cloneArrayBuffer(arrayBuffer) {
  5465. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5466. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5467. return result;
  5468. }
  5469. /**
  5470. * Creates a clone of `dataView`.
  5471. *
  5472. * @private
  5473. * @param {Object} dataView The data view to clone.
  5474. * @param {boolean} [isDeep] Specify a deep clone.
  5475. * @returns {Object} Returns the cloned data view.
  5476. */
  5477. function cloneDataView(dataView, isDeep) {
  5478. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5479. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5480. }
  5481. /**
  5482. * Creates a clone of `regexp`.
  5483. *
  5484. * @private
  5485. * @param {Object} regexp The regexp to clone.
  5486. * @returns {Object} Returns the cloned regexp.
  5487. */
  5488. function cloneRegExp(regexp) {
  5489. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5490. result.lastIndex = regexp.lastIndex;
  5491. return result;
  5492. }
  5493. /**
  5494. * Creates a clone of the `symbol` object.
  5495. *
  5496. * @private
  5497. * @param {Object} symbol The symbol object to clone.
  5498. * @returns {Object} Returns the cloned symbol object.
  5499. */
  5500. function cloneSymbol(symbol) {
  5501. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5502. }
  5503. /**
  5504. * Creates a clone of `typedArray`.
  5505. *
  5506. * @private
  5507. * @param {Object} typedArray The typed array to clone.
  5508. * @param {boolean} [isDeep] Specify a deep clone.
  5509. * @returns {Object} Returns the cloned typed array.
  5510. */
  5511. function cloneTypedArray(typedArray, isDeep) {
  5512. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5513. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5514. }
  5515. /**
  5516. * Compares values to sort them in ascending order.
  5517. *
  5518. * @private
  5519. * @param {*} value The value to compare.
  5520. * @param {*} other The other value to compare.
  5521. * @returns {number} Returns the sort order indicator for `value`.
  5522. */
  5523. function compareAscending(value, other) {
  5524. if (value !== other) {
  5525. var valIsDefined = value !== undefined,
  5526. valIsNull = value === null,
  5527. valIsReflexive = value === value,
  5528. valIsSymbol = isSymbol(value);
  5529. var othIsDefined = other !== undefined,
  5530. othIsNull = other === null,
  5531. othIsReflexive = other === other,
  5532. othIsSymbol = isSymbol(other);
  5533. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5534. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5535. (valIsNull && othIsDefined && othIsReflexive) ||
  5536. (!valIsDefined && othIsReflexive) ||
  5537. !valIsReflexive) {
  5538. return 1;
  5539. }
  5540. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5541. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5542. (othIsNull && valIsDefined && valIsReflexive) ||
  5543. (!othIsDefined && valIsReflexive) ||
  5544. !othIsReflexive) {
  5545. return -1;
  5546. }
  5547. }
  5548. return 0;
  5549. }
  5550. /**
  5551. * Used by `_.orderBy` to compare multiple properties of a value to another
  5552. * and stable sort them.
  5553. *
  5554. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5555. * specify an order of "desc" for descending or "asc" for ascending sort order
  5556. * of corresponding values.
  5557. *
  5558. * @private
  5559. * @param {Object} object The object to compare.
  5560. * @param {Object} other The other object to compare.
  5561. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5562. * @returns {number} Returns the sort order indicator for `object`.
  5563. */
  5564. function compareMultiple(object, other, orders) {
  5565. var index = -1,
  5566. objCriteria = object.criteria,
  5567. othCriteria = other.criteria,
  5568. length = objCriteria.length,
  5569. ordersLength = orders.length;
  5570. while (++index < length) {
  5571. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5572. if (result) {
  5573. if (index >= ordersLength) {
  5574. return result;
  5575. }
  5576. var order = orders[index];
  5577. return result * (order == 'desc' ? -1 : 1);
  5578. }
  5579. }
  5580. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5581. // that causes it, under certain circumstances, to provide the same value for
  5582. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5583. // for more details.
  5584. //
  5585. // This also ensures a stable sort in V8 and other engines.
  5586. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5587. return object.index - other.index;
  5588. }
  5589. /**
  5590. * Creates an array that is the composition of partially applied arguments,
  5591. * placeholders, and provided arguments into a single array of arguments.
  5592. *
  5593. * @private
  5594. * @param {Array} args The provided arguments.
  5595. * @param {Array} partials The arguments to prepend to those provided.
  5596. * @param {Array} holders The `partials` placeholder indexes.
  5597. * @params {boolean} [isCurried] Specify composing for a curried function.
  5598. * @returns {Array} Returns the new array of composed arguments.
  5599. */
  5600. function composeArgs(args, partials, holders, isCurried) {
  5601. var argsIndex = -1,
  5602. argsLength = args.length,
  5603. holdersLength = holders.length,
  5604. leftIndex = -1,
  5605. leftLength = partials.length,
  5606. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5607. result = Array(leftLength + rangeLength),
  5608. isUncurried = !isCurried;
  5609. while (++leftIndex < leftLength) {
  5610. result[leftIndex] = partials[leftIndex];
  5611. }
  5612. while (++argsIndex < holdersLength) {
  5613. if (isUncurried || argsIndex < argsLength) {
  5614. result[holders[argsIndex]] = args[argsIndex];
  5615. }
  5616. }
  5617. while (rangeLength--) {
  5618. result[leftIndex++] = args[argsIndex++];
  5619. }
  5620. return result;
  5621. }
  5622. /**
  5623. * This function is like `composeArgs` except that the arguments composition
  5624. * is tailored for `_.partialRight`.
  5625. *
  5626. * @private
  5627. * @param {Array} args The provided arguments.
  5628. * @param {Array} partials The arguments to append to those provided.
  5629. * @param {Array} holders The `partials` placeholder indexes.
  5630. * @params {boolean} [isCurried] Specify composing for a curried function.
  5631. * @returns {Array} Returns the new array of composed arguments.
  5632. */
  5633. function composeArgsRight(args, partials, holders, isCurried) {
  5634. var argsIndex = -1,
  5635. argsLength = args.length,
  5636. holdersIndex = -1,
  5637. holdersLength = holders.length,
  5638. rightIndex = -1,
  5639. rightLength = partials.length,
  5640. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5641. result = Array(rangeLength + rightLength),
  5642. isUncurried = !isCurried;
  5643. while (++argsIndex < rangeLength) {
  5644. result[argsIndex] = args[argsIndex];
  5645. }
  5646. var offset = argsIndex;
  5647. while (++rightIndex < rightLength) {
  5648. result[offset + rightIndex] = partials[rightIndex];
  5649. }
  5650. while (++holdersIndex < holdersLength) {
  5651. if (isUncurried || argsIndex < argsLength) {
  5652. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5653. }
  5654. }
  5655. return result;
  5656. }
  5657. /**
  5658. * Copies the values of `source` to `array`.
  5659. *
  5660. * @private
  5661. * @param {Array} source The array to copy values from.
  5662. * @param {Array} [array=[]] The array to copy values to.
  5663. * @returns {Array} Returns `array`.
  5664. */
  5665. function copyArray(source, array) {
  5666. var index = -1,
  5667. length = source.length;
  5668. array || (array = Array(length));
  5669. while (++index < length) {
  5670. array[index] = source[index];
  5671. }
  5672. return array;
  5673. }
  5674. /**
  5675. * Copies properties of `source` to `object`.
  5676. *
  5677. * @private
  5678. * @param {Object} source The object to copy properties from.
  5679. * @param {Array} props The property identifiers to copy.
  5680. * @param {Object} [object={}] The object to copy properties to.
  5681. * @param {Function} [customizer] The function to customize copied values.
  5682. * @returns {Object} Returns `object`.
  5683. */
  5684. function copyObject(source, props, object, customizer) {
  5685. var isNew = !object;
  5686. object || (object = {});
  5687. var index = -1,
  5688. length = props.length;
  5689. while (++index < length) {
  5690. var key = props[index];
  5691. var newValue = customizer
  5692. ? customizer(object[key], source[key], key, object, source)
  5693. : undefined;
  5694. if (newValue === undefined) {
  5695. newValue = source[key];
  5696. }
  5697. if (isNew) {
  5698. baseAssignValue(object, key, newValue);
  5699. } else {
  5700. assignValue(object, key, newValue);
  5701. }
  5702. }
  5703. return object;
  5704. }
  5705. /**
  5706. * Copies own symbols of `source` to `object`.
  5707. *
  5708. * @private
  5709. * @param {Object} source The object to copy symbols from.
  5710. * @param {Object} [object={}] The object to copy symbols to.
  5711. * @returns {Object} Returns `object`.
  5712. */
  5713. function copySymbols(source, object) {
  5714. return copyObject(source, getSymbols(source), object);
  5715. }
  5716. /**
  5717. * Copies own and inherited symbols of `source` to `object`.
  5718. *
  5719. * @private
  5720. * @param {Object} source The object to copy symbols from.
  5721. * @param {Object} [object={}] The object to copy symbols to.
  5722. * @returns {Object} Returns `object`.
  5723. */
  5724. function copySymbolsIn(source, object) {
  5725. return copyObject(source, getSymbolsIn(source), object);
  5726. }
  5727. /**
  5728. * Creates a function like `_.groupBy`.
  5729. *
  5730. * @private
  5731. * @param {Function} setter The function to set accumulator values.
  5732. * @param {Function} [initializer] The accumulator object initializer.
  5733. * @returns {Function} Returns the new aggregator function.
  5734. */
  5735. function createAggregator(setter, initializer) {
  5736. return function(collection, iteratee) {
  5737. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5738. accumulator = initializer ? initializer() : {};
  5739. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5740. };
  5741. }
  5742. /**
  5743. * Creates a function like `_.assign`.
  5744. *
  5745. * @private
  5746. * @param {Function} assigner The function to assign values.
  5747. * @returns {Function} Returns the new assigner function.
  5748. */
  5749. function createAssigner(assigner) {
  5750. return baseRest(function(object, sources) {
  5751. var index = -1,
  5752. length = sources.length,
  5753. customizer = length > 1 ? sources[length - 1] : undefined,
  5754. guard = length > 2 ? sources[2] : undefined;
  5755. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5756. ? (length--, customizer)
  5757. : undefined;
  5758. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5759. customizer = length < 3 ? undefined : customizer;
  5760. length = 1;
  5761. }
  5762. object = Object(object);
  5763. while (++index < length) {
  5764. var source = sources[index];
  5765. if (source) {
  5766. assigner(object, source, index, customizer);
  5767. }
  5768. }
  5769. return object;
  5770. });
  5771. }
  5772. /**
  5773. * Creates a `baseEach` or `baseEachRight` function.
  5774. *
  5775. * @private
  5776. * @param {Function} eachFunc The function to iterate over a collection.
  5777. * @param {boolean} [fromRight] Specify iterating from right to left.
  5778. * @returns {Function} Returns the new base function.
  5779. */
  5780. function createBaseEach(eachFunc, fromRight) {
  5781. return function(collection, iteratee) {
  5782. if (collection == null) {
  5783. return collection;
  5784. }
  5785. if (!isArrayLike(collection)) {
  5786. return eachFunc(collection, iteratee);
  5787. }
  5788. var length = collection.length,
  5789. index = fromRight ? length : -1,
  5790. iterable = Object(collection);
  5791. while ((fromRight ? index-- : ++index < length)) {
  5792. if (iteratee(iterable[index], index, iterable) === false) {
  5793. break;
  5794. }
  5795. }
  5796. return collection;
  5797. };
  5798. }
  5799. /**
  5800. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5801. *
  5802. * @private
  5803. * @param {boolean} [fromRight] Specify iterating from right to left.
  5804. * @returns {Function} Returns the new base function.
  5805. */
  5806. function createBaseFor(fromRight) {
  5807. return function(object, iteratee, keysFunc) {
  5808. var index = -1,
  5809. iterable = Object(object),
  5810. props = keysFunc(object),
  5811. length = props.length;
  5812. while (length--) {
  5813. var key = props[fromRight ? length : ++index];
  5814. if (iteratee(iterable[key], key, iterable) === false) {
  5815. break;
  5816. }
  5817. }
  5818. return object;
  5819. };
  5820. }
  5821. /**
  5822. * Creates a function that wraps `func` to invoke it with the optional `this`
  5823. * binding of `thisArg`.
  5824. *
  5825. * @private
  5826. * @param {Function} func The function to wrap.
  5827. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5828. * @param {*} [thisArg] The `this` binding of `func`.
  5829. * @returns {Function} Returns the new wrapped function.
  5830. */
  5831. function createBind(func, bitmask, thisArg) {
  5832. var isBind = bitmask & WRAP_BIND_FLAG,
  5833. Ctor = createCtor(func);
  5834. function wrapper() {
  5835. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5836. return fn.apply(isBind ? thisArg : this, arguments);
  5837. }
  5838. return wrapper;
  5839. }
  5840. /**
  5841. * Creates a function like `_.lowerFirst`.
  5842. *
  5843. * @private
  5844. * @param {string} methodName The name of the `String` case method to use.
  5845. * @returns {Function} Returns the new case function.
  5846. */
  5847. function createCaseFirst(methodName) {
  5848. return function(string) {
  5849. string = toString(string);
  5850. var strSymbols = hasUnicode(string)
  5851. ? stringToArray(string)
  5852. : undefined;
  5853. var chr = strSymbols
  5854. ? strSymbols[0]
  5855. : string.charAt(0);
  5856. var trailing = strSymbols
  5857. ? castSlice(strSymbols, 1).join('')
  5858. : string.slice(1);
  5859. return chr[methodName]() + trailing;
  5860. };
  5861. }
  5862. /**
  5863. * Creates a function like `_.camelCase`.
  5864. *
  5865. * @private
  5866. * @param {Function} callback The function to combine each word.
  5867. * @returns {Function} Returns the new compounder function.
  5868. */
  5869. function createCompounder(callback) {
  5870. return function(string) {
  5871. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5872. };
  5873. }
  5874. /**
  5875. * Creates a function that produces an instance of `Ctor` regardless of
  5876. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5877. *
  5878. * @private
  5879. * @param {Function} Ctor The constructor to wrap.
  5880. * @returns {Function} Returns the new wrapped function.
  5881. */
  5882. function createCtor(Ctor) {
  5883. return function() {
  5884. // Use a `switch` statement to work with class constructors. See
  5885. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5886. // for more details.
  5887. var args = arguments;
  5888. switch (args.length) {
  5889. case 0: return new Ctor;
  5890. case 1: return new Ctor(args[0]);
  5891. case 2: return new Ctor(args[0], args[1]);
  5892. case 3: return new Ctor(args[0], args[1], args[2]);
  5893. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5894. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5895. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5896. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5897. }
  5898. var thisBinding = baseCreate(Ctor.prototype),
  5899. result = Ctor.apply(thisBinding, args);
  5900. // Mimic the constructor's `return` behavior.
  5901. // See https://es5.github.io/#x13.2.2 for more details.
  5902. return isObject(result) ? result : thisBinding;
  5903. };
  5904. }
  5905. /**
  5906. * Creates a function that wraps `func` to enable currying.
  5907. *
  5908. * @private
  5909. * @param {Function} func The function to wrap.
  5910. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5911. * @param {number} arity The arity of `func`.
  5912. * @returns {Function} Returns the new wrapped function.
  5913. */
  5914. function createCurry(func, bitmask, arity) {
  5915. var Ctor = createCtor(func);
  5916. function wrapper() {
  5917. var length = arguments.length,
  5918. args = Array(length),
  5919. index = length,
  5920. placeholder = getHolder(wrapper);
  5921. while (index--) {
  5922. args[index] = arguments[index];
  5923. }
  5924. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5925. ? []
  5926. : replaceHolders(args, placeholder);
  5927. length -= holders.length;
  5928. if (length < arity) {
  5929. return createRecurry(
  5930. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5931. args, holders, undefined, undefined, arity - length);
  5932. }
  5933. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5934. return apply(fn, this, args);
  5935. }
  5936. return wrapper;
  5937. }
  5938. /**
  5939. * Creates a `_.find` or `_.findLast` function.
  5940. *
  5941. * @private
  5942. * @param {Function} findIndexFunc The function to find the collection index.
  5943. * @returns {Function} Returns the new find function.
  5944. */
  5945. function createFind(findIndexFunc) {
  5946. return function(collection, predicate, fromIndex) {
  5947. var iterable = Object(collection);
  5948. if (!isArrayLike(collection)) {
  5949. var iteratee = getIteratee(predicate, 3);
  5950. collection = keys(collection);
  5951. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5952. }
  5953. var index = findIndexFunc(collection, predicate, fromIndex);
  5954. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5955. };
  5956. }
  5957. /**
  5958. * Creates a `_.flow` or `_.flowRight` function.
  5959. *
  5960. * @private
  5961. * @param {boolean} [fromRight] Specify iterating from right to left.
  5962. * @returns {Function} Returns the new flow function.
  5963. */
  5964. function createFlow(fromRight) {
  5965. return flatRest(function(funcs) {
  5966. var length = funcs.length,
  5967. index = length,
  5968. prereq = LodashWrapper.prototype.thru;
  5969. if (fromRight) {
  5970. funcs.reverse();
  5971. }
  5972. while (index--) {
  5973. var func = funcs[index];
  5974. if (typeof func != 'function') {
  5975. throw new TypeError(FUNC_ERROR_TEXT);
  5976. }
  5977. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5978. var wrapper = new LodashWrapper([], true);
  5979. }
  5980. }
  5981. index = wrapper ? index : length;
  5982. while (++index < length) {
  5983. func = funcs[index];
  5984. var funcName = getFuncName(func),
  5985. data = funcName == 'wrapper' ? getData(func) : undefined;
  5986. if (data && isLaziable(data[0]) &&
  5987. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5988. !data[4].length && data[9] == 1
  5989. ) {
  5990. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5991. } else {
  5992. wrapper = (func.length == 1 && isLaziable(func))
  5993. ? wrapper[funcName]()
  5994. : wrapper.thru(func);
  5995. }
  5996. }
  5997. return function() {
  5998. var args = arguments,
  5999. value = args[0];
  6000. if (wrapper && args.length == 1 && isArray(value)) {
  6001. return wrapper.plant(value).value();
  6002. }
  6003. var index = 0,
  6004. result = length ? funcs[index].apply(this, args) : value;
  6005. while (++index < length) {
  6006. result = funcs[index].call(this, result);
  6007. }
  6008. return result;
  6009. };
  6010. });
  6011. }
  6012. /**
  6013. * Creates a function that wraps `func` to invoke it with optional `this`
  6014. * binding of `thisArg`, partial application, and currying.
  6015. *
  6016. * @private
  6017. * @param {Function|string} func The function or method name to wrap.
  6018. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6019. * @param {*} [thisArg] The `this` binding of `func`.
  6020. * @param {Array} [partials] The arguments to prepend to those provided to
  6021. * the new function.
  6022. * @param {Array} [holders] The `partials` placeholder indexes.
  6023. * @param {Array} [partialsRight] The arguments to append to those provided
  6024. * to the new function.
  6025. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  6026. * @param {Array} [argPos] The argument positions of the new function.
  6027. * @param {number} [ary] The arity cap of `func`.
  6028. * @param {number} [arity] The arity of `func`.
  6029. * @returns {Function} Returns the new wrapped function.
  6030. */
  6031. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  6032. var isAry = bitmask & WRAP_ARY_FLAG,
  6033. isBind = bitmask & WRAP_BIND_FLAG,
  6034. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  6035. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  6036. isFlip = bitmask & WRAP_FLIP_FLAG,
  6037. Ctor = isBindKey ? undefined : createCtor(func);
  6038. function wrapper() {
  6039. var length = arguments.length,
  6040. args = Array(length),
  6041. index = length;
  6042. while (index--) {
  6043. args[index] = arguments[index];
  6044. }
  6045. if (isCurried) {
  6046. var placeholder = getHolder(wrapper),
  6047. holdersCount = countHolders(args, placeholder);
  6048. }
  6049. if (partials) {
  6050. args = composeArgs(args, partials, holders, isCurried);
  6051. }
  6052. if (partialsRight) {
  6053. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  6054. }
  6055. length -= holdersCount;
  6056. if (isCurried && length < arity) {
  6057. var newHolders = replaceHolders(args, placeholder);
  6058. return createRecurry(
  6059. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6060. args, newHolders, argPos, ary, arity - length
  6061. );
  6062. }
  6063. var thisBinding = isBind ? thisArg : this,
  6064. fn = isBindKey ? thisBinding[func] : func;
  6065. length = args.length;
  6066. if (argPos) {
  6067. args = reorder(args, argPos);
  6068. } else if (isFlip && length > 1) {
  6069. args.reverse();
  6070. }
  6071. if (isAry && ary < length) {
  6072. args.length = ary;
  6073. }
  6074. if (this && this !== root && this instanceof wrapper) {
  6075. fn = Ctor || createCtor(fn);
  6076. }
  6077. return fn.apply(thisBinding, args);
  6078. }
  6079. return wrapper;
  6080. }
  6081. /**
  6082. * Creates a function like `_.invertBy`.
  6083. *
  6084. * @private
  6085. * @param {Function} setter The function to set accumulator values.
  6086. * @param {Function} toIteratee The function to resolve iteratees.
  6087. * @returns {Function} Returns the new inverter function.
  6088. */
  6089. function createInverter(setter, toIteratee) {
  6090. return function(object, iteratee) {
  6091. return baseInverter(object, setter, toIteratee(iteratee), {});
  6092. };
  6093. }
  6094. /**
  6095. * Creates a function that performs a mathematical operation on two values.
  6096. *
  6097. * @private
  6098. * @param {Function} operator The function to perform the operation.
  6099. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6100. * @returns {Function} Returns the new mathematical operation function.
  6101. */
  6102. function createMathOperation(operator, defaultValue) {
  6103. return function(value, other) {
  6104. var result;
  6105. if (value === undefined && other === undefined) {
  6106. return defaultValue;
  6107. }
  6108. if (value !== undefined) {
  6109. result = value;
  6110. }
  6111. if (other !== undefined) {
  6112. if (result === undefined) {
  6113. return other;
  6114. }
  6115. if (typeof value == 'string' || typeof other == 'string') {
  6116. value = baseToString(value);
  6117. other = baseToString(other);
  6118. } else {
  6119. value = baseToNumber(value);
  6120. other = baseToNumber(other);
  6121. }
  6122. result = operator(value, other);
  6123. }
  6124. return result;
  6125. };
  6126. }
  6127. /**
  6128. * Creates a function like `_.over`.
  6129. *
  6130. * @private
  6131. * @param {Function} arrayFunc The function to iterate over iteratees.
  6132. * @returns {Function} Returns the new over function.
  6133. */
  6134. function createOver(arrayFunc) {
  6135. return flatRest(function(iteratees) {
  6136. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6137. return baseRest(function(args) {
  6138. var thisArg = this;
  6139. return arrayFunc(iteratees, function(iteratee) {
  6140. return apply(iteratee, thisArg, args);
  6141. });
  6142. });
  6143. });
  6144. }
  6145. /**
  6146. * Creates the padding for `string` based on `length`. The `chars` string
  6147. * is truncated if the number of characters exceeds `length`.
  6148. *
  6149. * @private
  6150. * @param {number} length The padding length.
  6151. * @param {string} [chars=' '] The string used as padding.
  6152. * @returns {string} Returns the padding for `string`.
  6153. */
  6154. function createPadding(length, chars) {
  6155. chars = chars === undefined ? ' ' : baseToString(chars);
  6156. var charsLength = chars.length;
  6157. if (charsLength < 2) {
  6158. return charsLength ? baseRepeat(chars, length) : chars;
  6159. }
  6160. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6161. return hasUnicode(chars)
  6162. ? castSlice(stringToArray(result), 0, length).join('')
  6163. : result.slice(0, length);
  6164. }
  6165. /**
  6166. * Creates a function that wraps `func` to invoke it with the `this` binding
  6167. * of `thisArg` and `partials` prepended to the arguments it receives.
  6168. *
  6169. * @private
  6170. * @param {Function} func The function to wrap.
  6171. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6172. * @param {*} thisArg The `this` binding of `func`.
  6173. * @param {Array} partials The arguments to prepend to those provided to
  6174. * the new function.
  6175. * @returns {Function} Returns the new wrapped function.
  6176. */
  6177. function createPartial(func, bitmask, thisArg, partials) {
  6178. var isBind = bitmask & WRAP_BIND_FLAG,
  6179. Ctor = createCtor(func);
  6180. function wrapper() {
  6181. var argsIndex = -1,
  6182. argsLength = arguments.length,
  6183. leftIndex = -1,
  6184. leftLength = partials.length,
  6185. args = Array(leftLength + argsLength),
  6186. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6187. while (++leftIndex < leftLength) {
  6188. args[leftIndex] = partials[leftIndex];
  6189. }
  6190. while (argsLength--) {
  6191. args[leftIndex++] = arguments[++argsIndex];
  6192. }
  6193. return apply(fn, isBind ? thisArg : this, args);
  6194. }
  6195. return wrapper;
  6196. }
  6197. /**
  6198. * Creates a `_.range` or `_.rangeRight` function.
  6199. *
  6200. * @private
  6201. * @param {boolean} [fromRight] Specify iterating from right to left.
  6202. * @returns {Function} Returns the new range function.
  6203. */
  6204. function createRange(fromRight) {
  6205. return function(start, end, step) {
  6206. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6207. end = step = undefined;
  6208. }
  6209. // Ensure the sign of `-0` is preserved.
  6210. start = toFinite(start);
  6211. if (end === undefined) {
  6212. end = start;
  6213. start = 0;
  6214. } else {
  6215. end = toFinite(end);
  6216. }
  6217. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6218. return baseRange(start, end, step, fromRight);
  6219. };
  6220. }
  6221. /**
  6222. * Creates a function that performs a relational operation on two values.
  6223. *
  6224. * @private
  6225. * @param {Function} operator The function to perform the operation.
  6226. * @returns {Function} Returns the new relational operation function.
  6227. */
  6228. function createRelationalOperation(operator) {
  6229. return function(value, other) {
  6230. if (!(typeof value == 'string' && typeof other == 'string')) {
  6231. value = toNumber(value);
  6232. other = toNumber(other);
  6233. }
  6234. return operator(value, other);
  6235. };
  6236. }
  6237. /**
  6238. * Creates a function that wraps `func` to continue currying.
  6239. *
  6240. * @private
  6241. * @param {Function} func The function to wrap.
  6242. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6243. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6244. * @param {*} placeholder The placeholder value.
  6245. * @param {*} [thisArg] The `this` binding of `func`.
  6246. * @param {Array} [partials] The arguments to prepend to those provided to
  6247. * the new function.
  6248. * @param {Array} [holders] The `partials` placeholder indexes.
  6249. * @param {Array} [argPos] The argument positions of the new function.
  6250. * @param {number} [ary] The arity cap of `func`.
  6251. * @param {number} [arity] The arity of `func`.
  6252. * @returns {Function} Returns the new wrapped function.
  6253. */
  6254. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6255. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6256. newHolders = isCurry ? holders : undefined,
  6257. newHoldersRight = isCurry ? undefined : holders,
  6258. newPartials = isCurry ? partials : undefined,
  6259. newPartialsRight = isCurry ? undefined : partials;
  6260. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6261. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6262. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6263. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6264. }
  6265. var newData = [
  6266. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6267. newHoldersRight, argPos, ary, arity
  6268. ];
  6269. var result = wrapFunc.apply(undefined, newData);
  6270. if (isLaziable(func)) {
  6271. setData(result, newData);
  6272. }
  6273. result.placeholder = placeholder;
  6274. return setWrapToString(result, func, bitmask);
  6275. }
  6276. /**
  6277. * Creates a function like `_.round`.
  6278. *
  6279. * @private
  6280. * @param {string} methodName The name of the `Math` method to use when rounding.
  6281. * @returns {Function} Returns the new round function.
  6282. */
  6283. function createRound(methodName) {
  6284. var func = Math[methodName];
  6285. return function(number, precision) {
  6286. number = toNumber(number);
  6287. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6288. if (precision && nativeIsFinite(number)) {
  6289. // Shift with exponential notation to avoid floating-point issues.
  6290. // See [MDN](https://mdn.io/round#Examples) for more details.
  6291. var pair = (toString(number) + 'e').split('e'),
  6292. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6293. pair = (toString(value) + 'e').split('e');
  6294. return +(pair[0] + 'e' + (+pair[1] - precision));
  6295. }
  6296. return func(number);
  6297. };
  6298. }
  6299. /**
  6300. * Creates a set object of `values`.
  6301. *
  6302. * @private
  6303. * @param {Array} values The values to add to the set.
  6304. * @returns {Object} Returns the new set.
  6305. */
  6306. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6307. return new Set(values);
  6308. };
  6309. /**
  6310. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6311. *
  6312. * @private
  6313. * @param {Function} keysFunc The function to get the keys of a given object.
  6314. * @returns {Function} Returns the new pairs function.
  6315. */
  6316. function createToPairs(keysFunc) {
  6317. return function(object) {
  6318. var tag = getTag(object);
  6319. if (tag == mapTag) {
  6320. return mapToArray(object);
  6321. }
  6322. if (tag == setTag) {
  6323. return setToPairs(object);
  6324. }
  6325. return baseToPairs(object, keysFunc(object));
  6326. };
  6327. }
  6328. /**
  6329. * Creates a function that either curries or invokes `func` with optional
  6330. * `this` binding and partially applied arguments.
  6331. *
  6332. * @private
  6333. * @param {Function|string} func The function or method name to wrap.
  6334. * @param {number} bitmask The bitmask flags.
  6335. * 1 - `_.bind`
  6336. * 2 - `_.bindKey`
  6337. * 4 - `_.curry` or `_.curryRight` of a bound function
  6338. * 8 - `_.curry`
  6339. * 16 - `_.curryRight`
  6340. * 32 - `_.partial`
  6341. * 64 - `_.partialRight`
  6342. * 128 - `_.rearg`
  6343. * 256 - `_.ary`
  6344. * 512 - `_.flip`
  6345. * @param {*} [thisArg] The `this` binding of `func`.
  6346. * @param {Array} [partials] The arguments to be partially applied.
  6347. * @param {Array} [holders] The `partials` placeholder indexes.
  6348. * @param {Array} [argPos] The argument positions of the new function.
  6349. * @param {number} [ary] The arity cap of `func`.
  6350. * @param {number} [arity] The arity of `func`.
  6351. * @returns {Function} Returns the new wrapped function.
  6352. */
  6353. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6354. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6355. if (!isBindKey && typeof func != 'function') {
  6356. throw new TypeError(FUNC_ERROR_TEXT);
  6357. }
  6358. var length = partials ? partials.length : 0;
  6359. if (!length) {
  6360. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6361. partials = holders = undefined;
  6362. }
  6363. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6364. arity = arity === undefined ? arity : toInteger(arity);
  6365. length -= holders ? holders.length : 0;
  6366. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6367. var partialsRight = partials,
  6368. holdersRight = holders;
  6369. partials = holders = undefined;
  6370. }
  6371. var data = isBindKey ? undefined : getData(func);
  6372. var newData = [
  6373. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6374. argPos, ary, arity
  6375. ];
  6376. if (data) {
  6377. mergeData(newData, data);
  6378. }
  6379. func = newData[0];
  6380. bitmask = newData[1];
  6381. thisArg = newData[2];
  6382. partials = newData[3];
  6383. holders = newData[4];
  6384. arity = newData[9] = newData[9] === undefined
  6385. ? (isBindKey ? 0 : func.length)
  6386. : nativeMax(newData[9] - length, 0);
  6387. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6388. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6389. }
  6390. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6391. var result = createBind(func, bitmask, thisArg);
  6392. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6393. result = createCurry(func, bitmask, arity);
  6394. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6395. result = createPartial(func, bitmask, thisArg, partials);
  6396. } else {
  6397. result = createHybrid.apply(undefined, newData);
  6398. }
  6399. var setter = data ? baseSetData : setData;
  6400. return setWrapToString(setter(result, newData), func, bitmask);
  6401. }
  6402. /**
  6403. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6404. * of source objects to the destination object for all destination properties
  6405. * that resolve to `undefined`.
  6406. *
  6407. * @private
  6408. * @param {*} objValue The destination value.
  6409. * @param {*} srcValue The source value.
  6410. * @param {string} key The key of the property to assign.
  6411. * @param {Object} object The parent object of `objValue`.
  6412. * @returns {*} Returns the value to assign.
  6413. */
  6414. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6415. if (objValue === undefined ||
  6416. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6417. return srcValue;
  6418. }
  6419. return objValue;
  6420. }
  6421. /**
  6422. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6423. * objects into destination objects that are passed thru.
  6424. *
  6425. * @private
  6426. * @param {*} objValue The destination value.
  6427. * @param {*} srcValue The source value.
  6428. * @param {string} key The key of the property to merge.
  6429. * @param {Object} object The parent object of `objValue`.
  6430. * @param {Object} source The parent object of `srcValue`.
  6431. * @param {Object} [stack] Tracks traversed source values and their merged
  6432. * counterparts.
  6433. * @returns {*} Returns the value to assign.
  6434. */
  6435. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6436. if (isObject(objValue) && isObject(srcValue)) {
  6437. // Recursively merge objects and arrays (susceptible to call stack limits).
  6438. stack.set(srcValue, objValue);
  6439. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6440. stack['delete'](srcValue);
  6441. }
  6442. return objValue;
  6443. }
  6444. /**
  6445. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6446. * objects.
  6447. *
  6448. * @private
  6449. * @param {*} value The value to inspect.
  6450. * @param {string} key The key of the property to inspect.
  6451. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6452. */
  6453. function customOmitClone(value) {
  6454. return isPlainObject(value) ? undefined : value;
  6455. }
  6456. /**
  6457. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6458. * partial deep comparisons.
  6459. *
  6460. * @private
  6461. * @param {Array} array The array to compare.
  6462. * @param {Array} other The other array to compare.
  6463. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6464. * @param {Function} customizer The function to customize comparisons.
  6465. * @param {Function} equalFunc The function to determine equivalents of values.
  6466. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6467. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6468. */
  6469. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6470. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6471. arrLength = array.length,
  6472. othLength = other.length;
  6473. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6474. return false;
  6475. }
  6476. // Check that cyclic values are equal.
  6477. var arrStacked = stack.get(array);
  6478. var othStacked = stack.get(other);
  6479. if (arrStacked && othStacked) {
  6480. return arrStacked == other && othStacked == array;
  6481. }
  6482. var index = -1,
  6483. result = true,
  6484. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6485. stack.set(array, other);
  6486. stack.set(other, array);
  6487. // Ignore non-index properties.
  6488. while (++index < arrLength) {
  6489. var arrValue = array[index],
  6490. othValue = other[index];
  6491. if (customizer) {
  6492. var compared = isPartial
  6493. ? customizer(othValue, arrValue, index, other, array, stack)
  6494. : customizer(arrValue, othValue, index, array, other, stack);
  6495. }
  6496. if (compared !== undefined) {
  6497. if (compared) {
  6498. continue;
  6499. }
  6500. result = false;
  6501. break;
  6502. }
  6503. // Recursively compare arrays (susceptible to call stack limits).
  6504. if (seen) {
  6505. if (!arraySome(other, function(othValue, othIndex) {
  6506. if (!cacheHas(seen, othIndex) &&
  6507. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6508. return seen.push(othIndex);
  6509. }
  6510. })) {
  6511. result = false;
  6512. break;
  6513. }
  6514. } else if (!(
  6515. arrValue === othValue ||
  6516. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6517. )) {
  6518. result = false;
  6519. break;
  6520. }
  6521. }
  6522. stack['delete'](array);
  6523. stack['delete'](other);
  6524. return result;
  6525. }
  6526. /**
  6527. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6528. * the same `toStringTag`.
  6529. *
  6530. * **Note:** This function only supports comparing values with tags of
  6531. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6532. *
  6533. * @private
  6534. * @param {Object} object The object to compare.
  6535. * @param {Object} other The other object to compare.
  6536. * @param {string} tag The `toStringTag` of the objects to compare.
  6537. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6538. * @param {Function} customizer The function to customize comparisons.
  6539. * @param {Function} equalFunc The function to determine equivalents of values.
  6540. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6541. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6542. */
  6543. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6544. switch (tag) {
  6545. case dataViewTag:
  6546. if ((object.byteLength != other.byteLength) ||
  6547. (object.byteOffset != other.byteOffset)) {
  6548. return false;
  6549. }
  6550. object = object.buffer;
  6551. other = other.buffer;
  6552. case arrayBufferTag:
  6553. if ((object.byteLength != other.byteLength) ||
  6554. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6555. return false;
  6556. }
  6557. return true;
  6558. case boolTag:
  6559. case dateTag:
  6560. case numberTag:
  6561. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6562. // Invalid dates are coerced to `NaN`.
  6563. return eq(+object, +other);
  6564. case errorTag:
  6565. return object.name == other.name && object.message == other.message;
  6566. case regexpTag:
  6567. case stringTag:
  6568. // Coerce regexes to strings and treat strings, primitives and objects,
  6569. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6570. // for more details.
  6571. return object == (other + '');
  6572. case mapTag:
  6573. var convert = mapToArray;
  6574. case setTag:
  6575. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6576. convert || (convert = setToArray);
  6577. if (object.size != other.size && !isPartial) {
  6578. return false;
  6579. }
  6580. // Assume cyclic values are equal.
  6581. var stacked = stack.get(object);
  6582. if (stacked) {
  6583. return stacked == other;
  6584. }
  6585. bitmask |= COMPARE_UNORDERED_FLAG;
  6586. // Recursively compare objects (susceptible to call stack limits).
  6587. stack.set(object, other);
  6588. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6589. stack['delete'](object);
  6590. return result;
  6591. case symbolTag:
  6592. if (symbolValueOf) {
  6593. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6594. }
  6595. }
  6596. return false;
  6597. }
  6598. /**
  6599. * A specialized version of `baseIsEqualDeep` for objects with support for
  6600. * partial deep comparisons.
  6601. *
  6602. * @private
  6603. * @param {Object} object The object to compare.
  6604. * @param {Object} other The other object to compare.
  6605. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6606. * @param {Function} customizer The function to customize comparisons.
  6607. * @param {Function} equalFunc The function to determine equivalents of values.
  6608. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6609. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6610. */
  6611. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6612. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6613. objProps = getAllKeys(object),
  6614. objLength = objProps.length,
  6615. othProps = getAllKeys(other),
  6616. othLength = othProps.length;
  6617. if (objLength != othLength && !isPartial) {
  6618. return false;
  6619. }
  6620. var index = objLength;
  6621. while (index--) {
  6622. var key = objProps[index];
  6623. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6624. return false;
  6625. }
  6626. }
  6627. // Check that cyclic values are equal.
  6628. var objStacked = stack.get(object);
  6629. var othStacked = stack.get(other);
  6630. if (objStacked && othStacked) {
  6631. return objStacked == other && othStacked == object;
  6632. }
  6633. var result = true;
  6634. stack.set(object, other);
  6635. stack.set(other, object);
  6636. var skipCtor = isPartial;
  6637. while (++index < objLength) {
  6638. key = objProps[index];
  6639. var objValue = object[key],
  6640. othValue = other[key];
  6641. if (customizer) {
  6642. var compared = isPartial
  6643. ? customizer(othValue, objValue, key, other, object, stack)
  6644. : customizer(objValue, othValue, key, object, other, stack);
  6645. }
  6646. // Recursively compare objects (susceptible to call stack limits).
  6647. if (!(compared === undefined
  6648. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6649. : compared
  6650. )) {
  6651. result = false;
  6652. break;
  6653. }
  6654. skipCtor || (skipCtor = key == 'constructor');
  6655. }
  6656. if (result && !skipCtor) {
  6657. var objCtor = object.constructor,
  6658. othCtor = other.constructor;
  6659. // Non `Object` object instances with different constructors are not equal.
  6660. if (objCtor != othCtor &&
  6661. ('constructor' in object && 'constructor' in other) &&
  6662. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6663. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6664. result = false;
  6665. }
  6666. }
  6667. stack['delete'](object);
  6668. stack['delete'](other);
  6669. return result;
  6670. }
  6671. /**
  6672. * A specialized version of `baseRest` which flattens the rest array.
  6673. *
  6674. * @private
  6675. * @param {Function} func The function to apply a rest parameter to.
  6676. * @returns {Function} Returns the new function.
  6677. */
  6678. function flatRest(func) {
  6679. return setToString(overRest(func, undefined, flatten), func + '');
  6680. }
  6681. /**
  6682. * Creates an array of own enumerable property names and symbols of `object`.
  6683. *
  6684. * @private
  6685. * @param {Object} object The object to query.
  6686. * @returns {Array} Returns the array of property names and symbols.
  6687. */
  6688. function getAllKeys(object) {
  6689. return baseGetAllKeys(object, keys, getSymbols);
  6690. }
  6691. /**
  6692. * Creates an array of own and inherited enumerable property names and
  6693. * symbols of `object`.
  6694. *
  6695. * @private
  6696. * @param {Object} object The object to query.
  6697. * @returns {Array} Returns the array of property names and symbols.
  6698. */
  6699. function getAllKeysIn(object) {
  6700. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6701. }
  6702. /**
  6703. * Gets metadata for `func`.
  6704. *
  6705. * @private
  6706. * @param {Function} func The function to query.
  6707. * @returns {*} Returns the metadata for `func`.
  6708. */
  6709. var getData = !metaMap ? noop : function(func) {
  6710. return metaMap.get(func);
  6711. };
  6712. /**
  6713. * Gets the name of `func`.
  6714. *
  6715. * @private
  6716. * @param {Function} func The function to query.
  6717. * @returns {string} Returns the function name.
  6718. */
  6719. function getFuncName(func) {
  6720. var result = (func.name + ''),
  6721. array = realNames[result],
  6722. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6723. while (length--) {
  6724. var data = array[length],
  6725. otherFunc = data.func;
  6726. if (otherFunc == null || otherFunc == func) {
  6727. return data.name;
  6728. }
  6729. }
  6730. return result;
  6731. }
  6732. /**
  6733. * Gets the argument placeholder value for `func`.
  6734. *
  6735. * @private
  6736. * @param {Function} func The function to inspect.
  6737. * @returns {*} Returns the placeholder value.
  6738. */
  6739. function getHolder(func) {
  6740. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6741. return object.placeholder;
  6742. }
  6743. /**
  6744. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6745. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6746. * If arguments are provided, the chosen function is invoked with them and
  6747. * its result is returned.
  6748. *
  6749. * @private
  6750. * @param {*} [value] The value to convert to an iteratee.
  6751. * @param {number} [arity] The arity of the created iteratee.
  6752. * @returns {Function} Returns the chosen function or its result.
  6753. */
  6754. function getIteratee() {
  6755. var result = lodash.iteratee || iteratee;
  6756. result = result === iteratee ? baseIteratee : result;
  6757. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6758. }
  6759. /**
  6760. * Gets the data for `map`.
  6761. *
  6762. * @private
  6763. * @param {Object} map The map to query.
  6764. * @param {string} key The reference key.
  6765. * @returns {*} Returns the map data.
  6766. */
  6767. function getMapData(map, key) {
  6768. var data = map.__data__;
  6769. return isKeyable(key)
  6770. ? data[typeof key == 'string' ? 'string' : 'hash']
  6771. : data.map;
  6772. }
  6773. /**
  6774. * Gets the property names, values, and compare flags of `object`.
  6775. *
  6776. * @private
  6777. * @param {Object} object The object to query.
  6778. * @returns {Array} Returns the match data of `object`.
  6779. */
  6780. function getMatchData(object) {
  6781. var result = keys(object),
  6782. length = result.length;
  6783. while (length--) {
  6784. var key = result[length],
  6785. value = object[key];
  6786. result[length] = [key, value, isStrictComparable(value)];
  6787. }
  6788. return result;
  6789. }
  6790. /**
  6791. * Gets the native function at `key` of `object`.
  6792. *
  6793. * @private
  6794. * @param {Object} object The object to query.
  6795. * @param {string} key The key of the method to get.
  6796. * @returns {*} Returns the function if it's native, else `undefined`.
  6797. */
  6798. function getNative(object, key) {
  6799. var value = getValue(object, key);
  6800. return baseIsNative(value) ? value : undefined;
  6801. }
  6802. /**
  6803. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6804. *
  6805. * @private
  6806. * @param {*} value The value to query.
  6807. * @returns {string} Returns the raw `toStringTag`.
  6808. */
  6809. function getRawTag(value) {
  6810. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6811. tag = value[symToStringTag];
  6812. try {
  6813. value[symToStringTag] = undefined;
  6814. var unmasked = true;
  6815. } catch (e) {}
  6816. var result = nativeObjectToString.call(value);
  6817. if (unmasked) {
  6818. if (isOwn) {
  6819. value[symToStringTag] = tag;
  6820. } else {
  6821. delete value[symToStringTag];
  6822. }
  6823. }
  6824. return result;
  6825. }
  6826. /**
  6827. * Creates an array of the own enumerable symbols of `object`.
  6828. *
  6829. * @private
  6830. * @param {Object} object The object to query.
  6831. * @returns {Array} Returns the array of symbols.
  6832. */
  6833. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6834. if (object == null) {
  6835. return [];
  6836. }
  6837. object = Object(object);
  6838. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6839. return propertyIsEnumerable.call(object, symbol);
  6840. });
  6841. };
  6842. /**
  6843. * Creates an array of the own and inherited enumerable symbols of `object`.
  6844. *
  6845. * @private
  6846. * @param {Object} object The object to query.
  6847. * @returns {Array} Returns the array of symbols.
  6848. */
  6849. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6850. var result = [];
  6851. while (object) {
  6852. arrayPush(result, getSymbols(object));
  6853. object = getPrototype(object);
  6854. }
  6855. return result;
  6856. };
  6857. /**
  6858. * Gets the `toStringTag` of `value`.
  6859. *
  6860. * @private
  6861. * @param {*} value The value to query.
  6862. * @returns {string} Returns the `toStringTag`.
  6863. */
  6864. var getTag = baseGetTag;
  6865. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6866. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6867. (Map && getTag(new Map) != mapTag) ||
  6868. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6869. (Set && getTag(new Set) != setTag) ||
  6870. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6871. getTag = function(value) {
  6872. var result = baseGetTag(value),
  6873. Ctor = result == objectTag ? value.constructor : undefined,
  6874. ctorString = Ctor ? toSource(Ctor) : '';
  6875. if (ctorString) {
  6876. switch (ctorString) {
  6877. case dataViewCtorString: return dataViewTag;
  6878. case mapCtorString: return mapTag;
  6879. case promiseCtorString: return promiseTag;
  6880. case setCtorString: return setTag;
  6881. case weakMapCtorString: return weakMapTag;
  6882. }
  6883. }
  6884. return result;
  6885. };
  6886. }
  6887. /**
  6888. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6889. *
  6890. * @private
  6891. * @param {number} start The start of the view.
  6892. * @param {number} end The end of the view.
  6893. * @param {Array} transforms The transformations to apply to the view.
  6894. * @returns {Object} Returns an object containing the `start` and `end`
  6895. * positions of the view.
  6896. */
  6897. function getView(start, end, transforms) {
  6898. var index = -1,
  6899. length = transforms.length;
  6900. while (++index < length) {
  6901. var data = transforms[index],
  6902. size = data.size;
  6903. switch (data.type) {
  6904. case 'drop': start += size; break;
  6905. case 'dropRight': end -= size; break;
  6906. case 'take': end = nativeMin(end, start + size); break;
  6907. case 'takeRight': start = nativeMax(start, end - size); break;
  6908. }
  6909. }
  6910. return { 'start': start, 'end': end };
  6911. }
  6912. /**
  6913. * Extracts wrapper details from the `source` body comment.
  6914. *
  6915. * @private
  6916. * @param {string} source The source to inspect.
  6917. * @returns {Array} Returns the wrapper details.
  6918. */
  6919. function getWrapDetails(source) {
  6920. var match = source.match(reWrapDetails);
  6921. return match ? match[1].split(reSplitDetails) : [];
  6922. }
  6923. /**
  6924. * Checks if `path` exists on `object`.
  6925. *
  6926. * @private
  6927. * @param {Object} object The object to query.
  6928. * @param {Array|string} path The path to check.
  6929. * @param {Function} hasFunc The function to check properties.
  6930. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6931. */
  6932. function hasPath(object, path, hasFunc) {
  6933. path = castPath(path, object);
  6934. var index = -1,
  6935. length = path.length,
  6936. result = false;
  6937. while (++index < length) {
  6938. var key = toKey(path[index]);
  6939. if (!(result = object != null && hasFunc(object, key))) {
  6940. break;
  6941. }
  6942. object = object[key];
  6943. }
  6944. if (result || ++index != length) {
  6945. return result;
  6946. }
  6947. length = object == null ? 0 : object.length;
  6948. return !!length && isLength(length) && isIndex(key, length) &&
  6949. (isArray(object) || isArguments(object));
  6950. }
  6951. /**
  6952. * Initializes an array clone.
  6953. *
  6954. * @private
  6955. * @param {Array} array The array to clone.
  6956. * @returns {Array} Returns the initialized clone.
  6957. */
  6958. function initCloneArray(array) {
  6959. var length = array.length,
  6960. result = new array.constructor(length);
  6961. // Add properties assigned by `RegExp#exec`.
  6962. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6963. result.index = array.index;
  6964. result.input = array.input;
  6965. }
  6966. return result;
  6967. }
  6968. /**
  6969. * Initializes an object clone.
  6970. *
  6971. * @private
  6972. * @param {Object} object The object to clone.
  6973. * @returns {Object} Returns the initialized clone.
  6974. */
  6975. function initCloneObject(object) {
  6976. return (typeof object.constructor == 'function' && !isPrototype(object))
  6977. ? baseCreate(getPrototype(object))
  6978. : {};
  6979. }
  6980. /**
  6981. * Initializes an object clone based on its `toStringTag`.
  6982. *
  6983. * **Note:** This function only supports cloning values with tags of
  6984. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6985. *
  6986. * @private
  6987. * @param {Object} object The object to clone.
  6988. * @param {string} tag The `toStringTag` of the object to clone.
  6989. * @param {boolean} [isDeep] Specify a deep clone.
  6990. * @returns {Object} Returns the initialized clone.
  6991. */
  6992. function initCloneByTag(object, tag, isDeep) {
  6993. var Ctor = object.constructor;
  6994. switch (tag) {
  6995. case arrayBufferTag:
  6996. return cloneArrayBuffer(object);
  6997. case boolTag:
  6998. case dateTag:
  6999. return new Ctor(+object);
  7000. case dataViewTag:
  7001. return cloneDataView(object, isDeep);
  7002. case float32Tag: case float64Tag:
  7003. case int8Tag: case int16Tag: case int32Tag:
  7004. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  7005. return cloneTypedArray(object, isDeep);
  7006. case mapTag:
  7007. return new Ctor;
  7008. case numberTag:
  7009. case stringTag:
  7010. return new Ctor(object);
  7011. case regexpTag:
  7012. return cloneRegExp(object);
  7013. case setTag:
  7014. return new Ctor;
  7015. case symbolTag:
  7016. return cloneSymbol(object);
  7017. }
  7018. }
  7019. /**
  7020. * Inserts wrapper `details` in a comment at the top of the `source` body.
  7021. *
  7022. * @private
  7023. * @param {string} source The source to modify.
  7024. * @returns {Array} details The details to insert.
  7025. * @returns {string} Returns the modified source.
  7026. */
  7027. function insertWrapDetails(source, details) {
  7028. var length = details.length;
  7029. if (!length) {
  7030. return source;
  7031. }
  7032. var lastIndex = length - 1;
  7033. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  7034. details = details.join(length > 2 ? ', ' : ' ');
  7035. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  7036. }
  7037. /**
  7038. * Checks if `value` is a flattenable `arguments` object or array.
  7039. *
  7040. * @private
  7041. * @param {*} value The value to check.
  7042. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  7043. */
  7044. function isFlattenable(value) {
  7045. return isArray(value) || isArguments(value) ||
  7046. !!(spreadableSymbol && value && value[spreadableSymbol]);
  7047. }
  7048. /**
  7049. * Checks if `value` is a valid array-like index.
  7050. *
  7051. * @private
  7052. * @param {*} value The value to check.
  7053. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7054. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7055. */
  7056. function isIndex(value, length) {
  7057. var type = typeof value;
  7058. length = length == null ? MAX_SAFE_INTEGER : length;
  7059. return !!length &&
  7060. (type == 'number' ||
  7061. (type != 'symbol' && reIsUint.test(value))) &&
  7062. (value > -1 && value % 1 == 0 && value < length);
  7063. }
  7064. /**
  7065. * Checks if the given arguments are from an iteratee call.
  7066. *
  7067. * @private
  7068. * @param {*} value The potential iteratee value argument.
  7069. * @param {*} index The potential iteratee index or key argument.
  7070. * @param {*} object The potential iteratee object argument.
  7071. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7072. * else `false`.
  7073. */
  7074. function isIterateeCall(value, index, object) {
  7075. if (!isObject(object)) {
  7076. return false;
  7077. }
  7078. var type = typeof index;
  7079. if (type == 'number'
  7080. ? (isArrayLike(object) && isIndex(index, object.length))
  7081. : (type == 'string' && index in object)
  7082. ) {
  7083. return eq(object[index], value);
  7084. }
  7085. return false;
  7086. }
  7087. /**
  7088. * Checks if `value` is a property name and not a property path.
  7089. *
  7090. * @private
  7091. * @param {*} value The value to check.
  7092. * @param {Object} [object] The object to query keys on.
  7093. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7094. */
  7095. function isKey(value, object) {
  7096. if (isArray(value)) {
  7097. return false;
  7098. }
  7099. var type = typeof value;
  7100. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7101. value == null || isSymbol(value)) {
  7102. return true;
  7103. }
  7104. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7105. (object != null && value in Object(object));
  7106. }
  7107. /**
  7108. * Checks if `value` is suitable for use as unique object key.
  7109. *
  7110. * @private
  7111. * @param {*} value The value to check.
  7112. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7113. */
  7114. function isKeyable(value) {
  7115. var type = typeof value;
  7116. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7117. ? (value !== '__proto__')
  7118. : (value === null);
  7119. }
  7120. /**
  7121. * Checks if `func` has a lazy counterpart.
  7122. *
  7123. * @private
  7124. * @param {Function} func The function to check.
  7125. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7126. * else `false`.
  7127. */
  7128. function isLaziable(func) {
  7129. var funcName = getFuncName(func),
  7130. other = lodash[funcName];
  7131. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7132. return false;
  7133. }
  7134. if (func === other) {
  7135. return true;
  7136. }
  7137. var data = getData(other);
  7138. return !!data && func === data[0];
  7139. }
  7140. /**
  7141. * Checks if `func` has its source masked.
  7142. *
  7143. * @private
  7144. * @param {Function} func The function to check.
  7145. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7146. */
  7147. function isMasked(func) {
  7148. return !!maskSrcKey && (maskSrcKey in func);
  7149. }
  7150. /**
  7151. * Checks if `func` is capable of being masked.
  7152. *
  7153. * @private
  7154. * @param {*} value The value to check.
  7155. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7156. */
  7157. var isMaskable = coreJsData ? isFunction : stubFalse;
  7158. /**
  7159. * Checks if `value` is likely a prototype object.
  7160. *
  7161. * @private
  7162. * @param {*} value The value to check.
  7163. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7164. */
  7165. function isPrototype(value) {
  7166. var Ctor = value && value.constructor,
  7167. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7168. return value === proto;
  7169. }
  7170. /**
  7171. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7172. *
  7173. * @private
  7174. * @param {*} value The value to check.
  7175. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7176. * equality comparisons, else `false`.
  7177. */
  7178. function isStrictComparable(value) {
  7179. return value === value && !isObject(value);
  7180. }
  7181. /**
  7182. * A specialized version of `matchesProperty` for source values suitable
  7183. * for strict equality comparisons, i.e. `===`.
  7184. *
  7185. * @private
  7186. * @param {string} key The key of the property to get.
  7187. * @param {*} srcValue The value to match.
  7188. * @returns {Function} Returns the new spec function.
  7189. */
  7190. function matchesStrictComparable(key, srcValue) {
  7191. return function(object) {
  7192. if (object == null) {
  7193. return false;
  7194. }
  7195. return object[key] === srcValue &&
  7196. (srcValue !== undefined || (key in Object(object)));
  7197. };
  7198. }
  7199. /**
  7200. * A specialized version of `_.memoize` which clears the memoized function's
  7201. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7202. *
  7203. * @private
  7204. * @param {Function} func The function to have its output memoized.
  7205. * @returns {Function} Returns the new memoized function.
  7206. */
  7207. function memoizeCapped(func) {
  7208. var result = memoize(func, function(key) {
  7209. if (cache.size === MAX_MEMOIZE_SIZE) {
  7210. cache.clear();
  7211. }
  7212. return key;
  7213. });
  7214. var cache = result.cache;
  7215. return result;
  7216. }
  7217. /**
  7218. * Merges the function metadata of `source` into `data`.
  7219. *
  7220. * Merging metadata reduces the number of wrappers used to invoke a function.
  7221. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7222. * may be applied regardless of execution order. Methods like `_.ary` and
  7223. * `_.rearg` modify function arguments, making the order in which they are
  7224. * executed important, preventing the merging of metadata. However, we make
  7225. * an exception for a safe combined case where curried functions have `_.ary`
  7226. * and or `_.rearg` applied.
  7227. *
  7228. * @private
  7229. * @param {Array} data The destination metadata.
  7230. * @param {Array} source The source metadata.
  7231. * @returns {Array} Returns `data`.
  7232. */
  7233. function mergeData(data, source) {
  7234. var bitmask = data[1],
  7235. srcBitmask = source[1],
  7236. newBitmask = bitmask | srcBitmask,
  7237. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7238. var isCombo =
  7239. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7240. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7241. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7242. // Exit early if metadata can't be merged.
  7243. if (!(isCommon || isCombo)) {
  7244. return data;
  7245. }
  7246. // Use source `thisArg` if available.
  7247. if (srcBitmask & WRAP_BIND_FLAG) {
  7248. data[2] = source[2];
  7249. // Set when currying a bound function.
  7250. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7251. }
  7252. // Compose partial arguments.
  7253. var value = source[3];
  7254. if (value) {
  7255. var partials = data[3];
  7256. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7257. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7258. }
  7259. // Compose partial right arguments.
  7260. value = source[5];
  7261. if (value) {
  7262. partials = data[5];
  7263. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7264. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7265. }
  7266. // Use source `argPos` if available.
  7267. value = source[7];
  7268. if (value) {
  7269. data[7] = value;
  7270. }
  7271. // Use source `ary` if it's smaller.
  7272. if (srcBitmask & WRAP_ARY_FLAG) {
  7273. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7274. }
  7275. // Use source `arity` if one is not provided.
  7276. if (data[9] == null) {
  7277. data[9] = source[9];
  7278. }
  7279. // Use source `func` and merge bitmasks.
  7280. data[0] = source[0];
  7281. data[1] = newBitmask;
  7282. return data;
  7283. }
  7284. /**
  7285. * This function is like
  7286. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7287. * except that it includes inherited enumerable properties.
  7288. *
  7289. * @private
  7290. * @param {Object} object The object to query.
  7291. * @returns {Array} Returns the array of property names.
  7292. */
  7293. function nativeKeysIn(object) {
  7294. var result = [];
  7295. if (object != null) {
  7296. for (var key in Object(object)) {
  7297. result.push(key);
  7298. }
  7299. }
  7300. return result;
  7301. }
  7302. /**
  7303. * Converts `value` to a string using `Object.prototype.toString`.
  7304. *
  7305. * @private
  7306. * @param {*} value The value to convert.
  7307. * @returns {string} Returns the converted string.
  7308. */
  7309. function objectToString(value) {
  7310. return nativeObjectToString.call(value);
  7311. }
  7312. /**
  7313. * A specialized version of `baseRest` which transforms the rest array.
  7314. *
  7315. * @private
  7316. * @param {Function} func The function to apply a rest parameter to.
  7317. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7318. * @param {Function} transform The rest array transform.
  7319. * @returns {Function} Returns the new function.
  7320. */
  7321. function overRest(func, start, transform) {
  7322. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7323. return function() {
  7324. var args = arguments,
  7325. index = -1,
  7326. length = nativeMax(args.length - start, 0),
  7327. array = Array(length);
  7328. while (++index < length) {
  7329. array[index] = args[start + index];
  7330. }
  7331. index = -1;
  7332. var otherArgs = Array(start + 1);
  7333. while (++index < start) {
  7334. otherArgs[index] = args[index];
  7335. }
  7336. otherArgs[start] = transform(array);
  7337. return apply(func, this, otherArgs);
  7338. };
  7339. }
  7340. /**
  7341. * Gets the parent value at `path` of `object`.
  7342. *
  7343. * @private
  7344. * @param {Object} object The object to query.
  7345. * @param {Array} path The path to get the parent value of.
  7346. * @returns {*} Returns the parent value.
  7347. */
  7348. function parent(object, path) {
  7349. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7350. }
  7351. /**
  7352. * Reorder `array` according to the specified indexes where the element at
  7353. * the first index is assigned as the first element, the element at
  7354. * the second index is assigned as the second element, and so on.
  7355. *
  7356. * @private
  7357. * @param {Array} array The array to reorder.
  7358. * @param {Array} indexes The arranged array indexes.
  7359. * @returns {Array} Returns `array`.
  7360. */
  7361. function reorder(array, indexes) {
  7362. var arrLength = array.length,
  7363. length = nativeMin(indexes.length, arrLength),
  7364. oldArray = copyArray(array);
  7365. while (length--) {
  7366. var index = indexes[length];
  7367. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7368. }
  7369. return array;
  7370. }
  7371. /**
  7372. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7373. *
  7374. * @private
  7375. * @param {Object} object The object to query.
  7376. * @param {string} key The key of the property to get.
  7377. * @returns {*} Returns the property value.
  7378. */
  7379. function safeGet(object, key) {
  7380. if (key === 'constructor' && typeof object[key] === 'function') {
  7381. return;
  7382. }
  7383. if (key == '__proto__') {
  7384. return;
  7385. }
  7386. return object[key];
  7387. }
  7388. /**
  7389. * Sets metadata for `func`.
  7390. *
  7391. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7392. * period of time, it will trip its breaker and transition to an identity
  7393. * function to avoid garbage collection pauses in V8. See
  7394. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7395. * for more details.
  7396. *
  7397. * @private
  7398. * @param {Function} func The function to associate metadata with.
  7399. * @param {*} data The metadata.
  7400. * @returns {Function} Returns `func`.
  7401. */
  7402. var setData = shortOut(baseSetData);
  7403. /**
  7404. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7405. *
  7406. * @private
  7407. * @param {Function} func The function to delay.
  7408. * @param {number} wait The number of milliseconds to delay invocation.
  7409. * @returns {number|Object} Returns the timer id or timeout object.
  7410. */
  7411. var setTimeout = ctxSetTimeout || function(func, wait) {
  7412. return root.setTimeout(func, wait);
  7413. };
  7414. /**
  7415. * Sets the `toString` method of `func` to return `string`.
  7416. *
  7417. * @private
  7418. * @param {Function} func The function to modify.
  7419. * @param {Function} string The `toString` result.
  7420. * @returns {Function} Returns `func`.
  7421. */
  7422. var setToString = shortOut(baseSetToString);
  7423. /**
  7424. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7425. * with wrapper details in a comment at the top of the source body.
  7426. *
  7427. * @private
  7428. * @param {Function} wrapper The function to modify.
  7429. * @param {Function} reference The reference function.
  7430. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7431. * @returns {Function} Returns `wrapper`.
  7432. */
  7433. function setWrapToString(wrapper, reference, bitmask) {
  7434. var source = (reference + '');
  7435. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7436. }
  7437. /**
  7438. * Creates a function that'll short out and invoke `identity` instead
  7439. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7440. * milliseconds.
  7441. *
  7442. * @private
  7443. * @param {Function} func The function to restrict.
  7444. * @returns {Function} Returns the new shortable function.
  7445. */
  7446. function shortOut(func) {
  7447. var count = 0,
  7448. lastCalled = 0;
  7449. return function() {
  7450. var stamp = nativeNow(),
  7451. remaining = HOT_SPAN - (stamp - lastCalled);
  7452. lastCalled = stamp;
  7453. if (remaining > 0) {
  7454. if (++count >= HOT_COUNT) {
  7455. return arguments[0];
  7456. }
  7457. } else {
  7458. count = 0;
  7459. }
  7460. return func.apply(undefined, arguments);
  7461. };
  7462. }
  7463. /**
  7464. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7465. *
  7466. * @private
  7467. * @param {Array} array The array to shuffle.
  7468. * @param {number} [size=array.length] The size of `array`.
  7469. * @returns {Array} Returns `array`.
  7470. */
  7471. function shuffleSelf(array, size) {
  7472. var index = -1,
  7473. length = array.length,
  7474. lastIndex = length - 1;
  7475. size = size === undefined ? length : size;
  7476. while (++index < size) {
  7477. var rand = baseRandom(index, lastIndex),
  7478. value = array[rand];
  7479. array[rand] = array[index];
  7480. array[index] = value;
  7481. }
  7482. array.length = size;
  7483. return array;
  7484. }
  7485. /**
  7486. * Converts `string` to a property path array.
  7487. *
  7488. * @private
  7489. * @param {string} string The string to convert.
  7490. * @returns {Array} Returns the property path array.
  7491. */
  7492. var stringToPath = memoizeCapped(function(string) {
  7493. var result = [];
  7494. if (string.charCodeAt(0) === 46 /* . */) {
  7495. result.push('');
  7496. }
  7497. string.replace(rePropName, function(match, number, quote, subString) {
  7498. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7499. });
  7500. return result;
  7501. });
  7502. /**
  7503. * Converts `value` to a string key if it's not a string or symbol.
  7504. *
  7505. * @private
  7506. * @param {*} value The value to inspect.
  7507. * @returns {string|symbol} Returns the key.
  7508. */
  7509. function toKey(value) {
  7510. if (typeof value == 'string' || isSymbol(value)) {
  7511. return value;
  7512. }
  7513. var result = (value + '');
  7514. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7515. }
  7516. /**
  7517. * Converts `func` to its source code.
  7518. *
  7519. * @private
  7520. * @param {Function} func The function to convert.
  7521. * @returns {string} Returns the source code.
  7522. */
  7523. function toSource(func) {
  7524. if (func != null) {
  7525. try {
  7526. return funcToString.call(func);
  7527. } catch (e) {}
  7528. try {
  7529. return (func + '');
  7530. } catch (e) {}
  7531. }
  7532. return '';
  7533. }
  7534. /**
  7535. * Updates wrapper `details` based on `bitmask` flags.
  7536. *
  7537. * @private
  7538. * @returns {Array} details The details to modify.
  7539. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7540. * @returns {Array} Returns `details`.
  7541. */
  7542. function updateWrapDetails(details, bitmask) {
  7543. arrayEach(wrapFlags, function(pair) {
  7544. var value = '_.' + pair[0];
  7545. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7546. details.push(value);
  7547. }
  7548. });
  7549. return details.sort();
  7550. }
  7551. /**
  7552. * Creates a clone of `wrapper`.
  7553. *
  7554. * @private
  7555. * @param {Object} wrapper The wrapper to clone.
  7556. * @returns {Object} Returns the cloned wrapper.
  7557. */
  7558. function wrapperClone(wrapper) {
  7559. if (wrapper instanceof LazyWrapper) {
  7560. return wrapper.clone();
  7561. }
  7562. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7563. result.__actions__ = copyArray(wrapper.__actions__);
  7564. result.__index__ = wrapper.__index__;
  7565. result.__values__ = wrapper.__values__;
  7566. return result;
  7567. }
  7568. /*------------------------------------------------------------------------*/
  7569. /**
  7570. * Creates an array of elements split into groups the length of `size`.
  7571. * If `array` can't be split evenly, the final chunk will be the remaining
  7572. * elements.
  7573. *
  7574. * @static
  7575. * @memberOf _
  7576. * @since 3.0.0
  7577. * @category Array
  7578. * @param {Array} array The array to process.
  7579. * @param {number} [size=1] The length of each chunk
  7580. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7581. * @returns {Array} Returns the new array of chunks.
  7582. * @example
  7583. *
  7584. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7585. * // => [['a', 'b'], ['c', 'd']]
  7586. *
  7587. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7588. * // => [['a', 'b', 'c'], ['d']]
  7589. */
  7590. function chunk(array, size, guard) {
  7591. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7592. size = 1;
  7593. } else {
  7594. size = nativeMax(toInteger(size), 0);
  7595. }
  7596. var length = array == null ? 0 : array.length;
  7597. if (!length || size < 1) {
  7598. return [];
  7599. }
  7600. var index = 0,
  7601. resIndex = 0,
  7602. result = Array(nativeCeil(length / size));
  7603. while (index < length) {
  7604. result[resIndex++] = baseSlice(array, index, (index += size));
  7605. }
  7606. return result;
  7607. }
  7608. /**
  7609. * Creates an array with all falsey values removed. The values `false`, `null`,
  7610. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7611. *
  7612. * @static
  7613. * @memberOf _
  7614. * @since 0.1.0
  7615. * @category Array
  7616. * @param {Array} array The array to compact.
  7617. * @returns {Array} Returns the new array of filtered values.
  7618. * @example
  7619. *
  7620. * _.compact([0, 1, false, 2, '', 3]);
  7621. * // => [1, 2, 3]
  7622. */
  7623. function compact(array) {
  7624. var index = -1,
  7625. length = array == null ? 0 : array.length,
  7626. resIndex = 0,
  7627. result = [];
  7628. while (++index < length) {
  7629. var value = array[index];
  7630. if (value) {
  7631. result[resIndex++] = value;
  7632. }
  7633. }
  7634. return result;
  7635. }
  7636. /**
  7637. * Creates a new array concatenating `array` with any additional arrays
  7638. * and/or values.
  7639. *
  7640. * @static
  7641. * @memberOf _
  7642. * @since 4.0.0
  7643. * @category Array
  7644. * @param {Array} array The array to concatenate.
  7645. * @param {...*} [values] The values to concatenate.
  7646. * @returns {Array} Returns the new concatenated array.
  7647. * @example
  7648. *
  7649. * var array = [1];
  7650. * var other = _.concat(array, 2, [3], [[4]]);
  7651. *
  7652. * console.log(other);
  7653. * // => [1, 2, 3, [4]]
  7654. *
  7655. * console.log(array);
  7656. * // => [1]
  7657. */
  7658. function concat() {
  7659. var length = arguments.length;
  7660. if (!length) {
  7661. return [];
  7662. }
  7663. var args = Array(length - 1),
  7664. array = arguments[0],
  7665. index = length;
  7666. while (index--) {
  7667. args[index - 1] = arguments[index];
  7668. }
  7669. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7670. }
  7671. /**
  7672. * Creates an array of `array` values not included in the other given arrays
  7673. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7674. * for equality comparisons. The order and references of result values are
  7675. * determined by the first array.
  7676. *
  7677. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7678. *
  7679. * @static
  7680. * @memberOf _
  7681. * @since 0.1.0
  7682. * @category Array
  7683. * @param {Array} array The array to inspect.
  7684. * @param {...Array} [values] The values to exclude.
  7685. * @returns {Array} Returns the new array of filtered values.
  7686. * @see _.without, _.xor
  7687. * @example
  7688. *
  7689. * _.difference([2, 1], [2, 3]);
  7690. * // => [1]
  7691. */
  7692. var difference = baseRest(function(array, values) {
  7693. return isArrayLikeObject(array)
  7694. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7695. : [];
  7696. });
  7697. /**
  7698. * This method is like `_.difference` except that it accepts `iteratee` which
  7699. * is invoked for each element of `array` and `values` to generate the criterion
  7700. * by which they're compared. The order and references of result values are
  7701. * determined by the first array. The iteratee is invoked with one argument:
  7702. * (value).
  7703. *
  7704. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7705. *
  7706. * @static
  7707. * @memberOf _
  7708. * @since 4.0.0
  7709. * @category Array
  7710. * @param {Array} array The array to inspect.
  7711. * @param {...Array} [values] The values to exclude.
  7712. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7713. * @returns {Array} Returns the new array of filtered values.
  7714. * @example
  7715. *
  7716. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7717. * // => [1.2]
  7718. *
  7719. * // The `_.property` iteratee shorthand.
  7720. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7721. * // => [{ 'x': 2 }]
  7722. */
  7723. var differenceBy = baseRest(function(array, values) {
  7724. var iteratee = last(values);
  7725. if (isArrayLikeObject(iteratee)) {
  7726. iteratee = undefined;
  7727. }
  7728. return isArrayLikeObject(array)
  7729. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7730. : [];
  7731. });
  7732. /**
  7733. * This method is like `_.difference` except that it accepts `comparator`
  7734. * which is invoked to compare elements of `array` to `values`. The order and
  7735. * references of result values are determined by the first array. The comparator
  7736. * is invoked with two arguments: (arrVal, othVal).
  7737. *
  7738. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7739. *
  7740. * @static
  7741. * @memberOf _
  7742. * @since 4.0.0
  7743. * @category Array
  7744. * @param {Array} array The array to inspect.
  7745. * @param {...Array} [values] The values to exclude.
  7746. * @param {Function} [comparator] The comparator invoked per element.
  7747. * @returns {Array} Returns the new array of filtered values.
  7748. * @example
  7749. *
  7750. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7751. *
  7752. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7753. * // => [{ 'x': 2, 'y': 1 }]
  7754. */
  7755. var differenceWith = baseRest(function(array, values) {
  7756. var comparator = last(values);
  7757. if (isArrayLikeObject(comparator)) {
  7758. comparator = undefined;
  7759. }
  7760. return isArrayLikeObject(array)
  7761. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7762. : [];
  7763. });
  7764. /**
  7765. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7766. *
  7767. * @static
  7768. * @memberOf _
  7769. * @since 0.5.0
  7770. * @category Array
  7771. * @param {Array} array The array to query.
  7772. * @param {number} [n=1] The number of elements to drop.
  7773. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7774. * @returns {Array} Returns the slice of `array`.
  7775. * @example
  7776. *
  7777. * _.drop([1, 2, 3]);
  7778. * // => [2, 3]
  7779. *
  7780. * _.drop([1, 2, 3], 2);
  7781. * // => [3]
  7782. *
  7783. * _.drop([1, 2, 3], 5);
  7784. * // => []
  7785. *
  7786. * _.drop([1, 2, 3], 0);
  7787. * // => [1, 2, 3]
  7788. */
  7789. function drop(array, n, guard) {
  7790. var length = array == null ? 0 : array.length;
  7791. if (!length) {
  7792. return [];
  7793. }
  7794. n = (guard || n === undefined) ? 1 : toInteger(n);
  7795. return baseSlice(array, n < 0 ? 0 : n, length);
  7796. }
  7797. /**
  7798. * Creates a slice of `array` with `n` elements dropped from the end.
  7799. *
  7800. * @static
  7801. * @memberOf _
  7802. * @since 3.0.0
  7803. * @category Array
  7804. * @param {Array} array The array to query.
  7805. * @param {number} [n=1] The number of elements to drop.
  7806. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7807. * @returns {Array} Returns the slice of `array`.
  7808. * @example
  7809. *
  7810. * _.dropRight([1, 2, 3]);
  7811. * // => [1, 2]
  7812. *
  7813. * _.dropRight([1, 2, 3], 2);
  7814. * // => [1]
  7815. *
  7816. * _.dropRight([1, 2, 3], 5);
  7817. * // => []
  7818. *
  7819. * _.dropRight([1, 2, 3], 0);
  7820. * // => [1, 2, 3]
  7821. */
  7822. function dropRight(array, n, guard) {
  7823. var length = array == null ? 0 : array.length;
  7824. if (!length) {
  7825. return [];
  7826. }
  7827. n = (guard || n === undefined) ? 1 : toInteger(n);
  7828. n = length - n;
  7829. return baseSlice(array, 0, n < 0 ? 0 : n);
  7830. }
  7831. /**
  7832. * Creates a slice of `array` excluding elements dropped from the end.
  7833. * Elements are dropped until `predicate` returns falsey. The predicate is
  7834. * invoked with three arguments: (value, index, array).
  7835. *
  7836. * @static
  7837. * @memberOf _
  7838. * @since 3.0.0
  7839. * @category Array
  7840. * @param {Array} array The array to query.
  7841. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7842. * @returns {Array} Returns the slice of `array`.
  7843. * @example
  7844. *
  7845. * var users = [
  7846. * { 'user': 'barney', 'active': true },
  7847. * { 'user': 'fred', 'active': false },
  7848. * { 'user': 'pebbles', 'active': false }
  7849. * ];
  7850. *
  7851. * _.dropRightWhile(users, function(o) { return !o.active; });
  7852. * // => objects for ['barney']
  7853. *
  7854. * // The `_.matches` iteratee shorthand.
  7855. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7856. * // => objects for ['barney', 'fred']
  7857. *
  7858. * // The `_.matchesProperty` iteratee shorthand.
  7859. * _.dropRightWhile(users, ['active', false]);
  7860. * // => objects for ['barney']
  7861. *
  7862. * // The `_.property` iteratee shorthand.
  7863. * _.dropRightWhile(users, 'active');
  7864. * // => objects for ['barney', 'fred', 'pebbles']
  7865. */
  7866. function dropRightWhile(array, predicate) {
  7867. return (array && array.length)
  7868. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7869. : [];
  7870. }
  7871. /**
  7872. * Creates a slice of `array` excluding elements dropped from the beginning.
  7873. * Elements are dropped until `predicate` returns falsey. The predicate is
  7874. * invoked with three arguments: (value, index, array).
  7875. *
  7876. * @static
  7877. * @memberOf _
  7878. * @since 3.0.0
  7879. * @category Array
  7880. * @param {Array} array The array to query.
  7881. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7882. * @returns {Array} Returns the slice of `array`.
  7883. * @example
  7884. *
  7885. * var users = [
  7886. * { 'user': 'barney', 'active': false },
  7887. * { 'user': 'fred', 'active': false },
  7888. * { 'user': 'pebbles', 'active': true }
  7889. * ];
  7890. *
  7891. * _.dropWhile(users, function(o) { return !o.active; });
  7892. * // => objects for ['pebbles']
  7893. *
  7894. * // The `_.matches` iteratee shorthand.
  7895. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7896. * // => objects for ['fred', 'pebbles']
  7897. *
  7898. * // The `_.matchesProperty` iteratee shorthand.
  7899. * _.dropWhile(users, ['active', false]);
  7900. * // => objects for ['pebbles']
  7901. *
  7902. * // The `_.property` iteratee shorthand.
  7903. * _.dropWhile(users, 'active');
  7904. * // => objects for ['barney', 'fred', 'pebbles']
  7905. */
  7906. function dropWhile(array, predicate) {
  7907. return (array && array.length)
  7908. ? baseWhile(array, getIteratee(predicate, 3), true)
  7909. : [];
  7910. }
  7911. /**
  7912. * Fills elements of `array` with `value` from `start` up to, but not
  7913. * including, `end`.
  7914. *
  7915. * **Note:** This method mutates `array`.
  7916. *
  7917. * @static
  7918. * @memberOf _
  7919. * @since 3.2.0
  7920. * @category Array
  7921. * @param {Array} array The array to fill.
  7922. * @param {*} value The value to fill `array` with.
  7923. * @param {number} [start=0] The start position.
  7924. * @param {number} [end=array.length] The end position.
  7925. * @returns {Array} Returns `array`.
  7926. * @example
  7927. *
  7928. * var array = [1, 2, 3];
  7929. *
  7930. * _.fill(array, 'a');
  7931. * console.log(array);
  7932. * // => ['a', 'a', 'a']
  7933. *
  7934. * _.fill(Array(3), 2);
  7935. * // => [2, 2, 2]
  7936. *
  7937. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7938. * // => [4, '*', '*', 10]
  7939. */
  7940. function fill(array, value, start, end) {
  7941. var length = array == null ? 0 : array.length;
  7942. if (!length) {
  7943. return [];
  7944. }
  7945. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7946. start = 0;
  7947. end = length;
  7948. }
  7949. return baseFill(array, value, start, end);
  7950. }
  7951. /**
  7952. * This method is like `_.find` except that it returns the index of the first
  7953. * element `predicate` returns truthy for instead of the element itself.
  7954. *
  7955. * @static
  7956. * @memberOf _
  7957. * @since 1.1.0
  7958. * @category Array
  7959. * @param {Array} array The array to inspect.
  7960. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7961. * @param {number} [fromIndex=0] The index to search from.
  7962. * @returns {number} Returns the index of the found element, else `-1`.
  7963. * @example
  7964. *
  7965. * var users = [
  7966. * { 'user': 'barney', 'active': false },
  7967. * { 'user': 'fred', 'active': false },
  7968. * { 'user': 'pebbles', 'active': true }
  7969. * ];
  7970. *
  7971. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7972. * // => 0
  7973. *
  7974. * // The `_.matches` iteratee shorthand.
  7975. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7976. * // => 1
  7977. *
  7978. * // The `_.matchesProperty` iteratee shorthand.
  7979. * _.findIndex(users, ['active', false]);
  7980. * // => 0
  7981. *
  7982. * // The `_.property` iteratee shorthand.
  7983. * _.findIndex(users, 'active');
  7984. * // => 2
  7985. */
  7986. function findIndex(array, predicate, fromIndex) {
  7987. var length = array == null ? 0 : array.length;
  7988. if (!length) {
  7989. return -1;
  7990. }
  7991. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7992. if (index < 0) {
  7993. index = nativeMax(length + index, 0);
  7994. }
  7995. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7996. }
  7997. /**
  7998. * This method is like `_.findIndex` except that it iterates over elements
  7999. * of `collection` from right to left.
  8000. *
  8001. * @static
  8002. * @memberOf _
  8003. * @since 2.0.0
  8004. * @category Array
  8005. * @param {Array} array The array to inspect.
  8006. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8007. * @param {number} [fromIndex=array.length-1] The index to search from.
  8008. * @returns {number} Returns the index of the found element, else `-1`.
  8009. * @example
  8010. *
  8011. * var users = [
  8012. * { 'user': 'barney', 'active': true },
  8013. * { 'user': 'fred', 'active': false },
  8014. * { 'user': 'pebbles', 'active': false }
  8015. * ];
  8016. *
  8017. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  8018. * // => 2
  8019. *
  8020. * // The `_.matches` iteratee shorthand.
  8021. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  8022. * // => 0
  8023. *
  8024. * // The `_.matchesProperty` iteratee shorthand.
  8025. * _.findLastIndex(users, ['active', false]);
  8026. * // => 2
  8027. *
  8028. * // The `_.property` iteratee shorthand.
  8029. * _.findLastIndex(users, 'active');
  8030. * // => 0
  8031. */
  8032. function findLastIndex(array, predicate, fromIndex) {
  8033. var length = array == null ? 0 : array.length;
  8034. if (!length) {
  8035. return -1;
  8036. }
  8037. var index = length - 1;
  8038. if (fromIndex !== undefined) {
  8039. index = toInteger(fromIndex);
  8040. index = fromIndex < 0
  8041. ? nativeMax(length + index, 0)
  8042. : nativeMin(index, length - 1);
  8043. }
  8044. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  8045. }
  8046. /**
  8047. * Flattens `array` a single level deep.
  8048. *
  8049. * @static
  8050. * @memberOf _
  8051. * @since 0.1.0
  8052. * @category Array
  8053. * @param {Array} array The array to flatten.
  8054. * @returns {Array} Returns the new flattened array.
  8055. * @example
  8056. *
  8057. * _.flatten([1, [2, [3, [4]], 5]]);
  8058. * // => [1, 2, [3, [4]], 5]
  8059. */
  8060. function flatten(array) {
  8061. var length = array == null ? 0 : array.length;
  8062. return length ? baseFlatten(array, 1) : [];
  8063. }
  8064. /**
  8065. * Recursively flattens `array`.
  8066. *
  8067. * @static
  8068. * @memberOf _
  8069. * @since 3.0.0
  8070. * @category Array
  8071. * @param {Array} array The array to flatten.
  8072. * @returns {Array} Returns the new flattened array.
  8073. * @example
  8074. *
  8075. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8076. * // => [1, 2, 3, 4, 5]
  8077. */
  8078. function flattenDeep(array) {
  8079. var length = array == null ? 0 : array.length;
  8080. return length ? baseFlatten(array, INFINITY) : [];
  8081. }
  8082. /**
  8083. * Recursively flatten `array` up to `depth` times.
  8084. *
  8085. * @static
  8086. * @memberOf _
  8087. * @since 4.4.0
  8088. * @category Array
  8089. * @param {Array} array The array to flatten.
  8090. * @param {number} [depth=1] The maximum recursion depth.
  8091. * @returns {Array} Returns the new flattened array.
  8092. * @example
  8093. *
  8094. * var array = [1, [2, [3, [4]], 5]];
  8095. *
  8096. * _.flattenDepth(array, 1);
  8097. * // => [1, 2, [3, [4]], 5]
  8098. *
  8099. * _.flattenDepth(array, 2);
  8100. * // => [1, 2, 3, [4], 5]
  8101. */
  8102. function flattenDepth(array, depth) {
  8103. var length = array == null ? 0 : array.length;
  8104. if (!length) {
  8105. return [];
  8106. }
  8107. depth = depth === undefined ? 1 : toInteger(depth);
  8108. return baseFlatten(array, depth);
  8109. }
  8110. /**
  8111. * The inverse of `_.toPairs`; this method returns an object composed
  8112. * from key-value `pairs`.
  8113. *
  8114. * @static
  8115. * @memberOf _
  8116. * @since 4.0.0
  8117. * @category Array
  8118. * @param {Array} pairs The key-value pairs.
  8119. * @returns {Object} Returns the new object.
  8120. * @example
  8121. *
  8122. * _.fromPairs([['a', 1], ['b', 2]]);
  8123. * // => { 'a': 1, 'b': 2 }
  8124. */
  8125. function fromPairs(pairs) {
  8126. var index = -1,
  8127. length = pairs == null ? 0 : pairs.length,
  8128. result = {};
  8129. while (++index < length) {
  8130. var pair = pairs[index];
  8131. result[pair[0]] = pair[1];
  8132. }
  8133. return result;
  8134. }
  8135. /**
  8136. * Gets the first element of `array`.
  8137. *
  8138. * @static
  8139. * @memberOf _
  8140. * @since 0.1.0
  8141. * @alias first
  8142. * @category Array
  8143. * @param {Array} array The array to query.
  8144. * @returns {*} Returns the first element of `array`.
  8145. * @example
  8146. *
  8147. * _.head([1, 2, 3]);
  8148. * // => 1
  8149. *
  8150. * _.head([]);
  8151. * // => undefined
  8152. */
  8153. function head(array) {
  8154. return (array && array.length) ? array[0] : undefined;
  8155. }
  8156. /**
  8157. * Gets the index at which the first occurrence of `value` is found in `array`
  8158. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8159. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8160. * offset from the end of `array`.
  8161. *
  8162. * @static
  8163. * @memberOf _
  8164. * @since 0.1.0
  8165. * @category Array
  8166. * @param {Array} array The array to inspect.
  8167. * @param {*} value The value to search for.
  8168. * @param {number} [fromIndex=0] The index to search from.
  8169. * @returns {number} Returns the index of the matched value, else `-1`.
  8170. * @example
  8171. *
  8172. * _.indexOf([1, 2, 1, 2], 2);
  8173. * // => 1
  8174. *
  8175. * // Search from the `fromIndex`.
  8176. * _.indexOf([1, 2, 1, 2], 2, 2);
  8177. * // => 3
  8178. */
  8179. function indexOf(array, value, fromIndex) {
  8180. var length = array == null ? 0 : array.length;
  8181. if (!length) {
  8182. return -1;
  8183. }
  8184. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8185. if (index < 0) {
  8186. index = nativeMax(length + index, 0);
  8187. }
  8188. return baseIndexOf(array, value, index);
  8189. }
  8190. /**
  8191. * Gets all but the last element of `array`.
  8192. *
  8193. * @static
  8194. * @memberOf _
  8195. * @since 0.1.0
  8196. * @category Array
  8197. * @param {Array} array The array to query.
  8198. * @returns {Array} Returns the slice of `array`.
  8199. * @example
  8200. *
  8201. * _.initial([1, 2, 3]);
  8202. * // => [1, 2]
  8203. */
  8204. function initial(array) {
  8205. var length = array == null ? 0 : array.length;
  8206. return length ? baseSlice(array, 0, -1) : [];
  8207. }
  8208. /**
  8209. * Creates an array of unique values that are included in all given arrays
  8210. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8211. * for equality comparisons. The order and references of result values are
  8212. * determined by the first array.
  8213. *
  8214. * @static
  8215. * @memberOf _
  8216. * @since 0.1.0
  8217. * @category Array
  8218. * @param {...Array} [arrays] The arrays to inspect.
  8219. * @returns {Array} Returns the new array of intersecting values.
  8220. * @example
  8221. *
  8222. * _.intersection([2, 1], [2, 3]);
  8223. * // => [2]
  8224. */
  8225. var intersection = baseRest(function(arrays) {
  8226. var mapped = arrayMap(arrays, castArrayLikeObject);
  8227. return (mapped.length && mapped[0] === arrays[0])
  8228. ? baseIntersection(mapped)
  8229. : [];
  8230. });
  8231. /**
  8232. * This method is like `_.intersection` except that it accepts `iteratee`
  8233. * which is invoked for each element of each `arrays` to generate the criterion
  8234. * by which they're compared. The order and references of result values are
  8235. * determined by the first array. The iteratee is invoked with one argument:
  8236. * (value).
  8237. *
  8238. * @static
  8239. * @memberOf _
  8240. * @since 4.0.0
  8241. * @category Array
  8242. * @param {...Array} [arrays] The arrays to inspect.
  8243. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8244. * @returns {Array} Returns the new array of intersecting values.
  8245. * @example
  8246. *
  8247. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8248. * // => [2.1]
  8249. *
  8250. * // The `_.property` iteratee shorthand.
  8251. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8252. * // => [{ 'x': 1 }]
  8253. */
  8254. var intersectionBy = baseRest(function(arrays) {
  8255. var iteratee = last(arrays),
  8256. mapped = arrayMap(arrays, castArrayLikeObject);
  8257. if (iteratee === last(mapped)) {
  8258. iteratee = undefined;
  8259. } else {
  8260. mapped.pop();
  8261. }
  8262. return (mapped.length && mapped[0] === arrays[0])
  8263. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8264. : [];
  8265. });
  8266. /**
  8267. * This method is like `_.intersection` except that it accepts `comparator`
  8268. * which is invoked to compare elements of `arrays`. The order and references
  8269. * of result values are determined by the first array. The comparator is
  8270. * invoked with two arguments: (arrVal, othVal).
  8271. *
  8272. * @static
  8273. * @memberOf _
  8274. * @since 4.0.0
  8275. * @category Array
  8276. * @param {...Array} [arrays] The arrays to inspect.
  8277. * @param {Function} [comparator] The comparator invoked per element.
  8278. * @returns {Array} Returns the new array of intersecting values.
  8279. * @example
  8280. *
  8281. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8282. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8283. *
  8284. * _.intersectionWith(objects, others, _.isEqual);
  8285. * // => [{ 'x': 1, 'y': 2 }]
  8286. */
  8287. var intersectionWith = baseRest(function(arrays) {
  8288. var comparator = last(arrays),
  8289. mapped = arrayMap(arrays, castArrayLikeObject);
  8290. comparator = typeof comparator == 'function' ? comparator : undefined;
  8291. if (comparator) {
  8292. mapped.pop();
  8293. }
  8294. return (mapped.length && mapped[0] === arrays[0])
  8295. ? baseIntersection(mapped, undefined, comparator)
  8296. : [];
  8297. });
  8298. /**
  8299. * Converts all elements in `array` into a string separated by `separator`.
  8300. *
  8301. * @static
  8302. * @memberOf _
  8303. * @since 4.0.0
  8304. * @category Array
  8305. * @param {Array} array The array to convert.
  8306. * @param {string} [separator=','] The element separator.
  8307. * @returns {string} Returns the joined string.
  8308. * @example
  8309. *
  8310. * _.join(['a', 'b', 'c'], '~');
  8311. * // => 'a~b~c'
  8312. */
  8313. function join(array, separator) {
  8314. return array == null ? '' : nativeJoin.call(array, separator);
  8315. }
  8316. /**
  8317. * Gets the last element of `array`.
  8318. *
  8319. * @static
  8320. * @memberOf _
  8321. * @since 0.1.0
  8322. * @category Array
  8323. * @param {Array} array The array to query.
  8324. * @returns {*} Returns the last element of `array`.
  8325. * @example
  8326. *
  8327. * _.last([1, 2, 3]);
  8328. * // => 3
  8329. */
  8330. function last(array) {
  8331. var length = array == null ? 0 : array.length;
  8332. return length ? array[length - 1] : undefined;
  8333. }
  8334. /**
  8335. * This method is like `_.indexOf` except that it iterates over elements of
  8336. * `array` from right to left.
  8337. *
  8338. * @static
  8339. * @memberOf _
  8340. * @since 0.1.0
  8341. * @category Array
  8342. * @param {Array} array The array to inspect.
  8343. * @param {*} value The value to search for.
  8344. * @param {number} [fromIndex=array.length-1] The index to search from.
  8345. * @returns {number} Returns the index of the matched value, else `-1`.
  8346. * @example
  8347. *
  8348. * _.lastIndexOf([1, 2, 1, 2], 2);
  8349. * // => 3
  8350. *
  8351. * // Search from the `fromIndex`.
  8352. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8353. * // => 1
  8354. */
  8355. function lastIndexOf(array, value, fromIndex) {
  8356. var length = array == null ? 0 : array.length;
  8357. if (!length) {
  8358. return -1;
  8359. }
  8360. var index = length;
  8361. if (fromIndex !== undefined) {
  8362. index = toInteger(fromIndex);
  8363. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8364. }
  8365. return value === value
  8366. ? strictLastIndexOf(array, value, index)
  8367. : baseFindIndex(array, baseIsNaN, index, true);
  8368. }
  8369. /**
  8370. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8371. * element from the end is returned.
  8372. *
  8373. * @static
  8374. * @memberOf _
  8375. * @since 4.11.0
  8376. * @category Array
  8377. * @param {Array} array The array to query.
  8378. * @param {number} [n=0] The index of the element to return.
  8379. * @returns {*} Returns the nth element of `array`.
  8380. * @example
  8381. *
  8382. * var array = ['a', 'b', 'c', 'd'];
  8383. *
  8384. * _.nth(array, 1);
  8385. * // => 'b'
  8386. *
  8387. * _.nth(array, -2);
  8388. * // => 'c';
  8389. */
  8390. function nth(array, n) {
  8391. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8392. }
  8393. /**
  8394. * Removes all given values from `array` using
  8395. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8396. * for equality comparisons.
  8397. *
  8398. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8399. * to remove elements from an array by predicate.
  8400. *
  8401. * @static
  8402. * @memberOf _
  8403. * @since 2.0.0
  8404. * @category Array
  8405. * @param {Array} array The array to modify.
  8406. * @param {...*} [values] The values to remove.
  8407. * @returns {Array} Returns `array`.
  8408. * @example
  8409. *
  8410. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8411. *
  8412. * _.pull(array, 'a', 'c');
  8413. * console.log(array);
  8414. * // => ['b', 'b']
  8415. */
  8416. var pull = baseRest(pullAll);
  8417. /**
  8418. * This method is like `_.pull` except that it accepts an array of values to remove.
  8419. *
  8420. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8421. *
  8422. * @static
  8423. * @memberOf _
  8424. * @since 4.0.0
  8425. * @category Array
  8426. * @param {Array} array The array to modify.
  8427. * @param {Array} values The values to remove.
  8428. * @returns {Array} Returns `array`.
  8429. * @example
  8430. *
  8431. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8432. *
  8433. * _.pullAll(array, ['a', 'c']);
  8434. * console.log(array);
  8435. * // => ['b', 'b']
  8436. */
  8437. function pullAll(array, values) {
  8438. return (array && array.length && values && values.length)
  8439. ? basePullAll(array, values)
  8440. : array;
  8441. }
  8442. /**
  8443. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8444. * invoked for each element of `array` and `values` to generate the criterion
  8445. * by which they're compared. The iteratee is invoked with one argument: (value).
  8446. *
  8447. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8448. *
  8449. * @static
  8450. * @memberOf _
  8451. * @since 4.0.0
  8452. * @category Array
  8453. * @param {Array} array The array to modify.
  8454. * @param {Array} values The values to remove.
  8455. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8456. * @returns {Array} Returns `array`.
  8457. * @example
  8458. *
  8459. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8460. *
  8461. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8462. * console.log(array);
  8463. * // => [{ 'x': 2 }]
  8464. */
  8465. function pullAllBy(array, values, iteratee) {
  8466. return (array && array.length && values && values.length)
  8467. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8468. : array;
  8469. }
  8470. /**
  8471. * This method is like `_.pullAll` except that it accepts `comparator` which
  8472. * is invoked to compare elements of `array` to `values`. The comparator is
  8473. * invoked with two arguments: (arrVal, othVal).
  8474. *
  8475. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8476. *
  8477. * @static
  8478. * @memberOf _
  8479. * @since 4.6.0
  8480. * @category Array
  8481. * @param {Array} array The array to modify.
  8482. * @param {Array} values The values to remove.
  8483. * @param {Function} [comparator] The comparator invoked per element.
  8484. * @returns {Array} Returns `array`.
  8485. * @example
  8486. *
  8487. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8488. *
  8489. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8490. * console.log(array);
  8491. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8492. */
  8493. function pullAllWith(array, values, comparator) {
  8494. return (array && array.length && values && values.length)
  8495. ? basePullAll(array, values, undefined, comparator)
  8496. : array;
  8497. }
  8498. /**
  8499. * Removes elements from `array` corresponding to `indexes` and returns an
  8500. * array of removed elements.
  8501. *
  8502. * **Note:** Unlike `_.at`, this method mutates `array`.
  8503. *
  8504. * @static
  8505. * @memberOf _
  8506. * @since 3.0.0
  8507. * @category Array
  8508. * @param {Array} array The array to modify.
  8509. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8510. * @returns {Array} Returns the new array of removed elements.
  8511. * @example
  8512. *
  8513. * var array = ['a', 'b', 'c', 'd'];
  8514. * var pulled = _.pullAt(array, [1, 3]);
  8515. *
  8516. * console.log(array);
  8517. * // => ['a', 'c']
  8518. *
  8519. * console.log(pulled);
  8520. * // => ['b', 'd']
  8521. */
  8522. var pullAt = flatRest(function(array, indexes) {
  8523. var length = array == null ? 0 : array.length,
  8524. result = baseAt(array, indexes);
  8525. basePullAt(array, arrayMap(indexes, function(index) {
  8526. return isIndex(index, length) ? +index : index;
  8527. }).sort(compareAscending));
  8528. return result;
  8529. });
  8530. /**
  8531. * Removes all elements from `array` that `predicate` returns truthy for
  8532. * and returns an array of the removed elements. The predicate is invoked
  8533. * with three arguments: (value, index, array).
  8534. *
  8535. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8536. * to pull elements from an array by value.
  8537. *
  8538. * @static
  8539. * @memberOf _
  8540. * @since 2.0.0
  8541. * @category Array
  8542. * @param {Array} array The array to modify.
  8543. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8544. * @returns {Array} Returns the new array of removed elements.
  8545. * @example
  8546. *
  8547. * var array = [1, 2, 3, 4];
  8548. * var evens = _.remove(array, function(n) {
  8549. * return n % 2 == 0;
  8550. * });
  8551. *
  8552. * console.log(array);
  8553. * // => [1, 3]
  8554. *
  8555. * console.log(evens);
  8556. * // => [2, 4]
  8557. */
  8558. function remove(array, predicate) {
  8559. var result = [];
  8560. if (!(array && array.length)) {
  8561. return result;
  8562. }
  8563. var index = -1,
  8564. indexes = [],
  8565. length = array.length;
  8566. predicate = getIteratee(predicate, 3);
  8567. while (++index < length) {
  8568. var value = array[index];
  8569. if (predicate(value, index, array)) {
  8570. result.push(value);
  8571. indexes.push(index);
  8572. }
  8573. }
  8574. basePullAt(array, indexes);
  8575. return result;
  8576. }
  8577. /**
  8578. * Reverses `array` so that the first element becomes the last, the second
  8579. * element becomes the second to last, and so on.
  8580. *
  8581. * **Note:** This method mutates `array` and is based on
  8582. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8583. *
  8584. * @static
  8585. * @memberOf _
  8586. * @since 4.0.0
  8587. * @category Array
  8588. * @param {Array} array The array to modify.
  8589. * @returns {Array} Returns `array`.
  8590. * @example
  8591. *
  8592. * var array = [1, 2, 3];
  8593. *
  8594. * _.reverse(array);
  8595. * // => [3, 2, 1]
  8596. *
  8597. * console.log(array);
  8598. * // => [3, 2, 1]
  8599. */
  8600. function reverse(array) {
  8601. return array == null ? array : nativeReverse.call(array);
  8602. }
  8603. /**
  8604. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8605. *
  8606. * **Note:** This method is used instead of
  8607. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8608. * returned.
  8609. *
  8610. * @static
  8611. * @memberOf _
  8612. * @since 3.0.0
  8613. * @category Array
  8614. * @param {Array} array The array to slice.
  8615. * @param {number} [start=0] The start position.
  8616. * @param {number} [end=array.length] The end position.
  8617. * @returns {Array} Returns the slice of `array`.
  8618. */
  8619. function slice(array, start, end) {
  8620. var length = array == null ? 0 : array.length;
  8621. if (!length) {
  8622. return [];
  8623. }
  8624. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8625. start = 0;
  8626. end = length;
  8627. }
  8628. else {
  8629. start = start == null ? 0 : toInteger(start);
  8630. end = end === undefined ? length : toInteger(end);
  8631. }
  8632. return baseSlice(array, start, end);
  8633. }
  8634. /**
  8635. * Uses a binary search to determine the lowest index at which `value`
  8636. * should be inserted into `array` in order to maintain its sort order.
  8637. *
  8638. * @static
  8639. * @memberOf _
  8640. * @since 0.1.0
  8641. * @category Array
  8642. * @param {Array} array The sorted array to inspect.
  8643. * @param {*} value The value to evaluate.
  8644. * @returns {number} Returns the index at which `value` should be inserted
  8645. * into `array`.
  8646. * @example
  8647. *
  8648. * _.sortedIndex([30, 50], 40);
  8649. * // => 1
  8650. */
  8651. function sortedIndex(array, value) {
  8652. return baseSortedIndex(array, value);
  8653. }
  8654. /**
  8655. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8656. * which is invoked for `value` and each element of `array` to compute their
  8657. * sort ranking. The iteratee is invoked with one argument: (value).
  8658. *
  8659. * @static
  8660. * @memberOf _
  8661. * @since 4.0.0
  8662. * @category Array
  8663. * @param {Array} array The sorted array to inspect.
  8664. * @param {*} value The value to evaluate.
  8665. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8666. * @returns {number} Returns the index at which `value` should be inserted
  8667. * into `array`.
  8668. * @example
  8669. *
  8670. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8671. *
  8672. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8673. * // => 0
  8674. *
  8675. * // The `_.property` iteratee shorthand.
  8676. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8677. * // => 0
  8678. */
  8679. function sortedIndexBy(array, value, iteratee) {
  8680. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8681. }
  8682. /**
  8683. * This method is like `_.indexOf` except that it performs a binary
  8684. * search on a sorted `array`.
  8685. *
  8686. * @static
  8687. * @memberOf _
  8688. * @since 4.0.0
  8689. * @category Array
  8690. * @param {Array} array The array to inspect.
  8691. * @param {*} value The value to search for.
  8692. * @returns {number} Returns the index of the matched value, else `-1`.
  8693. * @example
  8694. *
  8695. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8696. * // => 1
  8697. */
  8698. function sortedIndexOf(array, value) {
  8699. var length = array == null ? 0 : array.length;
  8700. if (length) {
  8701. var index = baseSortedIndex(array, value);
  8702. if (index < length && eq(array[index], value)) {
  8703. return index;
  8704. }
  8705. }
  8706. return -1;
  8707. }
  8708. /**
  8709. * This method is like `_.sortedIndex` except that it returns the highest
  8710. * index at which `value` should be inserted into `array` in order to
  8711. * maintain its sort order.
  8712. *
  8713. * @static
  8714. * @memberOf _
  8715. * @since 3.0.0
  8716. * @category Array
  8717. * @param {Array} array The sorted array to inspect.
  8718. * @param {*} value The value to evaluate.
  8719. * @returns {number} Returns the index at which `value` should be inserted
  8720. * into `array`.
  8721. * @example
  8722. *
  8723. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8724. * // => 4
  8725. */
  8726. function sortedLastIndex(array, value) {
  8727. return baseSortedIndex(array, value, true);
  8728. }
  8729. /**
  8730. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8731. * which is invoked for `value` and each element of `array` to compute their
  8732. * sort ranking. The iteratee is invoked with one argument: (value).
  8733. *
  8734. * @static
  8735. * @memberOf _
  8736. * @since 4.0.0
  8737. * @category Array
  8738. * @param {Array} array The sorted array to inspect.
  8739. * @param {*} value The value to evaluate.
  8740. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8741. * @returns {number} Returns the index at which `value` should be inserted
  8742. * into `array`.
  8743. * @example
  8744. *
  8745. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8746. *
  8747. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8748. * // => 1
  8749. *
  8750. * // The `_.property` iteratee shorthand.
  8751. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8752. * // => 1
  8753. */
  8754. function sortedLastIndexBy(array, value, iteratee) {
  8755. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8756. }
  8757. /**
  8758. * This method is like `_.lastIndexOf` except that it performs a binary
  8759. * search on a sorted `array`.
  8760. *
  8761. * @static
  8762. * @memberOf _
  8763. * @since 4.0.0
  8764. * @category Array
  8765. * @param {Array} array The array to inspect.
  8766. * @param {*} value The value to search for.
  8767. * @returns {number} Returns the index of the matched value, else `-1`.
  8768. * @example
  8769. *
  8770. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8771. * // => 3
  8772. */
  8773. function sortedLastIndexOf(array, value) {
  8774. var length = array == null ? 0 : array.length;
  8775. if (length) {
  8776. var index = baseSortedIndex(array, value, true) - 1;
  8777. if (eq(array[index], value)) {
  8778. return index;
  8779. }
  8780. }
  8781. return -1;
  8782. }
  8783. /**
  8784. * This method is like `_.uniq` except that it's designed and optimized
  8785. * for sorted arrays.
  8786. *
  8787. * @static
  8788. * @memberOf _
  8789. * @since 4.0.0
  8790. * @category Array
  8791. * @param {Array} array The array to inspect.
  8792. * @returns {Array} Returns the new duplicate free array.
  8793. * @example
  8794. *
  8795. * _.sortedUniq([1, 1, 2]);
  8796. * // => [1, 2]
  8797. */
  8798. function sortedUniq(array) {
  8799. return (array && array.length)
  8800. ? baseSortedUniq(array)
  8801. : [];
  8802. }
  8803. /**
  8804. * This method is like `_.uniqBy` except that it's designed and optimized
  8805. * for sorted arrays.
  8806. *
  8807. * @static
  8808. * @memberOf _
  8809. * @since 4.0.0
  8810. * @category Array
  8811. * @param {Array} array The array to inspect.
  8812. * @param {Function} [iteratee] The iteratee invoked per element.
  8813. * @returns {Array} Returns the new duplicate free array.
  8814. * @example
  8815. *
  8816. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8817. * // => [1.1, 2.3]
  8818. */
  8819. function sortedUniqBy(array, iteratee) {
  8820. return (array && array.length)
  8821. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8822. : [];
  8823. }
  8824. /**
  8825. * Gets all but the first element of `array`.
  8826. *
  8827. * @static
  8828. * @memberOf _
  8829. * @since 4.0.0
  8830. * @category Array
  8831. * @param {Array} array The array to query.
  8832. * @returns {Array} Returns the slice of `array`.
  8833. * @example
  8834. *
  8835. * _.tail([1, 2, 3]);
  8836. * // => [2, 3]
  8837. */
  8838. function tail(array) {
  8839. var length = array == null ? 0 : array.length;
  8840. return length ? baseSlice(array, 1, length) : [];
  8841. }
  8842. /**
  8843. * Creates a slice of `array` with `n` elements taken from the beginning.
  8844. *
  8845. * @static
  8846. * @memberOf _
  8847. * @since 0.1.0
  8848. * @category Array
  8849. * @param {Array} array The array to query.
  8850. * @param {number} [n=1] The number of elements to take.
  8851. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8852. * @returns {Array} Returns the slice of `array`.
  8853. * @example
  8854. *
  8855. * _.take([1, 2, 3]);
  8856. * // => [1]
  8857. *
  8858. * _.take([1, 2, 3], 2);
  8859. * // => [1, 2]
  8860. *
  8861. * _.take([1, 2, 3], 5);
  8862. * // => [1, 2, 3]
  8863. *
  8864. * _.take([1, 2, 3], 0);
  8865. * // => []
  8866. */
  8867. function take(array, n, guard) {
  8868. if (!(array && array.length)) {
  8869. return [];
  8870. }
  8871. n = (guard || n === undefined) ? 1 : toInteger(n);
  8872. return baseSlice(array, 0, n < 0 ? 0 : n);
  8873. }
  8874. /**
  8875. * Creates a slice of `array` with `n` elements taken from the end.
  8876. *
  8877. * @static
  8878. * @memberOf _
  8879. * @since 3.0.0
  8880. * @category Array
  8881. * @param {Array} array The array to query.
  8882. * @param {number} [n=1] The number of elements to take.
  8883. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8884. * @returns {Array} Returns the slice of `array`.
  8885. * @example
  8886. *
  8887. * _.takeRight([1, 2, 3]);
  8888. * // => [3]
  8889. *
  8890. * _.takeRight([1, 2, 3], 2);
  8891. * // => [2, 3]
  8892. *
  8893. * _.takeRight([1, 2, 3], 5);
  8894. * // => [1, 2, 3]
  8895. *
  8896. * _.takeRight([1, 2, 3], 0);
  8897. * // => []
  8898. */
  8899. function takeRight(array, n, guard) {
  8900. var length = array == null ? 0 : array.length;
  8901. if (!length) {
  8902. return [];
  8903. }
  8904. n = (guard || n === undefined) ? 1 : toInteger(n);
  8905. n = length - n;
  8906. return baseSlice(array, n < 0 ? 0 : n, length);
  8907. }
  8908. /**
  8909. * Creates a slice of `array` with elements taken from the end. Elements are
  8910. * taken until `predicate` returns falsey. The predicate is invoked with
  8911. * three arguments: (value, index, array).
  8912. *
  8913. * @static
  8914. * @memberOf _
  8915. * @since 3.0.0
  8916. * @category Array
  8917. * @param {Array} array The array to query.
  8918. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8919. * @returns {Array} Returns the slice of `array`.
  8920. * @example
  8921. *
  8922. * var users = [
  8923. * { 'user': 'barney', 'active': true },
  8924. * { 'user': 'fred', 'active': false },
  8925. * { 'user': 'pebbles', 'active': false }
  8926. * ];
  8927. *
  8928. * _.takeRightWhile(users, function(o) { return !o.active; });
  8929. * // => objects for ['fred', 'pebbles']
  8930. *
  8931. * // The `_.matches` iteratee shorthand.
  8932. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8933. * // => objects for ['pebbles']
  8934. *
  8935. * // The `_.matchesProperty` iteratee shorthand.
  8936. * _.takeRightWhile(users, ['active', false]);
  8937. * // => objects for ['fred', 'pebbles']
  8938. *
  8939. * // The `_.property` iteratee shorthand.
  8940. * _.takeRightWhile(users, 'active');
  8941. * // => []
  8942. */
  8943. function takeRightWhile(array, predicate) {
  8944. return (array && array.length)
  8945. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8946. : [];
  8947. }
  8948. /**
  8949. * Creates a slice of `array` with elements taken from the beginning. Elements
  8950. * are taken until `predicate` returns falsey. The predicate is invoked with
  8951. * three arguments: (value, index, array).
  8952. *
  8953. * @static
  8954. * @memberOf _
  8955. * @since 3.0.0
  8956. * @category Array
  8957. * @param {Array} array The array to query.
  8958. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8959. * @returns {Array} Returns the slice of `array`.
  8960. * @example
  8961. *
  8962. * var users = [
  8963. * { 'user': 'barney', 'active': false },
  8964. * { 'user': 'fred', 'active': false },
  8965. * { 'user': 'pebbles', 'active': true }
  8966. * ];
  8967. *
  8968. * _.takeWhile(users, function(o) { return !o.active; });
  8969. * // => objects for ['barney', 'fred']
  8970. *
  8971. * // The `_.matches` iteratee shorthand.
  8972. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8973. * // => objects for ['barney']
  8974. *
  8975. * // The `_.matchesProperty` iteratee shorthand.
  8976. * _.takeWhile(users, ['active', false]);
  8977. * // => objects for ['barney', 'fred']
  8978. *
  8979. * // The `_.property` iteratee shorthand.
  8980. * _.takeWhile(users, 'active');
  8981. * // => []
  8982. */
  8983. function takeWhile(array, predicate) {
  8984. return (array && array.length)
  8985. ? baseWhile(array, getIteratee(predicate, 3))
  8986. : [];
  8987. }
  8988. /**
  8989. * Creates an array of unique values, in order, from all given arrays using
  8990. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8991. * for equality comparisons.
  8992. *
  8993. * @static
  8994. * @memberOf _
  8995. * @since 0.1.0
  8996. * @category Array
  8997. * @param {...Array} [arrays] The arrays to inspect.
  8998. * @returns {Array} Returns the new array of combined values.
  8999. * @example
  9000. *
  9001. * _.union([2], [1, 2]);
  9002. * // => [2, 1]
  9003. */
  9004. var union = baseRest(function(arrays) {
  9005. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  9006. });
  9007. /**
  9008. * This method is like `_.union` except that it accepts `iteratee` which is
  9009. * invoked for each element of each `arrays` to generate the criterion by
  9010. * which uniqueness is computed. Result values are chosen from the first
  9011. * array in which the value occurs. The iteratee is invoked with one argument:
  9012. * (value).
  9013. *
  9014. * @static
  9015. * @memberOf _
  9016. * @since 4.0.0
  9017. * @category Array
  9018. * @param {...Array} [arrays] The arrays to inspect.
  9019. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9020. * @returns {Array} Returns the new array of combined values.
  9021. * @example
  9022. *
  9023. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  9024. * // => [2.1, 1.2]
  9025. *
  9026. * // The `_.property` iteratee shorthand.
  9027. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9028. * // => [{ 'x': 1 }, { 'x': 2 }]
  9029. */
  9030. var unionBy = baseRest(function(arrays) {
  9031. var iteratee = last(arrays);
  9032. if (isArrayLikeObject(iteratee)) {
  9033. iteratee = undefined;
  9034. }
  9035. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  9036. });
  9037. /**
  9038. * This method is like `_.union` except that it accepts `comparator` which
  9039. * is invoked to compare elements of `arrays`. Result values are chosen from
  9040. * the first array in which the value occurs. The comparator is invoked
  9041. * with two arguments: (arrVal, othVal).
  9042. *
  9043. * @static
  9044. * @memberOf _
  9045. * @since 4.0.0
  9046. * @category Array
  9047. * @param {...Array} [arrays] The arrays to inspect.
  9048. * @param {Function} [comparator] The comparator invoked per element.
  9049. * @returns {Array} Returns the new array of combined values.
  9050. * @example
  9051. *
  9052. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9053. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9054. *
  9055. * _.unionWith(objects, others, _.isEqual);
  9056. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9057. */
  9058. var unionWith = baseRest(function(arrays) {
  9059. var comparator = last(arrays);
  9060. comparator = typeof comparator == 'function' ? comparator : undefined;
  9061. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9062. });
  9063. /**
  9064. * Creates a duplicate-free version of an array, using
  9065. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9066. * for equality comparisons, in which only the first occurrence of each element
  9067. * is kept. The order of result values is determined by the order they occur
  9068. * in the array.
  9069. *
  9070. * @static
  9071. * @memberOf _
  9072. * @since 0.1.0
  9073. * @category Array
  9074. * @param {Array} array The array to inspect.
  9075. * @returns {Array} Returns the new duplicate free array.
  9076. * @example
  9077. *
  9078. * _.uniq([2, 1, 2]);
  9079. * // => [2, 1]
  9080. */
  9081. function uniq(array) {
  9082. return (array && array.length) ? baseUniq(array) : [];
  9083. }
  9084. /**
  9085. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9086. * invoked for each element in `array` to generate the criterion by which
  9087. * uniqueness is computed. The order of result values is determined by the
  9088. * order they occur in the array. The iteratee is invoked with one argument:
  9089. * (value).
  9090. *
  9091. * @static
  9092. * @memberOf _
  9093. * @since 4.0.0
  9094. * @category Array
  9095. * @param {Array} array The array to inspect.
  9096. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9097. * @returns {Array} Returns the new duplicate free array.
  9098. * @example
  9099. *
  9100. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9101. * // => [2.1, 1.2]
  9102. *
  9103. * // The `_.property` iteratee shorthand.
  9104. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9105. * // => [{ 'x': 1 }, { 'x': 2 }]
  9106. */
  9107. function uniqBy(array, iteratee) {
  9108. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9109. }
  9110. /**
  9111. * This method is like `_.uniq` except that it accepts `comparator` which
  9112. * is invoked to compare elements of `array`. The order of result values is
  9113. * determined by the order they occur in the array.The comparator is invoked
  9114. * with two arguments: (arrVal, othVal).
  9115. *
  9116. * @static
  9117. * @memberOf _
  9118. * @since 4.0.0
  9119. * @category Array
  9120. * @param {Array} array The array to inspect.
  9121. * @param {Function} [comparator] The comparator invoked per element.
  9122. * @returns {Array} Returns the new duplicate free array.
  9123. * @example
  9124. *
  9125. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9126. *
  9127. * _.uniqWith(objects, _.isEqual);
  9128. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9129. */
  9130. function uniqWith(array, comparator) {
  9131. comparator = typeof comparator == 'function' ? comparator : undefined;
  9132. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9133. }
  9134. /**
  9135. * This method is like `_.zip` except that it accepts an array of grouped
  9136. * elements and creates an array regrouping the elements to their pre-zip
  9137. * configuration.
  9138. *
  9139. * @static
  9140. * @memberOf _
  9141. * @since 1.2.0
  9142. * @category Array
  9143. * @param {Array} array The array of grouped elements to process.
  9144. * @returns {Array} Returns the new array of regrouped elements.
  9145. * @example
  9146. *
  9147. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9148. * // => [['a', 1, true], ['b', 2, false]]
  9149. *
  9150. * _.unzip(zipped);
  9151. * // => [['a', 'b'], [1, 2], [true, false]]
  9152. */
  9153. function unzip(array) {
  9154. if (!(array && array.length)) {
  9155. return [];
  9156. }
  9157. var length = 0;
  9158. array = arrayFilter(array, function(group) {
  9159. if (isArrayLikeObject(group)) {
  9160. length = nativeMax(group.length, length);
  9161. return true;
  9162. }
  9163. });
  9164. return baseTimes(length, function(index) {
  9165. return arrayMap(array, baseProperty(index));
  9166. });
  9167. }
  9168. /**
  9169. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9170. * how regrouped values should be combined. The iteratee is invoked with the
  9171. * elements of each group: (...group).
  9172. *
  9173. * @static
  9174. * @memberOf _
  9175. * @since 3.8.0
  9176. * @category Array
  9177. * @param {Array} array The array of grouped elements to process.
  9178. * @param {Function} [iteratee=_.identity] The function to combine
  9179. * regrouped values.
  9180. * @returns {Array} Returns the new array of regrouped elements.
  9181. * @example
  9182. *
  9183. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9184. * // => [[1, 10, 100], [2, 20, 200]]
  9185. *
  9186. * _.unzipWith(zipped, _.add);
  9187. * // => [3, 30, 300]
  9188. */
  9189. function unzipWith(array, iteratee) {
  9190. if (!(array && array.length)) {
  9191. return [];
  9192. }
  9193. var result = unzip(array);
  9194. if (iteratee == null) {
  9195. return result;
  9196. }
  9197. return arrayMap(result, function(group) {
  9198. return apply(iteratee, undefined, group);
  9199. });
  9200. }
  9201. /**
  9202. * Creates an array excluding all given values using
  9203. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9204. * for equality comparisons.
  9205. *
  9206. * **Note:** Unlike `_.pull`, this method returns a new array.
  9207. *
  9208. * @static
  9209. * @memberOf _
  9210. * @since 0.1.0
  9211. * @category Array
  9212. * @param {Array} array The array to inspect.
  9213. * @param {...*} [values] The values to exclude.
  9214. * @returns {Array} Returns the new array of filtered values.
  9215. * @see _.difference, _.xor
  9216. * @example
  9217. *
  9218. * _.without([2, 1, 2, 3], 1, 2);
  9219. * // => [3]
  9220. */
  9221. var without = baseRest(function(array, values) {
  9222. return isArrayLikeObject(array)
  9223. ? baseDifference(array, values)
  9224. : [];
  9225. });
  9226. /**
  9227. * Creates an array of unique values that is the
  9228. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9229. * of the given arrays. The order of result values is determined by the order
  9230. * they occur in the arrays.
  9231. *
  9232. * @static
  9233. * @memberOf _
  9234. * @since 2.4.0
  9235. * @category Array
  9236. * @param {...Array} [arrays] The arrays to inspect.
  9237. * @returns {Array} Returns the new array of filtered values.
  9238. * @see _.difference, _.without
  9239. * @example
  9240. *
  9241. * _.xor([2, 1], [2, 3]);
  9242. * // => [1, 3]
  9243. */
  9244. var xor = baseRest(function(arrays) {
  9245. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9246. });
  9247. /**
  9248. * This method is like `_.xor` except that it accepts `iteratee` which is
  9249. * invoked for each element of each `arrays` to generate the criterion by
  9250. * which by which they're compared. The order of result values is determined
  9251. * by the order they occur in the arrays. The iteratee is invoked with one
  9252. * argument: (value).
  9253. *
  9254. * @static
  9255. * @memberOf _
  9256. * @since 4.0.0
  9257. * @category Array
  9258. * @param {...Array} [arrays] The arrays to inspect.
  9259. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9260. * @returns {Array} Returns the new array of filtered values.
  9261. * @example
  9262. *
  9263. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9264. * // => [1.2, 3.4]
  9265. *
  9266. * // The `_.property` iteratee shorthand.
  9267. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9268. * // => [{ 'x': 2 }]
  9269. */
  9270. var xorBy = baseRest(function(arrays) {
  9271. var iteratee = last(arrays);
  9272. if (isArrayLikeObject(iteratee)) {
  9273. iteratee = undefined;
  9274. }
  9275. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9276. });
  9277. /**
  9278. * This method is like `_.xor` except that it accepts `comparator` which is
  9279. * invoked to compare elements of `arrays`. The order of result values is
  9280. * determined by the order they occur in the arrays. The comparator is invoked
  9281. * with two arguments: (arrVal, othVal).
  9282. *
  9283. * @static
  9284. * @memberOf _
  9285. * @since 4.0.0
  9286. * @category Array
  9287. * @param {...Array} [arrays] The arrays to inspect.
  9288. * @param {Function} [comparator] The comparator invoked per element.
  9289. * @returns {Array} Returns the new array of filtered values.
  9290. * @example
  9291. *
  9292. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9293. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9294. *
  9295. * _.xorWith(objects, others, _.isEqual);
  9296. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9297. */
  9298. var xorWith = baseRest(function(arrays) {
  9299. var comparator = last(arrays);
  9300. comparator = typeof comparator == 'function' ? comparator : undefined;
  9301. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9302. });
  9303. /**
  9304. * Creates an array of grouped elements, the first of which contains the
  9305. * first elements of the given arrays, the second of which contains the
  9306. * second elements of the given arrays, and so on.
  9307. *
  9308. * @static
  9309. * @memberOf _
  9310. * @since 0.1.0
  9311. * @category Array
  9312. * @param {...Array} [arrays] The arrays to process.
  9313. * @returns {Array} Returns the new array of grouped elements.
  9314. * @example
  9315. *
  9316. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9317. * // => [['a', 1, true], ['b', 2, false]]
  9318. */
  9319. var zip = baseRest(unzip);
  9320. /**
  9321. * This method is like `_.fromPairs` except that it accepts two arrays,
  9322. * one of property identifiers and one of corresponding values.
  9323. *
  9324. * @static
  9325. * @memberOf _
  9326. * @since 0.4.0
  9327. * @category Array
  9328. * @param {Array} [props=[]] The property identifiers.
  9329. * @param {Array} [values=[]] The property values.
  9330. * @returns {Object} Returns the new object.
  9331. * @example
  9332. *
  9333. * _.zipObject(['a', 'b'], [1, 2]);
  9334. * // => { 'a': 1, 'b': 2 }
  9335. */
  9336. function zipObject(props, values) {
  9337. return baseZipObject(props || [], values || [], assignValue);
  9338. }
  9339. /**
  9340. * This method is like `_.zipObject` except that it supports property paths.
  9341. *
  9342. * @static
  9343. * @memberOf _
  9344. * @since 4.1.0
  9345. * @category Array
  9346. * @param {Array} [props=[]] The property identifiers.
  9347. * @param {Array} [values=[]] The property values.
  9348. * @returns {Object} Returns the new object.
  9349. * @example
  9350. *
  9351. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9352. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9353. */
  9354. function zipObjectDeep(props, values) {
  9355. return baseZipObject(props || [], values || [], baseSet);
  9356. }
  9357. /**
  9358. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9359. * how grouped values should be combined. The iteratee is invoked with the
  9360. * elements of each group: (...group).
  9361. *
  9362. * @static
  9363. * @memberOf _
  9364. * @since 3.8.0
  9365. * @category Array
  9366. * @param {...Array} [arrays] The arrays to process.
  9367. * @param {Function} [iteratee=_.identity] The function to combine
  9368. * grouped values.
  9369. * @returns {Array} Returns the new array of grouped elements.
  9370. * @example
  9371. *
  9372. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9373. * return a + b + c;
  9374. * });
  9375. * // => [111, 222]
  9376. */
  9377. var zipWith = baseRest(function(arrays) {
  9378. var length = arrays.length,
  9379. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9380. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9381. return unzipWith(arrays, iteratee);
  9382. });
  9383. /*------------------------------------------------------------------------*/
  9384. /**
  9385. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9386. * chain sequences enabled. The result of such sequences must be unwrapped
  9387. * with `_#value`.
  9388. *
  9389. * @static
  9390. * @memberOf _
  9391. * @since 1.3.0
  9392. * @category Seq
  9393. * @param {*} value The value to wrap.
  9394. * @returns {Object} Returns the new `lodash` wrapper instance.
  9395. * @example
  9396. *
  9397. * var users = [
  9398. * { 'user': 'barney', 'age': 36 },
  9399. * { 'user': 'fred', 'age': 40 },
  9400. * { 'user': 'pebbles', 'age': 1 }
  9401. * ];
  9402. *
  9403. * var youngest = _
  9404. * .chain(users)
  9405. * .sortBy('age')
  9406. * .map(function(o) {
  9407. * return o.user + ' is ' + o.age;
  9408. * })
  9409. * .head()
  9410. * .value();
  9411. * // => 'pebbles is 1'
  9412. */
  9413. function chain(value) {
  9414. var result = lodash(value);
  9415. result.__chain__ = true;
  9416. return result;
  9417. }
  9418. /**
  9419. * This method invokes `interceptor` and returns `value`. The interceptor
  9420. * is invoked with one argument; (value). The purpose of this method is to
  9421. * "tap into" a method chain sequence in order to modify intermediate results.
  9422. *
  9423. * @static
  9424. * @memberOf _
  9425. * @since 0.1.0
  9426. * @category Seq
  9427. * @param {*} value The value to provide to `interceptor`.
  9428. * @param {Function} interceptor The function to invoke.
  9429. * @returns {*} Returns `value`.
  9430. * @example
  9431. *
  9432. * _([1, 2, 3])
  9433. * .tap(function(array) {
  9434. * // Mutate input array.
  9435. * array.pop();
  9436. * })
  9437. * .reverse()
  9438. * .value();
  9439. * // => [2, 1]
  9440. */
  9441. function tap(value, interceptor) {
  9442. interceptor(value);
  9443. return value;
  9444. }
  9445. /**
  9446. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9447. * The purpose of this method is to "pass thru" values replacing intermediate
  9448. * results in a method chain sequence.
  9449. *
  9450. * @static
  9451. * @memberOf _
  9452. * @since 3.0.0
  9453. * @category Seq
  9454. * @param {*} value The value to provide to `interceptor`.
  9455. * @param {Function} interceptor The function to invoke.
  9456. * @returns {*} Returns the result of `interceptor`.
  9457. * @example
  9458. *
  9459. * _(' abc ')
  9460. * .chain()
  9461. * .trim()
  9462. * .thru(function(value) {
  9463. * return [value];
  9464. * })
  9465. * .value();
  9466. * // => ['abc']
  9467. */
  9468. function thru(value, interceptor) {
  9469. return interceptor(value);
  9470. }
  9471. /**
  9472. * This method is the wrapper version of `_.at`.
  9473. *
  9474. * @name at
  9475. * @memberOf _
  9476. * @since 1.0.0
  9477. * @category Seq
  9478. * @param {...(string|string[])} [paths] The property paths to pick.
  9479. * @returns {Object} Returns the new `lodash` wrapper instance.
  9480. * @example
  9481. *
  9482. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9483. *
  9484. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9485. * // => [3, 4]
  9486. */
  9487. var wrapperAt = flatRest(function(paths) {
  9488. var length = paths.length,
  9489. start = length ? paths[0] : 0,
  9490. value = this.__wrapped__,
  9491. interceptor = function(object) { return baseAt(object, paths); };
  9492. if (length > 1 || this.__actions__.length ||
  9493. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9494. return this.thru(interceptor);
  9495. }
  9496. value = value.slice(start, +start + (length ? 1 : 0));
  9497. value.__actions__.push({
  9498. 'func': thru,
  9499. 'args': [interceptor],
  9500. 'thisArg': undefined
  9501. });
  9502. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9503. if (length && !array.length) {
  9504. array.push(undefined);
  9505. }
  9506. return array;
  9507. });
  9508. });
  9509. /**
  9510. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9511. *
  9512. * @name chain
  9513. * @memberOf _
  9514. * @since 0.1.0
  9515. * @category Seq
  9516. * @returns {Object} Returns the new `lodash` wrapper instance.
  9517. * @example
  9518. *
  9519. * var users = [
  9520. * { 'user': 'barney', 'age': 36 },
  9521. * { 'user': 'fred', 'age': 40 }
  9522. * ];
  9523. *
  9524. * // A sequence without explicit chaining.
  9525. * _(users).head();
  9526. * // => { 'user': 'barney', 'age': 36 }
  9527. *
  9528. * // A sequence with explicit chaining.
  9529. * _(users)
  9530. * .chain()
  9531. * .head()
  9532. * .pick('user')
  9533. * .value();
  9534. * // => { 'user': 'barney' }
  9535. */
  9536. function wrapperChain() {
  9537. return chain(this);
  9538. }
  9539. /**
  9540. * Executes the chain sequence and returns the wrapped result.
  9541. *
  9542. * @name commit
  9543. * @memberOf _
  9544. * @since 3.2.0
  9545. * @category Seq
  9546. * @returns {Object} Returns the new `lodash` wrapper instance.
  9547. * @example
  9548. *
  9549. * var array = [1, 2];
  9550. * var wrapped = _(array).push(3);
  9551. *
  9552. * console.log(array);
  9553. * // => [1, 2]
  9554. *
  9555. * wrapped = wrapped.commit();
  9556. * console.log(array);
  9557. * // => [1, 2, 3]
  9558. *
  9559. * wrapped.last();
  9560. * // => 3
  9561. *
  9562. * console.log(array);
  9563. * // => [1, 2, 3]
  9564. */
  9565. function wrapperCommit() {
  9566. return new LodashWrapper(this.value(), this.__chain__);
  9567. }
  9568. /**
  9569. * Gets the next value on a wrapped object following the
  9570. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9571. *
  9572. * @name next
  9573. * @memberOf _
  9574. * @since 4.0.0
  9575. * @category Seq
  9576. * @returns {Object} Returns the next iterator value.
  9577. * @example
  9578. *
  9579. * var wrapped = _([1, 2]);
  9580. *
  9581. * wrapped.next();
  9582. * // => { 'done': false, 'value': 1 }
  9583. *
  9584. * wrapped.next();
  9585. * // => { 'done': false, 'value': 2 }
  9586. *
  9587. * wrapped.next();
  9588. * // => { 'done': true, 'value': undefined }
  9589. */
  9590. function wrapperNext() {
  9591. if (this.__values__ === undefined) {
  9592. this.__values__ = toArray(this.value());
  9593. }
  9594. var done = this.__index__ >= this.__values__.length,
  9595. value = done ? undefined : this.__values__[this.__index__++];
  9596. return { 'done': done, 'value': value };
  9597. }
  9598. /**
  9599. * Enables the wrapper to be iterable.
  9600. *
  9601. * @name Symbol.iterator
  9602. * @memberOf _
  9603. * @since 4.0.0
  9604. * @category Seq
  9605. * @returns {Object} Returns the wrapper object.
  9606. * @example
  9607. *
  9608. * var wrapped = _([1, 2]);
  9609. *
  9610. * wrapped[Symbol.iterator]() === wrapped;
  9611. * // => true
  9612. *
  9613. * Array.from(wrapped);
  9614. * // => [1, 2]
  9615. */
  9616. function wrapperToIterator() {
  9617. return this;
  9618. }
  9619. /**
  9620. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9621. *
  9622. * @name plant
  9623. * @memberOf _
  9624. * @since 3.2.0
  9625. * @category Seq
  9626. * @param {*} value The value to plant.
  9627. * @returns {Object} Returns the new `lodash` wrapper instance.
  9628. * @example
  9629. *
  9630. * function square(n) {
  9631. * return n * n;
  9632. * }
  9633. *
  9634. * var wrapped = _([1, 2]).map(square);
  9635. * var other = wrapped.plant([3, 4]);
  9636. *
  9637. * other.value();
  9638. * // => [9, 16]
  9639. *
  9640. * wrapped.value();
  9641. * // => [1, 4]
  9642. */
  9643. function wrapperPlant(value) {
  9644. var result,
  9645. parent = this;
  9646. while (parent instanceof baseLodash) {
  9647. var clone = wrapperClone(parent);
  9648. clone.__index__ = 0;
  9649. clone.__values__ = undefined;
  9650. if (result) {
  9651. previous.__wrapped__ = clone;
  9652. } else {
  9653. result = clone;
  9654. }
  9655. var previous = clone;
  9656. parent = parent.__wrapped__;
  9657. }
  9658. previous.__wrapped__ = value;
  9659. return result;
  9660. }
  9661. /**
  9662. * This method is the wrapper version of `_.reverse`.
  9663. *
  9664. * **Note:** This method mutates the wrapped array.
  9665. *
  9666. * @name reverse
  9667. * @memberOf _
  9668. * @since 0.1.0
  9669. * @category Seq
  9670. * @returns {Object} Returns the new `lodash` wrapper instance.
  9671. * @example
  9672. *
  9673. * var array = [1, 2, 3];
  9674. *
  9675. * _(array).reverse().value()
  9676. * // => [3, 2, 1]
  9677. *
  9678. * console.log(array);
  9679. * // => [3, 2, 1]
  9680. */
  9681. function wrapperReverse() {
  9682. var value = this.__wrapped__;
  9683. if (value instanceof LazyWrapper) {
  9684. var wrapped = value;
  9685. if (this.__actions__.length) {
  9686. wrapped = new LazyWrapper(this);
  9687. }
  9688. wrapped = wrapped.reverse();
  9689. wrapped.__actions__.push({
  9690. 'func': thru,
  9691. 'args': [reverse],
  9692. 'thisArg': undefined
  9693. });
  9694. return new LodashWrapper(wrapped, this.__chain__);
  9695. }
  9696. return this.thru(reverse);
  9697. }
  9698. /**
  9699. * Executes the chain sequence to resolve the unwrapped value.
  9700. *
  9701. * @name value
  9702. * @memberOf _
  9703. * @since 0.1.0
  9704. * @alias toJSON, valueOf
  9705. * @category Seq
  9706. * @returns {*} Returns the resolved unwrapped value.
  9707. * @example
  9708. *
  9709. * _([1, 2, 3]).value();
  9710. * // => [1, 2, 3]
  9711. */
  9712. function wrapperValue() {
  9713. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9714. }
  9715. /*------------------------------------------------------------------------*/
  9716. /**
  9717. * Creates an object composed of keys generated from the results of running
  9718. * each element of `collection` thru `iteratee`. The corresponding value of
  9719. * each key is the number of times the key was returned by `iteratee`. The
  9720. * iteratee is invoked with one argument: (value).
  9721. *
  9722. * @static
  9723. * @memberOf _
  9724. * @since 0.5.0
  9725. * @category Collection
  9726. * @param {Array|Object} collection The collection to iterate over.
  9727. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9728. * @returns {Object} Returns the composed aggregate object.
  9729. * @example
  9730. *
  9731. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9732. * // => { '4': 1, '6': 2 }
  9733. *
  9734. * // The `_.property` iteratee shorthand.
  9735. * _.countBy(['one', 'two', 'three'], 'length');
  9736. * // => { '3': 2, '5': 1 }
  9737. */
  9738. var countBy = createAggregator(function(result, value, key) {
  9739. if (hasOwnProperty.call(result, key)) {
  9740. ++result[key];
  9741. } else {
  9742. baseAssignValue(result, key, 1);
  9743. }
  9744. });
  9745. /**
  9746. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9747. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9748. * invoked with three arguments: (value, index|key, collection).
  9749. *
  9750. * **Note:** This method returns `true` for
  9751. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9752. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9753. * elements of empty collections.
  9754. *
  9755. * @static
  9756. * @memberOf _
  9757. * @since 0.1.0
  9758. * @category Collection
  9759. * @param {Array|Object} collection The collection to iterate over.
  9760. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9761. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9762. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9763. * else `false`.
  9764. * @example
  9765. *
  9766. * _.every([true, 1, null, 'yes'], Boolean);
  9767. * // => false
  9768. *
  9769. * var users = [
  9770. * { 'user': 'barney', 'age': 36, 'active': false },
  9771. * { 'user': 'fred', 'age': 40, 'active': false }
  9772. * ];
  9773. *
  9774. * // The `_.matches` iteratee shorthand.
  9775. * _.every(users, { 'user': 'barney', 'active': false });
  9776. * // => false
  9777. *
  9778. * // The `_.matchesProperty` iteratee shorthand.
  9779. * _.every(users, ['active', false]);
  9780. * // => true
  9781. *
  9782. * // The `_.property` iteratee shorthand.
  9783. * _.every(users, 'active');
  9784. * // => false
  9785. */
  9786. function every(collection, predicate, guard) {
  9787. var func = isArray(collection) ? arrayEvery : baseEvery;
  9788. if (guard && isIterateeCall(collection, predicate, guard)) {
  9789. predicate = undefined;
  9790. }
  9791. return func(collection, getIteratee(predicate, 3));
  9792. }
  9793. /**
  9794. * Iterates over elements of `collection`, returning an array of all elements
  9795. * `predicate` returns truthy for. The predicate is invoked with three
  9796. * arguments: (value, index|key, collection).
  9797. *
  9798. * **Note:** Unlike `_.remove`, this method returns a new array.
  9799. *
  9800. * @static
  9801. * @memberOf _
  9802. * @since 0.1.0
  9803. * @category Collection
  9804. * @param {Array|Object} collection The collection to iterate over.
  9805. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9806. * @returns {Array} Returns the new filtered array.
  9807. * @see _.reject
  9808. * @example
  9809. *
  9810. * var users = [
  9811. * { 'user': 'barney', 'age': 36, 'active': true },
  9812. * { 'user': 'fred', 'age': 40, 'active': false }
  9813. * ];
  9814. *
  9815. * _.filter(users, function(o) { return !o.active; });
  9816. * // => objects for ['fred']
  9817. *
  9818. * // The `_.matches` iteratee shorthand.
  9819. * _.filter(users, { 'age': 36, 'active': true });
  9820. * // => objects for ['barney']
  9821. *
  9822. * // The `_.matchesProperty` iteratee shorthand.
  9823. * _.filter(users, ['active', false]);
  9824. * // => objects for ['fred']
  9825. *
  9826. * // The `_.property` iteratee shorthand.
  9827. * _.filter(users, 'active');
  9828. * // => objects for ['barney']
  9829. *
  9830. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9831. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9832. * // => objects for ['fred', 'barney']
  9833. */
  9834. function filter(collection, predicate) {
  9835. var func = isArray(collection) ? arrayFilter : baseFilter;
  9836. return func(collection, getIteratee(predicate, 3));
  9837. }
  9838. /**
  9839. * Iterates over elements of `collection`, returning the first element
  9840. * `predicate` returns truthy for. The predicate is invoked with three
  9841. * arguments: (value, index|key, collection).
  9842. *
  9843. * @static
  9844. * @memberOf _
  9845. * @since 0.1.0
  9846. * @category Collection
  9847. * @param {Array|Object} collection The collection to inspect.
  9848. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9849. * @param {number} [fromIndex=0] The index to search from.
  9850. * @returns {*} Returns the matched element, else `undefined`.
  9851. * @example
  9852. *
  9853. * var users = [
  9854. * { 'user': 'barney', 'age': 36, 'active': true },
  9855. * { 'user': 'fred', 'age': 40, 'active': false },
  9856. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9857. * ];
  9858. *
  9859. * _.find(users, function(o) { return o.age < 40; });
  9860. * // => object for 'barney'
  9861. *
  9862. * // The `_.matches` iteratee shorthand.
  9863. * _.find(users, { 'age': 1, 'active': true });
  9864. * // => object for 'pebbles'
  9865. *
  9866. * // The `_.matchesProperty` iteratee shorthand.
  9867. * _.find(users, ['active', false]);
  9868. * // => object for 'fred'
  9869. *
  9870. * // The `_.property` iteratee shorthand.
  9871. * _.find(users, 'active');
  9872. * // => object for 'barney'
  9873. */
  9874. var find = createFind(findIndex);
  9875. /**
  9876. * This method is like `_.find` except that it iterates over elements of
  9877. * `collection` from right to left.
  9878. *
  9879. * @static
  9880. * @memberOf _
  9881. * @since 2.0.0
  9882. * @category Collection
  9883. * @param {Array|Object} collection The collection to inspect.
  9884. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9885. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9886. * @returns {*} Returns the matched element, else `undefined`.
  9887. * @example
  9888. *
  9889. * _.findLast([1, 2, 3, 4], function(n) {
  9890. * return n % 2 == 1;
  9891. * });
  9892. * // => 3
  9893. */
  9894. var findLast = createFind(findLastIndex);
  9895. /**
  9896. * Creates a flattened array of values by running each element in `collection`
  9897. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9898. * with three arguments: (value, index|key, collection).
  9899. *
  9900. * @static
  9901. * @memberOf _
  9902. * @since 4.0.0
  9903. * @category Collection
  9904. * @param {Array|Object} collection The collection to iterate over.
  9905. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9906. * @returns {Array} Returns the new flattened array.
  9907. * @example
  9908. *
  9909. * function duplicate(n) {
  9910. * return [n, n];
  9911. * }
  9912. *
  9913. * _.flatMap([1, 2], duplicate);
  9914. * // => [1, 1, 2, 2]
  9915. */
  9916. function flatMap(collection, iteratee) {
  9917. return baseFlatten(map(collection, iteratee), 1);
  9918. }
  9919. /**
  9920. * This method is like `_.flatMap` except that it recursively flattens the
  9921. * mapped results.
  9922. *
  9923. * @static
  9924. * @memberOf _
  9925. * @since 4.7.0
  9926. * @category Collection
  9927. * @param {Array|Object} collection The collection to iterate over.
  9928. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9929. * @returns {Array} Returns the new flattened array.
  9930. * @example
  9931. *
  9932. * function duplicate(n) {
  9933. * return [[[n, n]]];
  9934. * }
  9935. *
  9936. * _.flatMapDeep([1, 2], duplicate);
  9937. * // => [1, 1, 2, 2]
  9938. */
  9939. function flatMapDeep(collection, iteratee) {
  9940. return baseFlatten(map(collection, iteratee), INFINITY);
  9941. }
  9942. /**
  9943. * This method is like `_.flatMap` except that it recursively flattens the
  9944. * mapped results up to `depth` times.
  9945. *
  9946. * @static
  9947. * @memberOf _
  9948. * @since 4.7.0
  9949. * @category Collection
  9950. * @param {Array|Object} collection The collection to iterate over.
  9951. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9952. * @param {number} [depth=1] The maximum recursion depth.
  9953. * @returns {Array} Returns the new flattened array.
  9954. * @example
  9955. *
  9956. * function duplicate(n) {
  9957. * return [[[n, n]]];
  9958. * }
  9959. *
  9960. * _.flatMapDepth([1, 2], duplicate, 2);
  9961. * // => [[1, 1], [2, 2]]
  9962. */
  9963. function flatMapDepth(collection, iteratee, depth) {
  9964. depth = depth === undefined ? 1 : toInteger(depth);
  9965. return baseFlatten(map(collection, iteratee), depth);
  9966. }
  9967. /**
  9968. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9969. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9970. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9971. *
  9972. * **Note:** As with other "Collections" methods, objects with a "length"
  9973. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9974. * or `_.forOwn` for object iteration.
  9975. *
  9976. * @static
  9977. * @memberOf _
  9978. * @since 0.1.0
  9979. * @alias each
  9980. * @category Collection
  9981. * @param {Array|Object} collection The collection to iterate over.
  9982. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9983. * @returns {Array|Object} Returns `collection`.
  9984. * @see _.forEachRight
  9985. * @example
  9986. *
  9987. * _.forEach([1, 2], function(value) {
  9988. * console.log(value);
  9989. * });
  9990. * // => Logs `1` then `2`.
  9991. *
  9992. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9993. * console.log(key);
  9994. * });
  9995. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9996. */
  9997. function forEach(collection, iteratee) {
  9998. var func = isArray(collection) ? arrayEach : baseEach;
  9999. return func(collection, getIteratee(iteratee, 3));
  10000. }
  10001. /**
  10002. * This method is like `_.forEach` except that it iterates over elements of
  10003. * `collection` from right to left.
  10004. *
  10005. * @static
  10006. * @memberOf _
  10007. * @since 2.0.0
  10008. * @alias eachRight
  10009. * @category Collection
  10010. * @param {Array|Object} collection The collection to iterate over.
  10011. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10012. * @returns {Array|Object} Returns `collection`.
  10013. * @see _.forEach
  10014. * @example
  10015. *
  10016. * _.forEachRight([1, 2], function(value) {
  10017. * console.log(value);
  10018. * });
  10019. * // => Logs `2` then `1`.
  10020. */
  10021. function forEachRight(collection, iteratee) {
  10022. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  10023. return func(collection, getIteratee(iteratee, 3));
  10024. }
  10025. /**
  10026. * Creates an object composed of keys generated from the results of running
  10027. * each element of `collection` thru `iteratee`. The order of grouped values
  10028. * is determined by the order they occur in `collection`. The corresponding
  10029. * value of each key is an array of elements responsible for generating the
  10030. * key. The iteratee is invoked with one argument: (value).
  10031. *
  10032. * @static
  10033. * @memberOf _
  10034. * @since 0.1.0
  10035. * @category Collection
  10036. * @param {Array|Object} collection The collection to iterate over.
  10037. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10038. * @returns {Object} Returns the composed aggregate object.
  10039. * @example
  10040. *
  10041. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  10042. * // => { '4': [4.2], '6': [6.1, 6.3] }
  10043. *
  10044. * // The `_.property` iteratee shorthand.
  10045. * _.groupBy(['one', 'two', 'three'], 'length');
  10046. * // => { '3': ['one', 'two'], '5': ['three'] }
  10047. */
  10048. var groupBy = createAggregator(function(result, value, key) {
  10049. if (hasOwnProperty.call(result, key)) {
  10050. result[key].push(value);
  10051. } else {
  10052. baseAssignValue(result, key, [value]);
  10053. }
  10054. });
  10055. /**
  10056. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10057. * checked for a substring of `value`, otherwise
  10058. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10059. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10060. * the offset from the end of `collection`.
  10061. *
  10062. * @static
  10063. * @memberOf _
  10064. * @since 0.1.0
  10065. * @category Collection
  10066. * @param {Array|Object|string} collection The collection to inspect.
  10067. * @param {*} value The value to search for.
  10068. * @param {number} [fromIndex=0] The index to search from.
  10069. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10070. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10071. * @example
  10072. *
  10073. * _.includes([1, 2, 3], 1);
  10074. * // => true
  10075. *
  10076. * _.includes([1, 2, 3], 1, 2);
  10077. * // => false
  10078. *
  10079. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10080. * // => true
  10081. *
  10082. * _.includes('abcd', 'bc');
  10083. * // => true
  10084. */
  10085. function includes(collection, value, fromIndex, guard) {
  10086. collection = isArrayLike(collection) ? collection : values(collection);
  10087. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10088. var length = collection.length;
  10089. if (fromIndex < 0) {
  10090. fromIndex = nativeMax(length + fromIndex, 0);
  10091. }
  10092. return isString(collection)
  10093. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10094. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10095. }
  10096. /**
  10097. * Invokes the method at `path` of each element in `collection`, returning
  10098. * an array of the results of each invoked method. Any additional arguments
  10099. * are provided to each invoked method. If `path` is a function, it's invoked
  10100. * for, and `this` bound to, each element in `collection`.
  10101. *
  10102. * @static
  10103. * @memberOf _
  10104. * @since 4.0.0
  10105. * @category Collection
  10106. * @param {Array|Object} collection The collection to iterate over.
  10107. * @param {Array|Function|string} path The path of the method to invoke or
  10108. * the function invoked per iteration.
  10109. * @param {...*} [args] The arguments to invoke each method with.
  10110. * @returns {Array} Returns the array of results.
  10111. * @example
  10112. *
  10113. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10114. * // => [[1, 5, 7], [1, 2, 3]]
  10115. *
  10116. * _.invokeMap([123, 456], String.prototype.split, '');
  10117. * // => [['1', '2', '3'], ['4', '5', '6']]
  10118. */
  10119. var invokeMap = baseRest(function(collection, path, args) {
  10120. var index = -1,
  10121. isFunc = typeof path == 'function',
  10122. result = isArrayLike(collection) ? Array(collection.length) : [];
  10123. baseEach(collection, function(value) {
  10124. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10125. });
  10126. return result;
  10127. });
  10128. /**
  10129. * Creates an object composed of keys generated from the results of running
  10130. * each element of `collection` thru `iteratee`. The corresponding value of
  10131. * each key is the last element responsible for generating the key. The
  10132. * iteratee is invoked with one argument: (value).
  10133. *
  10134. * @static
  10135. * @memberOf _
  10136. * @since 4.0.0
  10137. * @category Collection
  10138. * @param {Array|Object} collection The collection to iterate over.
  10139. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10140. * @returns {Object} Returns the composed aggregate object.
  10141. * @example
  10142. *
  10143. * var array = [
  10144. * { 'dir': 'left', 'code': 97 },
  10145. * { 'dir': 'right', 'code': 100 }
  10146. * ];
  10147. *
  10148. * _.keyBy(array, function(o) {
  10149. * return String.fromCharCode(o.code);
  10150. * });
  10151. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10152. *
  10153. * _.keyBy(array, 'dir');
  10154. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10155. */
  10156. var keyBy = createAggregator(function(result, value, key) {
  10157. baseAssignValue(result, key, value);
  10158. });
  10159. /**
  10160. * Creates an array of values by running each element in `collection` thru
  10161. * `iteratee`. The iteratee is invoked with three arguments:
  10162. * (value, index|key, collection).
  10163. *
  10164. * Many lodash methods are guarded to work as iteratees for methods like
  10165. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10166. *
  10167. * The guarded methods are:
  10168. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10169. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10170. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10171. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10172. *
  10173. * @static
  10174. * @memberOf _
  10175. * @since 0.1.0
  10176. * @category Collection
  10177. * @param {Array|Object} collection The collection to iterate over.
  10178. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10179. * @returns {Array} Returns the new mapped array.
  10180. * @example
  10181. *
  10182. * function square(n) {
  10183. * return n * n;
  10184. * }
  10185. *
  10186. * _.map([4, 8], square);
  10187. * // => [16, 64]
  10188. *
  10189. * _.map({ 'a': 4, 'b': 8 }, square);
  10190. * // => [16, 64] (iteration order is not guaranteed)
  10191. *
  10192. * var users = [
  10193. * { 'user': 'barney' },
  10194. * { 'user': 'fred' }
  10195. * ];
  10196. *
  10197. * // The `_.property` iteratee shorthand.
  10198. * _.map(users, 'user');
  10199. * // => ['barney', 'fred']
  10200. */
  10201. function map(collection, iteratee) {
  10202. var func = isArray(collection) ? arrayMap : baseMap;
  10203. return func(collection, getIteratee(iteratee, 3));
  10204. }
  10205. /**
  10206. * This method is like `_.sortBy` except that it allows specifying the sort
  10207. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10208. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10209. * descending or "asc" for ascending sort order of corresponding values.
  10210. *
  10211. * @static
  10212. * @memberOf _
  10213. * @since 4.0.0
  10214. * @category Collection
  10215. * @param {Array|Object} collection The collection to iterate over.
  10216. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10217. * The iteratees to sort by.
  10218. * @param {string[]} [orders] The sort orders of `iteratees`.
  10219. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10220. * @returns {Array} Returns the new sorted array.
  10221. * @example
  10222. *
  10223. * var users = [
  10224. * { 'user': 'fred', 'age': 48 },
  10225. * { 'user': 'barney', 'age': 34 },
  10226. * { 'user': 'fred', 'age': 40 },
  10227. * { 'user': 'barney', 'age': 36 }
  10228. * ];
  10229. *
  10230. * // Sort by `user` in ascending order and by `age` in descending order.
  10231. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10232. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10233. */
  10234. function orderBy(collection, iteratees, orders, guard) {
  10235. if (collection == null) {
  10236. return [];
  10237. }
  10238. if (!isArray(iteratees)) {
  10239. iteratees = iteratees == null ? [] : [iteratees];
  10240. }
  10241. orders = guard ? undefined : orders;
  10242. if (!isArray(orders)) {
  10243. orders = orders == null ? [] : [orders];
  10244. }
  10245. return baseOrderBy(collection, iteratees, orders);
  10246. }
  10247. /**
  10248. * Creates an array of elements split into two groups, the first of which
  10249. * contains elements `predicate` returns truthy for, the second of which
  10250. * contains elements `predicate` returns falsey for. The predicate is
  10251. * invoked with one argument: (value).
  10252. *
  10253. * @static
  10254. * @memberOf _
  10255. * @since 3.0.0
  10256. * @category Collection
  10257. * @param {Array|Object} collection The collection to iterate over.
  10258. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10259. * @returns {Array} Returns the array of grouped elements.
  10260. * @example
  10261. *
  10262. * var users = [
  10263. * { 'user': 'barney', 'age': 36, 'active': false },
  10264. * { 'user': 'fred', 'age': 40, 'active': true },
  10265. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10266. * ];
  10267. *
  10268. * _.partition(users, function(o) { return o.active; });
  10269. * // => objects for [['fred'], ['barney', 'pebbles']]
  10270. *
  10271. * // The `_.matches` iteratee shorthand.
  10272. * _.partition(users, { 'age': 1, 'active': false });
  10273. * // => objects for [['pebbles'], ['barney', 'fred']]
  10274. *
  10275. * // The `_.matchesProperty` iteratee shorthand.
  10276. * _.partition(users, ['active', false]);
  10277. * // => objects for [['barney', 'pebbles'], ['fred']]
  10278. *
  10279. * // The `_.property` iteratee shorthand.
  10280. * _.partition(users, 'active');
  10281. * // => objects for [['fred'], ['barney', 'pebbles']]
  10282. */
  10283. var partition = createAggregator(function(result, value, key) {
  10284. result[key ? 0 : 1].push(value);
  10285. }, function() { return [[], []]; });
  10286. /**
  10287. * Reduces `collection` to a value which is the accumulated result of running
  10288. * each element in `collection` thru `iteratee`, where each successive
  10289. * invocation is supplied the return value of the previous. If `accumulator`
  10290. * is not given, the first element of `collection` is used as the initial
  10291. * value. The iteratee is invoked with four arguments:
  10292. * (accumulator, value, index|key, collection).
  10293. *
  10294. * Many lodash methods are guarded to work as iteratees for methods like
  10295. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10296. *
  10297. * The guarded methods are:
  10298. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10299. * and `sortBy`
  10300. *
  10301. * @static
  10302. * @memberOf _
  10303. * @since 0.1.0
  10304. * @category Collection
  10305. * @param {Array|Object} collection The collection to iterate over.
  10306. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10307. * @param {*} [accumulator] The initial value.
  10308. * @returns {*} Returns the accumulated value.
  10309. * @see _.reduceRight
  10310. * @example
  10311. *
  10312. * _.reduce([1, 2], function(sum, n) {
  10313. * return sum + n;
  10314. * }, 0);
  10315. * // => 3
  10316. *
  10317. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10318. * (result[value] || (result[value] = [])).push(key);
  10319. * return result;
  10320. * }, {});
  10321. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10322. */
  10323. function reduce(collection, iteratee, accumulator) {
  10324. var func = isArray(collection) ? arrayReduce : baseReduce,
  10325. initAccum = arguments.length < 3;
  10326. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10327. }
  10328. /**
  10329. * This method is like `_.reduce` except that it iterates over elements of
  10330. * `collection` from right to left.
  10331. *
  10332. * @static
  10333. * @memberOf _
  10334. * @since 0.1.0
  10335. * @category Collection
  10336. * @param {Array|Object} collection The collection to iterate over.
  10337. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10338. * @param {*} [accumulator] The initial value.
  10339. * @returns {*} Returns the accumulated value.
  10340. * @see _.reduce
  10341. * @example
  10342. *
  10343. * var array = [[0, 1], [2, 3], [4, 5]];
  10344. *
  10345. * _.reduceRight(array, function(flattened, other) {
  10346. * return flattened.concat(other);
  10347. * }, []);
  10348. * // => [4, 5, 2, 3, 0, 1]
  10349. */
  10350. function reduceRight(collection, iteratee, accumulator) {
  10351. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10352. initAccum = arguments.length < 3;
  10353. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10354. }
  10355. /**
  10356. * The opposite of `_.filter`; this method returns the elements of `collection`
  10357. * that `predicate` does **not** return truthy for.
  10358. *
  10359. * @static
  10360. * @memberOf _
  10361. * @since 0.1.0
  10362. * @category Collection
  10363. * @param {Array|Object} collection The collection to iterate over.
  10364. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10365. * @returns {Array} Returns the new filtered array.
  10366. * @see _.filter
  10367. * @example
  10368. *
  10369. * var users = [
  10370. * { 'user': 'barney', 'age': 36, 'active': false },
  10371. * { 'user': 'fred', 'age': 40, 'active': true }
  10372. * ];
  10373. *
  10374. * _.reject(users, function(o) { return !o.active; });
  10375. * // => objects for ['fred']
  10376. *
  10377. * // The `_.matches` iteratee shorthand.
  10378. * _.reject(users, { 'age': 40, 'active': true });
  10379. * // => objects for ['barney']
  10380. *
  10381. * // The `_.matchesProperty` iteratee shorthand.
  10382. * _.reject(users, ['active', false]);
  10383. * // => objects for ['fred']
  10384. *
  10385. * // The `_.property` iteratee shorthand.
  10386. * _.reject(users, 'active');
  10387. * // => objects for ['barney']
  10388. */
  10389. function reject(collection, predicate) {
  10390. var func = isArray(collection) ? arrayFilter : baseFilter;
  10391. return func(collection, negate(getIteratee(predicate, 3)));
  10392. }
  10393. /**
  10394. * Gets a random element from `collection`.
  10395. *
  10396. * @static
  10397. * @memberOf _
  10398. * @since 2.0.0
  10399. * @category Collection
  10400. * @param {Array|Object} collection The collection to sample.
  10401. * @returns {*} Returns the random element.
  10402. * @example
  10403. *
  10404. * _.sample([1, 2, 3, 4]);
  10405. * // => 2
  10406. */
  10407. function sample(collection) {
  10408. var func = isArray(collection) ? arraySample : baseSample;
  10409. return func(collection);
  10410. }
  10411. /**
  10412. * Gets `n` random elements at unique keys from `collection` up to the
  10413. * size of `collection`.
  10414. *
  10415. * @static
  10416. * @memberOf _
  10417. * @since 4.0.0
  10418. * @category Collection
  10419. * @param {Array|Object} collection The collection to sample.
  10420. * @param {number} [n=1] The number of elements to sample.
  10421. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10422. * @returns {Array} Returns the random elements.
  10423. * @example
  10424. *
  10425. * _.sampleSize([1, 2, 3], 2);
  10426. * // => [3, 1]
  10427. *
  10428. * _.sampleSize([1, 2, 3], 4);
  10429. * // => [2, 3, 1]
  10430. */
  10431. function sampleSize(collection, n, guard) {
  10432. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10433. n = 1;
  10434. } else {
  10435. n = toInteger(n);
  10436. }
  10437. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10438. return func(collection, n);
  10439. }
  10440. /**
  10441. * Creates an array of shuffled values, using a version of the
  10442. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10443. *
  10444. * @static
  10445. * @memberOf _
  10446. * @since 0.1.0
  10447. * @category Collection
  10448. * @param {Array|Object} collection The collection to shuffle.
  10449. * @returns {Array} Returns the new shuffled array.
  10450. * @example
  10451. *
  10452. * _.shuffle([1, 2, 3, 4]);
  10453. * // => [4, 1, 3, 2]
  10454. */
  10455. function shuffle(collection) {
  10456. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10457. return func(collection);
  10458. }
  10459. /**
  10460. * Gets the size of `collection` by returning its length for array-like
  10461. * values or the number of own enumerable string keyed properties for objects.
  10462. *
  10463. * @static
  10464. * @memberOf _
  10465. * @since 0.1.0
  10466. * @category Collection
  10467. * @param {Array|Object|string} collection The collection to inspect.
  10468. * @returns {number} Returns the collection size.
  10469. * @example
  10470. *
  10471. * _.size([1, 2, 3]);
  10472. * // => 3
  10473. *
  10474. * _.size({ 'a': 1, 'b': 2 });
  10475. * // => 2
  10476. *
  10477. * _.size('pebbles');
  10478. * // => 7
  10479. */
  10480. function size(collection) {
  10481. if (collection == null) {
  10482. return 0;
  10483. }
  10484. if (isArrayLike(collection)) {
  10485. return isString(collection) ? stringSize(collection) : collection.length;
  10486. }
  10487. var tag = getTag(collection);
  10488. if (tag == mapTag || tag == setTag) {
  10489. return collection.size;
  10490. }
  10491. return baseKeys(collection).length;
  10492. }
  10493. /**
  10494. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10495. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10496. * invoked with three arguments: (value, index|key, collection).
  10497. *
  10498. * @static
  10499. * @memberOf _
  10500. * @since 0.1.0
  10501. * @category Collection
  10502. * @param {Array|Object} collection The collection to iterate over.
  10503. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10504. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10505. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10506. * else `false`.
  10507. * @example
  10508. *
  10509. * _.some([null, 0, 'yes', false], Boolean);
  10510. * // => true
  10511. *
  10512. * var users = [
  10513. * { 'user': 'barney', 'active': true },
  10514. * { 'user': 'fred', 'active': false }
  10515. * ];
  10516. *
  10517. * // The `_.matches` iteratee shorthand.
  10518. * _.some(users, { 'user': 'barney', 'active': false });
  10519. * // => false
  10520. *
  10521. * // The `_.matchesProperty` iteratee shorthand.
  10522. * _.some(users, ['active', false]);
  10523. * // => true
  10524. *
  10525. * // The `_.property` iteratee shorthand.
  10526. * _.some(users, 'active');
  10527. * // => true
  10528. */
  10529. function some(collection, predicate, guard) {
  10530. var func = isArray(collection) ? arraySome : baseSome;
  10531. if (guard && isIterateeCall(collection, predicate, guard)) {
  10532. predicate = undefined;
  10533. }
  10534. return func(collection, getIteratee(predicate, 3));
  10535. }
  10536. /**
  10537. * Creates an array of elements, sorted in ascending order by the results of
  10538. * running each element in a collection thru each iteratee. This method
  10539. * performs a stable sort, that is, it preserves the original sort order of
  10540. * equal elements. The iteratees are invoked with one argument: (value).
  10541. *
  10542. * @static
  10543. * @memberOf _
  10544. * @since 0.1.0
  10545. * @category Collection
  10546. * @param {Array|Object} collection The collection to iterate over.
  10547. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10548. * The iteratees to sort by.
  10549. * @returns {Array} Returns the new sorted array.
  10550. * @example
  10551. *
  10552. * var users = [
  10553. * { 'user': 'fred', 'age': 48 },
  10554. * { 'user': 'barney', 'age': 36 },
  10555. * { 'user': 'fred', 'age': 30 },
  10556. * { 'user': 'barney', 'age': 34 }
  10557. * ];
  10558. *
  10559. * _.sortBy(users, [function(o) { return o.user; }]);
  10560. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10561. *
  10562. * _.sortBy(users, ['user', 'age']);
  10563. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10564. */
  10565. var sortBy = baseRest(function(collection, iteratees) {
  10566. if (collection == null) {
  10567. return [];
  10568. }
  10569. var length = iteratees.length;
  10570. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10571. iteratees = [];
  10572. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10573. iteratees = [iteratees[0]];
  10574. }
  10575. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10576. });
  10577. /*------------------------------------------------------------------------*/
  10578. /**
  10579. * Gets the timestamp of the number of milliseconds that have elapsed since
  10580. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10581. *
  10582. * @static
  10583. * @memberOf _
  10584. * @since 2.4.0
  10585. * @category Date
  10586. * @returns {number} Returns the timestamp.
  10587. * @example
  10588. *
  10589. * _.defer(function(stamp) {
  10590. * console.log(_.now() - stamp);
  10591. * }, _.now());
  10592. * // => Logs the number of milliseconds it took for the deferred invocation.
  10593. */
  10594. var now = ctxNow || function() {
  10595. return root.Date.now();
  10596. };
  10597. /*------------------------------------------------------------------------*/
  10598. /**
  10599. * The opposite of `_.before`; this method creates a function that invokes
  10600. * `func` once it's called `n` or more times.
  10601. *
  10602. * @static
  10603. * @memberOf _
  10604. * @since 0.1.0
  10605. * @category Function
  10606. * @param {number} n The number of calls before `func` is invoked.
  10607. * @param {Function} func The function to restrict.
  10608. * @returns {Function} Returns the new restricted function.
  10609. * @example
  10610. *
  10611. * var saves = ['profile', 'settings'];
  10612. *
  10613. * var done = _.after(saves.length, function() {
  10614. * console.log('done saving!');
  10615. * });
  10616. *
  10617. * _.forEach(saves, function(type) {
  10618. * asyncSave({ 'type': type, 'complete': done });
  10619. * });
  10620. * // => Logs 'done saving!' after the two async saves have completed.
  10621. */
  10622. function after(n, func) {
  10623. if (typeof func != 'function') {
  10624. throw new TypeError(FUNC_ERROR_TEXT);
  10625. }
  10626. n = toInteger(n);
  10627. return function() {
  10628. if (--n < 1) {
  10629. return func.apply(this, arguments);
  10630. }
  10631. };
  10632. }
  10633. /**
  10634. * Creates a function that invokes `func`, with up to `n` arguments,
  10635. * ignoring any additional arguments.
  10636. *
  10637. * @static
  10638. * @memberOf _
  10639. * @since 3.0.0
  10640. * @category Function
  10641. * @param {Function} func The function to cap arguments for.
  10642. * @param {number} [n=func.length] The arity cap.
  10643. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10644. * @returns {Function} Returns the new capped function.
  10645. * @example
  10646. *
  10647. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10648. * // => [6, 8, 10]
  10649. */
  10650. function ary(func, n, guard) {
  10651. n = guard ? undefined : n;
  10652. n = (func && n == null) ? func.length : n;
  10653. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10654. }
  10655. /**
  10656. * Creates a function that invokes `func`, with the `this` binding and arguments
  10657. * of the created function, while it's called less than `n` times. Subsequent
  10658. * calls to the created function return the result of the last `func` invocation.
  10659. *
  10660. * @static
  10661. * @memberOf _
  10662. * @since 3.0.0
  10663. * @category Function
  10664. * @param {number} n The number of calls at which `func` is no longer invoked.
  10665. * @param {Function} func The function to restrict.
  10666. * @returns {Function} Returns the new restricted function.
  10667. * @example
  10668. *
  10669. * jQuery(element).on('click', _.before(5, addContactToList));
  10670. * // => Allows adding up to 4 contacts to the list.
  10671. */
  10672. function before(n, func) {
  10673. var result;
  10674. if (typeof func != 'function') {
  10675. throw new TypeError(FUNC_ERROR_TEXT);
  10676. }
  10677. n = toInteger(n);
  10678. return function() {
  10679. if (--n > 0) {
  10680. result = func.apply(this, arguments);
  10681. }
  10682. if (n <= 1) {
  10683. func = undefined;
  10684. }
  10685. return result;
  10686. };
  10687. }
  10688. /**
  10689. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10690. * and `partials` prepended to the arguments it receives.
  10691. *
  10692. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10693. * may be used as a placeholder for partially applied arguments.
  10694. *
  10695. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10696. * property of bound functions.
  10697. *
  10698. * @static
  10699. * @memberOf _
  10700. * @since 0.1.0
  10701. * @category Function
  10702. * @param {Function} func The function to bind.
  10703. * @param {*} thisArg The `this` binding of `func`.
  10704. * @param {...*} [partials] The arguments to be partially applied.
  10705. * @returns {Function} Returns the new bound function.
  10706. * @example
  10707. *
  10708. * function greet(greeting, punctuation) {
  10709. * return greeting + ' ' + this.user + punctuation;
  10710. * }
  10711. *
  10712. * var object = { 'user': 'fred' };
  10713. *
  10714. * var bound = _.bind(greet, object, 'hi');
  10715. * bound('!');
  10716. * // => 'hi fred!'
  10717. *
  10718. * // Bound with placeholders.
  10719. * var bound = _.bind(greet, object, _, '!');
  10720. * bound('hi');
  10721. * // => 'hi fred!'
  10722. */
  10723. var bind = baseRest(function(func, thisArg, partials) {
  10724. var bitmask = WRAP_BIND_FLAG;
  10725. if (partials.length) {
  10726. var holders = replaceHolders(partials, getHolder(bind));
  10727. bitmask |= WRAP_PARTIAL_FLAG;
  10728. }
  10729. return createWrap(func, bitmask, thisArg, partials, holders);
  10730. });
  10731. /**
  10732. * Creates a function that invokes the method at `object[key]` with `partials`
  10733. * prepended to the arguments it receives.
  10734. *
  10735. * This method differs from `_.bind` by allowing bound functions to reference
  10736. * methods that may be redefined or don't yet exist. See
  10737. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10738. * for more details.
  10739. *
  10740. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10741. * builds, may be used as a placeholder for partially applied arguments.
  10742. *
  10743. * @static
  10744. * @memberOf _
  10745. * @since 0.10.0
  10746. * @category Function
  10747. * @param {Object} object The object to invoke the method on.
  10748. * @param {string} key The key of the method.
  10749. * @param {...*} [partials] The arguments to be partially applied.
  10750. * @returns {Function} Returns the new bound function.
  10751. * @example
  10752. *
  10753. * var object = {
  10754. * 'user': 'fred',
  10755. * 'greet': function(greeting, punctuation) {
  10756. * return greeting + ' ' + this.user + punctuation;
  10757. * }
  10758. * };
  10759. *
  10760. * var bound = _.bindKey(object, 'greet', 'hi');
  10761. * bound('!');
  10762. * // => 'hi fred!'
  10763. *
  10764. * object.greet = function(greeting, punctuation) {
  10765. * return greeting + 'ya ' + this.user + punctuation;
  10766. * };
  10767. *
  10768. * bound('!');
  10769. * // => 'hiya fred!'
  10770. *
  10771. * // Bound with placeholders.
  10772. * var bound = _.bindKey(object, 'greet', _, '!');
  10773. * bound('hi');
  10774. * // => 'hiya fred!'
  10775. */
  10776. var bindKey = baseRest(function(object, key, partials) {
  10777. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10778. if (partials.length) {
  10779. var holders = replaceHolders(partials, getHolder(bindKey));
  10780. bitmask |= WRAP_PARTIAL_FLAG;
  10781. }
  10782. return createWrap(key, bitmask, object, partials, holders);
  10783. });
  10784. /**
  10785. * Creates a function that accepts arguments of `func` and either invokes
  10786. * `func` returning its result, if at least `arity` number of arguments have
  10787. * been provided, or returns a function that accepts the remaining `func`
  10788. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10789. * is not sufficient.
  10790. *
  10791. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10792. * may be used as a placeholder for provided arguments.
  10793. *
  10794. * **Note:** This method doesn't set the "length" property of curried functions.
  10795. *
  10796. * @static
  10797. * @memberOf _
  10798. * @since 2.0.0
  10799. * @category Function
  10800. * @param {Function} func The function to curry.
  10801. * @param {number} [arity=func.length] The arity of `func`.
  10802. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10803. * @returns {Function} Returns the new curried function.
  10804. * @example
  10805. *
  10806. * var abc = function(a, b, c) {
  10807. * return [a, b, c];
  10808. * };
  10809. *
  10810. * var curried = _.curry(abc);
  10811. *
  10812. * curried(1)(2)(3);
  10813. * // => [1, 2, 3]
  10814. *
  10815. * curried(1, 2)(3);
  10816. * // => [1, 2, 3]
  10817. *
  10818. * curried(1, 2, 3);
  10819. * // => [1, 2, 3]
  10820. *
  10821. * // Curried with placeholders.
  10822. * curried(1)(_, 3)(2);
  10823. * // => [1, 2, 3]
  10824. */
  10825. function curry(func, arity, guard) {
  10826. arity = guard ? undefined : arity;
  10827. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10828. result.placeholder = curry.placeholder;
  10829. return result;
  10830. }
  10831. /**
  10832. * This method is like `_.curry` except that arguments are applied to `func`
  10833. * in the manner of `_.partialRight` instead of `_.partial`.
  10834. *
  10835. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10836. * builds, may be used as a placeholder for provided arguments.
  10837. *
  10838. * **Note:** This method doesn't set the "length" property of curried functions.
  10839. *
  10840. * @static
  10841. * @memberOf _
  10842. * @since 3.0.0
  10843. * @category Function
  10844. * @param {Function} func The function to curry.
  10845. * @param {number} [arity=func.length] The arity of `func`.
  10846. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10847. * @returns {Function} Returns the new curried function.
  10848. * @example
  10849. *
  10850. * var abc = function(a, b, c) {
  10851. * return [a, b, c];
  10852. * };
  10853. *
  10854. * var curried = _.curryRight(abc);
  10855. *
  10856. * curried(3)(2)(1);
  10857. * // => [1, 2, 3]
  10858. *
  10859. * curried(2, 3)(1);
  10860. * // => [1, 2, 3]
  10861. *
  10862. * curried(1, 2, 3);
  10863. * // => [1, 2, 3]
  10864. *
  10865. * // Curried with placeholders.
  10866. * curried(3)(1, _)(2);
  10867. * // => [1, 2, 3]
  10868. */
  10869. function curryRight(func, arity, guard) {
  10870. arity = guard ? undefined : arity;
  10871. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10872. result.placeholder = curryRight.placeholder;
  10873. return result;
  10874. }
  10875. /**
  10876. * Creates a debounced function that delays invoking `func` until after `wait`
  10877. * milliseconds have elapsed since the last time the debounced function was
  10878. * invoked. The debounced function comes with a `cancel` method to cancel
  10879. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10880. * Provide `options` to indicate whether `func` should be invoked on the
  10881. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10882. * with the last arguments provided to the debounced function. Subsequent
  10883. * calls to the debounced function return the result of the last `func`
  10884. * invocation.
  10885. *
  10886. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10887. * invoked on the trailing edge of the timeout only if the debounced function
  10888. * is invoked more than once during the `wait` timeout.
  10889. *
  10890. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10891. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10892. *
  10893. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10894. * for details over the differences between `_.debounce` and `_.throttle`.
  10895. *
  10896. * @static
  10897. * @memberOf _
  10898. * @since 0.1.0
  10899. * @category Function
  10900. * @param {Function} func The function to debounce.
  10901. * @param {number} [wait=0] The number of milliseconds to delay.
  10902. * @param {Object} [options={}] The options object.
  10903. * @param {boolean} [options.leading=false]
  10904. * Specify invoking on the leading edge of the timeout.
  10905. * @param {number} [options.maxWait]
  10906. * The maximum time `func` is allowed to be delayed before it's invoked.
  10907. * @param {boolean} [options.trailing=true]
  10908. * Specify invoking on the trailing edge of the timeout.
  10909. * @returns {Function} Returns the new debounced function.
  10910. * @example
  10911. *
  10912. * // Avoid costly calculations while the window size is in flux.
  10913. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10914. *
  10915. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10916. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10917. * 'leading': true,
  10918. * 'trailing': false
  10919. * }));
  10920. *
  10921. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10922. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10923. * var source = new EventSource('/stream');
  10924. * jQuery(source).on('message', debounced);
  10925. *
  10926. * // Cancel the trailing debounced invocation.
  10927. * jQuery(window).on('popstate', debounced.cancel);
  10928. */
  10929. function debounce(func, wait, options) {
  10930. var lastArgs,
  10931. lastThis,
  10932. maxWait,
  10933. result,
  10934. timerId,
  10935. lastCallTime,
  10936. lastInvokeTime = 0,
  10937. leading = false,
  10938. maxing = false,
  10939. trailing = true;
  10940. if (typeof func != 'function') {
  10941. throw new TypeError(FUNC_ERROR_TEXT);
  10942. }
  10943. wait = toNumber(wait) || 0;
  10944. if (isObject(options)) {
  10945. leading = !!options.leading;
  10946. maxing = 'maxWait' in options;
  10947. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10948. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10949. }
  10950. function invokeFunc(time) {
  10951. var args = lastArgs,
  10952. thisArg = lastThis;
  10953. lastArgs = lastThis = undefined;
  10954. lastInvokeTime = time;
  10955. result = func.apply(thisArg, args);
  10956. return result;
  10957. }
  10958. function leadingEdge(time) {
  10959. // Reset any `maxWait` timer.
  10960. lastInvokeTime = time;
  10961. // Start the timer for the trailing edge.
  10962. timerId = setTimeout(timerExpired, wait);
  10963. // Invoke the leading edge.
  10964. return leading ? invokeFunc(time) : result;
  10965. }
  10966. function remainingWait(time) {
  10967. var timeSinceLastCall = time - lastCallTime,
  10968. timeSinceLastInvoke = time - lastInvokeTime,
  10969. timeWaiting = wait - timeSinceLastCall;
  10970. return maxing
  10971. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10972. : timeWaiting;
  10973. }
  10974. function shouldInvoke(time) {
  10975. var timeSinceLastCall = time - lastCallTime,
  10976. timeSinceLastInvoke = time - lastInvokeTime;
  10977. // Either this is the first call, activity has stopped and we're at the
  10978. // trailing edge, the system time has gone backwards and we're treating
  10979. // it as the trailing edge, or we've hit the `maxWait` limit.
  10980. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10981. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10982. }
  10983. function timerExpired() {
  10984. var time = now();
  10985. if (shouldInvoke(time)) {
  10986. return trailingEdge(time);
  10987. }
  10988. // Restart the timer.
  10989. timerId = setTimeout(timerExpired, remainingWait(time));
  10990. }
  10991. function trailingEdge(time) {
  10992. timerId = undefined;
  10993. // Only invoke if we have `lastArgs` which means `func` has been
  10994. // debounced at least once.
  10995. if (trailing && lastArgs) {
  10996. return invokeFunc(time);
  10997. }
  10998. lastArgs = lastThis = undefined;
  10999. return result;
  11000. }
  11001. function cancel() {
  11002. if (timerId !== undefined) {
  11003. clearTimeout(timerId);
  11004. }
  11005. lastInvokeTime = 0;
  11006. lastArgs = lastCallTime = lastThis = timerId = undefined;
  11007. }
  11008. function flush() {
  11009. return timerId === undefined ? result : trailingEdge(now());
  11010. }
  11011. function debounced() {
  11012. var time = now(),
  11013. isInvoking = shouldInvoke(time);
  11014. lastArgs = arguments;
  11015. lastThis = this;
  11016. lastCallTime = time;
  11017. if (isInvoking) {
  11018. if (timerId === undefined) {
  11019. return leadingEdge(lastCallTime);
  11020. }
  11021. if (maxing) {
  11022. // Handle invocations in a tight loop.
  11023. clearTimeout(timerId);
  11024. timerId = setTimeout(timerExpired, wait);
  11025. return invokeFunc(lastCallTime);
  11026. }
  11027. }
  11028. if (timerId === undefined) {
  11029. timerId = setTimeout(timerExpired, wait);
  11030. }
  11031. return result;
  11032. }
  11033. debounced.cancel = cancel;
  11034. debounced.flush = flush;
  11035. return debounced;
  11036. }
  11037. /**
  11038. * Defers invoking the `func` until the current call stack has cleared. Any
  11039. * additional arguments are provided to `func` when it's invoked.
  11040. *
  11041. * @static
  11042. * @memberOf _
  11043. * @since 0.1.0
  11044. * @category Function
  11045. * @param {Function} func The function to defer.
  11046. * @param {...*} [args] The arguments to invoke `func` with.
  11047. * @returns {number} Returns the timer id.
  11048. * @example
  11049. *
  11050. * _.defer(function(text) {
  11051. * console.log(text);
  11052. * }, 'deferred');
  11053. * // => Logs 'deferred' after one millisecond.
  11054. */
  11055. var defer = baseRest(function(func, args) {
  11056. return baseDelay(func, 1, args);
  11057. });
  11058. /**
  11059. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11060. * provided to `func` when it's invoked.
  11061. *
  11062. * @static
  11063. * @memberOf _
  11064. * @since 0.1.0
  11065. * @category Function
  11066. * @param {Function} func The function to delay.
  11067. * @param {number} wait The number of milliseconds to delay invocation.
  11068. * @param {...*} [args] The arguments to invoke `func` with.
  11069. * @returns {number} Returns the timer id.
  11070. * @example
  11071. *
  11072. * _.delay(function(text) {
  11073. * console.log(text);
  11074. * }, 1000, 'later');
  11075. * // => Logs 'later' after one second.
  11076. */
  11077. var delay = baseRest(function(func, wait, args) {
  11078. return baseDelay(func, toNumber(wait) || 0, args);
  11079. });
  11080. /**
  11081. * Creates a function that invokes `func` with arguments reversed.
  11082. *
  11083. * @static
  11084. * @memberOf _
  11085. * @since 4.0.0
  11086. * @category Function
  11087. * @param {Function} func The function to flip arguments for.
  11088. * @returns {Function} Returns the new flipped function.
  11089. * @example
  11090. *
  11091. * var flipped = _.flip(function() {
  11092. * return _.toArray(arguments);
  11093. * });
  11094. *
  11095. * flipped('a', 'b', 'c', 'd');
  11096. * // => ['d', 'c', 'b', 'a']
  11097. */
  11098. function flip(func) {
  11099. return createWrap(func, WRAP_FLIP_FLAG);
  11100. }
  11101. /**
  11102. * Creates a function that memoizes the result of `func`. If `resolver` is
  11103. * provided, it determines the cache key for storing the result based on the
  11104. * arguments provided to the memoized function. By default, the first argument
  11105. * provided to the memoized function is used as the map cache key. The `func`
  11106. * is invoked with the `this` binding of the memoized function.
  11107. *
  11108. * **Note:** The cache is exposed as the `cache` property on the memoized
  11109. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11110. * constructor with one whose instances implement the
  11111. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11112. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11113. *
  11114. * @static
  11115. * @memberOf _
  11116. * @since 0.1.0
  11117. * @category Function
  11118. * @param {Function} func The function to have its output memoized.
  11119. * @param {Function} [resolver] The function to resolve the cache key.
  11120. * @returns {Function} Returns the new memoized function.
  11121. * @example
  11122. *
  11123. * var object = { 'a': 1, 'b': 2 };
  11124. * var other = { 'c': 3, 'd': 4 };
  11125. *
  11126. * var values = _.memoize(_.values);
  11127. * values(object);
  11128. * // => [1, 2]
  11129. *
  11130. * values(other);
  11131. * // => [3, 4]
  11132. *
  11133. * object.a = 2;
  11134. * values(object);
  11135. * // => [1, 2]
  11136. *
  11137. * // Modify the result cache.
  11138. * values.cache.set(object, ['a', 'b']);
  11139. * values(object);
  11140. * // => ['a', 'b']
  11141. *
  11142. * // Replace `_.memoize.Cache`.
  11143. * _.memoize.Cache = WeakMap;
  11144. */
  11145. function memoize(func, resolver) {
  11146. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11147. throw new TypeError(FUNC_ERROR_TEXT);
  11148. }
  11149. var memoized = function() {
  11150. var args = arguments,
  11151. key = resolver ? resolver.apply(this, args) : args[0],
  11152. cache = memoized.cache;
  11153. if (cache.has(key)) {
  11154. return cache.get(key);
  11155. }
  11156. var result = func.apply(this, args);
  11157. memoized.cache = cache.set(key, result) || cache;
  11158. return result;
  11159. };
  11160. memoized.cache = new (memoize.Cache || MapCache);
  11161. return memoized;
  11162. }
  11163. // Expose `MapCache`.
  11164. memoize.Cache = MapCache;
  11165. /**
  11166. * Creates a function that negates the result of the predicate `func`. The
  11167. * `func` predicate is invoked with the `this` binding and arguments of the
  11168. * created function.
  11169. *
  11170. * @static
  11171. * @memberOf _
  11172. * @since 3.0.0
  11173. * @category Function
  11174. * @param {Function} predicate The predicate to negate.
  11175. * @returns {Function} Returns the new negated function.
  11176. * @example
  11177. *
  11178. * function isEven(n) {
  11179. * return n % 2 == 0;
  11180. * }
  11181. *
  11182. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11183. * // => [1, 3, 5]
  11184. */
  11185. function negate(predicate) {
  11186. if (typeof predicate != 'function') {
  11187. throw new TypeError(FUNC_ERROR_TEXT);
  11188. }
  11189. return function() {
  11190. var args = arguments;
  11191. switch (args.length) {
  11192. case 0: return !predicate.call(this);
  11193. case 1: return !predicate.call(this, args[0]);
  11194. case 2: return !predicate.call(this, args[0], args[1]);
  11195. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11196. }
  11197. return !predicate.apply(this, args);
  11198. };
  11199. }
  11200. /**
  11201. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11202. * to the function return the value of the first invocation. The `func` is
  11203. * invoked with the `this` binding and arguments of the created function.
  11204. *
  11205. * @static
  11206. * @memberOf _
  11207. * @since 0.1.0
  11208. * @category Function
  11209. * @param {Function} func The function to restrict.
  11210. * @returns {Function} Returns the new restricted function.
  11211. * @example
  11212. *
  11213. * var initialize = _.once(createApplication);
  11214. * initialize();
  11215. * initialize();
  11216. * // => `createApplication` is invoked once
  11217. */
  11218. function once(func) {
  11219. return before(2, func);
  11220. }
  11221. /**
  11222. * Creates a function that invokes `func` with its arguments transformed.
  11223. *
  11224. * @static
  11225. * @since 4.0.0
  11226. * @memberOf _
  11227. * @category Function
  11228. * @param {Function} func The function to wrap.
  11229. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11230. * The argument transforms.
  11231. * @returns {Function} Returns the new function.
  11232. * @example
  11233. *
  11234. * function doubled(n) {
  11235. * return n * 2;
  11236. * }
  11237. *
  11238. * function square(n) {
  11239. * return n * n;
  11240. * }
  11241. *
  11242. * var func = _.overArgs(function(x, y) {
  11243. * return [x, y];
  11244. * }, [square, doubled]);
  11245. *
  11246. * func(9, 3);
  11247. * // => [81, 6]
  11248. *
  11249. * func(10, 5);
  11250. * // => [100, 10]
  11251. */
  11252. var overArgs = castRest(function(func, transforms) {
  11253. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11254. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11255. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11256. var funcsLength = transforms.length;
  11257. return baseRest(function(args) {
  11258. var index = -1,
  11259. length = nativeMin(args.length, funcsLength);
  11260. while (++index < length) {
  11261. args[index] = transforms[index].call(this, args[index]);
  11262. }
  11263. return apply(func, this, args);
  11264. });
  11265. });
  11266. /**
  11267. * Creates a function that invokes `func` with `partials` prepended to the
  11268. * arguments it receives. This method is like `_.bind` except it does **not**
  11269. * alter the `this` binding.
  11270. *
  11271. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11272. * builds, may be used as a placeholder for partially applied arguments.
  11273. *
  11274. * **Note:** This method doesn't set the "length" property of partially
  11275. * applied functions.
  11276. *
  11277. * @static
  11278. * @memberOf _
  11279. * @since 0.2.0
  11280. * @category Function
  11281. * @param {Function} func The function to partially apply arguments to.
  11282. * @param {...*} [partials] The arguments to be partially applied.
  11283. * @returns {Function} Returns the new partially applied function.
  11284. * @example
  11285. *
  11286. * function greet(greeting, name) {
  11287. * return greeting + ' ' + name;
  11288. * }
  11289. *
  11290. * var sayHelloTo = _.partial(greet, 'hello');
  11291. * sayHelloTo('fred');
  11292. * // => 'hello fred'
  11293. *
  11294. * // Partially applied with placeholders.
  11295. * var greetFred = _.partial(greet, _, 'fred');
  11296. * greetFred('hi');
  11297. * // => 'hi fred'
  11298. */
  11299. var partial = baseRest(function(func, partials) {
  11300. var holders = replaceHolders(partials, getHolder(partial));
  11301. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11302. });
  11303. /**
  11304. * This method is like `_.partial` except that partially applied arguments
  11305. * are appended to the arguments it receives.
  11306. *
  11307. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11308. * builds, may be used as a placeholder for partially applied arguments.
  11309. *
  11310. * **Note:** This method doesn't set the "length" property of partially
  11311. * applied functions.
  11312. *
  11313. * @static
  11314. * @memberOf _
  11315. * @since 1.0.0
  11316. * @category Function
  11317. * @param {Function} func The function to partially apply arguments to.
  11318. * @param {...*} [partials] The arguments to be partially applied.
  11319. * @returns {Function} Returns the new partially applied function.
  11320. * @example
  11321. *
  11322. * function greet(greeting, name) {
  11323. * return greeting + ' ' + name;
  11324. * }
  11325. *
  11326. * var greetFred = _.partialRight(greet, 'fred');
  11327. * greetFred('hi');
  11328. * // => 'hi fred'
  11329. *
  11330. * // Partially applied with placeholders.
  11331. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11332. * sayHelloTo('fred');
  11333. * // => 'hello fred'
  11334. */
  11335. var partialRight = baseRest(function(func, partials) {
  11336. var holders = replaceHolders(partials, getHolder(partialRight));
  11337. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11338. });
  11339. /**
  11340. * Creates a function that invokes `func` with arguments arranged according
  11341. * to the specified `indexes` where the argument value at the first index is
  11342. * provided as the first argument, the argument value at the second index is
  11343. * provided as the second argument, and so on.
  11344. *
  11345. * @static
  11346. * @memberOf _
  11347. * @since 3.0.0
  11348. * @category Function
  11349. * @param {Function} func The function to rearrange arguments for.
  11350. * @param {...(number|number[])} indexes The arranged argument indexes.
  11351. * @returns {Function} Returns the new function.
  11352. * @example
  11353. *
  11354. * var rearged = _.rearg(function(a, b, c) {
  11355. * return [a, b, c];
  11356. * }, [2, 0, 1]);
  11357. *
  11358. * rearged('b', 'c', 'a')
  11359. * // => ['a', 'b', 'c']
  11360. */
  11361. var rearg = flatRest(function(func, indexes) {
  11362. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11363. });
  11364. /**
  11365. * Creates a function that invokes `func` with the `this` binding of the
  11366. * created function and arguments from `start` and beyond provided as
  11367. * an array.
  11368. *
  11369. * **Note:** This method is based on the
  11370. * [rest parameter](https://mdn.io/rest_parameters).
  11371. *
  11372. * @static
  11373. * @memberOf _
  11374. * @since 4.0.0
  11375. * @category Function
  11376. * @param {Function} func The function to apply a rest parameter to.
  11377. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11378. * @returns {Function} Returns the new function.
  11379. * @example
  11380. *
  11381. * var say = _.rest(function(what, names) {
  11382. * return what + ' ' + _.initial(names).join(', ') +
  11383. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11384. * });
  11385. *
  11386. * say('hello', 'fred', 'barney', 'pebbles');
  11387. * // => 'hello fred, barney, & pebbles'
  11388. */
  11389. function rest(func, start) {
  11390. if (typeof func != 'function') {
  11391. throw new TypeError(FUNC_ERROR_TEXT);
  11392. }
  11393. start = start === undefined ? start : toInteger(start);
  11394. return baseRest(func, start);
  11395. }
  11396. /**
  11397. * Creates a function that invokes `func` with the `this` binding of the
  11398. * create function and an array of arguments much like
  11399. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11400. *
  11401. * **Note:** This method is based on the
  11402. * [spread operator](https://mdn.io/spread_operator).
  11403. *
  11404. * @static
  11405. * @memberOf _
  11406. * @since 3.2.0
  11407. * @category Function
  11408. * @param {Function} func The function to spread arguments over.
  11409. * @param {number} [start=0] The start position of the spread.
  11410. * @returns {Function} Returns the new function.
  11411. * @example
  11412. *
  11413. * var say = _.spread(function(who, what) {
  11414. * return who + ' says ' + what;
  11415. * });
  11416. *
  11417. * say(['fred', 'hello']);
  11418. * // => 'fred says hello'
  11419. *
  11420. * var numbers = Promise.all([
  11421. * Promise.resolve(40),
  11422. * Promise.resolve(36)
  11423. * ]);
  11424. *
  11425. * numbers.then(_.spread(function(x, y) {
  11426. * return x + y;
  11427. * }));
  11428. * // => a Promise of 76
  11429. */
  11430. function spread(func, start) {
  11431. if (typeof func != 'function') {
  11432. throw new TypeError(FUNC_ERROR_TEXT);
  11433. }
  11434. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11435. return baseRest(function(args) {
  11436. var array = args[start],
  11437. otherArgs = castSlice(args, 0, start);
  11438. if (array) {
  11439. arrayPush(otherArgs, array);
  11440. }
  11441. return apply(func, this, otherArgs);
  11442. });
  11443. }
  11444. /**
  11445. * Creates a throttled function that only invokes `func` at most once per
  11446. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11447. * method to cancel delayed `func` invocations and a `flush` method to
  11448. * immediately invoke them. Provide `options` to indicate whether `func`
  11449. * should be invoked on the leading and/or trailing edge of the `wait`
  11450. * timeout. The `func` is invoked with the last arguments provided to the
  11451. * throttled function. Subsequent calls to the throttled function return the
  11452. * result of the last `func` invocation.
  11453. *
  11454. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11455. * invoked on the trailing edge of the timeout only if the throttled function
  11456. * is invoked more than once during the `wait` timeout.
  11457. *
  11458. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11459. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11460. *
  11461. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11462. * for details over the differences between `_.throttle` and `_.debounce`.
  11463. *
  11464. * @static
  11465. * @memberOf _
  11466. * @since 0.1.0
  11467. * @category Function
  11468. * @param {Function} func The function to throttle.
  11469. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11470. * @param {Object} [options={}] The options object.
  11471. * @param {boolean} [options.leading=true]
  11472. * Specify invoking on the leading edge of the timeout.
  11473. * @param {boolean} [options.trailing=true]
  11474. * Specify invoking on the trailing edge of the timeout.
  11475. * @returns {Function} Returns the new throttled function.
  11476. * @example
  11477. *
  11478. * // Avoid excessively updating the position while scrolling.
  11479. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11480. *
  11481. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11482. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11483. * jQuery(element).on('click', throttled);
  11484. *
  11485. * // Cancel the trailing throttled invocation.
  11486. * jQuery(window).on('popstate', throttled.cancel);
  11487. */
  11488. function throttle(func, wait, options) {
  11489. var leading = true,
  11490. trailing = true;
  11491. if (typeof func != 'function') {
  11492. throw new TypeError(FUNC_ERROR_TEXT);
  11493. }
  11494. if (isObject(options)) {
  11495. leading = 'leading' in options ? !!options.leading : leading;
  11496. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11497. }
  11498. return debounce(func, wait, {
  11499. 'leading': leading,
  11500. 'maxWait': wait,
  11501. 'trailing': trailing
  11502. });
  11503. }
  11504. /**
  11505. * Creates a function that accepts up to one argument, ignoring any
  11506. * additional arguments.
  11507. *
  11508. * @static
  11509. * @memberOf _
  11510. * @since 4.0.0
  11511. * @category Function
  11512. * @param {Function} func The function to cap arguments for.
  11513. * @returns {Function} Returns the new capped function.
  11514. * @example
  11515. *
  11516. * _.map(['6', '8', '10'], _.unary(parseInt));
  11517. * // => [6, 8, 10]
  11518. */
  11519. function unary(func) {
  11520. return ary(func, 1);
  11521. }
  11522. /**
  11523. * Creates a function that provides `value` to `wrapper` as its first
  11524. * argument. Any additional arguments provided to the function are appended
  11525. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11526. * binding of the created function.
  11527. *
  11528. * @static
  11529. * @memberOf _
  11530. * @since 0.1.0
  11531. * @category Function
  11532. * @param {*} value The value to wrap.
  11533. * @param {Function} [wrapper=identity] The wrapper function.
  11534. * @returns {Function} Returns the new function.
  11535. * @example
  11536. *
  11537. * var p = _.wrap(_.escape, function(func, text) {
  11538. * return '<p>' + func(text) + '</p>';
  11539. * });
  11540. *
  11541. * p('fred, barney, & pebbles');
  11542. * // => '<p>fred, barney, &amp; pebbles</p>'
  11543. */
  11544. function wrap(value, wrapper) {
  11545. return partial(castFunction(wrapper), value);
  11546. }
  11547. /*------------------------------------------------------------------------*/
  11548. /**
  11549. * Casts `value` as an array if it's not one.
  11550. *
  11551. * @static
  11552. * @memberOf _
  11553. * @since 4.4.0
  11554. * @category Lang
  11555. * @param {*} value The value to inspect.
  11556. * @returns {Array} Returns the cast array.
  11557. * @example
  11558. *
  11559. * _.castArray(1);
  11560. * // => [1]
  11561. *
  11562. * _.castArray({ 'a': 1 });
  11563. * // => [{ 'a': 1 }]
  11564. *
  11565. * _.castArray('abc');
  11566. * // => ['abc']
  11567. *
  11568. * _.castArray(null);
  11569. * // => [null]
  11570. *
  11571. * _.castArray(undefined);
  11572. * // => [undefined]
  11573. *
  11574. * _.castArray();
  11575. * // => []
  11576. *
  11577. * var array = [1, 2, 3];
  11578. * console.log(_.castArray(array) === array);
  11579. * // => true
  11580. */
  11581. function castArray() {
  11582. if (!arguments.length) {
  11583. return [];
  11584. }
  11585. var value = arguments[0];
  11586. return isArray(value) ? value : [value];
  11587. }
  11588. /**
  11589. * Creates a shallow clone of `value`.
  11590. *
  11591. * **Note:** This method is loosely based on the
  11592. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11593. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11594. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11595. * arrays. The own enumerable properties of `arguments` objects are cloned
  11596. * as plain objects. An empty object is returned for uncloneable values such
  11597. * as error objects, functions, DOM nodes, and WeakMaps.
  11598. *
  11599. * @static
  11600. * @memberOf _
  11601. * @since 0.1.0
  11602. * @category Lang
  11603. * @param {*} value The value to clone.
  11604. * @returns {*} Returns the cloned value.
  11605. * @see _.cloneDeep
  11606. * @example
  11607. *
  11608. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11609. *
  11610. * var shallow = _.clone(objects);
  11611. * console.log(shallow[0] === objects[0]);
  11612. * // => true
  11613. */
  11614. function clone(value) {
  11615. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11616. }
  11617. /**
  11618. * This method is like `_.clone` except that it accepts `customizer` which
  11619. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11620. * cloning is handled by the method instead. The `customizer` is invoked with
  11621. * up to four arguments; (value [, index|key, object, stack]).
  11622. *
  11623. * @static
  11624. * @memberOf _
  11625. * @since 4.0.0
  11626. * @category Lang
  11627. * @param {*} value The value to clone.
  11628. * @param {Function} [customizer] The function to customize cloning.
  11629. * @returns {*} Returns the cloned value.
  11630. * @see _.cloneDeepWith
  11631. * @example
  11632. *
  11633. * function customizer(value) {
  11634. * if (_.isElement(value)) {
  11635. * return value.cloneNode(false);
  11636. * }
  11637. * }
  11638. *
  11639. * var el = _.cloneWith(document.body, customizer);
  11640. *
  11641. * console.log(el === document.body);
  11642. * // => false
  11643. * console.log(el.nodeName);
  11644. * // => 'BODY'
  11645. * console.log(el.childNodes.length);
  11646. * // => 0
  11647. */
  11648. function cloneWith(value, customizer) {
  11649. customizer = typeof customizer == 'function' ? customizer : undefined;
  11650. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11651. }
  11652. /**
  11653. * This method is like `_.clone` except that it recursively clones `value`.
  11654. *
  11655. * @static
  11656. * @memberOf _
  11657. * @since 1.0.0
  11658. * @category Lang
  11659. * @param {*} value The value to recursively clone.
  11660. * @returns {*} Returns the deep cloned value.
  11661. * @see _.clone
  11662. * @example
  11663. *
  11664. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11665. *
  11666. * var deep = _.cloneDeep(objects);
  11667. * console.log(deep[0] === objects[0]);
  11668. * // => false
  11669. */
  11670. function cloneDeep(value) {
  11671. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11672. }
  11673. /**
  11674. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11675. *
  11676. * @static
  11677. * @memberOf _
  11678. * @since 4.0.0
  11679. * @category Lang
  11680. * @param {*} value The value to recursively clone.
  11681. * @param {Function} [customizer] The function to customize cloning.
  11682. * @returns {*} Returns the deep cloned value.
  11683. * @see _.cloneWith
  11684. * @example
  11685. *
  11686. * function customizer(value) {
  11687. * if (_.isElement(value)) {
  11688. * return value.cloneNode(true);
  11689. * }
  11690. * }
  11691. *
  11692. * var el = _.cloneDeepWith(document.body, customizer);
  11693. *
  11694. * console.log(el === document.body);
  11695. * // => false
  11696. * console.log(el.nodeName);
  11697. * // => 'BODY'
  11698. * console.log(el.childNodes.length);
  11699. * // => 20
  11700. */
  11701. function cloneDeepWith(value, customizer) {
  11702. customizer = typeof customizer == 'function' ? customizer : undefined;
  11703. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11704. }
  11705. /**
  11706. * Checks if `object` conforms to `source` by invoking the predicate
  11707. * properties of `source` with the corresponding property values of `object`.
  11708. *
  11709. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11710. * partially applied.
  11711. *
  11712. * @static
  11713. * @memberOf _
  11714. * @since 4.14.0
  11715. * @category Lang
  11716. * @param {Object} object The object to inspect.
  11717. * @param {Object} source The object of property predicates to conform to.
  11718. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11719. * @example
  11720. *
  11721. * var object = { 'a': 1, 'b': 2 };
  11722. *
  11723. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11724. * // => true
  11725. *
  11726. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11727. * // => false
  11728. */
  11729. function conformsTo(object, source) {
  11730. return source == null || baseConformsTo(object, source, keys(source));
  11731. }
  11732. /**
  11733. * Performs a
  11734. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11735. * comparison between two values to determine if they are equivalent.
  11736. *
  11737. * @static
  11738. * @memberOf _
  11739. * @since 4.0.0
  11740. * @category Lang
  11741. * @param {*} value The value to compare.
  11742. * @param {*} other The other value to compare.
  11743. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11744. * @example
  11745. *
  11746. * var object = { 'a': 1 };
  11747. * var other = { 'a': 1 };
  11748. *
  11749. * _.eq(object, object);
  11750. * // => true
  11751. *
  11752. * _.eq(object, other);
  11753. * // => false
  11754. *
  11755. * _.eq('a', 'a');
  11756. * // => true
  11757. *
  11758. * _.eq('a', Object('a'));
  11759. * // => false
  11760. *
  11761. * _.eq(NaN, NaN);
  11762. * // => true
  11763. */
  11764. function eq(value, other) {
  11765. return value === other || (value !== value && other !== other);
  11766. }
  11767. /**
  11768. * Checks if `value` is greater than `other`.
  11769. *
  11770. * @static
  11771. * @memberOf _
  11772. * @since 3.9.0
  11773. * @category Lang
  11774. * @param {*} value The value to compare.
  11775. * @param {*} other The other value to compare.
  11776. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11777. * else `false`.
  11778. * @see _.lt
  11779. * @example
  11780. *
  11781. * _.gt(3, 1);
  11782. * // => true
  11783. *
  11784. * _.gt(3, 3);
  11785. * // => false
  11786. *
  11787. * _.gt(1, 3);
  11788. * // => false
  11789. */
  11790. var gt = createRelationalOperation(baseGt);
  11791. /**
  11792. * Checks if `value` is greater than or equal to `other`.
  11793. *
  11794. * @static
  11795. * @memberOf _
  11796. * @since 3.9.0
  11797. * @category Lang
  11798. * @param {*} value The value to compare.
  11799. * @param {*} other The other value to compare.
  11800. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11801. * `other`, else `false`.
  11802. * @see _.lte
  11803. * @example
  11804. *
  11805. * _.gte(3, 1);
  11806. * // => true
  11807. *
  11808. * _.gte(3, 3);
  11809. * // => true
  11810. *
  11811. * _.gte(1, 3);
  11812. * // => false
  11813. */
  11814. var gte = createRelationalOperation(function(value, other) {
  11815. return value >= other;
  11816. });
  11817. /**
  11818. * Checks if `value` is likely an `arguments` object.
  11819. *
  11820. * @static
  11821. * @memberOf _
  11822. * @since 0.1.0
  11823. * @category Lang
  11824. * @param {*} value The value to check.
  11825. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11826. * else `false`.
  11827. * @example
  11828. *
  11829. * _.isArguments(function() { return arguments; }());
  11830. * // => true
  11831. *
  11832. * _.isArguments([1, 2, 3]);
  11833. * // => false
  11834. */
  11835. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11836. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11837. !propertyIsEnumerable.call(value, 'callee');
  11838. };
  11839. /**
  11840. * Checks if `value` is classified as an `Array` object.
  11841. *
  11842. * @static
  11843. * @memberOf _
  11844. * @since 0.1.0
  11845. * @category Lang
  11846. * @param {*} value The value to check.
  11847. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11848. * @example
  11849. *
  11850. * _.isArray([1, 2, 3]);
  11851. * // => true
  11852. *
  11853. * _.isArray(document.body.children);
  11854. * // => false
  11855. *
  11856. * _.isArray('abc');
  11857. * // => false
  11858. *
  11859. * _.isArray(_.noop);
  11860. * // => false
  11861. */
  11862. var isArray = Array.isArray;
  11863. /**
  11864. * Checks if `value` is classified as an `ArrayBuffer` object.
  11865. *
  11866. * @static
  11867. * @memberOf _
  11868. * @since 4.3.0
  11869. * @category Lang
  11870. * @param {*} value The value to check.
  11871. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11872. * @example
  11873. *
  11874. * _.isArrayBuffer(new ArrayBuffer(2));
  11875. * // => true
  11876. *
  11877. * _.isArrayBuffer(new Array(2));
  11878. * // => false
  11879. */
  11880. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11881. /**
  11882. * Checks if `value` is array-like. A value is considered array-like if it's
  11883. * not a function and has a `value.length` that's an integer greater than or
  11884. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11885. *
  11886. * @static
  11887. * @memberOf _
  11888. * @since 4.0.0
  11889. * @category Lang
  11890. * @param {*} value The value to check.
  11891. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11892. * @example
  11893. *
  11894. * _.isArrayLike([1, 2, 3]);
  11895. * // => true
  11896. *
  11897. * _.isArrayLike(document.body.children);
  11898. * // => true
  11899. *
  11900. * _.isArrayLike('abc');
  11901. * // => true
  11902. *
  11903. * _.isArrayLike(_.noop);
  11904. * // => false
  11905. */
  11906. function isArrayLike(value) {
  11907. return value != null && isLength(value.length) && !isFunction(value);
  11908. }
  11909. /**
  11910. * This method is like `_.isArrayLike` except that it also checks if `value`
  11911. * is an object.
  11912. *
  11913. * @static
  11914. * @memberOf _
  11915. * @since 4.0.0
  11916. * @category Lang
  11917. * @param {*} value The value to check.
  11918. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11919. * else `false`.
  11920. * @example
  11921. *
  11922. * _.isArrayLikeObject([1, 2, 3]);
  11923. * // => true
  11924. *
  11925. * _.isArrayLikeObject(document.body.children);
  11926. * // => true
  11927. *
  11928. * _.isArrayLikeObject('abc');
  11929. * // => false
  11930. *
  11931. * _.isArrayLikeObject(_.noop);
  11932. * // => false
  11933. */
  11934. function isArrayLikeObject(value) {
  11935. return isObjectLike(value) && isArrayLike(value);
  11936. }
  11937. /**
  11938. * Checks if `value` is classified as a boolean primitive or object.
  11939. *
  11940. * @static
  11941. * @memberOf _
  11942. * @since 0.1.0
  11943. * @category Lang
  11944. * @param {*} value The value to check.
  11945. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11946. * @example
  11947. *
  11948. * _.isBoolean(false);
  11949. * // => true
  11950. *
  11951. * _.isBoolean(null);
  11952. * // => false
  11953. */
  11954. function isBoolean(value) {
  11955. return value === true || value === false ||
  11956. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11957. }
  11958. /**
  11959. * Checks if `value` is a buffer.
  11960. *
  11961. * @static
  11962. * @memberOf _
  11963. * @since 4.3.0
  11964. * @category Lang
  11965. * @param {*} value The value to check.
  11966. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11967. * @example
  11968. *
  11969. * _.isBuffer(new Buffer(2));
  11970. * // => true
  11971. *
  11972. * _.isBuffer(new Uint8Array(2));
  11973. * // => false
  11974. */
  11975. var isBuffer = nativeIsBuffer || stubFalse;
  11976. /**
  11977. * Checks if `value` is classified as a `Date` object.
  11978. *
  11979. * @static
  11980. * @memberOf _
  11981. * @since 0.1.0
  11982. * @category Lang
  11983. * @param {*} value The value to check.
  11984. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11985. * @example
  11986. *
  11987. * _.isDate(new Date);
  11988. * // => true
  11989. *
  11990. * _.isDate('Mon April 23 2012');
  11991. * // => false
  11992. */
  11993. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11994. /**
  11995. * Checks if `value` is likely a DOM element.
  11996. *
  11997. * @static
  11998. * @memberOf _
  11999. * @since 0.1.0
  12000. * @category Lang
  12001. * @param {*} value The value to check.
  12002. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  12003. * @example
  12004. *
  12005. * _.isElement(document.body);
  12006. * // => true
  12007. *
  12008. * _.isElement('<body>');
  12009. * // => false
  12010. */
  12011. function isElement(value) {
  12012. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  12013. }
  12014. /**
  12015. * Checks if `value` is an empty object, collection, map, or set.
  12016. *
  12017. * Objects are considered empty if they have no own enumerable string keyed
  12018. * properties.
  12019. *
  12020. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  12021. * jQuery-like collections are considered empty if they have a `length` of `0`.
  12022. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  12023. *
  12024. * @static
  12025. * @memberOf _
  12026. * @since 0.1.0
  12027. * @category Lang
  12028. * @param {*} value The value to check.
  12029. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  12030. * @example
  12031. *
  12032. * _.isEmpty(null);
  12033. * // => true
  12034. *
  12035. * _.isEmpty(true);
  12036. * // => true
  12037. *
  12038. * _.isEmpty(1);
  12039. * // => true
  12040. *
  12041. * _.isEmpty([1, 2, 3]);
  12042. * // => false
  12043. *
  12044. * _.isEmpty({ 'a': 1 });
  12045. * // => false
  12046. */
  12047. function isEmpty(value) {
  12048. if (value == null) {
  12049. return true;
  12050. }
  12051. if (isArrayLike(value) &&
  12052. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  12053. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12054. return !value.length;
  12055. }
  12056. var tag = getTag(value);
  12057. if (tag == mapTag || tag == setTag) {
  12058. return !value.size;
  12059. }
  12060. if (isPrototype(value)) {
  12061. return !baseKeys(value).length;
  12062. }
  12063. for (var key in value) {
  12064. if (hasOwnProperty.call(value, key)) {
  12065. return false;
  12066. }
  12067. }
  12068. return true;
  12069. }
  12070. /**
  12071. * Performs a deep comparison between two values to determine if they are
  12072. * equivalent.
  12073. *
  12074. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12075. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12076. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12077. * by their own, not inherited, enumerable properties. Functions and DOM
  12078. * nodes are compared by strict equality, i.e. `===`.
  12079. *
  12080. * @static
  12081. * @memberOf _
  12082. * @since 0.1.0
  12083. * @category Lang
  12084. * @param {*} value The value to compare.
  12085. * @param {*} other The other value to compare.
  12086. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12087. * @example
  12088. *
  12089. * var object = { 'a': 1 };
  12090. * var other = { 'a': 1 };
  12091. *
  12092. * _.isEqual(object, other);
  12093. * // => true
  12094. *
  12095. * object === other;
  12096. * // => false
  12097. */
  12098. function isEqual(value, other) {
  12099. return baseIsEqual(value, other);
  12100. }
  12101. /**
  12102. * This method is like `_.isEqual` except that it accepts `customizer` which
  12103. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12104. * are handled by the method instead. The `customizer` is invoked with up to
  12105. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12106. *
  12107. * @static
  12108. * @memberOf _
  12109. * @since 4.0.0
  12110. * @category Lang
  12111. * @param {*} value The value to compare.
  12112. * @param {*} other The other value to compare.
  12113. * @param {Function} [customizer] The function to customize comparisons.
  12114. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12115. * @example
  12116. *
  12117. * function isGreeting(value) {
  12118. * return /^h(?:i|ello)$/.test(value);
  12119. * }
  12120. *
  12121. * function customizer(objValue, othValue) {
  12122. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12123. * return true;
  12124. * }
  12125. * }
  12126. *
  12127. * var array = ['hello', 'goodbye'];
  12128. * var other = ['hi', 'goodbye'];
  12129. *
  12130. * _.isEqualWith(array, other, customizer);
  12131. * // => true
  12132. */
  12133. function isEqualWith(value, other, customizer) {
  12134. customizer = typeof customizer == 'function' ? customizer : undefined;
  12135. var result = customizer ? customizer(value, other) : undefined;
  12136. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12137. }
  12138. /**
  12139. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12140. * `SyntaxError`, `TypeError`, or `URIError` object.
  12141. *
  12142. * @static
  12143. * @memberOf _
  12144. * @since 3.0.0
  12145. * @category Lang
  12146. * @param {*} value The value to check.
  12147. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12148. * @example
  12149. *
  12150. * _.isError(new Error);
  12151. * // => true
  12152. *
  12153. * _.isError(Error);
  12154. * // => false
  12155. */
  12156. function isError(value) {
  12157. if (!isObjectLike(value)) {
  12158. return false;
  12159. }
  12160. var tag = baseGetTag(value);
  12161. return tag == errorTag || tag == domExcTag ||
  12162. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12163. }
  12164. /**
  12165. * Checks if `value` is a finite primitive number.
  12166. *
  12167. * **Note:** This method is based on
  12168. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12169. *
  12170. * @static
  12171. * @memberOf _
  12172. * @since 0.1.0
  12173. * @category Lang
  12174. * @param {*} value The value to check.
  12175. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12176. * @example
  12177. *
  12178. * _.isFinite(3);
  12179. * // => true
  12180. *
  12181. * _.isFinite(Number.MIN_VALUE);
  12182. * // => true
  12183. *
  12184. * _.isFinite(Infinity);
  12185. * // => false
  12186. *
  12187. * _.isFinite('3');
  12188. * // => false
  12189. */
  12190. function isFinite(value) {
  12191. return typeof value == 'number' && nativeIsFinite(value);
  12192. }
  12193. /**
  12194. * Checks if `value` is classified as a `Function` object.
  12195. *
  12196. * @static
  12197. * @memberOf _
  12198. * @since 0.1.0
  12199. * @category Lang
  12200. * @param {*} value The value to check.
  12201. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12202. * @example
  12203. *
  12204. * _.isFunction(_);
  12205. * // => true
  12206. *
  12207. * _.isFunction(/abc/);
  12208. * // => false
  12209. */
  12210. function isFunction(value) {
  12211. if (!isObject(value)) {
  12212. return false;
  12213. }
  12214. // The use of `Object#toString` avoids issues with the `typeof` operator
  12215. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12216. var tag = baseGetTag(value);
  12217. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12218. }
  12219. /**
  12220. * Checks if `value` is an integer.
  12221. *
  12222. * **Note:** This method is based on
  12223. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12224. *
  12225. * @static
  12226. * @memberOf _
  12227. * @since 4.0.0
  12228. * @category Lang
  12229. * @param {*} value The value to check.
  12230. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12231. * @example
  12232. *
  12233. * _.isInteger(3);
  12234. * // => true
  12235. *
  12236. * _.isInteger(Number.MIN_VALUE);
  12237. * // => false
  12238. *
  12239. * _.isInteger(Infinity);
  12240. * // => false
  12241. *
  12242. * _.isInteger('3');
  12243. * // => false
  12244. */
  12245. function isInteger(value) {
  12246. return typeof value == 'number' && value == toInteger(value);
  12247. }
  12248. /**
  12249. * Checks if `value` is a valid array-like length.
  12250. *
  12251. * **Note:** This method is loosely based on
  12252. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12253. *
  12254. * @static
  12255. * @memberOf _
  12256. * @since 4.0.0
  12257. * @category Lang
  12258. * @param {*} value The value to check.
  12259. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12260. * @example
  12261. *
  12262. * _.isLength(3);
  12263. * // => true
  12264. *
  12265. * _.isLength(Number.MIN_VALUE);
  12266. * // => false
  12267. *
  12268. * _.isLength(Infinity);
  12269. * // => false
  12270. *
  12271. * _.isLength('3');
  12272. * // => false
  12273. */
  12274. function isLength(value) {
  12275. return typeof value == 'number' &&
  12276. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12277. }
  12278. /**
  12279. * Checks if `value` is the
  12280. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12281. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12282. *
  12283. * @static
  12284. * @memberOf _
  12285. * @since 0.1.0
  12286. * @category Lang
  12287. * @param {*} value The value to check.
  12288. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12289. * @example
  12290. *
  12291. * _.isObject({});
  12292. * // => true
  12293. *
  12294. * _.isObject([1, 2, 3]);
  12295. * // => true
  12296. *
  12297. * _.isObject(_.noop);
  12298. * // => true
  12299. *
  12300. * _.isObject(null);
  12301. * // => false
  12302. */
  12303. function isObject(value) {
  12304. var type = typeof value;
  12305. return value != null && (type == 'object' || type == 'function');
  12306. }
  12307. /**
  12308. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12309. * and has a `typeof` result of "object".
  12310. *
  12311. * @static
  12312. * @memberOf _
  12313. * @since 4.0.0
  12314. * @category Lang
  12315. * @param {*} value The value to check.
  12316. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12317. * @example
  12318. *
  12319. * _.isObjectLike({});
  12320. * // => true
  12321. *
  12322. * _.isObjectLike([1, 2, 3]);
  12323. * // => true
  12324. *
  12325. * _.isObjectLike(_.noop);
  12326. * // => false
  12327. *
  12328. * _.isObjectLike(null);
  12329. * // => false
  12330. */
  12331. function isObjectLike(value) {
  12332. return value != null && typeof value == 'object';
  12333. }
  12334. /**
  12335. * Checks if `value` is classified as a `Map` object.
  12336. *
  12337. * @static
  12338. * @memberOf _
  12339. * @since 4.3.0
  12340. * @category Lang
  12341. * @param {*} value The value to check.
  12342. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12343. * @example
  12344. *
  12345. * _.isMap(new Map);
  12346. * // => true
  12347. *
  12348. * _.isMap(new WeakMap);
  12349. * // => false
  12350. */
  12351. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12352. /**
  12353. * Performs a partial deep comparison between `object` and `source` to
  12354. * determine if `object` contains equivalent property values.
  12355. *
  12356. * **Note:** This method is equivalent to `_.matches` when `source` is
  12357. * partially applied.
  12358. *
  12359. * Partial comparisons will match empty array and empty object `source`
  12360. * values against any array or object value, respectively. See `_.isEqual`
  12361. * for a list of supported value comparisons.
  12362. *
  12363. * @static
  12364. * @memberOf _
  12365. * @since 3.0.0
  12366. * @category Lang
  12367. * @param {Object} object The object to inspect.
  12368. * @param {Object} source The object of property values to match.
  12369. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12370. * @example
  12371. *
  12372. * var object = { 'a': 1, 'b': 2 };
  12373. *
  12374. * _.isMatch(object, { 'b': 2 });
  12375. * // => true
  12376. *
  12377. * _.isMatch(object, { 'b': 1 });
  12378. * // => false
  12379. */
  12380. function isMatch(object, source) {
  12381. return object === source || baseIsMatch(object, source, getMatchData(source));
  12382. }
  12383. /**
  12384. * This method is like `_.isMatch` except that it accepts `customizer` which
  12385. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12386. * are handled by the method instead. The `customizer` is invoked with five
  12387. * arguments: (objValue, srcValue, index|key, object, source).
  12388. *
  12389. * @static
  12390. * @memberOf _
  12391. * @since 4.0.0
  12392. * @category Lang
  12393. * @param {Object} object The object to inspect.
  12394. * @param {Object} source The object of property values to match.
  12395. * @param {Function} [customizer] The function to customize comparisons.
  12396. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12397. * @example
  12398. *
  12399. * function isGreeting(value) {
  12400. * return /^h(?:i|ello)$/.test(value);
  12401. * }
  12402. *
  12403. * function customizer(objValue, srcValue) {
  12404. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12405. * return true;
  12406. * }
  12407. * }
  12408. *
  12409. * var object = { 'greeting': 'hello' };
  12410. * var source = { 'greeting': 'hi' };
  12411. *
  12412. * _.isMatchWith(object, source, customizer);
  12413. * // => true
  12414. */
  12415. function isMatchWith(object, source, customizer) {
  12416. customizer = typeof customizer == 'function' ? customizer : undefined;
  12417. return baseIsMatch(object, source, getMatchData(source), customizer);
  12418. }
  12419. /**
  12420. * Checks if `value` is `NaN`.
  12421. *
  12422. * **Note:** This method is based on
  12423. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12424. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12425. * `undefined` and other non-number values.
  12426. *
  12427. * @static
  12428. * @memberOf _
  12429. * @since 0.1.0
  12430. * @category Lang
  12431. * @param {*} value The value to check.
  12432. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12433. * @example
  12434. *
  12435. * _.isNaN(NaN);
  12436. * // => true
  12437. *
  12438. * _.isNaN(new Number(NaN));
  12439. * // => true
  12440. *
  12441. * isNaN(undefined);
  12442. * // => true
  12443. *
  12444. * _.isNaN(undefined);
  12445. * // => false
  12446. */
  12447. function isNaN(value) {
  12448. // An `NaN` primitive is the only value that is not equal to itself.
  12449. // Perform the `toStringTag` check first to avoid errors with some
  12450. // ActiveX objects in IE.
  12451. return isNumber(value) && value != +value;
  12452. }
  12453. /**
  12454. * Checks if `value` is a pristine native function.
  12455. *
  12456. * **Note:** This method can't reliably detect native functions in the presence
  12457. * of the core-js package because core-js circumvents this kind of detection.
  12458. * Despite multiple requests, the core-js maintainer has made it clear: any
  12459. * attempt to fix the detection will be obstructed. As a result, we're left
  12460. * with little choice but to throw an error. Unfortunately, this also affects
  12461. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12462. * which rely on core-js.
  12463. *
  12464. * @static
  12465. * @memberOf _
  12466. * @since 3.0.0
  12467. * @category Lang
  12468. * @param {*} value The value to check.
  12469. * @returns {boolean} Returns `true` if `value` is a native function,
  12470. * else `false`.
  12471. * @example
  12472. *
  12473. * _.isNative(Array.prototype.push);
  12474. * // => true
  12475. *
  12476. * _.isNative(_);
  12477. * // => false
  12478. */
  12479. function isNative(value) {
  12480. if (isMaskable(value)) {
  12481. throw new Error(CORE_ERROR_TEXT);
  12482. }
  12483. return baseIsNative(value);
  12484. }
  12485. /**
  12486. * Checks if `value` is `null`.
  12487. *
  12488. * @static
  12489. * @memberOf _
  12490. * @since 0.1.0
  12491. * @category Lang
  12492. * @param {*} value The value to check.
  12493. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12494. * @example
  12495. *
  12496. * _.isNull(null);
  12497. * // => true
  12498. *
  12499. * _.isNull(void 0);
  12500. * // => false
  12501. */
  12502. function isNull(value) {
  12503. return value === null;
  12504. }
  12505. /**
  12506. * Checks if `value` is `null` or `undefined`.
  12507. *
  12508. * @static
  12509. * @memberOf _
  12510. * @since 4.0.0
  12511. * @category Lang
  12512. * @param {*} value The value to check.
  12513. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12514. * @example
  12515. *
  12516. * _.isNil(null);
  12517. * // => true
  12518. *
  12519. * _.isNil(void 0);
  12520. * // => true
  12521. *
  12522. * _.isNil(NaN);
  12523. * // => false
  12524. */
  12525. function isNil(value) {
  12526. return value == null;
  12527. }
  12528. /**
  12529. * Checks if `value` is classified as a `Number` primitive or object.
  12530. *
  12531. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12532. * classified as numbers, use the `_.isFinite` method.
  12533. *
  12534. * @static
  12535. * @memberOf _
  12536. * @since 0.1.0
  12537. * @category Lang
  12538. * @param {*} value The value to check.
  12539. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12540. * @example
  12541. *
  12542. * _.isNumber(3);
  12543. * // => true
  12544. *
  12545. * _.isNumber(Number.MIN_VALUE);
  12546. * // => true
  12547. *
  12548. * _.isNumber(Infinity);
  12549. * // => true
  12550. *
  12551. * _.isNumber('3');
  12552. * // => false
  12553. */
  12554. function isNumber(value) {
  12555. return typeof value == 'number' ||
  12556. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12557. }
  12558. /**
  12559. * Checks if `value` is a plain object, that is, an object created by the
  12560. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12561. *
  12562. * @static
  12563. * @memberOf _
  12564. * @since 0.8.0
  12565. * @category Lang
  12566. * @param {*} value The value to check.
  12567. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12568. * @example
  12569. *
  12570. * function Foo() {
  12571. * this.a = 1;
  12572. * }
  12573. *
  12574. * _.isPlainObject(new Foo);
  12575. * // => false
  12576. *
  12577. * _.isPlainObject([1, 2, 3]);
  12578. * // => false
  12579. *
  12580. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12581. * // => true
  12582. *
  12583. * _.isPlainObject(Object.create(null));
  12584. * // => true
  12585. */
  12586. function isPlainObject(value) {
  12587. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12588. return false;
  12589. }
  12590. var proto = getPrototype(value);
  12591. if (proto === null) {
  12592. return true;
  12593. }
  12594. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12595. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12596. funcToString.call(Ctor) == objectCtorString;
  12597. }
  12598. /**
  12599. * Checks if `value` is classified as a `RegExp` object.
  12600. *
  12601. * @static
  12602. * @memberOf _
  12603. * @since 0.1.0
  12604. * @category Lang
  12605. * @param {*} value The value to check.
  12606. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12607. * @example
  12608. *
  12609. * _.isRegExp(/abc/);
  12610. * // => true
  12611. *
  12612. * _.isRegExp('/abc/');
  12613. * // => false
  12614. */
  12615. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12616. /**
  12617. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12618. * double precision number which isn't the result of a rounded unsafe integer.
  12619. *
  12620. * **Note:** This method is based on
  12621. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12622. *
  12623. * @static
  12624. * @memberOf _
  12625. * @since 4.0.0
  12626. * @category Lang
  12627. * @param {*} value The value to check.
  12628. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12629. * @example
  12630. *
  12631. * _.isSafeInteger(3);
  12632. * // => true
  12633. *
  12634. * _.isSafeInteger(Number.MIN_VALUE);
  12635. * // => false
  12636. *
  12637. * _.isSafeInteger(Infinity);
  12638. * // => false
  12639. *
  12640. * _.isSafeInteger('3');
  12641. * // => false
  12642. */
  12643. function isSafeInteger(value) {
  12644. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12645. }
  12646. /**
  12647. * Checks if `value` is classified as a `Set` object.
  12648. *
  12649. * @static
  12650. * @memberOf _
  12651. * @since 4.3.0
  12652. * @category Lang
  12653. * @param {*} value The value to check.
  12654. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12655. * @example
  12656. *
  12657. * _.isSet(new Set);
  12658. * // => true
  12659. *
  12660. * _.isSet(new WeakSet);
  12661. * // => false
  12662. */
  12663. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12664. /**
  12665. * Checks if `value` is classified as a `String` primitive or object.
  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 a string, else `false`.
  12673. * @example
  12674. *
  12675. * _.isString('abc');
  12676. * // => true
  12677. *
  12678. * _.isString(1);
  12679. * // => false
  12680. */
  12681. function isString(value) {
  12682. return typeof value == 'string' ||
  12683. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12684. }
  12685. /**
  12686. * Checks if `value` is classified as a `Symbol` primitive or object.
  12687. *
  12688. * @static
  12689. * @memberOf _
  12690. * @since 4.0.0
  12691. * @category Lang
  12692. * @param {*} value The value to check.
  12693. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12694. * @example
  12695. *
  12696. * _.isSymbol(Symbol.iterator);
  12697. * // => true
  12698. *
  12699. * _.isSymbol('abc');
  12700. * // => false
  12701. */
  12702. function isSymbol(value) {
  12703. return typeof value == 'symbol' ||
  12704. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12705. }
  12706. /**
  12707. * Checks if `value` is classified as a typed array.
  12708. *
  12709. * @static
  12710. * @memberOf _
  12711. * @since 3.0.0
  12712. * @category Lang
  12713. * @param {*} value The value to check.
  12714. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12715. * @example
  12716. *
  12717. * _.isTypedArray(new Uint8Array);
  12718. * // => true
  12719. *
  12720. * _.isTypedArray([]);
  12721. * // => false
  12722. */
  12723. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12724. /**
  12725. * Checks if `value` is `undefined`.
  12726. *
  12727. * @static
  12728. * @since 0.1.0
  12729. * @memberOf _
  12730. * @category Lang
  12731. * @param {*} value The value to check.
  12732. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12733. * @example
  12734. *
  12735. * _.isUndefined(void 0);
  12736. * // => true
  12737. *
  12738. * _.isUndefined(null);
  12739. * // => false
  12740. */
  12741. function isUndefined(value) {
  12742. return value === undefined;
  12743. }
  12744. /**
  12745. * Checks if `value` is classified as a `WeakMap` object.
  12746. *
  12747. * @static
  12748. * @memberOf _
  12749. * @since 4.3.0
  12750. * @category Lang
  12751. * @param {*} value The value to check.
  12752. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12753. * @example
  12754. *
  12755. * _.isWeakMap(new WeakMap);
  12756. * // => true
  12757. *
  12758. * _.isWeakMap(new Map);
  12759. * // => false
  12760. */
  12761. function isWeakMap(value) {
  12762. return isObjectLike(value) && getTag(value) == weakMapTag;
  12763. }
  12764. /**
  12765. * Checks if `value` is classified as a `WeakSet` object.
  12766. *
  12767. * @static
  12768. * @memberOf _
  12769. * @since 4.3.0
  12770. * @category Lang
  12771. * @param {*} value The value to check.
  12772. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12773. * @example
  12774. *
  12775. * _.isWeakSet(new WeakSet);
  12776. * // => true
  12777. *
  12778. * _.isWeakSet(new Set);
  12779. * // => false
  12780. */
  12781. function isWeakSet(value) {
  12782. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12783. }
  12784. /**
  12785. * Checks if `value` is less than `other`.
  12786. *
  12787. * @static
  12788. * @memberOf _
  12789. * @since 3.9.0
  12790. * @category Lang
  12791. * @param {*} value The value to compare.
  12792. * @param {*} other The other value to compare.
  12793. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12794. * else `false`.
  12795. * @see _.gt
  12796. * @example
  12797. *
  12798. * _.lt(1, 3);
  12799. * // => true
  12800. *
  12801. * _.lt(3, 3);
  12802. * // => false
  12803. *
  12804. * _.lt(3, 1);
  12805. * // => false
  12806. */
  12807. var lt = createRelationalOperation(baseLt);
  12808. /**
  12809. * Checks if `value` is less than or equal to `other`.
  12810. *
  12811. * @static
  12812. * @memberOf _
  12813. * @since 3.9.0
  12814. * @category Lang
  12815. * @param {*} value The value to compare.
  12816. * @param {*} other The other value to compare.
  12817. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12818. * `other`, else `false`.
  12819. * @see _.gte
  12820. * @example
  12821. *
  12822. * _.lte(1, 3);
  12823. * // => true
  12824. *
  12825. * _.lte(3, 3);
  12826. * // => true
  12827. *
  12828. * _.lte(3, 1);
  12829. * // => false
  12830. */
  12831. var lte = createRelationalOperation(function(value, other) {
  12832. return value <= other;
  12833. });
  12834. /**
  12835. * Converts `value` to an array.
  12836. *
  12837. * @static
  12838. * @since 0.1.0
  12839. * @memberOf _
  12840. * @category Lang
  12841. * @param {*} value The value to convert.
  12842. * @returns {Array} Returns the converted array.
  12843. * @example
  12844. *
  12845. * _.toArray({ 'a': 1, 'b': 2 });
  12846. * // => [1, 2]
  12847. *
  12848. * _.toArray('abc');
  12849. * // => ['a', 'b', 'c']
  12850. *
  12851. * _.toArray(1);
  12852. * // => []
  12853. *
  12854. * _.toArray(null);
  12855. * // => []
  12856. */
  12857. function toArray(value) {
  12858. if (!value) {
  12859. return [];
  12860. }
  12861. if (isArrayLike(value)) {
  12862. return isString(value) ? stringToArray(value) : copyArray(value);
  12863. }
  12864. if (symIterator && value[symIterator]) {
  12865. return iteratorToArray(value[symIterator]());
  12866. }
  12867. var tag = getTag(value),
  12868. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12869. return func(value);
  12870. }
  12871. /**
  12872. * Converts `value` to a finite number.
  12873. *
  12874. * @static
  12875. * @memberOf _
  12876. * @since 4.12.0
  12877. * @category Lang
  12878. * @param {*} value The value to convert.
  12879. * @returns {number} Returns the converted number.
  12880. * @example
  12881. *
  12882. * _.toFinite(3.2);
  12883. * // => 3.2
  12884. *
  12885. * _.toFinite(Number.MIN_VALUE);
  12886. * // => 5e-324
  12887. *
  12888. * _.toFinite(Infinity);
  12889. * // => 1.7976931348623157e+308
  12890. *
  12891. * _.toFinite('3.2');
  12892. * // => 3.2
  12893. */
  12894. function toFinite(value) {
  12895. if (!value) {
  12896. return value === 0 ? value : 0;
  12897. }
  12898. value = toNumber(value);
  12899. if (value === INFINITY || value === -INFINITY) {
  12900. var sign = (value < 0 ? -1 : 1);
  12901. return sign * MAX_INTEGER;
  12902. }
  12903. return value === value ? value : 0;
  12904. }
  12905. /**
  12906. * Converts `value` to an integer.
  12907. *
  12908. * **Note:** This method is loosely based on
  12909. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12910. *
  12911. * @static
  12912. * @memberOf _
  12913. * @since 4.0.0
  12914. * @category Lang
  12915. * @param {*} value The value to convert.
  12916. * @returns {number} Returns the converted integer.
  12917. * @example
  12918. *
  12919. * _.toInteger(3.2);
  12920. * // => 3
  12921. *
  12922. * _.toInteger(Number.MIN_VALUE);
  12923. * // => 0
  12924. *
  12925. * _.toInteger(Infinity);
  12926. * // => 1.7976931348623157e+308
  12927. *
  12928. * _.toInteger('3.2');
  12929. * // => 3
  12930. */
  12931. function toInteger(value) {
  12932. var result = toFinite(value),
  12933. remainder = result % 1;
  12934. return result === result ? (remainder ? result - remainder : result) : 0;
  12935. }
  12936. /**
  12937. * Converts `value` to an integer suitable for use as the length of an
  12938. * array-like object.
  12939. *
  12940. * **Note:** This method is based on
  12941. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12942. *
  12943. * @static
  12944. * @memberOf _
  12945. * @since 4.0.0
  12946. * @category Lang
  12947. * @param {*} value The value to convert.
  12948. * @returns {number} Returns the converted integer.
  12949. * @example
  12950. *
  12951. * _.toLength(3.2);
  12952. * // => 3
  12953. *
  12954. * _.toLength(Number.MIN_VALUE);
  12955. * // => 0
  12956. *
  12957. * _.toLength(Infinity);
  12958. * // => 4294967295
  12959. *
  12960. * _.toLength('3.2');
  12961. * // => 3
  12962. */
  12963. function toLength(value) {
  12964. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12965. }
  12966. /**
  12967. * Converts `value` to a number.
  12968. *
  12969. * @static
  12970. * @memberOf _
  12971. * @since 4.0.0
  12972. * @category Lang
  12973. * @param {*} value The value to process.
  12974. * @returns {number} Returns the number.
  12975. * @example
  12976. *
  12977. * _.toNumber(3.2);
  12978. * // => 3.2
  12979. *
  12980. * _.toNumber(Number.MIN_VALUE);
  12981. * // => 5e-324
  12982. *
  12983. * _.toNumber(Infinity);
  12984. * // => Infinity
  12985. *
  12986. * _.toNumber('3.2');
  12987. * // => 3.2
  12988. */
  12989. function toNumber(value) {
  12990. if (typeof value == 'number') {
  12991. return value;
  12992. }
  12993. if (isSymbol(value)) {
  12994. return NAN;
  12995. }
  12996. if (isObject(value)) {
  12997. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12998. value = isObject(other) ? (other + '') : other;
  12999. }
  13000. if (typeof value != 'string') {
  13001. return value === 0 ? value : +value;
  13002. }
  13003. value = baseTrim(value);
  13004. var isBinary = reIsBinary.test(value);
  13005. return (isBinary || reIsOctal.test(value))
  13006. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  13007. : (reIsBadHex.test(value) ? NAN : +value);
  13008. }
  13009. /**
  13010. * Converts `value` to a plain object flattening inherited enumerable string
  13011. * keyed properties of `value` to own properties of the plain object.
  13012. *
  13013. * @static
  13014. * @memberOf _
  13015. * @since 3.0.0
  13016. * @category Lang
  13017. * @param {*} value The value to convert.
  13018. * @returns {Object} Returns the converted plain object.
  13019. * @example
  13020. *
  13021. * function Foo() {
  13022. * this.b = 2;
  13023. * }
  13024. *
  13025. * Foo.prototype.c = 3;
  13026. *
  13027. * _.assign({ 'a': 1 }, new Foo);
  13028. * // => { 'a': 1, 'b': 2 }
  13029. *
  13030. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  13031. * // => { 'a': 1, 'b': 2, 'c': 3 }
  13032. */
  13033. function toPlainObject(value) {
  13034. return copyObject(value, keysIn(value));
  13035. }
  13036. /**
  13037. * Converts `value` to a safe integer. A safe integer can be compared and
  13038. * represented correctly.
  13039. *
  13040. * @static
  13041. * @memberOf _
  13042. * @since 4.0.0
  13043. * @category Lang
  13044. * @param {*} value The value to convert.
  13045. * @returns {number} Returns the converted integer.
  13046. * @example
  13047. *
  13048. * _.toSafeInteger(3.2);
  13049. * // => 3
  13050. *
  13051. * _.toSafeInteger(Number.MIN_VALUE);
  13052. * // => 0
  13053. *
  13054. * _.toSafeInteger(Infinity);
  13055. * // => 9007199254740991
  13056. *
  13057. * _.toSafeInteger('3.2');
  13058. * // => 3
  13059. */
  13060. function toSafeInteger(value) {
  13061. return value
  13062. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13063. : (value === 0 ? value : 0);
  13064. }
  13065. /**
  13066. * Converts `value` to a string. An empty string is returned for `null`
  13067. * and `undefined` values. The sign of `-0` is preserved.
  13068. *
  13069. * @static
  13070. * @memberOf _
  13071. * @since 4.0.0
  13072. * @category Lang
  13073. * @param {*} value The value to convert.
  13074. * @returns {string} Returns the converted string.
  13075. * @example
  13076. *
  13077. * _.toString(null);
  13078. * // => ''
  13079. *
  13080. * _.toString(-0);
  13081. * // => '-0'
  13082. *
  13083. * _.toString([1, 2, 3]);
  13084. * // => '1,2,3'
  13085. */
  13086. function toString(value) {
  13087. return value == null ? '' : baseToString(value);
  13088. }
  13089. /*------------------------------------------------------------------------*/
  13090. /**
  13091. * Assigns own enumerable string keyed properties of source objects to the
  13092. * destination object. Source objects are applied from left to right.
  13093. * Subsequent sources overwrite property assignments of previous sources.
  13094. *
  13095. * **Note:** This method mutates `object` and is loosely based on
  13096. * [`Object.assign`](https://mdn.io/Object/assign).
  13097. *
  13098. * @static
  13099. * @memberOf _
  13100. * @since 0.10.0
  13101. * @category Object
  13102. * @param {Object} object The destination object.
  13103. * @param {...Object} [sources] The source objects.
  13104. * @returns {Object} Returns `object`.
  13105. * @see _.assignIn
  13106. * @example
  13107. *
  13108. * function Foo() {
  13109. * this.a = 1;
  13110. * }
  13111. *
  13112. * function Bar() {
  13113. * this.c = 3;
  13114. * }
  13115. *
  13116. * Foo.prototype.b = 2;
  13117. * Bar.prototype.d = 4;
  13118. *
  13119. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13120. * // => { 'a': 1, 'c': 3 }
  13121. */
  13122. var assign = createAssigner(function(object, source) {
  13123. if (isPrototype(source) || isArrayLike(source)) {
  13124. copyObject(source, keys(source), object);
  13125. return;
  13126. }
  13127. for (var key in source) {
  13128. if (hasOwnProperty.call(source, key)) {
  13129. assignValue(object, key, source[key]);
  13130. }
  13131. }
  13132. });
  13133. /**
  13134. * This method is like `_.assign` except that it iterates over own and
  13135. * inherited source properties.
  13136. *
  13137. * **Note:** This method mutates `object`.
  13138. *
  13139. * @static
  13140. * @memberOf _
  13141. * @since 4.0.0
  13142. * @alias extend
  13143. * @category Object
  13144. * @param {Object} object The destination object.
  13145. * @param {...Object} [sources] The source objects.
  13146. * @returns {Object} Returns `object`.
  13147. * @see _.assign
  13148. * @example
  13149. *
  13150. * function Foo() {
  13151. * this.a = 1;
  13152. * }
  13153. *
  13154. * function Bar() {
  13155. * this.c = 3;
  13156. * }
  13157. *
  13158. * Foo.prototype.b = 2;
  13159. * Bar.prototype.d = 4;
  13160. *
  13161. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13162. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13163. */
  13164. var assignIn = createAssigner(function(object, source) {
  13165. copyObject(source, keysIn(source), object);
  13166. });
  13167. /**
  13168. * This method is like `_.assignIn` except that it accepts `customizer`
  13169. * which is invoked to produce the assigned values. If `customizer` returns
  13170. * `undefined`, assignment is handled by the method instead. The `customizer`
  13171. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13172. *
  13173. * **Note:** This method mutates `object`.
  13174. *
  13175. * @static
  13176. * @memberOf _
  13177. * @since 4.0.0
  13178. * @alias extendWith
  13179. * @category Object
  13180. * @param {Object} object The destination object.
  13181. * @param {...Object} sources The source objects.
  13182. * @param {Function} [customizer] The function to customize assigned values.
  13183. * @returns {Object} Returns `object`.
  13184. * @see _.assignWith
  13185. * @example
  13186. *
  13187. * function customizer(objValue, srcValue) {
  13188. * return _.isUndefined(objValue) ? srcValue : objValue;
  13189. * }
  13190. *
  13191. * var defaults = _.partialRight(_.assignInWith, customizer);
  13192. *
  13193. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13194. * // => { 'a': 1, 'b': 2 }
  13195. */
  13196. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13197. copyObject(source, keysIn(source), object, customizer);
  13198. });
  13199. /**
  13200. * This method is like `_.assign` except that it accepts `customizer`
  13201. * which is invoked to produce the assigned values. If `customizer` returns
  13202. * `undefined`, assignment is handled by the method instead. The `customizer`
  13203. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13204. *
  13205. * **Note:** This method mutates `object`.
  13206. *
  13207. * @static
  13208. * @memberOf _
  13209. * @since 4.0.0
  13210. * @category Object
  13211. * @param {Object} object The destination object.
  13212. * @param {...Object} sources The source objects.
  13213. * @param {Function} [customizer] The function to customize assigned values.
  13214. * @returns {Object} Returns `object`.
  13215. * @see _.assignInWith
  13216. * @example
  13217. *
  13218. * function customizer(objValue, srcValue) {
  13219. * return _.isUndefined(objValue) ? srcValue : objValue;
  13220. * }
  13221. *
  13222. * var defaults = _.partialRight(_.assignWith, customizer);
  13223. *
  13224. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13225. * // => { 'a': 1, 'b': 2 }
  13226. */
  13227. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13228. copyObject(source, keys(source), object, customizer);
  13229. });
  13230. /**
  13231. * Creates an array of values corresponding to `paths` of `object`.
  13232. *
  13233. * @static
  13234. * @memberOf _
  13235. * @since 1.0.0
  13236. * @category Object
  13237. * @param {Object} object The object to iterate over.
  13238. * @param {...(string|string[])} [paths] The property paths to pick.
  13239. * @returns {Array} Returns the picked values.
  13240. * @example
  13241. *
  13242. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13243. *
  13244. * _.at(object, ['a[0].b.c', 'a[1]']);
  13245. * // => [3, 4]
  13246. */
  13247. var at = flatRest(baseAt);
  13248. /**
  13249. * Creates an object that inherits from the `prototype` object. If a
  13250. * `properties` object is given, its own enumerable string keyed properties
  13251. * are assigned to the created object.
  13252. *
  13253. * @static
  13254. * @memberOf _
  13255. * @since 2.3.0
  13256. * @category Object
  13257. * @param {Object} prototype The object to inherit from.
  13258. * @param {Object} [properties] The properties to assign to the object.
  13259. * @returns {Object} Returns the new object.
  13260. * @example
  13261. *
  13262. * function Shape() {
  13263. * this.x = 0;
  13264. * this.y = 0;
  13265. * }
  13266. *
  13267. * function Circle() {
  13268. * Shape.call(this);
  13269. * }
  13270. *
  13271. * Circle.prototype = _.create(Shape.prototype, {
  13272. * 'constructor': Circle
  13273. * });
  13274. *
  13275. * var circle = new Circle;
  13276. * circle instanceof Circle;
  13277. * // => true
  13278. *
  13279. * circle instanceof Shape;
  13280. * // => true
  13281. */
  13282. function create(prototype, properties) {
  13283. var result = baseCreate(prototype);
  13284. return properties == null ? result : baseAssign(result, properties);
  13285. }
  13286. /**
  13287. * Assigns own and inherited enumerable string keyed properties of source
  13288. * objects to the destination object for all destination properties that
  13289. * resolve to `undefined`. Source objects are applied from left to right.
  13290. * Once a property is set, additional values of the same property are ignored.
  13291. *
  13292. * **Note:** This method mutates `object`.
  13293. *
  13294. * @static
  13295. * @since 0.1.0
  13296. * @memberOf _
  13297. * @category Object
  13298. * @param {Object} object The destination object.
  13299. * @param {...Object} [sources] The source objects.
  13300. * @returns {Object} Returns `object`.
  13301. * @see _.defaultsDeep
  13302. * @example
  13303. *
  13304. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13305. * // => { 'a': 1, 'b': 2 }
  13306. */
  13307. var defaults = baseRest(function(object, sources) {
  13308. object = Object(object);
  13309. var index = -1;
  13310. var length = sources.length;
  13311. var guard = length > 2 ? sources[2] : undefined;
  13312. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13313. length = 1;
  13314. }
  13315. while (++index < length) {
  13316. var source = sources[index];
  13317. var props = keysIn(source);
  13318. var propsIndex = -1;
  13319. var propsLength = props.length;
  13320. while (++propsIndex < propsLength) {
  13321. var key = props[propsIndex];
  13322. var value = object[key];
  13323. if (value === undefined ||
  13324. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13325. object[key] = source[key];
  13326. }
  13327. }
  13328. }
  13329. return object;
  13330. });
  13331. /**
  13332. * This method is like `_.defaults` except that it recursively assigns
  13333. * default properties.
  13334. *
  13335. * **Note:** This method mutates `object`.
  13336. *
  13337. * @static
  13338. * @memberOf _
  13339. * @since 3.10.0
  13340. * @category Object
  13341. * @param {Object} object The destination object.
  13342. * @param {...Object} [sources] The source objects.
  13343. * @returns {Object} Returns `object`.
  13344. * @see _.defaults
  13345. * @example
  13346. *
  13347. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13348. * // => { 'a': { 'b': 2, 'c': 3 } }
  13349. */
  13350. var defaultsDeep = baseRest(function(args) {
  13351. args.push(undefined, customDefaultsMerge);
  13352. return apply(mergeWith, undefined, args);
  13353. });
  13354. /**
  13355. * This method is like `_.find` except that it returns the key of the first
  13356. * element `predicate` returns truthy for instead of the element itself.
  13357. *
  13358. * @static
  13359. * @memberOf _
  13360. * @since 1.1.0
  13361. * @category Object
  13362. * @param {Object} object The object to inspect.
  13363. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13364. * @returns {string|undefined} Returns the key of the matched element,
  13365. * else `undefined`.
  13366. * @example
  13367. *
  13368. * var users = {
  13369. * 'barney': { 'age': 36, 'active': true },
  13370. * 'fred': { 'age': 40, 'active': false },
  13371. * 'pebbles': { 'age': 1, 'active': true }
  13372. * };
  13373. *
  13374. * _.findKey(users, function(o) { return o.age < 40; });
  13375. * // => 'barney' (iteration order is not guaranteed)
  13376. *
  13377. * // The `_.matches` iteratee shorthand.
  13378. * _.findKey(users, { 'age': 1, 'active': true });
  13379. * // => 'pebbles'
  13380. *
  13381. * // The `_.matchesProperty` iteratee shorthand.
  13382. * _.findKey(users, ['active', false]);
  13383. * // => 'fred'
  13384. *
  13385. * // The `_.property` iteratee shorthand.
  13386. * _.findKey(users, 'active');
  13387. * // => 'barney'
  13388. */
  13389. function findKey(object, predicate) {
  13390. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13391. }
  13392. /**
  13393. * This method is like `_.findKey` except that it iterates over elements of
  13394. * a collection in the opposite order.
  13395. *
  13396. * @static
  13397. * @memberOf _
  13398. * @since 2.0.0
  13399. * @category Object
  13400. * @param {Object} object The object to inspect.
  13401. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13402. * @returns {string|undefined} Returns the key of the matched element,
  13403. * else `undefined`.
  13404. * @example
  13405. *
  13406. * var users = {
  13407. * 'barney': { 'age': 36, 'active': true },
  13408. * 'fred': { 'age': 40, 'active': false },
  13409. * 'pebbles': { 'age': 1, 'active': true }
  13410. * };
  13411. *
  13412. * _.findLastKey(users, function(o) { return o.age < 40; });
  13413. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13414. *
  13415. * // The `_.matches` iteratee shorthand.
  13416. * _.findLastKey(users, { 'age': 36, 'active': true });
  13417. * // => 'barney'
  13418. *
  13419. * // The `_.matchesProperty` iteratee shorthand.
  13420. * _.findLastKey(users, ['active', false]);
  13421. * // => 'fred'
  13422. *
  13423. * // The `_.property` iteratee shorthand.
  13424. * _.findLastKey(users, 'active');
  13425. * // => 'pebbles'
  13426. */
  13427. function findLastKey(object, predicate) {
  13428. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13429. }
  13430. /**
  13431. * Iterates over own and inherited enumerable string keyed properties of an
  13432. * object and invokes `iteratee` for each property. The iteratee is invoked
  13433. * with three arguments: (value, key, object). Iteratee functions may exit
  13434. * iteration early by explicitly returning `false`.
  13435. *
  13436. * @static
  13437. * @memberOf _
  13438. * @since 0.3.0
  13439. * @category Object
  13440. * @param {Object} object The object to iterate over.
  13441. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13442. * @returns {Object} Returns `object`.
  13443. * @see _.forInRight
  13444. * @example
  13445. *
  13446. * function Foo() {
  13447. * this.a = 1;
  13448. * this.b = 2;
  13449. * }
  13450. *
  13451. * Foo.prototype.c = 3;
  13452. *
  13453. * _.forIn(new Foo, function(value, key) {
  13454. * console.log(key);
  13455. * });
  13456. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13457. */
  13458. function forIn(object, iteratee) {
  13459. return object == null
  13460. ? object
  13461. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13462. }
  13463. /**
  13464. * This method is like `_.forIn` except that it iterates over properties of
  13465. * `object` in the opposite order.
  13466. *
  13467. * @static
  13468. * @memberOf _
  13469. * @since 2.0.0
  13470. * @category Object
  13471. * @param {Object} object The object to iterate over.
  13472. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13473. * @returns {Object} Returns `object`.
  13474. * @see _.forIn
  13475. * @example
  13476. *
  13477. * function Foo() {
  13478. * this.a = 1;
  13479. * this.b = 2;
  13480. * }
  13481. *
  13482. * Foo.prototype.c = 3;
  13483. *
  13484. * _.forInRight(new Foo, function(value, key) {
  13485. * console.log(key);
  13486. * });
  13487. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13488. */
  13489. function forInRight(object, iteratee) {
  13490. return object == null
  13491. ? object
  13492. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13493. }
  13494. /**
  13495. * Iterates over own enumerable string keyed properties of an object and
  13496. * invokes `iteratee` for each property. The iteratee is invoked with three
  13497. * arguments: (value, key, object). Iteratee functions may exit iteration
  13498. * early by explicitly returning `false`.
  13499. *
  13500. * @static
  13501. * @memberOf _
  13502. * @since 0.3.0
  13503. * @category Object
  13504. * @param {Object} object The object to iterate over.
  13505. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13506. * @returns {Object} Returns `object`.
  13507. * @see _.forOwnRight
  13508. * @example
  13509. *
  13510. * function Foo() {
  13511. * this.a = 1;
  13512. * this.b = 2;
  13513. * }
  13514. *
  13515. * Foo.prototype.c = 3;
  13516. *
  13517. * _.forOwn(new Foo, function(value, key) {
  13518. * console.log(key);
  13519. * });
  13520. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13521. */
  13522. function forOwn(object, iteratee) {
  13523. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13524. }
  13525. /**
  13526. * This method is like `_.forOwn` except that it iterates over properties of
  13527. * `object` in the opposite order.
  13528. *
  13529. * @static
  13530. * @memberOf _
  13531. * @since 2.0.0
  13532. * @category Object
  13533. * @param {Object} object The object to iterate over.
  13534. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13535. * @returns {Object} Returns `object`.
  13536. * @see _.forOwn
  13537. * @example
  13538. *
  13539. * function Foo() {
  13540. * this.a = 1;
  13541. * this.b = 2;
  13542. * }
  13543. *
  13544. * Foo.prototype.c = 3;
  13545. *
  13546. * _.forOwnRight(new Foo, function(value, key) {
  13547. * console.log(key);
  13548. * });
  13549. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13550. */
  13551. function forOwnRight(object, iteratee) {
  13552. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13553. }
  13554. /**
  13555. * Creates an array of function property names from own enumerable properties
  13556. * of `object`.
  13557. *
  13558. * @static
  13559. * @since 0.1.0
  13560. * @memberOf _
  13561. * @category Object
  13562. * @param {Object} object The object to inspect.
  13563. * @returns {Array} Returns the function names.
  13564. * @see _.functionsIn
  13565. * @example
  13566. *
  13567. * function Foo() {
  13568. * this.a = _.constant('a');
  13569. * this.b = _.constant('b');
  13570. * }
  13571. *
  13572. * Foo.prototype.c = _.constant('c');
  13573. *
  13574. * _.functions(new Foo);
  13575. * // => ['a', 'b']
  13576. */
  13577. function functions(object) {
  13578. return object == null ? [] : baseFunctions(object, keys(object));
  13579. }
  13580. /**
  13581. * Creates an array of function property names from own and inherited
  13582. * enumerable properties of `object`.
  13583. *
  13584. * @static
  13585. * @memberOf _
  13586. * @since 4.0.0
  13587. * @category Object
  13588. * @param {Object} object The object to inspect.
  13589. * @returns {Array} Returns the function names.
  13590. * @see _.functions
  13591. * @example
  13592. *
  13593. * function Foo() {
  13594. * this.a = _.constant('a');
  13595. * this.b = _.constant('b');
  13596. * }
  13597. *
  13598. * Foo.prototype.c = _.constant('c');
  13599. *
  13600. * _.functionsIn(new Foo);
  13601. * // => ['a', 'b', 'c']
  13602. */
  13603. function functionsIn(object) {
  13604. return object == null ? [] : baseFunctions(object, keysIn(object));
  13605. }
  13606. /**
  13607. * Gets the value at `path` of `object`. If the resolved value is
  13608. * `undefined`, the `defaultValue` is returned in its place.
  13609. *
  13610. * @static
  13611. * @memberOf _
  13612. * @since 3.7.0
  13613. * @category Object
  13614. * @param {Object} object The object to query.
  13615. * @param {Array|string} path The path of the property to get.
  13616. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13617. * @returns {*} Returns the resolved value.
  13618. * @example
  13619. *
  13620. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13621. *
  13622. * _.get(object, 'a[0].b.c');
  13623. * // => 3
  13624. *
  13625. * _.get(object, ['a', '0', 'b', 'c']);
  13626. * // => 3
  13627. *
  13628. * _.get(object, 'a.b.c', 'default');
  13629. * // => 'default'
  13630. */
  13631. function get(object, path, defaultValue) {
  13632. var result = object == null ? undefined : baseGet(object, path);
  13633. return result === undefined ? defaultValue : result;
  13634. }
  13635. /**
  13636. * Checks if `path` is a direct property of `object`.
  13637. *
  13638. * @static
  13639. * @since 0.1.0
  13640. * @memberOf _
  13641. * @category Object
  13642. * @param {Object} object The object to query.
  13643. * @param {Array|string} path The path to check.
  13644. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13645. * @example
  13646. *
  13647. * var object = { 'a': { 'b': 2 } };
  13648. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13649. *
  13650. * _.has(object, 'a');
  13651. * // => true
  13652. *
  13653. * _.has(object, 'a.b');
  13654. * // => true
  13655. *
  13656. * _.has(object, ['a', 'b']);
  13657. * // => true
  13658. *
  13659. * _.has(other, 'a');
  13660. * // => false
  13661. */
  13662. function has(object, path) {
  13663. return object != null && hasPath(object, path, baseHas);
  13664. }
  13665. /**
  13666. * Checks if `path` is a direct or inherited property of `object`.
  13667. *
  13668. * @static
  13669. * @memberOf _
  13670. * @since 4.0.0
  13671. * @category Object
  13672. * @param {Object} object The object to query.
  13673. * @param {Array|string} path The path to check.
  13674. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13675. * @example
  13676. *
  13677. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13678. *
  13679. * _.hasIn(object, 'a');
  13680. * // => true
  13681. *
  13682. * _.hasIn(object, 'a.b');
  13683. * // => true
  13684. *
  13685. * _.hasIn(object, ['a', 'b']);
  13686. * // => true
  13687. *
  13688. * _.hasIn(object, 'b');
  13689. * // => false
  13690. */
  13691. function hasIn(object, path) {
  13692. return object != null && hasPath(object, path, baseHasIn);
  13693. }
  13694. /**
  13695. * Creates an object composed of the inverted keys and values of `object`.
  13696. * If `object` contains duplicate values, subsequent values overwrite
  13697. * property assignments of previous values.
  13698. *
  13699. * @static
  13700. * @memberOf _
  13701. * @since 0.7.0
  13702. * @category Object
  13703. * @param {Object} object The object to invert.
  13704. * @returns {Object} Returns the new inverted object.
  13705. * @example
  13706. *
  13707. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13708. *
  13709. * _.invert(object);
  13710. * // => { '1': 'c', '2': 'b' }
  13711. */
  13712. var invert = createInverter(function(result, value, key) {
  13713. if (value != null &&
  13714. typeof value.toString != 'function') {
  13715. value = nativeObjectToString.call(value);
  13716. }
  13717. result[value] = key;
  13718. }, constant(identity));
  13719. /**
  13720. * This method is like `_.invert` except that the inverted object is generated
  13721. * from the results of running each element of `object` thru `iteratee`. The
  13722. * corresponding inverted value of each inverted key is an array of keys
  13723. * responsible for generating the inverted value. The iteratee is invoked
  13724. * with one argument: (value).
  13725. *
  13726. * @static
  13727. * @memberOf _
  13728. * @since 4.1.0
  13729. * @category Object
  13730. * @param {Object} object The object to invert.
  13731. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13732. * @returns {Object} Returns the new inverted object.
  13733. * @example
  13734. *
  13735. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13736. *
  13737. * _.invertBy(object);
  13738. * // => { '1': ['a', 'c'], '2': ['b'] }
  13739. *
  13740. * _.invertBy(object, function(value) {
  13741. * return 'group' + value;
  13742. * });
  13743. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13744. */
  13745. var invertBy = createInverter(function(result, value, key) {
  13746. if (value != null &&
  13747. typeof value.toString != 'function') {
  13748. value = nativeObjectToString.call(value);
  13749. }
  13750. if (hasOwnProperty.call(result, value)) {
  13751. result[value].push(key);
  13752. } else {
  13753. result[value] = [key];
  13754. }
  13755. }, getIteratee);
  13756. /**
  13757. * Invokes the method at `path` of `object`.
  13758. *
  13759. * @static
  13760. * @memberOf _
  13761. * @since 4.0.0
  13762. * @category Object
  13763. * @param {Object} object The object to query.
  13764. * @param {Array|string} path The path of the method to invoke.
  13765. * @param {...*} [args] The arguments to invoke the method with.
  13766. * @returns {*} Returns the result of the invoked method.
  13767. * @example
  13768. *
  13769. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13770. *
  13771. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13772. * // => [2, 3]
  13773. */
  13774. var invoke = baseRest(baseInvoke);
  13775. /**
  13776. * Creates an array of the own enumerable property names of `object`.
  13777. *
  13778. * **Note:** Non-object values are coerced to objects. See the
  13779. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13780. * for more details.
  13781. *
  13782. * @static
  13783. * @since 0.1.0
  13784. * @memberOf _
  13785. * @category Object
  13786. * @param {Object} object The object to query.
  13787. * @returns {Array} Returns the array of property names.
  13788. * @example
  13789. *
  13790. * function Foo() {
  13791. * this.a = 1;
  13792. * this.b = 2;
  13793. * }
  13794. *
  13795. * Foo.prototype.c = 3;
  13796. *
  13797. * _.keys(new Foo);
  13798. * // => ['a', 'b'] (iteration order is not guaranteed)
  13799. *
  13800. * _.keys('hi');
  13801. * // => ['0', '1']
  13802. */
  13803. function keys(object) {
  13804. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13805. }
  13806. /**
  13807. * Creates an array of the own and inherited enumerable property names of `object`.
  13808. *
  13809. * **Note:** Non-object values are coerced to objects.
  13810. *
  13811. * @static
  13812. * @memberOf _
  13813. * @since 3.0.0
  13814. * @category Object
  13815. * @param {Object} object The object to query.
  13816. * @returns {Array} Returns the array of property names.
  13817. * @example
  13818. *
  13819. * function Foo() {
  13820. * this.a = 1;
  13821. * this.b = 2;
  13822. * }
  13823. *
  13824. * Foo.prototype.c = 3;
  13825. *
  13826. * _.keysIn(new Foo);
  13827. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13828. */
  13829. function keysIn(object) {
  13830. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13831. }
  13832. /**
  13833. * The opposite of `_.mapValues`; this method creates an object with the
  13834. * same values as `object` and keys generated by running each own enumerable
  13835. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13836. * with three arguments: (value, key, object).
  13837. *
  13838. * @static
  13839. * @memberOf _
  13840. * @since 3.8.0
  13841. * @category Object
  13842. * @param {Object} object The object to iterate over.
  13843. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13844. * @returns {Object} Returns the new mapped object.
  13845. * @see _.mapValues
  13846. * @example
  13847. *
  13848. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13849. * return key + value;
  13850. * });
  13851. * // => { 'a1': 1, 'b2': 2 }
  13852. */
  13853. function mapKeys(object, iteratee) {
  13854. var result = {};
  13855. iteratee = getIteratee(iteratee, 3);
  13856. baseForOwn(object, function(value, key, object) {
  13857. baseAssignValue(result, iteratee(value, key, object), value);
  13858. });
  13859. return result;
  13860. }
  13861. /**
  13862. * Creates an object with the same keys as `object` and values generated
  13863. * by running each own enumerable string keyed property of `object` thru
  13864. * `iteratee`. The iteratee is invoked with three arguments:
  13865. * (value, key, object).
  13866. *
  13867. * @static
  13868. * @memberOf _
  13869. * @since 2.4.0
  13870. * @category Object
  13871. * @param {Object} object The object to iterate over.
  13872. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13873. * @returns {Object} Returns the new mapped object.
  13874. * @see _.mapKeys
  13875. * @example
  13876. *
  13877. * var users = {
  13878. * 'fred': { 'user': 'fred', 'age': 40 },
  13879. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13880. * };
  13881. *
  13882. * _.mapValues(users, function(o) { return o.age; });
  13883. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13884. *
  13885. * // The `_.property` iteratee shorthand.
  13886. * _.mapValues(users, 'age');
  13887. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13888. */
  13889. function mapValues(object, iteratee) {
  13890. var result = {};
  13891. iteratee = getIteratee(iteratee, 3);
  13892. baseForOwn(object, function(value, key, object) {
  13893. baseAssignValue(result, key, iteratee(value, key, object));
  13894. });
  13895. return result;
  13896. }
  13897. /**
  13898. * This method is like `_.assign` except that it recursively merges own and
  13899. * inherited enumerable string keyed properties of source objects into the
  13900. * destination object. Source properties that resolve to `undefined` are
  13901. * skipped if a destination value exists. Array and plain object properties
  13902. * are merged recursively. Other objects and value types are overridden by
  13903. * assignment. Source objects are applied from left to right. Subsequent
  13904. * sources overwrite property assignments of previous sources.
  13905. *
  13906. * **Note:** This method mutates `object`.
  13907. *
  13908. * @static
  13909. * @memberOf _
  13910. * @since 0.5.0
  13911. * @category Object
  13912. * @param {Object} object The destination object.
  13913. * @param {...Object} [sources] The source objects.
  13914. * @returns {Object} Returns `object`.
  13915. * @example
  13916. *
  13917. * var object = {
  13918. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13919. * };
  13920. *
  13921. * var other = {
  13922. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13923. * };
  13924. *
  13925. * _.merge(object, other);
  13926. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13927. */
  13928. var merge = createAssigner(function(object, source, srcIndex) {
  13929. baseMerge(object, source, srcIndex);
  13930. });
  13931. /**
  13932. * This method is like `_.merge` except that it accepts `customizer` which
  13933. * is invoked to produce the merged values of the destination and source
  13934. * properties. If `customizer` returns `undefined`, merging is handled by the
  13935. * method instead. The `customizer` is invoked with six arguments:
  13936. * (objValue, srcValue, key, object, source, stack).
  13937. *
  13938. * **Note:** This method mutates `object`.
  13939. *
  13940. * @static
  13941. * @memberOf _
  13942. * @since 4.0.0
  13943. * @category Object
  13944. * @param {Object} object The destination object.
  13945. * @param {...Object} sources The source objects.
  13946. * @param {Function} customizer The function to customize assigned values.
  13947. * @returns {Object} Returns `object`.
  13948. * @example
  13949. *
  13950. * function customizer(objValue, srcValue) {
  13951. * if (_.isArray(objValue)) {
  13952. * return objValue.concat(srcValue);
  13953. * }
  13954. * }
  13955. *
  13956. * var object = { 'a': [1], 'b': [2] };
  13957. * var other = { 'a': [3], 'b': [4] };
  13958. *
  13959. * _.mergeWith(object, other, customizer);
  13960. * // => { 'a': [1, 3], 'b': [2, 4] }
  13961. */
  13962. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13963. baseMerge(object, source, srcIndex, customizer);
  13964. });
  13965. /**
  13966. * The opposite of `_.pick`; this method creates an object composed of the
  13967. * own and inherited enumerable property paths of `object` that are not omitted.
  13968. *
  13969. * **Note:** This method is considerably slower than `_.pick`.
  13970. *
  13971. * @static
  13972. * @since 0.1.0
  13973. * @memberOf _
  13974. * @category Object
  13975. * @param {Object} object The source object.
  13976. * @param {...(string|string[])} [paths] The property paths to omit.
  13977. * @returns {Object} Returns the new object.
  13978. * @example
  13979. *
  13980. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13981. *
  13982. * _.omit(object, ['a', 'c']);
  13983. * // => { 'b': '2' }
  13984. */
  13985. var omit = flatRest(function(object, paths) {
  13986. var result = {};
  13987. if (object == null) {
  13988. return result;
  13989. }
  13990. var isDeep = false;
  13991. paths = arrayMap(paths, function(path) {
  13992. path = castPath(path, object);
  13993. isDeep || (isDeep = path.length > 1);
  13994. return path;
  13995. });
  13996. copyObject(object, getAllKeysIn(object), result);
  13997. if (isDeep) {
  13998. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13999. }
  14000. var length = paths.length;
  14001. while (length--) {
  14002. baseUnset(result, paths[length]);
  14003. }
  14004. return result;
  14005. });
  14006. /**
  14007. * The opposite of `_.pickBy`; this method creates an object composed of
  14008. * the own and inherited enumerable string keyed properties of `object` that
  14009. * `predicate` doesn't return truthy for. The predicate is invoked with two
  14010. * arguments: (value, key).
  14011. *
  14012. * @static
  14013. * @memberOf _
  14014. * @since 4.0.0
  14015. * @category Object
  14016. * @param {Object} object The source object.
  14017. * @param {Function} [predicate=_.identity] The function invoked per property.
  14018. * @returns {Object} Returns the new object.
  14019. * @example
  14020. *
  14021. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14022. *
  14023. * _.omitBy(object, _.isNumber);
  14024. * // => { 'b': '2' }
  14025. */
  14026. function omitBy(object, predicate) {
  14027. return pickBy(object, negate(getIteratee(predicate)));
  14028. }
  14029. /**
  14030. * Creates an object composed of the picked `object` properties.
  14031. *
  14032. * @static
  14033. * @since 0.1.0
  14034. * @memberOf _
  14035. * @category Object
  14036. * @param {Object} object The source object.
  14037. * @param {...(string|string[])} [paths] The property paths to pick.
  14038. * @returns {Object} Returns the new object.
  14039. * @example
  14040. *
  14041. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14042. *
  14043. * _.pick(object, ['a', 'c']);
  14044. * // => { 'a': 1, 'c': 3 }
  14045. */
  14046. var pick = flatRest(function(object, paths) {
  14047. return object == null ? {} : basePick(object, paths);
  14048. });
  14049. /**
  14050. * Creates an object composed of the `object` properties `predicate` returns
  14051. * truthy for. The predicate is invoked with two arguments: (value, key).
  14052. *
  14053. * @static
  14054. * @memberOf _
  14055. * @since 4.0.0
  14056. * @category Object
  14057. * @param {Object} object The source object.
  14058. * @param {Function} [predicate=_.identity] The function invoked per property.
  14059. * @returns {Object} Returns the new object.
  14060. * @example
  14061. *
  14062. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14063. *
  14064. * _.pickBy(object, _.isNumber);
  14065. * // => { 'a': 1, 'c': 3 }
  14066. */
  14067. function pickBy(object, predicate) {
  14068. if (object == null) {
  14069. return {};
  14070. }
  14071. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14072. return [prop];
  14073. });
  14074. predicate = getIteratee(predicate);
  14075. return basePickBy(object, props, function(value, path) {
  14076. return predicate(value, path[0]);
  14077. });
  14078. }
  14079. /**
  14080. * This method is like `_.get` except that if the resolved value is a
  14081. * function it's invoked with the `this` binding of its parent object and
  14082. * its result is returned.
  14083. *
  14084. * @static
  14085. * @since 0.1.0
  14086. * @memberOf _
  14087. * @category Object
  14088. * @param {Object} object The object to query.
  14089. * @param {Array|string} path The path of the property to resolve.
  14090. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14091. * @returns {*} Returns the resolved value.
  14092. * @example
  14093. *
  14094. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14095. *
  14096. * _.result(object, 'a[0].b.c1');
  14097. * // => 3
  14098. *
  14099. * _.result(object, 'a[0].b.c2');
  14100. * // => 4
  14101. *
  14102. * _.result(object, 'a[0].b.c3', 'default');
  14103. * // => 'default'
  14104. *
  14105. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14106. * // => 'default'
  14107. */
  14108. function result(object, path, defaultValue) {
  14109. path = castPath(path, object);
  14110. var index = -1,
  14111. length = path.length;
  14112. // Ensure the loop is entered when path is empty.
  14113. if (!length) {
  14114. length = 1;
  14115. object = undefined;
  14116. }
  14117. while (++index < length) {
  14118. var value = object == null ? undefined : object[toKey(path[index])];
  14119. if (value === undefined) {
  14120. index = length;
  14121. value = defaultValue;
  14122. }
  14123. object = isFunction(value) ? value.call(object) : value;
  14124. }
  14125. return object;
  14126. }
  14127. /**
  14128. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14129. * it's created. Arrays are created for missing index properties while objects
  14130. * are created for all other missing properties. Use `_.setWith` to customize
  14131. * `path` creation.
  14132. *
  14133. * **Note:** This method mutates `object`.
  14134. *
  14135. * @static
  14136. * @memberOf _
  14137. * @since 3.7.0
  14138. * @category Object
  14139. * @param {Object} object The object to modify.
  14140. * @param {Array|string} path The path of the property to set.
  14141. * @param {*} value The value to set.
  14142. * @returns {Object} Returns `object`.
  14143. * @example
  14144. *
  14145. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14146. *
  14147. * _.set(object, 'a[0].b.c', 4);
  14148. * console.log(object.a[0].b.c);
  14149. * // => 4
  14150. *
  14151. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14152. * console.log(object.x[0].y.z);
  14153. * // => 5
  14154. */
  14155. function set(object, path, value) {
  14156. return object == null ? object : baseSet(object, path, value);
  14157. }
  14158. /**
  14159. * This method is like `_.set` except that it accepts `customizer` which is
  14160. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14161. * path creation is handled by the method instead. The `customizer` is invoked
  14162. * with three arguments: (nsValue, key, nsObject).
  14163. *
  14164. * **Note:** This method mutates `object`.
  14165. *
  14166. * @static
  14167. * @memberOf _
  14168. * @since 4.0.0
  14169. * @category Object
  14170. * @param {Object} object The object to modify.
  14171. * @param {Array|string} path The path of the property to set.
  14172. * @param {*} value The value to set.
  14173. * @param {Function} [customizer] The function to customize assigned values.
  14174. * @returns {Object} Returns `object`.
  14175. * @example
  14176. *
  14177. * var object = {};
  14178. *
  14179. * _.setWith(object, '[0][1]', 'a', Object);
  14180. * // => { '0': { '1': 'a' } }
  14181. */
  14182. function setWith(object, path, value, customizer) {
  14183. customizer = typeof customizer == 'function' ? customizer : undefined;
  14184. return object == null ? object : baseSet(object, path, value, customizer);
  14185. }
  14186. /**
  14187. * Creates an array of own enumerable string keyed-value pairs for `object`
  14188. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14189. * entries are returned.
  14190. *
  14191. * @static
  14192. * @memberOf _
  14193. * @since 4.0.0
  14194. * @alias entries
  14195. * @category Object
  14196. * @param {Object} object The object to query.
  14197. * @returns {Array} Returns the key-value pairs.
  14198. * @example
  14199. *
  14200. * function Foo() {
  14201. * this.a = 1;
  14202. * this.b = 2;
  14203. * }
  14204. *
  14205. * Foo.prototype.c = 3;
  14206. *
  14207. * _.toPairs(new Foo);
  14208. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14209. */
  14210. var toPairs = createToPairs(keys);
  14211. /**
  14212. * Creates an array of own and inherited enumerable string keyed-value pairs
  14213. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14214. * or set, its entries are returned.
  14215. *
  14216. * @static
  14217. * @memberOf _
  14218. * @since 4.0.0
  14219. * @alias entriesIn
  14220. * @category Object
  14221. * @param {Object} object The object to query.
  14222. * @returns {Array} Returns the key-value pairs.
  14223. * @example
  14224. *
  14225. * function Foo() {
  14226. * this.a = 1;
  14227. * this.b = 2;
  14228. * }
  14229. *
  14230. * Foo.prototype.c = 3;
  14231. *
  14232. * _.toPairsIn(new Foo);
  14233. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14234. */
  14235. var toPairsIn = createToPairs(keysIn);
  14236. /**
  14237. * An alternative to `_.reduce`; this method transforms `object` to a new
  14238. * `accumulator` object which is the result of running each of its own
  14239. * enumerable string keyed properties thru `iteratee`, with each invocation
  14240. * potentially mutating the `accumulator` object. If `accumulator` is not
  14241. * provided, a new object with the same `[[Prototype]]` will be used. The
  14242. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14243. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14244. *
  14245. * @static
  14246. * @memberOf _
  14247. * @since 1.3.0
  14248. * @category Object
  14249. * @param {Object} object The object to iterate over.
  14250. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14251. * @param {*} [accumulator] The custom accumulator value.
  14252. * @returns {*} Returns the accumulated value.
  14253. * @example
  14254. *
  14255. * _.transform([2, 3, 4], function(result, n) {
  14256. * result.push(n *= n);
  14257. * return n % 2 == 0;
  14258. * }, []);
  14259. * // => [4, 9]
  14260. *
  14261. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14262. * (result[value] || (result[value] = [])).push(key);
  14263. * }, {});
  14264. * // => { '1': ['a', 'c'], '2': ['b'] }
  14265. */
  14266. function transform(object, iteratee, accumulator) {
  14267. var isArr = isArray(object),
  14268. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14269. iteratee = getIteratee(iteratee, 4);
  14270. if (accumulator == null) {
  14271. var Ctor = object && object.constructor;
  14272. if (isArrLike) {
  14273. accumulator = isArr ? new Ctor : [];
  14274. }
  14275. else if (isObject(object)) {
  14276. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14277. }
  14278. else {
  14279. accumulator = {};
  14280. }
  14281. }
  14282. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14283. return iteratee(accumulator, value, index, object);
  14284. });
  14285. return accumulator;
  14286. }
  14287. /**
  14288. * Removes the property at `path` of `object`.
  14289. *
  14290. * **Note:** This method mutates `object`.
  14291. *
  14292. * @static
  14293. * @memberOf _
  14294. * @since 4.0.0
  14295. * @category Object
  14296. * @param {Object} object The object to modify.
  14297. * @param {Array|string} path The path of the property to unset.
  14298. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14299. * @example
  14300. *
  14301. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14302. * _.unset(object, 'a[0].b.c');
  14303. * // => true
  14304. *
  14305. * console.log(object);
  14306. * // => { 'a': [{ 'b': {} }] };
  14307. *
  14308. * _.unset(object, ['a', '0', 'b', 'c']);
  14309. * // => true
  14310. *
  14311. * console.log(object);
  14312. * // => { 'a': [{ 'b': {} }] };
  14313. */
  14314. function unset(object, path) {
  14315. return object == null ? true : baseUnset(object, path);
  14316. }
  14317. /**
  14318. * This method is like `_.set` except that accepts `updater` to produce the
  14319. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14320. * is invoked with one argument: (value).
  14321. *
  14322. * **Note:** This method mutates `object`.
  14323. *
  14324. * @static
  14325. * @memberOf _
  14326. * @since 4.6.0
  14327. * @category Object
  14328. * @param {Object} object The object to modify.
  14329. * @param {Array|string} path The path of the property to set.
  14330. * @param {Function} updater The function to produce the updated value.
  14331. * @returns {Object} Returns `object`.
  14332. * @example
  14333. *
  14334. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14335. *
  14336. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14337. * console.log(object.a[0].b.c);
  14338. * // => 9
  14339. *
  14340. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14341. * console.log(object.x[0].y.z);
  14342. * // => 0
  14343. */
  14344. function update(object, path, updater) {
  14345. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14346. }
  14347. /**
  14348. * This method is like `_.update` except that it accepts `customizer` which is
  14349. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14350. * path creation is handled by the method instead. The `customizer` is invoked
  14351. * with three arguments: (nsValue, key, nsObject).
  14352. *
  14353. * **Note:** This method mutates `object`.
  14354. *
  14355. * @static
  14356. * @memberOf _
  14357. * @since 4.6.0
  14358. * @category Object
  14359. * @param {Object} object The object to modify.
  14360. * @param {Array|string} path The path of the property to set.
  14361. * @param {Function} updater The function to produce the updated value.
  14362. * @param {Function} [customizer] The function to customize assigned values.
  14363. * @returns {Object} Returns `object`.
  14364. * @example
  14365. *
  14366. * var object = {};
  14367. *
  14368. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14369. * // => { '0': { '1': 'a' } }
  14370. */
  14371. function updateWith(object, path, updater, customizer) {
  14372. customizer = typeof customizer == 'function' ? customizer : undefined;
  14373. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14374. }
  14375. /**
  14376. * Creates an array of the own enumerable string keyed property values of `object`.
  14377. *
  14378. * **Note:** Non-object values are coerced to objects.
  14379. *
  14380. * @static
  14381. * @since 0.1.0
  14382. * @memberOf _
  14383. * @category Object
  14384. * @param {Object} object The object to query.
  14385. * @returns {Array} Returns the array of property values.
  14386. * @example
  14387. *
  14388. * function Foo() {
  14389. * this.a = 1;
  14390. * this.b = 2;
  14391. * }
  14392. *
  14393. * Foo.prototype.c = 3;
  14394. *
  14395. * _.values(new Foo);
  14396. * // => [1, 2] (iteration order is not guaranteed)
  14397. *
  14398. * _.values('hi');
  14399. * // => ['h', 'i']
  14400. */
  14401. function values(object) {
  14402. return object == null ? [] : baseValues(object, keys(object));
  14403. }
  14404. /**
  14405. * Creates an array of the own and inherited enumerable string keyed property
  14406. * values of `object`.
  14407. *
  14408. * **Note:** Non-object values are coerced to objects.
  14409. *
  14410. * @static
  14411. * @memberOf _
  14412. * @since 3.0.0
  14413. * @category Object
  14414. * @param {Object} object The object to query.
  14415. * @returns {Array} Returns the array of property values.
  14416. * @example
  14417. *
  14418. * function Foo() {
  14419. * this.a = 1;
  14420. * this.b = 2;
  14421. * }
  14422. *
  14423. * Foo.prototype.c = 3;
  14424. *
  14425. * _.valuesIn(new Foo);
  14426. * // => [1, 2, 3] (iteration order is not guaranteed)
  14427. */
  14428. function valuesIn(object) {
  14429. return object == null ? [] : baseValues(object, keysIn(object));
  14430. }
  14431. /*------------------------------------------------------------------------*/
  14432. /**
  14433. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14434. *
  14435. * @static
  14436. * @memberOf _
  14437. * @since 4.0.0
  14438. * @category Number
  14439. * @param {number} number The number to clamp.
  14440. * @param {number} [lower] The lower bound.
  14441. * @param {number} upper The upper bound.
  14442. * @returns {number} Returns the clamped number.
  14443. * @example
  14444. *
  14445. * _.clamp(-10, -5, 5);
  14446. * // => -5
  14447. *
  14448. * _.clamp(10, -5, 5);
  14449. * // => 5
  14450. */
  14451. function clamp(number, lower, upper) {
  14452. if (upper === undefined) {
  14453. upper = lower;
  14454. lower = undefined;
  14455. }
  14456. if (upper !== undefined) {
  14457. upper = toNumber(upper);
  14458. upper = upper === upper ? upper : 0;
  14459. }
  14460. if (lower !== undefined) {
  14461. lower = toNumber(lower);
  14462. lower = lower === lower ? lower : 0;
  14463. }
  14464. return baseClamp(toNumber(number), lower, upper);
  14465. }
  14466. /**
  14467. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14468. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14469. * If `start` is greater than `end` the params are swapped to support
  14470. * negative ranges.
  14471. *
  14472. * @static
  14473. * @memberOf _
  14474. * @since 3.3.0
  14475. * @category Number
  14476. * @param {number} number The number to check.
  14477. * @param {number} [start=0] The start of the range.
  14478. * @param {number} end The end of the range.
  14479. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14480. * @see _.range, _.rangeRight
  14481. * @example
  14482. *
  14483. * _.inRange(3, 2, 4);
  14484. * // => true
  14485. *
  14486. * _.inRange(4, 8);
  14487. * // => true
  14488. *
  14489. * _.inRange(4, 2);
  14490. * // => false
  14491. *
  14492. * _.inRange(2, 2);
  14493. * // => false
  14494. *
  14495. * _.inRange(1.2, 2);
  14496. * // => true
  14497. *
  14498. * _.inRange(5.2, 4);
  14499. * // => false
  14500. *
  14501. * _.inRange(-3, -2, -6);
  14502. * // => true
  14503. */
  14504. function inRange(number, start, end) {
  14505. start = toFinite(start);
  14506. if (end === undefined) {
  14507. end = start;
  14508. start = 0;
  14509. } else {
  14510. end = toFinite(end);
  14511. }
  14512. number = toNumber(number);
  14513. return baseInRange(number, start, end);
  14514. }
  14515. /**
  14516. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14517. * If only one argument is provided a number between `0` and the given number
  14518. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14519. * floats, a floating-point number is returned instead of an integer.
  14520. *
  14521. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14522. * floating-point values which can produce unexpected results.
  14523. *
  14524. * @static
  14525. * @memberOf _
  14526. * @since 0.7.0
  14527. * @category Number
  14528. * @param {number} [lower=0] The lower bound.
  14529. * @param {number} [upper=1] The upper bound.
  14530. * @param {boolean} [floating] Specify returning a floating-point number.
  14531. * @returns {number} Returns the random number.
  14532. * @example
  14533. *
  14534. * _.random(0, 5);
  14535. * // => an integer between 0 and 5
  14536. *
  14537. * _.random(5);
  14538. * // => also an integer between 0 and 5
  14539. *
  14540. * _.random(5, true);
  14541. * // => a floating-point number between 0 and 5
  14542. *
  14543. * _.random(1.2, 5.2);
  14544. * // => a floating-point number between 1.2 and 5.2
  14545. */
  14546. function random(lower, upper, floating) {
  14547. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14548. upper = floating = undefined;
  14549. }
  14550. if (floating === undefined) {
  14551. if (typeof upper == 'boolean') {
  14552. floating = upper;
  14553. upper = undefined;
  14554. }
  14555. else if (typeof lower == 'boolean') {
  14556. floating = lower;
  14557. lower = undefined;
  14558. }
  14559. }
  14560. if (lower === undefined && upper === undefined) {
  14561. lower = 0;
  14562. upper = 1;
  14563. }
  14564. else {
  14565. lower = toFinite(lower);
  14566. if (upper === undefined) {
  14567. upper = lower;
  14568. lower = 0;
  14569. } else {
  14570. upper = toFinite(upper);
  14571. }
  14572. }
  14573. if (lower > upper) {
  14574. var temp = lower;
  14575. lower = upper;
  14576. upper = temp;
  14577. }
  14578. if (floating || lower % 1 || upper % 1) {
  14579. var rand = nativeRandom();
  14580. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14581. }
  14582. return baseRandom(lower, upper);
  14583. }
  14584. /*------------------------------------------------------------------------*/
  14585. /**
  14586. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14587. *
  14588. * @static
  14589. * @memberOf _
  14590. * @since 3.0.0
  14591. * @category String
  14592. * @param {string} [string=''] The string to convert.
  14593. * @returns {string} Returns the camel cased string.
  14594. * @example
  14595. *
  14596. * _.camelCase('Foo Bar');
  14597. * // => 'fooBar'
  14598. *
  14599. * _.camelCase('--foo-bar--');
  14600. * // => 'fooBar'
  14601. *
  14602. * _.camelCase('__FOO_BAR__');
  14603. * // => 'fooBar'
  14604. */
  14605. var camelCase = createCompounder(function(result, word, index) {
  14606. word = word.toLowerCase();
  14607. return result + (index ? capitalize(word) : word);
  14608. });
  14609. /**
  14610. * Converts the first character of `string` to upper case and the remaining
  14611. * to lower case.
  14612. *
  14613. * @static
  14614. * @memberOf _
  14615. * @since 3.0.0
  14616. * @category String
  14617. * @param {string} [string=''] The string to capitalize.
  14618. * @returns {string} Returns the capitalized string.
  14619. * @example
  14620. *
  14621. * _.capitalize('FRED');
  14622. * // => 'Fred'
  14623. */
  14624. function capitalize(string) {
  14625. return upperFirst(toString(string).toLowerCase());
  14626. }
  14627. /**
  14628. * Deburrs `string` by converting
  14629. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14630. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14631. * letters to basic Latin letters and removing
  14632. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14633. *
  14634. * @static
  14635. * @memberOf _
  14636. * @since 3.0.0
  14637. * @category String
  14638. * @param {string} [string=''] The string to deburr.
  14639. * @returns {string} Returns the deburred string.
  14640. * @example
  14641. *
  14642. * _.deburr('déjà vu');
  14643. * // => 'deja vu'
  14644. */
  14645. function deburr(string) {
  14646. string = toString(string);
  14647. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14648. }
  14649. /**
  14650. * Checks if `string` ends with the given target string.
  14651. *
  14652. * @static
  14653. * @memberOf _
  14654. * @since 3.0.0
  14655. * @category String
  14656. * @param {string} [string=''] The string to inspect.
  14657. * @param {string} [target] The string to search for.
  14658. * @param {number} [position=string.length] The position to search up to.
  14659. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14660. * else `false`.
  14661. * @example
  14662. *
  14663. * _.endsWith('abc', 'c');
  14664. * // => true
  14665. *
  14666. * _.endsWith('abc', 'b');
  14667. * // => false
  14668. *
  14669. * _.endsWith('abc', 'b', 2);
  14670. * // => true
  14671. */
  14672. function endsWith(string, target, position) {
  14673. string = toString(string);
  14674. target = baseToString(target);
  14675. var length = string.length;
  14676. position = position === undefined
  14677. ? length
  14678. : baseClamp(toInteger(position), 0, length);
  14679. var end = position;
  14680. position -= target.length;
  14681. return position >= 0 && string.slice(position, end) == target;
  14682. }
  14683. /**
  14684. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14685. * corresponding HTML entities.
  14686. *
  14687. * **Note:** No other characters are escaped. To escape additional
  14688. * characters use a third-party library like [_he_](https://mths.be/he).
  14689. *
  14690. * Though the ">" character is escaped for symmetry, characters like
  14691. * ">" and "/" don't need escaping in HTML and have no special meaning
  14692. * unless they're part of a tag or unquoted attribute value. See
  14693. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14694. * (under "semi-related fun fact") for more details.
  14695. *
  14696. * When working with HTML you should always
  14697. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14698. * XSS vectors.
  14699. *
  14700. * @static
  14701. * @since 0.1.0
  14702. * @memberOf _
  14703. * @category String
  14704. * @param {string} [string=''] The string to escape.
  14705. * @returns {string} Returns the escaped string.
  14706. * @example
  14707. *
  14708. * _.escape('fred, barney, & pebbles');
  14709. * // => 'fred, barney, &amp; pebbles'
  14710. */
  14711. function escape(string) {
  14712. string = toString(string);
  14713. return (string && reHasUnescapedHtml.test(string))
  14714. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14715. : string;
  14716. }
  14717. /**
  14718. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14719. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14720. *
  14721. * @static
  14722. * @memberOf _
  14723. * @since 3.0.0
  14724. * @category String
  14725. * @param {string} [string=''] The string to escape.
  14726. * @returns {string} Returns the escaped string.
  14727. * @example
  14728. *
  14729. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14730. * // => '\[lodash\]\(https://lodash\.com/\)'
  14731. */
  14732. function escapeRegExp(string) {
  14733. string = toString(string);
  14734. return (string && reHasRegExpChar.test(string))
  14735. ? string.replace(reRegExpChar, '\\$&')
  14736. : string;
  14737. }
  14738. /**
  14739. * Converts `string` to
  14740. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14741. *
  14742. * @static
  14743. * @memberOf _
  14744. * @since 3.0.0
  14745. * @category String
  14746. * @param {string} [string=''] The string to convert.
  14747. * @returns {string} Returns the kebab cased string.
  14748. * @example
  14749. *
  14750. * _.kebabCase('Foo Bar');
  14751. * // => 'foo-bar'
  14752. *
  14753. * _.kebabCase('fooBar');
  14754. * // => 'foo-bar'
  14755. *
  14756. * _.kebabCase('__FOO_BAR__');
  14757. * // => 'foo-bar'
  14758. */
  14759. var kebabCase = createCompounder(function(result, word, index) {
  14760. return result + (index ? '-' : '') + word.toLowerCase();
  14761. });
  14762. /**
  14763. * Converts `string`, as space separated words, to lower case.
  14764. *
  14765. * @static
  14766. * @memberOf _
  14767. * @since 4.0.0
  14768. * @category String
  14769. * @param {string} [string=''] The string to convert.
  14770. * @returns {string} Returns the lower cased string.
  14771. * @example
  14772. *
  14773. * _.lowerCase('--Foo-Bar--');
  14774. * // => 'foo bar'
  14775. *
  14776. * _.lowerCase('fooBar');
  14777. * // => 'foo bar'
  14778. *
  14779. * _.lowerCase('__FOO_BAR__');
  14780. * // => 'foo bar'
  14781. */
  14782. var lowerCase = createCompounder(function(result, word, index) {
  14783. return result + (index ? ' ' : '') + word.toLowerCase();
  14784. });
  14785. /**
  14786. * Converts the first character of `string` to lower case.
  14787. *
  14788. * @static
  14789. * @memberOf _
  14790. * @since 4.0.0
  14791. * @category String
  14792. * @param {string} [string=''] The string to convert.
  14793. * @returns {string} Returns the converted string.
  14794. * @example
  14795. *
  14796. * _.lowerFirst('Fred');
  14797. * // => 'fred'
  14798. *
  14799. * _.lowerFirst('FRED');
  14800. * // => 'fRED'
  14801. */
  14802. var lowerFirst = createCaseFirst('toLowerCase');
  14803. /**
  14804. * Pads `string` on the left and right sides if it's shorter than `length`.
  14805. * Padding characters are truncated if they can't be evenly divided by `length`.
  14806. *
  14807. * @static
  14808. * @memberOf _
  14809. * @since 3.0.0
  14810. * @category String
  14811. * @param {string} [string=''] The string to pad.
  14812. * @param {number} [length=0] The padding length.
  14813. * @param {string} [chars=' '] The string used as padding.
  14814. * @returns {string} Returns the padded string.
  14815. * @example
  14816. *
  14817. * _.pad('abc', 8);
  14818. * // => ' abc '
  14819. *
  14820. * _.pad('abc', 8, '_-');
  14821. * // => '_-abc_-_'
  14822. *
  14823. * _.pad('abc', 3);
  14824. * // => 'abc'
  14825. */
  14826. function pad(string, length, chars) {
  14827. string = toString(string);
  14828. length = toInteger(length);
  14829. var strLength = length ? stringSize(string) : 0;
  14830. if (!length || strLength >= length) {
  14831. return string;
  14832. }
  14833. var mid = (length - strLength) / 2;
  14834. return (
  14835. createPadding(nativeFloor(mid), chars) +
  14836. string +
  14837. createPadding(nativeCeil(mid), chars)
  14838. );
  14839. }
  14840. /**
  14841. * Pads `string` on the right side if it's shorter than `length`. Padding
  14842. * characters are truncated if they exceed `length`.
  14843. *
  14844. * @static
  14845. * @memberOf _
  14846. * @since 4.0.0
  14847. * @category String
  14848. * @param {string} [string=''] The string to pad.
  14849. * @param {number} [length=0] The padding length.
  14850. * @param {string} [chars=' '] The string used as padding.
  14851. * @returns {string} Returns the padded string.
  14852. * @example
  14853. *
  14854. * _.padEnd('abc', 6);
  14855. * // => 'abc '
  14856. *
  14857. * _.padEnd('abc', 6, '_-');
  14858. * // => 'abc_-_'
  14859. *
  14860. * _.padEnd('abc', 3);
  14861. * // => 'abc'
  14862. */
  14863. function padEnd(string, length, chars) {
  14864. string = toString(string);
  14865. length = toInteger(length);
  14866. var strLength = length ? stringSize(string) : 0;
  14867. return (length && strLength < length)
  14868. ? (string + createPadding(length - strLength, chars))
  14869. : string;
  14870. }
  14871. /**
  14872. * Pads `string` on the left side if it's shorter than `length`. Padding
  14873. * characters are truncated if they exceed `length`.
  14874. *
  14875. * @static
  14876. * @memberOf _
  14877. * @since 4.0.0
  14878. * @category String
  14879. * @param {string} [string=''] The string to pad.
  14880. * @param {number} [length=0] The padding length.
  14881. * @param {string} [chars=' '] The string used as padding.
  14882. * @returns {string} Returns the padded string.
  14883. * @example
  14884. *
  14885. * _.padStart('abc', 6);
  14886. * // => ' abc'
  14887. *
  14888. * _.padStart('abc', 6, '_-');
  14889. * // => '_-_abc'
  14890. *
  14891. * _.padStart('abc', 3);
  14892. * // => 'abc'
  14893. */
  14894. function padStart(string, length, chars) {
  14895. string = toString(string);
  14896. length = toInteger(length);
  14897. var strLength = length ? stringSize(string) : 0;
  14898. return (length && strLength < length)
  14899. ? (createPadding(length - strLength, chars) + string)
  14900. : string;
  14901. }
  14902. /**
  14903. * Converts `string` to an integer of the specified radix. If `radix` is
  14904. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14905. * hexadecimal, in which case a `radix` of `16` is used.
  14906. *
  14907. * **Note:** This method aligns with the
  14908. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14909. *
  14910. * @static
  14911. * @memberOf _
  14912. * @since 1.1.0
  14913. * @category String
  14914. * @param {string} string The string to convert.
  14915. * @param {number} [radix=10] The radix to interpret `value` by.
  14916. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14917. * @returns {number} Returns the converted integer.
  14918. * @example
  14919. *
  14920. * _.parseInt('08');
  14921. * // => 8
  14922. *
  14923. * _.map(['6', '08', '10'], _.parseInt);
  14924. * // => [6, 8, 10]
  14925. */
  14926. function parseInt(string, radix, guard) {
  14927. if (guard || radix == null) {
  14928. radix = 0;
  14929. } else if (radix) {
  14930. radix = +radix;
  14931. }
  14932. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14933. }
  14934. /**
  14935. * Repeats the given string `n` times.
  14936. *
  14937. * @static
  14938. * @memberOf _
  14939. * @since 3.0.0
  14940. * @category String
  14941. * @param {string} [string=''] The string to repeat.
  14942. * @param {number} [n=1] The number of times to repeat the string.
  14943. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14944. * @returns {string} Returns the repeated string.
  14945. * @example
  14946. *
  14947. * _.repeat('*', 3);
  14948. * // => '***'
  14949. *
  14950. * _.repeat('abc', 2);
  14951. * // => 'abcabc'
  14952. *
  14953. * _.repeat('abc', 0);
  14954. * // => ''
  14955. */
  14956. function repeat(string, n, guard) {
  14957. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14958. n = 1;
  14959. } else {
  14960. n = toInteger(n);
  14961. }
  14962. return baseRepeat(toString(string), n);
  14963. }
  14964. /**
  14965. * Replaces matches for `pattern` in `string` with `replacement`.
  14966. *
  14967. * **Note:** This method is based on
  14968. * [`String#replace`](https://mdn.io/String/replace).
  14969. *
  14970. * @static
  14971. * @memberOf _
  14972. * @since 4.0.0
  14973. * @category String
  14974. * @param {string} [string=''] The string to modify.
  14975. * @param {RegExp|string} pattern The pattern to replace.
  14976. * @param {Function|string} replacement The match replacement.
  14977. * @returns {string} Returns the modified string.
  14978. * @example
  14979. *
  14980. * _.replace('Hi Fred', 'Fred', 'Barney');
  14981. * // => 'Hi Barney'
  14982. */
  14983. function replace() {
  14984. var args = arguments,
  14985. string = toString(args[0]);
  14986. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14987. }
  14988. /**
  14989. * Converts `string` to
  14990. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14991. *
  14992. * @static
  14993. * @memberOf _
  14994. * @since 3.0.0
  14995. * @category String
  14996. * @param {string} [string=''] The string to convert.
  14997. * @returns {string} Returns the snake cased string.
  14998. * @example
  14999. *
  15000. * _.snakeCase('Foo Bar');
  15001. * // => 'foo_bar'
  15002. *
  15003. * _.snakeCase('fooBar');
  15004. * // => 'foo_bar'
  15005. *
  15006. * _.snakeCase('--FOO-BAR--');
  15007. * // => 'foo_bar'
  15008. */
  15009. var snakeCase = createCompounder(function(result, word, index) {
  15010. return result + (index ? '_' : '') + word.toLowerCase();
  15011. });
  15012. /**
  15013. * Splits `string` by `separator`.
  15014. *
  15015. * **Note:** This method is based on
  15016. * [`String#split`](https://mdn.io/String/split).
  15017. *
  15018. * @static
  15019. * @memberOf _
  15020. * @since 4.0.0
  15021. * @category String
  15022. * @param {string} [string=''] The string to split.
  15023. * @param {RegExp|string} separator The separator pattern to split by.
  15024. * @param {number} [limit] The length to truncate results to.
  15025. * @returns {Array} Returns the string segments.
  15026. * @example
  15027. *
  15028. * _.split('a-b-c', '-', 2);
  15029. * // => ['a', 'b']
  15030. */
  15031. function split(string, separator, limit) {
  15032. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  15033. separator = limit = undefined;
  15034. }
  15035. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  15036. if (!limit) {
  15037. return [];
  15038. }
  15039. string = toString(string);
  15040. if (string && (
  15041. typeof separator == 'string' ||
  15042. (separator != null && !isRegExp(separator))
  15043. )) {
  15044. separator = baseToString(separator);
  15045. if (!separator && hasUnicode(string)) {
  15046. return castSlice(stringToArray(string), 0, limit);
  15047. }
  15048. }
  15049. return string.split(separator, limit);
  15050. }
  15051. /**
  15052. * Converts `string` to
  15053. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  15054. *
  15055. * @static
  15056. * @memberOf _
  15057. * @since 3.1.0
  15058. * @category String
  15059. * @param {string} [string=''] The string to convert.
  15060. * @returns {string} Returns the start cased string.
  15061. * @example
  15062. *
  15063. * _.startCase('--foo-bar--');
  15064. * // => 'Foo Bar'
  15065. *
  15066. * _.startCase('fooBar');
  15067. * // => 'Foo Bar'
  15068. *
  15069. * _.startCase('__FOO_BAR__');
  15070. * // => 'FOO BAR'
  15071. */
  15072. var startCase = createCompounder(function(result, word, index) {
  15073. return result + (index ? ' ' : '') + upperFirst(word);
  15074. });
  15075. /**
  15076. * Checks if `string` starts with the given target string.
  15077. *
  15078. * @static
  15079. * @memberOf _
  15080. * @since 3.0.0
  15081. * @category String
  15082. * @param {string} [string=''] The string to inspect.
  15083. * @param {string} [target] The string to search for.
  15084. * @param {number} [position=0] The position to search from.
  15085. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15086. * else `false`.
  15087. * @example
  15088. *
  15089. * _.startsWith('abc', 'a');
  15090. * // => true
  15091. *
  15092. * _.startsWith('abc', 'b');
  15093. * // => false
  15094. *
  15095. * _.startsWith('abc', 'b', 1);
  15096. * // => true
  15097. */
  15098. function startsWith(string, target, position) {
  15099. string = toString(string);
  15100. position = position == null
  15101. ? 0
  15102. : baseClamp(toInteger(position), 0, string.length);
  15103. target = baseToString(target);
  15104. return string.slice(position, position + target.length) == target;
  15105. }
  15106. /**
  15107. * Creates a compiled template function that can interpolate data properties
  15108. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15109. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15110. * properties may be accessed as free variables in the template. If a setting
  15111. * object is given, it takes precedence over `_.templateSettings` values.
  15112. *
  15113. * **Note:** In the development build `_.template` utilizes
  15114. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15115. * for easier debugging.
  15116. *
  15117. * For more information on precompiling templates see
  15118. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15119. *
  15120. * For more information on Chrome extension sandboxes see
  15121. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15122. *
  15123. * @static
  15124. * @since 0.1.0
  15125. * @memberOf _
  15126. * @category String
  15127. * @param {string} [string=''] The template string.
  15128. * @param {Object} [options={}] The options object.
  15129. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15130. * The HTML "escape" delimiter.
  15131. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15132. * The "evaluate" delimiter.
  15133. * @param {Object} [options.imports=_.templateSettings.imports]
  15134. * An object to import into the template as free variables.
  15135. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15136. * The "interpolate" delimiter.
  15137. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15138. * The sourceURL of the compiled template.
  15139. * @param {string} [options.variable='obj']
  15140. * The data object variable name.
  15141. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15142. * @returns {Function} Returns the compiled template function.
  15143. * @example
  15144. *
  15145. * // Use the "interpolate" delimiter to create a compiled template.
  15146. * var compiled = _.template('hello <%= user %>!');
  15147. * compiled({ 'user': 'fred' });
  15148. * // => 'hello fred!'
  15149. *
  15150. * // Use the HTML "escape" delimiter to escape data property values.
  15151. * var compiled = _.template('<b><%- value %></b>');
  15152. * compiled({ 'value': '<script>' });
  15153. * // => '<b>&lt;script&gt;</b>'
  15154. *
  15155. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15156. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15157. * compiled({ 'users': ['fred', 'barney'] });
  15158. * // => '<li>fred</li><li>barney</li>'
  15159. *
  15160. * // Use the internal `print` function in "evaluate" delimiters.
  15161. * var compiled = _.template('<% print("hello " + user); %>!');
  15162. * compiled({ 'user': 'barney' });
  15163. * // => 'hello barney!'
  15164. *
  15165. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15166. * // Disable support by replacing the "interpolate" delimiter.
  15167. * var compiled = _.template('hello ${ user }!');
  15168. * compiled({ 'user': 'pebbles' });
  15169. * // => 'hello pebbles!'
  15170. *
  15171. * // Use backslashes to treat delimiters as plain text.
  15172. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15173. * compiled({ 'value': 'ignored' });
  15174. * // => '<%- value %>'
  15175. *
  15176. * // Use the `imports` option to import `jQuery` as `jq`.
  15177. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15178. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15179. * compiled({ 'users': ['fred', 'barney'] });
  15180. * // => '<li>fred</li><li>barney</li>'
  15181. *
  15182. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15183. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15184. * compiled(data);
  15185. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15186. *
  15187. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15188. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15189. * compiled.source;
  15190. * // => function(data) {
  15191. * // var __t, __p = '';
  15192. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15193. * // return __p;
  15194. * // }
  15195. *
  15196. * // Use custom template delimiters.
  15197. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15198. * var compiled = _.template('hello {{ user }}!');
  15199. * compiled({ 'user': 'mustache' });
  15200. * // => 'hello mustache!'
  15201. *
  15202. * // Use the `source` property to inline compiled templates for meaningful
  15203. * // line numbers in error messages and stack traces.
  15204. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15205. * var JST = {\
  15206. * "main": ' + _.template(mainText).source + '\
  15207. * };\
  15208. * ');
  15209. */
  15210. function template(string, options, guard) {
  15211. // Based on John Resig's `tmpl` implementation
  15212. // (http://ejohn.org/blog/javascript-micro-templating/)
  15213. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15214. var settings = lodash.templateSettings;
  15215. if (guard && isIterateeCall(string, options, guard)) {
  15216. options = undefined;
  15217. }
  15218. string = toString(string);
  15219. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15220. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15221. importsKeys = keys(imports),
  15222. importsValues = baseValues(imports, importsKeys);
  15223. var isEscaping,
  15224. isEvaluating,
  15225. index = 0,
  15226. interpolate = options.interpolate || reNoMatch,
  15227. source = "__p += '";
  15228. // Compile the regexp to match each delimiter.
  15229. var reDelimiters = RegExp(
  15230. (options.escape || reNoMatch).source + '|' +
  15231. interpolate.source + '|' +
  15232. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15233. (options.evaluate || reNoMatch).source + '|$'
  15234. , 'g');
  15235. // Use a sourceURL for easier debugging.
  15236. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15237. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15238. // and escape the comment, thus injecting code that gets evaled.
  15239. var sourceURL = '//# sourceURL=' +
  15240. (hasOwnProperty.call(options, 'sourceURL')
  15241. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15242. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15243. ) + '\n';
  15244. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15245. interpolateValue || (interpolateValue = esTemplateValue);
  15246. // Escape characters that can't be included in string literals.
  15247. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15248. // Replace delimiters with snippets.
  15249. if (escapeValue) {
  15250. isEscaping = true;
  15251. source += "' +\n__e(" + escapeValue + ") +\n'";
  15252. }
  15253. if (evaluateValue) {
  15254. isEvaluating = true;
  15255. source += "';\n" + evaluateValue + ";\n__p += '";
  15256. }
  15257. if (interpolateValue) {
  15258. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15259. }
  15260. index = offset + match.length;
  15261. // The JS engine embedded in Adobe products needs `match` returned in
  15262. // order to produce the correct `offset` value.
  15263. return match;
  15264. });
  15265. source += "';\n";
  15266. // If `variable` is not specified wrap a with-statement around the generated
  15267. // code to add the data object to the top of the scope chain.
  15268. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15269. if (!variable) {
  15270. source = 'with (obj) {\n' + source + '\n}\n';
  15271. }
  15272. // Throw an error if a forbidden character was found in `variable`, to prevent
  15273. // potential command injection attacks.
  15274. else if (reForbiddenIdentifierChars.test(variable)) {
  15275. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15276. }
  15277. // Cleanup code by stripping empty strings.
  15278. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15279. .replace(reEmptyStringMiddle, '$1')
  15280. .replace(reEmptyStringTrailing, '$1;');
  15281. // Frame code as the function body.
  15282. source = 'function(' + (variable || 'obj') + ') {\n' +
  15283. (variable
  15284. ? ''
  15285. : 'obj || (obj = {});\n'
  15286. ) +
  15287. "var __t, __p = ''" +
  15288. (isEscaping
  15289. ? ', __e = _.escape'
  15290. : ''
  15291. ) +
  15292. (isEvaluating
  15293. ? ', __j = Array.prototype.join;\n' +
  15294. "function print() { __p += __j.call(arguments, '') }\n"
  15295. : ';\n'
  15296. ) +
  15297. source +
  15298. 'return __p\n}';
  15299. var result = attempt(function() {
  15300. return Function(importsKeys, sourceURL + 'return ' + source)
  15301. .apply(undefined, importsValues);
  15302. });
  15303. // Provide the compiled function's source by its `toString` method or
  15304. // the `source` property as a convenience for inlining compiled templates.
  15305. result.source = source;
  15306. if (isError(result)) {
  15307. throw result;
  15308. }
  15309. return result;
  15310. }
  15311. /**
  15312. * Converts `string`, as a whole, to lower case just like
  15313. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15314. *
  15315. * @static
  15316. * @memberOf _
  15317. * @since 4.0.0
  15318. * @category String
  15319. * @param {string} [string=''] The string to convert.
  15320. * @returns {string} Returns the lower cased string.
  15321. * @example
  15322. *
  15323. * _.toLower('--Foo-Bar--');
  15324. * // => '--foo-bar--'
  15325. *
  15326. * _.toLower('fooBar');
  15327. * // => 'foobar'
  15328. *
  15329. * _.toLower('__FOO_BAR__');
  15330. * // => '__foo_bar__'
  15331. */
  15332. function toLower(value) {
  15333. return toString(value).toLowerCase();
  15334. }
  15335. /**
  15336. * Converts `string`, as a whole, to upper case just like
  15337. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15338. *
  15339. * @static
  15340. * @memberOf _
  15341. * @since 4.0.0
  15342. * @category String
  15343. * @param {string} [string=''] The string to convert.
  15344. * @returns {string} Returns the upper cased string.
  15345. * @example
  15346. *
  15347. * _.toUpper('--foo-bar--');
  15348. * // => '--FOO-BAR--'
  15349. *
  15350. * _.toUpper('fooBar');
  15351. * // => 'FOOBAR'
  15352. *
  15353. * _.toUpper('__foo_bar__');
  15354. * // => '__FOO_BAR__'
  15355. */
  15356. function toUpper(value) {
  15357. return toString(value).toUpperCase();
  15358. }
  15359. /**
  15360. * Removes leading and trailing whitespace or specified characters from `string`.
  15361. *
  15362. * @static
  15363. * @memberOf _
  15364. * @since 3.0.0
  15365. * @category String
  15366. * @param {string} [string=''] The string to trim.
  15367. * @param {string} [chars=whitespace] The characters to trim.
  15368. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15369. * @returns {string} Returns the trimmed string.
  15370. * @example
  15371. *
  15372. * _.trim(' abc ');
  15373. * // => 'abc'
  15374. *
  15375. * _.trim('-_-abc-_-', '_-');
  15376. * // => 'abc'
  15377. *
  15378. * _.map([' foo ', ' bar '], _.trim);
  15379. * // => ['foo', 'bar']
  15380. */
  15381. function trim(string, chars, guard) {
  15382. string = toString(string);
  15383. if (string && (guard || chars === undefined)) {
  15384. return baseTrim(string);
  15385. }
  15386. if (!string || !(chars = baseToString(chars))) {
  15387. return string;
  15388. }
  15389. var strSymbols = stringToArray(string),
  15390. chrSymbols = stringToArray(chars),
  15391. start = charsStartIndex(strSymbols, chrSymbols),
  15392. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15393. return castSlice(strSymbols, start, end).join('');
  15394. }
  15395. /**
  15396. * Removes trailing whitespace or specified characters from `string`.
  15397. *
  15398. * @static
  15399. * @memberOf _
  15400. * @since 4.0.0
  15401. * @category String
  15402. * @param {string} [string=''] The string to trim.
  15403. * @param {string} [chars=whitespace] The characters to trim.
  15404. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15405. * @returns {string} Returns the trimmed string.
  15406. * @example
  15407. *
  15408. * _.trimEnd(' abc ');
  15409. * // => ' abc'
  15410. *
  15411. * _.trimEnd('-_-abc-_-', '_-');
  15412. * // => '-_-abc'
  15413. */
  15414. function trimEnd(string, chars, guard) {
  15415. string = toString(string);
  15416. if (string && (guard || chars === undefined)) {
  15417. return string.slice(0, trimmedEndIndex(string) + 1);
  15418. }
  15419. if (!string || !(chars = baseToString(chars))) {
  15420. return string;
  15421. }
  15422. var strSymbols = stringToArray(string),
  15423. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15424. return castSlice(strSymbols, 0, end).join('');
  15425. }
  15426. /**
  15427. * Removes leading whitespace or specified characters from `string`.
  15428. *
  15429. * @static
  15430. * @memberOf _
  15431. * @since 4.0.0
  15432. * @category String
  15433. * @param {string} [string=''] The string to trim.
  15434. * @param {string} [chars=whitespace] The characters to trim.
  15435. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15436. * @returns {string} Returns the trimmed string.
  15437. * @example
  15438. *
  15439. * _.trimStart(' abc ');
  15440. * // => 'abc '
  15441. *
  15442. * _.trimStart('-_-abc-_-', '_-');
  15443. * // => 'abc-_-'
  15444. */
  15445. function trimStart(string, chars, guard) {
  15446. string = toString(string);
  15447. if (string && (guard || chars === undefined)) {
  15448. return string.replace(reTrimStart, '');
  15449. }
  15450. if (!string || !(chars = baseToString(chars))) {
  15451. return string;
  15452. }
  15453. var strSymbols = stringToArray(string),
  15454. start = charsStartIndex(strSymbols, stringToArray(chars));
  15455. return castSlice(strSymbols, start).join('');
  15456. }
  15457. /**
  15458. * Truncates `string` if it's longer than the given maximum string length.
  15459. * The last characters of the truncated string are replaced with the omission
  15460. * string which defaults to "...".
  15461. *
  15462. * @static
  15463. * @memberOf _
  15464. * @since 4.0.0
  15465. * @category String
  15466. * @param {string} [string=''] The string to truncate.
  15467. * @param {Object} [options={}] The options object.
  15468. * @param {number} [options.length=30] The maximum string length.
  15469. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15470. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15471. * @returns {string} Returns the truncated string.
  15472. * @example
  15473. *
  15474. * _.truncate('hi-diddly-ho there, neighborino');
  15475. * // => 'hi-diddly-ho there, neighbo...'
  15476. *
  15477. * _.truncate('hi-diddly-ho there, neighborino', {
  15478. * 'length': 24,
  15479. * 'separator': ' '
  15480. * });
  15481. * // => 'hi-diddly-ho there,...'
  15482. *
  15483. * _.truncate('hi-diddly-ho there, neighborino', {
  15484. * 'length': 24,
  15485. * 'separator': /,? +/
  15486. * });
  15487. * // => 'hi-diddly-ho there...'
  15488. *
  15489. * _.truncate('hi-diddly-ho there, neighborino', {
  15490. * 'omission': ' [...]'
  15491. * });
  15492. * // => 'hi-diddly-ho there, neig [...]'
  15493. */
  15494. function truncate(string, options) {
  15495. var length = DEFAULT_TRUNC_LENGTH,
  15496. omission = DEFAULT_TRUNC_OMISSION;
  15497. if (isObject(options)) {
  15498. var separator = 'separator' in options ? options.separator : separator;
  15499. length = 'length' in options ? toInteger(options.length) : length;
  15500. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15501. }
  15502. string = toString(string);
  15503. var strLength = string.length;
  15504. if (hasUnicode(string)) {
  15505. var strSymbols = stringToArray(string);
  15506. strLength = strSymbols.length;
  15507. }
  15508. if (length >= strLength) {
  15509. return string;
  15510. }
  15511. var end = length - stringSize(omission);
  15512. if (end < 1) {
  15513. return omission;
  15514. }
  15515. var result = strSymbols
  15516. ? castSlice(strSymbols, 0, end).join('')
  15517. : string.slice(0, end);
  15518. if (separator === undefined) {
  15519. return result + omission;
  15520. }
  15521. if (strSymbols) {
  15522. end += (result.length - end);
  15523. }
  15524. if (isRegExp(separator)) {
  15525. if (string.slice(end).search(separator)) {
  15526. var match,
  15527. substring = result;
  15528. if (!separator.global) {
  15529. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15530. }
  15531. separator.lastIndex = 0;
  15532. while ((match = separator.exec(substring))) {
  15533. var newEnd = match.index;
  15534. }
  15535. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15536. }
  15537. } else if (string.indexOf(baseToString(separator), end) != end) {
  15538. var index = result.lastIndexOf(separator);
  15539. if (index > -1) {
  15540. result = result.slice(0, index);
  15541. }
  15542. }
  15543. return result + omission;
  15544. }
  15545. /**
  15546. * The inverse of `_.escape`; this method converts the HTML entities
  15547. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15548. * their corresponding characters.
  15549. *
  15550. * **Note:** No other HTML entities are unescaped. To unescape additional
  15551. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15552. *
  15553. * @static
  15554. * @memberOf _
  15555. * @since 0.6.0
  15556. * @category String
  15557. * @param {string} [string=''] The string to unescape.
  15558. * @returns {string} Returns the unescaped string.
  15559. * @example
  15560. *
  15561. * _.unescape('fred, barney, &amp; pebbles');
  15562. * // => 'fred, barney, & pebbles'
  15563. */
  15564. function unescape(string) {
  15565. string = toString(string);
  15566. return (string && reHasEscapedHtml.test(string))
  15567. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15568. : string;
  15569. }
  15570. /**
  15571. * Converts `string`, as space separated words, to upper case.
  15572. *
  15573. * @static
  15574. * @memberOf _
  15575. * @since 4.0.0
  15576. * @category String
  15577. * @param {string} [string=''] The string to convert.
  15578. * @returns {string} Returns the upper cased string.
  15579. * @example
  15580. *
  15581. * _.upperCase('--foo-bar');
  15582. * // => 'FOO BAR'
  15583. *
  15584. * _.upperCase('fooBar');
  15585. * // => 'FOO BAR'
  15586. *
  15587. * _.upperCase('__foo_bar__');
  15588. * // => 'FOO BAR'
  15589. */
  15590. var upperCase = createCompounder(function(result, word, index) {
  15591. return result + (index ? ' ' : '') + word.toUpperCase();
  15592. });
  15593. /**
  15594. * Converts the first character of `string` to upper case.
  15595. *
  15596. * @static
  15597. * @memberOf _
  15598. * @since 4.0.0
  15599. * @category String
  15600. * @param {string} [string=''] The string to convert.
  15601. * @returns {string} Returns the converted string.
  15602. * @example
  15603. *
  15604. * _.upperFirst('fred');
  15605. * // => 'Fred'
  15606. *
  15607. * _.upperFirst('FRED');
  15608. * // => 'FRED'
  15609. */
  15610. var upperFirst = createCaseFirst('toUpperCase');
  15611. /**
  15612. * Splits `string` into an array of its words.
  15613. *
  15614. * @static
  15615. * @memberOf _
  15616. * @since 3.0.0
  15617. * @category String
  15618. * @param {string} [string=''] The string to inspect.
  15619. * @param {RegExp|string} [pattern] The pattern to match words.
  15620. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15621. * @returns {Array} Returns the words of `string`.
  15622. * @example
  15623. *
  15624. * _.words('fred, barney, & pebbles');
  15625. * // => ['fred', 'barney', 'pebbles']
  15626. *
  15627. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15628. * // => ['fred', 'barney', '&', 'pebbles']
  15629. */
  15630. function words(string, pattern, guard) {
  15631. string = toString(string);
  15632. pattern = guard ? undefined : pattern;
  15633. if (pattern === undefined) {
  15634. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15635. }
  15636. return string.match(pattern) || [];
  15637. }
  15638. /*------------------------------------------------------------------------*/
  15639. /**
  15640. * Attempts to invoke `func`, returning either the result or the caught error
  15641. * object. Any additional arguments are provided to `func` when it's invoked.
  15642. *
  15643. * @static
  15644. * @memberOf _
  15645. * @since 3.0.0
  15646. * @category Util
  15647. * @param {Function} func The function to attempt.
  15648. * @param {...*} [args] The arguments to invoke `func` with.
  15649. * @returns {*} Returns the `func` result or error object.
  15650. * @example
  15651. *
  15652. * // Avoid throwing errors for invalid selectors.
  15653. * var elements = _.attempt(function(selector) {
  15654. * return document.querySelectorAll(selector);
  15655. * }, '>_>');
  15656. *
  15657. * if (_.isError(elements)) {
  15658. * elements = [];
  15659. * }
  15660. */
  15661. var attempt = baseRest(function(func, args) {
  15662. try {
  15663. return apply(func, undefined, args);
  15664. } catch (e) {
  15665. return isError(e) ? e : new Error(e);
  15666. }
  15667. });
  15668. /**
  15669. * Binds methods of an object to the object itself, overwriting the existing
  15670. * method.
  15671. *
  15672. * **Note:** This method doesn't set the "length" property of bound functions.
  15673. *
  15674. * @static
  15675. * @since 0.1.0
  15676. * @memberOf _
  15677. * @category Util
  15678. * @param {Object} object The object to bind and assign the bound methods to.
  15679. * @param {...(string|string[])} methodNames The object method names to bind.
  15680. * @returns {Object} Returns `object`.
  15681. * @example
  15682. *
  15683. * var view = {
  15684. * 'label': 'docs',
  15685. * 'click': function() {
  15686. * console.log('clicked ' + this.label);
  15687. * }
  15688. * };
  15689. *
  15690. * _.bindAll(view, ['click']);
  15691. * jQuery(element).on('click', view.click);
  15692. * // => Logs 'clicked docs' when clicked.
  15693. */
  15694. var bindAll = flatRest(function(object, methodNames) {
  15695. arrayEach(methodNames, function(key) {
  15696. key = toKey(key);
  15697. baseAssignValue(object, key, bind(object[key], object));
  15698. });
  15699. return object;
  15700. });
  15701. /**
  15702. * Creates a function that iterates over `pairs` and invokes the corresponding
  15703. * function of the first predicate to return truthy. The predicate-function
  15704. * pairs are invoked with the `this` binding and arguments of the created
  15705. * function.
  15706. *
  15707. * @static
  15708. * @memberOf _
  15709. * @since 4.0.0
  15710. * @category Util
  15711. * @param {Array} pairs The predicate-function pairs.
  15712. * @returns {Function} Returns the new composite function.
  15713. * @example
  15714. *
  15715. * var func = _.cond([
  15716. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15717. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15718. * [_.stubTrue, _.constant('no match')]
  15719. * ]);
  15720. *
  15721. * func({ 'a': 1, 'b': 2 });
  15722. * // => 'matches A'
  15723. *
  15724. * func({ 'a': 0, 'b': 1 });
  15725. * // => 'matches B'
  15726. *
  15727. * func({ 'a': '1', 'b': '2' });
  15728. * // => 'no match'
  15729. */
  15730. function cond(pairs) {
  15731. var length = pairs == null ? 0 : pairs.length,
  15732. toIteratee = getIteratee();
  15733. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15734. if (typeof pair[1] != 'function') {
  15735. throw new TypeError(FUNC_ERROR_TEXT);
  15736. }
  15737. return [toIteratee(pair[0]), pair[1]];
  15738. });
  15739. return baseRest(function(args) {
  15740. var index = -1;
  15741. while (++index < length) {
  15742. var pair = pairs[index];
  15743. if (apply(pair[0], this, args)) {
  15744. return apply(pair[1], this, args);
  15745. }
  15746. }
  15747. });
  15748. }
  15749. /**
  15750. * Creates a function that invokes the predicate properties of `source` with
  15751. * the corresponding property values of a given object, returning `true` if
  15752. * all predicates return truthy, else `false`.
  15753. *
  15754. * **Note:** The created function is equivalent to `_.conformsTo` with
  15755. * `source` partially applied.
  15756. *
  15757. * @static
  15758. * @memberOf _
  15759. * @since 4.0.0
  15760. * @category Util
  15761. * @param {Object} source The object of property predicates to conform to.
  15762. * @returns {Function} Returns the new spec function.
  15763. * @example
  15764. *
  15765. * var objects = [
  15766. * { 'a': 2, 'b': 1 },
  15767. * { 'a': 1, 'b': 2 }
  15768. * ];
  15769. *
  15770. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15771. * // => [{ 'a': 1, 'b': 2 }]
  15772. */
  15773. function conforms(source) {
  15774. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15775. }
  15776. /**
  15777. * Creates a function that returns `value`.
  15778. *
  15779. * @static
  15780. * @memberOf _
  15781. * @since 2.4.0
  15782. * @category Util
  15783. * @param {*} value The value to return from the new function.
  15784. * @returns {Function} Returns the new constant function.
  15785. * @example
  15786. *
  15787. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15788. *
  15789. * console.log(objects);
  15790. * // => [{ 'a': 1 }, { 'a': 1 }]
  15791. *
  15792. * console.log(objects[0] === objects[1]);
  15793. * // => true
  15794. */
  15795. function constant(value) {
  15796. return function() {
  15797. return value;
  15798. };
  15799. }
  15800. /**
  15801. * Checks `value` to determine whether a default value should be returned in
  15802. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15803. * or `undefined`.
  15804. *
  15805. * @static
  15806. * @memberOf _
  15807. * @since 4.14.0
  15808. * @category Util
  15809. * @param {*} value The value to check.
  15810. * @param {*} defaultValue The default value.
  15811. * @returns {*} Returns the resolved value.
  15812. * @example
  15813. *
  15814. * _.defaultTo(1, 10);
  15815. * // => 1
  15816. *
  15817. * _.defaultTo(undefined, 10);
  15818. * // => 10
  15819. */
  15820. function defaultTo(value, defaultValue) {
  15821. return (value == null || value !== value) ? defaultValue : value;
  15822. }
  15823. /**
  15824. * Creates a function that returns the result of invoking the given functions
  15825. * with the `this` binding of the created function, where each successive
  15826. * invocation is supplied the return value of the previous.
  15827. *
  15828. * @static
  15829. * @memberOf _
  15830. * @since 3.0.0
  15831. * @category Util
  15832. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15833. * @returns {Function} Returns the new composite function.
  15834. * @see _.flowRight
  15835. * @example
  15836. *
  15837. * function square(n) {
  15838. * return n * n;
  15839. * }
  15840. *
  15841. * var addSquare = _.flow([_.add, square]);
  15842. * addSquare(1, 2);
  15843. * // => 9
  15844. */
  15845. var flow = createFlow();
  15846. /**
  15847. * This method is like `_.flow` except that it creates a function that
  15848. * invokes the given functions from right to left.
  15849. *
  15850. * @static
  15851. * @since 3.0.0
  15852. * @memberOf _
  15853. * @category Util
  15854. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15855. * @returns {Function} Returns the new composite function.
  15856. * @see _.flow
  15857. * @example
  15858. *
  15859. * function square(n) {
  15860. * return n * n;
  15861. * }
  15862. *
  15863. * var addSquare = _.flowRight([square, _.add]);
  15864. * addSquare(1, 2);
  15865. * // => 9
  15866. */
  15867. var flowRight = createFlow(true);
  15868. /**
  15869. * This method returns the first argument it receives.
  15870. *
  15871. * @static
  15872. * @since 0.1.0
  15873. * @memberOf _
  15874. * @category Util
  15875. * @param {*} value Any value.
  15876. * @returns {*} Returns `value`.
  15877. * @example
  15878. *
  15879. * var object = { 'a': 1 };
  15880. *
  15881. * console.log(_.identity(object) === object);
  15882. * // => true
  15883. */
  15884. function identity(value) {
  15885. return value;
  15886. }
  15887. /**
  15888. * Creates a function that invokes `func` with the arguments of the created
  15889. * function. If `func` is a property name, the created function returns the
  15890. * property value for a given element. If `func` is an array or object, the
  15891. * created function returns `true` for elements that contain the equivalent
  15892. * source properties, otherwise it returns `false`.
  15893. *
  15894. * @static
  15895. * @since 4.0.0
  15896. * @memberOf _
  15897. * @category Util
  15898. * @param {*} [func=_.identity] The value to convert to a callback.
  15899. * @returns {Function} Returns the callback.
  15900. * @example
  15901. *
  15902. * var users = [
  15903. * { 'user': 'barney', 'age': 36, 'active': true },
  15904. * { 'user': 'fred', 'age': 40, 'active': false }
  15905. * ];
  15906. *
  15907. * // The `_.matches` iteratee shorthand.
  15908. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15909. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15910. *
  15911. * // The `_.matchesProperty` iteratee shorthand.
  15912. * _.filter(users, _.iteratee(['user', 'fred']));
  15913. * // => [{ 'user': 'fred', 'age': 40 }]
  15914. *
  15915. * // The `_.property` iteratee shorthand.
  15916. * _.map(users, _.iteratee('user'));
  15917. * // => ['barney', 'fred']
  15918. *
  15919. * // Create custom iteratee shorthands.
  15920. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15921. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15922. * return func.test(string);
  15923. * };
  15924. * });
  15925. *
  15926. * _.filter(['abc', 'def'], /ef/);
  15927. * // => ['def']
  15928. */
  15929. function iteratee(func) {
  15930. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15931. }
  15932. /**
  15933. * Creates a function that performs a partial deep comparison between a given
  15934. * object and `source`, returning `true` if the given object has equivalent
  15935. * property values, else `false`.
  15936. *
  15937. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15938. * partially applied.
  15939. *
  15940. * Partial comparisons will match empty array and empty object `source`
  15941. * values against any array or object value, respectively. See `_.isEqual`
  15942. * for a list of supported value comparisons.
  15943. *
  15944. * **Note:** Multiple values can be checked by combining several matchers
  15945. * using `_.overSome`
  15946. *
  15947. * @static
  15948. * @memberOf _
  15949. * @since 3.0.0
  15950. * @category Util
  15951. * @param {Object} source The object of property values to match.
  15952. * @returns {Function} Returns the new spec function.
  15953. * @example
  15954. *
  15955. * var objects = [
  15956. * { 'a': 1, 'b': 2, 'c': 3 },
  15957. * { 'a': 4, 'b': 5, 'c': 6 }
  15958. * ];
  15959. *
  15960. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15961. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15962. *
  15963. * // Checking for several possible values
  15964. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15965. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15966. */
  15967. function matches(source) {
  15968. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15969. }
  15970. /**
  15971. * Creates a function that performs a partial deep comparison between the
  15972. * value at `path` of a given object to `srcValue`, returning `true` if the
  15973. * object value is equivalent, else `false`.
  15974. *
  15975. * **Note:** Partial comparisons will match empty array and empty object
  15976. * `srcValue` values against any array or object value, respectively. See
  15977. * `_.isEqual` for a list of supported value comparisons.
  15978. *
  15979. * **Note:** Multiple values can be checked by combining several matchers
  15980. * using `_.overSome`
  15981. *
  15982. * @static
  15983. * @memberOf _
  15984. * @since 3.2.0
  15985. * @category Util
  15986. * @param {Array|string} path The path of the property to get.
  15987. * @param {*} srcValue The value to match.
  15988. * @returns {Function} Returns the new spec function.
  15989. * @example
  15990. *
  15991. * var objects = [
  15992. * { 'a': 1, 'b': 2, 'c': 3 },
  15993. * { 'a': 4, 'b': 5, 'c': 6 }
  15994. * ];
  15995. *
  15996. * _.find(objects, _.matchesProperty('a', 4));
  15997. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15998. *
  15999. * // Checking for several possible values
  16000. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  16001. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16002. */
  16003. function matchesProperty(path, srcValue) {
  16004. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  16005. }
  16006. /**
  16007. * Creates a function that invokes the method at `path` of a given object.
  16008. * Any additional arguments are provided to the invoked method.
  16009. *
  16010. * @static
  16011. * @memberOf _
  16012. * @since 3.7.0
  16013. * @category Util
  16014. * @param {Array|string} path The path of the method to invoke.
  16015. * @param {...*} [args] The arguments to invoke the method with.
  16016. * @returns {Function} Returns the new invoker function.
  16017. * @example
  16018. *
  16019. * var objects = [
  16020. * { 'a': { 'b': _.constant(2) } },
  16021. * { 'a': { 'b': _.constant(1) } }
  16022. * ];
  16023. *
  16024. * _.map(objects, _.method('a.b'));
  16025. * // => [2, 1]
  16026. *
  16027. * _.map(objects, _.method(['a', 'b']));
  16028. * // => [2, 1]
  16029. */
  16030. var method = baseRest(function(path, args) {
  16031. return function(object) {
  16032. return baseInvoke(object, path, args);
  16033. };
  16034. });
  16035. /**
  16036. * The opposite of `_.method`; this method creates a function that invokes
  16037. * the method at a given path of `object`. Any additional arguments are
  16038. * provided to the invoked method.
  16039. *
  16040. * @static
  16041. * @memberOf _
  16042. * @since 3.7.0
  16043. * @category Util
  16044. * @param {Object} object The object to query.
  16045. * @param {...*} [args] The arguments to invoke the method with.
  16046. * @returns {Function} Returns the new invoker function.
  16047. * @example
  16048. *
  16049. * var array = _.times(3, _.constant),
  16050. * object = { 'a': array, 'b': array, 'c': array };
  16051. *
  16052. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  16053. * // => [2, 0]
  16054. *
  16055. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  16056. * // => [2, 0]
  16057. */
  16058. var methodOf = baseRest(function(object, args) {
  16059. return function(path) {
  16060. return baseInvoke(object, path, args);
  16061. };
  16062. });
  16063. /**
  16064. * Adds all own enumerable string keyed function properties of a source
  16065. * object to the destination object. If `object` is a function, then methods
  16066. * are added to its prototype as well.
  16067. *
  16068. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16069. * avoid conflicts caused by modifying the original.
  16070. *
  16071. * @static
  16072. * @since 0.1.0
  16073. * @memberOf _
  16074. * @category Util
  16075. * @param {Function|Object} [object=lodash] The destination object.
  16076. * @param {Object} source The object of functions to add.
  16077. * @param {Object} [options={}] The options object.
  16078. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16079. * @returns {Function|Object} Returns `object`.
  16080. * @example
  16081. *
  16082. * function vowels(string) {
  16083. * return _.filter(string, function(v) {
  16084. * return /[aeiou]/i.test(v);
  16085. * });
  16086. * }
  16087. *
  16088. * _.mixin({ 'vowels': vowels });
  16089. * _.vowels('fred');
  16090. * // => ['e']
  16091. *
  16092. * _('fred').vowels().value();
  16093. * // => ['e']
  16094. *
  16095. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16096. * _('fred').vowels();
  16097. * // => ['e']
  16098. */
  16099. function mixin(object, source, options) {
  16100. var props = keys(source),
  16101. methodNames = baseFunctions(source, props);
  16102. if (options == null &&
  16103. !(isObject(source) && (methodNames.length || !props.length))) {
  16104. options = source;
  16105. source = object;
  16106. object = this;
  16107. methodNames = baseFunctions(source, keys(source));
  16108. }
  16109. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16110. isFunc = isFunction(object);
  16111. arrayEach(methodNames, function(methodName) {
  16112. var func = source[methodName];
  16113. object[methodName] = func;
  16114. if (isFunc) {
  16115. object.prototype[methodName] = function() {
  16116. var chainAll = this.__chain__;
  16117. if (chain || chainAll) {
  16118. var result = object(this.__wrapped__),
  16119. actions = result.__actions__ = copyArray(this.__actions__);
  16120. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16121. result.__chain__ = chainAll;
  16122. return result;
  16123. }
  16124. return func.apply(object, arrayPush([this.value()], arguments));
  16125. };
  16126. }
  16127. });
  16128. return object;
  16129. }
  16130. /**
  16131. * Reverts the `_` variable to its previous value and returns a reference to
  16132. * the `lodash` function.
  16133. *
  16134. * @static
  16135. * @since 0.1.0
  16136. * @memberOf _
  16137. * @category Util
  16138. * @returns {Function} Returns the `lodash` function.
  16139. * @example
  16140. *
  16141. * var lodash = _.noConflict();
  16142. */
  16143. function noConflict() {
  16144. if (root._ === this) {
  16145. root._ = oldDash;
  16146. }
  16147. return this;
  16148. }
  16149. /**
  16150. * This method returns `undefined`.
  16151. *
  16152. * @static
  16153. * @memberOf _
  16154. * @since 2.3.0
  16155. * @category Util
  16156. * @example
  16157. *
  16158. * _.times(2, _.noop);
  16159. * // => [undefined, undefined]
  16160. */
  16161. function noop() {
  16162. // No operation performed.
  16163. }
  16164. /**
  16165. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16166. * the nth argument from the end is returned.
  16167. *
  16168. * @static
  16169. * @memberOf _
  16170. * @since 4.0.0
  16171. * @category Util
  16172. * @param {number} [n=0] The index of the argument to return.
  16173. * @returns {Function} Returns the new pass-thru function.
  16174. * @example
  16175. *
  16176. * var func = _.nthArg(1);
  16177. * func('a', 'b', 'c', 'd');
  16178. * // => 'b'
  16179. *
  16180. * var func = _.nthArg(-2);
  16181. * func('a', 'b', 'c', 'd');
  16182. * // => 'c'
  16183. */
  16184. function nthArg(n) {
  16185. n = toInteger(n);
  16186. return baseRest(function(args) {
  16187. return baseNth(args, n);
  16188. });
  16189. }
  16190. /**
  16191. * Creates a function that invokes `iteratees` with the arguments it receives
  16192. * and returns their results.
  16193. *
  16194. * @static
  16195. * @memberOf _
  16196. * @since 4.0.0
  16197. * @category Util
  16198. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16199. * The iteratees to invoke.
  16200. * @returns {Function} Returns the new function.
  16201. * @example
  16202. *
  16203. * var func = _.over([Math.max, Math.min]);
  16204. *
  16205. * func(1, 2, 3, 4);
  16206. * // => [4, 1]
  16207. */
  16208. var over = createOver(arrayMap);
  16209. /**
  16210. * Creates a function that checks if **all** of the `predicates` return
  16211. * truthy when invoked with the arguments it receives.
  16212. *
  16213. * Following shorthands are possible for providing predicates.
  16214. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16215. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16216. *
  16217. * @static
  16218. * @memberOf _
  16219. * @since 4.0.0
  16220. * @category Util
  16221. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16222. * The predicates to check.
  16223. * @returns {Function} Returns the new function.
  16224. * @example
  16225. *
  16226. * var func = _.overEvery([Boolean, isFinite]);
  16227. *
  16228. * func('1');
  16229. * // => true
  16230. *
  16231. * func(null);
  16232. * // => false
  16233. *
  16234. * func(NaN);
  16235. * // => false
  16236. */
  16237. var overEvery = createOver(arrayEvery);
  16238. /**
  16239. * Creates a function that checks if **any** of the `predicates` return
  16240. * truthy when invoked with the arguments it receives.
  16241. *
  16242. * Following shorthands are possible for providing predicates.
  16243. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16244. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16245. *
  16246. * @static
  16247. * @memberOf _
  16248. * @since 4.0.0
  16249. * @category Util
  16250. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16251. * The predicates to check.
  16252. * @returns {Function} Returns the new function.
  16253. * @example
  16254. *
  16255. * var func = _.overSome([Boolean, isFinite]);
  16256. *
  16257. * func('1');
  16258. * // => true
  16259. *
  16260. * func(null);
  16261. * // => true
  16262. *
  16263. * func(NaN);
  16264. * // => false
  16265. *
  16266. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16267. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16268. */
  16269. var overSome = createOver(arraySome);
  16270. /**
  16271. * Creates a function that returns the value at `path` of a given object.
  16272. *
  16273. * @static
  16274. * @memberOf _
  16275. * @since 2.4.0
  16276. * @category Util
  16277. * @param {Array|string} path The path of the property to get.
  16278. * @returns {Function} Returns the new accessor function.
  16279. * @example
  16280. *
  16281. * var objects = [
  16282. * { 'a': { 'b': 2 } },
  16283. * { 'a': { 'b': 1 } }
  16284. * ];
  16285. *
  16286. * _.map(objects, _.property('a.b'));
  16287. * // => [2, 1]
  16288. *
  16289. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16290. * // => [1, 2]
  16291. */
  16292. function property(path) {
  16293. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16294. }
  16295. /**
  16296. * The opposite of `_.property`; this method creates a function that returns
  16297. * the value at a given path of `object`.
  16298. *
  16299. * @static
  16300. * @memberOf _
  16301. * @since 3.0.0
  16302. * @category Util
  16303. * @param {Object} object The object to query.
  16304. * @returns {Function} Returns the new accessor function.
  16305. * @example
  16306. *
  16307. * var array = [0, 1, 2],
  16308. * object = { 'a': array, 'b': array, 'c': array };
  16309. *
  16310. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16311. * // => [2, 0]
  16312. *
  16313. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16314. * // => [2, 0]
  16315. */
  16316. function propertyOf(object) {
  16317. return function(path) {
  16318. return object == null ? undefined : baseGet(object, path);
  16319. };
  16320. }
  16321. /**
  16322. * Creates an array of numbers (positive and/or negative) progressing from
  16323. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16324. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16325. * it's set to `start` with `start` then set to `0`.
  16326. *
  16327. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16328. * floating-point values which can produce unexpected results.
  16329. *
  16330. * @static
  16331. * @since 0.1.0
  16332. * @memberOf _
  16333. * @category Util
  16334. * @param {number} [start=0] The start of the range.
  16335. * @param {number} end The end of the range.
  16336. * @param {number} [step=1] The value to increment or decrement by.
  16337. * @returns {Array} Returns the range of numbers.
  16338. * @see _.inRange, _.rangeRight
  16339. * @example
  16340. *
  16341. * _.range(4);
  16342. * // => [0, 1, 2, 3]
  16343. *
  16344. * _.range(-4);
  16345. * // => [0, -1, -2, -3]
  16346. *
  16347. * _.range(1, 5);
  16348. * // => [1, 2, 3, 4]
  16349. *
  16350. * _.range(0, 20, 5);
  16351. * // => [0, 5, 10, 15]
  16352. *
  16353. * _.range(0, -4, -1);
  16354. * // => [0, -1, -2, -3]
  16355. *
  16356. * _.range(1, 4, 0);
  16357. * // => [1, 1, 1]
  16358. *
  16359. * _.range(0);
  16360. * // => []
  16361. */
  16362. var range = createRange();
  16363. /**
  16364. * This method is like `_.range` except that it populates values in
  16365. * descending order.
  16366. *
  16367. * @static
  16368. * @memberOf _
  16369. * @since 4.0.0
  16370. * @category Util
  16371. * @param {number} [start=0] The start of the range.
  16372. * @param {number} end The end of the range.
  16373. * @param {number} [step=1] The value to increment or decrement by.
  16374. * @returns {Array} Returns the range of numbers.
  16375. * @see _.inRange, _.range
  16376. * @example
  16377. *
  16378. * _.rangeRight(4);
  16379. * // => [3, 2, 1, 0]
  16380. *
  16381. * _.rangeRight(-4);
  16382. * // => [-3, -2, -1, 0]
  16383. *
  16384. * _.rangeRight(1, 5);
  16385. * // => [4, 3, 2, 1]
  16386. *
  16387. * _.rangeRight(0, 20, 5);
  16388. * // => [15, 10, 5, 0]
  16389. *
  16390. * _.rangeRight(0, -4, -1);
  16391. * // => [-3, -2, -1, 0]
  16392. *
  16393. * _.rangeRight(1, 4, 0);
  16394. * // => [1, 1, 1]
  16395. *
  16396. * _.rangeRight(0);
  16397. * // => []
  16398. */
  16399. var rangeRight = createRange(true);
  16400. /**
  16401. * This method returns a new empty array.
  16402. *
  16403. * @static
  16404. * @memberOf _
  16405. * @since 4.13.0
  16406. * @category Util
  16407. * @returns {Array} Returns the new empty array.
  16408. * @example
  16409. *
  16410. * var arrays = _.times(2, _.stubArray);
  16411. *
  16412. * console.log(arrays);
  16413. * // => [[], []]
  16414. *
  16415. * console.log(arrays[0] === arrays[1]);
  16416. * // => false
  16417. */
  16418. function stubArray() {
  16419. return [];
  16420. }
  16421. /**
  16422. * This method returns `false`.
  16423. *
  16424. * @static
  16425. * @memberOf _
  16426. * @since 4.13.0
  16427. * @category Util
  16428. * @returns {boolean} Returns `false`.
  16429. * @example
  16430. *
  16431. * _.times(2, _.stubFalse);
  16432. * // => [false, false]
  16433. */
  16434. function stubFalse() {
  16435. return false;
  16436. }
  16437. /**
  16438. * This method returns a new empty object.
  16439. *
  16440. * @static
  16441. * @memberOf _
  16442. * @since 4.13.0
  16443. * @category Util
  16444. * @returns {Object} Returns the new empty object.
  16445. * @example
  16446. *
  16447. * var objects = _.times(2, _.stubObject);
  16448. *
  16449. * console.log(objects);
  16450. * // => [{}, {}]
  16451. *
  16452. * console.log(objects[0] === objects[1]);
  16453. * // => false
  16454. */
  16455. function stubObject() {
  16456. return {};
  16457. }
  16458. /**
  16459. * This method returns an empty string.
  16460. *
  16461. * @static
  16462. * @memberOf _
  16463. * @since 4.13.0
  16464. * @category Util
  16465. * @returns {string} Returns the empty string.
  16466. * @example
  16467. *
  16468. * _.times(2, _.stubString);
  16469. * // => ['', '']
  16470. */
  16471. function stubString() {
  16472. return '';
  16473. }
  16474. /**
  16475. * This method returns `true`.
  16476. *
  16477. * @static
  16478. * @memberOf _
  16479. * @since 4.13.0
  16480. * @category Util
  16481. * @returns {boolean} Returns `true`.
  16482. * @example
  16483. *
  16484. * _.times(2, _.stubTrue);
  16485. * // => [true, true]
  16486. */
  16487. function stubTrue() {
  16488. return true;
  16489. }
  16490. /**
  16491. * Invokes the iteratee `n` times, returning an array of the results of
  16492. * each invocation. The iteratee is invoked with one argument; (index).
  16493. *
  16494. * @static
  16495. * @since 0.1.0
  16496. * @memberOf _
  16497. * @category Util
  16498. * @param {number} n The number of times to invoke `iteratee`.
  16499. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16500. * @returns {Array} Returns the array of results.
  16501. * @example
  16502. *
  16503. * _.times(3, String);
  16504. * // => ['0', '1', '2']
  16505. *
  16506. * _.times(4, _.constant(0));
  16507. * // => [0, 0, 0, 0]
  16508. */
  16509. function times(n, iteratee) {
  16510. n = toInteger(n);
  16511. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16512. return [];
  16513. }
  16514. var index = MAX_ARRAY_LENGTH,
  16515. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16516. iteratee = getIteratee(iteratee);
  16517. n -= MAX_ARRAY_LENGTH;
  16518. var result = baseTimes(length, iteratee);
  16519. while (++index < n) {
  16520. iteratee(index);
  16521. }
  16522. return result;
  16523. }
  16524. /**
  16525. * Converts `value` to a property path array.
  16526. *
  16527. * @static
  16528. * @memberOf _
  16529. * @since 4.0.0
  16530. * @category Util
  16531. * @param {*} value The value to convert.
  16532. * @returns {Array} Returns the new property path array.
  16533. * @example
  16534. *
  16535. * _.toPath('a.b.c');
  16536. * // => ['a', 'b', 'c']
  16537. *
  16538. * _.toPath('a[0].b.c');
  16539. * // => ['a', '0', 'b', 'c']
  16540. */
  16541. function toPath(value) {
  16542. if (isArray(value)) {
  16543. return arrayMap(value, toKey);
  16544. }
  16545. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16546. }
  16547. /**
  16548. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16549. *
  16550. * @static
  16551. * @since 0.1.0
  16552. * @memberOf _
  16553. * @category Util
  16554. * @param {string} [prefix=''] The value to prefix the ID with.
  16555. * @returns {string} Returns the unique ID.
  16556. * @example
  16557. *
  16558. * _.uniqueId('contact_');
  16559. * // => 'contact_104'
  16560. *
  16561. * _.uniqueId();
  16562. * // => '105'
  16563. */
  16564. function uniqueId(prefix) {
  16565. var id = ++idCounter;
  16566. return toString(prefix) + id;
  16567. }
  16568. /*------------------------------------------------------------------------*/
  16569. /**
  16570. * Adds two numbers.
  16571. *
  16572. * @static
  16573. * @memberOf _
  16574. * @since 3.4.0
  16575. * @category Math
  16576. * @param {number} augend The first number in an addition.
  16577. * @param {number} addend The second number in an addition.
  16578. * @returns {number} Returns the total.
  16579. * @example
  16580. *
  16581. * _.add(6, 4);
  16582. * // => 10
  16583. */
  16584. var add = createMathOperation(function(augend, addend) {
  16585. return augend + addend;
  16586. }, 0);
  16587. /**
  16588. * Computes `number` rounded up to `precision`.
  16589. *
  16590. * @static
  16591. * @memberOf _
  16592. * @since 3.10.0
  16593. * @category Math
  16594. * @param {number} number The number to round up.
  16595. * @param {number} [precision=0] The precision to round up to.
  16596. * @returns {number} Returns the rounded up number.
  16597. * @example
  16598. *
  16599. * _.ceil(4.006);
  16600. * // => 5
  16601. *
  16602. * _.ceil(6.004, 2);
  16603. * // => 6.01
  16604. *
  16605. * _.ceil(6040, -2);
  16606. * // => 6100
  16607. */
  16608. var ceil = createRound('ceil');
  16609. /**
  16610. * Divide two numbers.
  16611. *
  16612. * @static
  16613. * @memberOf _
  16614. * @since 4.7.0
  16615. * @category Math
  16616. * @param {number} dividend The first number in a division.
  16617. * @param {number} divisor The second number in a division.
  16618. * @returns {number} Returns the quotient.
  16619. * @example
  16620. *
  16621. * _.divide(6, 4);
  16622. * // => 1.5
  16623. */
  16624. var divide = createMathOperation(function(dividend, divisor) {
  16625. return dividend / divisor;
  16626. }, 1);
  16627. /**
  16628. * Computes `number` rounded down to `precision`.
  16629. *
  16630. * @static
  16631. * @memberOf _
  16632. * @since 3.10.0
  16633. * @category Math
  16634. * @param {number} number The number to round down.
  16635. * @param {number} [precision=0] The precision to round down to.
  16636. * @returns {number} Returns the rounded down number.
  16637. * @example
  16638. *
  16639. * _.floor(4.006);
  16640. * // => 4
  16641. *
  16642. * _.floor(0.046, 2);
  16643. * // => 0.04
  16644. *
  16645. * _.floor(4060, -2);
  16646. * // => 4000
  16647. */
  16648. var floor = createRound('floor');
  16649. /**
  16650. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16651. * `undefined` is returned.
  16652. *
  16653. * @static
  16654. * @since 0.1.0
  16655. * @memberOf _
  16656. * @category Math
  16657. * @param {Array} array The array to iterate over.
  16658. * @returns {*} Returns the maximum value.
  16659. * @example
  16660. *
  16661. * _.max([4, 2, 8, 6]);
  16662. * // => 8
  16663. *
  16664. * _.max([]);
  16665. * // => undefined
  16666. */
  16667. function max(array) {
  16668. return (array && array.length)
  16669. ? baseExtremum(array, identity, baseGt)
  16670. : undefined;
  16671. }
  16672. /**
  16673. * This method is like `_.max` except that it accepts `iteratee` which is
  16674. * invoked for each element in `array` to generate the criterion by which
  16675. * the value is ranked. The iteratee is invoked with one argument: (value).
  16676. *
  16677. * @static
  16678. * @memberOf _
  16679. * @since 4.0.0
  16680. * @category Math
  16681. * @param {Array} array The array to iterate over.
  16682. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16683. * @returns {*} Returns the maximum value.
  16684. * @example
  16685. *
  16686. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16687. *
  16688. * _.maxBy(objects, function(o) { return o.n; });
  16689. * // => { 'n': 2 }
  16690. *
  16691. * // The `_.property` iteratee shorthand.
  16692. * _.maxBy(objects, 'n');
  16693. * // => { 'n': 2 }
  16694. */
  16695. function maxBy(array, iteratee) {
  16696. return (array && array.length)
  16697. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16698. : undefined;
  16699. }
  16700. /**
  16701. * Computes the mean of the values in `array`.
  16702. *
  16703. * @static
  16704. * @memberOf _
  16705. * @since 4.0.0
  16706. * @category Math
  16707. * @param {Array} array The array to iterate over.
  16708. * @returns {number} Returns the mean.
  16709. * @example
  16710. *
  16711. * _.mean([4, 2, 8, 6]);
  16712. * // => 5
  16713. */
  16714. function mean(array) {
  16715. return baseMean(array, identity);
  16716. }
  16717. /**
  16718. * This method is like `_.mean` except that it accepts `iteratee` which is
  16719. * invoked for each element in `array` to generate the value to be averaged.
  16720. * The iteratee is invoked with one argument: (value).
  16721. *
  16722. * @static
  16723. * @memberOf _
  16724. * @since 4.7.0
  16725. * @category Math
  16726. * @param {Array} array The array to iterate over.
  16727. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16728. * @returns {number} Returns the mean.
  16729. * @example
  16730. *
  16731. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16732. *
  16733. * _.meanBy(objects, function(o) { return o.n; });
  16734. * // => 5
  16735. *
  16736. * // The `_.property` iteratee shorthand.
  16737. * _.meanBy(objects, 'n');
  16738. * // => 5
  16739. */
  16740. function meanBy(array, iteratee) {
  16741. return baseMean(array, getIteratee(iteratee, 2));
  16742. }
  16743. /**
  16744. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16745. * `undefined` is returned.
  16746. *
  16747. * @static
  16748. * @since 0.1.0
  16749. * @memberOf _
  16750. * @category Math
  16751. * @param {Array} array The array to iterate over.
  16752. * @returns {*} Returns the minimum value.
  16753. * @example
  16754. *
  16755. * _.min([4, 2, 8, 6]);
  16756. * // => 2
  16757. *
  16758. * _.min([]);
  16759. * // => undefined
  16760. */
  16761. function min(array) {
  16762. return (array && array.length)
  16763. ? baseExtremum(array, identity, baseLt)
  16764. : undefined;
  16765. }
  16766. /**
  16767. * This method is like `_.min` except that it accepts `iteratee` which is
  16768. * invoked for each element in `array` to generate the criterion by which
  16769. * the value is ranked. The iteratee is invoked with one argument: (value).
  16770. *
  16771. * @static
  16772. * @memberOf _
  16773. * @since 4.0.0
  16774. * @category Math
  16775. * @param {Array} array The array to iterate over.
  16776. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16777. * @returns {*} Returns the minimum value.
  16778. * @example
  16779. *
  16780. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16781. *
  16782. * _.minBy(objects, function(o) { return o.n; });
  16783. * // => { 'n': 1 }
  16784. *
  16785. * // The `_.property` iteratee shorthand.
  16786. * _.minBy(objects, 'n');
  16787. * // => { 'n': 1 }
  16788. */
  16789. function minBy(array, iteratee) {
  16790. return (array && array.length)
  16791. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16792. : undefined;
  16793. }
  16794. /**
  16795. * Multiply two numbers.
  16796. *
  16797. * @static
  16798. * @memberOf _
  16799. * @since 4.7.0
  16800. * @category Math
  16801. * @param {number} multiplier The first number in a multiplication.
  16802. * @param {number} multiplicand The second number in a multiplication.
  16803. * @returns {number} Returns the product.
  16804. * @example
  16805. *
  16806. * _.multiply(6, 4);
  16807. * // => 24
  16808. */
  16809. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16810. return multiplier * multiplicand;
  16811. }, 1);
  16812. /**
  16813. * Computes `number` rounded to `precision`.
  16814. *
  16815. * @static
  16816. * @memberOf _
  16817. * @since 3.10.0
  16818. * @category Math
  16819. * @param {number} number The number to round.
  16820. * @param {number} [precision=0] The precision to round to.
  16821. * @returns {number} Returns the rounded number.
  16822. * @example
  16823. *
  16824. * _.round(4.006);
  16825. * // => 4
  16826. *
  16827. * _.round(4.006, 2);
  16828. * // => 4.01
  16829. *
  16830. * _.round(4060, -2);
  16831. * // => 4100
  16832. */
  16833. var round = createRound('round');
  16834. /**
  16835. * Subtract two numbers.
  16836. *
  16837. * @static
  16838. * @memberOf _
  16839. * @since 4.0.0
  16840. * @category Math
  16841. * @param {number} minuend The first number in a subtraction.
  16842. * @param {number} subtrahend The second number in a subtraction.
  16843. * @returns {number} Returns the difference.
  16844. * @example
  16845. *
  16846. * _.subtract(6, 4);
  16847. * // => 2
  16848. */
  16849. var subtract = createMathOperation(function(minuend, subtrahend) {
  16850. return minuend - subtrahend;
  16851. }, 0);
  16852. /**
  16853. * Computes the sum of the values in `array`.
  16854. *
  16855. * @static
  16856. * @memberOf _
  16857. * @since 3.4.0
  16858. * @category Math
  16859. * @param {Array} array The array to iterate over.
  16860. * @returns {number} Returns the sum.
  16861. * @example
  16862. *
  16863. * _.sum([4, 2, 8, 6]);
  16864. * // => 20
  16865. */
  16866. function sum(array) {
  16867. return (array && array.length)
  16868. ? baseSum(array, identity)
  16869. : 0;
  16870. }
  16871. /**
  16872. * This method is like `_.sum` except that it accepts `iteratee` which is
  16873. * invoked for each element in `array` to generate the value to be summed.
  16874. * The iteratee is invoked with one argument: (value).
  16875. *
  16876. * @static
  16877. * @memberOf _
  16878. * @since 4.0.0
  16879. * @category Math
  16880. * @param {Array} array The array to iterate over.
  16881. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16882. * @returns {number} Returns the sum.
  16883. * @example
  16884. *
  16885. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16886. *
  16887. * _.sumBy(objects, function(o) { return o.n; });
  16888. * // => 20
  16889. *
  16890. * // The `_.property` iteratee shorthand.
  16891. * _.sumBy(objects, 'n');
  16892. * // => 20
  16893. */
  16894. function sumBy(array, iteratee) {
  16895. return (array && array.length)
  16896. ? baseSum(array, getIteratee(iteratee, 2))
  16897. : 0;
  16898. }
  16899. /*------------------------------------------------------------------------*/
  16900. // Add methods that return wrapped values in chain sequences.
  16901. lodash.after = after;
  16902. lodash.ary = ary;
  16903. lodash.assign = assign;
  16904. lodash.assignIn = assignIn;
  16905. lodash.assignInWith = assignInWith;
  16906. lodash.assignWith = assignWith;
  16907. lodash.at = at;
  16908. lodash.before = before;
  16909. lodash.bind = bind;
  16910. lodash.bindAll = bindAll;
  16911. lodash.bindKey = bindKey;
  16912. lodash.castArray = castArray;
  16913. lodash.chain = chain;
  16914. lodash.chunk = chunk;
  16915. lodash.compact = compact;
  16916. lodash.concat = concat;
  16917. lodash.cond = cond;
  16918. lodash.conforms = conforms;
  16919. lodash.constant = constant;
  16920. lodash.countBy = countBy;
  16921. lodash.create = create;
  16922. lodash.curry = curry;
  16923. lodash.curryRight = curryRight;
  16924. lodash.debounce = debounce;
  16925. lodash.defaults = defaults;
  16926. lodash.defaultsDeep = defaultsDeep;
  16927. lodash.defer = defer;
  16928. lodash.delay = delay;
  16929. lodash.difference = difference;
  16930. lodash.differenceBy = differenceBy;
  16931. lodash.differenceWith = differenceWith;
  16932. lodash.drop = drop;
  16933. lodash.dropRight = dropRight;
  16934. lodash.dropRightWhile = dropRightWhile;
  16935. lodash.dropWhile = dropWhile;
  16936. lodash.fill = fill;
  16937. lodash.filter = filter;
  16938. lodash.flatMap = flatMap;
  16939. lodash.flatMapDeep = flatMapDeep;
  16940. lodash.flatMapDepth = flatMapDepth;
  16941. lodash.flatten = flatten;
  16942. lodash.flattenDeep = flattenDeep;
  16943. lodash.flattenDepth = flattenDepth;
  16944. lodash.flip = flip;
  16945. lodash.flow = flow;
  16946. lodash.flowRight = flowRight;
  16947. lodash.fromPairs = fromPairs;
  16948. lodash.functions = functions;
  16949. lodash.functionsIn = functionsIn;
  16950. lodash.groupBy = groupBy;
  16951. lodash.initial = initial;
  16952. lodash.intersection = intersection;
  16953. lodash.intersectionBy = intersectionBy;
  16954. lodash.intersectionWith = intersectionWith;
  16955. lodash.invert = invert;
  16956. lodash.invertBy = invertBy;
  16957. lodash.invokeMap = invokeMap;
  16958. lodash.iteratee = iteratee;
  16959. lodash.keyBy = keyBy;
  16960. lodash.keys = keys;
  16961. lodash.keysIn = keysIn;
  16962. lodash.map = map;
  16963. lodash.mapKeys = mapKeys;
  16964. lodash.mapValues = mapValues;
  16965. lodash.matches = matches;
  16966. lodash.matchesProperty = matchesProperty;
  16967. lodash.memoize = memoize;
  16968. lodash.merge = merge;
  16969. lodash.mergeWith = mergeWith;
  16970. lodash.method = method;
  16971. lodash.methodOf = methodOf;
  16972. lodash.mixin = mixin;
  16973. lodash.negate = negate;
  16974. lodash.nthArg = nthArg;
  16975. lodash.omit = omit;
  16976. lodash.omitBy = omitBy;
  16977. lodash.once = once;
  16978. lodash.orderBy = orderBy;
  16979. lodash.over = over;
  16980. lodash.overArgs = overArgs;
  16981. lodash.overEvery = overEvery;
  16982. lodash.overSome = overSome;
  16983. lodash.partial = partial;
  16984. lodash.partialRight = partialRight;
  16985. lodash.partition = partition;
  16986. lodash.pick = pick;
  16987. lodash.pickBy = pickBy;
  16988. lodash.property = property;
  16989. lodash.propertyOf = propertyOf;
  16990. lodash.pull = pull;
  16991. lodash.pullAll = pullAll;
  16992. lodash.pullAllBy = pullAllBy;
  16993. lodash.pullAllWith = pullAllWith;
  16994. lodash.pullAt = pullAt;
  16995. lodash.range = range;
  16996. lodash.rangeRight = rangeRight;
  16997. lodash.rearg = rearg;
  16998. lodash.reject = reject;
  16999. lodash.remove = remove;
  17000. lodash.rest = rest;
  17001. lodash.reverse = reverse;
  17002. lodash.sampleSize = sampleSize;
  17003. lodash.set = set;
  17004. lodash.setWith = setWith;
  17005. lodash.shuffle = shuffle;
  17006. lodash.slice = slice;
  17007. lodash.sortBy = sortBy;
  17008. lodash.sortedUniq = sortedUniq;
  17009. lodash.sortedUniqBy = sortedUniqBy;
  17010. lodash.split = split;
  17011. lodash.spread = spread;
  17012. lodash.tail = tail;
  17013. lodash.take = take;
  17014. lodash.takeRight = takeRight;
  17015. lodash.takeRightWhile = takeRightWhile;
  17016. lodash.takeWhile = takeWhile;
  17017. lodash.tap = tap;
  17018. lodash.throttle = throttle;
  17019. lodash.thru = thru;
  17020. lodash.toArray = toArray;
  17021. lodash.toPairs = toPairs;
  17022. lodash.toPairsIn = toPairsIn;
  17023. lodash.toPath = toPath;
  17024. lodash.toPlainObject = toPlainObject;
  17025. lodash.transform = transform;
  17026. lodash.unary = unary;
  17027. lodash.union = union;
  17028. lodash.unionBy = unionBy;
  17029. lodash.unionWith = unionWith;
  17030. lodash.uniq = uniq;
  17031. lodash.uniqBy = uniqBy;
  17032. lodash.uniqWith = uniqWith;
  17033. lodash.unset = unset;
  17034. lodash.unzip = unzip;
  17035. lodash.unzipWith = unzipWith;
  17036. lodash.update = update;
  17037. lodash.updateWith = updateWith;
  17038. lodash.values = values;
  17039. lodash.valuesIn = valuesIn;
  17040. lodash.without = without;
  17041. lodash.words = words;
  17042. lodash.wrap = wrap;
  17043. lodash.xor = xor;
  17044. lodash.xorBy = xorBy;
  17045. lodash.xorWith = xorWith;
  17046. lodash.zip = zip;
  17047. lodash.zipObject = zipObject;
  17048. lodash.zipObjectDeep = zipObjectDeep;
  17049. lodash.zipWith = zipWith;
  17050. // Add aliases.
  17051. lodash.entries = toPairs;
  17052. lodash.entriesIn = toPairsIn;
  17053. lodash.extend = assignIn;
  17054. lodash.extendWith = assignInWith;
  17055. // Add methods to `lodash.prototype`.
  17056. mixin(lodash, lodash);
  17057. /*------------------------------------------------------------------------*/
  17058. // Add methods that return unwrapped values in chain sequences.
  17059. lodash.add = add;
  17060. lodash.attempt = attempt;
  17061. lodash.camelCase = camelCase;
  17062. lodash.capitalize = capitalize;
  17063. lodash.ceil = ceil;
  17064. lodash.clamp = clamp;
  17065. lodash.clone = clone;
  17066. lodash.cloneDeep = cloneDeep;
  17067. lodash.cloneDeepWith = cloneDeepWith;
  17068. lodash.cloneWith = cloneWith;
  17069. lodash.conformsTo = conformsTo;
  17070. lodash.deburr = deburr;
  17071. lodash.defaultTo = defaultTo;
  17072. lodash.divide = divide;
  17073. lodash.endsWith = endsWith;
  17074. lodash.eq = eq;
  17075. lodash.escape = escape;
  17076. lodash.escapeRegExp = escapeRegExp;
  17077. lodash.every = every;
  17078. lodash.find = find;
  17079. lodash.findIndex = findIndex;
  17080. lodash.findKey = findKey;
  17081. lodash.findLast = findLast;
  17082. lodash.findLastIndex = findLastIndex;
  17083. lodash.findLastKey = findLastKey;
  17084. lodash.floor = floor;
  17085. lodash.forEach = forEach;
  17086. lodash.forEachRight = forEachRight;
  17087. lodash.forIn = forIn;
  17088. lodash.forInRight = forInRight;
  17089. lodash.forOwn = forOwn;
  17090. lodash.forOwnRight = forOwnRight;
  17091. lodash.get = get;
  17092. lodash.gt = gt;
  17093. lodash.gte = gte;
  17094. lodash.has = has;
  17095. lodash.hasIn = hasIn;
  17096. lodash.head = head;
  17097. lodash.identity = identity;
  17098. lodash.includes = includes;
  17099. lodash.indexOf = indexOf;
  17100. lodash.inRange = inRange;
  17101. lodash.invoke = invoke;
  17102. lodash.isArguments = isArguments;
  17103. lodash.isArray = isArray;
  17104. lodash.isArrayBuffer = isArrayBuffer;
  17105. lodash.isArrayLike = isArrayLike;
  17106. lodash.isArrayLikeObject = isArrayLikeObject;
  17107. lodash.isBoolean = isBoolean;
  17108. lodash.isBuffer = isBuffer;
  17109. lodash.isDate = isDate;
  17110. lodash.isElement = isElement;
  17111. lodash.isEmpty = isEmpty;
  17112. lodash.isEqual = isEqual;
  17113. lodash.isEqualWith = isEqualWith;
  17114. lodash.isError = isError;
  17115. lodash.isFinite = isFinite;
  17116. lodash.isFunction = isFunction;
  17117. lodash.isInteger = isInteger;
  17118. lodash.isLength = isLength;
  17119. lodash.isMap = isMap;
  17120. lodash.isMatch = isMatch;
  17121. lodash.isMatchWith = isMatchWith;
  17122. lodash.isNaN = isNaN;
  17123. lodash.isNative = isNative;
  17124. lodash.isNil = isNil;
  17125. lodash.isNull = isNull;
  17126. lodash.isNumber = isNumber;
  17127. lodash.isObject = isObject;
  17128. lodash.isObjectLike = isObjectLike;
  17129. lodash.isPlainObject = isPlainObject;
  17130. lodash.isRegExp = isRegExp;
  17131. lodash.isSafeInteger = isSafeInteger;
  17132. lodash.isSet = isSet;
  17133. lodash.isString = isString;
  17134. lodash.isSymbol = isSymbol;
  17135. lodash.isTypedArray = isTypedArray;
  17136. lodash.isUndefined = isUndefined;
  17137. lodash.isWeakMap = isWeakMap;
  17138. lodash.isWeakSet = isWeakSet;
  17139. lodash.join = join;
  17140. lodash.kebabCase = kebabCase;
  17141. lodash.last = last;
  17142. lodash.lastIndexOf = lastIndexOf;
  17143. lodash.lowerCase = lowerCase;
  17144. lodash.lowerFirst = lowerFirst;
  17145. lodash.lt = lt;
  17146. lodash.lte = lte;
  17147. lodash.max = max;
  17148. lodash.maxBy = maxBy;
  17149. lodash.mean = mean;
  17150. lodash.meanBy = meanBy;
  17151. lodash.min = min;
  17152. lodash.minBy = minBy;
  17153. lodash.stubArray = stubArray;
  17154. lodash.stubFalse = stubFalse;
  17155. lodash.stubObject = stubObject;
  17156. lodash.stubString = stubString;
  17157. lodash.stubTrue = stubTrue;
  17158. lodash.multiply = multiply;
  17159. lodash.nth = nth;
  17160. lodash.noConflict = noConflict;
  17161. lodash.noop = noop;
  17162. lodash.now = now;
  17163. lodash.pad = pad;
  17164. lodash.padEnd = padEnd;
  17165. lodash.padStart = padStart;
  17166. lodash.parseInt = parseInt;
  17167. lodash.random = random;
  17168. lodash.reduce = reduce;
  17169. lodash.reduceRight = reduceRight;
  17170. lodash.repeat = repeat;
  17171. lodash.replace = replace;
  17172. lodash.result = result;
  17173. lodash.round = round;
  17174. lodash.runInContext = runInContext;
  17175. lodash.sample = sample;
  17176. lodash.size = size;
  17177. lodash.snakeCase = snakeCase;
  17178. lodash.some = some;
  17179. lodash.sortedIndex = sortedIndex;
  17180. lodash.sortedIndexBy = sortedIndexBy;
  17181. lodash.sortedIndexOf = sortedIndexOf;
  17182. lodash.sortedLastIndex = sortedLastIndex;
  17183. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17184. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17185. lodash.startCase = startCase;
  17186. lodash.startsWith = startsWith;
  17187. lodash.subtract = subtract;
  17188. lodash.sum = sum;
  17189. lodash.sumBy = sumBy;
  17190. lodash.template = template;
  17191. lodash.times = times;
  17192. lodash.toFinite = toFinite;
  17193. lodash.toInteger = toInteger;
  17194. lodash.toLength = toLength;
  17195. lodash.toLower = toLower;
  17196. lodash.toNumber = toNumber;
  17197. lodash.toSafeInteger = toSafeInteger;
  17198. lodash.toString = toString;
  17199. lodash.toUpper = toUpper;
  17200. lodash.trim = trim;
  17201. lodash.trimEnd = trimEnd;
  17202. lodash.trimStart = trimStart;
  17203. lodash.truncate = truncate;
  17204. lodash.unescape = unescape;
  17205. lodash.uniqueId = uniqueId;
  17206. lodash.upperCase = upperCase;
  17207. lodash.upperFirst = upperFirst;
  17208. // Add aliases.
  17209. lodash.each = forEach;
  17210. lodash.eachRight = forEachRight;
  17211. lodash.first = head;
  17212. mixin(lodash, (function() {
  17213. var source = {};
  17214. baseForOwn(lodash, function(func, methodName) {
  17215. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17216. source[methodName] = func;
  17217. }
  17218. });
  17219. return source;
  17220. }()), { 'chain': false });
  17221. /*------------------------------------------------------------------------*/
  17222. /**
  17223. * The semantic version number.
  17224. *
  17225. * @static
  17226. * @memberOf _
  17227. * @type {string}
  17228. */
  17229. lodash.VERSION = VERSION;
  17230. // Assign default placeholders.
  17231. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17232. lodash[methodName].placeholder = lodash;
  17233. });
  17234. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17235. arrayEach(['drop', 'take'], function(methodName, index) {
  17236. LazyWrapper.prototype[methodName] = function(n) {
  17237. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17238. var result = (this.__filtered__ && !index)
  17239. ? new LazyWrapper(this)
  17240. : this.clone();
  17241. if (result.__filtered__) {
  17242. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17243. } else {
  17244. result.__views__.push({
  17245. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17246. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17247. });
  17248. }
  17249. return result;
  17250. };
  17251. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17252. return this.reverse()[methodName](n).reverse();
  17253. };
  17254. });
  17255. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17256. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17257. var type = index + 1,
  17258. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17259. LazyWrapper.prototype[methodName] = function(iteratee) {
  17260. var result = this.clone();
  17261. result.__iteratees__.push({
  17262. 'iteratee': getIteratee(iteratee, 3),
  17263. 'type': type
  17264. });
  17265. result.__filtered__ = result.__filtered__ || isFilter;
  17266. return result;
  17267. };
  17268. });
  17269. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17270. arrayEach(['head', 'last'], function(methodName, index) {
  17271. var takeName = 'take' + (index ? 'Right' : '');
  17272. LazyWrapper.prototype[methodName] = function() {
  17273. return this[takeName](1).value()[0];
  17274. };
  17275. });
  17276. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17277. arrayEach(['initial', 'tail'], function(methodName, index) {
  17278. var dropName = 'drop' + (index ? '' : 'Right');
  17279. LazyWrapper.prototype[methodName] = function() {
  17280. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17281. };
  17282. });
  17283. LazyWrapper.prototype.compact = function() {
  17284. return this.filter(identity);
  17285. };
  17286. LazyWrapper.prototype.find = function(predicate) {
  17287. return this.filter(predicate).head();
  17288. };
  17289. LazyWrapper.prototype.findLast = function(predicate) {
  17290. return this.reverse().find(predicate);
  17291. };
  17292. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17293. if (typeof path == 'function') {
  17294. return new LazyWrapper(this);
  17295. }
  17296. return this.map(function(value) {
  17297. return baseInvoke(value, path, args);
  17298. });
  17299. });
  17300. LazyWrapper.prototype.reject = function(predicate) {
  17301. return this.filter(negate(getIteratee(predicate)));
  17302. };
  17303. LazyWrapper.prototype.slice = function(start, end) {
  17304. start = toInteger(start);
  17305. var result = this;
  17306. if (result.__filtered__ && (start > 0 || end < 0)) {
  17307. return new LazyWrapper(result);
  17308. }
  17309. if (start < 0) {
  17310. result = result.takeRight(-start);
  17311. } else if (start) {
  17312. result = result.drop(start);
  17313. }
  17314. if (end !== undefined) {
  17315. end = toInteger(end);
  17316. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17317. }
  17318. return result;
  17319. };
  17320. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17321. return this.reverse().takeWhile(predicate).reverse();
  17322. };
  17323. LazyWrapper.prototype.toArray = function() {
  17324. return this.take(MAX_ARRAY_LENGTH);
  17325. };
  17326. // Add `LazyWrapper` methods to `lodash.prototype`.
  17327. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17328. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17329. isTaker = /^(?:head|last)$/.test(methodName),
  17330. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17331. retUnwrapped = isTaker || /^find/.test(methodName);
  17332. if (!lodashFunc) {
  17333. return;
  17334. }
  17335. lodash.prototype[methodName] = function() {
  17336. var value = this.__wrapped__,
  17337. args = isTaker ? [1] : arguments,
  17338. isLazy = value instanceof LazyWrapper,
  17339. iteratee = args[0],
  17340. useLazy = isLazy || isArray(value);
  17341. var interceptor = function(value) {
  17342. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17343. return (isTaker && chainAll) ? result[0] : result;
  17344. };
  17345. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17346. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17347. isLazy = useLazy = false;
  17348. }
  17349. var chainAll = this.__chain__,
  17350. isHybrid = !!this.__actions__.length,
  17351. isUnwrapped = retUnwrapped && !chainAll,
  17352. onlyLazy = isLazy && !isHybrid;
  17353. if (!retUnwrapped && useLazy) {
  17354. value = onlyLazy ? value : new LazyWrapper(this);
  17355. var result = func.apply(value, args);
  17356. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17357. return new LodashWrapper(result, chainAll);
  17358. }
  17359. if (isUnwrapped && onlyLazy) {
  17360. return func.apply(this, args);
  17361. }
  17362. result = this.thru(interceptor);
  17363. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17364. };
  17365. });
  17366. // Add `Array` methods to `lodash.prototype`.
  17367. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17368. var func = arrayProto[methodName],
  17369. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17370. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17371. lodash.prototype[methodName] = function() {
  17372. var args = arguments;
  17373. if (retUnwrapped && !this.__chain__) {
  17374. var value = this.value();
  17375. return func.apply(isArray(value) ? value : [], args);
  17376. }
  17377. return this[chainName](function(value) {
  17378. return func.apply(isArray(value) ? value : [], args);
  17379. });
  17380. };
  17381. });
  17382. // Map minified method names to their real names.
  17383. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17384. var lodashFunc = lodash[methodName];
  17385. if (lodashFunc) {
  17386. var key = lodashFunc.name + '';
  17387. if (!hasOwnProperty.call(realNames, key)) {
  17388. realNames[key] = [];
  17389. }
  17390. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17391. }
  17392. });
  17393. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17394. 'name': 'wrapper',
  17395. 'func': undefined
  17396. }];
  17397. // Add methods to `LazyWrapper`.
  17398. LazyWrapper.prototype.clone = lazyClone;
  17399. LazyWrapper.prototype.reverse = lazyReverse;
  17400. LazyWrapper.prototype.value = lazyValue;
  17401. // Add chain sequence methods to the `lodash` wrapper.
  17402. lodash.prototype.at = wrapperAt;
  17403. lodash.prototype.chain = wrapperChain;
  17404. lodash.prototype.commit = wrapperCommit;
  17405. lodash.prototype.next = wrapperNext;
  17406. lodash.prototype.plant = wrapperPlant;
  17407. lodash.prototype.reverse = wrapperReverse;
  17408. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17409. // Add lazy aliases.
  17410. lodash.prototype.first = lodash.prototype.head;
  17411. if (symIterator) {
  17412. lodash.prototype[symIterator] = wrapperToIterator;
  17413. }
  17414. return lodash;
  17415. });
  17416. /*--------------------------------------------------------------------------*/
  17417. // Export lodash.
  17418. var _ = runInContext();
  17419. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17420. if (true) {
  17421. // Expose Lodash on the global object to prevent errors when Lodash is
  17422. // loaded by a script tag in the presence of an AMD loader.
  17423. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17424. // Use `_.noConflict` to remove Lodash from the global object.
  17425. root._ = _;
  17426. // Define as an anonymous module so, through path mapping, it can be
  17427. // referenced as the "underscore" module.
  17428. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17429. return _;
  17430. }).call(exports, __webpack_require__, exports, module),
  17431. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17432. }
  17433. // Check for `exports` after `define` in case a build optimizer adds it.
  17434. else {}
  17435. }.call(this));
  17436. /***/ }),
  17437. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17438. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17439. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17440. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17441. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17442. "use strict";
  17443. __webpack_require__.r(__webpack_exports__);
  17444. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17445. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17446. /* harmony export */ });
  17447. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17448. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17449. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17450. var options = {};
  17451. options.insert = "head";
  17452. options.singleton = false;
  17453. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17454. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17455. /***/ }),
  17456. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17457. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17458. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17459. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17460. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17461. "use strict";
  17462. __webpack_require__.r(__webpack_exports__);
  17463. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17464. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17465. /* harmony export */ });
  17466. /* 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");
  17467. /* 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__);
  17468. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17469. var options = {};
  17470. options.insert = "head";
  17471. options.singleton = false;
  17472. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17473. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17474. /***/ }),
  17475. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17476. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17477. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17478. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17479. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17480. "use strict";
  17481. __webpack_require__.r(__webpack_exports__);
  17482. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17483. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17484. /* harmony export */ });
  17485. /* harmony import */ var _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");
  17486. /* 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__);
  17487. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17488. var options = {};
  17489. options.insert = "head";
  17490. options.singleton = false;
  17491. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17492. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17493. /***/ }),
  17494. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17495. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17496. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17497. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17498. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17499. "use strict";
  17500. __webpack_require__.r(__webpack_exports__);
  17501. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17502. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17503. /* harmony export */ });
  17504. /* 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");
  17505. /* 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__);
  17506. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17507. var options = {};
  17508. options.insert = "head";
  17509. options.singleton = false;
  17510. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17511. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17512. /***/ }),
  17513. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17514. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17515. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17516. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17517. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17518. "use strict";
  17519. __webpack_require__.r(__webpack_exports__);
  17520. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17521. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17522. /* harmony export */ });
  17523. /* 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");
  17524. /* 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__);
  17525. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17526. var options = {};
  17527. options.insert = "head";
  17528. options.singleton = false;
  17529. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17530. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17531. /***/ }),
  17532. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17533. /*!******************************************************!*\
  17534. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17535. \******************************************************/
  17536. /***/ ((__unused_webpack_module, exports) => {
  17537. "use strict";
  17538. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17539. // runtime helper for setting properties on components
  17540. // in a tree-shakable way
  17541. exports["default"] = (sfc, props) => {
  17542. const target = sfc.__vccOpts || sfc;
  17543. for (const [key, val] of props) {
  17544. target[key] = val;
  17545. }
  17546. return target;
  17547. };
  17548. /***/ }),
  17549. /***/ "./resources/js/components/AppButtonLink.vue":
  17550. /*!***************************************************!*\
  17551. !*** ./resources/js/components/AppButtonLink.vue ***!
  17552. \***************************************************/
  17553. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17554. "use strict";
  17555. __webpack_require__.r(__webpack_exports__);
  17556. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17557. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17558. /* harmony export */ });
  17559. /* harmony import */ var _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");
  17560. /* 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");
  17561. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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");
  17562. ;
  17563. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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"]])
  17564. /* hot reload */
  17565. if (false) {}
  17566. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17567. /***/ }),
  17568. /***/ "./resources/js/components/AppFooter.vue":
  17569. /*!***********************************************!*\
  17570. !*** ./resources/js/components/AppFooter.vue ***!
  17571. \***********************************************/
  17572. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17573. "use strict";
  17574. __webpack_require__.r(__webpack_exports__);
  17575. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17576. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17577. /* harmony export */ });
  17578. /* harmony import */ var _AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true */ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true");
  17579. /* harmony import */ var _AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17580. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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");
  17581. const script = {}
  17582. ;
  17583. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(script, [['render',_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-4ab6097e"],['__file',"resources/js/components/AppFooter.vue"]])
  17584. /* hot reload */
  17585. if (false) {}
  17586. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17587. /***/ }),
  17588. /***/ "./resources/js/components/AppMessage.vue":
  17589. /*!************************************************!*\
  17590. !*** ./resources/js/components/AppMessage.vue ***!
  17591. \************************************************/
  17592. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17593. "use strict";
  17594. __webpack_require__.r(__webpack_exports__);
  17595. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17596. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17597. /* harmony export */ });
  17598. /* harmony import */ var _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");
  17599. /* 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");
  17600. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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");
  17601. ;
  17602. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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"]])
  17603. /* hot reload */
  17604. if (false) {}
  17605. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17606. /***/ }),
  17607. /***/ "./resources/js/components/AppPagination.vue":
  17608. /*!***************************************************!*\
  17609. !*** ./resources/js/components/AppPagination.vue ***!
  17610. \***************************************************/
  17611. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17612. "use strict";
  17613. __webpack_require__.r(__webpack_exports__);
  17614. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17615. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17616. /* harmony export */ });
  17617. /* 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");
  17618. /* 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");
  17619. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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");
  17620. ;
  17621. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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"]])
  17622. /* hot reload */
  17623. if (false) {}
  17624. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17625. /***/ }),
  17626. /***/ "./resources/js/components/AppSidebar.vue":
  17627. /*!************************************************!*\
  17628. !*** ./resources/js/components/AppSidebar.vue ***!
  17629. \************************************************/
  17630. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17631. "use strict";
  17632. __webpack_require__.r(__webpack_exports__);
  17633. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17634. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17635. /* harmony export */ });
  17636. /* harmony import */ var _AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  17637. /* harmony import */ var _AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  17638. /* harmony import */ var _AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17639. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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");
  17640. ;
  17641. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-22a4e926"],['__file',"resources/js/components/AppSidebar.vue"]])
  17642. /* hot reload */
  17643. if (false) {}
  17644. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17645. /***/ }),
  17646. /***/ "./resources/js/components/AppSubSidebar.vue":
  17647. /*!***************************************************!*\
  17648. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17649. \***************************************************/
  17650. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17651. "use strict";
  17652. __webpack_require__.r(__webpack_exports__);
  17653. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17654. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17655. /* harmony export */ });
  17656. /* harmony import */ var _AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  17657. /* harmony import */ var _AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  17658. /* harmony import */ var _AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17659. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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");
  17660. ;
  17661. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0addd9bc"],['__file',"resources/js/components/AppSubSidebar.vue"]])
  17662. /* hot reload */
  17663. if (false) {}
  17664. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17665. /***/ }),
  17666. /***/ "./resources/js/components/AppTopBar.vue":
  17667. /*!***********************************************!*\
  17668. !*** ./resources/js/components/AppTopBar.vue ***!
  17669. \***********************************************/
  17670. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17671. "use strict";
  17672. __webpack_require__.r(__webpack_exports__);
  17673. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17674. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17675. /* harmony export */ });
  17676. /* harmony import */ var _AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  17677. /* harmony import */ var _AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  17678. /* harmony import */ var _AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17679. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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");
  17680. ;
  17681. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-42bf62a4"],['__file',"resources/js/components/AppTopBar.vue"]])
  17682. /* hot reload */
  17683. if (false) {}
  17684. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17685. /***/ }),
  17686. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17687. /*!**************************************************!*\
  17688. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17689. \**************************************************/
  17690. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17691. "use strict";
  17692. __webpack_require__.r(__webpack_exports__);
  17693. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17694. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17695. /* harmony export */ });
  17696. /* harmony import */ var _DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  17697. /* harmony import */ var _DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17698. /* harmony import */ var _DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17699. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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");
  17700. ;
  17701. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-549bf5ac"],['__file',"resources/js/layouts/DashboardLayout.vue"]])
  17702. /* hot reload */
  17703. if (false) {}
  17704. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17705. /***/ }),
  17706. /***/ "./resources/js/pages/topup/Index.vue":
  17707. /*!********************************************!*\
  17708. !*** ./resources/js/pages/topup/Index.vue ***!
  17709. \********************************************/
  17710. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17711. "use strict";
  17712. __webpack_require__.r(__webpack_exports__);
  17713. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17714. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17715. /* harmony export */ });
  17716. /* harmony import */ var _Index_vue_vue_type_template_id_3bf54f8c__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=3bf54f8c */ "./resources/js/pages/topup/Index.vue?vue&type=template&id=3bf54f8c");
  17717. /* 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/topup/Index.vue?vue&type=script&setup=true&lang=js");
  17718. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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");
  17719. ;
  17720. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_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_3bf54f8c__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/topup/Index.vue"]])
  17721. /* hot reload */
  17722. if (false) {}
  17723. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17724. /***/ }),
  17725. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17726. /*!**************************************************************************************!*\
  17727. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17728. \**************************************************************************************/
  17729. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17730. "use strict";
  17731. __webpack_require__.r(__webpack_exports__);
  17732. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17733. /* 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"])
  17734. /* harmony export */ });
  17735. /* 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");
  17736. /***/ }),
  17737. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17738. /*!***********************************************************************************!*\
  17739. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17740. \***********************************************************************************/
  17741. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17742. "use strict";
  17743. __webpack_require__.r(__webpack_exports__);
  17744. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17745. /* 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"])
  17746. /* harmony export */ });
  17747. /* 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");
  17748. /***/ }),
  17749. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17750. /*!**************************************************************************************!*\
  17751. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17752. \**************************************************************************************/
  17753. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17754. "use strict";
  17755. __webpack_require__.r(__webpack_exports__);
  17756. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17757. /* 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"])
  17758. /* harmony export */ });
  17759. /* 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");
  17760. /***/ }),
  17761. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17762. /*!***********************************************************************************!*\
  17763. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17764. \***********************************************************************************/
  17765. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17766. "use strict";
  17767. __webpack_require__.r(__webpack_exports__);
  17768. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17769. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17770. /* harmony export */ });
  17771. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  17772. /***/ }),
  17773. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17774. /*!**************************************************************************************!*\
  17775. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17776. \**************************************************************************************/
  17777. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17778. "use strict";
  17779. __webpack_require__.r(__webpack_exports__);
  17780. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17781. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17782. /* harmony export */ });
  17783. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  17784. /***/ }),
  17785. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17786. /*!**********************************************************************************!*\
  17787. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17788. \**********************************************************************************/
  17789. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17790. "use strict";
  17791. __webpack_require__.r(__webpack_exports__);
  17792. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17793. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17794. /* harmony export */ });
  17795. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  17796. /***/ }),
  17797. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17798. /*!*************************************************************************************!*\
  17799. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17800. \*************************************************************************************/
  17801. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17802. "use strict";
  17803. __webpack_require__.r(__webpack_exports__);
  17804. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17805. /* 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"])
  17806. /* harmony export */ });
  17807. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17808. /***/ }),
  17809. /***/ "./resources/js/pages/topup/Index.vue?vue&type=script&setup=true&lang=js":
  17810. /*!*******************************************************************************!*\
  17811. !*** ./resources/js/pages/topup/Index.vue?vue&type=script&setup=true&lang=js ***!
  17812. \*******************************************************************************/
  17813. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17814. "use strict";
  17815. __webpack_require__.r(__webpack_exports__);
  17816. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17817. /* 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"])
  17818. /* harmony export */ });
  17819. /* 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/topup/Index.vue?vue&type=script&setup=true&lang=js");
  17820. /***/ }),
  17821. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17822. /*!*********************************************************************************!*\
  17823. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17824. \*********************************************************************************/
  17825. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17826. "use strict";
  17827. __webpack_require__.r(__webpack_exports__);
  17828. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17829. /* 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)
  17830. /* harmony export */ });
  17831. /* 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");
  17832. /***/ }),
  17833. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17834. /*!*****************************************************************************************!*\
  17835. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17836. \*****************************************************************************************/
  17837. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17838. "use strict";
  17839. __webpack_require__.r(__webpack_exports__);
  17840. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17841. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17842. /* harmony export */ });
  17843. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true");
  17844. /***/ }),
  17845. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17846. /*!******************************************************************************!*\
  17847. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17848. \******************************************************************************/
  17849. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17850. "use strict";
  17851. __webpack_require__.r(__webpack_exports__);
  17852. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17853. /* 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)
  17854. /* harmony export */ });
  17855. /* 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");
  17856. /***/ }),
  17857. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17858. /*!*********************************************************************************!*\
  17859. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17860. \*********************************************************************************/
  17861. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17862. "use strict";
  17863. __webpack_require__.r(__webpack_exports__);
  17864. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17865. /* 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)
  17866. /* harmony export */ });
  17867. /* 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");
  17868. /***/ }),
  17869. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17870. /*!******************************************************************************************!*\
  17871. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17872. \******************************************************************************************/
  17873. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17874. "use strict";
  17875. __webpack_require__.r(__webpack_exports__);
  17876. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17877. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17878. /* harmony export */ });
  17879. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  17880. /***/ }),
  17881. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17882. /*!*********************************************************************************************!*\
  17883. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17884. \*********************************************************************************************/
  17885. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17886. "use strict";
  17887. __webpack_require__.r(__webpack_exports__);
  17888. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17889. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17890. /* harmony export */ });
  17891. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  17892. /***/ }),
  17893. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17894. /*!*****************************************************************************************!*\
  17895. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17896. \*****************************************************************************************/
  17897. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17898. "use strict";
  17899. __webpack_require__.r(__webpack_exports__);
  17900. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17901. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17902. /* harmony export */ });
  17903. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  17904. /***/ }),
  17905. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17906. /*!********************************************************************************************!*\
  17907. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17908. \********************************************************************************************/
  17909. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17910. "use strict";
  17911. __webpack_require__.r(__webpack_exports__);
  17912. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17913. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17914. /* harmony export */ });
  17915. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  17916. /***/ }),
  17917. /***/ "./resources/js/pages/topup/Index.vue?vue&type=template&id=3bf54f8c":
  17918. /*!**************************************************************************!*\
  17919. !*** ./resources/js/pages/topup/Index.vue?vue&type=template&id=3bf54f8c ***!
  17920. \**************************************************************************/
  17921. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17922. "use strict";
  17923. __webpack_require__.r(__webpack_exports__);
  17924. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17925. /* 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_3bf54f8c__WEBPACK_IMPORTED_MODULE_0__.render)
  17926. /* harmony export */ });
  17927. /* 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_3bf54f8c__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=3bf54f8c */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/topup/Index.vue?vue&type=template&id=3bf54f8c");
  17928. /***/ }),
  17929. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17930. /*!********************************************************************************************************!*\
  17931. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17932. \********************************************************************************************************/
  17933. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17934. "use strict";
  17935. __webpack_require__.r(__webpack_exports__);
  17936. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17937. /***/ }),
  17938. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17939. /*!*********************************************************************************************************!*\
  17940. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17941. \*********************************************************************************************************/
  17942. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17943. "use strict";
  17944. __webpack_require__.r(__webpack_exports__);
  17945. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17946. /***/ }),
  17947. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17948. /*!************************************************************************************************************!*\
  17949. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17950. \************************************************************************************************************/
  17951. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17952. "use strict";
  17953. __webpack_require__.r(__webpack_exports__);
  17954. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17955. /***/ }),
  17956. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17957. /*!********************************************************************************************************!*\
  17958. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17959. \********************************************************************************************************/
  17960. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17961. "use strict";
  17962. __webpack_require__.r(__webpack_exports__);
  17963. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17964. /***/ }),
  17965. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17966. /*!***********************************************************************************************************!*\
  17967. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17968. \***********************************************************************************************************/
  17969. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17970. "use strict";
  17971. __webpack_require__.r(__webpack_exports__);
  17972. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17973. /***/ })
  17974. }]);