resources_js_pages_member_Edit_vue.js 718KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915
  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: props.member.phone,
  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: 'phone',
  1338. header: 'Nomor HP'
  1339. }, {
  1340. field: 'platNumber',
  1341. header: 'Plat Kendaraan'
  1342. }, {
  1343. field: 'type',
  1344. header: 'Jenis Member'
  1345. }, {
  1346. field: 'price',
  1347. header: 'Tarif Member'
  1348. }, {
  1349. field: 'expDate',
  1350. header: 'Berakhir'
  1351. }];
  1352. var platNumberTable = [{
  1353. field: 'platNumber',
  1354. header: 'Plat Kendaraan'
  1355. }, {
  1356. field: 'typeVehicle',
  1357. header: 'Jenis Kendaraan'
  1358. }];
  1359. /***/ }),
  1360. /***/ "./resources/js/pages/member/useVehicle.js":
  1361. /*!*************************************************!*\
  1362. !*** ./resources/js/pages/member/useVehicle.js ***!
  1363. \*************************************************/
  1364. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1365. "use strict";
  1366. __webpack_require__.r(__webpack_exports__);
  1367. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1368. /* harmony export */ "useVehicle": () => (/* binding */ useVehicle)
  1369. /* harmony export */ });
  1370. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1371. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  1372. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  1373. /* harmony import */ var _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/utils/formValidationError */ "./resources/js/utils/formValidationError.js");
  1374. function useVehicle(props, form) {
  1375. var listVehicle = (0,vue__WEBPACK_IMPORTED_MODULE_0__.reactive)([]);
  1376. (0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
  1377. props.initialVehicles.forEach(function (val) {
  1378. return listVehicle.push(val);
  1379. });
  1380. });
  1381. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(function () {
  1382. return form.type_member_id;
  1383. }, function () {
  1384. vehicleClear();
  1385. form.reset('plat_number', 'max_vehicle_id');
  1386. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.reload({
  1387. only: ['typeMember'],
  1388. data: {
  1389. id: form.type_member_id
  1390. }
  1391. });
  1392. });
  1393. var vehicleClear = function vehicleClear() {
  1394. listVehicle.splice(0);
  1395. };
  1396. var vehicleOnDelete = function vehicleOnDelete(index) {
  1397. listVehicle.splice(index, 1);
  1398. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.usePage)().props.value.errors = {};
  1399. };
  1400. var vehicleAddValidation = function vehicleAddValidation() {
  1401. if (!form.plat_number) {
  1402. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Plat kendaraan tidak boleh kosong', 'plat_number');
  1403. }
  1404. if (!form.max_vehicle_id) {
  1405. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Tidak boleh kosong', 'max_vehicle_id');
  1406. }
  1407. var platNumberExist = listVehicle.filter(function (vehicle) {
  1408. return vehicle.platNumber === form.plat_number.toUpperCase();
  1409. });
  1410. if (platNumberExist.length) {
  1411. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Nomor plat kendaraan tidak boleh sama', 'plat_number');
  1412. }
  1413. var maxVehicles = listVehicle.filter(function (vehicle) {
  1414. return vehicle.maxVehicleId === form.max_vehicle_id;
  1415. });
  1416. if (maxVehicles.length) {
  1417. if (maxVehicles.length + 1 > maxVehicles[0].maxVehicle) {
  1418. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Melibihi batas maksimal kendaraan', 'plat_number');
  1419. }
  1420. }
  1421. };
  1422. var vehicleOnAdd = function vehicleOnAdd() {
  1423. try {
  1424. form.clearErrors('plat_number', 'max_vehicle_id');
  1425. vehicleAddValidation();
  1426. var typeVehicle = props.typeMember.maxVehicles.filter(function (maxVehicle) {
  1427. return maxVehicle.value === form.max_vehicle_id;
  1428. })[0];
  1429. listVehicle.push({
  1430. platNumber: form.plat_number.toUpperCase(),
  1431. typeVehicle: typeVehicle.label,
  1432. typeVehicleId: typeVehicle.typeVehicleId,
  1433. maxVehicleId: typeVehicle.value,
  1434. maxVehicle: typeVehicle.maxVehicle
  1435. });
  1436. form.reset('plat_number', 'max_vehicle_id');
  1437. } catch (err) {
  1438. form.setError(err.field, err.message);
  1439. }
  1440. };
  1441. return {
  1442. listVehicle: listVehicle,
  1443. vehicleClear: vehicleClear,
  1444. vehicleOnDelete: vehicleOnDelete,
  1445. vehicleOnAdd: vehicleOnAdd
  1446. };
  1447. }
  1448. /***/ }),
  1449. /***/ "./resources/js/utils/formValidationError.js":
  1450. /*!***************************************************!*\
  1451. !*** ./resources/js/utils/formValidationError.js ***!
  1452. \***************************************************/
  1453. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1454. "use strict";
  1455. __webpack_require__.r(__webpack_exports__);
  1456. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1457. /* harmony export */ "default": () => (/* binding */ FormValidationError)
  1458. /* harmony export */ });
  1459. 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); }
  1460. 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); } }
  1461. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  1462. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1463. 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); }
  1464. 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); }; }
  1465. 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); }
  1466. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  1467. 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); }
  1468. 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); }
  1469. 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; } }
  1470. function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
  1471. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  1472. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  1473. var FormValidationError = /*#__PURE__*/function (_Error) {
  1474. _inherits(FormValidationError, _Error);
  1475. var _super = _createSuper(FormValidationError);
  1476. function FormValidationError(message, field) {
  1477. var _this;
  1478. _classCallCheck(this, FormValidationError);
  1479. _this = _super.call(this, message);
  1480. _this.field = field;
  1481. return _this;
  1482. }
  1483. return _createClass(FormValidationError);
  1484. }( /*#__PURE__*/_wrapNativeSuper(Error));
  1485. /***/ }),
  1486. /***/ "./resources/js/utils/menu.js":
  1487. /*!************************************!*\
  1488. !*** ./resources/js/utils/menu.js ***!
  1489. \************************************/
  1490. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1491. "use strict";
  1492. __webpack_require__.r(__webpack_exports__);
  1493. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1494. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1495. /* harmony export */ });
  1496. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1497. // Admin
  1498. 1: [{
  1499. label: 'Home',
  1500. items: [{
  1501. label: 'Dashboard',
  1502. icon: 'pi pi-home',
  1503. to: '/dashboards',
  1504. component: 'home/Index'
  1505. }]
  1506. }, {
  1507. label: 'Master',
  1508. items: [{
  1509. label: 'User',
  1510. icon: 'pi pi-user',
  1511. to: '/users',
  1512. component: 'user/Index'
  1513. }]
  1514. }],
  1515. // Supervisor
  1516. 2: [{
  1517. label: 'Home',
  1518. items: [{
  1519. label: 'Dashboard',
  1520. icon: 'pi pi-home',
  1521. to: '/dashboards',
  1522. component: 'home/Index'
  1523. }]
  1524. }, {
  1525. label: 'Menu',
  1526. items: [{
  1527. label: 'Pengeluaran',
  1528. icon: 'pi pi-wallet',
  1529. to: '/expenses',
  1530. component: 'expense/Index'
  1531. }, {
  1532. label: 'Laporan',
  1533. icon: 'pi pi-book',
  1534. items: [{
  1535. label: 'Mutasi',
  1536. icon: 'pi pi-circle',
  1537. to: '/reports/mutations',
  1538. component: 'mutation/Report'
  1539. }]
  1540. }]
  1541. }, {
  1542. label: 'Master',
  1543. items: [{
  1544. label: 'Jenis Kendaraan',
  1545. icon: 'pi pi-car',
  1546. to: '/type-vehicles',
  1547. component: 'typevehicle/Index'
  1548. }, {
  1549. label: 'Jenis Member',
  1550. icon: 'pi pi-id-card',
  1551. to: '/type-members',
  1552. component: 'typemember/Index'
  1553. }]
  1554. }, {
  1555. label: 'Pengaturan',
  1556. items: [{
  1557. label: 'Tarif Parkir',
  1558. icon: 'pi pi-car',
  1559. to: '/parking-fees/create',
  1560. component: 'parkingfee/Create'
  1561. }]
  1562. }],
  1563. // Operator
  1564. 3: [{
  1565. label: 'Home',
  1566. items: [{
  1567. label: 'Dashboard',
  1568. icon: 'pi pi-home',
  1569. to: '/dashboards',
  1570. component: 'home/Index'
  1571. }]
  1572. }, {
  1573. label: 'Menu',
  1574. items: [{
  1575. label: 'Pengeluaran',
  1576. icon: 'pi pi-wallet',
  1577. to: '/expenses',
  1578. component: 'expense/Index'
  1579. }, {
  1580. label: 'Member',
  1581. icon: 'pi pi-id-card',
  1582. to: '/members',
  1583. component: 'member/Index'
  1584. }, {
  1585. label: 'Top Up',
  1586. icon: 'pi pi-car',
  1587. to: '/top-ups',
  1588. component: 'topup/Index'
  1589. }]
  1590. }]
  1591. });
  1592. /***/ }),
  1593. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1594. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1595. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1596. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1597. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1598. "use strict";
  1599. __webpack_require__.r(__webpack_exports__);
  1600. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1601. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1602. /* harmony export */ });
  1603. /* 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");
  1604. /* 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__);
  1605. // Imports
  1606. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1607. // Module
  1608. ___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}", ""]);
  1609. // Exports
  1610. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1611. /***/ }),
  1612. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1613. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1614. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1615. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1616. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1617. "use strict";
  1618. __webpack_require__.r(__webpack_exports__);
  1619. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1620. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1621. /* harmony export */ });
  1622. /* 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");
  1623. /* 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__);
  1624. // Imports
  1625. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1626. // Module
  1627. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1628. // Exports
  1629. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1630. /***/ }),
  1631. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1632. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1633. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1634. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1635. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1636. "use strict";
  1637. __webpack_require__.r(__webpack_exports__);
  1638. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1639. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1640. /* harmony export */ });
  1641. /* 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");
  1642. /* 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__);
  1643. // Imports
  1644. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1645. // Module
  1646. ___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}", ""]);
  1647. // Exports
  1648. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1649. /***/ }),
  1650. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1651. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1652. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1653. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1654. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1655. "use strict";
  1656. __webpack_require__.r(__webpack_exports__);
  1657. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1658. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1659. /* harmony export */ });
  1660. /* 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");
  1661. /* 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__);
  1662. // Imports
  1663. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1664. // Module
  1665. ___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}", ""]);
  1666. // Exports
  1667. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1668. /***/ }),
  1669. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1670. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1671. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1672. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1673. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1674. "use strict";
  1675. __webpack_require__.r(__webpack_exports__);
  1676. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1677. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1678. /* harmony export */ });
  1679. /* 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");
  1680. /* 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__);
  1681. // Imports
  1682. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1683. // Module
  1684. ___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}", ""]);
  1685. // Exports
  1686. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1687. /***/ }),
  1688. /***/ "./node_modules/lodash/lodash.js":
  1689. /*!***************************************!*\
  1690. !*** ./node_modules/lodash/lodash.js ***!
  1691. \***************************************/
  1692. /***/ (function(module, exports, __webpack_require__) {
  1693. /* module decorator */ module = __webpack_require__.nmd(module);
  1694. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1695. * @license
  1696. * Lodash <https://lodash.com/>
  1697. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1698. * Released under MIT license <https://lodash.com/license>
  1699. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1700. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1701. */
  1702. ;(function() {
  1703. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1704. var undefined;
  1705. /** Used as the semantic version number. */
  1706. var VERSION = '4.17.21';
  1707. /** Used as the size to enable large array optimizations. */
  1708. var LARGE_ARRAY_SIZE = 200;
  1709. /** Error message constants. */
  1710. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1711. FUNC_ERROR_TEXT = 'Expected a function',
  1712. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1713. /** Used to stand-in for `undefined` hash values. */
  1714. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1715. /** Used as the maximum memoize cache size. */
  1716. var MAX_MEMOIZE_SIZE = 500;
  1717. /** Used as the internal argument placeholder. */
  1718. var PLACEHOLDER = '__lodash_placeholder__';
  1719. /** Used to compose bitmasks for cloning. */
  1720. var CLONE_DEEP_FLAG = 1,
  1721. CLONE_FLAT_FLAG = 2,
  1722. CLONE_SYMBOLS_FLAG = 4;
  1723. /** Used to compose bitmasks for value comparisons. */
  1724. var COMPARE_PARTIAL_FLAG = 1,
  1725. COMPARE_UNORDERED_FLAG = 2;
  1726. /** Used to compose bitmasks for function metadata. */
  1727. var WRAP_BIND_FLAG = 1,
  1728. WRAP_BIND_KEY_FLAG = 2,
  1729. WRAP_CURRY_BOUND_FLAG = 4,
  1730. WRAP_CURRY_FLAG = 8,
  1731. WRAP_CURRY_RIGHT_FLAG = 16,
  1732. WRAP_PARTIAL_FLAG = 32,
  1733. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1734. WRAP_ARY_FLAG = 128,
  1735. WRAP_REARG_FLAG = 256,
  1736. WRAP_FLIP_FLAG = 512;
  1737. /** Used as default options for `_.truncate`. */
  1738. var DEFAULT_TRUNC_LENGTH = 30,
  1739. DEFAULT_TRUNC_OMISSION = '...';
  1740. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1741. var HOT_COUNT = 800,
  1742. HOT_SPAN = 16;
  1743. /** Used to indicate the type of lazy iteratees. */
  1744. var LAZY_FILTER_FLAG = 1,
  1745. LAZY_MAP_FLAG = 2,
  1746. LAZY_WHILE_FLAG = 3;
  1747. /** Used as references for various `Number` constants. */
  1748. var INFINITY = 1 / 0,
  1749. MAX_SAFE_INTEGER = 9007199254740991,
  1750. MAX_INTEGER = 1.7976931348623157e+308,
  1751. NAN = 0 / 0;
  1752. /** Used as references for the maximum length and index of an array. */
  1753. var MAX_ARRAY_LENGTH = 4294967295,
  1754. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1755. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1756. /** Used to associate wrap methods with their bit flags. */
  1757. var wrapFlags = [
  1758. ['ary', WRAP_ARY_FLAG],
  1759. ['bind', WRAP_BIND_FLAG],
  1760. ['bindKey', WRAP_BIND_KEY_FLAG],
  1761. ['curry', WRAP_CURRY_FLAG],
  1762. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1763. ['flip', WRAP_FLIP_FLAG],
  1764. ['partial', WRAP_PARTIAL_FLAG],
  1765. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1766. ['rearg', WRAP_REARG_FLAG]
  1767. ];
  1768. /** `Object#toString` result references. */
  1769. var argsTag = '[object Arguments]',
  1770. arrayTag = '[object Array]',
  1771. asyncTag = '[object AsyncFunction]',
  1772. boolTag = '[object Boolean]',
  1773. dateTag = '[object Date]',
  1774. domExcTag = '[object DOMException]',
  1775. errorTag = '[object Error]',
  1776. funcTag = '[object Function]',
  1777. genTag = '[object GeneratorFunction]',
  1778. mapTag = '[object Map]',
  1779. numberTag = '[object Number]',
  1780. nullTag = '[object Null]',
  1781. objectTag = '[object Object]',
  1782. promiseTag = '[object Promise]',
  1783. proxyTag = '[object Proxy]',
  1784. regexpTag = '[object RegExp]',
  1785. setTag = '[object Set]',
  1786. stringTag = '[object String]',
  1787. symbolTag = '[object Symbol]',
  1788. undefinedTag = '[object Undefined]',
  1789. weakMapTag = '[object WeakMap]',
  1790. weakSetTag = '[object WeakSet]';
  1791. var arrayBufferTag = '[object ArrayBuffer]',
  1792. dataViewTag = '[object DataView]',
  1793. float32Tag = '[object Float32Array]',
  1794. float64Tag = '[object Float64Array]',
  1795. int8Tag = '[object Int8Array]',
  1796. int16Tag = '[object Int16Array]',
  1797. int32Tag = '[object Int32Array]',
  1798. uint8Tag = '[object Uint8Array]',
  1799. uint8ClampedTag = '[object Uint8ClampedArray]',
  1800. uint16Tag = '[object Uint16Array]',
  1801. uint32Tag = '[object Uint32Array]';
  1802. /** Used to match empty string literals in compiled template source. */
  1803. var reEmptyStringLeading = /\b__p \+= '';/g,
  1804. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1805. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1806. /** Used to match HTML entities and HTML characters. */
  1807. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1808. reUnescapedHtml = /[&<>"']/g,
  1809. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1810. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1811. /** Used to match template delimiters. */
  1812. var reEscape = /<%-([\s\S]+?)%>/g,
  1813. reEvaluate = /<%([\s\S]+?)%>/g,
  1814. reInterpolate = /<%=([\s\S]+?)%>/g;
  1815. /** Used to match property names within property paths. */
  1816. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1817. reIsPlainProp = /^\w*$/,
  1818. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1819. /**
  1820. * Used to match `RegExp`
  1821. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1822. */
  1823. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1824. reHasRegExpChar = RegExp(reRegExpChar.source);
  1825. /** Used to match leading whitespace. */
  1826. var reTrimStart = /^\s+/;
  1827. /** Used to match a single whitespace character. */
  1828. var reWhitespace = /\s/;
  1829. /** Used to match wrap detail comments. */
  1830. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1831. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1832. reSplitDetails = /,? & /;
  1833. /** Used to match words composed of alphanumeric characters. */
  1834. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1835. /**
  1836. * Used to validate the `validate` option in `_.template` variable.
  1837. *
  1838. * Forbids characters which could potentially change the meaning of the function argument definition:
  1839. * - "()," (modification of function parameters)
  1840. * - "=" (default value)
  1841. * - "[]{}" (destructuring of function parameters)
  1842. * - "/" (beginning of a comment)
  1843. * - whitespace
  1844. */
  1845. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1846. /** Used to match backslashes in property paths. */
  1847. var reEscapeChar = /\\(\\)?/g;
  1848. /**
  1849. * Used to match
  1850. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1851. */
  1852. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1853. /** Used to match `RegExp` flags from their coerced string values. */
  1854. var reFlags = /\w*$/;
  1855. /** Used to detect bad signed hexadecimal string values. */
  1856. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1857. /** Used to detect binary string values. */
  1858. var reIsBinary = /^0b[01]+$/i;
  1859. /** Used to detect host constructors (Safari). */
  1860. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1861. /** Used to detect octal string values. */
  1862. var reIsOctal = /^0o[0-7]+$/i;
  1863. /** Used to detect unsigned integer values. */
  1864. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1865. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1866. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1867. /** Used to ensure capturing order of template delimiters. */
  1868. var reNoMatch = /($^)/;
  1869. /** Used to match unescaped characters in compiled string literals. */
  1870. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1871. /** Used to compose unicode character classes. */
  1872. var rsAstralRange = '\\ud800-\\udfff',
  1873. rsComboMarksRange = '\\u0300-\\u036f',
  1874. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1875. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1876. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1877. rsDingbatRange = '\\u2700-\\u27bf',
  1878. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1879. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1880. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1881. rsPunctuationRange = '\\u2000-\\u206f',
  1882. 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',
  1883. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1884. rsVarRange = '\\ufe0e\\ufe0f',
  1885. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1886. /** Used to compose unicode capture groups. */
  1887. var rsApos = "['\u2019]",
  1888. rsAstral = '[' + rsAstralRange + ']',
  1889. rsBreak = '[' + rsBreakRange + ']',
  1890. rsCombo = '[' + rsComboRange + ']',
  1891. rsDigits = '\\d+',
  1892. rsDingbat = '[' + rsDingbatRange + ']',
  1893. rsLower = '[' + rsLowerRange + ']',
  1894. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1895. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1896. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1897. rsNonAstral = '[^' + rsAstralRange + ']',
  1898. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1899. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1900. rsUpper = '[' + rsUpperRange + ']',
  1901. rsZWJ = '\\u200d';
  1902. /** Used to compose unicode regexes. */
  1903. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1904. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1905. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1906. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1907. reOptMod = rsModifier + '?',
  1908. rsOptVar = '[' + rsVarRange + ']?',
  1909. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1910. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1911. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1912. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1913. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1914. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1915. /** Used to match apostrophes. */
  1916. var reApos = RegExp(rsApos, 'g');
  1917. /**
  1918. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1919. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1920. */
  1921. var reComboMark = RegExp(rsCombo, 'g');
  1922. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1923. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1924. /** Used to match complex or compound words. */
  1925. var reUnicodeWord = RegExp([
  1926. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1927. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1928. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1929. rsUpper + '+' + rsOptContrUpper,
  1930. rsOrdUpper,
  1931. rsOrdLower,
  1932. rsDigits,
  1933. rsEmoji
  1934. ].join('|'), 'g');
  1935. /** 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/). */
  1936. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1937. /** Used to detect strings that need a more robust regexp to match words. */
  1938. 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 ]/;
  1939. /** Used to assign default `context` object properties. */
  1940. var contextProps = [
  1941. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1942. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1943. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1944. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1945. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1946. ];
  1947. /** Used to make template sourceURLs easier to identify. */
  1948. var templateCounter = -1;
  1949. /** Used to identify `toStringTag` values of typed arrays. */
  1950. var typedArrayTags = {};
  1951. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1952. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1953. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1954. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1955. typedArrayTags[uint32Tag] = true;
  1956. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1957. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1958. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1959. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1960. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1961. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1962. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1963. typedArrayTags[weakMapTag] = false;
  1964. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1965. var cloneableTags = {};
  1966. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1967. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1968. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1969. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1970. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1971. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1972. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1973. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1974. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1975. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1976. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1977. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1978. cloneableTags[weakMapTag] = false;
  1979. /** Used to map Latin Unicode letters to basic Latin letters. */
  1980. var deburredLetters = {
  1981. // Latin-1 Supplement block.
  1982. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1983. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1984. '\xc7': 'C', '\xe7': 'c',
  1985. '\xd0': 'D', '\xf0': 'd',
  1986. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1987. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1988. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1989. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1990. '\xd1': 'N', '\xf1': 'n',
  1991. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1992. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1993. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1994. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1995. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1996. '\xc6': 'Ae', '\xe6': 'ae',
  1997. '\xde': 'Th', '\xfe': 'th',
  1998. '\xdf': 'ss',
  1999. // Latin Extended-A block.
  2000. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  2001. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  2002. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  2003. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  2004. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  2005. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  2006. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  2007. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  2008. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  2009. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  2010. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  2011. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  2012. '\u0134': 'J', '\u0135': 'j',
  2013. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  2014. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  2015. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  2016. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  2017. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  2018. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  2019. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  2020. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  2021. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  2022. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  2023. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  2024. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  2025. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  2026. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  2027. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  2028. '\u0174': 'W', '\u0175': 'w',
  2029. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  2030. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  2031. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  2032. '\u0132': 'IJ', '\u0133': 'ij',
  2033. '\u0152': 'Oe', '\u0153': 'oe',
  2034. '\u0149': "'n", '\u017f': 's'
  2035. };
  2036. /** Used to map characters to HTML entities. */
  2037. var htmlEscapes = {
  2038. '&': '&amp;',
  2039. '<': '&lt;',
  2040. '>': '&gt;',
  2041. '"': '&quot;',
  2042. "'": '&#39;'
  2043. };
  2044. /** Used to map HTML entities to characters. */
  2045. var htmlUnescapes = {
  2046. '&amp;': '&',
  2047. '&lt;': '<',
  2048. '&gt;': '>',
  2049. '&quot;': '"',
  2050. '&#39;': "'"
  2051. };
  2052. /** Used to escape characters for inclusion in compiled string literals. */
  2053. var stringEscapes = {
  2054. '\\': '\\',
  2055. "'": "'",
  2056. '\n': 'n',
  2057. '\r': 'r',
  2058. '\u2028': 'u2028',
  2059. '\u2029': 'u2029'
  2060. };
  2061. /** Built-in method references without a dependency on `root`. */
  2062. var freeParseFloat = parseFloat,
  2063. freeParseInt = parseInt;
  2064. /** Detect free variable `global` from Node.js. */
  2065. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  2066. /** Detect free variable `self`. */
  2067. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  2068. /** Used as a reference to the global object. */
  2069. var root = freeGlobal || freeSelf || Function('return this')();
  2070. /** Detect free variable `exports`. */
  2071. var freeExports = true && exports && !exports.nodeType && exports;
  2072. /** Detect free variable `module`. */
  2073. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  2074. /** Detect the popular CommonJS extension `module.exports`. */
  2075. var moduleExports = freeModule && freeModule.exports === freeExports;
  2076. /** Detect free variable `process` from Node.js. */
  2077. var freeProcess = moduleExports && freeGlobal.process;
  2078. /** Used to access faster Node.js helpers. */
  2079. var nodeUtil = (function() {
  2080. try {
  2081. // Use `util.types` for Node.js 10+.
  2082. var types = freeModule && freeModule.require && freeModule.require('util').types;
  2083. if (types) {
  2084. return types;
  2085. }
  2086. // Legacy `process.binding('util')` for Node.js < 10.
  2087. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  2088. } catch (e) {}
  2089. }());
  2090. /* Node.js helper references. */
  2091. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  2092. nodeIsDate = nodeUtil && nodeUtil.isDate,
  2093. nodeIsMap = nodeUtil && nodeUtil.isMap,
  2094. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  2095. nodeIsSet = nodeUtil && nodeUtil.isSet,
  2096. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  2097. /*--------------------------------------------------------------------------*/
  2098. /**
  2099. * A faster alternative to `Function#apply`, this function invokes `func`
  2100. * with the `this` binding of `thisArg` and the arguments of `args`.
  2101. *
  2102. * @private
  2103. * @param {Function} func The function to invoke.
  2104. * @param {*} thisArg The `this` binding of `func`.
  2105. * @param {Array} args The arguments to invoke `func` with.
  2106. * @returns {*} Returns the result of `func`.
  2107. */
  2108. function apply(func, thisArg, args) {
  2109. switch (args.length) {
  2110. case 0: return func.call(thisArg);
  2111. case 1: return func.call(thisArg, args[0]);
  2112. case 2: return func.call(thisArg, args[0], args[1]);
  2113. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  2114. }
  2115. return func.apply(thisArg, args);
  2116. }
  2117. /**
  2118. * A specialized version of `baseAggregator` for arrays.
  2119. *
  2120. * @private
  2121. * @param {Array} [array] The array to iterate over.
  2122. * @param {Function} setter The function to set `accumulator` values.
  2123. * @param {Function} iteratee The iteratee to transform keys.
  2124. * @param {Object} accumulator The initial aggregated object.
  2125. * @returns {Function} Returns `accumulator`.
  2126. */
  2127. function arrayAggregator(array, setter, iteratee, accumulator) {
  2128. var index = -1,
  2129. length = array == null ? 0 : array.length;
  2130. while (++index < length) {
  2131. var value = array[index];
  2132. setter(accumulator, value, iteratee(value), array);
  2133. }
  2134. return accumulator;
  2135. }
  2136. /**
  2137. * A specialized version of `_.forEach` for arrays without support for
  2138. * iteratee shorthands.
  2139. *
  2140. * @private
  2141. * @param {Array} [array] The array to iterate over.
  2142. * @param {Function} iteratee The function invoked per iteration.
  2143. * @returns {Array} Returns `array`.
  2144. */
  2145. function arrayEach(array, iteratee) {
  2146. var index = -1,
  2147. length = array == null ? 0 : array.length;
  2148. while (++index < length) {
  2149. if (iteratee(array[index], index, array) === false) {
  2150. break;
  2151. }
  2152. }
  2153. return array;
  2154. }
  2155. /**
  2156. * A specialized version of `_.forEachRight` for arrays without support for
  2157. * iteratee shorthands.
  2158. *
  2159. * @private
  2160. * @param {Array} [array] The array to iterate over.
  2161. * @param {Function} iteratee The function invoked per iteration.
  2162. * @returns {Array} Returns `array`.
  2163. */
  2164. function arrayEachRight(array, iteratee) {
  2165. var length = array == null ? 0 : array.length;
  2166. while (length--) {
  2167. if (iteratee(array[length], length, array) === false) {
  2168. break;
  2169. }
  2170. }
  2171. return array;
  2172. }
  2173. /**
  2174. * A specialized version of `_.every` for arrays without support for
  2175. * iteratee shorthands.
  2176. *
  2177. * @private
  2178. * @param {Array} [array] The array to iterate over.
  2179. * @param {Function} predicate The function invoked per iteration.
  2180. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  2181. * else `false`.
  2182. */
  2183. function arrayEvery(array, predicate) {
  2184. var index = -1,
  2185. length = array == null ? 0 : array.length;
  2186. while (++index < length) {
  2187. if (!predicate(array[index], index, array)) {
  2188. return false;
  2189. }
  2190. }
  2191. return true;
  2192. }
  2193. /**
  2194. * A specialized version of `_.filter` for arrays without support for
  2195. * iteratee shorthands.
  2196. *
  2197. * @private
  2198. * @param {Array} [array] The array to iterate over.
  2199. * @param {Function} predicate The function invoked per iteration.
  2200. * @returns {Array} Returns the new filtered array.
  2201. */
  2202. function arrayFilter(array, predicate) {
  2203. var index = -1,
  2204. length = array == null ? 0 : array.length,
  2205. resIndex = 0,
  2206. result = [];
  2207. while (++index < length) {
  2208. var value = array[index];
  2209. if (predicate(value, index, array)) {
  2210. result[resIndex++] = value;
  2211. }
  2212. }
  2213. return result;
  2214. }
  2215. /**
  2216. * A specialized version of `_.includes` for arrays without support for
  2217. * specifying an index to search from.
  2218. *
  2219. * @private
  2220. * @param {Array} [array] The array to inspect.
  2221. * @param {*} target The value to search for.
  2222. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  2223. */
  2224. function arrayIncludes(array, value) {
  2225. var length = array == null ? 0 : array.length;
  2226. return !!length && baseIndexOf(array, value, 0) > -1;
  2227. }
  2228. /**
  2229. * This function is like `arrayIncludes` except that it accepts a comparator.
  2230. *
  2231. * @private
  2232. * @param {Array} [array] The array to inspect.
  2233. * @param {*} target The value to search for.
  2234. * @param {Function} comparator The comparator invoked per element.
  2235. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  2236. */
  2237. function arrayIncludesWith(array, value, comparator) {
  2238. var index = -1,
  2239. length = array == null ? 0 : array.length;
  2240. while (++index < length) {
  2241. if (comparator(value, array[index])) {
  2242. return true;
  2243. }
  2244. }
  2245. return false;
  2246. }
  2247. /**
  2248. * A specialized version of `_.map` for arrays without support for iteratee
  2249. * shorthands.
  2250. *
  2251. * @private
  2252. * @param {Array} [array] The array to iterate over.
  2253. * @param {Function} iteratee The function invoked per iteration.
  2254. * @returns {Array} Returns the new mapped array.
  2255. */
  2256. function arrayMap(array, iteratee) {
  2257. var index = -1,
  2258. length = array == null ? 0 : array.length,
  2259. result = Array(length);
  2260. while (++index < length) {
  2261. result[index] = iteratee(array[index], index, array);
  2262. }
  2263. return result;
  2264. }
  2265. /**
  2266. * Appends the elements of `values` to `array`.
  2267. *
  2268. * @private
  2269. * @param {Array} array The array to modify.
  2270. * @param {Array} values The values to append.
  2271. * @returns {Array} Returns `array`.
  2272. */
  2273. function arrayPush(array, values) {
  2274. var index = -1,
  2275. length = values.length,
  2276. offset = array.length;
  2277. while (++index < length) {
  2278. array[offset + index] = values[index];
  2279. }
  2280. return array;
  2281. }
  2282. /**
  2283. * A specialized version of `_.reduce` for arrays without support for
  2284. * iteratee shorthands.
  2285. *
  2286. * @private
  2287. * @param {Array} [array] The array to iterate over.
  2288. * @param {Function} iteratee The function invoked per iteration.
  2289. * @param {*} [accumulator] The initial value.
  2290. * @param {boolean} [initAccum] Specify using the first element of `array` as
  2291. * the initial value.
  2292. * @returns {*} Returns the accumulated value.
  2293. */
  2294. function arrayReduce(array, iteratee, accumulator, initAccum) {
  2295. var index = -1,
  2296. length = array == null ? 0 : array.length;
  2297. if (initAccum && length) {
  2298. accumulator = array[++index];
  2299. }
  2300. while (++index < length) {
  2301. accumulator = iteratee(accumulator, array[index], index, array);
  2302. }
  2303. return accumulator;
  2304. }
  2305. /**
  2306. * A specialized version of `_.reduceRight` for arrays without support for
  2307. * iteratee shorthands.
  2308. *
  2309. * @private
  2310. * @param {Array} [array] The array to iterate over.
  2311. * @param {Function} iteratee The function invoked per iteration.
  2312. * @param {*} [accumulator] The initial value.
  2313. * @param {boolean} [initAccum] Specify using the last element of `array` as
  2314. * the initial value.
  2315. * @returns {*} Returns the accumulated value.
  2316. */
  2317. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  2318. var length = array == null ? 0 : array.length;
  2319. if (initAccum && length) {
  2320. accumulator = array[--length];
  2321. }
  2322. while (length--) {
  2323. accumulator = iteratee(accumulator, array[length], length, array);
  2324. }
  2325. return accumulator;
  2326. }
  2327. /**
  2328. * A specialized version of `_.some` for arrays without support for iteratee
  2329. * shorthands.
  2330. *
  2331. * @private
  2332. * @param {Array} [array] The array to iterate over.
  2333. * @param {Function} predicate The function invoked per iteration.
  2334. * @returns {boolean} Returns `true` if any element passes the predicate check,
  2335. * else `false`.
  2336. */
  2337. function arraySome(array, predicate) {
  2338. var index = -1,
  2339. length = array == null ? 0 : array.length;
  2340. while (++index < length) {
  2341. if (predicate(array[index], index, array)) {
  2342. return true;
  2343. }
  2344. }
  2345. return false;
  2346. }
  2347. /**
  2348. * Gets the size of an ASCII `string`.
  2349. *
  2350. * @private
  2351. * @param {string} string The string inspect.
  2352. * @returns {number} Returns the string size.
  2353. */
  2354. var asciiSize = baseProperty('length');
  2355. /**
  2356. * Converts an ASCII `string` to an array.
  2357. *
  2358. * @private
  2359. * @param {string} string The string to convert.
  2360. * @returns {Array} Returns the converted array.
  2361. */
  2362. function asciiToArray(string) {
  2363. return string.split('');
  2364. }
  2365. /**
  2366. * Splits an ASCII `string` into an array of its words.
  2367. *
  2368. * @private
  2369. * @param {string} The string to inspect.
  2370. * @returns {Array} Returns the words of `string`.
  2371. */
  2372. function asciiWords(string) {
  2373. return string.match(reAsciiWord) || [];
  2374. }
  2375. /**
  2376. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  2377. * without support for iteratee shorthands, which iterates over `collection`
  2378. * using `eachFunc`.
  2379. *
  2380. * @private
  2381. * @param {Array|Object} collection The collection to inspect.
  2382. * @param {Function} predicate The function invoked per iteration.
  2383. * @param {Function} eachFunc The function to iterate over `collection`.
  2384. * @returns {*} Returns the found element or its key, else `undefined`.
  2385. */
  2386. function baseFindKey(collection, predicate, eachFunc) {
  2387. var result;
  2388. eachFunc(collection, function(value, key, collection) {
  2389. if (predicate(value, key, collection)) {
  2390. result = key;
  2391. return false;
  2392. }
  2393. });
  2394. return result;
  2395. }
  2396. /**
  2397. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  2398. * support for iteratee shorthands.
  2399. *
  2400. * @private
  2401. * @param {Array} array The array to inspect.
  2402. * @param {Function} predicate The function invoked per iteration.
  2403. * @param {number} fromIndex The index to search from.
  2404. * @param {boolean} [fromRight] Specify iterating from right to left.
  2405. * @returns {number} Returns the index of the matched value, else `-1`.
  2406. */
  2407. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  2408. var length = array.length,
  2409. index = fromIndex + (fromRight ? 1 : -1);
  2410. while ((fromRight ? index-- : ++index < length)) {
  2411. if (predicate(array[index], index, array)) {
  2412. return index;
  2413. }
  2414. }
  2415. return -1;
  2416. }
  2417. /**
  2418. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  2419. *
  2420. * @private
  2421. * @param {Array} array The array to inspect.
  2422. * @param {*} value The value to search for.
  2423. * @param {number} fromIndex The index to search from.
  2424. * @returns {number} Returns the index of the matched value, else `-1`.
  2425. */
  2426. function baseIndexOf(array, value, fromIndex) {
  2427. return value === value
  2428. ? strictIndexOf(array, value, fromIndex)
  2429. : baseFindIndex(array, baseIsNaN, fromIndex);
  2430. }
  2431. /**
  2432. * This function is like `baseIndexOf` except that it accepts a comparator.
  2433. *
  2434. * @private
  2435. * @param {Array} array The array to inspect.
  2436. * @param {*} value The value to search for.
  2437. * @param {number} fromIndex The index to search from.
  2438. * @param {Function} comparator The comparator invoked per element.
  2439. * @returns {number} Returns the index of the matched value, else `-1`.
  2440. */
  2441. function baseIndexOfWith(array, value, fromIndex, comparator) {
  2442. var index = fromIndex - 1,
  2443. length = array.length;
  2444. while (++index < length) {
  2445. if (comparator(array[index], value)) {
  2446. return index;
  2447. }
  2448. }
  2449. return -1;
  2450. }
  2451. /**
  2452. * The base implementation of `_.isNaN` without support for number objects.
  2453. *
  2454. * @private
  2455. * @param {*} value The value to check.
  2456. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  2457. */
  2458. function baseIsNaN(value) {
  2459. return value !== value;
  2460. }
  2461. /**
  2462. * The base implementation of `_.mean` and `_.meanBy` without support for
  2463. * iteratee shorthands.
  2464. *
  2465. * @private
  2466. * @param {Array} array The array to iterate over.
  2467. * @param {Function} iteratee The function invoked per iteration.
  2468. * @returns {number} Returns the mean.
  2469. */
  2470. function baseMean(array, iteratee) {
  2471. var length = array == null ? 0 : array.length;
  2472. return length ? (baseSum(array, iteratee) / length) : NAN;
  2473. }
  2474. /**
  2475. * The base implementation of `_.property` without support for deep paths.
  2476. *
  2477. * @private
  2478. * @param {string} key The key of the property to get.
  2479. * @returns {Function} Returns the new accessor function.
  2480. */
  2481. function baseProperty(key) {
  2482. return function(object) {
  2483. return object == null ? undefined : object[key];
  2484. };
  2485. }
  2486. /**
  2487. * The base implementation of `_.propertyOf` without support for deep paths.
  2488. *
  2489. * @private
  2490. * @param {Object} object The object to query.
  2491. * @returns {Function} Returns the new accessor function.
  2492. */
  2493. function basePropertyOf(object) {
  2494. return function(key) {
  2495. return object == null ? undefined : object[key];
  2496. };
  2497. }
  2498. /**
  2499. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2500. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2501. *
  2502. * @private
  2503. * @param {Array|Object} collection The collection to iterate over.
  2504. * @param {Function} iteratee The function invoked per iteration.
  2505. * @param {*} accumulator The initial value.
  2506. * @param {boolean} initAccum Specify using the first or last element of
  2507. * `collection` as the initial value.
  2508. * @param {Function} eachFunc The function to iterate over `collection`.
  2509. * @returns {*} Returns the accumulated value.
  2510. */
  2511. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2512. eachFunc(collection, function(value, index, collection) {
  2513. accumulator = initAccum
  2514. ? (initAccum = false, value)
  2515. : iteratee(accumulator, value, index, collection);
  2516. });
  2517. return accumulator;
  2518. }
  2519. /**
  2520. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2521. * sort order of `array` and replaces criteria objects with their corresponding
  2522. * values.
  2523. *
  2524. * @private
  2525. * @param {Array} array The array to sort.
  2526. * @param {Function} comparer The function to define sort order.
  2527. * @returns {Array} Returns `array`.
  2528. */
  2529. function baseSortBy(array, comparer) {
  2530. var length = array.length;
  2531. array.sort(comparer);
  2532. while (length--) {
  2533. array[length] = array[length].value;
  2534. }
  2535. return array;
  2536. }
  2537. /**
  2538. * The base implementation of `_.sum` and `_.sumBy` without support for
  2539. * iteratee shorthands.
  2540. *
  2541. * @private
  2542. * @param {Array} array The array to iterate over.
  2543. * @param {Function} iteratee The function invoked per iteration.
  2544. * @returns {number} Returns the sum.
  2545. */
  2546. function baseSum(array, iteratee) {
  2547. var result,
  2548. index = -1,
  2549. length = array.length;
  2550. while (++index < length) {
  2551. var current = iteratee(array[index]);
  2552. if (current !== undefined) {
  2553. result = result === undefined ? current : (result + current);
  2554. }
  2555. }
  2556. return result;
  2557. }
  2558. /**
  2559. * The base implementation of `_.times` without support for iteratee shorthands
  2560. * or max array length checks.
  2561. *
  2562. * @private
  2563. * @param {number} n The number of times to invoke `iteratee`.
  2564. * @param {Function} iteratee The function invoked per iteration.
  2565. * @returns {Array} Returns the array of results.
  2566. */
  2567. function baseTimes(n, iteratee) {
  2568. var index = -1,
  2569. result = Array(n);
  2570. while (++index < n) {
  2571. result[index] = iteratee(index);
  2572. }
  2573. return result;
  2574. }
  2575. /**
  2576. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2577. * of key-value pairs for `object` corresponding to the property names of `props`.
  2578. *
  2579. * @private
  2580. * @param {Object} object The object to query.
  2581. * @param {Array} props The property names to get values for.
  2582. * @returns {Object} Returns the key-value pairs.
  2583. */
  2584. function baseToPairs(object, props) {
  2585. return arrayMap(props, function(key) {
  2586. return [key, object[key]];
  2587. });
  2588. }
  2589. /**
  2590. * The base implementation of `_.trim`.
  2591. *
  2592. * @private
  2593. * @param {string} string The string to trim.
  2594. * @returns {string} Returns the trimmed string.
  2595. */
  2596. function baseTrim(string) {
  2597. return string
  2598. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2599. : string;
  2600. }
  2601. /**
  2602. * The base implementation of `_.unary` without support for storing metadata.
  2603. *
  2604. * @private
  2605. * @param {Function} func The function to cap arguments for.
  2606. * @returns {Function} Returns the new capped function.
  2607. */
  2608. function baseUnary(func) {
  2609. return function(value) {
  2610. return func(value);
  2611. };
  2612. }
  2613. /**
  2614. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2615. * array of `object` property values corresponding to the property names
  2616. * of `props`.
  2617. *
  2618. * @private
  2619. * @param {Object} object The object to query.
  2620. * @param {Array} props The property names to get values for.
  2621. * @returns {Object} Returns the array of property values.
  2622. */
  2623. function baseValues(object, props) {
  2624. return arrayMap(props, function(key) {
  2625. return object[key];
  2626. });
  2627. }
  2628. /**
  2629. * Checks if a `cache` value for `key` exists.
  2630. *
  2631. * @private
  2632. * @param {Object} cache The cache to query.
  2633. * @param {string} key The key of the entry to check.
  2634. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2635. */
  2636. function cacheHas(cache, key) {
  2637. return cache.has(key);
  2638. }
  2639. /**
  2640. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2641. * that is not found in the character symbols.
  2642. *
  2643. * @private
  2644. * @param {Array} strSymbols The string symbols to inspect.
  2645. * @param {Array} chrSymbols The character symbols to find.
  2646. * @returns {number} Returns the index of the first unmatched string symbol.
  2647. */
  2648. function charsStartIndex(strSymbols, chrSymbols) {
  2649. var index = -1,
  2650. length = strSymbols.length;
  2651. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2652. return index;
  2653. }
  2654. /**
  2655. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2656. * that is not found in the character symbols.
  2657. *
  2658. * @private
  2659. * @param {Array} strSymbols The string symbols to inspect.
  2660. * @param {Array} chrSymbols The character symbols to find.
  2661. * @returns {number} Returns the index of the last unmatched string symbol.
  2662. */
  2663. function charsEndIndex(strSymbols, chrSymbols) {
  2664. var index = strSymbols.length;
  2665. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2666. return index;
  2667. }
  2668. /**
  2669. * Gets the number of `placeholder` occurrences in `array`.
  2670. *
  2671. * @private
  2672. * @param {Array} array The array to inspect.
  2673. * @param {*} placeholder The placeholder to search for.
  2674. * @returns {number} Returns the placeholder count.
  2675. */
  2676. function countHolders(array, placeholder) {
  2677. var length = array.length,
  2678. result = 0;
  2679. while (length--) {
  2680. if (array[length] === placeholder) {
  2681. ++result;
  2682. }
  2683. }
  2684. return result;
  2685. }
  2686. /**
  2687. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2688. * letters to basic Latin letters.
  2689. *
  2690. * @private
  2691. * @param {string} letter The matched letter to deburr.
  2692. * @returns {string} Returns the deburred letter.
  2693. */
  2694. var deburrLetter = basePropertyOf(deburredLetters);
  2695. /**
  2696. * Used by `_.escape` to convert characters to HTML entities.
  2697. *
  2698. * @private
  2699. * @param {string} chr The matched character to escape.
  2700. * @returns {string} Returns the escaped character.
  2701. */
  2702. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2703. /**
  2704. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2705. *
  2706. * @private
  2707. * @param {string} chr The matched character to escape.
  2708. * @returns {string} Returns the escaped character.
  2709. */
  2710. function escapeStringChar(chr) {
  2711. return '\\' + stringEscapes[chr];
  2712. }
  2713. /**
  2714. * Gets the value at `key` of `object`.
  2715. *
  2716. * @private
  2717. * @param {Object} [object] The object to query.
  2718. * @param {string} key The key of the property to get.
  2719. * @returns {*} Returns the property value.
  2720. */
  2721. function getValue(object, key) {
  2722. return object == null ? undefined : object[key];
  2723. }
  2724. /**
  2725. * Checks if `string` contains Unicode symbols.
  2726. *
  2727. * @private
  2728. * @param {string} string The string to inspect.
  2729. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2730. */
  2731. function hasUnicode(string) {
  2732. return reHasUnicode.test(string);
  2733. }
  2734. /**
  2735. * Checks if `string` contains a word composed of Unicode symbols.
  2736. *
  2737. * @private
  2738. * @param {string} string The string to inspect.
  2739. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2740. */
  2741. function hasUnicodeWord(string) {
  2742. return reHasUnicodeWord.test(string);
  2743. }
  2744. /**
  2745. * Converts `iterator` to an array.
  2746. *
  2747. * @private
  2748. * @param {Object} iterator The iterator to convert.
  2749. * @returns {Array} Returns the converted array.
  2750. */
  2751. function iteratorToArray(iterator) {
  2752. var data,
  2753. result = [];
  2754. while (!(data = iterator.next()).done) {
  2755. result.push(data.value);
  2756. }
  2757. return result;
  2758. }
  2759. /**
  2760. * Converts `map` to its key-value pairs.
  2761. *
  2762. * @private
  2763. * @param {Object} map The map to convert.
  2764. * @returns {Array} Returns the key-value pairs.
  2765. */
  2766. function mapToArray(map) {
  2767. var index = -1,
  2768. result = Array(map.size);
  2769. map.forEach(function(value, key) {
  2770. result[++index] = [key, value];
  2771. });
  2772. return result;
  2773. }
  2774. /**
  2775. * Creates a unary function that invokes `func` with its argument transformed.
  2776. *
  2777. * @private
  2778. * @param {Function} func The function to wrap.
  2779. * @param {Function} transform The argument transform.
  2780. * @returns {Function} Returns the new function.
  2781. */
  2782. function overArg(func, transform) {
  2783. return function(arg) {
  2784. return func(transform(arg));
  2785. };
  2786. }
  2787. /**
  2788. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2789. * and returns an array of their indexes.
  2790. *
  2791. * @private
  2792. * @param {Array} array The array to modify.
  2793. * @param {*} placeholder The placeholder to replace.
  2794. * @returns {Array} Returns the new array of placeholder indexes.
  2795. */
  2796. function replaceHolders(array, placeholder) {
  2797. var index = -1,
  2798. length = array.length,
  2799. resIndex = 0,
  2800. result = [];
  2801. while (++index < length) {
  2802. var value = array[index];
  2803. if (value === placeholder || value === PLACEHOLDER) {
  2804. array[index] = PLACEHOLDER;
  2805. result[resIndex++] = index;
  2806. }
  2807. }
  2808. return result;
  2809. }
  2810. /**
  2811. * Converts `set` to an array of its values.
  2812. *
  2813. * @private
  2814. * @param {Object} set The set to convert.
  2815. * @returns {Array} Returns the values.
  2816. */
  2817. function setToArray(set) {
  2818. var index = -1,
  2819. result = Array(set.size);
  2820. set.forEach(function(value) {
  2821. result[++index] = value;
  2822. });
  2823. return result;
  2824. }
  2825. /**
  2826. * Converts `set` to its value-value pairs.
  2827. *
  2828. * @private
  2829. * @param {Object} set The set to convert.
  2830. * @returns {Array} Returns the value-value pairs.
  2831. */
  2832. function setToPairs(set) {
  2833. var index = -1,
  2834. result = Array(set.size);
  2835. set.forEach(function(value) {
  2836. result[++index] = [value, value];
  2837. });
  2838. return result;
  2839. }
  2840. /**
  2841. * A specialized version of `_.indexOf` which performs strict equality
  2842. * comparisons of values, i.e. `===`.
  2843. *
  2844. * @private
  2845. * @param {Array} array The array to inspect.
  2846. * @param {*} value The value to search for.
  2847. * @param {number} fromIndex The index to search from.
  2848. * @returns {number} Returns the index of the matched value, else `-1`.
  2849. */
  2850. function strictIndexOf(array, value, fromIndex) {
  2851. var index = fromIndex - 1,
  2852. length = array.length;
  2853. while (++index < length) {
  2854. if (array[index] === value) {
  2855. return index;
  2856. }
  2857. }
  2858. return -1;
  2859. }
  2860. /**
  2861. * A specialized version of `_.lastIndexOf` which performs strict equality
  2862. * comparisons of values, i.e. `===`.
  2863. *
  2864. * @private
  2865. * @param {Array} array The array to inspect.
  2866. * @param {*} value The value to search for.
  2867. * @param {number} fromIndex The index to search from.
  2868. * @returns {number} Returns the index of the matched value, else `-1`.
  2869. */
  2870. function strictLastIndexOf(array, value, fromIndex) {
  2871. var index = fromIndex + 1;
  2872. while (index--) {
  2873. if (array[index] === value) {
  2874. return index;
  2875. }
  2876. }
  2877. return index;
  2878. }
  2879. /**
  2880. * Gets the number of symbols in `string`.
  2881. *
  2882. * @private
  2883. * @param {string} string The string to inspect.
  2884. * @returns {number} Returns the string size.
  2885. */
  2886. function stringSize(string) {
  2887. return hasUnicode(string)
  2888. ? unicodeSize(string)
  2889. : asciiSize(string);
  2890. }
  2891. /**
  2892. * Converts `string` to an array.
  2893. *
  2894. * @private
  2895. * @param {string} string The string to convert.
  2896. * @returns {Array} Returns the converted array.
  2897. */
  2898. function stringToArray(string) {
  2899. return hasUnicode(string)
  2900. ? unicodeToArray(string)
  2901. : asciiToArray(string);
  2902. }
  2903. /**
  2904. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2905. * character of `string`.
  2906. *
  2907. * @private
  2908. * @param {string} string The string to inspect.
  2909. * @returns {number} Returns the index of the last non-whitespace character.
  2910. */
  2911. function trimmedEndIndex(string) {
  2912. var index = string.length;
  2913. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2914. return index;
  2915. }
  2916. /**
  2917. * Used by `_.unescape` to convert HTML entities to characters.
  2918. *
  2919. * @private
  2920. * @param {string} chr The matched character to unescape.
  2921. * @returns {string} Returns the unescaped character.
  2922. */
  2923. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2924. /**
  2925. * Gets the size of a Unicode `string`.
  2926. *
  2927. * @private
  2928. * @param {string} string The string inspect.
  2929. * @returns {number} Returns the string size.
  2930. */
  2931. function unicodeSize(string) {
  2932. var result = reUnicode.lastIndex = 0;
  2933. while (reUnicode.test(string)) {
  2934. ++result;
  2935. }
  2936. return result;
  2937. }
  2938. /**
  2939. * Converts a Unicode `string` to an array.
  2940. *
  2941. * @private
  2942. * @param {string} string The string to convert.
  2943. * @returns {Array} Returns the converted array.
  2944. */
  2945. function unicodeToArray(string) {
  2946. return string.match(reUnicode) || [];
  2947. }
  2948. /**
  2949. * Splits a Unicode `string` into an array of its words.
  2950. *
  2951. * @private
  2952. * @param {string} The string to inspect.
  2953. * @returns {Array} Returns the words of `string`.
  2954. */
  2955. function unicodeWords(string) {
  2956. return string.match(reUnicodeWord) || [];
  2957. }
  2958. /*--------------------------------------------------------------------------*/
  2959. /**
  2960. * Create a new pristine `lodash` function using the `context` object.
  2961. *
  2962. * @static
  2963. * @memberOf _
  2964. * @since 1.1.0
  2965. * @category Util
  2966. * @param {Object} [context=root] The context object.
  2967. * @returns {Function} Returns a new `lodash` function.
  2968. * @example
  2969. *
  2970. * _.mixin({ 'foo': _.constant('foo') });
  2971. *
  2972. * var lodash = _.runInContext();
  2973. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2974. *
  2975. * _.isFunction(_.foo);
  2976. * // => true
  2977. * _.isFunction(_.bar);
  2978. * // => false
  2979. *
  2980. * lodash.isFunction(lodash.foo);
  2981. * // => false
  2982. * lodash.isFunction(lodash.bar);
  2983. * // => true
  2984. *
  2985. * // Create a suped-up `defer` in Node.js.
  2986. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2987. */
  2988. var runInContext = (function runInContext(context) {
  2989. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2990. /** Built-in constructor references. */
  2991. var Array = context.Array,
  2992. Date = context.Date,
  2993. Error = context.Error,
  2994. Function = context.Function,
  2995. Math = context.Math,
  2996. Object = context.Object,
  2997. RegExp = context.RegExp,
  2998. String = context.String,
  2999. TypeError = context.TypeError;
  3000. /** Used for built-in method references. */
  3001. var arrayProto = Array.prototype,
  3002. funcProto = Function.prototype,
  3003. objectProto = Object.prototype;
  3004. /** Used to detect overreaching core-js shims. */
  3005. var coreJsData = context['__core-js_shared__'];
  3006. /** Used to resolve the decompiled source of functions. */
  3007. var funcToString = funcProto.toString;
  3008. /** Used to check objects for own properties. */
  3009. var hasOwnProperty = objectProto.hasOwnProperty;
  3010. /** Used to generate unique IDs. */
  3011. var idCounter = 0;
  3012. /** Used to detect methods masquerading as native. */
  3013. var maskSrcKey = (function() {
  3014. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  3015. return uid ? ('Symbol(src)_1.' + uid) : '';
  3016. }());
  3017. /**
  3018. * Used to resolve the
  3019. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  3020. * of values.
  3021. */
  3022. var nativeObjectToString = objectProto.toString;
  3023. /** Used to infer the `Object` constructor. */
  3024. var objectCtorString = funcToString.call(Object);
  3025. /** Used to restore the original `_` reference in `_.noConflict`. */
  3026. var oldDash = root._;
  3027. /** Used to detect if a method is native. */
  3028. var reIsNative = RegExp('^' +
  3029. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  3030. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  3031. );
  3032. /** Built-in value references. */
  3033. var Buffer = moduleExports ? context.Buffer : undefined,
  3034. Symbol = context.Symbol,
  3035. Uint8Array = context.Uint8Array,
  3036. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  3037. getPrototype = overArg(Object.getPrototypeOf, Object),
  3038. objectCreate = Object.create,
  3039. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  3040. splice = arrayProto.splice,
  3041. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  3042. symIterator = Symbol ? Symbol.iterator : undefined,
  3043. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  3044. var defineProperty = (function() {
  3045. try {
  3046. var func = getNative(Object, 'defineProperty');
  3047. func({}, '', {});
  3048. return func;
  3049. } catch (e) {}
  3050. }());
  3051. /** Mocked built-ins. */
  3052. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  3053. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  3054. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  3055. /* Built-in method references for those with the same name as other `lodash` methods. */
  3056. var nativeCeil = Math.ceil,
  3057. nativeFloor = Math.floor,
  3058. nativeGetSymbols = Object.getOwnPropertySymbols,
  3059. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  3060. nativeIsFinite = context.isFinite,
  3061. nativeJoin = arrayProto.join,
  3062. nativeKeys = overArg(Object.keys, Object),
  3063. nativeMax = Math.max,
  3064. nativeMin = Math.min,
  3065. nativeNow = Date.now,
  3066. nativeParseInt = context.parseInt,
  3067. nativeRandom = Math.random,
  3068. nativeReverse = arrayProto.reverse;
  3069. /* Built-in method references that are verified to be native. */
  3070. var DataView = getNative(context, 'DataView'),
  3071. Map = getNative(context, 'Map'),
  3072. Promise = getNative(context, 'Promise'),
  3073. Set = getNative(context, 'Set'),
  3074. WeakMap = getNative(context, 'WeakMap'),
  3075. nativeCreate = getNative(Object, 'create');
  3076. /** Used to store function metadata. */
  3077. var metaMap = WeakMap && new WeakMap;
  3078. /** Used to lookup unminified function names. */
  3079. var realNames = {};
  3080. /** Used to detect maps, sets, and weakmaps. */
  3081. var dataViewCtorString = toSource(DataView),
  3082. mapCtorString = toSource(Map),
  3083. promiseCtorString = toSource(Promise),
  3084. setCtorString = toSource(Set),
  3085. weakMapCtorString = toSource(WeakMap);
  3086. /** Used to convert symbols to primitives and strings. */
  3087. var symbolProto = Symbol ? Symbol.prototype : undefined,
  3088. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  3089. symbolToString = symbolProto ? symbolProto.toString : undefined;
  3090. /*------------------------------------------------------------------------*/
  3091. /**
  3092. * Creates a `lodash` object which wraps `value` to enable implicit method
  3093. * chain sequences. Methods that operate on and return arrays, collections,
  3094. * and functions can be chained together. Methods that retrieve a single value
  3095. * or may return a primitive value will automatically end the chain sequence
  3096. * and return the unwrapped value. Otherwise, the value must be unwrapped
  3097. * with `_#value`.
  3098. *
  3099. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  3100. * enabled using `_.chain`.
  3101. *
  3102. * The execution of chained methods is lazy, that is, it's deferred until
  3103. * `_#value` is implicitly or explicitly called.
  3104. *
  3105. * Lazy evaluation allows several methods to support shortcut fusion.
  3106. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  3107. * the creation of intermediate arrays and can greatly reduce the number of
  3108. * iteratee executions. Sections of a chain sequence qualify for shortcut
  3109. * fusion if the section is applied to an array and iteratees accept only
  3110. * one argument. The heuristic for whether a section qualifies for shortcut
  3111. * fusion is subject to change.
  3112. *
  3113. * Chaining is supported in custom builds as long as the `_#value` method is
  3114. * directly or indirectly included in the build.
  3115. *
  3116. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  3117. *
  3118. * The wrapper `Array` methods are:
  3119. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  3120. *
  3121. * The wrapper `String` methods are:
  3122. * `replace` and `split`
  3123. *
  3124. * The wrapper methods that support shortcut fusion are:
  3125. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  3126. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  3127. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  3128. *
  3129. * The chainable wrapper methods are:
  3130. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  3131. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  3132. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  3133. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  3134. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  3135. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  3136. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  3137. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  3138. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  3139. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  3140. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  3141. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  3142. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  3143. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  3144. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  3145. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  3146. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  3147. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  3148. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  3149. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  3150. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  3151. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  3152. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  3153. * `zipObject`, `zipObjectDeep`, and `zipWith`
  3154. *
  3155. * The wrapper methods that are **not** chainable by default are:
  3156. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  3157. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  3158. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  3159. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  3160. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  3161. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  3162. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  3163. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  3164. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  3165. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  3166. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  3167. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  3168. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  3169. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  3170. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  3171. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  3172. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  3173. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  3174. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  3175. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  3176. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  3177. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  3178. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  3179. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  3180. * `upperFirst`, `value`, and `words`
  3181. *
  3182. * @name _
  3183. * @constructor
  3184. * @category Seq
  3185. * @param {*} value The value to wrap in a `lodash` instance.
  3186. * @returns {Object} Returns the new `lodash` wrapper instance.
  3187. * @example
  3188. *
  3189. * function square(n) {
  3190. * return n * n;
  3191. * }
  3192. *
  3193. * var wrapped = _([1, 2, 3]);
  3194. *
  3195. * // Returns an unwrapped value.
  3196. * wrapped.reduce(_.add);
  3197. * // => 6
  3198. *
  3199. * // Returns a wrapped value.
  3200. * var squares = wrapped.map(square);
  3201. *
  3202. * _.isArray(squares);
  3203. * // => false
  3204. *
  3205. * _.isArray(squares.value());
  3206. * // => true
  3207. */
  3208. function lodash(value) {
  3209. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  3210. if (value instanceof LodashWrapper) {
  3211. return value;
  3212. }
  3213. if (hasOwnProperty.call(value, '__wrapped__')) {
  3214. return wrapperClone(value);
  3215. }
  3216. }
  3217. return new LodashWrapper(value);
  3218. }
  3219. /**
  3220. * The base implementation of `_.create` without support for assigning
  3221. * properties to the created object.
  3222. *
  3223. * @private
  3224. * @param {Object} proto The object to inherit from.
  3225. * @returns {Object} Returns the new object.
  3226. */
  3227. var baseCreate = (function() {
  3228. function object() {}
  3229. return function(proto) {
  3230. if (!isObject(proto)) {
  3231. return {};
  3232. }
  3233. if (objectCreate) {
  3234. return objectCreate(proto);
  3235. }
  3236. object.prototype = proto;
  3237. var result = new object;
  3238. object.prototype = undefined;
  3239. return result;
  3240. };
  3241. }());
  3242. /**
  3243. * The function whose prototype chain sequence wrappers inherit from.
  3244. *
  3245. * @private
  3246. */
  3247. function baseLodash() {
  3248. // No operation performed.
  3249. }
  3250. /**
  3251. * The base constructor for creating `lodash` wrapper objects.
  3252. *
  3253. * @private
  3254. * @param {*} value The value to wrap.
  3255. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  3256. */
  3257. function LodashWrapper(value, chainAll) {
  3258. this.__wrapped__ = value;
  3259. this.__actions__ = [];
  3260. this.__chain__ = !!chainAll;
  3261. this.__index__ = 0;
  3262. this.__values__ = undefined;
  3263. }
  3264. /**
  3265. * By default, the template delimiters used by lodash are like those in
  3266. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  3267. * following template settings to use alternative delimiters.
  3268. *
  3269. * @static
  3270. * @memberOf _
  3271. * @type {Object}
  3272. */
  3273. lodash.templateSettings = {
  3274. /**
  3275. * Used to detect `data` property values to be HTML-escaped.
  3276. *
  3277. * @memberOf _.templateSettings
  3278. * @type {RegExp}
  3279. */
  3280. 'escape': reEscape,
  3281. /**
  3282. * Used to detect code to be evaluated.
  3283. *
  3284. * @memberOf _.templateSettings
  3285. * @type {RegExp}
  3286. */
  3287. 'evaluate': reEvaluate,
  3288. /**
  3289. * Used to detect `data` property values to inject.
  3290. *
  3291. * @memberOf _.templateSettings
  3292. * @type {RegExp}
  3293. */
  3294. 'interpolate': reInterpolate,
  3295. /**
  3296. * Used to reference the data object in the template text.
  3297. *
  3298. * @memberOf _.templateSettings
  3299. * @type {string}
  3300. */
  3301. 'variable': '',
  3302. /**
  3303. * Used to import variables into the compiled template.
  3304. *
  3305. * @memberOf _.templateSettings
  3306. * @type {Object}
  3307. */
  3308. 'imports': {
  3309. /**
  3310. * A reference to the `lodash` function.
  3311. *
  3312. * @memberOf _.templateSettings.imports
  3313. * @type {Function}
  3314. */
  3315. '_': lodash
  3316. }
  3317. };
  3318. // Ensure wrappers are instances of `baseLodash`.
  3319. lodash.prototype = baseLodash.prototype;
  3320. lodash.prototype.constructor = lodash;
  3321. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  3322. LodashWrapper.prototype.constructor = LodashWrapper;
  3323. /*------------------------------------------------------------------------*/
  3324. /**
  3325. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  3326. *
  3327. * @private
  3328. * @constructor
  3329. * @param {*} value The value to wrap.
  3330. */
  3331. function LazyWrapper(value) {
  3332. this.__wrapped__ = value;
  3333. this.__actions__ = [];
  3334. this.__dir__ = 1;
  3335. this.__filtered__ = false;
  3336. this.__iteratees__ = [];
  3337. this.__takeCount__ = MAX_ARRAY_LENGTH;
  3338. this.__views__ = [];
  3339. }
  3340. /**
  3341. * Creates a clone of the lazy wrapper object.
  3342. *
  3343. * @private
  3344. * @name clone
  3345. * @memberOf LazyWrapper
  3346. * @returns {Object} Returns the cloned `LazyWrapper` object.
  3347. */
  3348. function lazyClone() {
  3349. var result = new LazyWrapper(this.__wrapped__);
  3350. result.__actions__ = copyArray(this.__actions__);
  3351. result.__dir__ = this.__dir__;
  3352. result.__filtered__ = this.__filtered__;
  3353. result.__iteratees__ = copyArray(this.__iteratees__);
  3354. result.__takeCount__ = this.__takeCount__;
  3355. result.__views__ = copyArray(this.__views__);
  3356. return result;
  3357. }
  3358. /**
  3359. * Reverses the direction of lazy iteration.
  3360. *
  3361. * @private
  3362. * @name reverse
  3363. * @memberOf LazyWrapper
  3364. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  3365. */
  3366. function lazyReverse() {
  3367. if (this.__filtered__) {
  3368. var result = new LazyWrapper(this);
  3369. result.__dir__ = -1;
  3370. result.__filtered__ = true;
  3371. } else {
  3372. result = this.clone();
  3373. result.__dir__ *= -1;
  3374. }
  3375. return result;
  3376. }
  3377. /**
  3378. * Extracts the unwrapped value from its lazy wrapper.
  3379. *
  3380. * @private
  3381. * @name value
  3382. * @memberOf LazyWrapper
  3383. * @returns {*} Returns the unwrapped value.
  3384. */
  3385. function lazyValue() {
  3386. var array = this.__wrapped__.value(),
  3387. dir = this.__dir__,
  3388. isArr = isArray(array),
  3389. isRight = dir < 0,
  3390. arrLength = isArr ? array.length : 0,
  3391. view = getView(0, arrLength, this.__views__),
  3392. start = view.start,
  3393. end = view.end,
  3394. length = end - start,
  3395. index = isRight ? end : (start - 1),
  3396. iteratees = this.__iteratees__,
  3397. iterLength = iteratees.length,
  3398. resIndex = 0,
  3399. takeCount = nativeMin(length, this.__takeCount__);
  3400. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  3401. return baseWrapperValue(array, this.__actions__);
  3402. }
  3403. var result = [];
  3404. outer:
  3405. while (length-- && resIndex < takeCount) {
  3406. index += dir;
  3407. var iterIndex = -1,
  3408. value = array[index];
  3409. while (++iterIndex < iterLength) {
  3410. var data = iteratees[iterIndex],
  3411. iteratee = data.iteratee,
  3412. type = data.type,
  3413. computed = iteratee(value);
  3414. if (type == LAZY_MAP_FLAG) {
  3415. value = computed;
  3416. } else if (!computed) {
  3417. if (type == LAZY_FILTER_FLAG) {
  3418. continue outer;
  3419. } else {
  3420. break outer;
  3421. }
  3422. }
  3423. }
  3424. result[resIndex++] = value;
  3425. }
  3426. return result;
  3427. }
  3428. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  3429. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  3430. LazyWrapper.prototype.constructor = LazyWrapper;
  3431. /*------------------------------------------------------------------------*/
  3432. /**
  3433. * Creates a hash object.
  3434. *
  3435. * @private
  3436. * @constructor
  3437. * @param {Array} [entries] The key-value pairs to cache.
  3438. */
  3439. function Hash(entries) {
  3440. var index = -1,
  3441. length = entries == null ? 0 : entries.length;
  3442. this.clear();
  3443. while (++index < length) {
  3444. var entry = entries[index];
  3445. this.set(entry[0], entry[1]);
  3446. }
  3447. }
  3448. /**
  3449. * Removes all key-value entries from the hash.
  3450. *
  3451. * @private
  3452. * @name clear
  3453. * @memberOf Hash
  3454. */
  3455. function hashClear() {
  3456. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3457. this.size = 0;
  3458. }
  3459. /**
  3460. * Removes `key` and its value from the hash.
  3461. *
  3462. * @private
  3463. * @name delete
  3464. * @memberOf Hash
  3465. * @param {Object} hash The hash to modify.
  3466. * @param {string} key The key of the value to remove.
  3467. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3468. */
  3469. function hashDelete(key) {
  3470. var result = this.has(key) && delete this.__data__[key];
  3471. this.size -= result ? 1 : 0;
  3472. return result;
  3473. }
  3474. /**
  3475. * Gets the hash value for `key`.
  3476. *
  3477. * @private
  3478. * @name get
  3479. * @memberOf Hash
  3480. * @param {string} key The key of the value to get.
  3481. * @returns {*} Returns the entry value.
  3482. */
  3483. function hashGet(key) {
  3484. var data = this.__data__;
  3485. if (nativeCreate) {
  3486. var result = data[key];
  3487. return result === HASH_UNDEFINED ? undefined : result;
  3488. }
  3489. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3490. }
  3491. /**
  3492. * Checks if a hash value for `key` exists.
  3493. *
  3494. * @private
  3495. * @name has
  3496. * @memberOf Hash
  3497. * @param {string} key The key of the entry to check.
  3498. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3499. */
  3500. function hashHas(key) {
  3501. var data = this.__data__;
  3502. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3503. }
  3504. /**
  3505. * Sets the hash `key` to `value`.
  3506. *
  3507. * @private
  3508. * @name set
  3509. * @memberOf Hash
  3510. * @param {string} key The key of the value to set.
  3511. * @param {*} value The value to set.
  3512. * @returns {Object} Returns the hash instance.
  3513. */
  3514. function hashSet(key, value) {
  3515. var data = this.__data__;
  3516. this.size += this.has(key) ? 0 : 1;
  3517. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3518. return this;
  3519. }
  3520. // Add methods to `Hash`.
  3521. Hash.prototype.clear = hashClear;
  3522. Hash.prototype['delete'] = hashDelete;
  3523. Hash.prototype.get = hashGet;
  3524. Hash.prototype.has = hashHas;
  3525. Hash.prototype.set = hashSet;
  3526. /*------------------------------------------------------------------------*/
  3527. /**
  3528. * Creates an list cache object.
  3529. *
  3530. * @private
  3531. * @constructor
  3532. * @param {Array} [entries] The key-value pairs to cache.
  3533. */
  3534. function ListCache(entries) {
  3535. var index = -1,
  3536. length = entries == null ? 0 : entries.length;
  3537. this.clear();
  3538. while (++index < length) {
  3539. var entry = entries[index];
  3540. this.set(entry[0], entry[1]);
  3541. }
  3542. }
  3543. /**
  3544. * Removes all key-value entries from the list cache.
  3545. *
  3546. * @private
  3547. * @name clear
  3548. * @memberOf ListCache
  3549. */
  3550. function listCacheClear() {
  3551. this.__data__ = [];
  3552. this.size = 0;
  3553. }
  3554. /**
  3555. * Removes `key` and its value from the list cache.
  3556. *
  3557. * @private
  3558. * @name delete
  3559. * @memberOf ListCache
  3560. * @param {string} key The key of the value to remove.
  3561. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3562. */
  3563. function listCacheDelete(key) {
  3564. var data = this.__data__,
  3565. index = assocIndexOf(data, key);
  3566. if (index < 0) {
  3567. return false;
  3568. }
  3569. var lastIndex = data.length - 1;
  3570. if (index == lastIndex) {
  3571. data.pop();
  3572. } else {
  3573. splice.call(data, index, 1);
  3574. }
  3575. --this.size;
  3576. return true;
  3577. }
  3578. /**
  3579. * Gets the list cache value for `key`.
  3580. *
  3581. * @private
  3582. * @name get
  3583. * @memberOf ListCache
  3584. * @param {string} key The key of the value to get.
  3585. * @returns {*} Returns the entry value.
  3586. */
  3587. function listCacheGet(key) {
  3588. var data = this.__data__,
  3589. index = assocIndexOf(data, key);
  3590. return index < 0 ? undefined : data[index][1];
  3591. }
  3592. /**
  3593. * Checks if a list cache value for `key` exists.
  3594. *
  3595. * @private
  3596. * @name has
  3597. * @memberOf ListCache
  3598. * @param {string} key The key of the entry to check.
  3599. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3600. */
  3601. function listCacheHas(key) {
  3602. return assocIndexOf(this.__data__, key) > -1;
  3603. }
  3604. /**
  3605. * Sets the list cache `key` to `value`.
  3606. *
  3607. * @private
  3608. * @name set
  3609. * @memberOf ListCache
  3610. * @param {string} key The key of the value to set.
  3611. * @param {*} value The value to set.
  3612. * @returns {Object} Returns the list cache instance.
  3613. */
  3614. function listCacheSet(key, value) {
  3615. var data = this.__data__,
  3616. index = assocIndexOf(data, key);
  3617. if (index < 0) {
  3618. ++this.size;
  3619. data.push([key, value]);
  3620. } else {
  3621. data[index][1] = value;
  3622. }
  3623. return this;
  3624. }
  3625. // Add methods to `ListCache`.
  3626. ListCache.prototype.clear = listCacheClear;
  3627. ListCache.prototype['delete'] = listCacheDelete;
  3628. ListCache.prototype.get = listCacheGet;
  3629. ListCache.prototype.has = listCacheHas;
  3630. ListCache.prototype.set = listCacheSet;
  3631. /*------------------------------------------------------------------------*/
  3632. /**
  3633. * Creates a map cache object to store key-value pairs.
  3634. *
  3635. * @private
  3636. * @constructor
  3637. * @param {Array} [entries] The key-value pairs to cache.
  3638. */
  3639. function MapCache(entries) {
  3640. var index = -1,
  3641. length = entries == null ? 0 : entries.length;
  3642. this.clear();
  3643. while (++index < length) {
  3644. var entry = entries[index];
  3645. this.set(entry[0], entry[1]);
  3646. }
  3647. }
  3648. /**
  3649. * Removes all key-value entries from the map.
  3650. *
  3651. * @private
  3652. * @name clear
  3653. * @memberOf MapCache
  3654. */
  3655. function mapCacheClear() {
  3656. this.size = 0;
  3657. this.__data__ = {
  3658. 'hash': new Hash,
  3659. 'map': new (Map || ListCache),
  3660. 'string': new Hash
  3661. };
  3662. }
  3663. /**
  3664. * Removes `key` and its value from the map.
  3665. *
  3666. * @private
  3667. * @name delete
  3668. * @memberOf MapCache
  3669. * @param {string} key The key of the value to remove.
  3670. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3671. */
  3672. function mapCacheDelete(key) {
  3673. var result = getMapData(this, key)['delete'](key);
  3674. this.size -= result ? 1 : 0;
  3675. return result;
  3676. }
  3677. /**
  3678. * Gets the map value for `key`.
  3679. *
  3680. * @private
  3681. * @name get
  3682. * @memberOf MapCache
  3683. * @param {string} key The key of the value to get.
  3684. * @returns {*} Returns the entry value.
  3685. */
  3686. function mapCacheGet(key) {
  3687. return getMapData(this, key).get(key);
  3688. }
  3689. /**
  3690. * Checks if a map value for `key` exists.
  3691. *
  3692. * @private
  3693. * @name has
  3694. * @memberOf MapCache
  3695. * @param {string} key The key of the entry to check.
  3696. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3697. */
  3698. function mapCacheHas(key) {
  3699. return getMapData(this, key).has(key);
  3700. }
  3701. /**
  3702. * Sets the map `key` to `value`.
  3703. *
  3704. * @private
  3705. * @name set
  3706. * @memberOf MapCache
  3707. * @param {string} key The key of the value to set.
  3708. * @param {*} value The value to set.
  3709. * @returns {Object} Returns the map cache instance.
  3710. */
  3711. function mapCacheSet(key, value) {
  3712. var data = getMapData(this, key),
  3713. size = data.size;
  3714. data.set(key, value);
  3715. this.size += data.size == size ? 0 : 1;
  3716. return this;
  3717. }
  3718. // Add methods to `MapCache`.
  3719. MapCache.prototype.clear = mapCacheClear;
  3720. MapCache.prototype['delete'] = mapCacheDelete;
  3721. MapCache.prototype.get = mapCacheGet;
  3722. MapCache.prototype.has = mapCacheHas;
  3723. MapCache.prototype.set = mapCacheSet;
  3724. /*------------------------------------------------------------------------*/
  3725. /**
  3726. *
  3727. * Creates an array cache object to store unique values.
  3728. *
  3729. * @private
  3730. * @constructor
  3731. * @param {Array} [values] The values to cache.
  3732. */
  3733. function SetCache(values) {
  3734. var index = -1,
  3735. length = values == null ? 0 : values.length;
  3736. this.__data__ = new MapCache;
  3737. while (++index < length) {
  3738. this.add(values[index]);
  3739. }
  3740. }
  3741. /**
  3742. * Adds `value` to the array cache.
  3743. *
  3744. * @private
  3745. * @name add
  3746. * @memberOf SetCache
  3747. * @alias push
  3748. * @param {*} value The value to cache.
  3749. * @returns {Object} Returns the cache instance.
  3750. */
  3751. function setCacheAdd(value) {
  3752. this.__data__.set(value, HASH_UNDEFINED);
  3753. return this;
  3754. }
  3755. /**
  3756. * Checks if `value` is in the array cache.
  3757. *
  3758. * @private
  3759. * @name has
  3760. * @memberOf SetCache
  3761. * @param {*} value The value to search for.
  3762. * @returns {number} Returns `true` if `value` is found, else `false`.
  3763. */
  3764. function setCacheHas(value) {
  3765. return this.__data__.has(value);
  3766. }
  3767. // Add methods to `SetCache`.
  3768. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3769. SetCache.prototype.has = setCacheHas;
  3770. /*------------------------------------------------------------------------*/
  3771. /**
  3772. * Creates a stack cache object to store key-value pairs.
  3773. *
  3774. * @private
  3775. * @constructor
  3776. * @param {Array} [entries] The key-value pairs to cache.
  3777. */
  3778. function Stack(entries) {
  3779. var data = this.__data__ = new ListCache(entries);
  3780. this.size = data.size;
  3781. }
  3782. /**
  3783. * Removes all key-value entries from the stack.
  3784. *
  3785. * @private
  3786. * @name clear
  3787. * @memberOf Stack
  3788. */
  3789. function stackClear() {
  3790. this.__data__ = new ListCache;
  3791. this.size = 0;
  3792. }
  3793. /**
  3794. * Removes `key` and its value from the stack.
  3795. *
  3796. * @private
  3797. * @name delete
  3798. * @memberOf Stack
  3799. * @param {string} key The key of the value to remove.
  3800. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3801. */
  3802. function stackDelete(key) {
  3803. var data = this.__data__,
  3804. result = data['delete'](key);
  3805. this.size = data.size;
  3806. return result;
  3807. }
  3808. /**
  3809. * Gets the stack value for `key`.
  3810. *
  3811. * @private
  3812. * @name get
  3813. * @memberOf Stack
  3814. * @param {string} key The key of the value to get.
  3815. * @returns {*} Returns the entry value.
  3816. */
  3817. function stackGet(key) {
  3818. return this.__data__.get(key);
  3819. }
  3820. /**
  3821. * Checks if a stack value for `key` exists.
  3822. *
  3823. * @private
  3824. * @name has
  3825. * @memberOf Stack
  3826. * @param {string} key The key of the entry to check.
  3827. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3828. */
  3829. function stackHas(key) {
  3830. return this.__data__.has(key);
  3831. }
  3832. /**
  3833. * Sets the stack `key` to `value`.
  3834. *
  3835. * @private
  3836. * @name set
  3837. * @memberOf Stack
  3838. * @param {string} key The key of the value to set.
  3839. * @param {*} value The value to set.
  3840. * @returns {Object} Returns the stack cache instance.
  3841. */
  3842. function stackSet(key, value) {
  3843. var data = this.__data__;
  3844. if (data instanceof ListCache) {
  3845. var pairs = data.__data__;
  3846. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3847. pairs.push([key, value]);
  3848. this.size = ++data.size;
  3849. return this;
  3850. }
  3851. data = this.__data__ = new MapCache(pairs);
  3852. }
  3853. data.set(key, value);
  3854. this.size = data.size;
  3855. return this;
  3856. }
  3857. // Add methods to `Stack`.
  3858. Stack.prototype.clear = stackClear;
  3859. Stack.prototype['delete'] = stackDelete;
  3860. Stack.prototype.get = stackGet;
  3861. Stack.prototype.has = stackHas;
  3862. Stack.prototype.set = stackSet;
  3863. /*------------------------------------------------------------------------*/
  3864. /**
  3865. * Creates an array of the enumerable property names of the array-like `value`.
  3866. *
  3867. * @private
  3868. * @param {*} value The value to query.
  3869. * @param {boolean} inherited Specify returning inherited property names.
  3870. * @returns {Array} Returns the array of property names.
  3871. */
  3872. function arrayLikeKeys(value, inherited) {
  3873. var isArr = isArray(value),
  3874. isArg = !isArr && isArguments(value),
  3875. isBuff = !isArr && !isArg && isBuffer(value),
  3876. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3877. skipIndexes = isArr || isArg || isBuff || isType,
  3878. result = skipIndexes ? baseTimes(value.length, String) : [],
  3879. length = result.length;
  3880. for (var key in value) {
  3881. if ((inherited || hasOwnProperty.call(value, key)) &&
  3882. !(skipIndexes && (
  3883. // Safari 9 has enumerable `arguments.length` in strict mode.
  3884. key == 'length' ||
  3885. // Node.js 0.10 has enumerable non-index properties on buffers.
  3886. (isBuff && (key == 'offset' || key == 'parent')) ||
  3887. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3888. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3889. // Skip index properties.
  3890. isIndex(key, length)
  3891. ))) {
  3892. result.push(key);
  3893. }
  3894. }
  3895. return result;
  3896. }
  3897. /**
  3898. * A specialized version of `_.sample` for arrays.
  3899. *
  3900. * @private
  3901. * @param {Array} array The array to sample.
  3902. * @returns {*} Returns the random element.
  3903. */
  3904. function arraySample(array) {
  3905. var length = array.length;
  3906. return length ? array[baseRandom(0, length - 1)] : undefined;
  3907. }
  3908. /**
  3909. * A specialized version of `_.sampleSize` for arrays.
  3910. *
  3911. * @private
  3912. * @param {Array} array The array to sample.
  3913. * @param {number} n The number of elements to sample.
  3914. * @returns {Array} Returns the random elements.
  3915. */
  3916. function arraySampleSize(array, n) {
  3917. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3918. }
  3919. /**
  3920. * A specialized version of `_.shuffle` for arrays.
  3921. *
  3922. * @private
  3923. * @param {Array} array The array to shuffle.
  3924. * @returns {Array} Returns the new shuffled array.
  3925. */
  3926. function arrayShuffle(array) {
  3927. return shuffleSelf(copyArray(array));
  3928. }
  3929. /**
  3930. * This function is like `assignValue` except that it doesn't assign
  3931. * `undefined` values.
  3932. *
  3933. * @private
  3934. * @param {Object} object The object to modify.
  3935. * @param {string} key The key of the property to assign.
  3936. * @param {*} value The value to assign.
  3937. */
  3938. function assignMergeValue(object, key, value) {
  3939. if ((value !== undefined && !eq(object[key], value)) ||
  3940. (value === undefined && !(key in object))) {
  3941. baseAssignValue(object, key, value);
  3942. }
  3943. }
  3944. /**
  3945. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3946. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3947. * for equality comparisons.
  3948. *
  3949. * @private
  3950. * @param {Object} object The object to modify.
  3951. * @param {string} key The key of the property to assign.
  3952. * @param {*} value The value to assign.
  3953. */
  3954. function assignValue(object, key, value) {
  3955. var objValue = object[key];
  3956. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3957. (value === undefined && !(key in object))) {
  3958. baseAssignValue(object, key, value);
  3959. }
  3960. }
  3961. /**
  3962. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3963. *
  3964. * @private
  3965. * @param {Array} array The array to inspect.
  3966. * @param {*} key The key to search for.
  3967. * @returns {number} Returns the index of the matched value, else `-1`.
  3968. */
  3969. function assocIndexOf(array, key) {
  3970. var length = array.length;
  3971. while (length--) {
  3972. if (eq(array[length][0], key)) {
  3973. return length;
  3974. }
  3975. }
  3976. return -1;
  3977. }
  3978. /**
  3979. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3980. * by `iteratee` and values set by `setter`.
  3981. *
  3982. * @private
  3983. * @param {Array|Object} collection The collection to iterate over.
  3984. * @param {Function} setter The function to set `accumulator` values.
  3985. * @param {Function} iteratee The iteratee to transform keys.
  3986. * @param {Object} accumulator The initial aggregated object.
  3987. * @returns {Function} Returns `accumulator`.
  3988. */
  3989. function baseAggregator(collection, setter, iteratee, accumulator) {
  3990. baseEach(collection, function(value, key, collection) {
  3991. setter(accumulator, value, iteratee(value), collection);
  3992. });
  3993. return accumulator;
  3994. }
  3995. /**
  3996. * The base implementation of `_.assign` without support for multiple sources
  3997. * or `customizer` functions.
  3998. *
  3999. * @private
  4000. * @param {Object} object The destination object.
  4001. * @param {Object} source The source object.
  4002. * @returns {Object} Returns `object`.
  4003. */
  4004. function baseAssign(object, source) {
  4005. return object && copyObject(source, keys(source), object);
  4006. }
  4007. /**
  4008. * The base implementation of `_.assignIn` without support for multiple sources
  4009. * or `customizer` functions.
  4010. *
  4011. * @private
  4012. * @param {Object} object The destination object.
  4013. * @param {Object} source The source object.
  4014. * @returns {Object} Returns `object`.
  4015. */
  4016. function baseAssignIn(object, source) {
  4017. return object && copyObject(source, keysIn(source), object);
  4018. }
  4019. /**
  4020. * The base implementation of `assignValue` and `assignMergeValue` without
  4021. * value checks.
  4022. *
  4023. * @private
  4024. * @param {Object} object The object to modify.
  4025. * @param {string} key The key of the property to assign.
  4026. * @param {*} value The value to assign.
  4027. */
  4028. function baseAssignValue(object, key, value) {
  4029. if (key == '__proto__' && defineProperty) {
  4030. defineProperty(object, key, {
  4031. 'configurable': true,
  4032. 'enumerable': true,
  4033. 'value': value,
  4034. 'writable': true
  4035. });
  4036. } else {
  4037. object[key] = value;
  4038. }
  4039. }
  4040. /**
  4041. * The base implementation of `_.at` without support for individual paths.
  4042. *
  4043. * @private
  4044. * @param {Object} object The object to iterate over.
  4045. * @param {string[]} paths The property paths to pick.
  4046. * @returns {Array} Returns the picked elements.
  4047. */
  4048. function baseAt(object, paths) {
  4049. var index = -1,
  4050. length = paths.length,
  4051. result = Array(length),
  4052. skip = object == null;
  4053. while (++index < length) {
  4054. result[index] = skip ? undefined : get(object, paths[index]);
  4055. }
  4056. return result;
  4057. }
  4058. /**
  4059. * The base implementation of `_.clamp` which doesn't coerce arguments.
  4060. *
  4061. * @private
  4062. * @param {number} number The number to clamp.
  4063. * @param {number} [lower] The lower bound.
  4064. * @param {number} upper The upper bound.
  4065. * @returns {number} Returns the clamped number.
  4066. */
  4067. function baseClamp(number, lower, upper) {
  4068. if (number === number) {
  4069. if (upper !== undefined) {
  4070. number = number <= upper ? number : upper;
  4071. }
  4072. if (lower !== undefined) {
  4073. number = number >= lower ? number : lower;
  4074. }
  4075. }
  4076. return number;
  4077. }
  4078. /**
  4079. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  4080. * traversed objects.
  4081. *
  4082. * @private
  4083. * @param {*} value The value to clone.
  4084. * @param {boolean} bitmask The bitmask flags.
  4085. * 1 - Deep clone
  4086. * 2 - Flatten inherited properties
  4087. * 4 - Clone symbols
  4088. * @param {Function} [customizer] The function to customize cloning.
  4089. * @param {string} [key] The key of `value`.
  4090. * @param {Object} [object] The parent object of `value`.
  4091. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  4092. * @returns {*} Returns the cloned value.
  4093. */
  4094. function baseClone(value, bitmask, customizer, key, object, stack) {
  4095. var result,
  4096. isDeep = bitmask & CLONE_DEEP_FLAG,
  4097. isFlat = bitmask & CLONE_FLAT_FLAG,
  4098. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  4099. if (customizer) {
  4100. result = object ? customizer(value, key, object, stack) : customizer(value);
  4101. }
  4102. if (result !== undefined) {
  4103. return result;
  4104. }
  4105. if (!isObject(value)) {
  4106. return value;
  4107. }
  4108. var isArr = isArray(value);
  4109. if (isArr) {
  4110. result = initCloneArray(value);
  4111. if (!isDeep) {
  4112. return copyArray(value, result);
  4113. }
  4114. } else {
  4115. var tag = getTag(value),
  4116. isFunc = tag == funcTag || tag == genTag;
  4117. if (isBuffer(value)) {
  4118. return cloneBuffer(value, isDeep);
  4119. }
  4120. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  4121. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  4122. if (!isDeep) {
  4123. return isFlat
  4124. ? copySymbolsIn(value, baseAssignIn(result, value))
  4125. : copySymbols(value, baseAssign(result, value));
  4126. }
  4127. } else {
  4128. if (!cloneableTags[tag]) {
  4129. return object ? value : {};
  4130. }
  4131. result = initCloneByTag(value, tag, isDeep);
  4132. }
  4133. }
  4134. // Check for circular references and return its corresponding clone.
  4135. stack || (stack = new Stack);
  4136. var stacked = stack.get(value);
  4137. if (stacked) {
  4138. return stacked;
  4139. }
  4140. stack.set(value, result);
  4141. if (isSet(value)) {
  4142. value.forEach(function(subValue) {
  4143. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  4144. });
  4145. } else if (isMap(value)) {
  4146. value.forEach(function(subValue, key) {
  4147. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  4148. });
  4149. }
  4150. var keysFunc = isFull
  4151. ? (isFlat ? getAllKeysIn : getAllKeys)
  4152. : (isFlat ? keysIn : keys);
  4153. var props = isArr ? undefined : keysFunc(value);
  4154. arrayEach(props || value, function(subValue, key) {
  4155. if (props) {
  4156. key = subValue;
  4157. subValue = value[key];
  4158. }
  4159. // Recursively populate clone (susceptible to call stack limits).
  4160. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  4161. });
  4162. return result;
  4163. }
  4164. /**
  4165. * The base implementation of `_.conforms` which doesn't clone `source`.
  4166. *
  4167. * @private
  4168. * @param {Object} source The object of property predicates to conform to.
  4169. * @returns {Function} Returns the new spec function.
  4170. */
  4171. function baseConforms(source) {
  4172. var props = keys(source);
  4173. return function(object) {
  4174. return baseConformsTo(object, source, props);
  4175. };
  4176. }
  4177. /**
  4178. * The base implementation of `_.conformsTo` which accepts `props` to check.
  4179. *
  4180. * @private
  4181. * @param {Object} object The object to inspect.
  4182. * @param {Object} source The object of property predicates to conform to.
  4183. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  4184. */
  4185. function baseConformsTo(object, source, props) {
  4186. var length = props.length;
  4187. if (object == null) {
  4188. return !length;
  4189. }
  4190. object = Object(object);
  4191. while (length--) {
  4192. var key = props[length],
  4193. predicate = source[key],
  4194. value = object[key];
  4195. if ((value === undefined && !(key in object)) || !predicate(value)) {
  4196. return false;
  4197. }
  4198. }
  4199. return true;
  4200. }
  4201. /**
  4202. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  4203. * to provide to `func`.
  4204. *
  4205. * @private
  4206. * @param {Function} func The function to delay.
  4207. * @param {number} wait The number of milliseconds to delay invocation.
  4208. * @param {Array} args The arguments to provide to `func`.
  4209. * @returns {number|Object} Returns the timer id or timeout object.
  4210. */
  4211. function baseDelay(func, wait, args) {
  4212. if (typeof func != 'function') {
  4213. throw new TypeError(FUNC_ERROR_TEXT);
  4214. }
  4215. return setTimeout(function() { func.apply(undefined, args); }, wait);
  4216. }
  4217. /**
  4218. * The base implementation of methods like `_.difference` without support
  4219. * for excluding multiple arrays or iteratee shorthands.
  4220. *
  4221. * @private
  4222. * @param {Array} array The array to inspect.
  4223. * @param {Array} values The values to exclude.
  4224. * @param {Function} [iteratee] The iteratee invoked per element.
  4225. * @param {Function} [comparator] The comparator invoked per element.
  4226. * @returns {Array} Returns the new array of filtered values.
  4227. */
  4228. function baseDifference(array, values, iteratee, comparator) {
  4229. var index = -1,
  4230. includes = arrayIncludes,
  4231. isCommon = true,
  4232. length = array.length,
  4233. result = [],
  4234. valuesLength = values.length;
  4235. if (!length) {
  4236. return result;
  4237. }
  4238. if (iteratee) {
  4239. values = arrayMap(values, baseUnary(iteratee));
  4240. }
  4241. if (comparator) {
  4242. includes = arrayIncludesWith;
  4243. isCommon = false;
  4244. }
  4245. else if (values.length >= LARGE_ARRAY_SIZE) {
  4246. includes = cacheHas;
  4247. isCommon = false;
  4248. values = new SetCache(values);
  4249. }
  4250. outer:
  4251. while (++index < length) {
  4252. var value = array[index],
  4253. computed = iteratee == null ? value : iteratee(value);
  4254. value = (comparator || value !== 0) ? value : 0;
  4255. if (isCommon && computed === computed) {
  4256. var valuesIndex = valuesLength;
  4257. while (valuesIndex--) {
  4258. if (values[valuesIndex] === computed) {
  4259. continue outer;
  4260. }
  4261. }
  4262. result.push(value);
  4263. }
  4264. else if (!includes(values, computed, comparator)) {
  4265. result.push(value);
  4266. }
  4267. }
  4268. return result;
  4269. }
  4270. /**
  4271. * The base implementation of `_.forEach` without support for iteratee shorthands.
  4272. *
  4273. * @private
  4274. * @param {Array|Object} collection The collection to iterate over.
  4275. * @param {Function} iteratee The function invoked per iteration.
  4276. * @returns {Array|Object} Returns `collection`.
  4277. */
  4278. var baseEach = createBaseEach(baseForOwn);
  4279. /**
  4280. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  4281. *
  4282. * @private
  4283. * @param {Array|Object} collection The collection to iterate over.
  4284. * @param {Function} iteratee The function invoked per iteration.
  4285. * @returns {Array|Object} Returns `collection`.
  4286. */
  4287. var baseEachRight = createBaseEach(baseForOwnRight, true);
  4288. /**
  4289. * The base implementation of `_.every` without support for iteratee shorthands.
  4290. *
  4291. * @private
  4292. * @param {Array|Object} collection The collection to iterate over.
  4293. * @param {Function} predicate The function invoked per iteration.
  4294. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  4295. * else `false`
  4296. */
  4297. function baseEvery(collection, predicate) {
  4298. var result = true;
  4299. baseEach(collection, function(value, index, collection) {
  4300. result = !!predicate(value, index, collection);
  4301. return result;
  4302. });
  4303. return result;
  4304. }
  4305. /**
  4306. * The base implementation of methods like `_.max` and `_.min` which accepts a
  4307. * `comparator` to determine the extremum value.
  4308. *
  4309. * @private
  4310. * @param {Array} array The array to iterate over.
  4311. * @param {Function} iteratee The iteratee invoked per iteration.
  4312. * @param {Function} comparator The comparator used to compare values.
  4313. * @returns {*} Returns the extremum value.
  4314. */
  4315. function baseExtremum(array, iteratee, comparator) {
  4316. var index = -1,
  4317. length = array.length;
  4318. while (++index < length) {
  4319. var value = array[index],
  4320. current = iteratee(value);
  4321. if (current != null && (computed === undefined
  4322. ? (current === current && !isSymbol(current))
  4323. : comparator(current, computed)
  4324. )) {
  4325. var computed = current,
  4326. result = value;
  4327. }
  4328. }
  4329. return result;
  4330. }
  4331. /**
  4332. * The base implementation of `_.fill` without an iteratee call guard.
  4333. *
  4334. * @private
  4335. * @param {Array} array The array to fill.
  4336. * @param {*} value The value to fill `array` with.
  4337. * @param {number} [start=0] The start position.
  4338. * @param {number} [end=array.length] The end position.
  4339. * @returns {Array} Returns `array`.
  4340. */
  4341. function baseFill(array, value, start, end) {
  4342. var length = array.length;
  4343. start = toInteger(start);
  4344. if (start < 0) {
  4345. start = -start > length ? 0 : (length + start);
  4346. }
  4347. end = (end === undefined || end > length) ? length : toInteger(end);
  4348. if (end < 0) {
  4349. end += length;
  4350. }
  4351. end = start > end ? 0 : toLength(end);
  4352. while (start < end) {
  4353. array[start++] = value;
  4354. }
  4355. return array;
  4356. }
  4357. /**
  4358. * The base implementation of `_.filter` without support for iteratee shorthands.
  4359. *
  4360. * @private
  4361. * @param {Array|Object} collection The collection to iterate over.
  4362. * @param {Function} predicate The function invoked per iteration.
  4363. * @returns {Array} Returns the new filtered array.
  4364. */
  4365. function baseFilter(collection, predicate) {
  4366. var result = [];
  4367. baseEach(collection, function(value, index, collection) {
  4368. if (predicate(value, index, collection)) {
  4369. result.push(value);
  4370. }
  4371. });
  4372. return result;
  4373. }
  4374. /**
  4375. * The base implementation of `_.flatten` with support for restricting flattening.
  4376. *
  4377. * @private
  4378. * @param {Array} array The array to flatten.
  4379. * @param {number} depth The maximum recursion depth.
  4380. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  4381. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  4382. * @param {Array} [result=[]] The initial result value.
  4383. * @returns {Array} Returns the new flattened array.
  4384. */
  4385. function baseFlatten(array, depth, predicate, isStrict, result) {
  4386. var index = -1,
  4387. length = array.length;
  4388. predicate || (predicate = isFlattenable);
  4389. result || (result = []);
  4390. while (++index < length) {
  4391. var value = array[index];
  4392. if (depth > 0 && predicate(value)) {
  4393. if (depth > 1) {
  4394. // Recursively flatten arrays (susceptible to call stack limits).
  4395. baseFlatten(value, depth - 1, predicate, isStrict, result);
  4396. } else {
  4397. arrayPush(result, value);
  4398. }
  4399. } else if (!isStrict) {
  4400. result[result.length] = value;
  4401. }
  4402. }
  4403. return result;
  4404. }
  4405. /**
  4406. * The base implementation of `baseForOwn` which iterates over `object`
  4407. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  4408. * Iteratee functions may exit iteration early by explicitly returning `false`.
  4409. *
  4410. * @private
  4411. * @param {Object} object The object to iterate over.
  4412. * @param {Function} iteratee The function invoked per iteration.
  4413. * @param {Function} keysFunc The function to get the keys of `object`.
  4414. * @returns {Object} Returns `object`.
  4415. */
  4416. var baseFor = createBaseFor();
  4417. /**
  4418. * This function is like `baseFor` except that it iterates over properties
  4419. * in the opposite order.
  4420. *
  4421. * @private
  4422. * @param {Object} object The object to iterate over.
  4423. * @param {Function} iteratee The function invoked per iteration.
  4424. * @param {Function} keysFunc The function to get the keys of `object`.
  4425. * @returns {Object} Returns `object`.
  4426. */
  4427. var baseForRight = createBaseFor(true);
  4428. /**
  4429. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  4430. *
  4431. * @private
  4432. * @param {Object} object The object to iterate over.
  4433. * @param {Function} iteratee The function invoked per iteration.
  4434. * @returns {Object} Returns `object`.
  4435. */
  4436. function baseForOwn(object, iteratee) {
  4437. return object && baseFor(object, iteratee, keys);
  4438. }
  4439. /**
  4440. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  4441. *
  4442. * @private
  4443. * @param {Object} object The object to iterate over.
  4444. * @param {Function} iteratee The function invoked per iteration.
  4445. * @returns {Object} Returns `object`.
  4446. */
  4447. function baseForOwnRight(object, iteratee) {
  4448. return object && baseForRight(object, iteratee, keys);
  4449. }
  4450. /**
  4451. * The base implementation of `_.functions` which creates an array of
  4452. * `object` function property names filtered from `props`.
  4453. *
  4454. * @private
  4455. * @param {Object} object The object to inspect.
  4456. * @param {Array} props The property names to filter.
  4457. * @returns {Array} Returns the function names.
  4458. */
  4459. function baseFunctions(object, props) {
  4460. return arrayFilter(props, function(key) {
  4461. return isFunction(object[key]);
  4462. });
  4463. }
  4464. /**
  4465. * The base implementation of `_.get` without support for default values.
  4466. *
  4467. * @private
  4468. * @param {Object} object The object to query.
  4469. * @param {Array|string} path The path of the property to get.
  4470. * @returns {*} Returns the resolved value.
  4471. */
  4472. function baseGet(object, path) {
  4473. path = castPath(path, object);
  4474. var index = 0,
  4475. length = path.length;
  4476. while (object != null && index < length) {
  4477. object = object[toKey(path[index++])];
  4478. }
  4479. return (index && index == length) ? object : undefined;
  4480. }
  4481. /**
  4482. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4483. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4484. * symbols of `object`.
  4485. *
  4486. * @private
  4487. * @param {Object} object The object to query.
  4488. * @param {Function} keysFunc The function to get the keys of `object`.
  4489. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4490. * @returns {Array} Returns the array of property names and symbols.
  4491. */
  4492. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4493. var result = keysFunc(object);
  4494. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4495. }
  4496. /**
  4497. * The base implementation of `getTag` without fallbacks for buggy environments.
  4498. *
  4499. * @private
  4500. * @param {*} value The value to query.
  4501. * @returns {string} Returns the `toStringTag`.
  4502. */
  4503. function baseGetTag(value) {
  4504. if (value == null) {
  4505. return value === undefined ? undefinedTag : nullTag;
  4506. }
  4507. return (symToStringTag && symToStringTag in Object(value))
  4508. ? getRawTag(value)
  4509. : objectToString(value);
  4510. }
  4511. /**
  4512. * The base implementation of `_.gt` which doesn't coerce arguments.
  4513. *
  4514. * @private
  4515. * @param {*} value The value to compare.
  4516. * @param {*} other The other value to compare.
  4517. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4518. * else `false`.
  4519. */
  4520. function baseGt(value, other) {
  4521. return value > other;
  4522. }
  4523. /**
  4524. * The base implementation of `_.has` without support for deep paths.
  4525. *
  4526. * @private
  4527. * @param {Object} [object] The object to query.
  4528. * @param {Array|string} key The key to check.
  4529. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4530. */
  4531. function baseHas(object, key) {
  4532. return object != null && hasOwnProperty.call(object, key);
  4533. }
  4534. /**
  4535. * The base implementation of `_.hasIn` without support for deep paths.
  4536. *
  4537. * @private
  4538. * @param {Object} [object] The object to query.
  4539. * @param {Array|string} key The key to check.
  4540. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4541. */
  4542. function baseHasIn(object, key) {
  4543. return object != null && key in Object(object);
  4544. }
  4545. /**
  4546. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4547. *
  4548. * @private
  4549. * @param {number} number The number to check.
  4550. * @param {number} start The start of the range.
  4551. * @param {number} end The end of the range.
  4552. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4553. */
  4554. function baseInRange(number, start, end) {
  4555. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4556. }
  4557. /**
  4558. * The base implementation of methods like `_.intersection`, without support
  4559. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4560. *
  4561. * @private
  4562. * @param {Array} arrays The arrays to inspect.
  4563. * @param {Function} [iteratee] The iteratee invoked per element.
  4564. * @param {Function} [comparator] The comparator invoked per element.
  4565. * @returns {Array} Returns the new array of shared values.
  4566. */
  4567. function baseIntersection(arrays, iteratee, comparator) {
  4568. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4569. length = arrays[0].length,
  4570. othLength = arrays.length,
  4571. othIndex = othLength,
  4572. caches = Array(othLength),
  4573. maxLength = Infinity,
  4574. result = [];
  4575. while (othIndex--) {
  4576. var array = arrays[othIndex];
  4577. if (othIndex && iteratee) {
  4578. array = arrayMap(array, baseUnary(iteratee));
  4579. }
  4580. maxLength = nativeMin(array.length, maxLength);
  4581. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4582. ? new SetCache(othIndex && array)
  4583. : undefined;
  4584. }
  4585. array = arrays[0];
  4586. var index = -1,
  4587. seen = caches[0];
  4588. outer:
  4589. while (++index < length && result.length < maxLength) {
  4590. var value = array[index],
  4591. computed = iteratee ? iteratee(value) : value;
  4592. value = (comparator || value !== 0) ? value : 0;
  4593. if (!(seen
  4594. ? cacheHas(seen, computed)
  4595. : includes(result, computed, comparator)
  4596. )) {
  4597. othIndex = othLength;
  4598. while (--othIndex) {
  4599. var cache = caches[othIndex];
  4600. if (!(cache
  4601. ? cacheHas(cache, computed)
  4602. : includes(arrays[othIndex], computed, comparator))
  4603. ) {
  4604. continue outer;
  4605. }
  4606. }
  4607. if (seen) {
  4608. seen.push(computed);
  4609. }
  4610. result.push(value);
  4611. }
  4612. }
  4613. return result;
  4614. }
  4615. /**
  4616. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4617. * `object` with values transformed by `iteratee` and set by `setter`.
  4618. *
  4619. * @private
  4620. * @param {Object} object The object to iterate over.
  4621. * @param {Function} setter The function to set `accumulator` values.
  4622. * @param {Function} iteratee The iteratee to transform values.
  4623. * @param {Object} accumulator The initial inverted object.
  4624. * @returns {Function} Returns `accumulator`.
  4625. */
  4626. function baseInverter(object, setter, iteratee, accumulator) {
  4627. baseForOwn(object, function(value, key, object) {
  4628. setter(accumulator, iteratee(value), key, object);
  4629. });
  4630. return accumulator;
  4631. }
  4632. /**
  4633. * The base implementation of `_.invoke` without support for individual
  4634. * method arguments.
  4635. *
  4636. * @private
  4637. * @param {Object} object The object to query.
  4638. * @param {Array|string} path The path of the method to invoke.
  4639. * @param {Array} args The arguments to invoke the method with.
  4640. * @returns {*} Returns the result of the invoked method.
  4641. */
  4642. function baseInvoke(object, path, args) {
  4643. path = castPath(path, object);
  4644. object = parent(object, path);
  4645. var func = object == null ? object : object[toKey(last(path))];
  4646. return func == null ? undefined : apply(func, object, args);
  4647. }
  4648. /**
  4649. * The base implementation of `_.isArguments`.
  4650. *
  4651. * @private
  4652. * @param {*} value The value to check.
  4653. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4654. */
  4655. function baseIsArguments(value) {
  4656. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4657. }
  4658. /**
  4659. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4660. *
  4661. * @private
  4662. * @param {*} value The value to check.
  4663. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4664. */
  4665. function baseIsArrayBuffer(value) {
  4666. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4667. }
  4668. /**
  4669. * The base implementation of `_.isDate` without Node.js optimizations.
  4670. *
  4671. * @private
  4672. * @param {*} value The value to check.
  4673. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4674. */
  4675. function baseIsDate(value) {
  4676. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4677. }
  4678. /**
  4679. * The base implementation of `_.isEqual` which supports partial comparisons
  4680. * and tracks traversed objects.
  4681. *
  4682. * @private
  4683. * @param {*} value The value to compare.
  4684. * @param {*} other The other value to compare.
  4685. * @param {boolean} bitmask The bitmask flags.
  4686. * 1 - Unordered comparison
  4687. * 2 - Partial comparison
  4688. * @param {Function} [customizer] The function to customize comparisons.
  4689. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4690. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4691. */
  4692. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4693. if (value === other) {
  4694. return true;
  4695. }
  4696. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4697. return value !== value && other !== other;
  4698. }
  4699. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4700. }
  4701. /**
  4702. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4703. * deep comparisons and tracks traversed objects enabling objects with circular
  4704. * references to be compared.
  4705. *
  4706. * @private
  4707. * @param {Object} object The object to compare.
  4708. * @param {Object} other The other object to compare.
  4709. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4710. * @param {Function} customizer The function to customize comparisons.
  4711. * @param {Function} equalFunc The function to determine equivalents of values.
  4712. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4713. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4714. */
  4715. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4716. var objIsArr = isArray(object),
  4717. othIsArr = isArray(other),
  4718. objTag = objIsArr ? arrayTag : getTag(object),
  4719. othTag = othIsArr ? arrayTag : getTag(other);
  4720. objTag = objTag == argsTag ? objectTag : objTag;
  4721. othTag = othTag == argsTag ? objectTag : othTag;
  4722. var objIsObj = objTag == objectTag,
  4723. othIsObj = othTag == objectTag,
  4724. isSameTag = objTag == othTag;
  4725. if (isSameTag && isBuffer(object)) {
  4726. if (!isBuffer(other)) {
  4727. return false;
  4728. }
  4729. objIsArr = true;
  4730. objIsObj = false;
  4731. }
  4732. if (isSameTag && !objIsObj) {
  4733. stack || (stack = new Stack);
  4734. return (objIsArr || isTypedArray(object))
  4735. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4736. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4737. }
  4738. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4739. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4740. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4741. if (objIsWrapped || othIsWrapped) {
  4742. var objUnwrapped = objIsWrapped ? object.value() : object,
  4743. othUnwrapped = othIsWrapped ? other.value() : other;
  4744. stack || (stack = new Stack);
  4745. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4746. }
  4747. }
  4748. if (!isSameTag) {
  4749. return false;
  4750. }
  4751. stack || (stack = new Stack);
  4752. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4753. }
  4754. /**
  4755. * The base implementation of `_.isMap` without Node.js optimizations.
  4756. *
  4757. * @private
  4758. * @param {*} value The value to check.
  4759. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4760. */
  4761. function baseIsMap(value) {
  4762. return isObjectLike(value) && getTag(value) == mapTag;
  4763. }
  4764. /**
  4765. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4766. *
  4767. * @private
  4768. * @param {Object} object The object to inspect.
  4769. * @param {Object} source The object of property values to match.
  4770. * @param {Array} matchData The property names, values, and compare flags to match.
  4771. * @param {Function} [customizer] The function to customize comparisons.
  4772. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4773. */
  4774. function baseIsMatch(object, source, matchData, customizer) {
  4775. var index = matchData.length,
  4776. length = index,
  4777. noCustomizer = !customizer;
  4778. if (object == null) {
  4779. return !length;
  4780. }
  4781. object = Object(object);
  4782. while (index--) {
  4783. var data = matchData[index];
  4784. if ((noCustomizer && data[2])
  4785. ? data[1] !== object[data[0]]
  4786. : !(data[0] in object)
  4787. ) {
  4788. return false;
  4789. }
  4790. }
  4791. while (++index < length) {
  4792. data = matchData[index];
  4793. var key = data[0],
  4794. objValue = object[key],
  4795. srcValue = data[1];
  4796. if (noCustomizer && data[2]) {
  4797. if (objValue === undefined && !(key in object)) {
  4798. return false;
  4799. }
  4800. } else {
  4801. var stack = new Stack;
  4802. if (customizer) {
  4803. var result = customizer(objValue, srcValue, key, object, source, stack);
  4804. }
  4805. if (!(result === undefined
  4806. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4807. : result
  4808. )) {
  4809. return false;
  4810. }
  4811. }
  4812. }
  4813. return true;
  4814. }
  4815. /**
  4816. * The base implementation of `_.isNative` without bad shim checks.
  4817. *
  4818. * @private
  4819. * @param {*} value The value to check.
  4820. * @returns {boolean} Returns `true` if `value` is a native function,
  4821. * else `false`.
  4822. */
  4823. function baseIsNative(value) {
  4824. if (!isObject(value) || isMasked(value)) {
  4825. return false;
  4826. }
  4827. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4828. return pattern.test(toSource(value));
  4829. }
  4830. /**
  4831. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4832. *
  4833. * @private
  4834. * @param {*} value The value to check.
  4835. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4836. */
  4837. function baseIsRegExp(value) {
  4838. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4839. }
  4840. /**
  4841. * The base implementation of `_.isSet` without Node.js optimizations.
  4842. *
  4843. * @private
  4844. * @param {*} value The value to check.
  4845. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4846. */
  4847. function baseIsSet(value) {
  4848. return isObjectLike(value) && getTag(value) == setTag;
  4849. }
  4850. /**
  4851. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4852. *
  4853. * @private
  4854. * @param {*} value The value to check.
  4855. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4856. */
  4857. function baseIsTypedArray(value) {
  4858. return isObjectLike(value) &&
  4859. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4860. }
  4861. /**
  4862. * The base implementation of `_.iteratee`.
  4863. *
  4864. * @private
  4865. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4866. * @returns {Function} Returns the iteratee.
  4867. */
  4868. function baseIteratee(value) {
  4869. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4870. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4871. if (typeof value == 'function') {
  4872. return value;
  4873. }
  4874. if (value == null) {
  4875. return identity;
  4876. }
  4877. if (typeof value == 'object') {
  4878. return isArray(value)
  4879. ? baseMatchesProperty(value[0], value[1])
  4880. : baseMatches(value);
  4881. }
  4882. return property(value);
  4883. }
  4884. /**
  4885. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4886. *
  4887. * @private
  4888. * @param {Object} object The object to query.
  4889. * @returns {Array} Returns the array of property names.
  4890. */
  4891. function baseKeys(object) {
  4892. if (!isPrototype(object)) {
  4893. return nativeKeys(object);
  4894. }
  4895. var result = [];
  4896. for (var key in Object(object)) {
  4897. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4898. result.push(key);
  4899. }
  4900. }
  4901. return result;
  4902. }
  4903. /**
  4904. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4905. *
  4906. * @private
  4907. * @param {Object} object The object to query.
  4908. * @returns {Array} Returns the array of property names.
  4909. */
  4910. function baseKeysIn(object) {
  4911. if (!isObject(object)) {
  4912. return nativeKeysIn(object);
  4913. }
  4914. var isProto = isPrototype(object),
  4915. result = [];
  4916. for (var key in object) {
  4917. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4918. result.push(key);
  4919. }
  4920. }
  4921. return result;
  4922. }
  4923. /**
  4924. * The base implementation of `_.lt` which doesn't coerce arguments.
  4925. *
  4926. * @private
  4927. * @param {*} value The value to compare.
  4928. * @param {*} other The other value to compare.
  4929. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4930. * else `false`.
  4931. */
  4932. function baseLt(value, other) {
  4933. return value < other;
  4934. }
  4935. /**
  4936. * The base implementation of `_.map` without support for iteratee shorthands.
  4937. *
  4938. * @private
  4939. * @param {Array|Object} collection The collection to iterate over.
  4940. * @param {Function} iteratee The function invoked per iteration.
  4941. * @returns {Array} Returns the new mapped array.
  4942. */
  4943. function baseMap(collection, iteratee) {
  4944. var index = -1,
  4945. result = isArrayLike(collection) ? Array(collection.length) : [];
  4946. baseEach(collection, function(value, key, collection) {
  4947. result[++index] = iteratee(value, key, collection);
  4948. });
  4949. return result;
  4950. }
  4951. /**
  4952. * The base implementation of `_.matches` which doesn't clone `source`.
  4953. *
  4954. * @private
  4955. * @param {Object} source The object of property values to match.
  4956. * @returns {Function} Returns the new spec function.
  4957. */
  4958. function baseMatches(source) {
  4959. var matchData = getMatchData(source);
  4960. if (matchData.length == 1 && matchData[0][2]) {
  4961. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4962. }
  4963. return function(object) {
  4964. return object === source || baseIsMatch(object, source, matchData);
  4965. };
  4966. }
  4967. /**
  4968. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4969. *
  4970. * @private
  4971. * @param {string} path The path of the property to get.
  4972. * @param {*} srcValue The value to match.
  4973. * @returns {Function} Returns the new spec function.
  4974. */
  4975. function baseMatchesProperty(path, srcValue) {
  4976. if (isKey(path) && isStrictComparable(srcValue)) {
  4977. return matchesStrictComparable(toKey(path), srcValue);
  4978. }
  4979. return function(object) {
  4980. var objValue = get(object, path);
  4981. return (objValue === undefined && objValue === srcValue)
  4982. ? hasIn(object, path)
  4983. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4984. };
  4985. }
  4986. /**
  4987. * The base implementation of `_.merge` without support for multiple sources.
  4988. *
  4989. * @private
  4990. * @param {Object} object The destination object.
  4991. * @param {Object} source The source object.
  4992. * @param {number} srcIndex The index of `source`.
  4993. * @param {Function} [customizer] The function to customize merged values.
  4994. * @param {Object} [stack] Tracks traversed source values and their merged
  4995. * counterparts.
  4996. */
  4997. function baseMerge(object, source, srcIndex, customizer, stack) {
  4998. if (object === source) {
  4999. return;
  5000. }
  5001. baseFor(source, function(srcValue, key) {
  5002. stack || (stack = new Stack);
  5003. if (isObject(srcValue)) {
  5004. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  5005. }
  5006. else {
  5007. var newValue = customizer
  5008. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  5009. : undefined;
  5010. if (newValue === undefined) {
  5011. newValue = srcValue;
  5012. }
  5013. assignMergeValue(object, key, newValue);
  5014. }
  5015. }, keysIn);
  5016. }
  5017. /**
  5018. * A specialized version of `baseMerge` for arrays and objects which performs
  5019. * deep merges and tracks traversed objects enabling objects with circular
  5020. * references to be merged.
  5021. *
  5022. * @private
  5023. * @param {Object} object The destination object.
  5024. * @param {Object} source The source object.
  5025. * @param {string} key The key of the value to merge.
  5026. * @param {number} srcIndex The index of `source`.
  5027. * @param {Function} mergeFunc The function to merge values.
  5028. * @param {Function} [customizer] The function to customize assigned values.
  5029. * @param {Object} [stack] Tracks traversed source values and their merged
  5030. * counterparts.
  5031. */
  5032. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  5033. var objValue = safeGet(object, key),
  5034. srcValue = safeGet(source, key),
  5035. stacked = stack.get(srcValue);
  5036. if (stacked) {
  5037. assignMergeValue(object, key, stacked);
  5038. return;
  5039. }
  5040. var newValue = customizer
  5041. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  5042. : undefined;
  5043. var isCommon = newValue === undefined;
  5044. if (isCommon) {
  5045. var isArr = isArray(srcValue),
  5046. isBuff = !isArr && isBuffer(srcValue),
  5047. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  5048. newValue = srcValue;
  5049. if (isArr || isBuff || isTyped) {
  5050. if (isArray(objValue)) {
  5051. newValue = objValue;
  5052. }
  5053. else if (isArrayLikeObject(objValue)) {
  5054. newValue = copyArray(objValue);
  5055. }
  5056. else if (isBuff) {
  5057. isCommon = false;
  5058. newValue = cloneBuffer(srcValue, true);
  5059. }
  5060. else if (isTyped) {
  5061. isCommon = false;
  5062. newValue = cloneTypedArray(srcValue, true);
  5063. }
  5064. else {
  5065. newValue = [];
  5066. }
  5067. }
  5068. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  5069. newValue = objValue;
  5070. if (isArguments(objValue)) {
  5071. newValue = toPlainObject(objValue);
  5072. }
  5073. else if (!isObject(objValue) || isFunction(objValue)) {
  5074. newValue = initCloneObject(srcValue);
  5075. }
  5076. }
  5077. else {
  5078. isCommon = false;
  5079. }
  5080. }
  5081. if (isCommon) {
  5082. // Recursively merge objects and arrays (susceptible to call stack limits).
  5083. stack.set(srcValue, newValue);
  5084. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  5085. stack['delete'](srcValue);
  5086. }
  5087. assignMergeValue(object, key, newValue);
  5088. }
  5089. /**
  5090. * The base implementation of `_.nth` which doesn't coerce arguments.
  5091. *
  5092. * @private
  5093. * @param {Array} array The array to query.
  5094. * @param {number} n The index of the element to return.
  5095. * @returns {*} Returns the nth element of `array`.
  5096. */
  5097. function baseNth(array, n) {
  5098. var length = array.length;
  5099. if (!length) {
  5100. return;
  5101. }
  5102. n += n < 0 ? length : 0;
  5103. return isIndex(n, length) ? array[n] : undefined;
  5104. }
  5105. /**
  5106. * The base implementation of `_.orderBy` without param guards.
  5107. *
  5108. * @private
  5109. * @param {Array|Object} collection The collection to iterate over.
  5110. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  5111. * @param {string[]} orders The sort orders of `iteratees`.
  5112. * @returns {Array} Returns the new sorted array.
  5113. */
  5114. function baseOrderBy(collection, iteratees, orders) {
  5115. if (iteratees.length) {
  5116. iteratees = arrayMap(iteratees, function(iteratee) {
  5117. if (isArray(iteratee)) {
  5118. return function(value) {
  5119. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  5120. }
  5121. }
  5122. return iteratee;
  5123. });
  5124. } else {
  5125. iteratees = [identity];
  5126. }
  5127. var index = -1;
  5128. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  5129. var result = baseMap(collection, function(value, key, collection) {
  5130. var criteria = arrayMap(iteratees, function(iteratee) {
  5131. return iteratee(value);
  5132. });
  5133. return { 'criteria': criteria, 'index': ++index, 'value': value };
  5134. });
  5135. return baseSortBy(result, function(object, other) {
  5136. return compareMultiple(object, other, orders);
  5137. });
  5138. }
  5139. /**
  5140. * The base implementation of `_.pick` without support for individual
  5141. * property identifiers.
  5142. *
  5143. * @private
  5144. * @param {Object} object The source object.
  5145. * @param {string[]} paths The property paths to pick.
  5146. * @returns {Object} Returns the new object.
  5147. */
  5148. function basePick(object, paths) {
  5149. return basePickBy(object, paths, function(value, path) {
  5150. return hasIn(object, path);
  5151. });
  5152. }
  5153. /**
  5154. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  5155. *
  5156. * @private
  5157. * @param {Object} object The source object.
  5158. * @param {string[]} paths The property paths to pick.
  5159. * @param {Function} predicate The function invoked per property.
  5160. * @returns {Object} Returns the new object.
  5161. */
  5162. function basePickBy(object, paths, predicate) {
  5163. var index = -1,
  5164. length = paths.length,
  5165. result = {};
  5166. while (++index < length) {
  5167. var path = paths[index],
  5168. value = baseGet(object, path);
  5169. if (predicate(value, path)) {
  5170. baseSet(result, castPath(path, object), value);
  5171. }
  5172. }
  5173. return result;
  5174. }
  5175. /**
  5176. * A specialized version of `baseProperty` which supports deep paths.
  5177. *
  5178. * @private
  5179. * @param {Array|string} path The path of the property to get.
  5180. * @returns {Function} Returns the new accessor function.
  5181. */
  5182. function basePropertyDeep(path) {
  5183. return function(object) {
  5184. return baseGet(object, path);
  5185. };
  5186. }
  5187. /**
  5188. * The base implementation of `_.pullAllBy` without support for iteratee
  5189. * shorthands.
  5190. *
  5191. * @private
  5192. * @param {Array} array The array to modify.
  5193. * @param {Array} values The values to remove.
  5194. * @param {Function} [iteratee] The iteratee invoked per element.
  5195. * @param {Function} [comparator] The comparator invoked per element.
  5196. * @returns {Array} Returns `array`.
  5197. */
  5198. function basePullAll(array, values, iteratee, comparator) {
  5199. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  5200. index = -1,
  5201. length = values.length,
  5202. seen = array;
  5203. if (array === values) {
  5204. values = copyArray(values);
  5205. }
  5206. if (iteratee) {
  5207. seen = arrayMap(array, baseUnary(iteratee));
  5208. }
  5209. while (++index < length) {
  5210. var fromIndex = 0,
  5211. value = values[index],
  5212. computed = iteratee ? iteratee(value) : value;
  5213. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  5214. if (seen !== array) {
  5215. splice.call(seen, fromIndex, 1);
  5216. }
  5217. splice.call(array, fromIndex, 1);
  5218. }
  5219. }
  5220. return array;
  5221. }
  5222. /**
  5223. * The base implementation of `_.pullAt` without support for individual
  5224. * indexes or capturing the removed elements.
  5225. *
  5226. * @private
  5227. * @param {Array} array The array to modify.
  5228. * @param {number[]} indexes The indexes of elements to remove.
  5229. * @returns {Array} Returns `array`.
  5230. */
  5231. function basePullAt(array, indexes) {
  5232. var length = array ? indexes.length : 0,
  5233. lastIndex = length - 1;
  5234. while (length--) {
  5235. var index = indexes[length];
  5236. if (length == lastIndex || index !== previous) {
  5237. var previous = index;
  5238. if (isIndex(index)) {
  5239. splice.call(array, index, 1);
  5240. } else {
  5241. baseUnset(array, index);
  5242. }
  5243. }
  5244. }
  5245. return array;
  5246. }
  5247. /**
  5248. * The base implementation of `_.random` without support for returning
  5249. * floating-point numbers.
  5250. *
  5251. * @private
  5252. * @param {number} lower The lower bound.
  5253. * @param {number} upper The upper bound.
  5254. * @returns {number} Returns the random number.
  5255. */
  5256. function baseRandom(lower, upper) {
  5257. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  5258. }
  5259. /**
  5260. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  5261. * coerce arguments.
  5262. *
  5263. * @private
  5264. * @param {number} start The start of the range.
  5265. * @param {number} end The end of the range.
  5266. * @param {number} step The value to increment or decrement by.
  5267. * @param {boolean} [fromRight] Specify iterating from right to left.
  5268. * @returns {Array} Returns the range of numbers.
  5269. */
  5270. function baseRange(start, end, step, fromRight) {
  5271. var index = -1,
  5272. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  5273. result = Array(length);
  5274. while (length--) {
  5275. result[fromRight ? length : ++index] = start;
  5276. start += step;
  5277. }
  5278. return result;
  5279. }
  5280. /**
  5281. * The base implementation of `_.repeat` which doesn't coerce arguments.
  5282. *
  5283. * @private
  5284. * @param {string} string The string to repeat.
  5285. * @param {number} n The number of times to repeat the string.
  5286. * @returns {string} Returns the repeated string.
  5287. */
  5288. function baseRepeat(string, n) {
  5289. var result = '';
  5290. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  5291. return result;
  5292. }
  5293. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  5294. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  5295. do {
  5296. if (n % 2) {
  5297. result += string;
  5298. }
  5299. n = nativeFloor(n / 2);
  5300. if (n) {
  5301. string += string;
  5302. }
  5303. } while (n);
  5304. return result;
  5305. }
  5306. /**
  5307. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  5308. *
  5309. * @private
  5310. * @param {Function} func The function to apply a rest parameter to.
  5311. * @param {number} [start=func.length-1] The start position of the rest parameter.
  5312. * @returns {Function} Returns the new function.
  5313. */
  5314. function baseRest(func, start) {
  5315. return setToString(overRest(func, start, identity), func + '');
  5316. }
  5317. /**
  5318. * The base implementation of `_.sample`.
  5319. *
  5320. * @private
  5321. * @param {Array|Object} collection The collection to sample.
  5322. * @returns {*} Returns the random element.
  5323. */
  5324. function baseSample(collection) {
  5325. return arraySample(values(collection));
  5326. }
  5327. /**
  5328. * The base implementation of `_.sampleSize` without param guards.
  5329. *
  5330. * @private
  5331. * @param {Array|Object} collection The collection to sample.
  5332. * @param {number} n The number of elements to sample.
  5333. * @returns {Array} Returns the random elements.
  5334. */
  5335. function baseSampleSize(collection, n) {
  5336. var array = values(collection);
  5337. return shuffleSelf(array, baseClamp(n, 0, array.length));
  5338. }
  5339. /**
  5340. * The base implementation of `_.set`.
  5341. *
  5342. * @private
  5343. * @param {Object} object The object to modify.
  5344. * @param {Array|string} path The path of the property to set.
  5345. * @param {*} value The value to set.
  5346. * @param {Function} [customizer] The function to customize path creation.
  5347. * @returns {Object} Returns `object`.
  5348. */
  5349. function baseSet(object, path, value, customizer) {
  5350. if (!isObject(object)) {
  5351. return object;
  5352. }
  5353. path = castPath(path, object);
  5354. var index = -1,
  5355. length = path.length,
  5356. lastIndex = length - 1,
  5357. nested = object;
  5358. while (nested != null && ++index < length) {
  5359. var key = toKey(path[index]),
  5360. newValue = value;
  5361. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  5362. return object;
  5363. }
  5364. if (index != lastIndex) {
  5365. var objValue = nested[key];
  5366. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  5367. if (newValue === undefined) {
  5368. newValue = isObject(objValue)
  5369. ? objValue
  5370. : (isIndex(path[index + 1]) ? [] : {});
  5371. }
  5372. }
  5373. assignValue(nested, key, newValue);
  5374. nested = nested[key];
  5375. }
  5376. return object;
  5377. }
  5378. /**
  5379. * The base implementation of `setData` without support for hot loop shorting.
  5380. *
  5381. * @private
  5382. * @param {Function} func The function to associate metadata with.
  5383. * @param {*} data The metadata.
  5384. * @returns {Function} Returns `func`.
  5385. */
  5386. var baseSetData = !metaMap ? identity : function(func, data) {
  5387. metaMap.set(func, data);
  5388. return func;
  5389. };
  5390. /**
  5391. * The base implementation of `setToString` without support for hot loop shorting.
  5392. *
  5393. * @private
  5394. * @param {Function} func The function to modify.
  5395. * @param {Function} string The `toString` result.
  5396. * @returns {Function} Returns `func`.
  5397. */
  5398. var baseSetToString = !defineProperty ? identity : function(func, string) {
  5399. return defineProperty(func, 'toString', {
  5400. 'configurable': true,
  5401. 'enumerable': false,
  5402. 'value': constant(string),
  5403. 'writable': true
  5404. });
  5405. };
  5406. /**
  5407. * The base implementation of `_.shuffle`.
  5408. *
  5409. * @private
  5410. * @param {Array|Object} collection The collection to shuffle.
  5411. * @returns {Array} Returns the new shuffled array.
  5412. */
  5413. function baseShuffle(collection) {
  5414. return shuffleSelf(values(collection));
  5415. }
  5416. /**
  5417. * The base implementation of `_.slice` without an iteratee call guard.
  5418. *
  5419. * @private
  5420. * @param {Array} array The array to slice.
  5421. * @param {number} [start=0] The start position.
  5422. * @param {number} [end=array.length] The end position.
  5423. * @returns {Array} Returns the slice of `array`.
  5424. */
  5425. function baseSlice(array, start, end) {
  5426. var index = -1,
  5427. length = array.length;
  5428. if (start < 0) {
  5429. start = -start > length ? 0 : (length + start);
  5430. }
  5431. end = end > length ? length : end;
  5432. if (end < 0) {
  5433. end += length;
  5434. }
  5435. length = start > end ? 0 : ((end - start) >>> 0);
  5436. start >>>= 0;
  5437. var result = Array(length);
  5438. while (++index < length) {
  5439. result[index] = array[index + start];
  5440. }
  5441. return result;
  5442. }
  5443. /**
  5444. * The base implementation of `_.some` without support for iteratee shorthands.
  5445. *
  5446. * @private
  5447. * @param {Array|Object} collection The collection to iterate over.
  5448. * @param {Function} predicate The function invoked per iteration.
  5449. * @returns {boolean} Returns `true` if any element passes the predicate check,
  5450. * else `false`.
  5451. */
  5452. function baseSome(collection, predicate) {
  5453. var result;
  5454. baseEach(collection, function(value, index, collection) {
  5455. result = predicate(value, index, collection);
  5456. return !result;
  5457. });
  5458. return !!result;
  5459. }
  5460. /**
  5461. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5462. * performs a binary search of `array` to determine the index at which `value`
  5463. * should be inserted into `array` in order to maintain its sort order.
  5464. *
  5465. * @private
  5466. * @param {Array} array The sorted array to inspect.
  5467. * @param {*} value The value to evaluate.
  5468. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5469. * @returns {number} Returns the index at which `value` should be inserted
  5470. * into `array`.
  5471. */
  5472. function baseSortedIndex(array, value, retHighest) {
  5473. var low = 0,
  5474. high = array == null ? low : array.length;
  5475. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5476. while (low < high) {
  5477. var mid = (low + high) >>> 1,
  5478. computed = array[mid];
  5479. if (computed !== null && !isSymbol(computed) &&
  5480. (retHighest ? (computed <= value) : (computed < value))) {
  5481. low = mid + 1;
  5482. } else {
  5483. high = mid;
  5484. }
  5485. }
  5486. return high;
  5487. }
  5488. return baseSortedIndexBy(array, value, identity, retHighest);
  5489. }
  5490. /**
  5491. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5492. * which invokes `iteratee` for `value` and each element of `array` to compute
  5493. * their sort ranking. The iteratee is invoked with one argument; (value).
  5494. *
  5495. * @private
  5496. * @param {Array} array The sorted array to inspect.
  5497. * @param {*} value The value to evaluate.
  5498. * @param {Function} iteratee The iteratee invoked per element.
  5499. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5500. * @returns {number} Returns the index at which `value` should be inserted
  5501. * into `array`.
  5502. */
  5503. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5504. var low = 0,
  5505. high = array == null ? 0 : array.length;
  5506. if (high === 0) {
  5507. return 0;
  5508. }
  5509. value = iteratee(value);
  5510. var valIsNaN = value !== value,
  5511. valIsNull = value === null,
  5512. valIsSymbol = isSymbol(value),
  5513. valIsUndefined = value === undefined;
  5514. while (low < high) {
  5515. var mid = nativeFloor((low + high) / 2),
  5516. computed = iteratee(array[mid]),
  5517. othIsDefined = computed !== undefined,
  5518. othIsNull = computed === null,
  5519. othIsReflexive = computed === computed,
  5520. othIsSymbol = isSymbol(computed);
  5521. if (valIsNaN) {
  5522. var setLow = retHighest || othIsReflexive;
  5523. } else if (valIsUndefined) {
  5524. setLow = othIsReflexive && (retHighest || othIsDefined);
  5525. } else if (valIsNull) {
  5526. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5527. } else if (valIsSymbol) {
  5528. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5529. } else if (othIsNull || othIsSymbol) {
  5530. setLow = false;
  5531. } else {
  5532. setLow = retHighest ? (computed <= value) : (computed < value);
  5533. }
  5534. if (setLow) {
  5535. low = mid + 1;
  5536. } else {
  5537. high = mid;
  5538. }
  5539. }
  5540. return nativeMin(high, MAX_ARRAY_INDEX);
  5541. }
  5542. /**
  5543. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5544. * support for iteratee shorthands.
  5545. *
  5546. * @private
  5547. * @param {Array} array The array to inspect.
  5548. * @param {Function} [iteratee] The iteratee invoked per element.
  5549. * @returns {Array} Returns the new duplicate free array.
  5550. */
  5551. function baseSortedUniq(array, iteratee) {
  5552. var index = -1,
  5553. length = array.length,
  5554. resIndex = 0,
  5555. result = [];
  5556. while (++index < length) {
  5557. var value = array[index],
  5558. computed = iteratee ? iteratee(value) : value;
  5559. if (!index || !eq(computed, seen)) {
  5560. var seen = computed;
  5561. result[resIndex++] = value === 0 ? 0 : value;
  5562. }
  5563. }
  5564. return result;
  5565. }
  5566. /**
  5567. * The base implementation of `_.toNumber` which doesn't ensure correct
  5568. * conversions of binary, hexadecimal, or octal string values.
  5569. *
  5570. * @private
  5571. * @param {*} value The value to process.
  5572. * @returns {number} Returns the number.
  5573. */
  5574. function baseToNumber(value) {
  5575. if (typeof value == 'number') {
  5576. return value;
  5577. }
  5578. if (isSymbol(value)) {
  5579. return NAN;
  5580. }
  5581. return +value;
  5582. }
  5583. /**
  5584. * The base implementation of `_.toString` which doesn't convert nullish
  5585. * values to empty strings.
  5586. *
  5587. * @private
  5588. * @param {*} value The value to process.
  5589. * @returns {string} Returns the string.
  5590. */
  5591. function baseToString(value) {
  5592. // Exit early for strings to avoid a performance hit in some environments.
  5593. if (typeof value == 'string') {
  5594. return value;
  5595. }
  5596. if (isArray(value)) {
  5597. // Recursively convert values (susceptible to call stack limits).
  5598. return arrayMap(value, baseToString) + '';
  5599. }
  5600. if (isSymbol(value)) {
  5601. return symbolToString ? symbolToString.call(value) : '';
  5602. }
  5603. var result = (value + '');
  5604. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5605. }
  5606. /**
  5607. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5608. *
  5609. * @private
  5610. * @param {Array} array The array to inspect.
  5611. * @param {Function} [iteratee] The iteratee invoked per element.
  5612. * @param {Function} [comparator] The comparator invoked per element.
  5613. * @returns {Array} Returns the new duplicate free array.
  5614. */
  5615. function baseUniq(array, iteratee, comparator) {
  5616. var index = -1,
  5617. includes = arrayIncludes,
  5618. length = array.length,
  5619. isCommon = true,
  5620. result = [],
  5621. seen = result;
  5622. if (comparator) {
  5623. isCommon = false;
  5624. includes = arrayIncludesWith;
  5625. }
  5626. else if (length >= LARGE_ARRAY_SIZE) {
  5627. var set = iteratee ? null : createSet(array);
  5628. if (set) {
  5629. return setToArray(set);
  5630. }
  5631. isCommon = false;
  5632. includes = cacheHas;
  5633. seen = new SetCache;
  5634. }
  5635. else {
  5636. seen = iteratee ? [] : result;
  5637. }
  5638. outer:
  5639. while (++index < length) {
  5640. var value = array[index],
  5641. computed = iteratee ? iteratee(value) : value;
  5642. value = (comparator || value !== 0) ? value : 0;
  5643. if (isCommon && computed === computed) {
  5644. var seenIndex = seen.length;
  5645. while (seenIndex--) {
  5646. if (seen[seenIndex] === computed) {
  5647. continue outer;
  5648. }
  5649. }
  5650. if (iteratee) {
  5651. seen.push(computed);
  5652. }
  5653. result.push(value);
  5654. }
  5655. else if (!includes(seen, computed, comparator)) {
  5656. if (seen !== result) {
  5657. seen.push(computed);
  5658. }
  5659. result.push(value);
  5660. }
  5661. }
  5662. return result;
  5663. }
  5664. /**
  5665. * The base implementation of `_.unset`.
  5666. *
  5667. * @private
  5668. * @param {Object} object The object to modify.
  5669. * @param {Array|string} path The property path to unset.
  5670. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5671. */
  5672. function baseUnset(object, path) {
  5673. path = castPath(path, object);
  5674. object = parent(object, path);
  5675. return object == null || delete object[toKey(last(path))];
  5676. }
  5677. /**
  5678. * The base implementation of `_.update`.
  5679. *
  5680. * @private
  5681. * @param {Object} object The object to modify.
  5682. * @param {Array|string} path The path of the property to update.
  5683. * @param {Function} updater The function to produce the updated value.
  5684. * @param {Function} [customizer] The function to customize path creation.
  5685. * @returns {Object} Returns `object`.
  5686. */
  5687. function baseUpdate(object, path, updater, customizer) {
  5688. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5689. }
  5690. /**
  5691. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5692. * without support for iteratee shorthands.
  5693. *
  5694. * @private
  5695. * @param {Array} array The array to query.
  5696. * @param {Function} predicate The function invoked per iteration.
  5697. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5698. * @param {boolean} [fromRight] Specify iterating from right to left.
  5699. * @returns {Array} Returns the slice of `array`.
  5700. */
  5701. function baseWhile(array, predicate, isDrop, fromRight) {
  5702. var length = array.length,
  5703. index = fromRight ? length : -1;
  5704. while ((fromRight ? index-- : ++index < length) &&
  5705. predicate(array[index], index, array)) {}
  5706. return isDrop
  5707. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5708. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5709. }
  5710. /**
  5711. * The base implementation of `wrapperValue` which returns the result of
  5712. * performing a sequence of actions on the unwrapped `value`, where each
  5713. * successive action is supplied the return value of the previous.
  5714. *
  5715. * @private
  5716. * @param {*} value The unwrapped value.
  5717. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5718. * @returns {*} Returns the resolved value.
  5719. */
  5720. function baseWrapperValue(value, actions) {
  5721. var result = value;
  5722. if (result instanceof LazyWrapper) {
  5723. result = result.value();
  5724. }
  5725. return arrayReduce(actions, function(result, action) {
  5726. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5727. }, result);
  5728. }
  5729. /**
  5730. * The base implementation of methods like `_.xor`, without support for
  5731. * iteratee shorthands, that accepts an array of arrays to inspect.
  5732. *
  5733. * @private
  5734. * @param {Array} arrays The arrays to inspect.
  5735. * @param {Function} [iteratee] The iteratee invoked per element.
  5736. * @param {Function} [comparator] The comparator invoked per element.
  5737. * @returns {Array} Returns the new array of values.
  5738. */
  5739. function baseXor(arrays, iteratee, comparator) {
  5740. var length = arrays.length;
  5741. if (length < 2) {
  5742. return length ? baseUniq(arrays[0]) : [];
  5743. }
  5744. var index = -1,
  5745. result = Array(length);
  5746. while (++index < length) {
  5747. var array = arrays[index],
  5748. othIndex = -1;
  5749. while (++othIndex < length) {
  5750. if (othIndex != index) {
  5751. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5752. }
  5753. }
  5754. }
  5755. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5756. }
  5757. /**
  5758. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5759. *
  5760. * @private
  5761. * @param {Array} props The property identifiers.
  5762. * @param {Array} values The property values.
  5763. * @param {Function} assignFunc The function to assign values.
  5764. * @returns {Object} Returns the new object.
  5765. */
  5766. function baseZipObject(props, values, assignFunc) {
  5767. var index = -1,
  5768. length = props.length,
  5769. valsLength = values.length,
  5770. result = {};
  5771. while (++index < length) {
  5772. var value = index < valsLength ? values[index] : undefined;
  5773. assignFunc(result, props[index], value);
  5774. }
  5775. return result;
  5776. }
  5777. /**
  5778. * Casts `value` to an empty array if it's not an array like object.
  5779. *
  5780. * @private
  5781. * @param {*} value The value to inspect.
  5782. * @returns {Array|Object} Returns the cast array-like object.
  5783. */
  5784. function castArrayLikeObject(value) {
  5785. return isArrayLikeObject(value) ? value : [];
  5786. }
  5787. /**
  5788. * Casts `value` to `identity` if it's not a function.
  5789. *
  5790. * @private
  5791. * @param {*} value The value to inspect.
  5792. * @returns {Function} Returns cast function.
  5793. */
  5794. function castFunction(value) {
  5795. return typeof value == 'function' ? value : identity;
  5796. }
  5797. /**
  5798. * Casts `value` to a path array if it's not one.
  5799. *
  5800. * @private
  5801. * @param {*} value The value to inspect.
  5802. * @param {Object} [object] The object to query keys on.
  5803. * @returns {Array} Returns the cast property path array.
  5804. */
  5805. function castPath(value, object) {
  5806. if (isArray(value)) {
  5807. return value;
  5808. }
  5809. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5810. }
  5811. /**
  5812. * A `baseRest` alias which can be replaced with `identity` by module
  5813. * replacement plugins.
  5814. *
  5815. * @private
  5816. * @type {Function}
  5817. * @param {Function} func The function to apply a rest parameter to.
  5818. * @returns {Function} Returns the new function.
  5819. */
  5820. var castRest = baseRest;
  5821. /**
  5822. * Casts `array` to a slice if it's needed.
  5823. *
  5824. * @private
  5825. * @param {Array} array The array to inspect.
  5826. * @param {number} start The start position.
  5827. * @param {number} [end=array.length] The end position.
  5828. * @returns {Array} Returns the cast slice.
  5829. */
  5830. function castSlice(array, start, end) {
  5831. var length = array.length;
  5832. end = end === undefined ? length : end;
  5833. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5834. }
  5835. /**
  5836. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5837. *
  5838. * @private
  5839. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5840. */
  5841. var clearTimeout = ctxClearTimeout || function(id) {
  5842. return root.clearTimeout(id);
  5843. };
  5844. /**
  5845. * Creates a clone of `buffer`.
  5846. *
  5847. * @private
  5848. * @param {Buffer} buffer The buffer to clone.
  5849. * @param {boolean} [isDeep] Specify a deep clone.
  5850. * @returns {Buffer} Returns the cloned buffer.
  5851. */
  5852. function cloneBuffer(buffer, isDeep) {
  5853. if (isDeep) {
  5854. return buffer.slice();
  5855. }
  5856. var length = buffer.length,
  5857. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5858. buffer.copy(result);
  5859. return result;
  5860. }
  5861. /**
  5862. * Creates a clone of `arrayBuffer`.
  5863. *
  5864. * @private
  5865. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5866. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5867. */
  5868. function cloneArrayBuffer(arrayBuffer) {
  5869. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5870. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5871. return result;
  5872. }
  5873. /**
  5874. * Creates a clone of `dataView`.
  5875. *
  5876. * @private
  5877. * @param {Object} dataView The data view to clone.
  5878. * @param {boolean} [isDeep] Specify a deep clone.
  5879. * @returns {Object} Returns the cloned data view.
  5880. */
  5881. function cloneDataView(dataView, isDeep) {
  5882. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5883. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5884. }
  5885. /**
  5886. * Creates a clone of `regexp`.
  5887. *
  5888. * @private
  5889. * @param {Object} regexp The regexp to clone.
  5890. * @returns {Object} Returns the cloned regexp.
  5891. */
  5892. function cloneRegExp(regexp) {
  5893. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5894. result.lastIndex = regexp.lastIndex;
  5895. return result;
  5896. }
  5897. /**
  5898. * Creates a clone of the `symbol` object.
  5899. *
  5900. * @private
  5901. * @param {Object} symbol The symbol object to clone.
  5902. * @returns {Object} Returns the cloned symbol object.
  5903. */
  5904. function cloneSymbol(symbol) {
  5905. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5906. }
  5907. /**
  5908. * Creates a clone of `typedArray`.
  5909. *
  5910. * @private
  5911. * @param {Object} typedArray The typed array to clone.
  5912. * @param {boolean} [isDeep] Specify a deep clone.
  5913. * @returns {Object} Returns the cloned typed array.
  5914. */
  5915. function cloneTypedArray(typedArray, isDeep) {
  5916. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5917. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5918. }
  5919. /**
  5920. * Compares values to sort them in ascending order.
  5921. *
  5922. * @private
  5923. * @param {*} value The value to compare.
  5924. * @param {*} other The other value to compare.
  5925. * @returns {number} Returns the sort order indicator for `value`.
  5926. */
  5927. function compareAscending(value, other) {
  5928. if (value !== other) {
  5929. var valIsDefined = value !== undefined,
  5930. valIsNull = value === null,
  5931. valIsReflexive = value === value,
  5932. valIsSymbol = isSymbol(value);
  5933. var othIsDefined = other !== undefined,
  5934. othIsNull = other === null,
  5935. othIsReflexive = other === other,
  5936. othIsSymbol = isSymbol(other);
  5937. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5938. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5939. (valIsNull && othIsDefined && othIsReflexive) ||
  5940. (!valIsDefined && othIsReflexive) ||
  5941. !valIsReflexive) {
  5942. return 1;
  5943. }
  5944. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5945. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5946. (othIsNull && valIsDefined && valIsReflexive) ||
  5947. (!othIsDefined && valIsReflexive) ||
  5948. !othIsReflexive) {
  5949. return -1;
  5950. }
  5951. }
  5952. return 0;
  5953. }
  5954. /**
  5955. * Used by `_.orderBy` to compare multiple properties of a value to another
  5956. * and stable sort them.
  5957. *
  5958. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5959. * specify an order of "desc" for descending or "asc" for ascending sort order
  5960. * of corresponding values.
  5961. *
  5962. * @private
  5963. * @param {Object} object The object to compare.
  5964. * @param {Object} other The other object to compare.
  5965. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5966. * @returns {number} Returns the sort order indicator for `object`.
  5967. */
  5968. function compareMultiple(object, other, orders) {
  5969. var index = -1,
  5970. objCriteria = object.criteria,
  5971. othCriteria = other.criteria,
  5972. length = objCriteria.length,
  5973. ordersLength = orders.length;
  5974. while (++index < length) {
  5975. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5976. if (result) {
  5977. if (index >= ordersLength) {
  5978. return result;
  5979. }
  5980. var order = orders[index];
  5981. return result * (order == 'desc' ? -1 : 1);
  5982. }
  5983. }
  5984. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5985. // that causes it, under certain circumstances, to provide the same value for
  5986. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5987. // for more details.
  5988. //
  5989. // This also ensures a stable sort in V8 and other engines.
  5990. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5991. return object.index - other.index;
  5992. }
  5993. /**
  5994. * Creates an array that is the composition of partially applied arguments,
  5995. * placeholders, and provided arguments into a single array of arguments.
  5996. *
  5997. * @private
  5998. * @param {Array} args The provided arguments.
  5999. * @param {Array} partials The arguments to prepend to those provided.
  6000. * @param {Array} holders The `partials` placeholder indexes.
  6001. * @params {boolean} [isCurried] Specify composing for a curried function.
  6002. * @returns {Array} Returns the new array of composed arguments.
  6003. */
  6004. function composeArgs(args, partials, holders, isCurried) {
  6005. var argsIndex = -1,
  6006. argsLength = args.length,
  6007. holdersLength = holders.length,
  6008. leftIndex = -1,
  6009. leftLength = partials.length,
  6010. rangeLength = nativeMax(argsLength - holdersLength, 0),
  6011. result = Array(leftLength + rangeLength),
  6012. isUncurried = !isCurried;
  6013. while (++leftIndex < leftLength) {
  6014. result[leftIndex] = partials[leftIndex];
  6015. }
  6016. while (++argsIndex < holdersLength) {
  6017. if (isUncurried || argsIndex < argsLength) {
  6018. result[holders[argsIndex]] = args[argsIndex];
  6019. }
  6020. }
  6021. while (rangeLength--) {
  6022. result[leftIndex++] = args[argsIndex++];
  6023. }
  6024. return result;
  6025. }
  6026. /**
  6027. * This function is like `composeArgs` except that the arguments composition
  6028. * is tailored for `_.partialRight`.
  6029. *
  6030. * @private
  6031. * @param {Array} args The provided arguments.
  6032. * @param {Array} partials The arguments to append to those provided.
  6033. * @param {Array} holders The `partials` placeholder indexes.
  6034. * @params {boolean} [isCurried] Specify composing for a curried function.
  6035. * @returns {Array} Returns the new array of composed arguments.
  6036. */
  6037. function composeArgsRight(args, partials, holders, isCurried) {
  6038. var argsIndex = -1,
  6039. argsLength = args.length,
  6040. holdersIndex = -1,
  6041. holdersLength = holders.length,
  6042. rightIndex = -1,
  6043. rightLength = partials.length,
  6044. rangeLength = nativeMax(argsLength - holdersLength, 0),
  6045. result = Array(rangeLength + rightLength),
  6046. isUncurried = !isCurried;
  6047. while (++argsIndex < rangeLength) {
  6048. result[argsIndex] = args[argsIndex];
  6049. }
  6050. var offset = argsIndex;
  6051. while (++rightIndex < rightLength) {
  6052. result[offset + rightIndex] = partials[rightIndex];
  6053. }
  6054. while (++holdersIndex < holdersLength) {
  6055. if (isUncurried || argsIndex < argsLength) {
  6056. result[offset + holders[holdersIndex]] = args[argsIndex++];
  6057. }
  6058. }
  6059. return result;
  6060. }
  6061. /**
  6062. * Copies the values of `source` to `array`.
  6063. *
  6064. * @private
  6065. * @param {Array} source The array to copy values from.
  6066. * @param {Array} [array=[]] The array to copy values to.
  6067. * @returns {Array} Returns `array`.
  6068. */
  6069. function copyArray(source, array) {
  6070. var index = -1,
  6071. length = source.length;
  6072. array || (array = Array(length));
  6073. while (++index < length) {
  6074. array[index] = source[index];
  6075. }
  6076. return array;
  6077. }
  6078. /**
  6079. * Copies properties of `source` to `object`.
  6080. *
  6081. * @private
  6082. * @param {Object} source The object to copy properties from.
  6083. * @param {Array} props The property identifiers to copy.
  6084. * @param {Object} [object={}] The object to copy properties to.
  6085. * @param {Function} [customizer] The function to customize copied values.
  6086. * @returns {Object} Returns `object`.
  6087. */
  6088. function copyObject(source, props, object, customizer) {
  6089. var isNew = !object;
  6090. object || (object = {});
  6091. var index = -1,
  6092. length = props.length;
  6093. while (++index < length) {
  6094. var key = props[index];
  6095. var newValue = customizer
  6096. ? customizer(object[key], source[key], key, object, source)
  6097. : undefined;
  6098. if (newValue === undefined) {
  6099. newValue = source[key];
  6100. }
  6101. if (isNew) {
  6102. baseAssignValue(object, key, newValue);
  6103. } else {
  6104. assignValue(object, key, newValue);
  6105. }
  6106. }
  6107. return object;
  6108. }
  6109. /**
  6110. * Copies own symbols of `source` to `object`.
  6111. *
  6112. * @private
  6113. * @param {Object} source The object to copy symbols from.
  6114. * @param {Object} [object={}] The object to copy symbols to.
  6115. * @returns {Object} Returns `object`.
  6116. */
  6117. function copySymbols(source, object) {
  6118. return copyObject(source, getSymbols(source), object);
  6119. }
  6120. /**
  6121. * Copies own and inherited symbols of `source` to `object`.
  6122. *
  6123. * @private
  6124. * @param {Object} source The object to copy symbols from.
  6125. * @param {Object} [object={}] The object to copy symbols to.
  6126. * @returns {Object} Returns `object`.
  6127. */
  6128. function copySymbolsIn(source, object) {
  6129. return copyObject(source, getSymbolsIn(source), object);
  6130. }
  6131. /**
  6132. * Creates a function like `_.groupBy`.
  6133. *
  6134. * @private
  6135. * @param {Function} setter The function to set accumulator values.
  6136. * @param {Function} [initializer] The accumulator object initializer.
  6137. * @returns {Function} Returns the new aggregator function.
  6138. */
  6139. function createAggregator(setter, initializer) {
  6140. return function(collection, iteratee) {
  6141. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  6142. accumulator = initializer ? initializer() : {};
  6143. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  6144. };
  6145. }
  6146. /**
  6147. * Creates a function like `_.assign`.
  6148. *
  6149. * @private
  6150. * @param {Function} assigner The function to assign values.
  6151. * @returns {Function} Returns the new assigner function.
  6152. */
  6153. function createAssigner(assigner) {
  6154. return baseRest(function(object, sources) {
  6155. var index = -1,
  6156. length = sources.length,
  6157. customizer = length > 1 ? sources[length - 1] : undefined,
  6158. guard = length > 2 ? sources[2] : undefined;
  6159. customizer = (assigner.length > 3 && typeof customizer == 'function')
  6160. ? (length--, customizer)
  6161. : undefined;
  6162. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  6163. customizer = length < 3 ? undefined : customizer;
  6164. length = 1;
  6165. }
  6166. object = Object(object);
  6167. while (++index < length) {
  6168. var source = sources[index];
  6169. if (source) {
  6170. assigner(object, source, index, customizer);
  6171. }
  6172. }
  6173. return object;
  6174. });
  6175. }
  6176. /**
  6177. * Creates a `baseEach` or `baseEachRight` function.
  6178. *
  6179. * @private
  6180. * @param {Function} eachFunc The function to iterate over a collection.
  6181. * @param {boolean} [fromRight] Specify iterating from right to left.
  6182. * @returns {Function} Returns the new base function.
  6183. */
  6184. function createBaseEach(eachFunc, fromRight) {
  6185. return function(collection, iteratee) {
  6186. if (collection == null) {
  6187. return collection;
  6188. }
  6189. if (!isArrayLike(collection)) {
  6190. return eachFunc(collection, iteratee);
  6191. }
  6192. var length = collection.length,
  6193. index = fromRight ? length : -1,
  6194. iterable = Object(collection);
  6195. while ((fromRight ? index-- : ++index < length)) {
  6196. if (iteratee(iterable[index], index, iterable) === false) {
  6197. break;
  6198. }
  6199. }
  6200. return collection;
  6201. };
  6202. }
  6203. /**
  6204. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  6205. *
  6206. * @private
  6207. * @param {boolean} [fromRight] Specify iterating from right to left.
  6208. * @returns {Function} Returns the new base function.
  6209. */
  6210. function createBaseFor(fromRight) {
  6211. return function(object, iteratee, keysFunc) {
  6212. var index = -1,
  6213. iterable = Object(object),
  6214. props = keysFunc(object),
  6215. length = props.length;
  6216. while (length--) {
  6217. var key = props[fromRight ? length : ++index];
  6218. if (iteratee(iterable[key], key, iterable) === false) {
  6219. break;
  6220. }
  6221. }
  6222. return object;
  6223. };
  6224. }
  6225. /**
  6226. * Creates a function that wraps `func` to invoke it with the optional `this`
  6227. * binding of `thisArg`.
  6228. *
  6229. * @private
  6230. * @param {Function} func The function to wrap.
  6231. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6232. * @param {*} [thisArg] The `this` binding of `func`.
  6233. * @returns {Function} Returns the new wrapped function.
  6234. */
  6235. function createBind(func, bitmask, thisArg) {
  6236. var isBind = bitmask & WRAP_BIND_FLAG,
  6237. Ctor = createCtor(func);
  6238. function wrapper() {
  6239. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6240. return fn.apply(isBind ? thisArg : this, arguments);
  6241. }
  6242. return wrapper;
  6243. }
  6244. /**
  6245. * Creates a function like `_.lowerFirst`.
  6246. *
  6247. * @private
  6248. * @param {string} methodName The name of the `String` case method to use.
  6249. * @returns {Function} Returns the new case function.
  6250. */
  6251. function createCaseFirst(methodName) {
  6252. return function(string) {
  6253. string = toString(string);
  6254. var strSymbols = hasUnicode(string)
  6255. ? stringToArray(string)
  6256. : undefined;
  6257. var chr = strSymbols
  6258. ? strSymbols[0]
  6259. : string.charAt(0);
  6260. var trailing = strSymbols
  6261. ? castSlice(strSymbols, 1).join('')
  6262. : string.slice(1);
  6263. return chr[methodName]() + trailing;
  6264. };
  6265. }
  6266. /**
  6267. * Creates a function like `_.camelCase`.
  6268. *
  6269. * @private
  6270. * @param {Function} callback The function to combine each word.
  6271. * @returns {Function} Returns the new compounder function.
  6272. */
  6273. function createCompounder(callback) {
  6274. return function(string) {
  6275. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  6276. };
  6277. }
  6278. /**
  6279. * Creates a function that produces an instance of `Ctor` regardless of
  6280. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  6281. *
  6282. * @private
  6283. * @param {Function} Ctor The constructor to wrap.
  6284. * @returns {Function} Returns the new wrapped function.
  6285. */
  6286. function createCtor(Ctor) {
  6287. return function() {
  6288. // Use a `switch` statement to work with class constructors. See
  6289. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  6290. // for more details.
  6291. var args = arguments;
  6292. switch (args.length) {
  6293. case 0: return new Ctor;
  6294. case 1: return new Ctor(args[0]);
  6295. case 2: return new Ctor(args[0], args[1]);
  6296. case 3: return new Ctor(args[0], args[1], args[2]);
  6297. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  6298. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  6299. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  6300. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  6301. }
  6302. var thisBinding = baseCreate(Ctor.prototype),
  6303. result = Ctor.apply(thisBinding, args);
  6304. // Mimic the constructor's `return` behavior.
  6305. // See https://es5.github.io/#x13.2.2 for more details.
  6306. return isObject(result) ? result : thisBinding;
  6307. };
  6308. }
  6309. /**
  6310. * Creates a function that wraps `func` to enable currying.
  6311. *
  6312. * @private
  6313. * @param {Function} func The function to wrap.
  6314. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6315. * @param {number} arity The arity of `func`.
  6316. * @returns {Function} Returns the new wrapped function.
  6317. */
  6318. function createCurry(func, bitmask, arity) {
  6319. var Ctor = createCtor(func);
  6320. function wrapper() {
  6321. var length = arguments.length,
  6322. args = Array(length),
  6323. index = length,
  6324. placeholder = getHolder(wrapper);
  6325. while (index--) {
  6326. args[index] = arguments[index];
  6327. }
  6328. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  6329. ? []
  6330. : replaceHolders(args, placeholder);
  6331. length -= holders.length;
  6332. if (length < arity) {
  6333. return createRecurry(
  6334. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  6335. args, holders, undefined, undefined, arity - length);
  6336. }
  6337. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6338. return apply(fn, this, args);
  6339. }
  6340. return wrapper;
  6341. }
  6342. /**
  6343. * Creates a `_.find` or `_.findLast` function.
  6344. *
  6345. * @private
  6346. * @param {Function} findIndexFunc The function to find the collection index.
  6347. * @returns {Function} Returns the new find function.
  6348. */
  6349. function createFind(findIndexFunc) {
  6350. return function(collection, predicate, fromIndex) {
  6351. var iterable = Object(collection);
  6352. if (!isArrayLike(collection)) {
  6353. var iteratee = getIteratee(predicate, 3);
  6354. collection = keys(collection);
  6355. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  6356. }
  6357. var index = findIndexFunc(collection, predicate, fromIndex);
  6358. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  6359. };
  6360. }
  6361. /**
  6362. * Creates a `_.flow` or `_.flowRight` function.
  6363. *
  6364. * @private
  6365. * @param {boolean} [fromRight] Specify iterating from right to left.
  6366. * @returns {Function} Returns the new flow function.
  6367. */
  6368. function createFlow(fromRight) {
  6369. return flatRest(function(funcs) {
  6370. var length = funcs.length,
  6371. index = length,
  6372. prereq = LodashWrapper.prototype.thru;
  6373. if (fromRight) {
  6374. funcs.reverse();
  6375. }
  6376. while (index--) {
  6377. var func = funcs[index];
  6378. if (typeof func != 'function') {
  6379. throw new TypeError(FUNC_ERROR_TEXT);
  6380. }
  6381. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  6382. var wrapper = new LodashWrapper([], true);
  6383. }
  6384. }
  6385. index = wrapper ? index : length;
  6386. while (++index < length) {
  6387. func = funcs[index];
  6388. var funcName = getFuncName(func),
  6389. data = funcName == 'wrapper' ? getData(func) : undefined;
  6390. if (data && isLaziable(data[0]) &&
  6391. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  6392. !data[4].length && data[9] == 1
  6393. ) {
  6394. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  6395. } else {
  6396. wrapper = (func.length == 1 && isLaziable(func))
  6397. ? wrapper[funcName]()
  6398. : wrapper.thru(func);
  6399. }
  6400. }
  6401. return function() {
  6402. var args = arguments,
  6403. value = args[0];
  6404. if (wrapper && args.length == 1 && isArray(value)) {
  6405. return wrapper.plant(value).value();
  6406. }
  6407. var index = 0,
  6408. result = length ? funcs[index].apply(this, args) : value;
  6409. while (++index < length) {
  6410. result = funcs[index].call(this, result);
  6411. }
  6412. return result;
  6413. };
  6414. });
  6415. }
  6416. /**
  6417. * Creates a function that wraps `func` to invoke it with optional `this`
  6418. * binding of `thisArg`, partial application, and currying.
  6419. *
  6420. * @private
  6421. * @param {Function|string} func The function or method name to wrap.
  6422. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6423. * @param {*} [thisArg] The `this` binding of `func`.
  6424. * @param {Array} [partials] The arguments to prepend to those provided to
  6425. * the new function.
  6426. * @param {Array} [holders] The `partials` placeholder indexes.
  6427. * @param {Array} [partialsRight] The arguments to append to those provided
  6428. * to the new function.
  6429. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  6430. * @param {Array} [argPos] The argument positions of the new function.
  6431. * @param {number} [ary] The arity cap of `func`.
  6432. * @param {number} [arity] The arity of `func`.
  6433. * @returns {Function} Returns the new wrapped function.
  6434. */
  6435. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  6436. var isAry = bitmask & WRAP_ARY_FLAG,
  6437. isBind = bitmask & WRAP_BIND_FLAG,
  6438. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  6439. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  6440. isFlip = bitmask & WRAP_FLIP_FLAG,
  6441. Ctor = isBindKey ? undefined : createCtor(func);
  6442. function wrapper() {
  6443. var length = arguments.length,
  6444. args = Array(length),
  6445. index = length;
  6446. while (index--) {
  6447. args[index] = arguments[index];
  6448. }
  6449. if (isCurried) {
  6450. var placeholder = getHolder(wrapper),
  6451. holdersCount = countHolders(args, placeholder);
  6452. }
  6453. if (partials) {
  6454. args = composeArgs(args, partials, holders, isCurried);
  6455. }
  6456. if (partialsRight) {
  6457. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  6458. }
  6459. length -= holdersCount;
  6460. if (isCurried && length < arity) {
  6461. var newHolders = replaceHolders(args, placeholder);
  6462. return createRecurry(
  6463. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6464. args, newHolders, argPos, ary, arity - length
  6465. );
  6466. }
  6467. var thisBinding = isBind ? thisArg : this,
  6468. fn = isBindKey ? thisBinding[func] : func;
  6469. length = args.length;
  6470. if (argPos) {
  6471. args = reorder(args, argPos);
  6472. } else if (isFlip && length > 1) {
  6473. args.reverse();
  6474. }
  6475. if (isAry && ary < length) {
  6476. args.length = ary;
  6477. }
  6478. if (this && this !== root && this instanceof wrapper) {
  6479. fn = Ctor || createCtor(fn);
  6480. }
  6481. return fn.apply(thisBinding, args);
  6482. }
  6483. return wrapper;
  6484. }
  6485. /**
  6486. * Creates a function like `_.invertBy`.
  6487. *
  6488. * @private
  6489. * @param {Function} setter The function to set accumulator values.
  6490. * @param {Function} toIteratee The function to resolve iteratees.
  6491. * @returns {Function} Returns the new inverter function.
  6492. */
  6493. function createInverter(setter, toIteratee) {
  6494. return function(object, iteratee) {
  6495. return baseInverter(object, setter, toIteratee(iteratee), {});
  6496. };
  6497. }
  6498. /**
  6499. * Creates a function that performs a mathematical operation on two values.
  6500. *
  6501. * @private
  6502. * @param {Function} operator The function to perform the operation.
  6503. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6504. * @returns {Function} Returns the new mathematical operation function.
  6505. */
  6506. function createMathOperation(operator, defaultValue) {
  6507. return function(value, other) {
  6508. var result;
  6509. if (value === undefined && other === undefined) {
  6510. return defaultValue;
  6511. }
  6512. if (value !== undefined) {
  6513. result = value;
  6514. }
  6515. if (other !== undefined) {
  6516. if (result === undefined) {
  6517. return other;
  6518. }
  6519. if (typeof value == 'string' || typeof other == 'string') {
  6520. value = baseToString(value);
  6521. other = baseToString(other);
  6522. } else {
  6523. value = baseToNumber(value);
  6524. other = baseToNumber(other);
  6525. }
  6526. result = operator(value, other);
  6527. }
  6528. return result;
  6529. };
  6530. }
  6531. /**
  6532. * Creates a function like `_.over`.
  6533. *
  6534. * @private
  6535. * @param {Function} arrayFunc The function to iterate over iteratees.
  6536. * @returns {Function} Returns the new over function.
  6537. */
  6538. function createOver(arrayFunc) {
  6539. return flatRest(function(iteratees) {
  6540. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6541. return baseRest(function(args) {
  6542. var thisArg = this;
  6543. return arrayFunc(iteratees, function(iteratee) {
  6544. return apply(iteratee, thisArg, args);
  6545. });
  6546. });
  6547. });
  6548. }
  6549. /**
  6550. * Creates the padding for `string` based on `length`. The `chars` string
  6551. * is truncated if the number of characters exceeds `length`.
  6552. *
  6553. * @private
  6554. * @param {number} length The padding length.
  6555. * @param {string} [chars=' '] The string used as padding.
  6556. * @returns {string} Returns the padding for `string`.
  6557. */
  6558. function createPadding(length, chars) {
  6559. chars = chars === undefined ? ' ' : baseToString(chars);
  6560. var charsLength = chars.length;
  6561. if (charsLength < 2) {
  6562. return charsLength ? baseRepeat(chars, length) : chars;
  6563. }
  6564. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6565. return hasUnicode(chars)
  6566. ? castSlice(stringToArray(result), 0, length).join('')
  6567. : result.slice(0, length);
  6568. }
  6569. /**
  6570. * Creates a function that wraps `func` to invoke it with the `this` binding
  6571. * of `thisArg` and `partials` prepended to the arguments it receives.
  6572. *
  6573. * @private
  6574. * @param {Function} func The function to wrap.
  6575. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6576. * @param {*} thisArg The `this` binding of `func`.
  6577. * @param {Array} partials The arguments to prepend to those provided to
  6578. * the new function.
  6579. * @returns {Function} Returns the new wrapped function.
  6580. */
  6581. function createPartial(func, bitmask, thisArg, partials) {
  6582. var isBind = bitmask & WRAP_BIND_FLAG,
  6583. Ctor = createCtor(func);
  6584. function wrapper() {
  6585. var argsIndex = -1,
  6586. argsLength = arguments.length,
  6587. leftIndex = -1,
  6588. leftLength = partials.length,
  6589. args = Array(leftLength + argsLength),
  6590. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6591. while (++leftIndex < leftLength) {
  6592. args[leftIndex] = partials[leftIndex];
  6593. }
  6594. while (argsLength--) {
  6595. args[leftIndex++] = arguments[++argsIndex];
  6596. }
  6597. return apply(fn, isBind ? thisArg : this, args);
  6598. }
  6599. return wrapper;
  6600. }
  6601. /**
  6602. * Creates a `_.range` or `_.rangeRight` function.
  6603. *
  6604. * @private
  6605. * @param {boolean} [fromRight] Specify iterating from right to left.
  6606. * @returns {Function} Returns the new range function.
  6607. */
  6608. function createRange(fromRight) {
  6609. return function(start, end, step) {
  6610. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6611. end = step = undefined;
  6612. }
  6613. // Ensure the sign of `-0` is preserved.
  6614. start = toFinite(start);
  6615. if (end === undefined) {
  6616. end = start;
  6617. start = 0;
  6618. } else {
  6619. end = toFinite(end);
  6620. }
  6621. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6622. return baseRange(start, end, step, fromRight);
  6623. };
  6624. }
  6625. /**
  6626. * Creates a function that performs a relational operation on two values.
  6627. *
  6628. * @private
  6629. * @param {Function} operator The function to perform the operation.
  6630. * @returns {Function} Returns the new relational operation function.
  6631. */
  6632. function createRelationalOperation(operator) {
  6633. return function(value, other) {
  6634. if (!(typeof value == 'string' && typeof other == 'string')) {
  6635. value = toNumber(value);
  6636. other = toNumber(other);
  6637. }
  6638. return operator(value, other);
  6639. };
  6640. }
  6641. /**
  6642. * Creates a function that wraps `func` to continue currying.
  6643. *
  6644. * @private
  6645. * @param {Function} func The function to wrap.
  6646. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6647. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6648. * @param {*} placeholder The placeholder value.
  6649. * @param {*} [thisArg] The `this` binding of `func`.
  6650. * @param {Array} [partials] The arguments to prepend to those provided to
  6651. * the new function.
  6652. * @param {Array} [holders] The `partials` placeholder indexes.
  6653. * @param {Array} [argPos] The argument positions of the new function.
  6654. * @param {number} [ary] The arity cap of `func`.
  6655. * @param {number} [arity] The arity of `func`.
  6656. * @returns {Function} Returns the new wrapped function.
  6657. */
  6658. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6659. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6660. newHolders = isCurry ? holders : undefined,
  6661. newHoldersRight = isCurry ? undefined : holders,
  6662. newPartials = isCurry ? partials : undefined,
  6663. newPartialsRight = isCurry ? undefined : partials;
  6664. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6665. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6666. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6667. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6668. }
  6669. var newData = [
  6670. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6671. newHoldersRight, argPos, ary, arity
  6672. ];
  6673. var result = wrapFunc.apply(undefined, newData);
  6674. if (isLaziable(func)) {
  6675. setData(result, newData);
  6676. }
  6677. result.placeholder = placeholder;
  6678. return setWrapToString(result, func, bitmask);
  6679. }
  6680. /**
  6681. * Creates a function like `_.round`.
  6682. *
  6683. * @private
  6684. * @param {string} methodName The name of the `Math` method to use when rounding.
  6685. * @returns {Function} Returns the new round function.
  6686. */
  6687. function createRound(methodName) {
  6688. var func = Math[methodName];
  6689. return function(number, precision) {
  6690. number = toNumber(number);
  6691. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6692. if (precision && nativeIsFinite(number)) {
  6693. // Shift with exponential notation to avoid floating-point issues.
  6694. // See [MDN](https://mdn.io/round#Examples) for more details.
  6695. var pair = (toString(number) + 'e').split('e'),
  6696. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6697. pair = (toString(value) + 'e').split('e');
  6698. return +(pair[0] + 'e' + (+pair[1] - precision));
  6699. }
  6700. return func(number);
  6701. };
  6702. }
  6703. /**
  6704. * Creates a set object of `values`.
  6705. *
  6706. * @private
  6707. * @param {Array} values The values to add to the set.
  6708. * @returns {Object} Returns the new set.
  6709. */
  6710. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6711. return new Set(values);
  6712. };
  6713. /**
  6714. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6715. *
  6716. * @private
  6717. * @param {Function} keysFunc The function to get the keys of a given object.
  6718. * @returns {Function} Returns the new pairs function.
  6719. */
  6720. function createToPairs(keysFunc) {
  6721. return function(object) {
  6722. var tag = getTag(object);
  6723. if (tag == mapTag) {
  6724. return mapToArray(object);
  6725. }
  6726. if (tag == setTag) {
  6727. return setToPairs(object);
  6728. }
  6729. return baseToPairs(object, keysFunc(object));
  6730. };
  6731. }
  6732. /**
  6733. * Creates a function that either curries or invokes `func` with optional
  6734. * `this` binding and partially applied arguments.
  6735. *
  6736. * @private
  6737. * @param {Function|string} func The function or method name to wrap.
  6738. * @param {number} bitmask The bitmask flags.
  6739. * 1 - `_.bind`
  6740. * 2 - `_.bindKey`
  6741. * 4 - `_.curry` or `_.curryRight` of a bound function
  6742. * 8 - `_.curry`
  6743. * 16 - `_.curryRight`
  6744. * 32 - `_.partial`
  6745. * 64 - `_.partialRight`
  6746. * 128 - `_.rearg`
  6747. * 256 - `_.ary`
  6748. * 512 - `_.flip`
  6749. * @param {*} [thisArg] The `this` binding of `func`.
  6750. * @param {Array} [partials] The arguments to be partially applied.
  6751. * @param {Array} [holders] The `partials` placeholder indexes.
  6752. * @param {Array} [argPos] The argument positions of the new function.
  6753. * @param {number} [ary] The arity cap of `func`.
  6754. * @param {number} [arity] The arity of `func`.
  6755. * @returns {Function} Returns the new wrapped function.
  6756. */
  6757. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6758. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6759. if (!isBindKey && typeof func != 'function') {
  6760. throw new TypeError(FUNC_ERROR_TEXT);
  6761. }
  6762. var length = partials ? partials.length : 0;
  6763. if (!length) {
  6764. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6765. partials = holders = undefined;
  6766. }
  6767. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6768. arity = arity === undefined ? arity : toInteger(arity);
  6769. length -= holders ? holders.length : 0;
  6770. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6771. var partialsRight = partials,
  6772. holdersRight = holders;
  6773. partials = holders = undefined;
  6774. }
  6775. var data = isBindKey ? undefined : getData(func);
  6776. var newData = [
  6777. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6778. argPos, ary, arity
  6779. ];
  6780. if (data) {
  6781. mergeData(newData, data);
  6782. }
  6783. func = newData[0];
  6784. bitmask = newData[1];
  6785. thisArg = newData[2];
  6786. partials = newData[3];
  6787. holders = newData[4];
  6788. arity = newData[9] = newData[9] === undefined
  6789. ? (isBindKey ? 0 : func.length)
  6790. : nativeMax(newData[9] - length, 0);
  6791. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6792. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6793. }
  6794. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6795. var result = createBind(func, bitmask, thisArg);
  6796. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6797. result = createCurry(func, bitmask, arity);
  6798. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6799. result = createPartial(func, bitmask, thisArg, partials);
  6800. } else {
  6801. result = createHybrid.apply(undefined, newData);
  6802. }
  6803. var setter = data ? baseSetData : setData;
  6804. return setWrapToString(setter(result, newData), func, bitmask);
  6805. }
  6806. /**
  6807. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6808. * of source objects to the destination object for all destination properties
  6809. * that resolve to `undefined`.
  6810. *
  6811. * @private
  6812. * @param {*} objValue The destination value.
  6813. * @param {*} srcValue The source value.
  6814. * @param {string} key The key of the property to assign.
  6815. * @param {Object} object The parent object of `objValue`.
  6816. * @returns {*} Returns the value to assign.
  6817. */
  6818. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6819. if (objValue === undefined ||
  6820. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6821. return srcValue;
  6822. }
  6823. return objValue;
  6824. }
  6825. /**
  6826. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6827. * objects into destination objects that are passed thru.
  6828. *
  6829. * @private
  6830. * @param {*} objValue The destination value.
  6831. * @param {*} srcValue The source value.
  6832. * @param {string} key The key of the property to merge.
  6833. * @param {Object} object The parent object of `objValue`.
  6834. * @param {Object} source The parent object of `srcValue`.
  6835. * @param {Object} [stack] Tracks traversed source values and their merged
  6836. * counterparts.
  6837. * @returns {*} Returns the value to assign.
  6838. */
  6839. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6840. if (isObject(objValue) && isObject(srcValue)) {
  6841. // Recursively merge objects and arrays (susceptible to call stack limits).
  6842. stack.set(srcValue, objValue);
  6843. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6844. stack['delete'](srcValue);
  6845. }
  6846. return objValue;
  6847. }
  6848. /**
  6849. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6850. * objects.
  6851. *
  6852. * @private
  6853. * @param {*} value The value to inspect.
  6854. * @param {string} key The key of the property to inspect.
  6855. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6856. */
  6857. function customOmitClone(value) {
  6858. return isPlainObject(value) ? undefined : value;
  6859. }
  6860. /**
  6861. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6862. * partial deep comparisons.
  6863. *
  6864. * @private
  6865. * @param {Array} array The array to compare.
  6866. * @param {Array} other The other array to compare.
  6867. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6868. * @param {Function} customizer The function to customize comparisons.
  6869. * @param {Function} equalFunc The function to determine equivalents of values.
  6870. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6871. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6872. */
  6873. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6874. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6875. arrLength = array.length,
  6876. othLength = other.length;
  6877. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6878. return false;
  6879. }
  6880. // Check that cyclic values are equal.
  6881. var arrStacked = stack.get(array);
  6882. var othStacked = stack.get(other);
  6883. if (arrStacked && othStacked) {
  6884. return arrStacked == other && othStacked == array;
  6885. }
  6886. var index = -1,
  6887. result = true,
  6888. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6889. stack.set(array, other);
  6890. stack.set(other, array);
  6891. // Ignore non-index properties.
  6892. while (++index < arrLength) {
  6893. var arrValue = array[index],
  6894. othValue = other[index];
  6895. if (customizer) {
  6896. var compared = isPartial
  6897. ? customizer(othValue, arrValue, index, other, array, stack)
  6898. : customizer(arrValue, othValue, index, array, other, stack);
  6899. }
  6900. if (compared !== undefined) {
  6901. if (compared) {
  6902. continue;
  6903. }
  6904. result = false;
  6905. break;
  6906. }
  6907. // Recursively compare arrays (susceptible to call stack limits).
  6908. if (seen) {
  6909. if (!arraySome(other, function(othValue, othIndex) {
  6910. if (!cacheHas(seen, othIndex) &&
  6911. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6912. return seen.push(othIndex);
  6913. }
  6914. })) {
  6915. result = false;
  6916. break;
  6917. }
  6918. } else if (!(
  6919. arrValue === othValue ||
  6920. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6921. )) {
  6922. result = false;
  6923. break;
  6924. }
  6925. }
  6926. stack['delete'](array);
  6927. stack['delete'](other);
  6928. return result;
  6929. }
  6930. /**
  6931. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6932. * the same `toStringTag`.
  6933. *
  6934. * **Note:** This function only supports comparing values with tags of
  6935. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6936. *
  6937. * @private
  6938. * @param {Object} object The object to compare.
  6939. * @param {Object} other The other object to compare.
  6940. * @param {string} tag The `toStringTag` of the objects to compare.
  6941. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6942. * @param {Function} customizer The function to customize comparisons.
  6943. * @param {Function} equalFunc The function to determine equivalents of values.
  6944. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6945. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6946. */
  6947. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6948. switch (tag) {
  6949. case dataViewTag:
  6950. if ((object.byteLength != other.byteLength) ||
  6951. (object.byteOffset != other.byteOffset)) {
  6952. return false;
  6953. }
  6954. object = object.buffer;
  6955. other = other.buffer;
  6956. case arrayBufferTag:
  6957. if ((object.byteLength != other.byteLength) ||
  6958. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6959. return false;
  6960. }
  6961. return true;
  6962. case boolTag:
  6963. case dateTag:
  6964. case numberTag:
  6965. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6966. // Invalid dates are coerced to `NaN`.
  6967. return eq(+object, +other);
  6968. case errorTag:
  6969. return object.name == other.name && object.message == other.message;
  6970. case regexpTag:
  6971. case stringTag:
  6972. // Coerce regexes to strings and treat strings, primitives and objects,
  6973. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6974. // for more details.
  6975. return object == (other + '');
  6976. case mapTag:
  6977. var convert = mapToArray;
  6978. case setTag:
  6979. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6980. convert || (convert = setToArray);
  6981. if (object.size != other.size && !isPartial) {
  6982. return false;
  6983. }
  6984. // Assume cyclic values are equal.
  6985. var stacked = stack.get(object);
  6986. if (stacked) {
  6987. return stacked == other;
  6988. }
  6989. bitmask |= COMPARE_UNORDERED_FLAG;
  6990. // Recursively compare objects (susceptible to call stack limits).
  6991. stack.set(object, other);
  6992. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6993. stack['delete'](object);
  6994. return result;
  6995. case symbolTag:
  6996. if (symbolValueOf) {
  6997. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6998. }
  6999. }
  7000. return false;
  7001. }
  7002. /**
  7003. * A specialized version of `baseIsEqualDeep` for objects with support for
  7004. * partial deep comparisons.
  7005. *
  7006. * @private
  7007. * @param {Object} object The object to compare.
  7008. * @param {Object} other The other object to compare.
  7009. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  7010. * @param {Function} customizer The function to customize comparisons.
  7011. * @param {Function} equalFunc The function to determine equivalents of values.
  7012. * @param {Object} stack Tracks traversed `object` and `other` objects.
  7013. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  7014. */
  7015. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  7016. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  7017. objProps = getAllKeys(object),
  7018. objLength = objProps.length,
  7019. othProps = getAllKeys(other),
  7020. othLength = othProps.length;
  7021. if (objLength != othLength && !isPartial) {
  7022. return false;
  7023. }
  7024. var index = objLength;
  7025. while (index--) {
  7026. var key = objProps[index];
  7027. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  7028. return false;
  7029. }
  7030. }
  7031. // Check that cyclic values are equal.
  7032. var objStacked = stack.get(object);
  7033. var othStacked = stack.get(other);
  7034. if (objStacked && othStacked) {
  7035. return objStacked == other && othStacked == object;
  7036. }
  7037. var result = true;
  7038. stack.set(object, other);
  7039. stack.set(other, object);
  7040. var skipCtor = isPartial;
  7041. while (++index < objLength) {
  7042. key = objProps[index];
  7043. var objValue = object[key],
  7044. othValue = other[key];
  7045. if (customizer) {
  7046. var compared = isPartial
  7047. ? customizer(othValue, objValue, key, other, object, stack)
  7048. : customizer(objValue, othValue, key, object, other, stack);
  7049. }
  7050. // Recursively compare objects (susceptible to call stack limits).
  7051. if (!(compared === undefined
  7052. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  7053. : compared
  7054. )) {
  7055. result = false;
  7056. break;
  7057. }
  7058. skipCtor || (skipCtor = key == 'constructor');
  7059. }
  7060. if (result && !skipCtor) {
  7061. var objCtor = object.constructor,
  7062. othCtor = other.constructor;
  7063. // Non `Object` object instances with different constructors are not equal.
  7064. if (objCtor != othCtor &&
  7065. ('constructor' in object && 'constructor' in other) &&
  7066. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  7067. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  7068. result = false;
  7069. }
  7070. }
  7071. stack['delete'](object);
  7072. stack['delete'](other);
  7073. return result;
  7074. }
  7075. /**
  7076. * A specialized version of `baseRest` which flattens the rest array.
  7077. *
  7078. * @private
  7079. * @param {Function} func The function to apply a rest parameter to.
  7080. * @returns {Function} Returns the new function.
  7081. */
  7082. function flatRest(func) {
  7083. return setToString(overRest(func, undefined, flatten), func + '');
  7084. }
  7085. /**
  7086. * Creates an array of own enumerable property names and symbols of `object`.
  7087. *
  7088. * @private
  7089. * @param {Object} object The object to query.
  7090. * @returns {Array} Returns the array of property names and symbols.
  7091. */
  7092. function getAllKeys(object) {
  7093. return baseGetAllKeys(object, keys, getSymbols);
  7094. }
  7095. /**
  7096. * Creates an array of own and inherited enumerable property names and
  7097. * symbols of `object`.
  7098. *
  7099. * @private
  7100. * @param {Object} object The object to query.
  7101. * @returns {Array} Returns the array of property names and symbols.
  7102. */
  7103. function getAllKeysIn(object) {
  7104. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  7105. }
  7106. /**
  7107. * Gets metadata for `func`.
  7108. *
  7109. * @private
  7110. * @param {Function} func The function to query.
  7111. * @returns {*} Returns the metadata for `func`.
  7112. */
  7113. var getData = !metaMap ? noop : function(func) {
  7114. return metaMap.get(func);
  7115. };
  7116. /**
  7117. * Gets the name of `func`.
  7118. *
  7119. * @private
  7120. * @param {Function} func The function to query.
  7121. * @returns {string} Returns the function name.
  7122. */
  7123. function getFuncName(func) {
  7124. var result = (func.name + ''),
  7125. array = realNames[result],
  7126. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  7127. while (length--) {
  7128. var data = array[length],
  7129. otherFunc = data.func;
  7130. if (otherFunc == null || otherFunc == func) {
  7131. return data.name;
  7132. }
  7133. }
  7134. return result;
  7135. }
  7136. /**
  7137. * Gets the argument placeholder value for `func`.
  7138. *
  7139. * @private
  7140. * @param {Function} func The function to inspect.
  7141. * @returns {*} Returns the placeholder value.
  7142. */
  7143. function getHolder(func) {
  7144. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  7145. return object.placeholder;
  7146. }
  7147. /**
  7148. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  7149. * this function returns the custom method, otherwise it returns `baseIteratee`.
  7150. * If arguments are provided, the chosen function is invoked with them and
  7151. * its result is returned.
  7152. *
  7153. * @private
  7154. * @param {*} [value] The value to convert to an iteratee.
  7155. * @param {number} [arity] The arity of the created iteratee.
  7156. * @returns {Function} Returns the chosen function or its result.
  7157. */
  7158. function getIteratee() {
  7159. var result = lodash.iteratee || iteratee;
  7160. result = result === iteratee ? baseIteratee : result;
  7161. return arguments.length ? result(arguments[0], arguments[1]) : result;
  7162. }
  7163. /**
  7164. * Gets the data for `map`.
  7165. *
  7166. * @private
  7167. * @param {Object} map The map to query.
  7168. * @param {string} key The reference key.
  7169. * @returns {*} Returns the map data.
  7170. */
  7171. function getMapData(map, key) {
  7172. var data = map.__data__;
  7173. return isKeyable(key)
  7174. ? data[typeof key == 'string' ? 'string' : 'hash']
  7175. : data.map;
  7176. }
  7177. /**
  7178. * Gets the property names, values, and compare flags of `object`.
  7179. *
  7180. * @private
  7181. * @param {Object} object The object to query.
  7182. * @returns {Array} Returns the match data of `object`.
  7183. */
  7184. function getMatchData(object) {
  7185. var result = keys(object),
  7186. length = result.length;
  7187. while (length--) {
  7188. var key = result[length],
  7189. value = object[key];
  7190. result[length] = [key, value, isStrictComparable(value)];
  7191. }
  7192. return result;
  7193. }
  7194. /**
  7195. * Gets the native function at `key` of `object`.
  7196. *
  7197. * @private
  7198. * @param {Object} object The object to query.
  7199. * @param {string} key The key of the method to get.
  7200. * @returns {*} Returns the function if it's native, else `undefined`.
  7201. */
  7202. function getNative(object, key) {
  7203. var value = getValue(object, key);
  7204. return baseIsNative(value) ? value : undefined;
  7205. }
  7206. /**
  7207. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  7208. *
  7209. * @private
  7210. * @param {*} value The value to query.
  7211. * @returns {string} Returns the raw `toStringTag`.
  7212. */
  7213. function getRawTag(value) {
  7214. var isOwn = hasOwnProperty.call(value, symToStringTag),
  7215. tag = value[symToStringTag];
  7216. try {
  7217. value[symToStringTag] = undefined;
  7218. var unmasked = true;
  7219. } catch (e) {}
  7220. var result = nativeObjectToString.call(value);
  7221. if (unmasked) {
  7222. if (isOwn) {
  7223. value[symToStringTag] = tag;
  7224. } else {
  7225. delete value[symToStringTag];
  7226. }
  7227. }
  7228. return result;
  7229. }
  7230. /**
  7231. * Creates an array of the own enumerable symbols of `object`.
  7232. *
  7233. * @private
  7234. * @param {Object} object The object to query.
  7235. * @returns {Array} Returns the array of symbols.
  7236. */
  7237. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  7238. if (object == null) {
  7239. return [];
  7240. }
  7241. object = Object(object);
  7242. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  7243. return propertyIsEnumerable.call(object, symbol);
  7244. });
  7245. };
  7246. /**
  7247. * Creates an array of the own and inherited enumerable symbols of `object`.
  7248. *
  7249. * @private
  7250. * @param {Object} object The object to query.
  7251. * @returns {Array} Returns the array of symbols.
  7252. */
  7253. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  7254. var result = [];
  7255. while (object) {
  7256. arrayPush(result, getSymbols(object));
  7257. object = getPrototype(object);
  7258. }
  7259. return result;
  7260. };
  7261. /**
  7262. * Gets the `toStringTag` of `value`.
  7263. *
  7264. * @private
  7265. * @param {*} value The value to query.
  7266. * @returns {string} Returns the `toStringTag`.
  7267. */
  7268. var getTag = baseGetTag;
  7269. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  7270. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  7271. (Map && getTag(new Map) != mapTag) ||
  7272. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  7273. (Set && getTag(new Set) != setTag) ||
  7274. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  7275. getTag = function(value) {
  7276. var result = baseGetTag(value),
  7277. Ctor = result == objectTag ? value.constructor : undefined,
  7278. ctorString = Ctor ? toSource(Ctor) : '';
  7279. if (ctorString) {
  7280. switch (ctorString) {
  7281. case dataViewCtorString: return dataViewTag;
  7282. case mapCtorString: return mapTag;
  7283. case promiseCtorString: return promiseTag;
  7284. case setCtorString: return setTag;
  7285. case weakMapCtorString: return weakMapTag;
  7286. }
  7287. }
  7288. return result;
  7289. };
  7290. }
  7291. /**
  7292. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  7293. *
  7294. * @private
  7295. * @param {number} start The start of the view.
  7296. * @param {number} end The end of the view.
  7297. * @param {Array} transforms The transformations to apply to the view.
  7298. * @returns {Object} Returns an object containing the `start` and `end`
  7299. * positions of the view.
  7300. */
  7301. function getView(start, end, transforms) {
  7302. var index = -1,
  7303. length = transforms.length;
  7304. while (++index < length) {
  7305. var data = transforms[index],
  7306. size = data.size;
  7307. switch (data.type) {
  7308. case 'drop': start += size; break;
  7309. case 'dropRight': end -= size; break;
  7310. case 'take': end = nativeMin(end, start + size); break;
  7311. case 'takeRight': start = nativeMax(start, end - size); break;
  7312. }
  7313. }
  7314. return { 'start': start, 'end': end };
  7315. }
  7316. /**
  7317. * Extracts wrapper details from the `source` body comment.
  7318. *
  7319. * @private
  7320. * @param {string} source The source to inspect.
  7321. * @returns {Array} Returns the wrapper details.
  7322. */
  7323. function getWrapDetails(source) {
  7324. var match = source.match(reWrapDetails);
  7325. return match ? match[1].split(reSplitDetails) : [];
  7326. }
  7327. /**
  7328. * Checks if `path` exists on `object`.
  7329. *
  7330. * @private
  7331. * @param {Object} object The object to query.
  7332. * @param {Array|string} path The path to check.
  7333. * @param {Function} hasFunc The function to check properties.
  7334. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  7335. */
  7336. function hasPath(object, path, hasFunc) {
  7337. path = castPath(path, object);
  7338. var index = -1,
  7339. length = path.length,
  7340. result = false;
  7341. while (++index < length) {
  7342. var key = toKey(path[index]);
  7343. if (!(result = object != null && hasFunc(object, key))) {
  7344. break;
  7345. }
  7346. object = object[key];
  7347. }
  7348. if (result || ++index != length) {
  7349. return result;
  7350. }
  7351. length = object == null ? 0 : object.length;
  7352. return !!length && isLength(length) && isIndex(key, length) &&
  7353. (isArray(object) || isArguments(object));
  7354. }
  7355. /**
  7356. * Initializes an array clone.
  7357. *
  7358. * @private
  7359. * @param {Array} array The array to clone.
  7360. * @returns {Array} Returns the initialized clone.
  7361. */
  7362. function initCloneArray(array) {
  7363. var length = array.length,
  7364. result = new array.constructor(length);
  7365. // Add properties assigned by `RegExp#exec`.
  7366. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  7367. result.index = array.index;
  7368. result.input = array.input;
  7369. }
  7370. return result;
  7371. }
  7372. /**
  7373. * Initializes an object clone.
  7374. *
  7375. * @private
  7376. * @param {Object} object The object to clone.
  7377. * @returns {Object} Returns the initialized clone.
  7378. */
  7379. function initCloneObject(object) {
  7380. return (typeof object.constructor == 'function' && !isPrototype(object))
  7381. ? baseCreate(getPrototype(object))
  7382. : {};
  7383. }
  7384. /**
  7385. * Initializes an object clone based on its `toStringTag`.
  7386. *
  7387. * **Note:** This function only supports cloning values with tags of
  7388. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  7389. *
  7390. * @private
  7391. * @param {Object} object The object to clone.
  7392. * @param {string} tag The `toStringTag` of the object to clone.
  7393. * @param {boolean} [isDeep] Specify a deep clone.
  7394. * @returns {Object} Returns the initialized clone.
  7395. */
  7396. function initCloneByTag(object, tag, isDeep) {
  7397. var Ctor = object.constructor;
  7398. switch (tag) {
  7399. case arrayBufferTag:
  7400. return cloneArrayBuffer(object);
  7401. case boolTag:
  7402. case dateTag:
  7403. return new Ctor(+object);
  7404. case dataViewTag:
  7405. return cloneDataView(object, isDeep);
  7406. case float32Tag: case float64Tag:
  7407. case int8Tag: case int16Tag: case int32Tag:
  7408. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  7409. return cloneTypedArray(object, isDeep);
  7410. case mapTag:
  7411. return new Ctor;
  7412. case numberTag:
  7413. case stringTag:
  7414. return new Ctor(object);
  7415. case regexpTag:
  7416. return cloneRegExp(object);
  7417. case setTag:
  7418. return new Ctor;
  7419. case symbolTag:
  7420. return cloneSymbol(object);
  7421. }
  7422. }
  7423. /**
  7424. * Inserts wrapper `details` in a comment at the top of the `source` body.
  7425. *
  7426. * @private
  7427. * @param {string} source The source to modify.
  7428. * @returns {Array} details The details to insert.
  7429. * @returns {string} Returns the modified source.
  7430. */
  7431. function insertWrapDetails(source, details) {
  7432. var length = details.length;
  7433. if (!length) {
  7434. return source;
  7435. }
  7436. var lastIndex = length - 1;
  7437. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  7438. details = details.join(length > 2 ? ', ' : ' ');
  7439. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  7440. }
  7441. /**
  7442. * Checks if `value` is a flattenable `arguments` object or array.
  7443. *
  7444. * @private
  7445. * @param {*} value The value to check.
  7446. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  7447. */
  7448. function isFlattenable(value) {
  7449. return isArray(value) || isArguments(value) ||
  7450. !!(spreadableSymbol && value && value[spreadableSymbol]);
  7451. }
  7452. /**
  7453. * Checks if `value` is a valid array-like index.
  7454. *
  7455. * @private
  7456. * @param {*} value The value to check.
  7457. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7458. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7459. */
  7460. function isIndex(value, length) {
  7461. var type = typeof value;
  7462. length = length == null ? MAX_SAFE_INTEGER : length;
  7463. return !!length &&
  7464. (type == 'number' ||
  7465. (type != 'symbol' && reIsUint.test(value))) &&
  7466. (value > -1 && value % 1 == 0 && value < length);
  7467. }
  7468. /**
  7469. * Checks if the given arguments are from an iteratee call.
  7470. *
  7471. * @private
  7472. * @param {*} value The potential iteratee value argument.
  7473. * @param {*} index The potential iteratee index or key argument.
  7474. * @param {*} object The potential iteratee object argument.
  7475. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7476. * else `false`.
  7477. */
  7478. function isIterateeCall(value, index, object) {
  7479. if (!isObject(object)) {
  7480. return false;
  7481. }
  7482. var type = typeof index;
  7483. if (type == 'number'
  7484. ? (isArrayLike(object) && isIndex(index, object.length))
  7485. : (type == 'string' && index in object)
  7486. ) {
  7487. return eq(object[index], value);
  7488. }
  7489. return false;
  7490. }
  7491. /**
  7492. * Checks if `value` is a property name and not a property path.
  7493. *
  7494. * @private
  7495. * @param {*} value The value to check.
  7496. * @param {Object} [object] The object to query keys on.
  7497. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7498. */
  7499. function isKey(value, object) {
  7500. if (isArray(value)) {
  7501. return false;
  7502. }
  7503. var type = typeof value;
  7504. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7505. value == null || isSymbol(value)) {
  7506. return true;
  7507. }
  7508. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7509. (object != null && value in Object(object));
  7510. }
  7511. /**
  7512. * Checks if `value` is suitable for use as unique object key.
  7513. *
  7514. * @private
  7515. * @param {*} value The value to check.
  7516. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7517. */
  7518. function isKeyable(value) {
  7519. var type = typeof value;
  7520. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7521. ? (value !== '__proto__')
  7522. : (value === null);
  7523. }
  7524. /**
  7525. * Checks if `func` has a lazy counterpart.
  7526. *
  7527. * @private
  7528. * @param {Function} func The function to check.
  7529. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7530. * else `false`.
  7531. */
  7532. function isLaziable(func) {
  7533. var funcName = getFuncName(func),
  7534. other = lodash[funcName];
  7535. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7536. return false;
  7537. }
  7538. if (func === other) {
  7539. return true;
  7540. }
  7541. var data = getData(other);
  7542. return !!data && func === data[0];
  7543. }
  7544. /**
  7545. * Checks if `func` has its source masked.
  7546. *
  7547. * @private
  7548. * @param {Function} func The function to check.
  7549. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7550. */
  7551. function isMasked(func) {
  7552. return !!maskSrcKey && (maskSrcKey in func);
  7553. }
  7554. /**
  7555. * Checks if `func` is capable of being masked.
  7556. *
  7557. * @private
  7558. * @param {*} value The value to check.
  7559. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7560. */
  7561. var isMaskable = coreJsData ? isFunction : stubFalse;
  7562. /**
  7563. * Checks if `value` is likely a prototype object.
  7564. *
  7565. * @private
  7566. * @param {*} value The value to check.
  7567. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7568. */
  7569. function isPrototype(value) {
  7570. var Ctor = value && value.constructor,
  7571. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7572. return value === proto;
  7573. }
  7574. /**
  7575. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7576. *
  7577. * @private
  7578. * @param {*} value The value to check.
  7579. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7580. * equality comparisons, else `false`.
  7581. */
  7582. function isStrictComparable(value) {
  7583. return value === value && !isObject(value);
  7584. }
  7585. /**
  7586. * A specialized version of `matchesProperty` for source values suitable
  7587. * for strict equality comparisons, i.e. `===`.
  7588. *
  7589. * @private
  7590. * @param {string} key The key of the property to get.
  7591. * @param {*} srcValue The value to match.
  7592. * @returns {Function} Returns the new spec function.
  7593. */
  7594. function matchesStrictComparable(key, srcValue) {
  7595. return function(object) {
  7596. if (object == null) {
  7597. return false;
  7598. }
  7599. return object[key] === srcValue &&
  7600. (srcValue !== undefined || (key in Object(object)));
  7601. };
  7602. }
  7603. /**
  7604. * A specialized version of `_.memoize` which clears the memoized function's
  7605. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7606. *
  7607. * @private
  7608. * @param {Function} func The function to have its output memoized.
  7609. * @returns {Function} Returns the new memoized function.
  7610. */
  7611. function memoizeCapped(func) {
  7612. var result = memoize(func, function(key) {
  7613. if (cache.size === MAX_MEMOIZE_SIZE) {
  7614. cache.clear();
  7615. }
  7616. return key;
  7617. });
  7618. var cache = result.cache;
  7619. return result;
  7620. }
  7621. /**
  7622. * Merges the function metadata of `source` into `data`.
  7623. *
  7624. * Merging metadata reduces the number of wrappers used to invoke a function.
  7625. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7626. * may be applied regardless of execution order. Methods like `_.ary` and
  7627. * `_.rearg` modify function arguments, making the order in which they are
  7628. * executed important, preventing the merging of metadata. However, we make
  7629. * an exception for a safe combined case where curried functions have `_.ary`
  7630. * and or `_.rearg` applied.
  7631. *
  7632. * @private
  7633. * @param {Array} data The destination metadata.
  7634. * @param {Array} source The source metadata.
  7635. * @returns {Array} Returns `data`.
  7636. */
  7637. function mergeData(data, source) {
  7638. var bitmask = data[1],
  7639. srcBitmask = source[1],
  7640. newBitmask = bitmask | srcBitmask,
  7641. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7642. var isCombo =
  7643. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7644. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7645. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7646. // Exit early if metadata can't be merged.
  7647. if (!(isCommon || isCombo)) {
  7648. return data;
  7649. }
  7650. // Use source `thisArg` if available.
  7651. if (srcBitmask & WRAP_BIND_FLAG) {
  7652. data[2] = source[2];
  7653. // Set when currying a bound function.
  7654. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7655. }
  7656. // Compose partial arguments.
  7657. var value = source[3];
  7658. if (value) {
  7659. var partials = data[3];
  7660. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7661. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7662. }
  7663. // Compose partial right arguments.
  7664. value = source[5];
  7665. if (value) {
  7666. partials = data[5];
  7667. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7668. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7669. }
  7670. // Use source `argPos` if available.
  7671. value = source[7];
  7672. if (value) {
  7673. data[7] = value;
  7674. }
  7675. // Use source `ary` if it's smaller.
  7676. if (srcBitmask & WRAP_ARY_FLAG) {
  7677. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7678. }
  7679. // Use source `arity` if one is not provided.
  7680. if (data[9] == null) {
  7681. data[9] = source[9];
  7682. }
  7683. // Use source `func` and merge bitmasks.
  7684. data[0] = source[0];
  7685. data[1] = newBitmask;
  7686. return data;
  7687. }
  7688. /**
  7689. * This function is like
  7690. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7691. * except that it includes inherited enumerable properties.
  7692. *
  7693. * @private
  7694. * @param {Object} object The object to query.
  7695. * @returns {Array} Returns the array of property names.
  7696. */
  7697. function nativeKeysIn(object) {
  7698. var result = [];
  7699. if (object != null) {
  7700. for (var key in Object(object)) {
  7701. result.push(key);
  7702. }
  7703. }
  7704. return result;
  7705. }
  7706. /**
  7707. * Converts `value` to a string using `Object.prototype.toString`.
  7708. *
  7709. * @private
  7710. * @param {*} value The value to convert.
  7711. * @returns {string} Returns the converted string.
  7712. */
  7713. function objectToString(value) {
  7714. return nativeObjectToString.call(value);
  7715. }
  7716. /**
  7717. * A specialized version of `baseRest` which transforms the rest array.
  7718. *
  7719. * @private
  7720. * @param {Function} func The function to apply a rest parameter to.
  7721. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7722. * @param {Function} transform The rest array transform.
  7723. * @returns {Function} Returns the new function.
  7724. */
  7725. function overRest(func, start, transform) {
  7726. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7727. return function() {
  7728. var args = arguments,
  7729. index = -1,
  7730. length = nativeMax(args.length - start, 0),
  7731. array = Array(length);
  7732. while (++index < length) {
  7733. array[index] = args[start + index];
  7734. }
  7735. index = -1;
  7736. var otherArgs = Array(start + 1);
  7737. while (++index < start) {
  7738. otherArgs[index] = args[index];
  7739. }
  7740. otherArgs[start] = transform(array);
  7741. return apply(func, this, otherArgs);
  7742. };
  7743. }
  7744. /**
  7745. * Gets the parent value at `path` of `object`.
  7746. *
  7747. * @private
  7748. * @param {Object} object The object to query.
  7749. * @param {Array} path The path to get the parent value of.
  7750. * @returns {*} Returns the parent value.
  7751. */
  7752. function parent(object, path) {
  7753. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7754. }
  7755. /**
  7756. * Reorder `array` according to the specified indexes where the element at
  7757. * the first index is assigned as the first element, the element at
  7758. * the second index is assigned as the second element, and so on.
  7759. *
  7760. * @private
  7761. * @param {Array} array The array to reorder.
  7762. * @param {Array} indexes The arranged array indexes.
  7763. * @returns {Array} Returns `array`.
  7764. */
  7765. function reorder(array, indexes) {
  7766. var arrLength = array.length,
  7767. length = nativeMin(indexes.length, arrLength),
  7768. oldArray = copyArray(array);
  7769. while (length--) {
  7770. var index = indexes[length];
  7771. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7772. }
  7773. return array;
  7774. }
  7775. /**
  7776. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7777. *
  7778. * @private
  7779. * @param {Object} object The object to query.
  7780. * @param {string} key The key of the property to get.
  7781. * @returns {*} Returns the property value.
  7782. */
  7783. function safeGet(object, key) {
  7784. if (key === 'constructor' && typeof object[key] === 'function') {
  7785. return;
  7786. }
  7787. if (key == '__proto__') {
  7788. return;
  7789. }
  7790. return object[key];
  7791. }
  7792. /**
  7793. * Sets metadata for `func`.
  7794. *
  7795. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7796. * period of time, it will trip its breaker and transition to an identity
  7797. * function to avoid garbage collection pauses in V8. See
  7798. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7799. * for more details.
  7800. *
  7801. * @private
  7802. * @param {Function} func The function to associate metadata with.
  7803. * @param {*} data The metadata.
  7804. * @returns {Function} Returns `func`.
  7805. */
  7806. var setData = shortOut(baseSetData);
  7807. /**
  7808. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7809. *
  7810. * @private
  7811. * @param {Function} func The function to delay.
  7812. * @param {number} wait The number of milliseconds to delay invocation.
  7813. * @returns {number|Object} Returns the timer id or timeout object.
  7814. */
  7815. var setTimeout = ctxSetTimeout || function(func, wait) {
  7816. return root.setTimeout(func, wait);
  7817. };
  7818. /**
  7819. * Sets the `toString` method of `func` to return `string`.
  7820. *
  7821. * @private
  7822. * @param {Function} func The function to modify.
  7823. * @param {Function} string The `toString` result.
  7824. * @returns {Function} Returns `func`.
  7825. */
  7826. var setToString = shortOut(baseSetToString);
  7827. /**
  7828. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7829. * with wrapper details in a comment at the top of the source body.
  7830. *
  7831. * @private
  7832. * @param {Function} wrapper The function to modify.
  7833. * @param {Function} reference The reference function.
  7834. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7835. * @returns {Function} Returns `wrapper`.
  7836. */
  7837. function setWrapToString(wrapper, reference, bitmask) {
  7838. var source = (reference + '');
  7839. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7840. }
  7841. /**
  7842. * Creates a function that'll short out and invoke `identity` instead
  7843. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7844. * milliseconds.
  7845. *
  7846. * @private
  7847. * @param {Function} func The function to restrict.
  7848. * @returns {Function} Returns the new shortable function.
  7849. */
  7850. function shortOut(func) {
  7851. var count = 0,
  7852. lastCalled = 0;
  7853. return function() {
  7854. var stamp = nativeNow(),
  7855. remaining = HOT_SPAN - (stamp - lastCalled);
  7856. lastCalled = stamp;
  7857. if (remaining > 0) {
  7858. if (++count >= HOT_COUNT) {
  7859. return arguments[0];
  7860. }
  7861. } else {
  7862. count = 0;
  7863. }
  7864. return func.apply(undefined, arguments);
  7865. };
  7866. }
  7867. /**
  7868. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7869. *
  7870. * @private
  7871. * @param {Array} array The array to shuffle.
  7872. * @param {number} [size=array.length] The size of `array`.
  7873. * @returns {Array} Returns `array`.
  7874. */
  7875. function shuffleSelf(array, size) {
  7876. var index = -1,
  7877. length = array.length,
  7878. lastIndex = length - 1;
  7879. size = size === undefined ? length : size;
  7880. while (++index < size) {
  7881. var rand = baseRandom(index, lastIndex),
  7882. value = array[rand];
  7883. array[rand] = array[index];
  7884. array[index] = value;
  7885. }
  7886. array.length = size;
  7887. return array;
  7888. }
  7889. /**
  7890. * Converts `string` to a property path array.
  7891. *
  7892. * @private
  7893. * @param {string} string The string to convert.
  7894. * @returns {Array} Returns the property path array.
  7895. */
  7896. var stringToPath = memoizeCapped(function(string) {
  7897. var result = [];
  7898. if (string.charCodeAt(0) === 46 /* . */) {
  7899. result.push('');
  7900. }
  7901. string.replace(rePropName, function(match, number, quote, subString) {
  7902. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7903. });
  7904. return result;
  7905. });
  7906. /**
  7907. * Converts `value` to a string key if it's not a string or symbol.
  7908. *
  7909. * @private
  7910. * @param {*} value The value to inspect.
  7911. * @returns {string|symbol} Returns the key.
  7912. */
  7913. function toKey(value) {
  7914. if (typeof value == 'string' || isSymbol(value)) {
  7915. return value;
  7916. }
  7917. var result = (value + '');
  7918. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7919. }
  7920. /**
  7921. * Converts `func` to its source code.
  7922. *
  7923. * @private
  7924. * @param {Function} func The function to convert.
  7925. * @returns {string} Returns the source code.
  7926. */
  7927. function toSource(func) {
  7928. if (func != null) {
  7929. try {
  7930. return funcToString.call(func);
  7931. } catch (e) {}
  7932. try {
  7933. return (func + '');
  7934. } catch (e) {}
  7935. }
  7936. return '';
  7937. }
  7938. /**
  7939. * Updates wrapper `details` based on `bitmask` flags.
  7940. *
  7941. * @private
  7942. * @returns {Array} details The details to modify.
  7943. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7944. * @returns {Array} Returns `details`.
  7945. */
  7946. function updateWrapDetails(details, bitmask) {
  7947. arrayEach(wrapFlags, function(pair) {
  7948. var value = '_.' + pair[0];
  7949. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7950. details.push(value);
  7951. }
  7952. });
  7953. return details.sort();
  7954. }
  7955. /**
  7956. * Creates a clone of `wrapper`.
  7957. *
  7958. * @private
  7959. * @param {Object} wrapper The wrapper to clone.
  7960. * @returns {Object} Returns the cloned wrapper.
  7961. */
  7962. function wrapperClone(wrapper) {
  7963. if (wrapper instanceof LazyWrapper) {
  7964. return wrapper.clone();
  7965. }
  7966. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7967. result.__actions__ = copyArray(wrapper.__actions__);
  7968. result.__index__ = wrapper.__index__;
  7969. result.__values__ = wrapper.__values__;
  7970. return result;
  7971. }
  7972. /*------------------------------------------------------------------------*/
  7973. /**
  7974. * Creates an array of elements split into groups the length of `size`.
  7975. * If `array` can't be split evenly, the final chunk will be the remaining
  7976. * elements.
  7977. *
  7978. * @static
  7979. * @memberOf _
  7980. * @since 3.0.0
  7981. * @category Array
  7982. * @param {Array} array The array to process.
  7983. * @param {number} [size=1] The length of each chunk
  7984. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7985. * @returns {Array} Returns the new array of chunks.
  7986. * @example
  7987. *
  7988. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7989. * // => [['a', 'b'], ['c', 'd']]
  7990. *
  7991. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7992. * // => [['a', 'b', 'c'], ['d']]
  7993. */
  7994. function chunk(array, size, guard) {
  7995. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7996. size = 1;
  7997. } else {
  7998. size = nativeMax(toInteger(size), 0);
  7999. }
  8000. var length = array == null ? 0 : array.length;
  8001. if (!length || size < 1) {
  8002. return [];
  8003. }
  8004. var index = 0,
  8005. resIndex = 0,
  8006. result = Array(nativeCeil(length / size));
  8007. while (index < length) {
  8008. result[resIndex++] = baseSlice(array, index, (index += size));
  8009. }
  8010. return result;
  8011. }
  8012. /**
  8013. * Creates an array with all falsey values removed. The values `false`, `null`,
  8014. * `0`, `""`, `undefined`, and `NaN` are falsey.
  8015. *
  8016. * @static
  8017. * @memberOf _
  8018. * @since 0.1.0
  8019. * @category Array
  8020. * @param {Array} array The array to compact.
  8021. * @returns {Array} Returns the new array of filtered values.
  8022. * @example
  8023. *
  8024. * _.compact([0, 1, false, 2, '', 3]);
  8025. * // => [1, 2, 3]
  8026. */
  8027. function compact(array) {
  8028. var index = -1,
  8029. length = array == null ? 0 : array.length,
  8030. resIndex = 0,
  8031. result = [];
  8032. while (++index < length) {
  8033. var value = array[index];
  8034. if (value) {
  8035. result[resIndex++] = value;
  8036. }
  8037. }
  8038. return result;
  8039. }
  8040. /**
  8041. * Creates a new array concatenating `array` with any additional arrays
  8042. * and/or values.
  8043. *
  8044. * @static
  8045. * @memberOf _
  8046. * @since 4.0.0
  8047. * @category Array
  8048. * @param {Array} array The array to concatenate.
  8049. * @param {...*} [values] The values to concatenate.
  8050. * @returns {Array} Returns the new concatenated array.
  8051. * @example
  8052. *
  8053. * var array = [1];
  8054. * var other = _.concat(array, 2, [3], [[4]]);
  8055. *
  8056. * console.log(other);
  8057. * // => [1, 2, 3, [4]]
  8058. *
  8059. * console.log(array);
  8060. * // => [1]
  8061. */
  8062. function concat() {
  8063. var length = arguments.length;
  8064. if (!length) {
  8065. return [];
  8066. }
  8067. var args = Array(length - 1),
  8068. array = arguments[0],
  8069. index = length;
  8070. while (index--) {
  8071. args[index - 1] = arguments[index];
  8072. }
  8073. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  8074. }
  8075. /**
  8076. * Creates an array of `array` values not included in the other given arrays
  8077. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8078. * for equality comparisons. The order and references of result values are
  8079. * determined by the first array.
  8080. *
  8081. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  8082. *
  8083. * @static
  8084. * @memberOf _
  8085. * @since 0.1.0
  8086. * @category Array
  8087. * @param {Array} array The array to inspect.
  8088. * @param {...Array} [values] The values to exclude.
  8089. * @returns {Array} Returns the new array of filtered values.
  8090. * @see _.without, _.xor
  8091. * @example
  8092. *
  8093. * _.difference([2, 1], [2, 3]);
  8094. * // => [1]
  8095. */
  8096. var difference = baseRest(function(array, values) {
  8097. return isArrayLikeObject(array)
  8098. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  8099. : [];
  8100. });
  8101. /**
  8102. * This method is like `_.difference` except that it accepts `iteratee` which
  8103. * is invoked for each element of `array` and `values` to generate the criterion
  8104. * by which they're compared. The order and references of result values are
  8105. * determined by the first array. The iteratee is invoked with one argument:
  8106. * (value).
  8107. *
  8108. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  8109. *
  8110. * @static
  8111. * @memberOf _
  8112. * @since 4.0.0
  8113. * @category Array
  8114. * @param {Array} array The array to inspect.
  8115. * @param {...Array} [values] The values to exclude.
  8116. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8117. * @returns {Array} Returns the new array of filtered values.
  8118. * @example
  8119. *
  8120. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8121. * // => [1.2]
  8122. *
  8123. * // The `_.property` iteratee shorthand.
  8124. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  8125. * // => [{ 'x': 2 }]
  8126. */
  8127. var differenceBy = baseRest(function(array, values) {
  8128. var iteratee = last(values);
  8129. if (isArrayLikeObject(iteratee)) {
  8130. iteratee = undefined;
  8131. }
  8132. return isArrayLikeObject(array)
  8133. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  8134. : [];
  8135. });
  8136. /**
  8137. * This method is like `_.difference` except that it accepts `comparator`
  8138. * which is invoked to compare elements of `array` to `values`. The order and
  8139. * references of result values are determined by the first array. The comparator
  8140. * is invoked with two arguments: (arrVal, othVal).
  8141. *
  8142. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  8143. *
  8144. * @static
  8145. * @memberOf _
  8146. * @since 4.0.0
  8147. * @category Array
  8148. * @param {Array} array The array to inspect.
  8149. * @param {...Array} [values] The values to exclude.
  8150. * @param {Function} [comparator] The comparator invoked per element.
  8151. * @returns {Array} Returns the new array of filtered values.
  8152. * @example
  8153. *
  8154. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8155. *
  8156. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  8157. * // => [{ 'x': 2, 'y': 1 }]
  8158. */
  8159. var differenceWith = baseRest(function(array, values) {
  8160. var comparator = last(values);
  8161. if (isArrayLikeObject(comparator)) {
  8162. comparator = undefined;
  8163. }
  8164. return isArrayLikeObject(array)
  8165. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  8166. : [];
  8167. });
  8168. /**
  8169. * Creates a slice of `array` with `n` elements dropped from the beginning.
  8170. *
  8171. * @static
  8172. * @memberOf _
  8173. * @since 0.5.0
  8174. * @category Array
  8175. * @param {Array} array The array to query.
  8176. * @param {number} [n=1] The number of elements to drop.
  8177. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8178. * @returns {Array} Returns the slice of `array`.
  8179. * @example
  8180. *
  8181. * _.drop([1, 2, 3]);
  8182. * // => [2, 3]
  8183. *
  8184. * _.drop([1, 2, 3], 2);
  8185. * // => [3]
  8186. *
  8187. * _.drop([1, 2, 3], 5);
  8188. * // => []
  8189. *
  8190. * _.drop([1, 2, 3], 0);
  8191. * // => [1, 2, 3]
  8192. */
  8193. function drop(array, n, guard) {
  8194. var length = array == null ? 0 : array.length;
  8195. if (!length) {
  8196. return [];
  8197. }
  8198. n = (guard || n === undefined) ? 1 : toInteger(n);
  8199. return baseSlice(array, n < 0 ? 0 : n, length);
  8200. }
  8201. /**
  8202. * Creates a slice of `array` with `n` elements dropped from the end.
  8203. *
  8204. * @static
  8205. * @memberOf _
  8206. * @since 3.0.0
  8207. * @category Array
  8208. * @param {Array} array The array to query.
  8209. * @param {number} [n=1] The number of elements to drop.
  8210. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8211. * @returns {Array} Returns the slice of `array`.
  8212. * @example
  8213. *
  8214. * _.dropRight([1, 2, 3]);
  8215. * // => [1, 2]
  8216. *
  8217. * _.dropRight([1, 2, 3], 2);
  8218. * // => [1]
  8219. *
  8220. * _.dropRight([1, 2, 3], 5);
  8221. * // => []
  8222. *
  8223. * _.dropRight([1, 2, 3], 0);
  8224. * // => [1, 2, 3]
  8225. */
  8226. function dropRight(array, n, guard) {
  8227. var length = array == null ? 0 : array.length;
  8228. if (!length) {
  8229. return [];
  8230. }
  8231. n = (guard || n === undefined) ? 1 : toInteger(n);
  8232. n = length - n;
  8233. return baseSlice(array, 0, n < 0 ? 0 : n);
  8234. }
  8235. /**
  8236. * Creates a slice of `array` excluding elements dropped from the end.
  8237. * Elements are dropped until `predicate` returns falsey. The predicate is
  8238. * invoked with three arguments: (value, index, array).
  8239. *
  8240. * @static
  8241. * @memberOf _
  8242. * @since 3.0.0
  8243. * @category Array
  8244. * @param {Array} array The array to query.
  8245. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8246. * @returns {Array} Returns the slice of `array`.
  8247. * @example
  8248. *
  8249. * var users = [
  8250. * { 'user': 'barney', 'active': true },
  8251. * { 'user': 'fred', 'active': false },
  8252. * { 'user': 'pebbles', 'active': false }
  8253. * ];
  8254. *
  8255. * _.dropRightWhile(users, function(o) { return !o.active; });
  8256. * // => objects for ['barney']
  8257. *
  8258. * // The `_.matches` iteratee shorthand.
  8259. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  8260. * // => objects for ['barney', 'fred']
  8261. *
  8262. * // The `_.matchesProperty` iteratee shorthand.
  8263. * _.dropRightWhile(users, ['active', false]);
  8264. * // => objects for ['barney']
  8265. *
  8266. * // The `_.property` iteratee shorthand.
  8267. * _.dropRightWhile(users, 'active');
  8268. * // => objects for ['barney', 'fred', 'pebbles']
  8269. */
  8270. function dropRightWhile(array, predicate) {
  8271. return (array && array.length)
  8272. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  8273. : [];
  8274. }
  8275. /**
  8276. * Creates a slice of `array` excluding elements dropped from the beginning.
  8277. * Elements are dropped until `predicate` returns falsey. The predicate is
  8278. * invoked with three arguments: (value, index, array).
  8279. *
  8280. * @static
  8281. * @memberOf _
  8282. * @since 3.0.0
  8283. * @category Array
  8284. * @param {Array} array The array to query.
  8285. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8286. * @returns {Array} Returns the slice of `array`.
  8287. * @example
  8288. *
  8289. * var users = [
  8290. * { 'user': 'barney', 'active': false },
  8291. * { 'user': 'fred', 'active': false },
  8292. * { 'user': 'pebbles', 'active': true }
  8293. * ];
  8294. *
  8295. * _.dropWhile(users, function(o) { return !o.active; });
  8296. * // => objects for ['pebbles']
  8297. *
  8298. * // The `_.matches` iteratee shorthand.
  8299. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  8300. * // => objects for ['fred', 'pebbles']
  8301. *
  8302. * // The `_.matchesProperty` iteratee shorthand.
  8303. * _.dropWhile(users, ['active', false]);
  8304. * // => objects for ['pebbles']
  8305. *
  8306. * // The `_.property` iteratee shorthand.
  8307. * _.dropWhile(users, 'active');
  8308. * // => objects for ['barney', 'fred', 'pebbles']
  8309. */
  8310. function dropWhile(array, predicate) {
  8311. return (array && array.length)
  8312. ? baseWhile(array, getIteratee(predicate, 3), true)
  8313. : [];
  8314. }
  8315. /**
  8316. * Fills elements of `array` with `value` from `start` up to, but not
  8317. * including, `end`.
  8318. *
  8319. * **Note:** This method mutates `array`.
  8320. *
  8321. * @static
  8322. * @memberOf _
  8323. * @since 3.2.0
  8324. * @category Array
  8325. * @param {Array} array The array to fill.
  8326. * @param {*} value The value to fill `array` with.
  8327. * @param {number} [start=0] The start position.
  8328. * @param {number} [end=array.length] The end position.
  8329. * @returns {Array} Returns `array`.
  8330. * @example
  8331. *
  8332. * var array = [1, 2, 3];
  8333. *
  8334. * _.fill(array, 'a');
  8335. * console.log(array);
  8336. * // => ['a', 'a', 'a']
  8337. *
  8338. * _.fill(Array(3), 2);
  8339. * // => [2, 2, 2]
  8340. *
  8341. * _.fill([4, 6, 8, 10], '*', 1, 3);
  8342. * // => [4, '*', '*', 10]
  8343. */
  8344. function fill(array, value, start, end) {
  8345. var length = array == null ? 0 : array.length;
  8346. if (!length) {
  8347. return [];
  8348. }
  8349. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  8350. start = 0;
  8351. end = length;
  8352. }
  8353. return baseFill(array, value, start, end);
  8354. }
  8355. /**
  8356. * This method is like `_.find` except that it returns the index of the first
  8357. * element `predicate` returns truthy for instead of the element itself.
  8358. *
  8359. * @static
  8360. * @memberOf _
  8361. * @since 1.1.0
  8362. * @category Array
  8363. * @param {Array} array The array to inspect.
  8364. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8365. * @param {number} [fromIndex=0] The index to search from.
  8366. * @returns {number} Returns the index of the found element, else `-1`.
  8367. * @example
  8368. *
  8369. * var users = [
  8370. * { 'user': 'barney', 'active': false },
  8371. * { 'user': 'fred', 'active': false },
  8372. * { 'user': 'pebbles', 'active': true }
  8373. * ];
  8374. *
  8375. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  8376. * // => 0
  8377. *
  8378. * // The `_.matches` iteratee shorthand.
  8379. * _.findIndex(users, { 'user': 'fred', 'active': false });
  8380. * // => 1
  8381. *
  8382. * // The `_.matchesProperty` iteratee shorthand.
  8383. * _.findIndex(users, ['active', false]);
  8384. * // => 0
  8385. *
  8386. * // The `_.property` iteratee shorthand.
  8387. * _.findIndex(users, 'active');
  8388. * // => 2
  8389. */
  8390. function findIndex(array, predicate, fromIndex) {
  8391. var length = array == null ? 0 : array.length;
  8392. if (!length) {
  8393. return -1;
  8394. }
  8395. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8396. if (index < 0) {
  8397. index = nativeMax(length + index, 0);
  8398. }
  8399. return baseFindIndex(array, getIteratee(predicate, 3), index);
  8400. }
  8401. /**
  8402. * This method is like `_.findIndex` except that it iterates over elements
  8403. * of `collection` from right to left.
  8404. *
  8405. * @static
  8406. * @memberOf _
  8407. * @since 2.0.0
  8408. * @category Array
  8409. * @param {Array} array The array to inspect.
  8410. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8411. * @param {number} [fromIndex=array.length-1] The index to search from.
  8412. * @returns {number} Returns the index of the found element, else `-1`.
  8413. * @example
  8414. *
  8415. * var users = [
  8416. * { 'user': 'barney', 'active': true },
  8417. * { 'user': 'fred', 'active': false },
  8418. * { 'user': 'pebbles', 'active': false }
  8419. * ];
  8420. *
  8421. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  8422. * // => 2
  8423. *
  8424. * // The `_.matches` iteratee shorthand.
  8425. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  8426. * // => 0
  8427. *
  8428. * // The `_.matchesProperty` iteratee shorthand.
  8429. * _.findLastIndex(users, ['active', false]);
  8430. * // => 2
  8431. *
  8432. * // The `_.property` iteratee shorthand.
  8433. * _.findLastIndex(users, 'active');
  8434. * // => 0
  8435. */
  8436. function findLastIndex(array, predicate, fromIndex) {
  8437. var length = array == null ? 0 : array.length;
  8438. if (!length) {
  8439. return -1;
  8440. }
  8441. var index = length - 1;
  8442. if (fromIndex !== undefined) {
  8443. index = toInteger(fromIndex);
  8444. index = fromIndex < 0
  8445. ? nativeMax(length + index, 0)
  8446. : nativeMin(index, length - 1);
  8447. }
  8448. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  8449. }
  8450. /**
  8451. * Flattens `array` a single level deep.
  8452. *
  8453. * @static
  8454. * @memberOf _
  8455. * @since 0.1.0
  8456. * @category Array
  8457. * @param {Array} array The array to flatten.
  8458. * @returns {Array} Returns the new flattened array.
  8459. * @example
  8460. *
  8461. * _.flatten([1, [2, [3, [4]], 5]]);
  8462. * // => [1, 2, [3, [4]], 5]
  8463. */
  8464. function flatten(array) {
  8465. var length = array == null ? 0 : array.length;
  8466. return length ? baseFlatten(array, 1) : [];
  8467. }
  8468. /**
  8469. * Recursively flattens `array`.
  8470. *
  8471. * @static
  8472. * @memberOf _
  8473. * @since 3.0.0
  8474. * @category Array
  8475. * @param {Array} array The array to flatten.
  8476. * @returns {Array} Returns the new flattened array.
  8477. * @example
  8478. *
  8479. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8480. * // => [1, 2, 3, 4, 5]
  8481. */
  8482. function flattenDeep(array) {
  8483. var length = array == null ? 0 : array.length;
  8484. return length ? baseFlatten(array, INFINITY) : [];
  8485. }
  8486. /**
  8487. * Recursively flatten `array` up to `depth` times.
  8488. *
  8489. * @static
  8490. * @memberOf _
  8491. * @since 4.4.0
  8492. * @category Array
  8493. * @param {Array} array The array to flatten.
  8494. * @param {number} [depth=1] The maximum recursion depth.
  8495. * @returns {Array} Returns the new flattened array.
  8496. * @example
  8497. *
  8498. * var array = [1, [2, [3, [4]], 5]];
  8499. *
  8500. * _.flattenDepth(array, 1);
  8501. * // => [1, 2, [3, [4]], 5]
  8502. *
  8503. * _.flattenDepth(array, 2);
  8504. * // => [1, 2, 3, [4], 5]
  8505. */
  8506. function flattenDepth(array, depth) {
  8507. var length = array == null ? 0 : array.length;
  8508. if (!length) {
  8509. return [];
  8510. }
  8511. depth = depth === undefined ? 1 : toInteger(depth);
  8512. return baseFlatten(array, depth);
  8513. }
  8514. /**
  8515. * The inverse of `_.toPairs`; this method returns an object composed
  8516. * from key-value `pairs`.
  8517. *
  8518. * @static
  8519. * @memberOf _
  8520. * @since 4.0.0
  8521. * @category Array
  8522. * @param {Array} pairs The key-value pairs.
  8523. * @returns {Object} Returns the new object.
  8524. * @example
  8525. *
  8526. * _.fromPairs([['a', 1], ['b', 2]]);
  8527. * // => { 'a': 1, 'b': 2 }
  8528. */
  8529. function fromPairs(pairs) {
  8530. var index = -1,
  8531. length = pairs == null ? 0 : pairs.length,
  8532. result = {};
  8533. while (++index < length) {
  8534. var pair = pairs[index];
  8535. result[pair[0]] = pair[1];
  8536. }
  8537. return result;
  8538. }
  8539. /**
  8540. * Gets the first element of `array`.
  8541. *
  8542. * @static
  8543. * @memberOf _
  8544. * @since 0.1.0
  8545. * @alias first
  8546. * @category Array
  8547. * @param {Array} array The array to query.
  8548. * @returns {*} Returns the first element of `array`.
  8549. * @example
  8550. *
  8551. * _.head([1, 2, 3]);
  8552. * // => 1
  8553. *
  8554. * _.head([]);
  8555. * // => undefined
  8556. */
  8557. function head(array) {
  8558. return (array && array.length) ? array[0] : undefined;
  8559. }
  8560. /**
  8561. * Gets the index at which the first occurrence of `value` is found in `array`
  8562. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8563. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8564. * offset from the end of `array`.
  8565. *
  8566. * @static
  8567. * @memberOf _
  8568. * @since 0.1.0
  8569. * @category Array
  8570. * @param {Array} array The array to inspect.
  8571. * @param {*} value The value to search for.
  8572. * @param {number} [fromIndex=0] The index to search from.
  8573. * @returns {number} Returns the index of the matched value, else `-1`.
  8574. * @example
  8575. *
  8576. * _.indexOf([1, 2, 1, 2], 2);
  8577. * // => 1
  8578. *
  8579. * // Search from the `fromIndex`.
  8580. * _.indexOf([1, 2, 1, 2], 2, 2);
  8581. * // => 3
  8582. */
  8583. function indexOf(array, value, fromIndex) {
  8584. var length = array == null ? 0 : array.length;
  8585. if (!length) {
  8586. return -1;
  8587. }
  8588. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8589. if (index < 0) {
  8590. index = nativeMax(length + index, 0);
  8591. }
  8592. return baseIndexOf(array, value, index);
  8593. }
  8594. /**
  8595. * Gets all but the last element of `array`.
  8596. *
  8597. * @static
  8598. * @memberOf _
  8599. * @since 0.1.0
  8600. * @category Array
  8601. * @param {Array} array The array to query.
  8602. * @returns {Array} Returns the slice of `array`.
  8603. * @example
  8604. *
  8605. * _.initial([1, 2, 3]);
  8606. * // => [1, 2]
  8607. */
  8608. function initial(array) {
  8609. var length = array == null ? 0 : array.length;
  8610. return length ? baseSlice(array, 0, -1) : [];
  8611. }
  8612. /**
  8613. * Creates an array of unique values that are included in all given arrays
  8614. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8615. * for equality comparisons. The order and references of result values are
  8616. * determined by the first array.
  8617. *
  8618. * @static
  8619. * @memberOf _
  8620. * @since 0.1.0
  8621. * @category Array
  8622. * @param {...Array} [arrays] The arrays to inspect.
  8623. * @returns {Array} Returns the new array of intersecting values.
  8624. * @example
  8625. *
  8626. * _.intersection([2, 1], [2, 3]);
  8627. * // => [2]
  8628. */
  8629. var intersection = baseRest(function(arrays) {
  8630. var mapped = arrayMap(arrays, castArrayLikeObject);
  8631. return (mapped.length && mapped[0] === arrays[0])
  8632. ? baseIntersection(mapped)
  8633. : [];
  8634. });
  8635. /**
  8636. * This method is like `_.intersection` except that it accepts `iteratee`
  8637. * which is invoked for each element of each `arrays` to generate the criterion
  8638. * by which they're compared. The order and references of result values are
  8639. * determined by the first array. The iteratee is invoked with one argument:
  8640. * (value).
  8641. *
  8642. * @static
  8643. * @memberOf _
  8644. * @since 4.0.0
  8645. * @category Array
  8646. * @param {...Array} [arrays] The arrays to inspect.
  8647. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8648. * @returns {Array} Returns the new array of intersecting values.
  8649. * @example
  8650. *
  8651. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8652. * // => [2.1]
  8653. *
  8654. * // The `_.property` iteratee shorthand.
  8655. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8656. * // => [{ 'x': 1 }]
  8657. */
  8658. var intersectionBy = baseRest(function(arrays) {
  8659. var iteratee = last(arrays),
  8660. mapped = arrayMap(arrays, castArrayLikeObject);
  8661. if (iteratee === last(mapped)) {
  8662. iteratee = undefined;
  8663. } else {
  8664. mapped.pop();
  8665. }
  8666. return (mapped.length && mapped[0] === arrays[0])
  8667. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8668. : [];
  8669. });
  8670. /**
  8671. * This method is like `_.intersection` except that it accepts `comparator`
  8672. * which is invoked to compare elements of `arrays`. The order and references
  8673. * of result values are determined by the first array. The comparator is
  8674. * invoked with two arguments: (arrVal, othVal).
  8675. *
  8676. * @static
  8677. * @memberOf _
  8678. * @since 4.0.0
  8679. * @category Array
  8680. * @param {...Array} [arrays] The arrays to inspect.
  8681. * @param {Function} [comparator] The comparator invoked per element.
  8682. * @returns {Array} Returns the new array of intersecting values.
  8683. * @example
  8684. *
  8685. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8686. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8687. *
  8688. * _.intersectionWith(objects, others, _.isEqual);
  8689. * // => [{ 'x': 1, 'y': 2 }]
  8690. */
  8691. var intersectionWith = baseRest(function(arrays) {
  8692. var comparator = last(arrays),
  8693. mapped = arrayMap(arrays, castArrayLikeObject);
  8694. comparator = typeof comparator == 'function' ? comparator : undefined;
  8695. if (comparator) {
  8696. mapped.pop();
  8697. }
  8698. return (mapped.length && mapped[0] === arrays[0])
  8699. ? baseIntersection(mapped, undefined, comparator)
  8700. : [];
  8701. });
  8702. /**
  8703. * Converts all elements in `array` into a string separated by `separator`.
  8704. *
  8705. * @static
  8706. * @memberOf _
  8707. * @since 4.0.0
  8708. * @category Array
  8709. * @param {Array} array The array to convert.
  8710. * @param {string} [separator=','] The element separator.
  8711. * @returns {string} Returns the joined string.
  8712. * @example
  8713. *
  8714. * _.join(['a', 'b', 'c'], '~');
  8715. * // => 'a~b~c'
  8716. */
  8717. function join(array, separator) {
  8718. return array == null ? '' : nativeJoin.call(array, separator);
  8719. }
  8720. /**
  8721. * Gets the last element of `array`.
  8722. *
  8723. * @static
  8724. * @memberOf _
  8725. * @since 0.1.0
  8726. * @category Array
  8727. * @param {Array} array The array to query.
  8728. * @returns {*} Returns the last element of `array`.
  8729. * @example
  8730. *
  8731. * _.last([1, 2, 3]);
  8732. * // => 3
  8733. */
  8734. function last(array) {
  8735. var length = array == null ? 0 : array.length;
  8736. return length ? array[length - 1] : undefined;
  8737. }
  8738. /**
  8739. * This method is like `_.indexOf` except that it iterates over elements of
  8740. * `array` from right to left.
  8741. *
  8742. * @static
  8743. * @memberOf _
  8744. * @since 0.1.0
  8745. * @category Array
  8746. * @param {Array} array The array to inspect.
  8747. * @param {*} value The value to search for.
  8748. * @param {number} [fromIndex=array.length-1] The index to search from.
  8749. * @returns {number} Returns the index of the matched value, else `-1`.
  8750. * @example
  8751. *
  8752. * _.lastIndexOf([1, 2, 1, 2], 2);
  8753. * // => 3
  8754. *
  8755. * // Search from the `fromIndex`.
  8756. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8757. * // => 1
  8758. */
  8759. function lastIndexOf(array, value, fromIndex) {
  8760. var length = array == null ? 0 : array.length;
  8761. if (!length) {
  8762. return -1;
  8763. }
  8764. var index = length;
  8765. if (fromIndex !== undefined) {
  8766. index = toInteger(fromIndex);
  8767. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8768. }
  8769. return value === value
  8770. ? strictLastIndexOf(array, value, index)
  8771. : baseFindIndex(array, baseIsNaN, index, true);
  8772. }
  8773. /**
  8774. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8775. * element from the end is returned.
  8776. *
  8777. * @static
  8778. * @memberOf _
  8779. * @since 4.11.0
  8780. * @category Array
  8781. * @param {Array} array The array to query.
  8782. * @param {number} [n=0] The index of the element to return.
  8783. * @returns {*} Returns the nth element of `array`.
  8784. * @example
  8785. *
  8786. * var array = ['a', 'b', 'c', 'd'];
  8787. *
  8788. * _.nth(array, 1);
  8789. * // => 'b'
  8790. *
  8791. * _.nth(array, -2);
  8792. * // => 'c';
  8793. */
  8794. function nth(array, n) {
  8795. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8796. }
  8797. /**
  8798. * Removes all given values from `array` using
  8799. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8800. * for equality comparisons.
  8801. *
  8802. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8803. * to remove elements from an array by predicate.
  8804. *
  8805. * @static
  8806. * @memberOf _
  8807. * @since 2.0.0
  8808. * @category Array
  8809. * @param {Array} array The array to modify.
  8810. * @param {...*} [values] The values to remove.
  8811. * @returns {Array} Returns `array`.
  8812. * @example
  8813. *
  8814. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8815. *
  8816. * _.pull(array, 'a', 'c');
  8817. * console.log(array);
  8818. * // => ['b', 'b']
  8819. */
  8820. var pull = baseRest(pullAll);
  8821. /**
  8822. * This method is like `_.pull` except that it accepts an array of values to remove.
  8823. *
  8824. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8825. *
  8826. * @static
  8827. * @memberOf _
  8828. * @since 4.0.0
  8829. * @category Array
  8830. * @param {Array} array The array to modify.
  8831. * @param {Array} values The values to remove.
  8832. * @returns {Array} Returns `array`.
  8833. * @example
  8834. *
  8835. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8836. *
  8837. * _.pullAll(array, ['a', 'c']);
  8838. * console.log(array);
  8839. * // => ['b', 'b']
  8840. */
  8841. function pullAll(array, values) {
  8842. return (array && array.length && values && values.length)
  8843. ? basePullAll(array, values)
  8844. : array;
  8845. }
  8846. /**
  8847. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8848. * invoked for each element of `array` and `values` to generate the criterion
  8849. * by which they're compared. The iteratee is invoked with one argument: (value).
  8850. *
  8851. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8852. *
  8853. * @static
  8854. * @memberOf _
  8855. * @since 4.0.0
  8856. * @category Array
  8857. * @param {Array} array The array to modify.
  8858. * @param {Array} values The values to remove.
  8859. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8860. * @returns {Array} Returns `array`.
  8861. * @example
  8862. *
  8863. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8864. *
  8865. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8866. * console.log(array);
  8867. * // => [{ 'x': 2 }]
  8868. */
  8869. function pullAllBy(array, values, iteratee) {
  8870. return (array && array.length && values && values.length)
  8871. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8872. : array;
  8873. }
  8874. /**
  8875. * This method is like `_.pullAll` except that it accepts `comparator` which
  8876. * is invoked to compare elements of `array` to `values`. The comparator is
  8877. * invoked with two arguments: (arrVal, othVal).
  8878. *
  8879. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8880. *
  8881. * @static
  8882. * @memberOf _
  8883. * @since 4.6.0
  8884. * @category Array
  8885. * @param {Array} array The array to modify.
  8886. * @param {Array} values The values to remove.
  8887. * @param {Function} [comparator] The comparator invoked per element.
  8888. * @returns {Array} Returns `array`.
  8889. * @example
  8890. *
  8891. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8892. *
  8893. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8894. * console.log(array);
  8895. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8896. */
  8897. function pullAllWith(array, values, comparator) {
  8898. return (array && array.length && values && values.length)
  8899. ? basePullAll(array, values, undefined, comparator)
  8900. : array;
  8901. }
  8902. /**
  8903. * Removes elements from `array` corresponding to `indexes` and returns an
  8904. * array of removed elements.
  8905. *
  8906. * **Note:** Unlike `_.at`, this method mutates `array`.
  8907. *
  8908. * @static
  8909. * @memberOf _
  8910. * @since 3.0.0
  8911. * @category Array
  8912. * @param {Array} array The array to modify.
  8913. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8914. * @returns {Array} Returns the new array of removed elements.
  8915. * @example
  8916. *
  8917. * var array = ['a', 'b', 'c', 'd'];
  8918. * var pulled = _.pullAt(array, [1, 3]);
  8919. *
  8920. * console.log(array);
  8921. * // => ['a', 'c']
  8922. *
  8923. * console.log(pulled);
  8924. * // => ['b', 'd']
  8925. */
  8926. var pullAt = flatRest(function(array, indexes) {
  8927. var length = array == null ? 0 : array.length,
  8928. result = baseAt(array, indexes);
  8929. basePullAt(array, arrayMap(indexes, function(index) {
  8930. return isIndex(index, length) ? +index : index;
  8931. }).sort(compareAscending));
  8932. return result;
  8933. });
  8934. /**
  8935. * Removes all elements from `array` that `predicate` returns truthy for
  8936. * and returns an array of the removed elements. The predicate is invoked
  8937. * with three arguments: (value, index, array).
  8938. *
  8939. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8940. * to pull elements from an array by value.
  8941. *
  8942. * @static
  8943. * @memberOf _
  8944. * @since 2.0.0
  8945. * @category Array
  8946. * @param {Array} array The array to modify.
  8947. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8948. * @returns {Array} Returns the new array of removed elements.
  8949. * @example
  8950. *
  8951. * var array = [1, 2, 3, 4];
  8952. * var evens = _.remove(array, function(n) {
  8953. * return n % 2 == 0;
  8954. * });
  8955. *
  8956. * console.log(array);
  8957. * // => [1, 3]
  8958. *
  8959. * console.log(evens);
  8960. * // => [2, 4]
  8961. */
  8962. function remove(array, predicate) {
  8963. var result = [];
  8964. if (!(array && array.length)) {
  8965. return result;
  8966. }
  8967. var index = -1,
  8968. indexes = [],
  8969. length = array.length;
  8970. predicate = getIteratee(predicate, 3);
  8971. while (++index < length) {
  8972. var value = array[index];
  8973. if (predicate(value, index, array)) {
  8974. result.push(value);
  8975. indexes.push(index);
  8976. }
  8977. }
  8978. basePullAt(array, indexes);
  8979. return result;
  8980. }
  8981. /**
  8982. * Reverses `array` so that the first element becomes the last, the second
  8983. * element becomes the second to last, and so on.
  8984. *
  8985. * **Note:** This method mutates `array` and is based on
  8986. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8987. *
  8988. * @static
  8989. * @memberOf _
  8990. * @since 4.0.0
  8991. * @category Array
  8992. * @param {Array} array The array to modify.
  8993. * @returns {Array} Returns `array`.
  8994. * @example
  8995. *
  8996. * var array = [1, 2, 3];
  8997. *
  8998. * _.reverse(array);
  8999. * // => [3, 2, 1]
  9000. *
  9001. * console.log(array);
  9002. * // => [3, 2, 1]
  9003. */
  9004. function reverse(array) {
  9005. return array == null ? array : nativeReverse.call(array);
  9006. }
  9007. /**
  9008. * Creates a slice of `array` from `start` up to, but not including, `end`.
  9009. *
  9010. * **Note:** This method is used instead of
  9011. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  9012. * returned.
  9013. *
  9014. * @static
  9015. * @memberOf _
  9016. * @since 3.0.0
  9017. * @category Array
  9018. * @param {Array} array The array to slice.
  9019. * @param {number} [start=0] The start position.
  9020. * @param {number} [end=array.length] The end position.
  9021. * @returns {Array} Returns the slice of `array`.
  9022. */
  9023. function slice(array, start, end) {
  9024. var length = array == null ? 0 : array.length;
  9025. if (!length) {
  9026. return [];
  9027. }
  9028. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  9029. start = 0;
  9030. end = length;
  9031. }
  9032. else {
  9033. start = start == null ? 0 : toInteger(start);
  9034. end = end === undefined ? length : toInteger(end);
  9035. }
  9036. return baseSlice(array, start, end);
  9037. }
  9038. /**
  9039. * Uses a binary search to determine the lowest index at which `value`
  9040. * should be inserted into `array` in order to maintain its sort order.
  9041. *
  9042. * @static
  9043. * @memberOf _
  9044. * @since 0.1.0
  9045. * @category Array
  9046. * @param {Array} array The sorted array to inspect.
  9047. * @param {*} value The value to evaluate.
  9048. * @returns {number} Returns the index at which `value` should be inserted
  9049. * into `array`.
  9050. * @example
  9051. *
  9052. * _.sortedIndex([30, 50], 40);
  9053. * // => 1
  9054. */
  9055. function sortedIndex(array, value) {
  9056. return baseSortedIndex(array, value);
  9057. }
  9058. /**
  9059. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  9060. * which is invoked for `value` and each element of `array` to compute their
  9061. * sort ranking. The iteratee is invoked with one argument: (value).
  9062. *
  9063. * @static
  9064. * @memberOf _
  9065. * @since 4.0.0
  9066. * @category Array
  9067. * @param {Array} array The sorted array to inspect.
  9068. * @param {*} value The value to evaluate.
  9069. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9070. * @returns {number} Returns the index at which `value` should be inserted
  9071. * into `array`.
  9072. * @example
  9073. *
  9074. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  9075. *
  9076. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  9077. * // => 0
  9078. *
  9079. * // The `_.property` iteratee shorthand.
  9080. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  9081. * // => 0
  9082. */
  9083. function sortedIndexBy(array, value, iteratee) {
  9084. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  9085. }
  9086. /**
  9087. * This method is like `_.indexOf` except that it performs a binary
  9088. * search on a sorted `array`.
  9089. *
  9090. * @static
  9091. * @memberOf _
  9092. * @since 4.0.0
  9093. * @category Array
  9094. * @param {Array} array The array to inspect.
  9095. * @param {*} value The value to search for.
  9096. * @returns {number} Returns the index of the matched value, else `-1`.
  9097. * @example
  9098. *
  9099. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  9100. * // => 1
  9101. */
  9102. function sortedIndexOf(array, value) {
  9103. var length = array == null ? 0 : array.length;
  9104. if (length) {
  9105. var index = baseSortedIndex(array, value);
  9106. if (index < length && eq(array[index], value)) {
  9107. return index;
  9108. }
  9109. }
  9110. return -1;
  9111. }
  9112. /**
  9113. * This method is like `_.sortedIndex` except that it returns the highest
  9114. * index at which `value` should be inserted into `array` in order to
  9115. * maintain its sort order.
  9116. *
  9117. * @static
  9118. * @memberOf _
  9119. * @since 3.0.0
  9120. * @category Array
  9121. * @param {Array} array The sorted array to inspect.
  9122. * @param {*} value The value to evaluate.
  9123. * @returns {number} Returns the index at which `value` should be inserted
  9124. * into `array`.
  9125. * @example
  9126. *
  9127. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  9128. * // => 4
  9129. */
  9130. function sortedLastIndex(array, value) {
  9131. return baseSortedIndex(array, value, true);
  9132. }
  9133. /**
  9134. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  9135. * which is invoked for `value` and each element of `array` to compute their
  9136. * sort ranking. The iteratee is invoked with one argument: (value).
  9137. *
  9138. * @static
  9139. * @memberOf _
  9140. * @since 4.0.0
  9141. * @category Array
  9142. * @param {Array} array The sorted array to inspect.
  9143. * @param {*} value The value to evaluate.
  9144. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9145. * @returns {number} Returns the index at which `value` should be inserted
  9146. * into `array`.
  9147. * @example
  9148. *
  9149. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  9150. *
  9151. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  9152. * // => 1
  9153. *
  9154. * // The `_.property` iteratee shorthand.
  9155. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  9156. * // => 1
  9157. */
  9158. function sortedLastIndexBy(array, value, iteratee) {
  9159. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  9160. }
  9161. /**
  9162. * This method is like `_.lastIndexOf` except that it performs a binary
  9163. * search on a sorted `array`.
  9164. *
  9165. * @static
  9166. * @memberOf _
  9167. * @since 4.0.0
  9168. * @category Array
  9169. * @param {Array} array The array to inspect.
  9170. * @param {*} value The value to search for.
  9171. * @returns {number} Returns the index of the matched value, else `-1`.
  9172. * @example
  9173. *
  9174. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  9175. * // => 3
  9176. */
  9177. function sortedLastIndexOf(array, value) {
  9178. var length = array == null ? 0 : array.length;
  9179. if (length) {
  9180. var index = baseSortedIndex(array, value, true) - 1;
  9181. if (eq(array[index], value)) {
  9182. return index;
  9183. }
  9184. }
  9185. return -1;
  9186. }
  9187. /**
  9188. * This method is like `_.uniq` except that it's designed and optimized
  9189. * for sorted arrays.
  9190. *
  9191. * @static
  9192. * @memberOf _
  9193. * @since 4.0.0
  9194. * @category Array
  9195. * @param {Array} array The array to inspect.
  9196. * @returns {Array} Returns the new duplicate free array.
  9197. * @example
  9198. *
  9199. * _.sortedUniq([1, 1, 2]);
  9200. * // => [1, 2]
  9201. */
  9202. function sortedUniq(array) {
  9203. return (array && array.length)
  9204. ? baseSortedUniq(array)
  9205. : [];
  9206. }
  9207. /**
  9208. * This method is like `_.uniqBy` except that it's designed and optimized
  9209. * for sorted arrays.
  9210. *
  9211. * @static
  9212. * @memberOf _
  9213. * @since 4.0.0
  9214. * @category Array
  9215. * @param {Array} array The array to inspect.
  9216. * @param {Function} [iteratee] The iteratee invoked per element.
  9217. * @returns {Array} Returns the new duplicate free array.
  9218. * @example
  9219. *
  9220. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  9221. * // => [1.1, 2.3]
  9222. */
  9223. function sortedUniqBy(array, iteratee) {
  9224. return (array && array.length)
  9225. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  9226. : [];
  9227. }
  9228. /**
  9229. * Gets all but the first element of `array`.
  9230. *
  9231. * @static
  9232. * @memberOf _
  9233. * @since 4.0.0
  9234. * @category Array
  9235. * @param {Array} array The array to query.
  9236. * @returns {Array} Returns the slice of `array`.
  9237. * @example
  9238. *
  9239. * _.tail([1, 2, 3]);
  9240. * // => [2, 3]
  9241. */
  9242. function tail(array) {
  9243. var length = array == null ? 0 : array.length;
  9244. return length ? baseSlice(array, 1, length) : [];
  9245. }
  9246. /**
  9247. * Creates a slice of `array` with `n` elements taken from the beginning.
  9248. *
  9249. * @static
  9250. * @memberOf _
  9251. * @since 0.1.0
  9252. * @category Array
  9253. * @param {Array} array The array to query.
  9254. * @param {number} [n=1] The number of elements to take.
  9255. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9256. * @returns {Array} Returns the slice of `array`.
  9257. * @example
  9258. *
  9259. * _.take([1, 2, 3]);
  9260. * // => [1]
  9261. *
  9262. * _.take([1, 2, 3], 2);
  9263. * // => [1, 2]
  9264. *
  9265. * _.take([1, 2, 3], 5);
  9266. * // => [1, 2, 3]
  9267. *
  9268. * _.take([1, 2, 3], 0);
  9269. * // => []
  9270. */
  9271. function take(array, n, guard) {
  9272. if (!(array && array.length)) {
  9273. return [];
  9274. }
  9275. n = (guard || n === undefined) ? 1 : toInteger(n);
  9276. return baseSlice(array, 0, n < 0 ? 0 : n);
  9277. }
  9278. /**
  9279. * Creates a slice of `array` with `n` elements taken from the end.
  9280. *
  9281. * @static
  9282. * @memberOf _
  9283. * @since 3.0.0
  9284. * @category Array
  9285. * @param {Array} array The array to query.
  9286. * @param {number} [n=1] The number of elements to take.
  9287. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9288. * @returns {Array} Returns the slice of `array`.
  9289. * @example
  9290. *
  9291. * _.takeRight([1, 2, 3]);
  9292. * // => [3]
  9293. *
  9294. * _.takeRight([1, 2, 3], 2);
  9295. * // => [2, 3]
  9296. *
  9297. * _.takeRight([1, 2, 3], 5);
  9298. * // => [1, 2, 3]
  9299. *
  9300. * _.takeRight([1, 2, 3], 0);
  9301. * // => []
  9302. */
  9303. function takeRight(array, n, guard) {
  9304. var length = array == null ? 0 : array.length;
  9305. if (!length) {
  9306. return [];
  9307. }
  9308. n = (guard || n === undefined) ? 1 : toInteger(n);
  9309. n = length - n;
  9310. return baseSlice(array, n < 0 ? 0 : n, length);
  9311. }
  9312. /**
  9313. * Creates a slice of `array` with elements taken from the end. Elements are
  9314. * taken until `predicate` returns falsey. The predicate is invoked with
  9315. * three arguments: (value, index, array).
  9316. *
  9317. * @static
  9318. * @memberOf _
  9319. * @since 3.0.0
  9320. * @category Array
  9321. * @param {Array} array The array to query.
  9322. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9323. * @returns {Array} Returns the slice of `array`.
  9324. * @example
  9325. *
  9326. * var users = [
  9327. * { 'user': 'barney', 'active': true },
  9328. * { 'user': 'fred', 'active': false },
  9329. * { 'user': 'pebbles', 'active': false }
  9330. * ];
  9331. *
  9332. * _.takeRightWhile(users, function(o) { return !o.active; });
  9333. * // => objects for ['fred', 'pebbles']
  9334. *
  9335. * // The `_.matches` iteratee shorthand.
  9336. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  9337. * // => objects for ['pebbles']
  9338. *
  9339. * // The `_.matchesProperty` iteratee shorthand.
  9340. * _.takeRightWhile(users, ['active', false]);
  9341. * // => objects for ['fred', 'pebbles']
  9342. *
  9343. * // The `_.property` iteratee shorthand.
  9344. * _.takeRightWhile(users, 'active');
  9345. * // => []
  9346. */
  9347. function takeRightWhile(array, predicate) {
  9348. return (array && array.length)
  9349. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  9350. : [];
  9351. }
  9352. /**
  9353. * Creates a slice of `array` with elements taken from the beginning. Elements
  9354. * are taken until `predicate` returns falsey. The predicate is invoked with
  9355. * three arguments: (value, index, array).
  9356. *
  9357. * @static
  9358. * @memberOf _
  9359. * @since 3.0.0
  9360. * @category Array
  9361. * @param {Array} array The array to query.
  9362. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9363. * @returns {Array} Returns the slice of `array`.
  9364. * @example
  9365. *
  9366. * var users = [
  9367. * { 'user': 'barney', 'active': false },
  9368. * { 'user': 'fred', 'active': false },
  9369. * { 'user': 'pebbles', 'active': true }
  9370. * ];
  9371. *
  9372. * _.takeWhile(users, function(o) { return !o.active; });
  9373. * // => objects for ['barney', 'fred']
  9374. *
  9375. * // The `_.matches` iteratee shorthand.
  9376. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  9377. * // => objects for ['barney']
  9378. *
  9379. * // The `_.matchesProperty` iteratee shorthand.
  9380. * _.takeWhile(users, ['active', false]);
  9381. * // => objects for ['barney', 'fred']
  9382. *
  9383. * // The `_.property` iteratee shorthand.
  9384. * _.takeWhile(users, 'active');
  9385. * // => []
  9386. */
  9387. function takeWhile(array, predicate) {
  9388. return (array && array.length)
  9389. ? baseWhile(array, getIteratee(predicate, 3))
  9390. : [];
  9391. }
  9392. /**
  9393. * Creates an array of unique values, in order, from all given arrays using
  9394. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9395. * for equality comparisons.
  9396. *
  9397. * @static
  9398. * @memberOf _
  9399. * @since 0.1.0
  9400. * @category Array
  9401. * @param {...Array} [arrays] The arrays to inspect.
  9402. * @returns {Array} Returns the new array of combined values.
  9403. * @example
  9404. *
  9405. * _.union([2], [1, 2]);
  9406. * // => [2, 1]
  9407. */
  9408. var union = baseRest(function(arrays) {
  9409. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  9410. });
  9411. /**
  9412. * This method is like `_.union` except that it accepts `iteratee` which is
  9413. * invoked for each element of each `arrays` to generate the criterion by
  9414. * which uniqueness is computed. Result values are chosen from the first
  9415. * array in which the value occurs. The iteratee is invoked with one argument:
  9416. * (value).
  9417. *
  9418. * @static
  9419. * @memberOf _
  9420. * @since 4.0.0
  9421. * @category Array
  9422. * @param {...Array} [arrays] The arrays to inspect.
  9423. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9424. * @returns {Array} Returns the new array of combined values.
  9425. * @example
  9426. *
  9427. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  9428. * // => [2.1, 1.2]
  9429. *
  9430. * // The `_.property` iteratee shorthand.
  9431. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9432. * // => [{ 'x': 1 }, { 'x': 2 }]
  9433. */
  9434. var unionBy = baseRest(function(arrays) {
  9435. var iteratee = last(arrays);
  9436. if (isArrayLikeObject(iteratee)) {
  9437. iteratee = undefined;
  9438. }
  9439. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  9440. });
  9441. /**
  9442. * This method is like `_.union` except that it accepts `comparator` which
  9443. * is invoked to compare elements of `arrays`. Result values are chosen from
  9444. * the first array in which the value occurs. The comparator is invoked
  9445. * with two arguments: (arrVal, othVal).
  9446. *
  9447. * @static
  9448. * @memberOf _
  9449. * @since 4.0.0
  9450. * @category Array
  9451. * @param {...Array} [arrays] The arrays to inspect.
  9452. * @param {Function} [comparator] The comparator invoked per element.
  9453. * @returns {Array} Returns the new array of combined values.
  9454. * @example
  9455. *
  9456. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9457. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9458. *
  9459. * _.unionWith(objects, others, _.isEqual);
  9460. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9461. */
  9462. var unionWith = baseRest(function(arrays) {
  9463. var comparator = last(arrays);
  9464. comparator = typeof comparator == 'function' ? comparator : undefined;
  9465. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9466. });
  9467. /**
  9468. * Creates a duplicate-free version of an array, using
  9469. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9470. * for equality comparisons, in which only the first occurrence of each element
  9471. * is kept. The order of result values is determined by the order they occur
  9472. * in the array.
  9473. *
  9474. * @static
  9475. * @memberOf _
  9476. * @since 0.1.0
  9477. * @category Array
  9478. * @param {Array} array The array to inspect.
  9479. * @returns {Array} Returns the new duplicate free array.
  9480. * @example
  9481. *
  9482. * _.uniq([2, 1, 2]);
  9483. * // => [2, 1]
  9484. */
  9485. function uniq(array) {
  9486. return (array && array.length) ? baseUniq(array) : [];
  9487. }
  9488. /**
  9489. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9490. * invoked for each element in `array` to generate the criterion by which
  9491. * uniqueness is computed. The order of result values is determined by the
  9492. * order they occur in the array. The iteratee is invoked with one argument:
  9493. * (value).
  9494. *
  9495. * @static
  9496. * @memberOf _
  9497. * @since 4.0.0
  9498. * @category Array
  9499. * @param {Array} array The array to inspect.
  9500. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9501. * @returns {Array} Returns the new duplicate free array.
  9502. * @example
  9503. *
  9504. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9505. * // => [2.1, 1.2]
  9506. *
  9507. * // The `_.property` iteratee shorthand.
  9508. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9509. * // => [{ 'x': 1 }, { 'x': 2 }]
  9510. */
  9511. function uniqBy(array, iteratee) {
  9512. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9513. }
  9514. /**
  9515. * This method is like `_.uniq` except that it accepts `comparator` which
  9516. * is invoked to compare elements of `array`. The order of result values is
  9517. * determined by the order they occur in the array.The comparator is invoked
  9518. * with two arguments: (arrVal, othVal).
  9519. *
  9520. * @static
  9521. * @memberOf _
  9522. * @since 4.0.0
  9523. * @category Array
  9524. * @param {Array} array The array to inspect.
  9525. * @param {Function} [comparator] The comparator invoked per element.
  9526. * @returns {Array} Returns the new duplicate free array.
  9527. * @example
  9528. *
  9529. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9530. *
  9531. * _.uniqWith(objects, _.isEqual);
  9532. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9533. */
  9534. function uniqWith(array, comparator) {
  9535. comparator = typeof comparator == 'function' ? comparator : undefined;
  9536. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9537. }
  9538. /**
  9539. * This method is like `_.zip` except that it accepts an array of grouped
  9540. * elements and creates an array regrouping the elements to their pre-zip
  9541. * configuration.
  9542. *
  9543. * @static
  9544. * @memberOf _
  9545. * @since 1.2.0
  9546. * @category Array
  9547. * @param {Array} array The array of grouped elements to process.
  9548. * @returns {Array} Returns the new array of regrouped elements.
  9549. * @example
  9550. *
  9551. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9552. * // => [['a', 1, true], ['b', 2, false]]
  9553. *
  9554. * _.unzip(zipped);
  9555. * // => [['a', 'b'], [1, 2], [true, false]]
  9556. */
  9557. function unzip(array) {
  9558. if (!(array && array.length)) {
  9559. return [];
  9560. }
  9561. var length = 0;
  9562. array = arrayFilter(array, function(group) {
  9563. if (isArrayLikeObject(group)) {
  9564. length = nativeMax(group.length, length);
  9565. return true;
  9566. }
  9567. });
  9568. return baseTimes(length, function(index) {
  9569. return arrayMap(array, baseProperty(index));
  9570. });
  9571. }
  9572. /**
  9573. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9574. * how regrouped values should be combined. The iteratee is invoked with the
  9575. * elements of each group: (...group).
  9576. *
  9577. * @static
  9578. * @memberOf _
  9579. * @since 3.8.0
  9580. * @category Array
  9581. * @param {Array} array The array of grouped elements to process.
  9582. * @param {Function} [iteratee=_.identity] The function to combine
  9583. * regrouped values.
  9584. * @returns {Array} Returns the new array of regrouped elements.
  9585. * @example
  9586. *
  9587. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9588. * // => [[1, 10, 100], [2, 20, 200]]
  9589. *
  9590. * _.unzipWith(zipped, _.add);
  9591. * // => [3, 30, 300]
  9592. */
  9593. function unzipWith(array, iteratee) {
  9594. if (!(array && array.length)) {
  9595. return [];
  9596. }
  9597. var result = unzip(array);
  9598. if (iteratee == null) {
  9599. return result;
  9600. }
  9601. return arrayMap(result, function(group) {
  9602. return apply(iteratee, undefined, group);
  9603. });
  9604. }
  9605. /**
  9606. * Creates an array excluding all given values using
  9607. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9608. * for equality comparisons.
  9609. *
  9610. * **Note:** Unlike `_.pull`, this method returns a new array.
  9611. *
  9612. * @static
  9613. * @memberOf _
  9614. * @since 0.1.0
  9615. * @category Array
  9616. * @param {Array} array The array to inspect.
  9617. * @param {...*} [values] The values to exclude.
  9618. * @returns {Array} Returns the new array of filtered values.
  9619. * @see _.difference, _.xor
  9620. * @example
  9621. *
  9622. * _.without([2, 1, 2, 3], 1, 2);
  9623. * // => [3]
  9624. */
  9625. var without = baseRest(function(array, values) {
  9626. return isArrayLikeObject(array)
  9627. ? baseDifference(array, values)
  9628. : [];
  9629. });
  9630. /**
  9631. * Creates an array of unique values that is the
  9632. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9633. * of the given arrays. The order of result values is determined by the order
  9634. * they occur in the arrays.
  9635. *
  9636. * @static
  9637. * @memberOf _
  9638. * @since 2.4.0
  9639. * @category Array
  9640. * @param {...Array} [arrays] The arrays to inspect.
  9641. * @returns {Array} Returns the new array of filtered values.
  9642. * @see _.difference, _.without
  9643. * @example
  9644. *
  9645. * _.xor([2, 1], [2, 3]);
  9646. * // => [1, 3]
  9647. */
  9648. var xor = baseRest(function(arrays) {
  9649. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9650. });
  9651. /**
  9652. * This method is like `_.xor` except that it accepts `iteratee` which is
  9653. * invoked for each element of each `arrays` to generate the criterion by
  9654. * which by which they're compared. The order of result values is determined
  9655. * by the order they occur in the arrays. The iteratee is invoked with one
  9656. * argument: (value).
  9657. *
  9658. * @static
  9659. * @memberOf _
  9660. * @since 4.0.0
  9661. * @category Array
  9662. * @param {...Array} [arrays] The arrays to inspect.
  9663. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9664. * @returns {Array} Returns the new array of filtered values.
  9665. * @example
  9666. *
  9667. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9668. * // => [1.2, 3.4]
  9669. *
  9670. * // The `_.property` iteratee shorthand.
  9671. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9672. * // => [{ 'x': 2 }]
  9673. */
  9674. var xorBy = baseRest(function(arrays) {
  9675. var iteratee = last(arrays);
  9676. if (isArrayLikeObject(iteratee)) {
  9677. iteratee = undefined;
  9678. }
  9679. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9680. });
  9681. /**
  9682. * This method is like `_.xor` except that it accepts `comparator` which is
  9683. * invoked to compare elements of `arrays`. The order of result values is
  9684. * determined by the order they occur in the arrays. The comparator is invoked
  9685. * with two arguments: (arrVal, othVal).
  9686. *
  9687. * @static
  9688. * @memberOf _
  9689. * @since 4.0.0
  9690. * @category Array
  9691. * @param {...Array} [arrays] The arrays to inspect.
  9692. * @param {Function} [comparator] The comparator invoked per element.
  9693. * @returns {Array} Returns the new array of filtered values.
  9694. * @example
  9695. *
  9696. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9697. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9698. *
  9699. * _.xorWith(objects, others, _.isEqual);
  9700. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9701. */
  9702. var xorWith = baseRest(function(arrays) {
  9703. var comparator = last(arrays);
  9704. comparator = typeof comparator == 'function' ? comparator : undefined;
  9705. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9706. });
  9707. /**
  9708. * Creates an array of grouped elements, the first of which contains the
  9709. * first elements of the given arrays, the second of which contains the
  9710. * second elements of the given arrays, and so on.
  9711. *
  9712. * @static
  9713. * @memberOf _
  9714. * @since 0.1.0
  9715. * @category Array
  9716. * @param {...Array} [arrays] The arrays to process.
  9717. * @returns {Array} Returns the new array of grouped elements.
  9718. * @example
  9719. *
  9720. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9721. * // => [['a', 1, true], ['b', 2, false]]
  9722. */
  9723. var zip = baseRest(unzip);
  9724. /**
  9725. * This method is like `_.fromPairs` except that it accepts two arrays,
  9726. * one of property identifiers and one of corresponding values.
  9727. *
  9728. * @static
  9729. * @memberOf _
  9730. * @since 0.4.0
  9731. * @category Array
  9732. * @param {Array} [props=[]] The property identifiers.
  9733. * @param {Array} [values=[]] The property values.
  9734. * @returns {Object} Returns the new object.
  9735. * @example
  9736. *
  9737. * _.zipObject(['a', 'b'], [1, 2]);
  9738. * // => { 'a': 1, 'b': 2 }
  9739. */
  9740. function zipObject(props, values) {
  9741. return baseZipObject(props || [], values || [], assignValue);
  9742. }
  9743. /**
  9744. * This method is like `_.zipObject` except that it supports property paths.
  9745. *
  9746. * @static
  9747. * @memberOf _
  9748. * @since 4.1.0
  9749. * @category Array
  9750. * @param {Array} [props=[]] The property identifiers.
  9751. * @param {Array} [values=[]] The property values.
  9752. * @returns {Object} Returns the new object.
  9753. * @example
  9754. *
  9755. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9756. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9757. */
  9758. function zipObjectDeep(props, values) {
  9759. return baseZipObject(props || [], values || [], baseSet);
  9760. }
  9761. /**
  9762. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9763. * how grouped values should be combined. The iteratee is invoked with the
  9764. * elements of each group: (...group).
  9765. *
  9766. * @static
  9767. * @memberOf _
  9768. * @since 3.8.0
  9769. * @category Array
  9770. * @param {...Array} [arrays] The arrays to process.
  9771. * @param {Function} [iteratee=_.identity] The function to combine
  9772. * grouped values.
  9773. * @returns {Array} Returns the new array of grouped elements.
  9774. * @example
  9775. *
  9776. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9777. * return a + b + c;
  9778. * });
  9779. * // => [111, 222]
  9780. */
  9781. var zipWith = baseRest(function(arrays) {
  9782. var length = arrays.length,
  9783. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9784. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9785. return unzipWith(arrays, iteratee);
  9786. });
  9787. /*------------------------------------------------------------------------*/
  9788. /**
  9789. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9790. * chain sequences enabled. The result of such sequences must be unwrapped
  9791. * with `_#value`.
  9792. *
  9793. * @static
  9794. * @memberOf _
  9795. * @since 1.3.0
  9796. * @category Seq
  9797. * @param {*} value The value to wrap.
  9798. * @returns {Object} Returns the new `lodash` wrapper instance.
  9799. * @example
  9800. *
  9801. * var users = [
  9802. * { 'user': 'barney', 'age': 36 },
  9803. * { 'user': 'fred', 'age': 40 },
  9804. * { 'user': 'pebbles', 'age': 1 }
  9805. * ];
  9806. *
  9807. * var youngest = _
  9808. * .chain(users)
  9809. * .sortBy('age')
  9810. * .map(function(o) {
  9811. * return o.user + ' is ' + o.age;
  9812. * })
  9813. * .head()
  9814. * .value();
  9815. * // => 'pebbles is 1'
  9816. */
  9817. function chain(value) {
  9818. var result = lodash(value);
  9819. result.__chain__ = true;
  9820. return result;
  9821. }
  9822. /**
  9823. * This method invokes `interceptor` and returns `value`. The interceptor
  9824. * is invoked with one argument; (value). The purpose of this method is to
  9825. * "tap into" a method chain sequence in order to modify intermediate results.
  9826. *
  9827. * @static
  9828. * @memberOf _
  9829. * @since 0.1.0
  9830. * @category Seq
  9831. * @param {*} value The value to provide to `interceptor`.
  9832. * @param {Function} interceptor The function to invoke.
  9833. * @returns {*} Returns `value`.
  9834. * @example
  9835. *
  9836. * _([1, 2, 3])
  9837. * .tap(function(array) {
  9838. * // Mutate input array.
  9839. * array.pop();
  9840. * })
  9841. * .reverse()
  9842. * .value();
  9843. * // => [2, 1]
  9844. */
  9845. function tap(value, interceptor) {
  9846. interceptor(value);
  9847. return value;
  9848. }
  9849. /**
  9850. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9851. * The purpose of this method is to "pass thru" values replacing intermediate
  9852. * results in a method chain sequence.
  9853. *
  9854. * @static
  9855. * @memberOf _
  9856. * @since 3.0.0
  9857. * @category Seq
  9858. * @param {*} value The value to provide to `interceptor`.
  9859. * @param {Function} interceptor The function to invoke.
  9860. * @returns {*} Returns the result of `interceptor`.
  9861. * @example
  9862. *
  9863. * _(' abc ')
  9864. * .chain()
  9865. * .trim()
  9866. * .thru(function(value) {
  9867. * return [value];
  9868. * })
  9869. * .value();
  9870. * // => ['abc']
  9871. */
  9872. function thru(value, interceptor) {
  9873. return interceptor(value);
  9874. }
  9875. /**
  9876. * This method is the wrapper version of `_.at`.
  9877. *
  9878. * @name at
  9879. * @memberOf _
  9880. * @since 1.0.0
  9881. * @category Seq
  9882. * @param {...(string|string[])} [paths] The property paths to pick.
  9883. * @returns {Object} Returns the new `lodash` wrapper instance.
  9884. * @example
  9885. *
  9886. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9887. *
  9888. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9889. * // => [3, 4]
  9890. */
  9891. var wrapperAt = flatRest(function(paths) {
  9892. var length = paths.length,
  9893. start = length ? paths[0] : 0,
  9894. value = this.__wrapped__,
  9895. interceptor = function(object) { return baseAt(object, paths); };
  9896. if (length > 1 || this.__actions__.length ||
  9897. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9898. return this.thru(interceptor);
  9899. }
  9900. value = value.slice(start, +start + (length ? 1 : 0));
  9901. value.__actions__.push({
  9902. 'func': thru,
  9903. 'args': [interceptor],
  9904. 'thisArg': undefined
  9905. });
  9906. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9907. if (length && !array.length) {
  9908. array.push(undefined);
  9909. }
  9910. return array;
  9911. });
  9912. });
  9913. /**
  9914. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9915. *
  9916. * @name chain
  9917. * @memberOf _
  9918. * @since 0.1.0
  9919. * @category Seq
  9920. * @returns {Object} Returns the new `lodash` wrapper instance.
  9921. * @example
  9922. *
  9923. * var users = [
  9924. * { 'user': 'barney', 'age': 36 },
  9925. * { 'user': 'fred', 'age': 40 }
  9926. * ];
  9927. *
  9928. * // A sequence without explicit chaining.
  9929. * _(users).head();
  9930. * // => { 'user': 'barney', 'age': 36 }
  9931. *
  9932. * // A sequence with explicit chaining.
  9933. * _(users)
  9934. * .chain()
  9935. * .head()
  9936. * .pick('user')
  9937. * .value();
  9938. * // => { 'user': 'barney' }
  9939. */
  9940. function wrapperChain() {
  9941. return chain(this);
  9942. }
  9943. /**
  9944. * Executes the chain sequence and returns the wrapped result.
  9945. *
  9946. * @name commit
  9947. * @memberOf _
  9948. * @since 3.2.0
  9949. * @category Seq
  9950. * @returns {Object} Returns the new `lodash` wrapper instance.
  9951. * @example
  9952. *
  9953. * var array = [1, 2];
  9954. * var wrapped = _(array).push(3);
  9955. *
  9956. * console.log(array);
  9957. * // => [1, 2]
  9958. *
  9959. * wrapped = wrapped.commit();
  9960. * console.log(array);
  9961. * // => [1, 2, 3]
  9962. *
  9963. * wrapped.last();
  9964. * // => 3
  9965. *
  9966. * console.log(array);
  9967. * // => [1, 2, 3]
  9968. */
  9969. function wrapperCommit() {
  9970. return new LodashWrapper(this.value(), this.__chain__);
  9971. }
  9972. /**
  9973. * Gets the next value on a wrapped object following the
  9974. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9975. *
  9976. * @name next
  9977. * @memberOf _
  9978. * @since 4.0.0
  9979. * @category Seq
  9980. * @returns {Object} Returns the next iterator value.
  9981. * @example
  9982. *
  9983. * var wrapped = _([1, 2]);
  9984. *
  9985. * wrapped.next();
  9986. * // => { 'done': false, 'value': 1 }
  9987. *
  9988. * wrapped.next();
  9989. * // => { 'done': false, 'value': 2 }
  9990. *
  9991. * wrapped.next();
  9992. * // => { 'done': true, 'value': undefined }
  9993. */
  9994. function wrapperNext() {
  9995. if (this.__values__ === undefined) {
  9996. this.__values__ = toArray(this.value());
  9997. }
  9998. var done = this.__index__ >= this.__values__.length,
  9999. value = done ? undefined : this.__values__[this.__index__++];
  10000. return { 'done': done, 'value': value };
  10001. }
  10002. /**
  10003. * Enables the wrapper to be iterable.
  10004. *
  10005. * @name Symbol.iterator
  10006. * @memberOf _
  10007. * @since 4.0.0
  10008. * @category Seq
  10009. * @returns {Object} Returns the wrapper object.
  10010. * @example
  10011. *
  10012. * var wrapped = _([1, 2]);
  10013. *
  10014. * wrapped[Symbol.iterator]() === wrapped;
  10015. * // => true
  10016. *
  10017. * Array.from(wrapped);
  10018. * // => [1, 2]
  10019. */
  10020. function wrapperToIterator() {
  10021. return this;
  10022. }
  10023. /**
  10024. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  10025. *
  10026. * @name plant
  10027. * @memberOf _
  10028. * @since 3.2.0
  10029. * @category Seq
  10030. * @param {*} value The value to plant.
  10031. * @returns {Object} Returns the new `lodash` wrapper instance.
  10032. * @example
  10033. *
  10034. * function square(n) {
  10035. * return n * n;
  10036. * }
  10037. *
  10038. * var wrapped = _([1, 2]).map(square);
  10039. * var other = wrapped.plant([3, 4]);
  10040. *
  10041. * other.value();
  10042. * // => [9, 16]
  10043. *
  10044. * wrapped.value();
  10045. * // => [1, 4]
  10046. */
  10047. function wrapperPlant(value) {
  10048. var result,
  10049. parent = this;
  10050. while (parent instanceof baseLodash) {
  10051. var clone = wrapperClone(parent);
  10052. clone.__index__ = 0;
  10053. clone.__values__ = undefined;
  10054. if (result) {
  10055. previous.__wrapped__ = clone;
  10056. } else {
  10057. result = clone;
  10058. }
  10059. var previous = clone;
  10060. parent = parent.__wrapped__;
  10061. }
  10062. previous.__wrapped__ = value;
  10063. return result;
  10064. }
  10065. /**
  10066. * This method is the wrapper version of `_.reverse`.
  10067. *
  10068. * **Note:** This method mutates the wrapped array.
  10069. *
  10070. * @name reverse
  10071. * @memberOf _
  10072. * @since 0.1.0
  10073. * @category Seq
  10074. * @returns {Object} Returns the new `lodash` wrapper instance.
  10075. * @example
  10076. *
  10077. * var array = [1, 2, 3];
  10078. *
  10079. * _(array).reverse().value()
  10080. * // => [3, 2, 1]
  10081. *
  10082. * console.log(array);
  10083. * // => [3, 2, 1]
  10084. */
  10085. function wrapperReverse() {
  10086. var value = this.__wrapped__;
  10087. if (value instanceof LazyWrapper) {
  10088. var wrapped = value;
  10089. if (this.__actions__.length) {
  10090. wrapped = new LazyWrapper(this);
  10091. }
  10092. wrapped = wrapped.reverse();
  10093. wrapped.__actions__.push({
  10094. 'func': thru,
  10095. 'args': [reverse],
  10096. 'thisArg': undefined
  10097. });
  10098. return new LodashWrapper(wrapped, this.__chain__);
  10099. }
  10100. return this.thru(reverse);
  10101. }
  10102. /**
  10103. * Executes the chain sequence to resolve the unwrapped value.
  10104. *
  10105. * @name value
  10106. * @memberOf _
  10107. * @since 0.1.0
  10108. * @alias toJSON, valueOf
  10109. * @category Seq
  10110. * @returns {*} Returns the resolved unwrapped value.
  10111. * @example
  10112. *
  10113. * _([1, 2, 3]).value();
  10114. * // => [1, 2, 3]
  10115. */
  10116. function wrapperValue() {
  10117. return baseWrapperValue(this.__wrapped__, this.__actions__);
  10118. }
  10119. /*------------------------------------------------------------------------*/
  10120. /**
  10121. * Creates an object composed of keys generated from the results of running
  10122. * each element of `collection` thru `iteratee`. The corresponding value of
  10123. * each key is the number of times the key was returned by `iteratee`. The
  10124. * iteratee is invoked with one argument: (value).
  10125. *
  10126. * @static
  10127. * @memberOf _
  10128. * @since 0.5.0
  10129. * @category Collection
  10130. * @param {Array|Object} collection The collection to iterate over.
  10131. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10132. * @returns {Object} Returns the composed aggregate object.
  10133. * @example
  10134. *
  10135. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  10136. * // => { '4': 1, '6': 2 }
  10137. *
  10138. * // The `_.property` iteratee shorthand.
  10139. * _.countBy(['one', 'two', 'three'], 'length');
  10140. * // => { '3': 2, '5': 1 }
  10141. */
  10142. var countBy = createAggregator(function(result, value, key) {
  10143. if (hasOwnProperty.call(result, key)) {
  10144. ++result[key];
  10145. } else {
  10146. baseAssignValue(result, key, 1);
  10147. }
  10148. });
  10149. /**
  10150. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  10151. * Iteration is stopped once `predicate` returns falsey. The predicate is
  10152. * invoked with three arguments: (value, index|key, collection).
  10153. *
  10154. * **Note:** This method returns `true` for
  10155. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  10156. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  10157. * elements of empty collections.
  10158. *
  10159. * @static
  10160. * @memberOf _
  10161. * @since 0.1.0
  10162. * @category Collection
  10163. * @param {Array|Object} collection The collection to iterate over.
  10164. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10165. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10166. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  10167. * else `false`.
  10168. * @example
  10169. *
  10170. * _.every([true, 1, null, 'yes'], Boolean);
  10171. * // => false
  10172. *
  10173. * var users = [
  10174. * { 'user': 'barney', 'age': 36, 'active': false },
  10175. * { 'user': 'fred', 'age': 40, 'active': false }
  10176. * ];
  10177. *
  10178. * // The `_.matches` iteratee shorthand.
  10179. * _.every(users, { 'user': 'barney', 'active': false });
  10180. * // => false
  10181. *
  10182. * // The `_.matchesProperty` iteratee shorthand.
  10183. * _.every(users, ['active', false]);
  10184. * // => true
  10185. *
  10186. * // The `_.property` iteratee shorthand.
  10187. * _.every(users, 'active');
  10188. * // => false
  10189. */
  10190. function every(collection, predicate, guard) {
  10191. var func = isArray(collection) ? arrayEvery : baseEvery;
  10192. if (guard && isIterateeCall(collection, predicate, guard)) {
  10193. predicate = undefined;
  10194. }
  10195. return func(collection, getIteratee(predicate, 3));
  10196. }
  10197. /**
  10198. * Iterates over elements of `collection`, returning an array of all elements
  10199. * `predicate` returns truthy for. The predicate is invoked with three
  10200. * arguments: (value, index|key, collection).
  10201. *
  10202. * **Note:** Unlike `_.remove`, this method returns a new array.
  10203. *
  10204. * @static
  10205. * @memberOf _
  10206. * @since 0.1.0
  10207. * @category Collection
  10208. * @param {Array|Object} collection The collection to iterate over.
  10209. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10210. * @returns {Array} Returns the new filtered array.
  10211. * @see _.reject
  10212. * @example
  10213. *
  10214. * var users = [
  10215. * { 'user': 'barney', 'age': 36, 'active': true },
  10216. * { 'user': 'fred', 'age': 40, 'active': false }
  10217. * ];
  10218. *
  10219. * _.filter(users, function(o) { return !o.active; });
  10220. * // => objects for ['fred']
  10221. *
  10222. * // The `_.matches` iteratee shorthand.
  10223. * _.filter(users, { 'age': 36, 'active': true });
  10224. * // => objects for ['barney']
  10225. *
  10226. * // The `_.matchesProperty` iteratee shorthand.
  10227. * _.filter(users, ['active', false]);
  10228. * // => objects for ['fred']
  10229. *
  10230. * // The `_.property` iteratee shorthand.
  10231. * _.filter(users, 'active');
  10232. * // => objects for ['barney']
  10233. *
  10234. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  10235. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  10236. * // => objects for ['fred', 'barney']
  10237. */
  10238. function filter(collection, predicate) {
  10239. var func = isArray(collection) ? arrayFilter : baseFilter;
  10240. return func(collection, getIteratee(predicate, 3));
  10241. }
  10242. /**
  10243. * Iterates over elements of `collection`, returning the first element
  10244. * `predicate` returns truthy for. The predicate is invoked with three
  10245. * arguments: (value, index|key, collection).
  10246. *
  10247. * @static
  10248. * @memberOf _
  10249. * @since 0.1.0
  10250. * @category Collection
  10251. * @param {Array|Object} collection The collection to inspect.
  10252. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10253. * @param {number} [fromIndex=0] The index to search from.
  10254. * @returns {*} Returns the matched element, else `undefined`.
  10255. * @example
  10256. *
  10257. * var users = [
  10258. * { 'user': 'barney', 'age': 36, 'active': true },
  10259. * { 'user': 'fred', 'age': 40, 'active': false },
  10260. * { 'user': 'pebbles', 'age': 1, 'active': true }
  10261. * ];
  10262. *
  10263. * _.find(users, function(o) { return o.age < 40; });
  10264. * // => object for 'barney'
  10265. *
  10266. * // The `_.matches` iteratee shorthand.
  10267. * _.find(users, { 'age': 1, 'active': true });
  10268. * // => object for 'pebbles'
  10269. *
  10270. * // The `_.matchesProperty` iteratee shorthand.
  10271. * _.find(users, ['active', false]);
  10272. * // => object for 'fred'
  10273. *
  10274. * // The `_.property` iteratee shorthand.
  10275. * _.find(users, 'active');
  10276. * // => object for 'barney'
  10277. */
  10278. var find = createFind(findIndex);
  10279. /**
  10280. * This method is like `_.find` except that it iterates over elements of
  10281. * `collection` from right to left.
  10282. *
  10283. * @static
  10284. * @memberOf _
  10285. * @since 2.0.0
  10286. * @category Collection
  10287. * @param {Array|Object} collection The collection to inspect.
  10288. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10289. * @param {number} [fromIndex=collection.length-1] The index to search from.
  10290. * @returns {*} Returns the matched element, else `undefined`.
  10291. * @example
  10292. *
  10293. * _.findLast([1, 2, 3, 4], function(n) {
  10294. * return n % 2 == 1;
  10295. * });
  10296. * // => 3
  10297. */
  10298. var findLast = createFind(findLastIndex);
  10299. /**
  10300. * Creates a flattened array of values by running each element in `collection`
  10301. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  10302. * with three arguments: (value, index|key, collection).
  10303. *
  10304. * @static
  10305. * @memberOf _
  10306. * @since 4.0.0
  10307. * @category Collection
  10308. * @param {Array|Object} collection The collection to iterate over.
  10309. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10310. * @returns {Array} Returns the new flattened array.
  10311. * @example
  10312. *
  10313. * function duplicate(n) {
  10314. * return [n, n];
  10315. * }
  10316. *
  10317. * _.flatMap([1, 2], duplicate);
  10318. * // => [1, 1, 2, 2]
  10319. */
  10320. function flatMap(collection, iteratee) {
  10321. return baseFlatten(map(collection, iteratee), 1);
  10322. }
  10323. /**
  10324. * This method is like `_.flatMap` except that it recursively flattens the
  10325. * mapped results.
  10326. *
  10327. * @static
  10328. * @memberOf _
  10329. * @since 4.7.0
  10330. * @category Collection
  10331. * @param {Array|Object} collection The collection to iterate over.
  10332. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10333. * @returns {Array} Returns the new flattened array.
  10334. * @example
  10335. *
  10336. * function duplicate(n) {
  10337. * return [[[n, n]]];
  10338. * }
  10339. *
  10340. * _.flatMapDeep([1, 2], duplicate);
  10341. * // => [1, 1, 2, 2]
  10342. */
  10343. function flatMapDeep(collection, iteratee) {
  10344. return baseFlatten(map(collection, iteratee), INFINITY);
  10345. }
  10346. /**
  10347. * This method is like `_.flatMap` except that it recursively flattens the
  10348. * mapped results up to `depth` times.
  10349. *
  10350. * @static
  10351. * @memberOf _
  10352. * @since 4.7.0
  10353. * @category Collection
  10354. * @param {Array|Object} collection The collection to iterate over.
  10355. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10356. * @param {number} [depth=1] The maximum recursion depth.
  10357. * @returns {Array} Returns the new flattened array.
  10358. * @example
  10359. *
  10360. * function duplicate(n) {
  10361. * return [[[n, n]]];
  10362. * }
  10363. *
  10364. * _.flatMapDepth([1, 2], duplicate, 2);
  10365. * // => [[1, 1], [2, 2]]
  10366. */
  10367. function flatMapDepth(collection, iteratee, depth) {
  10368. depth = depth === undefined ? 1 : toInteger(depth);
  10369. return baseFlatten(map(collection, iteratee), depth);
  10370. }
  10371. /**
  10372. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  10373. * The iteratee is invoked with three arguments: (value, index|key, collection).
  10374. * Iteratee functions may exit iteration early by explicitly returning `false`.
  10375. *
  10376. * **Note:** As with other "Collections" methods, objects with a "length"
  10377. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  10378. * or `_.forOwn` for object iteration.
  10379. *
  10380. * @static
  10381. * @memberOf _
  10382. * @since 0.1.0
  10383. * @alias each
  10384. * @category Collection
  10385. * @param {Array|Object} collection The collection to iterate over.
  10386. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10387. * @returns {Array|Object} Returns `collection`.
  10388. * @see _.forEachRight
  10389. * @example
  10390. *
  10391. * _.forEach([1, 2], function(value) {
  10392. * console.log(value);
  10393. * });
  10394. * // => Logs `1` then `2`.
  10395. *
  10396. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  10397. * console.log(key);
  10398. * });
  10399. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  10400. */
  10401. function forEach(collection, iteratee) {
  10402. var func = isArray(collection) ? arrayEach : baseEach;
  10403. return func(collection, getIteratee(iteratee, 3));
  10404. }
  10405. /**
  10406. * This method is like `_.forEach` except that it iterates over elements of
  10407. * `collection` from right to left.
  10408. *
  10409. * @static
  10410. * @memberOf _
  10411. * @since 2.0.0
  10412. * @alias eachRight
  10413. * @category Collection
  10414. * @param {Array|Object} collection The collection to iterate over.
  10415. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10416. * @returns {Array|Object} Returns `collection`.
  10417. * @see _.forEach
  10418. * @example
  10419. *
  10420. * _.forEachRight([1, 2], function(value) {
  10421. * console.log(value);
  10422. * });
  10423. * // => Logs `2` then `1`.
  10424. */
  10425. function forEachRight(collection, iteratee) {
  10426. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  10427. return func(collection, getIteratee(iteratee, 3));
  10428. }
  10429. /**
  10430. * Creates an object composed of keys generated from the results of running
  10431. * each element of `collection` thru `iteratee`. The order of grouped values
  10432. * is determined by the order they occur in `collection`. The corresponding
  10433. * value of each key is an array of elements responsible for generating the
  10434. * key. The iteratee is invoked with one argument: (value).
  10435. *
  10436. * @static
  10437. * @memberOf _
  10438. * @since 0.1.0
  10439. * @category Collection
  10440. * @param {Array|Object} collection The collection to iterate over.
  10441. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10442. * @returns {Object} Returns the composed aggregate object.
  10443. * @example
  10444. *
  10445. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  10446. * // => { '4': [4.2], '6': [6.1, 6.3] }
  10447. *
  10448. * // The `_.property` iteratee shorthand.
  10449. * _.groupBy(['one', 'two', 'three'], 'length');
  10450. * // => { '3': ['one', 'two'], '5': ['three'] }
  10451. */
  10452. var groupBy = createAggregator(function(result, value, key) {
  10453. if (hasOwnProperty.call(result, key)) {
  10454. result[key].push(value);
  10455. } else {
  10456. baseAssignValue(result, key, [value]);
  10457. }
  10458. });
  10459. /**
  10460. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10461. * checked for a substring of `value`, otherwise
  10462. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10463. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10464. * the offset from the end of `collection`.
  10465. *
  10466. * @static
  10467. * @memberOf _
  10468. * @since 0.1.0
  10469. * @category Collection
  10470. * @param {Array|Object|string} collection The collection to inspect.
  10471. * @param {*} value The value to search for.
  10472. * @param {number} [fromIndex=0] The index to search from.
  10473. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10474. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10475. * @example
  10476. *
  10477. * _.includes([1, 2, 3], 1);
  10478. * // => true
  10479. *
  10480. * _.includes([1, 2, 3], 1, 2);
  10481. * // => false
  10482. *
  10483. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10484. * // => true
  10485. *
  10486. * _.includes('abcd', 'bc');
  10487. * // => true
  10488. */
  10489. function includes(collection, value, fromIndex, guard) {
  10490. collection = isArrayLike(collection) ? collection : values(collection);
  10491. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10492. var length = collection.length;
  10493. if (fromIndex < 0) {
  10494. fromIndex = nativeMax(length + fromIndex, 0);
  10495. }
  10496. return isString(collection)
  10497. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10498. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10499. }
  10500. /**
  10501. * Invokes the method at `path` of each element in `collection`, returning
  10502. * an array of the results of each invoked method. Any additional arguments
  10503. * are provided to each invoked method. If `path` is a function, it's invoked
  10504. * for, and `this` bound to, each element in `collection`.
  10505. *
  10506. * @static
  10507. * @memberOf _
  10508. * @since 4.0.0
  10509. * @category Collection
  10510. * @param {Array|Object} collection The collection to iterate over.
  10511. * @param {Array|Function|string} path The path of the method to invoke or
  10512. * the function invoked per iteration.
  10513. * @param {...*} [args] The arguments to invoke each method with.
  10514. * @returns {Array} Returns the array of results.
  10515. * @example
  10516. *
  10517. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10518. * // => [[1, 5, 7], [1, 2, 3]]
  10519. *
  10520. * _.invokeMap([123, 456], String.prototype.split, '');
  10521. * // => [['1', '2', '3'], ['4', '5', '6']]
  10522. */
  10523. var invokeMap = baseRest(function(collection, path, args) {
  10524. var index = -1,
  10525. isFunc = typeof path == 'function',
  10526. result = isArrayLike(collection) ? Array(collection.length) : [];
  10527. baseEach(collection, function(value) {
  10528. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10529. });
  10530. return result;
  10531. });
  10532. /**
  10533. * Creates an object composed of keys generated from the results of running
  10534. * each element of `collection` thru `iteratee`. The corresponding value of
  10535. * each key is the last element responsible for generating the key. The
  10536. * iteratee is invoked with one argument: (value).
  10537. *
  10538. * @static
  10539. * @memberOf _
  10540. * @since 4.0.0
  10541. * @category Collection
  10542. * @param {Array|Object} collection The collection to iterate over.
  10543. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10544. * @returns {Object} Returns the composed aggregate object.
  10545. * @example
  10546. *
  10547. * var array = [
  10548. * { 'dir': 'left', 'code': 97 },
  10549. * { 'dir': 'right', 'code': 100 }
  10550. * ];
  10551. *
  10552. * _.keyBy(array, function(o) {
  10553. * return String.fromCharCode(o.code);
  10554. * });
  10555. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10556. *
  10557. * _.keyBy(array, 'dir');
  10558. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10559. */
  10560. var keyBy = createAggregator(function(result, value, key) {
  10561. baseAssignValue(result, key, value);
  10562. });
  10563. /**
  10564. * Creates an array of values by running each element in `collection` thru
  10565. * `iteratee`. The iteratee is invoked with three arguments:
  10566. * (value, index|key, collection).
  10567. *
  10568. * Many lodash methods are guarded to work as iteratees for methods like
  10569. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10570. *
  10571. * The guarded methods are:
  10572. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10573. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10574. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10575. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10576. *
  10577. * @static
  10578. * @memberOf _
  10579. * @since 0.1.0
  10580. * @category Collection
  10581. * @param {Array|Object} collection The collection to iterate over.
  10582. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10583. * @returns {Array} Returns the new mapped array.
  10584. * @example
  10585. *
  10586. * function square(n) {
  10587. * return n * n;
  10588. * }
  10589. *
  10590. * _.map([4, 8], square);
  10591. * // => [16, 64]
  10592. *
  10593. * _.map({ 'a': 4, 'b': 8 }, square);
  10594. * // => [16, 64] (iteration order is not guaranteed)
  10595. *
  10596. * var users = [
  10597. * { 'user': 'barney' },
  10598. * { 'user': 'fred' }
  10599. * ];
  10600. *
  10601. * // The `_.property` iteratee shorthand.
  10602. * _.map(users, 'user');
  10603. * // => ['barney', 'fred']
  10604. */
  10605. function map(collection, iteratee) {
  10606. var func = isArray(collection) ? arrayMap : baseMap;
  10607. return func(collection, getIteratee(iteratee, 3));
  10608. }
  10609. /**
  10610. * This method is like `_.sortBy` except that it allows specifying the sort
  10611. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10612. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10613. * descending or "asc" for ascending sort order of corresponding values.
  10614. *
  10615. * @static
  10616. * @memberOf _
  10617. * @since 4.0.0
  10618. * @category Collection
  10619. * @param {Array|Object} collection The collection to iterate over.
  10620. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10621. * The iteratees to sort by.
  10622. * @param {string[]} [orders] The sort orders of `iteratees`.
  10623. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10624. * @returns {Array} Returns the new sorted array.
  10625. * @example
  10626. *
  10627. * var users = [
  10628. * { 'user': 'fred', 'age': 48 },
  10629. * { 'user': 'barney', 'age': 34 },
  10630. * { 'user': 'fred', 'age': 40 },
  10631. * { 'user': 'barney', 'age': 36 }
  10632. * ];
  10633. *
  10634. * // Sort by `user` in ascending order and by `age` in descending order.
  10635. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10636. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10637. */
  10638. function orderBy(collection, iteratees, orders, guard) {
  10639. if (collection == null) {
  10640. return [];
  10641. }
  10642. if (!isArray(iteratees)) {
  10643. iteratees = iteratees == null ? [] : [iteratees];
  10644. }
  10645. orders = guard ? undefined : orders;
  10646. if (!isArray(orders)) {
  10647. orders = orders == null ? [] : [orders];
  10648. }
  10649. return baseOrderBy(collection, iteratees, orders);
  10650. }
  10651. /**
  10652. * Creates an array of elements split into two groups, the first of which
  10653. * contains elements `predicate` returns truthy for, the second of which
  10654. * contains elements `predicate` returns falsey for. The predicate is
  10655. * invoked with one argument: (value).
  10656. *
  10657. * @static
  10658. * @memberOf _
  10659. * @since 3.0.0
  10660. * @category Collection
  10661. * @param {Array|Object} collection The collection to iterate over.
  10662. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10663. * @returns {Array} Returns the array of grouped elements.
  10664. * @example
  10665. *
  10666. * var users = [
  10667. * { 'user': 'barney', 'age': 36, 'active': false },
  10668. * { 'user': 'fred', 'age': 40, 'active': true },
  10669. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10670. * ];
  10671. *
  10672. * _.partition(users, function(o) { return o.active; });
  10673. * // => objects for [['fred'], ['barney', 'pebbles']]
  10674. *
  10675. * // The `_.matches` iteratee shorthand.
  10676. * _.partition(users, { 'age': 1, 'active': false });
  10677. * // => objects for [['pebbles'], ['barney', 'fred']]
  10678. *
  10679. * // The `_.matchesProperty` iteratee shorthand.
  10680. * _.partition(users, ['active', false]);
  10681. * // => objects for [['barney', 'pebbles'], ['fred']]
  10682. *
  10683. * // The `_.property` iteratee shorthand.
  10684. * _.partition(users, 'active');
  10685. * // => objects for [['fred'], ['barney', 'pebbles']]
  10686. */
  10687. var partition = createAggregator(function(result, value, key) {
  10688. result[key ? 0 : 1].push(value);
  10689. }, function() { return [[], []]; });
  10690. /**
  10691. * Reduces `collection` to a value which is the accumulated result of running
  10692. * each element in `collection` thru `iteratee`, where each successive
  10693. * invocation is supplied the return value of the previous. If `accumulator`
  10694. * is not given, the first element of `collection` is used as the initial
  10695. * value. The iteratee is invoked with four arguments:
  10696. * (accumulator, value, index|key, collection).
  10697. *
  10698. * Many lodash methods are guarded to work as iteratees for methods like
  10699. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10700. *
  10701. * The guarded methods are:
  10702. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10703. * and `sortBy`
  10704. *
  10705. * @static
  10706. * @memberOf _
  10707. * @since 0.1.0
  10708. * @category Collection
  10709. * @param {Array|Object} collection The collection to iterate over.
  10710. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10711. * @param {*} [accumulator] The initial value.
  10712. * @returns {*} Returns the accumulated value.
  10713. * @see _.reduceRight
  10714. * @example
  10715. *
  10716. * _.reduce([1, 2], function(sum, n) {
  10717. * return sum + n;
  10718. * }, 0);
  10719. * // => 3
  10720. *
  10721. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10722. * (result[value] || (result[value] = [])).push(key);
  10723. * return result;
  10724. * }, {});
  10725. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10726. */
  10727. function reduce(collection, iteratee, accumulator) {
  10728. var func = isArray(collection) ? arrayReduce : baseReduce,
  10729. initAccum = arguments.length < 3;
  10730. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10731. }
  10732. /**
  10733. * This method is like `_.reduce` except that it iterates over elements of
  10734. * `collection` from right to left.
  10735. *
  10736. * @static
  10737. * @memberOf _
  10738. * @since 0.1.0
  10739. * @category Collection
  10740. * @param {Array|Object} collection The collection to iterate over.
  10741. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10742. * @param {*} [accumulator] The initial value.
  10743. * @returns {*} Returns the accumulated value.
  10744. * @see _.reduce
  10745. * @example
  10746. *
  10747. * var array = [[0, 1], [2, 3], [4, 5]];
  10748. *
  10749. * _.reduceRight(array, function(flattened, other) {
  10750. * return flattened.concat(other);
  10751. * }, []);
  10752. * // => [4, 5, 2, 3, 0, 1]
  10753. */
  10754. function reduceRight(collection, iteratee, accumulator) {
  10755. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10756. initAccum = arguments.length < 3;
  10757. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10758. }
  10759. /**
  10760. * The opposite of `_.filter`; this method returns the elements of `collection`
  10761. * that `predicate` does **not** return truthy for.
  10762. *
  10763. * @static
  10764. * @memberOf _
  10765. * @since 0.1.0
  10766. * @category Collection
  10767. * @param {Array|Object} collection The collection to iterate over.
  10768. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10769. * @returns {Array} Returns the new filtered array.
  10770. * @see _.filter
  10771. * @example
  10772. *
  10773. * var users = [
  10774. * { 'user': 'barney', 'age': 36, 'active': false },
  10775. * { 'user': 'fred', 'age': 40, 'active': true }
  10776. * ];
  10777. *
  10778. * _.reject(users, function(o) { return !o.active; });
  10779. * // => objects for ['fred']
  10780. *
  10781. * // The `_.matches` iteratee shorthand.
  10782. * _.reject(users, { 'age': 40, 'active': true });
  10783. * // => objects for ['barney']
  10784. *
  10785. * // The `_.matchesProperty` iteratee shorthand.
  10786. * _.reject(users, ['active', false]);
  10787. * // => objects for ['fred']
  10788. *
  10789. * // The `_.property` iteratee shorthand.
  10790. * _.reject(users, 'active');
  10791. * // => objects for ['barney']
  10792. */
  10793. function reject(collection, predicate) {
  10794. var func = isArray(collection) ? arrayFilter : baseFilter;
  10795. return func(collection, negate(getIteratee(predicate, 3)));
  10796. }
  10797. /**
  10798. * Gets a random element from `collection`.
  10799. *
  10800. * @static
  10801. * @memberOf _
  10802. * @since 2.0.0
  10803. * @category Collection
  10804. * @param {Array|Object} collection The collection to sample.
  10805. * @returns {*} Returns the random element.
  10806. * @example
  10807. *
  10808. * _.sample([1, 2, 3, 4]);
  10809. * // => 2
  10810. */
  10811. function sample(collection) {
  10812. var func = isArray(collection) ? arraySample : baseSample;
  10813. return func(collection);
  10814. }
  10815. /**
  10816. * Gets `n` random elements at unique keys from `collection` up to the
  10817. * size of `collection`.
  10818. *
  10819. * @static
  10820. * @memberOf _
  10821. * @since 4.0.0
  10822. * @category Collection
  10823. * @param {Array|Object} collection The collection to sample.
  10824. * @param {number} [n=1] The number of elements to sample.
  10825. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10826. * @returns {Array} Returns the random elements.
  10827. * @example
  10828. *
  10829. * _.sampleSize([1, 2, 3], 2);
  10830. * // => [3, 1]
  10831. *
  10832. * _.sampleSize([1, 2, 3], 4);
  10833. * // => [2, 3, 1]
  10834. */
  10835. function sampleSize(collection, n, guard) {
  10836. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10837. n = 1;
  10838. } else {
  10839. n = toInteger(n);
  10840. }
  10841. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10842. return func(collection, n);
  10843. }
  10844. /**
  10845. * Creates an array of shuffled values, using a version of the
  10846. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10847. *
  10848. * @static
  10849. * @memberOf _
  10850. * @since 0.1.0
  10851. * @category Collection
  10852. * @param {Array|Object} collection The collection to shuffle.
  10853. * @returns {Array} Returns the new shuffled array.
  10854. * @example
  10855. *
  10856. * _.shuffle([1, 2, 3, 4]);
  10857. * // => [4, 1, 3, 2]
  10858. */
  10859. function shuffle(collection) {
  10860. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10861. return func(collection);
  10862. }
  10863. /**
  10864. * Gets the size of `collection` by returning its length for array-like
  10865. * values or the number of own enumerable string keyed properties for objects.
  10866. *
  10867. * @static
  10868. * @memberOf _
  10869. * @since 0.1.0
  10870. * @category Collection
  10871. * @param {Array|Object|string} collection The collection to inspect.
  10872. * @returns {number} Returns the collection size.
  10873. * @example
  10874. *
  10875. * _.size([1, 2, 3]);
  10876. * // => 3
  10877. *
  10878. * _.size({ 'a': 1, 'b': 2 });
  10879. * // => 2
  10880. *
  10881. * _.size('pebbles');
  10882. * // => 7
  10883. */
  10884. function size(collection) {
  10885. if (collection == null) {
  10886. return 0;
  10887. }
  10888. if (isArrayLike(collection)) {
  10889. return isString(collection) ? stringSize(collection) : collection.length;
  10890. }
  10891. var tag = getTag(collection);
  10892. if (tag == mapTag || tag == setTag) {
  10893. return collection.size;
  10894. }
  10895. return baseKeys(collection).length;
  10896. }
  10897. /**
  10898. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10899. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10900. * invoked with three arguments: (value, index|key, collection).
  10901. *
  10902. * @static
  10903. * @memberOf _
  10904. * @since 0.1.0
  10905. * @category Collection
  10906. * @param {Array|Object} collection The collection to iterate over.
  10907. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10908. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10909. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10910. * else `false`.
  10911. * @example
  10912. *
  10913. * _.some([null, 0, 'yes', false], Boolean);
  10914. * // => true
  10915. *
  10916. * var users = [
  10917. * { 'user': 'barney', 'active': true },
  10918. * { 'user': 'fred', 'active': false }
  10919. * ];
  10920. *
  10921. * // The `_.matches` iteratee shorthand.
  10922. * _.some(users, { 'user': 'barney', 'active': false });
  10923. * // => false
  10924. *
  10925. * // The `_.matchesProperty` iteratee shorthand.
  10926. * _.some(users, ['active', false]);
  10927. * // => true
  10928. *
  10929. * // The `_.property` iteratee shorthand.
  10930. * _.some(users, 'active');
  10931. * // => true
  10932. */
  10933. function some(collection, predicate, guard) {
  10934. var func = isArray(collection) ? arraySome : baseSome;
  10935. if (guard && isIterateeCall(collection, predicate, guard)) {
  10936. predicate = undefined;
  10937. }
  10938. return func(collection, getIteratee(predicate, 3));
  10939. }
  10940. /**
  10941. * Creates an array of elements, sorted in ascending order by the results of
  10942. * running each element in a collection thru each iteratee. This method
  10943. * performs a stable sort, that is, it preserves the original sort order of
  10944. * equal elements. The iteratees are invoked with one argument: (value).
  10945. *
  10946. * @static
  10947. * @memberOf _
  10948. * @since 0.1.0
  10949. * @category Collection
  10950. * @param {Array|Object} collection The collection to iterate over.
  10951. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10952. * The iteratees to sort by.
  10953. * @returns {Array} Returns the new sorted array.
  10954. * @example
  10955. *
  10956. * var users = [
  10957. * { 'user': 'fred', 'age': 48 },
  10958. * { 'user': 'barney', 'age': 36 },
  10959. * { 'user': 'fred', 'age': 30 },
  10960. * { 'user': 'barney', 'age': 34 }
  10961. * ];
  10962. *
  10963. * _.sortBy(users, [function(o) { return o.user; }]);
  10964. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10965. *
  10966. * _.sortBy(users, ['user', 'age']);
  10967. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10968. */
  10969. var sortBy = baseRest(function(collection, iteratees) {
  10970. if (collection == null) {
  10971. return [];
  10972. }
  10973. var length = iteratees.length;
  10974. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10975. iteratees = [];
  10976. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10977. iteratees = [iteratees[0]];
  10978. }
  10979. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10980. });
  10981. /*------------------------------------------------------------------------*/
  10982. /**
  10983. * Gets the timestamp of the number of milliseconds that have elapsed since
  10984. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10985. *
  10986. * @static
  10987. * @memberOf _
  10988. * @since 2.4.0
  10989. * @category Date
  10990. * @returns {number} Returns the timestamp.
  10991. * @example
  10992. *
  10993. * _.defer(function(stamp) {
  10994. * console.log(_.now() - stamp);
  10995. * }, _.now());
  10996. * // => Logs the number of milliseconds it took for the deferred invocation.
  10997. */
  10998. var now = ctxNow || function() {
  10999. return root.Date.now();
  11000. };
  11001. /*------------------------------------------------------------------------*/
  11002. /**
  11003. * The opposite of `_.before`; this method creates a function that invokes
  11004. * `func` once it's called `n` or more times.
  11005. *
  11006. * @static
  11007. * @memberOf _
  11008. * @since 0.1.0
  11009. * @category Function
  11010. * @param {number} n The number of calls before `func` is invoked.
  11011. * @param {Function} func The function to restrict.
  11012. * @returns {Function} Returns the new restricted function.
  11013. * @example
  11014. *
  11015. * var saves = ['profile', 'settings'];
  11016. *
  11017. * var done = _.after(saves.length, function() {
  11018. * console.log('done saving!');
  11019. * });
  11020. *
  11021. * _.forEach(saves, function(type) {
  11022. * asyncSave({ 'type': type, 'complete': done });
  11023. * });
  11024. * // => Logs 'done saving!' after the two async saves have completed.
  11025. */
  11026. function after(n, func) {
  11027. if (typeof func != 'function') {
  11028. throw new TypeError(FUNC_ERROR_TEXT);
  11029. }
  11030. n = toInteger(n);
  11031. return function() {
  11032. if (--n < 1) {
  11033. return func.apply(this, arguments);
  11034. }
  11035. };
  11036. }
  11037. /**
  11038. * Creates a function that invokes `func`, with up to `n` arguments,
  11039. * ignoring any additional arguments.
  11040. *
  11041. * @static
  11042. * @memberOf _
  11043. * @since 3.0.0
  11044. * @category Function
  11045. * @param {Function} func The function to cap arguments for.
  11046. * @param {number} [n=func.length] The arity cap.
  11047. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  11048. * @returns {Function} Returns the new capped function.
  11049. * @example
  11050. *
  11051. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  11052. * // => [6, 8, 10]
  11053. */
  11054. function ary(func, n, guard) {
  11055. n = guard ? undefined : n;
  11056. n = (func && n == null) ? func.length : n;
  11057. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  11058. }
  11059. /**
  11060. * Creates a function that invokes `func`, with the `this` binding and arguments
  11061. * of the created function, while it's called less than `n` times. Subsequent
  11062. * calls to the created function return the result of the last `func` invocation.
  11063. *
  11064. * @static
  11065. * @memberOf _
  11066. * @since 3.0.0
  11067. * @category Function
  11068. * @param {number} n The number of calls at which `func` is no longer invoked.
  11069. * @param {Function} func The function to restrict.
  11070. * @returns {Function} Returns the new restricted function.
  11071. * @example
  11072. *
  11073. * jQuery(element).on('click', _.before(5, addContactToList));
  11074. * // => Allows adding up to 4 contacts to the list.
  11075. */
  11076. function before(n, func) {
  11077. var result;
  11078. if (typeof func != 'function') {
  11079. throw new TypeError(FUNC_ERROR_TEXT);
  11080. }
  11081. n = toInteger(n);
  11082. return function() {
  11083. if (--n > 0) {
  11084. result = func.apply(this, arguments);
  11085. }
  11086. if (n <= 1) {
  11087. func = undefined;
  11088. }
  11089. return result;
  11090. };
  11091. }
  11092. /**
  11093. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  11094. * and `partials` prepended to the arguments it receives.
  11095. *
  11096. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  11097. * may be used as a placeholder for partially applied arguments.
  11098. *
  11099. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  11100. * property of bound functions.
  11101. *
  11102. * @static
  11103. * @memberOf _
  11104. * @since 0.1.0
  11105. * @category Function
  11106. * @param {Function} func The function to bind.
  11107. * @param {*} thisArg The `this` binding of `func`.
  11108. * @param {...*} [partials] The arguments to be partially applied.
  11109. * @returns {Function} Returns the new bound function.
  11110. * @example
  11111. *
  11112. * function greet(greeting, punctuation) {
  11113. * return greeting + ' ' + this.user + punctuation;
  11114. * }
  11115. *
  11116. * var object = { 'user': 'fred' };
  11117. *
  11118. * var bound = _.bind(greet, object, 'hi');
  11119. * bound('!');
  11120. * // => 'hi fred!'
  11121. *
  11122. * // Bound with placeholders.
  11123. * var bound = _.bind(greet, object, _, '!');
  11124. * bound('hi');
  11125. * // => 'hi fred!'
  11126. */
  11127. var bind = baseRest(function(func, thisArg, partials) {
  11128. var bitmask = WRAP_BIND_FLAG;
  11129. if (partials.length) {
  11130. var holders = replaceHolders(partials, getHolder(bind));
  11131. bitmask |= WRAP_PARTIAL_FLAG;
  11132. }
  11133. return createWrap(func, bitmask, thisArg, partials, holders);
  11134. });
  11135. /**
  11136. * Creates a function that invokes the method at `object[key]` with `partials`
  11137. * prepended to the arguments it receives.
  11138. *
  11139. * This method differs from `_.bind` by allowing bound functions to reference
  11140. * methods that may be redefined or don't yet exist. See
  11141. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  11142. * for more details.
  11143. *
  11144. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  11145. * builds, may be used as a placeholder for partially applied arguments.
  11146. *
  11147. * @static
  11148. * @memberOf _
  11149. * @since 0.10.0
  11150. * @category Function
  11151. * @param {Object} object The object to invoke the method on.
  11152. * @param {string} key The key of the method.
  11153. * @param {...*} [partials] The arguments to be partially applied.
  11154. * @returns {Function} Returns the new bound function.
  11155. * @example
  11156. *
  11157. * var object = {
  11158. * 'user': 'fred',
  11159. * 'greet': function(greeting, punctuation) {
  11160. * return greeting + ' ' + this.user + punctuation;
  11161. * }
  11162. * };
  11163. *
  11164. * var bound = _.bindKey(object, 'greet', 'hi');
  11165. * bound('!');
  11166. * // => 'hi fred!'
  11167. *
  11168. * object.greet = function(greeting, punctuation) {
  11169. * return greeting + 'ya ' + this.user + punctuation;
  11170. * };
  11171. *
  11172. * bound('!');
  11173. * // => 'hiya fred!'
  11174. *
  11175. * // Bound with placeholders.
  11176. * var bound = _.bindKey(object, 'greet', _, '!');
  11177. * bound('hi');
  11178. * // => 'hiya fred!'
  11179. */
  11180. var bindKey = baseRest(function(object, key, partials) {
  11181. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  11182. if (partials.length) {
  11183. var holders = replaceHolders(partials, getHolder(bindKey));
  11184. bitmask |= WRAP_PARTIAL_FLAG;
  11185. }
  11186. return createWrap(key, bitmask, object, partials, holders);
  11187. });
  11188. /**
  11189. * Creates a function that accepts arguments of `func` and either invokes
  11190. * `func` returning its result, if at least `arity` number of arguments have
  11191. * been provided, or returns a function that accepts the remaining `func`
  11192. * arguments, and so on. The arity of `func` may be specified if `func.length`
  11193. * is not sufficient.
  11194. *
  11195. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  11196. * may be used as a placeholder for provided arguments.
  11197. *
  11198. * **Note:** This method doesn't set the "length" property of curried functions.
  11199. *
  11200. * @static
  11201. * @memberOf _
  11202. * @since 2.0.0
  11203. * @category Function
  11204. * @param {Function} func The function to curry.
  11205. * @param {number} [arity=func.length] The arity of `func`.
  11206. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  11207. * @returns {Function} Returns the new curried function.
  11208. * @example
  11209. *
  11210. * var abc = function(a, b, c) {
  11211. * return [a, b, c];
  11212. * };
  11213. *
  11214. * var curried = _.curry(abc);
  11215. *
  11216. * curried(1)(2)(3);
  11217. * // => [1, 2, 3]
  11218. *
  11219. * curried(1, 2)(3);
  11220. * // => [1, 2, 3]
  11221. *
  11222. * curried(1, 2, 3);
  11223. * // => [1, 2, 3]
  11224. *
  11225. * // Curried with placeholders.
  11226. * curried(1)(_, 3)(2);
  11227. * // => [1, 2, 3]
  11228. */
  11229. function curry(func, arity, guard) {
  11230. arity = guard ? undefined : arity;
  11231. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  11232. result.placeholder = curry.placeholder;
  11233. return result;
  11234. }
  11235. /**
  11236. * This method is like `_.curry` except that arguments are applied to `func`
  11237. * in the manner of `_.partialRight` instead of `_.partial`.
  11238. *
  11239. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  11240. * builds, may be used as a placeholder for provided arguments.
  11241. *
  11242. * **Note:** This method doesn't set the "length" property of curried functions.
  11243. *
  11244. * @static
  11245. * @memberOf _
  11246. * @since 3.0.0
  11247. * @category Function
  11248. * @param {Function} func The function to curry.
  11249. * @param {number} [arity=func.length] The arity of `func`.
  11250. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  11251. * @returns {Function} Returns the new curried function.
  11252. * @example
  11253. *
  11254. * var abc = function(a, b, c) {
  11255. * return [a, b, c];
  11256. * };
  11257. *
  11258. * var curried = _.curryRight(abc);
  11259. *
  11260. * curried(3)(2)(1);
  11261. * // => [1, 2, 3]
  11262. *
  11263. * curried(2, 3)(1);
  11264. * // => [1, 2, 3]
  11265. *
  11266. * curried(1, 2, 3);
  11267. * // => [1, 2, 3]
  11268. *
  11269. * // Curried with placeholders.
  11270. * curried(3)(1, _)(2);
  11271. * // => [1, 2, 3]
  11272. */
  11273. function curryRight(func, arity, guard) {
  11274. arity = guard ? undefined : arity;
  11275. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  11276. result.placeholder = curryRight.placeholder;
  11277. return result;
  11278. }
  11279. /**
  11280. * Creates a debounced function that delays invoking `func` until after `wait`
  11281. * milliseconds have elapsed since the last time the debounced function was
  11282. * invoked. The debounced function comes with a `cancel` method to cancel
  11283. * delayed `func` invocations and a `flush` method to immediately invoke them.
  11284. * Provide `options` to indicate whether `func` should be invoked on the
  11285. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  11286. * with the last arguments provided to the debounced function. Subsequent
  11287. * calls to the debounced function return the result of the last `func`
  11288. * invocation.
  11289. *
  11290. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11291. * invoked on the trailing edge of the timeout only if the debounced function
  11292. * is invoked more than once during the `wait` timeout.
  11293. *
  11294. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11295. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11296. *
  11297. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11298. * for details over the differences between `_.debounce` and `_.throttle`.
  11299. *
  11300. * @static
  11301. * @memberOf _
  11302. * @since 0.1.0
  11303. * @category Function
  11304. * @param {Function} func The function to debounce.
  11305. * @param {number} [wait=0] The number of milliseconds to delay.
  11306. * @param {Object} [options={}] The options object.
  11307. * @param {boolean} [options.leading=false]
  11308. * Specify invoking on the leading edge of the timeout.
  11309. * @param {number} [options.maxWait]
  11310. * The maximum time `func` is allowed to be delayed before it's invoked.
  11311. * @param {boolean} [options.trailing=true]
  11312. * Specify invoking on the trailing edge of the timeout.
  11313. * @returns {Function} Returns the new debounced function.
  11314. * @example
  11315. *
  11316. * // Avoid costly calculations while the window size is in flux.
  11317. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  11318. *
  11319. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  11320. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  11321. * 'leading': true,
  11322. * 'trailing': false
  11323. * }));
  11324. *
  11325. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  11326. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  11327. * var source = new EventSource('/stream');
  11328. * jQuery(source).on('message', debounced);
  11329. *
  11330. * // Cancel the trailing debounced invocation.
  11331. * jQuery(window).on('popstate', debounced.cancel);
  11332. */
  11333. function debounce(func, wait, options) {
  11334. var lastArgs,
  11335. lastThis,
  11336. maxWait,
  11337. result,
  11338. timerId,
  11339. lastCallTime,
  11340. lastInvokeTime = 0,
  11341. leading = false,
  11342. maxing = false,
  11343. trailing = true;
  11344. if (typeof func != 'function') {
  11345. throw new TypeError(FUNC_ERROR_TEXT);
  11346. }
  11347. wait = toNumber(wait) || 0;
  11348. if (isObject(options)) {
  11349. leading = !!options.leading;
  11350. maxing = 'maxWait' in options;
  11351. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  11352. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11353. }
  11354. function invokeFunc(time) {
  11355. var args = lastArgs,
  11356. thisArg = lastThis;
  11357. lastArgs = lastThis = undefined;
  11358. lastInvokeTime = time;
  11359. result = func.apply(thisArg, args);
  11360. return result;
  11361. }
  11362. function leadingEdge(time) {
  11363. // Reset any `maxWait` timer.
  11364. lastInvokeTime = time;
  11365. // Start the timer for the trailing edge.
  11366. timerId = setTimeout(timerExpired, wait);
  11367. // Invoke the leading edge.
  11368. return leading ? invokeFunc(time) : result;
  11369. }
  11370. function remainingWait(time) {
  11371. var timeSinceLastCall = time - lastCallTime,
  11372. timeSinceLastInvoke = time - lastInvokeTime,
  11373. timeWaiting = wait - timeSinceLastCall;
  11374. return maxing
  11375. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  11376. : timeWaiting;
  11377. }
  11378. function shouldInvoke(time) {
  11379. var timeSinceLastCall = time - lastCallTime,
  11380. timeSinceLastInvoke = time - lastInvokeTime;
  11381. // Either this is the first call, activity has stopped and we're at the
  11382. // trailing edge, the system time has gone backwards and we're treating
  11383. // it as the trailing edge, or we've hit the `maxWait` limit.
  11384. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  11385. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  11386. }
  11387. function timerExpired() {
  11388. var time = now();
  11389. if (shouldInvoke(time)) {
  11390. return trailingEdge(time);
  11391. }
  11392. // Restart the timer.
  11393. timerId = setTimeout(timerExpired, remainingWait(time));
  11394. }
  11395. function trailingEdge(time) {
  11396. timerId = undefined;
  11397. // Only invoke if we have `lastArgs` which means `func` has been
  11398. // debounced at least once.
  11399. if (trailing && lastArgs) {
  11400. return invokeFunc(time);
  11401. }
  11402. lastArgs = lastThis = undefined;
  11403. return result;
  11404. }
  11405. function cancel() {
  11406. if (timerId !== undefined) {
  11407. clearTimeout(timerId);
  11408. }
  11409. lastInvokeTime = 0;
  11410. lastArgs = lastCallTime = lastThis = timerId = undefined;
  11411. }
  11412. function flush() {
  11413. return timerId === undefined ? result : trailingEdge(now());
  11414. }
  11415. function debounced() {
  11416. var time = now(),
  11417. isInvoking = shouldInvoke(time);
  11418. lastArgs = arguments;
  11419. lastThis = this;
  11420. lastCallTime = time;
  11421. if (isInvoking) {
  11422. if (timerId === undefined) {
  11423. return leadingEdge(lastCallTime);
  11424. }
  11425. if (maxing) {
  11426. // Handle invocations in a tight loop.
  11427. clearTimeout(timerId);
  11428. timerId = setTimeout(timerExpired, wait);
  11429. return invokeFunc(lastCallTime);
  11430. }
  11431. }
  11432. if (timerId === undefined) {
  11433. timerId = setTimeout(timerExpired, wait);
  11434. }
  11435. return result;
  11436. }
  11437. debounced.cancel = cancel;
  11438. debounced.flush = flush;
  11439. return debounced;
  11440. }
  11441. /**
  11442. * Defers invoking the `func` until the current call stack has cleared. Any
  11443. * additional arguments are provided to `func` when it's invoked.
  11444. *
  11445. * @static
  11446. * @memberOf _
  11447. * @since 0.1.0
  11448. * @category Function
  11449. * @param {Function} func The function to defer.
  11450. * @param {...*} [args] The arguments to invoke `func` with.
  11451. * @returns {number} Returns the timer id.
  11452. * @example
  11453. *
  11454. * _.defer(function(text) {
  11455. * console.log(text);
  11456. * }, 'deferred');
  11457. * // => Logs 'deferred' after one millisecond.
  11458. */
  11459. var defer = baseRest(function(func, args) {
  11460. return baseDelay(func, 1, args);
  11461. });
  11462. /**
  11463. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11464. * provided to `func` when it's invoked.
  11465. *
  11466. * @static
  11467. * @memberOf _
  11468. * @since 0.1.0
  11469. * @category Function
  11470. * @param {Function} func The function to delay.
  11471. * @param {number} wait The number of milliseconds to delay invocation.
  11472. * @param {...*} [args] The arguments to invoke `func` with.
  11473. * @returns {number} Returns the timer id.
  11474. * @example
  11475. *
  11476. * _.delay(function(text) {
  11477. * console.log(text);
  11478. * }, 1000, 'later');
  11479. * // => Logs 'later' after one second.
  11480. */
  11481. var delay = baseRest(function(func, wait, args) {
  11482. return baseDelay(func, toNumber(wait) || 0, args);
  11483. });
  11484. /**
  11485. * Creates a function that invokes `func` with arguments reversed.
  11486. *
  11487. * @static
  11488. * @memberOf _
  11489. * @since 4.0.0
  11490. * @category Function
  11491. * @param {Function} func The function to flip arguments for.
  11492. * @returns {Function} Returns the new flipped function.
  11493. * @example
  11494. *
  11495. * var flipped = _.flip(function() {
  11496. * return _.toArray(arguments);
  11497. * });
  11498. *
  11499. * flipped('a', 'b', 'c', 'd');
  11500. * // => ['d', 'c', 'b', 'a']
  11501. */
  11502. function flip(func) {
  11503. return createWrap(func, WRAP_FLIP_FLAG);
  11504. }
  11505. /**
  11506. * Creates a function that memoizes the result of `func`. If `resolver` is
  11507. * provided, it determines the cache key for storing the result based on the
  11508. * arguments provided to the memoized function. By default, the first argument
  11509. * provided to the memoized function is used as the map cache key. The `func`
  11510. * is invoked with the `this` binding of the memoized function.
  11511. *
  11512. * **Note:** The cache is exposed as the `cache` property on the memoized
  11513. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11514. * constructor with one whose instances implement the
  11515. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11516. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11517. *
  11518. * @static
  11519. * @memberOf _
  11520. * @since 0.1.0
  11521. * @category Function
  11522. * @param {Function} func The function to have its output memoized.
  11523. * @param {Function} [resolver] The function to resolve the cache key.
  11524. * @returns {Function} Returns the new memoized function.
  11525. * @example
  11526. *
  11527. * var object = { 'a': 1, 'b': 2 };
  11528. * var other = { 'c': 3, 'd': 4 };
  11529. *
  11530. * var values = _.memoize(_.values);
  11531. * values(object);
  11532. * // => [1, 2]
  11533. *
  11534. * values(other);
  11535. * // => [3, 4]
  11536. *
  11537. * object.a = 2;
  11538. * values(object);
  11539. * // => [1, 2]
  11540. *
  11541. * // Modify the result cache.
  11542. * values.cache.set(object, ['a', 'b']);
  11543. * values(object);
  11544. * // => ['a', 'b']
  11545. *
  11546. * // Replace `_.memoize.Cache`.
  11547. * _.memoize.Cache = WeakMap;
  11548. */
  11549. function memoize(func, resolver) {
  11550. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11551. throw new TypeError(FUNC_ERROR_TEXT);
  11552. }
  11553. var memoized = function() {
  11554. var args = arguments,
  11555. key = resolver ? resolver.apply(this, args) : args[0],
  11556. cache = memoized.cache;
  11557. if (cache.has(key)) {
  11558. return cache.get(key);
  11559. }
  11560. var result = func.apply(this, args);
  11561. memoized.cache = cache.set(key, result) || cache;
  11562. return result;
  11563. };
  11564. memoized.cache = new (memoize.Cache || MapCache);
  11565. return memoized;
  11566. }
  11567. // Expose `MapCache`.
  11568. memoize.Cache = MapCache;
  11569. /**
  11570. * Creates a function that negates the result of the predicate `func`. The
  11571. * `func` predicate is invoked with the `this` binding and arguments of the
  11572. * created function.
  11573. *
  11574. * @static
  11575. * @memberOf _
  11576. * @since 3.0.0
  11577. * @category Function
  11578. * @param {Function} predicate The predicate to negate.
  11579. * @returns {Function} Returns the new negated function.
  11580. * @example
  11581. *
  11582. * function isEven(n) {
  11583. * return n % 2 == 0;
  11584. * }
  11585. *
  11586. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11587. * // => [1, 3, 5]
  11588. */
  11589. function negate(predicate) {
  11590. if (typeof predicate != 'function') {
  11591. throw new TypeError(FUNC_ERROR_TEXT);
  11592. }
  11593. return function() {
  11594. var args = arguments;
  11595. switch (args.length) {
  11596. case 0: return !predicate.call(this);
  11597. case 1: return !predicate.call(this, args[0]);
  11598. case 2: return !predicate.call(this, args[0], args[1]);
  11599. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11600. }
  11601. return !predicate.apply(this, args);
  11602. };
  11603. }
  11604. /**
  11605. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11606. * to the function return the value of the first invocation. The `func` is
  11607. * invoked with the `this` binding and arguments of the created function.
  11608. *
  11609. * @static
  11610. * @memberOf _
  11611. * @since 0.1.0
  11612. * @category Function
  11613. * @param {Function} func The function to restrict.
  11614. * @returns {Function} Returns the new restricted function.
  11615. * @example
  11616. *
  11617. * var initialize = _.once(createApplication);
  11618. * initialize();
  11619. * initialize();
  11620. * // => `createApplication` is invoked once
  11621. */
  11622. function once(func) {
  11623. return before(2, func);
  11624. }
  11625. /**
  11626. * Creates a function that invokes `func` with its arguments transformed.
  11627. *
  11628. * @static
  11629. * @since 4.0.0
  11630. * @memberOf _
  11631. * @category Function
  11632. * @param {Function} func The function to wrap.
  11633. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11634. * The argument transforms.
  11635. * @returns {Function} Returns the new function.
  11636. * @example
  11637. *
  11638. * function doubled(n) {
  11639. * return n * 2;
  11640. * }
  11641. *
  11642. * function square(n) {
  11643. * return n * n;
  11644. * }
  11645. *
  11646. * var func = _.overArgs(function(x, y) {
  11647. * return [x, y];
  11648. * }, [square, doubled]);
  11649. *
  11650. * func(9, 3);
  11651. * // => [81, 6]
  11652. *
  11653. * func(10, 5);
  11654. * // => [100, 10]
  11655. */
  11656. var overArgs = castRest(function(func, transforms) {
  11657. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11658. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11659. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11660. var funcsLength = transforms.length;
  11661. return baseRest(function(args) {
  11662. var index = -1,
  11663. length = nativeMin(args.length, funcsLength);
  11664. while (++index < length) {
  11665. args[index] = transforms[index].call(this, args[index]);
  11666. }
  11667. return apply(func, this, args);
  11668. });
  11669. });
  11670. /**
  11671. * Creates a function that invokes `func` with `partials` prepended to the
  11672. * arguments it receives. This method is like `_.bind` except it does **not**
  11673. * alter the `this` binding.
  11674. *
  11675. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11676. * builds, may be used as a placeholder for partially applied arguments.
  11677. *
  11678. * **Note:** This method doesn't set the "length" property of partially
  11679. * applied functions.
  11680. *
  11681. * @static
  11682. * @memberOf _
  11683. * @since 0.2.0
  11684. * @category Function
  11685. * @param {Function} func The function to partially apply arguments to.
  11686. * @param {...*} [partials] The arguments to be partially applied.
  11687. * @returns {Function} Returns the new partially applied function.
  11688. * @example
  11689. *
  11690. * function greet(greeting, name) {
  11691. * return greeting + ' ' + name;
  11692. * }
  11693. *
  11694. * var sayHelloTo = _.partial(greet, 'hello');
  11695. * sayHelloTo('fred');
  11696. * // => 'hello fred'
  11697. *
  11698. * // Partially applied with placeholders.
  11699. * var greetFred = _.partial(greet, _, 'fred');
  11700. * greetFred('hi');
  11701. * // => 'hi fred'
  11702. */
  11703. var partial = baseRest(function(func, partials) {
  11704. var holders = replaceHolders(partials, getHolder(partial));
  11705. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11706. });
  11707. /**
  11708. * This method is like `_.partial` except that partially applied arguments
  11709. * are appended to the arguments it receives.
  11710. *
  11711. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11712. * builds, may be used as a placeholder for partially applied arguments.
  11713. *
  11714. * **Note:** This method doesn't set the "length" property of partially
  11715. * applied functions.
  11716. *
  11717. * @static
  11718. * @memberOf _
  11719. * @since 1.0.0
  11720. * @category Function
  11721. * @param {Function} func The function to partially apply arguments to.
  11722. * @param {...*} [partials] The arguments to be partially applied.
  11723. * @returns {Function} Returns the new partially applied function.
  11724. * @example
  11725. *
  11726. * function greet(greeting, name) {
  11727. * return greeting + ' ' + name;
  11728. * }
  11729. *
  11730. * var greetFred = _.partialRight(greet, 'fred');
  11731. * greetFred('hi');
  11732. * // => 'hi fred'
  11733. *
  11734. * // Partially applied with placeholders.
  11735. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11736. * sayHelloTo('fred');
  11737. * // => 'hello fred'
  11738. */
  11739. var partialRight = baseRest(function(func, partials) {
  11740. var holders = replaceHolders(partials, getHolder(partialRight));
  11741. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11742. });
  11743. /**
  11744. * Creates a function that invokes `func` with arguments arranged according
  11745. * to the specified `indexes` where the argument value at the first index is
  11746. * provided as the first argument, the argument value at the second index is
  11747. * provided as the second argument, and so on.
  11748. *
  11749. * @static
  11750. * @memberOf _
  11751. * @since 3.0.0
  11752. * @category Function
  11753. * @param {Function} func The function to rearrange arguments for.
  11754. * @param {...(number|number[])} indexes The arranged argument indexes.
  11755. * @returns {Function} Returns the new function.
  11756. * @example
  11757. *
  11758. * var rearged = _.rearg(function(a, b, c) {
  11759. * return [a, b, c];
  11760. * }, [2, 0, 1]);
  11761. *
  11762. * rearged('b', 'c', 'a')
  11763. * // => ['a', 'b', 'c']
  11764. */
  11765. var rearg = flatRest(function(func, indexes) {
  11766. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11767. });
  11768. /**
  11769. * Creates a function that invokes `func` with the `this` binding of the
  11770. * created function and arguments from `start` and beyond provided as
  11771. * an array.
  11772. *
  11773. * **Note:** This method is based on the
  11774. * [rest parameter](https://mdn.io/rest_parameters).
  11775. *
  11776. * @static
  11777. * @memberOf _
  11778. * @since 4.0.0
  11779. * @category Function
  11780. * @param {Function} func The function to apply a rest parameter to.
  11781. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11782. * @returns {Function} Returns the new function.
  11783. * @example
  11784. *
  11785. * var say = _.rest(function(what, names) {
  11786. * return what + ' ' + _.initial(names).join(', ') +
  11787. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11788. * });
  11789. *
  11790. * say('hello', 'fred', 'barney', 'pebbles');
  11791. * // => 'hello fred, barney, & pebbles'
  11792. */
  11793. function rest(func, start) {
  11794. if (typeof func != 'function') {
  11795. throw new TypeError(FUNC_ERROR_TEXT);
  11796. }
  11797. start = start === undefined ? start : toInteger(start);
  11798. return baseRest(func, start);
  11799. }
  11800. /**
  11801. * Creates a function that invokes `func` with the `this` binding of the
  11802. * create function and an array of arguments much like
  11803. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11804. *
  11805. * **Note:** This method is based on the
  11806. * [spread operator](https://mdn.io/spread_operator).
  11807. *
  11808. * @static
  11809. * @memberOf _
  11810. * @since 3.2.0
  11811. * @category Function
  11812. * @param {Function} func The function to spread arguments over.
  11813. * @param {number} [start=0] The start position of the spread.
  11814. * @returns {Function} Returns the new function.
  11815. * @example
  11816. *
  11817. * var say = _.spread(function(who, what) {
  11818. * return who + ' says ' + what;
  11819. * });
  11820. *
  11821. * say(['fred', 'hello']);
  11822. * // => 'fred says hello'
  11823. *
  11824. * var numbers = Promise.all([
  11825. * Promise.resolve(40),
  11826. * Promise.resolve(36)
  11827. * ]);
  11828. *
  11829. * numbers.then(_.spread(function(x, y) {
  11830. * return x + y;
  11831. * }));
  11832. * // => a Promise of 76
  11833. */
  11834. function spread(func, start) {
  11835. if (typeof func != 'function') {
  11836. throw new TypeError(FUNC_ERROR_TEXT);
  11837. }
  11838. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11839. return baseRest(function(args) {
  11840. var array = args[start],
  11841. otherArgs = castSlice(args, 0, start);
  11842. if (array) {
  11843. arrayPush(otherArgs, array);
  11844. }
  11845. return apply(func, this, otherArgs);
  11846. });
  11847. }
  11848. /**
  11849. * Creates a throttled function that only invokes `func` at most once per
  11850. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11851. * method to cancel delayed `func` invocations and a `flush` method to
  11852. * immediately invoke them. Provide `options` to indicate whether `func`
  11853. * should be invoked on the leading and/or trailing edge of the `wait`
  11854. * timeout. The `func` is invoked with the last arguments provided to the
  11855. * throttled function. Subsequent calls to the throttled function return the
  11856. * result of the last `func` invocation.
  11857. *
  11858. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11859. * invoked on the trailing edge of the timeout only if the throttled function
  11860. * is invoked more than once during the `wait` timeout.
  11861. *
  11862. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11863. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11864. *
  11865. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11866. * for details over the differences between `_.throttle` and `_.debounce`.
  11867. *
  11868. * @static
  11869. * @memberOf _
  11870. * @since 0.1.0
  11871. * @category Function
  11872. * @param {Function} func The function to throttle.
  11873. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11874. * @param {Object} [options={}] The options object.
  11875. * @param {boolean} [options.leading=true]
  11876. * Specify invoking on the leading edge of the timeout.
  11877. * @param {boolean} [options.trailing=true]
  11878. * Specify invoking on the trailing edge of the timeout.
  11879. * @returns {Function} Returns the new throttled function.
  11880. * @example
  11881. *
  11882. * // Avoid excessively updating the position while scrolling.
  11883. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11884. *
  11885. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11886. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11887. * jQuery(element).on('click', throttled);
  11888. *
  11889. * // Cancel the trailing throttled invocation.
  11890. * jQuery(window).on('popstate', throttled.cancel);
  11891. */
  11892. function throttle(func, wait, options) {
  11893. var leading = true,
  11894. trailing = true;
  11895. if (typeof func != 'function') {
  11896. throw new TypeError(FUNC_ERROR_TEXT);
  11897. }
  11898. if (isObject(options)) {
  11899. leading = 'leading' in options ? !!options.leading : leading;
  11900. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11901. }
  11902. return debounce(func, wait, {
  11903. 'leading': leading,
  11904. 'maxWait': wait,
  11905. 'trailing': trailing
  11906. });
  11907. }
  11908. /**
  11909. * Creates a function that accepts up to one argument, ignoring any
  11910. * additional arguments.
  11911. *
  11912. * @static
  11913. * @memberOf _
  11914. * @since 4.0.0
  11915. * @category Function
  11916. * @param {Function} func The function to cap arguments for.
  11917. * @returns {Function} Returns the new capped function.
  11918. * @example
  11919. *
  11920. * _.map(['6', '8', '10'], _.unary(parseInt));
  11921. * // => [6, 8, 10]
  11922. */
  11923. function unary(func) {
  11924. return ary(func, 1);
  11925. }
  11926. /**
  11927. * Creates a function that provides `value` to `wrapper` as its first
  11928. * argument. Any additional arguments provided to the function are appended
  11929. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11930. * binding of the created function.
  11931. *
  11932. * @static
  11933. * @memberOf _
  11934. * @since 0.1.0
  11935. * @category Function
  11936. * @param {*} value The value to wrap.
  11937. * @param {Function} [wrapper=identity] The wrapper function.
  11938. * @returns {Function} Returns the new function.
  11939. * @example
  11940. *
  11941. * var p = _.wrap(_.escape, function(func, text) {
  11942. * return '<p>' + func(text) + '</p>';
  11943. * });
  11944. *
  11945. * p('fred, barney, & pebbles');
  11946. * // => '<p>fred, barney, &amp; pebbles</p>'
  11947. */
  11948. function wrap(value, wrapper) {
  11949. return partial(castFunction(wrapper), value);
  11950. }
  11951. /*------------------------------------------------------------------------*/
  11952. /**
  11953. * Casts `value` as an array if it's not one.
  11954. *
  11955. * @static
  11956. * @memberOf _
  11957. * @since 4.4.0
  11958. * @category Lang
  11959. * @param {*} value The value to inspect.
  11960. * @returns {Array} Returns the cast array.
  11961. * @example
  11962. *
  11963. * _.castArray(1);
  11964. * // => [1]
  11965. *
  11966. * _.castArray({ 'a': 1 });
  11967. * // => [{ 'a': 1 }]
  11968. *
  11969. * _.castArray('abc');
  11970. * // => ['abc']
  11971. *
  11972. * _.castArray(null);
  11973. * // => [null]
  11974. *
  11975. * _.castArray(undefined);
  11976. * // => [undefined]
  11977. *
  11978. * _.castArray();
  11979. * // => []
  11980. *
  11981. * var array = [1, 2, 3];
  11982. * console.log(_.castArray(array) === array);
  11983. * // => true
  11984. */
  11985. function castArray() {
  11986. if (!arguments.length) {
  11987. return [];
  11988. }
  11989. var value = arguments[0];
  11990. return isArray(value) ? value : [value];
  11991. }
  11992. /**
  11993. * Creates a shallow clone of `value`.
  11994. *
  11995. * **Note:** This method is loosely based on the
  11996. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11997. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11998. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11999. * arrays. The own enumerable properties of `arguments` objects are cloned
  12000. * as plain objects. An empty object is returned for uncloneable values such
  12001. * as error objects, functions, DOM nodes, and WeakMaps.
  12002. *
  12003. * @static
  12004. * @memberOf _
  12005. * @since 0.1.0
  12006. * @category Lang
  12007. * @param {*} value The value to clone.
  12008. * @returns {*} Returns the cloned value.
  12009. * @see _.cloneDeep
  12010. * @example
  12011. *
  12012. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  12013. *
  12014. * var shallow = _.clone(objects);
  12015. * console.log(shallow[0] === objects[0]);
  12016. * // => true
  12017. */
  12018. function clone(value) {
  12019. return baseClone(value, CLONE_SYMBOLS_FLAG);
  12020. }
  12021. /**
  12022. * This method is like `_.clone` except that it accepts `customizer` which
  12023. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  12024. * cloning is handled by the method instead. The `customizer` is invoked with
  12025. * up to four arguments; (value [, index|key, object, stack]).
  12026. *
  12027. * @static
  12028. * @memberOf _
  12029. * @since 4.0.0
  12030. * @category Lang
  12031. * @param {*} value The value to clone.
  12032. * @param {Function} [customizer] The function to customize cloning.
  12033. * @returns {*} Returns the cloned value.
  12034. * @see _.cloneDeepWith
  12035. * @example
  12036. *
  12037. * function customizer(value) {
  12038. * if (_.isElement(value)) {
  12039. * return value.cloneNode(false);
  12040. * }
  12041. * }
  12042. *
  12043. * var el = _.cloneWith(document.body, customizer);
  12044. *
  12045. * console.log(el === document.body);
  12046. * // => false
  12047. * console.log(el.nodeName);
  12048. * // => 'BODY'
  12049. * console.log(el.childNodes.length);
  12050. * // => 0
  12051. */
  12052. function cloneWith(value, customizer) {
  12053. customizer = typeof customizer == 'function' ? customizer : undefined;
  12054. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  12055. }
  12056. /**
  12057. * This method is like `_.clone` except that it recursively clones `value`.
  12058. *
  12059. * @static
  12060. * @memberOf _
  12061. * @since 1.0.0
  12062. * @category Lang
  12063. * @param {*} value The value to recursively clone.
  12064. * @returns {*} Returns the deep cloned value.
  12065. * @see _.clone
  12066. * @example
  12067. *
  12068. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  12069. *
  12070. * var deep = _.cloneDeep(objects);
  12071. * console.log(deep[0] === objects[0]);
  12072. * // => false
  12073. */
  12074. function cloneDeep(value) {
  12075. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  12076. }
  12077. /**
  12078. * This method is like `_.cloneWith` except that it recursively clones `value`.
  12079. *
  12080. * @static
  12081. * @memberOf _
  12082. * @since 4.0.0
  12083. * @category Lang
  12084. * @param {*} value The value to recursively clone.
  12085. * @param {Function} [customizer] The function to customize cloning.
  12086. * @returns {*} Returns the deep cloned value.
  12087. * @see _.cloneWith
  12088. * @example
  12089. *
  12090. * function customizer(value) {
  12091. * if (_.isElement(value)) {
  12092. * return value.cloneNode(true);
  12093. * }
  12094. * }
  12095. *
  12096. * var el = _.cloneDeepWith(document.body, customizer);
  12097. *
  12098. * console.log(el === document.body);
  12099. * // => false
  12100. * console.log(el.nodeName);
  12101. * // => 'BODY'
  12102. * console.log(el.childNodes.length);
  12103. * // => 20
  12104. */
  12105. function cloneDeepWith(value, customizer) {
  12106. customizer = typeof customizer == 'function' ? customizer : undefined;
  12107. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  12108. }
  12109. /**
  12110. * Checks if `object` conforms to `source` by invoking the predicate
  12111. * properties of `source` with the corresponding property values of `object`.
  12112. *
  12113. * **Note:** This method is equivalent to `_.conforms` when `source` is
  12114. * partially applied.
  12115. *
  12116. * @static
  12117. * @memberOf _
  12118. * @since 4.14.0
  12119. * @category Lang
  12120. * @param {Object} object The object to inspect.
  12121. * @param {Object} source The object of property predicates to conform to.
  12122. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  12123. * @example
  12124. *
  12125. * var object = { 'a': 1, 'b': 2 };
  12126. *
  12127. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  12128. * // => true
  12129. *
  12130. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  12131. * // => false
  12132. */
  12133. function conformsTo(object, source) {
  12134. return source == null || baseConformsTo(object, source, keys(source));
  12135. }
  12136. /**
  12137. * Performs a
  12138. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12139. * comparison between two values to determine if they are equivalent.
  12140. *
  12141. * @static
  12142. * @memberOf _
  12143. * @since 4.0.0
  12144. * @category Lang
  12145. * @param {*} value The value to compare.
  12146. * @param {*} other The other value to compare.
  12147. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12148. * @example
  12149. *
  12150. * var object = { 'a': 1 };
  12151. * var other = { 'a': 1 };
  12152. *
  12153. * _.eq(object, object);
  12154. * // => true
  12155. *
  12156. * _.eq(object, other);
  12157. * // => false
  12158. *
  12159. * _.eq('a', 'a');
  12160. * // => true
  12161. *
  12162. * _.eq('a', Object('a'));
  12163. * // => false
  12164. *
  12165. * _.eq(NaN, NaN);
  12166. * // => true
  12167. */
  12168. function eq(value, other) {
  12169. return value === other || (value !== value && other !== other);
  12170. }
  12171. /**
  12172. * Checks if `value` is greater than `other`.
  12173. *
  12174. * @static
  12175. * @memberOf _
  12176. * @since 3.9.0
  12177. * @category Lang
  12178. * @param {*} value The value to compare.
  12179. * @param {*} other The other value to compare.
  12180. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  12181. * else `false`.
  12182. * @see _.lt
  12183. * @example
  12184. *
  12185. * _.gt(3, 1);
  12186. * // => true
  12187. *
  12188. * _.gt(3, 3);
  12189. * // => false
  12190. *
  12191. * _.gt(1, 3);
  12192. * // => false
  12193. */
  12194. var gt = createRelationalOperation(baseGt);
  12195. /**
  12196. * Checks if `value` is greater than or equal to `other`.
  12197. *
  12198. * @static
  12199. * @memberOf _
  12200. * @since 3.9.0
  12201. * @category Lang
  12202. * @param {*} value The value to compare.
  12203. * @param {*} other The other value to compare.
  12204. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  12205. * `other`, else `false`.
  12206. * @see _.lte
  12207. * @example
  12208. *
  12209. * _.gte(3, 1);
  12210. * // => true
  12211. *
  12212. * _.gte(3, 3);
  12213. * // => true
  12214. *
  12215. * _.gte(1, 3);
  12216. * // => false
  12217. */
  12218. var gte = createRelationalOperation(function(value, other) {
  12219. return value >= other;
  12220. });
  12221. /**
  12222. * Checks if `value` is likely an `arguments` object.
  12223. *
  12224. * @static
  12225. * @memberOf _
  12226. * @since 0.1.0
  12227. * @category Lang
  12228. * @param {*} value The value to check.
  12229. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  12230. * else `false`.
  12231. * @example
  12232. *
  12233. * _.isArguments(function() { return arguments; }());
  12234. * // => true
  12235. *
  12236. * _.isArguments([1, 2, 3]);
  12237. * // => false
  12238. */
  12239. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  12240. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  12241. !propertyIsEnumerable.call(value, 'callee');
  12242. };
  12243. /**
  12244. * Checks if `value` is classified as an `Array` object.
  12245. *
  12246. * @static
  12247. * @memberOf _
  12248. * @since 0.1.0
  12249. * @category Lang
  12250. * @param {*} value The value to check.
  12251. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  12252. * @example
  12253. *
  12254. * _.isArray([1, 2, 3]);
  12255. * // => true
  12256. *
  12257. * _.isArray(document.body.children);
  12258. * // => false
  12259. *
  12260. * _.isArray('abc');
  12261. * // => false
  12262. *
  12263. * _.isArray(_.noop);
  12264. * // => false
  12265. */
  12266. var isArray = Array.isArray;
  12267. /**
  12268. * Checks if `value` is classified as an `ArrayBuffer` object.
  12269. *
  12270. * @static
  12271. * @memberOf _
  12272. * @since 4.3.0
  12273. * @category Lang
  12274. * @param {*} value The value to check.
  12275. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  12276. * @example
  12277. *
  12278. * _.isArrayBuffer(new ArrayBuffer(2));
  12279. * // => true
  12280. *
  12281. * _.isArrayBuffer(new Array(2));
  12282. * // => false
  12283. */
  12284. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  12285. /**
  12286. * Checks if `value` is array-like. A value is considered array-like if it's
  12287. * not a function and has a `value.length` that's an integer greater than or
  12288. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  12289. *
  12290. * @static
  12291. * @memberOf _
  12292. * @since 4.0.0
  12293. * @category Lang
  12294. * @param {*} value The value to check.
  12295. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  12296. * @example
  12297. *
  12298. * _.isArrayLike([1, 2, 3]);
  12299. * // => true
  12300. *
  12301. * _.isArrayLike(document.body.children);
  12302. * // => true
  12303. *
  12304. * _.isArrayLike('abc');
  12305. * // => true
  12306. *
  12307. * _.isArrayLike(_.noop);
  12308. * // => false
  12309. */
  12310. function isArrayLike(value) {
  12311. return value != null && isLength(value.length) && !isFunction(value);
  12312. }
  12313. /**
  12314. * This method is like `_.isArrayLike` except that it also checks if `value`
  12315. * is an object.
  12316. *
  12317. * @static
  12318. * @memberOf _
  12319. * @since 4.0.0
  12320. * @category Lang
  12321. * @param {*} value The value to check.
  12322. * @returns {boolean} Returns `true` if `value` is an array-like object,
  12323. * else `false`.
  12324. * @example
  12325. *
  12326. * _.isArrayLikeObject([1, 2, 3]);
  12327. * // => true
  12328. *
  12329. * _.isArrayLikeObject(document.body.children);
  12330. * // => true
  12331. *
  12332. * _.isArrayLikeObject('abc');
  12333. * // => false
  12334. *
  12335. * _.isArrayLikeObject(_.noop);
  12336. * // => false
  12337. */
  12338. function isArrayLikeObject(value) {
  12339. return isObjectLike(value) && isArrayLike(value);
  12340. }
  12341. /**
  12342. * Checks if `value` is classified as a boolean primitive or object.
  12343. *
  12344. * @static
  12345. * @memberOf _
  12346. * @since 0.1.0
  12347. * @category Lang
  12348. * @param {*} value The value to check.
  12349. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  12350. * @example
  12351. *
  12352. * _.isBoolean(false);
  12353. * // => true
  12354. *
  12355. * _.isBoolean(null);
  12356. * // => false
  12357. */
  12358. function isBoolean(value) {
  12359. return value === true || value === false ||
  12360. (isObjectLike(value) && baseGetTag(value) == boolTag);
  12361. }
  12362. /**
  12363. * Checks if `value` is a buffer.
  12364. *
  12365. * @static
  12366. * @memberOf _
  12367. * @since 4.3.0
  12368. * @category Lang
  12369. * @param {*} value The value to check.
  12370. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  12371. * @example
  12372. *
  12373. * _.isBuffer(new Buffer(2));
  12374. * // => true
  12375. *
  12376. * _.isBuffer(new Uint8Array(2));
  12377. * // => false
  12378. */
  12379. var isBuffer = nativeIsBuffer || stubFalse;
  12380. /**
  12381. * Checks if `value` is classified as a `Date` object.
  12382. *
  12383. * @static
  12384. * @memberOf _
  12385. * @since 0.1.0
  12386. * @category Lang
  12387. * @param {*} value The value to check.
  12388. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  12389. * @example
  12390. *
  12391. * _.isDate(new Date);
  12392. * // => true
  12393. *
  12394. * _.isDate('Mon April 23 2012');
  12395. * // => false
  12396. */
  12397. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  12398. /**
  12399. * Checks if `value` is likely a DOM element.
  12400. *
  12401. * @static
  12402. * @memberOf _
  12403. * @since 0.1.0
  12404. * @category Lang
  12405. * @param {*} value The value to check.
  12406. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  12407. * @example
  12408. *
  12409. * _.isElement(document.body);
  12410. * // => true
  12411. *
  12412. * _.isElement('<body>');
  12413. * // => false
  12414. */
  12415. function isElement(value) {
  12416. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  12417. }
  12418. /**
  12419. * Checks if `value` is an empty object, collection, map, or set.
  12420. *
  12421. * Objects are considered empty if they have no own enumerable string keyed
  12422. * properties.
  12423. *
  12424. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  12425. * jQuery-like collections are considered empty if they have a `length` of `0`.
  12426. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  12427. *
  12428. * @static
  12429. * @memberOf _
  12430. * @since 0.1.0
  12431. * @category Lang
  12432. * @param {*} value The value to check.
  12433. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  12434. * @example
  12435. *
  12436. * _.isEmpty(null);
  12437. * // => true
  12438. *
  12439. * _.isEmpty(true);
  12440. * // => true
  12441. *
  12442. * _.isEmpty(1);
  12443. * // => true
  12444. *
  12445. * _.isEmpty([1, 2, 3]);
  12446. * // => false
  12447. *
  12448. * _.isEmpty({ 'a': 1 });
  12449. * // => false
  12450. */
  12451. function isEmpty(value) {
  12452. if (value == null) {
  12453. return true;
  12454. }
  12455. if (isArrayLike(value) &&
  12456. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  12457. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12458. return !value.length;
  12459. }
  12460. var tag = getTag(value);
  12461. if (tag == mapTag || tag == setTag) {
  12462. return !value.size;
  12463. }
  12464. if (isPrototype(value)) {
  12465. return !baseKeys(value).length;
  12466. }
  12467. for (var key in value) {
  12468. if (hasOwnProperty.call(value, key)) {
  12469. return false;
  12470. }
  12471. }
  12472. return true;
  12473. }
  12474. /**
  12475. * Performs a deep comparison between two values to determine if they are
  12476. * equivalent.
  12477. *
  12478. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12479. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12480. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12481. * by their own, not inherited, enumerable properties. Functions and DOM
  12482. * nodes are compared by strict equality, i.e. `===`.
  12483. *
  12484. * @static
  12485. * @memberOf _
  12486. * @since 0.1.0
  12487. * @category Lang
  12488. * @param {*} value The value to compare.
  12489. * @param {*} other The other value to compare.
  12490. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12491. * @example
  12492. *
  12493. * var object = { 'a': 1 };
  12494. * var other = { 'a': 1 };
  12495. *
  12496. * _.isEqual(object, other);
  12497. * // => true
  12498. *
  12499. * object === other;
  12500. * // => false
  12501. */
  12502. function isEqual(value, other) {
  12503. return baseIsEqual(value, other);
  12504. }
  12505. /**
  12506. * This method is like `_.isEqual` except that it accepts `customizer` which
  12507. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12508. * are handled by the method instead. The `customizer` is invoked with up to
  12509. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12510. *
  12511. * @static
  12512. * @memberOf _
  12513. * @since 4.0.0
  12514. * @category Lang
  12515. * @param {*} value The value to compare.
  12516. * @param {*} other The other value to compare.
  12517. * @param {Function} [customizer] The function to customize comparisons.
  12518. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12519. * @example
  12520. *
  12521. * function isGreeting(value) {
  12522. * return /^h(?:i|ello)$/.test(value);
  12523. * }
  12524. *
  12525. * function customizer(objValue, othValue) {
  12526. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12527. * return true;
  12528. * }
  12529. * }
  12530. *
  12531. * var array = ['hello', 'goodbye'];
  12532. * var other = ['hi', 'goodbye'];
  12533. *
  12534. * _.isEqualWith(array, other, customizer);
  12535. * // => true
  12536. */
  12537. function isEqualWith(value, other, customizer) {
  12538. customizer = typeof customizer == 'function' ? customizer : undefined;
  12539. var result = customizer ? customizer(value, other) : undefined;
  12540. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12541. }
  12542. /**
  12543. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12544. * `SyntaxError`, `TypeError`, or `URIError` object.
  12545. *
  12546. * @static
  12547. * @memberOf _
  12548. * @since 3.0.0
  12549. * @category Lang
  12550. * @param {*} value The value to check.
  12551. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12552. * @example
  12553. *
  12554. * _.isError(new Error);
  12555. * // => true
  12556. *
  12557. * _.isError(Error);
  12558. * // => false
  12559. */
  12560. function isError(value) {
  12561. if (!isObjectLike(value)) {
  12562. return false;
  12563. }
  12564. var tag = baseGetTag(value);
  12565. return tag == errorTag || tag == domExcTag ||
  12566. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12567. }
  12568. /**
  12569. * Checks if `value` is a finite primitive number.
  12570. *
  12571. * **Note:** This method is based on
  12572. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12573. *
  12574. * @static
  12575. * @memberOf _
  12576. * @since 0.1.0
  12577. * @category Lang
  12578. * @param {*} value The value to check.
  12579. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12580. * @example
  12581. *
  12582. * _.isFinite(3);
  12583. * // => true
  12584. *
  12585. * _.isFinite(Number.MIN_VALUE);
  12586. * // => true
  12587. *
  12588. * _.isFinite(Infinity);
  12589. * // => false
  12590. *
  12591. * _.isFinite('3');
  12592. * // => false
  12593. */
  12594. function isFinite(value) {
  12595. return typeof value == 'number' && nativeIsFinite(value);
  12596. }
  12597. /**
  12598. * Checks if `value` is classified as a `Function` object.
  12599. *
  12600. * @static
  12601. * @memberOf _
  12602. * @since 0.1.0
  12603. * @category Lang
  12604. * @param {*} value The value to check.
  12605. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12606. * @example
  12607. *
  12608. * _.isFunction(_);
  12609. * // => true
  12610. *
  12611. * _.isFunction(/abc/);
  12612. * // => false
  12613. */
  12614. function isFunction(value) {
  12615. if (!isObject(value)) {
  12616. return false;
  12617. }
  12618. // The use of `Object#toString` avoids issues with the `typeof` operator
  12619. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12620. var tag = baseGetTag(value);
  12621. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12622. }
  12623. /**
  12624. * Checks if `value` is an integer.
  12625. *
  12626. * **Note:** This method is based on
  12627. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12628. *
  12629. * @static
  12630. * @memberOf _
  12631. * @since 4.0.0
  12632. * @category Lang
  12633. * @param {*} value The value to check.
  12634. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12635. * @example
  12636. *
  12637. * _.isInteger(3);
  12638. * // => true
  12639. *
  12640. * _.isInteger(Number.MIN_VALUE);
  12641. * // => false
  12642. *
  12643. * _.isInteger(Infinity);
  12644. * // => false
  12645. *
  12646. * _.isInteger('3');
  12647. * // => false
  12648. */
  12649. function isInteger(value) {
  12650. return typeof value == 'number' && value == toInteger(value);
  12651. }
  12652. /**
  12653. * Checks if `value` is a valid array-like length.
  12654. *
  12655. * **Note:** This method is loosely based on
  12656. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12657. *
  12658. * @static
  12659. * @memberOf _
  12660. * @since 4.0.0
  12661. * @category Lang
  12662. * @param {*} value The value to check.
  12663. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12664. * @example
  12665. *
  12666. * _.isLength(3);
  12667. * // => true
  12668. *
  12669. * _.isLength(Number.MIN_VALUE);
  12670. * // => false
  12671. *
  12672. * _.isLength(Infinity);
  12673. * // => false
  12674. *
  12675. * _.isLength('3');
  12676. * // => false
  12677. */
  12678. function isLength(value) {
  12679. return typeof value == 'number' &&
  12680. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12681. }
  12682. /**
  12683. * Checks if `value` is the
  12684. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12685. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12686. *
  12687. * @static
  12688. * @memberOf _
  12689. * @since 0.1.0
  12690. * @category Lang
  12691. * @param {*} value The value to check.
  12692. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12693. * @example
  12694. *
  12695. * _.isObject({});
  12696. * // => true
  12697. *
  12698. * _.isObject([1, 2, 3]);
  12699. * // => true
  12700. *
  12701. * _.isObject(_.noop);
  12702. * // => true
  12703. *
  12704. * _.isObject(null);
  12705. * // => false
  12706. */
  12707. function isObject(value) {
  12708. var type = typeof value;
  12709. return value != null && (type == 'object' || type == 'function');
  12710. }
  12711. /**
  12712. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12713. * and has a `typeof` result of "object".
  12714. *
  12715. * @static
  12716. * @memberOf _
  12717. * @since 4.0.0
  12718. * @category Lang
  12719. * @param {*} value The value to check.
  12720. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12721. * @example
  12722. *
  12723. * _.isObjectLike({});
  12724. * // => true
  12725. *
  12726. * _.isObjectLike([1, 2, 3]);
  12727. * // => true
  12728. *
  12729. * _.isObjectLike(_.noop);
  12730. * // => false
  12731. *
  12732. * _.isObjectLike(null);
  12733. * // => false
  12734. */
  12735. function isObjectLike(value) {
  12736. return value != null && typeof value == 'object';
  12737. }
  12738. /**
  12739. * Checks if `value` is classified as a `Map` object.
  12740. *
  12741. * @static
  12742. * @memberOf _
  12743. * @since 4.3.0
  12744. * @category Lang
  12745. * @param {*} value The value to check.
  12746. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12747. * @example
  12748. *
  12749. * _.isMap(new Map);
  12750. * // => true
  12751. *
  12752. * _.isMap(new WeakMap);
  12753. * // => false
  12754. */
  12755. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12756. /**
  12757. * Performs a partial deep comparison between `object` and `source` to
  12758. * determine if `object` contains equivalent property values.
  12759. *
  12760. * **Note:** This method is equivalent to `_.matches` when `source` is
  12761. * partially applied.
  12762. *
  12763. * Partial comparisons will match empty array and empty object `source`
  12764. * values against any array or object value, respectively. See `_.isEqual`
  12765. * for a list of supported value comparisons.
  12766. *
  12767. * @static
  12768. * @memberOf _
  12769. * @since 3.0.0
  12770. * @category Lang
  12771. * @param {Object} object The object to inspect.
  12772. * @param {Object} source The object of property values to match.
  12773. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12774. * @example
  12775. *
  12776. * var object = { 'a': 1, 'b': 2 };
  12777. *
  12778. * _.isMatch(object, { 'b': 2 });
  12779. * // => true
  12780. *
  12781. * _.isMatch(object, { 'b': 1 });
  12782. * // => false
  12783. */
  12784. function isMatch(object, source) {
  12785. return object === source || baseIsMatch(object, source, getMatchData(source));
  12786. }
  12787. /**
  12788. * This method is like `_.isMatch` except that it accepts `customizer` which
  12789. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12790. * are handled by the method instead. The `customizer` is invoked with five
  12791. * arguments: (objValue, srcValue, index|key, object, source).
  12792. *
  12793. * @static
  12794. * @memberOf _
  12795. * @since 4.0.0
  12796. * @category Lang
  12797. * @param {Object} object The object to inspect.
  12798. * @param {Object} source The object of property values to match.
  12799. * @param {Function} [customizer] The function to customize comparisons.
  12800. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12801. * @example
  12802. *
  12803. * function isGreeting(value) {
  12804. * return /^h(?:i|ello)$/.test(value);
  12805. * }
  12806. *
  12807. * function customizer(objValue, srcValue) {
  12808. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12809. * return true;
  12810. * }
  12811. * }
  12812. *
  12813. * var object = { 'greeting': 'hello' };
  12814. * var source = { 'greeting': 'hi' };
  12815. *
  12816. * _.isMatchWith(object, source, customizer);
  12817. * // => true
  12818. */
  12819. function isMatchWith(object, source, customizer) {
  12820. customizer = typeof customizer == 'function' ? customizer : undefined;
  12821. return baseIsMatch(object, source, getMatchData(source), customizer);
  12822. }
  12823. /**
  12824. * Checks if `value` is `NaN`.
  12825. *
  12826. * **Note:** This method is based on
  12827. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12828. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12829. * `undefined` and other non-number values.
  12830. *
  12831. * @static
  12832. * @memberOf _
  12833. * @since 0.1.0
  12834. * @category Lang
  12835. * @param {*} value The value to check.
  12836. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12837. * @example
  12838. *
  12839. * _.isNaN(NaN);
  12840. * // => true
  12841. *
  12842. * _.isNaN(new Number(NaN));
  12843. * // => true
  12844. *
  12845. * isNaN(undefined);
  12846. * // => true
  12847. *
  12848. * _.isNaN(undefined);
  12849. * // => false
  12850. */
  12851. function isNaN(value) {
  12852. // An `NaN` primitive is the only value that is not equal to itself.
  12853. // Perform the `toStringTag` check first to avoid errors with some
  12854. // ActiveX objects in IE.
  12855. return isNumber(value) && value != +value;
  12856. }
  12857. /**
  12858. * Checks if `value` is a pristine native function.
  12859. *
  12860. * **Note:** This method can't reliably detect native functions in the presence
  12861. * of the core-js package because core-js circumvents this kind of detection.
  12862. * Despite multiple requests, the core-js maintainer has made it clear: any
  12863. * attempt to fix the detection will be obstructed. As a result, we're left
  12864. * with little choice but to throw an error. Unfortunately, this also affects
  12865. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12866. * which rely on core-js.
  12867. *
  12868. * @static
  12869. * @memberOf _
  12870. * @since 3.0.0
  12871. * @category Lang
  12872. * @param {*} value The value to check.
  12873. * @returns {boolean} Returns `true` if `value` is a native function,
  12874. * else `false`.
  12875. * @example
  12876. *
  12877. * _.isNative(Array.prototype.push);
  12878. * // => true
  12879. *
  12880. * _.isNative(_);
  12881. * // => false
  12882. */
  12883. function isNative(value) {
  12884. if (isMaskable(value)) {
  12885. throw new Error(CORE_ERROR_TEXT);
  12886. }
  12887. return baseIsNative(value);
  12888. }
  12889. /**
  12890. * Checks if `value` is `null`.
  12891. *
  12892. * @static
  12893. * @memberOf _
  12894. * @since 0.1.0
  12895. * @category Lang
  12896. * @param {*} value The value to check.
  12897. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12898. * @example
  12899. *
  12900. * _.isNull(null);
  12901. * // => true
  12902. *
  12903. * _.isNull(void 0);
  12904. * // => false
  12905. */
  12906. function isNull(value) {
  12907. return value === null;
  12908. }
  12909. /**
  12910. * Checks if `value` is `null` or `undefined`.
  12911. *
  12912. * @static
  12913. * @memberOf _
  12914. * @since 4.0.0
  12915. * @category Lang
  12916. * @param {*} value The value to check.
  12917. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12918. * @example
  12919. *
  12920. * _.isNil(null);
  12921. * // => true
  12922. *
  12923. * _.isNil(void 0);
  12924. * // => true
  12925. *
  12926. * _.isNil(NaN);
  12927. * // => false
  12928. */
  12929. function isNil(value) {
  12930. return value == null;
  12931. }
  12932. /**
  12933. * Checks if `value` is classified as a `Number` primitive or object.
  12934. *
  12935. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12936. * classified as numbers, use the `_.isFinite` method.
  12937. *
  12938. * @static
  12939. * @memberOf _
  12940. * @since 0.1.0
  12941. * @category Lang
  12942. * @param {*} value The value to check.
  12943. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12944. * @example
  12945. *
  12946. * _.isNumber(3);
  12947. * // => true
  12948. *
  12949. * _.isNumber(Number.MIN_VALUE);
  12950. * // => true
  12951. *
  12952. * _.isNumber(Infinity);
  12953. * // => true
  12954. *
  12955. * _.isNumber('3');
  12956. * // => false
  12957. */
  12958. function isNumber(value) {
  12959. return typeof value == 'number' ||
  12960. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12961. }
  12962. /**
  12963. * Checks if `value` is a plain object, that is, an object created by the
  12964. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12965. *
  12966. * @static
  12967. * @memberOf _
  12968. * @since 0.8.0
  12969. * @category Lang
  12970. * @param {*} value The value to check.
  12971. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12972. * @example
  12973. *
  12974. * function Foo() {
  12975. * this.a = 1;
  12976. * }
  12977. *
  12978. * _.isPlainObject(new Foo);
  12979. * // => false
  12980. *
  12981. * _.isPlainObject([1, 2, 3]);
  12982. * // => false
  12983. *
  12984. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12985. * // => true
  12986. *
  12987. * _.isPlainObject(Object.create(null));
  12988. * // => true
  12989. */
  12990. function isPlainObject(value) {
  12991. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12992. return false;
  12993. }
  12994. var proto = getPrototype(value);
  12995. if (proto === null) {
  12996. return true;
  12997. }
  12998. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12999. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  13000. funcToString.call(Ctor) == objectCtorString;
  13001. }
  13002. /**
  13003. * Checks if `value` is classified as a `RegExp` object.
  13004. *
  13005. * @static
  13006. * @memberOf _
  13007. * @since 0.1.0
  13008. * @category Lang
  13009. * @param {*} value The value to check.
  13010. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  13011. * @example
  13012. *
  13013. * _.isRegExp(/abc/);
  13014. * // => true
  13015. *
  13016. * _.isRegExp('/abc/');
  13017. * // => false
  13018. */
  13019. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  13020. /**
  13021. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  13022. * double precision number which isn't the result of a rounded unsafe integer.
  13023. *
  13024. * **Note:** This method is based on
  13025. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  13026. *
  13027. * @static
  13028. * @memberOf _
  13029. * @since 4.0.0
  13030. * @category Lang
  13031. * @param {*} value The value to check.
  13032. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  13033. * @example
  13034. *
  13035. * _.isSafeInteger(3);
  13036. * // => true
  13037. *
  13038. * _.isSafeInteger(Number.MIN_VALUE);
  13039. * // => false
  13040. *
  13041. * _.isSafeInteger(Infinity);
  13042. * // => false
  13043. *
  13044. * _.isSafeInteger('3');
  13045. * // => false
  13046. */
  13047. function isSafeInteger(value) {
  13048. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  13049. }
  13050. /**
  13051. * Checks if `value` is classified as a `Set` object.
  13052. *
  13053. * @static
  13054. * @memberOf _
  13055. * @since 4.3.0
  13056. * @category Lang
  13057. * @param {*} value The value to check.
  13058. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  13059. * @example
  13060. *
  13061. * _.isSet(new Set);
  13062. * // => true
  13063. *
  13064. * _.isSet(new WeakSet);
  13065. * // => false
  13066. */
  13067. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  13068. /**
  13069. * Checks if `value` is classified as a `String` primitive or object.
  13070. *
  13071. * @static
  13072. * @since 0.1.0
  13073. * @memberOf _
  13074. * @category Lang
  13075. * @param {*} value The value to check.
  13076. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  13077. * @example
  13078. *
  13079. * _.isString('abc');
  13080. * // => true
  13081. *
  13082. * _.isString(1);
  13083. * // => false
  13084. */
  13085. function isString(value) {
  13086. return typeof value == 'string' ||
  13087. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  13088. }
  13089. /**
  13090. * Checks if `value` is classified as a `Symbol` primitive or object.
  13091. *
  13092. * @static
  13093. * @memberOf _
  13094. * @since 4.0.0
  13095. * @category Lang
  13096. * @param {*} value The value to check.
  13097. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  13098. * @example
  13099. *
  13100. * _.isSymbol(Symbol.iterator);
  13101. * // => true
  13102. *
  13103. * _.isSymbol('abc');
  13104. * // => false
  13105. */
  13106. function isSymbol(value) {
  13107. return typeof value == 'symbol' ||
  13108. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  13109. }
  13110. /**
  13111. * Checks if `value` is classified as a typed array.
  13112. *
  13113. * @static
  13114. * @memberOf _
  13115. * @since 3.0.0
  13116. * @category Lang
  13117. * @param {*} value The value to check.
  13118. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  13119. * @example
  13120. *
  13121. * _.isTypedArray(new Uint8Array);
  13122. * // => true
  13123. *
  13124. * _.isTypedArray([]);
  13125. * // => false
  13126. */
  13127. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  13128. /**
  13129. * Checks if `value` is `undefined`.
  13130. *
  13131. * @static
  13132. * @since 0.1.0
  13133. * @memberOf _
  13134. * @category Lang
  13135. * @param {*} value The value to check.
  13136. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  13137. * @example
  13138. *
  13139. * _.isUndefined(void 0);
  13140. * // => true
  13141. *
  13142. * _.isUndefined(null);
  13143. * // => false
  13144. */
  13145. function isUndefined(value) {
  13146. return value === undefined;
  13147. }
  13148. /**
  13149. * Checks if `value` is classified as a `WeakMap` object.
  13150. *
  13151. * @static
  13152. * @memberOf _
  13153. * @since 4.3.0
  13154. * @category Lang
  13155. * @param {*} value The value to check.
  13156. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  13157. * @example
  13158. *
  13159. * _.isWeakMap(new WeakMap);
  13160. * // => true
  13161. *
  13162. * _.isWeakMap(new Map);
  13163. * // => false
  13164. */
  13165. function isWeakMap(value) {
  13166. return isObjectLike(value) && getTag(value) == weakMapTag;
  13167. }
  13168. /**
  13169. * Checks if `value` is classified as a `WeakSet` object.
  13170. *
  13171. * @static
  13172. * @memberOf _
  13173. * @since 4.3.0
  13174. * @category Lang
  13175. * @param {*} value The value to check.
  13176. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  13177. * @example
  13178. *
  13179. * _.isWeakSet(new WeakSet);
  13180. * // => true
  13181. *
  13182. * _.isWeakSet(new Set);
  13183. * // => false
  13184. */
  13185. function isWeakSet(value) {
  13186. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  13187. }
  13188. /**
  13189. * Checks if `value` is less than `other`.
  13190. *
  13191. * @static
  13192. * @memberOf _
  13193. * @since 3.9.0
  13194. * @category Lang
  13195. * @param {*} value The value to compare.
  13196. * @param {*} other The other value to compare.
  13197. * @returns {boolean} Returns `true` if `value` is less than `other`,
  13198. * else `false`.
  13199. * @see _.gt
  13200. * @example
  13201. *
  13202. * _.lt(1, 3);
  13203. * // => true
  13204. *
  13205. * _.lt(3, 3);
  13206. * // => false
  13207. *
  13208. * _.lt(3, 1);
  13209. * // => false
  13210. */
  13211. var lt = createRelationalOperation(baseLt);
  13212. /**
  13213. * Checks if `value` is less than or equal to `other`.
  13214. *
  13215. * @static
  13216. * @memberOf _
  13217. * @since 3.9.0
  13218. * @category Lang
  13219. * @param {*} value The value to compare.
  13220. * @param {*} other The other value to compare.
  13221. * @returns {boolean} Returns `true` if `value` is less than or equal to
  13222. * `other`, else `false`.
  13223. * @see _.gte
  13224. * @example
  13225. *
  13226. * _.lte(1, 3);
  13227. * // => true
  13228. *
  13229. * _.lte(3, 3);
  13230. * // => true
  13231. *
  13232. * _.lte(3, 1);
  13233. * // => false
  13234. */
  13235. var lte = createRelationalOperation(function(value, other) {
  13236. return value <= other;
  13237. });
  13238. /**
  13239. * Converts `value` to an array.
  13240. *
  13241. * @static
  13242. * @since 0.1.0
  13243. * @memberOf _
  13244. * @category Lang
  13245. * @param {*} value The value to convert.
  13246. * @returns {Array} Returns the converted array.
  13247. * @example
  13248. *
  13249. * _.toArray({ 'a': 1, 'b': 2 });
  13250. * // => [1, 2]
  13251. *
  13252. * _.toArray('abc');
  13253. * // => ['a', 'b', 'c']
  13254. *
  13255. * _.toArray(1);
  13256. * // => []
  13257. *
  13258. * _.toArray(null);
  13259. * // => []
  13260. */
  13261. function toArray(value) {
  13262. if (!value) {
  13263. return [];
  13264. }
  13265. if (isArrayLike(value)) {
  13266. return isString(value) ? stringToArray(value) : copyArray(value);
  13267. }
  13268. if (symIterator && value[symIterator]) {
  13269. return iteratorToArray(value[symIterator]());
  13270. }
  13271. var tag = getTag(value),
  13272. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  13273. return func(value);
  13274. }
  13275. /**
  13276. * Converts `value` to a finite number.
  13277. *
  13278. * @static
  13279. * @memberOf _
  13280. * @since 4.12.0
  13281. * @category Lang
  13282. * @param {*} value The value to convert.
  13283. * @returns {number} Returns the converted number.
  13284. * @example
  13285. *
  13286. * _.toFinite(3.2);
  13287. * // => 3.2
  13288. *
  13289. * _.toFinite(Number.MIN_VALUE);
  13290. * // => 5e-324
  13291. *
  13292. * _.toFinite(Infinity);
  13293. * // => 1.7976931348623157e+308
  13294. *
  13295. * _.toFinite('3.2');
  13296. * // => 3.2
  13297. */
  13298. function toFinite(value) {
  13299. if (!value) {
  13300. return value === 0 ? value : 0;
  13301. }
  13302. value = toNumber(value);
  13303. if (value === INFINITY || value === -INFINITY) {
  13304. var sign = (value < 0 ? -1 : 1);
  13305. return sign * MAX_INTEGER;
  13306. }
  13307. return value === value ? value : 0;
  13308. }
  13309. /**
  13310. * Converts `value` to an integer.
  13311. *
  13312. * **Note:** This method is loosely based on
  13313. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  13314. *
  13315. * @static
  13316. * @memberOf _
  13317. * @since 4.0.0
  13318. * @category Lang
  13319. * @param {*} value The value to convert.
  13320. * @returns {number} Returns the converted integer.
  13321. * @example
  13322. *
  13323. * _.toInteger(3.2);
  13324. * // => 3
  13325. *
  13326. * _.toInteger(Number.MIN_VALUE);
  13327. * // => 0
  13328. *
  13329. * _.toInteger(Infinity);
  13330. * // => 1.7976931348623157e+308
  13331. *
  13332. * _.toInteger('3.2');
  13333. * // => 3
  13334. */
  13335. function toInteger(value) {
  13336. var result = toFinite(value),
  13337. remainder = result % 1;
  13338. return result === result ? (remainder ? result - remainder : result) : 0;
  13339. }
  13340. /**
  13341. * Converts `value` to an integer suitable for use as the length of an
  13342. * array-like object.
  13343. *
  13344. * **Note:** This method is based on
  13345. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  13346. *
  13347. * @static
  13348. * @memberOf _
  13349. * @since 4.0.0
  13350. * @category Lang
  13351. * @param {*} value The value to convert.
  13352. * @returns {number} Returns the converted integer.
  13353. * @example
  13354. *
  13355. * _.toLength(3.2);
  13356. * // => 3
  13357. *
  13358. * _.toLength(Number.MIN_VALUE);
  13359. * // => 0
  13360. *
  13361. * _.toLength(Infinity);
  13362. * // => 4294967295
  13363. *
  13364. * _.toLength('3.2');
  13365. * // => 3
  13366. */
  13367. function toLength(value) {
  13368. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  13369. }
  13370. /**
  13371. * Converts `value` to a number.
  13372. *
  13373. * @static
  13374. * @memberOf _
  13375. * @since 4.0.0
  13376. * @category Lang
  13377. * @param {*} value The value to process.
  13378. * @returns {number} Returns the number.
  13379. * @example
  13380. *
  13381. * _.toNumber(3.2);
  13382. * // => 3.2
  13383. *
  13384. * _.toNumber(Number.MIN_VALUE);
  13385. * // => 5e-324
  13386. *
  13387. * _.toNumber(Infinity);
  13388. * // => Infinity
  13389. *
  13390. * _.toNumber('3.2');
  13391. * // => 3.2
  13392. */
  13393. function toNumber(value) {
  13394. if (typeof value == 'number') {
  13395. return value;
  13396. }
  13397. if (isSymbol(value)) {
  13398. return NAN;
  13399. }
  13400. if (isObject(value)) {
  13401. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  13402. value = isObject(other) ? (other + '') : other;
  13403. }
  13404. if (typeof value != 'string') {
  13405. return value === 0 ? value : +value;
  13406. }
  13407. value = baseTrim(value);
  13408. var isBinary = reIsBinary.test(value);
  13409. return (isBinary || reIsOctal.test(value))
  13410. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  13411. : (reIsBadHex.test(value) ? NAN : +value);
  13412. }
  13413. /**
  13414. * Converts `value` to a plain object flattening inherited enumerable string
  13415. * keyed properties of `value` to own properties of the plain object.
  13416. *
  13417. * @static
  13418. * @memberOf _
  13419. * @since 3.0.0
  13420. * @category Lang
  13421. * @param {*} value The value to convert.
  13422. * @returns {Object} Returns the converted plain object.
  13423. * @example
  13424. *
  13425. * function Foo() {
  13426. * this.b = 2;
  13427. * }
  13428. *
  13429. * Foo.prototype.c = 3;
  13430. *
  13431. * _.assign({ 'a': 1 }, new Foo);
  13432. * // => { 'a': 1, 'b': 2 }
  13433. *
  13434. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  13435. * // => { 'a': 1, 'b': 2, 'c': 3 }
  13436. */
  13437. function toPlainObject(value) {
  13438. return copyObject(value, keysIn(value));
  13439. }
  13440. /**
  13441. * Converts `value` to a safe integer. A safe integer can be compared and
  13442. * represented correctly.
  13443. *
  13444. * @static
  13445. * @memberOf _
  13446. * @since 4.0.0
  13447. * @category Lang
  13448. * @param {*} value The value to convert.
  13449. * @returns {number} Returns the converted integer.
  13450. * @example
  13451. *
  13452. * _.toSafeInteger(3.2);
  13453. * // => 3
  13454. *
  13455. * _.toSafeInteger(Number.MIN_VALUE);
  13456. * // => 0
  13457. *
  13458. * _.toSafeInteger(Infinity);
  13459. * // => 9007199254740991
  13460. *
  13461. * _.toSafeInteger('3.2');
  13462. * // => 3
  13463. */
  13464. function toSafeInteger(value) {
  13465. return value
  13466. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13467. : (value === 0 ? value : 0);
  13468. }
  13469. /**
  13470. * Converts `value` to a string. An empty string is returned for `null`
  13471. * and `undefined` values. The sign of `-0` is preserved.
  13472. *
  13473. * @static
  13474. * @memberOf _
  13475. * @since 4.0.0
  13476. * @category Lang
  13477. * @param {*} value The value to convert.
  13478. * @returns {string} Returns the converted string.
  13479. * @example
  13480. *
  13481. * _.toString(null);
  13482. * // => ''
  13483. *
  13484. * _.toString(-0);
  13485. * // => '-0'
  13486. *
  13487. * _.toString([1, 2, 3]);
  13488. * // => '1,2,3'
  13489. */
  13490. function toString(value) {
  13491. return value == null ? '' : baseToString(value);
  13492. }
  13493. /*------------------------------------------------------------------------*/
  13494. /**
  13495. * Assigns own enumerable string keyed properties of source objects to the
  13496. * destination object. Source objects are applied from left to right.
  13497. * Subsequent sources overwrite property assignments of previous sources.
  13498. *
  13499. * **Note:** This method mutates `object` and is loosely based on
  13500. * [`Object.assign`](https://mdn.io/Object/assign).
  13501. *
  13502. * @static
  13503. * @memberOf _
  13504. * @since 0.10.0
  13505. * @category Object
  13506. * @param {Object} object The destination object.
  13507. * @param {...Object} [sources] The source objects.
  13508. * @returns {Object} Returns `object`.
  13509. * @see _.assignIn
  13510. * @example
  13511. *
  13512. * function Foo() {
  13513. * this.a = 1;
  13514. * }
  13515. *
  13516. * function Bar() {
  13517. * this.c = 3;
  13518. * }
  13519. *
  13520. * Foo.prototype.b = 2;
  13521. * Bar.prototype.d = 4;
  13522. *
  13523. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13524. * // => { 'a': 1, 'c': 3 }
  13525. */
  13526. var assign = createAssigner(function(object, source) {
  13527. if (isPrototype(source) || isArrayLike(source)) {
  13528. copyObject(source, keys(source), object);
  13529. return;
  13530. }
  13531. for (var key in source) {
  13532. if (hasOwnProperty.call(source, key)) {
  13533. assignValue(object, key, source[key]);
  13534. }
  13535. }
  13536. });
  13537. /**
  13538. * This method is like `_.assign` except that it iterates over own and
  13539. * inherited source properties.
  13540. *
  13541. * **Note:** This method mutates `object`.
  13542. *
  13543. * @static
  13544. * @memberOf _
  13545. * @since 4.0.0
  13546. * @alias extend
  13547. * @category Object
  13548. * @param {Object} object The destination object.
  13549. * @param {...Object} [sources] The source objects.
  13550. * @returns {Object} Returns `object`.
  13551. * @see _.assign
  13552. * @example
  13553. *
  13554. * function Foo() {
  13555. * this.a = 1;
  13556. * }
  13557. *
  13558. * function Bar() {
  13559. * this.c = 3;
  13560. * }
  13561. *
  13562. * Foo.prototype.b = 2;
  13563. * Bar.prototype.d = 4;
  13564. *
  13565. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13566. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13567. */
  13568. var assignIn = createAssigner(function(object, source) {
  13569. copyObject(source, keysIn(source), object);
  13570. });
  13571. /**
  13572. * This method is like `_.assignIn` except that it accepts `customizer`
  13573. * which is invoked to produce the assigned values. If `customizer` returns
  13574. * `undefined`, assignment is handled by the method instead. The `customizer`
  13575. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13576. *
  13577. * **Note:** This method mutates `object`.
  13578. *
  13579. * @static
  13580. * @memberOf _
  13581. * @since 4.0.0
  13582. * @alias extendWith
  13583. * @category Object
  13584. * @param {Object} object The destination object.
  13585. * @param {...Object} sources The source objects.
  13586. * @param {Function} [customizer] The function to customize assigned values.
  13587. * @returns {Object} Returns `object`.
  13588. * @see _.assignWith
  13589. * @example
  13590. *
  13591. * function customizer(objValue, srcValue) {
  13592. * return _.isUndefined(objValue) ? srcValue : objValue;
  13593. * }
  13594. *
  13595. * var defaults = _.partialRight(_.assignInWith, customizer);
  13596. *
  13597. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13598. * // => { 'a': 1, 'b': 2 }
  13599. */
  13600. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13601. copyObject(source, keysIn(source), object, customizer);
  13602. });
  13603. /**
  13604. * This method is like `_.assign` except that it accepts `customizer`
  13605. * which is invoked to produce the assigned values. If `customizer` returns
  13606. * `undefined`, assignment is handled by the method instead. The `customizer`
  13607. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13608. *
  13609. * **Note:** This method mutates `object`.
  13610. *
  13611. * @static
  13612. * @memberOf _
  13613. * @since 4.0.0
  13614. * @category Object
  13615. * @param {Object} object The destination object.
  13616. * @param {...Object} sources The source objects.
  13617. * @param {Function} [customizer] The function to customize assigned values.
  13618. * @returns {Object} Returns `object`.
  13619. * @see _.assignInWith
  13620. * @example
  13621. *
  13622. * function customizer(objValue, srcValue) {
  13623. * return _.isUndefined(objValue) ? srcValue : objValue;
  13624. * }
  13625. *
  13626. * var defaults = _.partialRight(_.assignWith, customizer);
  13627. *
  13628. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13629. * // => { 'a': 1, 'b': 2 }
  13630. */
  13631. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13632. copyObject(source, keys(source), object, customizer);
  13633. });
  13634. /**
  13635. * Creates an array of values corresponding to `paths` of `object`.
  13636. *
  13637. * @static
  13638. * @memberOf _
  13639. * @since 1.0.0
  13640. * @category Object
  13641. * @param {Object} object The object to iterate over.
  13642. * @param {...(string|string[])} [paths] The property paths to pick.
  13643. * @returns {Array} Returns the picked values.
  13644. * @example
  13645. *
  13646. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13647. *
  13648. * _.at(object, ['a[0].b.c', 'a[1]']);
  13649. * // => [3, 4]
  13650. */
  13651. var at = flatRest(baseAt);
  13652. /**
  13653. * Creates an object that inherits from the `prototype` object. If a
  13654. * `properties` object is given, its own enumerable string keyed properties
  13655. * are assigned to the created object.
  13656. *
  13657. * @static
  13658. * @memberOf _
  13659. * @since 2.3.0
  13660. * @category Object
  13661. * @param {Object} prototype The object to inherit from.
  13662. * @param {Object} [properties] The properties to assign to the object.
  13663. * @returns {Object} Returns the new object.
  13664. * @example
  13665. *
  13666. * function Shape() {
  13667. * this.x = 0;
  13668. * this.y = 0;
  13669. * }
  13670. *
  13671. * function Circle() {
  13672. * Shape.call(this);
  13673. * }
  13674. *
  13675. * Circle.prototype = _.create(Shape.prototype, {
  13676. * 'constructor': Circle
  13677. * });
  13678. *
  13679. * var circle = new Circle;
  13680. * circle instanceof Circle;
  13681. * // => true
  13682. *
  13683. * circle instanceof Shape;
  13684. * // => true
  13685. */
  13686. function create(prototype, properties) {
  13687. var result = baseCreate(prototype);
  13688. return properties == null ? result : baseAssign(result, properties);
  13689. }
  13690. /**
  13691. * Assigns own and inherited enumerable string keyed properties of source
  13692. * objects to the destination object for all destination properties that
  13693. * resolve to `undefined`. Source objects are applied from left to right.
  13694. * Once a property is set, additional values of the same property are ignored.
  13695. *
  13696. * **Note:** This method mutates `object`.
  13697. *
  13698. * @static
  13699. * @since 0.1.0
  13700. * @memberOf _
  13701. * @category Object
  13702. * @param {Object} object The destination object.
  13703. * @param {...Object} [sources] The source objects.
  13704. * @returns {Object} Returns `object`.
  13705. * @see _.defaultsDeep
  13706. * @example
  13707. *
  13708. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13709. * // => { 'a': 1, 'b': 2 }
  13710. */
  13711. var defaults = baseRest(function(object, sources) {
  13712. object = Object(object);
  13713. var index = -1;
  13714. var length = sources.length;
  13715. var guard = length > 2 ? sources[2] : undefined;
  13716. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13717. length = 1;
  13718. }
  13719. while (++index < length) {
  13720. var source = sources[index];
  13721. var props = keysIn(source);
  13722. var propsIndex = -1;
  13723. var propsLength = props.length;
  13724. while (++propsIndex < propsLength) {
  13725. var key = props[propsIndex];
  13726. var value = object[key];
  13727. if (value === undefined ||
  13728. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13729. object[key] = source[key];
  13730. }
  13731. }
  13732. }
  13733. return object;
  13734. });
  13735. /**
  13736. * This method is like `_.defaults` except that it recursively assigns
  13737. * default properties.
  13738. *
  13739. * **Note:** This method mutates `object`.
  13740. *
  13741. * @static
  13742. * @memberOf _
  13743. * @since 3.10.0
  13744. * @category Object
  13745. * @param {Object} object The destination object.
  13746. * @param {...Object} [sources] The source objects.
  13747. * @returns {Object} Returns `object`.
  13748. * @see _.defaults
  13749. * @example
  13750. *
  13751. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13752. * // => { 'a': { 'b': 2, 'c': 3 } }
  13753. */
  13754. var defaultsDeep = baseRest(function(args) {
  13755. args.push(undefined, customDefaultsMerge);
  13756. return apply(mergeWith, undefined, args);
  13757. });
  13758. /**
  13759. * This method is like `_.find` except that it returns the key of the first
  13760. * element `predicate` returns truthy for instead of the element itself.
  13761. *
  13762. * @static
  13763. * @memberOf _
  13764. * @since 1.1.0
  13765. * @category Object
  13766. * @param {Object} object The object to inspect.
  13767. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13768. * @returns {string|undefined} Returns the key of the matched element,
  13769. * else `undefined`.
  13770. * @example
  13771. *
  13772. * var users = {
  13773. * 'barney': { 'age': 36, 'active': true },
  13774. * 'fred': { 'age': 40, 'active': false },
  13775. * 'pebbles': { 'age': 1, 'active': true }
  13776. * };
  13777. *
  13778. * _.findKey(users, function(o) { return o.age < 40; });
  13779. * // => 'barney' (iteration order is not guaranteed)
  13780. *
  13781. * // The `_.matches` iteratee shorthand.
  13782. * _.findKey(users, { 'age': 1, 'active': true });
  13783. * // => 'pebbles'
  13784. *
  13785. * // The `_.matchesProperty` iteratee shorthand.
  13786. * _.findKey(users, ['active', false]);
  13787. * // => 'fred'
  13788. *
  13789. * // The `_.property` iteratee shorthand.
  13790. * _.findKey(users, 'active');
  13791. * // => 'barney'
  13792. */
  13793. function findKey(object, predicate) {
  13794. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13795. }
  13796. /**
  13797. * This method is like `_.findKey` except that it iterates over elements of
  13798. * a collection in the opposite order.
  13799. *
  13800. * @static
  13801. * @memberOf _
  13802. * @since 2.0.0
  13803. * @category Object
  13804. * @param {Object} object The object to inspect.
  13805. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13806. * @returns {string|undefined} Returns the key of the matched element,
  13807. * else `undefined`.
  13808. * @example
  13809. *
  13810. * var users = {
  13811. * 'barney': { 'age': 36, 'active': true },
  13812. * 'fred': { 'age': 40, 'active': false },
  13813. * 'pebbles': { 'age': 1, 'active': true }
  13814. * };
  13815. *
  13816. * _.findLastKey(users, function(o) { return o.age < 40; });
  13817. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13818. *
  13819. * // The `_.matches` iteratee shorthand.
  13820. * _.findLastKey(users, { 'age': 36, 'active': true });
  13821. * // => 'barney'
  13822. *
  13823. * // The `_.matchesProperty` iteratee shorthand.
  13824. * _.findLastKey(users, ['active', false]);
  13825. * // => 'fred'
  13826. *
  13827. * // The `_.property` iteratee shorthand.
  13828. * _.findLastKey(users, 'active');
  13829. * // => 'pebbles'
  13830. */
  13831. function findLastKey(object, predicate) {
  13832. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13833. }
  13834. /**
  13835. * Iterates over own and inherited enumerable string keyed properties of an
  13836. * object and invokes `iteratee` for each property. The iteratee is invoked
  13837. * with three arguments: (value, key, object). Iteratee functions may exit
  13838. * iteration early by explicitly returning `false`.
  13839. *
  13840. * @static
  13841. * @memberOf _
  13842. * @since 0.3.0
  13843. * @category Object
  13844. * @param {Object} object The object to iterate over.
  13845. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13846. * @returns {Object} Returns `object`.
  13847. * @see _.forInRight
  13848. * @example
  13849. *
  13850. * function Foo() {
  13851. * this.a = 1;
  13852. * this.b = 2;
  13853. * }
  13854. *
  13855. * Foo.prototype.c = 3;
  13856. *
  13857. * _.forIn(new Foo, function(value, key) {
  13858. * console.log(key);
  13859. * });
  13860. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13861. */
  13862. function forIn(object, iteratee) {
  13863. return object == null
  13864. ? object
  13865. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13866. }
  13867. /**
  13868. * This method is like `_.forIn` except that it iterates over properties of
  13869. * `object` in the opposite order.
  13870. *
  13871. * @static
  13872. * @memberOf _
  13873. * @since 2.0.0
  13874. * @category Object
  13875. * @param {Object} object The object to iterate over.
  13876. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13877. * @returns {Object} Returns `object`.
  13878. * @see _.forIn
  13879. * @example
  13880. *
  13881. * function Foo() {
  13882. * this.a = 1;
  13883. * this.b = 2;
  13884. * }
  13885. *
  13886. * Foo.prototype.c = 3;
  13887. *
  13888. * _.forInRight(new Foo, function(value, key) {
  13889. * console.log(key);
  13890. * });
  13891. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13892. */
  13893. function forInRight(object, iteratee) {
  13894. return object == null
  13895. ? object
  13896. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13897. }
  13898. /**
  13899. * Iterates over own enumerable string keyed properties of an object and
  13900. * invokes `iteratee` for each property. The iteratee is invoked with three
  13901. * arguments: (value, key, object). Iteratee functions may exit iteration
  13902. * early by explicitly returning `false`.
  13903. *
  13904. * @static
  13905. * @memberOf _
  13906. * @since 0.3.0
  13907. * @category Object
  13908. * @param {Object} object The object to iterate over.
  13909. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13910. * @returns {Object} Returns `object`.
  13911. * @see _.forOwnRight
  13912. * @example
  13913. *
  13914. * function Foo() {
  13915. * this.a = 1;
  13916. * this.b = 2;
  13917. * }
  13918. *
  13919. * Foo.prototype.c = 3;
  13920. *
  13921. * _.forOwn(new Foo, function(value, key) {
  13922. * console.log(key);
  13923. * });
  13924. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13925. */
  13926. function forOwn(object, iteratee) {
  13927. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13928. }
  13929. /**
  13930. * This method is like `_.forOwn` except that it iterates over properties of
  13931. * `object` in the opposite order.
  13932. *
  13933. * @static
  13934. * @memberOf _
  13935. * @since 2.0.0
  13936. * @category Object
  13937. * @param {Object} object The object to iterate over.
  13938. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13939. * @returns {Object} Returns `object`.
  13940. * @see _.forOwn
  13941. * @example
  13942. *
  13943. * function Foo() {
  13944. * this.a = 1;
  13945. * this.b = 2;
  13946. * }
  13947. *
  13948. * Foo.prototype.c = 3;
  13949. *
  13950. * _.forOwnRight(new Foo, function(value, key) {
  13951. * console.log(key);
  13952. * });
  13953. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13954. */
  13955. function forOwnRight(object, iteratee) {
  13956. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13957. }
  13958. /**
  13959. * Creates an array of function property names from own enumerable properties
  13960. * of `object`.
  13961. *
  13962. * @static
  13963. * @since 0.1.0
  13964. * @memberOf _
  13965. * @category Object
  13966. * @param {Object} object The object to inspect.
  13967. * @returns {Array} Returns the function names.
  13968. * @see _.functionsIn
  13969. * @example
  13970. *
  13971. * function Foo() {
  13972. * this.a = _.constant('a');
  13973. * this.b = _.constant('b');
  13974. * }
  13975. *
  13976. * Foo.prototype.c = _.constant('c');
  13977. *
  13978. * _.functions(new Foo);
  13979. * // => ['a', 'b']
  13980. */
  13981. function functions(object) {
  13982. return object == null ? [] : baseFunctions(object, keys(object));
  13983. }
  13984. /**
  13985. * Creates an array of function property names from own and inherited
  13986. * enumerable properties of `object`.
  13987. *
  13988. * @static
  13989. * @memberOf _
  13990. * @since 4.0.0
  13991. * @category Object
  13992. * @param {Object} object The object to inspect.
  13993. * @returns {Array} Returns the function names.
  13994. * @see _.functions
  13995. * @example
  13996. *
  13997. * function Foo() {
  13998. * this.a = _.constant('a');
  13999. * this.b = _.constant('b');
  14000. * }
  14001. *
  14002. * Foo.prototype.c = _.constant('c');
  14003. *
  14004. * _.functionsIn(new Foo);
  14005. * // => ['a', 'b', 'c']
  14006. */
  14007. function functionsIn(object) {
  14008. return object == null ? [] : baseFunctions(object, keysIn(object));
  14009. }
  14010. /**
  14011. * Gets the value at `path` of `object`. If the resolved value is
  14012. * `undefined`, the `defaultValue` is returned in its place.
  14013. *
  14014. * @static
  14015. * @memberOf _
  14016. * @since 3.7.0
  14017. * @category Object
  14018. * @param {Object} object The object to query.
  14019. * @param {Array|string} path The path of the property to get.
  14020. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14021. * @returns {*} Returns the resolved value.
  14022. * @example
  14023. *
  14024. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14025. *
  14026. * _.get(object, 'a[0].b.c');
  14027. * // => 3
  14028. *
  14029. * _.get(object, ['a', '0', 'b', 'c']);
  14030. * // => 3
  14031. *
  14032. * _.get(object, 'a.b.c', 'default');
  14033. * // => 'default'
  14034. */
  14035. function get(object, path, defaultValue) {
  14036. var result = object == null ? undefined : baseGet(object, path);
  14037. return result === undefined ? defaultValue : result;
  14038. }
  14039. /**
  14040. * Checks if `path` is a direct property of `object`.
  14041. *
  14042. * @static
  14043. * @since 0.1.0
  14044. * @memberOf _
  14045. * @category Object
  14046. * @param {Object} object The object to query.
  14047. * @param {Array|string} path The path to check.
  14048. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  14049. * @example
  14050. *
  14051. * var object = { 'a': { 'b': 2 } };
  14052. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  14053. *
  14054. * _.has(object, 'a');
  14055. * // => true
  14056. *
  14057. * _.has(object, 'a.b');
  14058. * // => true
  14059. *
  14060. * _.has(object, ['a', 'b']);
  14061. * // => true
  14062. *
  14063. * _.has(other, 'a');
  14064. * // => false
  14065. */
  14066. function has(object, path) {
  14067. return object != null && hasPath(object, path, baseHas);
  14068. }
  14069. /**
  14070. * Checks if `path` is a direct or inherited property of `object`.
  14071. *
  14072. * @static
  14073. * @memberOf _
  14074. * @since 4.0.0
  14075. * @category Object
  14076. * @param {Object} object The object to query.
  14077. * @param {Array|string} path The path to check.
  14078. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  14079. * @example
  14080. *
  14081. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  14082. *
  14083. * _.hasIn(object, 'a');
  14084. * // => true
  14085. *
  14086. * _.hasIn(object, 'a.b');
  14087. * // => true
  14088. *
  14089. * _.hasIn(object, ['a', 'b']);
  14090. * // => true
  14091. *
  14092. * _.hasIn(object, 'b');
  14093. * // => false
  14094. */
  14095. function hasIn(object, path) {
  14096. return object != null && hasPath(object, path, baseHasIn);
  14097. }
  14098. /**
  14099. * Creates an object composed of the inverted keys and values of `object`.
  14100. * If `object` contains duplicate values, subsequent values overwrite
  14101. * property assignments of previous values.
  14102. *
  14103. * @static
  14104. * @memberOf _
  14105. * @since 0.7.0
  14106. * @category Object
  14107. * @param {Object} object The object to invert.
  14108. * @returns {Object} Returns the new inverted object.
  14109. * @example
  14110. *
  14111. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  14112. *
  14113. * _.invert(object);
  14114. * // => { '1': 'c', '2': 'b' }
  14115. */
  14116. var invert = createInverter(function(result, value, key) {
  14117. if (value != null &&
  14118. typeof value.toString != 'function') {
  14119. value = nativeObjectToString.call(value);
  14120. }
  14121. result[value] = key;
  14122. }, constant(identity));
  14123. /**
  14124. * This method is like `_.invert` except that the inverted object is generated
  14125. * from the results of running each element of `object` thru `iteratee`. The
  14126. * corresponding inverted value of each inverted key is an array of keys
  14127. * responsible for generating the inverted value. The iteratee is invoked
  14128. * with one argument: (value).
  14129. *
  14130. * @static
  14131. * @memberOf _
  14132. * @since 4.1.0
  14133. * @category Object
  14134. * @param {Object} object The object to invert.
  14135. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  14136. * @returns {Object} Returns the new inverted object.
  14137. * @example
  14138. *
  14139. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  14140. *
  14141. * _.invertBy(object);
  14142. * // => { '1': ['a', 'c'], '2': ['b'] }
  14143. *
  14144. * _.invertBy(object, function(value) {
  14145. * return 'group' + value;
  14146. * });
  14147. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  14148. */
  14149. var invertBy = createInverter(function(result, value, key) {
  14150. if (value != null &&
  14151. typeof value.toString != 'function') {
  14152. value = nativeObjectToString.call(value);
  14153. }
  14154. if (hasOwnProperty.call(result, value)) {
  14155. result[value].push(key);
  14156. } else {
  14157. result[value] = [key];
  14158. }
  14159. }, getIteratee);
  14160. /**
  14161. * Invokes the method at `path` of `object`.
  14162. *
  14163. * @static
  14164. * @memberOf _
  14165. * @since 4.0.0
  14166. * @category Object
  14167. * @param {Object} object The object to query.
  14168. * @param {Array|string} path The path of the method to invoke.
  14169. * @param {...*} [args] The arguments to invoke the method with.
  14170. * @returns {*} Returns the result of the invoked method.
  14171. * @example
  14172. *
  14173. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  14174. *
  14175. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  14176. * // => [2, 3]
  14177. */
  14178. var invoke = baseRest(baseInvoke);
  14179. /**
  14180. * Creates an array of the own enumerable property names of `object`.
  14181. *
  14182. * **Note:** Non-object values are coerced to objects. See the
  14183. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  14184. * for more details.
  14185. *
  14186. * @static
  14187. * @since 0.1.0
  14188. * @memberOf _
  14189. * @category Object
  14190. * @param {Object} object The object to query.
  14191. * @returns {Array} Returns the array of property names.
  14192. * @example
  14193. *
  14194. * function Foo() {
  14195. * this.a = 1;
  14196. * this.b = 2;
  14197. * }
  14198. *
  14199. * Foo.prototype.c = 3;
  14200. *
  14201. * _.keys(new Foo);
  14202. * // => ['a', 'b'] (iteration order is not guaranteed)
  14203. *
  14204. * _.keys('hi');
  14205. * // => ['0', '1']
  14206. */
  14207. function keys(object) {
  14208. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  14209. }
  14210. /**
  14211. * Creates an array of the own and inherited enumerable property names of `object`.
  14212. *
  14213. * **Note:** Non-object values are coerced to objects.
  14214. *
  14215. * @static
  14216. * @memberOf _
  14217. * @since 3.0.0
  14218. * @category Object
  14219. * @param {Object} object The object to query.
  14220. * @returns {Array} Returns the array of property names.
  14221. * @example
  14222. *
  14223. * function Foo() {
  14224. * this.a = 1;
  14225. * this.b = 2;
  14226. * }
  14227. *
  14228. * Foo.prototype.c = 3;
  14229. *
  14230. * _.keysIn(new Foo);
  14231. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  14232. */
  14233. function keysIn(object) {
  14234. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  14235. }
  14236. /**
  14237. * The opposite of `_.mapValues`; this method creates an object with the
  14238. * same values as `object` and keys generated by running each own enumerable
  14239. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  14240. * with three arguments: (value, key, object).
  14241. *
  14242. * @static
  14243. * @memberOf _
  14244. * @since 3.8.0
  14245. * @category Object
  14246. * @param {Object} object The object to iterate over.
  14247. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14248. * @returns {Object} Returns the new mapped object.
  14249. * @see _.mapValues
  14250. * @example
  14251. *
  14252. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  14253. * return key + value;
  14254. * });
  14255. * // => { 'a1': 1, 'b2': 2 }
  14256. */
  14257. function mapKeys(object, iteratee) {
  14258. var result = {};
  14259. iteratee = getIteratee(iteratee, 3);
  14260. baseForOwn(object, function(value, key, object) {
  14261. baseAssignValue(result, iteratee(value, key, object), value);
  14262. });
  14263. return result;
  14264. }
  14265. /**
  14266. * Creates an object with the same keys as `object` and values generated
  14267. * by running each own enumerable string keyed property of `object` thru
  14268. * `iteratee`. The iteratee is invoked with three arguments:
  14269. * (value, key, object).
  14270. *
  14271. * @static
  14272. * @memberOf _
  14273. * @since 2.4.0
  14274. * @category Object
  14275. * @param {Object} object The object to iterate over.
  14276. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14277. * @returns {Object} Returns the new mapped object.
  14278. * @see _.mapKeys
  14279. * @example
  14280. *
  14281. * var users = {
  14282. * 'fred': { 'user': 'fred', 'age': 40 },
  14283. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  14284. * };
  14285. *
  14286. * _.mapValues(users, function(o) { return o.age; });
  14287. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  14288. *
  14289. * // The `_.property` iteratee shorthand.
  14290. * _.mapValues(users, 'age');
  14291. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  14292. */
  14293. function mapValues(object, iteratee) {
  14294. var result = {};
  14295. iteratee = getIteratee(iteratee, 3);
  14296. baseForOwn(object, function(value, key, object) {
  14297. baseAssignValue(result, key, iteratee(value, key, object));
  14298. });
  14299. return result;
  14300. }
  14301. /**
  14302. * This method is like `_.assign` except that it recursively merges own and
  14303. * inherited enumerable string keyed properties of source objects into the
  14304. * destination object. Source properties that resolve to `undefined` are
  14305. * skipped if a destination value exists. Array and plain object properties
  14306. * are merged recursively. Other objects and value types are overridden by
  14307. * assignment. Source objects are applied from left to right. Subsequent
  14308. * sources overwrite property assignments of previous sources.
  14309. *
  14310. * **Note:** This method mutates `object`.
  14311. *
  14312. * @static
  14313. * @memberOf _
  14314. * @since 0.5.0
  14315. * @category Object
  14316. * @param {Object} object The destination object.
  14317. * @param {...Object} [sources] The source objects.
  14318. * @returns {Object} Returns `object`.
  14319. * @example
  14320. *
  14321. * var object = {
  14322. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  14323. * };
  14324. *
  14325. * var other = {
  14326. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  14327. * };
  14328. *
  14329. * _.merge(object, other);
  14330. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  14331. */
  14332. var merge = createAssigner(function(object, source, srcIndex) {
  14333. baseMerge(object, source, srcIndex);
  14334. });
  14335. /**
  14336. * This method is like `_.merge` except that it accepts `customizer` which
  14337. * is invoked to produce the merged values of the destination and source
  14338. * properties. If `customizer` returns `undefined`, merging is handled by the
  14339. * method instead. The `customizer` is invoked with six arguments:
  14340. * (objValue, srcValue, key, object, source, stack).
  14341. *
  14342. * **Note:** This method mutates `object`.
  14343. *
  14344. * @static
  14345. * @memberOf _
  14346. * @since 4.0.0
  14347. * @category Object
  14348. * @param {Object} object The destination object.
  14349. * @param {...Object} sources The source objects.
  14350. * @param {Function} customizer The function to customize assigned values.
  14351. * @returns {Object} Returns `object`.
  14352. * @example
  14353. *
  14354. * function customizer(objValue, srcValue) {
  14355. * if (_.isArray(objValue)) {
  14356. * return objValue.concat(srcValue);
  14357. * }
  14358. * }
  14359. *
  14360. * var object = { 'a': [1], 'b': [2] };
  14361. * var other = { 'a': [3], 'b': [4] };
  14362. *
  14363. * _.mergeWith(object, other, customizer);
  14364. * // => { 'a': [1, 3], 'b': [2, 4] }
  14365. */
  14366. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  14367. baseMerge(object, source, srcIndex, customizer);
  14368. });
  14369. /**
  14370. * The opposite of `_.pick`; this method creates an object composed of the
  14371. * own and inherited enumerable property paths of `object` that are not omitted.
  14372. *
  14373. * **Note:** This method is considerably slower than `_.pick`.
  14374. *
  14375. * @static
  14376. * @since 0.1.0
  14377. * @memberOf _
  14378. * @category Object
  14379. * @param {Object} object The source object.
  14380. * @param {...(string|string[])} [paths] The property paths to omit.
  14381. * @returns {Object} Returns the new object.
  14382. * @example
  14383. *
  14384. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14385. *
  14386. * _.omit(object, ['a', 'c']);
  14387. * // => { 'b': '2' }
  14388. */
  14389. var omit = flatRest(function(object, paths) {
  14390. var result = {};
  14391. if (object == null) {
  14392. return result;
  14393. }
  14394. var isDeep = false;
  14395. paths = arrayMap(paths, function(path) {
  14396. path = castPath(path, object);
  14397. isDeep || (isDeep = path.length > 1);
  14398. return path;
  14399. });
  14400. copyObject(object, getAllKeysIn(object), result);
  14401. if (isDeep) {
  14402. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  14403. }
  14404. var length = paths.length;
  14405. while (length--) {
  14406. baseUnset(result, paths[length]);
  14407. }
  14408. return result;
  14409. });
  14410. /**
  14411. * The opposite of `_.pickBy`; this method creates an object composed of
  14412. * the own and inherited enumerable string keyed properties of `object` that
  14413. * `predicate` doesn't return truthy for. The predicate is invoked with two
  14414. * arguments: (value, key).
  14415. *
  14416. * @static
  14417. * @memberOf _
  14418. * @since 4.0.0
  14419. * @category Object
  14420. * @param {Object} object The source object.
  14421. * @param {Function} [predicate=_.identity] The function invoked per property.
  14422. * @returns {Object} Returns the new object.
  14423. * @example
  14424. *
  14425. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14426. *
  14427. * _.omitBy(object, _.isNumber);
  14428. * // => { 'b': '2' }
  14429. */
  14430. function omitBy(object, predicate) {
  14431. return pickBy(object, negate(getIteratee(predicate)));
  14432. }
  14433. /**
  14434. * Creates an object composed of the picked `object` properties.
  14435. *
  14436. * @static
  14437. * @since 0.1.0
  14438. * @memberOf _
  14439. * @category Object
  14440. * @param {Object} object The source object.
  14441. * @param {...(string|string[])} [paths] The property paths to pick.
  14442. * @returns {Object} Returns the new object.
  14443. * @example
  14444. *
  14445. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14446. *
  14447. * _.pick(object, ['a', 'c']);
  14448. * // => { 'a': 1, 'c': 3 }
  14449. */
  14450. var pick = flatRest(function(object, paths) {
  14451. return object == null ? {} : basePick(object, paths);
  14452. });
  14453. /**
  14454. * Creates an object composed of the `object` properties `predicate` returns
  14455. * truthy for. The predicate is invoked with two arguments: (value, key).
  14456. *
  14457. * @static
  14458. * @memberOf _
  14459. * @since 4.0.0
  14460. * @category Object
  14461. * @param {Object} object The source object.
  14462. * @param {Function} [predicate=_.identity] The function invoked per property.
  14463. * @returns {Object} Returns the new object.
  14464. * @example
  14465. *
  14466. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14467. *
  14468. * _.pickBy(object, _.isNumber);
  14469. * // => { 'a': 1, 'c': 3 }
  14470. */
  14471. function pickBy(object, predicate) {
  14472. if (object == null) {
  14473. return {};
  14474. }
  14475. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14476. return [prop];
  14477. });
  14478. predicate = getIteratee(predicate);
  14479. return basePickBy(object, props, function(value, path) {
  14480. return predicate(value, path[0]);
  14481. });
  14482. }
  14483. /**
  14484. * This method is like `_.get` except that if the resolved value is a
  14485. * function it's invoked with the `this` binding of its parent object and
  14486. * its result is returned.
  14487. *
  14488. * @static
  14489. * @since 0.1.0
  14490. * @memberOf _
  14491. * @category Object
  14492. * @param {Object} object The object to query.
  14493. * @param {Array|string} path The path of the property to resolve.
  14494. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14495. * @returns {*} Returns the resolved value.
  14496. * @example
  14497. *
  14498. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14499. *
  14500. * _.result(object, 'a[0].b.c1');
  14501. * // => 3
  14502. *
  14503. * _.result(object, 'a[0].b.c2');
  14504. * // => 4
  14505. *
  14506. * _.result(object, 'a[0].b.c3', 'default');
  14507. * // => 'default'
  14508. *
  14509. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14510. * // => 'default'
  14511. */
  14512. function result(object, path, defaultValue) {
  14513. path = castPath(path, object);
  14514. var index = -1,
  14515. length = path.length;
  14516. // Ensure the loop is entered when path is empty.
  14517. if (!length) {
  14518. length = 1;
  14519. object = undefined;
  14520. }
  14521. while (++index < length) {
  14522. var value = object == null ? undefined : object[toKey(path[index])];
  14523. if (value === undefined) {
  14524. index = length;
  14525. value = defaultValue;
  14526. }
  14527. object = isFunction(value) ? value.call(object) : value;
  14528. }
  14529. return object;
  14530. }
  14531. /**
  14532. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14533. * it's created. Arrays are created for missing index properties while objects
  14534. * are created for all other missing properties. Use `_.setWith` to customize
  14535. * `path` creation.
  14536. *
  14537. * **Note:** This method mutates `object`.
  14538. *
  14539. * @static
  14540. * @memberOf _
  14541. * @since 3.7.0
  14542. * @category Object
  14543. * @param {Object} object The object to modify.
  14544. * @param {Array|string} path The path of the property to set.
  14545. * @param {*} value The value to set.
  14546. * @returns {Object} Returns `object`.
  14547. * @example
  14548. *
  14549. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14550. *
  14551. * _.set(object, 'a[0].b.c', 4);
  14552. * console.log(object.a[0].b.c);
  14553. * // => 4
  14554. *
  14555. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14556. * console.log(object.x[0].y.z);
  14557. * // => 5
  14558. */
  14559. function set(object, path, value) {
  14560. return object == null ? object : baseSet(object, path, value);
  14561. }
  14562. /**
  14563. * This method is like `_.set` except that it accepts `customizer` which is
  14564. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14565. * path creation is handled by the method instead. The `customizer` is invoked
  14566. * with three arguments: (nsValue, key, nsObject).
  14567. *
  14568. * **Note:** This method mutates `object`.
  14569. *
  14570. * @static
  14571. * @memberOf _
  14572. * @since 4.0.0
  14573. * @category Object
  14574. * @param {Object} object The object to modify.
  14575. * @param {Array|string} path The path of the property to set.
  14576. * @param {*} value The value to set.
  14577. * @param {Function} [customizer] The function to customize assigned values.
  14578. * @returns {Object} Returns `object`.
  14579. * @example
  14580. *
  14581. * var object = {};
  14582. *
  14583. * _.setWith(object, '[0][1]', 'a', Object);
  14584. * // => { '0': { '1': 'a' } }
  14585. */
  14586. function setWith(object, path, value, customizer) {
  14587. customizer = typeof customizer == 'function' ? customizer : undefined;
  14588. return object == null ? object : baseSet(object, path, value, customizer);
  14589. }
  14590. /**
  14591. * Creates an array of own enumerable string keyed-value pairs for `object`
  14592. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14593. * entries are returned.
  14594. *
  14595. * @static
  14596. * @memberOf _
  14597. * @since 4.0.0
  14598. * @alias entries
  14599. * @category Object
  14600. * @param {Object} object The object to query.
  14601. * @returns {Array} Returns the key-value pairs.
  14602. * @example
  14603. *
  14604. * function Foo() {
  14605. * this.a = 1;
  14606. * this.b = 2;
  14607. * }
  14608. *
  14609. * Foo.prototype.c = 3;
  14610. *
  14611. * _.toPairs(new Foo);
  14612. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14613. */
  14614. var toPairs = createToPairs(keys);
  14615. /**
  14616. * Creates an array of own and inherited enumerable string keyed-value pairs
  14617. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14618. * or set, its entries are returned.
  14619. *
  14620. * @static
  14621. * @memberOf _
  14622. * @since 4.0.0
  14623. * @alias entriesIn
  14624. * @category Object
  14625. * @param {Object} object The object to query.
  14626. * @returns {Array} Returns the key-value pairs.
  14627. * @example
  14628. *
  14629. * function Foo() {
  14630. * this.a = 1;
  14631. * this.b = 2;
  14632. * }
  14633. *
  14634. * Foo.prototype.c = 3;
  14635. *
  14636. * _.toPairsIn(new Foo);
  14637. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14638. */
  14639. var toPairsIn = createToPairs(keysIn);
  14640. /**
  14641. * An alternative to `_.reduce`; this method transforms `object` to a new
  14642. * `accumulator` object which is the result of running each of its own
  14643. * enumerable string keyed properties thru `iteratee`, with each invocation
  14644. * potentially mutating the `accumulator` object. If `accumulator` is not
  14645. * provided, a new object with the same `[[Prototype]]` will be used. The
  14646. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14647. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14648. *
  14649. * @static
  14650. * @memberOf _
  14651. * @since 1.3.0
  14652. * @category Object
  14653. * @param {Object} object The object to iterate over.
  14654. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14655. * @param {*} [accumulator] The custom accumulator value.
  14656. * @returns {*} Returns the accumulated value.
  14657. * @example
  14658. *
  14659. * _.transform([2, 3, 4], function(result, n) {
  14660. * result.push(n *= n);
  14661. * return n % 2 == 0;
  14662. * }, []);
  14663. * // => [4, 9]
  14664. *
  14665. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14666. * (result[value] || (result[value] = [])).push(key);
  14667. * }, {});
  14668. * // => { '1': ['a', 'c'], '2': ['b'] }
  14669. */
  14670. function transform(object, iteratee, accumulator) {
  14671. var isArr = isArray(object),
  14672. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14673. iteratee = getIteratee(iteratee, 4);
  14674. if (accumulator == null) {
  14675. var Ctor = object && object.constructor;
  14676. if (isArrLike) {
  14677. accumulator = isArr ? new Ctor : [];
  14678. }
  14679. else if (isObject(object)) {
  14680. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14681. }
  14682. else {
  14683. accumulator = {};
  14684. }
  14685. }
  14686. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14687. return iteratee(accumulator, value, index, object);
  14688. });
  14689. return accumulator;
  14690. }
  14691. /**
  14692. * Removes the property at `path` of `object`.
  14693. *
  14694. * **Note:** This method mutates `object`.
  14695. *
  14696. * @static
  14697. * @memberOf _
  14698. * @since 4.0.0
  14699. * @category Object
  14700. * @param {Object} object The object to modify.
  14701. * @param {Array|string} path The path of the property to unset.
  14702. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14703. * @example
  14704. *
  14705. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14706. * _.unset(object, 'a[0].b.c');
  14707. * // => true
  14708. *
  14709. * console.log(object);
  14710. * // => { 'a': [{ 'b': {} }] };
  14711. *
  14712. * _.unset(object, ['a', '0', 'b', 'c']);
  14713. * // => true
  14714. *
  14715. * console.log(object);
  14716. * // => { 'a': [{ 'b': {} }] };
  14717. */
  14718. function unset(object, path) {
  14719. return object == null ? true : baseUnset(object, path);
  14720. }
  14721. /**
  14722. * This method is like `_.set` except that accepts `updater` to produce the
  14723. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14724. * is invoked with one argument: (value).
  14725. *
  14726. * **Note:** This method mutates `object`.
  14727. *
  14728. * @static
  14729. * @memberOf _
  14730. * @since 4.6.0
  14731. * @category Object
  14732. * @param {Object} object The object to modify.
  14733. * @param {Array|string} path The path of the property to set.
  14734. * @param {Function} updater The function to produce the updated value.
  14735. * @returns {Object} Returns `object`.
  14736. * @example
  14737. *
  14738. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14739. *
  14740. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14741. * console.log(object.a[0].b.c);
  14742. * // => 9
  14743. *
  14744. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14745. * console.log(object.x[0].y.z);
  14746. * // => 0
  14747. */
  14748. function update(object, path, updater) {
  14749. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14750. }
  14751. /**
  14752. * This method is like `_.update` except that it accepts `customizer` which is
  14753. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14754. * path creation is handled by the method instead. The `customizer` is invoked
  14755. * with three arguments: (nsValue, key, nsObject).
  14756. *
  14757. * **Note:** This method mutates `object`.
  14758. *
  14759. * @static
  14760. * @memberOf _
  14761. * @since 4.6.0
  14762. * @category Object
  14763. * @param {Object} object The object to modify.
  14764. * @param {Array|string} path The path of the property to set.
  14765. * @param {Function} updater The function to produce the updated value.
  14766. * @param {Function} [customizer] The function to customize assigned values.
  14767. * @returns {Object} Returns `object`.
  14768. * @example
  14769. *
  14770. * var object = {};
  14771. *
  14772. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14773. * // => { '0': { '1': 'a' } }
  14774. */
  14775. function updateWith(object, path, updater, customizer) {
  14776. customizer = typeof customizer == 'function' ? customizer : undefined;
  14777. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14778. }
  14779. /**
  14780. * Creates an array of the own enumerable string keyed property values of `object`.
  14781. *
  14782. * **Note:** Non-object values are coerced to objects.
  14783. *
  14784. * @static
  14785. * @since 0.1.0
  14786. * @memberOf _
  14787. * @category Object
  14788. * @param {Object} object The object to query.
  14789. * @returns {Array} Returns the array of property values.
  14790. * @example
  14791. *
  14792. * function Foo() {
  14793. * this.a = 1;
  14794. * this.b = 2;
  14795. * }
  14796. *
  14797. * Foo.prototype.c = 3;
  14798. *
  14799. * _.values(new Foo);
  14800. * // => [1, 2] (iteration order is not guaranteed)
  14801. *
  14802. * _.values('hi');
  14803. * // => ['h', 'i']
  14804. */
  14805. function values(object) {
  14806. return object == null ? [] : baseValues(object, keys(object));
  14807. }
  14808. /**
  14809. * Creates an array of the own and inherited enumerable string keyed property
  14810. * values of `object`.
  14811. *
  14812. * **Note:** Non-object values are coerced to objects.
  14813. *
  14814. * @static
  14815. * @memberOf _
  14816. * @since 3.0.0
  14817. * @category Object
  14818. * @param {Object} object The object to query.
  14819. * @returns {Array} Returns the array of property values.
  14820. * @example
  14821. *
  14822. * function Foo() {
  14823. * this.a = 1;
  14824. * this.b = 2;
  14825. * }
  14826. *
  14827. * Foo.prototype.c = 3;
  14828. *
  14829. * _.valuesIn(new Foo);
  14830. * // => [1, 2, 3] (iteration order is not guaranteed)
  14831. */
  14832. function valuesIn(object) {
  14833. return object == null ? [] : baseValues(object, keysIn(object));
  14834. }
  14835. /*------------------------------------------------------------------------*/
  14836. /**
  14837. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14838. *
  14839. * @static
  14840. * @memberOf _
  14841. * @since 4.0.0
  14842. * @category Number
  14843. * @param {number} number The number to clamp.
  14844. * @param {number} [lower] The lower bound.
  14845. * @param {number} upper The upper bound.
  14846. * @returns {number} Returns the clamped number.
  14847. * @example
  14848. *
  14849. * _.clamp(-10, -5, 5);
  14850. * // => -5
  14851. *
  14852. * _.clamp(10, -5, 5);
  14853. * // => 5
  14854. */
  14855. function clamp(number, lower, upper) {
  14856. if (upper === undefined) {
  14857. upper = lower;
  14858. lower = undefined;
  14859. }
  14860. if (upper !== undefined) {
  14861. upper = toNumber(upper);
  14862. upper = upper === upper ? upper : 0;
  14863. }
  14864. if (lower !== undefined) {
  14865. lower = toNumber(lower);
  14866. lower = lower === lower ? lower : 0;
  14867. }
  14868. return baseClamp(toNumber(number), lower, upper);
  14869. }
  14870. /**
  14871. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14872. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14873. * If `start` is greater than `end` the params are swapped to support
  14874. * negative ranges.
  14875. *
  14876. * @static
  14877. * @memberOf _
  14878. * @since 3.3.0
  14879. * @category Number
  14880. * @param {number} number The number to check.
  14881. * @param {number} [start=0] The start of the range.
  14882. * @param {number} end The end of the range.
  14883. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14884. * @see _.range, _.rangeRight
  14885. * @example
  14886. *
  14887. * _.inRange(3, 2, 4);
  14888. * // => true
  14889. *
  14890. * _.inRange(4, 8);
  14891. * // => true
  14892. *
  14893. * _.inRange(4, 2);
  14894. * // => false
  14895. *
  14896. * _.inRange(2, 2);
  14897. * // => false
  14898. *
  14899. * _.inRange(1.2, 2);
  14900. * // => true
  14901. *
  14902. * _.inRange(5.2, 4);
  14903. * // => false
  14904. *
  14905. * _.inRange(-3, -2, -6);
  14906. * // => true
  14907. */
  14908. function inRange(number, start, end) {
  14909. start = toFinite(start);
  14910. if (end === undefined) {
  14911. end = start;
  14912. start = 0;
  14913. } else {
  14914. end = toFinite(end);
  14915. }
  14916. number = toNumber(number);
  14917. return baseInRange(number, start, end);
  14918. }
  14919. /**
  14920. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14921. * If only one argument is provided a number between `0` and the given number
  14922. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14923. * floats, a floating-point number is returned instead of an integer.
  14924. *
  14925. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14926. * floating-point values which can produce unexpected results.
  14927. *
  14928. * @static
  14929. * @memberOf _
  14930. * @since 0.7.0
  14931. * @category Number
  14932. * @param {number} [lower=0] The lower bound.
  14933. * @param {number} [upper=1] The upper bound.
  14934. * @param {boolean} [floating] Specify returning a floating-point number.
  14935. * @returns {number} Returns the random number.
  14936. * @example
  14937. *
  14938. * _.random(0, 5);
  14939. * // => an integer between 0 and 5
  14940. *
  14941. * _.random(5);
  14942. * // => also an integer between 0 and 5
  14943. *
  14944. * _.random(5, true);
  14945. * // => a floating-point number between 0 and 5
  14946. *
  14947. * _.random(1.2, 5.2);
  14948. * // => a floating-point number between 1.2 and 5.2
  14949. */
  14950. function random(lower, upper, floating) {
  14951. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14952. upper = floating = undefined;
  14953. }
  14954. if (floating === undefined) {
  14955. if (typeof upper == 'boolean') {
  14956. floating = upper;
  14957. upper = undefined;
  14958. }
  14959. else if (typeof lower == 'boolean') {
  14960. floating = lower;
  14961. lower = undefined;
  14962. }
  14963. }
  14964. if (lower === undefined && upper === undefined) {
  14965. lower = 0;
  14966. upper = 1;
  14967. }
  14968. else {
  14969. lower = toFinite(lower);
  14970. if (upper === undefined) {
  14971. upper = lower;
  14972. lower = 0;
  14973. } else {
  14974. upper = toFinite(upper);
  14975. }
  14976. }
  14977. if (lower > upper) {
  14978. var temp = lower;
  14979. lower = upper;
  14980. upper = temp;
  14981. }
  14982. if (floating || lower % 1 || upper % 1) {
  14983. var rand = nativeRandom();
  14984. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14985. }
  14986. return baseRandom(lower, upper);
  14987. }
  14988. /*------------------------------------------------------------------------*/
  14989. /**
  14990. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14991. *
  14992. * @static
  14993. * @memberOf _
  14994. * @since 3.0.0
  14995. * @category String
  14996. * @param {string} [string=''] The string to convert.
  14997. * @returns {string} Returns the camel cased string.
  14998. * @example
  14999. *
  15000. * _.camelCase('Foo Bar');
  15001. * // => 'fooBar'
  15002. *
  15003. * _.camelCase('--foo-bar--');
  15004. * // => 'fooBar'
  15005. *
  15006. * _.camelCase('__FOO_BAR__');
  15007. * // => 'fooBar'
  15008. */
  15009. var camelCase = createCompounder(function(result, word, index) {
  15010. word = word.toLowerCase();
  15011. return result + (index ? capitalize(word) : word);
  15012. });
  15013. /**
  15014. * Converts the first character of `string` to upper case and the remaining
  15015. * to lower case.
  15016. *
  15017. * @static
  15018. * @memberOf _
  15019. * @since 3.0.0
  15020. * @category String
  15021. * @param {string} [string=''] The string to capitalize.
  15022. * @returns {string} Returns the capitalized string.
  15023. * @example
  15024. *
  15025. * _.capitalize('FRED');
  15026. * // => 'Fred'
  15027. */
  15028. function capitalize(string) {
  15029. return upperFirst(toString(string).toLowerCase());
  15030. }
  15031. /**
  15032. * Deburrs `string` by converting
  15033. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  15034. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  15035. * letters to basic Latin letters and removing
  15036. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  15037. *
  15038. * @static
  15039. * @memberOf _
  15040. * @since 3.0.0
  15041. * @category String
  15042. * @param {string} [string=''] The string to deburr.
  15043. * @returns {string} Returns the deburred string.
  15044. * @example
  15045. *
  15046. * _.deburr('déjà vu');
  15047. * // => 'deja vu'
  15048. */
  15049. function deburr(string) {
  15050. string = toString(string);
  15051. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  15052. }
  15053. /**
  15054. * Checks if `string` ends with the given target string.
  15055. *
  15056. * @static
  15057. * @memberOf _
  15058. * @since 3.0.0
  15059. * @category String
  15060. * @param {string} [string=''] The string to inspect.
  15061. * @param {string} [target] The string to search for.
  15062. * @param {number} [position=string.length] The position to search up to.
  15063. * @returns {boolean} Returns `true` if `string` ends with `target`,
  15064. * else `false`.
  15065. * @example
  15066. *
  15067. * _.endsWith('abc', 'c');
  15068. * // => true
  15069. *
  15070. * _.endsWith('abc', 'b');
  15071. * // => false
  15072. *
  15073. * _.endsWith('abc', 'b', 2);
  15074. * // => true
  15075. */
  15076. function endsWith(string, target, position) {
  15077. string = toString(string);
  15078. target = baseToString(target);
  15079. var length = string.length;
  15080. position = position === undefined
  15081. ? length
  15082. : baseClamp(toInteger(position), 0, length);
  15083. var end = position;
  15084. position -= target.length;
  15085. return position >= 0 && string.slice(position, end) == target;
  15086. }
  15087. /**
  15088. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  15089. * corresponding HTML entities.
  15090. *
  15091. * **Note:** No other characters are escaped. To escape additional
  15092. * characters use a third-party library like [_he_](https://mths.be/he).
  15093. *
  15094. * Though the ">" character is escaped for symmetry, characters like
  15095. * ">" and "/" don't need escaping in HTML and have no special meaning
  15096. * unless they're part of a tag or unquoted attribute value. See
  15097. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  15098. * (under "semi-related fun fact") for more details.
  15099. *
  15100. * When working with HTML you should always
  15101. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  15102. * XSS vectors.
  15103. *
  15104. * @static
  15105. * @since 0.1.0
  15106. * @memberOf _
  15107. * @category String
  15108. * @param {string} [string=''] The string to escape.
  15109. * @returns {string} Returns the escaped string.
  15110. * @example
  15111. *
  15112. * _.escape('fred, barney, & pebbles');
  15113. * // => 'fred, barney, &amp; pebbles'
  15114. */
  15115. function escape(string) {
  15116. string = toString(string);
  15117. return (string && reHasUnescapedHtml.test(string))
  15118. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  15119. : string;
  15120. }
  15121. /**
  15122. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  15123. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  15124. *
  15125. * @static
  15126. * @memberOf _
  15127. * @since 3.0.0
  15128. * @category String
  15129. * @param {string} [string=''] The string to escape.
  15130. * @returns {string} Returns the escaped string.
  15131. * @example
  15132. *
  15133. * _.escapeRegExp('[lodash](https://lodash.com/)');
  15134. * // => '\[lodash\]\(https://lodash\.com/\)'
  15135. */
  15136. function escapeRegExp(string) {
  15137. string = toString(string);
  15138. return (string && reHasRegExpChar.test(string))
  15139. ? string.replace(reRegExpChar, '\\$&')
  15140. : string;
  15141. }
  15142. /**
  15143. * Converts `string` to
  15144. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  15145. *
  15146. * @static
  15147. * @memberOf _
  15148. * @since 3.0.0
  15149. * @category String
  15150. * @param {string} [string=''] The string to convert.
  15151. * @returns {string} Returns the kebab cased string.
  15152. * @example
  15153. *
  15154. * _.kebabCase('Foo Bar');
  15155. * // => 'foo-bar'
  15156. *
  15157. * _.kebabCase('fooBar');
  15158. * // => 'foo-bar'
  15159. *
  15160. * _.kebabCase('__FOO_BAR__');
  15161. * // => 'foo-bar'
  15162. */
  15163. var kebabCase = createCompounder(function(result, word, index) {
  15164. return result + (index ? '-' : '') + word.toLowerCase();
  15165. });
  15166. /**
  15167. * Converts `string`, as space separated words, to lower case.
  15168. *
  15169. * @static
  15170. * @memberOf _
  15171. * @since 4.0.0
  15172. * @category String
  15173. * @param {string} [string=''] The string to convert.
  15174. * @returns {string} Returns the lower cased string.
  15175. * @example
  15176. *
  15177. * _.lowerCase('--Foo-Bar--');
  15178. * // => 'foo bar'
  15179. *
  15180. * _.lowerCase('fooBar');
  15181. * // => 'foo bar'
  15182. *
  15183. * _.lowerCase('__FOO_BAR__');
  15184. * // => 'foo bar'
  15185. */
  15186. var lowerCase = createCompounder(function(result, word, index) {
  15187. return result + (index ? ' ' : '') + word.toLowerCase();
  15188. });
  15189. /**
  15190. * Converts the first character of `string` to lower case.
  15191. *
  15192. * @static
  15193. * @memberOf _
  15194. * @since 4.0.0
  15195. * @category String
  15196. * @param {string} [string=''] The string to convert.
  15197. * @returns {string} Returns the converted string.
  15198. * @example
  15199. *
  15200. * _.lowerFirst('Fred');
  15201. * // => 'fred'
  15202. *
  15203. * _.lowerFirst('FRED');
  15204. * // => 'fRED'
  15205. */
  15206. var lowerFirst = createCaseFirst('toLowerCase');
  15207. /**
  15208. * Pads `string` on the left and right sides if it's shorter than `length`.
  15209. * Padding characters are truncated if they can't be evenly divided by `length`.
  15210. *
  15211. * @static
  15212. * @memberOf _
  15213. * @since 3.0.0
  15214. * @category String
  15215. * @param {string} [string=''] The string to pad.
  15216. * @param {number} [length=0] The padding length.
  15217. * @param {string} [chars=' '] The string used as padding.
  15218. * @returns {string} Returns the padded string.
  15219. * @example
  15220. *
  15221. * _.pad('abc', 8);
  15222. * // => ' abc '
  15223. *
  15224. * _.pad('abc', 8, '_-');
  15225. * // => '_-abc_-_'
  15226. *
  15227. * _.pad('abc', 3);
  15228. * // => 'abc'
  15229. */
  15230. function pad(string, length, chars) {
  15231. string = toString(string);
  15232. length = toInteger(length);
  15233. var strLength = length ? stringSize(string) : 0;
  15234. if (!length || strLength >= length) {
  15235. return string;
  15236. }
  15237. var mid = (length - strLength) / 2;
  15238. return (
  15239. createPadding(nativeFloor(mid), chars) +
  15240. string +
  15241. createPadding(nativeCeil(mid), chars)
  15242. );
  15243. }
  15244. /**
  15245. * Pads `string` on the right side if it's shorter than `length`. Padding
  15246. * characters are truncated if they exceed `length`.
  15247. *
  15248. * @static
  15249. * @memberOf _
  15250. * @since 4.0.0
  15251. * @category String
  15252. * @param {string} [string=''] The string to pad.
  15253. * @param {number} [length=0] The padding length.
  15254. * @param {string} [chars=' '] The string used as padding.
  15255. * @returns {string} Returns the padded string.
  15256. * @example
  15257. *
  15258. * _.padEnd('abc', 6);
  15259. * // => 'abc '
  15260. *
  15261. * _.padEnd('abc', 6, '_-');
  15262. * // => 'abc_-_'
  15263. *
  15264. * _.padEnd('abc', 3);
  15265. * // => 'abc'
  15266. */
  15267. function padEnd(string, length, chars) {
  15268. string = toString(string);
  15269. length = toInteger(length);
  15270. var strLength = length ? stringSize(string) : 0;
  15271. return (length && strLength < length)
  15272. ? (string + createPadding(length - strLength, chars))
  15273. : string;
  15274. }
  15275. /**
  15276. * Pads `string` on the left side if it's shorter than `length`. Padding
  15277. * characters are truncated if they exceed `length`.
  15278. *
  15279. * @static
  15280. * @memberOf _
  15281. * @since 4.0.0
  15282. * @category String
  15283. * @param {string} [string=''] The string to pad.
  15284. * @param {number} [length=0] The padding length.
  15285. * @param {string} [chars=' '] The string used as padding.
  15286. * @returns {string} Returns the padded string.
  15287. * @example
  15288. *
  15289. * _.padStart('abc', 6);
  15290. * // => ' abc'
  15291. *
  15292. * _.padStart('abc', 6, '_-');
  15293. * // => '_-_abc'
  15294. *
  15295. * _.padStart('abc', 3);
  15296. * // => 'abc'
  15297. */
  15298. function padStart(string, length, chars) {
  15299. string = toString(string);
  15300. length = toInteger(length);
  15301. var strLength = length ? stringSize(string) : 0;
  15302. return (length && strLength < length)
  15303. ? (createPadding(length - strLength, chars) + string)
  15304. : string;
  15305. }
  15306. /**
  15307. * Converts `string` to an integer of the specified radix. If `radix` is
  15308. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  15309. * hexadecimal, in which case a `radix` of `16` is used.
  15310. *
  15311. * **Note:** This method aligns with the
  15312. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  15313. *
  15314. * @static
  15315. * @memberOf _
  15316. * @since 1.1.0
  15317. * @category String
  15318. * @param {string} string The string to convert.
  15319. * @param {number} [radix=10] The radix to interpret `value` by.
  15320. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15321. * @returns {number} Returns the converted integer.
  15322. * @example
  15323. *
  15324. * _.parseInt('08');
  15325. * // => 8
  15326. *
  15327. * _.map(['6', '08', '10'], _.parseInt);
  15328. * // => [6, 8, 10]
  15329. */
  15330. function parseInt(string, radix, guard) {
  15331. if (guard || radix == null) {
  15332. radix = 0;
  15333. } else if (radix) {
  15334. radix = +radix;
  15335. }
  15336. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  15337. }
  15338. /**
  15339. * Repeats the given string `n` times.
  15340. *
  15341. * @static
  15342. * @memberOf _
  15343. * @since 3.0.0
  15344. * @category String
  15345. * @param {string} [string=''] The string to repeat.
  15346. * @param {number} [n=1] The number of times to repeat the string.
  15347. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15348. * @returns {string} Returns the repeated string.
  15349. * @example
  15350. *
  15351. * _.repeat('*', 3);
  15352. * // => '***'
  15353. *
  15354. * _.repeat('abc', 2);
  15355. * // => 'abcabc'
  15356. *
  15357. * _.repeat('abc', 0);
  15358. * // => ''
  15359. */
  15360. function repeat(string, n, guard) {
  15361. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  15362. n = 1;
  15363. } else {
  15364. n = toInteger(n);
  15365. }
  15366. return baseRepeat(toString(string), n);
  15367. }
  15368. /**
  15369. * Replaces matches for `pattern` in `string` with `replacement`.
  15370. *
  15371. * **Note:** This method is based on
  15372. * [`String#replace`](https://mdn.io/String/replace).
  15373. *
  15374. * @static
  15375. * @memberOf _
  15376. * @since 4.0.0
  15377. * @category String
  15378. * @param {string} [string=''] The string to modify.
  15379. * @param {RegExp|string} pattern The pattern to replace.
  15380. * @param {Function|string} replacement The match replacement.
  15381. * @returns {string} Returns the modified string.
  15382. * @example
  15383. *
  15384. * _.replace('Hi Fred', 'Fred', 'Barney');
  15385. * // => 'Hi Barney'
  15386. */
  15387. function replace() {
  15388. var args = arguments,
  15389. string = toString(args[0]);
  15390. return args.length < 3 ? string : string.replace(args[1], args[2]);
  15391. }
  15392. /**
  15393. * Converts `string` to
  15394. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  15395. *
  15396. * @static
  15397. * @memberOf _
  15398. * @since 3.0.0
  15399. * @category String
  15400. * @param {string} [string=''] The string to convert.
  15401. * @returns {string} Returns the snake cased string.
  15402. * @example
  15403. *
  15404. * _.snakeCase('Foo Bar');
  15405. * // => 'foo_bar'
  15406. *
  15407. * _.snakeCase('fooBar');
  15408. * // => 'foo_bar'
  15409. *
  15410. * _.snakeCase('--FOO-BAR--');
  15411. * // => 'foo_bar'
  15412. */
  15413. var snakeCase = createCompounder(function(result, word, index) {
  15414. return result + (index ? '_' : '') + word.toLowerCase();
  15415. });
  15416. /**
  15417. * Splits `string` by `separator`.
  15418. *
  15419. * **Note:** This method is based on
  15420. * [`String#split`](https://mdn.io/String/split).
  15421. *
  15422. * @static
  15423. * @memberOf _
  15424. * @since 4.0.0
  15425. * @category String
  15426. * @param {string} [string=''] The string to split.
  15427. * @param {RegExp|string} separator The separator pattern to split by.
  15428. * @param {number} [limit] The length to truncate results to.
  15429. * @returns {Array} Returns the string segments.
  15430. * @example
  15431. *
  15432. * _.split('a-b-c', '-', 2);
  15433. * // => ['a', 'b']
  15434. */
  15435. function split(string, separator, limit) {
  15436. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  15437. separator = limit = undefined;
  15438. }
  15439. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  15440. if (!limit) {
  15441. return [];
  15442. }
  15443. string = toString(string);
  15444. if (string && (
  15445. typeof separator == 'string' ||
  15446. (separator != null && !isRegExp(separator))
  15447. )) {
  15448. separator = baseToString(separator);
  15449. if (!separator && hasUnicode(string)) {
  15450. return castSlice(stringToArray(string), 0, limit);
  15451. }
  15452. }
  15453. return string.split(separator, limit);
  15454. }
  15455. /**
  15456. * Converts `string` to
  15457. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  15458. *
  15459. * @static
  15460. * @memberOf _
  15461. * @since 3.1.0
  15462. * @category String
  15463. * @param {string} [string=''] The string to convert.
  15464. * @returns {string} Returns the start cased string.
  15465. * @example
  15466. *
  15467. * _.startCase('--foo-bar--');
  15468. * // => 'Foo Bar'
  15469. *
  15470. * _.startCase('fooBar');
  15471. * // => 'Foo Bar'
  15472. *
  15473. * _.startCase('__FOO_BAR__');
  15474. * // => 'FOO BAR'
  15475. */
  15476. var startCase = createCompounder(function(result, word, index) {
  15477. return result + (index ? ' ' : '') + upperFirst(word);
  15478. });
  15479. /**
  15480. * Checks if `string` starts with the given target string.
  15481. *
  15482. * @static
  15483. * @memberOf _
  15484. * @since 3.0.0
  15485. * @category String
  15486. * @param {string} [string=''] The string to inspect.
  15487. * @param {string} [target] The string to search for.
  15488. * @param {number} [position=0] The position to search from.
  15489. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15490. * else `false`.
  15491. * @example
  15492. *
  15493. * _.startsWith('abc', 'a');
  15494. * // => true
  15495. *
  15496. * _.startsWith('abc', 'b');
  15497. * // => false
  15498. *
  15499. * _.startsWith('abc', 'b', 1);
  15500. * // => true
  15501. */
  15502. function startsWith(string, target, position) {
  15503. string = toString(string);
  15504. position = position == null
  15505. ? 0
  15506. : baseClamp(toInteger(position), 0, string.length);
  15507. target = baseToString(target);
  15508. return string.slice(position, position + target.length) == target;
  15509. }
  15510. /**
  15511. * Creates a compiled template function that can interpolate data properties
  15512. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15513. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15514. * properties may be accessed as free variables in the template. If a setting
  15515. * object is given, it takes precedence over `_.templateSettings` values.
  15516. *
  15517. * **Note:** In the development build `_.template` utilizes
  15518. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15519. * for easier debugging.
  15520. *
  15521. * For more information on precompiling templates see
  15522. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15523. *
  15524. * For more information on Chrome extension sandboxes see
  15525. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15526. *
  15527. * @static
  15528. * @since 0.1.0
  15529. * @memberOf _
  15530. * @category String
  15531. * @param {string} [string=''] The template string.
  15532. * @param {Object} [options={}] The options object.
  15533. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15534. * The HTML "escape" delimiter.
  15535. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15536. * The "evaluate" delimiter.
  15537. * @param {Object} [options.imports=_.templateSettings.imports]
  15538. * An object to import into the template as free variables.
  15539. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15540. * The "interpolate" delimiter.
  15541. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15542. * The sourceURL of the compiled template.
  15543. * @param {string} [options.variable='obj']
  15544. * The data object variable name.
  15545. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15546. * @returns {Function} Returns the compiled template function.
  15547. * @example
  15548. *
  15549. * // Use the "interpolate" delimiter to create a compiled template.
  15550. * var compiled = _.template('hello <%= user %>!');
  15551. * compiled({ 'user': 'fred' });
  15552. * // => 'hello fred!'
  15553. *
  15554. * // Use the HTML "escape" delimiter to escape data property values.
  15555. * var compiled = _.template('<b><%- value %></b>');
  15556. * compiled({ 'value': '<script>' });
  15557. * // => '<b>&lt;script&gt;</b>'
  15558. *
  15559. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15560. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15561. * compiled({ 'users': ['fred', 'barney'] });
  15562. * // => '<li>fred</li><li>barney</li>'
  15563. *
  15564. * // Use the internal `print` function in "evaluate" delimiters.
  15565. * var compiled = _.template('<% print("hello " + user); %>!');
  15566. * compiled({ 'user': 'barney' });
  15567. * // => 'hello barney!'
  15568. *
  15569. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15570. * // Disable support by replacing the "interpolate" delimiter.
  15571. * var compiled = _.template('hello ${ user }!');
  15572. * compiled({ 'user': 'pebbles' });
  15573. * // => 'hello pebbles!'
  15574. *
  15575. * // Use backslashes to treat delimiters as plain text.
  15576. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15577. * compiled({ 'value': 'ignored' });
  15578. * // => '<%- value %>'
  15579. *
  15580. * // Use the `imports` option to import `jQuery` as `jq`.
  15581. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15582. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15583. * compiled({ 'users': ['fred', 'barney'] });
  15584. * // => '<li>fred</li><li>barney</li>'
  15585. *
  15586. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15587. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15588. * compiled(data);
  15589. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15590. *
  15591. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15592. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15593. * compiled.source;
  15594. * // => function(data) {
  15595. * // var __t, __p = '';
  15596. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15597. * // return __p;
  15598. * // }
  15599. *
  15600. * // Use custom template delimiters.
  15601. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15602. * var compiled = _.template('hello {{ user }}!');
  15603. * compiled({ 'user': 'mustache' });
  15604. * // => 'hello mustache!'
  15605. *
  15606. * // Use the `source` property to inline compiled templates for meaningful
  15607. * // line numbers in error messages and stack traces.
  15608. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15609. * var JST = {\
  15610. * "main": ' + _.template(mainText).source + '\
  15611. * };\
  15612. * ');
  15613. */
  15614. function template(string, options, guard) {
  15615. // Based on John Resig's `tmpl` implementation
  15616. // (http://ejohn.org/blog/javascript-micro-templating/)
  15617. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15618. var settings = lodash.templateSettings;
  15619. if (guard && isIterateeCall(string, options, guard)) {
  15620. options = undefined;
  15621. }
  15622. string = toString(string);
  15623. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15624. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15625. importsKeys = keys(imports),
  15626. importsValues = baseValues(imports, importsKeys);
  15627. var isEscaping,
  15628. isEvaluating,
  15629. index = 0,
  15630. interpolate = options.interpolate || reNoMatch,
  15631. source = "__p += '";
  15632. // Compile the regexp to match each delimiter.
  15633. var reDelimiters = RegExp(
  15634. (options.escape || reNoMatch).source + '|' +
  15635. interpolate.source + '|' +
  15636. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15637. (options.evaluate || reNoMatch).source + '|$'
  15638. , 'g');
  15639. // Use a sourceURL for easier debugging.
  15640. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15641. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15642. // and escape the comment, thus injecting code that gets evaled.
  15643. var sourceURL = '//# sourceURL=' +
  15644. (hasOwnProperty.call(options, 'sourceURL')
  15645. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15646. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15647. ) + '\n';
  15648. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15649. interpolateValue || (interpolateValue = esTemplateValue);
  15650. // Escape characters that can't be included in string literals.
  15651. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15652. // Replace delimiters with snippets.
  15653. if (escapeValue) {
  15654. isEscaping = true;
  15655. source += "' +\n__e(" + escapeValue + ") +\n'";
  15656. }
  15657. if (evaluateValue) {
  15658. isEvaluating = true;
  15659. source += "';\n" + evaluateValue + ";\n__p += '";
  15660. }
  15661. if (interpolateValue) {
  15662. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15663. }
  15664. index = offset + match.length;
  15665. // The JS engine embedded in Adobe products needs `match` returned in
  15666. // order to produce the correct `offset` value.
  15667. return match;
  15668. });
  15669. source += "';\n";
  15670. // If `variable` is not specified wrap a with-statement around the generated
  15671. // code to add the data object to the top of the scope chain.
  15672. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15673. if (!variable) {
  15674. source = 'with (obj) {\n' + source + '\n}\n';
  15675. }
  15676. // Throw an error if a forbidden character was found in `variable`, to prevent
  15677. // potential command injection attacks.
  15678. else if (reForbiddenIdentifierChars.test(variable)) {
  15679. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15680. }
  15681. // Cleanup code by stripping empty strings.
  15682. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15683. .replace(reEmptyStringMiddle, '$1')
  15684. .replace(reEmptyStringTrailing, '$1;');
  15685. // Frame code as the function body.
  15686. source = 'function(' + (variable || 'obj') + ') {\n' +
  15687. (variable
  15688. ? ''
  15689. : 'obj || (obj = {});\n'
  15690. ) +
  15691. "var __t, __p = ''" +
  15692. (isEscaping
  15693. ? ', __e = _.escape'
  15694. : ''
  15695. ) +
  15696. (isEvaluating
  15697. ? ', __j = Array.prototype.join;\n' +
  15698. "function print() { __p += __j.call(arguments, '') }\n"
  15699. : ';\n'
  15700. ) +
  15701. source +
  15702. 'return __p\n}';
  15703. var result = attempt(function() {
  15704. return Function(importsKeys, sourceURL + 'return ' + source)
  15705. .apply(undefined, importsValues);
  15706. });
  15707. // Provide the compiled function's source by its `toString` method or
  15708. // the `source` property as a convenience for inlining compiled templates.
  15709. result.source = source;
  15710. if (isError(result)) {
  15711. throw result;
  15712. }
  15713. return result;
  15714. }
  15715. /**
  15716. * Converts `string`, as a whole, to lower case just like
  15717. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15718. *
  15719. * @static
  15720. * @memberOf _
  15721. * @since 4.0.0
  15722. * @category String
  15723. * @param {string} [string=''] The string to convert.
  15724. * @returns {string} Returns the lower cased string.
  15725. * @example
  15726. *
  15727. * _.toLower('--Foo-Bar--');
  15728. * // => '--foo-bar--'
  15729. *
  15730. * _.toLower('fooBar');
  15731. * // => 'foobar'
  15732. *
  15733. * _.toLower('__FOO_BAR__');
  15734. * // => '__foo_bar__'
  15735. */
  15736. function toLower(value) {
  15737. return toString(value).toLowerCase();
  15738. }
  15739. /**
  15740. * Converts `string`, as a whole, to upper case just like
  15741. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15742. *
  15743. * @static
  15744. * @memberOf _
  15745. * @since 4.0.0
  15746. * @category String
  15747. * @param {string} [string=''] The string to convert.
  15748. * @returns {string} Returns the upper cased string.
  15749. * @example
  15750. *
  15751. * _.toUpper('--foo-bar--');
  15752. * // => '--FOO-BAR--'
  15753. *
  15754. * _.toUpper('fooBar');
  15755. * // => 'FOOBAR'
  15756. *
  15757. * _.toUpper('__foo_bar__');
  15758. * // => '__FOO_BAR__'
  15759. */
  15760. function toUpper(value) {
  15761. return toString(value).toUpperCase();
  15762. }
  15763. /**
  15764. * Removes leading and trailing whitespace or specified characters from `string`.
  15765. *
  15766. * @static
  15767. * @memberOf _
  15768. * @since 3.0.0
  15769. * @category String
  15770. * @param {string} [string=''] The string to trim.
  15771. * @param {string} [chars=whitespace] The characters to trim.
  15772. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15773. * @returns {string} Returns the trimmed string.
  15774. * @example
  15775. *
  15776. * _.trim(' abc ');
  15777. * // => 'abc'
  15778. *
  15779. * _.trim('-_-abc-_-', '_-');
  15780. * // => 'abc'
  15781. *
  15782. * _.map([' foo ', ' bar '], _.trim);
  15783. * // => ['foo', 'bar']
  15784. */
  15785. function trim(string, chars, guard) {
  15786. string = toString(string);
  15787. if (string && (guard || chars === undefined)) {
  15788. return baseTrim(string);
  15789. }
  15790. if (!string || !(chars = baseToString(chars))) {
  15791. return string;
  15792. }
  15793. var strSymbols = stringToArray(string),
  15794. chrSymbols = stringToArray(chars),
  15795. start = charsStartIndex(strSymbols, chrSymbols),
  15796. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15797. return castSlice(strSymbols, start, end).join('');
  15798. }
  15799. /**
  15800. * Removes trailing whitespace or specified characters from `string`.
  15801. *
  15802. * @static
  15803. * @memberOf _
  15804. * @since 4.0.0
  15805. * @category String
  15806. * @param {string} [string=''] The string to trim.
  15807. * @param {string} [chars=whitespace] The characters to trim.
  15808. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15809. * @returns {string} Returns the trimmed string.
  15810. * @example
  15811. *
  15812. * _.trimEnd(' abc ');
  15813. * // => ' abc'
  15814. *
  15815. * _.trimEnd('-_-abc-_-', '_-');
  15816. * // => '-_-abc'
  15817. */
  15818. function trimEnd(string, chars, guard) {
  15819. string = toString(string);
  15820. if (string && (guard || chars === undefined)) {
  15821. return string.slice(0, trimmedEndIndex(string) + 1);
  15822. }
  15823. if (!string || !(chars = baseToString(chars))) {
  15824. return string;
  15825. }
  15826. var strSymbols = stringToArray(string),
  15827. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15828. return castSlice(strSymbols, 0, end).join('');
  15829. }
  15830. /**
  15831. * Removes leading whitespace or specified characters from `string`.
  15832. *
  15833. * @static
  15834. * @memberOf _
  15835. * @since 4.0.0
  15836. * @category String
  15837. * @param {string} [string=''] The string to trim.
  15838. * @param {string} [chars=whitespace] The characters to trim.
  15839. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15840. * @returns {string} Returns the trimmed string.
  15841. * @example
  15842. *
  15843. * _.trimStart(' abc ');
  15844. * // => 'abc '
  15845. *
  15846. * _.trimStart('-_-abc-_-', '_-');
  15847. * // => 'abc-_-'
  15848. */
  15849. function trimStart(string, chars, guard) {
  15850. string = toString(string);
  15851. if (string && (guard || chars === undefined)) {
  15852. return string.replace(reTrimStart, '');
  15853. }
  15854. if (!string || !(chars = baseToString(chars))) {
  15855. return string;
  15856. }
  15857. var strSymbols = stringToArray(string),
  15858. start = charsStartIndex(strSymbols, stringToArray(chars));
  15859. return castSlice(strSymbols, start).join('');
  15860. }
  15861. /**
  15862. * Truncates `string` if it's longer than the given maximum string length.
  15863. * The last characters of the truncated string are replaced with the omission
  15864. * string which defaults to "...".
  15865. *
  15866. * @static
  15867. * @memberOf _
  15868. * @since 4.0.0
  15869. * @category String
  15870. * @param {string} [string=''] The string to truncate.
  15871. * @param {Object} [options={}] The options object.
  15872. * @param {number} [options.length=30] The maximum string length.
  15873. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15874. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15875. * @returns {string} Returns the truncated string.
  15876. * @example
  15877. *
  15878. * _.truncate('hi-diddly-ho there, neighborino');
  15879. * // => 'hi-diddly-ho there, neighbo...'
  15880. *
  15881. * _.truncate('hi-diddly-ho there, neighborino', {
  15882. * 'length': 24,
  15883. * 'separator': ' '
  15884. * });
  15885. * // => 'hi-diddly-ho there,...'
  15886. *
  15887. * _.truncate('hi-diddly-ho there, neighborino', {
  15888. * 'length': 24,
  15889. * 'separator': /,? +/
  15890. * });
  15891. * // => 'hi-diddly-ho there...'
  15892. *
  15893. * _.truncate('hi-diddly-ho there, neighborino', {
  15894. * 'omission': ' [...]'
  15895. * });
  15896. * // => 'hi-diddly-ho there, neig [...]'
  15897. */
  15898. function truncate(string, options) {
  15899. var length = DEFAULT_TRUNC_LENGTH,
  15900. omission = DEFAULT_TRUNC_OMISSION;
  15901. if (isObject(options)) {
  15902. var separator = 'separator' in options ? options.separator : separator;
  15903. length = 'length' in options ? toInteger(options.length) : length;
  15904. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15905. }
  15906. string = toString(string);
  15907. var strLength = string.length;
  15908. if (hasUnicode(string)) {
  15909. var strSymbols = stringToArray(string);
  15910. strLength = strSymbols.length;
  15911. }
  15912. if (length >= strLength) {
  15913. return string;
  15914. }
  15915. var end = length - stringSize(omission);
  15916. if (end < 1) {
  15917. return omission;
  15918. }
  15919. var result = strSymbols
  15920. ? castSlice(strSymbols, 0, end).join('')
  15921. : string.slice(0, end);
  15922. if (separator === undefined) {
  15923. return result + omission;
  15924. }
  15925. if (strSymbols) {
  15926. end += (result.length - end);
  15927. }
  15928. if (isRegExp(separator)) {
  15929. if (string.slice(end).search(separator)) {
  15930. var match,
  15931. substring = result;
  15932. if (!separator.global) {
  15933. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15934. }
  15935. separator.lastIndex = 0;
  15936. while ((match = separator.exec(substring))) {
  15937. var newEnd = match.index;
  15938. }
  15939. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15940. }
  15941. } else if (string.indexOf(baseToString(separator), end) != end) {
  15942. var index = result.lastIndexOf(separator);
  15943. if (index > -1) {
  15944. result = result.slice(0, index);
  15945. }
  15946. }
  15947. return result + omission;
  15948. }
  15949. /**
  15950. * The inverse of `_.escape`; this method converts the HTML entities
  15951. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15952. * their corresponding characters.
  15953. *
  15954. * **Note:** No other HTML entities are unescaped. To unescape additional
  15955. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15956. *
  15957. * @static
  15958. * @memberOf _
  15959. * @since 0.6.0
  15960. * @category String
  15961. * @param {string} [string=''] The string to unescape.
  15962. * @returns {string} Returns the unescaped string.
  15963. * @example
  15964. *
  15965. * _.unescape('fred, barney, &amp; pebbles');
  15966. * // => 'fred, barney, & pebbles'
  15967. */
  15968. function unescape(string) {
  15969. string = toString(string);
  15970. return (string && reHasEscapedHtml.test(string))
  15971. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15972. : string;
  15973. }
  15974. /**
  15975. * Converts `string`, as space separated words, to upper case.
  15976. *
  15977. * @static
  15978. * @memberOf _
  15979. * @since 4.0.0
  15980. * @category String
  15981. * @param {string} [string=''] The string to convert.
  15982. * @returns {string} Returns the upper cased string.
  15983. * @example
  15984. *
  15985. * _.upperCase('--foo-bar');
  15986. * // => 'FOO BAR'
  15987. *
  15988. * _.upperCase('fooBar');
  15989. * // => 'FOO BAR'
  15990. *
  15991. * _.upperCase('__foo_bar__');
  15992. * // => 'FOO BAR'
  15993. */
  15994. var upperCase = createCompounder(function(result, word, index) {
  15995. return result + (index ? ' ' : '') + word.toUpperCase();
  15996. });
  15997. /**
  15998. * Converts the first character of `string` to upper case.
  15999. *
  16000. * @static
  16001. * @memberOf _
  16002. * @since 4.0.0
  16003. * @category String
  16004. * @param {string} [string=''] The string to convert.
  16005. * @returns {string} Returns the converted string.
  16006. * @example
  16007. *
  16008. * _.upperFirst('fred');
  16009. * // => 'Fred'
  16010. *
  16011. * _.upperFirst('FRED');
  16012. * // => 'FRED'
  16013. */
  16014. var upperFirst = createCaseFirst('toUpperCase');
  16015. /**
  16016. * Splits `string` into an array of its words.
  16017. *
  16018. * @static
  16019. * @memberOf _
  16020. * @since 3.0.0
  16021. * @category String
  16022. * @param {string} [string=''] The string to inspect.
  16023. * @param {RegExp|string} [pattern] The pattern to match words.
  16024. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  16025. * @returns {Array} Returns the words of `string`.
  16026. * @example
  16027. *
  16028. * _.words('fred, barney, & pebbles');
  16029. * // => ['fred', 'barney', 'pebbles']
  16030. *
  16031. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  16032. * // => ['fred', 'barney', '&', 'pebbles']
  16033. */
  16034. function words(string, pattern, guard) {
  16035. string = toString(string);
  16036. pattern = guard ? undefined : pattern;
  16037. if (pattern === undefined) {
  16038. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  16039. }
  16040. return string.match(pattern) || [];
  16041. }
  16042. /*------------------------------------------------------------------------*/
  16043. /**
  16044. * Attempts to invoke `func`, returning either the result or the caught error
  16045. * object. Any additional arguments are provided to `func` when it's invoked.
  16046. *
  16047. * @static
  16048. * @memberOf _
  16049. * @since 3.0.0
  16050. * @category Util
  16051. * @param {Function} func The function to attempt.
  16052. * @param {...*} [args] The arguments to invoke `func` with.
  16053. * @returns {*} Returns the `func` result or error object.
  16054. * @example
  16055. *
  16056. * // Avoid throwing errors for invalid selectors.
  16057. * var elements = _.attempt(function(selector) {
  16058. * return document.querySelectorAll(selector);
  16059. * }, '>_>');
  16060. *
  16061. * if (_.isError(elements)) {
  16062. * elements = [];
  16063. * }
  16064. */
  16065. var attempt = baseRest(function(func, args) {
  16066. try {
  16067. return apply(func, undefined, args);
  16068. } catch (e) {
  16069. return isError(e) ? e : new Error(e);
  16070. }
  16071. });
  16072. /**
  16073. * Binds methods of an object to the object itself, overwriting the existing
  16074. * method.
  16075. *
  16076. * **Note:** This method doesn't set the "length" property of bound functions.
  16077. *
  16078. * @static
  16079. * @since 0.1.0
  16080. * @memberOf _
  16081. * @category Util
  16082. * @param {Object} object The object to bind and assign the bound methods to.
  16083. * @param {...(string|string[])} methodNames The object method names to bind.
  16084. * @returns {Object} Returns `object`.
  16085. * @example
  16086. *
  16087. * var view = {
  16088. * 'label': 'docs',
  16089. * 'click': function() {
  16090. * console.log('clicked ' + this.label);
  16091. * }
  16092. * };
  16093. *
  16094. * _.bindAll(view, ['click']);
  16095. * jQuery(element).on('click', view.click);
  16096. * // => Logs 'clicked docs' when clicked.
  16097. */
  16098. var bindAll = flatRest(function(object, methodNames) {
  16099. arrayEach(methodNames, function(key) {
  16100. key = toKey(key);
  16101. baseAssignValue(object, key, bind(object[key], object));
  16102. });
  16103. return object;
  16104. });
  16105. /**
  16106. * Creates a function that iterates over `pairs` and invokes the corresponding
  16107. * function of the first predicate to return truthy. The predicate-function
  16108. * pairs are invoked with the `this` binding and arguments of the created
  16109. * function.
  16110. *
  16111. * @static
  16112. * @memberOf _
  16113. * @since 4.0.0
  16114. * @category Util
  16115. * @param {Array} pairs The predicate-function pairs.
  16116. * @returns {Function} Returns the new composite function.
  16117. * @example
  16118. *
  16119. * var func = _.cond([
  16120. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  16121. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  16122. * [_.stubTrue, _.constant('no match')]
  16123. * ]);
  16124. *
  16125. * func({ 'a': 1, 'b': 2 });
  16126. * // => 'matches A'
  16127. *
  16128. * func({ 'a': 0, 'b': 1 });
  16129. * // => 'matches B'
  16130. *
  16131. * func({ 'a': '1', 'b': '2' });
  16132. * // => 'no match'
  16133. */
  16134. function cond(pairs) {
  16135. var length = pairs == null ? 0 : pairs.length,
  16136. toIteratee = getIteratee();
  16137. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  16138. if (typeof pair[1] != 'function') {
  16139. throw new TypeError(FUNC_ERROR_TEXT);
  16140. }
  16141. return [toIteratee(pair[0]), pair[1]];
  16142. });
  16143. return baseRest(function(args) {
  16144. var index = -1;
  16145. while (++index < length) {
  16146. var pair = pairs[index];
  16147. if (apply(pair[0], this, args)) {
  16148. return apply(pair[1], this, args);
  16149. }
  16150. }
  16151. });
  16152. }
  16153. /**
  16154. * Creates a function that invokes the predicate properties of `source` with
  16155. * the corresponding property values of a given object, returning `true` if
  16156. * all predicates return truthy, else `false`.
  16157. *
  16158. * **Note:** The created function is equivalent to `_.conformsTo` with
  16159. * `source` partially applied.
  16160. *
  16161. * @static
  16162. * @memberOf _
  16163. * @since 4.0.0
  16164. * @category Util
  16165. * @param {Object} source The object of property predicates to conform to.
  16166. * @returns {Function} Returns the new spec function.
  16167. * @example
  16168. *
  16169. * var objects = [
  16170. * { 'a': 2, 'b': 1 },
  16171. * { 'a': 1, 'b': 2 }
  16172. * ];
  16173. *
  16174. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  16175. * // => [{ 'a': 1, 'b': 2 }]
  16176. */
  16177. function conforms(source) {
  16178. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  16179. }
  16180. /**
  16181. * Creates a function that returns `value`.
  16182. *
  16183. * @static
  16184. * @memberOf _
  16185. * @since 2.4.0
  16186. * @category Util
  16187. * @param {*} value The value to return from the new function.
  16188. * @returns {Function} Returns the new constant function.
  16189. * @example
  16190. *
  16191. * var objects = _.times(2, _.constant({ 'a': 1 }));
  16192. *
  16193. * console.log(objects);
  16194. * // => [{ 'a': 1 }, { 'a': 1 }]
  16195. *
  16196. * console.log(objects[0] === objects[1]);
  16197. * // => true
  16198. */
  16199. function constant(value) {
  16200. return function() {
  16201. return value;
  16202. };
  16203. }
  16204. /**
  16205. * Checks `value` to determine whether a default value should be returned in
  16206. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  16207. * or `undefined`.
  16208. *
  16209. * @static
  16210. * @memberOf _
  16211. * @since 4.14.0
  16212. * @category Util
  16213. * @param {*} value The value to check.
  16214. * @param {*} defaultValue The default value.
  16215. * @returns {*} Returns the resolved value.
  16216. * @example
  16217. *
  16218. * _.defaultTo(1, 10);
  16219. * // => 1
  16220. *
  16221. * _.defaultTo(undefined, 10);
  16222. * // => 10
  16223. */
  16224. function defaultTo(value, defaultValue) {
  16225. return (value == null || value !== value) ? defaultValue : value;
  16226. }
  16227. /**
  16228. * Creates a function that returns the result of invoking the given functions
  16229. * with the `this` binding of the created function, where each successive
  16230. * invocation is supplied the return value of the previous.
  16231. *
  16232. * @static
  16233. * @memberOf _
  16234. * @since 3.0.0
  16235. * @category Util
  16236. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  16237. * @returns {Function} Returns the new composite function.
  16238. * @see _.flowRight
  16239. * @example
  16240. *
  16241. * function square(n) {
  16242. * return n * n;
  16243. * }
  16244. *
  16245. * var addSquare = _.flow([_.add, square]);
  16246. * addSquare(1, 2);
  16247. * // => 9
  16248. */
  16249. var flow = createFlow();
  16250. /**
  16251. * This method is like `_.flow` except that it creates a function that
  16252. * invokes the given functions from right to left.
  16253. *
  16254. * @static
  16255. * @since 3.0.0
  16256. * @memberOf _
  16257. * @category Util
  16258. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  16259. * @returns {Function} Returns the new composite function.
  16260. * @see _.flow
  16261. * @example
  16262. *
  16263. * function square(n) {
  16264. * return n * n;
  16265. * }
  16266. *
  16267. * var addSquare = _.flowRight([square, _.add]);
  16268. * addSquare(1, 2);
  16269. * // => 9
  16270. */
  16271. var flowRight = createFlow(true);
  16272. /**
  16273. * This method returns the first argument it receives.
  16274. *
  16275. * @static
  16276. * @since 0.1.0
  16277. * @memberOf _
  16278. * @category Util
  16279. * @param {*} value Any value.
  16280. * @returns {*} Returns `value`.
  16281. * @example
  16282. *
  16283. * var object = { 'a': 1 };
  16284. *
  16285. * console.log(_.identity(object) === object);
  16286. * // => true
  16287. */
  16288. function identity(value) {
  16289. return value;
  16290. }
  16291. /**
  16292. * Creates a function that invokes `func` with the arguments of the created
  16293. * function. If `func` is a property name, the created function returns the
  16294. * property value for a given element. If `func` is an array or object, the
  16295. * created function returns `true` for elements that contain the equivalent
  16296. * source properties, otherwise it returns `false`.
  16297. *
  16298. * @static
  16299. * @since 4.0.0
  16300. * @memberOf _
  16301. * @category Util
  16302. * @param {*} [func=_.identity] The value to convert to a callback.
  16303. * @returns {Function} Returns the callback.
  16304. * @example
  16305. *
  16306. * var users = [
  16307. * { 'user': 'barney', 'age': 36, 'active': true },
  16308. * { 'user': 'fred', 'age': 40, 'active': false }
  16309. * ];
  16310. *
  16311. * // The `_.matches` iteratee shorthand.
  16312. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  16313. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  16314. *
  16315. * // The `_.matchesProperty` iteratee shorthand.
  16316. * _.filter(users, _.iteratee(['user', 'fred']));
  16317. * // => [{ 'user': 'fred', 'age': 40 }]
  16318. *
  16319. * // The `_.property` iteratee shorthand.
  16320. * _.map(users, _.iteratee('user'));
  16321. * // => ['barney', 'fred']
  16322. *
  16323. * // Create custom iteratee shorthands.
  16324. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  16325. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  16326. * return func.test(string);
  16327. * };
  16328. * });
  16329. *
  16330. * _.filter(['abc', 'def'], /ef/);
  16331. * // => ['def']
  16332. */
  16333. function iteratee(func) {
  16334. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  16335. }
  16336. /**
  16337. * Creates a function that performs a partial deep comparison between a given
  16338. * object and `source`, returning `true` if the given object has equivalent
  16339. * property values, else `false`.
  16340. *
  16341. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  16342. * partially applied.
  16343. *
  16344. * Partial comparisons will match empty array and empty object `source`
  16345. * values against any array or object value, respectively. See `_.isEqual`
  16346. * for a list of supported value comparisons.
  16347. *
  16348. * **Note:** Multiple values can be checked by combining several matchers
  16349. * using `_.overSome`
  16350. *
  16351. * @static
  16352. * @memberOf _
  16353. * @since 3.0.0
  16354. * @category Util
  16355. * @param {Object} source The object of property values to match.
  16356. * @returns {Function} Returns the new spec function.
  16357. * @example
  16358. *
  16359. * var objects = [
  16360. * { 'a': 1, 'b': 2, 'c': 3 },
  16361. * { 'a': 4, 'b': 5, 'c': 6 }
  16362. * ];
  16363. *
  16364. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  16365. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  16366. *
  16367. * // Checking for several possible values
  16368. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  16369. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16370. */
  16371. function matches(source) {
  16372. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  16373. }
  16374. /**
  16375. * Creates a function that performs a partial deep comparison between the
  16376. * value at `path` of a given object to `srcValue`, returning `true` if the
  16377. * object value is equivalent, else `false`.
  16378. *
  16379. * **Note:** Partial comparisons will match empty array and empty object
  16380. * `srcValue` values against any array or object value, respectively. See
  16381. * `_.isEqual` for a list of supported value comparisons.
  16382. *
  16383. * **Note:** Multiple values can be checked by combining several matchers
  16384. * using `_.overSome`
  16385. *
  16386. * @static
  16387. * @memberOf _
  16388. * @since 3.2.0
  16389. * @category Util
  16390. * @param {Array|string} path The path of the property to get.
  16391. * @param {*} srcValue The value to match.
  16392. * @returns {Function} Returns the new spec function.
  16393. * @example
  16394. *
  16395. * var objects = [
  16396. * { 'a': 1, 'b': 2, 'c': 3 },
  16397. * { 'a': 4, 'b': 5, 'c': 6 }
  16398. * ];
  16399. *
  16400. * _.find(objects, _.matchesProperty('a', 4));
  16401. * // => { 'a': 4, 'b': 5, 'c': 6 }
  16402. *
  16403. * // Checking for several possible values
  16404. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  16405. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16406. */
  16407. function matchesProperty(path, srcValue) {
  16408. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  16409. }
  16410. /**
  16411. * Creates a function that invokes the method at `path` of a given object.
  16412. * Any additional arguments are provided to the invoked method.
  16413. *
  16414. * @static
  16415. * @memberOf _
  16416. * @since 3.7.0
  16417. * @category Util
  16418. * @param {Array|string} path The path of the method to invoke.
  16419. * @param {...*} [args] The arguments to invoke the method with.
  16420. * @returns {Function} Returns the new invoker function.
  16421. * @example
  16422. *
  16423. * var objects = [
  16424. * { 'a': { 'b': _.constant(2) } },
  16425. * { 'a': { 'b': _.constant(1) } }
  16426. * ];
  16427. *
  16428. * _.map(objects, _.method('a.b'));
  16429. * // => [2, 1]
  16430. *
  16431. * _.map(objects, _.method(['a', 'b']));
  16432. * // => [2, 1]
  16433. */
  16434. var method = baseRest(function(path, args) {
  16435. return function(object) {
  16436. return baseInvoke(object, path, args);
  16437. };
  16438. });
  16439. /**
  16440. * The opposite of `_.method`; this method creates a function that invokes
  16441. * the method at a given path of `object`. Any additional arguments are
  16442. * provided to the invoked method.
  16443. *
  16444. * @static
  16445. * @memberOf _
  16446. * @since 3.7.0
  16447. * @category Util
  16448. * @param {Object} object The object to query.
  16449. * @param {...*} [args] The arguments to invoke the method with.
  16450. * @returns {Function} Returns the new invoker function.
  16451. * @example
  16452. *
  16453. * var array = _.times(3, _.constant),
  16454. * object = { 'a': array, 'b': array, 'c': array };
  16455. *
  16456. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  16457. * // => [2, 0]
  16458. *
  16459. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  16460. * // => [2, 0]
  16461. */
  16462. var methodOf = baseRest(function(object, args) {
  16463. return function(path) {
  16464. return baseInvoke(object, path, args);
  16465. };
  16466. });
  16467. /**
  16468. * Adds all own enumerable string keyed function properties of a source
  16469. * object to the destination object. If `object` is a function, then methods
  16470. * are added to its prototype as well.
  16471. *
  16472. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16473. * avoid conflicts caused by modifying the original.
  16474. *
  16475. * @static
  16476. * @since 0.1.0
  16477. * @memberOf _
  16478. * @category Util
  16479. * @param {Function|Object} [object=lodash] The destination object.
  16480. * @param {Object} source The object of functions to add.
  16481. * @param {Object} [options={}] The options object.
  16482. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16483. * @returns {Function|Object} Returns `object`.
  16484. * @example
  16485. *
  16486. * function vowels(string) {
  16487. * return _.filter(string, function(v) {
  16488. * return /[aeiou]/i.test(v);
  16489. * });
  16490. * }
  16491. *
  16492. * _.mixin({ 'vowels': vowels });
  16493. * _.vowels('fred');
  16494. * // => ['e']
  16495. *
  16496. * _('fred').vowels().value();
  16497. * // => ['e']
  16498. *
  16499. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16500. * _('fred').vowels();
  16501. * // => ['e']
  16502. */
  16503. function mixin(object, source, options) {
  16504. var props = keys(source),
  16505. methodNames = baseFunctions(source, props);
  16506. if (options == null &&
  16507. !(isObject(source) && (methodNames.length || !props.length))) {
  16508. options = source;
  16509. source = object;
  16510. object = this;
  16511. methodNames = baseFunctions(source, keys(source));
  16512. }
  16513. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16514. isFunc = isFunction(object);
  16515. arrayEach(methodNames, function(methodName) {
  16516. var func = source[methodName];
  16517. object[methodName] = func;
  16518. if (isFunc) {
  16519. object.prototype[methodName] = function() {
  16520. var chainAll = this.__chain__;
  16521. if (chain || chainAll) {
  16522. var result = object(this.__wrapped__),
  16523. actions = result.__actions__ = copyArray(this.__actions__);
  16524. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16525. result.__chain__ = chainAll;
  16526. return result;
  16527. }
  16528. return func.apply(object, arrayPush([this.value()], arguments));
  16529. };
  16530. }
  16531. });
  16532. return object;
  16533. }
  16534. /**
  16535. * Reverts the `_` variable to its previous value and returns a reference to
  16536. * the `lodash` function.
  16537. *
  16538. * @static
  16539. * @since 0.1.0
  16540. * @memberOf _
  16541. * @category Util
  16542. * @returns {Function} Returns the `lodash` function.
  16543. * @example
  16544. *
  16545. * var lodash = _.noConflict();
  16546. */
  16547. function noConflict() {
  16548. if (root._ === this) {
  16549. root._ = oldDash;
  16550. }
  16551. return this;
  16552. }
  16553. /**
  16554. * This method returns `undefined`.
  16555. *
  16556. * @static
  16557. * @memberOf _
  16558. * @since 2.3.0
  16559. * @category Util
  16560. * @example
  16561. *
  16562. * _.times(2, _.noop);
  16563. * // => [undefined, undefined]
  16564. */
  16565. function noop() {
  16566. // No operation performed.
  16567. }
  16568. /**
  16569. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16570. * the nth argument from the end is returned.
  16571. *
  16572. * @static
  16573. * @memberOf _
  16574. * @since 4.0.0
  16575. * @category Util
  16576. * @param {number} [n=0] The index of the argument to return.
  16577. * @returns {Function} Returns the new pass-thru function.
  16578. * @example
  16579. *
  16580. * var func = _.nthArg(1);
  16581. * func('a', 'b', 'c', 'd');
  16582. * // => 'b'
  16583. *
  16584. * var func = _.nthArg(-2);
  16585. * func('a', 'b', 'c', 'd');
  16586. * // => 'c'
  16587. */
  16588. function nthArg(n) {
  16589. n = toInteger(n);
  16590. return baseRest(function(args) {
  16591. return baseNth(args, n);
  16592. });
  16593. }
  16594. /**
  16595. * Creates a function that invokes `iteratees` with the arguments it receives
  16596. * and returns their results.
  16597. *
  16598. * @static
  16599. * @memberOf _
  16600. * @since 4.0.0
  16601. * @category Util
  16602. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16603. * The iteratees to invoke.
  16604. * @returns {Function} Returns the new function.
  16605. * @example
  16606. *
  16607. * var func = _.over([Math.max, Math.min]);
  16608. *
  16609. * func(1, 2, 3, 4);
  16610. * // => [4, 1]
  16611. */
  16612. var over = createOver(arrayMap);
  16613. /**
  16614. * Creates a function that checks if **all** of the `predicates` return
  16615. * truthy when invoked with the arguments it receives.
  16616. *
  16617. * Following shorthands are possible for providing predicates.
  16618. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16619. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16620. *
  16621. * @static
  16622. * @memberOf _
  16623. * @since 4.0.0
  16624. * @category Util
  16625. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16626. * The predicates to check.
  16627. * @returns {Function} Returns the new function.
  16628. * @example
  16629. *
  16630. * var func = _.overEvery([Boolean, isFinite]);
  16631. *
  16632. * func('1');
  16633. * // => true
  16634. *
  16635. * func(null);
  16636. * // => false
  16637. *
  16638. * func(NaN);
  16639. * // => false
  16640. */
  16641. var overEvery = createOver(arrayEvery);
  16642. /**
  16643. * Creates a function that checks if **any** of the `predicates` return
  16644. * truthy when invoked with the arguments it receives.
  16645. *
  16646. * Following shorthands are possible for providing predicates.
  16647. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16648. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16649. *
  16650. * @static
  16651. * @memberOf _
  16652. * @since 4.0.0
  16653. * @category Util
  16654. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16655. * The predicates to check.
  16656. * @returns {Function} Returns the new function.
  16657. * @example
  16658. *
  16659. * var func = _.overSome([Boolean, isFinite]);
  16660. *
  16661. * func('1');
  16662. * // => true
  16663. *
  16664. * func(null);
  16665. * // => true
  16666. *
  16667. * func(NaN);
  16668. * // => false
  16669. *
  16670. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16671. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16672. */
  16673. var overSome = createOver(arraySome);
  16674. /**
  16675. * Creates a function that returns the value at `path` of a given object.
  16676. *
  16677. * @static
  16678. * @memberOf _
  16679. * @since 2.4.0
  16680. * @category Util
  16681. * @param {Array|string} path The path of the property to get.
  16682. * @returns {Function} Returns the new accessor function.
  16683. * @example
  16684. *
  16685. * var objects = [
  16686. * { 'a': { 'b': 2 } },
  16687. * { 'a': { 'b': 1 } }
  16688. * ];
  16689. *
  16690. * _.map(objects, _.property('a.b'));
  16691. * // => [2, 1]
  16692. *
  16693. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16694. * // => [1, 2]
  16695. */
  16696. function property(path) {
  16697. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16698. }
  16699. /**
  16700. * The opposite of `_.property`; this method creates a function that returns
  16701. * the value at a given path of `object`.
  16702. *
  16703. * @static
  16704. * @memberOf _
  16705. * @since 3.0.0
  16706. * @category Util
  16707. * @param {Object} object The object to query.
  16708. * @returns {Function} Returns the new accessor function.
  16709. * @example
  16710. *
  16711. * var array = [0, 1, 2],
  16712. * object = { 'a': array, 'b': array, 'c': array };
  16713. *
  16714. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16715. * // => [2, 0]
  16716. *
  16717. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16718. * // => [2, 0]
  16719. */
  16720. function propertyOf(object) {
  16721. return function(path) {
  16722. return object == null ? undefined : baseGet(object, path);
  16723. };
  16724. }
  16725. /**
  16726. * Creates an array of numbers (positive and/or negative) progressing from
  16727. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16728. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16729. * it's set to `start` with `start` then set to `0`.
  16730. *
  16731. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16732. * floating-point values which can produce unexpected results.
  16733. *
  16734. * @static
  16735. * @since 0.1.0
  16736. * @memberOf _
  16737. * @category Util
  16738. * @param {number} [start=0] The start of the range.
  16739. * @param {number} end The end of the range.
  16740. * @param {number} [step=1] The value to increment or decrement by.
  16741. * @returns {Array} Returns the range of numbers.
  16742. * @see _.inRange, _.rangeRight
  16743. * @example
  16744. *
  16745. * _.range(4);
  16746. * // => [0, 1, 2, 3]
  16747. *
  16748. * _.range(-4);
  16749. * // => [0, -1, -2, -3]
  16750. *
  16751. * _.range(1, 5);
  16752. * // => [1, 2, 3, 4]
  16753. *
  16754. * _.range(0, 20, 5);
  16755. * // => [0, 5, 10, 15]
  16756. *
  16757. * _.range(0, -4, -1);
  16758. * // => [0, -1, -2, -3]
  16759. *
  16760. * _.range(1, 4, 0);
  16761. * // => [1, 1, 1]
  16762. *
  16763. * _.range(0);
  16764. * // => []
  16765. */
  16766. var range = createRange();
  16767. /**
  16768. * This method is like `_.range` except that it populates values in
  16769. * descending order.
  16770. *
  16771. * @static
  16772. * @memberOf _
  16773. * @since 4.0.0
  16774. * @category Util
  16775. * @param {number} [start=0] The start of the range.
  16776. * @param {number} end The end of the range.
  16777. * @param {number} [step=1] The value to increment or decrement by.
  16778. * @returns {Array} Returns the range of numbers.
  16779. * @see _.inRange, _.range
  16780. * @example
  16781. *
  16782. * _.rangeRight(4);
  16783. * // => [3, 2, 1, 0]
  16784. *
  16785. * _.rangeRight(-4);
  16786. * // => [-3, -2, -1, 0]
  16787. *
  16788. * _.rangeRight(1, 5);
  16789. * // => [4, 3, 2, 1]
  16790. *
  16791. * _.rangeRight(0, 20, 5);
  16792. * // => [15, 10, 5, 0]
  16793. *
  16794. * _.rangeRight(0, -4, -1);
  16795. * // => [-3, -2, -1, 0]
  16796. *
  16797. * _.rangeRight(1, 4, 0);
  16798. * // => [1, 1, 1]
  16799. *
  16800. * _.rangeRight(0);
  16801. * // => []
  16802. */
  16803. var rangeRight = createRange(true);
  16804. /**
  16805. * This method returns a new empty array.
  16806. *
  16807. * @static
  16808. * @memberOf _
  16809. * @since 4.13.0
  16810. * @category Util
  16811. * @returns {Array} Returns the new empty array.
  16812. * @example
  16813. *
  16814. * var arrays = _.times(2, _.stubArray);
  16815. *
  16816. * console.log(arrays);
  16817. * // => [[], []]
  16818. *
  16819. * console.log(arrays[0] === arrays[1]);
  16820. * // => false
  16821. */
  16822. function stubArray() {
  16823. return [];
  16824. }
  16825. /**
  16826. * This method returns `false`.
  16827. *
  16828. * @static
  16829. * @memberOf _
  16830. * @since 4.13.0
  16831. * @category Util
  16832. * @returns {boolean} Returns `false`.
  16833. * @example
  16834. *
  16835. * _.times(2, _.stubFalse);
  16836. * // => [false, false]
  16837. */
  16838. function stubFalse() {
  16839. return false;
  16840. }
  16841. /**
  16842. * This method returns a new empty object.
  16843. *
  16844. * @static
  16845. * @memberOf _
  16846. * @since 4.13.0
  16847. * @category Util
  16848. * @returns {Object} Returns the new empty object.
  16849. * @example
  16850. *
  16851. * var objects = _.times(2, _.stubObject);
  16852. *
  16853. * console.log(objects);
  16854. * // => [{}, {}]
  16855. *
  16856. * console.log(objects[0] === objects[1]);
  16857. * // => false
  16858. */
  16859. function stubObject() {
  16860. return {};
  16861. }
  16862. /**
  16863. * This method returns an empty string.
  16864. *
  16865. * @static
  16866. * @memberOf _
  16867. * @since 4.13.0
  16868. * @category Util
  16869. * @returns {string} Returns the empty string.
  16870. * @example
  16871. *
  16872. * _.times(2, _.stubString);
  16873. * // => ['', '']
  16874. */
  16875. function stubString() {
  16876. return '';
  16877. }
  16878. /**
  16879. * This method returns `true`.
  16880. *
  16881. * @static
  16882. * @memberOf _
  16883. * @since 4.13.0
  16884. * @category Util
  16885. * @returns {boolean} Returns `true`.
  16886. * @example
  16887. *
  16888. * _.times(2, _.stubTrue);
  16889. * // => [true, true]
  16890. */
  16891. function stubTrue() {
  16892. return true;
  16893. }
  16894. /**
  16895. * Invokes the iteratee `n` times, returning an array of the results of
  16896. * each invocation. The iteratee is invoked with one argument; (index).
  16897. *
  16898. * @static
  16899. * @since 0.1.0
  16900. * @memberOf _
  16901. * @category Util
  16902. * @param {number} n The number of times to invoke `iteratee`.
  16903. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16904. * @returns {Array} Returns the array of results.
  16905. * @example
  16906. *
  16907. * _.times(3, String);
  16908. * // => ['0', '1', '2']
  16909. *
  16910. * _.times(4, _.constant(0));
  16911. * // => [0, 0, 0, 0]
  16912. */
  16913. function times(n, iteratee) {
  16914. n = toInteger(n);
  16915. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16916. return [];
  16917. }
  16918. var index = MAX_ARRAY_LENGTH,
  16919. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16920. iteratee = getIteratee(iteratee);
  16921. n -= MAX_ARRAY_LENGTH;
  16922. var result = baseTimes(length, iteratee);
  16923. while (++index < n) {
  16924. iteratee(index);
  16925. }
  16926. return result;
  16927. }
  16928. /**
  16929. * Converts `value` to a property path array.
  16930. *
  16931. * @static
  16932. * @memberOf _
  16933. * @since 4.0.0
  16934. * @category Util
  16935. * @param {*} value The value to convert.
  16936. * @returns {Array} Returns the new property path array.
  16937. * @example
  16938. *
  16939. * _.toPath('a.b.c');
  16940. * // => ['a', 'b', 'c']
  16941. *
  16942. * _.toPath('a[0].b.c');
  16943. * // => ['a', '0', 'b', 'c']
  16944. */
  16945. function toPath(value) {
  16946. if (isArray(value)) {
  16947. return arrayMap(value, toKey);
  16948. }
  16949. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16950. }
  16951. /**
  16952. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16953. *
  16954. * @static
  16955. * @since 0.1.0
  16956. * @memberOf _
  16957. * @category Util
  16958. * @param {string} [prefix=''] The value to prefix the ID with.
  16959. * @returns {string} Returns the unique ID.
  16960. * @example
  16961. *
  16962. * _.uniqueId('contact_');
  16963. * // => 'contact_104'
  16964. *
  16965. * _.uniqueId();
  16966. * // => '105'
  16967. */
  16968. function uniqueId(prefix) {
  16969. var id = ++idCounter;
  16970. return toString(prefix) + id;
  16971. }
  16972. /*------------------------------------------------------------------------*/
  16973. /**
  16974. * Adds two numbers.
  16975. *
  16976. * @static
  16977. * @memberOf _
  16978. * @since 3.4.0
  16979. * @category Math
  16980. * @param {number} augend The first number in an addition.
  16981. * @param {number} addend The second number in an addition.
  16982. * @returns {number} Returns the total.
  16983. * @example
  16984. *
  16985. * _.add(6, 4);
  16986. * // => 10
  16987. */
  16988. var add = createMathOperation(function(augend, addend) {
  16989. return augend + addend;
  16990. }, 0);
  16991. /**
  16992. * Computes `number` rounded up to `precision`.
  16993. *
  16994. * @static
  16995. * @memberOf _
  16996. * @since 3.10.0
  16997. * @category Math
  16998. * @param {number} number The number to round up.
  16999. * @param {number} [precision=0] The precision to round up to.
  17000. * @returns {number} Returns the rounded up number.
  17001. * @example
  17002. *
  17003. * _.ceil(4.006);
  17004. * // => 5
  17005. *
  17006. * _.ceil(6.004, 2);
  17007. * // => 6.01
  17008. *
  17009. * _.ceil(6040, -2);
  17010. * // => 6100
  17011. */
  17012. var ceil = createRound('ceil');
  17013. /**
  17014. * Divide two numbers.
  17015. *
  17016. * @static
  17017. * @memberOf _
  17018. * @since 4.7.0
  17019. * @category Math
  17020. * @param {number} dividend The first number in a division.
  17021. * @param {number} divisor The second number in a division.
  17022. * @returns {number} Returns the quotient.
  17023. * @example
  17024. *
  17025. * _.divide(6, 4);
  17026. * // => 1.5
  17027. */
  17028. var divide = createMathOperation(function(dividend, divisor) {
  17029. return dividend / divisor;
  17030. }, 1);
  17031. /**
  17032. * Computes `number` rounded down to `precision`.
  17033. *
  17034. * @static
  17035. * @memberOf _
  17036. * @since 3.10.0
  17037. * @category Math
  17038. * @param {number} number The number to round down.
  17039. * @param {number} [precision=0] The precision to round down to.
  17040. * @returns {number} Returns the rounded down number.
  17041. * @example
  17042. *
  17043. * _.floor(4.006);
  17044. * // => 4
  17045. *
  17046. * _.floor(0.046, 2);
  17047. * // => 0.04
  17048. *
  17049. * _.floor(4060, -2);
  17050. * // => 4000
  17051. */
  17052. var floor = createRound('floor');
  17053. /**
  17054. * Computes the maximum value of `array`. If `array` is empty or falsey,
  17055. * `undefined` is returned.
  17056. *
  17057. * @static
  17058. * @since 0.1.0
  17059. * @memberOf _
  17060. * @category Math
  17061. * @param {Array} array The array to iterate over.
  17062. * @returns {*} Returns the maximum value.
  17063. * @example
  17064. *
  17065. * _.max([4, 2, 8, 6]);
  17066. * // => 8
  17067. *
  17068. * _.max([]);
  17069. * // => undefined
  17070. */
  17071. function max(array) {
  17072. return (array && array.length)
  17073. ? baseExtremum(array, identity, baseGt)
  17074. : undefined;
  17075. }
  17076. /**
  17077. * This method is like `_.max` except that it accepts `iteratee` which is
  17078. * invoked for each element in `array` to generate the criterion by which
  17079. * the value is ranked. The iteratee is invoked with one argument: (value).
  17080. *
  17081. * @static
  17082. * @memberOf _
  17083. * @since 4.0.0
  17084. * @category Math
  17085. * @param {Array} array The array to iterate over.
  17086. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17087. * @returns {*} Returns the maximum value.
  17088. * @example
  17089. *
  17090. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  17091. *
  17092. * _.maxBy(objects, function(o) { return o.n; });
  17093. * // => { 'n': 2 }
  17094. *
  17095. * // The `_.property` iteratee shorthand.
  17096. * _.maxBy(objects, 'n');
  17097. * // => { 'n': 2 }
  17098. */
  17099. function maxBy(array, iteratee) {
  17100. return (array && array.length)
  17101. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  17102. : undefined;
  17103. }
  17104. /**
  17105. * Computes the mean of the values in `array`.
  17106. *
  17107. * @static
  17108. * @memberOf _
  17109. * @since 4.0.0
  17110. * @category Math
  17111. * @param {Array} array The array to iterate over.
  17112. * @returns {number} Returns the mean.
  17113. * @example
  17114. *
  17115. * _.mean([4, 2, 8, 6]);
  17116. * // => 5
  17117. */
  17118. function mean(array) {
  17119. return baseMean(array, identity);
  17120. }
  17121. /**
  17122. * This method is like `_.mean` except that it accepts `iteratee` which is
  17123. * invoked for each element in `array` to generate the value to be averaged.
  17124. * The iteratee is invoked with one argument: (value).
  17125. *
  17126. * @static
  17127. * @memberOf _
  17128. * @since 4.7.0
  17129. * @category Math
  17130. * @param {Array} array The array to iterate over.
  17131. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17132. * @returns {number} Returns the mean.
  17133. * @example
  17134. *
  17135. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  17136. *
  17137. * _.meanBy(objects, function(o) { return o.n; });
  17138. * // => 5
  17139. *
  17140. * // The `_.property` iteratee shorthand.
  17141. * _.meanBy(objects, 'n');
  17142. * // => 5
  17143. */
  17144. function meanBy(array, iteratee) {
  17145. return baseMean(array, getIteratee(iteratee, 2));
  17146. }
  17147. /**
  17148. * Computes the minimum value of `array`. If `array` is empty or falsey,
  17149. * `undefined` is returned.
  17150. *
  17151. * @static
  17152. * @since 0.1.0
  17153. * @memberOf _
  17154. * @category Math
  17155. * @param {Array} array The array to iterate over.
  17156. * @returns {*} Returns the minimum value.
  17157. * @example
  17158. *
  17159. * _.min([4, 2, 8, 6]);
  17160. * // => 2
  17161. *
  17162. * _.min([]);
  17163. * // => undefined
  17164. */
  17165. function min(array) {
  17166. return (array && array.length)
  17167. ? baseExtremum(array, identity, baseLt)
  17168. : undefined;
  17169. }
  17170. /**
  17171. * This method is like `_.min` except that it accepts `iteratee` which is
  17172. * invoked for each element in `array` to generate the criterion by which
  17173. * the value is ranked. The iteratee is invoked with one argument: (value).
  17174. *
  17175. * @static
  17176. * @memberOf _
  17177. * @since 4.0.0
  17178. * @category Math
  17179. * @param {Array} array The array to iterate over.
  17180. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17181. * @returns {*} Returns the minimum value.
  17182. * @example
  17183. *
  17184. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  17185. *
  17186. * _.minBy(objects, function(o) { return o.n; });
  17187. * // => { 'n': 1 }
  17188. *
  17189. * // The `_.property` iteratee shorthand.
  17190. * _.minBy(objects, 'n');
  17191. * // => { 'n': 1 }
  17192. */
  17193. function minBy(array, iteratee) {
  17194. return (array && array.length)
  17195. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  17196. : undefined;
  17197. }
  17198. /**
  17199. * Multiply two numbers.
  17200. *
  17201. * @static
  17202. * @memberOf _
  17203. * @since 4.7.0
  17204. * @category Math
  17205. * @param {number} multiplier The first number in a multiplication.
  17206. * @param {number} multiplicand The second number in a multiplication.
  17207. * @returns {number} Returns the product.
  17208. * @example
  17209. *
  17210. * _.multiply(6, 4);
  17211. * // => 24
  17212. */
  17213. var multiply = createMathOperation(function(multiplier, multiplicand) {
  17214. return multiplier * multiplicand;
  17215. }, 1);
  17216. /**
  17217. * Computes `number` rounded to `precision`.
  17218. *
  17219. * @static
  17220. * @memberOf _
  17221. * @since 3.10.0
  17222. * @category Math
  17223. * @param {number} number The number to round.
  17224. * @param {number} [precision=0] The precision to round to.
  17225. * @returns {number} Returns the rounded number.
  17226. * @example
  17227. *
  17228. * _.round(4.006);
  17229. * // => 4
  17230. *
  17231. * _.round(4.006, 2);
  17232. * // => 4.01
  17233. *
  17234. * _.round(4060, -2);
  17235. * // => 4100
  17236. */
  17237. var round = createRound('round');
  17238. /**
  17239. * Subtract two numbers.
  17240. *
  17241. * @static
  17242. * @memberOf _
  17243. * @since 4.0.0
  17244. * @category Math
  17245. * @param {number} minuend The first number in a subtraction.
  17246. * @param {number} subtrahend The second number in a subtraction.
  17247. * @returns {number} Returns the difference.
  17248. * @example
  17249. *
  17250. * _.subtract(6, 4);
  17251. * // => 2
  17252. */
  17253. var subtract = createMathOperation(function(minuend, subtrahend) {
  17254. return minuend - subtrahend;
  17255. }, 0);
  17256. /**
  17257. * Computes the sum of the values in `array`.
  17258. *
  17259. * @static
  17260. * @memberOf _
  17261. * @since 3.4.0
  17262. * @category Math
  17263. * @param {Array} array The array to iterate over.
  17264. * @returns {number} Returns the sum.
  17265. * @example
  17266. *
  17267. * _.sum([4, 2, 8, 6]);
  17268. * // => 20
  17269. */
  17270. function sum(array) {
  17271. return (array && array.length)
  17272. ? baseSum(array, identity)
  17273. : 0;
  17274. }
  17275. /**
  17276. * This method is like `_.sum` except that it accepts `iteratee` which is
  17277. * invoked for each element in `array` to generate the value to be summed.
  17278. * The iteratee is invoked with one argument: (value).
  17279. *
  17280. * @static
  17281. * @memberOf _
  17282. * @since 4.0.0
  17283. * @category Math
  17284. * @param {Array} array The array to iterate over.
  17285. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17286. * @returns {number} Returns the sum.
  17287. * @example
  17288. *
  17289. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  17290. *
  17291. * _.sumBy(objects, function(o) { return o.n; });
  17292. * // => 20
  17293. *
  17294. * // The `_.property` iteratee shorthand.
  17295. * _.sumBy(objects, 'n');
  17296. * // => 20
  17297. */
  17298. function sumBy(array, iteratee) {
  17299. return (array && array.length)
  17300. ? baseSum(array, getIteratee(iteratee, 2))
  17301. : 0;
  17302. }
  17303. /*------------------------------------------------------------------------*/
  17304. // Add methods that return wrapped values in chain sequences.
  17305. lodash.after = after;
  17306. lodash.ary = ary;
  17307. lodash.assign = assign;
  17308. lodash.assignIn = assignIn;
  17309. lodash.assignInWith = assignInWith;
  17310. lodash.assignWith = assignWith;
  17311. lodash.at = at;
  17312. lodash.before = before;
  17313. lodash.bind = bind;
  17314. lodash.bindAll = bindAll;
  17315. lodash.bindKey = bindKey;
  17316. lodash.castArray = castArray;
  17317. lodash.chain = chain;
  17318. lodash.chunk = chunk;
  17319. lodash.compact = compact;
  17320. lodash.concat = concat;
  17321. lodash.cond = cond;
  17322. lodash.conforms = conforms;
  17323. lodash.constant = constant;
  17324. lodash.countBy = countBy;
  17325. lodash.create = create;
  17326. lodash.curry = curry;
  17327. lodash.curryRight = curryRight;
  17328. lodash.debounce = debounce;
  17329. lodash.defaults = defaults;
  17330. lodash.defaultsDeep = defaultsDeep;
  17331. lodash.defer = defer;
  17332. lodash.delay = delay;
  17333. lodash.difference = difference;
  17334. lodash.differenceBy = differenceBy;
  17335. lodash.differenceWith = differenceWith;
  17336. lodash.drop = drop;
  17337. lodash.dropRight = dropRight;
  17338. lodash.dropRightWhile = dropRightWhile;
  17339. lodash.dropWhile = dropWhile;
  17340. lodash.fill = fill;
  17341. lodash.filter = filter;
  17342. lodash.flatMap = flatMap;
  17343. lodash.flatMapDeep = flatMapDeep;
  17344. lodash.flatMapDepth = flatMapDepth;
  17345. lodash.flatten = flatten;
  17346. lodash.flattenDeep = flattenDeep;
  17347. lodash.flattenDepth = flattenDepth;
  17348. lodash.flip = flip;
  17349. lodash.flow = flow;
  17350. lodash.flowRight = flowRight;
  17351. lodash.fromPairs = fromPairs;
  17352. lodash.functions = functions;
  17353. lodash.functionsIn = functionsIn;
  17354. lodash.groupBy = groupBy;
  17355. lodash.initial = initial;
  17356. lodash.intersection = intersection;
  17357. lodash.intersectionBy = intersectionBy;
  17358. lodash.intersectionWith = intersectionWith;
  17359. lodash.invert = invert;
  17360. lodash.invertBy = invertBy;
  17361. lodash.invokeMap = invokeMap;
  17362. lodash.iteratee = iteratee;
  17363. lodash.keyBy = keyBy;
  17364. lodash.keys = keys;
  17365. lodash.keysIn = keysIn;
  17366. lodash.map = map;
  17367. lodash.mapKeys = mapKeys;
  17368. lodash.mapValues = mapValues;
  17369. lodash.matches = matches;
  17370. lodash.matchesProperty = matchesProperty;
  17371. lodash.memoize = memoize;
  17372. lodash.merge = merge;
  17373. lodash.mergeWith = mergeWith;
  17374. lodash.method = method;
  17375. lodash.methodOf = methodOf;
  17376. lodash.mixin = mixin;
  17377. lodash.negate = negate;
  17378. lodash.nthArg = nthArg;
  17379. lodash.omit = omit;
  17380. lodash.omitBy = omitBy;
  17381. lodash.once = once;
  17382. lodash.orderBy = orderBy;
  17383. lodash.over = over;
  17384. lodash.overArgs = overArgs;
  17385. lodash.overEvery = overEvery;
  17386. lodash.overSome = overSome;
  17387. lodash.partial = partial;
  17388. lodash.partialRight = partialRight;
  17389. lodash.partition = partition;
  17390. lodash.pick = pick;
  17391. lodash.pickBy = pickBy;
  17392. lodash.property = property;
  17393. lodash.propertyOf = propertyOf;
  17394. lodash.pull = pull;
  17395. lodash.pullAll = pullAll;
  17396. lodash.pullAllBy = pullAllBy;
  17397. lodash.pullAllWith = pullAllWith;
  17398. lodash.pullAt = pullAt;
  17399. lodash.range = range;
  17400. lodash.rangeRight = rangeRight;
  17401. lodash.rearg = rearg;
  17402. lodash.reject = reject;
  17403. lodash.remove = remove;
  17404. lodash.rest = rest;
  17405. lodash.reverse = reverse;
  17406. lodash.sampleSize = sampleSize;
  17407. lodash.set = set;
  17408. lodash.setWith = setWith;
  17409. lodash.shuffle = shuffle;
  17410. lodash.slice = slice;
  17411. lodash.sortBy = sortBy;
  17412. lodash.sortedUniq = sortedUniq;
  17413. lodash.sortedUniqBy = sortedUniqBy;
  17414. lodash.split = split;
  17415. lodash.spread = spread;
  17416. lodash.tail = tail;
  17417. lodash.take = take;
  17418. lodash.takeRight = takeRight;
  17419. lodash.takeRightWhile = takeRightWhile;
  17420. lodash.takeWhile = takeWhile;
  17421. lodash.tap = tap;
  17422. lodash.throttle = throttle;
  17423. lodash.thru = thru;
  17424. lodash.toArray = toArray;
  17425. lodash.toPairs = toPairs;
  17426. lodash.toPairsIn = toPairsIn;
  17427. lodash.toPath = toPath;
  17428. lodash.toPlainObject = toPlainObject;
  17429. lodash.transform = transform;
  17430. lodash.unary = unary;
  17431. lodash.union = union;
  17432. lodash.unionBy = unionBy;
  17433. lodash.unionWith = unionWith;
  17434. lodash.uniq = uniq;
  17435. lodash.uniqBy = uniqBy;
  17436. lodash.uniqWith = uniqWith;
  17437. lodash.unset = unset;
  17438. lodash.unzip = unzip;
  17439. lodash.unzipWith = unzipWith;
  17440. lodash.update = update;
  17441. lodash.updateWith = updateWith;
  17442. lodash.values = values;
  17443. lodash.valuesIn = valuesIn;
  17444. lodash.without = without;
  17445. lodash.words = words;
  17446. lodash.wrap = wrap;
  17447. lodash.xor = xor;
  17448. lodash.xorBy = xorBy;
  17449. lodash.xorWith = xorWith;
  17450. lodash.zip = zip;
  17451. lodash.zipObject = zipObject;
  17452. lodash.zipObjectDeep = zipObjectDeep;
  17453. lodash.zipWith = zipWith;
  17454. // Add aliases.
  17455. lodash.entries = toPairs;
  17456. lodash.entriesIn = toPairsIn;
  17457. lodash.extend = assignIn;
  17458. lodash.extendWith = assignInWith;
  17459. // Add methods to `lodash.prototype`.
  17460. mixin(lodash, lodash);
  17461. /*------------------------------------------------------------------------*/
  17462. // Add methods that return unwrapped values in chain sequences.
  17463. lodash.add = add;
  17464. lodash.attempt = attempt;
  17465. lodash.camelCase = camelCase;
  17466. lodash.capitalize = capitalize;
  17467. lodash.ceil = ceil;
  17468. lodash.clamp = clamp;
  17469. lodash.clone = clone;
  17470. lodash.cloneDeep = cloneDeep;
  17471. lodash.cloneDeepWith = cloneDeepWith;
  17472. lodash.cloneWith = cloneWith;
  17473. lodash.conformsTo = conformsTo;
  17474. lodash.deburr = deburr;
  17475. lodash.defaultTo = defaultTo;
  17476. lodash.divide = divide;
  17477. lodash.endsWith = endsWith;
  17478. lodash.eq = eq;
  17479. lodash.escape = escape;
  17480. lodash.escapeRegExp = escapeRegExp;
  17481. lodash.every = every;
  17482. lodash.find = find;
  17483. lodash.findIndex = findIndex;
  17484. lodash.findKey = findKey;
  17485. lodash.findLast = findLast;
  17486. lodash.findLastIndex = findLastIndex;
  17487. lodash.findLastKey = findLastKey;
  17488. lodash.floor = floor;
  17489. lodash.forEach = forEach;
  17490. lodash.forEachRight = forEachRight;
  17491. lodash.forIn = forIn;
  17492. lodash.forInRight = forInRight;
  17493. lodash.forOwn = forOwn;
  17494. lodash.forOwnRight = forOwnRight;
  17495. lodash.get = get;
  17496. lodash.gt = gt;
  17497. lodash.gte = gte;
  17498. lodash.has = has;
  17499. lodash.hasIn = hasIn;
  17500. lodash.head = head;
  17501. lodash.identity = identity;
  17502. lodash.includes = includes;
  17503. lodash.indexOf = indexOf;
  17504. lodash.inRange = inRange;
  17505. lodash.invoke = invoke;
  17506. lodash.isArguments = isArguments;
  17507. lodash.isArray = isArray;
  17508. lodash.isArrayBuffer = isArrayBuffer;
  17509. lodash.isArrayLike = isArrayLike;
  17510. lodash.isArrayLikeObject = isArrayLikeObject;
  17511. lodash.isBoolean = isBoolean;
  17512. lodash.isBuffer = isBuffer;
  17513. lodash.isDate = isDate;
  17514. lodash.isElement = isElement;
  17515. lodash.isEmpty = isEmpty;
  17516. lodash.isEqual = isEqual;
  17517. lodash.isEqualWith = isEqualWith;
  17518. lodash.isError = isError;
  17519. lodash.isFinite = isFinite;
  17520. lodash.isFunction = isFunction;
  17521. lodash.isInteger = isInteger;
  17522. lodash.isLength = isLength;
  17523. lodash.isMap = isMap;
  17524. lodash.isMatch = isMatch;
  17525. lodash.isMatchWith = isMatchWith;
  17526. lodash.isNaN = isNaN;
  17527. lodash.isNative = isNative;
  17528. lodash.isNil = isNil;
  17529. lodash.isNull = isNull;
  17530. lodash.isNumber = isNumber;
  17531. lodash.isObject = isObject;
  17532. lodash.isObjectLike = isObjectLike;
  17533. lodash.isPlainObject = isPlainObject;
  17534. lodash.isRegExp = isRegExp;
  17535. lodash.isSafeInteger = isSafeInteger;
  17536. lodash.isSet = isSet;
  17537. lodash.isString = isString;
  17538. lodash.isSymbol = isSymbol;
  17539. lodash.isTypedArray = isTypedArray;
  17540. lodash.isUndefined = isUndefined;
  17541. lodash.isWeakMap = isWeakMap;
  17542. lodash.isWeakSet = isWeakSet;
  17543. lodash.join = join;
  17544. lodash.kebabCase = kebabCase;
  17545. lodash.last = last;
  17546. lodash.lastIndexOf = lastIndexOf;
  17547. lodash.lowerCase = lowerCase;
  17548. lodash.lowerFirst = lowerFirst;
  17549. lodash.lt = lt;
  17550. lodash.lte = lte;
  17551. lodash.max = max;
  17552. lodash.maxBy = maxBy;
  17553. lodash.mean = mean;
  17554. lodash.meanBy = meanBy;
  17555. lodash.min = min;
  17556. lodash.minBy = minBy;
  17557. lodash.stubArray = stubArray;
  17558. lodash.stubFalse = stubFalse;
  17559. lodash.stubObject = stubObject;
  17560. lodash.stubString = stubString;
  17561. lodash.stubTrue = stubTrue;
  17562. lodash.multiply = multiply;
  17563. lodash.nth = nth;
  17564. lodash.noConflict = noConflict;
  17565. lodash.noop = noop;
  17566. lodash.now = now;
  17567. lodash.pad = pad;
  17568. lodash.padEnd = padEnd;
  17569. lodash.padStart = padStart;
  17570. lodash.parseInt = parseInt;
  17571. lodash.random = random;
  17572. lodash.reduce = reduce;
  17573. lodash.reduceRight = reduceRight;
  17574. lodash.repeat = repeat;
  17575. lodash.replace = replace;
  17576. lodash.result = result;
  17577. lodash.round = round;
  17578. lodash.runInContext = runInContext;
  17579. lodash.sample = sample;
  17580. lodash.size = size;
  17581. lodash.snakeCase = snakeCase;
  17582. lodash.some = some;
  17583. lodash.sortedIndex = sortedIndex;
  17584. lodash.sortedIndexBy = sortedIndexBy;
  17585. lodash.sortedIndexOf = sortedIndexOf;
  17586. lodash.sortedLastIndex = sortedLastIndex;
  17587. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17588. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17589. lodash.startCase = startCase;
  17590. lodash.startsWith = startsWith;
  17591. lodash.subtract = subtract;
  17592. lodash.sum = sum;
  17593. lodash.sumBy = sumBy;
  17594. lodash.template = template;
  17595. lodash.times = times;
  17596. lodash.toFinite = toFinite;
  17597. lodash.toInteger = toInteger;
  17598. lodash.toLength = toLength;
  17599. lodash.toLower = toLower;
  17600. lodash.toNumber = toNumber;
  17601. lodash.toSafeInteger = toSafeInteger;
  17602. lodash.toString = toString;
  17603. lodash.toUpper = toUpper;
  17604. lodash.trim = trim;
  17605. lodash.trimEnd = trimEnd;
  17606. lodash.trimStart = trimStart;
  17607. lodash.truncate = truncate;
  17608. lodash.unescape = unescape;
  17609. lodash.uniqueId = uniqueId;
  17610. lodash.upperCase = upperCase;
  17611. lodash.upperFirst = upperFirst;
  17612. // Add aliases.
  17613. lodash.each = forEach;
  17614. lodash.eachRight = forEachRight;
  17615. lodash.first = head;
  17616. mixin(lodash, (function() {
  17617. var source = {};
  17618. baseForOwn(lodash, function(func, methodName) {
  17619. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17620. source[methodName] = func;
  17621. }
  17622. });
  17623. return source;
  17624. }()), { 'chain': false });
  17625. /*------------------------------------------------------------------------*/
  17626. /**
  17627. * The semantic version number.
  17628. *
  17629. * @static
  17630. * @memberOf _
  17631. * @type {string}
  17632. */
  17633. lodash.VERSION = VERSION;
  17634. // Assign default placeholders.
  17635. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17636. lodash[methodName].placeholder = lodash;
  17637. });
  17638. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17639. arrayEach(['drop', 'take'], function(methodName, index) {
  17640. LazyWrapper.prototype[methodName] = function(n) {
  17641. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17642. var result = (this.__filtered__ && !index)
  17643. ? new LazyWrapper(this)
  17644. : this.clone();
  17645. if (result.__filtered__) {
  17646. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17647. } else {
  17648. result.__views__.push({
  17649. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17650. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17651. });
  17652. }
  17653. return result;
  17654. };
  17655. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17656. return this.reverse()[methodName](n).reverse();
  17657. };
  17658. });
  17659. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17660. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17661. var type = index + 1,
  17662. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17663. LazyWrapper.prototype[methodName] = function(iteratee) {
  17664. var result = this.clone();
  17665. result.__iteratees__.push({
  17666. 'iteratee': getIteratee(iteratee, 3),
  17667. 'type': type
  17668. });
  17669. result.__filtered__ = result.__filtered__ || isFilter;
  17670. return result;
  17671. };
  17672. });
  17673. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17674. arrayEach(['head', 'last'], function(methodName, index) {
  17675. var takeName = 'take' + (index ? 'Right' : '');
  17676. LazyWrapper.prototype[methodName] = function() {
  17677. return this[takeName](1).value()[0];
  17678. };
  17679. });
  17680. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17681. arrayEach(['initial', 'tail'], function(methodName, index) {
  17682. var dropName = 'drop' + (index ? '' : 'Right');
  17683. LazyWrapper.prototype[methodName] = function() {
  17684. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17685. };
  17686. });
  17687. LazyWrapper.prototype.compact = function() {
  17688. return this.filter(identity);
  17689. };
  17690. LazyWrapper.prototype.find = function(predicate) {
  17691. return this.filter(predicate).head();
  17692. };
  17693. LazyWrapper.prototype.findLast = function(predicate) {
  17694. return this.reverse().find(predicate);
  17695. };
  17696. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17697. if (typeof path == 'function') {
  17698. return new LazyWrapper(this);
  17699. }
  17700. return this.map(function(value) {
  17701. return baseInvoke(value, path, args);
  17702. });
  17703. });
  17704. LazyWrapper.prototype.reject = function(predicate) {
  17705. return this.filter(negate(getIteratee(predicate)));
  17706. };
  17707. LazyWrapper.prototype.slice = function(start, end) {
  17708. start = toInteger(start);
  17709. var result = this;
  17710. if (result.__filtered__ && (start > 0 || end < 0)) {
  17711. return new LazyWrapper(result);
  17712. }
  17713. if (start < 0) {
  17714. result = result.takeRight(-start);
  17715. } else if (start) {
  17716. result = result.drop(start);
  17717. }
  17718. if (end !== undefined) {
  17719. end = toInteger(end);
  17720. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17721. }
  17722. return result;
  17723. };
  17724. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17725. return this.reverse().takeWhile(predicate).reverse();
  17726. };
  17727. LazyWrapper.prototype.toArray = function() {
  17728. return this.take(MAX_ARRAY_LENGTH);
  17729. };
  17730. // Add `LazyWrapper` methods to `lodash.prototype`.
  17731. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17732. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17733. isTaker = /^(?:head|last)$/.test(methodName),
  17734. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17735. retUnwrapped = isTaker || /^find/.test(methodName);
  17736. if (!lodashFunc) {
  17737. return;
  17738. }
  17739. lodash.prototype[methodName] = function() {
  17740. var value = this.__wrapped__,
  17741. args = isTaker ? [1] : arguments,
  17742. isLazy = value instanceof LazyWrapper,
  17743. iteratee = args[0],
  17744. useLazy = isLazy || isArray(value);
  17745. var interceptor = function(value) {
  17746. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17747. return (isTaker && chainAll) ? result[0] : result;
  17748. };
  17749. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17750. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17751. isLazy = useLazy = false;
  17752. }
  17753. var chainAll = this.__chain__,
  17754. isHybrid = !!this.__actions__.length,
  17755. isUnwrapped = retUnwrapped && !chainAll,
  17756. onlyLazy = isLazy && !isHybrid;
  17757. if (!retUnwrapped && useLazy) {
  17758. value = onlyLazy ? value : new LazyWrapper(this);
  17759. var result = func.apply(value, args);
  17760. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17761. return new LodashWrapper(result, chainAll);
  17762. }
  17763. if (isUnwrapped && onlyLazy) {
  17764. return func.apply(this, args);
  17765. }
  17766. result = this.thru(interceptor);
  17767. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17768. };
  17769. });
  17770. // Add `Array` methods to `lodash.prototype`.
  17771. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17772. var func = arrayProto[methodName],
  17773. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17774. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17775. lodash.prototype[methodName] = function() {
  17776. var args = arguments;
  17777. if (retUnwrapped && !this.__chain__) {
  17778. var value = this.value();
  17779. return func.apply(isArray(value) ? value : [], args);
  17780. }
  17781. return this[chainName](function(value) {
  17782. return func.apply(isArray(value) ? value : [], args);
  17783. });
  17784. };
  17785. });
  17786. // Map minified method names to their real names.
  17787. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17788. var lodashFunc = lodash[methodName];
  17789. if (lodashFunc) {
  17790. var key = lodashFunc.name + '';
  17791. if (!hasOwnProperty.call(realNames, key)) {
  17792. realNames[key] = [];
  17793. }
  17794. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17795. }
  17796. });
  17797. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17798. 'name': 'wrapper',
  17799. 'func': undefined
  17800. }];
  17801. // Add methods to `LazyWrapper`.
  17802. LazyWrapper.prototype.clone = lazyClone;
  17803. LazyWrapper.prototype.reverse = lazyReverse;
  17804. LazyWrapper.prototype.value = lazyValue;
  17805. // Add chain sequence methods to the `lodash` wrapper.
  17806. lodash.prototype.at = wrapperAt;
  17807. lodash.prototype.chain = wrapperChain;
  17808. lodash.prototype.commit = wrapperCommit;
  17809. lodash.prototype.next = wrapperNext;
  17810. lodash.prototype.plant = wrapperPlant;
  17811. lodash.prototype.reverse = wrapperReverse;
  17812. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17813. // Add lazy aliases.
  17814. lodash.prototype.first = lodash.prototype.head;
  17815. if (symIterator) {
  17816. lodash.prototype[symIterator] = wrapperToIterator;
  17817. }
  17818. return lodash;
  17819. });
  17820. /*--------------------------------------------------------------------------*/
  17821. // Export lodash.
  17822. var _ = runInContext();
  17823. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17824. if (true) {
  17825. // Expose Lodash on the global object to prevent errors when Lodash is
  17826. // loaded by a script tag in the presence of an AMD loader.
  17827. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17828. // Use `_.noConflict` to remove Lodash from the global object.
  17829. root._ = _;
  17830. // Define as an anonymous module so, through path mapping, it can be
  17831. // referenced as the "underscore" module.
  17832. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17833. return _;
  17834. }).call(exports, __webpack_require__, exports, module),
  17835. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17836. }
  17837. // Check for `exports` after `define` in case a build optimizer adds it.
  17838. else {}
  17839. }.call(this));
  17840. /***/ }),
  17841. /***/ "./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":
  17842. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17843. !*** ./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 ***!
  17844. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17845. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17846. "use strict";
  17847. __webpack_require__.r(__webpack_exports__);
  17848. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17849. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17850. /* harmony export */ });
  17851. /* 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");
  17852. /* 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__);
  17853. /* 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");
  17854. var options = {};
  17855. options.insert = "head";
  17856. options.singleton = false;
  17857. 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);
  17858. /* 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 || {});
  17859. /***/ }),
  17860. /***/ "./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":
  17861. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17862. !*** ./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 ***!
  17863. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17864. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17865. "use strict";
  17866. __webpack_require__.r(__webpack_exports__);
  17867. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17868. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17869. /* harmony export */ });
  17870. /* 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");
  17871. /* 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__);
  17872. /* 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");
  17873. var options = {};
  17874. options.insert = "head";
  17875. options.singleton = false;
  17876. 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);
  17877. /* 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 || {});
  17878. /***/ }),
  17879. /***/ "./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":
  17880. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17881. !*** ./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 ***!
  17882. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17883. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17884. "use strict";
  17885. __webpack_require__.r(__webpack_exports__);
  17886. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17887. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17888. /* harmony export */ });
  17889. /* 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");
  17890. /* 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__);
  17891. /* 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");
  17892. var options = {};
  17893. options.insert = "head";
  17894. options.singleton = false;
  17895. 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);
  17896. /* 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 || {});
  17897. /***/ }),
  17898. /***/ "./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":
  17899. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17900. !*** ./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 ***!
  17901. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17902. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17903. "use strict";
  17904. __webpack_require__.r(__webpack_exports__);
  17905. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17906. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17907. /* harmony export */ });
  17908. /* 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");
  17909. /* 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__);
  17910. /* 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");
  17911. var options = {};
  17912. options.insert = "head";
  17913. options.singleton = false;
  17914. 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);
  17915. /* 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 || {});
  17916. /***/ }),
  17917. /***/ "./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":
  17918. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17919. !*** ./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 ***!
  17920. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17921. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17922. "use strict";
  17923. __webpack_require__.r(__webpack_exports__);
  17924. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17925. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17926. /* harmony export */ });
  17927. /* 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");
  17928. /* 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__);
  17929. /* 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");
  17930. var options = {};
  17931. options.insert = "head";
  17932. options.singleton = false;
  17933. 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);
  17934. /* 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 || {});
  17935. /***/ }),
  17936. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17937. /*!******************************************************!*\
  17938. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17939. \******************************************************/
  17940. /***/ ((__unused_webpack_module, exports) => {
  17941. "use strict";
  17942. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17943. // runtime helper for setting properties on components
  17944. // in a tree-shakable way
  17945. exports["default"] = (sfc, props) => {
  17946. const target = sfc.__vccOpts || sfc;
  17947. for (const [key, val] of props) {
  17948. target[key] = val;
  17949. }
  17950. return target;
  17951. };
  17952. /***/ }),
  17953. /***/ "./resources/js/components/AppDropdown.vue":
  17954. /*!*************************************************!*\
  17955. !*** ./resources/js/components/AppDropdown.vue ***!
  17956. \*************************************************/
  17957. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17958. "use strict";
  17959. __webpack_require__.r(__webpack_exports__);
  17960. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17961. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17962. /* harmony export */ });
  17963. /* 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");
  17964. /* 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");
  17965. /* 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");
  17966. ;
  17967. 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"]])
  17968. /* hot reload */
  17969. if (false) {}
  17970. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17971. /***/ }),
  17972. /***/ "./resources/js/components/AppFooter.vue":
  17973. /*!***********************************************!*\
  17974. !*** ./resources/js/components/AppFooter.vue ***!
  17975. \***********************************************/
  17976. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17977. "use strict";
  17978. __webpack_require__.r(__webpack_exports__);
  17979. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17980. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17981. /* harmony export */ });
  17982. /* 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");
  17983. /* 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");
  17984. /* 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");
  17985. const script = {}
  17986. ;
  17987. 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"]])
  17988. /* hot reload */
  17989. if (false) {}
  17990. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17991. /***/ }),
  17992. /***/ "./resources/js/components/AppInputText.vue":
  17993. /*!**************************************************!*\
  17994. !*** ./resources/js/components/AppInputText.vue ***!
  17995. \**************************************************/
  17996. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17997. "use strict";
  17998. __webpack_require__.r(__webpack_exports__);
  17999. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18000. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18001. /* harmony export */ });
  18002. /* 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");
  18003. /* 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");
  18004. /* 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");
  18005. ;
  18006. 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"]])
  18007. /* hot reload */
  18008. if (false) {}
  18009. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18010. /***/ }),
  18011. /***/ "./resources/js/components/AppMessage.vue":
  18012. /*!************************************************!*\
  18013. !*** ./resources/js/components/AppMessage.vue ***!
  18014. \************************************************/
  18015. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18016. "use strict";
  18017. __webpack_require__.r(__webpack_exports__);
  18018. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18019. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18020. /* harmony export */ });
  18021. /* 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");
  18022. /* 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");
  18023. /* 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");
  18024. ;
  18025. 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"]])
  18026. /* hot reload */
  18027. if (false) {}
  18028. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18029. /***/ }),
  18030. /***/ "./resources/js/components/AppSidebar.vue":
  18031. /*!************************************************!*\
  18032. !*** ./resources/js/components/AppSidebar.vue ***!
  18033. \************************************************/
  18034. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18035. "use strict";
  18036. __webpack_require__.r(__webpack_exports__);
  18037. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18038. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18039. /* harmony export */ });
  18040. /* 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");
  18041. /* 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");
  18042. /* 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");
  18043. /* 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");
  18044. ;
  18045. 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"]])
  18046. /* hot reload */
  18047. if (false) {}
  18048. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18049. /***/ }),
  18050. /***/ "./resources/js/components/AppSubSidebar.vue":
  18051. /*!***************************************************!*\
  18052. !*** ./resources/js/components/AppSubSidebar.vue ***!
  18053. \***************************************************/
  18054. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18055. "use strict";
  18056. __webpack_require__.r(__webpack_exports__);
  18057. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18058. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18059. /* harmony export */ });
  18060. /* 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");
  18061. /* 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");
  18062. /* 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");
  18063. /* 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");
  18064. ;
  18065. 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"]])
  18066. /* hot reload */
  18067. if (false) {}
  18068. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18069. /***/ }),
  18070. /***/ "./resources/js/components/AppTopBar.vue":
  18071. /*!***********************************************!*\
  18072. !*** ./resources/js/components/AppTopBar.vue ***!
  18073. \***********************************************/
  18074. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18075. "use strict";
  18076. __webpack_require__.r(__webpack_exports__);
  18077. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18078. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18079. /* harmony export */ });
  18080. /* 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");
  18081. /* 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");
  18082. /* 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");
  18083. /* 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");
  18084. ;
  18085. 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"]])
  18086. /* hot reload */
  18087. if (false) {}
  18088. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18089. /***/ }),
  18090. /***/ "./resources/js/layouts/DashboardLayout.vue":
  18091. /*!**************************************************!*\
  18092. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  18093. \**************************************************/
  18094. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18095. "use strict";
  18096. __webpack_require__.r(__webpack_exports__);
  18097. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18098. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18099. /* harmony export */ });
  18100. /* 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");
  18101. /* 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");
  18102. /* 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");
  18103. /* 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");
  18104. ;
  18105. 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"]])
  18106. /* hot reload */
  18107. if (false) {}
  18108. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18109. /***/ }),
  18110. /***/ "./resources/js/pages/member/Edit.vue":
  18111. /*!********************************************!*\
  18112. !*** ./resources/js/pages/member/Edit.vue ***!
  18113. \********************************************/
  18114. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18115. "use strict";
  18116. __webpack_require__.r(__webpack_exports__);
  18117. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18118. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18119. /* harmony export */ });
  18120. /* 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");
  18121. /* 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");
  18122. /* 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");
  18123. ;
  18124. 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"]])
  18125. /* hot reload */
  18126. if (false) {}
  18127. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18128. /***/ }),
  18129. /***/ "./resources/js/components/AppDropdown.vue?vue&type=script&setup=true&lang=js":
  18130. /*!************************************************************************************!*\
  18131. !*** ./resources/js/components/AppDropdown.vue?vue&type=script&setup=true&lang=js ***!
  18132. \************************************************************************************/
  18133. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18134. "use strict";
  18135. __webpack_require__.r(__webpack_exports__);
  18136. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18137. /* 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"])
  18138. /* harmony export */ });
  18139. /* 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");
  18140. /***/ }),
  18141. /***/ "./resources/js/components/AppInputText.vue?vue&type=script&setup=true&lang=js":
  18142. /*!*************************************************************************************!*\
  18143. !*** ./resources/js/components/AppInputText.vue?vue&type=script&setup=true&lang=js ***!
  18144. \*************************************************************************************/
  18145. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18146. "use strict";
  18147. __webpack_require__.r(__webpack_exports__);
  18148. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18149. /* 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"])
  18150. /* harmony export */ });
  18151. /* 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");
  18152. /***/ }),
  18153. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  18154. /*!***********************************************************************************!*\
  18155. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  18156. \***********************************************************************************/
  18157. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18158. "use strict";
  18159. __webpack_require__.r(__webpack_exports__);
  18160. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18161. /* 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"])
  18162. /* harmony export */ });
  18163. /* 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");
  18164. /***/ }),
  18165. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  18166. /*!***********************************************************************************!*\
  18167. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  18168. \***********************************************************************************/
  18169. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18170. "use strict";
  18171. __webpack_require__.r(__webpack_exports__);
  18172. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18173. /* 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"])
  18174. /* harmony export */ });
  18175. /* 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");
  18176. /***/ }),
  18177. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  18178. /*!**************************************************************************************!*\
  18179. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  18180. \**************************************************************************************/
  18181. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18182. "use strict";
  18183. __webpack_require__.r(__webpack_exports__);
  18184. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18185. /* 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"])
  18186. /* harmony export */ });
  18187. /* 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");
  18188. /***/ }),
  18189. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  18190. /*!**********************************************************************************!*\
  18191. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  18192. \**********************************************************************************/
  18193. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18194. "use strict";
  18195. __webpack_require__.r(__webpack_exports__);
  18196. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18197. /* 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"])
  18198. /* harmony export */ });
  18199. /* 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");
  18200. /***/ }),
  18201. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  18202. /*!*************************************************************************************!*\
  18203. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  18204. \*************************************************************************************/
  18205. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18206. "use strict";
  18207. __webpack_require__.r(__webpack_exports__);
  18208. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18209. /* 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"])
  18210. /* harmony export */ });
  18211. /* 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");
  18212. /***/ }),
  18213. /***/ "./resources/js/pages/member/Edit.vue?vue&type=script&setup=true&lang=js":
  18214. /*!*******************************************************************************!*\
  18215. !*** ./resources/js/pages/member/Edit.vue?vue&type=script&setup=true&lang=js ***!
  18216. \*******************************************************************************/
  18217. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18218. "use strict";
  18219. __webpack_require__.r(__webpack_exports__);
  18220. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18221. /* 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"])
  18222. /* harmony export */ });
  18223. /* 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");
  18224. /***/ }),
  18225. /***/ "./resources/js/components/AppDropdown.vue?vue&type=template&id=ce0d1992":
  18226. /*!*******************************************************************************!*\
  18227. !*** ./resources/js/components/AppDropdown.vue?vue&type=template&id=ce0d1992 ***!
  18228. \*******************************************************************************/
  18229. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18230. "use strict";
  18231. __webpack_require__.r(__webpack_exports__);
  18232. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18233. /* 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)
  18234. /* harmony export */ });
  18235. /* 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");
  18236. /***/ }),
  18237. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  18238. /*!*****************************************************************************************!*\
  18239. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  18240. \*****************************************************************************************/
  18241. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18242. "use strict";
  18243. __webpack_require__.r(__webpack_exports__);
  18244. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18245. /* 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)
  18246. /* harmony export */ });
  18247. /* 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");
  18248. /***/ }),
  18249. /***/ "./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1":
  18250. /*!********************************************************************************!*\
  18251. !*** ./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1 ***!
  18252. \********************************************************************************/
  18253. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18254. "use strict";
  18255. __webpack_require__.r(__webpack_exports__);
  18256. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18257. /* 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)
  18258. /* harmony export */ });
  18259. /* 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");
  18260. /***/ }),
  18261. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  18262. /*!******************************************************************************!*\
  18263. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  18264. \******************************************************************************/
  18265. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18266. "use strict";
  18267. __webpack_require__.r(__webpack_exports__);
  18268. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18269. /* 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)
  18270. /* harmony export */ });
  18271. /* 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");
  18272. /***/ }),
  18273. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  18274. /*!******************************************************************************************!*\
  18275. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  18276. \******************************************************************************************/
  18277. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18278. "use strict";
  18279. __webpack_require__.r(__webpack_exports__);
  18280. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18281. /* 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)
  18282. /* harmony export */ });
  18283. /* 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");
  18284. /***/ }),
  18285. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  18286. /*!*********************************************************************************************!*\
  18287. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  18288. \*********************************************************************************************/
  18289. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18290. "use strict";
  18291. __webpack_require__.r(__webpack_exports__);
  18292. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18293. /* 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)
  18294. /* harmony export */ });
  18295. /* 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");
  18296. /***/ }),
  18297. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  18298. /*!*****************************************************************************************!*\
  18299. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  18300. \*****************************************************************************************/
  18301. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18302. "use strict";
  18303. __webpack_require__.r(__webpack_exports__);
  18304. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18305. /* 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)
  18306. /* harmony export */ });
  18307. /* 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");
  18308. /***/ }),
  18309. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  18310. /*!********************************************************************************************!*\
  18311. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  18312. \********************************************************************************************/
  18313. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18314. "use strict";
  18315. __webpack_require__.r(__webpack_exports__);
  18316. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18317. /* 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)
  18318. /* harmony export */ });
  18319. /* 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");
  18320. /***/ }),
  18321. /***/ "./resources/js/pages/member/Edit.vue?vue&type=template&id=1a9fb226":
  18322. /*!**************************************************************************!*\
  18323. !*** ./resources/js/pages/member/Edit.vue?vue&type=template&id=1a9fb226 ***!
  18324. \**************************************************************************/
  18325. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18326. "use strict";
  18327. __webpack_require__.r(__webpack_exports__);
  18328. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18329. /* 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)
  18330. /* harmony export */ });
  18331. /* 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");
  18332. /***/ }),
  18333. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  18334. /*!********************************************************************************************************!*\
  18335. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  18336. \********************************************************************************************************/
  18337. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18338. "use strict";
  18339. __webpack_require__.r(__webpack_exports__);
  18340. /* 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");
  18341. /***/ }),
  18342. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  18343. /*!*********************************************************************************************************!*\
  18344. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  18345. \*********************************************************************************************************/
  18346. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18347. "use strict";
  18348. __webpack_require__.r(__webpack_exports__);
  18349. /* 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");
  18350. /***/ }),
  18351. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  18352. /*!************************************************************************************************************!*\
  18353. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  18354. \************************************************************************************************************/
  18355. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18356. "use strict";
  18357. __webpack_require__.r(__webpack_exports__);
  18358. /* 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");
  18359. /***/ }),
  18360. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  18361. /*!********************************************************************************************************!*\
  18362. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  18363. \********************************************************************************************************/
  18364. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18365. "use strict";
  18366. __webpack_require__.r(__webpack_exports__);
  18367. /* 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");
  18368. /***/ }),
  18369. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  18370. /*!***********************************************************************************************************!*\
  18371. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  18372. \***********************************************************************************************************/
  18373. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18374. "use strict";
  18375. __webpack_require__.r(__webpack_exports__);
  18376. /* 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");
  18377. /***/ })
  18378. }]);