resources_js_pages_member_Edit_vue.js 718KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_member_Edit_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/AppDropdown.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/AppDropdown.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 vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. props: {
  15. label: {
  16. type: String,
  17. required: true
  18. },
  19. disabled: {
  20. type: Boolean,
  21. "default": false
  22. },
  23. placeholder: {
  24. type: String,
  25. required: true
  26. },
  27. error: {
  28. type: String,
  29. "default": null
  30. },
  31. optionLabel: {
  32. type: String,
  33. "default": 'label'
  34. },
  35. optionValue: {
  36. type: String,
  37. "default": 'value'
  38. },
  39. optionDisabled: {
  40. type: String,
  41. "default": 'disabled'
  42. },
  43. optionGroupChildren: {
  44. type: String,
  45. "default": null
  46. },
  47. optionGroupLabel: {
  48. type: String,
  49. "default": null
  50. },
  51. options: {
  52. type: Array,
  53. required: true
  54. },
  55. modelValue: null
  56. },
  57. emits: ['update:modelValue'],
  58. setup: function setup(__props, _ref) {
  59. var expose = _ref.expose;
  60. expose();
  61. var props = __props;
  62. var isError = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  63. return props.error ? true : false;
  64. });
  65. var forLabel = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  66. return props.label ? props.label.toLowerCase().replace(/\s+/g, '-') : null;
  67. });
  68. var ariaDescribedbyLabel = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  69. return props.label ? props.label.toLowerCase().replace(/\s+/g, '-') + '-help' : null;
  70. });
  71. var selectedDropdownLabel = function selectedDropdownLabel(value) {
  72. var result = props.options.find(function (option) {
  73. return option[props.optionValue] == value;
  74. });
  75. if (result) {
  76. return result[props.optionLabel];
  77. }
  78. };
  79. var __returned__ = {
  80. props: props,
  81. isError: isError,
  82. forLabel: forLabel,
  83. ariaDescribedbyLabel: ariaDescribedbyLabel,
  84. selectedDropdownLabel: selectedDropdownLabel,
  85. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed
  86. };
  87. Object.defineProperty(__returned__, '__isScriptSetup', {
  88. enumerable: false,
  89. value: true
  90. });
  91. return __returned__;
  92. }
  93. });
  94. /***/ }),
  95. /***/ "./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/AppInputText.vue?vue&type=script&setup=true&lang=js":
  96. /*!*****************************************************************************************************************************************************************************************************************!*\
  97. !*** ./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/AppInputText.vue?vue&type=script&setup=true&lang=js ***!
  98. \*****************************************************************************************************************************************************************************************************************/
  99. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  100. "use strict";
  101. __webpack_require__.r(__webpack_exports__);
  102. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  103. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  104. /* harmony export */ });
  105. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  106. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  107. props: {
  108. label: {
  109. type: String,
  110. required: true
  111. },
  112. disabled: {
  113. type: Boolean,
  114. "default": false
  115. },
  116. placeholder: {
  117. type: String,
  118. required: true
  119. },
  120. error: {
  121. type: String,
  122. "default": null
  123. },
  124. modelValue: null
  125. },
  126. emits: ['update:modelValue'],
  127. setup: function setup(__props, _ref) {
  128. var expose = _ref.expose;
  129. expose();
  130. var props = __props;
  131. var isError = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  132. return props.error ? true : false;
  133. });
  134. var forLabel = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  135. return props.label.toLowerCase().replace(/\s+/g, '-');
  136. });
  137. var ariaDescribedbyLabel = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  138. return props.label.toLowerCase().replace(/\s+/g, '-') + '-help';
  139. });
  140. var __returned__ = {
  141. props: props,
  142. isError: isError,
  143. forLabel: forLabel,
  144. ariaDescribedbyLabel: ariaDescribedbyLabel,
  145. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed
  146. };
  147. Object.defineProperty(__returned__, '__isScriptSetup', {
  148. enumerable: false,
  149. value: true
  150. });
  151. return __returned__;
  152. }
  153. });
  154. /***/ }),
  155. /***/ "./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":
  156. /*!***************************************************************************************************************************************************************************************************************!*\
  157. !*** ./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 ***!
  158. \***************************************************************************************************************************************************************************************************************/
  159. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  160. "use strict";
  161. __webpack_require__.r(__webpack_exports__);
  162. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  163. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  164. /* harmony export */ });
  165. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  166. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  167. setup: function setup(__props, _ref) {
  168. var expose = _ref.expose;
  169. expose();
  170. var onClose = function onClose() {
  171. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  172. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  173. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  174. };
  175. var __returned__ = {
  176. onClose: onClose,
  177. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  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/components/AppSidebar.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/components/AppSidebar.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 _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  198. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  199. props: {
  200. menu: Array
  201. },
  202. setup: function setup(__props, _ref) {
  203. var expose = _ref.expose;
  204. expose();
  205. var __returned__ = {
  206. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  207. };
  208. Object.defineProperty(__returned__, '__isScriptSetup', {
  209. enumerable: false,
  210. value: true
  211. });
  212. return __returned__;
  213. }
  214. });
  215. /***/ }),
  216. /***/ "./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":
  217. /*!******************************************************************************************************************************************************************************************************************!*\
  218. !*** ./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 ***!
  219. \******************************************************************************************************************************************************************************************************************/
  220. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  221. "use strict";
  222. __webpack_require__.r(__webpack_exports__);
  223. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  224. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  225. /* harmony export */ });
  226. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  227. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  228. props: {
  229. items: Array,
  230. root: {
  231. type: Boolean,
  232. "default": false
  233. }
  234. },
  235. setup: function setup(__props, _ref) {
  236. var expose = _ref.expose;
  237. expose();
  238. var __returned__ = {
  239. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  240. };
  241. Object.defineProperty(__returned__, '__isScriptSetup', {
  242. enumerable: false,
  243. value: true
  244. });
  245. return __returned__;
  246. }
  247. });
  248. /***/ }),
  249. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  250. /*!**************************************************************************************************************************************************************************************************************!*\
  251. !*** ./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 ***!
  252. \**************************************************************************************************************************************************************************************************************/
  253. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  254. "use strict";
  255. __webpack_require__.r(__webpack_exports__);
  256. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  257. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  258. /* harmony export */ });
  259. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  260. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  261. emits: ['menu-toggle'],
  262. setup: function setup(__props, _ref) {
  263. var expose = _ref.expose;
  264. expose();
  265. var __returned__ = {
  266. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  267. };
  268. Object.defineProperty(__returned__, '__isScriptSetup', {
  269. enumerable: false,
  270. value: true
  271. });
  272. return __returned__;
  273. }
  274. });
  275. /***/ }),
  276. /***/ "./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":
  277. /*!*****************************************************************************************************************************************************************************************************************!*\
  278. !*** ./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 ***!
  279. \*****************************************************************************************************************************************************************************************************************/
  280. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  281. "use strict";
  282. __webpack_require__.r(__webpack_exports__);
  283. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  284. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  285. /* harmony export */ });
  286. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  287. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  288. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  289. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  290. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  291. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  292. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  293. setup: function setup(__props, _ref) {
  294. var expose = _ref.expose;
  295. expose();
  296. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  297. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  298. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  299. var isDesktop = function isDesktop() {
  300. return window.innerWidth >= 992;
  301. };
  302. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  303. return ['layout-wrapper', {
  304. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  305. 'layout-mobile-sidebar-active': mobileMenuActive.value
  306. }];
  307. });
  308. var onWrapperClick = function onWrapperClick() {
  309. if (!menuClick.value) {
  310. mobileMenuActive.value = false;
  311. }
  312. menuClick.value = false;
  313. };
  314. var onMenuToggle = function onMenuToggle(event) {
  315. menuClick.value = true;
  316. if (isDesktop()) {
  317. staticMenuInactive.value = !staticMenuInactive.value;
  318. } else {
  319. mobileMenuActive.value = !mobileMenuActive.value;
  320. }
  321. event.preventDefault();
  322. };
  323. var __returned__ = {
  324. mobileMenuActive: mobileMenuActive,
  325. staticMenuInactive: staticMenuInactive,
  326. menuClick: menuClick,
  327. isDesktop: isDesktop,
  328. containerClass: containerClass,
  329. onWrapperClick: onWrapperClick,
  330. onMenuToggle: onMenuToggle,
  331. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  332. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  333. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  334. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  335. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  336. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  337. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  338. };
  339. Object.defineProperty(__returned__, '__isScriptSetup', {
  340. enumerable: false,
  341. value: true
  342. });
  343. return __returned__;
  344. }
  345. });
  346. /***/ }),
  347. /***/ "./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/member/Edit.vue?vue&type=script&setup=true&lang=js":
  348. /*!***********************************************************************************************************************************************************************************************************!*\
  349. !*** ./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/member/Edit.vue?vue&type=script&setup=true&lang=js ***!
  350. \***********************************************************************************************************************************************************************************************************/
  351. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  352. "use strict";
  353. __webpack_require__.r(__webpack_exports__);
  354. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  355. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  356. /* harmony export */ });
  357. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  358. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  359. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  360. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
  361. /* harmony import */ var primevue_useconfirm__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! primevue/useconfirm */ "./node_modules/primevue/useconfirm/useconfirm.esm.js");
  362. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/member/tableHeader.js");
  363. /* harmony import */ var _useVehicle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./useVehicle */ "./resources/js/pages/member/useVehicle.js");
  364. /* harmony import */ var _components_useFormErrorReset__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/useFormErrorReset */ "./resources/js/components/useFormErrorReset.js");
  365. /* harmony import */ var _utils_formValidationError__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/utils/formValidationError */ "./resources/js/utils/formValidationError.js");
  366. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  367. /* harmony import */ var _components_AppDropdown_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/components/AppDropdown.vue */ "./resources/js/components/AppDropdown.vue");
  368. /* harmony import */ var _components_AppInputText_vue__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/components/AppInputText.vue */ "./resources/js/components/AppInputText.vue");
  369. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  370. props: {
  371. member: Object,
  372. typeMembers: Array,
  373. typeMember: Object,
  374. initialVehicles: Object
  375. },
  376. setup: function setup(__props, _ref) {
  377. var expose = _ref.expose;
  378. expose();
  379. var props = __props;
  380. var form = (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.useForm)({
  381. name: props.member.name,
  382. phone: null,
  383. plat_number: null,
  384. max_vehicle_id: null,
  385. type_member_id: props.member.typeMemberId
  386. });
  387. (0,_components_useFormErrorReset__WEBPACK_IMPORTED_MODULE_6__.useFormErrorReset)(form);
  388. var _useVehicle = (0,_useVehicle__WEBPACK_IMPORTED_MODULE_5__.useVehicle)(props, form),
  389. listVehicle = _useVehicle.listVehicle,
  390. vehicleOnDelete = _useVehicle.vehicleOnDelete,
  391. vehicleOnAdd = _useVehicle.vehicleOnAdd;
  392. var confirm = (0,primevue_useconfirm__WEBPACK_IMPORTED_MODULE_3__.useConfirm)();
  393. var errorSubmitVisible = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  394. var errorSubmitText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)();
  395. var submitValidation = function submitValidation() {
  396. var listPlatNumberGroup = (0,lodash__WEBPACK_IMPORTED_MODULE_2__.groupBy)(listVehicle, 'typeVehicleId');
  397. var listVehicles = [];
  398. for (var key in listPlatNumberGroup) {
  399. listVehicles.push({
  400. typeVehicleId: listPlatNumberGroup[key][0]['typeVehicleId'],
  401. maxVehicle: listPlatNumberGroup[key][0]['maxVehicle'],
  402. count: listPlatNumberGroup[key].length
  403. });
  404. }
  405. listVehicles.forEach(function (val) {
  406. if (val.count > val.maxVehicle) {
  407. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_7__["default"]('Ada perubahan pada batas maksimal kendaraan');
  408. }
  409. });
  410. };
  411. var formSent = function formSent() {
  412. form.transform(function (data) {
  413. return {
  414. name: data.name,
  415. phone: data.phone,
  416. vehicles: listVehicle,
  417. type_member_id: data.type_member_id
  418. };
  419. }).put(route('members.update', props.member.id));
  420. };
  421. var onSubmit = function onSubmit() {
  422. try {
  423. submitValidation();
  424. if (props.member.typeMemberId != form.type_member_id) {
  425. confirm.require({
  426. message: "Dikenakan tagihan perubahan member sebesar ".concat(props.typeMember.price),
  427. header: 'Tagihan Perubahan Jenis Member',
  428. acceptLabel: 'Bayar dan simpan',
  429. rejectLabel: 'Batalkan',
  430. accept: function accept() {
  431. formSent();
  432. },
  433. reject: function reject() {
  434. confirm.close();
  435. }
  436. });
  437. } else {
  438. formSent();
  439. }
  440. } catch (err) {
  441. errorSubmitVisible.value = true;
  442. errorSubmitText.value = err.message;
  443. }
  444. };
  445. var __returned__ = {
  446. props: props,
  447. form: form,
  448. listVehicle: listVehicle,
  449. vehicleOnDelete: vehicleOnDelete,
  450. vehicleOnAdd: vehicleOnAdd,
  451. confirm: confirm,
  452. errorSubmitVisible: errorSubmitVisible,
  453. errorSubmitText: errorSubmitText,
  454. submitValidation: submitValidation,
  455. formSent: formSent,
  456. onSubmit: onSubmit,
  457. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  458. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.Head,
  459. useForm: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.useForm,
  460. groupBy: lodash__WEBPACK_IMPORTED_MODULE_2__.groupBy,
  461. useConfirm: primevue_useconfirm__WEBPACK_IMPORTED_MODULE_3__.useConfirm,
  462. platNumberTable: _tableHeader__WEBPACK_IMPORTED_MODULE_4__.platNumberTable,
  463. useVehicle: _useVehicle__WEBPACK_IMPORTED_MODULE_5__.useVehicle,
  464. useFormErrorReset: _components_useFormErrorReset__WEBPACK_IMPORTED_MODULE_6__.useFormErrorReset,
  465. FormValidationError: _utils_formValidationError__WEBPACK_IMPORTED_MODULE_7__["default"],
  466. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_8__["default"],
  467. AppDropdown: _components_AppDropdown_vue__WEBPACK_IMPORTED_MODULE_9__["default"],
  468. AppInputText: _components_AppInputText_vue__WEBPACK_IMPORTED_MODULE_10__["default"]
  469. };
  470. Object.defineProperty(__returned__, '__isScriptSetup', {
  471. enumerable: false,
  472. value: true
  473. });
  474. return __returned__;
  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/AppDropdown.vue?vue&type=template&id=ce0d1992":
  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/AppDropdown.vue?vue&type=template&id=ce0d1992 ***!
  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. "class": "field"
  491. };
  492. var _hoisted_2 = ["for"];
  493. var _hoisted_3 = {
  494. key: 0
  495. };
  496. var _hoisted_4 = {
  497. key: 1
  498. };
  499. var _hoisted_5 = ["id"];
  500. function render(_ctx, _cache, $props, $setup, $data, $options) {
  501. var _component_Dropdown = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Dropdown");
  502. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [$props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("label", {
  503. key: 0,
  504. "for": $setup.forLabel
  505. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 9
  506. /* TEXT, PROPS */
  507. , _hoisted_2)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Dropdown, {
  508. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["w-full", {
  509. 'p-invalid': $setup.isError
  510. }]),
  511. id: $setup.forLabel,
  512. "aria-describedby": $setup.ariaDescribedbyLabel,
  513. "option-disabled": $props.optionDisabled,
  514. "option-group-children": $props.optionGroupChildren,
  515. "option-group-label": $props.optionGroupLabel,
  516. "option-label": $props.optionLabel,
  517. "option-value": $props.optionValue,
  518. placeholder: $props.placeholder,
  519. options: $props.options,
  520. "model-value": $props.modelValue,
  521. disabled: $props.disabled,
  522. onChange: _cache[0] || (_cache[0] = function ($event) {
  523. return _ctx.$emit('update:modelValue', $event.value);
  524. })
  525. }, {
  526. value: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (slotProps) {
  527. return [slotProps.value ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_3, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.selectedDropdownLabel(slotProps.value)), 1
  528. /* TEXT */
  529. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(slotProps.placeholder), 1
  530. /* TEXT */
  531. ))];
  532. }),
  533. option: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  534. var option = _ref.option,
  535. index = _ref.index;
  536. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "option", {
  537. option: option,
  538. index: index
  539. })];
  540. }),
  541. _: 3
  542. /* FORWARDED */
  543. }, 8
  544. /* PROPS */
  545. , ["class", "id", "aria-describedby", "option-disabled", "option-group-children", "option-group-label", "option-label", "option-value", "placeholder", "options", "model-value", "disabled"]), $props.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("small", {
  546. key: 1,
  547. id: $setup.ariaDescribedbyLabel,
  548. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)({
  549. 'p-error': $setup.isError
  550. })
  551. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.error), 11
  552. /* TEXT, CLASS, PROPS */
  553. , _hoisted_5)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]);
  554. }
  555. /***/ }),
  556. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  557. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  558. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  559. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  560. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  561. "use strict";
  562. __webpack_require__.r(__webpack_exports__);
  563. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  564. /* harmony export */ "render": () => (/* binding */ render)
  565. /* harmony export */ });
  566. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  567. var _withScopeId = function _withScopeId(n) {
  568. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  569. };
  570. var _hoisted_1 = {
  571. "class": "layout-footer"
  572. };
  573. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  574. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  575. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  576. href: "https://dijitalcode.com",
  577. target: "_blank",
  578. "class": "font-medium ml-2"
  579. }, "DijitalCODE", -1
  580. /* HOISTED */
  581. );
  582. });
  583. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  584. function render(_ctx, _cache) {
  585. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  586. }
  587. /***/ }),
  588. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/AppInputText.vue?vue&type=template&id=16729fe1":
  589. /*!**********************************************************************************************************************************************************************************************************************************************************************************!*\
  590. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/AppInputText.vue?vue&type=template&id=16729fe1 ***!
  591. \**********************************************************************************************************************************************************************************************************************************************************************************/
  592. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  593. "use strict";
  594. __webpack_require__.r(__webpack_exports__);
  595. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  596. /* harmony export */ "render": () => (/* binding */ render)
  597. /* harmony export */ });
  598. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  599. var _hoisted_1 = {
  600. "class": "field"
  601. };
  602. var _hoisted_2 = ["for"];
  603. var _hoisted_3 = ["id"];
  604. function render(_ctx, _cache, $props, $setup, $data, $options) {
  605. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  606. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("label", {
  607. "for": $setup.forLabel
  608. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 9
  609. /* TEXT, PROPS */
  610. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_InputText, {
  611. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["w-full", {
  612. 'p-invalid': $setup.isError
  613. }]),
  614. type: "text",
  615. id: $setup.forLabel,
  616. "aria-describedby": $setup.ariaDescribedbyLabel,
  617. "model-value": $props.modelValue,
  618. placeholder: $props.placeholder,
  619. value: $props.modelValue,
  620. disabled: $props.disabled,
  621. onInput: _cache[0] || (_cache[0] = function ($event) {
  622. return _ctx.$emit('update:modelValue', $event.target.value);
  623. })
  624. }, null, 8
  625. /* PROPS */
  626. , ["class", "id", "aria-describedby", "model-value", "placeholder", "value", "disabled"]), $props.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("small", {
  627. key: 0,
  628. id: $setup.ariaDescribedbyLabel,
  629. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)({
  630. 'p-error': $setup.isError
  631. })
  632. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.error), 11
  633. /* TEXT, CLASS, PROPS */
  634. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]);
  635. }
  636. /***/ }),
  637. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  638. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  639. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  640. \********************************************************************************************************************************************************************************************************************************************************************************/
  641. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  642. "use strict";
  643. __webpack_require__.r(__webpack_exports__);
  644. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  645. /* harmony export */ "render": () => (/* binding */ render)
  646. /* harmony export */ });
  647. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  648. var _hoisted_1 = {
  649. key: 0
  650. };
  651. var _hoisted_2 = {
  652. key: 1
  653. };
  654. function render(_ctx, _cache, $props, $setup, $data, $options) {
  655. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  656. 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, {
  657. key: 0,
  658. severity: "success",
  659. onClose: $setup.onClose
  660. }, {
  661. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  662. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  663. /* TEXT */
  664. )];
  665. }),
  666. _: 1
  667. /* STABLE */
  668. })) : (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, {
  669. key: 1,
  670. severity: "error",
  671. onClose: $setup.onClose
  672. }, {
  673. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  674. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  675. /* TEXT */
  676. )];
  677. }),
  678. _: 1
  679. /* STABLE */
  680. })) : (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, {
  681. key: 2,
  682. severity: "error",
  683. onClose: $setup.onClose
  684. }, {
  685. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  686. 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
  687. /* TEXT */
  688. ))];
  689. }),
  690. _: 1
  691. /* STABLE */
  692. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  693. /* STABLE_FRAGMENT */
  694. );
  695. }
  696. /***/ }),
  697. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  698. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  699. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  700. \********************************************************************************************************************************************************************************************************************************************************************************************/
  701. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  702. "use strict";
  703. __webpack_require__.r(__webpack_exports__);
  704. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  705. /* harmony export */ "render": () => (/* binding */ render)
  706. /* harmony export */ });
  707. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  708. function render(_ctx, _cache, $props, $setup, $data, $options) {
  709. 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"], {
  710. "class": "layout-menu",
  711. items: $props.menu,
  712. root: true
  713. }, null, 8
  714. /* PROPS */
  715. , ["items"])]);
  716. }
  717. /***/ }),
  718. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  719. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  720. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  721. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  722. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  723. "use strict";
  724. __webpack_require__.r(__webpack_exports__);
  725. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  726. /* harmony export */ "render": () => (/* binding */ render)
  727. /* harmony export */ });
  728. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  729. var _withScopeId = function _withScopeId(n) {
  730. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  731. };
  732. var _hoisted_1 = {
  733. key: 0
  734. };
  735. var _hoisted_2 = ["aria-label"];
  736. var _hoisted_3 = ["aria-label"];
  737. function render(_ctx, _cache, $props, $setup, $data, $options) {
  738. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  739. 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) {
  740. 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", {
  741. key: i,
  742. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  743. 'layout-menuitem-category': $props.root
  744. }]),
  745. role: "none"
  746. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  747. key: 0
  748. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  749. "class": "layout-menuitem-root-text",
  750. "aria-label": item.label
  751. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  752. /* TEXT, PROPS */
  753. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  754. items: item.items
  755. }, null, 8
  756. /* PROPS */
  757. , ["items"])], 64
  758. /* STABLE_FRAGMENT */
  759. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  760. key: 1
  761. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  762. key: 0,
  763. role: "menuitem",
  764. href: item.to,
  765. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  766. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  767. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  768. }]),
  769. "aria-label": item.label
  770. }, {
  771. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  772. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  773. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  774. }, null, 2
  775. /* CLASS */
  776. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  777. /* TEXT */
  778. )];
  779. }),
  780. _: 2
  781. /* DYNAMIC */
  782. }, 1032
  783. /* PROPS, DYNAMIC_SLOTS */
  784. , ["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", {
  785. key: 1,
  786. href: "#",
  787. role: "menuitem",
  788. "aria-label": item.label
  789. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  790. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  791. }, null, 2
  792. /* CLASS */
  793. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  794. /* TEXT */
  795. )], 8
  796. /* PROPS */
  797. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  798. items: item.items
  799. }, null, 8
  800. /* PROPS */
  801. , ["items"])], 64
  802. /* STABLE_FRAGMENT */
  803. ))], 2
  804. /* CLASS */
  805. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  806. /* STABLE_FRAGMENT */
  807. );
  808. }), 256
  809. /* UNKEYED_FRAGMENT */
  810. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  811. }
  812. /***/ }),
  813. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  814. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  815. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  816. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  817. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  818. "use strict";
  819. __webpack_require__.r(__webpack_exports__);
  820. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  821. /* harmony export */ "render": () => (/* binding */ render)
  822. /* harmony export */ });
  823. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  824. var _withScopeId = function _withScopeId(n) {
  825. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  826. };
  827. var _hoisted_1 = {
  828. "class": "layout-topbar"
  829. };
  830. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  831. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  832. alt: "Logo",
  833. src: "/images/logo.svg",
  834. "class": "md:mr-3"
  835. }, null, -1
  836. /* HOISTED */
  837. );
  838. });
  839. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  840. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  841. /* HOISTED */
  842. );
  843. });
  844. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  845. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  846. "class": "pi pi-bars"
  847. }, null, -1
  848. /* HOISTED */
  849. );
  850. });
  851. var _hoisted_5 = [_hoisted_4];
  852. var _hoisted_6 = {
  853. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  854. };
  855. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  856. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  857. "class": "pi pi-ellipsis-v"
  858. }, null, -1
  859. /* HOISTED */
  860. );
  861. });
  862. var _hoisted_8 = [_hoisted_7];
  863. var _hoisted_9 = {
  864. "class": "layout-topbar-menu hidden lg:flex origin-top"
  865. };
  866. var _hoisted_10 = {
  867. "class": "align-self-center"
  868. };
  869. var _hoisted_11 = {
  870. "class": "hidden lg:inline"
  871. };
  872. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  873. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  874. "class": "pi pi-user"
  875. }, null, -1
  876. /* HOISTED */
  877. );
  878. });
  879. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  880. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Profil Saya", -1
  881. /* HOISTED */
  882. );
  883. });
  884. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  885. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  886. "class": "pi pi-sign-out"
  887. }, null, -1
  888. /* HOISTED */
  889. );
  890. });
  891. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  892. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Sign Out", -1
  893. /* HOISTED */
  894. );
  895. });
  896. function render(_ctx, _cache, $props, $setup, $data, $options) {
  897. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  898. 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"], {
  899. href: "/",
  900. "class": "layout-topbar-logo"
  901. }, {
  902. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  903. return [_hoisted_2, _hoisted_3];
  904. }),
  905. _: 1
  906. /* STABLE */
  907. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  908. "class": "p-link layout-menu-button layout-topbar-button",
  909. onClick: _cache[0] || (_cache[0] = function ($event) {
  910. return _ctx.$emit('menu-toggle', $event);
  911. })
  912. }, _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, {
  913. selector: '@next',
  914. enterClass: 'hidden',
  915. enterActiveClass: 'scalein',
  916. leaveToClass: 'hidden',
  917. leaveActiveClass: 'fadeout',
  918. hideOnOutsideClick: true
  919. }]]), (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
  920. /* TEXT */
  921. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  922. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  923. "class": "p-link layout-topbar-button"
  924. }, {
  925. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  926. return [_hoisted_12, _hoisted_13];
  927. }),
  928. _: 1
  929. /* STABLE */
  930. }, 8
  931. /* PROPS */
  932. , ["href"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  933. href: _ctx.route('logout'),
  934. as: "button",
  935. method: "post",
  936. "class": "p-link layout-topbar-button"
  937. }, {
  938. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  939. return [_hoisted_14, _hoisted_15];
  940. }),
  941. _: 1
  942. /* STABLE */
  943. }, 8
  944. /* PROPS */
  945. , ["href"])])])]);
  946. }
  947. /***/ }),
  948. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  949. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  950. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  951. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  952. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  953. "use strict";
  954. __webpack_require__.r(__webpack_exports__);
  955. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  956. /* harmony export */ "render": () => (/* binding */ render)
  957. /* harmony export */ });
  958. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  959. var _withScopeId = function _withScopeId(n) {
  960. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  961. };
  962. var _hoisted_1 = {
  963. "class": "layout-sidebar"
  964. };
  965. var _hoisted_2 = {
  966. "class": "layout-main-container"
  967. };
  968. var _hoisted_3 = {
  969. "class": "layout-main"
  970. };
  971. var _hoisted_4 = {
  972. key: 0,
  973. "class": "layout-mask p-component-overlay"
  974. };
  975. function render(_ctx, _cache, $props, $setup, $data, $options) {
  976. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  977. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  978. onClick: $setup.onWrapperClick
  979. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  980. onMenuToggle: $setup.onMenuToggle
  981. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  982. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  983. }, null, 8
  984. /* PROPS */
  985. , ["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, {
  986. name: "layout-mask"
  987. }, {
  988. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  989. 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)];
  990. }),
  991. _: 1
  992. /* STABLE */
  993. })], 2
  994. /* CLASS */
  995. );
  996. }
  997. /***/ }),
  998. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/member/Edit.vue?vue&type=template&id=1a9fb226":
  999. /*!****************************************************************************************************************************************************************************************************************************************************************************!*\
  1000. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/member/Edit.vue?vue&type=template&id=1a9fb226 ***!
  1001. \****************************************************************************************************************************************************************************************************************************************************************************/
  1002. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1003. "use strict";
  1004. __webpack_require__.r(__webpack_exports__);
  1005. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1006. /* harmony export */ "render": () => (/* binding */ render)
  1007. /* harmony export */ });
  1008. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1009. var _hoisted_1 = {
  1010. "class": "grid"
  1011. };
  1012. var _hoisted_2 = {
  1013. "class": "col-12 md:col-8"
  1014. };
  1015. var _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Ubah Member ");
  1016. var _hoisted_4 = {
  1017. "class": "grid"
  1018. };
  1019. var _hoisted_5 = {
  1020. "class": "col-12 md:col-6"
  1021. };
  1022. var _hoisted_6 = {
  1023. "class": "col-12 md:col-6"
  1024. };
  1025. var _hoisted_7 = {
  1026. "class": "col-12 md:col-6"
  1027. };
  1028. var _hoisted_8 = {
  1029. "class": "grid"
  1030. };
  1031. var _hoisted_9 = {
  1032. "class": "col-12 md:col-8"
  1033. };
  1034. var _hoisted_10 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)("Detail Harga");
  1035. var _hoisted_11 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", {
  1036. "class": "text-base font-bold mb-0"
  1037. }, "Jenis Member", -1
  1038. /* HOISTED */
  1039. );
  1040. var _hoisted_12 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", {
  1041. "class": "text-base font-bold mb-0"
  1042. }, "Batas Maksimal Kendaraan", -1
  1043. /* HOISTED */
  1044. );
  1045. var _hoisted_13 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", {
  1046. "class": "text-base font-bold mb-0"
  1047. }, "Keterangan", -1
  1048. /* HOISTED */
  1049. );
  1050. var _hoisted_14 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", {
  1051. "class": "text-base font-bold mb-0"
  1052. }, "Tarif Member", -1
  1053. /* HOISTED */
  1054. );
  1055. var _hoisted_15 = {
  1056. key: 0,
  1057. "class": "grid"
  1058. };
  1059. var _hoisted_16 = {
  1060. "class": "col-12 md:col-8"
  1061. };
  1062. var _hoisted_17 = {
  1063. "class": "grid"
  1064. };
  1065. var _hoisted_18 = {
  1066. "class": "col-12 md:col-6"
  1067. };
  1068. var _hoisted_19 = {
  1069. "class": "col-12 md:col-6"
  1070. };
  1071. var _hoisted_20 = {
  1072. "class": "col-12 mb-3 md:mb-0"
  1073. };
  1074. var _hoisted_21 = {
  1075. "class": "flex flex-column md:flex-row md:align-items-center justify-content-end"
  1076. };
  1077. var _hoisted_22 = {
  1078. "class": "col-12"
  1079. };
  1080. var _hoisted_23 = {
  1081. style: {
  1082. "color": "#b71c1c"
  1083. }
  1084. };
  1085. var _hoisted_24 = {
  1086. "class": "flex justify-content-end"
  1087. };
  1088. var _hoisted_25 = {
  1089. "class": "grid"
  1090. };
  1091. var _hoisted_26 = {
  1092. "class": "col-12 flex flex-column md:flex-row justify-content-center md:justify-content-end"
  1093. };
  1094. function render(_ctx, _cache, $props, $setup, $data, $options) {
  1095. var _component_ConfirmDialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("ConfirmDialog");
  1096. var _component_Dialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Dialog");
  1097. var _component_Card = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Card");
  1098. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  1099. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  1100. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  1101. 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"], {
  1102. title: "Ubah Member"
  1103. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  1104. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1105. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_ConfirmDialog), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Dialog, {
  1106. modal: "",
  1107. header: "Error",
  1108. visible: $setup.errorSubmitVisible,
  1109. "onUpdate:visible": _cache[0] || (_cache[0] = function ($event) {
  1110. return $setup.errorSubmitVisible = $event;
  1111. }),
  1112. contentStyle: "color: #b71c1c",
  1113. closable: false,
  1114. style: {
  1115. width: '40vw'
  1116. }
  1117. }, {
  1118. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1119. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.errorSubmitText), 1
  1120. /* TEXT */
  1121. )];
  1122. }),
  1123. _: 1
  1124. /* STABLE */
  1125. }, 8
  1126. /* PROPS */
  1127. , ["visible"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Card, null, {
  1128. title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1129. return [_hoisted_3];
  1130. }),
  1131. content: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1132. return [(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)($setup["AppInputText"], {
  1133. modelValue: $setup.form.name,
  1134. "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) {
  1135. return $setup.form.name = $event;
  1136. }),
  1137. label: "Nama",
  1138. placeholder: "nama",
  1139. error: $setup.form.errors.name
  1140. }, null, 8
  1141. /* PROPS */
  1142. , ["modelValue", "error"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppInputText"], {
  1143. modelValue: $setup.form.phone,
  1144. "onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) {
  1145. return $setup.form.phone = $event;
  1146. }),
  1147. label: "Nomor HP",
  1148. placeholder: "nomor hp",
  1149. error: $setup.form.errors.phone
  1150. }, null, 8
  1151. /* PROPS */
  1152. , ["modelValue", "error"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_7, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppDropdown"], {
  1153. label: "Jenis member",
  1154. placeholder: "pilih satu",
  1155. modelValue: $setup.form.type_member_id,
  1156. "onUpdate:modelValue": _cache[3] || (_cache[3] = function ($event) {
  1157. return $setup.form.type_member_id = $event;
  1158. }),
  1159. options: $props.typeMembers,
  1160. error: $setup.form.errors.type_member_id
  1161. }, null, 8
  1162. /* PROPS */
  1163. , ["modelValue", "options", "error"])])])];
  1164. }),
  1165. _: 1
  1166. /* STABLE */
  1167. })])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_8, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Card, {
  1168. "class": "bg-primary"
  1169. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createSlots)({
  1170. title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1171. return [_hoisted_10];
  1172. }),
  1173. _: 2
  1174. /* DYNAMIC */
  1175. }, [$props.typeMember ? {
  1176. name: "content",
  1177. fn: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1178. return [_hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.typeMember.type), 1
  1179. /* TEXT */
  1180. ), _hoisted_12, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.typeMember.max), 1
  1181. /* TEXT */
  1182. ), _hoisted_13, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.typeMember.description), 1
  1183. /* TEXT */
  1184. ), _hoisted_14, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.typeMember.price), 1
  1185. /* TEXT */
  1186. )];
  1187. })
  1188. } : undefined]), 1024
  1189. /* DYNAMIC_SLOTS */
  1190. )])]), $props.typeMember ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_15, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_16, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Card, null, {
  1191. content: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1192. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_17, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_18, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppInputText"], {
  1193. modelValue: $setup.form.plat_number,
  1194. "onUpdate:modelValue": _cache[4] || (_cache[4] = function ($event) {
  1195. return $setup.form.plat_number = $event;
  1196. }),
  1197. label: "Plat Kendaraan",
  1198. placeholder: "plat kendaraan",
  1199. disabled: !$setup.form.type_member_id,
  1200. error: $setup.form.errors.plat_number
  1201. }, null, 8
  1202. /* PROPS */
  1203. , ["modelValue", "disabled", "error"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_19, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppDropdown"], {
  1204. modelValue: $setup.form.max_vehicle_id,
  1205. "onUpdate:modelValue": _cache[5] || (_cache[5] = function ($event) {
  1206. return $setup.form.max_vehicle_id = $event;
  1207. }),
  1208. label: "Jenis Kendaraan",
  1209. placeholder: "jenis kendaraan",
  1210. disabled: !$setup.form.type_member_id,
  1211. options: $props.typeMember.maxVehicles,
  1212. error: $setup.form.errors.max_vehicle_id
  1213. }, null, 8
  1214. /* PROPS */
  1215. , ["modelValue", "disabled", "options", "error"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_20, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_21, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  1216. label: "Tambah",
  1217. "class": "p-button-outlined",
  1218. icon: "pi pi-car",
  1219. disabled: !$setup.form.type_member_id,
  1220. onClick: $setup.vehicleOnAdd
  1221. }, null, 8
  1222. /* PROPS */
  1223. , ["disabled", "onClick"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_22, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  1224. "striped-rows": "",
  1225. "row-hover": "",
  1226. "responsive-layout": "scroll",
  1227. "column-resize-mode": "expand",
  1228. "edit-mode": "cell",
  1229. value: $setup.listVehicle
  1230. }, {
  1231. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1232. 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.platNumberTable, function (value) {
  1233. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  1234. field: value.field,
  1235. header: value.header,
  1236. key: value.field
  1237. }, null, 8
  1238. /* PROPS */
  1239. , ["field", "header"]);
  1240. }), 128
  1241. /* KEYED_FRAGMENT */
  1242. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  1243. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  1244. var index = _ref.index;
  1245. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_23, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.errors["vehicles.".concat(index, ".platNumber")]), 1
  1246. /* TEXT */
  1247. )];
  1248. }),
  1249. _: 1
  1250. /* STABLE */
  1251. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  1252. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref2) {
  1253. var index = _ref2.index;
  1254. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_24, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  1255. icon: "pi pi-trash",
  1256. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-rounded p-button-text", {
  1257. 'p-button-danger': _ctx.$page.props.errors["vehicles.".concat(index, ".platNumber")]
  1258. }]),
  1259. onClick: function onClick($event) {
  1260. return $setup.vehicleOnDelete(index);
  1261. }
  1262. }, null, 8
  1263. /* PROPS */
  1264. , ["class", "onClick"])])];
  1265. }),
  1266. _: 1
  1267. /* STABLE */
  1268. })];
  1269. }),
  1270. _: 1
  1271. /* STABLE */
  1272. }, 8
  1273. /* PROPS */
  1274. , ["value"])])])];
  1275. }),
  1276. footer: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1277. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_25, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_26, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  1278. label: "Simpan",
  1279. icon: "pi pi-check",
  1280. "class": "p-button-outlined",
  1281. disabled: $setup.form.processing || $setup.listVehicle.length === 0,
  1282. onClick: $setup.onSubmit
  1283. }, null, 8
  1284. /* PROPS */
  1285. , ["disabled"])])])];
  1286. }),
  1287. _: 1
  1288. /* STABLE */
  1289. })])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  1290. }),
  1291. _: 1
  1292. /* STABLE */
  1293. })], 64
  1294. /* STABLE_FRAGMENT */
  1295. );
  1296. }
  1297. /***/ }),
  1298. /***/ "./resources/js/components/useFormErrorReset.js":
  1299. /*!******************************************************!*\
  1300. !*** ./resources/js/components/useFormErrorReset.js ***!
  1301. \******************************************************/
  1302. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1303. "use strict";
  1304. __webpack_require__.r(__webpack_exports__);
  1305. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1306. /* harmony export */ "useFormErrorReset": () => (/* binding */ useFormErrorReset)
  1307. /* harmony export */ });
  1308. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1309. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  1310. function useFormErrorReset(form) {
  1311. var errors = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  1312. return (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.usePage)().props.value.errors;
  1313. });
  1314. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(errors, function () {
  1315. form.clearErrors();
  1316. });
  1317. }
  1318. /***/ }),
  1319. /***/ "./resources/js/pages/member/tableHeader.js":
  1320. /*!**************************************************!*\
  1321. !*** ./resources/js/pages/member/tableHeader.js ***!
  1322. \**************************************************/
  1323. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1324. "use strict";
  1325. __webpack_require__.r(__webpack_exports__);
  1326. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1327. /* harmony export */ "indexTable": () => (/* binding */ indexTable),
  1328. /* harmony export */ "platNumberTable": () => (/* binding */ platNumberTable)
  1329. /* harmony export */ });
  1330. var indexTable = [{
  1331. field: 'updatedAt',
  1332. header: 'Diperbaharui'
  1333. }, {
  1334. field: 'name',
  1335. header: 'Nama'
  1336. }, {
  1337. field: 'platNumber',
  1338. header: 'Plat Kendaraan'
  1339. }, {
  1340. field: 'type',
  1341. header: 'Jenis Member'
  1342. }, {
  1343. field: 'price',
  1344. header: 'Tarif Member'
  1345. }, {
  1346. field: 'expDate',
  1347. header: 'Berakhir'
  1348. }];
  1349. var platNumberTable = [{
  1350. field: 'platNumber',
  1351. header: 'Plat Kendaraan'
  1352. }, {
  1353. field: 'typeVehicle',
  1354. header: 'Jenis Kendaraan'
  1355. }];
  1356. /***/ }),
  1357. /***/ "./resources/js/pages/member/useVehicle.js":
  1358. /*!*************************************************!*\
  1359. !*** ./resources/js/pages/member/useVehicle.js ***!
  1360. \*************************************************/
  1361. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1362. "use strict";
  1363. __webpack_require__.r(__webpack_exports__);
  1364. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1365. /* harmony export */ "useVehicle": () => (/* binding */ useVehicle)
  1366. /* harmony export */ });
  1367. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1368. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  1369. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  1370. /* harmony import */ var _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/utils/formValidationError */ "./resources/js/utils/formValidationError.js");
  1371. function useVehicle(props, form) {
  1372. var listVehicle = (0,vue__WEBPACK_IMPORTED_MODULE_0__.reactive)([]);
  1373. (0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
  1374. if (props.initialVehicles) {
  1375. props.initialVehicles.forEach(function (val) {
  1376. return listVehicle.push(val);
  1377. });
  1378. }
  1379. });
  1380. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(function () {
  1381. return form.type_member_id;
  1382. }, function () {
  1383. vehicleClear();
  1384. form.reset('plat_number', 'max_vehicle_id');
  1385. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.reload({
  1386. only: ['typeMember'],
  1387. data: {
  1388. id: form.type_member_id
  1389. }
  1390. });
  1391. });
  1392. var vehicleClear = function vehicleClear() {
  1393. listVehicle.splice(0);
  1394. };
  1395. var vehicleOnDelete = function vehicleOnDelete(index) {
  1396. listVehicle.splice(index, 1);
  1397. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.usePage)().props.value.errors = {};
  1398. };
  1399. var vehicleAddValidation = function vehicleAddValidation() {
  1400. if (!form.plat_number) {
  1401. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Plat kendaraan tidak boleh kosong', 'plat_number');
  1402. }
  1403. if (!form.max_vehicle_id) {
  1404. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Tidak boleh kosong', 'max_vehicle_id');
  1405. }
  1406. var platNumberExist = listVehicle.filter(function (vehicle) {
  1407. return vehicle.platNumber === form.plat_number.toUpperCase();
  1408. });
  1409. if (platNumberExist.length) {
  1410. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Nomor plat kendaraan tidak boleh sama', 'plat_number');
  1411. }
  1412. var maxVehicles = listVehicle.filter(function (vehicle) {
  1413. return vehicle.maxVehicleId === form.max_vehicle_id;
  1414. });
  1415. if (maxVehicles.length) {
  1416. if (maxVehicles.length + 1 > maxVehicles[0].maxVehicle) {
  1417. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Melibihi batas maksimal kendaraan', 'plat_number');
  1418. }
  1419. }
  1420. };
  1421. var vehicleOnAdd = function vehicleOnAdd() {
  1422. try {
  1423. form.clearErrors('plat_number', 'max_vehicle_id');
  1424. vehicleAddValidation();
  1425. var typeVehicle = props.typeMember.maxVehicles.filter(function (maxVehicle) {
  1426. return maxVehicle.value === form.max_vehicle_id;
  1427. })[0];
  1428. listVehicle.push({
  1429. platNumber: form.plat_number.toUpperCase(),
  1430. typeVehicle: typeVehicle.label,
  1431. typeVehicleId: typeVehicle.typeVehicleId,
  1432. maxVehicleId: typeVehicle.value,
  1433. maxVehicle: typeVehicle.maxVehicle
  1434. });
  1435. form.reset('plat_number', 'max_vehicle_id');
  1436. } catch (err) {
  1437. form.setError(err.field, err.message);
  1438. }
  1439. };
  1440. return {
  1441. listVehicle: listVehicle,
  1442. vehicleClear: vehicleClear,
  1443. vehicleOnDelete: vehicleOnDelete,
  1444. vehicleOnAdd: vehicleOnAdd
  1445. };
  1446. }
  1447. /***/ }),
  1448. /***/ "./resources/js/utils/formValidationError.js":
  1449. /*!***************************************************!*\
  1450. !*** ./resources/js/utils/formValidationError.js ***!
  1451. \***************************************************/
  1452. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1453. "use strict";
  1454. __webpack_require__.r(__webpack_exports__);
  1455. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1456. /* harmony export */ "default": () => (/* binding */ FormValidationError)
  1457. /* harmony export */ });
  1458. function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
  1459. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  1460. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  1461. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1462. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
  1463. function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
  1464. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
  1465. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  1466. function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
  1467. function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
  1468. function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
  1469. function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
  1470. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  1471. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  1472. var FormValidationError = /*#__PURE__*/function (_Error) {
  1473. _inherits(FormValidationError, _Error);
  1474. var _super = _createSuper(FormValidationError);
  1475. function FormValidationError(message, field) {
  1476. var _this;
  1477. _classCallCheck(this, FormValidationError);
  1478. _this = _super.call(this, message);
  1479. _this.field = field;
  1480. return _this;
  1481. }
  1482. return _createClass(FormValidationError);
  1483. }( /*#__PURE__*/_wrapNativeSuper(Error));
  1484. /***/ }),
  1485. /***/ "./resources/js/utils/menu.js":
  1486. /*!************************************!*\
  1487. !*** ./resources/js/utils/menu.js ***!
  1488. \************************************/
  1489. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1490. "use strict";
  1491. __webpack_require__.r(__webpack_exports__);
  1492. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1493. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1494. /* harmony export */ });
  1495. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1496. // Admin
  1497. 1: [{
  1498. label: 'Home',
  1499. items: [{
  1500. label: 'Dashboard',
  1501. icon: 'pi pi-home',
  1502. to: '/dashboards',
  1503. component: 'home/Index'
  1504. }]
  1505. }, {
  1506. label: 'Master',
  1507. items: [{
  1508. label: 'User',
  1509. icon: 'pi pi-user',
  1510. to: '/users',
  1511. component: 'user/Index'
  1512. }]
  1513. }],
  1514. // Supervisor
  1515. 2: [{
  1516. label: 'Home',
  1517. items: [{
  1518. label: 'Dashboard',
  1519. icon: 'pi pi-home',
  1520. to: '/dashboards',
  1521. component: 'home/Index'
  1522. }]
  1523. }, {
  1524. label: 'Menu',
  1525. items: [{
  1526. label: 'Pengeluaran',
  1527. icon: 'pi pi-wallet',
  1528. to: '/expenses',
  1529. component: 'expense/Index'
  1530. }, {
  1531. label: 'Laporan',
  1532. icon: 'pi pi-book',
  1533. items: [{
  1534. label: 'Mutasi',
  1535. icon: 'pi pi-circle',
  1536. to: '/reports/mutations',
  1537. component: 'mutation/Report'
  1538. }]
  1539. }]
  1540. }, {
  1541. label: 'Master',
  1542. items: [{
  1543. label: 'Jenis Kendaraan',
  1544. icon: 'pi pi-car',
  1545. to: '/type-vehicles',
  1546. component: 'typevehicle/Index'
  1547. }, {
  1548. label: 'Jenis Member',
  1549. icon: 'pi pi-id-card',
  1550. to: '/type-members',
  1551. component: 'typemember/Index'
  1552. }]
  1553. }, {
  1554. label: 'Pengaturan',
  1555. items: [{
  1556. label: 'Tarif Parkir',
  1557. icon: 'pi pi-car',
  1558. to: '/parking-fees/create',
  1559. component: 'parkingfee/Create'
  1560. }]
  1561. }],
  1562. // Operator
  1563. 3: [{
  1564. label: 'Home',
  1565. items: [{
  1566. label: 'Dashboard',
  1567. icon: 'pi pi-home',
  1568. to: '/dashboards',
  1569. component: 'home/Index'
  1570. }]
  1571. }, {
  1572. label: 'Menu',
  1573. items: [{
  1574. label: 'Pengeluaran',
  1575. icon: 'pi pi-wallet',
  1576. to: '/expenses',
  1577. component: 'expense/Index'
  1578. }, {
  1579. label: 'Member',
  1580. icon: 'pi pi-id-card',
  1581. to: '/members',
  1582. component: 'member/Index'
  1583. }, {
  1584. label: 'Top Up',
  1585. icon: 'pi pi-car',
  1586. to: '/top-ups',
  1587. component: 'topup/Index'
  1588. }]
  1589. }]
  1590. });
  1591. /***/ }),
  1592. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1593. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1594. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1595. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1596. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1597. "use strict";
  1598. __webpack_require__.r(__webpack_exports__);
  1599. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1600. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1601. /* harmony export */ });
  1602. /* 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");
  1603. /* 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__);
  1604. // Imports
  1605. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1606. // Module
  1607. ___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}", ""]);
  1608. // Exports
  1609. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1610. /***/ }),
  1611. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1612. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1613. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1614. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1615. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1616. "use strict";
  1617. __webpack_require__.r(__webpack_exports__);
  1618. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1619. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1620. /* harmony export */ });
  1621. /* 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");
  1622. /* 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__);
  1623. // Imports
  1624. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1625. // Module
  1626. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1627. // Exports
  1628. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1629. /***/ }),
  1630. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1631. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1632. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1633. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1634. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1635. "use strict";
  1636. __webpack_require__.r(__webpack_exports__);
  1637. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1638. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1639. /* harmony export */ });
  1640. /* 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");
  1641. /* 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__);
  1642. // Imports
  1643. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1644. // Module
  1645. ___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}", ""]);
  1646. // Exports
  1647. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1648. /***/ }),
  1649. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1650. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1651. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1652. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1653. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1654. "use strict";
  1655. __webpack_require__.r(__webpack_exports__);
  1656. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1657. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1658. /* harmony export */ });
  1659. /* 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");
  1660. /* 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__);
  1661. // Imports
  1662. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1663. // Module
  1664. ___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}", ""]);
  1665. // Exports
  1666. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1667. /***/ }),
  1668. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1669. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1670. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1671. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1672. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1673. "use strict";
  1674. __webpack_require__.r(__webpack_exports__);
  1675. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1676. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1677. /* harmony export */ });
  1678. /* 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");
  1679. /* 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__);
  1680. // Imports
  1681. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1682. // Module
  1683. ___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}", ""]);
  1684. // Exports
  1685. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1686. /***/ }),
  1687. /***/ "./node_modules/lodash/lodash.js":
  1688. /*!***************************************!*\
  1689. !*** ./node_modules/lodash/lodash.js ***!
  1690. \***************************************/
  1691. /***/ (function(module, exports, __webpack_require__) {
  1692. /* module decorator */ module = __webpack_require__.nmd(module);
  1693. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1694. * @license
  1695. * Lodash <https://lodash.com/>
  1696. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1697. * Released under MIT license <https://lodash.com/license>
  1698. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1699. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1700. */
  1701. ;(function() {
  1702. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1703. var undefined;
  1704. /** Used as the semantic version number. */
  1705. var VERSION = '4.17.21';
  1706. /** Used as the size to enable large array optimizations. */
  1707. var LARGE_ARRAY_SIZE = 200;
  1708. /** Error message constants. */
  1709. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1710. FUNC_ERROR_TEXT = 'Expected a function',
  1711. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1712. /** Used to stand-in for `undefined` hash values. */
  1713. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1714. /** Used as the maximum memoize cache size. */
  1715. var MAX_MEMOIZE_SIZE = 500;
  1716. /** Used as the internal argument placeholder. */
  1717. var PLACEHOLDER = '__lodash_placeholder__';
  1718. /** Used to compose bitmasks for cloning. */
  1719. var CLONE_DEEP_FLAG = 1,
  1720. CLONE_FLAT_FLAG = 2,
  1721. CLONE_SYMBOLS_FLAG = 4;
  1722. /** Used to compose bitmasks for value comparisons. */
  1723. var COMPARE_PARTIAL_FLAG = 1,
  1724. COMPARE_UNORDERED_FLAG = 2;
  1725. /** Used to compose bitmasks for function metadata. */
  1726. var WRAP_BIND_FLAG = 1,
  1727. WRAP_BIND_KEY_FLAG = 2,
  1728. WRAP_CURRY_BOUND_FLAG = 4,
  1729. WRAP_CURRY_FLAG = 8,
  1730. WRAP_CURRY_RIGHT_FLAG = 16,
  1731. WRAP_PARTIAL_FLAG = 32,
  1732. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1733. WRAP_ARY_FLAG = 128,
  1734. WRAP_REARG_FLAG = 256,
  1735. WRAP_FLIP_FLAG = 512;
  1736. /** Used as default options for `_.truncate`. */
  1737. var DEFAULT_TRUNC_LENGTH = 30,
  1738. DEFAULT_TRUNC_OMISSION = '...';
  1739. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1740. var HOT_COUNT = 800,
  1741. HOT_SPAN = 16;
  1742. /** Used to indicate the type of lazy iteratees. */
  1743. var LAZY_FILTER_FLAG = 1,
  1744. LAZY_MAP_FLAG = 2,
  1745. LAZY_WHILE_FLAG = 3;
  1746. /** Used as references for various `Number` constants. */
  1747. var INFINITY = 1 / 0,
  1748. MAX_SAFE_INTEGER = 9007199254740991,
  1749. MAX_INTEGER = 1.7976931348623157e+308,
  1750. NAN = 0 / 0;
  1751. /** Used as references for the maximum length and index of an array. */
  1752. var MAX_ARRAY_LENGTH = 4294967295,
  1753. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1754. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1755. /** Used to associate wrap methods with their bit flags. */
  1756. var wrapFlags = [
  1757. ['ary', WRAP_ARY_FLAG],
  1758. ['bind', WRAP_BIND_FLAG],
  1759. ['bindKey', WRAP_BIND_KEY_FLAG],
  1760. ['curry', WRAP_CURRY_FLAG],
  1761. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1762. ['flip', WRAP_FLIP_FLAG],
  1763. ['partial', WRAP_PARTIAL_FLAG],
  1764. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1765. ['rearg', WRAP_REARG_FLAG]
  1766. ];
  1767. /** `Object#toString` result references. */
  1768. var argsTag = '[object Arguments]',
  1769. arrayTag = '[object Array]',
  1770. asyncTag = '[object AsyncFunction]',
  1771. boolTag = '[object Boolean]',
  1772. dateTag = '[object Date]',
  1773. domExcTag = '[object DOMException]',
  1774. errorTag = '[object Error]',
  1775. funcTag = '[object Function]',
  1776. genTag = '[object GeneratorFunction]',
  1777. mapTag = '[object Map]',
  1778. numberTag = '[object Number]',
  1779. nullTag = '[object Null]',
  1780. objectTag = '[object Object]',
  1781. promiseTag = '[object Promise]',
  1782. proxyTag = '[object Proxy]',
  1783. regexpTag = '[object RegExp]',
  1784. setTag = '[object Set]',
  1785. stringTag = '[object String]',
  1786. symbolTag = '[object Symbol]',
  1787. undefinedTag = '[object Undefined]',
  1788. weakMapTag = '[object WeakMap]',
  1789. weakSetTag = '[object WeakSet]';
  1790. var arrayBufferTag = '[object ArrayBuffer]',
  1791. dataViewTag = '[object DataView]',
  1792. float32Tag = '[object Float32Array]',
  1793. float64Tag = '[object Float64Array]',
  1794. int8Tag = '[object Int8Array]',
  1795. int16Tag = '[object Int16Array]',
  1796. int32Tag = '[object Int32Array]',
  1797. uint8Tag = '[object Uint8Array]',
  1798. uint8ClampedTag = '[object Uint8ClampedArray]',
  1799. uint16Tag = '[object Uint16Array]',
  1800. uint32Tag = '[object Uint32Array]';
  1801. /** Used to match empty string literals in compiled template source. */
  1802. var reEmptyStringLeading = /\b__p \+= '';/g,
  1803. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1804. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1805. /** Used to match HTML entities and HTML characters. */
  1806. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1807. reUnescapedHtml = /[&<>"']/g,
  1808. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1809. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1810. /** Used to match template delimiters. */
  1811. var reEscape = /<%-([\s\S]+?)%>/g,
  1812. reEvaluate = /<%([\s\S]+?)%>/g,
  1813. reInterpolate = /<%=([\s\S]+?)%>/g;
  1814. /** Used to match property names within property paths. */
  1815. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1816. reIsPlainProp = /^\w*$/,
  1817. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1818. /**
  1819. * Used to match `RegExp`
  1820. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1821. */
  1822. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1823. reHasRegExpChar = RegExp(reRegExpChar.source);
  1824. /** Used to match leading whitespace. */
  1825. var reTrimStart = /^\s+/;
  1826. /** Used to match a single whitespace character. */
  1827. var reWhitespace = /\s/;
  1828. /** Used to match wrap detail comments. */
  1829. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1830. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1831. reSplitDetails = /,? & /;
  1832. /** Used to match words composed of alphanumeric characters. */
  1833. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1834. /**
  1835. * Used to validate the `validate` option in `_.template` variable.
  1836. *
  1837. * Forbids characters which could potentially change the meaning of the function argument definition:
  1838. * - "()," (modification of function parameters)
  1839. * - "=" (default value)
  1840. * - "[]{}" (destructuring of function parameters)
  1841. * - "/" (beginning of a comment)
  1842. * - whitespace
  1843. */
  1844. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1845. /** Used to match backslashes in property paths. */
  1846. var reEscapeChar = /\\(\\)?/g;
  1847. /**
  1848. * Used to match
  1849. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1850. */
  1851. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1852. /** Used to match `RegExp` flags from their coerced string values. */
  1853. var reFlags = /\w*$/;
  1854. /** Used to detect bad signed hexadecimal string values. */
  1855. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1856. /** Used to detect binary string values. */
  1857. var reIsBinary = /^0b[01]+$/i;
  1858. /** Used to detect host constructors (Safari). */
  1859. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1860. /** Used to detect octal string values. */
  1861. var reIsOctal = /^0o[0-7]+$/i;
  1862. /** Used to detect unsigned integer values. */
  1863. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1864. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1865. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1866. /** Used to ensure capturing order of template delimiters. */
  1867. var reNoMatch = /($^)/;
  1868. /** Used to match unescaped characters in compiled string literals. */
  1869. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1870. /** Used to compose unicode character classes. */
  1871. var rsAstralRange = '\\ud800-\\udfff',
  1872. rsComboMarksRange = '\\u0300-\\u036f',
  1873. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1874. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1875. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1876. rsDingbatRange = '\\u2700-\\u27bf',
  1877. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1878. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1879. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1880. rsPunctuationRange = '\\u2000-\\u206f',
  1881. 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',
  1882. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1883. rsVarRange = '\\ufe0e\\ufe0f',
  1884. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1885. /** Used to compose unicode capture groups. */
  1886. var rsApos = "['\u2019]",
  1887. rsAstral = '[' + rsAstralRange + ']',
  1888. rsBreak = '[' + rsBreakRange + ']',
  1889. rsCombo = '[' + rsComboRange + ']',
  1890. rsDigits = '\\d+',
  1891. rsDingbat = '[' + rsDingbatRange + ']',
  1892. rsLower = '[' + rsLowerRange + ']',
  1893. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1894. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1895. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1896. rsNonAstral = '[^' + rsAstralRange + ']',
  1897. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1898. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1899. rsUpper = '[' + rsUpperRange + ']',
  1900. rsZWJ = '\\u200d';
  1901. /** Used to compose unicode regexes. */
  1902. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1903. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1904. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1905. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1906. reOptMod = rsModifier + '?',
  1907. rsOptVar = '[' + rsVarRange + ']?',
  1908. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1909. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1910. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1911. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1912. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1913. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1914. /** Used to match apostrophes. */
  1915. var reApos = RegExp(rsApos, 'g');
  1916. /**
  1917. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1918. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1919. */
  1920. var reComboMark = RegExp(rsCombo, 'g');
  1921. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1922. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1923. /** Used to match complex or compound words. */
  1924. var reUnicodeWord = RegExp([
  1925. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1926. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1927. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1928. rsUpper + '+' + rsOptContrUpper,
  1929. rsOrdUpper,
  1930. rsOrdLower,
  1931. rsDigits,
  1932. rsEmoji
  1933. ].join('|'), 'g');
  1934. /** 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/). */
  1935. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1936. /** Used to detect strings that need a more robust regexp to match words. */
  1937. 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 ]/;
  1938. /** Used to assign default `context` object properties. */
  1939. var contextProps = [
  1940. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1941. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1942. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1943. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1944. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1945. ];
  1946. /** Used to make template sourceURLs easier to identify. */
  1947. var templateCounter = -1;
  1948. /** Used to identify `toStringTag` values of typed arrays. */
  1949. var typedArrayTags = {};
  1950. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1951. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1952. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1953. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1954. typedArrayTags[uint32Tag] = true;
  1955. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1956. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1957. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1958. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1959. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1960. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1961. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1962. typedArrayTags[weakMapTag] = false;
  1963. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1964. var cloneableTags = {};
  1965. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1966. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1967. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1968. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1969. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1970. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1971. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1972. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1973. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1974. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1975. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1976. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1977. cloneableTags[weakMapTag] = false;
  1978. /** Used to map Latin Unicode letters to basic Latin letters. */
  1979. var deburredLetters = {
  1980. // Latin-1 Supplement block.
  1981. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1982. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1983. '\xc7': 'C', '\xe7': 'c',
  1984. '\xd0': 'D', '\xf0': 'd',
  1985. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1986. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1987. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1988. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1989. '\xd1': 'N', '\xf1': 'n',
  1990. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1991. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1992. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1993. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1994. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1995. '\xc6': 'Ae', '\xe6': 'ae',
  1996. '\xde': 'Th', '\xfe': 'th',
  1997. '\xdf': 'ss',
  1998. // Latin Extended-A block.
  1999. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  2000. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  2001. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  2002. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  2003. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  2004. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  2005. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  2006. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  2007. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  2008. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  2009. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  2010. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  2011. '\u0134': 'J', '\u0135': 'j',
  2012. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  2013. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  2014. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  2015. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  2016. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  2017. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  2018. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  2019. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  2020. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  2021. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  2022. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  2023. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  2024. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  2025. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  2026. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  2027. '\u0174': 'W', '\u0175': 'w',
  2028. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  2029. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  2030. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  2031. '\u0132': 'IJ', '\u0133': 'ij',
  2032. '\u0152': 'Oe', '\u0153': 'oe',
  2033. '\u0149': "'n", '\u017f': 's'
  2034. };
  2035. /** Used to map characters to HTML entities. */
  2036. var htmlEscapes = {
  2037. '&': '&amp;',
  2038. '<': '&lt;',
  2039. '>': '&gt;',
  2040. '"': '&quot;',
  2041. "'": '&#39;'
  2042. };
  2043. /** Used to map HTML entities to characters. */
  2044. var htmlUnescapes = {
  2045. '&amp;': '&',
  2046. '&lt;': '<',
  2047. '&gt;': '>',
  2048. '&quot;': '"',
  2049. '&#39;': "'"
  2050. };
  2051. /** Used to escape characters for inclusion in compiled string literals. */
  2052. var stringEscapes = {
  2053. '\\': '\\',
  2054. "'": "'",
  2055. '\n': 'n',
  2056. '\r': 'r',
  2057. '\u2028': 'u2028',
  2058. '\u2029': 'u2029'
  2059. };
  2060. /** Built-in method references without a dependency on `root`. */
  2061. var freeParseFloat = parseFloat,
  2062. freeParseInt = parseInt;
  2063. /** Detect free variable `global` from Node.js. */
  2064. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  2065. /** Detect free variable `self`. */
  2066. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  2067. /** Used as a reference to the global object. */
  2068. var root = freeGlobal || freeSelf || Function('return this')();
  2069. /** Detect free variable `exports`. */
  2070. var freeExports = true && exports && !exports.nodeType && exports;
  2071. /** Detect free variable `module`. */
  2072. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  2073. /** Detect the popular CommonJS extension `module.exports`. */
  2074. var moduleExports = freeModule && freeModule.exports === freeExports;
  2075. /** Detect free variable `process` from Node.js. */
  2076. var freeProcess = moduleExports && freeGlobal.process;
  2077. /** Used to access faster Node.js helpers. */
  2078. var nodeUtil = (function() {
  2079. try {
  2080. // Use `util.types` for Node.js 10+.
  2081. var types = freeModule && freeModule.require && freeModule.require('util').types;
  2082. if (types) {
  2083. return types;
  2084. }
  2085. // Legacy `process.binding('util')` for Node.js < 10.
  2086. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  2087. } catch (e) {}
  2088. }());
  2089. /* Node.js helper references. */
  2090. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  2091. nodeIsDate = nodeUtil && nodeUtil.isDate,
  2092. nodeIsMap = nodeUtil && nodeUtil.isMap,
  2093. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  2094. nodeIsSet = nodeUtil && nodeUtil.isSet,
  2095. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  2096. /*--------------------------------------------------------------------------*/
  2097. /**
  2098. * A faster alternative to `Function#apply`, this function invokes `func`
  2099. * with the `this` binding of `thisArg` and the arguments of `args`.
  2100. *
  2101. * @private
  2102. * @param {Function} func The function to invoke.
  2103. * @param {*} thisArg The `this` binding of `func`.
  2104. * @param {Array} args The arguments to invoke `func` with.
  2105. * @returns {*} Returns the result of `func`.
  2106. */
  2107. function apply(func, thisArg, args) {
  2108. switch (args.length) {
  2109. case 0: return func.call(thisArg);
  2110. case 1: return func.call(thisArg, args[0]);
  2111. case 2: return func.call(thisArg, args[0], args[1]);
  2112. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  2113. }
  2114. return func.apply(thisArg, args);
  2115. }
  2116. /**
  2117. * A specialized version of `baseAggregator` for arrays.
  2118. *
  2119. * @private
  2120. * @param {Array} [array] The array to iterate over.
  2121. * @param {Function} setter The function to set `accumulator` values.
  2122. * @param {Function} iteratee The iteratee to transform keys.
  2123. * @param {Object} accumulator The initial aggregated object.
  2124. * @returns {Function} Returns `accumulator`.
  2125. */
  2126. function arrayAggregator(array, setter, iteratee, accumulator) {
  2127. var index = -1,
  2128. length = array == null ? 0 : array.length;
  2129. while (++index < length) {
  2130. var value = array[index];
  2131. setter(accumulator, value, iteratee(value), array);
  2132. }
  2133. return accumulator;
  2134. }
  2135. /**
  2136. * A specialized version of `_.forEach` for arrays without support for
  2137. * iteratee shorthands.
  2138. *
  2139. * @private
  2140. * @param {Array} [array] The array to iterate over.
  2141. * @param {Function} iteratee The function invoked per iteration.
  2142. * @returns {Array} Returns `array`.
  2143. */
  2144. function arrayEach(array, iteratee) {
  2145. var index = -1,
  2146. length = array == null ? 0 : array.length;
  2147. while (++index < length) {
  2148. if (iteratee(array[index], index, array) === false) {
  2149. break;
  2150. }
  2151. }
  2152. return array;
  2153. }
  2154. /**
  2155. * A specialized version of `_.forEachRight` for arrays without support for
  2156. * iteratee shorthands.
  2157. *
  2158. * @private
  2159. * @param {Array} [array] The array to iterate over.
  2160. * @param {Function} iteratee The function invoked per iteration.
  2161. * @returns {Array} Returns `array`.
  2162. */
  2163. function arrayEachRight(array, iteratee) {
  2164. var length = array == null ? 0 : array.length;
  2165. while (length--) {
  2166. if (iteratee(array[length], length, array) === false) {
  2167. break;
  2168. }
  2169. }
  2170. return array;
  2171. }
  2172. /**
  2173. * A specialized version of `_.every` for arrays without support for
  2174. * iteratee shorthands.
  2175. *
  2176. * @private
  2177. * @param {Array} [array] The array to iterate over.
  2178. * @param {Function} predicate The function invoked per iteration.
  2179. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  2180. * else `false`.
  2181. */
  2182. function arrayEvery(array, predicate) {
  2183. var index = -1,
  2184. length = array == null ? 0 : array.length;
  2185. while (++index < length) {
  2186. if (!predicate(array[index], index, array)) {
  2187. return false;
  2188. }
  2189. }
  2190. return true;
  2191. }
  2192. /**
  2193. * A specialized version of `_.filter` for arrays without support for
  2194. * iteratee shorthands.
  2195. *
  2196. * @private
  2197. * @param {Array} [array] The array to iterate over.
  2198. * @param {Function} predicate The function invoked per iteration.
  2199. * @returns {Array} Returns the new filtered array.
  2200. */
  2201. function arrayFilter(array, predicate) {
  2202. var index = -1,
  2203. length = array == null ? 0 : array.length,
  2204. resIndex = 0,
  2205. result = [];
  2206. while (++index < length) {
  2207. var value = array[index];
  2208. if (predicate(value, index, array)) {
  2209. result[resIndex++] = value;
  2210. }
  2211. }
  2212. return result;
  2213. }
  2214. /**
  2215. * A specialized version of `_.includes` for arrays without support for
  2216. * specifying an index to search from.
  2217. *
  2218. * @private
  2219. * @param {Array} [array] The array to inspect.
  2220. * @param {*} target The value to search for.
  2221. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  2222. */
  2223. function arrayIncludes(array, value) {
  2224. var length = array == null ? 0 : array.length;
  2225. return !!length && baseIndexOf(array, value, 0) > -1;
  2226. }
  2227. /**
  2228. * This function is like `arrayIncludes` except that it accepts a comparator.
  2229. *
  2230. * @private
  2231. * @param {Array} [array] The array to inspect.
  2232. * @param {*} target The value to search for.
  2233. * @param {Function} comparator The comparator invoked per element.
  2234. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  2235. */
  2236. function arrayIncludesWith(array, value, comparator) {
  2237. var index = -1,
  2238. length = array == null ? 0 : array.length;
  2239. while (++index < length) {
  2240. if (comparator(value, array[index])) {
  2241. return true;
  2242. }
  2243. }
  2244. return false;
  2245. }
  2246. /**
  2247. * A specialized version of `_.map` for arrays without support for iteratee
  2248. * shorthands.
  2249. *
  2250. * @private
  2251. * @param {Array} [array] The array to iterate over.
  2252. * @param {Function} iteratee The function invoked per iteration.
  2253. * @returns {Array} Returns the new mapped array.
  2254. */
  2255. function arrayMap(array, iteratee) {
  2256. var index = -1,
  2257. length = array == null ? 0 : array.length,
  2258. result = Array(length);
  2259. while (++index < length) {
  2260. result[index] = iteratee(array[index], index, array);
  2261. }
  2262. return result;
  2263. }
  2264. /**
  2265. * Appends the elements of `values` to `array`.
  2266. *
  2267. * @private
  2268. * @param {Array} array The array to modify.
  2269. * @param {Array} values The values to append.
  2270. * @returns {Array} Returns `array`.
  2271. */
  2272. function arrayPush(array, values) {
  2273. var index = -1,
  2274. length = values.length,
  2275. offset = array.length;
  2276. while (++index < length) {
  2277. array[offset + index] = values[index];
  2278. }
  2279. return array;
  2280. }
  2281. /**
  2282. * A specialized version of `_.reduce` for arrays without support for
  2283. * iteratee shorthands.
  2284. *
  2285. * @private
  2286. * @param {Array} [array] The array to iterate over.
  2287. * @param {Function} iteratee The function invoked per iteration.
  2288. * @param {*} [accumulator] The initial value.
  2289. * @param {boolean} [initAccum] Specify using the first element of `array` as
  2290. * the initial value.
  2291. * @returns {*} Returns the accumulated value.
  2292. */
  2293. function arrayReduce(array, iteratee, accumulator, initAccum) {
  2294. var index = -1,
  2295. length = array == null ? 0 : array.length;
  2296. if (initAccum && length) {
  2297. accumulator = array[++index];
  2298. }
  2299. while (++index < length) {
  2300. accumulator = iteratee(accumulator, array[index], index, array);
  2301. }
  2302. return accumulator;
  2303. }
  2304. /**
  2305. * A specialized version of `_.reduceRight` for arrays without support for
  2306. * iteratee shorthands.
  2307. *
  2308. * @private
  2309. * @param {Array} [array] The array to iterate over.
  2310. * @param {Function} iteratee The function invoked per iteration.
  2311. * @param {*} [accumulator] The initial value.
  2312. * @param {boolean} [initAccum] Specify using the last element of `array` as
  2313. * the initial value.
  2314. * @returns {*} Returns the accumulated value.
  2315. */
  2316. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  2317. var length = array == null ? 0 : array.length;
  2318. if (initAccum && length) {
  2319. accumulator = array[--length];
  2320. }
  2321. while (length--) {
  2322. accumulator = iteratee(accumulator, array[length], length, array);
  2323. }
  2324. return accumulator;
  2325. }
  2326. /**
  2327. * A specialized version of `_.some` for arrays without support for iteratee
  2328. * shorthands.
  2329. *
  2330. * @private
  2331. * @param {Array} [array] The array to iterate over.
  2332. * @param {Function} predicate The function invoked per iteration.
  2333. * @returns {boolean} Returns `true` if any element passes the predicate check,
  2334. * else `false`.
  2335. */
  2336. function arraySome(array, predicate) {
  2337. var index = -1,
  2338. length = array == null ? 0 : array.length;
  2339. while (++index < length) {
  2340. if (predicate(array[index], index, array)) {
  2341. return true;
  2342. }
  2343. }
  2344. return false;
  2345. }
  2346. /**
  2347. * Gets the size of an ASCII `string`.
  2348. *
  2349. * @private
  2350. * @param {string} string The string inspect.
  2351. * @returns {number} Returns the string size.
  2352. */
  2353. var asciiSize = baseProperty('length');
  2354. /**
  2355. * Converts an ASCII `string` to an array.
  2356. *
  2357. * @private
  2358. * @param {string} string The string to convert.
  2359. * @returns {Array} Returns the converted array.
  2360. */
  2361. function asciiToArray(string) {
  2362. return string.split('');
  2363. }
  2364. /**
  2365. * Splits an ASCII `string` into an array of its words.
  2366. *
  2367. * @private
  2368. * @param {string} The string to inspect.
  2369. * @returns {Array} Returns the words of `string`.
  2370. */
  2371. function asciiWords(string) {
  2372. return string.match(reAsciiWord) || [];
  2373. }
  2374. /**
  2375. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  2376. * without support for iteratee shorthands, which iterates over `collection`
  2377. * using `eachFunc`.
  2378. *
  2379. * @private
  2380. * @param {Array|Object} collection The collection to inspect.
  2381. * @param {Function} predicate The function invoked per iteration.
  2382. * @param {Function} eachFunc The function to iterate over `collection`.
  2383. * @returns {*} Returns the found element or its key, else `undefined`.
  2384. */
  2385. function baseFindKey(collection, predicate, eachFunc) {
  2386. var result;
  2387. eachFunc(collection, function(value, key, collection) {
  2388. if (predicate(value, key, collection)) {
  2389. result = key;
  2390. return false;
  2391. }
  2392. });
  2393. return result;
  2394. }
  2395. /**
  2396. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  2397. * support for iteratee shorthands.
  2398. *
  2399. * @private
  2400. * @param {Array} array The array to inspect.
  2401. * @param {Function} predicate The function invoked per iteration.
  2402. * @param {number} fromIndex The index to search from.
  2403. * @param {boolean} [fromRight] Specify iterating from right to left.
  2404. * @returns {number} Returns the index of the matched value, else `-1`.
  2405. */
  2406. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  2407. var length = array.length,
  2408. index = fromIndex + (fromRight ? 1 : -1);
  2409. while ((fromRight ? index-- : ++index < length)) {
  2410. if (predicate(array[index], index, array)) {
  2411. return index;
  2412. }
  2413. }
  2414. return -1;
  2415. }
  2416. /**
  2417. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  2418. *
  2419. * @private
  2420. * @param {Array} array The array to inspect.
  2421. * @param {*} value The value to search for.
  2422. * @param {number} fromIndex The index to search from.
  2423. * @returns {number} Returns the index of the matched value, else `-1`.
  2424. */
  2425. function baseIndexOf(array, value, fromIndex) {
  2426. return value === value
  2427. ? strictIndexOf(array, value, fromIndex)
  2428. : baseFindIndex(array, baseIsNaN, fromIndex);
  2429. }
  2430. /**
  2431. * This function is like `baseIndexOf` except that it accepts a comparator.
  2432. *
  2433. * @private
  2434. * @param {Array} array The array to inspect.
  2435. * @param {*} value The value to search for.
  2436. * @param {number} fromIndex The index to search from.
  2437. * @param {Function} comparator The comparator invoked per element.
  2438. * @returns {number} Returns the index of the matched value, else `-1`.
  2439. */
  2440. function baseIndexOfWith(array, value, fromIndex, comparator) {
  2441. var index = fromIndex - 1,
  2442. length = array.length;
  2443. while (++index < length) {
  2444. if (comparator(array[index], value)) {
  2445. return index;
  2446. }
  2447. }
  2448. return -1;
  2449. }
  2450. /**
  2451. * The base implementation of `_.isNaN` without support for number objects.
  2452. *
  2453. * @private
  2454. * @param {*} value The value to check.
  2455. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  2456. */
  2457. function baseIsNaN(value) {
  2458. return value !== value;
  2459. }
  2460. /**
  2461. * The base implementation of `_.mean` and `_.meanBy` without support for
  2462. * iteratee shorthands.
  2463. *
  2464. * @private
  2465. * @param {Array} array The array to iterate over.
  2466. * @param {Function} iteratee The function invoked per iteration.
  2467. * @returns {number} Returns the mean.
  2468. */
  2469. function baseMean(array, iteratee) {
  2470. var length = array == null ? 0 : array.length;
  2471. return length ? (baseSum(array, iteratee) / length) : NAN;
  2472. }
  2473. /**
  2474. * The base implementation of `_.property` without support for deep paths.
  2475. *
  2476. * @private
  2477. * @param {string} key The key of the property to get.
  2478. * @returns {Function} Returns the new accessor function.
  2479. */
  2480. function baseProperty(key) {
  2481. return function(object) {
  2482. return object == null ? undefined : object[key];
  2483. };
  2484. }
  2485. /**
  2486. * The base implementation of `_.propertyOf` without support for deep paths.
  2487. *
  2488. * @private
  2489. * @param {Object} object The object to query.
  2490. * @returns {Function} Returns the new accessor function.
  2491. */
  2492. function basePropertyOf(object) {
  2493. return function(key) {
  2494. return object == null ? undefined : object[key];
  2495. };
  2496. }
  2497. /**
  2498. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2499. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2500. *
  2501. * @private
  2502. * @param {Array|Object} collection The collection to iterate over.
  2503. * @param {Function} iteratee The function invoked per iteration.
  2504. * @param {*} accumulator The initial value.
  2505. * @param {boolean} initAccum Specify using the first or last element of
  2506. * `collection` as the initial value.
  2507. * @param {Function} eachFunc The function to iterate over `collection`.
  2508. * @returns {*} Returns the accumulated value.
  2509. */
  2510. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2511. eachFunc(collection, function(value, index, collection) {
  2512. accumulator = initAccum
  2513. ? (initAccum = false, value)
  2514. : iteratee(accumulator, value, index, collection);
  2515. });
  2516. return accumulator;
  2517. }
  2518. /**
  2519. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2520. * sort order of `array` and replaces criteria objects with their corresponding
  2521. * values.
  2522. *
  2523. * @private
  2524. * @param {Array} array The array to sort.
  2525. * @param {Function} comparer The function to define sort order.
  2526. * @returns {Array} Returns `array`.
  2527. */
  2528. function baseSortBy(array, comparer) {
  2529. var length = array.length;
  2530. array.sort(comparer);
  2531. while (length--) {
  2532. array[length] = array[length].value;
  2533. }
  2534. return array;
  2535. }
  2536. /**
  2537. * The base implementation of `_.sum` and `_.sumBy` without support for
  2538. * iteratee shorthands.
  2539. *
  2540. * @private
  2541. * @param {Array} array The array to iterate over.
  2542. * @param {Function} iteratee The function invoked per iteration.
  2543. * @returns {number} Returns the sum.
  2544. */
  2545. function baseSum(array, iteratee) {
  2546. var result,
  2547. index = -1,
  2548. length = array.length;
  2549. while (++index < length) {
  2550. var current = iteratee(array[index]);
  2551. if (current !== undefined) {
  2552. result = result === undefined ? current : (result + current);
  2553. }
  2554. }
  2555. return result;
  2556. }
  2557. /**
  2558. * The base implementation of `_.times` without support for iteratee shorthands
  2559. * or max array length checks.
  2560. *
  2561. * @private
  2562. * @param {number} n The number of times to invoke `iteratee`.
  2563. * @param {Function} iteratee The function invoked per iteration.
  2564. * @returns {Array} Returns the array of results.
  2565. */
  2566. function baseTimes(n, iteratee) {
  2567. var index = -1,
  2568. result = Array(n);
  2569. while (++index < n) {
  2570. result[index] = iteratee(index);
  2571. }
  2572. return result;
  2573. }
  2574. /**
  2575. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2576. * of key-value pairs for `object` corresponding to the property names of `props`.
  2577. *
  2578. * @private
  2579. * @param {Object} object The object to query.
  2580. * @param {Array} props The property names to get values for.
  2581. * @returns {Object} Returns the key-value pairs.
  2582. */
  2583. function baseToPairs(object, props) {
  2584. return arrayMap(props, function(key) {
  2585. return [key, object[key]];
  2586. });
  2587. }
  2588. /**
  2589. * The base implementation of `_.trim`.
  2590. *
  2591. * @private
  2592. * @param {string} string The string to trim.
  2593. * @returns {string} Returns the trimmed string.
  2594. */
  2595. function baseTrim(string) {
  2596. return string
  2597. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2598. : string;
  2599. }
  2600. /**
  2601. * The base implementation of `_.unary` without support for storing metadata.
  2602. *
  2603. * @private
  2604. * @param {Function} func The function to cap arguments for.
  2605. * @returns {Function} Returns the new capped function.
  2606. */
  2607. function baseUnary(func) {
  2608. return function(value) {
  2609. return func(value);
  2610. };
  2611. }
  2612. /**
  2613. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2614. * array of `object` property values corresponding to the property names
  2615. * of `props`.
  2616. *
  2617. * @private
  2618. * @param {Object} object The object to query.
  2619. * @param {Array} props The property names to get values for.
  2620. * @returns {Object} Returns the array of property values.
  2621. */
  2622. function baseValues(object, props) {
  2623. return arrayMap(props, function(key) {
  2624. return object[key];
  2625. });
  2626. }
  2627. /**
  2628. * Checks if a `cache` value for `key` exists.
  2629. *
  2630. * @private
  2631. * @param {Object} cache The cache to query.
  2632. * @param {string} key The key of the entry to check.
  2633. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2634. */
  2635. function cacheHas(cache, key) {
  2636. return cache.has(key);
  2637. }
  2638. /**
  2639. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2640. * that is not found in the character symbols.
  2641. *
  2642. * @private
  2643. * @param {Array} strSymbols The string symbols to inspect.
  2644. * @param {Array} chrSymbols The character symbols to find.
  2645. * @returns {number} Returns the index of the first unmatched string symbol.
  2646. */
  2647. function charsStartIndex(strSymbols, chrSymbols) {
  2648. var index = -1,
  2649. length = strSymbols.length;
  2650. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2651. return index;
  2652. }
  2653. /**
  2654. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2655. * that is not found in the character symbols.
  2656. *
  2657. * @private
  2658. * @param {Array} strSymbols The string symbols to inspect.
  2659. * @param {Array} chrSymbols The character symbols to find.
  2660. * @returns {number} Returns the index of the last unmatched string symbol.
  2661. */
  2662. function charsEndIndex(strSymbols, chrSymbols) {
  2663. var index = strSymbols.length;
  2664. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2665. return index;
  2666. }
  2667. /**
  2668. * Gets the number of `placeholder` occurrences in `array`.
  2669. *
  2670. * @private
  2671. * @param {Array} array The array to inspect.
  2672. * @param {*} placeholder The placeholder to search for.
  2673. * @returns {number} Returns the placeholder count.
  2674. */
  2675. function countHolders(array, placeholder) {
  2676. var length = array.length,
  2677. result = 0;
  2678. while (length--) {
  2679. if (array[length] === placeholder) {
  2680. ++result;
  2681. }
  2682. }
  2683. return result;
  2684. }
  2685. /**
  2686. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2687. * letters to basic Latin letters.
  2688. *
  2689. * @private
  2690. * @param {string} letter The matched letter to deburr.
  2691. * @returns {string} Returns the deburred letter.
  2692. */
  2693. var deburrLetter = basePropertyOf(deburredLetters);
  2694. /**
  2695. * Used by `_.escape` to convert characters to HTML entities.
  2696. *
  2697. * @private
  2698. * @param {string} chr The matched character to escape.
  2699. * @returns {string} Returns the escaped character.
  2700. */
  2701. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2702. /**
  2703. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2704. *
  2705. * @private
  2706. * @param {string} chr The matched character to escape.
  2707. * @returns {string} Returns the escaped character.
  2708. */
  2709. function escapeStringChar(chr) {
  2710. return '\\' + stringEscapes[chr];
  2711. }
  2712. /**
  2713. * Gets the value at `key` of `object`.
  2714. *
  2715. * @private
  2716. * @param {Object} [object] The object to query.
  2717. * @param {string} key The key of the property to get.
  2718. * @returns {*} Returns the property value.
  2719. */
  2720. function getValue(object, key) {
  2721. return object == null ? undefined : object[key];
  2722. }
  2723. /**
  2724. * Checks if `string` contains Unicode symbols.
  2725. *
  2726. * @private
  2727. * @param {string} string The string to inspect.
  2728. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2729. */
  2730. function hasUnicode(string) {
  2731. return reHasUnicode.test(string);
  2732. }
  2733. /**
  2734. * Checks if `string` contains a word composed of Unicode symbols.
  2735. *
  2736. * @private
  2737. * @param {string} string The string to inspect.
  2738. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2739. */
  2740. function hasUnicodeWord(string) {
  2741. return reHasUnicodeWord.test(string);
  2742. }
  2743. /**
  2744. * Converts `iterator` to an array.
  2745. *
  2746. * @private
  2747. * @param {Object} iterator The iterator to convert.
  2748. * @returns {Array} Returns the converted array.
  2749. */
  2750. function iteratorToArray(iterator) {
  2751. var data,
  2752. result = [];
  2753. while (!(data = iterator.next()).done) {
  2754. result.push(data.value);
  2755. }
  2756. return result;
  2757. }
  2758. /**
  2759. * Converts `map` to its key-value pairs.
  2760. *
  2761. * @private
  2762. * @param {Object} map The map to convert.
  2763. * @returns {Array} Returns the key-value pairs.
  2764. */
  2765. function mapToArray(map) {
  2766. var index = -1,
  2767. result = Array(map.size);
  2768. map.forEach(function(value, key) {
  2769. result[++index] = [key, value];
  2770. });
  2771. return result;
  2772. }
  2773. /**
  2774. * Creates a unary function that invokes `func` with its argument transformed.
  2775. *
  2776. * @private
  2777. * @param {Function} func The function to wrap.
  2778. * @param {Function} transform The argument transform.
  2779. * @returns {Function} Returns the new function.
  2780. */
  2781. function overArg(func, transform) {
  2782. return function(arg) {
  2783. return func(transform(arg));
  2784. };
  2785. }
  2786. /**
  2787. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2788. * and returns an array of their indexes.
  2789. *
  2790. * @private
  2791. * @param {Array} array The array to modify.
  2792. * @param {*} placeholder The placeholder to replace.
  2793. * @returns {Array} Returns the new array of placeholder indexes.
  2794. */
  2795. function replaceHolders(array, placeholder) {
  2796. var index = -1,
  2797. length = array.length,
  2798. resIndex = 0,
  2799. result = [];
  2800. while (++index < length) {
  2801. var value = array[index];
  2802. if (value === placeholder || value === PLACEHOLDER) {
  2803. array[index] = PLACEHOLDER;
  2804. result[resIndex++] = index;
  2805. }
  2806. }
  2807. return result;
  2808. }
  2809. /**
  2810. * Converts `set` to an array of its values.
  2811. *
  2812. * @private
  2813. * @param {Object} set The set to convert.
  2814. * @returns {Array} Returns the values.
  2815. */
  2816. function setToArray(set) {
  2817. var index = -1,
  2818. result = Array(set.size);
  2819. set.forEach(function(value) {
  2820. result[++index] = value;
  2821. });
  2822. return result;
  2823. }
  2824. /**
  2825. * Converts `set` to its value-value pairs.
  2826. *
  2827. * @private
  2828. * @param {Object} set The set to convert.
  2829. * @returns {Array} Returns the value-value pairs.
  2830. */
  2831. function setToPairs(set) {
  2832. var index = -1,
  2833. result = Array(set.size);
  2834. set.forEach(function(value) {
  2835. result[++index] = [value, value];
  2836. });
  2837. return result;
  2838. }
  2839. /**
  2840. * A specialized version of `_.indexOf` which performs strict equality
  2841. * comparisons of values, i.e. `===`.
  2842. *
  2843. * @private
  2844. * @param {Array} array The array to inspect.
  2845. * @param {*} value The value to search for.
  2846. * @param {number} fromIndex The index to search from.
  2847. * @returns {number} Returns the index of the matched value, else `-1`.
  2848. */
  2849. function strictIndexOf(array, value, fromIndex) {
  2850. var index = fromIndex - 1,
  2851. length = array.length;
  2852. while (++index < length) {
  2853. if (array[index] === value) {
  2854. return index;
  2855. }
  2856. }
  2857. return -1;
  2858. }
  2859. /**
  2860. * A specialized version of `_.lastIndexOf` which performs strict equality
  2861. * comparisons of values, i.e. `===`.
  2862. *
  2863. * @private
  2864. * @param {Array} array The array to inspect.
  2865. * @param {*} value The value to search for.
  2866. * @param {number} fromIndex The index to search from.
  2867. * @returns {number} Returns the index of the matched value, else `-1`.
  2868. */
  2869. function strictLastIndexOf(array, value, fromIndex) {
  2870. var index = fromIndex + 1;
  2871. while (index--) {
  2872. if (array[index] === value) {
  2873. return index;
  2874. }
  2875. }
  2876. return index;
  2877. }
  2878. /**
  2879. * Gets the number of symbols in `string`.
  2880. *
  2881. * @private
  2882. * @param {string} string The string to inspect.
  2883. * @returns {number} Returns the string size.
  2884. */
  2885. function stringSize(string) {
  2886. return hasUnicode(string)
  2887. ? unicodeSize(string)
  2888. : asciiSize(string);
  2889. }
  2890. /**
  2891. * Converts `string` to an array.
  2892. *
  2893. * @private
  2894. * @param {string} string The string to convert.
  2895. * @returns {Array} Returns the converted array.
  2896. */
  2897. function stringToArray(string) {
  2898. return hasUnicode(string)
  2899. ? unicodeToArray(string)
  2900. : asciiToArray(string);
  2901. }
  2902. /**
  2903. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2904. * character of `string`.
  2905. *
  2906. * @private
  2907. * @param {string} string The string to inspect.
  2908. * @returns {number} Returns the index of the last non-whitespace character.
  2909. */
  2910. function trimmedEndIndex(string) {
  2911. var index = string.length;
  2912. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2913. return index;
  2914. }
  2915. /**
  2916. * Used by `_.unescape` to convert HTML entities to characters.
  2917. *
  2918. * @private
  2919. * @param {string} chr The matched character to unescape.
  2920. * @returns {string} Returns the unescaped character.
  2921. */
  2922. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2923. /**
  2924. * Gets the size of a Unicode `string`.
  2925. *
  2926. * @private
  2927. * @param {string} string The string inspect.
  2928. * @returns {number} Returns the string size.
  2929. */
  2930. function unicodeSize(string) {
  2931. var result = reUnicode.lastIndex = 0;
  2932. while (reUnicode.test(string)) {
  2933. ++result;
  2934. }
  2935. return result;
  2936. }
  2937. /**
  2938. * Converts a Unicode `string` to an array.
  2939. *
  2940. * @private
  2941. * @param {string} string The string to convert.
  2942. * @returns {Array} Returns the converted array.
  2943. */
  2944. function unicodeToArray(string) {
  2945. return string.match(reUnicode) || [];
  2946. }
  2947. /**
  2948. * Splits a Unicode `string` into an array of its words.
  2949. *
  2950. * @private
  2951. * @param {string} The string to inspect.
  2952. * @returns {Array} Returns the words of `string`.
  2953. */
  2954. function unicodeWords(string) {
  2955. return string.match(reUnicodeWord) || [];
  2956. }
  2957. /*--------------------------------------------------------------------------*/
  2958. /**
  2959. * Create a new pristine `lodash` function using the `context` object.
  2960. *
  2961. * @static
  2962. * @memberOf _
  2963. * @since 1.1.0
  2964. * @category Util
  2965. * @param {Object} [context=root] The context object.
  2966. * @returns {Function} Returns a new `lodash` function.
  2967. * @example
  2968. *
  2969. * _.mixin({ 'foo': _.constant('foo') });
  2970. *
  2971. * var lodash = _.runInContext();
  2972. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2973. *
  2974. * _.isFunction(_.foo);
  2975. * // => true
  2976. * _.isFunction(_.bar);
  2977. * // => false
  2978. *
  2979. * lodash.isFunction(lodash.foo);
  2980. * // => false
  2981. * lodash.isFunction(lodash.bar);
  2982. * // => true
  2983. *
  2984. * // Create a suped-up `defer` in Node.js.
  2985. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2986. */
  2987. var runInContext = (function runInContext(context) {
  2988. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2989. /** Built-in constructor references. */
  2990. var Array = context.Array,
  2991. Date = context.Date,
  2992. Error = context.Error,
  2993. Function = context.Function,
  2994. Math = context.Math,
  2995. Object = context.Object,
  2996. RegExp = context.RegExp,
  2997. String = context.String,
  2998. TypeError = context.TypeError;
  2999. /** Used for built-in method references. */
  3000. var arrayProto = Array.prototype,
  3001. funcProto = Function.prototype,
  3002. objectProto = Object.prototype;
  3003. /** Used to detect overreaching core-js shims. */
  3004. var coreJsData = context['__core-js_shared__'];
  3005. /** Used to resolve the decompiled source of functions. */
  3006. var funcToString = funcProto.toString;
  3007. /** Used to check objects for own properties. */
  3008. var hasOwnProperty = objectProto.hasOwnProperty;
  3009. /** Used to generate unique IDs. */
  3010. var idCounter = 0;
  3011. /** Used to detect methods masquerading as native. */
  3012. var maskSrcKey = (function() {
  3013. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  3014. return uid ? ('Symbol(src)_1.' + uid) : '';
  3015. }());
  3016. /**
  3017. * Used to resolve the
  3018. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  3019. * of values.
  3020. */
  3021. var nativeObjectToString = objectProto.toString;
  3022. /** Used to infer the `Object` constructor. */
  3023. var objectCtorString = funcToString.call(Object);
  3024. /** Used to restore the original `_` reference in `_.noConflict`. */
  3025. var oldDash = root._;
  3026. /** Used to detect if a method is native. */
  3027. var reIsNative = RegExp('^' +
  3028. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  3029. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  3030. );
  3031. /** Built-in value references. */
  3032. var Buffer = moduleExports ? context.Buffer : undefined,
  3033. Symbol = context.Symbol,
  3034. Uint8Array = context.Uint8Array,
  3035. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  3036. getPrototype = overArg(Object.getPrototypeOf, Object),
  3037. objectCreate = Object.create,
  3038. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  3039. splice = arrayProto.splice,
  3040. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  3041. symIterator = Symbol ? Symbol.iterator : undefined,
  3042. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  3043. var defineProperty = (function() {
  3044. try {
  3045. var func = getNative(Object, 'defineProperty');
  3046. func({}, '', {});
  3047. return func;
  3048. } catch (e) {}
  3049. }());
  3050. /** Mocked built-ins. */
  3051. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  3052. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  3053. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  3054. /* Built-in method references for those with the same name as other `lodash` methods. */
  3055. var nativeCeil = Math.ceil,
  3056. nativeFloor = Math.floor,
  3057. nativeGetSymbols = Object.getOwnPropertySymbols,
  3058. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  3059. nativeIsFinite = context.isFinite,
  3060. nativeJoin = arrayProto.join,
  3061. nativeKeys = overArg(Object.keys, Object),
  3062. nativeMax = Math.max,
  3063. nativeMin = Math.min,
  3064. nativeNow = Date.now,
  3065. nativeParseInt = context.parseInt,
  3066. nativeRandom = Math.random,
  3067. nativeReverse = arrayProto.reverse;
  3068. /* Built-in method references that are verified to be native. */
  3069. var DataView = getNative(context, 'DataView'),
  3070. Map = getNative(context, 'Map'),
  3071. Promise = getNative(context, 'Promise'),
  3072. Set = getNative(context, 'Set'),
  3073. WeakMap = getNative(context, 'WeakMap'),
  3074. nativeCreate = getNative(Object, 'create');
  3075. /** Used to store function metadata. */
  3076. var metaMap = WeakMap && new WeakMap;
  3077. /** Used to lookup unminified function names. */
  3078. var realNames = {};
  3079. /** Used to detect maps, sets, and weakmaps. */
  3080. var dataViewCtorString = toSource(DataView),
  3081. mapCtorString = toSource(Map),
  3082. promiseCtorString = toSource(Promise),
  3083. setCtorString = toSource(Set),
  3084. weakMapCtorString = toSource(WeakMap);
  3085. /** Used to convert symbols to primitives and strings. */
  3086. var symbolProto = Symbol ? Symbol.prototype : undefined,
  3087. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  3088. symbolToString = symbolProto ? symbolProto.toString : undefined;
  3089. /*------------------------------------------------------------------------*/
  3090. /**
  3091. * Creates a `lodash` object which wraps `value` to enable implicit method
  3092. * chain sequences. Methods that operate on and return arrays, collections,
  3093. * and functions can be chained together. Methods that retrieve a single value
  3094. * or may return a primitive value will automatically end the chain sequence
  3095. * and return the unwrapped value. Otherwise, the value must be unwrapped
  3096. * with `_#value`.
  3097. *
  3098. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  3099. * enabled using `_.chain`.
  3100. *
  3101. * The execution of chained methods is lazy, that is, it's deferred until
  3102. * `_#value` is implicitly or explicitly called.
  3103. *
  3104. * Lazy evaluation allows several methods to support shortcut fusion.
  3105. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  3106. * the creation of intermediate arrays and can greatly reduce the number of
  3107. * iteratee executions. Sections of a chain sequence qualify for shortcut
  3108. * fusion if the section is applied to an array and iteratees accept only
  3109. * one argument. The heuristic for whether a section qualifies for shortcut
  3110. * fusion is subject to change.
  3111. *
  3112. * Chaining is supported in custom builds as long as the `_#value` method is
  3113. * directly or indirectly included in the build.
  3114. *
  3115. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  3116. *
  3117. * The wrapper `Array` methods are:
  3118. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  3119. *
  3120. * The wrapper `String` methods are:
  3121. * `replace` and `split`
  3122. *
  3123. * The wrapper methods that support shortcut fusion are:
  3124. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  3125. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  3126. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  3127. *
  3128. * The chainable wrapper methods are:
  3129. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  3130. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  3131. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  3132. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  3133. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  3134. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  3135. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  3136. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  3137. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  3138. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  3139. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  3140. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  3141. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  3142. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  3143. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  3144. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  3145. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  3146. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  3147. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  3148. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  3149. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  3150. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  3151. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  3152. * `zipObject`, `zipObjectDeep`, and `zipWith`
  3153. *
  3154. * The wrapper methods that are **not** chainable by default are:
  3155. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  3156. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  3157. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  3158. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  3159. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  3160. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  3161. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  3162. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  3163. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  3164. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  3165. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  3166. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  3167. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  3168. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  3169. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  3170. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  3171. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  3172. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  3173. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  3174. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  3175. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  3176. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  3177. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  3178. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  3179. * `upperFirst`, `value`, and `words`
  3180. *
  3181. * @name _
  3182. * @constructor
  3183. * @category Seq
  3184. * @param {*} value The value to wrap in a `lodash` instance.
  3185. * @returns {Object} Returns the new `lodash` wrapper instance.
  3186. * @example
  3187. *
  3188. * function square(n) {
  3189. * return n * n;
  3190. * }
  3191. *
  3192. * var wrapped = _([1, 2, 3]);
  3193. *
  3194. * // Returns an unwrapped value.
  3195. * wrapped.reduce(_.add);
  3196. * // => 6
  3197. *
  3198. * // Returns a wrapped value.
  3199. * var squares = wrapped.map(square);
  3200. *
  3201. * _.isArray(squares);
  3202. * // => false
  3203. *
  3204. * _.isArray(squares.value());
  3205. * // => true
  3206. */
  3207. function lodash(value) {
  3208. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  3209. if (value instanceof LodashWrapper) {
  3210. return value;
  3211. }
  3212. if (hasOwnProperty.call(value, '__wrapped__')) {
  3213. return wrapperClone(value);
  3214. }
  3215. }
  3216. return new LodashWrapper(value);
  3217. }
  3218. /**
  3219. * The base implementation of `_.create` without support for assigning
  3220. * properties to the created object.
  3221. *
  3222. * @private
  3223. * @param {Object} proto The object to inherit from.
  3224. * @returns {Object} Returns the new object.
  3225. */
  3226. var baseCreate = (function() {
  3227. function object() {}
  3228. return function(proto) {
  3229. if (!isObject(proto)) {
  3230. return {};
  3231. }
  3232. if (objectCreate) {
  3233. return objectCreate(proto);
  3234. }
  3235. object.prototype = proto;
  3236. var result = new object;
  3237. object.prototype = undefined;
  3238. return result;
  3239. };
  3240. }());
  3241. /**
  3242. * The function whose prototype chain sequence wrappers inherit from.
  3243. *
  3244. * @private
  3245. */
  3246. function baseLodash() {
  3247. // No operation performed.
  3248. }
  3249. /**
  3250. * The base constructor for creating `lodash` wrapper objects.
  3251. *
  3252. * @private
  3253. * @param {*} value The value to wrap.
  3254. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  3255. */
  3256. function LodashWrapper(value, chainAll) {
  3257. this.__wrapped__ = value;
  3258. this.__actions__ = [];
  3259. this.__chain__ = !!chainAll;
  3260. this.__index__ = 0;
  3261. this.__values__ = undefined;
  3262. }
  3263. /**
  3264. * By default, the template delimiters used by lodash are like those in
  3265. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  3266. * following template settings to use alternative delimiters.
  3267. *
  3268. * @static
  3269. * @memberOf _
  3270. * @type {Object}
  3271. */
  3272. lodash.templateSettings = {
  3273. /**
  3274. * Used to detect `data` property values to be HTML-escaped.
  3275. *
  3276. * @memberOf _.templateSettings
  3277. * @type {RegExp}
  3278. */
  3279. 'escape': reEscape,
  3280. /**
  3281. * Used to detect code to be evaluated.
  3282. *
  3283. * @memberOf _.templateSettings
  3284. * @type {RegExp}
  3285. */
  3286. 'evaluate': reEvaluate,
  3287. /**
  3288. * Used to detect `data` property values to inject.
  3289. *
  3290. * @memberOf _.templateSettings
  3291. * @type {RegExp}
  3292. */
  3293. 'interpolate': reInterpolate,
  3294. /**
  3295. * Used to reference the data object in the template text.
  3296. *
  3297. * @memberOf _.templateSettings
  3298. * @type {string}
  3299. */
  3300. 'variable': '',
  3301. /**
  3302. * Used to import variables into the compiled template.
  3303. *
  3304. * @memberOf _.templateSettings
  3305. * @type {Object}
  3306. */
  3307. 'imports': {
  3308. /**
  3309. * A reference to the `lodash` function.
  3310. *
  3311. * @memberOf _.templateSettings.imports
  3312. * @type {Function}
  3313. */
  3314. '_': lodash
  3315. }
  3316. };
  3317. // Ensure wrappers are instances of `baseLodash`.
  3318. lodash.prototype = baseLodash.prototype;
  3319. lodash.prototype.constructor = lodash;
  3320. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  3321. LodashWrapper.prototype.constructor = LodashWrapper;
  3322. /*------------------------------------------------------------------------*/
  3323. /**
  3324. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  3325. *
  3326. * @private
  3327. * @constructor
  3328. * @param {*} value The value to wrap.
  3329. */
  3330. function LazyWrapper(value) {
  3331. this.__wrapped__ = value;
  3332. this.__actions__ = [];
  3333. this.__dir__ = 1;
  3334. this.__filtered__ = false;
  3335. this.__iteratees__ = [];
  3336. this.__takeCount__ = MAX_ARRAY_LENGTH;
  3337. this.__views__ = [];
  3338. }
  3339. /**
  3340. * Creates a clone of the lazy wrapper object.
  3341. *
  3342. * @private
  3343. * @name clone
  3344. * @memberOf LazyWrapper
  3345. * @returns {Object} Returns the cloned `LazyWrapper` object.
  3346. */
  3347. function lazyClone() {
  3348. var result = new LazyWrapper(this.__wrapped__);
  3349. result.__actions__ = copyArray(this.__actions__);
  3350. result.__dir__ = this.__dir__;
  3351. result.__filtered__ = this.__filtered__;
  3352. result.__iteratees__ = copyArray(this.__iteratees__);
  3353. result.__takeCount__ = this.__takeCount__;
  3354. result.__views__ = copyArray(this.__views__);
  3355. return result;
  3356. }
  3357. /**
  3358. * Reverses the direction of lazy iteration.
  3359. *
  3360. * @private
  3361. * @name reverse
  3362. * @memberOf LazyWrapper
  3363. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  3364. */
  3365. function lazyReverse() {
  3366. if (this.__filtered__) {
  3367. var result = new LazyWrapper(this);
  3368. result.__dir__ = -1;
  3369. result.__filtered__ = true;
  3370. } else {
  3371. result = this.clone();
  3372. result.__dir__ *= -1;
  3373. }
  3374. return result;
  3375. }
  3376. /**
  3377. * Extracts the unwrapped value from its lazy wrapper.
  3378. *
  3379. * @private
  3380. * @name value
  3381. * @memberOf LazyWrapper
  3382. * @returns {*} Returns the unwrapped value.
  3383. */
  3384. function lazyValue() {
  3385. var array = this.__wrapped__.value(),
  3386. dir = this.__dir__,
  3387. isArr = isArray(array),
  3388. isRight = dir < 0,
  3389. arrLength = isArr ? array.length : 0,
  3390. view = getView(0, arrLength, this.__views__),
  3391. start = view.start,
  3392. end = view.end,
  3393. length = end - start,
  3394. index = isRight ? end : (start - 1),
  3395. iteratees = this.__iteratees__,
  3396. iterLength = iteratees.length,
  3397. resIndex = 0,
  3398. takeCount = nativeMin(length, this.__takeCount__);
  3399. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  3400. return baseWrapperValue(array, this.__actions__);
  3401. }
  3402. var result = [];
  3403. outer:
  3404. while (length-- && resIndex < takeCount) {
  3405. index += dir;
  3406. var iterIndex = -1,
  3407. value = array[index];
  3408. while (++iterIndex < iterLength) {
  3409. var data = iteratees[iterIndex],
  3410. iteratee = data.iteratee,
  3411. type = data.type,
  3412. computed = iteratee(value);
  3413. if (type == LAZY_MAP_FLAG) {
  3414. value = computed;
  3415. } else if (!computed) {
  3416. if (type == LAZY_FILTER_FLAG) {
  3417. continue outer;
  3418. } else {
  3419. break outer;
  3420. }
  3421. }
  3422. }
  3423. result[resIndex++] = value;
  3424. }
  3425. return result;
  3426. }
  3427. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  3428. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  3429. LazyWrapper.prototype.constructor = LazyWrapper;
  3430. /*------------------------------------------------------------------------*/
  3431. /**
  3432. * Creates a hash object.
  3433. *
  3434. * @private
  3435. * @constructor
  3436. * @param {Array} [entries] The key-value pairs to cache.
  3437. */
  3438. function Hash(entries) {
  3439. var index = -1,
  3440. length = entries == null ? 0 : entries.length;
  3441. this.clear();
  3442. while (++index < length) {
  3443. var entry = entries[index];
  3444. this.set(entry[0], entry[1]);
  3445. }
  3446. }
  3447. /**
  3448. * Removes all key-value entries from the hash.
  3449. *
  3450. * @private
  3451. * @name clear
  3452. * @memberOf Hash
  3453. */
  3454. function hashClear() {
  3455. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3456. this.size = 0;
  3457. }
  3458. /**
  3459. * Removes `key` and its value from the hash.
  3460. *
  3461. * @private
  3462. * @name delete
  3463. * @memberOf Hash
  3464. * @param {Object} hash The hash to modify.
  3465. * @param {string} key The key of the value to remove.
  3466. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3467. */
  3468. function hashDelete(key) {
  3469. var result = this.has(key) && delete this.__data__[key];
  3470. this.size -= result ? 1 : 0;
  3471. return result;
  3472. }
  3473. /**
  3474. * Gets the hash value for `key`.
  3475. *
  3476. * @private
  3477. * @name get
  3478. * @memberOf Hash
  3479. * @param {string} key The key of the value to get.
  3480. * @returns {*} Returns the entry value.
  3481. */
  3482. function hashGet(key) {
  3483. var data = this.__data__;
  3484. if (nativeCreate) {
  3485. var result = data[key];
  3486. return result === HASH_UNDEFINED ? undefined : result;
  3487. }
  3488. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3489. }
  3490. /**
  3491. * Checks if a hash value for `key` exists.
  3492. *
  3493. * @private
  3494. * @name has
  3495. * @memberOf Hash
  3496. * @param {string} key The key of the entry to check.
  3497. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3498. */
  3499. function hashHas(key) {
  3500. var data = this.__data__;
  3501. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3502. }
  3503. /**
  3504. * Sets the hash `key` to `value`.
  3505. *
  3506. * @private
  3507. * @name set
  3508. * @memberOf Hash
  3509. * @param {string} key The key of the value to set.
  3510. * @param {*} value The value to set.
  3511. * @returns {Object} Returns the hash instance.
  3512. */
  3513. function hashSet(key, value) {
  3514. var data = this.__data__;
  3515. this.size += this.has(key) ? 0 : 1;
  3516. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3517. return this;
  3518. }
  3519. // Add methods to `Hash`.
  3520. Hash.prototype.clear = hashClear;
  3521. Hash.prototype['delete'] = hashDelete;
  3522. Hash.prototype.get = hashGet;
  3523. Hash.prototype.has = hashHas;
  3524. Hash.prototype.set = hashSet;
  3525. /*------------------------------------------------------------------------*/
  3526. /**
  3527. * Creates an list cache object.
  3528. *
  3529. * @private
  3530. * @constructor
  3531. * @param {Array} [entries] The key-value pairs to cache.
  3532. */
  3533. function ListCache(entries) {
  3534. var index = -1,
  3535. length = entries == null ? 0 : entries.length;
  3536. this.clear();
  3537. while (++index < length) {
  3538. var entry = entries[index];
  3539. this.set(entry[0], entry[1]);
  3540. }
  3541. }
  3542. /**
  3543. * Removes all key-value entries from the list cache.
  3544. *
  3545. * @private
  3546. * @name clear
  3547. * @memberOf ListCache
  3548. */
  3549. function listCacheClear() {
  3550. this.__data__ = [];
  3551. this.size = 0;
  3552. }
  3553. /**
  3554. * Removes `key` and its value from the list cache.
  3555. *
  3556. * @private
  3557. * @name delete
  3558. * @memberOf ListCache
  3559. * @param {string} key The key of the value to remove.
  3560. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3561. */
  3562. function listCacheDelete(key) {
  3563. var data = this.__data__,
  3564. index = assocIndexOf(data, key);
  3565. if (index < 0) {
  3566. return false;
  3567. }
  3568. var lastIndex = data.length - 1;
  3569. if (index == lastIndex) {
  3570. data.pop();
  3571. } else {
  3572. splice.call(data, index, 1);
  3573. }
  3574. --this.size;
  3575. return true;
  3576. }
  3577. /**
  3578. * Gets the list cache value for `key`.
  3579. *
  3580. * @private
  3581. * @name get
  3582. * @memberOf ListCache
  3583. * @param {string} key The key of the value to get.
  3584. * @returns {*} Returns the entry value.
  3585. */
  3586. function listCacheGet(key) {
  3587. var data = this.__data__,
  3588. index = assocIndexOf(data, key);
  3589. return index < 0 ? undefined : data[index][1];
  3590. }
  3591. /**
  3592. * Checks if a list cache value for `key` exists.
  3593. *
  3594. * @private
  3595. * @name has
  3596. * @memberOf ListCache
  3597. * @param {string} key The key of the entry to check.
  3598. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3599. */
  3600. function listCacheHas(key) {
  3601. return assocIndexOf(this.__data__, key) > -1;
  3602. }
  3603. /**
  3604. * Sets the list cache `key` to `value`.
  3605. *
  3606. * @private
  3607. * @name set
  3608. * @memberOf ListCache
  3609. * @param {string} key The key of the value to set.
  3610. * @param {*} value The value to set.
  3611. * @returns {Object} Returns the list cache instance.
  3612. */
  3613. function listCacheSet(key, value) {
  3614. var data = this.__data__,
  3615. index = assocIndexOf(data, key);
  3616. if (index < 0) {
  3617. ++this.size;
  3618. data.push([key, value]);
  3619. } else {
  3620. data[index][1] = value;
  3621. }
  3622. return this;
  3623. }
  3624. // Add methods to `ListCache`.
  3625. ListCache.prototype.clear = listCacheClear;
  3626. ListCache.prototype['delete'] = listCacheDelete;
  3627. ListCache.prototype.get = listCacheGet;
  3628. ListCache.prototype.has = listCacheHas;
  3629. ListCache.prototype.set = listCacheSet;
  3630. /*------------------------------------------------------------------------*/
  3631. /**
  3632. * Creates a map cache object to store key-value pairs.
  3633. *
  3634. * @private
  3635. * @constructor
  3636. * @param {Array} [entries] The key-value pairs to cache.
  3637. */
  3638. function MapCache(entries) {
  3639. var index = -1,
  3640. length = entries == null ? 0 : entries.length;
  3641. this.clear();
  3642. while (++index < length) {
  3643. var entry = entries[index];
  3644. this.set(entry[0], entry[1]);
  3645. }
  3646. }
  3647. /**
  3648. * Removes all key-value entries from the map.
  3649. *
  3650. * @private
  3651. * @name clear
  3652. * @memberOf MapCache
  3653. */
  3654. function mapCacheClear() {
  3655. this.size = 0;
  3656. this.__data__ = {
  3657. 'hash': new Hash,
  3658. 'map': new (Map || ListCache),
  3659. 'string': new Hash
  3660. };
  3661. }
  3662. /**
  3663. * Removes `key` and its value from the map.
  3664. *
  3665. * @private
  3666. * @name delete
  3667. * @memberOf MapCache
  3668. * @param {string} key The key of the value to remove.
  3669. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3670. */
  3671. function mapCacheDelete(key) {
  3672. var result = getMapData(this, key)['delete'](key);
  3673. this.size -= result ? 1 : 0;
  3674. return result;
  3675. }
  3676. /**
  3677. * Gets the map value for `key`.
  3678. *
  3679. * @private
  3680. * @name get
  3681. * @memberOf MapCache
  3682. * @param {string} key The key of the value to get.
  3683. * @returns {*} Returns the entry value.
  3684. */
  3685. function mapCacheGet(key) {
  3686. return getMapData(this, key).get(key);
  3687. }
  3688. /**
  3689. * Checks if a map value for `key` exists.
  3690. *
  3691. * @private
  3692. * @name has
  3693. * @memberOf MapCache
  3694. * @param {string} key The key of the entry to check.
  3695. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3696. */
  3697. function mapCacheHas(key) {
  3698. return getMapData(this, key).has(key);
  3699. }
  3700. /**
  3701. * Sets the map `key` to `value`.
  3702. *
  3703. * @private
  3704. * @name set
  3705. * @memberOf MapCache
  3706. * @param {string} key The key of the value to set.
  3707. * @param {*} value The value to set.
  3708. * @returns {Object} Returns the map cache instance.
  3709. */
  3710. function mapCacheSet(key, value) {
  3711. var data = getMapData(this, key),
  3712. size = data.size;
  3713. data.set(key, value);
  3714. this.size += data.size == size ? 0 : 1;
  3715. return this;
  3716. }
  3717. // Add methods to `MapCache`.
  3718. MapCache.prototype.clear = mapCacheClear;
  3719. MapCache.prototype['delete'] = mapCacheDelete;
  3720. MapCache.prototype.get = mapCacheGet;
  3721. MapCache.prototype.has = mapCacheHas;
  3722. MapCache.prototype.set = mapCacheSet;
  3723. /*------------------------------------------------------------------------*/
  3724. /**
  3725. *
  3726. * Creates an array cache object to store unique values.
  3727. *
  3728. * @private
  3729. * @constructor
  3730. * @param {Array} [values] The values to cache.
  3731. */
  3732. function SetCache(values) {
  3733. var index = -1,
  3734. length = values == null ? 0 : values.length;
  3735. this.__data__ = new MapCache;
  3736. while (++index < length) {
  3737. this.add(values[index]);
  3738. }
  3739. }
  3740. /**
  3741. * Adds `value` to the array cache.
  3742. *
  3743. * @private
  3744. * @name add
  3745. * @memberOf SetCache
  3746. * @alias push
  3747. * @param {*} value The value to cache.
  3748. * @returns {Object} Returns the cache instance.
  3749. */
  3750. function setCacheAdd(value) {
  3751. this.__data__.set(value, HASH_UNDEFINED);
  3752. return this;
  3753. }
  3754. /**
  3755. * Checks if `value` is in the array cache.
  3756. *
  3757. * @private
  3758. * @name has
  3759. * @memberOf SetCache
  3760. * @param {*} value The value to search for.
  3761. * @returns {number} Returns `true` if `value` is found, else `false`.
  3762. */
  3763. function setCacheHas(value) {
  3764. return this.__data__.has(value);
  3765. }
  3766. // Add methods to `SetCache`.
  3767. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3768. SetCache.prototype.has = setCacheHas;
  3769. /*------------------------------------------------------------------------*/
  3770. /**
  3771. * Creates a stack cache object to store key-value pairs.
  3772. *
  3773. * @private
  3774. * @constructor
  3775. * @param {Array} [entries] The key-value pairs to cache.
  3776. */
  3777. function Stack(entries) {
  3778. var data = this.__data__ = new ListCache(entries);
  3779. this.size = data.size;
  3780. }
  3781. /**
  3782. * Removes all key-value entries from the stack.
  3783. *
  3784. * @private
  3785. * @name clear
  3786. * @memberOf Stack
  3787. */
  3788. function stackClear() {
  3789. this.__data__ = new ListCache;
  3790. this.size = 0;
  3791. }
  3792. /**
  3793. * Removes `key` and its value from the stack.
  3794. *
  3795. * @private
  3796. * @name delete
  3797. * @memberOf Stack
  3798. * @param {string} key The key of the value to remove.
  3799. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3800. */
  3801. function stackDelete(key) {
  3802. var data = this.__data__,
  3803. result = data['delete'](key);
  3804. this.size = data.size;
  3805. return result;
  3806. }
  3807. /**
  3808. * Gets the stack value for `key`.
  3809. *
  3810. * @private
  3811. * @name get
  3812. * @memberOf Stack
  3813. * @param {string} key The key of the value to get.
  3814. * @returns {*} Returns the entry value.
  3815. */
  3816. function stackGet(key) {
  3817. return this.__data__.get(key);
  3818. }
  3819. /**
  3820. * Checks if a stack value for `key` exists.
  3821. *
  3822. * @private
  3823. * @name has
  3824. * @memberOf Stack
  3825. * @param {string} key The key of the entry to check.
  3826. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3827. */
  3828. function stackHas(key) {
  3829. return this.__data__.has(key);
  3830. }
  3831. /**
  3832. * Sets the stack `key` to `value`.
  3833. *
  3834. * @private
  3835. * @name set
  3836. * @memberOf Stack
  3837. * @param {string} key The key of the value to set.
  3838. * @param {*} value The value to set.
  3839. * @returns {Object} Returns the stack cache instance.
  3840. */
  3841. function stackSet(key, value) {
  3842. var data = this.__data__;
  3843. if (data instanceof ListCache) {
  3844. var pairs = data.__data__;
  3845. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3846. pairs.push([key, value]);
  3847. this.size = ++data.size;
  3848. return this;
  3849. }
  3850. data = this.__data__ = new MapCache(pairs);
  3851. }
  3852. data.set(key, value);
  3853. this.size = data.size;
  3854. return this;
  3855. }
  3856. // Add methods to `Stack`.
  3857. Stack.prototype.clear = stackClear;
  3858. Stack.prototype['delete'] = stackDelete;
  3859. Stack.prototype.get = stackGet;
  3860. Stack.prototype.has = stackHas;
  3861. Stack.prototype.set = stackSet;
  3862. /*------------------------------------------------------------------------*/
  3863. /**
  3864. * Creates an array of the enumerable property names of the array-like `value`.
  3865. *
  3866. * @private
  3867. * @param {*} value The value to query.
  3868. * @param {boolean} inherited Specify returning inherited property names.
  3869. * @returns {Array} Returns the array of property names.
  3870. */
  3871. function arrayLikeKeys(value, inherited) {
  3872. var isArr = isArray(value),
  3873. isArg = !isArr && isArguments(value),
  3874. isBuff = !isArr && !isArg && isBuffer(value),
  3875. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3876. skipIndexes = isArr || isArg || isBuff || isType,
  3877. result = skipIndexes ? baseTimes(value.length, String) : [],
  3878. length = result.length;
  3879. for (var key in value) {
  3880. if ((inherited || hasOwnProperty.call(value, key)) &&
  3881. !(skipIndexes && (
  3882. // Safari 9 has enumerable `arguments.length` in strict mode.
  3883. key == 'length' ||
  3884. // Node.js 0.10 has enumerable non-index properties on buffers.
  3885. (isBuff && (key == 'offset' || key == 'parent')) ||
  3886. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3887. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3888. // Skip index properties.
  3889. isIndex(key, length)
  3890. ))) {
  3891. result.push(key);
  3892. }
  3893. }
  3894. return result;
  3895. }
  3896. /**
  3897. * A specialized version of `_.sample` for arrays.
  3898. *
  3899. * @private
  3900. * @param {Array} array The array to sample.
  3901. * @returns {*} Returns the random element.
  3902. */
  3903. function arraySample(array) {
  3904. var length = array.length;
  3905. return length ? array[baseRandom(0, length - 1)] : undefined;
  3906. }
  3907. /**
  3908. * A specialized version of `_.sampleSize` for arrays.
  3909. *
  3910. * @private
  3911. * @param {Array} array The array to sample.
  3912. * @param {number} n The number of elements to sample.
  3913. * @returns {Array} Returns the random elements.
  3914. */
  3915. function arraySampleSize(array, n) {
  3916. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3917. }
  3918. /**
  3919. * A specialized version of `_.shuffle` for arrays.
  3920. *
  3921. * @private
  3922. * @param {Array} array The array to shuffle.
  3923. * @returns {Array} Returns the new shuffled array.
  3924. */
  3925. function arrayShuffle(array) {
  3926. return shuffleSelf(copyArray(array));
  3927. }
  3928. /**
  3929. * This function is like `assignValue` except that it doesn't assign
  3930. * `undefined` values.
  3931. *
  3932. * @private
  3933. * @param {Object} object The object to modify.
  3934. * @param {string} key The key of the property to assign.
  3935. * @param {*} value The value to assign.
  3936. */
  3937. function assignMergeValue(object, key, value) {
  3938. if ((value !== undefined && !eq(object[key], value)) ||
  3939. (value === undefined && !(key in object))) {
  3940. baseAssignValue(object, key, value);
  3941. }
  3942. }
  3943. /**
  3944. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3945. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3946. * for equality comparisons.
  3947. *
  3948. * @private
  3949. * @param {Object} object The object to modify.
  3950. * @param {string} key The key of the property to assign.
  3951. * @param {*} value The value to assign.
  3952. */
  3953. function assignValue(object, key, value) {
  3954. var objValue = object[key];
  3955. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3956. (value === undefined && !(key in object))) {
  3957. baseAssignValue(object, key, value);
  3958. }
  3959. }
  3960. /**
  3961. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3962. *
  3963. * @private
  3964. * @param {Array} array The array to inspect.
  3965. * @param {*} key The key to search for.
  3966. * @returns {number} Returns the index of the matched value, else `-1`.
  3967. */
  3968. function assocIndexOf(array, key) {
  3969. var length = array.length;
  3970. while (length--) {
  3971. if (eq(array[length][0], key)) {
  3972. return length;
  3973. }
  3974. }
  3975. return -1;
  3976. }
  3977. /**
  3978. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3979. * by `iteratee` and values set by `setter`.
  3980. *
  3981. * @private
  3982. * @param {Array|Object} collection The collection to iterate over.
  3983. * @param {Function} setter The function to set `accumulator` values.
  3984. * @param {Function} iteratee The iteratee to transform keys.
  3985. * @param {Object} accumulator The initial aggregated object.
  3986. * @returns {Function} Returns `accumulator`.
  3987. */
  3988. function baseAggregator(collection, setter, iteratee, accumulator) {
  3989. baseEach(collection, function(value, key, collection) {
  3990. setter(accumulator, value, iteratee(value), collection);
  3991. });
  3992. return accumulator;
  3993. }
  3994. /**
  3995. * The base implementation of `_.assign` without support for multiple sources
  3996. * or `customizer` functions.
  3997. *
  3998. * @private
  3999. * @param {Object} object The destination object.
  4000. * @param {Object} source The source object.
  4001. * @returns {Object} Returns `object`.
  4002. */
  4003. function baseAssign(object, source) {
  4004. return object && copyObject(source, keys(source), object);
  4005. }
  4006. /**
  4007. * The base implementation of `_.assignIn` without support for multiple sources
  4008. * or `customizer` functions.
  4009. *
  4010. * @private
  4011. * @param {Object} object The destination object.
  4012. * @param {Object} source The source object.
  4013. * @returns {Object} Returns `object`.
  4014. */
  4015. function baseAssignIn(object, source) {
  4016. return object && copyObject(source, keysIn(source), object);
  4017. }
  4018. /**
  4019. * The base implementation of `assignValue` and `assignMergeValue` without
  4020. * value checks.
  4021. *
  4022. * @private
  4023. * @param {Object} object The object to modify.
  4024. * @param {string} key The key of the property to assign.
  4025. * @param {*} value The value to assign.
  4026. */
  4027. function baseAssignValue(object, key, value) {
  4028. if (key == '__proto__' && defineProperty) {
  4029. defineProperty(object, key, {
  4030. 'configurable': true,
  4031. 'enumerable': true,
  4032. 'value': value,
  4033. 'writable': true
  4034. });
  4035. } else {
  4036. object[key] = value;
  4037. }
  4038. }
  4039. /**
  4040. * The base implementation of `_.at` without support for individual paths.
  4041. *
  4042. * @private
  4043. * @param {Object} object The object to iterate over.
  4044. * @param {string[]} paths The property paths to pick.
  4045. * @returns {Array} Returns the picked elements.
  4046. */
  4047. function baseAt(object, paths) {
  4048. var index = -1,
  4049. length = paths.length,
  4050. result = Array(length),
  4051. skip = object == null;
  4052. while (++index < length) {
  4053. result[index] = skip ? undefined : get(object, paths[index]);
  4054. }
  4055. return result;
  4056. }
  4057. /**
  4058. * The base implementation of `_.clamp` which doesn't coerce arguments.
  4059. *
  4060. * @private
  4061. * @param {number} number The number to clamp.
  4062. * @param {number} [lower] The lower bound.
  4063. * @param {number} upper The upper bound.
  4064. * @returns {number} Returns the clamped number.
  4065. */
  4066. function baseClamp(number, lower, upper) {
  4067. if (number === number) {
  4068. if (upper !== undefined) {
  4069. number = number <= upper ? number : upper;
  4070. }
  4071. if (lower !== undefined) {
  4072. number = number >= lower ? number : lower;
  4073. }
  4074. }
  4075. return number;
  4076. }
  4077. /**
  4078. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  4079. * traversed objects.
  4080. *
  4081. * @private
  4082. * @param {*} value The value to clone.
  4083. * @param {boolean} bitmask The bitmask flags.
  4084. * 1 - Deep clone
  4085. * 2 - Flatten inherited properties
  4086. * 4 - Clone symbols
  4087. * @param {Function} [customizer] The function to customize cloning.
  4088. * @param {string} [key] The key of `value`.
  4089. * @param {Object} [object] The parent object of `value`.
  4090. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  4091. * @returns {*} Returns the cloned value.
  4092. */
  4093. function baseClone(value, bitmask, customizer, key, object, stack) {
  4094. var result,
  4095. isDeep = bitmask & CLONE_DEEP_FLAG,
  4096. isFlat = bitmask & CLONE_FLAT_FLAG,
  4097. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  4098. if (customizer) {
  4099. result = object ? customizer(value, key, object, stack) : customizer(value);
  4100. }
  4101. if (result !== undefined) {
  4102. return result;
  4103. }
  4104. if (!isObject(value)) {
  4105. return value;
  4106. }
  4107. var isArr = isArray(value);
  4108. if (isArr) {
  4109. result = initCloneArray(value);
  4110. if (!isDeep) {
  4111. return copyArray(value, result);
  4112. }
  4113. } else {
  4114. var tag = getTag(value),
  4115. isFunc = tag == funcTag || tag == genTag;
  4116. if (isBuffer(value)) {
  4117. return cloneBuffer(value, isDeep);
  4118. }
  4119. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  4120. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  4121. if (!isDeep) {
  4122. return isFlat
  4123. ? copySymbolsIn(value, baseAssignIn(result, value))
  4124. : copySymbols(value, baseAssign(result, value));
  4125. }
  4126. } else {
  4127. if (!cloneableTags[tag]) {
  4128. return object ? value : {};
  4129. }
  4130. result = initCloneByTag(value, tag, isDeep);
  4131. }
  4132. }
  4133. // Check for circular references and return its corresponding clone.
  4134. stack || (stack = new Stack);
  4135. var stacked = stack.get(value);
  4136. if (stacked) {
  4137. return stacked;
  4138. }
  4139. stack.set(value, result);
  4140. if (isSet(value)) {
  4141. value.forEach(function(subValue) {
  4142. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  4143. });
  4144. } else if (isMap(value)) {
  4145. value.forEach(function(subValue, key) {
  4146. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  4147. });
  4148. }
  4149. var keysFunc = isFull
  4150. ? (isFlat ? getAllKeysIn : getAllKeys)
  4151. : (isFlat ? keysIn : keys);
  4152. var props = isArr ? undefined : keysFunc(value);
  4153. arrayEach(props || value, function(subValue, key) {
  4154. if (props) {
  4155. key = subValue;
  4156. subValue = value[key];
  4157. }
  4158. // Recursively populate clone (susceptible to call stack limits).
  4159. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  4160. });
  4161. return result;
  4162. }
  4163. /**
  4164. * The base implementation of `_.conforms` which doesn't clone `source`.
  4165. *
  4166. * @private
  4167. * @param {Object} source The object of property predicates to conform to.
  4168. * @returns {Function} Returns the new spec function.
  4169. */
  4170. function baseConforms(source) {
  4171. var props = keys(source);
  4172. return function(object) {
  4173. return baseConformsTo(object, source, props);
  4174. };
  4175. }
  4176. /**
  4177. * The base implementation of `_.conformsTo` which accepts `props` to check.
  4178. *
  4179. * @private
  4180. * @param {Object} object The object to inspect.
  4181. * @param {Object} source The object of property predicates to conform to.
  4182. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  4183. */
  4184. function baseConformsTo(object, source, props) {
  4185. var length = props.length;
  4186. if (object == null) {
  4187. return !length;
  4188. }
  4189. object = Object(object);
  4190. while (length--) {
  4191. var key = props[length],
  4192. predicate = source[key],
  4193. value = object[key];
  4194. if ((value === undefined && !(key in object)) || !predicate(value)) {
  4195. return false;
  4196. }
  4197. }
  4198. return true;
  4199. }
  4200. /**
  4201. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  4202. * to provide to `func`.
  4203. *
  4204. * @private
  4205. * @param {Function} func The function to delay.
  4206. * @param {number} wait The number of milliseconds to delay invocation.
  4207. * @param {Array} args The arguments to provide to `func`.
  4208. * @returns {number|Object} Returns the timer id or timeout object.
  4209. */
  4210. function baseDelay(func, wait, args) {
  4211. if (typeof func != 'function') {
  4212. throw new TypeError(FUNC_ERROR_TEXT);
  4213. }
  4214. return setTimeout(function() { func.apply(undefined, args); }, wait);
  4215. }
  4216. /**
  4217. * The base implementation of methods like `_.difference` without support
  4218. * for excluding multiple arrays or iteratee shorthands.
  4219. *
  4220. * @private
  4221. * @param {Array} array The array to inspect.
  4222. * @param {Array} values The values to exclude.
  4223. * @param {Function} [iteratee] The iteratee invoked per element.
  4224. * @param {Function} [comparator] The comparator invoked per element.
  4225. * @returns {Array} Returns the new array of filtered values.
  4226. */
  4227. function baseDifference(array, values, iteratee, comparator) {
  4228. var index = -1,
  4229. includes = arrayIncludes,
  4230. isCommon = true,
  4231. length = array.length,
  4232. result = [],
  4233. valuesLength = values.length;
  4234. if (!length) {
  4235. return result;
  4236. }
  4237. if (iteratee) {
  4238. values = arrayMap(values, baseUnary(iteratee));
  4239. }
  4240. if (comparator) {
  4241. includes = arrayIncludesWith;
  4242. isCommon = false;
  4243. }
  4244. else if (values.length >= LARGE_ARRAY_SIZE) {
  4245. includes = cacheHas;
  4246. isCommon = false;
  4247. values = new SetCache(values);
  4248. }
  4249. outer:
  4250. while (++index < length) {
  4251. var value = array[index],
  4252. computed = iteratee == null ? value : iteratee(value);
  4253. value = (comparator || value !== 0) ? value : 0;
  4254. if (isCommon && computed === computed) {
  4255. var valuesIndex = valuesLength;
  4256. while (valuesIndex--) {
  4257. if (values[valuesIndex] === computed) {
  4258. continue outer;
  4259. }
  4260. }
  4261. result.push(value);
  4262. }
  4263. else if (!includes(values, computed, comparator)) {
  4264. result.push(value);
  4265. }
  4266. }
  4267. return result;
  4268. }
  4269. /**
  4270. * The base implementation of `_.forEach` without support for iteratee shorthands.
  4271. *
  4272. * @private
  4273. * @param {Array|Object} collection The collection to iterate over.
  4274. * @param {Function} iteratee The function invoked per iteration.
  4275. * @returns {Array|Object} Returns `collection`.
  4276. */
  4277. var baseEach = createBaseEach(baseForOwn);
  4278. /**
  4279. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  4280. *
  4281. * @private
  4282. * @param {Array|Object} collection The collection to iterate over.
  4283. * @param {Function} iteratee The function invoked per iteration.
  4284. * @returns {Array|Object} Returns `collection`.
  4285. */
  4286. var baseEachRight = createBaseEach(baseForOwnRight, true);
  4287. /**
  4288. * The base implementation of `_.every` without support for iteratee shorthands.
  4289. *
  4290. * @private
  4291. * @param {Array|Object} collection The collection to iterate over.
  4292. * @param {Function} predicate The function invoked per iteration.
  4293. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  4294. * else `false`
  4295. */
  4296. function baseEvery(collection, predicate) {
  4297. var result = true;
  4298. baseEach(collection, function(value, index, collection) {
  4299. result = !!predicate(value, index, collection);
  4300. return result;
  4301. });
  4302. return result;
  4303. }
  4304. /**
  4305. * The base implementation of methods like `_.max` and `_.min` which accepts a
  4306. * `comparator` to determine the extremum value.
  4307. *
  4308. * @private
  4309. * @param {Array} array The array to iterate over.
  4310. * @param {Function} iteratee The iteratee invoked per iteration.
  4311. * @param {Function} comparator The comparator used to compare values.
  4312. * @returns {*} Returns the extremum value.
  4313. */
  4314. function baseExtremum(array, iteratee, comparator) {
  4315. var index = -1,
  4316. length = array.length;
  4317. while (++index < length) {
  4318. var value = array[index],
  4319. current = iteratee(value);
  4320. if (current != null && (computed === undefined
  4321. ? (current === current && !isSymbol(current))
  4322. : comparator(current, computed)
  4323. )) {
  4324. var computed = current,
  4325. result = value;
  4326. }
  4327. }
  4328. return result;
  4329. }
  4330. /**
  4331. * The base implementation of `_.fill` without an iteratee call guard.
  4332. *
  4333. * @private
  4334. * @param {Array} array The array to fill.
  4335. * @param {*} value The value to fill `array` with.
  4336. * @param {number} [start=0] The start position.
  4337. * @param {number} [end=array.length] The end position.
  4338. * @returns {Array} Returns `array`.
  4339. */
  4340. function baseFill(array, value, start, end) {
  4341. var length = array.length;
  4342. start = toInteger(start);
  4343. if (start < 0) {
  4344. start = -start > length ? 0 : (length + start);
  4345. }
  4346. end = (end === undefined || end > length) ? length : toInteger(end);
  4347. if (end < 0) {
  4348. end += length;
  4349. }
  4350. end = start > end ? 0 : toLength(end);
  4351. while (start < end) {
  4352. array[start++] = value;
  4353. }
  4354. return array;
  4355. }
  4356. /**
  4357. * The base implementation of `_.filter` without support for iteratee shorthands.
  4358. *
  4359. * @private
  4360. * @param {Array|Object} collection The collection to iterate over.
  4361. * @param {Function} predicate The function invoked per iteration.
  4362. * @returns {Array} Returns the new filtered array.
  4363. */
  4364. function baseFilter(collection, predicate) {
  4365. var result = [];
  4366. baseEach(collection, function(value, index, collection) {
  4367. if (predicate(value, index, collection)) {
  4368. result.push(value);
  4369. }
  4370. });
  4371. return result;
  4372. }
  4373. /**
  4374. * The base implementation of `_.flatten` with support for restricting flattening.
  4375. *
  4376. * @private
  4377. * @param {Array} array The array to flatten.
  4378. * @param {number} depth The maximum recursion depth.
  4379. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  4380. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  4381. * @param {Array} [result=[]] The initial result value.
  4382. * @returns {Array} Returns the new flattened array.
  4383. */
  4384. function baseFlatten(array, depth, predicate, isStrict, result) {
  4385. var index = -1,
  4386. length = array.length;
  4387. predicate || (predicate = isFlattenable);
  4388. result || (result = []);
  4389. while (++index < length) {
  4390. var value = array[index];
  4391. if (depth > 0 && predicate(value)) {
  4392. if (depth > 1) {
  4393. // Recursively flatten arrays (susceptible to call stack limits).
  4394. baseFlatten(value, depth - 1, predicate, isStrict, result);
  4395. } else {
  4396. arrayPush(result, value);
  4397. }
  4398. } else if (!isStrict) {
  4399. result[result.length] = value;
  4400. }
  4401. }
  4402. return result;
  4403. }
  4404. /**
  4405. * The base implementation of `baseForOwn` which iterates over `object`
  4406. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  4407. * Iteratee functions may exit iteration early by explicitly returning `false`.
  4408. *
  4409. * @private
  4410. * @param {Object} object The object to iterate over.
  4411. * @param {Function} iteratee The function invoked per iteration.
  4412. * @param {Function} keysFunc The function to get the keys of `object`.
  4413. * @returns {Object} Returns `object`.
  4414. */
  4415. var baseFor = createBaseFor();
  4416. /**
  4417. * This function is like `baseFor` except that it iterates over properties
  4418. * in the opposite order.
  4419. *
  4420. * @private
  4421. * @param {Object} object The object to iterate over.
  4422. * @param {Function} iteratee The function invoked per iteration.
  4423. * @param {Function} keysFunc The function to get the keys of `object`.
  4424. * @returns {Object} Returns `object`.
  4425. */
  4426. var baseForRight = createBaseFor(true);
  4427. /**
  4428. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  4429. *
  4430. * @private
  4431. * @param {Object} object The object to iterate over.
  4432. * @param {Function} iteratee The function invoked per iteration.
  4433. * @returns {Object} Returns `object`.
  4434. */
  4435. function baseForOwn(object, iteratee) {
  4436. return object && baseFor(object, iteratee, keys);
  4437. }
  4438. /**
  4439. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  4440. *
  4441. * @private
  4442. * @param {Object} object The object to iterate over.
  4443. * @param {Function} iteratee The function invoked per iteration.
  4444. * @returns {Object} Returns `object`.
  4445. */
  4446. function baseForOwnRight(object, iteratee) {
  4447. return object && baseForRight(object, iteratee, keys);
  4448. }
  4449. /**
  4450. * The base implementation of `_.functions` which creates an array of
  4451. * `object` function property names filtered from `props`.
  4452. *
  4453. * @private
  4454. * @param {Object} object The object to inspect.
  4455. * @param {Array} props The property names to filter.
  4456. * @returns {Array} Returns the function names.
  4457. */
  4458. function baseFunctions(object, props) {
  4459. return arrayFilter(props, function(key) {
  4460. return isFunction(object[key]);
  4461. });
  4462. }
  4463. /**
  4464. * The base implementation of `_.get` without support for default values.
  4465. *
  4466. * @private
  4467. * @param {Object} object The object to query.
  4468. * @param {Array|string} path The path of the property to get.
  4469. * @returns {*} Returns the resolved value.
  4470. */
  4471. function baseGet(object, path) {
  4472. path = castPath(path, object);
  4473. var index = 0,
  4474. length = path.length;
  4475. while (object != null && index < length) {
  4476. object = object[toKey(path[index++])];
  4477. }
  4478. return (index && index == length) ? object : undefined;
  4479. }
  4480. /**
  4481. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4482. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4483. * symbols of `object`.
  4484. *
  4485. * @private
  4486. * @param {Object} object The object to query.
  4487. * @param {Function} keysFunc The function to get the keys of `object`.
  4488. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4489. * @returns {Array} Returns the array of property names and symbols.
  4490. */
  4491. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4492. var result = keysFunc(object);
  4493. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4494. }
  4495. /**
  4496. * The base implementation of `getTag` without fallbacks for buggy environments.
  4497. *
  4498. * @private
  4499. * @param {*} value The value to query.
  4500. * @returns {string} Returns the `toStringTag`.
  4501. */
  4502. function baseGetTag(value) {
  4503. if (value == null) {
  4504. return value === undefined ? undefinedTag : nullTag;
  4505. }
  4506. return (symToStringTag && symToStringTag in Object(value))
  4507. ? getRawTag(value)
  4508. : objectToString(value);
  4509. }
  4510. /**
  4511. * The base implementation of `_.gt` which doesn't coerce arguments.
  4512. *
  4513. * @private
  4514. * @param {*} value The value to compare.
  4515. * @param {*} other The other value to compare.
  4516. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4517. * else `false`.
  4518. */
  4519. function baseGt(value, other) {
  4520. return value > other;
  4521. }
  4522. /**
  4523. * The base implementation of `_.has` without support for deep paths.
  4524. *
  4525. * @private
  4526. * @param {Object} [object] The object to query.
  4527. * @param {Array|string} key The key to check.
  4528. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4529. */
  4530. function baseHas(object, key) {
  4531. return object != null && hasOwnProperty.call(object, key);
  4532. }
  4533. /**
  4534. * The base implementation of `_.hasIn` without support for deep paths.
  4535. *
  4536. * @private
  4537. * @param {Object} [object] The object to query.
  4538. * @param {Array|string} key The key to check.
  4539. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4540. */
  4541. function baseHasIn(object, key) {
  4542. return object != null && key in Object(object);
  4543. }
  4544. /**
  4545. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4546. *
  4547. * @private
  4548. * @param {number} number The number to check.
  4549. * @param {number} start The start of the range.
  4550. * @param {number} end The end of the range.
  4551. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4552. */
  4553. function baseInRange(number, start, end) {
  4554. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4555. }
  4556. /**
  4557. * The base implementation of methods like `_.intersection`, without support
  4558. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4559. *
  4560. * @private
  4561. * @param {Array} arrays The arrays to inspect.
  4562. * @param {Function} [iteratee] The iteratee invoked per element.
  4563. * @param {Function} [comparator] The comparator invoked per element.
  4564. * @returns {Array} Returns the new array of shared values.
  4565. */
  4566. function baseIntersection(arrays, iteratee, comparator) {
  4567. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4568. length = arrays[0].length,
  4569. othLength = arrays.length,
  4570. othIndex = othLength,
  4571. caches = Array(othLength),
  4572. maxLength = Infinity,
  4573. result = [];
  4574. while (othIndex--) {
  4575. var array = arrays[othIndex];
  4576. if (othIndex && iteratee) {
  4577. array = arrayMap(array, baseUnary(iteratee));
  4578. }
  4579. maxLength = nativeMin(array.length, maxLength);
  4580. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4581. ? new SetCache(othIndex && array)
  4582. : undefined;
  4583. }
  4584. array = arrays[0];
  4585. var index = -1,
  4586. seen = caches[0];
  4587. outer:
  4588. while (++index < length && result.length < maxLength) {
  4589. var value = array[index],
  4590. computed = iteratee ? iteratee(value) : value;
  4591. value = (comparator || value !== 0) ? value : 0;
  4592. if (!(seen
  4593. ? cacheHas(seen, computed)
  4594. : includes(result, computed, comparator)
  4595. )) {
  4596. othIndex = othLength;
  4597. while (--othIndex) {
  4598. var cache = caches[othIndex];
  4599. if (!(cache
  4600. ? cacheHas(cache, computed)
  4601. : includes(arrays[othIndex], computed, comparator))
  4602. ) {
  4603. continue outer;
  4604. }
  4605. }
  4606. if (seen) {
  4607. seen.push(computed);
  4608. }
  4609. result.push(value);
  4610. }
  4611. }
  4612. return result;
  4613. }
  4614. /**
  4615. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4616. * `object` with values transformed by `iteratee` and set by `setter`.
  4617. *
  4618. * @private
  4619. * @param {Object} object The object to iterate over.
  4620. * @param {Function} setter The function to set `accumulator` values.
  4621. * @param {Function} iteratee The iteratee to transform values.
  4622. * @param {Object} accumulator The initial inverted object.
  4623. * @returns {Function} Returns `accumulator`.
  4624. */
  4625. function baseInverter(object, setter, iteratee, accumulator) {
  4626. baseForOwn(object, function(value, key, object) {
  4627. setter(accumulator, iteratee(value), key, object);
  4628. });
  4629. return accumulator;
  4630. }
  4631. /**
  4632. * The base implementation of `_.invoke` without support for individual
  4633. * method arguments.
  4634. *
  4635. * @private
  4636. * @param {Object} object The object to query.
  4637. * @param {Array|string} path The path of the method to invoke.
  4638. * @param {Array} args The arguments to invoke the method with.
  4639. * @returns {*} Returns the result of the invoked method.
  4640. */
  4641. function baseInvoke(object, path, args) {
  4642. path = castPath(path, object);
  4643. object = parent(object, path);
  4644. var func = object == null ? object : object[toKey(last(path))];
  4645. return func == null ? undefined : apply(func, object, args);
  4646. }
  4647. /**
  4648. * The base implementation of `_.isArguments`.
  4649. *
  4650. * @private
  4651. * @param {*} value The value to check.
  4652. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4653. */
  4654. function baseIsArguments(value) {
  4655. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4656. }
  4657. /**
  4658. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4659. *
  4660. * @private
  4661. * @param {*} value The value to check.
  4662. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4663. */
  4664. function baseIsArrayBuffer(value) {
  4665. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4666. }
  4667. /**
  4668. * The base implementation of `_.isDate` without Node.js optimizations.
  4669. *
  4670. * @private
  4671. * @param {*} value The value to check.
  4672. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4673. */
  4674. function baseIsDate(value) {
  4675. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4676. }
  4677. /**
  4678. * The base implementation of `_.isEqual` which supports partial comparisons
  4679. * and tracks traversed objects.
  4680. *
  4681. * @private
  4682. * @param {*} value The value to compare.
  4683. * @param {*} other The other value to compare.
  4684. * @param {boolean} bitmask The bitmask flags.
  4685. * 1 - Unordered comparison
  4686. * 2 - Partial comparison
  4687. * @param {Function} [customizer] The function to customize comparisons.
  4688. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4689. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4690. */
  4691. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4692. if (value === other) {
  4693. return true;
  4694. }
  4695. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4696. return value !== value && other !== other;
  4697. }
  4698. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4699. }
  4700. /**
  4701. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4702. * deep comparisons and tracks traversed objects enabling objects with circular
  4703. * references to be compared.
  4704. *
  4705. * @private
  4706. * @param {Object} object The object to compare.
  4707. * @param {Object} other The other object to compare.
  4708. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4709. * @param {Function} customizer The function to customize comparisons.
  4710. * @param {Function} equalFunc The function to determine equivalents of values.
  4711. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4712. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4713. */
  4714. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4715. var objIsArr = isArray(object),
  4716. othIsArr = isArray(other),
  4717. objTag = objIsArr ? arrayTag : getTag(object),
  4718. othTag = othIsArr ? arrayTag : getTag(other);
  4719. objTag = objTag == argsTag ? objectTag : objTag;
  4720. othTag = othTag == argsTag ? objectTag : othTag;
  4721. var objIsObj = objTag == objectTag,
  4722. othIsObj = othTag == objectTag,
  4723. isSameTag = objTag == othTag;
  4724. if (isSameTag && isBuffer(object)) {
  4725. if (!isBuffer(other)) {
  4726. return false;
  4727. }
  4728. objIsArr = true;
  4729. objIsObj = false;
  4730. }
  4731. if (isSameTag && !objIsObj) {
  4732. stack || (stack = new Stack);
  4733. return (objIsArr || isTypedArray(object))
  4734. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4735. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4736. }
  4737. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4738. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4739. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4740. if (objIsWrapped || othIsWrapped) {
  4741. var objUnwrapped = objIsWrapped ? object.value() : object,
  4742. othUnwrapped = othIsWrapped ? other.value() : other;
  4743. stack || (stack = new Stack);
  4744. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4745. }
  4746. }
  4747. if (!isSameTag) {
  4748. return false;
  4749. }
  4750. stack || (stack = new Stack);
  4751. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4752. }
  4753. /**
  4754. * The base implementation of `_.isMap` without Node.js optimizations.
  4755. *
  4756. * @private
  4757. * @param {*} value The value to check.
  4758. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4759. */
  4760. function baseIsMap(value) {
  4761. return isObjectLike(value) && getTag(value) == mapTag;
  4762. }
  4763. /**
  4764. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4765. *
  4766. * @private
  4767. * @param {Object} object The object to inspect.
  4768. * @param {Object} source The object of property values to match.
  4769. * @param {Array} matchData The property names, values, and compare flags to match.
  4770. * @param {Function} [customizer] The function to customize comparisons.
  4771. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4772. */
  4773. function baseIsMatch(object, source, matchData, customizer) {
  4774. var index = matchData.length,
  4775. length = index,
  4776. noCustomizer = !customizer;
  4777. if (object == null) {
  4778. return !length;
  4779. }
  4780. object = Object(object);
  4781. while (index--) {
  4782. var data = matchData[index];
  4783. if ((noCustomizer && data[2])
  4784. ? data[1] !== object[data[0]]
  4785. : !(data[0] in object)
  4786. ) {
  4787. return false;
  4788. }
  4789. }
  4790. while (++index < length) {
  4791. data = matchData[index];
  4792. var key = data[0],
  4793. objValue = object[key],
  4794. srcValue = data[1];
  4795. if (noCustomizer && data[2]) {
  4796. if (objValue === undefined && !(key in object)) {
  4797. return false;
  4798. }
  4799. } else {
  4800. var stack = new Stack;
  4801. if (customizer) {
  4802. var result = customizer(objValue, srcValue, key, object, source, stack);
  4803. }
  4804. if (!(result === undefined
  4805. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4806. : result
  4807. )) {
  4808. return false;
  4809. }
  4810. }
  4811. }
  4812. return true;
  4813. }
  4814. /**
  4815. * The base implementation of `_.isNative` without bad shim checks.
  4816. *
  4817. * @private
  4818. * @param {*} value The value to check.
  4819. * @returns {boolean} Returns `true` if `value` is a native function,
  4820. * else `false`.
  4821. */
  4822. function baseIsNative(value) {
  4823. if (!isObject(value) || isMasked(value)) {
  4824. return false;
  4825. }
  4826. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4827. return pattern.test(toSource(value));
  4828. }
  4829. /**
  4830. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4831. *
  4832. * @private
  4833. * @param {*} value The value to check.
  4834. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4835. */
  4836. function baseIsRegExp(value) {
  4837. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4838. }
  4839. /**
  4840. * The base implementation of `_.isSet` without Node.js optimizations.
  4841. *
  4842. * @private
  4843. * @param {*} value The value to check.
  4844. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4845. */
  4846. function baseIsSet(value) {
  4847. return isObjectLike(value) && getTag(value) == setTag;
  4848. }
  4849. /**
  4850. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4851. *
  4852. * @private
  4853. * @param {*} value The value to check.
  4854. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4855. */
  4856. function baseIsTypedArray(value) {
  4857. return isObjectLike(value) &&
  4858. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4859. }
  4860. /**
  4861. * The base implementation of `_.iteratee`.
  4862. *
  4863. * @private
  4864. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4865. * @returns {Function} Returns the iteratee.
  4866. */
  4867. function baseIteratee(value) {
  4868. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4869. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4870. if (typeof value == 'function') {
  4871. return value;
  4872. }
  4873. if (value == null) {
  4874. return identity;
  4875. }
  4876. if (typeof value == 'object') {
  4877. return isArray(value)
  4878. ? baseMatchesProperty(value[0], value[1])
  4879. : baseMatches(value);
  4880. }
  4881. return property(value);
  4882. }
  4883. /**
  4884. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4885. *
  4886. * @private
  4887. * @param {Object} object The object to query.
  4888. * @returns {Array} Returns the array of property names.
  4889. */
  4890. function baseKeys(object) {
  4891. if (!isPrototype(object)) {
  4892. return nativeKeys(object);
  4893. }
  4894. var result = [];
  4895. for (var key in Object(object)) {
  4896. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4897. result.push(key);
  4898. }
  4899. }
  4900. return result;
  4901. }
  4902. /**
  4903. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4904. *
  4905. * @private
  4906. * @param {Object} object The object to query.
  4907. * @returns {Array} Returns the array of property names.
  4908. */
  4909. function baseKeysIn(object) {
  4910. if (!isObject(object)) {
  4911. return nativeKeysIn(object);
  4912. }
  4913. var isProto = isPrototype(object),
  4914. result = [];
  4915. for (var key in object) {
  4916. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4917. result.push(key);
  4918. }
  4919. }
  4920. return result;
  4921. }
  4922. /**
  4923. * The base implementation of `_.lt` which doesn't coerce arguments.
  4924. *
  4925. * @private
  4926. * @param {*} value The value to compare.
  4927. * @param {*} other The other value to compare.
  4928. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4929. * else `false`.
  4930. */
  4931. function baseLt(value, other) {
  4932. return value < other;
  4933. }
  4934. /**
  4935. * The base implementation of `_.map` without support for iteratee shorthands.
  4936. *
  4937. * @private
  4938. * @param {Array|Object} collection The collection to iterate over.
  4939. * @param {Function} iteratee The function invoked per iteration.
  4940. * @returns {Array} Returns the new mapped array.
  4941. */
  4942. function baseMap(collection, iteratee) {
  4943. var index = -1,
  4944. result = isArrayLike(collection) ? Array(collection.length) : [];
  4945. baseEach(collection, function(value, key, collection) {
  4946. result[++index] = iteratee(value, key, collection);
  4947. });
  4948. return result;
  4949. }
  4950. /**
  4951. * The base implementation of `_.matches` which doesn't clone `source`.
  4952. *
  4953. * @private
  4954. * @param {Object} source The object of property values to match.
  4955. * @returns {Function} Returns the new spec function.
  4956. */
  4957. function baseMatches(source) {
  4958. var matchData = getMatchData(source);
  4959. if (matchData.length == 1 && matchData[0][2]) {
  4960. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4961. }
  4962. return function(object) {
  4963. return object === source || baseIsMatch(object, source, matchData);
  4964. };
  4965. }
  4966. /**
  4967. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4968. *
  4969. * @private
  4970. * @param {string} path The path of the property to get.
  4971. * @param {*} srcValue The value to match.
  4972. * @returns {Function} Returns the new spec function.
  4973. */
  4974. function baseMatchesProperty(path, srcValue) {
  4975. if (isKey(path) && isStrictComparable(srcValue)) {
  4976. return matchesStrictComparable(toKey(path), srcValue);
  4977. }
  4978. return function(object) {
  4979. var objValue = get(object, path);
  4980. return (objValue === undefined && objValue === srcValue)
  4981. ? hasIn(object, path)
  4982. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4983. };
  4984. }
  4985. /**
  4986. * The base implementation of `_.merge` without support for multiple sources.
  4987. *
  4988. * @private
  4989. * @param {Object} object The destination object.
  4990. * @param {Object} source The source object.
  4991. * @param {number} srcIndex The index of `source`.
  4992. * @param {Function} [customizer] The function to customize merged values.
  4993. * @param {Object} [stack] Tracks traversed source values and their merged
  4994. * counterparts.
  4995. */
  4996. function baseMerge(object, source, srcIndex, customizer, stack) {
  4997. if (object === source) {
  4998. return;
  4999. }
  5000. baseFor(source, function(srcValue, key) {
  5001. stack || (stack = new Stack);
  5002. if (isObject(srcValue)) {
  5003. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  5004. }
  5005. else {
  5006. var newValue = customizer
  5007. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  5008. : undefined;
  5009. if (newValue === undefined) {
  5010. newValue = srcValue;
  5011. }
  5012. assignMergeValue(object, key, newValue);
  5013. }
  5014. }, keysIn);
  5015. }
  5016. /**
  5017. * A specialized version of `baseMerge` for arrays and objects which performs
  5018. * deep merges and tracks traversed objects enabling objects with circular
  5019. * references to be merged.
  5020. *
  5021. * @private
  5022. * @param {Object} object The destination object.
  5023. * @param {Object} source The source object.
  5024. * @param {string} key The key of the value to merge.
  5025. * @param {number} srcIndex The index of `source`.
  5026. * @param {Function} mergeFunc The function to merge values.
  5027. * @param {Function} [customizer] The function to customize assigned values.
  5028. * @param {Object} [stack] Tracks traversed source values and their merged
  5029. * counterparts.
  5030. */
  5031. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  5032. var objValue = safeGet(object, key),
  5033. srcValue = safeGet(source, key),
  5034. stacked = stack.get(srcValue);
  5035. if (stacked) {
  5036. assignMergeValue(object, key, stacked);
  5037. return;
  5038. }
  5039. var newValue = customizer
  5040. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  5041. : undefined;
  5042. var isCommon = newValue === undefined;
  5043. if (isCommon) {
  5044. var isArr = isArray(srcValue),
  5045. isBuff = !isArr && isBuffer(srcValue),
  5046. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  5047. newValue = srcValue;
  5048. if (isArr || isBuff || isTyped) {
  5049. if (isArray(objValue)) {
  5050. newValue = objValue;
  5051. }
  5052. else if (isArrayLikeObject(objValue)) {
  5053. newValue = copyArray(objValue);
  5054. }
  5055. else if (isBuff) {
  5056. isCommon = false;
  5057. newValue = cloneBuffer(srcValue, true);
  5058. }
  5059. else if (isTyped) {
  5060. isCommon = false;
  5061. newValue = cloneTypedArray(srcValue, true);
  5062. }
  5063. else {
  5064. newValue = [];
  5065. }
  5066. }
  5067. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  5068. newValue = objValue;
  5069. if (isArguments(objValue)) {
  5070. newValue = toPlainObject(objValue);
  5071. }
  5072. else if (!isObject(objValue) || isFunction(objValue)) {
  5073. newValue = initCloneObject(srcValue);
  5074. }
  5075. }
  5076. else {
  5077. isCommon = false;
  5078. }
  5079. }
  5080. if (isCommon) {
  5081. // Recursively merge objects and arrays (susceptible to call stack limits).
  5082. stack.set(srcValue, newValue);
  5083. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  5084. stack['delete'](srcValue);
  5085. }
  5086. assignMergeValue(object, key, newValue);
  5087. }
  5088. /**
  5089. * The base implementation of `_.nth` which doesn't coerce arguments.
  5090. *
  5091. * @private
  5092. * @param {Array} array The array to query.
  5093. * @param {number} n The index of the element to return.
  5094. * @returns {*} Returns the nth element of `array`.
  5095. */
  5096. function baseNth(array, n) {
  5097. var length = array.length;
  5098. if (!length) {
  5099. return;
  5100. }
  5101. n += n < 0 ? length : 0;
  5102. return isIndex(n, length) ? array[n] : undefined;
  5103. }
  5104. /**
  5105. * The base implementation of `_.orderBy` without param guards.
  5106. *
  5107. * @private
  5108. * @param {Array|Object} collection The collection to iterate over.
  5109. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  5110. * @param {string[]} orders The sort orders of `iteratees`.
  5111. * @returns {Array} Returns the new sorted array.
  5112. */
  5113. function baseOrderBy(collection, iteratees, orders) {
  5114. if (iteratees.length) {
  5115. iteratees = arrayMap(iteratees, function(iteratee) {
  5116. if (isArray(iteratee)) {
  5117. return function(value) {
  5118. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  5119. }
  5120. }
  5121. return iteratee;
  5122. });
  5123. } else {
  5124. iteratees = [identity];
  5125. }
  5126. var index = -1;
  5127. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  5128. var result = baseMap(collection, function(value, key, collection) {
  5129. var criteria = arrayMap(iteratees, function(iteratee) {
  5130. return iteratee(value);
  5131. });
  5132. return { 'criteria': criteria, 'index': ++index, 'value': value };
  5133. });
  5134. return baseSortBy(result, function(object, other) {
  5135. return compareMultiple(object, other, orders);
  5136. });
  5137. }
  5138. /**
  5139. * The base implementation of `_.pick` without support for individual
  5140. * property identifiers.
  5141. *
  5142. * @private
  5143. * @param {Object} object The source object.
  5144. * @param {string[]} paths The property paths to pick.
  5145. * @returns {Object} Returns the new object.
  5146. */
  5147. function basePick(object, paths) {
  5148. return basePickBy(object, paths, function(value, path) {
  5149. return hasIn(object, path);
  5150. });
  5151. }
  5152. /**
  5153. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  5154. *
  5155. * @private
  5156. * @param {Object} object The source object.
  5157. * @param {string[]} paths The property paths to pick.
  5158. * @param {Function} predicate The function invoked per property.
  5159. * @returns {Object} Returns the new object.
  5160. */
  5161. function basePickBy(object, paths, predicate) {
  5162. var index = -1,
  5163. length = paths.length,
  5164. result = {};
  5165. while (++index < length) {
  5166. var path = paths[index],
  5167. value = baseGet(object, path);
  5168. if (predicate(value, path)) {
  5169. baseSet(result, castPath(path, object), value);
  5170. }
  5171. }
  5172. return result;
  5173. }
  5174. /**
  5175. * A specialized version of `baseProperty` which supports deep paths.
  5176. *
  5177. * @private
  5178. * @param {Array|string} path The path of the property to get.
  5179. * @returns {Function} Returns the new accessor function.
  5180. */
  5181. function basePropertyDeep(path) {
  5182. return function(object) {
  5183. return baseGet(object, path);
  5184. };
  5185. }
  5186. /**
  5187. * The base implementation of `_.pullAllBy` without support for iteratee
  5188. * shorthands.
  5189. *
  5190. * @private
  5191. * @param {Array} array The array to modify.
  5192. * @param {Array} values The values to remove.
  5193. * @param {Function} [iteratee] The iteratee invoked per element.
  5194. * @param {Function} [comparator] The comparator invoked per element.
  5195. * @returns {Array} Returns `array`.
  5196. */
  5197. function basePullAll(array, values, iteratee, comparator) {
  5198. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  5199. index = -1,
  5200. length = values.length,
  5201. seen = array;
  5202. if (array === values) {
  5203. values = copyArray(values);
  5204. }
  5205. if (iteratee) {
  5206. seen = arrayMap(array, baseUnary(iteratee));
  5207. }
  5208. while (++index < length) {
  5209. var fromIndex = 0,
  5210. value = values[index],
  5211. computed = iteratee ? iteratee(value) : value;
  5212. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  5213. if (seen !== array) {
  5214. splice.call(seen, fromIndex, 1);
  5215. }
  5216. splice.call(array, fromIndex, 1);
  5217. }
  5218. }
  5219. return array;
  5220. }
  5221. /**
  5222. * The base implementation of `_.pullAt` without support for individual
  5223. * indexes or capturing the removed elements.
  5224. *
  5225. * @private
  5226. * @param {Array} array The array to modify.
  5227. * @param {number[]} indexes The indexes of elements to remove.
  5228. * @returns {Array} Returns `array`.
  5229. */
  5230. function basePullAt(array, indexes) {
  5231. var length = array ? indexes.length : 0,
  5232. lastIndex = length - 1;
  5233. while (length--) {
  5234. var index = indexes[length];
  5235. if (length == lastIndex || index !== previous) {
  5236. var previous = index;
  5237. if (isIndex(index)) {
  5238. splice.call(array, index, 1);
  5239. } else {
  5240. baseUnset(array, index);
  5241. }
  5242. }
  5243. }
  5244. return array;
  5245. }
  5246. /**
  5247. * The base implementation of `_.random` without support for returning
  5248. * floating-point numbers.
  5249. *
  5250. * @private
  5251. * @param {number} lower The lower bound.
  5252. * @param {number} upper The upper bound.
  5253. * @returns {number} Returns the random number.
  5254. */
  5255. function baseRandom(lower, upper) {
  5256. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  5257. }
  5258. /**
  5259. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  5260. * coerce arguments.
  5261. *
  5262. * @private
  5263. * @param {number} start The start of the range.
  5264. * @param {number} end The end of the range.
  5265. * @param {number} step The value to increment or decrement by.
  5266. * @param {boolean} [fromRight] Specify iterating from right to left.
  5267. * @returns {Array} Returns the range of numbers.
  5268. */
  5269. function baseRange(start, end, step, fromRight) {
  5270. var index = -1,
  5271. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  5272. result = Array(length);
  5273. while (length--) {
  5274. result[fromRight ? length : ++index] = start;
  5275. start += step;
  5276. }
  5277. return result;
  5278. }
  5279. /**
  5280. * The base implementation of `_.repeat` which doesn't coerce arguments.
  5281. *
  5282. * @private
  5283. * @param {string} string The string to repeat.
  5284. * @param {number} n The number of times to repeat the string.
  5285. * @returns {string} Returns the repeated string.
  5286. */
  5287. function baseRepeat(string, n) {
  5288. var result = '';
  5289. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  5290. return result;
  5291. }
  5292. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  5293. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  5294. do {
  5295. if (n % 2) {
  5296. result += string;
  5297. }
  5298. n = nativeFloor(n / 2);
  5299. if (n) {
  5300. string += string;
  5301. }
  5302. } while (n);
  5303. return result;
  5304. }
  5305. /**
  5306. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  5307. *
  5308. * @private
  5309. * @param {Function} func The function to apply a rest parameter to.
  5310. * @param {number} [start=func.length-1] The start position of the rest parameter.
  5311. * @returns {Function} Returns the new function.
  5312. */
  5313. function baseRest(func, start) {
  5314. return setToString(overRest(func, start, identity), func + '');
  5315. }
  5316. /**
  5317. * The base implementation of `_.sample`.
  5318. *
  5319. * @private
  5320. * @param {Array|Object} collection The collection to sample.
  5321. * @returns {*} Returns the random element.
  5322. */
  5323. function baseSample(collection) {
  5324. return arraySample(values(collection));
  5325. }
  5326. /**
  5327. * The base implementation of `_.sampleSize` without param guards.
  5328. *
  5329. * @private
  5330. * @param {Array|Object} collection The collection to sample.
  5331. * @param {number} n The number of elements to sample.
  5332. * @returns {Array} Returns the random elements.
  5333. */
  5334. function baseSampleSize(collection, n) {
  5335. var array = values(collection);
  5336. return shuffleSelf(array, baseClamp(n, 0, array.length));
  5337. }
  5338. /**
  5339. * The base implementation of `_.set`.
  5340. *
  5341. * @private
  5342. * @param {Object} object The object to modify.
  5343. * @param {Array|string} path The path of the property to set.
  5344. * @param {*} value The value to set.
  5345. * @param {Function} [customizer] The function to customize path creation.
  5346. * @returns {Object} Returns `object`.
  5347. */
  5348. function baseSet(object, path, value, customizer) {
  5349. if (!isObject(object)) {
  5350. return object;
  5351. }
  5352. path = castPath(path, object);
  5353. var index = -1,
  5354. length = path.length,
  5355. lastIndex = length - 1,
  5356. nested = object;
  5357. while (nested != null && ++index < length) {
  5358. var key = toKey(path[index]),
  5359. newValue = value;
  5360. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  5361. return object;
  5362. }
  5363. if (index != lastIndex) {
  5364. var objValue = nested[key];
  5365. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  5366. if (newValue === undefined) {
  5367. newValue = isObject(objValue)
  5368. ? objValue
  5369. : (isIndex(path[index + 1]) ? [] : {});
  5370. }
  5371. }
  5372. assignValue(nested, key, newValue);
  5373. nested = nested[key];
  5374. }
  5375. return object;
  5376. }
  5377. /**
  5378. * The base implementation of `setData` without support for hot loop shorting.
  5379. *
  5380. * @private
  5381. * @param {Function} func The function to associate metadata with.
  5382. * @param {*} data The metadata.
  5383. * @returns {Function} Returns `func`.
  5384. */
  5385. var baseSetData = !metaMap ? identity : function(func, data) {
  5386. metaMap.set(func, data);
  5387. return func;
  5388. };
  5389. /**
  5390. * The base implementation of `setToString` without support for hot loop shorting.
  5391. *
  5392. * @private
  5393. * @param {Function} func The function to modify.
  5394. * @param {Function} string The `toString` result.
  5395. * @returns {Function} Returns `func`.
  5396. */
  5397. var baseSetToString = !defineProperty ? identity : function(func, string) {
  5398. return defineProperty(func, 'toString', {
  5399. 'configurable': true,
  5400. 'enumerable': false,
  5401. 'value': constant(string),
  5402. 'writable': true
  5403. });
  5404. };
  5405. /**
  5406. * The base implementation of `_.shuffle`.
  5407. *
  5408. * @private
  5409. * @param {Array|Object} collection The collection to shuffle.
  5410. * @returns {Array} Returns the new shuffled array.
  5411. */
  5412. function baseShuffle(collection) {
  5413. return shuffleSelf(values(collection));
  5414. }
  5415. /**
  5416. * The base implementation of `_.slice` without an iteratee call guard.
  5417. *
  5418. * @private
  5419. * @param {Array} array The array to slice.
  5420. * @param {number} [start=0] The start position.
  5421. * @param {number} [end=array.length] The end position.
  5422. * @returns {Array} Returns the slice of `array`.
  5423. */
  5424. function baseSlice(array, start, end) {
  5425. var index = -1,
  5426. length = array.length;
  5427. if (start < 0) {
  5428. start = -start > length ? 0 : (length + start);
  5429. }
  5430. end = end > length ? length : end;
  5431. if (end < 0) {
  5432. end += length;
  5433. }
  5434. length = start > end ? 0 : ((end - start) >>> 0);
  5435. start >>>= 0;
  5436. var result = Array(length);
  5437. while (++index < length) {
  5438. result[index] = array[index + start];
  5439. }
  5440. return result;
  5441. }
  5442. /**
  5443. * The base implementation of `_.some` without support for iteratee shorthands.
  5444. *
  5445. * @private
  5446. * @param {Array|Object} collection The collection to iterate over.
  5447. * @param {Function} predicate The function invoked per iteration.
  5448. * @returns {boolean} Returns `true` if any element passes the predicate check,
  5449. * else `false`.
  5450. */
  5451. function baseSome(collection, predicate) {
  5452. var result;
  5453. baseEach(collection, function(value, index, collection) {
  5454. result = predicate(value, index, collection);
  5455. return !result;
  5456. });
  5457. return !!result;
  5458. }
  5459. /**
  5460. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5461. * performs a binary search of `array` to determine the index at which `value`
  5462. * should be inserted into `array` in order to maintain its sort order.
  5463. *
  5464. * @private
  5465. * @param {Array} array The sorted array to inspect.
  5466. * @param {*} value The value to evaluate.
  5467. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5468. * @returns {number} Returns the index at which `value` should be inserted
  5469. * into `array`.
  5470. */
  5471. function baseSortedIndex(array, value, retHighest) {
  5472. var low = 0,
  5473. high = array == null ? low : array.length;
  5474. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5475. while (low < high) {
  5476. var mid = (low + high) >>> 1,
  5477. computed = array[mid];
  5478. if (computed !== null && !isSymbol(computed) &&
  5479. (retHighest ? (computed <= value) : (computed < value))) {
  5480. low = mid + 1;
  5481. } else {
  5482. high = mid;
  5483. }
  5484. }
  5485. return high;
  5486. }
  5487. return baseSortedIndexBy(array, value, identity, retHighest);
  5488. }
  5489. /**
  5490. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5491. * which invokes `iteratee` for `value` and each element of `array` to compute
  5492. * their sort ranking. The iteratee is invoked with one argument; (value).
  5493. *
  5494. * @private
  5495. * @param {Array} array The sorted array to inspect.
  5496. * @param {*} value The value to evaluate.
  5497. * @param {Function} iteratee The iteratee invoked per element.
  5498. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5499. * @returns {number} Returns the index at which `value` should be inserted
  5500. * into `array`.
  5501. */
  5502. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5503. var low = 0,
  5504. high = array == null ? 0 : array.length;
  5505. if (high === 0) {
  5506. return 0;
  5507. }
  5508. value = iteratee(value);
  5509. var valIsNaN = value !== value,
  5510. valIsNull = value === null,
  5511. valIsSymbol = isSymbol(value),
  5512. valIsUndefined = value === undefined;
  5513. while (low < high) {
  5514. var mid = nativeFloor((low + high) / 2),
  5515. computed = iteratee(array[mid]),
  5516. othIsDefined = computed !== undefined,
  5517. othIsNull = computed === null,
  5518. othIsReflexive = computed === computed,
  5519. othIsSymbol = isSymbol(computed);
  5520. if (valIsNaN) {
  5521. var setLow = retHighest || othIsReflexive;
  5522. } else if (valIsUndefined) {
  5523. setLow = othIsReflexive && (retHighest || othIsDefined);
  5524. } else if (valIsNull) {
  5525. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5526. } else if (valIsSymbol) {
  5527. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5528. } else if (othIsNull || othIsSymbol) {
  5529. setLow = false;
  5530. } else {
  5531. setLow = retHighest ? (computed <= value) : (computed < value);
  5532. }
  5533. if (setLow) {
  5534. low = mid + 1;
  5535. } else {
  5536. high = mid;
  5537. }
  5538. }
  5539. return nativeMin(high, MAX_ARRAY_INDEX);
  5540. }
  5541. /**
  5542. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5543. * support for iteratee shorthands.
  5544. *
  5545. * @private
  5546. * @param {Array} array The array to inspect.
  5547. * @param {Function} [iteratee] The iteratee invoked per element.
  5548. * @returns {Array} Returns the new duplicate free array.
  5549. */
  5550. function baseSortedUniq(array, iteratee) {
  5551. var index = -1,
  5552. length = array.length,
  5553. resIndex = 0,
  5554. result = [];
  5555. while (++index < length) {
  5556. var value = array[index],
  5557. computed = iteratee ? iteratee(value) : value;
  5558. if (!index || !eq(computed, seen)) {
  5559. var seen = computed;
  5560. result[resIndex++] = value === 0 ? 0 : value;
  5561. }
  5562. }
  5563. return result;
  5564. }
  5565. /**
  5566. * The base implementation of `_.toNumber` which doesn't ensure correct
  5567. * conversions of binary, hexadecimal, or octal string values.
  5568. *
  5569. * @private
  5570. * @param {*} value The value to process.
  5571. * @returns {number} Returns the number.
  5572. */
  5573. function baseToNumber(value) {
  5574. if (typeof value == 'number') {
  5575. return value;
  5576. }
  5577. if (isSymbol(value)) {
  5578. return NAN;
  5579. }
  5580. return +value;
  5581. }
  5582. /**
  5583. * The base implementation of `_.toString` which doesn't convert nullish
  5584. * values to empty strings.
  5585. *
  5586. * @private
  5587. * @param {*} value The value to process.
  5588. * @returns {string} Returns the string.
  5589. */
  5590. function baseToString(value) {
  5591. // Exit early for strings to avoid a performance hit in some environments.
  5592. if (typeof value == 'string') {
  5593. return value;
  5594. }
  5595. if (isArray(value)) {
  5596. // Recursively convert values (susceptible to call stack limits).
  5597. return arrayMap(value, baseToString) + '';
  5598. }
  5599. if (isSymbol(value)) {
  5600. return symbolToString ? symbolToString.call(value) : '';
  5601. }
  5602. var result = (value + '');
  5603. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5604. }
  5605. /**
  5606. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5607. *
  5608. * @private
  5609. * @param {Array} array The array to inspect.
  5610. * @param {Function} [iteratee] The iteratee invoked per element.
  5611. * @param {Function} [comparator] The comparator invoked per element.
  5612. * @returns {Array} Returns the new duplicate free array.
  5613. */
  5614. function baseUniq(array, iteratee, comparator) {
  5615. var index = -1,
  5616. includes = arrayIncludes,
  5617. length = array.length,
  5618. isCommon = true,
  5619. result = [],
  5620. seen = result;
  5621. if (comparator) {
  5622. isCommon = false;
  5623. includes = arrayIncludesWith;
  5624. }
  5625. else if (length >= LARGE_ARRAY_SIZE) {
  5626. var set = iteratee ? null : createSet(array);
  5627. if (set) {
  5628. return setToArray(set);
  5629. }
  5630. isCommon = false;
  5631. includes = cacheHas;
  5632. seen = new SetCache;
  5633. }
  5634. else {
  5635. seen = iteratee ? [] : result;
  5636. }
  5637. outer:
  5638. while (++index < length) {
  5639. var value = array[index],
  5640. computed = iteratee ? iteratee(value) : value;
  5641. value = (comparator || value !== 0) ? value : 0;
  5642. if (isCommon && computed === computed) {
  5643. var seenIndex = seen.length;
  5644. while (seenIndex--) {
  5645. if (seen[seenIndex] === computed) {
  5646. continue outer;
  5647. }
  5648. }
  5649. if (iteratee) {
  5650. seen.push(computed);
  5651. }
  5652. result.push(value);
  5653. }
  5654. else if (!includes(seen, computed, comparator)) {
  5655. if (seen !== result) {
  5656. seen.push(computed);
  5657. }
  5658. result.push(value);
  5659. }
  5660. }
  5661. return result;
  5662. }
  5663. /**
  5664. * The base implementation of `_.unset`.
  5665. *
  5666. * @private
  5667. * @param {Object} object The object to modify.
  5668. * @param {Array|string} path The property path to unset.
  5669. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5670. */
  5671. function baseUnset(object, path) {
  5672. path = castPath(path, object);
  5673. object = parent(object, path);
  5674. return object == null || delete object[toKey(last(path))];
  5675. }
  5676. /**
  5677. * The base implementation of `_.update`.
  5678. *
  5679. * @private
  5680. * @param {Object} object The object to modify.
  5681. * @param {Array|string} path The path of the property to update.
  5682. * @param {Function} updater The function to produce the updated value.
  5683. * @param {Function} [customizer] The function to customize path creation.
  5684. * @returns {Object} Returns `object`.
  5685. */
  5686. function baseUpdate(object, path, updater, customizer) {
  5687. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5688. }
  5689. /**
  5690. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5691. * without support for iteratee shorthands.
  5692. *
  5693. * @private
  5694. * @param {Array} array The array to query.
  5695. * @param {Function} predicate The function invoked per iteration.
  5696. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5697. * @param {boolean} [fromRight] Specify iterating from right to left.
  5698. * @returns {Array} Returns the slice of `array`.
  5699. */
  5700. function baseWhile(array, predicate, isDrop, fromRight) {
  5701. var length = array.length,
  5702. index = fromRight ? length : -1;
  5703. while ((fromRight ? index-- : ++index < length) &&
  5704. predicate(array[index], index, array)) {}
  5705. return isDrop
  5706. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5707. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5708. }
  5709. /**
  5710. * The base implementation of `wrapperValue` which returns the result of
  5711. * performing a sequence of actions on the unwrapped `value`, where each
  5712. * successive action is supplied the return value of the previous.
  5713. *
  5714. * @private
  5715. * @param {*} value The unwrapped value.
  5716. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5717. * @returns {*} Returns the resolved value.
  5718. */
  5719. function baseWrapperValue(value, actions) {
  5720. var result = value;
  5721. if (result instanceof LazyWrapper) {
  5722. result = result.value();
  5723. }
  5724. return arrayReduce(actions, function(result, action) {
  5725. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5726. }, result);
  5727. }
  5728. /**
  5729. * The base implementation of methods like `_.xor`, without support for
  5730. * iteratee shorthands, that accepts an array of arrays to inspect.
  5731. *
  5732. * @private
  5733. * @param {Array} arrays The arrays to inspect.
  5734. * @param {Function} [iteratee] The iteratee invoked per element.
  5735. * @param {Function} [comparator] The comparator invoked per element.
  5736. * @returns {Array} Returns the new array of values.
  5737. */
  5738. function baseXor(arrays, iteratee, comparator) {
  5739. var length = arrays.length;
  5740. if (length < 2) {
  5741. return length ? baseUniq(arrays[0]) : [];
  5742. }
  5743. var index = -1,
  5744. result = Array(length);
  5745. while (++index < length) {
  5746. var array = arrays[index],
  5747. othIndex = -1;
  5748. while (++othIndex < length) {
  5749. if (othIndex != index) {
  5750. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5751. }
  5752. }
  5753. }
  5754. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5755. }
  5756. /**
  5757. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5758. *
  5759. * @private
  5760. * @param {Array} props The property identifiers.
  5761. * @param {Array} values The property values.
  5762. * @param {Function} assignFunc The function to assign values.
  5763. * @returns {Object} Returns the new object.
  5764. */
  5765. function baseZipObject(props, values, assignFunc) {
  5766. var index = -1,
  5767. length = props.length,
  5768. valsLength = values.length,
  5769. result = {};
  5770. while (++index < length) {
  5771. var value = index < valsLength ? values[index] : undefined;
  5772. assignFunc(result, props[index], value);
  5773. }
  5774. return result;
  5775. }
  5776. /**
  5777. * Casts `value` to an empty array if it's not an array like object.
  5778. *
  5779. * @private
  5780. * @param {*} value The value to inspect.
  5781. * @returns {Array|Object} Returns the cast array-like object.
  5782. */
  5783. function castArrayLikeObject(value) {
  5784. return isArrayLikeObject(value) ? value : [];
  5785. }
  5786. /**
  5787. * Casts `value` to `identity` if it's not a function.
  5788. *
  5789. * @private
  5790. * @param {*} value The value to inspect.
  5791. * @returns {Function} Returns cast function.
  5792. */
  5793. function castFunction(value) {
  5794. return typeof value == 'function' ? value : identity;
  5795. }
  5796. /**
  5797. * Casts `value` to a path array if it's not one.
  5798. *
  5799. * @private
  5800. * @param {*} value The value to inspect.
  5801. * @param {Object} [object] The object to query keys on.
  5802. * @returns {Array} Returns the cast property path array.
  5803. */
  5804. function castPath(value, object) {
  5805. if (isArray(value)) {
  5806. return value;
  5807. }
  5808. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5809. }
  5810. /**
  5811. * A `baseRest` alias which can be replaced with `identity` by module
  5812. * replacement plugins.
  5813. *
  5814. * @private
  5815. * @type {Function}
  5816. * @param {Function} func The function to apply a rest parameter to.
  5817. * @returns {Function} Returns the new function.
  5818. */
  5819. var castRest = baseRest;
  5820. /**
  5821. * Casts `array` to a slice if it's needed.
  5822. *
  5823. * @private
  5824. * @param {Array} array The array to inspect.
  5825. * @param {number} start The start position.
  5826. * @param {number} [end=array.length] The end position.
  5827. * @returns {Array} Returns the cast slice.
  5828. */
  5829. function castSlice(array, start, end) {
  5830. var length = array.length;
  5831. end = end === undefined ? length : end;
  5832. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5833. }
  5834. /**
  5835. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5836. *
  5837. * @private
  5838. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5839. */
  5840. var clearTimeout = ctxClearTimeout || function(id) {
  5841. return root.clearTimeout(id);
  5842. };
  5843. /**
  5844. * Creates a clone of `buffer`.
  5845. *
  5846. * @private
  5847. * @param {Buffer} buffer The buffer to clone.
  5848. * @param {boolean} [isDeep] Specify a deep clone.
  5849. * @returns {Buffer} Returns the cloned buffer.
  5850. */
  5851. function cloneBuffer(buffer, isDeep) {
  5852. if (isDeep) {
  5853. return buffer.slice();
  5854. }
  5855. var length = buffer.length,
  5856. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5857. buffer.copy(result);
  5858. return result;
  5859. }
  5860. /**
  5861. * Creates a clone of `arrayBuffer`.
  5862. *
  5863. * @private
  5864. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5865. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5866. */
  5867. function cloneArrayBuffer(arrayBuffer) {
  5868. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5869. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5870. return result;
  5871. }
  5872. /**
  5873. * Creates a clone of `dataView`.
  5874. *
  5875. * @private
  5876. * @param {Object} dataView The data view to clone.
  5877. * @param {boolean} [isDeep] Specify a deep clone.
  5878. * @returns {Object} Returns the cloned data view.
  5879. */
  5880. function cloneDataView(dataView, isDeep) {
  5881. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5882. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5883. }
  5884. /**
  5885. * Creates a clone of `regexp`.
  5886. *
  5887. * @private
  5888. * @param {Object} regexp The regexp to clone.
  5889. * @returns {Object} Returns the cloned regexp.
  5890. */
  5891. function cloneRegExp(regexp) {
  5892. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5893. result.lastIndex = regexp.lastIndex;
  5894. return result;
  5895. }
  5896. /**
  5897. * Creates a clone of the `symbol` object.
  5898. *
  5899. * @private
  5900. * @param {Object} symbol The symbol object to clone.
  5901. * @returns {Object} Returns the cloned symbol object.
  5902. */
  5903. function cloneSymbol(symbol) {
  5904. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5905. }
  5906. /**
  5907. * Creates a clone of `typedArray`.
  5908. *
  5909. * @private
  5910. * @param {Object} typedArray The typed array to clone.
  5911. * @param {boolean} [isDeep] Specify a deep clone.
  5912. * @returns {Object} Returns the cloned typed array.
  5913. */
  5914. function cloneTypedArray(typedArray, isDeep) {
  5915. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5916. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5917. }
  5918. /**
  5919. * Compares values to sort them in ascending order.
  5920. *
  5921. * @private
  5922. * @param {*} value The value to compare.
  5923. * @param {*} other The other value to compare.
  5924. * @returns {number} Returns the sort order indicator for `value`.
  5925. */
  5926. function compareAscending(value, other) {
  5927. if (value !== other) {
  5928. var valIsDefined = value !== undefined,
  5929. valIsNull = value === null,
  5930. valIsReflexive = value === value,
  5931. valIsSymbol = isSymbol(value);
  5932. var othIsDefined = other !== undefined,
  5933. othIsNull = other === null,
  5934. othIsReflexive = other === other,
  5935. othIsSymbol = isSymbol(other);
  5936. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5937. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5938. (valIsNull && othIsDefined && othIsReflexive) ||
  5939. (!valIsDefined && othIsReflexive) ||
  5940. !valIsReflexive) {
  5941. return 1;
  5942. }
  5943. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5944. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5945. (othIsNull && valIsDefined && valIsReflexive) ||
  5946. (!othIsDefined && valIsReflexive) ||
  5947. !othIsReflexive) {
  5948. return -1;
  5949. }
  5950. }
  5951. return 0;
  5952. }
  5953. /**
  5954. * Used by `_.orderBy` to compare multiple properties of a value to another
  5955. * and stable sort them.
  5956. *
  5957. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5958. * specify an order of "desc" for descending or "asc" for ascending sort order
  5959. * of corresponding values.
  5960. *
  5961. * @private
  5962. * @param {Object} object The object to compare.
  5963. * @param {Object} other The other object to compare.
  5964. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5965. * @returns {number} Returns the sort order indicator for `object`.
  5966. */
  5967. function compareMultiple(object, other, orders) {
  5968. var index = -1,
  5969. objCriteria = object.criteria,
  5970. othCriteria = other.criteria,
  5971. length = objCriteria.length,
  5972. ordersLength = orders.length;
  5973. while (++index < length) {
  5974. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5975. if (result) {
  5976. if (index >= ordersLength) {
  5977. return result;
  5978. }
  5979. var order = orders[index];
  5980. return result * (order == 'desc' ? -1 : 1);
  5981. }
  5982. }
  5983. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5984. // that causes it, under certain circumstances, to provide the same value for
  5985. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5986. // for more details.
  5987. //
  5988. // This also ensures a stable sort in V8 and other engines.
  5989. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5990. return object.index - other.index;
  5991. }
  5992. /**
  5993. * Creates an array that is the composition of partially applied arguments,
  5994. * placeholders, and provided arguments into a single array of arguments.
  5995. *
  5996. * @private
  5997. * @param {Array} args The provided arguments.
  5998. * @param {Array} partials The arguments to prepend to those provided.
  5999. * @param {Array} holders The `partials` placeholder indexes.
  6000. * @params {boolean} [isCurried] Specify composing for a curried function.
  6001. * @returns {Array} Returns the new array of composed arguments.
  6002. */
  6003. function composeArgs(args, partials, holders, isCurried) {
  6004. var argsIndex = -1,
  6005. argsLength = args.length,
  6006. holdersLength = holders.length,
  6007. leftIndex = -1,
  6008. leftLength = partials.length,
  6009. rangeLength = nativeMax(argsLength - holdersLength, 0),
  6010. result = Array(leftLength + rangeLength),
  6011. isUncurried = !isCurried;
  6012. while (++leftIndex < leftLength) {
  6013. result[leftIndex] = partials[leftIndex];
  6014. }
  6015. while (++argsIndex < holdersLength) {
  6016. if (isUncurried || argsIndex < argsLength) {
  6017. result[holders[argsIndex]] = args[argsIndex];
  6018. }
  6019. }
  6020. while (rangeLength--) {
  6021. result[leftIndex++] = args[argsIndex++];
  6022. }
  6023. return result;
  6024. }
  6025. /**
  6026. * This function is like `composeArgs` except that the arguments composition
  6027. * is tailored for `_.partialRight`.
  6028. *
  6029. * @private
  6030. * @param {Array} args The provided arguments.
  6031. * @param {Array} partials The arguments to append to those provided.
  6032. * @param {Array} holders The `partials` placeholder indexes.
  6033. * @params {boolean} [isCurried] Specify composing for a curried function.
  6034. * @returns {Array} Returns the new array of composed arguments.
  6035. */
  6036. function composeArgsRight(args, partials, holders, isCurried) {
  6037. var argsIndex = -1,
  6038. argsLength = args.length,
  6039. holdersIndex = -1,
  6040. holdersLength = holders.length,
  6041. rightIndex = -1,
  6042. rightLength = partials.length,
  6043. rangeLength = nativeMax(argsLength - holdersLength, 0),
  6044. result = Array(rangeLength + rightLength),
  6045. isUncurried = !isCurried;
  6046. while (++argsIndex < rangeLength) {
  6047. result[argsIndex] = args[argsIndex];
  6048. }
  6049. var offset = argsIndex;
  6050. while (++rightIndex < rightLength) {
  6051. result[offset + rightIndex] = partials[rightIndex];
  6052. }
  6053. while (++holdersIndex < holdersLength) {
  6054. if (isUncurried || argsIndex < argsLength) {
  6055. result[offset + holders[holdersIndex]] = args[argsIndex++];
  6056. }
  6057. }
  6058. return result;
  6059. }
  6060. /**
  6061. * Copies the values of `source` to `array`.
  6062. *
  6063. * @private
  6064. * @param {Array} source The array to copy values from.
  6065. * @param {Array} [array=[]] The array to copy values to.
  6066. * @returns {Array} Returns `array`.
  6067. */
  6068. function copyArray(source, array) {
  6069. var index = -1,
  6070. length = source.length;
  6071. array || (array = Array(length));
  6072. while (++index < length) {
  6073. array[index] = source[index];
  6074. }
  6075. return array;
  6076. }
  6077. /**
  6078. * Copies properties of `source` to `object`.
  6079. *
  6080. * @private
  6081. * @param {Object} source The object to copy properties from.
  6082. * @param {Array} props The property identifiers to copy.
  6083. * @param {Object} [object={}] The object to copy properties to.
  6084. * @param {Function} [customizer] The function to customize copied values.
  6085. * @returns {Object} Returns `object`.
  6086. */
  6087. function copyObject(source, props, object, customizer) {
  6088. var isNew = !object;
  6089. object || (object = {});
  6090. var index = -1,
  6091. length = props.length;
  6092. while (++index < length) {
  6093. var key = props[index];
  6094. var newValue = customizer
  6095. ? customizer(object[key], source[key], key, object, source)
  6096. : undefined;
  6097. if (newValue === undefined) {
  6098. newValue = source[key];
  6099. }
  6100. if (isNew) {
  6101. baseAssignValue(object, key, newValue);
  6102. } else {
  6103. assignValue(object, key, newValue);
  6104. }
  6105. }
  6106. return object;
  6107. }
  6108. /**
  6109. * Copies own symbols of `source` to `object`.
  6110. *
  6111. * @private
  6112. * @param {Object} source The object to copy symbols from.
  6113. * @param {Object} [object={}] The object to copy symbols to.
  6114. * @returns {Object} Returns `object`.
  6115. */
  6116. function copySymbols(source, object) {
  6117. return copyObject(source, getSymbols(source), object);
  6118. }
  6119. /**
  6120. * Copies own and inherited symbols of `source` to `object`.
  6121. *
  6122. * @private
  6123. * @param {Object} source The object to copy symbols from.
  6124. * @param {Object} [object={}] The object to copy symbols to.
  6125. * @returns {Object} Returns `object`.
  6126. */
  6127. function copySymbolsIn(source, object) {
  6128. return copyObject(source, getSymbolsIn(source), object);
  6129. }
  6130. /**
  6131. * Creates a function like `_.groupBy`.
  6132. *
  6133. * @private
  6134. * @param {Function} setter The function to set accumulator values.
  6135. * @param {Function} [initializer] The accumulator object initializer.
  6136. * @returns {Function} Returns the new aggregator function.
  6137. */
  6138. function createAggregator(setter, initializer) {
  6139. return function(collection, iteratee) {
  6140. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  6141. accumulator = initializer ? initializer() : {};
  6142. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  6143. };
  6144. }
  6145. /**
  6146. * Creates a function like `_.assign`.
  6147. *
  6148. * @private
  6149. * @param {Function} assigner The function to assign values.
  6150. * @returns {Function} Returns the new assigner function.
  6151. */
  6152. function createAssigner(assigner) {
  6153. return baseRest(function(object, sources) {
  6154. var index = -1,
  6155. length = sources.length,
  6156. customizer = length > 1 ? sources[length - 1] : undefined,
  6157. guard = length > 2 ? sources[2] : undefined;
  6158. customizer = (assigner.length > 3 && typeof customizer == 'function')
  6159. ? (length--, customizer)
  6160. : undefined;
  6161. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  6162. customizer = length < 3 ? undefined : customizer;
  6163. length = 1;
  6164. }
  6165. object = Object(object);
  6166. while (++index < length) {
  6167. var source = sources[index];
  6168. if (source) {
  6169. assigner(object, source, index, customizer);
  6170. }
  6171. }
  6172. return object;
  6173. });
  6174. }
  6175. /**
  6176. * Creates a `baseEach` or `baseEachRight` function.
  6177. *
  6178. * @private
  6179. * @param {Function} eachFunc The function to iterate over a collection.
  6180. * @param {boolean} [fromRight] Specify iterating from right to left.
  6181. * @returns {Function} Returns the new base function.
  6182. */
  6183. function createBaseEach(eachFunc, fromRight) {
  6184. return function(collection, iteratee) {
  6185. if (collection == null) {
  6186. return collection;
  6187. }
  6188. if (!isArrayLike(collection)) {
  6189. return eachFunc(collection, iteratee);
  6190. }
  6191. var length = collection.length,
  6192. index = fromRight ? length : -1,
  6193. iterable = Object(collection);
  6194. while ((fromRight ? index-- : ++index < length)) {
  6195. if (iteratee(iterable[index], index, iterable) === false) {
  6196. break;
  6197. }
  6198. }
  6199. return collection;
  6200. };
  6201. }
  6202. /**
  6203. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  6204. *
  6205. * @private
  6206. * @param {boolean} [fromRight] Specify iterating from right to left.
  6207. * @returns {Function} Returns the new base function.
  6208. */
  6209. function createBaseFor(fromRight) {
  6210. return function(object, iteratee, keysFunc) {
  6211. var index = -1,
  6212. iterable = Object(object),
  6213. props = keysFunc(object),
  6214. length = props.length;
  6215. while (length--) {
  6216. var key = props[fromRight ? length : ++index];
  6217. if (iteratee(iterable[key], key, iterable) === false) {
  6218. break;
  6219. }
  6220. }
  6221. return object;
  6222. };
  6223. }
  6224. /**
  6225. * Creates a function that wraps `func` to invoke it with the optional `this`
  6226. * binding of `thisArg`.
  6227. *
  6228. * @private
  6229. * @param {Function} func The function to wrap.
  6230. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6231. * @param {*} [thisArg] The `this` binding of `func`.
  6232. * @returns {Function} Returns the new wrapped function.
  6233. */
  6234. function createBind(func, bitmask, thisArg) {
  6235. var isBind = bitmask & WRAP_BIND_FLAG,
  6236. Ctor = createCtor(func);
  6237. function wrapper() {
  6238. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6239. return fn.apply(isBind ? thisArg : this, arguments);
  6240. }
  6241. return wrapper;
  6242. }
  6243. /**
  6244. * Creates a function like `_.lowerFirst`.
  6245. *
  6246. * @private
  6247. * @param {string} methodName The name of the `String` case method to use.
  6248. * @returns {Function} Returns the new case function.
  6249. */
  6250. function createCaseFirst(methodName) {
  6251. return function(string) {
  6252. string = toString(string);
  6253. var strSymbols = hasUnicode(string)
  6254. ? stringToArray(string)
  6255. : undefined;
  6256. var chr = strSymbols
  6257. ? strSymbols[0]
  6258. : string.charAt(0);
  6259. var trailing = strSymbols
  6260. ? castSlice(strSymbols, 1).join('')
  6261. : string.slice(1);
  6262. return chr[methodName]() + trailing;
  6263. };
  6264. }
  6265. /**
  6266. * Creates a function like `_.camelCase`.
  6267. *
  6268. * @private
  6269. * @param {Function} callback The function to combine each word.
  6270. * @returns {Function} Returns the new compounder function.
  6271. */
  6272. function createCompounder(callback) {
  6273. return function(string) {
  6274. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  6275. };
  6276. }
  6277. /**
  6278. * Creates a function that produces an instance of `Ctor` regardless of
  6279. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  6280. *
  6281. * @private
  6282. * @param {Function} Ctor The constructor to wrap.
  6283. * @returns {Function} Returns the new wrapped function.
  6284. */
  6285. function createCtor(Ctor) {
  6286. return function() {
  6287. // Use a `switch` statement to work with class constructors. See
  6288. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  6289. // for more details.
  6290. var args = arguments;
  6291. switch (args.length) {
  6292. case 0: return new Ctor;
  6293. case 1: return new Ctor(args[0]);
  6294. case 2: return new Ctor(args[0], args[1]);
  6295. case 3: return new Ctor(args[0], args[1], args[2]);
  6296. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  6297. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  6298. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  6299. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  6300. }
  6301. var thisBinding = baseCreate(Ctor.prototype),
  6302. result = Ctor.apply(thisBinding, args);
  6303. // Mimic the constructor's `return` behavior.
  6304. // See https://es5.github.io/#x13.2.2 for more details.
  6305. return isObject(result) ? result : thisBinding;
  6306. };
  6307. }
  6308. /**
  6309. * Creates a function that wraps `func` to enable currying.
  6310. *
  6311. * @private
  6312. * @param {Function} func The function to wrap.
  6313. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6314. * @param {number} arity The arity of `func`.
  6315. * @returns {Function} Returns the new wrapped function.
  6316. */
  6317. function createCurry(func, bitmask, arity) {
  6318. var Ctor = createCtor(func);
  6319. function wrapper() {
  6320. var length = arguments.length,
  6321. args = Array(length),
  6322. index = length,
  6323. placeholder = getHolder(wrapper);
  6324. while (index--) {
  6325. args[index] = arguments[index];
  6326. }
  6327. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  6328. ? []
  6329. : replaceHolders(args, placeholder);
  6330. length -= holders.length;
  6331. if (length < arity) {
  6332. return createRecurry(
  6333. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  6334. args, holders, undefined, undefined, arity - length);
  6335. }
  6336. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6337. return apply(fn, this, args);
  6338. }
  6339. return wrapper;
  6340. }
  6341. /**
  6342. * Creates a `_.find` or `_.findLast` function.
  6343. *
  6344. * @private
  6345. * @param {Function} findIndexFunc The function to find the collection index.
  6346. * @returns {Function} Returns the new find function.
  6347. */
  6348. function createFind(findIndexFunc) {
  6349. return function(collection, predicate, fromIndex) {
  6350. var iterable = Object(collection);
  6351. if (!isArrayLike(collection)) {
  6352. var iteratee = getIteratee(predicate, 3);
  6353. collection = keys(collection);
  6354. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  6355. }
  6356. var index = findIndexFunc(collection, predicate, fromIndex);
  6357. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  6358. };
  6359. }
  6360. /**
  6361. * Creates a `_.flow` or `_.flowRight` function.
  6362. *
  6363. * @private
  6364. * @param {boolean} [fromRight] Specify iterating from right to left.
  6365. * @returns {Function} Returns the new flow function.
  6366. */
  6367. function createFlow(fromRight) {
  6368. return flatRest(function(funcs) {
  6369. var length = funcs.length,
  6370. index = length,
  6371. prereq = LodashWrapper.prototype.thru;
  6372. if (fromRight) {
  6373. funcs.reverse();
  6374. }
  6375. while (index--) {
  6376. var func = funcs[index];
  6377. if (typeof func != 'function') {
  6378. throw new TypeError(FUNC_ERROR_TEXT);
  6379. }
  6380. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  6381. var wrapper = new LodashWrapper([], true);
  6382. }
  6383. }
  6384. index = wrapper ? index : length;
  6385. while (++index < length) {
  6386. func = funcs[index];
  6387. var funcName = getFuncName(func),
  6388. data = funcName == 'wrapper' ? getData(func) : undefined;
  6389. if (data && isLaziable(data[0]) &&
  6390. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  6391. !data[4].length && data[9] == 1
  6392. ) {
  6393. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  6394. } else {
  6395. wrapper = (func.length == 1 && isLaziable(func))
  6396. ? wrapper[funcName]()
  6397. : wrapper.thru(func);
  6398. }
  6399. }
  6400. return function() {
  6401. var args = arguments,
  6402. value = args[0];
  6403. if (wrapper && args.length == 1 && isArray(value)) {
  6404. return wrapper.plant(value).value();
  6405. }
  6406. var index = 0,
  6407. result = length ? funcs[index].apply(this, args) : value;
  6408. while (++index < length) {
  6409. result = funcs[index].call(this, result);
  6410. }
  6411. return result;
  6412. };
  6413. });
  6414. }
  6415. /**
  6416. * Creates a function that wraps `func` to invoke it with optional `this`
  6417. * binding of `thisArg`, partial application, and currying.
  6418. *
  6419. * @private
  6420. * @param {Function|string} func The function or method name to wrap.
  6421. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6422. * @param {*} [thisArg] The `this` binding of `func`.
  6423. * @param {Array} [partials] The arguments to prepend to those provided to
  6424. * the new function.
  6425. * @param {Array} [holders] The `partials` placeholder indexes.
  6426. * @param {Array} [partialsRight] The arguments to append to those provided
  6427. * to the new function.
  6428. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  6429. * @param {Array} [argPos] The argument positions of the new function.
  6430. * @param {number} [ary] The arity cap of `func`.
  6431. * @param {number} [arity] The arity of `func`.
  6432. * @returns {Function} Returns the new wrapped function.
  6433. */
  6434. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  6435. var isAry = bitmask & WRAP_ARY_FLAG,
  6436. isBind = bitmask & WRAP_BIND_FLAG,
  6437. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  6438. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  6439. isFlip = bitmask & WRAP_FLIP_FLAG,
  6440. Ctor = isBindKey ? undefined : createCtor(func);
  6441. function wrapper() {
  6442. var length = arguments.length,
  6443. args = Array(length),
  6444. index = length;
  6445. while (index--) {
  6446. args[index] = arguments[index];
  6447. }
  6448. if (isCurried) {
  6449. var placeholder = getHolder(wrapper),
  6450. holdersCount = countHolders(args, placeholder);
  6451. }
  6452. if (partials) {
  6453. args = composeArgs(args, partials, holders, isCurried);
  6454. }
  6455. if (partialsRight) {
  6456. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  6457. }
  6458. length -= holdersCount;
  6459. if (isCurried && length < arity) {
  6460. var newHolders = replaceHolders(args, placeholder);
  6461. return createRecurry(
  6462. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6463. args, newHolders, argPos, ary, arity - length
  6464. );
  6465. }
  6466. var thisBinding = isBind ? thisArg : this,
  6467. fn = isBindKey ? thisBinding[func] : func;
  6468. length = args.length;
  6469. if (argPos) {
  6470. args = reorder(args, argPos);
  6471. } else if (isFlip && length > 1) {
  6472. args.reverse();
  6473. }
  6474. if (isAry && ary < length) {
  6475. args.length = ary;
  6476. }
  6477. if (this && this !== root && this instanceof wrapper) {
  6478. fn = Ctor || createCtor(fn);
  6479. }
  6480. return fn.apply(thisBinding, args);
  6481. }
  6482. return wrapper;
  6483. }
  6484. /**
  6485. * Creates a function like `_.invertBy`.
  6486. *
  6487. * @private
  6488. * @param {Function} setter The function to set accumulator values.
  6489. * @param {Function} toIteratee The function to resolve iteratees.
  6490. * @returns {Function} Returns the new inverter function.
  6491. */
  6492. function createInverter(setter, toIteratee) {
  6493. return function(object, iteratee) {
  6494. return baseInverter(object, setter, toIteratee(iteratee), {});
  6495. };
  6496. }
  6497. /**
  6498. * Creates a function that performs a mathematical operation on two values.
  6499. *
  6500. * @private
  6501. * @param {Function} operator The function to perform the operation.
  6502. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6503. * @returns {Function} Returns the new mathematical operation function.
  6504. */
  6505. function createMathOperation(operator, defaultValue) {
  6506. return function(value, other) {
  6507. var result;
  6508. if (value === undefined && other === undefined) {
  6509. return defaultValue;
  6510. }
  6511. if (value !== undefined) {
  6512. result = value;
  6513. }
  6514. if (other !== undefined) {
  6515. if (result === undefined) {
  6516. return other;
  6517. }
  6518. if (typeof value == 'string' || typeof other == 'string') {
  6519. value = baseToString(value);
  6520. other = baseToString(other);
  6521. } else {
  6522. value = baseToNumber(value);
  6523. other = baseToNumber(other);
  6524. }
  6525. result = operator(value, other);
  6526. }
  6527. return result;
  6528. };
  6529. }
  6530. /**
  6531. * Creates a function like `_.over`.
  6532. *
  6533. * @private
  6534. * @param {Function} arrayFunc The function to iterate over iteratees.
  6535. * @returns {Function} Returns the new over function.
  6536. */
  6537. function createOver(arrayFunc) {
  6538. return flatRest(function(iteratees) {
  6539. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6540. return baseRest(function(args) {
  6541. var thisArg = this;
  6542. return arrayFunc(iteratees, function(iteratee) {
  6543. return apply(iteratee, thisArg, args);
  6544. });
  6545. });
  6546. });
  6547. }
  6548. /**
  6549. * Creates the padding for `string` based on `length`. The `chars` string
  6550. * is truncated if the number of characters exceeds `length`.
  6551. *
  6552. * @private
  6553. * @param {number} length The padding length.
  6554. * @param {string} [chars=' '] The string used as padding.
  6555. * @returns {string} Returns the padding for `string`.
  6556. */
  6557. function createPadding(length, chars) {
  6558. chars = chars === undefined ? ' ' : baseToString(chars);
  6559. var charsLength = chars.length;
  6560. if (charsLength < 2) {
  6561. return charsLength ? baseRepeat(chars, length) : chars;
  6562. }
  6563. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6564. return hasUnicode(chars)
  6565. ? castSlice(stringToArray(result), 0, length).join('')
  6566. : result.slice(0, length);
  6567. }
  6568. /**
  6569. * Creates a function that wraps `func` to invoke it with the `this` binding
  6570. * of `thisArg` and `partials` prepended to the arguments it receives.
  6571. *
  6572. * @private
  6573. * @param {Function} func The function to wrap.
  6574. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6575. * @param {*} thisArg The `this` binding of `func`.
  6576. * @param {Array} partials The arguments to prepend to those provided to
  6577. * the new function.
  6578. * @returns {Function} Returns the new wrapped function.
  6579. */
  6580. function createPartial(func, bitmask, thisArg, partials) {
  6581. var isBind = bitmask & WRAP_BIND_FLAG,
  6582. Ctor = createCtor(func);
  6583. function wrapper() {
  6584. var argsIndex = -1,
  6585. argsLength = arguments.length,
  6586. leftIndex = -1,
  6587. leftLength = partials.length,
  6588. args = Array(leftLength + argsLength),
  6589. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6590. while (++leftIndex < leftLength) {
  6591. args[leftIndex] = partials[leftIndex];
  6592. }
  6593. while (argsLength--) {
  6594. args[leftIndex++] = arguments[++argsIndex];
  6595. }
  6596. return apply(fn, isBind ? thisArg : this, args);
  6597. }
  6598. return wrapper;
  6599. }
  6600. /**
  6601. * Creates a `_.range` or `_.rangeRight` function.
  6602. *
  6603. * @private
  6604. * @param {boolean} [fromRight] Specify iterating from right to left.
  6605. * @returns {Function} Returns the new range function.
  6606. */
  6607. function createRange(fromRight) {
  6608. return function(start, end, step) {
  6609. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6610. end = step = undefined;
  6611. }
  6612. // Ensure the sign of `-0` is preserved.
  6613. start = toFinite(start);
  6614. if (end === undefined) {
  6615. end = start;
  6616. start = 0;
  6617. } else {
  6618. end = toFinite(end);
  6619. }
  6620. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6621. return baseRange(start, end, step, fromRight);
  6622. };
  6623. }
  6624. /**
  6625. * Creates a function that performs a relational operation on two values.
  6626. *
  6627. * @private
  6628. * @param {Function} operator The function to perform the operation.
  6629. * @returns {Function} Returns the new relational operation function.
  6630. */
  6631. function createRelationalOperation(operator) {
  6632. return function(value, other) {
  6633. if (!(typeof value == 'string' && typeof other == 'string')) {
  6634. value = toNumber(value);
  6635. other = toNumber(other);
  6636. }
  6637. return operator(value, other);
  6638. };
  6639. }
  6640. /**
  6641. * Creates a function that wraps `func` to continue currying.
  6642. *
  6643. * @private
  6644. * @param {Function} func The function to wrap.
  6645. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6646. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6647. * @param {*} placeholder The placeholder value.
  6648. * @param {*} [thisArg] The `this` binding of `func`.
  6649. * @param {Array} [partials] The arguments to prepend to those provided to
  6650. * the new function.
  6651. * @param {Array} [holders] The `partials` placeholder indexes.
  6652. * @param {Array} [argPos] The argument positions of the new function.
  6653. * @param {number} [ary] The arity cap of `func`.
  6654. * @param {number} [arity] The arity of `func`.
  6655. * @returns {Function} Returns the new wrapped function.
  6656. */
  6657. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6658. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6659. newHolders = isCurry ? holders : undefined,
  6660. newHoldersRight = isCurry ? undefined : holders,
  6661. newPartials = isCurry ? partials : undefined,
  6662. newPartialsRight = isCurry ? undefined : partials;
  6663. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6664. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6665. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6666. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6667. }
  6668. var newData = [
  6669. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6670. newHoldersRight, argPos, ary, arity
  6671. ];
  6672. var result = wrapFunc.apply(undefined, newData);
  6673. if (isLaziable(func)) {
  6674. setData(result, newData);
  6675. }
  6676. result.placeholder = placeholder;
  6677. return setWrapToString(result, func, bitmask);
  6678. }
  6679. /**
  6680. * Creates a function like `_.round`.
  6681. *
  6682. * @private
  6683. * @param {string} methodName The name of the `Math` method to use when rounding.
  6684. * @returns {Function} Returns the new round function.
  6685. */
  6686. function createRound(methodName) {
  6687. var func = Math[methodName];
  6688. return function(number, precision) {
  6689. number = toNumber(number);
  6690. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6691. if (precision && nativeIsFinite(number)) {
  6692. // Shift with exponential notation to avoid floating-point issues.
  6693. // See [MDN](https://mdn.io/round#Examples) for more details.
  6694. var pair = (toString(number) + 'e').split('e'),
  6695. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6696. pair = (toString(value) + 'e').split('e');
  6697. return +(pair[0] + 'e' + (+pair[1] - precision));
  6698. }
  6699. return func(number);
  6700. };
  6701. }
  6702. /**
  6703. * Creates a set object of `values`.
  6704. *
  6705. * @private
  6706. * @param {Array} values The values to add to the set.
  6707. * @returns {Object} Returns the new set.
  6708. */
  6709. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6710. return new Set(values);
  6711. };
  6712. /**
  6713. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6714. *
  6715. * @private
  6716. * @param {Function} keysFunc The function to get the keys of a given object.
  6717. * @returns {Function} Returns the new pairs function.
  6718. */
  6719. function createToPairs(keysFunc) {
  6720. return function(object) {
  6721. var tag = getTag(object);
  6722. if (tag == mapTag) {
  6723. return mapToArray(object);
  6724. }
  6725. if (tag == setTag) {
  6726. return setToPairs(object);
  6727. }
  6728. return baseToPairs(object, keysFunc(object));
  6729. };
  6730. }
  6731. /**
  6732. * Creates a function that either curries or invokes `func` with optional
  6733. * `this` binding and partially applied arguments.
  6734. *
  6735. * @private
  6736. * @param {Function|string} func The function or method name to wrap.
  6737. * @param {number} bitmask The bitmask flags.
  6738. * 1 - `_.bind`
  6739. * 2 - `_.bindKey`
  6740. * 4 - `_.curry` or `_.curryRight` of a bound function
  6741. * 8 - `_.curry`
  6742. * 16 - `_.curryRight`
  6743. * 32 - `_.partial`
  6744. * 64 - `_.partialRight`
  6745. * 128 - `_.rearg`
  6746. * 256 - `_.ary`
  6747. * 512 - `_.flip`
  6748. * @param {*} [thisArg] The `this` binding of `func`.
  6749. * @param {Array} [partials] The arguments to be partially applied.
  6750. * @param {Array} [holders] The `partials` placeholder indexes.
  6751. * @param {Array} [argPos] The argument positions of the new function.
  6752. * @param {number} [ary] The arity cap of `func`.
  6753. * @param {number} [arity] The arity of `func`.
  6754. * @returns {Function} Returns the new wrapped function.
  6755. */
  6756. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6757. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6758. if (!isBindKey && typeof func != 'function') {
  6759. throw new TypeError(FUNC_ERROR_TEXT);
  6760. }
  6761. var length = partials ? partials.length : 0;
  6762. if (!length) {
  6763. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6764. partials = holders = undefined;
  6765. }
  6766. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6767. arity = arity === undefined ? arity : toInteger(arity);
  6768. length -= holders ? holders.length : 0;
  6769. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6770. var partialsRight = partials,
  6771. holdersRight = holders;
  6772. partials = holders = undefined;
  6773. }
  6774. var data = isBindKey ? undefined : getData(func);
  6775. var newData = [
  6776. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6777. argPos, ary, arity
  6778. ];
  6779. if (data) {
  6780. mergeData(newData, data);
  6781. }
  6782. func = newData[0];
  6783. bitmask = newData[1];
  6784. thisArg = newData[2];
  6785. partials = newData[3];
  6786. holders = newData[4];
  6787. arity = newData[9] = newData[9] === undefined
  6788. ? (isBindKey ? 0 : func.length)
  6789. : nativeMax(newData[9] - length, 0);
  6790. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6791. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6792. }
  6793. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6794. var result = createBind(func, bitmask, thisArg);
  6795. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6796. result = createCurry(func, bitmask, arity);
  6797. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6798. result = createPartial(func, bitmask, thisArg, partials);
  6799. } else {
  6800. result = createHybrid.apply(undefined, newData);
  6801. }
  6802. var setter = data ? baseSetData : setData;
  6803. return setWrapToString(setter(result, newData), func, bitmask);
  6804. }
  6805. /**
  6806. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6807. * of source objects to the destination object for all destination properties
  6808. * that resolve to `undefined`.
  6809. *
  6810. * @private
  6811. * @param {*} objValue The destination value.
  6812. * @param {*} srcValue The source value.
  6813. * @param {string} key The key of the property to assign.
  6814. * @param {Object} object The parent object of `objValue`.
  6815. * @returns {*} Returns the value to assign.
  6816. */
  6817. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6818. if (objValue === undefined ||
  6819. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6820. return srcValue;
  6821. }
  6822. return objValue;
  6823. }
  6824. /**
  6825. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6826. * objects into destination objects that are passed thru.
  6827. *
  6828. * @private
  6829. * @param {*} objValue The destination value.
  6830. * @param {*} srcValue The source value.
  6831. * @param {string} key The key of the property to merge.
  6832. * @param {Object} object The parent object of `objValue`.
  6833. * @param {Object} source The parent object of `srcValue`.
  6834. * @param {Object} [stack] Tracks traversed source values and their merged
  6835. * counterparts.
  6836. * @returns {*} Returns the value to assign.
  6837. */
  6838. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6839. if (isObject(objValue) && isObject(srcValue)) {
  6840. // Recursively merge objects and arrays (susceptible to call stack limits).
  6841. stack.set(srcValue, objValue);
  6842. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6843. stack['delete'](srcValue);
  6844. }
  6845. return objValue;
  6846. }
  6847. /**
  6848. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6849. * objects.
  6850. *
  6851. * @private
  6852. * @param {*} value The value to inspect.
  6853. * @param {string} key The key of the property to inspect.
  6854. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6855. */
  6856. function customOmitClone(value) {
  6857. return isPlainObject(value) ? undefined : value;
  6858. }
  6859. /**
  6860. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6861. * partial deep comparisons.
  6862. *
  6863. * @private
  6864. * @param {Array} array The array to compare.
  6865. * @param {Array} other The other array to compare.
  6866. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6867. * @param {Function} customizer The function to customize comparisons.
  6868. * @param {Function} equalFunc The function to determine equivalents of values.
  6869. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6870. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6871. */
  6872. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6873. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6874. arrLength = array.length,
  6875. othLength = other.length;
  6876. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6877. return false;
  6878. }
  6879. // Check that cyclic values are equal.
  6880. var arrStacked = stack.get(array);
  6881. var othStacked = stack.get(other);
  6882. if (arrStacked && othStacked) {
  6883. return arrStacked == other && othStacked == array;
  6884. }
  6885. var index = -1,
  6886. result = true,
  6887. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6888. stack.set(array, other);
  6889. stack.set(other, array);
  6890. // Ignore non-index properties.
  6891. while (++index < arrLength) {
  6892. var arrValue = array[index],
  6893. othValue = other[index];
  6894. if (customizer) {
  6895. var compared = isPartial
  6896. ? customizer(othValue, arrValue, index, other, array, stack)
  6897. : customizer(arrValue, othValue, index, array, other, stack);
  6898. }
  6899. if (compared !== undefined) {
  6900. if (compared) {
  6901. continue;
  6902. }
  6903. result = false;
  6904. break;
  6905. }
  6906. // Recursively compare arrays (susceptible to call stack limits).
  6907. if (seen) {
  6908. if (!arraySome(other, function(othValue, othIndex) {
  6909. if (!cacheHas(seen, othIndex) &&
  6910. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6911. return seen.push(othIndex);
  6912. }
  6913. })) {
  6914. result = false;
  6915. break;
  6916. }
  6917. } else if (!(
  6918. arrValue === othValue ||
  6919. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6920. )) {
  6921. result = false;
  6922. break;
  6923. }
  6924. }
  6925. stack['delete'](array);
  6926. stack['delete'](other);
  6927. return result;
  6928. }
  6929. /**
  6930. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6931. * the same `toStringTag`.
  6932. *
  6933. * **Note:** This function only supports comparing values with tags of
  6934. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6935. *
  6936. * @private
  6937. * @param {Object} object The object to compare.
  6938. * @param {Object} other The other object to compare.
  6939. * @param {string} tag The `toStringTag` of the objects to compare.
  6940. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6941. * @param {Function} customizer The function to customize comparisons.
  6942. * @param {Function} equalFunc The function to determine equivalents of values.
  6943. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6944. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6945. */
  6946. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6947. switch (tag) {
  6948. case dataViewTag:
  6949. if ((object.byteLength != other.byteLength) ||
  6950. (object.byteOffset != other.byteOffset)) {
  6951. return false;
  6952. }
  6953. object = object.buffer;
  6954. other = other.buffer;
  6955. case arrayBufferTag:
  6956. if ((object.byteLength != other.byteLength) ||
  6957. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6958. return false;
  6959. }
  6960. return true;
  6961. case boolTag:
  6962. case dateTag:
  6963. case numberTag:
  6964. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6965. // Invalid dates are coerced to `NaN`.
  6966. return eq(+object, +other);
  6967. case errorTag:
  6968. return object.name == other.name && object.message == other.message;
  6969. case regexpTag:
  6970. case stringTag:
  6971. // Coerce regexes to strings and treat strings, primitives and objects,
  6972. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6973. // for more details.
  6974. return object == (other + '');
  6975. case mapTag:
  6976. var convert = mapToArray;
  6977. case setTag:
  6978. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6979. convert || (convert = setToArray);
  6980. if (object.size != other.size && !isPartial) {
  6981. return false;
  6982. }
  6983. // Assume cyclic values are equal.
  6984. var stacked = stack.get(object);
  6985. if (stacked) {
  6986. return stacked == other;
  6987. }
  6988. bitmask |= COMPARE_UNORDERED_FLAG;
  6989. // Recursively compare objects (susceptible to call stack limits).
  6990. stack.set(object, other);
  6991. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6992. stack['delete'](object);
  6993. return result;
  6994. case symbolTag:
  6995. if (symbolValueOf) {
  6996. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6997. }
  6998. }
  6999. return false;
  7000. }
  7001. /**
  7002. * A specialized version of `baseIsEqualDeep` for objects with support for
  7003. * partial deep comparisons.
  7004. *
  7005. * @private
  7006. * @param {Object} object The object to compare.
  7007. * @param {Object} other The other object to compare.
  7008. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  7009. * @param {Function} customizer The function to customize comparisons.
  7010. * @param {Function} equalFunc The function to determine equivalents of values.
  7011. * @param {Object} stack Tracks traversed `object` and `other` objects.
  7012. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  7013. */
  7014. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  7015. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  7016. objProps = getAllKeys(object),
  7017. objLength = objProps.length,
  7018. othProps = getAllKeys(other),
  7019. othLength = othProps.length;
  7020. if (objLength != othLength && !isPartial) {
  7021. return false;
  7022. }
  7023. var index = objLength;
  7024. while (index--) {
  7025. var key = objProps[index];
  7026. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  7027. return false;
  7028. }
  7029. }
  7030. // Check that cyclic values are equal.
  7031. var objStacked = stack.get(object);
  7032. var othStacked = stack.get(other);
  7033. if (objStacked && othStacked) {
  7034. return objStacked == other && othStacked == object;
  7035. }
  7036. var result = true;
  7037. stack.set(object, other);
  7038. stack.set(other, object);
  7039. var skipCtor = isPartial;
  7040. while (++index < objLength) {
  7041. key = objProps[index];
  7042. var objValue = object[key],
  7043. othValue = other[key];
  7044. if (customizer) {
  7045. var compared = isPartial
  7046. ? customizer(othValue, objValue, key, other, object, stack)
  7047. : customizer(objValue, othValue, key, object, other, stack);
  7048. }
  7049. // Recursively compare objects (susceptible to call stack limits).
  7050. if (!(compared === undefined
  7051. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  7052. : compared
  7053. )) {
  7054. result = false;
  7055. break;
  7056. }
  7057. skipCtor || (skipCtor = key == 'constructor');
  7058. }
  7059. if (result && !skipCtor) {
  7060. var objCtor = object.constructor,
  7061. othCtor = other.constructor;
  7062. // Non `Object` object instances with different constructors are not equal.
  7063. if (objCtor != othCtor &&
  7064. ('constructor' in object && 'constructor' in other) &&
  7065. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  7066. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  7067. result = false;
  7068. }
  7069. }
  7070. stack['delete'](object);
  7071. stack['delete'](other);
  7072. return result;
  7073. }
  7074. /**
  7075. * A specialized version of `baseRest` which flattens the rest array.
  7076. *
  7077. * @private
  7078. * @param {Function} func The function to apply a rest parameter to.
  7079. * @returns {Function} Returns the new function.
  7080. */
  7081. function flatRest(func) {
  7082. return setToString(overRest(func, undefined, flatten), func + '');
  7083. }
  7084. /**
  7085. * Creates an array of own enumerable property names and symbols of `object`.
  7086. *
  7087. * @private
  7088. * @param {Object} object The object to query.
  7089. * @returns {Array} Returns the array of property names and symbols.
  7090. */
  7091. function getAllKeys(object) {
  7092. return baseGetAllKeys(object, keys, getSymbols);
  7093. }
  7094. /**
  7095. * Creates an array of own and inherited enumerable property names and
  7096. * symbols of `object`.
  7097. *
  7098. * @private
  7099. * @param {Object} object The object to query.
  7100. * @returns {Array} Returns the array of property names and symbols.
  7101. */
  7102. function getAllKeysIn(object) {
  7103. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  7104. }
  7105. /**
  7106. * Gets metadata for `func`.
  7107. *
  7108. * @private
  7109. * @param {Function} func The function to query.
  7110. * @returns {*} Returns the metadata for `func`.
  7111. */
  7112. var getData = !metaMap ? noop : function(func) {
  7113. return metaMap.get(func);
  7114. };
  7115. /**
  7116. * Gets the name of `func`.
  7117. *
  7118. * @private
  7119. * @param {Function} func The function to query.
  7120. * @returns {string} Returns the function name.
  7121. */
  7122. function getFuncName(func) {
  7123. var result = (func.name + ''),
  7124. array = realNames[result],
  7125. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  7126. while (length--) {
  7127. var data = array[length],
  7128. otherFunc = data.func;
  7129. if (otherFunc == null || otherFunc == func) {
  7130. return data.name;
  7131. }
  7132. }
  7133. return result;
  7134. }
  7135. /**
  7136. * Gets the argument placeholder value for `func`.
  7137. *
  7138. * @private
  7139. * @param {Function} func The function to inspect.
  7140. * @returns {*} Returns the placeholder value.
  7141. */
  7142. function getHolder(func) {
  7143. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  7144. return object.placeholder;
  7145. }
  7146. /**
  7147. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  7148. * this function returns the custom method, otherwise it returns `baseIteratee`.
  7149. * If arguments are provided, the chosen function is invoked with them and
  7150. * its result is returned.
  7151. *
  7152. * @private
  7153. * @param {*} [value] The value to convert to an iteratee.
  7154. * @param {number} [arity] The arity of the created iteratee.
  7155. * @returns {Function} Returns the chosen function or its result.
  7156. */
  7157. function getIteratee() {
  7158. var result = lodash.iteratee || iteratee;
  7159. result = result === iteratee ? baseIteratee : result;
  7160. return arguments.length ? result(arguments[0], arguments[1]) : result;
  7161. }
  7162. /**
  7163. * Gets the data for `map`.
  7164. *
  7165. * @private
  7166. * @param {Object} map The map to query.
  7167. * @param {string} key The reference key.
  7168. * @returns {*} Returns the map data.
  7169. */
  7170. function getMapData(map, key) {
  7171. var data = map.__data__;
  7172. return isKeyable(key)
  7173. ? data[typeof key == 'string' ? 'string' : 'hash']
  7174. : data.map;
  7175. }
  7176. /**
  7177. * Gets the property names, values, and compare flags of `object`.
  7178. *
  7179. * @private
  7180. * @param {Object} object The object to query.
  7181. * @returns {Array} Returns the match data of `object`.
  7182. */
  7183. function getMatchData(object) {
  7184. var result = keys(object),
  7185. length = result.length;
  7186. while (length--) {
  7187. var key = result[length],
  7188. value = object[key];
  7189. result[length] = [key, value, isStrictComparable(value)];
  7190. }
  7191. return result;
  7192. }
  7193. /**
  7194. * Gets the native function at `key` of `object`.
  7195. *
  7196. * @private
  7197. * @param {Object} object The object to query.
  7198. * @param {string} key The key of the method to get.
  7199. * @returns {*} Returns the function if it's native, else `undefined`.
  7200. */
  7201. function getNative(object, key) {
  7202. var value = getValue(object, key);
  7203. return baseIsNative(value) ? value : undefined;
  7204. }
  7205. /**
  7206. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  7207. *
  7208. * @private
  7209. * @param {*} value The value to query.
  7210. * @returns {string} Returns the raw `toStringTag`.
  7211. */
  7212. function getRawTag(value) {
  7213. var isOwn = hasOwnProperty.call(value, symToStringTag),
  7214. tag = value[symToStringTag];
  7215. try {
  7216. value[symToStringTag] = undefined;
  7217. var unmasked = true;
  7218. } catch (e) {}
  7219. var result = nativeObjectToString.call(value);
  7220. if (unmasked) {
  7221. if (isOwn) {
  7222. value[symToStringTag] = tag;
  7223. } else {
  7224. delete value[symToStringTag];
  7225. }
  7226. }
  7227. return result;
  7228. }
  7229. /**
  7230. * Creates an array of the own enumerable symbols of `object`.
  7231. *
  7232. * @private
  7233. * @param {Object} object The object to query.
  7234. * @returns {Array} Returns the array of symbols.
  7235. */
  7236. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  7237. if (object == null) {
  7238. return [];
  7239. }
  7240. object = Object(object);
  7241. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  7242. return propertyIsEnumerable.call(object, symbol);
  7243. });
  7244. };
  7245. /**
  7246. * Creates an array of the own and inherited enumerable symbols of `object`.
  7247. *
  7248. * @private
  7249. * @param {Object} object The object to query.
  7250. * @returns {Array} Returns the array of symbols.
  7251. */
  7252. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  7253. var result = [];
  7254. while (object) {
  7255. arrayPush(result, getSymbols(object));
  7256. object = getPrototype(object);
  7257. }
  7258. return result;
  7259. };
  7260. /**
  7261. * Gets the `toStringTag` of `value`.
  7262. *
  7263. * @private
  7264. * @param {*} value The value to query.
  7265. * @returns {string} Returns the `toStringTag`.
  7266. */
  7267. var getTag = baseGetTag;
  7268. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  7269. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  7270. (Map && getTag(new Map) != mapTag) ||
  7271. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  7272. (Set && getTag(new Set) != setTag) ||
  7273. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  7274. getTag = function(value) {
  7275. var result = baseGetTag(value),
  7276. Ctor = result == objectTag ? value.constructor : undefined,
  7277. ctorString = Ctor ? toSource(Ctor) : '';
  7278. if (ctorString) {
  7279. switch (ctorString) {
  7280. case dataViewCtorString: return dataViewTag;
  7281. case mapCtorString: return mapTag;
  7282. case promiseCtorString: return promiseTag;
  7283. case setCtorString: return setTag;
  7284. case weakMapCtorString: return weakMapTag;
  7285. }
  7286. }
  7287. return result;
  7288. };
  7289. }
  7290. /**
  7291. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  7292. *
  7293. * @private
  7294. * @param {number} start The start of the view.
  7295. * @param {number} end The end of the view.
  7296. * @param {Array} transforms The transformations to apply to the view.
  7297. * @returns {Object} Returns an object containing the `start` and `end`
  7298. * positions of the view.
  7299. */
  7300. function getView(start, end, transforms) {
  7301. var index = -1,
  7302. length = transforms.length;
  7303. while (++index < length) {
  7304. var data = transforms[index],
  7305. size = data.size;
  7306. switch (data.type) {
  7307. case 'drop': start += size; break;
  7308. case 'dropRight': end -= size; break;
  7309. case 'take': end = nativeMin(end, start + size); break;
  7310. case 'takeRight': start = nativeMax(start, end - size); break;
  7311. }
  7312. }
  7313. return { 'start': start, 'end': end };
  7314. }
  7315. /**
  7316. * Extracts wrapper details from the `source` body comment.
  7317. *
  7318. * @private
  7319. * @param {string} source The source to inspect.
  7320. * @returns {Array} Returns the wrapper details.
  7321. */
  7322. function getWrapDetails(source) {
  7323. var match = source.match(reWrapDetails);
  7324. return match ? match[1].split(reSplitDetails) : [];
  7325. }
  7326. /**
  7327. * Checks if `path` exists on `object`.
  7328. *
  7329. * @private
  7330. * @param {Object} object The object to query.
  7331. * @param {Array|string} path The path to check.
  7332. * @param {Function} hasFunc The function to check properties.
  7333. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  7334. */
  7335. function hasPath(object, path, hasFunc) {
  7336. path = castPath(path, object);
  7337. var index = -1,
  7338. length = path.length,
  7339. result = false;
  7340. while (++index < length) {
  7341. var key = toKey(path[index]);
  7342. if (!(result = object != null && hasFunc(object, key))) {
  7343. break;
  7344. }
  7345. object = object[key];
  7346. }
  7347. if (result || ++index != length) {
  7348. return result;
  7349. }
  7350. length = object == null ? 0 : object.length;
  7351. return !!length && isLength(length) && isIndex(key, length) &&
  7352. (isArray(object) || isArguments(object));
  7353. }
  7354. /**
  7355. * Initializes an array clone.
  7356. *
  7357. * @private
  7358. * @param {Array} array The array to clone.
  7359. * @returns {Array} Returns the initialized clone.
  7360. */
  7361. function initCloneArray(array) {
  7362. var length = array.length,
  7363. result = new array.constructor(length);
  7364. // Add properties assigned by `RegExp#exec`.
  7365. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  7366. result.index = array.index;
  7367. result.input = array.input;
  7368. }
  7369. return result;
  7370. }
  7371. /**
  7372. * Initializes an object clone.
  7373. *
  7374. * @private
  7375. * @param {Object} object The object to clone.
  7376. * @returns {Object} Returns the initialized clone.
  7377. */
  7378. function initCloneObject(object) {
  7379. return (typeof object.constructor == 'function' && !isPrototype(object))
  7380. ? baseCreate(getPrototype(object))
  7381. : {};
  7382. }
  7383. /**
  7384. * Initializes an object clone based on its `toStringTag`.
  7385. *
  7386. * **Note:** This function only supports cloning values with tags of
  7387. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  7388. *
  7389. * @private
  7390. * @param {Object} object The object to clone.
  7391. * @param {string} tag The `toStringTag` of the object to clone.
  7392. * @param {boolean} [isDeep] Specify a deep clone.
  7393. * @returns {Object} Returns the initialized clone.
  7394. */
  7395. function initCloneByTag(object, tag, isDeep) {
  7396. var Ctor = object.constructor;
  7397. switch (tag) {
  7398. case arrayBufferTag:
  7399. return cloneArrayBuffer(object);
  7400. case boolTag:
  7401. case dateTag:
  7402. return new Ctor(+object);
  7403. case dataViewTag:
  7404. return cloneDataView(object, isDeep);
  7405. case float32Tag: case float64Tag:
  7406. case int8Tag: case int16Tag: case int32Tag:
  7407. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  7408. return cloneTypedArray(object, isDeep);
  7409. case mapTag:
  7410. return new Ctor;
  7411. case numberTag:
  7412. case stringTag:
  7413. return new Ctor(object);
  7414. case regexpTag:
  7415. return cloneRegExp(object);
  7416. case setTag:
  7417. return new Ctor;
  7418. case symbolTag:
  7419. return cloneSymbol(object);
  7420. }
  7421. }
  7422. /**
  7423. * Inserts wrapper `details` in a comment at the top of the `source` body.
  7424. *
  7425. * @private
  7426. * @param {string} source The source to modify.
  7427. * @returns {Array} details The details to insert.
  7428. * @returns {string} Returns the modified source.
  7429. */
  7430. function insertWrapDetails(source, details) {
  7431. var length = details.length;
  7432. if (!length) {
  7433. return source;
  7434. }
  7435. var lastIndex = length - 1;
  7436. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  7437. details = details.join(length > 2 ? ', ' : ' ');
  7438. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  7439. }
  7440. /**
  7441. * Checks if `value` is a flattenable `arguments` object or array.
  7442. *
  7443. * @private
  7444. * @param {*} value The value to check.
  7445. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  7446. */
  7447. function isFlattenable(value) {
  7448. return isArray(value) || isArguments(value) ||
  7449. !!(spreadableSymbol && value && value[spreadableSymbol]);
  7450. }
  7451. /**
  7452. * Checks if `value` is a valid array-like index.
  7453. *
  7454. * @private
  7455. * @param {*} value The value to check.
  7456. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7457. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7458. */
  7459. function isIndex(value, length) {
  7460. var type = typeof value;
  7461. length = length == null ? MAX_SAFE_INTEGER : length;
  7462. return !!length &&
  7463. (type == 'number' ||
  7464. (type != 'symbol' && reIsUint.test(value))) &&
  7465. (value > -1 && value % 1 == 0 && value < length);
  7466. }
  7467. /**
  7468. * Checks if the given arguments are from an iteratee call.
  7469. *
  7470. * @private
  7471. * @param {*} value The potential iteratee value argument.
  7472. * @param {*} index The potential iteratee index or key argument.
  7473. * @param {*} object The potential iteratee object argument.
  7474. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7475. * else `false`.
  7476. */
  7477. function isIterateeCall(value, index, object) {
  7478. if (!isObject(object)) {
  7479. return false;
  7480. }
  7481. var type = typeof index;
  7482. if (type == 'number'
  7483. ? (isArrayLike(object) && isIndex(index, object.length))
  7484. : (type == 'string' && index in object)
  7485. ) {
  7486. return eq(object[index], value);
  7487. }
  7488. return false;
  7489. }
  7490. /**
  7491. * Checks if `value` is a property name and not a property path.
  7492. *
  7493. * @private
  7494. * @param {*} value The value to check.
  7495. * @param {Object} [object] The object to query keys on.
  7496. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7497. */
  7498. function isKey(value, object) {
  7499. if (isArray(value)) {
  7500. return false;
  7501. }
  7502. var type = typeof value;
  7503. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7504. value == null || isSymbol(value)) {
  7505. return true;
  7506. }
  7507. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7508. (object != null && value in Object(object));
  7509. }
  7510. /**
  7511. * Checks if `value` is suitable for use as unique object key.
  7512. *
  7513. * @private
  7514. * @param {*} value The value to check.
  7515. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7516. */
  7517. function isKeyable(value) {
  7518. var type = typeof value;
  7519. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7520. ? (value !== '__proto__')
  7521. : (value === null);
  7522. }
  7523. /**
  7524. * Checks if `func` has a lazy counterpart.
  7525. *
  7526. * @private
  7527. * @param {Function} func The function to check.
  7528. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7529. * else `false`.
  7530. */
  7531. function isLaziable(func) {
  7532. var funcName = getFuncName(func),
  7533. other = lodash[funcName];
  7534. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7535. return false;
  7536. }
  7537. if (func === other) {
  7538. return true;
  7539. }
  7540. var data = getData(other);
  7541. return !!data && func === data[0];
  7542. }
  7543. /**
  7544. * Checks if `func` has its source masked.
  7545. *
  7546. * @private
  7547. * @param {Function} func The function to check.
  7548. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7549. */
  7550. function isMasked(func) {
  7551. return !!maskSrcKey && (maskSrcKey in func);
  7552. }
  7553. /**
  7554. * Checks if `func` is capable of being masked.
  7555. *
  7556. * @private
  7557. * @param {*} value The value to check.
  7558. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7559. */
  7560. var isMaskable = coreJsData ? isFunction : stubFalse;
  7561. /**
  7562. * Checks if `value` is likely a prototype object.
  7563. *
  7564. * @private
  7565. * @param {*} value The value to check.
  7566. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7567. */
  7568. function isPrototype(value) {
  7569. var Ctor = value && value.constructor,
  7570. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7571. return value === proto;
  7572. }
  7573. /**
  7574. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7575. *
  7576. * @private
  7577. * @param {*} value The value to check.
  7578. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7579. * equality comparisons, else `false`.
  7580. */
  7581. function isStrictComparable(value) {
  7582. return value === value && !isObject(value);
  7583. }
  7584. /**
  7585. * A specialized version of `matchesProperty` for source values suitable
  7586. * for strict equality comparisons, i.e. `===`.
  7587. *
  7588. * @private
  7589. * @param {string} key The key of the property to get.
  7590. * @param {*} srcValue The value to match.
  7591. * @returns {Function} Returns the new spec function.
  7592. */
  7593. function matchesStrictComparable(key, srcValue) {
  7594. return function(object) {
  7595. if (object == null) {
  7596. return false;
  7597. }
  7598. return object[key] === srcValue &&
  7599. (srcValue !== undefined || (key in Object(object)));
  7600. };
  7601. }
  7602. /**
  7603. * A specialized version of `_.memoize` which clears the memoized function's
  7604. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7605. *
  7606. * @private
  7607. * @param {Function} func The function to have its output memoized.
  7608. * @returns {Function} Returns the new memoized function.
  7609. */
  7610. function memoizeCapped(func) {
  7611. var result = memoize(func, function(key) {
  7612. if (cache.size === MAX_MEMOIZE_SIZE) {
  7613. cache.clear();
  7614. }
  7615. return key;
  7616. });
  7617. var cache = result.cache;
  7618. return result;
  7619. }
  7620. /**
  7621. * Merges the function metadata of `source` into `data`.
  7622. *
  7623. * Merging metadata reduces the number of wrappers used to invoke a function.
  7624. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7625. * may be applied regardless of execution order. Methods like `_.ary` and
  7626. * `_.rearg` modify function arguments, making the order in which they are
  7627. * executed important, preventing the merging of metadata. However, we make
  7628. * an exception for a safe combined case where curried functions have `_.ary`
  7629. * and or `_.rearg` applied.
  7630. *
  7631. * @private
  7632. * @param {Array} data The destination metadata.
  7633. * @param {Array} source The source metadata.
  7634. * @returns {Array} Returns `data`.
  7635. */
  7636. function mergeData(data, source) {
  7637. var bitmask = data[1],
  7638. srcBitmask = source[1],
  7639. newBitmask = bitmask | srcBitmask,
  7640. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7641. var isCombo =
  7642. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7643. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7644. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7645. // Exit early if metadata can't be merged.
  7646. if (!(isCommon || isCombo)) {
  7647. return data;
  7648. }
  7649. // Use source `thisArg` if available.
  7650. if (srcBitmask & WRAP_BIND_FLAG) {
  7651. data[2] = source[2];
  7652. // Set when currying a bound function.
  7653. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7654. }
  7655. // Compose partial arguments.
  7656. var value = source[3];
  7657. if (value) {
  7658. var partials = data[3];
  7659. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7660. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7661. }
  7662. // Compose partial right arguments.
  7663. value = source[5];
  7664. if (value) {
  7665. partials = data[5];
  7666. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7667. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7668. }
  7669. // Use source `argPos` if available.
  7670. value = source[7];
  7671. if (value) {
  7672. data[7] = value;
  7673. }
  7674. // Use source `ary` if it's smaller.
  7675. if (srcBitmask & WRAP_ARY_FLAG) {
  7676. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7677. }
  7678. // Use source `arity` if one is not provided.
  7679. if (data[9] == null) {
  7680. data[9] = source[9];
  7681. }
  7682. // Use source `func` and merge bitmasks.
  7683. data[0] = source[0];
  7684. data[1] = newBitmask;
  7685. return data;
  7686. }
  7687. /**
  7688. * This function is like
  7689. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7690. * except that it includes inherited enumerable properties.
  7691. *
  7692. * @private
  7693. * @param {Object} object The object to query.
  7694. * @returns {Array} Returns the array of property names.
  7695. */
  7696. function nativeKeysIn(object) {
  7697. var result = [];
  7698. if (object != null) {
  7699. for (var key in Object(object)) {
  7700. result.push(key);
  7701. }
  7702. }
  7703. return result;
  7704. }
  7705. /**
  7706. * Converts `value` to a string using `Object.prototype.toString`.
  7707. *
  7708. * @private
  7709. * @param {*} value The value to convert.
  7710. * @returns {string} Returns the converted string.
  7711. */
  7712. function objectToString(value) {
  7713. return nativeObjectToString.call(value);
  7714. }
  7715. /**
  7716. * A specialized version of `baseRest` which transforms the rest array.
  7717. *
  7718. * @private
  7719. * @param {Function} func The function to apply a rest parameter to.
  7720. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7721. * @param {Function} transform The rest array transform.
  7722. * @returns {Function} Returns the new function.
  7723. */
  7724. function overRest(func, start, transform) {
  7725. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7726. return function() {
  7727. var args = arguments,
  7728. index = -1,
  7729. length = nativeMax(args.length - start, 0),
  7730. array = Array(length);
  7731. while (++index < length) {
  7732. array[index] = args[start + index];
  7733. }
  7734. index = -1;
  7735. var otherArgs = Array(start + 1);
  7736. while (++index < start) {
  7737. otherArgs[index] = args[index];
  7738. }
  7739. otherArgs[start] = transform(array);
  7740. return apply(func, this, otherArgs);
  7741. };
  7742. }
  7743. /**
  7744. * Gets the parent value at `path` of `object`.
  7745. *
  7746. * @private
  7747. * @param {Object} object The object to query.
  7748. * @param {Array} path The path to get the parent value of.
  7749. * @returns {*} Returns the parent value.
  7750. */
  7751. function parent(object, path) {
  7752. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7753. }
  7754. /**
  7755. * Reorder `array` according to the specified indexes where the element at
  7756. * the first index is assigned as the first element, the element at
  7757. * the second index is assigned as the second element, and so on.
  7758. *
  7759. * @private
  7760. * @param {Array} array The array to reorder.
  7761. * @param {Array} indexes The arranged array indexes.
  7762. * @returns {Array} Returns `array`.
  7763. */
  7764. function reorder(array, indexes) {
  7765. var arrLength = array.length,
  7766. length = nativeMin(indexes.length, arrLength),
  7767. oldArray = copyArray(array);
  7768. while (length--) {
  7769. var index = indexes[length];
  7770. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7771. }
  7772. return array;
  7773. }
  7774. /**
  7775. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7776. *
  7777. * @private
  7778. * @param {Object} object The object to query.
  7779. * @param {string} key The key of the property to get.
  7780. * @returns {*} Returns the property value.
  7781. */
  7782. function safeGet(object, key) {
  7783. if (key === 'constructor' && typeof object[key] === 'function') {
  7784. return;
  7785. }
  7786. if (key == '__proto__') {
  7787. return;
  7788. }
  7789. return object[key];
  7790. }
  7791. /**
  7792. * Sets metadata for `func`.
  7793. *
  7794. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7795. * period of time, it will trip its breaker and transition to an identity
  7796. * function to avoid garbage collection pauses in V8. See
  7797. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7798. * for more details.
  7799. *
  7800. * @private
  7801. * @param {Function} func The function to associate metadata with.
  7802. * @param {*} data The metadata.
  7803. * @returns {Function} Returns `func`.
  7804. */
  7805. var setData = shortOut(baseSetData);
  7806. /**
  7807. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7808. *
  7809. * @private
  7810. * @param {Function} func The function to delay.
  7811. * @param {number} wait The number of milliseconds to delay invocation.
  7812. * @returns {number|Object} Returns the timer id or timeout object.
  7813. */
  7814. var setTimeout = ctxSetTimeout || function(func, wait) {
  7815. return root.setTimeout(func, wait);
  7816. };
  7817. /**
  7818. * Sets the `toString` method of `func` to return `string`.
  7819. *
  7820. * @private
  7821. * @param {Function} func The function to modify.
  7822. * @param {Function} string The `toString` result.
  7823. * @returns {Function} Returns `func`.
  7824. */
  7825. var setToString = shortOut(baseSetToString);
  7826. /**
  7827. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7828. * with wrapper details in a comment at the top of the source body.
  7829. *
  7830. * @private
  7831. * @param {Function} wrapper The function to modify.
  7832. * @param {Function} reference The reference function.
  7833. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7834. * @returns {Function} Returns `wrapper`.
  7835. */
  7836. function setWrapToString(wrapper, reference, bitmask) {
  7837. var source = (reference + '');
  7838. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7839. }
  7840. /**
  7841. * Creates a function that'll short out and invoke `identity` instead
  7842. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7843. * milliseconds.
  7844. *
  7845. * @private
  7846. * @param {Function} func The function to restrict.
  7847. * @returns {Function} Returns the new shortable function.
  7848. */
  7849. function shortOut(func) {
  7850. var count = 0,
  7851. lastCalled = 0;
  7852. return function() {
  7853. var stamp = nativeNow(),
  7854. remaining = HOT_SPAN - (stamp - lastCalled);
  7855. lastCalled = stamp;
  7856. if (remaining > 0) {
  7857. if (++count >= HOT_COUNT) {
  7858. return arguments[0];
  7859. }
  7860. } else {
  7861. count = 0;
  7862. }
  7863. return func.apply(undefined, arguments);
  7864. };
  7865. }
  7866. /**
  7867. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7868. *
  7869. * @private
  7870. * @param {Array} array The array to shuffle.
  7871. * @param {number} [size=array.length] The size of `array`.
  7872. * @returns {Array} Returns `array`.
  7873. */
  7874. function shuffleSelf(array, size) {
  7875. var index = -1,
  7876. length = array.length,
  7877. lastIndex = length - 1;
  7878. size = size === undefined ? length : size;
  7879. while (++index < size) {
  7880. var rand = baseRandom(index, lastIndex),
  7881. value = array[rand];
  7882. array[rand] = array[index];
  7883. array[index] = value;
  7884. }
  7885. array.length = size;
  7886. return array;
  7887. }
  7888. /**
  7889. * Converts `string` to a property path array.
  7890. *
  7891. * @private
  7892. * @param {string} string The string to convert.
  7893. * @returns {Array} Returns the property path array.
  7894. */
  7895. var stringToPath = memoizeCapped(function(string) {
  7896. var result = [];
  7897. if (string.charCodeAt(0) === 46 /* . */) {
  7898. result.push('');
  7899. }
  7900. string.replace(rePropName, function(match, number, quote, subString) {
  7901. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7902. });
  7903. return result;
  7904. });
  7905. /**
  7906. * Converts `value` to a string key if it's not a string or symbol.
  7907. *
  7908. * @private
  7909. * @param {*} value The value to inspect.
  7910. * @returns {string|symbol} Returns the key.
  7911. */
  7912. function toKey(value) {
  7913. if (typeof value == 'string' || isSymbol(value)) {
  7914. return value;
  7915. }
  7916. var result = (value + '');
  7917. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7918. }
  7919. /**
  7920. * Converts `func` to its source code.
  7921. *
  7922. * @private
  7923. * @param {Function} func The function to convert.
  7924. * @returns {string} Returns the source code.
  7925. */
  7926. function toSource(func) {
  7927. if (func != null) {
  7928. try {
  7929. return funcToString.call(func);
  7930. } catch (e) {}
  7931. try {
  7932. return (func + '');
  7933. } catch (e) {}
  7934. }
  7935. return '';
  7936. }
  7937. /**
  7938. * Updates wrapper `details` based on `bitmask` flags.
  7939. *
  7940. * @private
  7941. * @returns {Array} details The details to modify.
  7942. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7943. * @returns {Array} Returns `details`.
  7944. */
  7945. function updateWrapDetails(details, bitmask) {
  7946. arrayEach(wrapFlags, function(pair) {
  7947. var value = '_.' + pair[0];
  7948. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7949. details.push(value);
  7950. }
  7951. });
  7952. return details.sort();
  7953. }
  7954. /**
  7955. * Creates a clone of `wrapper`.
  7956. *
  7957. * @private
  7958. * @param {Object} wrapper The wrapper to clone.
  7959. * @returns {Object} Returns the cloned wrapper.
  7960. */
  7961. function wrapperClone(wrapper) {
  7962. if (wrapper instanceof LazyWrapper) {
  7963. return wrapper.clone();
  7964. }
  7965. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7966. result.__actions__ = copyArray(wrapper.__actions__);
  7967. result.__index__ = wrapper.__index__;
  7968. result.__values__ = wrapper.__values__;
  7969. return result;
  7970. }
  7971. /*------------------------------------------------------------------------*/
  7972. /**
  7973. * Creates an array of elements split into groups the length of `size`.
  7974. * If `array` can't be split evenly, the final chunk will be the remaining
  7975. * elements.
  7976. *
  7977. * @static
  7978. * @memberOf _
  7979. * @since 3.0.0
  7980. * @category Array
  7981. * @param {Array} array The array to process.
  7982. * @param {number} [size=1] The length of each chunk
  7983. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7984. * @returns {Array} Returns the new array of chunks.
  7985. * @example
  7986. *
  7987. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7988. * // => [['a', 'b'], ['c', 'd']]
  7989. *
  7990. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7991. * // => [['a', 'b', 'c'], ['d']]
  7992. */
  7993. function chunk(array, size, guard) {
  7994. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7995. size = 1;
  7996. } else {
  7997. size = nativeMax(toInteger(size), 0);
  7998. }
  7999. var length = array == null ? 0 : array.length;
  8000. if (!length || size < 1) {
  8001. return [];
  8002. }
  8003. var index = 0,
  8004. resIndex = 0,
  8005. result = Array(nativeCeil(length / size));
  8006. while (index < length) {
  8007. result[resIndex++] = baseSlice(array, index, (index += size));
  8008. }
  8009. return result;
  8010. }
  8011. /**
  8012. * Creates an array with all falsey values removed. The values `false`, `null`,
  8013. * `0`, `""`, `undefined`, and `NaN` are falsey.
  8014. *
  8015. * @static
  8016. * @memberOf _
  8017. * @since 0.1.0
  8018. * @category Array
  8019. * @param {Array} array The array to compact.
  8020. * @returns {Array} Returns the new array of filtered values.
  8021. * @example
  8022. *
  8023. * _.compact([0, 1, false, 2, '', 3]);
  8024. * // => [1, 2, 3]
  8025. */
  8026. function compact(array) {
  8027. var index = -1,
  8028. length = array == null ? 0 : array.length,
  8029. resIndex = 0,
  8030. result = [];
  8031. while (++index < length) {
  8032. var value = array[index];
  8033. if (value) {
  8034. result[resIndex++] = value;
  8035. }
  8036. }
  8037. return result;
  8038. }
  8039. /**
  8040. * Creates a new array concatenating `array` with any additional arrays
  8041. * and/or values.
  8042. *
  8043. * @static
  8044. * @memberOf _
  8045. * @since 4.0.0
  8046. * @category Array
  8047. * @param {Array} array The array to concatenate.
  8048. * @param {...*} [values] The values to concatenate.
  8049. * @returns {Array} Returns the new concatenated array.
  8050. * @example
  8051. *
  8052. * var array = [1];
  8053. * var other = _.concat(array, 2, [3], [[4]]);
  8054. *
  8055. * console.log(other);
  8056. * // => [1, 2, 3, [4]]
  8057. *
  8058. * console.log(array);
  8059. * // => [1]
  8060. */
  8061. function concat() {
  8062. var length = arguments.length;
  8063. if (!length) {
  8064. return [];
  8065. }
  8066. var args = Array(length - 1),
  8067. array = arguments[0],
  8068. index = length;
  8069. while (index--) {
  8070. args[index - 1] = arguments[index];
  8071. }
  8072. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  8073. }
  8074. /**
  8075. * Creates an array of `array` values not included in the other given arrays
  8076. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8077. * for equality comparisons. The order and references of result values are
  8078. * determined by the first array.
  8079. *
  8080. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  8081. *
  8082. * @static
  8083. * @memberOf _
  8084. * @since 0.1.0
  8085. * @category Array
  8086. * @param {Array} array The array to inspect.
  8087. * @param {...Array} [values] The values to exclude.
  8088. * @returns {Array} Returns the new array of filtered values.
  8089. * @see _.without, _.xor
  8090. * @example
  8091. *
  8092. * _.difference([2, 1], [2, 3]);
  8093. * // => [1]
  8094. */
  8095. var difference = baseRest(function(array, values) {
  8096. return isArrayLikeObject(array)
  8097. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  8098. : [];
  8099. });
  8100. /**
  8101. * This method is like `_.difference` except that it accepts `iteratee` which
  8102. * is invoked for each element of `array` and `values` to generate the criterion
  8103. * by which they're compared. The order and references of result values are
  8104. * determined by the first array. The iteratee is invoked with one argument:
  8105. * (value).
  8106. *
  8107. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  8108. *
  8109. * @static
  8110. * @memberOf _
  8111. * @since 4.0.0
  8112. * @category Array
  8113. * @param {Array} array The array to inspect.
  8114. * @param {...Array} [values] The values to exclude.
  8115. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8116. * @returns {Array} Returns the new array of filtered values.
  8117. * @example
  8118. *
  8119. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8120. * // => [1.2]
  8121. *
  8122. * // The `_.property` iteratee shorthand.
  8123. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  8124. * // => [{ 'x': 2 }]
  8125. */
  8126. var differenceBy = baseRest(function(array, values) {
  8127. var iteratee = last(values);
  8128. if (isArrayLikeObject(iteratee)) {
  8129. iteratee = undefined;
  8130. }
  8131. return isArrayLikeObject(array)
  8132. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  8133. : [];
  8134. });
  8135. /**
  8136. * This method is like `_.difference` except that it accepts `comparator`
  8137. * which is invoked to compare elements of `array` to `values`. The order and
  8138. * references of result values are determined by the first array. The comparator
  8139. * is invoked with two arguments: (arrVal, othVal).
  8140. *
  8141. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  8142. *
  8143. * @static
  8144. * @memberOf _
  8145. * @since 4.0.0
  8146. * @category Array
  8147. * @param {Array} array The array to inspect.
  8148. * @param {...Array} [values] The values to exclude.
  8149. * @param {Function} [comparator] The comparator invoked per element.
  8150. * @returns {Array} Returns the new array of filtered values.
  8151. * @example
  8152. *
  8153. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8154. *
  8155. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  8156. * // => [{ 'x': 2, 'y': 1 }]
  8157. */
  8158. var differenceWith = baseRest(function(array, values) {
  8159. var comparator = last(values);
  8160. if (isArrayLikeObject(comparator)) {
  8161. comparator = undefined;
  8162. }
  8163. return isArrayLikeObject(array)
  8164. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  8165. : [];
  8166. });
  8167. /**
  8168. * Creates a slice of `array` with `n` elements dropped from the beginning.
  8169. *
  8170. * @static
  8171. * @memberOf _
  8172. * @since 0.5.0
  8173. * @category Array
  8174. * @param {Array} array The array to query.
  8175. * @param {number} [n=1] The number of elements to drop.
  8176. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8177. * @returns {Array} Returns the slice of `array`.
  8178. * @example
  8179. *
  8180. * _.drop([1, 2, 3]);
  8181. * // => [2, 3]
  8182. *
  8183. * _.drop([1, 2, 3], 2);
  8184. * // => [3]
  8185. *
  8186. * _.drop([1, 2, 3], 5);
  8187. * // => []
  8188. *
  8189. * _.drop([1, 2, 3], 0);
  8190. * // => [1, 2, 3]
  8191. */
  8192. function drop(array, n, guard) {
  8193. var length = array == null ? 0 : array.length;
  8194. if (!length) {
  8195. return [];
  8196. }
  8197. n = (guard || n === undefined) ? 1 : toInteger(n);
  8198. return baseSlice(array, n < 0 ? 0 : n, length);
  8199. }
  8200. /**
  8201. * Creates a slice of `array` with `n` elements dropped from the end.
  8202. *
  8203. * @static
  8204. * @memberOf _
  8205. * @since 3.0.0
  8206. * @category Array
  8207. * @param {Array} array The array to query.
  8208. * @param {number} [n=1] The number of elements to drop.
  8209. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8210. * @returns {Array} Returns the slice of `array`.
  8211. * @example
  8212. *
  8213. * _.dropRight([1, 2, 3]);
  8214. * // => [1, 2]
  8215. *
  8216. * _.dropRight([1, 2, 3], 2);
  8217. * // => [1]
  8218. *
  8219. * _.dropRight([1, 2, 3], 5);
  8220. * // => []
  8221. *
  8222. * _.dropRight([1, 2, 3], 0);
  8223. * // => [1, 2, 3]
  8224. */
  8225. function dropRight(array, n, guard) {
  8226. var length = array == null ? 0 : array.length;
  8227. if (!length) {
  8228. return [];
  8229. }
  8230. n = (guard || n === undefined) ? 1 : toInteger(n);
  8231. n = length - n;
  8232. return baseSlice(array, 0, n < 0 ? 0 : n);
  8233. }
  8234. /**
  8235. * Creates a slice of `array` excluding elements dropped from the end.
  8236. * Elements are dropped until `predicate` returns falsey. The predicate is
  8237. * invoked with three arguments: (value, index, array).
  8238. *
  8239. * @static
  8240. * @memberOf _
  8241. * @since 3.0.0
  8242. * @category Array
  8243. * @param {Array} array The array to query.
  8244. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8245. * @returns {Array} Returns the slice of `array`.
  8246. * @example
  8247. *
  8248. * var users = [
  8249. * { 'user': 'barney', 'active': true },
  8250. * { 'user': 'fred', 'active': false },
  8251. * { 'user': 'pebbles', 'active': false }
  8252. * ];
  8253. *
  8254. * _.dropRightWhile(users, function(o) { return !o.active; });
  8255. * // => objects for ['barney']
  8256. *
  8257. * // The `_.matches` iteratee shorthand.
  8258. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  8259. * // => objects for ['barney', 'fred']
  8260. *
  8261. * // The `_.matchesProperty` iteratee shorthand.
  8262. * _.dropRightWhile(users, ['active', false]);
  8263. * // => objects for ['barney']
  8264. *
  8265. * // The `_.property` iteratee shorthand.
  8266. * _.dropRightWhile(users, 'active');
  8267. * // => objects for ['barney', 'fred', 'pebbles']
  8268. */
  8269. function dropRightWhile(array, predicate) {
  8270. return (array && array.length)
  8271. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  8272. : [];
  8273. }
  8274. /**
  8275. * Creates a slice of `array` excluding elements dropped from the beginning.
  8276. * Elements are dropped until `predicate` returns falsey. The predicate is
  8277. * invoked with three arguments: (value, index, array).
  8278. *
  8279. * @static
  8280. * @memberOf _
  8281. * @since 3.0.0
  8282. * @category Array
  8283. * @param {Array} array The array to query.
  8284. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8285. * @returns {Array} Returns the slice of `array`.
  8286. * @example
  8287. *
  8288. * var users = [
  8289. * { 'user': 'barney', 'active': false },
  8290. * { 'user': 'fred', 'active': false },
  8291. * { 'user': 'pebbles', 'active': true }
  8292. * ];
  8293. *
  8294. * _.dropWhile(users, function(o) { return !o.active; });
  8295. * // => objects for ['pebbles']
  8296. *
  8297. * // The `_.matches` iteratee shorthand.
  8298. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  8299. * // => objects for ['fred', 'pebbles']
  8300. *
  8301. * // The `_.matchesProperty` iteratee shorthand.
  8302. * _.dropWhile(users, ['active', false]);
  8303. * // => objects for ['pebbles']
  8304. *
  8305. * // The `_.property` iteratee shorthand.
  8306. * _.dropWhile(users, 'active');
  8307. * // => objects for ['barney', 'fred', 'pebbles']
  8308. */
  8309. function dropWhile(array, predicate) {
  8310. return (array && array.length)
  8311. ? baseWhile(array, getIteratee(predicate, 3), true)
  8312. : [];
  8313. }
  8314. /**
  8315. * Fills elements of `array` with `value` from `start` up to, but not
  8316. * including, `end`.
  8317. *
  8318. * **Note:** This method mutates `array`.
  8319. *
  8320. * @static
  8321. * @memberOf _
  8322. * @since 3.2.0
  8323. * @category Array
  8324. * @param {Array} array The array to fill.
  8325. * @param {*} value The value to fill `array` with.
  8326. * @param {number} [start=0] The start position.
  8327. * @param {number} [end=array.length] The end position.
  8328. * @returns {Array} Returns `array`.
  8329. * @example
  8330. *
  8331. * var array = [1, 2, 3];
  8332. *
  8333. * _.fill(array, 'a');
  8334. * console.log(array);
  8335. * // => ['a', 'a', 'a']
  8336. *
  8337. * _.fill(Array(3), 2);
  8338. * // => [2, 2, 2]
  8339. *
  8340. * _.fill([4, 6, 8, 10], '*', 1, 3);
  8341. * // => [4, '*', '*', 10]
  8342. */
  8343. function fill(array, value, start, end) {
  8344. var length = array == null ? 0 : array.length;
  8345. if (!length) {
  8346. return [];
  8347. }
  8348. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  8349. start = 0;
  8350. end = length;
  8351. }
  8352. return baseFill(array, value, start, end);
  8353. }
  8354. /**
  8355. * This method is like `_.find` except that it returns the index of the first
  8356. * element `predicate` returns truthy for instead of the element itself.
  8357. *
  8358. * @static
  8359. * @memberOf _
  8360. * @since 1.1.0
  8361. * @category Array
  8362. * @param {Array} array The array to inspect.
  8363. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8364. * @param {number} [fromIndex=0] The index to search from.
  8365. * @returns {number} Returns the index of the found element, else `-1`.
  8366. * @example
  8367. *
  8368. * var users = [
  8369. * { 'user': 'barney', 'active': false },
  8370. * { 'user': 'fred', 'active': false },
  8371. * { 'user': 'pebbles', 'active': true }
  8372. * ];
  8373. *
  8374. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  8375. * // => 0
  8376. *
  8377. * // The `_.matches` iteratee shorthand.
  8378. * _.findIndex(users, { 'user': 'fred', 'active': false });
  8379. * // => 1
  8380. *
  8381. * // The `_.matchesProperty` iteratee shorthand.
  8382. * _.findIndex(users, ['active', false]);
  8383. * // => 0
  8384. *
  8385. * // The `_.property` iteratee shorthand.
  8386. * _.findIndex(users, 'active');
  8387. * // => 2
  8388. */
  8389. function findIndex(array, predicate, fromIndex) {
  8390. var length = array == null ? 0 : array.length;
  8391. if (!length) {
  8392. return -1;
  8393. }
  8394. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8395. if (index < 0) {
  8396. index = nativeMax(length + index, 0);
  8397. }
  8398. return baseFindIndex(array, getIteratee(predicate, 3), index);
  8399. }
  8400. /**
  8401. * This method is like `_.findIndex` except that it iterates over elements
  8402. * of `collection` from right to left.
  8403. *
  8404. * @static
  8405. * @memberOf _
  8406. * @since 2.0.0
  8407. * @category Array
  8408. * @param {Array} array The array to inspect.
  8409. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8410. * @param {number} [fromIndex=array.length-1] The index to search from.
  8411. * @returns {number} Returns the index of the found element, else `-1`.
  8412. * @example
  8413. *
  8414. * var users = [
  8415. * { 'user': 'barney', 'active': true },
  8416. * { 'user': 'fred', 'active': false },
  8417. * { 'user': 'pebbles', 'active': false }
  8418. * ];
  8419. *
  8420. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  8421. * // => 2
  8422. *
  8423. * // The `_.matches` iteratee shorthand.
  8424. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  8425. * // => 0
  8426. *
  8427. * // The `_.matchesProperty` iteratee shorthand.
  8428. * _.findLastIndex(users, ['active', false]);
  8429. * // => 2
  8430. *
  8431. * // The `_.property` iteratee shorthand.
  8432. * _.findLastIndex(users, 'active');
  8433. * // => 0
  8434. */
  8435. function findLastIndex(array, predicate, fromIndex) {
  8436. var length = array == null ? 0 : array.length;
  8437. if (!length) {
  8438. return -1;
  8439. }
  8440. var index = length - 1;
  8441. if (fromIndex !== undefined) {
  8442. index = toInteger(fromIndex);
  8443. index = fromIndex < 0
  8444. ? nativeMax(length + index, 0)
  8445. : nativeMin(index, length - 1);
  8446. }
  8447. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  8448. }
  8449. /**
  8450. * Flattens `array` a single level deep.
  8451. *
  8452. * @static
  8453. * @memberOf _
  8454. * @since 0.1.0
  8455. * @category Array
  8456. * @param {Array} array The array to flatten.
  8457. * @returns {Array} Returns the new flattened array.
  8458. * @example
  8459. *
  8460. * _.flatten([1, [2, [3, [4]], 5]]);
  8461. * // => [1, 2, [3, [4]], 5]
  8462. */
  8463. function flatten(array) {
  8464. var length = array == null ? 0 : array.length;
  8465. return length ? baseFlatten(array, 1) : [];
  8466. }
  8467. /**
  8468. * Recursively flattens `array`.
  8469. *
  8470. * @static
  8471. * @memberOf _
  8472. * @since 3.0.0
  8473. * @category Array
  8474. * @param {Array} array The array to flatten.
  8475. * @returns {Array} Returns the new flattened array.
  8476. * @example
  8477. *
  8478. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8479. * // => [1, 2, 3, 4, 5]
  8480. */
  8481. function flattenDeep(array) {
  8482. var length = array == null ? 0 : array.length;
  8483. return length ? baseFlatten(array, INFINITY) : [];
  8484. }
  8485. /**
  8486. * Recursively flatten `array` up to `depth` times.
  8487. *
  8488. * @static
  8489. * @memberOf _
  8490. * @since 4.4.0
  8491. * @category Array
  8492. * @param {Array} array The array to flatten.
  8493. * @param {number} [depth=1] The maximum recursion depth.
  8494. * @returns {Array} Returns the new flattened array.
  8495. * @example
  8496. *
  8497. * var array = [1, [2, [3, [4]], 5]];
  8498. *
  8499. * _.flattenDepth(array, 1);
  8500. * // => [1, 2, [3, [4]], 5]
  8501. *
  8502. * _.flattenDepth(array, 2);
  8503. * // => [1, 2, 3, [4], 5]
  8504. */
  8505. function flattenDepth(array, depth) {
  8506. var length = array == null ? 0 : array.length;
  8507. if (!length) {
  8508. return [];
  8509. }
  8510. depth = depth === undefined ? 1 : toInteger(depth);
  8511. return baseFlatten(array, depth);
  8512. }
  8513. /**
  8514. * The inverse of `_.toPairs`; this method returns an object composed
  8515. * from key-value `pairs`.
  8516. *
  8517. * @static
  8518. * @memberOf _
  8519. * @since 4.0.0
  8520. * @category Array
  8521. * @param {Array} pairs The key-value pairs.
  8522. * @returns {Object} Returns the new object.
  8523. * @example
  8524. *
  8525. * _.fromPairs([['a', 1], ['b', 2]]);
  8526. * // => { 'a': 1, 'b': 2 }
  8527. */
  8528. function fromPairs(pairs) {
  8529. var index = -1,
  8530. length = pairs == null ? 0 : pairs.length,
  8531. result = {};
  8532. while (++index < length) {
  8533. var pair = pairs[index];
  8534. result[pair[0]] = pair[1];
  8535. }
  8536. return result;
  8537. }
  8538. /**
  8539. * Gets the first element of `array`.
  8540. *
  8541. * @static
  8542. * @memberOf _
  8543. * @since 0.1.0
  8544. * @alias first
  8545. * @category Array
  8546. * @param {Array} array The array to query.
  8547. * @returns {*} Returns the first element of `array`.
  8548. * @example
  8549. *
  8550. * _.head([1, 2, 3]);
  8551. * // => 1
  8552. *
  8553. * _.head([]);
  8554. * // => undefined
  8555. */
  8556. function head(array) {
  8557. return (array && array.length) ? array[0] : undefined;
  8558. }
  8559. /**
  8560. * Gets the index at which the first occurrence of `value` is found in `array`
  8561. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8562. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8563. * offset from the end of `array`.
  8564. *
  8565. * @static
  8566. * @memberOf _
  8567. * @since 0.1.0
  8568. * @category Array
  8569. * @param {Array} array The array to inspect.
  8570. * @param {*} value The value to search for.
  8571. * @param {number} [fromIndex=0] The index to search from.
  8572. * @returns {number} Returns the index of the matched value, else `-1`.
  8573. * @example
  8574. *
  8575. * _.indexOf([1, 2, 1, 2], 2);
  8576. * // => 1
  8577. *
  8578. * // Search from the `fromIndex`.
  8579. * _.indexOf([1, 2, 1, 2], 2, 2);
  8580. * // => 3
  8581. */
  8582. function indexOf(array, value, fromIndex) {
  8583. var length = array == null ? 0 : array.length;
  8584. if (!length) {
  8585. return -1;
  8586. }
  8587. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8588. if (index < 0) {
  8589. index = nativeMax(length + index, 0);
  8590. }
  8591. return baseIndexOf(array, value, index);
  8592. }
  8593. /**
  8594. * Gets all but the last element of `array`.
  8595. *
  8596. * @static
  8597. * @memberOf _
  8598. * @since 0.1.0
  8599. * @category Array
  8600. * @param {Array} array The array to query.
  8601. * @returns {Array} Returns the slice of `array`.
  8602. * @example
  8603. *
  8604. * _.initial([1, 2, 3]);
  8605. * // => [1, 2]
  8606. */
  8607. function initial(array) {
  8608. var length = array == null ? 0 : array.length;
  8609. return length ? baseSlice(array, 0, -1) : [];
  8610. }
  8611. /**
  8612. * Creates an array of unique values that are included in all given arrays
  8613. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8614. * for equality comparisons. The order and references of result values are
  8615. * determined by the first array.
  8616. *
  8617. * @static
  8618. * @memberOf _
  8619. * @since 0.1.0
  8620. * @category Array
  8621. * @param {...Array} [arrays] The arrays to inspect.
  8622. * @returns {Array} Returns the new array of intersecting values.
  8623. * @example
  8624. *
  8625. * _.intersection([2, 1], [2, 3]);
  8626. * // => [2]
  8627. */
  8628. var intersection = baseRest(function(arrays) {
  8629. var mapped = arrayMap(arrays, castArrayLikeObject);
  8630. return (mapped.length && mapped[0] === arrays[0])
  8631. ? baseIntersection(mapped)
  8632. : [];
  8633. });
  8634. /**
  8635. * This method is like `_.intersection` except that it accepts `iteratee`
  8636. * which is invoked for each element of each `arrays` to generate the criterion
  8637. * by which they're compared. The order and references of result values are
  8638. * determined by the first array. The iteratee is invoked with one argument:
  8639. * (value).
  8640. *
  8641. * @static
  8642. * @memberOf _
  8643. * @since 4.0.0
  8644. * @category Array
  8645. * @param {...Array} [arrays] The arrays to inspect.
  8646. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8647. * @returns {Array} Returns the new array of intersecting values.
  8648. * @example
  8649. *
  8650. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8651. * // => [2.1]
  8652. *
  8653. * // The `_.property` iteratee shorthand.
  8654. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8655. * // => [{ 'x': 1 }]
  8656. */
  8657. var intersectionBy = baseRest(function(arrays) {
  8658. var iteratee = last(arrays),
  8659. mapped = arrayMap(arrays, castArrayLikeObject);
  8660. if (iteratee === last(mapped)) {
  8661. iteratee = undefined;
  8662. } else {
  8663. mapped.pop();
  8664. }
  8665. return (mapped.length && mapped[0] === arrays[0])
  8666. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8667. : [];
  8668. });
  8669. /**
  8670. * This method is like `_.intersection` except that it accepts `comparator`
  8671. * which is invoked to compare elements of `arrays`. The order and references
  8672. * of result values are determined by the first array. The comparator is
  8673. * invoked with two arguments: (arrVal, othVal).
  8674. *
  8675. * @static
  8676. * @memberOf _
  8677. * @since 4.0.0
  8678. * @category Array
  8679. * @param {...Array} [arrays] The arrays to inspect.
  8680. * @param {Function} [comparator] The comparator invoked per element.
  8681. * @returns {Array} Returns the new array of intersecting values.
  8682. * @example
  8683. *
  8684. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8685. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8686. *
  8687. * _.intersectionWith(objects, others, _.isEqual);
  8688. * // => [{ 'x': 1, 'y': 2 }]
  8689. */
  8690. var intersectionWith = baseRest(function(arrays) {
  8691. var comparator = last(arrays),
  8692. mapped = arrayMap(arrays, castArrayLikeObject);
  8693. comparator = typeof comparator == 'function' ? comparator : undefined;
  8694. if (comparator) {
  8695. mapped.pop();
  8696. }
  8697. return (mapped.length && mapped[0] === arrays[0])
  8698. ? baseIntersection(mapped, undefined, comparator)
  8699. : [];
  8700. });
  8701. /**
  8702. * Converts all elements in `array` into a string separated by `separator`.
  8703. *
  8704. * @static
  8705. * @memberOf _
  8706. * @since 4.0.0
  8707. * @category Array
  8708. * @param {Array} array The array to convert.
  8709. * @param {string} [separator=','] The element separator.
  8710. * @returns {string} Returns the joined string.
  8711. * @example
  8712. *
  8713. * _.join(['a', 'b', 'c'], '~');
  8714. * // => 'a~b~c'
  8715. */
  8716. function join(array, separator) {
  8717. return array == null ? '' : nativeJoin.call(array, separator);
  8718. }
  8719. /**
  8720. * Gets the last element of `array`.
  8721. *
  8722. * @static
  8723. * @memberOf _
  8724. * @since 0.1.0
  8725. * @category Array
  8726. * @param {Array} array The array to query.
  8727. * @returns {*} Returns the last element of `array`.
  8728. * @example
  8729. *
  8730. * _.last([1, 2, 3]);
  8731. * // => 3
  8732. */
  8733. function last(array) {
  8734. var length = array == null ? 0 : array.length;
  8735. return length ? array[length - 1] : undefined;
  8736. }
  8737. /**
  8738. * This method is like `_.indexOf` except that it iterates over elements of
  8739. * `array` from right to left.
  8740. *
  8741. * @static
  8742. * @memberOf _
  8743. * @since 0.1.0
  8744. * @category Array
  8745. * @param {Array} array The array to inspect.
  8746. * @param {*} value The value to search for.
  8747. * @param {number} [fromIndex=array.length-1] The index to search from.
  8748. * @returns {number} Returns the index of the matched value, else `-1`.
  8749. * @example
  8750. *
  8751. * _.lastIndexOf([1, 2, 1, 2], 2);
  8752. * // => 3
  8753. *
  8754. * // Search from the `fromIndex`.
  8755. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8756. * // => 1
  8757. */
  8758. function lastIndexOf(array, value, fromIndex) {
  8759. var length = array == null ? 0 : array.length;
  8760. if (!length) {
  8761. return -1;
  8762. }
  8763. var index = length;
  8764. if (fromIndex !== undefined) {
  8765. index = toInteger(fromIndex);
  8766. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8767. }
  8768. return value === value
  8769. ? strictLastIndexOf(array, value, index)
  8770. : baseFindIndex(array, baseIsNaN, index, true);
  8771. }
  8772. /**
  8773. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8774. * element from the end is returned.
  8775. *
  8776. * @static
  8777. * @memberOf _
  8778. * @since 4.11.0
  8779. * @category Array
  8780. * @param {Array} array The array to query.
  8781. * @param {number} [n=0] The index of the element to return.
  8782. * @returns {*} Returns the nth element of `array`.
  8783. * @example
  8784. *
  8785. * var array = ['a', 'b', 'c', 'd'];
  8786. *
  8787. * _.nth(array, 1);
  8788. * // => 'b'
  8789. *
  8790. * _.nth(array, -2);
  8791. * // => 'c';
  8792. */
  8793. function nth(array, n) {
  8794. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8795. }
  8796. /**
  8797. * Removes all given values from `array` using
  8798. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8799. * for equality comparisons.
  8800. *
  8801. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8802. * to remove elements from an array by predicate.
  8803. *
  8804. * @static
  8805. * @memberOf _
  8806. * @since 2.0.0
  8807. * @category Array
  8808. * @param {Array} array The array to modify.
  8809. * @param {...*} [values] The values to remove.
  8810. * @returns {Array} Returns `array`.
  8811. * @example
  8812. *
  8813. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8814. *
  8815. * _.pull(array, 'a', 'c');
  8816. * console.log(array);
  8817. * // => ['b', 'b']
  8818. */
  8819. var pull = baseRest(pullAll);
  8820. /**
  8821. * This method is like `_.pull` except that it accepts an array of values to remove.
  8822. *
  8823. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8824. *
  8825. * @static
  8826. * @memberOf _
  8827. * @since 4.0.0
  8828. * @category Array
  8829. * @param {Array} array The array to modify.
  8830. * @param {Array} values The values to remove.
  8831. * @returns {Array} Returns `array`.
  8832. * @example
  8833. *
  8834. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8835. *
  8836. * _.pullAll(array, ['a', 'c']);
  8837. * console.log(array);
  8838. * // => ['b', 'b']
  8839. */
  8840. function pullAll(array, values) {
  8841. return (array && array.length && values && values.length)
  8842. ? basePullAll(array, values)
  8843. : array;
  8844. }
  8845. /**
  8846. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8847. * invoked for each element of `array` and `values` to generate the criterion
  8848. * by which they're compared. The iteratee is invoked with one argument: (value).
  8849. *
  8850. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8851. *
  8852. * @static
  8853. * @memberOf _
  8854. * @since 4.0.0
  8855. * @category Array
  8856. * @param {Array} array The array to modify.
  8857. * @param {Array} values The values to remove.
  8858. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8859. * @returns {Array} Returns `array`.
  8860. * @example
  8861. *
  8862. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8863. *
  8864. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8865. * console.log(array);
  8866. * // => [{ 'x': 2 }]
  8867. */
  8868. function pullAllBy(array, values, iteratee) {
  8869. return (array && array.length && values && values.length)
  8870. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8871. : array;
  8872. }
  8873. /**
  8874. * This method is like `_.pullAll` except that it accepts `comparator` which
  8875. * is invoked to compare elements of `array` to `values`. The comparator is
  8876. * invoked with two arguments: (arrVal, othVal).
  8877. *
  8878. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8879. *
  8880. * @static
  8881. * @memberOf _
  8882. * @since 4.6.0
  8883. * @category Array
  8884. * @param {Array} array The array to modify.
  8885. * @param {Array} values The values to remove.
  8886. * @param {Function} [comparator] The comparator invoked per element.
  8887. * @returns {Array} Returns `array`.
  8888. * @example
  8889. *
  8890. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8891. *
  8892. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8893. * console.log(array);
  8894. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8895. */
  8896. function pullAllWith(array, values, comparator) {
  8897. return (array && array.length && values && values.length)
  8898. ? basePullAll(array, values, undefined, comparator)
  8899. : array;
  8900. }
  8901. /**
  8902. * Removes elements from `array` corresponding to `indexes` and returns an
  8903. * array of removed elements.
  8904. *
  8905. * **Note:** Unlike `_.at`, this method mutates `array`.
  8906. *
  8907. * @static
  8908. * @memberOf _
  8909. * @since 3.0.0
  8910. * @category Array
  8911. * @param {Array} array The array to modify.
  8912. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8913. * @returns {Array} Returns the new array of removed elements.
  8914. * @example
  8915. *
  8916. * var array = ['a', 'b', 'c', 'd'];
  8917. * var pulled = _.pullAt(array, [1, 3]);
  8918. *
  8919. * console.log(array);
  8920. * // => ['a', 'c']
  8921. *
  8922. * console.log(pulled);
  8923. * // => ['b', 'd']
  8924. */
  8925. var pullAt = flatRest(function(array, indexes) {
  8926. var length = array == null ? 0 : array.length,
  8927. result = baseAt(array, indexes);
  8928. basePullAt(array, arrayMap(indexes, function(index) {
  8929. return isIndex(index, length) ? +index : index;
  8930. }).sort(compareAscending));
  8931. return result;
  8932. });
  8933. /**
  8934. * Removes all elements from `array` that `predicate` returns truthy for
  8935. * and returns an array of the removed elements. The predicate is invoked
  8936. * with three arguments: (value, index, array).
  8937. *
  8938. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8939. * to pull elements from an array by value.
  8940. *
  8941. * @static
  8942. * @memberOf _
  8943. * @since 2.0.0
  8944. * @category Array
  8945. * @param {Array} array The array to modify.
  8946. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8947. * @returns {Array} Returns the new array of removed elements.
  8948. * @example
  8949. *
  8950. * var array = [1, 2, 3, 4];
  8951. * var evens = _.remove(array, function(n) {
  8952. * return n % 2 == 0;
  8953. * });
  8954. *
  8955. * console.log(array);
  8956. * // => [1, 3]
  8957. *
  8958. * console.log(evens);
  8959. * // => [2, 4]
  8960. */
  8961. function remove(array, predicate) {
  8962. var result = [];
  8963. if (!(array && array.length)) {
  8964. return result;
  8965. }
  8966. var index = -1,
  8967. indexes = [],
  8968. length = array.length;
  8969. predicate = getIteratee(predicate, 3);
  8970. while (++index < length) {
  8971. var value = array[index];
  8972. if (predicate(value, index, array)) {
  8973. result.push(value);
  8974. indexes.push(index);
  8975. }
  8976. }
  8977. basePullAt(array, indexes);
  8978. return result;
  8979. }
  8980. /**
  8981. * Reverses `array` so that the first element becomes the last, the second
  8982. * element becomes the second to last, and so on.
  8983. *
  8984. * **Note:** This method mutates `array` and is based on
  8985. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8986. *
  8987. * @static
  8988. * @memberOf _
  8989. * @since 4.0.0
  8990. * @category Array
  8991. * @param {Array} array The array to modify.
  8992. * @returns {Array} Returns `array`.
  8993. * @example
  8994. *
  8995. * var array = [1, 2, 3];
  8996. *
  8997. * _.reverse(array);
  8998. * // => [3, 2, 1]
  8999. *
  9000. * console.log(array);
  9001. * // => [3, 2, 1]
  9002. */
  9003. function reverse(array) {
  9004. return array == null ? array : nativeReverse.call(array);
  9005. }
  9006. /**
  9007. * Creates a slice of `array` from `start` up to, but not including, `end`.
  9008. *
  9009. * **Note:** This method is used instead of
  9010. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  9011. * returned.
  9012. *
  9013. * @static
  9014. * @memberOf _
  9015. * @since 3.0.0
  9016. * @category Array
  9017. * @param {Array} array The array to slice.
  9018. * @param {number} [start=0] The start position.
  9019. * @param {number} [end=array.length] The end position.
  9020. * @returns {Array} Returns the slice of `array`.
  9021. */
  9022. function slice(array, start, end) {
  9023. var length = array == null ? 0 : array.length;
  9024. if (!length) {
  9025. return [];
  9026. }
  9027. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  9028. start = 0;
  9029. end = length;
  9030. }
  9031. else {
  9032. start = start == null ? 0 : toInteger(start);
  9033. end = end === undefined ? length : toInteger(end);
  9034. }
  9035. return baseSlice(array, start, end);
  9036. }
  9037. /**
  9038. * Uses a binary search to determine the lowest index at which `value`
  9039. * should be inserted into `array` in order to maintain its sort order.
  9040. *
  9041. * @static
  9042. * @memberOf _
  9043. * @since 0.1.0
  9044. * @category Array
  9045. * @param {Array} array The sorted array to inspect.
  9046. * @param {*} value The value to evaluate.
  9047. * @returns {number} Returns the index at which `value` should be inserted
  9048. * into `array`.
  9049. * @example
  9050. *
  9051. * _.sortedIndex([30, 50], 40);
  9052. * // => 1
  9053. */
  9054. function sortedIndex(array, value) {
  9055. return baseSortedIndex(array, value);
  9056. }
  9057. /**
  9058. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  9059. * which is invoked for `value` and each element of `array` to compute their
  9060. * sort ranking. The iteratee is invoked with one argument: (value).
  9061. *
  9062. * @static
  9063. * @memberOf _
  9064. * @since 4.0.0
  9065. * @category Array
  9066. * @param {Array} array The sorted array to inspect.
  9067. * @param {*} value The value to evaluate.
  9068. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9069. * @returns {number} Returns the index at which `value` should be inserted
  9070. * into `array`.
  9071. * @example
  9072. *
  9073. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  9074. *
  9075. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  9076. * // => 0
  9077. *
  9078. * // The `_.property` iteratee shorthand.
  9079. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  9080. * // => 0
  9081. */
  9082. function sortedIndexBy(array, value, iteratee) {
  9083. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  9084. }
  9085. /**
  9086. * This method is like `_.indexOf` except that it performs a binary
  9087. * search on a sorted `array`.
  9088. *
  9089. * @static
  9090. * @memberOf _
  9091. * @since 4.0.0
  9092. * @category Array
  9093. * @param {Array} array The array to inspect.
  9094. * @param {*} value The value to search for.
  9095. * @returns {number} Returns the index of the matched value, else `-1`.
  9096. * @example
  9097. *
  9098. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  9099. * // => 1
  9100. */
  9101. function sortedIndexOf(array, value) {
  9102. var length = array == null ? 0 : array.length;
  9103. if (length) {
  9104. var index = baseSortedIndex(array, value);
  9105. if (index < length && eq(array[index], value)) {
  9106. return index;
  9107. }
  9108. }
  9109. return -1;
  9110. }
  9111. /**
  9112. * This method is like `_.sortedIndex` except that it returns the highest
  9113. * index at which `value` should be inserted into `array` in order to
  9114. * maintain its sort order.
  9115. *
  9116. * @static
  9117. * @memberOf _
  9118. * @since 3.0.0
  9119. * @category Array
  9120. * @param {Array} array The sorted array to inspect.
  9121. * @param {*} value The value to evaluate.
  9122. * @returns {number} Returns the index at which `value` should be inserted
  9123. * into `array`.
  9124. * @example
  9125. *
  9126. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  9127. * // => 4
  9128. */
  9129. function sortedLastIndex(array, value) {
  9130. return baseSortedIndex(array, value, true);
  9131. }
  9132. /**
  9133. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  9134. * which is invoked for `value` and each element of `array` to compute their
  9135. * sort ranking. The iteratee is invoked with one argument: (value).
  9136. *
  9137. * @static
  9138. * @memberOf _
  9139. * @since 4.0.0
  9140. * @category Array
  9141. * @param {Array} array The sorted array to inspect.
  9142. * @param {*} value The value to evaluate.
  9143. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9144. * @returns {number} Returns the index at which `value` should be inserted
  9145. * into `array`.
  9146. * @example
  9147. *
  9148. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  9149. *
  9150. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  9151. * // => 1
  9152. *
  9153. * // The `_.property` iteratee shorthand.
  9154. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  9155. * // => 1
  9156. */
  9157. function sortedLastIndexBy(array, value, iteratee) {
  9158. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  9159. }
  9160. /**
  9161. * This method is like `_.lastIndexOf` except that it performs a binary
  9162. * search on a sorted `array`.
  9163. *
  9164. * @static
  9165. * @memberOf _
  9166. * @since 4.0.0
  9167. * @category Array
  9168. * @param {Array} array The array to inspect.
  9169. * @param {*} value The value to search for.
  9170. * @returns {number} Returns the index of the matched value, else `-1`.
  9171. * @example
  9172. *
  9173. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  9174. * // => 3
  9175. */
  9176. function sortedLastIndexOf(array, value) {
  9177. var length = array == null ? 0 : array.length;
  9178. if (length) {
  9179. var index = baseSortedIndex(array, value, true) - 1;
  9180. if (eq(array[index], value)) {
  9181. return index;
  9182. }
  9183. }
  9184. return -1;
  9185. }
  9186. /**
  9187. * This method is like `_.uniq` except that it's designed and optimized
  9188. * for sorted arrays.
  9189. *
  9190. * @static
  9191. * @memberOf _
  9192. * @since 4.0.0
  9193. * @category Array
  9194. * @param {Array} array The array to inspect.
  9195. * @returns {Array} Returns the new duplicate free array.
  9196. * @example
  9197. *
  9198. * _.sortedUniq([1, 1, 2]);
  9199. * // => [1, 2]
  9200. */
  9201. function sortedUniq(array) {
  9202. return (array && array.length)
  9203. ? baseSortedUniq(array)
  9204. : [];
  9205. }
  9206. /**
  9207. * This method is like `_.uniqBy` except that it's designed and optimized
  9208. * for sorted arrays.
  9209. *
  9210. * @static
  9211. * @memberOf _
  9212. * @since 4.0.0
  9213. * @category Array
  9214. * @param {Array} array The array to inspect.
  9215. * @param {Function} [iteratee] The iteratee invoked per element.
  9216. * @returns {Array} Returns the new duplicate free array.
  9217. * @example
  9218. *
  9219. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  9220. * // => [1.1, 2.3]
  9221. */
  9222. function sortedUniqBy(array, iteratee) {
  9223. return (array && array.length)
  9224. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  9225. : [];
  9226. }
  9227. /**
  9228. * Gets all but the first element of `array`.
  9229. *
  9230. * @static
  9231. * @memberOf _
  9232. * @since 4.0.0
  9233. * @category Array
  9234. * @param {Array} array The array to query.
  9235. * @returns {Array} Returns the slice of `array`.
  9236. * @example
  9237. *
  9238. * _.tail([1, 2, 3]);
  9239. * // => [2, 3]
  9240. */
  9241. function tail(array) {
  9242. var length = array == null ? 0 : array.length;
  9243. return length ? baseSlice(array, 1, length) : [];
  9244. }
  9245. /**
  9246. * Creates a slice of `array` with `n` elements taken from the beginning.
  9247. *
  9248. * @static
  9249. * @memberOf _
  9250. * @since 0.1.0
  9251. * @category Array
  9252. * @param {Array} array The array to query.
  9253. * @param {number} [n=1] The number of elements to take.
  9254. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9255. * @returns {Array} Returns the slice of `array`.
  9256. * @example
  9257. *
  9258. * _.take([1, 2, 3]);
  9259. * // => [1]
  9260. *
  9261. * _.take([1, 2, 3], 2);
  9262. * // => [1, 2]
  9263. *
  9264. * _.take([1, 2, 3], 5);
  9265. * // => [1, 2, 3]
  9266. *
  9267. * _.take([1, 2, 3], 0);
  9268. * // => []
  9269. */
  9270. function take(array, n, guard) {
  9271. if (!(array && array.length)) {
  9272. return [];
  9273. }
  9274. n = (guard || n === undefined) ? 1 : toInteger(n);
  9275. return baseSlice(array, 0, n < 0 ? 0 : n);
  9276. }
  9277. /**
  9278. * Creates a slice of `array` with `n` elements taken from the end.
  9279. *
  9280. * @static
  9281. * @memberOf _
  9282. * @since 3.0.0
  9283. * @category Array
  9284. * @param {Array} array The array to query.
  9285. * @param {number} [n=1] The number of elements to take.
  9286. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9287. * @returns {Array} Returns the slice of `array`.
  9288. * @example
  9289. *
  9290. * _.takeRight([1, 2, 3]);
  9291. * // => [3]
  9292. *
  9293. * _.takeRight([1, 2, 3], 2);
  9294. * // => [2, 3]
  9295. *
  9296. * _.takeRight([1, 2, 3], 5);
  9297. * // => [1, 2, 3]
  9298. *
  9299. * _.takeRight([1, 2, 3], 0);
  9300. * // => []
  9301. */
  9302. function takeRight(array, n, guard) {
  9303. var length = array == null ? 0 : array.length;
  9304. if (!length) {
  9305. return [];
  9306. }
  9307. n = (guard || n === undefined) ? 1 : toInteger(n);
  9308. n = length - n;
  9309. return baseSlice(array, n < 0 ? 0 : n, length);
  9310. }
  9311. /**
  9312. * Creates a slice of `array` with elements taken from the end. Elements are
  9313. * taken until `predicate` returns falsey. The predicate is invoked with
  9314. * three arguments: (value, index, array).
  9315. *
  9316. * @static
  9317. * @memberOf _
  9318. * @since 3.0.0
  9319. * @category Array
  9320. * @param {Array} array The array to query.
  9321. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9322. * @returns {Array} Returns the slice of `array`.
  9323. * @example
  9324. *
  9325. * var users = [
  9326. * { 'user': 'barney', 'active': true },
  9327. * { 'user': 'fred', 'active': false },
  9328. * { 'user': 'pebbles', 'active': false }
  9329. * ];
  9330. *
  9331. * _.takeRightWhile(users, function(o) { return !o.active; });
  9332. * // => objects for ['fred', 'pebbles']
  9333. *
  9334. * // The `_.matches` iteratee shorthand.
  9335. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  9336. * // => objects for ['pebbles']
  9337. *
  9338. * // The `_.matchesProperty` iteratee shorthand.
  9339. * _.takeRightWhile(users, ['active', false]);
  9340. * // => objects for ['fred', 'pebbles']
  9341. *
  9342. * // The `_.property` iteratee shorthand.
  9343. * _.takeRightWhile(users, 'active');
  9344. * // => []
  9345. */
  9346. function takeRightWhile(array, predicate) {
  9347. return (array && array.length)
  9348. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  9349. : [];
  9350. }
  9351. /**
  9352. * Creates a slice of `array` with elements taken from the beginning. Elements
  9353. * are taken until `predicate` returns falsey. The predicate is invoked with
  9354. * three arguments: (value, index, array).
  9355. *
  9356. * @static
  9357. * @memberOf _
  9358. * @since 3.0.0
  9359. * @category Array
  9360. * @param {Array} array The array to query.
  9361. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9362. * @returns {Array} Returns the slice of `array`.
  9363. * @example
  9364. *
  9365. * var users = [
  9366. * { 'user': 'barney', 'active': false },
  9367. * { 'user': 'fred', 'active': false },
  9368. * { 'user': 'pebbles', 'active': true }
  9369. * ];
  9370. *
  9371. * _.takeWhile(users, function(o) { return !o.active; });
  9372. * // => objects for ['barney', 'fred']
  9373. *
  9374. * // The `_.matches` iteratee shorthand.
  9375. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  9376. * // => objects for ['barney']
  9377. *
  9378. * // The `_.matchesProperty` iteratee shorthand.
  9379. * _.takeWhile(users, ['active', false]);
  9380. * // => objects for ['barney', 'fred']
  9381. *
  9382. * // The `_.property` iteratee shorthand.
  9383. * _.takeWhile(users, 'active');
  9384. * // => []
  9385. */
  9386. function takeWhile(array, predicate) {
  9387. return (array && array.length)
  9388. ? baseWhile(array, getIteratee(predicate, 3))
  9389. : [];
  9390. }
  9391. /**
  9392. * Creates an array of unique values, in order, from all given arrays using
  9393. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9394. * for equality comparisons.
  9395. *
  9396. * @static
  9397. * @memberOf _
  9398. * @since 0.1.0
  9399. * @category Array
  9400. * @param {...Array} [arrays] The arrays to inspect.
  9401. * @returns {Array} Returns the new array of combined values.
  9402. * @example
  9403. *
  9404. * _.union([2], [1, 2]);
  9405. * // => [2, 1]
  9406. */
  9407. var union = baseRest(function(arrays) {
  9408. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  9409. });
  9410. /**
  9411. * This method is like `_.union` except that it accepts `iteratee` which is
  9412. * invoked for each element of each `arrays` to generate the criterion by
  9413. * which uniqueness is computed. Result values are chosen from the first
  9414. * array in which the value occurs. The iteratee is invoked with one argument:
  9415. * (value).
  9416. *
  9417. * @static
  9418. * @memberOf _
  9419. * @since 4.0.0
  9420. * @category Array
  9421. * @param {...Array} [arrays] The arrays to inspect.
  9422. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9423. * @returns {Array} Returns the new array of combined values.
  9424. * @example
  9425. *
  9426. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  9427. * // => [2.1, 1.2]
  9428. *
  9429. * // The `_.property` iteratee shorthand.
  9430. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9431. * // => [{ 'x': 1 }, { 'x': 2 }]
  9432. */
  9433. var unionBy = baseRest(function(arrays) {
  9434. var iteratee = last(arrays);
  9435. if (isArrayLikeObject(iteratee)) {
  9436. iteratee = undefined;
  9437. }
  9438. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  9439. });
  9440. /**
  9441. * This method is like `_.union` except that it accepts `comparator` which
  9442. * is invoked to compare elements of `arrays`. Result values are chosen from
  9443. * the first array in which the value occurs. The comparator is invoked
  9444. * with two arguments: (arrVal, othVal).
  9445. *
  9446. * @static
  9447. * @memberOf _
  9448. * @since 4.0.0
  9449. * @category Array
  9450. * @param {...Array} [arrays] The arrays to inspect.
  9451. * @param {Function} [comparator] The comparator invoked per element.
  9452. * @returns {Array} Returns the new array of combined values.
  9453. * @example
  9454. *
  9455. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9456. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9457. *
  9458. * _.unionWith(objects, others, _.isEqual);
  9459. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9460. */
  9461. var unionWith = baseRest(function(arrays) {
  9462. var comparator = last(arrays);
  9463. comparator = typeof comparator == 'function' ? comparator : undefined;
  9464. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9465. });
  9466. /**
  9467. * Creates a duplicate-free version of an array, using
  9468. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9469. * for equality comparisons, in which only the first occurrence of each element
  9470. * is kept. The order of result values is determined by the order they occur
  9471. * in the array.
  9472. *
  9473. * @static
  9474. * @memberOf _
  9475. * @since 0.1.0
  9476. * @category Array
  9477. * @param {Array} array The array to inspect.
  9478. * @returns {Array} Returns the new duplicate free array.
  9479. * @example
  9480. *
  9481. * _.uniq([2, 1, 2]);
  9482. * // => [2, 1]
  9483. */
  9484. function uniq(array) {
  9485. return (array && array.length) ? baseUniq(array) : [];
  9486. }
  9487. /**
  9488. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9489. * invoked for each element in `array` to generate the criterion by which
  9490. * uniqueness is computed. The order of result values is determined by the
  9491. * order they occur in the array. The iteratee is invoked with one argument:
  9492. * (value).
  9493. *
  9494. * @static
  9495. * @memberOf _
  9496. * @since 4.0.0
  9497. * @category Array
  9498. * @param {Array} array The array to inspect.
  9499. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9500. * @returns {Array} Returns the new duplicate free array.
  9501. * @example
  9502. *
  9503. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9504. * // => [2.1, 1.2]
  9505. *
  9506. * // The `_.property` iteratee shorthand.
  9507. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9508. * // => [{ 'x': 1 }, { 'x': 2 }]
  9509. */
  9510. function uniqBy(array, iteratee) {
  9511. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9512. }
  9513. /**
  9514. * This method is like `_.uniq` except that it accepts `comparator` which
  9515. * is invoked to compare elements of `array`. The order of result values is
  9516. * determined by the order they occur in the array.The comparator is invoked
  9517. * with two arguments: (arrVal, othVal).
  9518. *
  9519. * @static
  9520. * @memberOf _
  9521. * @since 4.0.0
  9522. * @category Array
  9523. * @param {Array} array The array to inspect.
  9524. * @param {Function} [comparator] The comparator invoked per element.
  9525. * @returns {Array} Returns the new duplicate free array.
  9526. * @example
  9527. *
  9528. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9529. *
  9530. * _.uniqWith(objects, _.isEqual);
  9531. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9532. */
  9533. function uniqWith(array, comparator) {
  9534. comparator = typeof comparator == 'function' ? comparator : undefined;
  9535. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9536. }
  9537. /**
  9538. * This method is like `_.zip` except that it accepts an array of grouped
  9539. * elements and creates an array regrouping the elements to their pre-zip
  9540. * configuration.
  9541. *
  9542. * @static
  9543. * @memberOf _
  9544. * @since 1.2.0
  9545. * @category Array
  9546. * @param {Array} array The array of grouped elements to process.
  9547. * @returns {Array} Returns the new array of regrouped elements.
  9548. * @example
  9549. *
  9550. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9551. * // => [['a', 1, true], ['b', 2, false]]
  9552. *
  9553. * _.unzip(zipped);
  9554. * // => [['a', 'b'], [1, 2], [true, false]]
  9555. */
  9556. function unzip(array) {
  9557. if (!(array && array.length)) {
  9558. return [];
  9559. }
  9560. var length = 0;
  9561. array = arrayFilter(array, function(group) {
  9562. if (isArrayLikeObject(group)) {
  9563. length = nativeMax(group.length, length);
  9564. return true;
  9565. }
  9566. });
  9567. return baseTimes(length, function(index) {
  9568. return arrayMap(array, baseProperty(index));
  9569. });
  9570. }
  9571. /**
  9572. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9573. * how regrouped values should be combined. The iteratee is invoked with the
  9574. * elements of each group: (...group).
  9575. *
  9576. * @static
  9577. * @memberOf _
  9578. * @since 3.8.0
  9579. * @category Array
  9580. * @param {Array} array The array of grouped elements to process.
  9581. * @param {Function} [iteratee=_.identity] The function to combine
  9582. * regrouped values.
  9583. * @returns {Array} Returns the new array of regrouped elements.
  9584. * @example
  9585. *
  9586. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9587. * // => [[1, 10, 100], [2, 20, 200]]
  9588. *
  9589. * _.unzipWith(zipped, _.add);
  9590. * // => [3, 30, 300]
  9591. */
  9592. function unzipWith(array, iteratee) {
  9593. if (!(array && array.length)) {
  9594. return [];
  9595. }
  9596. var result = unzip(array);
  9597. if (iteratee == null) {
  9598. return result;
  9599. }
  9600. return arrayMap(result, function(group) {
  9601. return apply(iteratee, undefined, group);
  9602. });
  9603. }
  9604. /**
  9605. * Creates an array excluding all given values using
  9606. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9607. * for equality comparisons.
  9608. *
  9609. * **Note:** Unlike `_.pull`, this method returns a new array.
  9610. *
  9611. * @static
  9612. * @memberOf _
  9613. * @since 0.1.0
  9614. * @category Array
  9615. * @param {Array} array The array to inspect.
  9616. * @param {...*} [values] The values to exclude.
  9617. * @returns {Array} Returns the new array of filtered values.
  9618. * @see _.difference, _.xor
  9619. * @example
  9620. *
  9621. * _.without([2, 1, 2, 3], 1, 2);
  9622. * // => [3]
  9623. */
  9624. var without = baseRest(function(array, values) {
  9625. return isArrayLikeObject(array)
  9626. ? baseDifference(array, values)
  9627. : [];
  9628. });
  9629. /**
  9630. * Creates an array of unique values that is the
  9631. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9632. * of the given arrays. The order of result values is determined by the order
  9633. * they occur in the arrays.
  9634. *
  9635. * @static
  9636. * @memberOf _
  9637. * @since 2.4.0
  9638. * @category Array
  9639. * @param {...Array} [arrays] The arrays to inspect.
  9640. * @returns {Array} Returns the new array of filtered values.
  9641. * @see _.difference, _.without
  9642. * @example
  9643. *
  9644. * _.xor([2, 1], [2, 3]);
  9645. * // => [1, 3]
  9646. */
  9647. var xor = baseRest(function(arrays) {
  9648. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9649. });
  9650. /**
  9651. * This method is like `_.xor` except that it accepts `iteratee` which is
  9652. * invoked for each element of each `arrays` to generate the criterion by
  9653. * which by which they're compared. The order of result values is determined
  9654. * by the order they occur in the arrays. The iteratee is invoked with one
  9655. * argument: (value).
  9656. *
  9657. * @static
  9658. * @memberOf _
  9659. * @since 4.0.0
  9660. * @category Array
  9661. * @param {...Array} [arrays] The arrays to inspect.
  9662. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9663. * @returns {Array} Returns the new array of filtered values.
  9664. * @example
  9665. *
  9666. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9667. * // => [1.2, 3.4]
  9668. *
  9669. * // The `_.property` iteratee shorthand.
  9670. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9671. * // => [{ 'x': 2 }]
  9672. */
  9673. var xorBy = baseRest(function(arrays) {
  9674. var iteratee = last(arrays);
  9675. if (isArrayLikeObject(iteratee)) {
  9676. iteratee = undefined;
  9677. }
  9678. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9679. });
  9680. /**
  9681. * This method is like `_.xor` except that it accepts `comparator` which is
  9682. * invoked to compare elements of `arrays`. The order of result values is
  9683. * determined by the order they occur in the arrays. The comparator is invoked
  9684. * with two arguments: (arrVal, othVal).
  9685. *
  9686. * @static
  9687. * @memberOf _
  9688. * @since 4.0.0
  9689. * @category Array
  9690. * @param {...Array} [arrays] The arrays to inspect.
  9691. * @param {Function} [comparator] The comparator invoked per element.
  9692. * @returns {Array} Returns the new array of filtered values.
  9693. * @example
  9694. *
  9695. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9696. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9697. *
  9698. * _.xorWith(objects, others, _.isEqual);
  9699. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9700. */
  9701. var xorWith = baseRest(function(arrays) {
  9702. var comparator = last(arrays);
  9703. comparator = typeof comparator == 'function' ? comparator : undefined;
  9704. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9705. });
  9706. /**
  9707. * Creates an array of grouped elements, the first of which contains the
  9708. * first elements of the given arrays, the second of which contains the
  9709. * second elements of the given arrays, and so on.
  9710. *
  9711. * @static
  9712. * @memberOf _
  9713. * @since 0.1.0
  9714. * @category Array
  9715. * @param {...Array} [arrays] The arrays to process.
  9716. * @returns {Array} Returns the new array of grouped elements.
  9717. * @example
  9718. *
  9719. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9720. * // => [['a', 1, true], ['b', 2, false]]
  9721. */
  9722. var zip = baseRest(unzip);
  9723. /**
  9724. * This method is like `_.fromPairs` except that it accepts two arrays,
  9725. * one of property identifiers and one of corresponding values.
  9726. *
  9727. * @static
  9728. * @memberOf _
  9729. * @since 0.4.0
  9730. * @category Array
  9731. * @param {Array} [props=[]] The property identifiers.
  9732. * @param {Array} [values=[]] The property values.
  9733. * @returns {Object} Returns the new object.
  9734. * @example
  9735. *
  9736. * _.zipObject(['a', 'b'], [1, 2]);
  9737. * // => { 'a': 1, 'b': 2 }
  9738. */
  9739. function zipObject(props, values) {
  9740. return baseZipObject(props || [], values || [], assignValue);
  9741. }
  9742. /**
  9743. * This method is like `_.zipObject` except that it supports property paths.
  9744. *
  9745. * @static
  9746. * @memberOf _
  9747. * @since 4.1.0
  9748. * @category Array
  9749. * @param {Array} [props=[]] The property identifiers.
  9750. * @param {Array} [values=[]] The property values.
  9751. * @returns {Object} Returns the new object.
  9752. * @example
  9753. *
  9754. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9755. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9756. */
  9757. function zipObjectDeep(props, values) {
  9758. return baseZipObject(props || [], values || [], baseSet);
  9759. }
  9760. /**
  9761. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9762. * how grouped values should be combined. The iteratee is invoked with the
  9763. * elements of each group: (...group).
  9764. *
  9765. * @static
  9766. * @memberOf _
  9767. * @since 3.8.0
  9768. * @category Array
  9769. * @param {...Array} [arrays] The arrays to process.
  9770. * @param {Function} [iteratee=_.identity] The function to combine
  9771. * grouped values.
  9772. * @returns {Array} Returns the new array of grouped elements.
  9773. * @example
  9774. *
  9775. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9776. * return a + b + c;
  9777. * });
  9778. * // => [111, 222]
  9779. */
  9780. var zipWith = baseRest(function(arrays) {
  9781. var length = arrays.length,
  9782. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9783. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9784. return unzipWith(arrays, iteratee);
  9785. });
  9786. /*------------------------------------------------------------------------*/
  9787. /**
  9788. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9789. * chain sequences enabled. The result of such sequences must be unwrapped
  9790. * with `_#value`.
  9791. *
  9792. * @static
  9793. * @memberOf _
  9794. * @since 1.3.0
  9795. * @category Seq
  9796. * @param {*} value The value to wrap.
  9797. * @returns {Object} Returns the new `lodash` wrapper instance.
  9798. * @example
  9799. *
  9800. * var users = [
  9801. * { 'user': 'barney', 'age': 36 },
  9802. * { 'user': 'fred', 'age': 40 },
  9803. * { 'user': 'pebbles', 'age': 1 }
  9804. * ];
  9805. *
  9806. * var youngest = _
  9807. * .chain(users)
  9808. * .sortBy('age')
  9809. * .map(function(o) {
  9810. * return o.user + ' is ' + o.age;
  9811. * })
  9812. * .head()
  9813. * .value();
  9814. * // => 'pebbles is 1'
  9815. */
  9816. function chain(value) {
  9817. var result = lodash(value);
  9818. result.__chain__ = true;
  9819. return result;
  9820. }
  9821. /**
  9822. * This method invokes `interceptor` and returns `value`. The interceptor
  9823. * is invoked with one argument; (value). The purpose of this method is to
  9824. * "tap into" a method chain sequence in order to modify intermediate results.
  9825. *
  9826. * @static
  9827. * @memberOf _
  9828. * @since 0.1.0
  9829. * @category Seq
  9830. * @param {*} value The value to provide to `interceptor`.
  9831. * @param {Function} interceptor The function to invoke.
  9832. * @returns {*} Returns `value`.
  9833. * @example
  9834. *
  9835. * _([1, 2, 3])
  9836. * .tap(function(array) {
  9837. * // Mutate input array.
  9838. * array.pop();
  9839. * })
  9840. * .reverse()
  9841. * .value();
  9842. * // => [2, 1]
  9843. */
  9844. function tap(value, interceptor) {
  9845. interceptor(value);
  9846. return value;
  9847. }
  9848. /**
  9849. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9850. * The purpose of this method is to "pass thru" values replacing intermediate
  9851. * results in a method chain sequence.
  9852. *
  9853. * @static
  9854. * @memberOf _
  9855. * @since 3.0.0
  9856. * @category Seq
  9857. * @param {*} value The value to provide to `interceptor`.
  9858. * @param {Function} interceptor The function to invoke.
  9859. * @returns {*} Returns the result of `interceptor`.
  9860. * @example
  9861. *
  9862. * _(' abc ')
  9863. * .chain()
  9864. * .trim()
  9865. * .thru(function(value) {
  9866. * return [value];
  9867. * })
  9868. * .value();
  9869. * // => ['abc']
  9870. */
  9871. function thru(value, interceptor) {
  9872. return interceptor(value);
  9873. }
  9874. /**
  9875. * This method is the wrapper version of `_.at`.
  9876. *
  9877. * @name at
  9878. * @memberOf _
  9879. * @since 1.0.0
  9880. * @category Seq
  9881. * @param {...(string|string[])} [paths] The property paths to pick.
  9882. * @returns {Object} Returns the new `lodash` wrapper instance.
  9883. * @example
  9884. *
  9885. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9886. *
  9887. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9888. * // => [3, 4]
  9889. */
  9890. var wrapperAt = flatRest(function(paths) {
  9891. var length = paths.length,
  9892. start = length ? paths[0] : 0,
  9893. value = this.__wrapped__,
  9894. interceptor = function(object) { return baseAt(object, paths); };
  9895. if (length > 1 || this.__actions__.length ||
  9896. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9897. return this.thru(interceptor);
  9898. }
  9899. value = value.slice(start, +start + (length ? 1 : 0));
  9900. value.__actions__.push({
  9901. 'func': thru,
  9902. 'args': [interceptor],
  9903. 'thisArg': undefined
  9904. });
  9905. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9906. if (length && !array.length) {
  9907. array.push(undefined);
  9908. }
  9909. return array;
  9910. });
  9911. });
  9912. /**
  9913. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9914. *
  9915. * @name chain
  9916. * @memberOf _
  9917. * @since 0.1.0
  9918. * @category Seq
  9919. * @returns {Object} Returns the new `lodash` wrapper instance.
  9920. * @example
  9921. *
  9922. * var users = [
  9923. * { 'user': 'barney', 'age': 36 },
  9924. * { 'user': 'fred', 'age': 40 }
  9925. * ];
  9926. *
  9927. * // A sequence without explicit chaining.
  9928. * _(users).head();
  9929. * // => { 'user': 'barney', 'age': 36 }
  9930. *
  9931. * // A sequence with explicit chaining.
  9932. * _(users)
  9933. * .chain()
  9934. * .head()
  9935. * .pick('user')
  9936. * .value();
  9937. * // => { 'user': 'barney' }
  9938. */
  9939. function wrapperChain() {
  9940. return chain(this);
  9941. }
  9942. /**
  9943. * Executes the chain sequence and returns the wrapped result.
  9944. *
  9945. * @name commit
  9946. * @memberOf _
  9947. * @since 3.2.0
  9948. * @category Seq
  9949. * @returns {Object} Returns the new `lodash` wrapper instance.
  9950. * @example
  9951. *
  9952. * var array = [1, 2];
  9953. * var wrapped = _(array).push(3);
  9954. *
  9955. * console.log(array);
  9956. * // => [1, 2]
  9957. *
  9958. * wrapped = wrapped.commit();
  9959. * console.log(array);
  9960. * // => [1, 2, 3]
  9961. *
  9962. * wrapped.last();
  9963. * // => 3
  9964. *
  9965. * console.log(array);
  9966. * // => [1, 2, 3]
  9967. */
  9968. function wrapperCommit() {
  9969. return new LodashWrapper(this.value(), this.__chain__);
  9970. }
  9971. /**
  9972. * Gets the next value on a wrapped object following the
  9973. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9974. *
  9975. * @name next
  9976. * @memberOf _
  9977. * @since 4.0.0
  9978. * @category Seq
  9979. * @returns {Object} Returns the next iterator value.
  9980. * @example
  9981. *
  9982. * var wrapped = _([1, 2]);
  9983. *
  9984. * wrapped.next();
  9985. * // => { 'done': false, 'value': 1 }
  9986. *
  9987. * wrapped.next();
  9988. * // => { 'done': false, 'value': 2 }
  9989. *
  9990. * wrapped.next();
  9991. * // => { 'done': true, 'value': undefined }
  9992. */
  9993. function wrapperNext() {
  9994. if (this.__values__ === undefined) {
  9995. this.__values__ = toArray(this.value());
  9996. }
  9997. var done = this.__index__ >= this.__values__.length,
  9998. value = done ? undefined : this.__values__[this.__index__++];
  9999. return { 'done': done, 'value': value };
  10000. }
  10001. /**
  10002. * Enables the wrapper to be iterable.
  10003. *
  10004. * @name Symbol.iterator
  10005. * @memberOf _
  10006. * @since 4.0.0
  10007. * @category Seq
  10008. * @returns {Object} Returns the wrapper object.
  10009. * @example
  10010. *
  10011. * var wrapped = _([1, 2]);
  10012. *
  10013. * wrapped[Symbol.iterator]() === wrapped;
  10014. * // => true
  10015. *
  10016. * Array.from(wrapped);
  10017. * // => [1, 2]
  10018. */
  10019. function wrapperToIterator() {
  10020. return this;
  10021. }
  10022. /**
  10023. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  10024. *
  10025. * @name plant
  10026. * @memberOf _
  10027. * @since 3.2.0
  10028. * @category Seq
  10029. * @param {*} value The value to plant.
  10030. * @returns {Object} Returns the new `lodash` wrapper instance.
  10031. * @example
  10032. *
  10033. * function square(n) {
  10034. * return n * n;
  10035. * }
  10036. *
  10037. * var wrapped = _([1, 2]).map(square);
  10038. * var other = wrapped.plant([3, 4]);
  10039. *
  10040. * other.value();
  10041. * // => [9, 16]
  10042. *
  10043. * wrapped.value();
  10044. * // => [1, 4]
  10045. */
  10046. function wrapperPlant(value) {
  10047. var result,
  10048. parent = this;
  10049. while (parent instanceof baseLodash) {
  10050. var clone = wrapperClone(parent);
  10051. clone.__index__ = 0;
  10052. clone.__values__ = undefined;
  10053. if (result) {
  10054. previous.__wrapped__ = clone;
  10055. } else {
  10056. result = clone;
  10057. }
  10058. var previous = clone;
  10059. parent = parent.__wrapped__;
  10060. }
  10061. previous.__wrapped__ = value;
  10062. return result;
  10063. }
  10064. /**
  10065. * This method is the wrapper version of `_.reverse`.
  10066. *
  10067. * **Note:** This method mutates the wrapped array.
  10068. *
  10069. * @name reverse
  10070. * @memberOf _
  10071. * @since 0.1.0
  10072. * @category Seq
  10073. * @returns {Object} Returns the new `lodash` wrapper instance.
  10074. * @example
  10075. *
  10076. * var array = [1, 2, 3];
  10077. *
  10078. * _(array).reverse().value()
  10079. * // => [3, 2, 1]
  10080. *
  10081. * console.log(array);
  10082. * // => [3, 2, 1]
  10083. */
  10084. function wrapperReverse() {
  10085. var value = this.__wrapped__;
  10086. if (value instanceof LazyWrapper) {
  10087. var wrapped = value;
  10088. if (this.__actions__.length) {
  10089. wrapped = new LazyWrapper(this);
  10090. }
  10091. wrapped = wrapped.reverse();
  10092. wrapped.__actions__.push({
  10093. 'func': thru,
  10094. 'args': [reverse],
  10095. 'thisArg': undefined
  10096. });
  10097. return new LodashWrapper(wrapped, this.__chain__);
  10098. }
  10099. return this.thru(reverse);
  10100. }
  10101. /**
  10102. * Executes the chain sequence to resolve the unwrapped value.
  10103. *
  10104. * @name value
  10105. * @memberOf _
  10106. * @since 0.1.0
  10107. * @alias toJSON, valueOf
  10108. * @category Seq
  10109. * @returns {*} Returns the resolved unwrapped value.
  10110. * @example
  10111. *
  10112. * _([1, 2, 3]).value();
  10113. * // => [1, 2, 3]
  10114. */
  10115. function wrapperValue() {
  10116. return baseWrapperValue(this.__wrapped__, this.__actions__);
  10117. }
  10118. /*------------------------------------------------------------------------*/
  10119. /**
  10120. * Creates an object composed of keys generated from the results of running
  10121. * each element of `collection` thru `iteratee`. The corresponding value of
  10122. * each key is the number of times the key was returned by `iteratee`. The
  10123. * iteratee is invoked with one argument: (value).
  10124. *
  10125. * @static
  10126. * @memberOf _
  10127. * @since 0.5.0
  10128. * @category Collection
  10129. * @param {Array|Object} collection The collection to iterate over.
  10130. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10131. * @returns {Object} Returns the composed aggregate object.
  10132. * @example
  10133. *
  10134. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  10135. * // => { '4': 1, '6': 2 }
  10136. *
  10137. * // The `_.property` iteratee shorthand.
  10138. * _.countBy(['one', 'two', 'three'], 'length');
  10139. * // => { '3': 2, '5': 1 }
  10140. */
  10141. var countBy = createAggregator(function(result, value, key) {
  10142. if (hasOwnProperty.call(result, key)) {
  10143. ++result[key];
  10144. } else {
  10145. baseAssignValue(result, key, 1);
  10146. }
  10147. });
  10148. /**
  10149. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  10150. * Iteration is stopped once `predicate` returns falsey. The predicate is
  10151. * invoked with three arguments: (value, index|key, collection).
  10152. *
  10153. * **Note:** This method returns `true` for
  10154. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  10155. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  10156. * elements of empty collections.
  10157. *
  10158. * @static
  10159. * @memberOf _
  10160. * @since 0.1.0
  10161. * @category Collection
  10162. * @param {Array|Object} collection The collection to iterate over.
  10163. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10164. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10165. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  10166. * else `false`.
  10167. * @example
  10168. *
  10169. * _.every([true, 1, null, 'yes'], Boolean);
  10170. * // => false
  10171. *
  10172. * var users = [
  10173. * { 'user': 'barney', 'age': 36, 'active': false },
  10174. * { 'user': 'fred', 'age': 40, 'active': false }
  10175. * ];
  10176. *
  10177. * // The `_.matches` iteratee shorthand.
  10178. * _.every(users, { 'user': 'barney', 'active': false });
  10179. * // => false
  10180. *
  10181. * // The `_.matchesProperty` iteratee shorthand.
  10182. * _.every(users, ['active', false]);
  10183. * // => true
  10184. *
  10185. * // The `_.property` iteratee shorthand.
  10186. * _.every(users, 'active');
  10187. * // => false
  10188. */
  10189. function every(collection, predicate, guard) {
  10190. var func = isArray(collection) ? arrayEvery : baseEvery;
  10191. if (guard && isIterateeCall(collection, predicate, guard)) {
  10192. predicate = undefined;
  10193. }
  10194. return func(collection, getIteratee(predicate, 3));
  10195. }
  10196. /**
  10197. * Iterates over elements of `collection`, returning an array of all elements
  10198. * `predicate` returns truthy for. The predicate is invoked with three
  10199. * arguments: (value, index|key, collection).
  10200. *
  10201. * **Note:** Unlike `_.remove`, this method returns a new array.
  10202. *
  10203. * @static
  10204. * @memberOf _
  10205. * @since 0.1.0
  10206. * @category Collection
  10207. * @param {Array|Object} collection The collection to iterate over.
  10208. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10209. * @returns {Array} Returns the new filtered array.
  10210. * @see _.reject
  10211. * @example
  10212. *
  10213. * var users = [
  10214. * { 'user': 'barney', 'age': 36, 'active': true },
  10215. * { 'user': 'fred', 'age': 40, 'active': false }
  10216. * ];
  10217. *
  10218. * _.filter(users, function(o) { return !o.active; });
  10219. * // => objects for ['fred']
  10220. *
  10221. * // The `_.matches` iteratee shorthand.
  10222. * _.filter(users, { 'age': 36, 'active': true });
  10223. * // => objects for ['barney']
  10224. *
  10225. * // The `_.matchesProperty` iteratee shorthand.
  10226. * _.filter(users, ['active', false]);
  10227. * // => objects for ['fred']
  10228. *
  10229. * // The `_.property` iteratee shorthand.
  10230. * _.filter(users, 'active');
  10231. * // => objects for ['barney']
  10232. *
  10233. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  10234. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  10235. * // => objects for ['fred', 'barney']
  10236. */
  10237. function filter(collection, predicate) {
  10238. var func = isArray(collection) ? arrayFilter : baseFilter;
  10239. return func(collection, getIteratee(predicate, 3));
  10240. }
  10241. /**
  10242. * Iterates over elements of `collection`, returning the first element
  10243. * `predicate` returns truthy for. The predicate is invoked with three
  10244. * arguments: (value, index|key, collection).
  10245. *
  10246. * @static
  10247. * @memberOf _
  10248. * @since 0.1.0
  10249. * @category Collection
  10250. * @param {Array|Object} collection The collection to inspect.
  10251. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10252. * @param {number} [fromIndex=0] The index to search from.
  10253. * @returns {*} Returns the matched element, else `undefined`.
  10254. * @example
  10255. *
  10256. * var users = [
  10257. * { 'user': 'barney', 'age': 36, 'active': true },
  10258. * { 'user': 'fred', 'age': 40, 'active': false },
  10259. * { 'user': 'pebbles', 'age': 1, 'active': true }
  10260. * ];
  10261. *
  10262. * _.find(users, function(o) { return o.age < 40; });
  10263. * // => object for 'barney'
  10264. *
  10265. * // The `_.matches` iteratee shorthand.
  10266. * _.find(users, { 'age': 1, 'active': true });
  10267. * // => object for 'pebbles'
  10268. *
  10269. * // The `_.matchesProperty` iteratee shorthand.
  10270. * _.find(users, ['active', false]);
  10271. * // => object for 'fred'
  10272. *
  10273. * // The `_.property` iteratee shorthand.
  10274. * _.find(users, 'active');
  10275. * // => object for 'barney'
  10276. */
  10277. var find = createFind(findIndex);
  10278. /**
  10279. * This method is like `_.find` except that it iterates over elements of
  10280. * `collection` from right to left.
  10281. *
  10282. * @static
  10283. * @memberOf _
  10284. * @since 2.0.0
  10285. * @category Collection
  10286. * @param {Array|Object} collection The collection to inspect.
  10287. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10288. * @param {number} [fromIndex=collection.length-1] The index to search from.
  10289. * @returns {*} Returns the matched element, else `undefined`.
  10290. * @example
  10291. *
  10292. * _.findLast([1, 2, 3, 4], function(n) {
  10293. * return n % 2 == 1;
  10294. * });
  10295. * // => 3
  10296. */
  10297. var findLast = createFind(findLastIndex);
  10298. /**
  10299. * Creates a flattened array of values by running each element in `collection`
  10300. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  10301. * with three arguments: (value, index|key, collection).
  10302. *
  10303. * @static
  10304. * @memberOf _
  10305. * @since 4.0.0
  10306. * @category Collection
  10307. * @param {Array|Object} collection The collection to iterate over.
  10308. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10309. * @returns {Array} Returns the new flattened array.
  10310. * @example
  10311. *
  10312. * function duplicate(n) {
  10313. * return [n, n];
  10314. * }
  10315. *
  10316. * _.flatMap([1, 2], duplicate);
  10317. * // => [1, 1, 2, 2]
  10318. */
  10319. function flatMap(collection, iteratee) {
  10320. return baseFlatten(map(collection, iteratee), 1);
  10321. }
  10322. /**
  10323. * This method is like `_.flatMap` except that it recursively flattens the
  10324. * mapped results.
  10325. *
  10326. * @static
  10327. * @memberOf _
  10328. * @since 4.7.0
  10329. * @category Collection
  10330. * @param {Array|Object} collection The collection to iterate over.
  10331. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10332. * @returns {Array} Returns the new flattened array.
  10333. * @example
  10334. *
  10335. * function duplicate(n) {
  10336. * return [[[n, n]]];
  10337. * }
  10338. *
  10339. * _.flatMapDeep([1, 2], duplicate);
  10340. * // => [1, 1, 2, 2]
  10341. */
  10342. function flatMapDeep(collection, iteratee) {
  10343. return baseFlatten(map(collection, iteratee), INFINITY);
  10344. }
  10345. /**
  10346. * This method is like `_.flatMap` except that it recursively flattens the
  10347. * mapped results up to `depth` times.
  10348. *
  10349. * @static
  10350. * @memberOf _
  10351. * @since 4.7.0
  10352. * @category Collection
  10353. * @param {Array|Object} collection The collection to iterate over.
  10354. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10355. * @param {number} [depth=1] The maximum recursion depth.
  10356. * @returns {Array} Returns the new flattened array.
  10357. * @example
  10358. *
  10359. * function duplicate(n) {
  10360. * return [[[n, n]]];
  10361. * }
  10362. *
  10363. * _.flatMapDepth([1, 2], duplicate, 2);
  10364. * // => [[1, 1], [2, 2]]
  10365. */
  10366. function flatMapDepth(collection, iteratee, depth) {
  10367. depth = depth === undefined ? 1 : toInteger(depth);
  10368. return baseFlatten(map(collection, iteratee), depth);
  10369. }
  10370. /**
  10371. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  10372. * The iteratee is invoked with three arguments: (value, index|key, collection).
  10373. * Iteratee functions may exit iteration early by explicitly returning `false`.
  10374. *
  10375. * **Note:** As with other "Collections" methods, objects with a "length"
  10376. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  10377. * or `_.forOwn` for object iteration.
  10378. *
  10379. * @static
  10380. * @memberOf _
  10381. * @since 0.1.0
  10382. * @alias each
  10383. * @category Collection
  10384. * @param {Array|Object} collection The collection to iterate over.
  10385. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10386. * @returns {Array|Object} Returns `collection`.
  10387. * @see _.forEachRight
  10388. * @example
  10389. *
  10390. * _.forEach([1, 2], function(value) {
  10391. * console.log(value);
  10392. * });
  10393. * // => Logs `1` then `2`.
  10394. *
  10395. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  10396. * console.log(key);
  10397. * });
  10398. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  10399. */
  10400. function forEach(collection, iteratee) {
  10401. var func = isArray(collection) ? arrayEach : baseEach;
  10402. return func(collection, getIteratee(iteratee, 3));
  10403. }
  10404. /**
  10405. * This method is like `_.forEach` except that it iterates over elements of
  10406. * `collection` from right to left.
  10407. *
  10408. * @static
  10409. * @memberOf _
  10410. * @since 2.0.0
  10411. * @alias eachRight
  10412. * @category Collection
  10413. * @param {Array|Object} collection The collection to iterate over.
  10414. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10415. * @returns {Array|Object} Returns `collection`.
  10416. * @see _.forEach
  10417. * @example
  10418. *
  10419. * _.forEachRight([1, 2], function(value) {
  10420. * console.log(value);
  10421. * });
  10422. * // => Logs `2` then `1`.
  10423. */
  10424. function forEachRight(collection, iteratee) {
  10425. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  10426. return func(collection, getIteratee(iteratee, 3));
  10427. }
  10428. /**
  10429. * Creates an object composed of keys generated from the results of running
  10430. * each element of `collection` thru `iteratee`. The order of grouped values
  10431. * is determined by the order they occur in `collection`. The corresponding
  10432. * value of each key is an array of elements responsible for generating the
  10433. * key. The iteratee is invoked with one argument: (value).
  10434. *
  10435. * @static
  10436. * @memberOf _
  10437. * @since 0.1.0
  10438. * @category Collection
  10439. * @param {Array|Object} collection The collection to iterate over.
  10440. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10441. * @returns {Object} Returns the composed aggregate object.
  10442. * @example
  10443. *
  10444. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  10445. * // => { '4': [4.2], '6': [6.1, 6.3] }
  10446. *
  10447. * // The `_.property` iteratee shorthand.
  10448. * _.groupBy(['one', 'two', 'three'], 'length');
  10449. * // => { '3': ['one', 'two'], '5': ['three'] }
  10450. */
  10451. var groupBy = createAggregator(function(result, value, key) {
  10452. if (hasOwnProperty.call(result, key)) {
  10453. result[key].push(value);
  10454. } else {
  10455. baseAssignValue(result, key, [value]);
  10456. }
  10457. });
  10458. /**
  10459. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10460. * checked for a substring of `value`, otherwise
  10461. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10462. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10463. * the offset from the end of `collection`.
  10464. *
  10465. * @static
  10466. * @memberOf _
  10467. * @since 0.1.0
  10468. * @category Collection
  10469. * @param {Array|Object|string} collection The collection to inspect.
  10470. * @param {*} value The value to search for.
  10471. * @param {number} [fromIndex=0] The index to search from.
  10472. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10473. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10474. * @example
  10475. *
  10476. * _.includes([1, 2, 3], 1);
  10477. * // => true
  10478. *
  10479. * _.includes([1, 2, 3], 1, 2);
  10480. * // => false
  10481. *
  10482. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10483. * // => true
  10484. *
  10485. * _.includes('abcd', 'bc');
  10486. * // => true
  10487. */
  10488. function includes(collection, value, fromIndex, guard) {
  10489. collection = isArrayLike(collection) ? collection : values(collection);
  10490. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10491. var length = collection.length;
  10492. if (fromIndex < 0) {
  10493. fromIndex = nativeMax(length + fromIndex, 0);
  10494. }
  10495. return isString(collection)
  10496. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10497. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10498. }
  10499. /**
  10500. * Invokes the method at `path` of each element in `collection`, returning
  10501. * an array of the results of each invoked method. Any additional arguments
  10502. * are provided to each invoked method. If `path` is a function, it's invoked
  10503. * for, and `this` bound to, each element in `collection`.
  10504. *
  10505. * @static
  10506. * @memberOf _
  10507. * @since 4.0.0
  10508. * @category Collection
  10509. * @param {Array|Object} collection The collection to iterate over.
  10510. * @param {Array|Function|string} path The path of the method to invoke or
  10511. * the function invoked per iteration.
  10512. * @param {...*} [args] The arguments to invoke each method with.
  10513. * @returns {Array} Returns the array of results.
  10514. * @example
  10515. *
  10516. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10517. * // => [[1, 5, 7], [1, 2, 3]]
  10518. *
  10519. * _.invokeMap([123, 456], String.prototype.split, '');
  10520. * // => [['1', '2', '3'], ['4', '5', '6']]
  10521. */
  10522. var invokeMap = baseRest(function(collection, path, args) {
  10523. var index = -1,
  10524. isFunc = typeof path == 'function',
  10525. result = isArrayLike(collection) ? Array(collection.length) : [];
  10526. baseEach(collection, function(value) {
  10527. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10528. });
  10529. return result;
  10530. });
  10531. /**
  10532. * Creates an object composed of keys generated from the results of running
  10533. * each element of `collection` thru `iteratee`. The corresponding value of
  10534. * each key is the last element responsible for generating the key. The
  10535. * iteratee is invoked with one argument: (value).
  10536. *
  10537. * @static
  10538. * @memberOf _
  10539. * @since 4.0.0
  10540. * @category Collection
  10541. * @param {Array|Object} collection The collection to iterate over.
  10542. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10543. * @returns {Object} Returns the composed aggregate object.
  10544. * @example
  10545. *
  10546. * var array = [
  10547. * { 'dir': 'left', 'code': 97 },
  10548. * { 'dir': 'right', 'code': 100 }
  10549. * ];
  10550. *
  10551. * _.keyBy(array, function(o) {
  10552. * return String.fromCharCode(o.code);
  10553. * });
  10554. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10555. *
  10556. * _.keyBy(array, 'dir');
  10557. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10558. */
  10559. var keyBy = createAggregator(function(result, value, key) {
  10560. baseAssignValue(result, key, value);
  10561. });
  10562. /**
  10563. * Creates an array of values by running each element in `collection` thru
  10564. * `iteratee`. The iteratee is invoked with three arguments:
  10565. * (value, index|key, collection).
  10566. *
  10567. * Many lodash methods are guarded to work as iteratees for methods like
  10568. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10569. *
  10570. * The guarded methods are:
  10571. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10572. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10573. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10574. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10575. *
  10576. * @static
  10577. * @memberOf _
  10578. * @since 0.1.0
  10579. * @category Collection
  10580. * @param {Array|Object} collection The collection to iterate over.
  10581. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10582. * @returns {Array} Returns the new mapped array.
  10583. * @example
  10584. *
  10585. * function square(n) {
  10586. * return n * n;
  10587. * }
  10588. *
  10589. * _.map([4, 8], square);
  10590. * // => [16, 64]
  10591. *
  10592. * _.map({ 'a': 4, 'b': 8 }, square);
  10593. * // => [16, 64] (iteration order is not guaranteed)
  10594. *
  10595. * var users = [
  10596. * { 'user': 'barney' },
  10597. * { 'user': 'fred' }
  10598. * ];
  10599. *
  10600. * // The `_.property` iteratee shorthand.
  10601. * _.map(users, 'user');
  10602. * // => ['barney', 'fred']
  10603. */
  10604. function map(collection, iteratee) {
  10605. var func = isArray(collection) ? arrayMap : baseMap;
  10606. return func(collection, getIteratee(iteratee, 3));
  10607. }
  10608. /**
  10609. * This method is like `_.sortBy` except that it allows specifying the sort
  10610. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10611. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10612. * descending or "asc" for ascending sort order of corresponding values.
  10613. *
  10614. * @static
  10615. * @memberOf _
  10616. * @since 4.0.0
  10617. * @category Collection
  10618. * @param {Array|Object} collection The collection to iterate over.
  10619. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10620. * The iteratees to sort by.
  10621. * @param {string[]} [orders] The sort orders of `iteratees`.
  10622. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10623. * @returns {Array} Returns the new sorted array.
  10624. * @example
  10625. *
  10626. * var users = [
  10627. * { 'user': 'fred', 'age': 48 },
  10628. * { 'user': 'barney', 'age': 34 },
  10629. * { 'user': 'fred', 'age': 40 },
  10630. * { 'user': 'barney', 'age': 36 }
  10631. * ];
  10632. *
  10633. * // Sort by `user` in ascending order and by `age` in descending order.
  10634. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10635. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10636. */
  10637. function orderBy(collection, iteratees, orders, guard) {
  10638. if (collection == null) {
  10639. return [];
  10640. }
  10641. if (!isArray(iteratees)) {
  10642. iteratees = iteratees == null ? [] : [iteratees];
  10643. }
  10644. orders = guard ? undefined : orders;
  10645. if (!isArray(orders)) {
  10646. orders = orders == null ? [] : [orders];
  10647. }
  10648. return baseOrderBy(collection, iteratees, orders);
  10649. }
  10650. /**
  10651. * Creates an array of elements split into two groups, the first of which
  10652. * contains elements `predicate` returns truthy for, the second of which
  10653. * contains elements `predicate` returns falsey for. The predicate is
  10654. * invoked with one argument: (value).
  10655. *
  10656. * @static
  10657. * @memberOf _
  10658. * @since 3.0.0
  10659. * @category Collection
  10660. * @param {Array|Object} collection The collection to iterate over.
  10661. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10662. * @returns {Array} Returns the array of grouped elements.
  10663. * @example
  10664. *
  10665. * var users = [
  10666. * { 'user': 'barney', 'age': 36, 'active': false },
  10667. * { 'user': 'fred', 'age': 40, 'active': true },
  10668. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10669. * ];
  10670. *
  10671. * _.partition(users, function(o) { return o.active; });
  10672. * // => objects for [['fred'], ['barney', 'pebbles']]
  10673. *
  10674. * // The `_.matches` iteratee shorthand.
  10675. * _.partition(users, { 'age': 1, 'active': false });
  10676. * // => objects for [['pebbles'], ['barney', 'fred']]
  10677. *
  10678. * // The `_.matchesProperty` iteratee shorthand.
  10679. * _.partition(users, ['active', false]);
  10680. * // => objects for [['barney', 'pebbles'], ['fred']]
  10681. *
  10682. * // The `_.property` iteratee shorthand.
  10683. * _.partition(users, 'active');
  10684. * // => objects for [['fred'], ['barney', 'pebbles']]
  10685. */
  10686. var partition = createAggregator(function(result, value, key) {
  10687. result[key ? 0 : 1].push(value);
  10688. }, function() { return [[], []]; });
  10689. /**
  10690. * Reduces `collection` to a value which is the accumulated result of running
  10691. * each element in `collection` thru `iteratee`, where each successive
  10692. * invocation is supplied the return value of the previous. If `accumulator`
  10693. * is not given, the first element of `collection` is used as the initial
  10694. * value. The iteratee is invoked with four arguments:
  10695. * (accumulator, value, index|key, collection).
  10696. *
  10697. * Many lodash methods are guarded to work as iteratees for methods like
  10698. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10699. *
  10700. * The guarded methods are:
  10701. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10702. * and `sortBy`
  10703. *
  10704. * @static
  10705. * @memberOf _
  10706. * @since 0.1.0
  10707. * @category Collection
  10708. * @param {Array|Object} collection The collection to iterate over.
  10709. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10710. * @param {*} [accumulator] The initial value.
  10711. * @returns {*} Returns the accumulated value.
  10712. * @see _.reduceRight
  10713. * @example
  10714. *
  10715. * _.reduce([1, 2], function(sum, n) {
  10716. * return sum + n;
  10717. * }, 0);
  10718. * // => 3
  10719. *
  10720. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10721. * (result[value] || (result[value] = [])).push(key);
  10722. * return result;
  10723. * }, {});
  10724. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10725. */
  10726. function reduce(collection, iteratee, accumulator) {
  10727. var func = isArray(collection) ? arrayReduce : baseReduce,
  10728. initAccum = arguments.length < 3;
  10729. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10730. }
  10731. /**
  10732. * This method is like `_.reduce` except that it iterates over elements of
  10733. * `collection` from right to left.
  10734. *
  10735. * @static
  10736. * @memberOf _
  10737. * @since 0.1.0
  10738. * @category Collection
  10739. * @param {Array|Object} collection The collection to iterate over.
  10740. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10741. * @param {*} [accumulator] The initial value.
  10742. * @returns {*} Returns the accumulated value.
  10743. * @see _.reduce
  10744. * @example
  10745. *
  10746. * var array = [[0, 1], [2, 3], [4, 5]];
  10747. *
  10748. * _.reduceRight(array, function(flattened, other) {
  10749. * return flattened.concat(other);
  10750. * }, []);
  10751. * // => [4, 5, 2, 3, 0, 1]
  10752. */
  10753. function reduceRight(collection, iteratee, accumulator) {
  10754. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10755. initAccum = arguments.length < 3;
  10756. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10757. }
  10758. /**
  10759. * The opposite of `_.filter`; this method returns the elements of `collection`
  10760. * that `predicate` does **not** return truthy for.
  10761. *
  10762. * @static
  10763. * @memberOf _
  10764. * @since 0.1.0
  10765. * @category Collection
  10766. * @param {Array|Object} collection The collection to iterate over.
  10767. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10768. * @returns {Array} Returns the new filtered array.
  10769. * @see _.filter
  10770. * @example
  10771. *
  10772. * var users = [
  10773. * { 'user': 'barney', 'age': 36, 'active': false },
  10774. * { 'user': 'fred', 'age': 40, 'active': true }
  10775. * ];
  10776. *
  10777. * _.reject(users, function(o) { return !o.active; });
  10778. * // => objects for ['fred']
  10779. *
  10780. * // The `_.matches` iteratee shorthand.
  10781. * _.reject(users, { 'age': 40, 'active': true });
  10782. * // => objects for ['barney']
  10783. *
  10784. * // The `_.matchesProperty` iteratee shorthand.
  10785. * _.reject(users, ['active', false]);
  10786. * // => objects for ['fred']
  10787. *
  10788. * // The `_.property` iteratee shorthand.
  10789. * _.reject(users, 'active');
  10790. * // => objects for ['barney']
  10791. */
  10792. function reject(collection, predicate) {
  10793. var func = isArray(collection) ? arrayFilter : baseFilter;
  10794. return func(collection, negate(getIteratee(predicate, 3)));
  10795. }
  10796. /**
  10797. * Gets a random element from `collection`.
  10798. *
  10799. * @static
  10800. * @memberOf _
  10801. * @since 2.0.0
  10802. * @category Collection
  10803. * @param {Array|Object} collection The collection to sample.
  10804. * @returns {*} Returns the random element.
  10805. * @example
  10806. *
  10807. * _.sample([1, 2, 3, 4]);
  10808. * // => 2
  10809. */
  10810. function sample(collection) {
  10811. var func = isArray(collection) ? arraySample : baseSample;
  10812. return func(collection);
  10813. }
  10814. /**
  10815. * Gets `n` random elements at unique keys from `collection` up to the
  10816. * size of `collection`.
  10817. *
  10818. * @static
  10819. * @memberOf _
  10820. * @since 4.0.0
  10821. * @category Collection
  10822. * @param {Array|Object} collection The collection to sample.
  10823. * @param {number} [n=1] The number of elements to sample.
  10824. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10825. * @returns {Array} Returns the random elements.
  10826. * @example
  10827. *
  10828. * _.sampleSize([1, 2, 3], 2);
  10829. * // => [3, 1]
  10830. *
  10831. * _.sampleSize([1, 2, 3], 4);
  10832. * // => [2, 3, 1]
  10833. */
  10834. function sampleSize(collection, n, guard) {
  10835. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10836. n = 1;
  10837. } else {
  10838. n = toInteger(n);
  10839. }
  10840. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10841. return func(collection, n);
  10842. }
  10843. /**
  10844. * Creates an array of shuffled values, using a version of the
  10845. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10846. *
  10847. * @static
  10848. * @memberOf _
  10849. * @since 0.1.0
  10850. * @category Collection
  10851. * @param {Array|Object} collection The collection to shuffle.
  10852. * @returns {Array} Returns the new shuffled array.
  10853. * @example
  10854. *
  10855. * _.shuffle([1, 2, 3, 4]);
  10856. * // => [4, 1, 3, 2]
  10857. */
  10858. function shuffle(collection) {
  10859. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10860. return func(collection);
  10861. }
  10862. /**
  10863. * Gets the size of `collection` by returning its length for array-like
  10864. * values or the number of own enumerable string keyed properties for objects.
  10865. *
  10866. * @static
  10867. * @memberOf _
  10868. * @since 0.1.0
  10869. * @category Collection
  10870. * @param {Array|Object|string} collection The collection to inspect.
  10871. * @returns {number} Returns the collection size.
  10872. * @example
  10873. *
  10874. * _.size([1, 2, 3]);
  10875. * // => 3
  10876. *
  10877. * _.size({ 'a': 1, 'b': 2 });
  10878. * // => 2
  10879. *
  10880. * _.size('pebbles');
  10881. * // => 7
  10882. */
  10883. function size(collection) {
  10884. if (collection == null) {
  10885. return 0;
  10886. }
  10887. if (isArrayLike(collection)) {
  10888. return isString(collection) ? stringSize(collection) : collection.length;
  10889. }
  10890. var tag = getTag(collection);
  10891. if (tag == mapTag || tag == setTag) {
  10892. return collection.size;
  10893. }
  10894. return baseKeys(collection).length;
  10895. }
  10896. /**
  10897. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10898. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10899. * invoked with three arguments: (value, index|key, collection).
  10900. *
  10901. * @static
  10902. * @memberOf _
  10903. * @since 0.1.0
  10904. * @category Collection
  10905. * @param {Array|Object} collection The collection to iterate over.
  10906. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10907. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10908. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10909. * else `false`.
  10910. * @example
  10911. *
  10912. * _.some([null, 0, 'yes', false], Boolean);
  10913. * // => true
  10914. *
  10915. * var users = [
  10916. * { 'user': 'barney', 'active': true },
  10917. * { 'user': 'fred', 'active': false }
  10918. * ];
  10919. *
  10920. * // The `_.matches` iteratee shorthand.
  10921. * _.some(users, { 'user': 'barney', 'active': false });
  10922. * // => false
  10923. *
  10924. * // The `_.matchesProperty` iteratee shorthand.
  10925. * _.some(users, ['active', false]);
  10926. * // => true
  10927. *
  10928. * // The `_.property` iteratee shorthand.
  10929. * _.some(users, 'active');
  10930. * // => true
  10931. */
  10932. function some(collection, predicate, guard) {
  10933. var func = isArray(collection) ? arraySome : baseSome;
  10934. if (guard && isIterateeCall(collection, predicate, guard)) {
  10935. predicate = undefined;
  10936. }
  10937. return func(collection, getIteratee(predicate, 3));
  10938. }
  10939. /**
  10940. * Creates an array of elements, sorted in ascending order by the results of
  10941. * running each element in a collection thru each iteratee. This method
  10942. * performs a stable sort, that is, it preserves the original sort order of
  10943. * equal elements. The iteratees are invoked with one argument: (value).
  10944. *
  10945. * @static
  10946. * @memberOf _
  10947. * @since 0.1.0
  10948. * @category Collection
  10949. * @param {Array|Object} collection The collection to iterate over.
  10950. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10951. * The iteratees to sort by.
  10952. * @returns {Array} Returns the new sorted array.
  10953. * @example
  10954. *
  10955. * var users = [
  10956. * { 'user': 'fred', 'age': 48 },
  10957. * { 'user': 'barney', 'age': 36 },
  10958. * { 'user': 'fred', 'age': 30 },
  10959. * { 'user': 'barney', 'age': 34 }
  10960. * ];
  10961. *
  10962. * _.sortBy(users, [function(o) { return o.user; }]);
  10963. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10964. *
  10965. * _.sortBy(users, ['user', 'age']);
  10966. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10967. */
  10968. var sortBy = baseRest(function(collection, iteratees) {
  10969. if (collection == null) {
  10970. return [];
  10971. }
  10972. var length = iteratees.length;
  10973. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10974. iteratees = [];
  10975. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10976. iteratees = [iteratees[0]];
  10977. }
  10978. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10979. });
  10980. /*------------------------------------------------------------------------*/
  10981. /**
  10982. * Gets the timestamp of the number of milliseconds that have elapsed since
  10983. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10984. *
  10985. * @static
  10986. * @memberOf _
  10987. * @since 2.4.0
  10988. * @category Date
  10989. * @returns {number} Returns the timestamp.
  10990. * @example
  10991. *
  10992. * _.defer(function(stamp) {
  10993. * console.log(_.now() - stamp);
  10994. * }, _.now());
  10995. * // => Logs the number of milliseconds it took for the deferred invocation.
  10996. */
  10997. var now = ctxNow || function() {
  10998. return root.Date.now();
  10999. };
  11000. /*------------------------------------------------------------------------*/
  11001. /**
  11002. * The opposite of `_.before`; this method creates a function that invokes
  11003. * `func` once it's called `n` or more times.
  11004. *
  11005. * @static
  11006. * @memberOf _
  11007. * @since 0.1.0
  11008. * @category Function
  11009. * @param {number} n The number of calls before `func` is invoked.
  11010. * @param {Function} func The function to restrict.
  11011. * @returns {Function} Returns the new restricted function.
  11012. * @example
  11013. *
  11014. * var saves = ['profile', 'settings'];
  11015. *
  11016. * var done = _.after(saves.length, function() {
  11017. * console.log('done saving!');
  11018. * });
  11019. *
  11020. * _.forEach(saves, function(type) {
  11021. * asyncSave({ 'type': type, 'complete': done });
  11022. * });
  11023. * // => Logs 'done saving!' after the two async saves have completed.
  11024. */
  11025. function after(n, func) {
  11026. if (typeof func != 'function') {
  11027. throw new TypeError(FUNC_ERROR_TEXT);
  11028. }
  11029. n = toInteger(n);
  11030. return function() {
  11031. if (--n < 1) {
  11032. return func.apply(this, arguments);
  11033. }
  11034. };
  11035. }
  11036. /**
  11037. * Creates a function that invokes `func`, with up to `n` arguments,
  11038. * ignoring any additional arguments.
  11039. *
  11040. * @static
  11041. * @memberOf _
  11042. * @since 3.0.0
  11043. * @category Function
  11044. * @param {Function} func The function to cap arguments for.
  11045. * @param {number} [n=func.length] The arity cap.
  11046. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  11047. * @returns {Function} Returns the new capped function.
  11048. * @example
  11049. *
  11050. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  11051. * // => [6, 8, 10]
  11052. */
  11053. function ary(func, n, guard) {
  11054. n = guard ? undefined : n;
  11055. n = (func && n == null) ? func.length : n;
  11056. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  11057. }
  11058. /**
  11059. * Creates a function that invokes `func`, with the `this` binding and arguments
  11060. * of the created function, while it's called less than `n` times. Subsequent
  11061. * calls to the created function return the result of the last `func` invocation.
  11062. *
  11063. * @static
  11064. * @memberOf _
  11065. * @since 3.0.0
  11066. * @category Function
  11067. * @param {number} n The number of calls at which `func` is no longer invoked.
  11068. * @param {Function} func The function to restrict.
  11069. * @returns {Function} Returns the new restricted function.
  11070. * @example
  11071. *
  11072. * jQuery(element).on('click', _.before(5, addContactToList));
  11073. * // => Allows adding up to 4 contacts to the list.
  11074. */
  11075. function before(n, func) {
  11076. var result;
  11077. if (typeof func != 'function') {
  11078. throw new TypeError(FUNC_ERROR_TEXT);
  11079. }
  11080. n = toInteger(n);
  11081. return function() {
  11082. if (--n > 0) {
  11083. result = func.apply(this, arguments);
  11084. }
  11085. if (n <= 1) {
  11086. func = undefined;
  11087. }
  11088. return result;
  11089. };
  11090. }
  11091. /**
  11092. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  11093. * and `partials` prepended to the arguments it receives.
  11094. *
  11095. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  11096. * may be used as a placeholder for partially applied arguments.
  11097. *
  11098. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  11099. * property of bound functions.
  11100. *
  11101. * @static
  11102. * @memberOf _
  11103. * @since 0.1.0
  11104. * @category Function
  11105. * @param {Function} func The function to bind.
  11106. * @param {*} thisArg The `this` binding of `func`.
  11107. * @param {...*} [partials] The arguments to be partially applied.
  11108. * @returns {Function} Returns the new bound function.
  11109. * @example
  11110. *
  11111. * function greet(greeting, punctuation) {
  11112. * return greeting + ' ' + this.user + punctuation;
  11113. * }
  11114. *
  11115. * var object = { 'user': 'fred' };
  11116. *
  11117. * var bound = _.bind(greet, object, 'hi');
  11118. * bound('!');
  11119. * // => 'hi fred!'
  11120. *
  11121. * // Bound with placeholders.
  11122. * var bound = _.bind(greet, object, _, '!');
  11123. * bound('hi');
  11124. * // => 'hi fred!'
  11125. */
  11126. var bind = baseRest(function(func, thisArg, partials) {
  11127. var bitmask = WRAP_BIND_FLAG;
  11128. if (partials.length) {
  11129. var holders = replaceHolders(partials, getHolder(bind));
  11130. bitmask |= WRAP_PARTIAL_FLAG;
  11131. }
  11132. return createWrap(func, bitmask, thisArg, partials, holders);
  11133. });
  11134. /**
  11135. * Creates a function that invokes the method at `object[key]` with `partials`
  11136. * prepended to the arguments it receives.
  11137. *
  11138. * This method differs from `_.bind` by allowing bound functions to reference
  11139. * methods that may be redefined or don't yet exist. See
  11140. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  11141. * for more details.
  11142. *
  11143. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  11144. * builds, may be used as a placeholder for partially applied arguments.
  11145. *
  11146. * @static
  11147. * @memberOf _
  11148. * @since 0.10.0
  11149. * @category Function
  11150. * @param {Object} object The object to invoke the method on.
  11151. * @param {string} key The key of the method.
  11152. * @param {...*} [partials] The arguments to be partially applied.
  11153. * @returns {Function} Returns the new bound function.
  11154. * @example
  11155. *
  11156. * var object = {
  11157. * 'user': 'fred',
  11158. * 'greet': function(greeting, punctuation) {
  11159. * return greeting + ' ' + this.user + punctuation;
  11160. * }
  11161. * };
  11162. *
  11163. * var bound = _.bindKey(object, 'greet', 'hi');
  11164. * bound('!');
  11165. * // => 'hi fred!'
  11166. *
  11167. * object.greet = function(greeting, punctuation) {
  11168. * return greeting + 'ya ' + this.user + punctuation;
  11169. * };
  11170. *
  11171. * bound('!');
  11172. * // => 'hiya fred!'
  11173. *
  11174. * // Bound with placeholders.
  11175. * var bound = _.bindKey(object, 'greet', _, '!');
  11176. * bound('hi');
  11177. * // => 'hiya fred!'
  11178. */
  11179. var bindKey = baseRest(function(object, key, partials) {
  11180. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  11181. if (partials.length) {
  11182. var holders = replaceHolders(partials, getHolder(bindKey));
  11183. bitmask |= WRAP_PARTIAL_FLAG;
  11184. }
  11185. return createWrap(key, bitmask, object, partials, holders);
  11186. });
  11187. /**
  11188. * Creates a function that accepts arguments of `func` and either invokes
  11189. * `func` returning its result, if at least `arity` number of arguments have
  11190. * been provided, or returns a function that accepts the remaining `func`
  11191. * arguments, and so on. The arity of `func` may be specified if `func.length`
  11192. * is not sufficient.
  11193. *
  11194. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  11195. * may be used as a placeholder for provided arguments.
  11196. *
  11197. * **Note:** This method doesn't set the "length" property of curried functions.
  11198. *
  11199. * @static
  11200. * @memberOf _
  11201. * @since 2.0.0
  11202. * @category Function
  11203. * @param {Function} func The function to curry.
  11204. * @param {number} [arity=func.length] The arity of `func`.
  11205. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  11206. * @returns {Function} Returns the new curried function.
  11207. * @example
  11208. *
  11209. * var abc = function(a, b, c) {
  11210. * return [a, b, c];
  11211. * };
  11212. *
  11213. * var curried = _.curry(abc);
  11214. *
  11215. * curried(1)(2)(3);
  11216. * // => [1, 2, 3]
  11217. *
  11218. * curried(1, 2)(3);
  11219. * // => [1, 2, 3]
  11220. *
  11221. * curried(1, 2, 3);
  11222. * // => [1, 2, 3]
  11223. *
  11224. * // Curried with placeholders.
  11225. * curried(1)(_, 3)(2);
  11226. * // => [1, 2, 3]
  11227. */
  11228. function curry(func, arity, guard) {
  11229. arity = guard ? undefined : arity;
  11230. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  11231. result.placeholder = curry.placeholder;
  11232. return result;
  11233. }
  11234. /**
  11235. * This method is like `_.curry` except that arguments are applied to `func`
  11236. * in the manner of `_.partialRight` instead of `_.partial`.
  11237. *
  11238. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  11239. * builds, may be used as a placeholder for provided arguments.
  11240. *
  11241. * **Note:** This method doesn't set the "length" property of curried functions.
  11242. *
  11243. * @static
  11244. * @memberOf _
  11245. * @since 3.0.0
  11246. * @category Function
  11247. * @param {Function} func The function to curry.
  11248. * @param {number} [arity=func.length] The arity of `func`.
  11249. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  11250. * @returns {Function} Returns the new curried function.
  11251. * @example
  11252. *
  11253. * var abc = function(a, b, c) {
  11254. * return [a, b, c];
  11255. * };
  11256. *
  11257. * var curried = _.curryRight(abc);
  11258. *
  11259. * curried(3)(2)(1);
  11260. * // => [1, 2, 3]
  11261. *
  11262. * curried(2, 3)(1);
  11263. * // => [1, 2, 3]
  11264. *
  11265. * curried(1, 2, 3);
  11266. * // => [1, 2, 3]
  11267. *
  11268. * // Curried with placeholders.
  11269. * curried(3)(1, _)(2);
  11270. * // => [1, 2, 3]
  11271. */
  11272. function curryRight(func, arity, guard) {
  11273. arity = guard ? undefined : arity;
  11274. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  11275. result.placeholder = curryRight.placeholder;
  11276. return result;
  11277. }
  11278. /**
  11279. * Creates a debounced function that delays invoking `func` until after `wait`
  11280. * milliseconds have elapsed since the last time the debounced function was
  11281. * invoked. The debounced function comes with a `cancel` method to cancel
  11282. * delayed `func` invocations and a `flush` method to immediately invoke them.
  11283. * Provide `options` to indicate whether `func` should be invoked on the
  11284. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  11285. * with the last arguments provided to the debounced function. Subsequent
  11286. * calls to the debounced function return the result of the last `func`
  11287. * invocation.
  11288. *
  11289. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11290. * invoked on the trailing edge of the timeout only if the debounced function
  11291. * is invoked more than once during the `wait` timeout.
  11292. *
  11293. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11294. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11295. *
  11296. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11297. * for details over the differences between `_.debounce` and `_.throttle`.
  11298. *
  11299. * @static
  11300. * @memberOf _
  11301. * @since 0.1.0
  11302. * @category Function
  11303. * @param {Function} func The function to debounce.
  11304. * @param {number} [wait=0] The number of milliseconds to delay.
  11305. * @param {Object} [options={}] The options object.
  11306. * @param {boolean} [options.leading=false]
  11307. * Specify invoking on the leading edge of the timeout.
  11308. * @param {number} [options.maxWait]
  11309. * The maximum time `func` is allowed to be delayed before it's invoked.
  11310. * @param {boolean} [options.trailing=true]
  11311. * Specify invoking on the trailing edge of the timeout.
  11312. * @returns {Function} Returns the new debounced function.
  11313. * @example
  11314. *
  11315. * // Avoid costly calculations while the window size is in flux.
  11316. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  11317. *
  11318. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  11319. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  11320. * 'leading': true,
  11321. * 'trailing': false
  11322. * }));
  11323. *
  11324. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  11325. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  11326. * var source = new EventSource('/stream');
  11327. * jQuery(source).on('message', debounced);
  11328. *
  11329. * // Cancel the trailing debounced invocation.
  11330. * jQuery(window).on('popstate', debounced.cancel);
  11331. */
  11332. function debounce(func, wait, options) {
  11333. var lastArgs,
  11334. lastThis,
  11335. maxWait,
  11336. result,
  11337. timerId,
  11338. lastCallTime,
  11339. lastInvokeTime = 0,
  11340. leading = false,
  11341. maxing = false,
  11342. trailing = true;
  11343. if (typeof func != 'function') {
  11344. throw new TypeError(FUNC_ERROR_TEXT);
  11345. }
  11346. wait = toNumber(wait) || 0;
  11347. if (isObject(options)) {
  11348. leading = !!options.leading;
  11349. maxing = 'maxWait' in options;
  11350. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  11351. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11352. }
  11353. function invokeFunc(time) {
  11354. var args = lastArgs,
  11355. thisArg = lastThis;
  11356. lastArgs = lastThis = undefined;
  11357. lastInvokeTime = time;
  11358. result = func.apply(thisArg, args);
  11359. return result;
  11360. }
  11361. function leadingEdge(time) {
  11362. // Reset any `maxWait` timer.
  11363. lastInvokeTime = time;
  11364. // Start the timer for the trailing edge.
  11365. timerId = setTimeout(timerExpired, wait);
  11366. // Invoke the leading edge.
  11367. return leading ? invokeFunc(time) : result;
  11368. }
  11369. function remainingWait(time) {
  11370. var timeSinceLastCall = time - lastCallTime,
  11371. timeSinceLastInvoke = time - lastInvokeTime,
  11372. timeWaiting = wait - timeSinceLastCall;
  11373. return maxing
  11374. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  11375. : timeWaiting;
  11376. }
  11377. function shouldInvoke(time) {
  11378. var timeSinceLastCall = time - lastCallTime,
  11379. timeSinceLastInvoke = time - lastInvokeTime;
  11380. // Either this is the first call, activity has stopped and we're at the
  11381. // trailing edge, the system time has gone backwards and we're treating
  11382. // it as the trailing edge, or we've hit the `maxWait` limit.
  11383. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  11384. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  11385. }
  11386. function timerExpired() {
  11387. var time = now();
  11388. if (shouldInvoke(time)) {
  11389. return trailingEdge(time);
  11390. }
  11391. // Restart the timer.
  11392. timerId = setTimeout(timerExpired, remainingWait(time));
  11393. }
  11394. function trailingEdge(time) {
  11395. timerId = undefined;
  11396. // Only invoke if we have `lastArgs` which means `func` has been
  11397. // debounced at least once.
  11398. if (trailing && lastArgs) {
  11399. return invokeFunc(time);
  11400. }
  11401. lastArgs = lastThis = undefined;
  11402. return result;
  11403. }
  11404. function cancel() {
  11405. if (timerId !== undefined) {
  11406. clearTimeout(timerId);
  11407. }
  11408. lastInvokeTime = 0;
  11409. lastArgs = lastCallTime = lastThis = timerId = undefined;
  11410. }
  11411. function flush() {
  11412. return timerId === undefined ? result : trailingEdge(now());
  11413. }
  11414. function debounced() {
  11415. var time = now(),
  11416. isInvoking = shouldInvoke(time);
  11417. lastArgs = arguments;
  11418. lastThis = this;
  11419. lastCallTime = time;
  11420. if (isInvoking) {
  11421. if (timerId === undefined) {
  11422. return leadingEdge(lastCallTime);
  11423. }
  11424. if (maxing) {
  11425. // Handle invocations in a tight loop.
  11426. clearTimeout(timerId);
  11427. timerId = setTimeout(timerExpired, wait);
  11428. return invokeFunc(lastCallTime);
  11429. }
  11430. }
  11431. if (timerId === undefined) {
  11432. timerId = setTimeout(timerExpired, wait);
  11433. }
  11434. return result;
  11435. }
  11436. debounced.cancel = cancel;
  11437. debounced.flush = flush;
  11438. return debounced;
  11439. }
  11440. /**
  11441. * Defers invoking the `func` until the current call stack has cleared. Any
  11442. * additional arguments are provided to `func` when it's invoked.
  11443. *
  11444. * @static
  11445. * @memberOf _
  11446. * @since 0.1.0
  11447. * @category Function
  11448. * @param {Function} func The function to defer.
  11449. * @param {...*} [args] The arguments to invoke `func` with.
  11450. * @returns {number} Returns the timer id.
  11451. * @example
  11452. *
  11453. * _.defer(function(text) {
  11454. * console.log(text);
  11455. * }, 'deferred');
  11456. * // => Logs 'deferred' after one millisecond.
  11457. */
  11458. var defer = baseRest(function(func, args) {
  11459. return baseDelay(func, 1, args);
  11460. });
  11461. /**
  11462. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11463. * provided to `func` when it's invoked.
  11464. *
  11465. * @static
  11466. * @memberOf _
  11467. * @since 0.1.0
  11468. * @category Function
  11469. * @param {Function} func The function to delay.
  11470. * @param {number} wait The number of milliseconds to delay invocation.
  11471. * @param {...*} [args] The arguments to invoke `func` with.
  11472. * @returns {number} Returns the timer id.
  11473. * @example
  11474. *
  11475. * _.delay(function(text) {
  11476. * console.log(text);
  11477. * }, 1000, 'later');
  11478. * // => Logs 'later' after one second.
  11479. */
  11480. var delay = baseRest(function(func, wait, args) {
  11481. return baseDelay(func, toNumber(wait) || 0, args);
  11482. });
  11483. /**
  11484. * Creates a function that invokes `func` with arguments reversed.
  11485. *
  11486. * @static
  11487. * @memberOf _
  11488. * @since 4.0.0
  11489. * @category Function
  11490. * @param {Function} func The function to flip arguments for.
  11491. * @returns {Function} Returns the new flipped function.
  11492. * @example
  11493. *
  11494. * var flipped = _.flip(function() {
  11495. * return _.toArray(arguments);
  11496. * });
  11497. *
  11498. * flipped('a', 'b', 'c', 'd');
  11499. * // => ['d', 'c', 'b', 'a']
  11500. */
  11501. function flip(func) {
  11502. return createWrap(func, WRAP_FLIP_FLAG);
  11503. }
  11504. /**
  11505. * Creates a function that memoizes the result of `func`. If `resolver` is
  11506. * provided, it determines the cache key for storing the result based on the
  11507. * arguments provided to the memoized function. By default, the first argument
  11508. * provided to the memoized function is used as the map cache key. The `func`
  11509. * is invoked with the `this` binding of the memoized function.
  11510. *
  11511. * **Note:** The cache is exposed as the `cache` property on the memoized
  11512. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11513. * constructor with one whose instances implement the
  11514. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11515. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11516. *
  11517. * @static
  11518. * @memberOf _
  11519. * @since 0.1.0
  11520. * @category Function
  11521. * @param {Function} func The function to have its output memoized.
  11522. * @param {Function} [resolver] The function to resolve the cache key.
  11523. * @returns {Function} Returns the new memoized function.
  11524. * @example
  11525. *
  11526. * var object = { 'a': 1, 'b': 2 };
  11527. * var other = { 'c': 3, 'd': 4 };
  11528. *
  11529. * var values = _.memoize(_.values);
  11530. * values(object);
  11531. * // => [1, 2]
  11532. *
  11533. * values(other);
  11534. * // => [3, 4]
  11535. *
  11536. * object.a = 2;
  11537. * values(object);
  11538. * // => [1, 2]
  11539. *
  11540. * // Modify the result cache.
  11541. * values.cache.set(object, ['a', 'b']);
  11542. * values(object);
  11543. * // => ['a', 'b']
  11544. *
  11545. * // Replace `_.memoize.Cache`.
  11546. * _.memoize.Cache = WeakMap;
  11547. */
  11548. function memoize(func, resolver) {
  11549. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11550. throw new TypeError(FUNC_ERROR_TEXT);
  11551. }
  11552. var memoized = function() {
  11553. var args = arguments,
  11554. key = resolver ? resolver.apply(this, args) : args[0],
  11555. cache = memoized.cache;
  11556. if (cache.has(key)) {
  11557. return cache.get(key);
  11558. }
  11559. var result = func.apply(this, args);
  11560. memoized.cache = cache.set(key, result) || cache;
  11561. return result;
  11562. };
  11563. memoized.cache = new (memoize.Cache || MapCache);
  11564. return memoized;
  11565. }
  11566. // Expose `MapCache`.
  11567. memoize.Cache = MapCache;
  11568. /**
  11569. * Creates a function that negates the result of the predicate `func`. The
  11570. * `func` predicate is invoked with the `this` binding and arguments of the
  11571. * created function.
  11572. *
  11573. * @static
  11574. * @memberOf _
  11575. * @since 3.0.0
  11576. * @category Function
  11577. * @param {Function} predicate The predicate to negate.
  11578. * @returns {Function} Returns the new negated function.
  11579. * @example
  11580. *
  11581. * function isEven(n) {
  11582. * return n % 2 == 0;
  11583. * }
  11584. *
  11585. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11586. * // => [1, 3, 5]
  11587. */
  11588. function negate(predicate) {
  11589. if (typeof predicate != 'function') {
  11590. throw new TypeError(FUNC_ERROR_TEXT);
  11591. }
  11592. return function() {
  11593. var args = arguments;
  11594. switch (args.length) {
  11595. case 0: return !predicate.call(this);
  11596. case 1: return !predicate.call(this, args[0]);
  11597. case 2: return !predicate.call(this, args[0], args[1]);
  11598. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11599. }
  11600. return !predicate.apply(this, args);
  11601. };
  11602. }
  11603. /**
  11604. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11605. * to the function return the value of the first invocation. The `func` is
  11606. * invoked with the `this` binding and arguments of the created function.
  11607. *
  11608. * @static
  11609. * @memberOf _
  11610. * @since 0.1.0
  11611. * @category Function
  11612. * @param {Function} func The function to restrict.
  11613. * @returns {Function} Returns the new restricted function.
  11614. * @example
  11615. *
  11616. * var initialize = _.once(createApplication);
  11617. * initialize();
  11618. * initialize();
  11619. * // => `createApplication` is invoked once
  11620. */
  11621. function once(func) {
  11622. return before(2, func);
  11623. }
  11624. /**
  11625. * Creates a function that invokes `func` with its arguments transformed.
  11626. *
  11627. * @static
  11628. * @since 4.0.0
  11629. * @memberOf _
  11630. * @category Function
  11631. * @param {Function} func The function to wrap.
  11632. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11633. * The argument transforms.
  11634. * @returns {Function} Returns the new function.
  11635. * @example
  11636. *
  11637. * function doubled(n) {
  11638. * return n * 2;
  11639. * }
  11640. *
  11641. * function square(n) {
  11642. * return n * n;
  11643. * }
  11644. *
  11645. * var func = _.overArgs(function(x, y) {
  11646. * return [x, y];
  11647. * }, [square, doubled]);
  11648. *
  11649. * func(9, 3);
  11650. * // => [81, 6]
  11651. *
  11652. * func(10, 5);
  11653. * // => [100, 10]
  11654. */
  11655. var overArgs = castRest(function(func, transforms) {
  11656. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11657. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11658. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11659. var funcsLength = transforms.length;
  11660. return baseRest(function(args) {
  11661. var index = -1,
  11662. length = nativeMin(args.length, funcsLength);
  11663. while (++index < length) {
  11664. args[index] = transforms[index].call(this, args[index]);
  11665. }
  11666. return apply(func, this, args);
  11667. });
  11668. });
  11669. /**
  11670. * Creates a function that invokes `func` with `partials` prepended to the
  11671. * arguments it receives. This method is like `_.bind` except it does **not**
  11672. * alter the `this` binding.
  11673. *
  11674. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11675. * builds, may be used as a placeholder for partially applied arguments.
  11676. *
  11677. * **Note:** This method doesn't set the "length" property of partially
  11678. * applied functions.
  11679. *
  11680. * @static
  11681. * @memberOf _
  11682. * @since 0.2.0
  11683. * @category Function
  11684. * @param {Function} func The function to partially apply arguments to.
  11685. * @param {...*} [partials] The arguments to be partially applied.
  11686. * @returns {Function} Returns the new partially applied function.
  11687. * @example
  11688. *
  11689. * function greet(greeting, name) {
  11690. * return greeting + ' ' + name;
  11691. * }
  11692. *
  11693. * var sayHelloTo = _.partial(greet, 'hello');
  11694. * sayHelloTo('fred');
  11695. * // => 'hello fred'
  11696. *
  11697. * // Partially applied with placeholders.
  11698. * var greetFred = _.partial(greet, _, 'fred');
  11699. * greetFred('hi');
  11700. * // => 'hi fred'
  11701. */
  11702. var partial = baseRest(function(func, partials) {
  11703. var holders = replaceHolders(partials, getHolder(partial));
  11704. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11705. });
  11706. /**
  11707. * This method is like `_.partial` except that partially applied arguments
  11708. * are appended to the arguments it receives.
  11709. *
  11710. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11711. * builds, may be used as a placeholder for partially applied arguments.
  11712. *
  11713. * **Note:** This method doesn't set the "length" property of partially
  11714. * applied functions.
  11715. *
  11716. * @static
  11717. * @memberOf _
  11718. * @since 1.0.0
  11719. * @category Function
  11720. * @param {Function} func The function to partially apply arguments to.
  11721. * @param {...*} [partials] The arguments to be partially applied.
  11722. * @returns {Function} Returns the new partially applied function.
  11723. * @example
  11724. *
  11725. * function greet(greeting, name) {
  11726. * return greeting + ' ' + name;
  11727. * }
  11728. *
  11729. * var greetFred = _.partialRight(greet, 'fred');
  11730. * greetFred('hi');
  11731. * // => 'hi fred'
  11732. *
  11733. * // Partially applied with placeholders.
  11734. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11735. * sayHelloTo('fred');
  11736. * // => 'hello fred'
  11737. */
  11738. var partialRight = baseRest(function(func, partials) {
  11739. var holders = replaceHolders(partials, getHolder(partialRight));
  11740. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11741. });
  11742. /**
  11743. * Creates a function that invokes `func` with arguments arranged according
  11744. * to the specified `indexes` where the argument value at the first index is
  11745. * provided as the first argument, the argument value at the second index is
  11746. * provided as the second argument, and so on.
  11747. *
  11748. * @static
  11749. * @memberOf _
  11750. * @since 3.0.0
  11751. * @category Function
  11752. * @param {Function} func The function to rearrange arguments for.
  11753. * @param {...(number|number[])} indexes The arranged argument indexes.
  11754. * @returns {Function} Returns the new function.
  11755. * @example
  11756. *
  11757. * var rearged = _.rearg(function(a, b, c) {
  11758. * return [a, b, c];
  11759. * }, [2, 0, 1]);
  11760. *
  11761. * rearged('b', 'c', 'a')
  11762. * // => ['a', 'b', 'c']
  11763. */
  11764. var rearg = flatRest(function(func, indexes) {
  11765. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11766. });
  11767. /**
  11768. * Creates a function that invokes `func` with the `this` binding of the
  11769. * created function and arguments from `start` and beyond provided as
  11770. * an array.
  11771. *
  11772. * **Note:** This method is based on the
  11773. * [rest parameter](https://mdn.io/rest_parameters).
  11774. *
  11775. * @static
  11776. * @memberOf _
  11777. * @since 4.0.0
  11778. * @category Function
  11779. * @param {Function} func The function to apply a rest parameter to.
  11780. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11781. * @returns {Function} Returns the new function.
  11782. * @example
  11783. *
  11784. * var say = _.rest(function(what, names) {
  11785. * return what + ' ' + _.initial(names).join(', ') +
  11786. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11787. * });
  11788. *
  11789. * say('hello', 'fred', 'barney', 'pebbles');
  11790. * // => 'hello fred, barney, & pebbles'
  11791. */
  11792. function rest(func, start) {
  11793. if (typeof func != 'function') {
  11794. throw new TypeError(FUNC_ERROR_TEXT);
  11795. }
  11796. start = start === undefined ? start : toInteger(start);
  11797. return baseRest(func, start);
  11798. }
  11799. /**
  11800. * Creates a function that invokes `func` with the `this` binding of the
  11801. * create function and an array of arguments much like
  11802. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11803. *
  11804. * **Note:** This method is based on the
  11805. * [spread operator](https://mdn.io/spread_operator).
  11806. *
  11807. * @static
  11808. * @memberOf _
  11809. * @since 3.2.0
  11810. * @category Function
  11811. * @param {Function} func The function to spread arguments over.
  11812. * @param {number} [start=0] The start position of the spread.
  11813. * @returns {Function} Returns the new function.
  11814. * @example
  11815. *
  11816. * var say = _.spread(function(who, what) {
  11817. * return who + ' says ' + what;
  11818. * });
  11819. *
  11820. * say(['fred', 'hello']);
  11821. * // => 'fred says hello'
  11822. *
  11823. * var numbers = Promise.all([
  11824. * Promise.resolve(40),
  11825. * Promise.resolve(36)
  11826. * ]);
  11827. *
  11828. * numbers.then(_.spread(function(x, y) {
  11829. * return x + y;
  11830. * }));
  11831. * // => a Promise of 76
  11832. */
  11833. function spread(func, start) {
  11834. if (typeof func != 'function') {
  11835. throw new TypeError(FUNC_ERROR_TEXT);
  11836. }
  11837. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11838. return baseRest(function(args) {
  11839. var array = args[start],
  11840. otherArgs = castSlice(args, 0, start);
  11841. if (array) {
  11842. arrayPush(otherArgs, array);
  11843. }
  11844. return apply(func, this, otherArgs);
  11845. });
  11846. }
  11847. /**
  11848. * Creates a throttled function that only invokes `func` at most once per
  11849. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11850. * method to cancel delayed `func` invocations and a `flush` method to
  11851. * immediately invoke them. Provide `options` to indicate whether `func`
  11852. * should be invoked on the leading and/or trailing edge of the `wait`
  11853. * timeout. The `func` is invoked with the last arguments provided to the
  11854. * throttled function. Subsequent calls to the throttled function return the
  11855. * result of the last `func` invocation.
  11856. *
  11857. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11858. * invoked on the trailing edge of the timeout only if the throttled function
  11859. * is invoked more than once during the `wait` timeout.
  11860. *
  11861. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11862. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11863. *
  11864. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11865. * for details over the differences between `_.throttle` and `_.debounce`.
  11866. *
  11867. * @static
  11868. * @memberOf _
  11869. * @since 0.1.0
  11870. * @category Function
  11871. * @param {Function} func The function to throttle.
  11872. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11873. * @param {Object} [options={}] The options object.
  11874. * @param {boolean} [options.leading=true]
  11875. * Specify invoking on the leading edge of the timeout.
  11876. * @param {boolean} [options.trailing=true]
  11877. * Specify invoking on the trailing edge of the timeout.
  11878. * @returns {Function} Returns the new throttled function.
  11879. * @example
  11880. *
  11881. * // Avoid excessively updating the position while scrolling.
  11882. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11883. *
  11884. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11885. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11886. * jQuery(element).on('click', throttled);
  11887. *
  11888. * // Cancel the trailing throttled invocation.
  11889. * jQuery(window).on('popstate', throttled.cancel);
  11890. */
  11891. function throttle(func, wait, options) {
  11892. var leading = true,
  11893. trailing = true;
  11894. if (typeof func != 'function') {
  11895. throw new TypeError(FUNC_ERROR_TEXT);
  11896. }
  11897. if (isObject(options)) {
  11898. leading = 'leading' in options ? !!options.leading : leading;
  11899. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11900. }
  11901. return debounce(func, wait, {
  11902. 'leading': leading,
  11903. 'maxWait': wait,
  11904. 'trailing': trailing
  11905. });
  11906. }
  11907. /**
  11908. * Creates a function that accepts up to one argument, ignoring any
  11909. * additional arguments.
  11910. *
  11911. * @static
  11912. * @memberOf _
  11913. * @since 4.0.0
  11914. * @category Function
  11915. * @param {Function} func The function to cap arguments for.
  11916. * @returns {Function} Returns the new capped function.
  11917. * @example
  11918. *
  11919. * _.map(['6', '8', '10'], _.unary(parseInt));
  11920. * // => [6, 8, 10]
  11921. */
  11922. function unary(func) {
  11923. return ary(func, 1);
  11924. }
  11925. /**
  11926. * Creates a function that provides `value` to `wrapper` as its first
  11927. * argument. Any additional arguments provided to the function are appended
  11928. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11929. * binding of the created function.
  11930. *
  11931. * @static
  11932. * @memberOf _
  11933. * @since 0.1.0
  11934. * @category Function
  11935. * @param {*} value The value to wrap.
  11936. * @param {Function} [wrapper=identity] The wrapper function.
  11937. * @returns {Function} Returns the new function.
  11938. * @example
  11939. *
  11940. * var p = _.wrap(_.escape, function(func, text) {
  11941. * return '<p>' + func(text) + '</p>';
  11942. * });
  11943. *
  11944. * p('fred, barney, & pebbles');
  11945. * // => '<p>fred, barney, &amp; pebbles</p>'
  11946. */
  11947. function wrap(value, wrapper) {
  11948. return partial(castFunction(wrapper), value);
  11949. }
  11950. /*------------------------------------------------------------------------*/
  11951. /**
  11952. * Casts `value` as an array if it's not one.
  11953. *
  11954. * @static
  11955. * @memberOf _
  11956. * @since 4.4.0
  11957. * @category Lang
  11958. * @param {*} value The value to inspect.
  11959. * @returns {Array} Returns the cast array.
  11960. * @example
  11961. *
  11962. * _.castArray(1);
  11963. * // => [1]
  11964. *
  11965. * _.castArray({ 'a': 1 });
  11966. * // => [{ 'a': 1 }]
  11967. *
  11968. * _.castArray('abc');
  11969. * // => ['abc']
  11970. *
  11971. * _.castArray(null);
  11972. * // => [null]
  11973. *
  11974. * _.castArray(undefined);
  11975. * // => [undefined]
  11976. *
  11977. * _.castArray();
  11978. * // => []
  11979. *
  11980. * var array = [1, 2, 3];
  11981. * console.log(_.castArray(array) === array);
  11982. * // => true
  11983. */
  11984. function castArray() {
  11985. if (!arguments.length) {
  11986. return [];
  11987. }
  11988. var value = arguments[0];
  11989. return isArray(value) ? value : [value];
  11990. }
  11991. /**
  11992. * Creates a shallow clone of `value`.
  11993. *
  11994. * **Note:** This method is loosely based on the
  11995. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11996. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11997. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11998. * arrays. The own enumerable properties of `arguments` objects are cloned
  11999. * as plain objects. An empty object is returned for uncloneable values such
  12000. * as error objects, functions, DOM nodes, and WeakMaps.
  12001. *
  12002. * @static
  12003. * @memberOf _
  12004. * @since 0.1.0
  12005. * @category Lang
  12006. * @param {*} value The value to clone.
  12007. * @returns {*} Returns the cloned value.
  12008. * @see _.cloneDeep
  12009. * @example
  12010. *
  12011. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  12012. *
  12013. * var shallow = _.clone(objects);
  12014. * console.log(shallow[0] === objects[0]);
  12015. * // => true
  12016. */
  12017. function clone(value) {
  12018. return baseClone(value, CLONE_SYMBOLS_FLAG);
  12019. }
  12020. /**
  12021. * This method is like `_.clone` except that it accepts `customizer` which
  12022. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  12023. * cloning is handled by the method instead. The `customizer` is invoked with
  12024. * up to four arguments; (value [, index|key, object, stack]).
  12025. *
  12026. * @static
  12027. * @memberOf _
  12028. * @since 4.0.0
  12029. * @category Lang
  12030. * @param {*} value The value to clone.
  12031. * @param {Function} [customizer] The function to customize cloning.
  12032. * @returns {*} Returns the cloned value.
  12033. * @see _.cloneDeepWith
  12034. * @example
  12035. *
  12036. * function customizer(value) {
  12037. * if (_.isElement(value)) {
  12038. * return value.cloneNode(false);
  12039. * }
  12040. * }
  12041. *
  12042. * var el = _.cloneWith(document.body, customizer);
  12043. *
  12044. * console.log(el === document.body);
  12045. * // => false
  12046. * console.log(el.nodeName);
  12047. * // => 'BODY'
  12048. * console.log(el.childNodes.length);
  12049. * // => 0
  12050. */
  12051. function cloneWith(value, customizer) {
  12052. customizer = typeof customizer == 'function' ? customizer : undefined;
  12053. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  12054. }
  12055. /**
  12056. * This method is like `_.clone` except that it recursively clones `value`.
  12057. *
  12058. * @static
  12059. * @memberOf _
  12060. * @since 1.0.0
  12061. * @category Lang
  12062. * @param {*} value The value to recursively clone.
  12063. * @returns {*} Returns the deep cloned value.
  12064. * @see _.clone
  12065. * @example
  12066. *
  12067. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  12068. *
  12069. * var deep = _.cloneDeep(objects);
  12070. * console.log(deep[0] === objects[0]);
  12071. * // => false
  12072. */
  12073. function cloneDeep(value) {
  12074. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  12075. }
  12076. /**
  12077. * This method is like `_.cloneWith` except that it recursively clones `value`.
  12078. *
  12079. * @static
  12080. * @memberOf _
  12081. * @since 4.0.0
  12082. * @category Lang
  12083. * @param {*} value The value to recursively clone.
  12084. * @param {Function} [customizer] The function to customize cloning.
  12085. * @returns {*} Returns the deep cloned value.
  12086. * @see _.cloneWith
  12087. * @example
  12088. *
  12089. * function customizer(value) {
  12090. * if (_.isElement(value)) {
  12091. * return value.cloneNode(true);
  12092. * }
  12093. * }
  12094. *
  12095. * var el = _.cloneDeepWith(document.body, customizer);
  12096. *
  12097. * console.log(el === document.body);
  12098. * // => false
  12099. * console.log(el.nodeName);
  12100. * // => 'BODY'
  12101. * console.log(el.childNodes.length);
  12102. * // => 20
  12103. */
  12104. function cloneDeepWith(value, customizer) {
  12105. customizer = typeof customizer == 'function' ? customizer : undefined;
  12106. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  12107. }
  12108. /**
  12109. * Checks if `object` conforms to `source` by invoking the predicate
  12110. * properties of `source` with the corresponding property values of `object`.
  12111. *
  12112. * **Note:** This method is equivalent to `_.conforms` when `source` is
  12113. * partially applied.
  12114. *
  12115. * @static
  12116. * @memberOf _
  12117. * @since 4.14.0
  12118. * @category Lang
  12119. * @param {Object} object The object to inspect.
  12120. * @param {Object} source The object of property predicates to conform to.
  12121. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  12122. * @example
  12123. *
  12124. * var object = { 'a': 1, 'b': 2 };
  12125. *
  12126. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  12127. * // => true
  12128. *
  12129. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  12130. * // => false
  12131. */
  12132. function conformsTo(object, source) {
  12133. return source == null || baseConformsTo(object, source, keys(source));
  12134. }
  12135. /**
  12136. * Performs a
  12137. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12138. * comparison between two values to determine if they are equivalent.
  12139. *
  12140. * @static
  12141. * @memberOf _
  12142. * @since 4.0.0
  12143. * @category Lang
  12144. * @param {*} value The value to compare.
  12145. * @param {*} other The other value to compare.
  12146. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12147. * @example
  12148. *
  12149. * var object = { 'a': 1 };
  12150. * var other = { 'a': 1 };
  12151. *
  12152. * _.eq(object, object);
  12153. * // => true
  12154. *
  12155. * _.eq(object, other);
  12156. * // => false
  12157. *
  12158. * _.eq('a', 'a');
  12159. * // => true
  12160. *
  12161. * _.eq('a', Object('a'));
  12162. * // => false
  12163. *
  12164. * _.eq(NaN, NaN);
  12165. * // => true
  12166. */
  12167. function eq(value, other) {
  12168. return value === other || (value !== value && other !== other);
  12169. }
  12170. /**
  12171. * Checks if `value` is greater than `other`.
  12172. *
  12173. * @static
  12174. * @memberOf _
  12175. * @since 3.9.0
  12176. * @category Lang
  12177. * @param {*} value The value to compare.
  12178. * @param {*} other The other value to compare.
  12179. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  12180. * else `false`.
  12181. * @see _.lt
  12182. * @example
  12183. *
  12184. * _.gt(3, 1);
  12185. * // => true
  12186. *
  12187. * _.gt(3, 3);
  12188. * // => false
  12189. *
  12190. * _.gt(1, 3);
  12191. * // => false
  12192. */
  12193. var gt = createRelationalOperation(baseGt);
  12194. /**
  12195. * Checks if `value` is greater than or equal to `other`.
  12196. *
  12197. * @static
  12198. * @memberOf _
  12199. * @since 3.9.0
  12200. * @category Lang
  12201. * @param {*} value The value to compare.
  12202. * @param {*} other The other value to compare.
  12203. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  12204. * `other`, else `false`.
  12205. * @see _.lte
  12206. * @example
  12207. *
  12208. * _.gte(3, 1);
  12209. * // => true
  12210. *
  12211. * _.gte(3, 3);
  12212. * // => true
  12213. *
  12214. * _.gte(1, 3);
  12215. * // => false
  12216. */
  12217. var gte = createRelationalOperation(function(value, other) {
  12218. return value >= other;
  12219. });
  12220. /**
  12221. * Checks if `value` is likely an `arguments` object.
  12222. *
  12223. * @static
  12224. * @memberOf _
  12225. * @since 0.1.0
  12226. * @category Lang
  12227. * @param {*} value The value to check.
  12228. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  12229. * else `false`.
  12230. * @example
  12231. *
  12232. * _.isArguments(function() { return arguments; }());
  12233. * // => true
  12234. *
  12235. * _.isArguments([1, 2, 3]);
  12236. * // => false
  12237. */
  12238. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  12239. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  12240. !propertyIsEnumerable.call(value, 'callee');
  12241. };
  12242. /**
  12243. * Checks if `value` is classified as an `Array` object.
  12244. *
  12245. * @static
  12246. * @memberOf _
  12247. * @since 0.1.0
  12248. * @category Lang
  12249. * @param {*} value The value to check.
  12250. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  12251. * @example
  12252. *
  12253. * _.isArray([1, 2, 3]);
  12254. * // => true
  12255. *
  12256. * _.isArray(document.body.children);
  12257. * // => false
  12258. *
  12259. * _.isArray('abc');
  12260. * // => false
  12261. *
  12262. * _.isArray(_.noop);
  12263. * // => false
  12264. */
  12265. var isArray = Array.isArray;
  12266. /**
  12267. * Checks if `value` is classified as an `ArrayBuffer` object.
  12268. *
  12269. * @static
  12270. * @memberOf _
  12271. * @since 4.3.0
  12272. * @category Lang
  12273. * @param {*} value The value to check.
  12274. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  12275. * @example
  12276. *
  12277. * _.isArrayBuffer(new ArrayBuffer(2));
  12278. * // => true
  12279. *
  12280. * _.isArrayBuffer(new Array(2));
  12281. * // => false
  12282. */
  12283. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  12284. /**
  12285. * Checks if `value` is array-like. A value is considered array-like if it's
  12286. * not a function and has a `value.length` that's an integer greater than or
  12287. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  12288. *
  12289. * @static
  12290. * @memberOf _
  12291. * @since 4.0.0
  12292. * @category Lang
  12293. * @param {*} value The value to check.
  12294. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  12295. * @example
  12296. *
  12297. * _.isArrayLike([1, 2, 3]);
  12298. * // => true
  12299. *
  12300. * _.isArrayLike(document.body.children);
  12301. * // => true
  12302. *
  12303. * _.isArrayLike('abc');
  12304. * // => true
  12305. *
  12306. * _.isArrayLike(_.noop);
  12307. * // => false
  12308. */
  12309. function isArrayLike(value) {
  12310. return value != null && isLength(value.length) && !isFunction(value);
  12311. }
  12312. /**
  12313. * This method is like `_.isArrayLike` except that it also checks if `value`
  12314. * is an object.
  12315. *
  12316. * @static
  12317. * @memberOf _
  12318. * @since 4.0.0
  12319. * @category Lang
  12320. * @param {*} value The value to check.
  12321. * @returns {boolean} Returns `true` if `value` is an array-like object,
  12322. * else `false`.
  12323. * @example
  12324. *
  12325. * _.isArrayLikeObject([1, 2, 3]);
  12326. * // => true
  12327. *
  12328. * _.isArrayLikeObject(document.body.children);
  12329. * // => true
  12330. *
  12331. * _.isArrayLikeObject('abc');
  12332. * // => false
  12333. *
  12334. * _.isArrayLikeObject(_.noop);
  12335. * // => false
  12336. */
  12337. function isArrayLikeObject(value) {
  12338. return isObjectLike(value) && isArrayLike(value);
  12339. }
  12340. /**
  12341. * Checks if `value` is classified as a boolean primitive or object.
  12342. *
  12343. * @static
  12344. * @memberOf _
  12345. * @since 0.1.0
  12346. * @category Lang
  12347. * @param {*} value The value to check.
  12348. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  12349. * @example
  12350. *
  12351. * _.isBoolean(false);
  12352. * // => true
  12353. *
  12354. * _.isBoolean(null);
  12355. * // => false
  12356. */
  12357. function isBoolean(value) {
  12358. return value === true || value === false ||
  12359. (isObjectLike(value) && baseGetTag(value) == boolTag);
  12360. }
  12361. /**
  12362. * Checks if `value` is a buffer.
  12363. *
  12364. * @static
  12365. * @memberOf _
  12366. * @since 4.3.0
  12367. * @category Lang
  12368. * @param {*} value The value to check.
  12369. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  12370. * @example
  12371. *
  12372. * _.isBuffer(new Buffer(2));
  12373. * // => true
  12374. *
  12375. * _.isBuffer(new Uint8Array(2));
  12376. * // => false
  12377. */
  12378. var isBuffer = nativeIsBuffer || stubFalse;
  12379. /**
  12380. * Checks if `value` is classified as a `Date` object.
  12381. *
  12382. * @static
  12383. * @memberOf _
  12384. * @since 0.1.0
  12385. * @category Lang
  12386. * @param {*} value The value to check.
  12387. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  12388. * @example
  12389. *
  12390. * _.isDate(new Date);
  12391. * // => true
  12392. *
  12393. * _.isDate('Mon April 23 2012');
  12394. * // => false
  12395. */
  12396. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  12397. /**
  12398. * Checks if `value` is likely a DOM element.
  12399. *
  12400. * @static
  12401. * @memberOf _
  12402. * @since 0.1.0
  12403. * @category Lang
  12404. * @param {*} value The value to check.
  12405. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  12406. * @example
  12407. *
  12408. * _.isElement(document.body);
  12409. * // => true
  12410. *
  12411. * _.isElement('<body>');
  12412. * // => false
  12413. */
  12414. function isElement(value) {
  12415. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  12416. }
  12417. /**
  12418. * Checks if `value` is an empty object, collection, map, or set.
  12419. *
  12420. * Objects are considered empty if they have no own enumerable string keyed
  12421. * properties.
  12422. *
  12423. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  12424. * jQuery-like collections are considered empty if they have a `length` of `0`.
  12425. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  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 empty, else `false`.
  12433. * @example
  12434. *
  12435. * _.isEmpty(null);
  12436. * // => true
  12437. *
  12438. * _.isEmpty(true);
  12439. * // => true
  12440. *
  12441. * _.isEmpty(1);
  12442. * // => true
  12443. *
  12444. * _.isEmpty([1, 2, 3]);
  12445. * // => false
  12446. *
  12447. * _.isEmpty({ 'a': 1 });
  12448. * // => false
  12449. */
  12450. function isEmpty(value) {
  12451. if (value == null) {
  12452. return true;
  12453. }
  12454. if (isArrayLike(value) &&
  12455. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  12456. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12457. return !value.length;
  12458. }
  12459. var tag = getTag(value);
  12460. if (tag == mapTag || tag == setTag) {
  12461. return !value.size;
  12462. }
  12463. if (isPrototype(value)) {
  12464. return !baseKeys(value).length;
  12465. }
  12466. for (var key in value) {
  12467. if (hasOwnProperty.call(value, key)) {
  12468. return false;
  12469. }
  12470. }
  12471. return true;
  12472. }
  12473. /**
  12474. * Performs a deep comparison between two values to determine if they are
  12475. * equivalent.
  12476. *
  12477. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12478. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12479. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12480. * by their own, not inherited, enumerable properties. Functions and DOM
  12481. * nodes are compared by strict equality, i.e. `===`.
  12482. *
  12483. * @static
  12484. * @memberOf _
  12485. * @since 0.1.0
  12486. * @category Lang
  12487. * @param {*} value The value to compare.
  12488. * @param {*} other The other value to compare.
  12489. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12490. * @example
  12491. *
  12492. * var object = { 'a': 1 };
  12493. * var other = { 'a': 1 };
  12494. *
  12495. * _.isEqual(object, other);
  12496. * // => true
  12497. *
  12498. * object === other;
  12499. * // => false
  12500. */
  12501. function isEqual(value, other) {
  12502. return baseIsEqual(value, other);
  12503. }
  12504. /**
  12505. * This method is like `_.isEqual` except that it accepts `customizer` which
  12506. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12507. * are handled by the method instead. The `customizer` is invoked with up to
  12508. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12509. *
  12510. * @static
  12511. * @memberOf _
  12512. * @since 4.0.0
  12513. * @category Lang
  12514. * @param {*} value The value to compare.
  12515. * @param {*} other The other value to compare.
  12516. * @param {Function} [customizer] The function to customize comparisons.
  12517. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12518. * @example
  12519. *
  12520. * function isGreeting(value) {
  12521. * return /^h(?:i|ello)$/.test(value);
  12522. * }
  12523. *
  12524. * function customizer(objValue, othValue) {
  12525. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12526. * return true;
  12527. * }
  12528. * }
  12529. *
  12530. * var array = ['hello', 'goodbye'];
  12531. * var other = ['hi', 'goodbye'];
  12532. *
  12533. * _.isEqualWith(array, other, customizer);
  12534. * // => true
  12535. */
  12536. function isEqualWith(value, other, customizer) {
  12537. customizer = typeof customizer == 'function' ? customizer : undefined;
  12538. var result = customizer ? customizer(value, other) : undefined;
  12539. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12540. }
  12541. /**
  12542. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12543. * `SyntaxError`, `TypeError`, or `URIError` object.
  12544. *
  12545. * @static
  12546. * @memberOf _
  12547. * @since 3.0.0
  12548. * @category Lang
  12549. * @param {*} value The value to check.
  12550. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12551. * @example
  12552. *
  12553. * _.isError(new Error);
  12554. * // => true
  12555. *
  12556. * _.isError(Error);
  12557. * // => false
  12558. */
  12559. function isError(value) {
  12560. if (!isObjectLike(value)) {
  12561. return false;
  12562. }
  12563. var tag = baseGetTag(value);
  12564. return tag == errorTag || tag == domExcTag ||
  12565. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12566. }
  12567. /**
  12568. * Checks if `value` is a finite primitive number.
  12569. *
  12570. * **Note:** This method is based on
  12571. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12572. *
  12573. * @static
  12574. * @memberOf _
  12575. * @since 0.1.0
  12576. * @category Lang
  12577. * @param {*} value The value to check.
  12578. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12579. * @example
  12580. *
  12581. * _.isFinite(3);
  12582. * // => true
  12583. *
  12584. * _.isFinite(Number.MIN_VALUE);
  12585. * // => true
  12586. *
  12587. * _.isFinite(Infinity);
  12588. * // => false
  12589. *
  12590. * _.isFinite('3');
  12591. * // => false
  12592. */
  12593. function isFinite(value) {
  12594. return typeof value == 'number' && nativeIsFinite(value);
  12595. }
  12596. /**
  12597. * Checks if `value` is classified as a `Function` object.
  12598. *
  12599. * @static
  12600. * @memberOf _
  12601. * @since 0.1.0
  12602. * @category Lang
  12603. * @param {*} value The value to check.
  12604. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12605. * @example
  12606. *
  12607. * _.isFunction(_);
  12608. * // => true
  12609. *
  12610. * _.isFunction(/abc/);
  12611. * // => false
  12612. */
  12613. function isFunction(value) {
  12614. if (!isObject(value)) {
  12615. return false;
  12616. }
  12617. // The use of `Object#toString` avoids issues with the `typeof` operator
  12618. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12619. var tag = baseGetTag(value);
  12620. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12621. }
  12622. /**
  12623. * Checks if `value` is an integer.
  12624. *
  12625. * **Note:** This method is based on
  12626. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12627. *
  12628. * @static
  12629. * @memberOf _
  12630. * @since 4.0.0
  12631. * @category Lang
  12632. * @param {*} value The value to check.
  12633. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12634. * @example
  12635. *
  12636. * _.isInteger(3);
  12637. * // => true
  12638. *
  12639. * _.isInteger(Number.MIN_VALUE);
  12640. * // => false
  12641. *
  12642. * _.isInteger(Infinity);
  12643. * // => false
  12644. *
  12645. * _.isInteger('3');
  12646. * // => false
  12647. */
  12648. function isInteger(value) {
  12649. return typeof value == 'number' && value == toInteger(value);
  12650. }
  12651. /**
  12652. * Checks if `value` is a valid array-like length.
  12653. *
  12654. * **Note:** This method is loosely based on
  12655. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12656. *
  12657. * @static
  12658. * @memberOf _
  12659. * @since 4.0.0
  12660. * @category Lang
  12661. * @param {*} value The value to check.
  12662. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12663. * @example
  12664. *
  12665. * _.isLength(3);
  12666. * // => true
  12667. *
  12668. * _.isLength(Number.MIN_VALUE);
  12669. * // => false
  12670. *
  12671. * _.isLength(Infinity);
  12672. * // => false
  12673. *
  12674. * _.isLength('3');
  12675. * // => false
  12676. */
  12677. function isLength(value) {
  12678. return typeof value == 'number' &&
  12679. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12680. }
  12681. /**
  12682. * Checks if `value` is the
  12683. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12684. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12685. *
  12686. * @static
  12687. * @memberOf _
  12688. * @since 0.1.0
  12689. * @category Lang
  12690. * @param {*} value The value to check.
  12691. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12692. * @example
  12693. *
  12694. * _.isObject({});
  12695. * // => true
  12696. *
  12697. * _.isObject([1, 2, 3]);
  12698. * // => true
  12699. *
  12700. * _.isObject(_.noop);
  12701. * // => true
  12702. *
  12703. * _.isObject(null);
  12704. * // => false
  12705. */
  12706. function isObject(value) {
  12707. var type = typeof value;
  12708. return value != null && (type == 'object' || type == 'function');
  12709. }
  12710. /**
  12711. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12712. * and has a `typeof` result of "object".
  12713. *
  12714. * @static
  12715. * @memberOf _
  12716. * @since 4.0.0
  12717. * @category Lang
  12718. * @param {*} value The value to check.
  12719. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12720. * @example
  12721. *
  12722. * _.isObjectLike({});
  12723. * // => true
  12724. *
  12725. * _.isObjectLike([1, 2, 3]);
  12726. * // => true
  12727. *
  12728. * _.isObjectLike(_.noop);
  12729. * // => false
  12730. *
  12731. * _.isObjectLike(null);
  12732. * // => false
  12733. */
  12734. function isObjectLike(value) {
  12735. return value != null && typeof value == 'object';
  12736. }
  12737. /**
  12738. * Checks if `value` is classified as a `Map` object.
  12739. *
  12740. * @static
  12741. * @memberOf _
  12742. * @since 4.3.0
  12743. * @category Lang
  12744. * @param {*} value The value to check.
  12745. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12746. * @example
  12747. *
  12748. * _.isMap(new Map);
  12749. * // => true
  12750. *
  12751. * _.isMap(new WeakMap);
  12752. * // => false
  12753. */
  12754. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12755. /**
  12756. * Performs a partial deep comparison between `object` and `source` to
  12757. * determine if `object` contains equivalent property values.
  12758. *
  12759. * **Note:** This method is equivalent to `_.matches` when `source` is
  12760. * partially applied.
  12761. *
  12762. * Partial comparisons will match empty array and empty object `source`
  12763. * values against any array or object value, respectively. See `_.isEqual`
  12764. * for a list of supported value comparisons.
  12765. *
  12766. * @static
  12767. * @memberOf _
  12768. * @since 3.0.0
  12769. * @category Lang
  12770. * @param {Object} object The object to inspect.
  12771. * @param {Object} source The object of property values to match.
  12772. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12773. * @example
  12774. *
  12775. * var object = { 'a': 1, 'b': 2 };
  12776. *
  12777. * _.isMatch(object, { 'b': 2 });
  12778. * // => true
  12779. *
  12780. * _.isMatch(object, { 'b': 1 });
  12781. * // => false
  12782. */
  12783. function isMatch(object, source) {
  12784. return object === source || baseIsMatch(object, source, getMatchData(source));
  12785. }
  12786. /**
  12787. * This method is like `_.isMatch` except that it accepts `customizer` which
  12788. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12789. * are handled by the method instead. The `customizer` is invoked with five
  12790. * arguments: (objValue, srcValue, index|key, object, source).
  12791. *
  12792. * @static
  12793. * @memberOf _
  12794. * @since 4.0.0
  12795. * @category Lang
  12796. * @param {Object} object The object to inspect.
  12797. * @param {Object} source The object of property values to match.
  12798. * @param {Function} [customizer] The function to customize comparisons.
  12799. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12800. * @example
  12801. *
  12802. * function isGreeting(value) {
  12803. * return /^h(?:i|ello)$/.test(value);
  12804. * }
  12805. *
  12806. * function customizer(objValue, srcValue) {
  12807. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12808. * return true;
  12809. * }
  12810. * }
  12811. *
  12812. * var object = { 'greeting': 'hello' };
  12813. * var source = { 'greeting': 'hi' };
  12814. *
  12815. * _.isMatchWith(object, source, customizer);
  12816. * // => true
  12817. */
  12818. function isMatchWith(object, source, customizer) {
  12819. customizer = typeof customizer == 'function' ? customizer : undefined;
  12820. return baseIsMatch(object, source, getMatchData(source), customizer);
  12821. }
  12822. /**
  12823. * Checks if `value` is `NaN`.
  12824. *
  12825. * **Note:** This method is based on
  12826. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12827. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12828. * `undefined` and other non-number values.
  12829. *
  12830. * @static
  12831. * @memberOf _
  12832. * @since 0.1.0
  12833. * @category Lang
  12834. * @param {*} value The value to check.
  12835. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12836. * @example
  12837. *
  12838. * _.isNaN(NaN);
  12839. * // => true
  12840. *
  12841. * _.isNaN(new Number(NaN));
  12842. * // => true
  12843. *
  12844. * isNaN(undefined);
  12845. * // => true
  12846. *
  12847. * _.isNaN(undefined);
  12848. * // => false
  12849. */
  12850. function isNaN(value) {
  12851. // An `NaN` primitive is the only value that is not equal to itself.
  12852. // Perform the `toStringTag` check first to avoid errors with some
  12853. // ActiveX objects in IE.
  12854. return isNumber(value) && value != +value;
  12855. }
  12856. /**
  12857. * Checks if `value` is a pristine native function.
  12858. *
  12859. * **Note:** This method can't reliably detect native functions in the presence
  12860. * of the core-js package because core-js circumvents this kind of detection.
  12861. * Despite multiple requests, the core-js maintainer has made it clear: any
  12862. * attempt to fix the detection will be obstructed. As a result, we're left
  12863. * with little choice but to throw an error. Unfortunately, this also affects
  12864. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12865. * which rely on core-js.
  12866. *
  12867. * @static
  12868. * @memberOf _
  12869. * @since 3.0.0
  12870. * @category Lang
  12871. * @param {*} value The value to check.
  12872. * @returns {boolean} Returns `true` if `value` is a native function,
  12873. * else `false`.
  12874. * @example
  12875. *
  12876. * _.isNative(Array.prototype.push);
  12877. * // => true
  12878. *
  12879. * _.isNative(_);
  12880. * // => false
  12881. */
  12882. function isNative(value) {
  12883. if (isMaskable(value)) {
  12884. throw new Error(CORE_ERROR_TEXT);
  12885. }
  12886. return baseIsNative(value);
  12887. }
  12888. /**
  12889. * Checks if `value` is `null`.
  12890. *
  12891. * @static
  12892. * @memberOf _
  12893. * @since 0.1.0
  12894. * @category Lang
  12895. * @param {*} value The value to check.
  12896. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12897. * @example
  12898. *
  12899. * _.isNull(null);
  12900. * // => true
  12901. *
  12902. * _.isNull(void 0);
  12903. * // => false
  12904. */
  12905. function isNull(value) {
  12906. return value === null;
  12907. }
  12908. /**
  12909. * Checks if `value` is `null` or `undefined`.
  12910. *
  12911. * @static
  12912. * @memberOf _
  12913. * @since 4.0.0
  12914. * @category Lang
  12915. * @param {*} value The value to check.
  12916. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12917. * @example
  12918. *
  12919. * _.isNil(null);
  12920. * // => true
  12921. *
  12922. * _.isNil(void 0);
  12923. * // => true
  12924. *
  12925. * _.isNil(NaN);
  12926. * // => false
  12927. */
  12928. function isNil(value) {
  12929. return value == null;
  12930. }
  12931. /**
  12932. * Checks if `value` is classified as a `Number` primitive or object.
  12933. *
  12934. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12935. * classified as numbers, use the `_.isFinite` method.
  12936. *
  12937. * @static
  12938. * @memberOf _
  12939. * @since 0.1.0
  12940. * @category Lang
  12941. * @param {*} value The value to check.
  12942. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12943. * @example
  12944. *
  12945. * _.isNumber(3);
  12946. * // => true
  12947. *
  12948. * _.isNumber(Number.MIN_VALUE);
  12949. * // => true
  12950. *
  12951. * _.isNumber(Infinity);
  12952. * // => true
  12953. *
  12954. * _.isNumber('3');
  12955. * // => false
  12956. */
  12957. function isNumber(value) {
  12958. return typeof value == 'number' ||
  12959. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12960. }
  12961. /**
  12962. * Checks if `value` is a plain object, that is, an object created by the
  12963. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12964. *
  12965. * @static
  12966. * @memberOf _
  12967. * @since 0.8.0
  12968. * @category Lang
  12969. * @param {*} value The value to check.
  12970. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12971. * @example
  12972. *
  12973. * function Foo() {
  12974. * this.a = 1;
  12975. * }
  12976. *
  12977. * _.isPlainObject(new Foo);
  12978. * // => false
  12979. *
  12980. * _.isPlainObject([1, 2, 3]);
  12981. * // => false
  12982. *
  12983. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12984. * // => true
  12985. *
  12986. * _.isPlainObject(Object.create(null));
  12987. * // => true
  12988. */
  12989. function isPlainObject(value) {
  12990. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12991. return false;
  12992. }
  12993. var proto = getPrototype(value);
  12994. if (proto === null) {
  12995. return true;
  12996. }
  12997. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12998. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12999. funcToString.call(Ctor) == objectCtorString;
  13000. }
  13001. /**
  13002. * Checks if `value` is classified as a `RegExp` object.
  13003. *
  13004. * @static
  13005. * @memberOf _
  13006. * @since 0.1.0
  13007. * @category Lang
  13008. * @param {*} value The value to check.
  13009. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  13010. * @example
  13011. *
  13012. * _.isRegExp(/abc/);
  13013. * // => true
  13014. *
  13015. * _.isRegExp('/abc/');
  13016. * // => false
  13017. */
  13018. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  13019. /**
  13020. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  13021. * double precision number which isn't the result of a rounded unsafe integer.
  13022. *
  13023. * **Note:** This method is based on
  13024. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  13025. *
  13026. * @static
  13027. * @memberOf _
  13028. * @since 4.0.0
  13029. * @category Lang
  13030. * @param {*} value The value to check.
  13031. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  13032. * @example
  13033. *
  13034. * _.isSafeInteger(3);
  13035. * // => true
  13036. *
  13037. * _.isSafeInteger(Number.MIN_VALUE);
  13038. * // => false
  13039. *
  13040. * _.isSafeInteger(Infinity);
  13041. * // => false
  13042. *
  13043. * _.isSafeInteger('3');
  13044. * // => false
  13045. */
  13046. function isSafeInteger(value) {
  13047. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  13048. }
  13049. /**
  13050. * Checks if `value` is classified as a `Set` object.
  13051. *
  13052. * @static
  13053. * @memberOf _
  13054. * @since 4.3.0
  13055. * @category Lang
  13056. * @param {*} value The value to check.
  13057. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  13058. * @example
  13059. *
  13060. * _.isSet(new Set);
  13061. * // => true
  13062. *
  13063. * _.isSet(new WeakSet);
  13064. * // => false
  13065. */
  13066. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  13067. /**
  13068. * Checks if `value` is classified as a `String` primitive or object.
  13069. *
  13070. * @static
  13071. * @since 0.1.0
  13072. * @memberOf _
  13073. * @category Lang
  13074. * @param {*} value The value to check.
  13075. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  13076. * @example
  13077. *
  13078. * _.isString('abc');
  13079. * // => true
  13080. *
  13081. * _.isString(1);
  13082. * // => false
  13083. */
  13084. function isString(value) {
  13085. return typeof value == 'string' ||
  13086. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  13087. }
  13088. /**
  13089. * Checks if `value` is classified as a `Symbol` primitive or object.
  13090. *
  13091. * @static
  13092. * @memberOf _
  13093. * @since 4.0.0
  13094. * @category Lang
  13095. * @param {*} value The value to check.
  13096. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  13097. * @example
  13098. *
  13099. * _.isSymbol(Symbol.iterator);
  13100. * // => true
  13101. *
  13102. * _.isSymbol('abc');
  13103. * // => false
  13104. */
  13105. function isSymbol(value) {
  13106. return typeof value == 'symbol' ||
  13107. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  13108. }
  13109. /**
  13110. * Checks if `value` is classified as a typed array.
  13111. *
  13112. * @static
  13113. * @memberOf _
  13114. * @since 3.0.0
  13115. * @category Lang
  13116. * @param {*} value The value to check.
  13117. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  13118. * @example
  13119. *
  13120. * _.isTypedArray(new Uint8Array);
  13121. * // => true
  13122. *
  13123. * _.isTypedArray([]);
  13124. * // => false
  13125. */
  13126. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  13127. /**
  13128. * Checks if `value` is `undefined`.
  13129. *
  13130. * @static
  13131. * @since 0.1.0
  13132. * @memberOf _
  13133. * @category Lang
  13134. * @param {*} value The value to check.
  13135. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  13136. * @example
  13137. *
  13138. * _.isUndefined(void 0);
  13139. * // => true
  13140. *
  13141. * _.isUndefined(null);
  13142. * // => false
  13143. */
  13144. function isUndefined(value) {
  13145. return value === undefined;
  13146. }
  13147. /**
  13148. * Checks if `value` is classified as a `WeakMap` object.
  13149. *
  13150. * @static
  13151. * @memberOf _
  13152. * @since 4.3.0
  13153. * @category Lang
  13154. * @param {*} value The value to check.
  13155. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  13156. * @example
  13157. *
  13158. * _.isWeakMap(new WeakMap);
  13159. * // => true
  13160. *
  13161. * _.isWeakMap(new Map);
  13162. * // => false
  13163. */
  13164. function isWeakMap(value) {
  13165. return isObjectLike(value) && getTag(value) == weakMapTag;
  13166. }
  13167. /**
  13168. * Checks if `value` is classified as a `WeakSet` object.
  13169. *
  13170. * @static
  13171. * @memberOf _
  13172. * @since 4.3.0
  13173. * @category Lang
  13174. * @param {*} value The value to check.
  13175. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  13176. * @example
  13177. *
  13178. * _.isWeakSet(new WeakSet);
  13179. * // => true
  13180. *
  13181. * _.isWeakSet(new Set);
  13182. * // => false
  13183. */
  13184. function isWeakSet(value) {
  13185. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  13186. }
  13187. /**
  13188. * Checks if `value` is less than `other`.
  13189. *
  13190. * @static
  13191. * @memberOf _
  13192. * @since 3.9.0
  13193. * @category Lang
  13194. * @param {*} value The value to compare.
  13195. * @param {*} other The other value to compare.
  13196. * @returns {boolean} Returns `true` if `value` is less than `other`,
  13197. * else `false`.
  13198. * @see _.gt
  13199. * @example
  13200. *
  13201. * _.lt(1, 3);
  13202. * // => true
  13203. *
  13204. * _.lt(3, 3);
  13205. * // => false
  13206. *
  13207. * _.lt(3, 1);
  13208. * // => false
  13209. */
  13210. var lt = createRelationalOperation(baseLt);
  13211. /**
  13212. * Checks if `value` is less than or equal to `other`.
  13213. *
  13214. * @static
  13215. * @memberOf _
  13216. * @since 3.9.0
  13217. * @category Lang
  13218. * @param {*} value The value to compare.
  13219. * @param {*} other The other value to compare.
  13220. * @returns {boolean} Returns `true` if `value` is less than or equal to
  13221. * `other`, else `false`.
  13222. * @see _.gte
  13223. * @example
  13224. *
  13225. * _.lte(1, 3);
  13226. * // => true
  13227. *
  13228. * _.lte(3, 3);
  13229. * // => true
  13230. *
  13231. * _.lte(3, 1);
  13232. * // => false
  13233. */
  13234. var lte = createRelationalOperation(function(value, other) {
  13235. return value <= other;
  13236. });
  13237. /**
  13238. * Converts `value` to an array.
  13239. *
  13240. * @static
  13241. * @since 0.1.0
  13242. * @memberOf _
  13243. * @category Lang
  13244. * @param {*} value The value to convert.
  13245. * @returns {Array} Returns the converted array.
  13246. * @example
  13247. *
  13248. * _.toArray({ 'a': 1, 'b': 2 });
  13249. * // => [1, 2]
  13250. *
  13251. * _.toArray('abc');
  13252. * // => ['a', 'b', 'c']
  13253. *
  13254. * _.toArray(1);
  13255. * // => []
  13256. *
  13257. * _.toArray(null);
  13258. * // => []
  13259. */
  13260. function toArray(value) {
  13261. if (!value) {
  13262. return [];
  13263. }
  13264. if (isArrayLike(value)) {
  13265. return isString(value) ? stringToArray(value) : copyArray(value);
  13266. }
  13267. if (symIterator && value[symIterator]) {
  13268. return iteratorToArray(value[symIterator]());
  13269. }
  13270. var tag = getTag(value),
  13271. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  13272. return func(value);
  13273. }
  13274. /**
  13275. * Converts `value` to a finite number.
  13276. *
  13277. * @static
  13278. * @memberOf _
  13279. * @since 4.12.0
  13280. * @category Lang
  13281. * @param {*} value The value to convert.
  13282. * @returns {number} Returns the converted number.
  13283. * @example
  13284. *
  13285. * _.toFinite(3.2);
  13286. * // => 3.2
  13287. *
  13288. * _.toFinite(Number.MIN_VALUE);
  13289. * // => 5e-324
  13290. *
  13291. * _.toFinite(Infinity);
  13292. * // => 1.7976931348623157e+308
  13293. *
  13294. * _.toFinite('3.2');
  13295. * // => 3.2
  13296. */
  13297. function toFinite(value) {
  13298. if (!value) {
  13299. return value === 0 ? value : 0;
  13300. }
  13301. value = toNumber(value);
  13302. if (value === INFINITY || value === -INFINITY) {
  13303. var sign = (value < 0 ? -1 : 1);
  13304. return sign * MAX_INTEGER;
  13305. }
  13306. return value === value ? value : 0;
  13307. }
  13308. /**
  13309. * Converts `value` to an integer.
  13310. *
  13311. * **Note:** This method is loosely based on
  13312. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  13313. *
  13314. * @static
  13315. * @memberOf _
  13316. * @since 4.0.0
  13317. * @category Lang
  13318. * @param {*} value The value to convert.
  13319. * @returns {number} Returns the converted integer.
  13320. * @example
  13321. *
  13322. * _.toInteger(3.2);
  13323. * // => 3
  13324. *
  13325. * _.toInteger(Number.MIN_VALUE);
  13326. * // => 0
  13327. *
  13328. * _.toInteger(Infinity);
  13329. * // => 1.7976931348623157e+308
  13330. *
  13331. * _.toInteger('3.2');
  13332. * // => 3
  13333. */
  13334. function toInteger(value) {
  13335. var result = toFinite(value),
  13336. remainder = result % 1;
  13337. return result === result ? (remainder ? result - remainder : result) : 0;
  13338. }
  13339. /**
  13340. * Converts `value` to an integer suitable for use as the length of an
  13341. * array-like object.
  13342. *
  13343. * **Note:** This method is based on
  13344. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  13345. *
  13346. * @static
  13347. * @memberOf _
  13348. * @since 4.0.0
  13349. * @category Lang
  13350. * @param {*} value The value to convert.
  13351. * @returns {number} Returns the converted integer.
  13352. * @example
  13353. *
  13354. * _.toLength(3.2);
  13355. * // => 3
  13356. *
  13357. * _.toLength(Number.MIN_VALUE);
  13358. * // => 0
  13359. *
  13360. * _.toLength(Infinity);
  13361. * // => 4294967295
  13362. *
  13363. * _.toLength('3.2');
  13364. * // => 3
  13365. */
  13366. function toLength(value) {
  13367. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  13368. }
  13369. /**
  13370. * Converts `value` to a number.
  13371. *
  13372. * @static
  13373. * @memberOf _
  13374. * @since 4.0.0
  13375. * @category Lang
  13376. * @param {*} value The value to process.
  13377. * @returns {number} Returns the number.
  13378. * @example
  13379. *
  13380. * _.toNumber(3.2);
  13381. * // => 3.2
  13382. *
  13383. * _.toNumber(Number.MIN_VALUE);
  13384. * // => 5e-324
  13385. *
  13386. * _.toNumber(Infinity);
  13387. * // => Infinity
  13388. *
  13389. * _.toNumber('3.2');
  13390. * // => 3.2
  13391. */
  13392. function toNumber(value) {
  13393. if (typeof value == 'number') {
  13394. return value;
  13395. }
  13396. if (isSymbol(value)) {
  13397. return NAN;
  13398. }
  13399. if (isObject(value)) {
  13400. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  13401. value = isObject(other) ? (other + '') : other;
  13402. }
  13403. if (typeof value != 'string') {
  13404. return value === 0 ? value : +value;
  13405. }
  13406. value = baseTrim(value);
  13407. var isBinary = reIsBinary.test(value);
  13408. return (isBinary || reIsOctal.test(value))
  13409. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  13410. : (reIsBadHex.test(value) ? NAN : +value);
  13411. }
  13412. /**
  13413. * Converts `value` to a plain object flattening inherited enumerable string
  13414. * keyed properties of `value` to own properties of the plain object.
  13415. *
  13416. * @static
  13417. * @memberOf _
  13418. * @since 3.0.0
  13419. * @category Lang
  13420. * @param {*} value The value to convert.
  13421. * @returns {Object} Returns the converted plain object.
  13422. * @example
  13423. *
  13424. * function Foo() {
  13425. * this.b = 2;
  13426. * }
  13427. *
  13428. * Foo.prototype.c = 3;
  13429. *
  13430. * _.assign({ 'a': 1 }, new Foo);
  13431. * // => { 'a': 1, 'b': 2 }
  13432. *
  13433. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  13434. * // => { 'a': 1, 'b': 2, 'c': 3 }
  13435. */
  13436. function toPlainObject(value) {
  13437. return copyObject(value, keysIn(value));
  13438. }
  13439. /**
  13440. * Converts `value` to a safe integer. A safe integer can be compared and
  13441. * represented correctly.
  13442. *
  13443. * @static
  13444. * @memberOf _
  13445. * @since 4.0.0
  13446. * @category Lang
  13447. * @param {*} value The value to convert.
  13448. * @returns {number} Returns the converted integer.
  13449. * @example
  13450. *
  13451. * _.toSafeInteger(3.2);
  13452. * // => 3
  13453. *
  13454. * _.toSafeInteger(Number.MIN_VALUE);
  13455. * // => 0
  13456. *
  13457. * _.toSafeInteger(Infinity);
  13458. * // => 9007199254740991
  13459. *
  13460. * _.toSafeInteger('3.2');
  13461. * // => 3
  13462. */
  13463. function toSafeInteger(value) {
  13464. return value
  13465. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13466. : (value === 0 ? value : 0);
  13467. }
  13468. /**
  13469. * Converts `value` to a string. An empty string is returned for `null`
  13470. * and `undefined` values. The sign of `-0` is preserved.
  13471. *
  13472. * @static
  13473. * @memberOf _
  13474. * @since 4.0.0
  13475. * @category Lang
  13476. * @param {*} value The value to convert.
  13477. * @returns {string} Returns the converted string.
  13478. * @example
  13479. *
  13480. * _.toString(null);
  13481. * // => ''
  13482. *
  13483. * _.toString(-0);
  13484. * // => '-0'
  13485. *
  13486. * _.toString([1, 2, 3]);
  13487. * // => '1,2,3'
  13488. */
  13489. function toString(value) {
  13490. return value == null ? '' : baseToString(value);
  13491. }
  13492. /*------------------------------------------------------------------------*/
  13493. /**
  13494. * Assigns own enumerable string keyed properties of source objects to the
  13495. * destination object. Source objects are applied from left to right.
  13496. * Subsequent sources overwrite property assignments of previous sources.
  13497. *
  13498. * **Note:** This method mutates `object` and is loosely based on
  13499. * [`Object.assign`](https://mdn.io/Object/assign).
  13500. *
  13501. * @static
  13502. * @memberOf _
  13503. * @since 0.10.0
  13504. * @category Object
  13505. * @param {Object} object The destination object.
  13506. * @param {...Object} [sources] The source objects.
  13507. * @returns {Object} Returns `object`.
  13508. * @see _.assignIn
  13509. * @example
  13510. *
  13511. * function Foo() {
  13512. * this.a = 1;
  13513. * }
  13514. *
  13515. * function Bar() {
  13516. * this.c = 3;
  13517. * }
  13518. *
  13519. * Foo.prototype.b = 2;
  13520. * Bar.prototype.d = 4;
  13521. *
  13522. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13523. * // => { 'a': 1, 'c': 3 }
  13524. */
  13525. var assign = createAssigner(function(object, source) {
  13526. if (isPrototype(source) || isArrayLike(source)) {
  13527. copyObject(source, keys(source), object);
  13528. return;
  13529. }
  13530. for (var key in source) {
  13531. if (hasOwnProperty.call(source, key)) {
  13532. assignValue(object, key, source[key]);
  13533. }
  13534. }
  13535. });
  13536. /**
  13537. * This method is like `_.assign` except that it iterates over own and
  13538. * inherited source properties.
  13539. *
  13540. * **Note:** This method mutates `object`.
  13541. *
  13542. * @static
  13543. * @memberOf _
  13544. * @since 4.0.0
  13545. * @alias extend
  13546. * @category Object
  13547. * @param {Object} object The destination object.
  13548. * @param {...Object} [sources] The source objects.
  13549. * @returns {Object} Returns `object`.
  13550. * @see _.assign
  13551. * @example
  13552. *
  13553. * function Foo() {
  13554. * this.a = 1;
  13555. * }
  13556. *
  13557. * function Bar() {
  13558. * this.c = 3;
  13559. * }
  13560. *
  13561. * Foo.prototype.b = 2;
  13562. * Bar.prototype.d = 4;
  13563. *
  13564. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13565. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13566. */
  13567. var assignIn = createAssigner(function(object, source) {
  13568. copyObject(source, keysIn(source), object);
  13569. });
  13570. /**
  13571. * This method is like `_.assignIn` except that it accepts `customizer`
  13572. * which is invoked to produce the assigned values. If `customizer` returns
  13573. * `undefined`, assignment is handled by the method instead. The `customizer`
  13574. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13575. *
  13576. * **Note:** This method mutates `object`.
  13577. *
  13578. * @static
  13579. * @memberOf _
  13580. * @since 4.0.0
  13581. * @alias extendWith
  13582. * @category Object
  13583. * @param {Object} object The destination object.
  13584. * @param {...Object} sources The source objects.
  13585. * @param {Function} [customizer] The function to customize assigned values.
  13586. * @returns {Object} Returns `object`.
  13587. * @see _.assignWith
  13588. * @example
  13589. *
  13590. * function customizer(objValue, srcValue) {
  13591. * return _.isUndefined(objValue) ? srcValue : objValue;
  13592. * }
  13593. *
  13594. * var defaults = _.partialRight(_.assignInWith, customizer);
  13595. *
  13596. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13597. * // => { 'a': 1, 'b': 2 }
  13598. */
  13599. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13600. copyObject(source, keysIn(source), object, customizer);
  13601. });
  13602. /**
  13603. * This method is like `_.assign` except that it accepts `customizer`
  13604. * which is invoked to produce the assigned values. If `customizer` returns
  13605. * `undefined`, assignment is handled by the method instead. The `customizer`
  13606. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13607. *
  13608. * **Note:** This method mutates `object`.
  13609. *
  13610. * @static
  13611. * @memberOf _
  13612. * @since 4.0.0
  13613. * @category Object
  13614. * @param {Object} object The destination object.
  13615. * @param {...Object} sources The source objects.
  13616. * @param {Function} [customizer] The function to customize assigned values.
  13617. * @returns {Object} Returns `object`.
  13618. * @see _.assignInWith
  13619. * @example
  13620. *
  13621. * function customizer(objValue, srcValue) {
  13622. * return _.isUndefined(objValue) ? srcValue : objValue;
  13623. * }
  13624. *
  13625. * var defaults = _.partialRight(_.assignWith, customizer);
  13626. *
  13627. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13628. * // => { 'a': 1, 'b': 2 }
  13629. */
  13630. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13631. copyObject(source, keys(source), object, customizer);
  13632. });
  13633. /**
  13634. * Creates an array of values corresponding to `paths` of `object`.
  13635. *
  13636. * @static
  13637. * @memberOf _
  13638. * @since 1.0.0
  13639. * @category Object
  13640. * @param {Object} object The object to iterate over.
  13641. * @param {...(string|string[])} [paths] The property paths to pick.
  13642. * @returns {Array} Returns the picked values.
  13643. * @example
  13644. *
  13645. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13646. *
  13647. * _.at(object, ['a[0].b.c', 'a[1]']);
  13648. * // => [3, 4]
  13649. */
  13650. var at = flatRest(baseAt);
  13651. /**
  13652. * Creates an object that inherits from the `prototype` object. If a
  13653. * `properties` object is given, its own enumerable string keyed properties
  13654. * are assigned to the created object.
  13655. *
  13656. * @static
  13657. * @memberOf _
  13658. * @since 2.3.0
  13659. * @category Object
  13660. * @param {Object} prototype The object to inherit from.
  13661. * @param {Object} [properties] The properties to assign to the object.
  13662. * @returns {Object} Returns the new object.
  13663. * @example
  13664. *
  13665. * function Shape() {
  13666. * this.x = 0;
  13667. * this.y = 0;
  13668. * }
  13669. *
  13670. * function Circle() {
  13671. * Shape.call(this);
  13672. * }
  13673. *
  13674. * Circle.prototype = _.create(Shape.prototype, {
  13675. * 'constructor': Circle
  13676. * });
  13677. *
  13678. * var circle = new Circle;
  13679. * circle instanceof Circle;
  13680. * // => true
  13681. *
  13682. * circle instanceof Shape;
  13683. * // => true
  13684. */
  13685. function create(prototype, properties) {
  13686. var result = baseCreate(prototype);
  13687. return properties == null ? result : baseAssign(result, properties);
  13688. }
  13689. /**
  13690. * Assigns own and inherited enumerable string keyed properties of source
  13691. * objects to the destination object for all destination properties that
  13692. * resolve to `undefined`. Source objects are applied from left to right.
  13693. * Once a property is set, additional values of the same property are ignored.
  13694. *
  13695. * **Note:** This method mutates `object`.
  13696. *
  13697. * @static
  13698. * @since 0.1.0
  13699. * @memberOf _
  13700. * @category Object
  13701. * @param {Object} object The destination object.
  13702. * @param {...Object} [sources] The source objects.
  13703. * @returns {Object} Returns `object`.
  13704. * @see _.defaultsDeep
  13705. * @example
  13706. *
  13707. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13708. * // => { 'a': 1, 'b': 2 }
  13709. */
  13710. var defaults = baseRest(function(object, sources) {
  13711. object = Object(object);
  13712. var index = -1;
  13713. var length = sources.length;
  13714. var guard = length > 2 ? sources[2] : undefined;
  13715. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13716. length = 1;
  13717. }
  13718. while (++index < length) {
  13719. var source = sources[index];
  13720. var props = keysIn(source);
  13721. var propsIndex = -1;
  13722. var propsLength = props.length;
  13723. while (++propsIndex < propsLength) {
  13724. var key = props[propsIndex];
  13725. var value = object[key];
  13726. if (value === undefined ||
  13727. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13728. object[key] = source[key];
  13729. }
  13730. }
  13731. }
  13732. return object;
  13733. });
  13734. /**
  13735. * This method is like `_.defaults` except that it recursively assigns
  13736. * default properties.
  13737. *
  13738. * **Note:** This method mutates `object`.
  13739. *
  13740. * @static
  13741. * @memberOf _
  13742. * @since 3.10.0
  13743. * @category Object
  13744. * @param {Object} object The destination object.
  13745. * @param {...Object} [sources] The source objects.
  13746. * @returns {Object} Returns `object`.
  13747. * @see _.defaults
  13748. * @example
  13749. *
  13750. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13751. * // => { 'a': { 'b': 2, 'c': 3 } }
  13752. */
  13753. var defaultsDeep = baseRest(function(args) {
  13754. args.push(undefined, customDefaultsMerge);
  13755. return apply(mergeWith, undefined, args);
  13756. });
  13757. /**
  13758. * This method is like `_.find` except that it returns the key of the first
  13759. * element `predicate` returns truthy for instead of the element itself.
  13760. *
  13761. * @static
  13762. * @memberOf _
  13763. * @since 1.1.0
  13764. * @category Object
  13765. * @param {Object} object The object to inspect.
  13766. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13767. * @returns {string|undefined} Returns the key of the matched element,
  13768. * else `undefined`.
  13769. * @example
  13770. *
  13771. * var users = {
  13772. * 'barney': { 'age': 36, 'active': true },
  13773. * 'fred': { 'age': 40, 'active': false },
  13774. * 'pebbles': { 'age': 1, 'active': true }
  13775. * };
  13776. *
  13777. * _.findKey(users, function(o) { return o.age < 40; });
  13778. * // => 'barney' (iteration order is not guaranteed)
  13779. *
  13780. * // The `_.matches` iteratee shorthand.
  13781. * _.findKey(users, { 'age': 1, 'active': true });
  13782. * // => 'pebbles'
  13783. *
  13784. * // The `_.matchesProperty` iteratee shorthand.
  13785. * _.findKey(users, ['active', false]);
  13786. * // => 'fred'
  13787. *
  13788. * // The `_.property` iteratee shorthand.
  13789. * _.findKey(users, 'active');
  13790. * // => 'barney'
  13791. */
  13792. function findKey(object, predicate) {
  13793. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13794. }
  13795. /**
  13796. * This method is like `_.findKey` except that it iterates over elements of
  13797. * a collection in the opposite order.
  13798. *
  13799. * @static
  13800. * @memberOf _
  13801. * @since 2.0.0
  13802. * @category Object
  13803. * @param {Object} object The object to inspect.
  13804. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13805. * @returns {string|undefined} Returns the key of the matched element,
  13806. * else `undefined`.
  13807. * @example
  13808. *
  13809. * var users = {
  13810. * 'barney': { 'age': 36, 'active': true },
  13811. * 'fred': { 'age': 40, 'active': false },
  13812. * 'pebbles': { 'age': 1, 'active': true }
  13813. * };
  13814. *
  13815. * _.findLastKey(users, function(o) { return o.age < 40; });
  13816. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13817. *
  13818. * // The `_.matches` iteratee shorthand.
  13819. * _.findLastKey(users, { 'age': 36, 'active': true });
  13820. * // => 'barney'
  13821. *
  13822. * // The `_.matchesProperty` iteratee shorthand.
  13823. * _.findLastKey(users, ['active', false]);
  13824. * // => 'fred'
  13825. *
  13826. * // The `_.property` iteratee shorthand.
  13827. * _.findLastKey(users, 'active');
  13828. * // => 'pebbles'
  13829. */
  13830. function findLastKey(object, predicate) {
  13831. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13832. }
  13833. /**
  13834. * Iterates over own and inherited enumerable string keyed properties of an
  13835. * object and invokes `iteratee` for each property. The iteratee is invoked
  13836. * with three arguments: (value, key, object). Iteratee functions may exit
  13837. * iteration early by explicitly returning `false`.
  13838. *
  13839. * @static
  13840. * @memberOf _
  13841. * @since 0.3.0
  13842. * @category Object
  13843. * @param {Object} object The object to iterate over.
  13844. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13845. * @returns {Object} Returns `object`.
  13846. * @see _.forInRight
  13847. * @example
  13848. *
  13849. * function Foo() {
  13850. * this.a = 1;
  13851. * this.b = 2;
  13852. * }
  13853. *
  13854. * Foo.prototype.c = 3;
  13855. *
  13856. * _.forIn(new Foo, function(value, key) {
  13857. * console.log(key);
  13858. * });
  13859. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13860. */
  13861. function forIn(object, iteratee) {
  13862. return object == null
  13863. ? object
  13864. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13865. }
  13866. /**
  13867. * This method is like `_.forIn` except that it iterates over properties of
  13868. * `object` in the opposite order.
  13869. *
  13870. * @static
  13871. * @memberOf _
  13872. * @since 2.0.0
  13873. * @category Object
  13874. * @param {Object} object The object to iterate over.
  13875. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13876. * @returns {Object} Returns `object`.
  13877. * @see _.forIn
  13878. * @example
  13879. *
  13880. * function Foo() {
  13881. * this.a = 1;
  13882. * this.b = 2;
  13883. * }
  13884. *
  13885. * Foo.prototype.c = 3;
  13886. *
  13887. * _.forInRight(new Foo, function(value, key) {
  13888. * console.log(key);
  13889. * });
  13890. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13891. */
  13892. function forInRight(object, iteratee) {
  13893. return object == null
  13894. ? object
  13895. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13896. }
  13897. /**
  13898. * Iterates over own enumerable string keyed properties of an object and
  13899. * invokes `iteratee` for each property. The iteratee is invoked with three
  13900. * arguments: (value, key, object). Iteratee functions may exit iteration
  13901. * early by explicitly returning `false`.
  13902. *
  13903. * @static
  13904. * @memberOf _
  13905. * @since 0.3.0
  13906. * @category Object
  13907. * @param {Object} object The object to iterate over.
  13908. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13909. * @returns {Object} Returns `object`.
  13910. * @see _.forOwnRight
  13911. * @example
  13912. *
  13913. * function Foo() {
  13914. * this.a = 1;
  13915. * this.b = 2;
  13916. * }
  13917. *
  13918. * Foo.prototype.c = 3;
  13919. *
  13920. * _.forOwn(new Foo, function(value, key) {
  13921. * console.log(key);
  13922. * });
  13923. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13924. */
  13925. function forOwn(object, iteratee) {
  13926. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13927. }
  13928. /**
  13929. * This method is like `_.forOwn` except that it iterates over properties of
  13930. * `object` in the opposite order.
  13931. *
  13932. * @static
  13933. * @memberOf _
  13934. * @since 2.0.0
  13935. * @category Object
  13936. * @param {Object} object The object to iterate over.
  13937. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13938. * @returns {Object} Returns `object`.
  13939. * @see _.forOwn
  13940. * @example
  13941. *
  13942. * function Foo() {
  13943. * this.a = 1;
  13944. * this.b = 2;
  13945. * }
  13946. *
  13947. * Foo.prototype.c = 3;
  13948. *
  13949. * _.forOwnRight(new Foo, function(value, key) {
  13950. * console.log(key);
  13951. * });
  13952. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13953. */
  13954. function forOwnRight(object, iteratee) {
  13955. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13956. }
  13957. /**
  13958. * Creates an array of function property names from own enumerable properties
  13959. * of `object`.
  13960. *
  13961. * @static
  13962. * @since 0.1.0
  13963. * @memberOf _
  13964. * @category Object
  13965. * @param {Object} object The object to inspect.
  13966. * @returns {Array} Returns the function names.
  13967. * @see _.functionsIn
  13968. * @example
  13969. *
  13970. * function Foo() {
  13971. * this.a = _.constant('a');
  13972. * this.b = _.constant('b');
  13973. * }
  13974. *
  13975. * Foo.prototype.c = _.constant('c');
  13976. *
  13977. * _.functions(new Foo);
  13978. * // => ['a', 'b']
  13979. */
  13980. function functions(object) {
  13981. return object == null ? [] : baseFunctions(object, keys(object));
  13982. }
  13983. /**
  13984. * Creates an array of function property names from own and inherited
  13985. * enumerable properties of `object`.
  13986. *
  13987. * @static
  13988. * @memberOf _
  13989. * @since 4.0.0
  13990. * @category Object
  13991. * @param {Object} object The object to inspect.
  13992. * @returns {Array} Returns the function names.
  13993. * @see _.functions
  13994. * @example
  13995. *
  13996. * function Foo() {
  13997. * this.a = _.constant('a');
  13998. * this.b = _.constant('b');
  13999. * }
  14000. *
  14001. * Foo.prototype.c = _.constant('c');
  14002. *
  14003. * _.functionsIn(new Foo);
  14004. * // => ['a', 'b', 'c']
  14005. */
  14006. function functionsIn(object) {
  14007. return object == null ? [] : baseFunctions(object, keysIn(object));
  14008. }
  14009. /**
  14010. * Gets the value at `path` of `object`. If the resolved value is
  14011. * `undefined`, the `defaultValue` is returned in its place.
  14012. *
  14013. * @static
  14014. * @memberOf _
  14015. * @since 3.7.0
  14016. * @category Object
  14017. * @param {Object} object The object to query.
  14018. * @param {Array|string} path The path of the property to get.
  14019. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14020. * @returns {*} Returns the resolved value.
  14021. * @example
  14022. *
  14023. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14024. *
  14025. * _.get(object, 'a[0].b.c');
  14026. * // => 3
  14027. *
  14028. * _.get(object, ['a', '0', 'b', 'c']);
  14029. * // => 3
  14030. *
  14031. * _.get(object, 'a.b.c', 'default');
  14032. * // => 'default'
  14033. */
  14034. function get(object, path, defaultValue) {
  14035. var result = object == null ? undefined : baseGet(object, path);
  14036. return result === undefined ? defaultValue : result;
  14037. }
  14038. /**
  14039. * Checks if `path` is a direct property of `object`.
  14040. *
  14041. * @static
  14042. * @since 0.1.0
  14043. * @memberOf _
  14044. * @category Object
  14045. * @param {Object} object The object to query.
  14046. * @param {Array|string} path The path to check.
  14047. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  14048. * @example
  14049. *
  14050. * var object = { 'a': { 'b': 2 } };
  14051. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  14052. *
  14053. * _.has(object, 'a');
  14054. * // => true
  14055. *
  14056. * _.has(object, 'a.b');
  14057. * // => true
  14058. *
  14059. * _.has(object, ['a', 'b']);
  14060. * // => true
  14061. *
  14062. * _.has(other, 'a');
  14063. * // => false
  14064. */
  14065. function has(object, path) {
  14066. return object != null && hasPath(object, path, baseHas);
  14067. }
  14068. /**
  14069. * Checks if `path` is a direct or inherited property of `object`.
  14070. *
  14071. * @static
  14072. * @memberOf _
  14073. * @since 4.0.0
  14074. * @category Object
  14075. * @param {Object} object The object to query.
  14076. * @param {Array|string} path The path to check.
  14077. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  14078. * @example
  14079. *
  14080. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  14081. *
  14082. * _.hasIn(object, 'a');
  14083. * // => true
  14084. *
  14085. * _.hasIn(object, 'a.b');
  14086. * // => true
  14087. *
  14088. * _.hasIn(object, ['a', 'b']);
  14089. * // => true
  14090. *
  14091. * _.hasIn(object, 'b');
  14092. * // => false
  14093. */
  14094. function hasIn(object, path) {
  14095. return object != null && hasPath(object, path, baseHasIn);
  14096. }
  14097. /**
  14098. * Creates an object composed of the inverted keys and values of `object`.
  14099. * If `object` contains duplicate values, subsequent values overwrite
  14100. * property assignments of previous values.
  14101. *
  14102. * @static
  14103. * @memberOf _
  14104. * @since 0.7.0
  14105. * @category Object
  14106. * @param {Object} object The object to invert.
  14107. * @returns {Object} Returns the new inverted object.
  14108. * @example
  14109. *
  14110. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  14111. *
  14112. * _.invert(object);
  14113. * // => { '1': 'c', '2': 'b' }
  14114. */
  14115. var invert = createInverter(function(result, value, key) {
  14116. if (value != null &&
  14117. typeof value.toString != 'function') {
  14118. value = nativeObjectToString.call(value);
  14119. }
  14120. result[value] = key;
  14121. }, constant(identity));
  14122. /**
  14123. * This method is like `_.invert` except that the inverted object is generated
  14124. * from the results of running each element of `object` thru `iteratee`. The
  14125. * corresponding inverted value of each inverted key is an array of keys
  14126. * responsible for generating the inverted value. The iteratee is invoked
  14127. * with one argument: (value).
  14128. *
  14129. * @static
  14130. * @memberOf _
  14131. * @since 4.1.0
  14132. * @category Object
  14133. * @param {Object} object The object to invert.
  14134. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  14135. * @returns {Object} Returns the new inverted object.
  14136. * @example
  14137. *
  14138. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  14139. *
  14140. * _.invertBy(object);
  14141. * // => { '1': ['a', 'c'], '2': ['b'] }
  14142. *
  14143. * _.invertBy(object, function(value) {
  14144. * return 'group' + value;
  14145. * });
  14146. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  14147. */
  14148. var invertBy = createInverter(function(result, value, key) {
  14149. if (value != null &&
  14150. typeof value.toString != 'function') {
  14151. value = nativeObjectToString.call(value);
  14152. }
  14153. if (hasOwnProperty.call(result, value)) {
  14154. result[value].push(key);
  14155. } else {
  14156. result[value] = [key];
  14157. }
  14158. }, getIteratee);
  14159. /**
  14160. * Invokes the method at `path` of `object`.
  14161. *
  14162. * @static
  14163. * @memberOf _
  14164. * @since 4.0.0
  14165. * @category Object
  14166. * @param {Object} object The object to query.
  14167. * @param {Array|string} path The path of the method to invoke.
  14168. * @param {...*} [args] The arguments to invoke the method with.
  14169. * @returns {*} Returns the result of the invoked method.
  14170. * @example
  14171. *
  14172. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  14173. *
  14174. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  14175. * // => [2, 3]
  14176. */
  14177. var invoke = baseRest(baseInvoke);
  14178. /**
  14179. * Creates an array of the own enumerable property names of `object`.
  14180. *
  14181. * **Note:** Non-object values are coerced to objects. See the
  14182. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  14183. * for more details.
  14184. *
  14185. * @static
  14186. * @since 0.1.0
  14187. * @memberOf _
  14188. * @category Object
  14189. * @param {Object} object The object to query.
  14190. * @returns {Array} Returns the array of property names.
  14191. * @example
  14192. *
  14193. * function Foo() {
  14194. * this.a = 1;
  14195. * this.b = 2;
  14196. * }
  14197. *
  14198. * Foo.prototype.c = 3;
  14199. *
  14200. * _.keys(new Foo);
  14201. * // => ['a', 'b'] (iteration order is not guaranteed)
  14202. *
  14203. * _.keys('hi');
  14204. * // => ['0', '1']
  14205. */
  14206. function keys(object) {
  14207. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  14208. }
  14209. /**
  14210. * Creates an array of the own and inherited enumerable property names of `object`.
  14211. *
  14212. * **Note:** Non-object values are coerced to objects.
  14213. *
  14214. * @static
  14215. * @memberOf _
  14216. * @since 3.0.0
  14217. * @category Object
  14218. * @param {Object} object The object to query.
  14219. * @returns {Array} Returns the array of property names.
  14220. * @example
  14221. *
  14222. * function Foo() {
  14223. * this.a = 1;
  14224. * this.b = 2;
  14225. * }
  14226. *
  14227. * Foo.prototype.c = 3;
  14228. *
  14229. * _.keysIn(new Foo);
  14230. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  14231. */
  14232. function keysIn(object) {
  14233. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  14234. }
  14235. /**
  14236. * The opposite of `_.mapValues`; this method creates an object with the
  14237. * same values as `object` and keys generated by running each own enumerable
  14238. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  14239. * with three arguments: (value, key, object).
  14240. *
  14241. * @static
  14242. * @memberOf _
  14243. * @since 3.8.0
  14244. * @category Object
  14245. * @param {Object} object The object to iterate over.
  14246. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14247. * @returns {Object} Returns the new mapped object.
  14248. * @see _.mapValues
  14249. * @example
  14250. *
  14251. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  14252. * return key + value;
  14253. * });
  14254. * // => { 'a1': 1, 'b2': 2 }
  14255. */
  14256. function mapKeys(object, iteratee) {
  14257. var result = {};
  14258. iteratee = getIteratee(iteratee, 3);
  14259. baseForOwn(object, function(value, key, object) {
  14260. baseAssignValue(result, iteratee(value, key, object), value);
  14261. });
  14262. return result;
  14263. }
  14264. /**
  14265. * Creates an object with the same keys as `object` and values generated
  14266. * by running each own enumerable string keyed property of `object` thru
  14267. * `iteratee`. The iteratee is invoked with three arguments:
  14268. * (value, key, object).
  14269. *
  14270. * @static
  14271. * @memberOf _
  14272. * @since 2.4.0
  14273. * @category Object
  14274. * @param {Object} object The object to iterate over.
  14275. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14276. * @returns {Object} Returns the new mapped object.
  14277. * @see _.mapKeys
  14278. * @example
  14279. *
  14280. * var users = {
  14281. * 'fred': { 'user': 'fred', 'age': 40 },
  14282. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  14283. * };
  14284. *
  14285. * _.mapValues(users, function(o) { return o.age; });
  14286. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  14287. *
  14288. * // The `_.property` iteratee shorthand.
  14289. * _.mapValues(users, 'age');
  14290. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  14291. */
  14292. function mapValues(object, iteratee) {
  14293. var result = {};
  14294. iteratee = getIteratee(iteratee, 3);
  14295. baseForOwn(object, function(value, key, object) {
  14296. baseAssignValue(result, key, iteratee(value, key, object));
  14297. });
  14298. return result;
  14299. }
  14300. /**
  14301. * This method is like `_.assign` except that it recursively merges own and
  14302. * inherited enumerable string keyed properties of source objects into the
  14303. * destination object. Source properties that resolve to `undefined` are
  14304. * skipped if a destination value exists. Array and plain object properties
  14305. * are merged recursively. Other objects and value types are overridden by
  14306. * assignment. Source objects are applied from left to right. Subsequent
  14307. * sources overwrite property assignments of previous sources.
  14308. *
  14309. * **Note:** This method mutates `object`.
  14310. *
  14311. * @static
  14312. * @memberOf _
  14313. * @since 0.5.0
  14314. * @category Object
  14315. * @param {Object} object The destination object.
  14316. * @param {...Object} [sources] The source objects.
  14317. * @returns {Object} Returns `object`.
  14318. * @example
  14319. *
  14320. * var object = {
  14321. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  14322. * };
  14323. *
  14324. * var other = {
  14325. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  14326. * };
  14327. *
  14328. * _.merge(object, other);
  14329. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  14330. */
  14331. var merge = createAssigner(function(object, source, srcIndex) {
  14332. baseMerge(object, source, srcIndex);
  14333. });
  14334. /**
  14335. * This method is like `_.merge` except that it accepts `customizer` which
  14336. * is invoked to produce the merged values of the destination and source
  14337. * properties. If `customizer` returns `undefined`, merging is handled by the
  14338. * method instead. The `customizer` is invoked with six arguments:
  14339. * (objValue, srcValue, key, object, source, stack).
  14340. *
  14341. * **Note:** This method mutates `object`.
  14342. *
  14343. * @static
  14344. * @memberOf _
  14345. * @since 4.0.0
  14346. * @category Object
  14347. * @param {Object} object The destination object.
  14348. * @param {...Object} sources The source objects.
  14349. * @param {Function} customizer The function to customize assigned values.
  14350. * @returns {Object} Returns `object`.
  14351. * @example
  14352. *
  14353. * function customizer(objValue, srcValue) {
  14354. * if (_.isArray(objValue)) {
  14355. * return objValue.concat(srcValue);
  14356. * }
  14357. * }
  14358. *
  14359. * var object = { 'a': [1], 'b': [2] };
  14360. * var other = { 'a': [3], 'b': [4] };
  14361. *
  14362. * _.mergeWith(object, other, customizer);
  14363. * // => { 'a': [1, 3], 'b': [2, 4] }
  14364. */
  14365. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  14366. baseMerge(object, source, srcIndex, customizer);
  14367. });
  14368. /**
  14369. * The opposite of `_.pick`; this method creates an object composed of the
  14370. * own and inherited enumerable property paths of `object` that are not omitted.
  14371. *
  14372. * **Note:** This method is considerably slower than `_.pick`.
  14373. *
  14374. * @static
  14375. * @since 0.1.0
  14376. * @memberOf _
  14377. * @category Object
  14378. * @param {Object} object The source object.
  14379. * @param {...(string|string[])} [paths] The property paths to omit.
  14380. * @returns {Object} Returns the new object.
  14381. * @example
  14382. *
  14383. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14384. *
  14385. * _.omit(object, ['a', 'c']);
  14386. * // => { 'b': '2' }
  14387. */
  14388. var omit = flatRest(function(object, paths) {
  14389. var result = {};
  14390. if (object == null) {
  14391. return result;
  14392. }
  14393. var isDeep = false;
  14394. paths = arrayMap(paths, function(path) {
  14395. path = castPath(path, object);
  14396. isDeep || (isDeep = path.length > 1);
  14397. return path;
  14398. });
  14399. copyObject(object, getAllKeysIn(object), result);
  14400. if (isDeep) {
  14401. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  14402. }
  14403. var length = paths.length;
  14404. while (length--) {
  14405. baseUnset(result, paths[length]);
  14406. }
  14407. return result;
  14408. });
  14409. /**
  14410. * The opposite of `_.pickBy`; this method creates an object composed of
  14411. * the own and inherited enumerable string keyed properties of `object` that
  14412. * `predicate` doesn't return truthy for. The predicate is invoked with two
  14413. * arguments: (value, key).
  14414. *
  14415. * @static
  14416. * @memberOf _
  14417. * @since 4.0.0
  14418. * @category Object
  14419. * @param {Object} object The source object.
  14420. * @param {Function} [predicate=_.identity] The function invoked per property.
  14421. * @returns {Object} Returns the new object.
  14422. * @example
  14423. *
  14424. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14425. *
  14426. * _.omitBy(object, _.isNumber);
  14427. * // => { 'b': '2' }
  14428. */
  14429. function omitBy(object, predicate) {
  14430. return pickBy(object, negate(getIteratee(predicate)));
  14431. }
  14432. /**
  14433. * Creates an object composed of the picked `object` properties.
  14434. *
  14435. * @static
  14436. * @since 0.1.0
  14437. * @memberOf _
  14438. * @category Object
  14439. * @param {Object} object The source object.
  14440. * @param {...(string|string[])} [paths] The property paths to pick.
  14441. * @returns {Object} Returns the new object.
  14442. * @example
  14443. *
  14444. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14445. *
  14446. * _.pick(object, ['a', 'c']);
  14447. * // => { 'a': 1, 'c': 3 }
  14448. */
  14449. var pick = flatRest(function(object, paths) {
  14450. return object == null ? {} : basePick(object, paths);
  14451. });
  14452. /**
  14453. * Creates an object composed of the `object` properties `predicate` returns
  14454. * truthy for. The predicate is invoked with two arguments: (value, key).
  14455. *
  14456. * @static
  14457. * @memberOf _
  14458. * @since 4.0.0
  14459. * @category Object
  14460. * @param {Object} object The source object.
  14461. * @param {Function} [predicate=_.identity] The function invoked per property.
  14462. * @returns {Object} Returns the new object.
  14463. * @example
  14464. *
  14465. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14466. *
  14467. * _.pickBy(object, _.isNumber);
  14468. * // => { 'a': 1, 'c': 3 }
  14469. */
  14470. function pickBy(object, predicate) {
  14471. if (object == null) {
  14472. return {};
  14473. }
  14474. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14475. return [prop];
  14476. });
  14477. predicate = getIteratee(predicate);
  14478. return basePickBy(object, props, function(value, path) {
  14479. return predicate(value, path[0]);
  14480. });
  14481. }
  14482. /**
  14483. * This method is like `_.get` except that if the resolved value is a
  14484. * function it's invoked with the `this` binding of its parent object and
  14485. * its result is returned.
  14486. *
  14487. * @static
  14488. * @since 0.1.0
  14489. * @memberOf _
  14490. * @category Object
  14491. * @param {Object} object The object to query.
  14492. * @param {Array|string} path The path of the property to resolve.
  14493. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14494. * @returns {*} Returns the resolved value.
  14495. * @example
  14496. *
  14497. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14498. *
  14499. * _.result(object, 'a[0].b.c1');
  14500. * // => 3
  14501. *
  14502. * _.result(object, 'a[0].b.c2');
  14503. * // => 4
  14504. *
  14505. * _.result(object, 'a[0].b.c3', 'default');
  14506. * // => 'default'
  14507. *
  14508. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14509. * // => 'default'
  14510. */
  14511. function result(object, path, defaultValue) {
  14512. path = castPath(path, object);
  14513. var index = -1,
  14514. length = path.length;
  14515. // Ensure the loop is entered when path is empty.
  14516. if (!length) {
  14517. length = 1;
  14518. object = undefined;
  14519. }
  14520. while (++index < length) {
  14521. var value = object == null ? undefined : object[toKey(path[index])];
  14522. if (value === undefined) {
  14523. index = length;
  14524. value = defaultValue;
  14525. }
  14526. object = isFunction(value) ? value.call(object) : value;
  14527. }
  14528. return object;
  14529. }
  14530. /**
  14531. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14532. * it's created. Arrays are created for missing index properties while objects
  14533. * are created for all other missing properties. Use `_.setWith` to customize
  14534. * `path` creation.
  14535. *
  14536. * **Note:** This method mutates `object`.
  14537. *
  14538. * @static
  14539. * @memberOf _
  14540. * @since 3.7.0
  14541. * @category Object
  14542. * @param {Object} object The object to modify.
  14543. * @param {Array|string} path The path of the property to set.
  14544. * @param {*} value The value to set.
  14545. * @returns {Object} Returns `object`.
  14546. * @example
  14547. *
  14548. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14549. *
  14550. * _.set(object, 'a[0].b.c', 4);
  14551. * console.log(object.a[0].b.c);
  14552. * // => 4
  14553. *
  14554. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14555. * console.log(object.x[0].y.z);
  14556. * // => 5
  14557. */
  14558. function set(object, path, value) {
  14559. return object == null ? object : baseSet(object, path, value);
  14560. }
  14561. /**
  14562. * This method is like `_.set` except that it accepts `customizer` which is
  14563. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14564. * path creation is handled by the method instead. The `customizer` is invoked
  14565. * with three arguments: (nsValue, key, nsObject).
  14566. *
  14567. * **Note:** This method mutates `object`.
  14568. *
  14569. * @static
  14570. * @memberOf _
  14571. * @since 4.0.0
  14572. * @category Object
  14573. * @param {Object} object The object to modify.
  14574. * @param {Array|string} path The path of the property to set.
  14575. * @param {*} value The value to set.
  14576. * @param {Function} [customizer] The function to customize assigned values.
  14577. * @returns {Object} Returns `object`.
  14578. * @example
  14579. *
  14580. * var object = {};
  14581. *
  14582. * _.setWith(object, '[0][1]', 'a', Object);
  14583. * // => { '0': { '1': 'a' } }
  14584. */
  14585. function setWith(object, path, value, customizer) {
  14586. customizer = typeof customizer == 'function' ? customizer : undefined;
  14587. return object == null ? object : baseSet(object, path, value, customizer);
  14588. }
  14589. /**
  14590. * Creates an array of own enumerable string keyed-value pairs for `object`
  14591. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14592. * entries are returned.
  14593. *
  14594. * @static
  14595. * @memberOf _
  14596. * @since 4.0.0
  14597. * @alias entries
  14598. * @category Object
  14599. * @param {Object} object The object to query.
  14600. * @returns {Array} Returns the key-value pairs.
  14601. * @example
  14602. *
  14603. * function Foo() {
  14604. * this.a = 1;
  14605. * this.b = 2;
  14606. * }
  14607. *
  14608. * Foo.prototype.c = 3;
  14609. *
  14610. * _.toPairs(new Foo);
  14611. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14612. */
  14613. var toPairs = createToPairs(keys);
  14614. /**
  14615. * Creates an array of own and inherited enumerable string keyed-value pairs
  14616. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14617. * or set, its entries are returned.
  14618. *
  14619. * @static
  14620. * @memberOf _
  14621. * @since 4.0.0
  14622. * @alias entriesIn
  14623. * @category Object
  14624. * @param {Object} object The object to query.
  14625. * @returns {Array} Returns the key-value pairs.
  14626. * @example
  14627. *
  14628. * function Foo() {
  14629. * this.a = 1;
  14630. * this.b = 2;
  14631. * }
  14632. *
  14633. * Foo.prototype.c = 3;
  14634. *
  14635. * _.toPairsIn(new Foo);
  14636. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14637. */
  14638. var toPairsIn = createToPairs(keysIn);
  14639. /**
  14640. * An alternative to `_.reduce`; this method transforms `object` to a new
  14641. * `accumulator` object which is the result of running each of its own
  14642. * enumerable string keyed properties thru `iteratee`, with each invocation
  14643. * potentially mutating the `accumulator` object. If `accumulator` is not
  14644. * provided, a new object with the same `[[Prototype]]` will be used. The
  14645. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14646. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14647. *
  14648. * @static
  14649. * @memberOf _
  14650. * @since 1.3.0
  14651. * @category Object
  14652. * @param {Object} object The object to iterate over.
  14653. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14654. * @param {*} [accumulator] The custom accumulator value.
  14655. * @returns {*} Returns the accumulated value.
  14656. * @example
  14657. *
  14658. * _.transform([2, 3, 4], function(result, n) {
  14659. * result.push(n *= n);
  14660. * return n % 2 == 0;
  14661. * }, []);
  14662. * // => [4, 9]
  14663. *
  14664. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14665. * (result[value] || (result[value] = [])).push(key);
  14666. * }, {});
  14667. * // => { '1': ['a', 'c'], '2': ['b'] }
  14668. */
  14669. function transform(object, iteratee, accumulator) {
  14670. var isArr = isArray(object),
  14671. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14672. iteratee = getIteratee(iteratee, 4);
  14673. if (accumulator == null) {
  14674. var Ctor = object && object.constructor;
  14675. if (isArrLike) {
  14676. accumulator = isArr ? new Ctor : [];
  14677. }
  14678. else if (isObject(object)) {
  14679. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14680. }
  14681. else {
  14682. accumulator = {};
  14683. }
  14684. }
  14685. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14686. return iteratee(accumulator, value, index, object);
  14687. });
  14688. return accumulator;
  14689. }
  14690. /**
  14691. * Removes the property at `path` of `object`.
  14692. *
  14693. * **Note:** This method mutates `object`.
  14694. *
  14695. * @static
  14696. * @memberOf _
  14697. * @since 4.0.0
  14698. * @category Object
  14699. * @param {Object} object The object to modify.
  14700. * @param {Array|string} path The path of the property to unset.
  14701. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14702. * @example
  14703. *
  14704. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14705. * _.unset(object, 'a[0].b.c');
  14706. * // => true
  14707. *
  14708. * console.log(object);
  14709. * // => { 'a': [{ 'b': {} }] };
  14710. *
  14711. * _.unset(object, ['a', '0', 'b', 'c']);
  14712. * // => true
  14713. *
  14714. * console.log(object);
  14715. * // => { 'a': [{ 'b': {} }] };
  14716. */
  14717. function unset(object, path) {
  14718. return object == null ? true : baseUnset(object, path);
  14719. }
  14720. /**
  14721. * This method is like `_.set` except that accepts `updater` to produce the
  14722. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14723. * is invoked with one argument: (value).
  14724. *
  14725. * **Note:** This method mutates `object`.
  14726. *
  14727. * @static
  14728. * @memberOf _
  14729. * @since 4.6.0
  14730. * @category Object
  14731. * @param {Object} object The object to modify.
  14732. * @param {Array|string} path The path of the property to set.
  14733. * @param {Function} updater The function to produce the updated value.
  14734. * @returns {Object} Returns `object`.
  14735. * @example
  14736. *
  14737. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14738. *
  14739. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14740. * console.log(object.a[0].b.c);
  14741. * // => 9
  14742. *
  14743. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14744. * console.log(object.x[0].y.z);
  14745. * // => 0
  14746. */
  14747. function update(object, path, updater) {
  14748. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14749. }
  14750. /**
  14751. * This method is like `_.update` except that it accepts `customizer` which is
  14752. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14753. * path creation is handled by the method instead. The `customizer` is invoked
  14754. * with three arguments: (nsValue, key, nsObject).
  14755. *
  14756. * **Note:** This method mutates `object`.
  14757. *
  14758. * @static
  14759. * @memberOf _
  14760. * @since 4.6.0
  14761. * @category Object
  14762. * @param {Object} object The object to modify.
  14763. * @param {Array|string} path The path of the property to set.
  14764. * @param {Function} updater The function to produce the updated value.
  14765. * @param {Function} [customizer] The function to customize assigned values.
  14766. * @returns {Object} Returns `object`.
  14767. * @example
  14768. *
  14769. * var object = {};
  14770. *
  14771. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14772. * // => { '0': { '1': 'a' } }
  14773. */
  14774. function updateWith(object, path, updater, customizer) {
  14775. customizer = typeof customizer == 'function' ? customizer : undefined;
  14776. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14777. }
  14778. /**
  14779. * Creates an array of the own enumerable string keyed property values of `object`.
  14780. *
  14781. * **Note:** Non-object values are coerced to objects.
  14782. *
  14783. * @static
  14784. * @since 0.1.0
  14785. * @memberOf _
  14786. * @category Object
  14787. * @param {Object} object The object to query.
  14788. * @returns {Array} Returns the array of property values.
  14789. * @example
  14790. *
  14791. * function Foo() {
  14792. * this.a = 1;
  14793. * this.b = 2;
  14794. * }
  14795. *
  14796. * Foo.prototype.c = 3;
  14797. *
  14798. * _.values(new Foo);
  14799. * // => [1, 2] (iteration order is not guaranteed)
  14800. *
  14801. * _.values('hi');
  14802. * // => ['h', 'i']
  14803. */
  14804. function values(object) {
  14805. return object == null ? [] : baseValues(object, keys(object));
  14806. }
  14807. /**
  14808. * Creates an array of the own and inherited enumerable string keyed property
  14809. * values of `object`.
  14810. *
  14811. * **Note:** Non-object values are coerced to objects.
  14812. *
  14813. * @static
  14814. * @memberOf _
  14815. * @since 3.0.0
  14816. * @category Object
  14817. * @param {Object} object The object to query.
  14818. * @returns {Array} Returns the array of property values.
  14819. * @example
  14820. *
  14821. * function Foo() {
  14822. * this.a = 1;
  14823. * this.b = 2;
  14824. * }
  14825. *
  14826. * Foo.prototype.c = 3;
  14827. *
  14828. * _.valuesIn(new Foo);
  14829. * // => [1, 2, 3] (iteration order is not guaranteed)
  14830. */
  14831. function valuesIn(object) {
  14832. return object == null ? [] : baseValues(object, keysIn(object));
  14833. }
  14834. /*------------------------------------------------------------------------*/
  14835. /**
  14836. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14837. *
  14838. * @static
  14839. * @memberOf _
  14840. * @since 4.0.0
  14841. * @category Number
  14842. * @param {number} number The number to clamp.
  14843. * @param {number} [lower] The lower bound.
  14844. * @param {number} upper The upper bound.
  14845. * @returns {number} Returns the clamped number.
  14846. * @example
  14847. *
  14848. * _.clamp(-10, -5, 5);
  14849. * // => -5
  14850. *
  14851. * _.clamp(10, -5, 5);
  14852. * // => 5
  14853. */
  14854. function clamp(number, lower, upper) {
  14855. if (upper === undefined) {
  14856. upper = lower;
  14857. lower = undefined;
  14858. }
  14859. if (upper !== undefined) {
  14860. upper = toNumber(upper);
  14861. upper = upper === upper ? upper : 0;
  14862. }
  14863. if (lower !== undefined) {
  14864. lower = toNumber(lower);
  14865. lower = lower === lower ? lower : 0;
  14866. }
  14867. return baseClamp(toNumber(number), lower, upper);
  14868. }
  14869. /**
  14870. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14871. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14872. * If `start` is greater than `end` the params are swapped to support
  14873. * negative ranges.
  14874. *
  14875. * @static
  14876. * @memberOf _
  14877. * @since 3.3.0
  14878. * @category Number
  14879. * @param {number} number The number to check.
  14880. * @param {number} [start=0] The start of the range.
  14881. * @param {number} end The end of the range.
  14882. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14883. * @see _.range, _.rangeRight
  14884. * @example
  14885. *
  14886. * _.inRange(3, 2, 4);
  14887. * // => true
  14888. *
  14889. * _.inRange(4, 8);
  14890. * // => true
  14891. *
  14892. * _.inRange(4, 2);
  14893. * // => false
  14894. *
  14895. * _.inRange(2, 2);
  14896. * // => false
  14897. *
  14898. * _.inRange(1.2, 2);
  14899. * // => true
  14900. *
  14901. * _.inRange(5.2, 4);
  14902. * // => false
  14903. *
  14904. * _.inRange(-3, -2, -6);
  14905. * // => true
  14906. */
  14907. function inRange(number, start, end) {
  14908. start = toFinite(start);
  14909. if (end === undefined) {
  14910. end = start;
  14911. start = 0;
  14912. } else {
  14913. end = toFinite(end);
  14914. }
  14915. number = toNumber(number);
  14916. return baseInRange(number, start, end);
  14917. }
  14918. /**
  14919. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14920. * If only one argument is provided a number between `0` and the given number
  14921. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14922. * floats, a floating-point number is returned instead of an integer.
  14923. *
  14924. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14925. * floating-point values which can produce unexpected results.
  14926. *
  14927. * @static
  14928. * @memberOf _
  14929. * @since 0.7.0
  14930. * @category Number
  14931. * @param {number} [lower=0] The lower bound.
  14932. * @param {number} [upper=1] The upper bound.
  14933. * @param {boolean} [floating] Specify returning a floating-point number.
  14934. * @returns {number} Returns the random number.
  14935. * @example
  14936. *
  14937. * _.random(0, 5);
  14938. * // => an integer between 0 and 5
  14939. *
  14940. * _.random(5);
  14941. * // => also an integer between 0 and 5
  14942. *
  14943. * _.random(5, true);
  14944. * // => a floating-point number between 0 and 5
  14945. *
  14946. * _.random(1.2, 5.2);
  14947. * // => a floating-point number between 1.2 and 5.2
  14948. */
  14949. function random(lower, upper, floating) {
  14950. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14951. upper = floating = undefined;
  14952. }
  14953. if (floating === undefined) {
  14954. if (typeof upper == 'boolean') {
  14955. floating = upper;
  14956. upper = undefined;
  14957. }
  14958. else if (typeof lower == 'boolean') {
  14959. floating = lower;
  14960. lower = undefined;
  14961. }
  14962. }
  14963. if (lower === undefined && upper === undefined) {
  14964. lower = 0;
  14965. upper = 1;
  14966. }
  14967. else {
  14968. lower = toFinite(lower);
  14969. if (upper === undefined) {
  14970. upper = lower;
  14971. lower = 0;
  14972. } else {
  14973. upper = toFinite(upper);
  14974. }
  14975. }
  14976. if (lower > upper) {
  14977. var temp = lower;
  14978. lower = upper;
  14979. upper = temp;
  14980. }
  14981. if (floating || lower % 1 || upper % 1) {
  14982. var rand = nativeRandom();
  14983. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14984. }
  14985. return baseRandom(lower, upper);
  14986. }
  14987. /*------------------------------------------------------------------------*/
  14988. /**
  14989. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14990. *
  14991. * @static
  14992. * @memberOf _
  14993. * @since 3.0.0
  14994. * @category String
  14995. * @param {string} [string=''] The string to convert.
  14996. * @returns {string} Returns the camel cased string.
  14997. * @example
  14998. *
  14999. * _.camelCase('Foo Bar');
  15000. * // => 'fooBar'
  15001. *
  15002. * _.camelCase('--foo-bar--');
  15003. * // => 'fooBar'
  15004. *
  15005. * _.camelCase('__FOO_BAR__');
  15006. * // => 'fooBar'
  15007. */
  15008. var camelCase = createCompounder(function(result, word, index) {
  15009. word = word.toLowerCase();
  15010. return result + (index ? capitalize(word) : word);
  15011. });
  15012. /**
  15013. * Converts the first character of `string` to upper case and the remaining
  15014. * to lower case.
  15015. *
  15016. * @static
  15017. * @memberOf _
  15018. * @since 3.0.0
  15019. * @category String
  15020. * @param {string} [string=''] The string to capitalize.
  15021. * @returns {string} Returns the capitalized string.
  15022. * @example
  15023. *
  15024. * _.capitalize('FRED');
  15025. * // => 'Fred'
  15026. */
  15027. function capitalize(string) {
  15028. return upperFirst(toString(string).toLowerCase());
  15029. }
  15030. /**
  15031. * Deburrs `string` by converting
  15032. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  15033. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  15034. * letters to basic Latin letters and removing
  15035. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  15036. *
  15037. * @static
  15038. * @memberOf _
  15039. * @since 3.0.0
  15040. * @category String
  15041. * @param {string} [string=''] The string to deburr.
  15042. * @returns {string} Returns the deburred string.
  15043. * @example
  15044. *
  15045. * _.deburr('déjà vu');
  15046. * // => 'deja vu'
  15047. */
  15048. function deburr(string) {
  15049. string = toString(string);
  15050. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  15051. }
  15052. /**
  15053. * Checks if `string` ends with the given target string.
  15054. *
  15055. * @static
  15056. * @memberOf _
  15057. * @since 3.0.0
  15058. * @category String
  15059. * @param {string} [string=''] The string to inspect.
  15060. * @param {string} [target] The string to search for.
  15061. * @param {number} [position=string.length] The position to search up to.
  15062. * @returns {boolean} Returns `true` if `string` ends with `target`,
  15063. * else `false`.
  15064. * @example
  15065. *
  15066. * _.endsWith('abc', 'c');
  15067. * // => true
  15068. *
  15069. * _.endsWith('abc', 'b');
  15070. * // => false
  15071. *
  15072. * _.endsWith('abc', 'b', 2);
  15073. * // => true
  15074. */
  15075. function endsWith(string, target, position) {
  15076. string = toString(string);
  15077. target = baseToString(target);
  15078. var length = string.length;
  15079. position = position === undefined
  15080. ? length
  15081. : baseClamp(toInteger(position), 0, length);
  15082. var end = position;
  15083. position -= target.length;
  15084. return position >= 0 && string.slice(position, end) == target;
  15085. }
  15086. /**
  15087. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  15088. * corresponding HTML entities.
  15089. *
  15090. * **Note:** No other characters are escaped. To escape additional
  15091. * characters use a third-party library like [_he_](https://mths.be/he).
  15092. *
  15093. * Though the ">" character is escaped for symmetry, characters like
  15094. * ">" and "/" don't need escaping in HTML and have no special meaning
  15095. * unless they're part of a tag or unquoted attribute value. See
  15096. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  15097. * (under "semi-related fun fact") for more details.
  15098. *
  15099. * When working with HTML you should always
  15100. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  15101. * XSS vectors.
  15102. *
  15103. * @static
  15104. * @since 0.1.0
  15105. * @memberOf _
  15106. * @category String
  15107. * @param {string} [string=''] The string to escape.
  15108. * @returns {string} Returns the escaped string.
  15109. * @example
  15110. *
  15111. * _.escape('fred, barney, & pebbles');
  15112. * // => 'fred, barney, &amp; pebbles'
  15113. */
  15114. function escape(string) {
  15115. string = toString(string);
  15116. return (string && reHasUnescapedHtml.test(string))
  15117. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  15118. : string;
  15119. }
  15120. /**
  15121. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  15122. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  15123. *
  15124. * @static
  15125. * @memberOf _
  15126. * @since 3.0.0
  15127. * @category String
  15128. * @param {string} [string=''] The string to escape.
  15129. * @returns {string} Returns the escaped string.
  15130. * @example
  15131. *
  15132. * _.escapeRegExp('[lodash](https://lodash.com/)');
  15133. * // => '\[lodash\]\(https://lodash\.com/\)'
  15134. */
  15135. function escapeRegExp(string) {
  15136. string = toString(string);
  15137. return (string && reHasRegExpChar.test(string))
  15138. ? string.replace(reRegExpChar, '\\$&')
  15139. : string;
  15140. }
  15141. /**
  15142. * Converts `string` to
  15143. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  15144. *
  15145. * @static
  15146. * @memberOf _
  15147. * @since 3.0.0
  15148. * @category String
  15149. * @param {string} [string=''] The string to convert.
  15150. * @returns {string} Returns the kebab cased string.
  15151. * @example
  15152. *
  15153. * _.kebabCase('Foo Bar');
  15154. * // => 'foo-bar'
  15155. *
  15156. * _.kebabCase('fooBar');
  15157. * // => 'foo-bar'
  15158. *
  15159. * _.kebabCase('__FOO_BAR__');
  15160. * // => 'foo-bar'
  15161. */
  15162. var kebabCase = createCompounder(function(result, word, index) {
  15163. return result + (index ? '-' : '') + word.toLowerCase();
  15164. });
  15165. /**
  15166. * Converts `string`, as space separated words, to lower case.
  15167. *
  15168. * @static
  15169. * @memberOf _
  15170. * @since 4.0.0
  15171. * @category String
  15172. * @param {string} [string=''] The string to convert.
  15173. * @returns {string} Returns the lower cased string.
  15174. * @example
  15175. *
  15176. * _.lowerCase('--Foo-Bar--');
  15177. * // => 'foo bar'
  15178. *
  15179. * _.lowerCase('fooBar');
  15180. * // => 'foo bar'
  15181. *
  15182. * _.lowerCase('__FOO_BAR__');
  15183. * // => 'foo bar'
  15184. */
  15185. var lowerCase = createCompounder(function(result, word, index) {
  15186. return result + (index ? ' ' : '') + word.toLowerCase();
  15187. });
  15188. /**
  15189. * Converts the first character of `string` to lower case.
  15190. *
  15191. * @static
  15192. * @memberOf _
  15193. * @since 4.0.0
  15194. * @category String
  15195. * @param {string} [string=''] The string to convert.
  15196. * @returns {string} Returns the converted string.
  15197. * @example
  15198. *
  15199. * _.lowerFirst('Fred');
  15200. * // => 'fred'
  15201. *
  15202. * _.lowerFirst('FRED');
  15203. * // => 'fRED'
  15204. */
  15205. var lowerFirst = createCaseFirst('toLowerCase');
  15206. /**
  15207. * Pads `string` on the left and right sides if it's shorter than `length`.
  15208. * Padding characters are truncated if they can't be evenly divided by `length`.
  15209. *
  15210. * @static
  15211. * @memberOf _
  15212. * @since 3.0.0
  15213. * @category String
  15214. * @param {string} [string=''] The string to pad.
  15215. * @param {number} [length=0] The padding length.
  15216. * @param {string} [chars=' '] The string used as padding.
  15217. * @returns {string} Returns the padded string.
  15218. * @example
  15219. *
  15220. * _.pad('abc', 8);
  15221. * // => ' abc '
  15222. *
  15223. * _.pad('abc', 8, '_-');
  15224. * // => '_-abc_-_'
  15225. *
  15226. * _.pad('abc', 3);
  15227. * // => 'abc'
  15228. */
  15229. function pad(string, length, chars) {
  15230. string = toString(string);
  15231. length = toInteger(length);
  15232. var strLength = length ? stringSize(string) : 0;
  15233. if (!length || strLength >= length) {
  15234. return string;
  15235. }
  15236. var mid = (length - strLength) / 2;
  15237. return (
  15238. createPadding(nativeFloor(mid), chars) +
  15239. string +
  15240. createPadding(nativeCeil(mid), chars)
  15241. );
  15242. }
  15243. /**
  15244. * Pads `string` on the right side if it's shorter than `length`. Padding
  15245. * characters are truncated if they exceed `length`.
  15246. *
  15247. * @static
  15248. * @memberOf _
  15249. * @since 4.0.0
  15250. * @category String
  15251. * @param {string} [string=''] The string to pad.
  15252. * @param {number} [length=0] The padding length.
  15253. * @param {string} [chars=' '] The string used as padding.
  15254. * @returns {string} Returns the padded string.
  15255. * @example
  15256. *
  15257. * _.padEnd('abc', 6);
  15258. * // => 'abc '
  15259. *
  15260. * _.padEnd('abc', 6, '_-');
  15261. * // => 'abc_-_'
  15262. *
  15263. * _.padEnd('abc', 3);
  15264. * // => 'abc'
  15265. */
  15266. function padEnd(string, length, chars) {
  15267. string = toString(string);
  15268. length = toInteger(length);
  15269. var strLength = length ? stringSize(string) : 0;
  15270. return (length && strLength < length)
  15271. ? (string + createPadding(length - strLength, chars))
  15272. : string;
  15273. }
  15274. /**
  15275. * Pads `string` on the left side if it's shorter than `length`. Padding
  15276. * characters are truncated if they exceed `length`.
  15277. *
  15278. * @static
  15279. * @memberOf _
  15280. * @since 4.0.0
  15281. * @category String
  15282. * @param {string} [string=''] The string to pad.
  15283. * @param {number} [length=0] The padding length.
  15284. * @param {string} [chars=' '] The string used as padding.
  15285. * @returns {string} Returns the padded string.
  15286. * @example
  15287. *
  15288. * _.padStart('abc', 6);
  15289. * // => ' abc'
  15290. *
  15291. * _.padStart('abc', 6, '_-');
  15292. * // => '_-_abc'
  15293. *
  15294. * _.padStart('abc', 3);
  15295. * // => 'abc'
  15296. */
  15297. function padStart(string, length, chars) {
  15298. string = toString(string);
  15299. length = toInteger(length);
  15300. var strLength = length ? stringSize(string) : 0;
  15301. return (length && strLength < length)
  15302. ? (createPadding(length - strLength, chars) + string)
  15303. : string;
  15304. }
  15305. /**
  15306. * Converts `string` to an integer of the specified radix. If `radix` is
  15307. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  15308. * hexadecimal, in which case a `radix` of `16` is used.
  15309. *
  15310. * **Note:** This method aligns with the
  15311. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  15312. *
  15313. * @static
  15314. * @memberOf _
  15315. * @since 1.1.0
  15316. * @category String
  15317. * @param {string} string The string to convert.
  15318. * @param {number} [radix=10] The radix to interpret `value` by.
  15319. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15320. * @returns {number} Returns the converted integer.
  15321. * @example
  15322. *
  15323. * _.parseInt('08');
  15324. * // => 8
  15325. *
  15326. * _.map(['6', '08', '10'], _.parseInt);
  15327. * // => [6, 8, 10]
  15328. */
  15329. function parseInt(string, radix, guard) {
  15330. if (guard || radix == null) {
  15331. radix = 0;
  15332. } else if (radix) {
  15333. radix = +radix;
  15334. }
  15335. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  15336. }
  15337. /**
  15338. * Repeats the given string `n` times.
  15339. *
  15340. * @static
  15341. * @memberOf _
  15342. * @since 3.0.0
  15343. * @category String
  15344. * @param {string} [string=''] The string to repeat.
  15345. * @param {number} [n=1] The number of times to repeat the string.
  15346. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15347. * @returns {string} Returns the repeated string.
  15348. * @example
  15349. *
  15350. * _.repeat('*', 3);
  15351. * // => '***'
  15352. *
  15353. * _.repeat('abc', 2);
  15354. * // => 'abcabc'
  15355. *
  15356. * _.repeat('abc', 0);
  15357. * // => ''
  15358. */
  15359. function repeat(string, n, guard) {
  15360. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  15361. n = 1;
  15362. } else {
  15363. n = toInteger(n);
  15364. }
  15365. return baseRepeat(toString(string), n);
  15366. }
  15367. /**
  15368. * Replaces matches for `pattern` in `string` with `replacement`.
  15369. *
  15370. * **Note:** This method is based on
  15371. * [`String#replace`](https://mdn.io/String/replace).
  15372. *
  15373. * @static
  15374. * @memberOf _
  15375. * @since 4.0.0
  15376. * @category String
  15377. * @param {string} [string=''] The string to modify.
  15378. * @param {RegExp|string} pattern The pattern to replace.
  15379. * @param {Function|string} replacement The match replacement.
  15380. * @returns {string} Returns the modified string.
  15381. * @example
  15382. *
  15383. * _.replace('Hi Fred', 'Fred', 'Barney');
  15384. * // => 'Hi Barney'
  15385. */
  15386. function replace() {
  15387. var args = arguments,
  15388. string = toString(args[0]);
  15389. return args.length < 3 ? string : string.replace(args[1], args[2]);
  15390. }
  15391. /**
  15392. * Converts `string` to
  15393. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  15394. *
  15395. * @static
  15396. * @memberOf _
  15397. * @since 3.0.0
  15398. * @category String
  15399. * @param {string} [string=''] The string to convert.
  15400. * @returns {string} Returns the snake cased string.
  15401. * @example
  15402. *
  15403. * _.snakeCase('Foo Bar');
  15404. * // => 'foo_bar'
  15405. *
  15406. * _.snakeCase('fooBar');
  15407. * // => 'foo_bar'
  15408. *
  15409. * _.snakeCase('--FOO-BAR--');
  15410. * // => 'foo_bar'
  15411. */
  15412. var snakeCase = createCompounder(function(result, word, index) {
  15413. return result + (index ? '_' : '') + word.toLowerCase();
  15414. });
  15415. /**
  15416. * Splits `string` by `separator`.
  15417. *
  15418. * **Note:** This method is based on
  15419. * [`String#split`](https://mdn.io/String/split).
  15420. *
  15421. * @static
  15422. * @memberOf _
  15423. * @since 4.0.0
  15424. * @category String
  15425. * @param {string} [string=''] The string to split.
  15426. * @param {RegExp|string} separator The separator pattern to split by.
  15427. * @param {number} [limit] The length to truncate results to.
  15428. * @returns {Array} Returns the string segments.
  15429. * @example
  15430. *
  15431. * _.split('a-b-c', '-', 2);
  15432. * // => ['a', 'b']
  15433. */
  15434. function split(string, separator, limit) {
  15435. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  15436. separator = limit = undefined;
  15437. }
  15438. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  15439. if (!limit) {
  15440. return [];
  15441. }
  15442. string = toString(string);
  15443. if (string && (
  15444. typeof separator == 'string' ||
  15445. (separator != null && !isRegExp(separator))
  15446. )) {
  15447. separator = baseToString(separator);
  15448. if (!separator && hasUnicode(string)) {
  15449. return castSlice(stringToArray(string), 0, limit);
  15450. }
  15451. }
  15452. return string.split(separator, limit);
  15453. }
  15454. /**
  15455. * Converts `string` to
  15456. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  15457. *
  15458. * @static
  15459. * @memberOf _
  15460. * @since 3.1.0
  15461. * @category String
  15462. * @param {string} [string=''] The string to convert.
  15463. * @returns {string} Returns the start cased string.
  15464. * @example
  15465. *
  15466. * _.startCase('--foo-bar--');
  15467. * // => 'Foo Bar'
  15468. *
  15469. * _.startCase('fooBar');
  15470. * // => 'Foo Bar'
  15471. *
  15472. * _.startCase('__FOO_BAR__');
  15473. * // => 'FOO BAR'
  15474. */
  15475. var startCase = createCompounder(function(result, word, index) {
  15476. return result + (index ? ' ' : '') + upperFirst(word);
  15477. });
  15478. /**
  15479. * Checks if `string` starts with the given target string.
  15480. *
  15481. * @static
  15482. * @memberOf _
  15483. * @since 3.0.0
  15484. * @category String
  15485. * @param {string} [string=''] The string to inspect.
  15486. * @param {string} [target] The string to search for.
  15487. * @param {number} [position=0] The position to search from.
  15488. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15489. * else `false`.
  15490. * @example
  15491. *
  15492. * _.startsWith('abc', 'a');
  15493. * // => true
  15494. *
  15495. * _.startsWith('abc', 'b');
  15496. * // => false
  15497. *
  15498. * _.startsWith('abc', 'b', 1);
  15499. * // => true
  15500. */
  15501. function startsWith(string, target, position) {
  15502. string = toString(string);
  15503. position = position == null
  15504. ? 0
  15505. : baseClamp(toInteger(position), 0, string.length);
  15506. target = baseToString(target);
  15507. return string.slice(position, position + target.length) == target;
  15508. }
  15509. /**
  15510. * Creates a compiled template function that can interpolate data properties
  15511. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15512. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15513. * properties may be accessed as free variables in the template. If a setting
  15514. * object is given, it takes precedence over `_.templateSettings` values.
  15515. *
  15516. * **Note:** In the development build `_.template` utilizes
  15517. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15518. * for easier debugging.
  15519. *
  15520. * For more information on precompiling templates see
  15521. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15522. *
  15523. * For more information on Chrome extension sandboxes see
  15524. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15525. *
  15526. * @static
  15527. * @since 0.1.0
  15528. * @memberOf _
  15529. * @category String
  15530. * @param {string} [string=''] The template string.
  15531. * @param {Object} [options={}] The options object.
  15532. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15533. * The HTML "escape" delimiter.
  15534. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15535. * The "evaluate" delimiter.
  15536. * @param {Object} [options.imports=_.templateSettings.imports]
  15537. * An object to import into the template as free variables.
  15538. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15539. * The "interpolate" delimiter.
  15540. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15541. * The sourceURL of the compiled template.
  15542. * @param {string} [options.variable='obj']
  15543. * The data object variable name.
  15544. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15545. * @returns {Function} Returns the compiled template function.
  15546. * @example
  15547. *
  15548. * // Use the "interpolate" delimiter to create a compiled template.
  15549. * var compiled = _.template('hello <%= user %>!');
  15550. * compiled({ 'user': 'fred' });
  15551. * // => 'hello fred!'
  15552. *
  15553. * // Use the HTML "escape" delimiter to escape data property values.
  15554. * var compiled = _.template('<b><%- value %></b>');
  15555. * compiled({ 'value': '<script>' });
  15556. * // => '<b>&lt;script&gt;</b>'
  15557. *
  15558. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15559. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15560. * compiled({ 'users': ['fred', 'barney'] });
  15561. * // => '<li>fred</li><li>barney</li>'
  15562. *
  15563. * // Use the internal `print` function in "evaluate" delimiters.
  15564. * var compiled = _.template('<% print("hello " + user); %>!');
  15565. * compiled({ 'user': 'barney' });
  15566. * // => 'hello barney!'
  15567. *
  15568. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15569. * // Disable support by replacing the "interpolate" delimiter.
  15570. * var compiled = _.template('hello ${ user }!');
  15571. * compiled({ 'user': 'pebbles' });
  15572. * // => 'hello pebbles!'
  15573. *
  15574. * // Use backslashes to treat delimiters as plain text.
  15575. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15576. * compiled({ 'value': 'ignored' });
  15577. * // => '<%- value %>'
  15578. *
  15579. * // Use the `imports` option to import `jQuery` as `jq`.
  15580. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15581. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15582. * compiled({ 'users': ['fred', 'barney'] });
  15583. * // => '<li>fred</li><li>barney</li>'
  15584. *
  15585. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15586. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15587. * compiled(data);
  15588. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15589. *
  15590. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15591. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15592. * compiled.source;
  15593. * // => function(data) {
  15594. * // var __t, __p = '';
  15595. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15596. * // return __p;
  15597. * // }
  15598. *
  15599. * // Use custom template delimiters.
  15600. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15601. * var compiled = _.template('hello {{ user }}!');
  15602. * compiled({ 'user': 'mustache' });
  15603. * // => 'hello mustache!'
  15604. *
  15605. * // Use the `source` property to inline compiled templates for meaningful
  15606. * // line numbers in error messages and stack traces.
  15607. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15608. * var JST = {\
  15609. * "main": ' + _.template(mainText).source + '\
  15610. * };\
  15611. * ');
  15612. */
  15613. function template(string, options, guard) {
  15614. // Based on John Resig's `tmpl` implementation
  15615. // (http://ejohn.org/blog/javascript-micro-templating/)
  15616. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15617. var settings = lodash.templateSettings;
  15618. if (guard && isIterateeCall(string, options, guard)) {
  15619. options = undefined;
  15620. }
  15621. string = toString(string);
  15622. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15623. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15624. importsKeys = keys(imports),
  15625. importsValues = baseValues(imports, importsKeys);
  15626. var isEscaping,
  15627. isEvaluating,
  15628. index = 0,
  15629. interpolate = options.interpolate || reNoMatch,
  15630. source = "__p += '";
  15631. // Compile the regexp to match each delimiter.
  15632. var reDelimiters = RegExp(
  15633. (options.escape || reNoMatch).source + '|' +
  15634. interpolate.source + '|' +
  15635. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15636. (options.evaluate || reNoMatch).source + '|$'
  15637. , 'g');
  15638. // Use a sourceURL for easier debugging.
  15639. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15640. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15641. // and escape the comment, thus injecting code that gets evaled.
  15642. var sourceURL = '//# sourceURL=' +
  15643. (hasOwnProperty.call(options, 'sourceURL')
  15644. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15645. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15646. ) + '\n';
  15647. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15648. interpolateValue || (interpolateValue = esTemplateValue);
  15649. // Escape characters that can't be included in string literals.
  15650. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15651. // Replace delimiters with snippets.
  15652. if (escapeValue) {
  15653. isEscaping = true;
  15654. source += "' +\n__e(" + escapeValue + ") +\n'";
  15655. }
  15656. if (evaluateValue) {
  15657. isEvaluating = true;
  15658. source += "';\n" + evaluateValue + ";\n__p += '";
  15659. }
  15660. if (interpolateValue) {
  15661. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15662. }
  15663. index = offset + match.length;
  15664. // The JS engine embedded in Adobe products needs `match` returned in
  15665. // order to produce the correct `offset` value.
  15666. return match;
  15667. });
  15668. source += "';\n";
  15669. // If `variable` is not specified wrap a with-statement around the generated
  15670. // code to add the data object to the top of the scope chain.
  15671. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15672. if (!variable) {
  15673. source = 'with (obj) {\n' + source + '\n}\n';
  15674. }
  15675. // Throw an error if a forbidden character was found in `variable`, to prevent
  15676. // potential command injection attacks.
  15677. else if (reForbiddenIdentifierChars.test(variable)) {
  15678. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15679. }
  15680. // Cleanup code by stripping empty strings.
  15681. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15682. .replace(reEmptyStringMiddle, '$1')
  15683. .replace(reEmptyStringTrailing, '$1;');
  15684. // Frame code as the function body.
  15685. source = 'function(' + (variable || 'obj') + ') {\n' +
  15686. (variable
  15687. ? ''
  15688. : 'obj || (obj = {});\n'
  15689. ) +
  15690. "var __t, __p = ''" +
  15691. (isEscaping
  15692. ? ', __e = _.escape'
  15693. : ''
  15694. ) +
  15695. (isEvaluating
  15696. ? ', __j = Array.prototype.join;\n' +
  15697. "function print() { __p += __j.call(arguments, '') }\n"
  15698. : ';\n'
  15699. ) +
  15700. source +
  15701. 'return __p\n}';
  15702. var result = attempt(function() {
  15703. return Function(importsKeys, sourceURL + 'return ' + source)
  15704. .apply(undefined, importsValues);
  15705. });
  15706. // Provide the compiled function's source by its `toString` method or
  15707. // the `source` property as a convenience for inlining compiled templates.
  15708. result.source = source;
  15709. if (isError(result)) {
  15710. throw result;
  15711. }
  15712. return result;
  15713. }
  15714. /**
  15715. * Converts `string`, as a whole, to lower case just like
  15716. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15717. *
  15718. * @static
  15719. * @memberOf _
  15720. * @since 4.0.0
  15721. * @category String
  15722. * @param {string} [string=''] The string to convert.
  15723. * @returns {string} Returns the lower cased string.
  15724. * @example
  15725. *
  15726. * _.toLower('--Foo-Bar--');
  15727. * // => '--foo-bar--'
  15728. *
  15729. * _.toLower('fooBar');
  15730. * // => 'foobar'
  15731. *
  15732. * _.toLower('__FOO_BAR__');
  15733. * // => '__foo_bar__'
  15734. */
  15735. function toLower(value) {
  15736. return toString(value).toLowerCase();
  15737. }
  15738. /**
  15739. * Converts `string`, as a whole, to upper case just like
  15740. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15741. *
  15742. * @static
  15743. * @memberOf _
  15744. * @since 4.0.0
  15745. * @category String
  15746. * @param {string} [string=''] The string to convert.
  15747. * @returns {string} Returns the upper cased string.
  15748. * @example
  15749. *
  15750. * _.toUpper('--foo-bar--');
  15751. * // => '--FOO-BAR--'
  15752. *
  15753. * _.toUpper('fooBar');
  15754. * // => 'FOOBAR'
  15755. *
  15756. * _.toUpper('__foo_bar__');
  15757. * // => '__FOO_BAR__'
  15758. */
  15759. function toUpper(value) {
  15760. return toString(value).toUpperCase();
  15761. }
  15762. /**
  15763. * Removes leading and trailing whitespace or specified characters from `string`.
  15764. *
  15765. * @static
  15766. * @memberOf _
  15767. * @since 3.0.0
  15768. * @category String
  15769. * @param {string} [string=''] The string to trim.
  15770. * @param {string} [chars=whitespace] The characters to trim.
  15771. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15772. * @returns {string} Returns the trimmed string.
  15773. * @example
  15774. *
  15775. * _.trim(' abc ');
  15776. * // => 'abc'
  15777. *
  15778. * _.trim('-_-abc-_-', '_-');
  15779. * // => 'abc'
  15780. *
  15781. * _.map([' foo ', ' bar '], _.trim);
  15782. * // => ['foo', 'bar']
  15783. */
  15784. function trim(string, chars, guard) {
  15785. string = toString(string);
  15786. if (string && (guard || chars === undefined)) {
  15787. return baseTrim(string);
  15788. }
  15789. if (!string || !(chars = baseToString(chars))) {
  15790. return string;
  15791. }
  15792. var strSymbols = stringToArray(string),
  15793. chrSymbols = stringToArray(chars),
  15794. start = charsStartIndex(strSymbols, chrSymbols),
  15795. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15796. return castSlice(strSymbols, start, end).join('');
  15797. }
  15798. /**
  15799. * Removes trailing whitespace or specified characters from `string`.
  15800. *
  15801. * @static
  15802. * @memberOf _
  15803. * @since 4.0.0
  15804. * @category String
  15805. * @param {string} [string=''] The string to trim.
  15806. * @param {string} [chars=whitespace] The characters to trim.
  15807. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15808. * @returns {string} Returns the trimmed string.
  15809. * @example
  15810. *
  15811. * _.trimEnd(' abc ');
  15812. * // => ' abc'
  15813. *
  15814. * _.trimEnd('-_-abc-_-', '_-');
  15815. * // => '-_-abc'
  15816. */
  15817. function trimEnd(string, chars, guard) {
  15818. string = toString(string);
  15819. if (string && (guard || chars === undefined)) {
  15820. return string.slice(0, trimmedEndIndex(string) + 1);
  15821. }
  15822. if (!string || !(chars = baseToString(chars))) {
  15823. return string;
  15824. }
  15825. var strSymbols = stringToArray(string),
  15826. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15827. return castSlice(strSymbols, 0, end).join('');
  15828. }
  15829. /**
  15830. * Removes leading whitespace or specified characters from `string`.
  15831. *
  15832. * @static
  15833. * @memberOf _
  15834. * @since 4.0.0
  15835. * @category String
  15836. * @param {string} [string=''] The string to trim.
  15837. * @param {string} [chars=whitespace] The characters to trim.
  15838. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15839. * @returns {string} Returns the trimmed string.
  15840. * @example
  15841. *
  15842. * _.trimStart(' abc ');
  15843. * // => 'abc '
  15844. *
  15845. * _.trimStart('-_-abc-_-', '_-');
  15846. * // => 'abc-_-'
  15847. */
  15848. function trimStart(string, chars, guard) {
  15849. string = toString(string);
  15850. if (string && (guard || chars === undefined)) {
  15851. return string.replace(reTrimStart, '');
  15852. }
  15853. if (!string || !(chars = baseToString(chars))) {
  15854. return string;
  15855. }
  15856. var strSymbols = stringToArray(string),
  15857. start = charsStartIndex(strSymbols, stringToArray(chars));
  15858. return castSlice(strSymbols, start).join('');
  15859. }
  15860. /**
  15861. * Truncates `string` if it's longer than the given maximum string length.
  15862. * The last characters of the truncated string are replaced with the omission
  15863. * string which defaults to "...".
  15864. *
  15865. * @static
  15866. * @memberOf _
  15867. * @since 4.0.0
  15868. * @category String
  15869. * @param {string} [string=''] The string to truncate.
  15870. * @param {Object} [options={}] The options object.
  15871. * @param {number} [options.length=30] The maximum string length.
  15872. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15873. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15874. * @returns {string} Returns the truncated string.
  15875. * @example
  15876. *
  15877. * _.truncate('hi-diddly-ho there, neighborino');
  15878. * // => 'hi-diddly-ho there, neighbo...'
  15879. *
  15880. * _.truncate('hi-diddly-ho there, neighborino', {
  15881. * 'length': 24,
  15882. * 'separator': ' '
  15883. * });
  15884. * // => 'hi-diddly-ho there,...'
  15885. *
  15886. * _.truncate('hi-diddly-ho there, neighborino', {
  15887. * 'length': 24,
  15888. * 'separator': /,? +/
  15889. * });
  15890. * // => 'hi-diddly-ho there...'
  15891. *
  15892. * _.truncate('hi-diddly-ho there, neighborino', {
  15893. * 'omission': ' [...]'
  15894. * });
  15895. * // => 'hi-diddly-ho there, neig [...]'
  15896. */
  15897. function truncate(string, options) {
  15898. var length = DEFAULT_TRUNC_LENGTH,
  15899. omission = DEFAULT_TRUNC_OMISSION;
  15900. if (isObject(options)) {
  15901. var separator = 'separator' in options ? options.separator : separator;
  15902. length = 'length' in options ? toInteger(options.length) : length;
  15903. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15904. }
  15905. string = toString(string);
  15906. var strLength = string.length;
  15907. if (hasUnicode(string)) {
  15908. var strSymbols = stringToArray(string);
  15909. strLength = strSymbols.length;
  15910. }
  15911. if (length >= strLength) {
  15912. return string;
  15913. }
  15914. var end = length - stringSize(omission);
  15915. if (end < 1) {
  15916. return omission;
  15917. }
  15918. var result = strSymbols
  15919. ? castSlice(strSymbols, 0, end).join('')
  15920. : string.slice(0, end);
  15921. if (separator === undefined) {
  15922. return result + omission;
  15923. }
  15924. if (strSymbols) {
  15925. end += (result.length - end);
  15926. }
  15927. if (isRegExp(separator)) {
  15928. if (string.slice(end).search(separator)) {
  15929. var match,
  15930. substring = result;
  15931. if (!separator.global) {
  15932. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15933. }
  15934. separator.lastIndex = 0;
  15935. while ((match = separator.exec(substring))) {
  15936. var newEnd = match.index;
  15937. }
  15938. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15939. }
  15940. } else if (string.indexOf(baseToString(separator), end) != end) {
  15941. var index = result.lastIndexOf(separator);
  15942. if (index > -1) {
  15943. result = result.slice(0, index);
  15944. }
  15945. }
  15946. return result + omission;
  15947. }
  15948. /**
  15949. * The inverse of `_.escape`; this method converts the HTML entities
  15950. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15951. * their corresponding characters.
  15952. *
  15953. * **Note:** No other HTML entities are unescaped. To unescape additional
  15954. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15955. *
  15956. * @static
  15957. * @memberOf _
  15958. * @since 0.6.0
  15959. * @category String
  15960. * @param {string} [string=''] The string to unescape.
  15961. * @returns {string} Returns the unescaped string.
  15962. * @example
  15963. *
  15964. * _.unescape('fred, barney, &amp; pebbles');
  15965. * // => 'fred, barney, & pebbles'
  15966. */
  15967. function unescape(string) {
  15968. string = toString(string);
  15969. return (string && reHasEscapedHtml.test(string))
  15970. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15971. : string;
  15972. }
  15973. /**
  15974. * Converts `string`, as space separated words, to upper case.
  15975. *
  15976. * @static
  15977. * @memberOf _
  15978. * @since 4.0.0
  15979. * @category String
  15980. * @param {string} [string=''] The string to convert.
  15981. * @returns {string} Returns the upper cased string.
  15982. * @example
  15983. *
  15984. * _.upperCase('--foo-bar');
  15985. * // => 'FOO BAR'
  15986. *
  15987. * _.upperCase('fooBar');
  15988. * // => 'FOO BAR'
  15989. *
  15990. * _.upperCase('__foo_bar__');
  15991. * // => 'FOO BAR'
  15992. */
  15993. var upperCase = createCompounder(function(result, word, index) {
  15994. return result + (index ? ' ' : '') + word.toUpperCase();
  15995. });
  15996. /**
  15997. * Converts the first character of `string` to upper case.
  15998. *
  15999. * @static
  16000. * @memberOf _
  16001. * @since 4.0.0
  16002. * @category String
  16003. * @param {string} [string=''] The string to convert.
  16004. * @returns {string} Returns the converted string.
  16005. * @example
  16006. *
  16007. * _.upperFirst('fred');
  16008. * // => 'Fred'
  16009. *
  16010. * _.upperFirst('FRED');
  16011. * // => 'FRED'
  16012. */
  16013. var upperFirst = createCaseFirst('toUpperCase');
  16014. /**
  16015. * Splits `string` into an array of its words.
  16016. *
  16017. * @static
  16018. * @memberOf _
  16019. * @since 3.0.0
  16020. * @category String
  16021. * @param {string} [string=''] The string to inspect.
  16022. * @param {RegExp|string} [pattern] The pattern to match words.
  16023. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  16024. * @returns {Array} Returns the words of `string`.
  16025. * @example
  16026. *
  16027. * _.words('fred, barney, & pebbles');
  16028. * // => ['fred', 'barney', 'pebbles']
  16029. *
  16030. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  16031. * // => ['fred', 'barney', '&', 'pebbles']
  16032. */
  16033. function words(string, pattern, guard) {
  16034. string = toString(string);
  16035. pattern = guard ? undefined : pattern;
  16036. if (pattern === undefined) {
  16037. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  16038. }
  16039. return string.match(pattern) || [];
  16040. }
  16041. /*------------------------------------------------------------------------*/
  16042. /**
  16043. * Attempts to invoke `func`, returning either the result or the caught error
  16044. * object. Any additional arguments are provided to `func` when it's invoked.
  16045. *
  16046. * @static
  16047. * @memberOf _
  16048. * @since 3.0.0
  16049. * @category Util
  16050. * @param {Function} func The function to attempt.
  16051. * @param {...*} [args] The arguments to invoke `func` with.
  16052. * @returns {*} Returns the `func` result or error object.
  16053. * @example
  16054. *
  16055. * // Avoid throwing errors for invalid selectors.
  16056. * var elements = _.attempt(function(selector) {
  16057. * return document.querySelectorAll(selector);
  16058. * }, '>_>');
  16059. *
  16060. * if (_.isError(elements)) {
  16061. * elements = [];
  16062. * }
  16063. */
  16064. var attempt = baseRest(function(func, args) {
  16065. try {
  16066. return apply(func, undefined, args);
  16067. } catch (e) {
  16068. return isError(e) ? e : new Error(e);
  16069. }
  16070. });
  16071. /**
  16072. * Binds methods of an object to the object itself, overwriting the existing
  16073. * method.
  16074. *
  16075. * **Note:** This method doesn't set the "length" property of bound functions.
  16076. *
  16077. * @static
  16078. * @since 0.1.0
  16079. * @memberOf _
  16080. * @category Util
  16081. * @param {Object} object The object to bind and assign the bound methods to.
  16082. * @param {...(string|string[])} methodNames The object method names to bind.
  16083. * @returns {Object} Returns `object`.
  16084. * @example
  16085. *
  16086. * var view = {
  16087. * 'label': 'docs',
  16088. * 'click': function() {
  16089. * console.log('clicked ' + this.label);
  16090. * }
  16091. * };
  16092. *
  16093. * _.bindAll(view, ['click']);
  16094. * jQuery(element).on('click', view.click);
  16095. * // => Logs 'clicked docs' when clicked.
  16096. */
  16097. var bindAll = flatRest(function(object, methodNames) {
  16098. arrayEach(methodNames, function(key) {
  16099. key = toKey(key);
  16100. baseAssignValue(object, key, bind(object[key], object));
  16101. });
  16102. return object;
  16103. });
  16104. /**
  16105. * Creates a function that iterates over `pairs` and invokes the corresponding
  16106. * function of the first predicate to return truthy. The predicate-function
  16107. * pairs are invoked with the `this` binding and arguments of the created
  16108. * function.
  16109. *
  16110. * @static
  16111. * @memberOf _
  16112. * @since 4.0.0
  16113. * @category Util
  16114. * @param {Array} pairs The predicate-function pairs.
  16115. * @returns {Function} Returns the new composite function.
  16116. * @example
  16117. *
  16118. * var func = _.cond([
  16119. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  16120. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  16121. * [_.stubTrue, _.constant('no match')]
  16122. * ]);
  16123. *
  16124. * func({ 'a': 1, 'b': 2 });
  16125. * // => 'matches A'
  16126. *
  16127. * func({ 'a': 0, 'b': 1 });
  16128. * // => 'matches B'
  16129. *
  16130. * func({ 'a': '1', 'b': '2' });
  16131. * // => 'no match'
  16132. */
  16133. function cond(pairs) {
  16134. var length = pairs == null ? 0 : pairs.length,
  16135. toIteratee = getIteratee();
  16136. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  16137. if (typeof pair[1] != 'function') {
  16138. throw new TypeError(FUNC_ERROR_TEXT);
  16139. }
  16140. return [toIteratee(pair[0]), pair[1]];
  16141. });
  16142. return baseRest(function(args) {
  16143. var index = -1;
  16144. while (++index < length) {
  16145. var pair = pairs[index];
  16146. if (apply(pair[0], this, args)) {
  16147. return apply(pair[1], this, args);
  16148. }
  16149. }
  16150. });
  16151. }
  16152. /**
  16153. * Creates a function that invokes the predicate properties of `source` with
  16154. * the corresponding property values of a given object, returning `true` if
  16155. * all predicates return truthy, else `false`.
  16156. *
  16157. * **Note:** The created function is equivalent to `_.conformsTo` with
  16158. * `source` partially applied.
  16159. *
  16160. * @static
  16161. * @memberOf _
  16162. * @since 4.0.0
  16163. * @category Util
  16164. * @param {Object} source The object of property predicates to conform to.
  16165. * @returns {Function} Returns the new spec function.
  16166. * @example
  16167. *
  16168. * var objects = [
  16169. * { 'a': 2, 'b': 1 },
  16170. * { 'a': 1, 'b': 2 }
  16171. * ];
  16172. *
  16173. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  16174. * // => [{ 'a': 1, 'b': 2 }]
  16175. */
  16176. function conforms(source) {
  16177. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  16178. }
  16179. /**
  16180. * Creates a function that returns `value`.
  16181. *
  16182. * @static
  16183. * @memberOf _
  16184. * @since 2.4.0
  16185. * @category Util
  16186. * @param {*} value The value to return from the new function.
  16187. * @returns {Function} Returns the new constant function.
  16188. * @example
  16189. *
  16190. * var objects = _.times(2, _.constant({ 'a': 1 }));
  16191. *
  16192. * console.log(objects);
  16193. * // => [{ 'a': 1 }, { 'a': 1 }]
  16194. *
  16195. * console.log(objects[0] === objects[1]);
  16196. * // => true
  16197. */
  16198. function constant(value) {
  16199. return function() {
  16200. return value;
  16201. };
  16202. }
  16203. /**
  16204. * Checks `value` to determine whether a default value should be returned in
  16205. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  16206. * or `undefined`.
  16207. *
  16208. * @static
  16209. * @memberOf _
  16210. * @since 4.14.0
  16211. * @category Util
  16212. * @param {*} value The value to check.
  16213. * @param {*} defaultValue The default value.
  16214. * @returns {*} Returns the resolved value.
  16215. * @example
  16216. *
  16217. * _.defaultTo(1, 10);
  16218. * // => 1
  16219. *
  16220. * _.defaultTo(undefined, 10);
  16221. * // => 10
  16222. */
  16223. function defaultTo(value, defaultValue) {
  16224. return (value == null || value !== value) ? defaultValue : value;
  16225. }
  16226. /**
  16227. * Creates a function that returns the result of invoking the given functions
  16228. * with the `this` binding of the created function, where each successive
  16229. * invocation is supplied the return value of the previous.
  16230. *
  16231. * @static
  16232. * @memberOf _
  16233. * @since 3.0.0
  16234. * @category Util
  16235. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  16236. * @returns {Function} Returns the new composite function.
  16237. * @see _.flowRight
  16238. * @example
  16239. *
  16240. * function square(n) {
  16241. * return n * n;
  16242. * }
  16243. *
  16244. * var addSquare = _.flow([_.add, square]);
  16245. * addSquare(1, 2);
  16246. * // => 9
  16247. */
  16248. var flow = createFlow();
  16249. /**
  16250. * This method is like `_.flow` except that it creates a function that
  16251. * invokes the given functions from right to left.
  16252. *
  16253. * @static
  16254. * @since 3.0.0
  16255. * @memberOf _
  16256. * @category Util
  16257. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  16258. * @returns {Function} Returns the new composite function.
  16259. * @see _.flow
  16260. * @example
  16261. *
  16262. * function square(n) {
  16263. * return n * n;
  16264. * }
  16265. *
  16266. * var addSquare = _.flowRight([square, _.add]);
  16267. * addSquare(1, 2);
  16268. * // => 9
  16269. */
  16270. var flowRight = createFlow(true);
  16271. /**
  16272. * This method returns the first argument it receives.
  16273. *
  16274. * @static
  16275. * @since 0.1.0
  16276. * @memberOf _
  16277. * @category Util
  16278. * @param {*} value Any value.
  16279. * @returns {*} Returns `value`.
  16280. * @example
  16281. *
  16282. * var object = { 'a': 1 };
  16283. *
  16284. * console.log(_.identity(object) === object);
  16285. * // => true
  16286. */
  16287. function identity(value) {
  16288. return value;
  16289. }
  16290. /**
  16291. * Creates a function that invokes `func` with the arguments of the created
  16292. * function. If `func` is a property name, the created function returns the
  16293. * property value for a given element. If `func` is an array or object, the
  16294. * created function returns `true` for elements that contain the equivalent
  16295. * source properties, otherwise it returns `false`.
  16296. *
  16297. * @static
  16298. * @since 4.0.0
  16299. * @memberOf _
  16300. * @category Util
  16301. * @param {*} [func=_.identity] The value to convert to a callback.
  16302. * @returns {Function} Returns the callback.
  16303. * @example
  16304. *
  16305. * var users = [
  16306. * { 'user': 'barney', 'age': 36, 'active': true },
  16307. * { 'user': 'fred', 'age': 40, 'active': false }
  16308. * ];
  16309. *
  16310. * // The `_.matches` iteratee shorthand.
  16311. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  16312. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  16313. *
  16314. * // The `_.matchesProperty` iteratee shorthand.
  16315. * _.filter(users, _.iteratee(['user', 'fred']));
  16316. * // => [{ 'user': 'fred', 'age': 40 }]
  16317. *
  16318. * // The `_.property` iteratee shorthand.
  16319. * _.map(users, _.iteratee('user'));
  16320. * // => ['barney', 'fred']
  16321. *
  16322. * // Create custom iteratee shorthands.
  16323. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  16324. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  16325. * return func.test(string);
  16326. * };
  16327. * });
  16328. *
  16329. * _.filter(['abc', 'def'], /ef/);
  16330. * // => ['def']
  16331. */
  16332. function iteratee(func) {
  16333. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  16334. }
  16335. /**
  16336. * Creates a function that performs a partial deep comparison between a given
  16337. * object and `source`, returning `true` if the given object has equivalent
  16338. * property values, else `false`.
  16339. *
  16340. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  16341. * partially applied.
  16342. *
  16343. * Partial comparisons will match empty array and empty object `source`
  16344. * values against any array or object value, respectively. See `_.isEqual`
  16345. * for a list of supported value comparisons.
  16346. *
  16347. * **Note:** Multiple values can be checked by combining several matchers
  16348. * using `_.overSome`
  16349. *
  16350. * @static
  16351. * @memberOf _
  16352. * @since 3.0.0
  16353. * @category Util
  16354. * @param {Object} source The object of property values to match.
  16355. * @returns {Function} Returns the new spec function.
  16356. * @example
  16357. *
  16358. * var objects = [
  16359. * { 'a': 1, 'b': 2, 'c': 3 },
  16360. * { 'a': 4, 'b': 5, 'c': 6 }
  16361. * ];
  16362. *
  16363. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  16364. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  16365. *
  16366. * // Checking for several possible values
  16367. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  16368. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16369. */
  16370. function matches(source) {
  16371. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  16372. }
  16373. /**
  16374. * Creates a function that performs a partial deep comparison between the
  16375. * value at `path` of a given object to `srcValue`, returning `true` if the
  16376. * object value is equivalent, else `false`.
  16377. *
  16378. * **Note:** Partial comparisons will match empty array and empty object
  16379. * `srcValue` values against any array or object value, respectively. See
  16380. * `_.isEqual` for a list of supported value comparisons.
  16381. *
  16382. * **Note:** Multiple values can be checked by combining several matchers
  16383. * using `_.overSome`
  16384. *
  16385. * @static
  16386. * @memberOf _
  16387. * @since 3.2.0
  16388. * @category Util
  16389. * @param {Array|string} path The path of the property to get.
  16390. * @param {*} srcValue The value to match.
  16391. * @returns {Function} Returns the new spec function.
  16392. * @example
  16393. *
  16394. * var objects = [
  16395. * { 'a': 1, 'b': 2, 'c': 3 },
  16396. * { 'a': 4, 'b': 5, 'c': 6 }
  16397. * ];
  16398. *
  16399. * _.find(objects, _.matchesProperty('a', 4));
  16400. * // => { 'a': 4, 'b': 5, 'c': 6 }
  16401. *
  16402. * // Checking for several possible values
  16403. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  16404. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16405. */
  16406. function matchesProperty(path, srcValue) {
  16407. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  16408. }
  16409. /**
  16410. * Creates a function that invokes the method at `path` of a given object.
  16411. * Any additional arguments are provided to the invoked method.
  16412. *
  16413. * @static
  16414. * @memberOf _
  16415. * @since 3.7.0
  16416. * @category Util
  16417. * @param {Array|string} path The path of the method to invoke.
  16418. * @param {...*} [args] The arguments to invoke the method with.
  16419. * @returns {Function} Returns the new invoker function.
  16420. * @example
  16421. *
  16422. * var objects = [
  16423. * { 'a': { 'b': _.constant(2) } },
  16424. * { 'a': { 'b': _.constant(1) } }
  16425. * ];
  16426. *
  16427. * _.map(objects, _.method('a.b'));
  16428. * // => [2, 1]
  16429. *
  16430. * _.map(objects, _.method(['a', 'b']));
  16431. * // => [2, 1]
  16432. */
  16433. var method = baseRest(function(path, args) {
  16434. return function(object) {
  16435. return baseInvoke(object, path, args);
  16436. };
  16437. });
  16438. /**
  16439. * The opposite of `_.method`; this method creates a function that invokes
  16440. * the method at a given path of `object`. Any additional arguments are
  16441. * provided to the invoked method.
  16442. *
  16443. * @static
  16444. * @memberOf _
  16445. * @since 3.7.0
  16446. * @category Util
  16447. * @param {Object} object The object to query.
  16448. * @param {...*} [args] The arguments to invoke the method with.
  16449. * @returns {Function} Returns the new invoker function.
  16450. * @example
  16451. *
  16452. * var array = _.times(3, _.constant),
  16453. * object = { 'a': array, 'b': array, 'c': array };
  16454. *
  16455. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  16456. * // => [2, 0]
  16457. *
  16458. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  16459. * // => [2, 0]
  16460. */
  16461. var methodOf = baseRest(function(object, args) {
  16462. return function(path) {
  16463. return baseInvoke(object, path, args);
  16464. };
  16465. });
  16466. /**
  16467. * Adds all own enumerable string keyed function properties of a source
  16468. * object to the destination object. If `object` is a function, then methods
  16469. * are added to its prototype as well.
  16470. *
  16471. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16472. * avoid conflicts caused by modifying the original.
  16473. *
  16474. * @static
  16475. * @since 0.1.0
  16476. * @memberOf _
  16477. * @category Util
  16478. * @param {Function|Object} [object=lodash] The destination object.
  16479. * @param {Object} source The object of functions to add.
  16480. * @param {Object} [options={}] The options object.
  16481. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16482. * @returns {Function|Object} Returns `object`.
  16483. * @example
  16484. *
  16485. * function vowels(string) {
  16486. * return _.filter(string, function(v) {
  16487. * return /[aeiou]/i.test(v);
  16488. * });
  16489. * }
  16490. *
  16491. * _.mixin({ 'vowels': vowels });
  16492. * _.vowels('fred');
  16493. * // => ['e']
  16494. *
  16495. * _('fred').vowels().value();
  16496. * // => ['e']
  16497. *
  16498. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16499. * _('fred').vowels();
  16500. * // => ['e']
  16501. */
  16502. function mixin(object, source, options) {
  16503. var props = keys(source),
  16504. methodNames = baseFunctions(source, props);
  16505. if (options == null &&
  16506. !(isObject(source) && (methodNames.length || !props.length))) {
  16507. options = source;
  16508. source = object;
  16509. object = this;
  16510. methodNames = baseFunctions(source, keys(source));
  16511. }
  16512. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16513. isFunc = isFunction(object);
  16514. arrayEach(methodNames, function(methodName) {
  16515. var func = source[methodName];
  16516. object[methodName] = func;
  16517. if (isFunc) {
  16518. object.prototype[methodName] = function() {
  16519. var chainAll = this.__chain__;
  16520. if (chain || chainAll) {
  16521. var result = object(this.__wrapped__),
  16522. actions = result.__actions__ = copyArray(this.__actions__);
  16523. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16524. result.__chain__ = chainAll;
  16525. return result;
  16526. }
  16527. return func.apply(object, arrayPush([this.value()], arguments));
  16528. };
  16529. }
  16530. });
  16531. return object;
  16532. }
  16533. /**
  16534. * Reverts the `_` variable to its previous value and returns a reference to
  16535. * the `lodash` function.
  16536. *
  16537. * @static
  16538. * @since 0.1.0
  16539. * @memberOf _
  16540. * @category Util
  16541. * @returns {Function} Returns the `lodash` function.
  16542. * @example
  16543. *
  16544. * var lodash = _.noConflict();
  16545. */
  16546. function noConflict() {
  16547. if (root._ === this) {
  16548. root._ = oldDash;
  16549. }
  16550. return this;
  16551. }
  16552. /**
  16553. * This method returns `undefined`.
  16554. *
  16555. * @static
  16556. * @memberOf _
  16557. * @since 2.3.0
  16558. * @category Util
  16559. * @example
  16560. *
  16561. * _.times(2, _.noop);
  16562. * // => [undefined, undefined]
  16563. */
  16564. function noop() {
  16565. // No operation performed.
  16566. }
  16567. /**
  16568. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16569. * the nth argument from the end is returned.
  16570. *
  16571. * @static
  16572. * @memberOf _
  16573. * @since 4.0.0
  16574. * @category Util
  16575. * @param {number} [n=0] The index of the argument to return.
  16576. * @returns {Function} Returns the new pass-thru function.
  16577. * @example
  16578. *
  16579. * var func = _.nthArg(1);
  16580. * func('a', 'b', 'c', 'd');
  16581. * // => 'b'
  16582. *
  16583. * var func = _.nthArg(-2);
  16584. * func('a', 'b', 'c', 'd');
  16585. * // => 'c'
  16586. */
  16587. function nthArg(n) {
  16588. n = toInteger(n);
  16589. return baseRest(function(args) {
  16590. return baseNth(args, n);
  16591. });
  16592. }
  16593. /**
  16594. * Creates a function that invokes `iteratees` with the arguments it receives
  16595. * and returns their results.
  16596. *
  16597. * @static
  16598. * @memberOf _
  16599. * @since 4.0.0
  16600. * @category Util
  16601. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16602. * The iteratees to invoke.
  16603. * @returns {Function} Returns the new function.
  16604. * @example
  16605. *
  16606. * var func = _.over([Math.max, Math.min]);
  16607. *
  16608. * func(1, 2, 3, 4);
  16609. * // => [4, 1]
  16610. */
  16611. var over = createOver(arrayMap);
  16612. /**
  16613. * Creates a function that checks if **all** of the `predicates` return
  16614. * truthy when invoked with the arguments it receives.
  16615. *
  16616. * Following shorthands are possible for providing predicates.
  16617. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16618. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16619. *
  16620. * @static
  16621. * @memberOf _
  16622. * @since 4.0.0
  16623. * @category Util
  16624. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16625. * The predicates to check.
  16626. * @returns {Function} Returns the new function.
  16627. * @example
  16628. *
  16629. * var func = _.overEvery([Boolean, isFinite]);
  16630. *
  16631. * func('1');
  16632. * // => true
  16633. *
  16634. * func(null);
  16635. * // => false
  16636. *
  16637. * func(NaN);
  16638. * // => false
  16639. */
  16640. var overEvery = createOver(arrayEvery);
  16641. /**
  16642. * Creates a function that checks if **any** of the `predicates` return
  16643. * truthy when invoked with the arguments it receives.
  16644. *
  16645. * Following shorthands are possible for providing predicates.
  16646. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16647. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16648. *
  16649. * @static
  16650. * @memberOf _
  16651. * @since 4.0.0
  16652. * @category Util
  16653. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16654. * The predicates to check.
  16655. * @returns {Function} Returns the new function.
  16656. * @example
  16657. *
  16658. * var func = _.overSome([Boolean, isFinite]);
  16659. *
  16660. * func('1');
  16661. * // => true
  16662. *
  16663. * func(null);
  16664. * // => true
  16665. *
  16666. * func(NaN);
  16667. * // => false
  16668. *
  16669. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16670. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16671. */
  16672. var overSome = createOver(arraySome);
  16673. /**
  16674. * Creates a function that returns the value at `path` of a given object.
  16675. *
  16676. * @static
  16677. * @memberOf _
  16678. * @since 2.4.0
  16679. * @category Util
  16680. * @param {Array|string} path The path of the property to get.
  16681. * @returns {Function} Returns the new accessor function.
  16682. * @example
  16683. *
  16684. * var objects = [
  16685. * { 'a': { 'b': 2 } },
  16686. * { 'a': { 'b': 1 } }
  16687. * ];
  16688. *
  16689. * _.map(objects, _.property('a.b'));
  16690. * // => [2, 1]
  16691. *
  16692. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16693. * // => [1, 2]
  16694. */
  16695. function property(path) {
  16696. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16697. }
  16698. /**
  16699. * The opposite of `_.property`; this method creates a function that returns
  16700. * the value at a given path of `object`.
  16701. *
  16702. * @static
  16703. * @memberOf _
  16704. * @since 3.0.0
  16705. * @category Util
  16706. * @param {Object} object The object to query.
  16707. * @returns {Function} Returns the new accessor function.
  16708. * @example
  16709. *
  16710. * var array = [0, 1, 2],
  16711. * object = { 'a': array, 'b': array, 'c': array };
  16712. *
  16713. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16714. * // => [2, 0]
  16715. *
  16716. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16717. * // => [2, 0]
  16718. */
  16719. function propertyOf(object) {
  16720. return function(path) {
  16721. return object == null ? undefined : baseGet(object, path);
  16722. };
  16723. }
  16724. /**
  16725. * Creates an array of numbers (positive and/or negative) progressing from
  16726. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16727. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16728. * it's set to `start` with `start` then set to `0`.
  16729. *
  16730. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16731. * floating-point values which can produce unexpected results.
  16732. *
  16733. * @static
  16734. * @since 0.1.0
  16735. * @memberOf _
  16736. * @category Util
  16737. * @param {number} [start=0] The start of the range.
  16738. * @param {number} end The end of the range.
  16739. * @param {number} [step=1] The value to increment or decrement by.
  16740. * @returns {Array} Returns the range of numbers.
  16741. * @see _.inRange, _.rangeRight
  16742. * @example
  16743. *
  16744. * _.range(4);
  16745. * // => [0, 1, 2, 3]
  16746. *
  16747. * _.range(-4);
  16748. * // => [0, -1, -2, -3]
  16749. *
  16750. * _.range(1, 5);
  16751. * // => [1, 2, 3, 4]
  16752. *
  16753. * _.range(0, 20, 5);
  16754. * // => [0, 5, 10, 15]
  16755. *
  16756. * _.range(0, -4, -1);
  16757. * // => [0, -1, -2, -3]
  16758. *
  16759. * _.range(1, 4, 0);
  16760. * // => [1, 1, 1]
  16761. *
  16762. * _.range(0);
  16763. * // => []
  16764. */
  16765. var range = createRange();
  16766. /**
  16767. * This method is like `_.range` except that it populates values in
  16768. * descending order.
  16769. *
  16770. * @static
  16771. * @memberOf _
  16772. * @since 4.0.0
  16773. * @category Util
  16774. * @param {number} [start=0] The start of the range.
  16775. * @param {number} end The end of the range.
  16776. * @param {number} [step=1] The value to increment or decrement by.
  16777. * @returns {Array} Returns the range of numbers.
  16778. * @see _.inRange, _.range
  16779. * @example
  16780. *
  16781. * _.rangeRight(4);
  16782. * // => [3, 2, 1, 0]
  16783. *
  16784. * _.rangeRight(-4);
  16785. * // => [-3, -2, -1, 0]
  16786. *
  16787. * _.rangeRight(1, 5);
  16788. * // => [4, 3, 2, 1]
  16789. *
  16790. * _.rangeRight(0, 20, 5);
  16791. * // => [15, 10, 5, 0]
  16792. *
  16793. * _.rangeRight(0, -4, -1);
  16794. * // => [-3, -2, -1, 0]
  16795. *
  16796. * _.rangeRight(1, 4, 0);
  16797. * // => [1, 1, 1]
  16798. *
  16799. * _.rangeRight(0);
  16800. * // => []
  16801. */
  16802. var rangeRight = createRange(true);
  16803. /**
  16804. * This method returns a new empty array.
  16805. *
  16806. * @static
  16807. * @memberOf _
  16808. * @since 4.13.0
  16809. * @category Util
  16810. * @returns {Array} Returns the new empty array.
  16811. * @example
  16812. *
  16813. * var arrays = _.times(2, _.stubArray);
  16814. *
  16815. * console.log(arrays);
  16816. * // => [[], []]
  16817. *
  16818. * console.log(arrays[0] === arrays[1]);
  16819. * // => false
  16820. */
  16821. function stubArray() {
  16822. return [];
  16823. }
  16824. /**
  16825. * This method returns `false`.
  16826. *
  16827. * @static
  16828. * @memberOf _
  16829. * @since 4.13.0
  16830. * @category Util
  16831. * @returns {boolean} Returns `false`.
  16832. * @example
  16833. *
  16834. * _.times(2, _.stubFalse);
  16835. * // => [false, false]
  16836. */
  16837. function stubFalse() {
  16838. return false;
  16839. }
  16840. /**
  16841. * This method returns a new empty object.
  16842. *
  16843. * @static
  16844. * @memberOf _
  16845. * @since 4.13.0
  16846. * @category Util
  16847. * @returns {Object} Returns the new empty object.
  16848. * @example
  16849. *
  16850. * var objects = _.times(2, _.stubObject);
  16851. *
  16852. * console.log(objects);
  16853. * // => [{}, {}]
  16854. *
  16855. * console.log(objects[0] === objects[1]);
  16856. * // => false
  16857. */
  16858. function stubObject() {
  16859. return {};
  16860. }
  16861. /**
  16862. * This method returns an empty string.
  16863. *
  16864. * @static
  16865. * @memberOf _
  16866. * @since 4.13.0
  16867. * @category Util
  16868. * @returns {string} Returns the empty string.
  16869. * @example
  16870. *
  16871. * _.times(2, _.stubString);
  16872. * // => ['', '']
  16873. */
  16874. function stubString() {
  16875. return '';
  16876. }
  16877. /**
  16878. * This method returns `true`.
  16879. *
  16880. * @static
  16881. * @memberOf _
  16882. * @since 4.13.0
  16883. * @category Util
  16884. * @returns {boolean} Returns `true`.
  16885. * @example
  16886. *
  16887. * _.times(2, _.stubTrue);
  16888. * // => [true, true]
  16889. */
  16890. function stubTrue() {
  16891. return true;
  16892. }
  16893. /**
  16894. * Invokes the iteratee `n` times, returning an array of the results of
  16895. * each invocation. The iteratee is invoked with one argument; (index).
  16896. *
  16897. * @static
  16898. * @since 0.1.0
  16899. * @memberOf _
  16900. * @category Util
  16901. * @param {number} n The number of times to invoke `iteratee`.
  16902. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16903. * @returns {Array} Returns the array of results.
  16904. * @example
  16905. *
  16906. * _.times(3, String);
  16907. * // => ['0', '1', '2']
  16908. *
  16909. * _.times(4, _.constant(0));
  16910. * // => [0, 0, 0, 0]
  16911. */
  16912. function times(n, iteratee) {
  16913. n = toInteger(n);
  16914. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16915. return [];
  16916. }
  16917. var index = MAX_ARRAY_LENGTH,
  16918. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16919. iteratee = getIteratee(iteratee);
  16920. n -= MAX_ARRAY_LENGTH;
  16921. var result = baseTimes(length, iteratee);
  16922. while (++index < n) {
  16923. iteratee(index);
  16924. }
  16925. return result;
  16926. }
  16927. /**
  16928. * Converts `value` to a property path array.
  16929. *
  16930. * @static
  16931. * @memberOf _
  16932. * @since 4.0.0
  16933. * @category Util
  16934. * @param {*} value The value to convert.
  16935. * @returns {Array} Returns the new property path array.
  16936. * @example
  16937. *
  16938. * _.toPath('a.b.c');
  16939. * // => ['a', 'b', 'c']
  16940. *
  16941. * _.toPath('a[0].b.c');
  16942. * // => ['a', '0', 'b', 'c']
  16943. */
  16944. function toPath(value) {
  16945. if (isArray(value)) {
  16946. return arrayMap(value, toKey);
  16947. }
  16948. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16949. }
  16950. /**
  16951. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16952. *
  16953. * @static
  16954. * @since 0.1.0
  16955. * @memberOf _
  16956. * @category Util
  16957. * @param {string} [prefix=''] The value to prefix the ID with.
  16958. * @returns {string} Returns the unique ID.
  16959. * @example
  16960. *
  16961. * _.uniqueId('contact_');
  16962. * // => 'contact_104'
  16963. *
  16964. * _.uniqueId();
  16965. * // => '105'
  16966. */
  16967. function uniqueId(prefix) {
  16968. var id = ++idCounter;
  16969. return toString(prefix) + id;
  16970. }
  16971. /*------------------------------------------------------------------------*/
  16972. /**
  16973. * Adds two numbers.
  16974. *
  16975. * @static
  16976. * @memberOf _
  16977. * @since 3.4.0
  16978. * @category Math
  16979. * @param {number} augend The first number in an addition.
  16980. * @param {number} addend The second number in an addition.
  16981. * @returns {number} Returns the total.
  16982. * @example
  16983. *
  16984. * _.add(6, 4);
  16985. * // => 10
  16986. */
  16987. var add = createMathOperation(function(augend, addend) {
  16988. return augend + addend;
  16989. }, 0);
  16990. /**
  16991. * Computes `number` rounded up to `precision`.
  16992. *
  16993. * @static
  16994. * @memberOf _
  16995. * @since 3.10.0
  16996. * @category Math
  16997. * @param {number} number The number to round up.
  16998. * @param {number} [precision=0] The precision to round up to.
  16999. * @returns {number} Returns the rounded up number.
  17000. * @example
  17001. *
  17002. * _.ceil(4.006);
  17003. * // => 5
  17004. *
  17005. * _.ceil(6.004, 2);
  17006. * // => 6.01
  17007. *
  17008. * _.ceil(6040, -2);
  17009. * // => 6100
  17010. */
  17011. var ceil = createRound('ceil');
  17012. /**
  17013. * Divide two numbers.
  17014. *
  17015. * @static
  17016. * @memberOf _
  17017. * @since 4.7.0
  17018. * @category Math
  17019. * @param {number} dividend The first number in a division.
  17020. * @param {number} divisor The second number in a division.
  17021. * @returns {number} Returns the quotient.
  17022. * @example
  17023. *
  17024. * _.divide(6, 4);
  17025. * // => 1.5
  17026. */
  17027. var divide = createMathOperation(function(dividend, divisor) {
  17028. return dividend / divisor;
  17029. }, 1);
  17030. /**
  17031. * Computes `number` rounded down to `precision`.
  17032. *
  17033. * @static
  17034. * @memberOf _
  17035. * @since 3.10.0
  17036. * @category Math
  17037. * @param {number} number The number to round down.
  17038. * @param {number} [precision=0] The precision to round down to.
  17039. * @returns {number} Returns the rounded down number.
  17040. * @example
  17041. *
  17042. * _.floor(4.006);
  17043. * // => 4
  17044. *
  17045. * _.floor(0.046, 2);
  17046. * // => 0.04
  17047. *
  17048. * _.floor(4060, -2);
  17049. * // => 4000
  17050. */
  17051. var floor = createRound('floor');
  17052. /**
  17053. * Computes the maximum value of `array`. If `array` is empty or falsey,
  17054. * `undefined` is returned.
  17055. *
  17056. * @static
  17057. * @since 0.1.0
  17058. * @memberOf _
  17059. * @category Math
  17060. * @param {Array} array The array to iterate over.
  17061. * @returns {*} Returns the maximum value.
  17062. * @example
  17063. *
  17064. * _.max([4, 2, 8, 6]);
  17065. * // => 8
  17066. *
  17067. * _.max([]);
  17068. * // => undefined
  17069. */
  17070. function max(array) {
  17071. return (array && array.length)
  17072. ? baseExtremum(array, identity, baseGt)
  17073. : undefined;
  17074. }
  17075. /**
  17076. * This method is like `_.max` except that it accepts `iteratee` which is
  17077. * invoked for each element in `array` to generate the criterion by which
  17078. * the value is ranked. The iteratee is invoked with one argument: (value).
  17079. *
  17080. * @static
  17081. * @memberOf _
  17082. * @since 4.0.0
  17083. * @category Math
  17084. * @param {Array} array The array to iterate over.
  17085. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17086. * @returns {*} Returns the maximum value.
  17087. * @example
  17088. *
  17089. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  17090. *
  17091. * _.maxBy(objects, function(o) { return o.n; });
  17092. * // => { 'n': 2 }
  17093. *
  17094. * // The `_.property` iteratee shorthand.
  17095. * _.maxBy(objects, 'n');
  17096. * // => { 'n': 2 }
  17097. */
  17098. function maxBy(array, iteratee) {
  17099. return (array && array.length)
  17100. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  17101. : undefined;
  17102. }
  17103. /**
  17104. * Computes the mean of the values in `array`.
  17105. *
  17106. * @static
  17107. * @memberOf _
  17108. * @since 4.0.0
  17109. * @category Math
  17110. * @param {Array} array The array to iterate over.
  17111. * @returns {number} Returns the mean.
  17112. * @example
  17113. *
  17114. * _.mean([4, 2, 8, 6]);
  17115. * // => 5
  17116. */
  17117. function mean(array) {
  17118. return baseMean(array, identity);
  17119. }
  17120. /**
  17121. * This method is like `_.mean` except that it accepts `iteratee` which is
  17122. * invoked for each element in `array` to generate the value to be averaged.
  17123. * The iteratee is invoked with one argument: (value).
  17124. *
  17125. * @static
  17126. * @memberOf _
  17127. * @since 4.7.0
  17128. * @category Math
  17129. * @param {Array} array The array to iterate over.
  17130. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17131. * @returns {number} Returns the mean.
  17132. * @example
  17133. *
  17134. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  17135. *
  17136. * _.meanBy(objects, function(o) { return o.n; });
  17137. * // => 5
  17138. *
  17139. * // The `_.property` iteratee shorthand.
  17140. * _.meanBy(objects, 'n');
  17141. * // => 5
  17142. */
  17143. function meanBy(array, iteratee) {
  17144. return baseMean(array, getIteratee(iteratee, 2));
  17145. }
  17146. /**
  17147. * Computes the minimum value of `array`. If `array` is empty or falsey,
  17148. * `undefined` is returned.
  17149. *
  17150. * @static
  17151. * @since 0.1.0
  17152. * @memberOf _
  17153. * @category Math
  17154. * @param {Array} array The array to iterate over.
  17155. * @returns {*} Returns the minimum value.
  17156. * @example
  17157. *
  17158. * _.min([4, 2, 8, 6]);
  17159. * // => 2
  17160. *
  17161. * _.min([]);
  17162. * // => undefined
  17163. */
  17164. function min(array) {
  17165. return (array && array.length)
  17166. ? baseExtremum(array, identity, baseLt)
  17167. : undefined;
  17168. }
  17169. /**
  17170. * This method is like `_.min` except that it accepts `iteratee` which is
  17171. * invoked for each element in `array` to generate the criterion by which
  17172. * the value is ranked. The iteratee is invoked with one argument: (value).
  17173. *
  17174. * @static
  17175. * @memberOf _
  17176. * @since 4.0.0
  17177. * @category Math
  17178. * @param {Array} array The array to iterate over.
  17179. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17180. * @returns {*} Returns the minimum value.
  17181. * @example
  17182. *
  17183. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  17184. *
  17185. * _.minBy(objects, function(o) { return o.n; });
  17186. * // => { 'n': 1 }
  17187. *
  17188. * // The `_.property` iteratee shorthand.
  17189. * _.minBy(objects, 'n');
  17190. * // => { 'n': 1 }
  17191. */
  17192. function minBy(array, iteratee) {
  17193. return (array && array.length)
  17194. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  17195. : undefined;
  17196. }
  17197. /**
  17198. * Multiply two numbers.
  17199. *
  17200. * @static
  17201. * @memberOf _
  17202. * @since 4.7.0
  17203. * @category Math
  17204. * @param {number} multiplier The first number in a multiplication.
  17205. * @param {number} multiplicand The second number in a multiplication.
  17206. * @returns {number} Returns the product.
  17207. * @example
  17208. *
  17209. * _.multiply(6, 4);
  17210. * // => 24
  17211. */
  17212. var multiply = createMathOperation(function(multiplier, multiplicand) {
  17213. return multiplier * multiplicand;
  17214. }, 1);
  17215. /**
  17216. * Computes `number` rounded to `precision`.
  17217. *
  17218. * @static
  17219. * @memberOf _
  17220. * @since 3.10.0
  17221. * @category Math
  17222. * @param {number} number The number to round.
  17223. * @param {number} [precision=0] The precision to round to.
  17224. * @returns {number} Returns the rounded number.
  17225. * @example
  17226. *
  17227. * _.round(4.006);
  17228. * // => 4
  17229. *
  17230. * _.round(4.006, 2);
  17231. * // => 4.01
  17232. *
  17233. * _.round(4060, -2);
  17234. * // => 4100
  17235. */
  17236. var round = createRound('round');
  17237. /**
  17238. * Subtract two numbers.
  17239. *
  17240. * @static
  17241. * @memberOf _
  17242. * @since 4.0.0
  17243. * @category Math
  17244. * @param {number} minuend The first number in a subtraction.
  17245. * @param {number} subtrahend The second number in a subtraction.
  17246. * @returns {number} Returns the difference.
  17247. * @example
  17248. *
  17249. * _.subtract(6, 4);
  17250. * // => 2
  17251. */
  17252. var subtract = createMathOperation(function(minuend, subtrahend) {
  17253. return minuend - subtrahend;
  17254. }, 0);
  17255. /**
  17256. * Computes the sum of the values in `array`.
  17257. *
  17258. * @static
  17259. * @memberOf _
  17260. * @since 3.4.0
  17261. * @category Math
  17262. * @param {Array} array The array to iterate over.
  17263. * @returns {number} Returns the sum.
  17264. * @example
  17265. *
  17266. * _.sum([4, 2, 8, 6]);
  17267. * // => 20
  17268. */
  17269. function sum(array) {
  17270. return (array && array.length)
  17271. ? baseSum(array, identity)
  17272. : 0;
  17273. }
  17274. /**
  17275. * This method is like `_.sum` except that it accepts `iteratee` which is
  17276. * invoked for each element in `array` to generate the value to be summed.
  17277. * The iteratee is invoked with one argument: (value).
  17278. *
  17279. * @static
  17280. * @memberOf _
  17281. * @since 4.0.0
  17282. * @category Math
  17283. * @param {Array} array The array to iterate over.
  17284. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17285. * @returns {number} Returns the sum.
  17286. * @example
  17287. *
  17288. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  17289. *
  17290. * _.sumBy(objects, function(o) { return o.n; });
  17291. * // => 20
  17292. *
  17293. * // The `_.property` iteratee shorthand.
  17294. * _.sumBy(objects, 'n');
  17295. * // => 20
  17296. */
  17297. function sumBy(array, iteratee) {
  17298. return (array && array.length)
  17299. ? baseSum(array, getIteratee(iteratee, 2))
  17300. : 0;
  17301. }
  17302. /*------------------------------------------------------------------------*/
  17303. // Add methods that return wrapped values in chain sequences.
  17304. lodash.after = after;
  17305. lodash.ary = ary;
  17306. lodash.assign = assign;
  17307. lodash.assignIn = assignIn;
  17308. lodash.assignInWith = assignInWith;
  17309. lodash.assignWith = assignWith;
  17310. lodash.at = at;
  17311. lodash.before = before;
  17312. lodash.bind = bind;
  17313. lodash.bindAll = bindAll;
  17314. lodash.bindKey = bindKey;
  17315. lodash.castArray = castArray;
  17316. lodash.chain = chain;
  17317. lodash.chunk = chunk;
  17318. lodash.compact = compact;
  17319. lodash.concat = concat;
  17320. lodash.cond = cond;
  17321. lodash.conforms = conforms;
  17322. lodash.constant = constant;
  17323. lodash.countBy = countBy;
  17324. lodash.create = create;
  17325. lodash.curry = curry;
  17326. lodash.curryRight = curryRight;
  17327. lodash.debounce = debounce;
  17328. lodash.defaults = defaults;
  17329. lodash.defaultsDeep = defaultsDeep;
  17330. lodash.defer = defer;
  17331. lodash.delay = delay;
  17332. lodash.difference = difference;
  17333. lodash.differenceBy = differenceBy;
  17334. lodash.differenceWith = differenceWith;
  17335. lodash.drop = drop;
  17336. lodash.dropRight = dropRight;
  17337. lodash.dropRightWhile = dropRightWhile;
  17338. lodash.dropWhile = dropWhile;
  17339. lodash.fill = fill;
  17340. lodash.filter = filter;
  17341. lodash.flatMap = flatMap;
  17342. lodash.flatMapDeep = flatMapDeep;
  17343. lodash.flatMapDepth = flatMapDepth;
  17344. lodash.flatten = flatten;
  17345. lodash.flattenDeep = flattenDeep;
  17346. lodash.flattenDepth = flattenDepth;
  17347. lodash.flip = flip;
  17348. lodash.flow = flow;
  17349. lodash.flowRight = flowRight;
  17350. lodash.fromPairs = fromPairs;
  17351. lodash.functions = functions;
  17352. lodash.functionsIn = functionsIn;
  17353. lodash.groupBy = groupBy;
  17354. lodash.initial = initial;
  17355. lodash.intersection = intersection;
  17356. lodash.intersectionBy = intersectionBy;
  17357. lodash.intersectionWith = intersectionWith;
  17358. lodash.invert = invert;
  17359. lodash.invertBy = invertBy;
  17360. lodash.invokeMap = invokeMap;
  17361. lodash.iteratee = iteratee;
  17362. lodash.keyBy = keyBy;
  17363. lodash.keys = keys;
  17364. lodash.keysIn = keysIn;
  17365. lodash.map = map;
  17366. lodash.mapKeys = mapKeys;
  17367. lodash.mapValues = mapValues;
  17368. lodash.matches = matches;
  17369. lodash.matchesProperty = matchesProperty;
  17370. lodash.memoize = memoize;
  17371. lodash.merge = merge;
  17372. lodash.mergeWith = mergeWith;
  17373. lodash.method = method;
  17374. lodash.methodOf = methodOf;
  17375. lodash.mixin = mixin;
  17376. lodash.negate = negate;
  17377. lodash.nthArg = nthArg;
  17378. lodash.omit = omit;
  17379. lodash.omitBy = omitBy;
  17380. lodash.once = once;
  17381. lodash.orderBy = orderBy;
  17382. lodash.over = over;
  17383. lodash.overArgs = overArgs;
  17384. lodash.overEvery = overEvery;
  17385. lodash.overSome = overSome;
  17386. lodash.partial = partial;
  17387. lodash.partialRight = partialRight;
  17388. lodash.partition = partition;
  17389. lodash.pick = pick;
  17390. lodash.pickBy = pickBy;
  17391. lodash.property = property;
  17392. lodash.propertyOf = propertyOf;
  17393. lodash.pull = pull;
  17394. lodash.pullAll = pullAll;
  17395. lodash.pullAllBy = pullAllBy;
  17396. lodash.pullAllWith = pullAllWith;
  17397. lodash.pullAt = pullAt;
  17398. lodash.range = range;
  17399. lodash.rangeRight = rangeRight;
  17400. lodash.rearg = rearg;
  17401. lodash.reject = reject;
  17402. lodash.remove = remove;
  17403. lodash.rest = rest;
  17404. lodash.reverse = reverse;
  17405. lodash.sampleSize = sampleSize;
  17406. lodash.set = set;
  17407. lodash.setWith = setWith;
  17408. lodash.shuffle = shuffle;
  17409. lodash.slice = slice;
  17410. lodash.sortBy = sortBy;
  17411. lodash.sortedUniq = sortedUniq;
  17412. lodash.sortedUniqBy = sortedUniqBy;
  17413. lodash.split = split;
  17414. lodash.spread = spread;
  17415. lodash.tail = tail;
  17416. lodash.take = take;
  17417. lodash.takeRight = takeRight;
  17418. lodash.takeRightWhile = takeRightWhile;
  17419. lodash.takeWhile = takeWhile;
  17420. lodash.tap = tap;
  17421. lodash.throttle = throttle;
  17422. lodash.thru = thru;
  17423. lodash.toArray = toArray;
  17424. lodash.toPairs = toPairs;
  17425. lodash.toPairsIn = toPairsIn;
  17426. lodash.toPath = toPath;
  17427. lodash.toPlainObject = toPlainObject;
  17428. lodash.transform = transform;
  17429. lodash.unary = unary;
  17430. lodash.union = union;
  17431. lodash.unionBy = unionBy;
  17432. lodash.unionWith = unionWith;
  17433. lodash.uniq = uniq;
  17434. lodash.uniqBy = uniqBy;
  17435. lodash.uniqWith = uniqWith;
  17436. lodash.unset = unset;
  17437. lodash.unzip = unzip;
  17438. lodash.unzipWith = unzipWith;
  17439. lodash.update = update;
  17440. lodash.updateWith = updateWith;
  17441. lodash.values = values;
  17442. lodash.valuesIn = valuesIn;
  17443. lodash.without = without;
  17444. lodash.words = words;
  17445. lodash.wrap = wrap;
  17446. lodash.xor = xor;
  17447. lodash.xorBy = xorBy;
  17448. lodash.xorWith = xorWith;
  17449. lodash.zip = zip;
  17450. lodash.zipObject = zipObject;
  17451. lodash.zipObjectDeep = zipObjectDeep;
  17452. lodash.zipWith = zipWith;
  17453. // Add aliases.
  17454. lodash.entries = toPairs;
  17455. lodash.entriesIn = toPairsIn;
  17456. lodash.extend = assignIn;
  17457. lodash.extendWith = assignInWith;
  17458. // Add methods to `lodash.prototype`.
  17459. mixin(lodash, lodash);
  17460. /*------------------------------------------------------------------------*/
  17461. // Add methods that return unwrapped values in chain sequences.
  17462. lodash.add = add;
  17463. lodash.attempt = attempt;
  17464. lodash.camelCase = camelCase;
  17465. lodash.capitalize = capitalize;
  17466. lodash.ceil = ceil;
  17467. lodash.clamp = clamp;
  17468. lodash.clone = clone;
  17469. lodash.cloneDeep = cloneDeep;
  17470. lodash.cloneDeepWith = cloneDeepWith;
  17471. lodash.cloneWith = cloneWith;
  17472. lodash.conformsTo = conformsTo;
  17473. lodash.deburr = deburr;
  17474. lodash.defaultTo = defaultTo;
  17475. lodash.divide = divide;
  17476. lodash.endsWith = endsWith;
  17477. lodash.eq = eq;
  17478. lodash.escape = escape;
  17479. lodash.escapeRegExp = escapeRegExp;
  17480. lodash.every = every;
  17481. lodash.find = find;
  17482. lodash.findIndex = findIndex;
  17483. lodash.findKey = findKey;
  17484. lodash.findLast = findLast;
  17485. lodash.findLastIndex = findLastIndex;
  17486. lodash.findLastKey = findLastKey;
  17487. lodash.floor = floor;
  17488. lodash.forEach = forEach;
  17489. lodash.forEachRight = forEachRight;
  17490. lodash.forIn = forIn;
  17491. lodash.forInRight = forInRight;
  17492. lodash.forOwn = forOwn;
  17493. lodash.forOwnRight = forOwnRight;
  17494. lodash.get = get;
  17495. lodash.gt = gt;
  17496. lodash.gte = gte;
  17497. lodash.has = has;
  17498. lodash.hasIn = hasIn;
  17499. lodash.head = head;
  17500. lodash.identity = identity;
  17501. lodash.includes = includes;
  17502. lodash.indexOf = indexOf;
  17503. lodash.inRange = inRange;
  17504. lodash.invoke = invoke;
  17505. lodash.isArguments = isArguments;
  17506. lodash.isArray = isArray;
  17507. lodash.isArrayBuffer = isArrayBuffer;
  17508. lodash.isArrayLike = isArrayLike;
  17509. lodash.isArrayLikeObject = isArrayLikeObject;
  17510. lodash.isBoolean = isBoolean;
  17511. lodash.isBuffer = isBuffer;
  17512. lodash.isDate = isDate;
  17513. lodash.isElement = isElement;
  17514. lodash.isEmpty = isEmpty;
  17515. lodash.isEqual = isEqual;
  17516. lodash.isEqualWith = isEqualWith;
  17517. lodash.isError = isError;
  17518. lodash.isFinite = isFinite;
  17519. lodash.isFunction = isFunction;
  17520. lodash.isInteger = isInteger;
  17521. lodash.isLength = isLength;
  17522. lodash.isMap = isMap;
  17523. lodash.isMatch = isMatch;
  17524. lodash.isMatchWith = isMatchWith;
  17525. lodash.isNaN = isNaN;
  17526. lodash.isNative = isNative;
  17527. lodash.isNil = isNil;
  17528. lodash.isNull = isNull;
  17529. lodash.isNumber = isNumber;
  17530. lodash.isObject = isObject;
  17531. lodash.isObjectLike = isObjectLike;
  17532. lodash.isPlainObject = isPlainObject;
  17533. lodash.isRegExp = isRegExp;
  17534. lodash.isSafeInteger = isSafeInteger;
  17535. lodash.isSet = isSet;
  17536. lodash.isString = isString;
  17537. lodash.isSymbol = isSymbol;
  17538. lodash.isTypedArray = isTypedArray;
  17539. lodash.isUndefined = isUndefined;
  17540. lodash.isWeakMap = isWeakMap;
  17541. lodash.isWeakSet = isWeakSet;
  17542. lodash.join = join;
  17543. lodash.kebabCase = kebabCase;
  17544. lodash.last = last;
  17545. lodash.lastIndexOf = lastIndexOf;
  17546. lodash.lowerCase = lowerCase;
  17547. lodash.lowerFirst = lowerFirst;
  17548. lodash.lt = lt;
  17549. lodash.lte = lte;
  17550. lodash.max = max;
  17551. lodash.maxBy = maxBy;
  17552. lodash.mean = mean;
  17553. lodash.meanBy = meanBy;
  17554. lodash.min = min;
  17555. lodash.minBy = minBy;
  17556. lodash.stubArray = stubArray;
  17557. lodash.stubFalse = stubFalse;
  17558. lodash.stubObject = stubObject;
  17559. lodash.stubString = stubString;
  17560. lodash.stubTrue = stubTrue;
  17561. lodash.multiply = multiply;
  17562. lodash.nth = nth;
  17563. lodash.noConflict = noConflict;
  17564. lodash.noop = noop;
  17565. lodash.now = now;
  17566. lodash.pad = pad;
  17567. lodash.padEnd = padEnd;
  17568. lodash.padStart = padStart;
  17569. lodash.parseInt = parseInt;
  17570. lodash.random = random;
  17571. lodash.reduce = reduce;
  17572. lodash.reduceRight = reduceRight;
  17573. lodash.repeat = repeat;
  17574. lodash.replace = replace;
  17575. lodash.result = result;
  17576. lodash.round = round;
  17577. lodash.runInContext = runInContext;
  17578. lodash.sample = sample;
  17579. lodash.size = size;
  17580. lodash.snakeCase = snakeCase;
  17581. lodash.some = some;
  17582. lodash.sortedIndex = sortedIndex;
  17583. lodash.sortedIndexBy = sortedIndexBy;
  17584. lodash.sortedIndexOf = sortedIndexOf;
  17585. lodash.sortedLastIndex = sortedLastIndex;
  17586. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17587. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17588. lodash.startCase = startCase;
  17589. lodash.startsWith = startsWith;
  17590. lodash.subtract = subtract;
  17591. lodash.sum = sum;
  17592. lodash.sumBy = sumBy;
  17593. lodash.template = template;
  17594. lodash.times = times;
  17595. lodash.toFinite = toFinite;
  17596. lodash.toInteger = toInteger;
  17597. lodash.toLength = toLength;
  17598. lodash.toLower = toLower;
  17599. lodash.toNumber = toNumber;
  17600. lodash.toSafeInteger = toSafeInteger;
  17601. lodash.toString = toString;
  17602. lodash.toUpper = toUpper;
  17603. lodash.trim = trim;
  17604. lodash.trimEnd = trimEnd;
  17605. lodash.trimStart = trimStart;
  17606. lodash.truncate = truncate;
  17607. lodash.unescape = unescape;
  17608. lodash.uniqueId = uniqueId;
  17609. lodash.upperCase = upperCase;
  17610. lodash.upperFirst = upperFirst;
  17611. // Add aliases.
  17612. lodash.each = forEach;
  17613. lodash.eachRight = forEachRight;
  17614. lodash.first = head;
  17615. mixin(lodash, (function() {
  17616. var source = {};
  17617. baseForOwn(lodash, function(func, methodName) {
  17618. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17619. source[methodName] = func;
  17620. }
  17621. });
  17622. return source;
  17623. }()), { 'chain': false });
  17624. /*------------------------------------------------------------------------*/
  17625. /**
  17626. * The semantic version number.
  17627. *
  17628. * @static
  17629. * @memberOf _
  17630. * @type {string}
  17631. */
  17632. lodash.VERSION = VERSION;
  17633. // Assign default placeholders.
  17634. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17635. lodash[methodName].placeholder = lodash;
  17636. });
  17637. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17638. arrayEach(['drop', 'take'], function(methodName, index) {
  17639. LazyWrapper.prototype[methodName] = function(n) {
  17640. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17641. var result = (this.__filtered__ && !index)
  17642. ? new LazyWrapper(this)
  17643. : this.clone();
  17644. if (result.__filtered__) {
  17645. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17646. } else {
  17647. result.__views__.push({
  17648. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17649. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17650. });
  17651. }
  17652. return result;
  17653. };
  17654. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17655. return this.reverse()[methodName](n).reverse();
  17656. };
  17657. });
  17658. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17659. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17660. var type = index + 1,
  17661. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17662. LazyWrapper.prototype[methodName] = function(iteratee) {
  17663. var result = this.clone();
  17664. result.__iteratees__.push({
  17665. 'iteratee': getIteratee(iteratee, 3),
  17666. 'type': type
  17667. });
  17668. result.__filtered__ = result.__filtered__ || isFilter;
  17669. return result;
  17670. };
  17671. });
  17672. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17673. arrayEach(['head', 'last'], function(methodName, index) {
  17674. var takeName = 'take' + (index ? 'Right' : '');
  17675. LazyWrapper.prototype[methodName] = function() {
  17676. return this[takeName](1).value()[0];
  17677. };
  17678. });
  17679. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17680. arrayEach(['initial', 'tail'], function(methodName, index) {
  17681. var dropName = 'drop' + (index ? '' : 'Right');
  17682. LazyWrapper.prototype[methodName] = function() {
  17683. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17684. };
  17685. });
  17686. LazyWrapper.prototype.compact = function() {
  17687. return this.filter(identity);
  17688. };
  17689. LazyWrapper.prototype.find = function(predicate) {
  17690. return this.filter(predicate).head();
  17691. };
  17692. LazyWrapper.prototype.findLast = function(predicate) {
  17693. return this.reverse().find(predicate);
  17694. };
  17695. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17696. if (typeof path == 'function') {
  17697. return new LazyWrapper(this);
  17698. }
  17699. return this.map(function(value) {
  17700. return baseInvoke(value, path, args);
  17701. });
  17702. });
  17703. LazyWrapper.prototype.reject = function(predicate) {
  17704. return this.filter(negate(getIteratee(predicate)));
  17705. };
  17706. LazyWrapper.prototype.slice = function(start, end) {
  17707. start = toInteger(start);
  17708. var result = this;
  17709. if (result.__filtered__ && (start > 0 || end < 0)) {
  17710. return new LazyWrapper(result);
  17711. }
  17712. if (start < 0) {
  17713. result = result.takeRight(-start);
  17714. } else if (start) {
  17715. result = result.drop(start);
  17716. }
  17717. if (end !== undefined) {
  17718. end = toInteger(end);
  17719. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17720. }
  17721. return result;
  17722. };
  17723. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17724. return this.reverse().takeWhile(predicate).reverse();
  17725. };
  17726. LazyWrapper.prototype.toArray = function() {
  17727. return this.take(MAX_ARRAY_LENGTH);
  17728. };
  17729. // Add `LazyWrapper` methods to `lodash.prototype`.
  17730. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17731. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17732. isTaker = /^(?:head|last)$/.test(methodName),
  17733. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17734. retUnwrapped = isTaker || /^find/.test(methodName);
  17735. if (!lodashFunc) {
  17736. return;
  17737. }
  17738. lodash.prototype[methodName] = function() {
  17739. var value = this.__wrapped__,
  17740. args = isTaker ? [1] : arguments,
  17741. isLazy = value instanceof LazyWrapper,
  17742. iteratee = args[0],
  17743. useLazy = isLazy || isArray(value);
  17744. var interceptor = function(value) {
  17745. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17746. return (isTaker && chainAll) ? result[0] : result;
  17747. };
  17748. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17749. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17750. isLazy = useLazy = false;
  17751. }
  17752. var chainAll = this.__chain__,
  17753. isHybrid = !!this.__actions__.length,
  17754. isUnwrapped = retUnwrapped && !chainAll,
  17755. onlyLazy = isLazy && !isHybrid;
  17756. if (!retUnwrapped && useLazy) {
  17757. value = onlyLazy ? value : new LazyWrapper(this);
  17758. var result = func.apply(value, args);
  17759. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17760. return new LodashWrapper(result, chainAll);
  17761. }
  17762. if (isUnwrapped && onlyLazy) {
  17763. return func.apply(this, args);
  17764. }
  17765. result = this.thru(interceptor);
  17766. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17767. };
  17768. });
  17769. // Add `Array` methods to `lodash.prototype`.
  17770. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17771. var func = arrayProto[methodName],
  17772. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17773. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17774. lodash.prototype[methodName] = function() {
  17775. var args = arguments;
  17776. if (retUnwrapped && !this.__chain__) {
  17777. var value = this.value();
  17778. return func.apply(isArray(value) ? value : [], args);
  17779. }
  17780. return this[chainName](function(value) {
  17781. return func.apply(isArray(value) ? value : [], args);
  17782. });
  17783. };
  17784. });
  17785. // Map minified method names to their real names.
  17786. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17787. var lodashFunc = lodash[methodName];
  17788. if (lodashFunc) {
  17789. var key = lodashFunc.name + '';
  17790. if (!hasOwnProperty.call(realNames, key)) {
  17791. realNames[key] = [];
  17792. }
  17793. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17794. }
  17795. });
  17796. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17797. 'name': 'wrapper',
  17798. 'func': undefined
  17799. }];
  17800. // Add methods to `LazyWrapper`.
  17801. LazyWrapper.prototype.clone = lazyClone;
  17802. LazyWrapper.prototype.reverse = lazyReverse;
  17803. LazyWrapper.prototype.value = lazyValue;
  17804. // Add chain sequence methods to the `lodash` wrapper.
  17805. lodash.prototype.at = wrapperAt;
  17806. lodash.prototype.chain = wrapperChain;
  17807. lodash.prototype.commit = wrapperCommit;
  17808. lodash.prototype.next = wrapperNext;
  17809. lodash.prototype.plant = wrapperPlant;
  17810. lodash.prototype.reverse = wrapperReverse;
  17811. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17812. // Add lazy aliases.
  17813. lodash.prototype.first = lodash.prototype.head;
  17814. if (symIterator) {
  17815. lodash.prototype[symIterator] = wrapperToIterator;
  17816. }
  17817. return lodash;
  17818. });
  17819. /*--------------------------------------------------------------------------*/
  17820. // Export lodash.
  17821. var _ = runInContext();
  17822. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17823. if (true) {
  17824. // Expose Lodash on the global object to prevent errors when Lodash is
  17825. // loaded by a script tag in the presence of an AMD loader.
  17826. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17827. // Use `_.noConflict` to remove Lodash from the global object.
  17828. root._ = _;
  17829. // Define as an anonymous module so, through path mapping, it can be
  17830. // referenced as the "underscore" module.
  17831. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17832. return _;
  17833. }).call(exports, __webpack_require__, exports, module),
  17834. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17835. }
  17836. // Check for `exports` after `define` in case a build optimizer adds it.
  17837. else {}
  17838. }.call(this));
  17839. /***/ }),
  17840. /***/ "./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":
  17841. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17842. !*** ./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 ***!
  17843. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17844. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17845. "use strict";
  17846. __webpack_require__.r(__webpack_exports__);
  17847. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17848. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17849. /* harmony export */ });
  17850. /* 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");
  17851. /* 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__);
  17852. /* 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");
  17853. var options = {};
  17854. options.insert = "head";
  17855. options.singleton = false;
  17856. 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);
  17857. /* 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 || {});
  17858. /***/ }),
  17859. /***/ "./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":
  17860. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17861. !*** ./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 ***!
  17862. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17863. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17864. "use strict";
  17865. __webpack_require__.r(__webpack_exports__);
  17866. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17867. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17868. /* harmony export */ });
  17869. /* 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");
  17870. /* 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__);
  17871. /* 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");
  17872. var options = {};
  17873. options.insert = "head";
  17874. options.singleton = false;
  17875. 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);
  17876. /* 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 || {});
  17877. /***/ }),
  17878. /***/ "./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":
  17879. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17880. !*** ./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 ***!
  17881. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17882. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17883. "use strict";
  17884. __webpack_require__.r(__webpack_exports__);
  17885. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17886. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17887. /* harmony export */ });
  17888. /* 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");
  17889. /* 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__);
  17890. /* 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");
  17891. var options = {};
  17892. options.insert = "head";
  17893. options.singleton = false;
  17894. 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);
  17895. /* 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 || {});
  17896. /***/ }),
  17897. /***/ "./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":
  17898. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17899. !*** ./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 ***!
  17900. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17901. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17902. "use strict";
  17903. __webpack_require__.r(__webpack_exports__);
  17904. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17905. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17906. /* harmony export */ });
  17907. /* 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");
  17908. /* 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__);
  17909. /* 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");
  17910. var options = {};
  17911. options.insert = "head";
  17912. options.singleton = false;
  17913. 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);
  17914. /* 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 || {});
  17915. /***/ }),
  17916. /***/ "./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":
  17917. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17918. !*** ./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 ***!
  17919. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17920. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17921. "use strict";
  17922. __webpack_require__.r(__webpack_exports__);
  17923. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17924. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17925. /* harmony export */ });
  17926. /* 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");
  17927. /* 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__);
  17928. /* 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");
  17929. var options = {};
  17930. options.insert = "head";
  17931. options.singleton = false;
  17932. 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);
  17933. /* 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 || {});
  17934. /***/ }),
  17935. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17936. /*!******************************************************!*\
  17937. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17938. \******************************************************/
  17939. /***/ ((__unused_webpack_module, exports) => {
  17940. "use strict";
  17941. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17942. // runtime helper for setting properties on components
  17943. // in a tree-shakable way
  17944. exports["default"] = (sfc, props) => {
  17945. const target = sfc.__vccOpts || sfc;
  17946. for (const [key, val] of props) {
  17947. target[key] = val;
  17948. }
  17949. return target;
  17950. };
  17951. /***/ }),
  17952. /***/ "./resources/js/components/AppDropdown.vue":
  17953. /*!*************************************************!*\
  17954. !*** ./resources/js/components/AppDropdown.vue ***!
  17955. \*************************************************/
  17956. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17957. "use strict";
  17958. __webpack_require__.r(__webpack_exports__);
  17959. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17960. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17961. /* harmony export */ });
  17962. /* harmony import */ var _AppDropdown_vue_vue_type_template_id_ce0d1992__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppDropdown.vue?vue&type=template&id=ce0d1992 */ "./resources/js/components/AppDropdown.vue?vue&type=template&id=ce0d1992");
  17963. /* harmony import */ var _AppDropdown_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppDropdown.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppDropdown.vue?vue&type=script&setup=true&lang=js");
  17964. /* 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");
  17965. ;
  17966. 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"])(_AppDropdown_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppDropdown_vue_vue_type_template_id_ce0d1992__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppDropdown.vue"]])
  17967. /* hot reload */
  17968. if (false) {}
  17969. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17970. /***/ }),
  17971. /***/ "./resources/js/components/AppFooter.vue":
  17972. /*!***********************************************!*\
  17973. !*** ./resources/js/components/AppFooter.vue ***!
  17974. \***********************************************/
  17975. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17976. "use strict";
  17977. __webpack_require__.r(__webpack_exports__);
  17978. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17979. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17980. /* harmony export */ });
  17981. /* 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");
  17982. /* 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");
  17983. /* 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");
  17984. const script = {}
  17985. ;
  17986. 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"]])
  17987. /* hot reload */
  17988. if (false) {}
  17989. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17990. /***/ }),
  17991. /***/ "./resources/js/components/AppInputText.vue":
  17992. /*!**************************************************!*\
  17993. !*** ./resources/js/components/AppInputText.vue ***!
  17994. \**************************************************/
  17995. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17996. "use strict";
  17997. __webpack_require__.r(__webpack_exports__);
  17998. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17999. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18000. /* harmony export */ });
  18001. /* harmony import */ var _AppInputText_vue_vue_type_template_id_16729fe1__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppInputText.vue?vue&type=template&id=16729fe1 */ "./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1");
  18002. /* harmony import */ var _AppInputText_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppInputText.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppInputText.vue?vue&type=script&setup=true&lang=js");
  18003. /* 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");
  18004. ;
  18005. 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"])(_AppInputText_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppInputText_vue_vue_type_template_id_16729fe1__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppInputText.vue"]])
  18006. /* hot reload */
  18007. if (false) {}
  18008. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18009. /***/ }),
  18010. /***/ "./resources/js/components/AppMessage.vue":
  18011. /*!************************************************!*\
  18012. !*** ./resources/js/components/AppMessage.vue ***!
  18013. \************************************************/
  18014. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18015. "use strict";
  18016. __webpack_require__.r(__webpack_exports__);
  18017. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18018. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18019. /* harmony export */ });
  18020. /* 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");
  18021. /* 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");
  18022. /* 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");
  18023. ;
  18024. 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"]])
  18025. /* hot reload */
  18026. if (false) {}
  18027. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18028. /***/ }),
  18029. /***/ "./resources/js/components/AppSidebar.vue":
  18030. /*!************************************************!*\
  18031. !*** ./resources/js/components/AppSidebar.vue ***!
  18032. \************************************************/
  18033. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18034. "use strict";
  18035. __webpack_require__.r(__webpack_exports__);
  18036. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18037. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18038. /* harmony export */ });
  18039. /* 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");
  18040. /* 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");
  18041. /* 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");
  18042. /* 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");
  18043. ;
  18044. 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"]])
  18045. /* hot reload */
  18046. if (false) {}
  18047. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18048. /***/ }),
  18049. /***/ "./resources/js/components/AppSubSidebar.vue":
  18050. /*!***************************************************!*\
  18051. !*** ./resources/js/components/AppSubSidebar.vue ***!
  18052. \***************************************************/
  18053. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18054. "use strict";
  18055. __webpack_require__.r(__webpack_exports__);
  18056. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18057. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18058. /* harmony export */ });
  18059. /* 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");
  18060. /* 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");
  18061. /* 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");
  18062. /* 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");
  18063. ;
  18064. 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"]])
  18065. /* hot reload */
  18066. if (false) {}
  18067. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18068. /***/ }),
  18069. /***/ "./resources/js/components/AppTopBar.vue":
  18070. /*!***********************************************!*\
  18071. !*** ./resources/js/components/AppTopBar.vue ***!
  18072. \***********************************************/
  18073. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18074. "use strict";
  18075. __webpack_require__.r(__webpack_exports__);
  18076. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18077. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18078. /* harmony export */ });
  18079. /* 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");
  18080. /* 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");
  18081. /* 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");
  18082. /* 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");
  18083. ;
  18084. 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"]])
  18085. /* hot reload */
  18086. if (false) {}
  18087. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18088. /***/ }),
  18089. /***/ "./resources/js/layouts/DashboardLayout.vue":
  18090. /*!**************************************************!*\
  18091. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  18092. \**************************************************/
  18093. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18094. "use strict";
  18095. __webpack_require__.r(__webpack_exports__);
  18096. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18097. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18098. /* harmony export */ });
  18099. /* 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");
  18100. /* 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");
  18101. /* 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");
  18102. /* 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");
  18103. ;
  18104. 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"]])
  18105. /* hot reload */
  18106. if (false) {}
  18107. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18108. /***/ }),
  18109. /***/ "./resources/js/pages/member/Edit.vue":
  18110. /*!********************************************!*\
  18111. !*** ./resources/js/pages/member/Edit.vue ***!
  18112. \********************************************/
  18113. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18114. "use strict";
  18115. __webpack_require__.r(__webpack_exports__);
  18116. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18117. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18118. /* harmony export */ });
  18119. /* harmony import */ var _Edit_vue_vue_type_template_id_1a9fb226__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Edit.vue?vue&type=template&id=1a9fb226 */ "./resources/js/pages/member/Edit.vue?vue&type=template&id=1a9fb226");
  18120. /* harmony import */ var _Edit_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Edit.vue?vue&type=script&setup=true&lang=js */ "./resources/js/pages/member/Edit.vue?vue&type=script&setup=true&lang=js");
  18121. /* 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");
  18122. ;
  18123. 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"])(_Edit_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Edit_vue_vue_type_template_id_1a9fb226__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/member/Edit.vue"]])
  18124. /* hot reload */
  18125. if (false) {}
  18126. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18127. /***/ }),
  18128. /***/ "./resources/js/components/AppDropdown.vue?vue&type=script&setup=true&lang=js":
  18129. /*!************************************************************************************!*\
  18130. !*** ./resources/js/components/AppDropdown.vue?vue&type=script&setup=true&lang=js ***!
  18131. \************************************************************************************/
  18132. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18133. "use strict";
  18134. __webpack_require__.r(__webpack_exports__);
  18135. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18136. /* 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_AppDropdown_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  18137. /* harmony export */ });
  18138. /* 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_AppDropdown_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]!./AppDropdown.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/AppDropdown.vue?vue&type=script&setup=true&lang=js");
  18139. /***/ }),
  18140. /***/ "./resources/js/components/AppInputText.vue?vue&type=script&setup=true&lang=js":
  18141. /*!*************************************************************************************!*\
  18142. !*** ./resources/js/components/AppInputText.vue?vue&type=script&setup=true&lang=js ***!
  18143. \*************************************************************************************/
  18144. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18145. "use strict";
  18146. __webpack_require__.r(__webpack_exports__);
  18147. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18148. /* 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_AppInputText_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  18149. /* harmony export */ });
  18150. /* 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_AppInputText_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]!./AppInputText.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/AppInputText.vue?vue&type=script&setup=true&lang=js");
  18151. /***/ }),
  18152. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  18153. /*!***********************************************************************************!*\
  18154. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  18155. \***********************************************************************************/
  18156. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18157. "use strict";
  18158. __webpack_require__.r(__webpack_exports__);
  18159. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18160. /* 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"])
  18161. /* harmony export */ });
  18162. /* 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");
  18163. /***/ }),
  18164. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  18165. /*!***********************************************************************************!*\
  18166. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  18167. \***********************************************************************************/
  18168. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18169. "use strict";
  18170. __webpack_require__.r(__webpack_exports__);
  18171. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18172. /* 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"])
  18173. /* harmony export */ });
  18174. /* 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");
  18175. /***/ }),
  18176. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  18177. /*!**************************************************************************************!*\
  18178. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  18179. \**************************************************************************************/
  18180. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18181. "use strict";
  18182. __webpack_require__.r(__webpack_exports__);
  18183. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18184. /* 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"])
  18185. /* harmony export */ });
  18186. /* 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");
  18187. /***/ }),
  18188. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  18189. /*!**********************************************************************************!*\
  18190. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  18191. \**********************************************************************************/
  18192. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18193. "use strict";
  18194. __webpack_require__.r(__webpack_exports__);
  18195. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18196. /* 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"])
  18197. /* harmony export */ });
  18198. /* 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");
  18199. /***/ }),
  18200. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  18201. /*!*************************************************************************************!*\
  18202. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  18203. \*************************************************************************************/
  18204. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18205. "use strict";
  18206. __webpack_require__.r(__webpack_exports__);
  18207. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18208. /* 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"])
  18209. /* harmony export */ });
  18210. /* 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");
  18211. /***/ }),
  18212. /***/ "./resources/js/pages/member/Edit.vue?vue&type=script&setup=true&lang=js":
  18213. /*!*******************************************************************************!*\
  18214. !*** ./resources/js/pages/member/Edit.vue?vue&type=script&setup=true&lang=js ***!
  18215. \*******************************************************************************/
  18216. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18217. "use strict";
  18218. __webpack_require__.r(__webpack_exports__);
  18219. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18220. /* 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_Edit_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  18221. /* harmony export */ });
  18222. /* 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_Edit_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]!./Edit.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/member/Edit.vue?vue&type=script&setup=true&lang=js");
  18223. /***/ }),
  18224. /***/ "./resources/js/components/AppDropdown.vue?vue&type=template&id=ce0d1992":
  18225. /*!*******************************************************************************!*\
  18226. !*** ./resources/js/components/AppDropdown.vue?vue&type=template&id=ce0d1992 ***!
  18227. \*******************************************************************************/
  18228. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18229. "use strict";
  18230. __webpack_require__.r(__webpack_exports__);
  18231. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18232. /* 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_AppDropdown_vue_vue_type_template_id_ce0d1992__WEBPACK_IMPORTED_MODULE_0__.render)
  18233. /* harmony export */ });
  18234. /* 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_AppDropdown_vue_vue_type_template_id_ce0d1992__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]!./AppDropdown.vue?vue&type=template&id=ce0d1992 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/AppDropdown.vue?vue&type=template&id=ce0d1992");
  18235. /***/ }),
  18236. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  18237. /*!*****************************************************************************************!*\
  18238. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  18239. \*****************************************************************************************/
  18240. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18241. "use strict";
  18242. __webpack_require__.r(__webpack_exports__);
  18243. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18244. /* 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)
  18245. /* harmony export */ });
  18246. /* 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");
  18247. /***/ }),
  18248. /***/ "./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1":
  18249. /*!********************************************************************************!*\
  18250. !*** ./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1 ***!
  18251. \********************************************************************************/
  18252. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18253. "use strict";
  18254. __webpack_require__.r(__webpack_exports__);
  18255. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18256. /* 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_AppInputText_vue_vue_type_template_id_16729fe1__WEBPACK_IMPORTED_MODULE_0__.render)
  18257. /* harmony export */ });
  18258. /* 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_AppInputText_vue_vue_type_template_id_16729fe1__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]!./AppInputText.vue?vue&type=template&id=16729fe1 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/AppInputText.vue?vue&type=template&id=16729fe1");
  18259. /***/ }),
  18260. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  18261. /*!******************************************************************************!*\
  18262. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  18263. \******************************************************************************/
  18264. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18265. "use strict";
  18266. __webpack_require__.r(__webpack_exports__);
  18267. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18268. /* 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)
  18269. /* harmony export */ });
  18270. /* 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");
  18271. /***/ }),
  18272. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  18273. /*!******************************************************************************************!*\
  18274. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  18275. \******************************************************************************************/
  18276. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18277. "use strict";
  18278. __webpack_require__.r(__webpack_exports__);
  18279. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18280. /* 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)
  18281. /* harmony export */ });
  18282. /* 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");
  18283. /***/ }),
  18284. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  18285. /*!*********************************************************************************************!*\
  18286. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  18287. \*********************************************************************************************/
  18288. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18289. "use strict";
  18290. __webpack_require__.r(__webpack_exports__);
  18291. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18292. /* 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)
  18293. /* harmony export */ });
  18294. /* 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");
  18295. /***/ }),
  18296. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  18297. /*!*****************************************************************************************!*\
  18298. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  18299. \*****************************************************************************************/
  18300. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18301. "use strict";
  18302. __webpack_require__.r(__webpack_exports__);
  18303. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18304. /* 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)
  18305. /* harmony export */ });
  18306. /* 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");
  18307. /***/ }),
  18308. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  18309. /*!********************************************************************************************!*\
  18310. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  18311. \********************************************************************************************/
  18312. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18313. "use strict";
  18314. __webpack_require__.r(__webpack_exports__);
  18315. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18316. /* 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)
  18317. /* harmony export */ });
  18318. /* 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");
  18319. /***/ }),
  18320. /***/ "./resources/js/pages/member/Edit.vue?vue&type=template&id=1a9fb226":
  18321. /*!**************************************************************************!*\
  18322. !*** ./resources/js/pages/member/Edit.vue?vue&type=template&id=1a9fb226 ***!
  18323. \**************************************************************************/
  18324. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18325. "use strict";
  18326. __webpack_require__.r(__webpack_exports__);
  18327. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18328. /* 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_Edit_vue_vue_type_template_id_1a9fb226__WEBPACK_IMPORTED_MODULE_0__.render)
  18329. /* harmony export */ });
  18330. /* 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_Edit_vue_vue_type_template_id_1a9fb226__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]!./Edit.vue?vue&type=template&id=1a9fb226 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/member/Edit.vue?vue&type=template&id=1a9fb226");
  18331. /***/ }),
  18332. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  18333. /*!********************************************************************************************************!*\
  18334. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  18335. \********************************************************************************************************/
  18336. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18337. "use strict";
  18338. __webpack_require__.r(__webpack_exports__);
  18339. /* 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");
  18340. /***/ }),
  18341. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  18342. /*!*********************************************************************************************************!*\
  18343. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  18344. \*********************************************************************************************************/
  18345. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18346. "use strict";
  18347. __webpack_require__.r(__webpack_exports__);
  18348. /* 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");
  18349. /***/ }),
  18350. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  18351. /*!************************************************************************************************************!*\
  18352. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  18353. \************************************************************************************************************/
  18354. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18355. "use strict";
  18356. __webpack_require__.r(__webpack_exports__);
  18357. /* 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");
  18358. /***/ }),
  18359. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  18360. /*!********************************************************************************************************!*\
  18361. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  18362. \********************************************************************************************************/
  18363. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18364. "use strict";
  18365. __webpack_require__.r(__webpack_exports__);
  18366. /* 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");
  18367. /***/ }),
  18368. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  18369. /*!***********************************************************************************************************!*\
  18370. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  18371. \***********************************************************************************************************/
  18372. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18373. "use strict";
  18374. __webpack_require__.r(__webpack_exports__);
  18375. /* 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");
  18376. /***/ })
  18377. }]);