resources_js_pages_member_Edit_vue.js 719KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942
  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. type: {
  121. type: String,
  122. "default": 'text'
  123. },
  124. error: {
  125. type: String,
  126. "default": null
  127. },
  128. modelValue: null
  129. },
  130. emits: ['update:modelValue'],
  131. setup: function setup(__props, _ref) {
  132. var expose = _ref.expose;
  133. expose();
  134. var props = __props;
  135. var isError = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  136. return props.error ? true : false;
  137. });
  138. var forLabel = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  139. return props.label.toLowerCase().replace(/\s+/g, '-');
  140. });
  141. var ariaDescribedbyLabel = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  142. return props.label.toLowerCase().replace(/\s+/g, '-') + '-help';
  143. });
  144. var __returned__ = {
  145. props: props,
  146. isError: isError,
  147. forLabel: forLabel,
  148. ariaDescribedbyLabel: ariaDescribedbyLabel,
  149. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed
  150. };
  151. Object.defineProperty(__returned__, '__isScriptSetup', {
  152. enumerable: false,
  153. value: true
  154. });
  155. return __returned__;
  156. }
  157. });
  158. /***/ }),
  159. /***/ "./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":
  160. /*!***************************************************************************************************************************************************************************************************************!*\
  161. !*** ./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 ***!
  162. \***************************************************************************************************************************************************************************************************************/
  163. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  164. "use strict";
  165. __webpack_require__.r(__webpack_exports__);
  166. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  167. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  168. /* harmony export */ });
  169. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  170. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  171. setup: function setup(__props, _ref) {
  172. var expose = _ref.expose;
  173. expose();
  174. var onClose = function onClose() {
  175. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  176. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  177. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  178. };
  179. var __returned__ = {
  180. onClose: onClose,
  181. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  182. };
  183. Object.defineProperty(__returned__, '__isScriptSetup', {
  184. enumerable: false,
  185. value: true
  186. });
  187. return __returned__;
  188. }
  189. });
  190. /***/ }),
  191. /***/ "./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":
  192. /*!***************************************************************************************************************************************************************************************************************!*\
  193. !*** ./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 ***!
  194. \***************************************************************************************************************************************************************************************************************/
  195. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  196. "use strict";
  197. __webpack_require__.r(__webpack_exports__);
  198. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  199. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  200. /* harmony export */ });
  201. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  202. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  203. props: {
  204. menu: Array
  205. },
  206. setup: function setup(__props, _ref) {
  207. var expose = _ref.expose;
  208. expose();
  209. var __returned__ = {
  210. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  211. };
  212. Object.defineProperty(__returned__, '__isScriptSetup', {
  213. enumerable: false,
  214. value: true
  215. });
  216. return __returned__;
  217. }
  218. });
  219. /***/ }),
  220. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  221. /*!******************************************************************************************************************************************************************************************************************!*\
  222. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  223. \******************************************************************************************************************************************************************************************************************/
  224. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  225. "use strict";
  226. __webpack_require__.r(__webpack_exports__);
  227. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  228. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  229. /* harmony export */ });
  230. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  231. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  232. props: {
  233. items: Array,
  234. root: {
  235. type: Boolean,
  236. "default": false
  237. }
  238. },
  239. setup: function setup(__props, _ref) {
  240. var expose = _ref.expose;
  241. expose();
  242. var __returned__ = {
  243. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  244. };
  245. Object.defineProperty(__returned__, '__isScriptSetup', {
  246. enumerable: false,
  247. value: true
  248. });
  249. return __returned__;
  250. }
  251. });
  252. /***/ }),
  253. /***/ "./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":
  254. /*!**************************************************************************************************************************************************************************************************************!*\
  255. !*** ./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 ***!
  256. \**************************************************************************************************************************************************************************************************************/
  257. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  258. "use strict";
  259. __webpack_require__.r(__webpack_exports__);
  260. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  261. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  262. /* harmony export */ });
  263. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  264. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  265. emits: ['menu-toggle'],
  266. setup: function setup(__props, _ref) {
  267. var expose = _ref.expose;
  268. expose();
  269. var __returned__ = {
  270. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  271. };
  272. Object.defineProperty(__returned__, '__isScriptSetup', {
  273. enumerable: false,
  274. value: true
  275. });
  276. return __returned__;
  277. }
  278. });
  279. /***/ }),
  280. /***/ "./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":
  281. /*!*****************************************************************************************************************************************************************************************************************!*\
  282. !*** ./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 ***!
  283. \*****************************************************************************************************************************************************************************************************************/
  284. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  285. "use strict";
  286. __webpack_require__.r(__webpack_exports__);
  287. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  288. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  289. /* harmony export */ });
  290. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  291. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  292. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  293. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  294. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  295. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  296. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  297. setup: function setup(__props, _ref) {
  298. var expose = _ref.expose;
  299. expose();
  300. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  301. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  302. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  303. var isDesktop = function isDesktop() {
  304. return window.innerWidth >= 992;
  305. };
  306. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  307. return ['layout-wrapper', {
  308. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  309. 'layout-mobile-sidebar-active': mobileMenuActive.value
  310. }];
  311. });
  312. var onWrapperClick = function onWrapperClick() {
  313. if (!menuClick.value) {
  314. mobileMenuActive.value = false;
  315. }
  316. menuClick.value = false;
  317. };
  318. var onMenuToggle = function onMenuToggle(event) {
  319. menuClick.value = true;
  320. if (isDesktop()) {
  321. staticMenuInactive.value = !staticMenuInactive.value;
  322. } else {
  323. mobileMenuActive.value = !mobileMenuActive.value;
  324. }
  325. event.preventDefault();
  326. };
  327. var __returned__ = {
  328. mobileMenuActive: mobileMenuActive,
  329. staticMenuInactive: staticMenuInactive,
  330. menuClick: menuClick,
  331. isDesktop: isDesktop,
  332. containerClass: containerClass,
  333. onWrapperClick: onWrapperClick,
  334. onMenuToggle: onMenuToggle,
  335. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  336. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  337. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  338. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  339. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  340. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  341. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  342. };
  343. Object.defineProperty(__returned__, '__isScriptSetup', {
  344. enumerable: false,
  345. value: true
  346. });
  347. return __returned__;
  348. }
  349. });
  350. /***/ }),
  351. /***/ "./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":
  352. /*!***********************************************************************************************************************************************************************************************************!*\
  353. !*** ./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 ***!
  354. \***********************************************************************************************************************************************************************************************************/
  355. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  356. "use strict";
  357. __webpack_require__.r(__webpack_exports__);
  358. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  359. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  360. /* harmony export */ });
  361. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  362. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  363. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  364. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
  365. /* harmony import */ var primevue_useconfirm__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! primevue/useconfirm */ "./node_modules/primevue/useconfirm/useconfirm.esm.js");
  366. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/member/tableHeader.js");
  367. /* harmony import */ var _useVehicle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./useVehicle */ "./resources/js/pages/member/useVehicle.js");
  368. /* harmony import */ var _components_useFormErrorReset__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/useFormErrorReset */ "./resources/js/components/useFormErrorReset.js");
  369. /* harmony import */ var _utils_formValidationError__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/utils/formValidationError */ "./resources/js/utils/formValidationError.js");
  370. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  371. /* harmony import */ var _components_AppDropdown_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/components/AppDropdown.vue */ "./resources/js/components/AppDropdown.vue");
  372. /* harmony import */ var _components_AppInputText_vue__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/components/AppInputText.vue */ "./resources/js/components/AppInputText.vue");
  373. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  374. props: {
  375. member: Object,
  376. typeMembers: Array,
  377. typeMember: Object,
  378. initialVehicles: Object
  379. },
  380. setup: function setup(__props, _ref) {
  381. var expose = _ref.expose;
  382. expose();
  383. var props = __props;
  384. var form = (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.useForm)({
  385. name: props.member.name,
  386. phone: null,
  387. plat_number: null,
  388. max_vehicle_id: null,
  389. type_member_id: props.member.typeMemberId
  390. });
  391. (0,_components_useFormErrorReset__WEBPACK_IMPORTED_MODULE_6__.useFormErrorReset)(form);
  392. var _useVehicle = (0,_useVehicle__WEBPACK_IMPORTED_MODULE_5__.useVehicle)(props, form),
  393. listVehicle = _useVehicle.listVehicle,
  394. vehicleOnDelete = _useVehicle.vehicleOnDelete,
  395. vehicleOnAdd = _useVehicle.vehicleOnAdd;
  396. var confirm = (0,primevue_useconfirm__WEBPACK_IMPORTED_MODULE_3__.useConfirm)();
  397. var errorSubmitVisible = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  398. var errorSubmitText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)();
  399. var submitValidation = function submitValidation() {
  400. var listPlatNumberGroup = (0,lodash__WEBPACK_IMPORTED_MODULE_2__.groupBy)(listVehicle, 'typeVehicleId');
  401. var listVehicles = [];
  402. for (var key in listPlatNumberGroup) {
  403. listVehicles.push({
  404. typeVehicleId: listPlatNumberGroup[key][0]['typeVehicleId'],
  405. maxVehicle: listPlatNumberGroup[key][0]['maxVehicle'],
  406. count: listPlatNumberGroup[key].length
  407. });
  408. }
  409. listVehicles.forEach(function (val) {
  410. if (val.count > val.maxVehicle) {
  411. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_7__["default"]('Ada perubahan pada batas maksimal kendaraan');
  412. }
  413. });
  414. };
  415. var formSent = function formSent() {
  416. form.transform(function (data) {
  417. return {
  418. name: data.name,
  419. phone: data.phone,
  420. vehicles: listVehicle,
  421. type_member_id: data.type_member_id
  422. };
  423. }).put(route('members.update', props.member.id));
  424. };
  425. var onSubmit = function onSubmit() {
  426. try {
  427. submitValidation();
  428. if (props.member.typeMemberId != form.type_member_id) {
  429. confirm.require({
  430. message: "Dikenakan tagihan perubahan member sebesar ".concat(props.typeMember.price),
  431. header: 'Tagihan Perubahan Jenis Member',
  432. acceptLabel: 'Bayar dan simpan',
  433. rejectLabel: 'Batalkan',
  434. accept: function accept() {
  435. formSent();
  436. },
  437. reject: function reject() {
  438. confirm.close();
  439. }
  440. });
  441. } else {
  442. formSent();
  443. }
  444. } catch (err) {
  445. errorSubmitVisible.value = true;
  446. errorSubmitText.value = err.message;
  447. }
  448. };
  449. var __returned__ = {
  450. props: props,
  451. form: form,
  452. listVehicle: listVehicle,
  453. vehicleOnDelete: vehicleOnDelete,
  454. vehicleOnAdd: vehicleOnAdd,
  455. confirm: confirm,
  456. errorSubmitVisible: errorSubmitVisible,
  457. errorSubmitText: errorSubmitText,
  458. submitValidation: submitValidation,
  459. formSent: formSent,
  460. onSubmit: onSubmit,
  461. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  462. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.Head,
  463. useForm: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.useForm,
  464. groupBy: lodash__WEBPACK_IMPORTED_MODULE_2__.groupBy,
  465. useConfirm: primevue_useconfirm__WEBPACK_IMPORTED_MODULE_3__.useConfirm,
  466. platNumberTable: _tableHeader__WEBPACK_IMPORTED_MODULE_4__.platNumberTable,
  467. useVehicle: _useVehicle__WEBPACK_IMPORTED_MODULE_5__.useVehicle,
  468. useFormErrorReset: _components_useFormErrorReset__WEBPACK_IMPORTED_MODULE_6__.useFormErrorReset,
  469. FormValidationError: _utils_formValidationError__WEBPACK_IMPORTED_MODULE_7__["default"],
  470. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_8__["default"],
  471. AppDropdown: _components_AppDropdown_vue__WEBPACK_IMPORTED_MODULE_9__["default"],
  472. AppInputText: _components_AppInputText_vue__WEBPACK_IMPORTED_MODULE_10__["default"]
  473. };
  474. Object.defineProperty(__returned__, '__isScriptSetup', {
  475. enumerable: false,
  476. value: true
  477. });
  478. return __returned__;
  479. }
  480. });
  481. /***/ }),
  482. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  483. /*!*********************************************************************************************************************************************************************************************************************************************************************************!*\
  484. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  485. \*********************************************************************************************************************************************************************************************************************************************************************************/
  486. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  487. "use strict";
  488. __webpack_require__.r(__webpack_exports__);
  489. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  490. /* harmony export */ "render": () => (/* binding */ render)
  491. /* harmony export */ });
  492. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  493. var _hoisted_1 = {
  494. "class": "field"
  495. };
  496. var _hoisted_2 = ["for"];
  497. var _hoisted_3 = {
  498. key: 0
  499. };
  500. var _hoisted_4 = {
  501. key: 1
  502. };
  503. var _hoisted_5 = ["id"];
  504. function render(_ctx, _cache, $props, $setup, $data, $options) {
  505. var _component_Dropdown = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Dropdown");
  506. 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", {
  507. key: 0,
  508. "for": $setup.forLabel
  509. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 9
  510. /* TEXT, PROPS */
  511. , _hoisted_2)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Dropdown, {
  512. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["w-full", {
  513. 'p-invalid': $setup.isError
  514. }]),
  515. id: $setup.forLabel,
  516. "aria-describedby": $setup.ariaDescribedbyLabel,
  517. "option-disabled": $props.optionDisabled,
  518. "option-group-children": $props.optionGroupChildren,
  519. "option-group-label": $props.optionGroupLabel,
  520. "option-label": $props.optionLabel,
  521. "option-value": $props.optionValue,
  522. placeholder: $props.placeholder,
  523. options: $props.options,
  524. "model-value": $props.modelValue,
  525. disabled: $props.disabled,
  526. onChange: _cache[0] || (_cache[0] = function ($event) {
  527. return _ctx.$emit('update:modelValue', $event.value);
  528. })
  529. }, {
  530. value: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (slotProps) {
  531. 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
  532. /* TEXT */
  533. )) : ((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
  534. /* TEXT */
  535. ))];
  536. }),
  537. option: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  538. var option = _ref.option,
  539. index = _ref.index;
  540. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "option", {
  541. option: option,
  542. index: index
  543. })];
  544. }),
  545. _: 3
  546. /* FORWARDED */
  547. }, 8
  548. /* PROPS */
  549. , ["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", {
  550. key: 1,
  551. id: $setup.ariaDescribedbyLabel,
  552. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)({
  553. 'p-error': $setup.isError
  554. })
  555. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.error), 11
  556. /* TEXT, CLASS, PROPS */
  557. , _hoisted_5)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]);
  558. }
  559. /***/ }),
  560. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  561. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  562. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  563. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  564. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  565. "use strict";
  566. __webpack_require__.r(__webpack_exports__);
  567. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  568. /* harmony export */ "render": () => (/* binding */ render)
  569. /* harmony export */ });
  570. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  571. var _withScopeId = function _withScopeId(n) {
  572. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  573. };
  574. var _hoisted_1 = {
  575. "class": "layout-footer"
  576. };
  577. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  578. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  579. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  580. href: "https://dijitalcode.com",
  581. target: "_blank",
  582. "class": "font-medium ml-2"
  583. }, "DijitalCODE", -1
  584. /* HOISTED */
  585. );
  586. });
  587. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  588. function render(_ctx, _cache) {
  589. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  590. }
  591. /***/ }),
  592. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1":
  593. /*!**********************************************************************************************************************************************************************************************************************************************************************************!*\
  594. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1 ***!
  595. \**********************************************************************************************************************************************************************************************************************************************************************************/
  596. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  597. "use strict";
  598. __webpack_require__.r(__webpack_exports__);
  599. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  600. /* harmony export */ "render": () => (/* binding */ render)
  601. /* harmony export */ });
  602. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  603. var _hoisted_1 = {
  604. "class": "field"
  605. };
  606. var _hoisted_2 = ["for"];
  607. var _hoisted_3 = ["id"];
  608. function render(_ctx, _cache, $props, $setup, $data, $options) {
  609. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  610. 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", {
  611. "for": $setup.forLabel
  612. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 9
  613. /* TEXT, PROPS */
  614. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_InputText, {
  615. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["w-full", {
  616. 'p-invalid': $setup.isError
  617. }]),
  618. type: $props.type,
  619. id: $setup.forLabel,
  620. "aria-describedby": $setup.ariaDescribedbyLabel,
  621. "model-value": $props.modelValue,
  622. placeholder: $props.placeholder,
  623. value: $props.modelValue,
  624. disabled: $props.disabled,
  625. onInput: _cache[0] || (_cache[0] = function ($event) {
  626. return _ctx.$emit('update:modelValue', $event.target.value);
  627. })
  628. }, null, 8
  629. /* PROPS */
  630. , ["class", "type", "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", {
  631. key: 0,
  632. id: $setup.ariaDescribedbyLabel,
  633. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)({
  634. 'p-error': $setup.isError
  635. })
  636. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.error), 11
  637. /* TEXT, CLASS, PROPS */
  638. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]);
  639. }
  640. /***/ }),
  641. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  642. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  643. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  644. \********************************************************************************************************************************************************************************************************************************************************************************/
  645. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  646. "use strict";
  647. __webpack_require__.r(__webpack_exports__);
  648. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  649. /* harmony export */ "render": () => (/* binding */ render)
  650. /* harmony export */ });
  651. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  652. var _hoisted_1 = {
  653. key: 0
  654. };
  655. var _hoisted_2 = {
  656. key: 1
  657. };
  658. function render(_ctx, _cache, $props, $setup, $data, $options) {
  659. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  660. 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, {
  661. key: 0,
  662. severity: "success",
  663. onClose: $setup.onClose
  664. }, {
  665. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  666. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  667. /* TEXT */
  668. )];
  669. }),
  670. _: 1
  671. /* STABLE */
  672. })) : (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, {
  673. key: 1,
  674. severity: "error",
  675. onClose: $setup.onClose
  676. }, {
  677. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  678. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  679. /* TEXT */
  680. )];
  681. }),
  682. _: 1
  683. /* STABLE */
  684. })) : (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, {
  685. key: 2,
  686. severity: "error",
  687. onClose: $setup.onClose
  688. }, {
  689. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  690. 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
  691. /* TEXT */
  692. ))];
  693. }),
  694. _: 1
  695. /* STABLE */
  696. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  697. /* STABLE_FRAGMENT */
  698. );
  699. }
  700. /***/ }),
  701. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  702. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  703. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  704. \********************************************************************************************************************************************************************************************************************************************************************************************/
  705. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  706. "use strict";
  707. __webpack_require__.r(__webpack_exports__);
  708. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  709. /* harmony export */ "render": () => (/* binding */ render)
  710. /* harmony export */ });
  711. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  712. function render(_ctx, _cache, $props, $setup, $data, $options) {
  713. 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"], {
  714. "class": "layout-menu",
  715. items: $props.menu,
  716. root: true
  717. }, null, 8
  718. /* PROPS */
  719. , ["items"])]);
  720. }
  721. /***/ }),
  722. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  723. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  724. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  725. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  726. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  727. "use strict";
  728. __webpack_require__.r(__webpack_exports__);
  729. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  730. /* harmony export */ "render": () => (/* binding */ render)
  731. /* harmony export */ });
  732. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  733. var _withScopeId = function _withScopeId(n) {
  734. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  735. };
  736. var _hoisted_1 = {
  737. key: 0
  738. };
  739. var _hoisted_2 = ["aria-label"];
  740. var _hoisted_3 = ["aria-label"];
  741. function render(_ctx, _cache, $props, $setup, $data, $options) {
  742. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  743. 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) {
  744. 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", {
  745. key: i,
  746. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  747. 'layout-menuitem-category': $props.root
  748. }]),
  749. role: "none"
  750. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  751. key: 0
  752. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  753. "class": "layout-menuitem-root-text",
  754. "aria-label": item.label
  755. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  756. /* TEXT, PROPS */
  757. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  758. items: item.items
  759. }, null, 8
  760. /* PROPS */
  761. , ["items"])], 64
  762. /* STABLE_FRAGMENT */
  763. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  764. key: 1
  765. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  766. key: 0,
  767. role: "menuitem",
  768. href: item.to,
  769. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  770. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  771. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  772. }]),
  773. "aria-label": item.label
  774. }, {
  775. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  776. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  777. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  778. }, null, 2
  779. /* CLASS */
  780. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  781. /* TEXT */
  782. )];
  783. }),
  784. _: 2
  785. /* DYNAMIC */
  786. }, 1032
  787. /* PROPS, DYNAMIC_SLOTS */
  788. , ["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", {
  789. key: 1,
  790. href: "#",
  791. role: "menuitem",
  792. "aria-label": item.label
  793. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  794. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  795. }, null, 2
  796. /* CLASS */
  797. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  798. /* TEXT */
  799. )], 8
  800. /* PROPS */
  801. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  802. items: item.items
  803. }, null, 8
  804. /* PROPS */
  805. , ["items"])], 64
  806. /* STABLE_FRAGMENT */
  807. ))], 2
  808. /* CLASS */
  809. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  810. /* STABLE_FRAGMENT */
  811. );
  812. }), 256
  813. /* UNKEYED_FRAGMENT */
  814. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  815. }
  816. /***/ }),
  817. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  818. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  819. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  820. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  821. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  822. "use strict";
  823. __webpack_require__.r(__webpack_exports__);
  824. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  825. /* harmony export */ "render": () => (/* binding */ render)
  826. /* harmony export */ });
  827. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  828. var _withScopeId = function _withScopeId(n) {
  829. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  830. };
  831. var _hoisted_1 = {
  832. "class": "layout-topbar"
  833. };
  834. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  835. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  836. alt: "Logo",
  837. src: "/images/logo.svg",
  838. "class": "md:mr-3"
  839. }, null, -1
  840. /* HOISTED */
  841. );
  842. });
  843. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  844. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  845. /* HOISTED */
  846. );
  847. });
  848. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  849. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  850. "class": "pi pi-bars"
  851. }, null, -1
  852. /* HOISTED */
  853. );
  854. });
  855. var _hoisted_5 = [_hoisted_4];
  856. var _hoisted_6 = {
  857. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  858. };
  859. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  860. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  861. "class": "pi pi-ellipsis-v"
  862. }, null, -1
  863. /* HOISTED */
  864. );
  865. });
  866. var _hoisted_8 = [_hoisted_7];
  867. var _hoisted_9 = {
  868. "class": "layout-topbar-menu hidden lg:flex origin-top"
  869. };
  870. var _hoisted_10 = {
  871. "class": "align-self-center"
  872. };
  873. var _hoisted_11 = {
  874. "class": "hidden lg:inline"
  875. };
  876. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  877. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  878. "class": "pi pi-user"
  879. }, null, -1
  880. /* HOISTED */
  881. );
  882. });
  883. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  884. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  885. /* HOISTED */
  886. );
  887. });
  888. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  889. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  890. "class": "pi pi-sign-out"
  891. }, null, -1
  892. /* HOISTED */
  893. );
  894. });
  895. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  896. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  897. /* HOISTED */
  898. );
  899. });
  900. function render(_ctx, _cache, $props, $setup, $data, $options) {
  901. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  902. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  903. 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"], {
  904. href: "/",
  905. "class": "layout-topbar-logo"
  906. }, {
  907. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  908. return [_hoisted_2, _hoisted_3];
  909. }),
  910. _: 1
  911. /* STABLE */
  912. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  913. "class": "p-link layout-menu-button layout-topbar-button",
  914. onClick: _cache[0] || (_cache[0] = function ($event) {
  915. return _ctx.$emit('menu-toggle', $event);
  916. })
  917. }, _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, {
  918. selector: '@next',
  919. enterClass: 'hidden',
  920. enterActiveClass: 'scalein',
  921. leaveToClass: 'hidden',
  922. leaveActiveClass: 'fadeout',
  923. hideOnOutsideClick: true
  924. }]]), (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
  925. /* TEXT */
  926. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  927. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  928. "class": "p-link layout-topbar-button"
  929. }, {
  930. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  931. return [_hoisted_12, _hoisted_13];
  932. }),
  933. _: 1
  934. /* STABLE */
  935. }, 8
  936. /* PROPS */
  937. , ["href"])), [[_directive_tooltip, {
  938. value: 'Ubah Profil',
  939. "class": 'layout-topbar-menu-tooltip'
  940. }, void 0, {
  941. bottom: true
  942. }]])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  943. href: _ctx.route('logout'),
  944. as: "button",
  945. method: "post",
  946. "class": "p-link layout-topbar-button"
  947. }, {
  948. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  949. return [_hoisted_14, _hoisted_15];
  950. }),
  951. _: 1
  952. /* STABLE */
  953. }, 8
  954. /* PROPS */
  955. , ["href"])), [[_directive_tooltip, {
  956. value: 'Keluar',
  957. "class": 'layout-topbar-menu-tooltip'
  958. }, void 0, {
  959. bottom: true
  960. }]])])])]);
  961. }
  962. /***/ }),
  963. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  964. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  965. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  966. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  967. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  968. "use strict";
  969. __webpack_require__.r(__webpack_exports__);
  970. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  971. /* harmony export */ "render": () => (/* binding */ render)
  972. /* harmony export */ });
  973. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  974. var _withScopeId = function _withScopeId(n) {
  975. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  976. };
  977. var _hoisted_1 = {
  978. "class": "layout-sidebar"
  979. };
  980. var _hoisted_2 = {
  981. "class": "layout-main-container"
  982. };
  983. var _hoisted_3 = {
  984. "class": "layout-main"
  985. };
  986. var _hoisted_4 = {
  987. key: 0,
  988. "class": "layout-mask p-component-overlay"
  989. };
  990. function render(_ctx, _cache, $props, $setup, $data, $options) {
  991. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  992. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  993. onClick: $setup.onWrapperClick
  994. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  995. onMenuToggle: $setup.onMenuToggle
  996. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  997. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  998. }, null, 8
  999. /* PROPS */
  1000. , ["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, {
  1001. name: "layout-mask"
  1002. }, {
  1003. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1004. 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)];
  1005. }),
  1006. _: 1
  1007. /* STABLE */
  1008. })], 2
  1009. /* CLASS */
  1010. );
  1011. }
  1012. /***/ }),
  1013. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  1014. /*!****************************************************************************************************************************************************************************************************************************************************************************!*\
  1015. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  1016. \****************************************************************************************************************************************************************************************************************************************************************************/
  1017. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1018. "use strict";
  1019. __webpack_require__.r(__webpack_exports__);
  1020. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1021. /* harmony export */ "render": () => (/* binding */ render)
  1022. /* harmony export */ });
  1023. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1024. var _hoisted_1 = {
  1025. "class": "grid"
  1026. };
  1027. var _hoisted_2 = {
  1028. "class": "col-12 md:col-8"
  1029. };
  1030. var _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Ubah Member ");
  1031. var _hoisted_4 = {
  1032. "class": "grid"
  1033. };
  1034. var _hoisted_5 = {
  1035. "class": "col-12 md:col-6"
  1036. };
  1037. var _hoisted_6 = {
  1038. "class": "col-12 md:col-6"
  1039. };
  1040. var _hoisted_7 = {
  1041. "class": "col-12 md:col-6"
  1042. };
  1043. var _hoisted_8 = {
  1044. "class": "grid"
  1045. };
  1046. var _hoisted_9 = {
  1047. "class": "col-12 md:col-8"
  1048. };
  1049. var _hoisted_10 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)("Detail Harga");
  1050. var _hoisted_11 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", {
  1051. "class": "text-base font-bold mb-0"
  1052. }, "Jenis Member", -1
  1053. /* HOISTED */
  1054. );
  1055. var _hoisted_12 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", {
  1056. "class": "text-base font-bold mb-0"
  1057. }, "Batas Maksimal Kendaraan", -1
  1058. /* HOISTED */
  1059. );
  1060. var _hoisted_13 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", {
  1061. "class": "text-base font-bold mb-0"
  1062. }, "Keterangan", -1
  1063. /* HOISTED */
  1064. );
  1065. var _hoisted_14 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h3", {
  1066. "class": "text-base font-bold mb-0"
  1067. }, "Tarif Member", -1
  1068. /* HOISTED */
  1069. );
  1070. var _hoisted_15 = {
  1071. key: 0,
  1072. "class": "grid"
  1073. };
  1074. var _hoisted_16 = {
  1075. "class": "col-12 md:col-8"
  1076. };
  1077. var _hoisted_17 = {
  1078. "class": "grid"
  1079. };
  1080. var _hoisted_18 = {
  1081. "class": "col-12 md:col-6"
  1082. };
  1083. var _hoisted_19 = {
  1084. "class": "col-12 md:col-6"
  1085. };
  1086. var _hoisted_20 = {
  1087. "class": "col-12 mb-3 md:mb-0"
  1088. };
  1089. var _hoisted_21 = {
  1090. "class": "flex flex-column md:flex-row md:align-items-center justify-content-end"
  1091. };
  1092. var _hoisted_22 = {
  1093. "class": "col-12"
  1094. };
  1095. var _hoisted_23 = {
  1096. style: {
  1097. "color": "#b71c1c"
  1098. }
  1099. };
  1100. var _hoisted_24 = {
  1101. "class": "flex justify-content-end"
  1102. };
  1103. var _hoisted_25 = {
  1104. "class": "grid"
  1105. };
  1106. var _hoisted_26 = {
  1107. "class": "col-12 flex flex-column md:flex-row justify-content-center md:justify-content-end"
  1108. };
  1109. function render(_ctx, _cache, $props, $setup, $data, $options) {
  1110. var _component_ConfirmDialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("ConfirmDialog");
  1111. var _component_Dialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Dialog");
  1112. var _component_Card = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Card");
  1113. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  1114. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  1115. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  1116. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  1117. 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"], {
  1118. title: "Ubah Member"
  1119. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  1120. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1121. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_ConfirmDialog), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Dialog, {
  1122. modal: "",
  1123. header: "Error",
  1124. visible: $setup.errorSubmitVisible,
  1125. "onUpdate:visible": _cache[0] || (_cache[0] = function ($event) {
  1126. return $setup.errorSubmitVisible = $event;
  1127. }),
  1128. contentStyle: "color: #b71c1c",
  1129. closable: false,
  1130. style: {
  1131. width: '40vw'
  1132. }
  1133. }, {
  1134. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1135. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($setup.errorSubmitText), 1
  1136. /* TEXT */
  1137. )];
  1138. }),
  1139. _: 1
  1140. /* STABLE */
  1141. }, 8
  1142. /* PROPS */
  1143. , ["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, {
  1144. title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1145. return [_hoisted_3];
  1146. }),
  1147. content: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1148. 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"], {
  1149. modelValue: $setup.form.name,
  1150. "onUpdate:modelValue": _cache[1] || (_cache[1] = function ($event) {
  1151. return $setup.form.name = $event;
  1152. }),
  1153. label: "Nama",
  1154. placeholder: "nama",
  1155. error: $setup.form.errors.name
  1156. }, null, 8
  1157. /* PROPS */
  1158. , ["modelValue", "error"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppInputText"], {
  1159. modelValue: $setup.form.phone,
  1160. "onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) {
  1161. return $setup.form.phone = $event;
  1162. }),
  1163. label: "Nomor HP",
  1164. placeholder: "nomor hp",
  1165. error: $setup.form.errors.phone
  1166. }, null, 8
  1167. /* PROPS */
  1168. , ["modelValue", "error"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_7, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppDropdown"], {
  1169. label: "Jenis member",
  1170. placeholder: "pilih satu",
  1171. modelValue: $setup.form.type_member_id,
  1172. "onUpdate:modelValue": _cache[3] || (_cache[3] = function ($event) {
  1173. return $setup.form.type_member_id = $event;
  1174. }),
  1175. options: $props.typeMembers,
  1176. error: $setup.form.errors.type_member_id
  1177. }, null, 8
  1178. /* PROPS */
  1179. , ["modelValue", "options", "error"])])])];
  1180. }),
  1181. _: 1
  1182. /* STABLE */
  1183. })])]), (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, {
  1184. "class": "bg-primary"
  1185. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createSlots)({
  1186. title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1187. return [_hoisted_10];
  1188. }),
  1189. _: 2
  1190. /* DYNAMIC */
  1191. }, [$props.typeMember ? {
  1192. name: "content",
  1193. fn: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1194. return [_hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.typeMember.type), 1
  1195. /* TEXT */
  1196. ), _hoisted_12, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.typeMember.max), 1
  1197. /* TEXT */
  1198. ), _hoisted_13, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.typeMember.description), 1
  1199. /* TEXT */
  1200. ), _hoisted_14, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("p", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.typeMember.price), 1
  1201. /* TEXT */
  1202. )];
  1203. })
  1204. } : undefined]), 1024
  1205. /* DYNAMIC_SLOTS */
  1206. )])]), $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, {
  1207. content: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1208. 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"], {
  1209. modelValue: $setup.form.plat_number,
  1210. "onUpdate:modelValue": _cache[4] || (_cache[4] = function ($event) {
  1211. return $setup.form.plat_number = $event;
  1212. }),
  1213. label: "Plat Kendaraan",
  1214. placeholder: "plat kendaraan",
  1215. disabled: !$setup.form.type_member_id,
  1216. error: $setup.form.errors.plat_number
  1217. }, null, 8
  1218. /* PROPS */
  1219. , ["modelValue", "disabled", "error"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_19, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppDropdown"], {
  1220. modelValue: $setup.form.max_vehicle_id,
  1221. "onUpdate:modelValue": _cache[5] || (_cache[5] = function ($event) {
  1222. return $setup.form.max_vehicle_id = $event;
  1223. }),
  1224. label: "Jenis Kendaraan",
  1225. placeholder: "jenis kendaraan",
  1226. disabled: !$setup.form.type_member_id,
  1227. options: $props.typeMember.maxVehicles,
  1228. error: $setup.form.errors.max_vehicle_id
  1229. }, null, 8
  1230. /* PROPS */
  1231. , ["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, {
  1232. label: "Tambah",
  1233. "class": "p-button-outlined",
  1234. icon: "pi pi-car",
  1235. disabled: !$setup.form.type_member_id,
  1236. onClick: $setup.vehicleOnAdd
  1237. }, null, 8
  1238. /* PROPS */
  1239. , ["disabled", "onClick"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_22, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  1240. "striped-rows": "",
  1241. "row-hover": "",
  1242. "responsive-layout": "scroll",
  1243. "column-resize-mode": "expand",
  1244. "edit-mode": "cell",
  1245. value: $setup.listVehicle
  1246. }, {
  1247. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1248. 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) {
  1249. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  1250. field: value.field,
  1251. header: value.header,
  1252. key: value.field
  1253. }, null, 8
  1254. /* PROPS */
  1255. , ["field", "header"]);
  1256. }), 128
  1257. /* KEYED_FRAGMENT */
  1258. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  1259. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  1260. var index = _ref.index;
  1261. 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
  1262. /* TEXT */
  1263. )];
  1264. }),
  1265. _: 1
  1266. /* STABLE */
  1267. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  1268. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref2) {
  1269. var index = _ref2.index;
  1270. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_24, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  1271. icon: "pi pi-trash",
  1272. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-rounded p-button-text", {
  1273. 'p-button-danger': _ctx.$page.props.errors["vehicles.".concat(index, ".platNumber")]
  1274. }]),
  1275. onClick: function onClick($event) {
  1276. return $setup.vehicleOnDelete(index);
  1277. }
  1278. }, null, 8
  1279. /* PROPS */
  1280. , ["class", "onClick"]), [[_directive_tooltip, 'Hapus Data', void 0, {
  1281. bottom: true
  1282. }]])])];
  1283. }),
  1284. _: 1
  1285. /* STABLE */
  1286. })];
  1287. }),
  1288. _: 1
  1289. /* STABLE */
  1290. }, 8
  1291. /* PROPS */
  1292. , ["value"])])])];
  1293. }),
  1294. footer: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  1295. 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, {
  1296. label: "Simpan",
  1297. icon: "pi pi-check",
  1298. "class": "p-button-outlined",
  1299. disabled: $setup.form.processing || $setup.listVehicle.length === 0,
  1300. onClick: $setup.onSubmit
  1301. }, null, 8
  1302. /* PROPS */
  1303. , ["disabled"])])])];
  1304. }),
  1305. _: 1
  1306. /* STABLE */
  1307. })])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  1308. }),
  1309. _: 1
  1310. /* STABLE */
  1311. })], 64
  1312. /* STABLE_FRAGMENT */
  1313. );
  1314. }
  1315. /***/ }),
  1316. /***/ "./resources/js/components/useFormErrorReset.js":
  1317. /*!******************************************************!*\
  1318. !*** ./resources/js/components/useFormErrorReset.js ***!
  1319. \******************************************************/
  1320. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1321. "use strict";
  1322. __webpack_require__.r(__webpack_exports__);
  1323. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1324. /* harmony export */ "useFormErrorReset": () => (/* binding */ useFormErrorReset)
  1325. /* harmony export */ });
  1326. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1327. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  1328. function useFormErrorReset(form) {
  1329. var errors = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  1330. return (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.usePage)().props.value.errors;
  1331. });
  1332. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(errors, function () {
  1333. form.clearErrors();
  1334. });
  1335. }
  1336. /***/ }),
  1337. /***/ "./resources/js/pages/member/tableHeader.js":
  1338. /*!**************************************************!*\
  1339. !*** ./resources/js/pages/member/tableHeader.js ***!
  1340. \**************************************************/
  1341. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1342. "use strict";
  1343. __webpack_require__.r(__webpack_exports__);
  1344. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1345. /* harmony export */ "indexTable": () => (/* binding */ indexTable),
  1346. /* harmony export */ "platNumberTable": () => (/* binding */ platNumberTable)
  1347. /* harmony export */ });
  1348. var indexTable = [{
  1349. field: 'updatedAt',
  1350. header: 'Diperbaharui'
  1351. }, {
  1352. field: 'name',
  1353. header: 'Nama'
  1354. }, {
  1355. field: 'platNumber',
  1356. header: 'Plat Kendaraan'
  1357. }, {
  1358. field: 'type',
  1359. header: 'Jenis Member'
  1360. }, {
  1361. field: 'price',
  1362. header: 'Tarif Member'
  1363. }, {
  1364. field: 'expDate',
  1365. header: 'Berakhir'
  1366. }];
  1367. var platNumberTable = [{
  1368. field: 'platNumber',
  1369. header: 'Plat Kendaraan'
  1370. }, {
  1371. field: 'typeVehicle',
  1372. header: 'Jenis Kendaraan'
  1373. }];
  1374. /***/ }),
  1375. /***/ "./resources/js/pages/member/useVehicle.js":
  1376. /*!*************************************************!*\
  1377. !*** ./resources/js/pages/member/useVehicle.js ***!
  1378. \*************************************************/
  1379. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1380. "use strict";
  1381. __webpack_require__.r(__webpack_exports__);
  1382. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1383. /* harmony export */ "useVehicle": () => (/* binding */ useVehicle)
  1384. /* harmony export */ });
  1385. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1386. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  1387. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  1388. /* harmony import */ var _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/utils/formValidationError */ "./resources/js/utils/formValidationError.js");
  1389. function useVehicle(props, form) {
  1390. var listVehicle = (0,vue__WEBPACK_IMPORTED_MODULE_0__.reactive)([]);
  1391. (0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
  1392. if (props.initialVehicles) {
  1393. props.initialVehicles.forEach(function (val) {
  1394. return listVehicle.push(val);
  1395. });
  1396. }
  1397. });
  1398. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(function () {
  1399. return form.type_member_id;
  1400. }, function () {
  1401. vehicleClear();
  1402. form.reset('plat_number', 'max_vehicle_id');
  1403. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.reload({
  1404. only: ['typeMember'],
  1405. data: {
  1406. id: form.type_member_id
  1407. }
  1408. });
  1409. });
  1410. var vehicleClear = function vehicleClear() {
  1411. listVehicle.splice(0);
  1412. };
  1413. var vehicleOnDelete = function vehicleOnDelete(index) {
  1414. listVehicle.splice(index, 1);
  1415. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.usePage)().props.value.errors = {};
  1416. };
  1417. var vehicleAddValidation = function vehicleAddValidation() {
  1418. if (!form.plat_number) {
  1419. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Plat kendaraan tidak boleh kosong', 'plat_number');
  1420. }
  1421. if (!form.max_vehicle_id) {
  1422. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Tidak boleh kosong', 'max_vehicle_id');
  1423. }
  1424. var platNumberExist = listVehicle.filter(function (vehicle) {
  1425. return vehicle.platNumber === form.plat_number.toUpperCase();
  1426. });
  1427. if (platNumberExist.length) {
  1428. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Nomor plat kendaraan tidak boleh sama', 'plat_number');
  1429. }
  1430. var maxVehicles = listVehicle.filter(function (vehicle) {
  1431. return vehicle.maxVehicleId === form.max_vehicle_id;
  1432. });
  1433. if (maxVehicles.length) {
  1434. if (maxVehicles.length + 1 > maxVehicles[0].maxVehicle) {
  1435. throw new _utils_formValidationError__WEBPACK_IMPORTED_MODULE_3__["default"]('Melibihi batas maksimal kendaraan', 'plat_number');
  1436. }
  1437. }
  1438. };
  1439. var vehicleOnAdd = function vehicleOnAdd() {
  1440. try {
  1441. form.clearErrors('plat_number', 'max_vehicle_id');
  1442. vehicleAddValidation();
  1443. var typeVehicle = props.typeMember.maxVehicles.filter(function (maxVehicle) {
  1444. return maxVehicle.value === form.max_vehicle_id;
  1445. })[0];
  1446. listVehicle.push({
  1447. platNumber: form.plat_number.toUpperCase(),
  1448. typeVehicle: typeVehicle.label,
  1449. typeVehicleId: typeVehicle.typeVehicleId,
  1450. maxVehicleId: typeVehicle.value,
  1451. maxVehicle: typeVehicle.maxVehicle
  1452. });
  1453. form.reset('plat_number', 'max_vehicle_id');
  1454. } catch (err) {
  1455. form.setError(err.field, err.message);
  1456. }
  1457. };
  1458. return {
  1459. listVehicle: listVehicle,
  1460. vehicleClear: vehicleClear,
  1461. vehicleOnDelete: vehicleOnDelete,
  1462. vehicleOnAdd: vehicleOnAdd
  1463. };
  1464. }
  1465. /***/ }),
  1466. /***/ "./resources/js/utils/formValidationError.js":
  1467. /*!***************************************************!*\
  1468. !*** ./resources/js/utils/formValidationError.js ***!
  1469. \***************************************************/
  1470. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1471. "use strict";
  1472. __webpack_require__.r(__webpack_exports__);
  1473. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1474. /* harmony export */ "default": () => (/* binding */ FormValidationError)
  1475. /* harmony export */ });
  1476. 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); }
  1477. 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); } }
  1478. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
  1479. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  1480. 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); }
  1481. 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); }; }
  1482. 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); }
  1483. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  1484. 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); }
  1485. 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); }
  1486. 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; } }
  1487. function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
  1488. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  1489. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  1490. var FormValidationError = /*#__PURE__*/function (_Error) {
  1491. _inherits(FormValidationError, _Error);
  1492. var _super = _createSuper(FormValidationError);
  1493. function FormValidationError(message, field) {
  1494. var _this;
  1495. _classCallCheck(this, FormValidationError);
  1496. _this = _super.call(this, message);
  1497. _this.field = field;
  1498. return _this;
  1499. }
  1500. return _createClass(FormValidationError);
  1501. }( /*#__PURE__*/_wrapNativeSuper(Error));
  1502. /***/ }),
  1503. /***/ "./resources/js/utils/menu.js":
  1504. /*!************************************!*\
  1505. !*** ./resources/js/utils/menu.js ***!
  1506. \************************************/
  1507. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1508. "use strict";
  1509. __webpack_require__.r(__webpack_exports__);
  1510. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1511. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1512. /* harmony export */ });
  1513. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1514. // Admin
  1515. 1: [{
  1516. label: 'Home',
  1517. items: [{
  1518. label: 'Dashboard',
  1519. icon: 'pi pi-home',
  1520. to: '/dashboards',
  1521. component: 'home/Index'
  1522. }]
  1523. }, {
  1524. label: 'Master',
  1525. items: [{
  1526. label: 'User',
  1527. icon: 'pi pi-user',
  1528. to: '/users',
  1529. component: 'user/Index'
  1530. }]
  1531. }],
  1532. // Supervisor
  1533. 2: [{
  1534. label: 'Home',
  1535. items: [{
  1536. label: 'Dashboard',
  1537. icon: 'pi pi-home',
  1538. to: '/dashboards',
  1539. component: 'home/Index'
  1540. }]
  1541. }, {
  1542. label: 'Menu',
  1543. items: [{
  1544. label: 'Pengeluaran',
  1545. icon: 'pi pi-wallet',
  1546. to: '/expenses',
  1547. component: 'expense/Index'
  1548. }, {
  1549. label: 'Laporan',
  1550. icon: 'pi pi-book',
  1551. items: [{
  1552. label: 'Mutasi',
  1553. icon: 'pi pi-circle',
  1554. to: '/reports/mutations',
  1555. component: 'mutation/Report'
  1556. }]
  1557. }]
  1558. }, {
  1559. label: 'Master',
  1560. items: [{
  1561. label: 'Jenis Kendaraan',
  1562. icon: 'pi pi-car',
  1563. to: '/type-vehicles',
  1564. component: 'typevehicle/Index'
  1565. }, {
  1566. label: 'Jenis Member',
  1567. icon: 'pi pi-id-card',
  1568. to: '/type-members',
  1569. component: 'typemember/Index'
  1570. }]
  1571. }, {
  1572. label: 'Pengaturan',
  1573. items: [{
  1574. label: 'Tarif Parkir',
  1575. icon: 'pi pi-car',
  1576. to: '/parking-fees/create',
  1577. component: 'parkingfee/Create'
  1578. }]
  1579. }],
  1580. // Operator
  1581. 3: [{
  1582. label: 'Home',
  1583. items: [{
  1584. label: 'Dashboard',
  1585. icon: 'pi pi-home',
  1586. to: '/dashboards',
  1587. component: 'home/Index'
  1588. }]
  1589. }, {
  1590. label: 'Transaksi',
  1591. items: [{
  1592. label: 'Transaksi Keluar',
  1593. icon: 'pi pi-car',
  1594. to: '/transactions/create',
  1595. component: 'transaction/Create'
  1596. }]
  1597. }, {
  1598. label: 'Menu',
  1599. items: [{
  1600. label: 'Pengeluaran',
  1601. icon: 'pi pi-wallet',
  1602. to: '/expenses',
  1603. component: 'expense/Index'
  1604. }, {
  1605. label: 'Member',
  1606. icon: 'pi pi-id-card',
  1607. to: '/members',
  1608. component: 'member/Index'
  1609. }, {
  1610. label: 'Top Up',
  1611. icon: 'pi pi-car',
  1612. to: '/top-ups',
  1613. component: 'topup/Index'
  1614. }]
  1615. }]
  1616. });
  1617. /***/ }),
  1618. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1619. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1620. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1621. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1622. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1623. "use strict";
  1624. __webpack_require__.r(__webpack_exports__);
  1625. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1626. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1627. /* harmony export */ });
  1628. /* 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");
  1629. /* 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__);
  1630. // Imports
  1631. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1632. // Module
  1633. ___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}", ""]);
  1634. // Exports
  1635. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1636. /***/ }),
  1637. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1638. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1639. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1640. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1641. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1642. "use strict";
  1643. __webpack_require__.r(__webpack_exports__);
  1644. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1645. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1646. /* harmony export */ });
  1647. /* 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");
  1648. /* 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__);
  1649. // Imports
  1650. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1651. // Module
  1652. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1653. // Exports
  1654. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1655. /***/ }),
  1656. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1657. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1658. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1659. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1660. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1661. "use strict";
  1662. __webpack_require__.r(__webpack_exports__);
  1663. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1664. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1665. /* harmony export */ });
  1666. /* 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");
  1667. /* 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__);
  1668. // Imports
  1669. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1670. // Module
  1671. ___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}", ""]);
  1672. // Exports
  1673. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1674. /***/ }),
  1675. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1676. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1677. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1678. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1679. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1680. "use strict";
  1681. __webpack_require__.r(__webpack_exports__);
  1682. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1683. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1684. /* harmony export */ });
  1685. /* 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");
  1686. /* 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__);
  1687. // Imports
  1688. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1689. // Module
  1690. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 994;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-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: 5.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}", ""]);
  1691. // Exports
  1692. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1693. /***/ }),
  1694. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1695. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1696. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1697. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1698. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1699. "use strict";
  1700. __webpack_require__.r(__webpack_exports__);
  1701. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1702. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1703. /* harmony export */ });
  1704. /* 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");
  1705. /* 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__);
  1706. // Imports
  1707. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1708. // Module
  1709. ___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: 996;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-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: 995;\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}", ""]);
  1710. // Exports
  1711. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1712. /***/ }),
  1713. /***/ "./node_modules/lodash/lodash.js":
  1714. /*!***************************************!*\
  1715. !*** ./node_modules/lodash/lodash.js ***!
  1716. \***************************************/
  1717. /***/ (function(module, exports, __webpack_require__) {
  1718. /* module decorator */ module = __webpack_require__.nmd(module);
  1719. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1720. * @license
  1721. * Lodash <https://lodash.com/>
  1722. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1723. * Released under MIT license <https://lodash.com/license>
  1724. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1725. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1726. */
  1727. ;(function() {
  1728. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1729. var undefined;
  1730. /** Used as the semantic version number. */
  1731. var VERSION = '4.17.21';
  1732. /** Used as the size to enable large array optimizations. */
  1733. var LARGE_ARRAY_SIZE = 200;
  1734. /** Error message constants. */
  1735. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1736. FUNC_ERROR_TEXT = 'Expected a function',
  1737. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1738. /** Used to stand-in for `undefined` hash values. */
  1739. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1740. /** Used as the maximum memoize cache size. */
  1741. var MAX_MEMOIZE_SIZE = 500;
  1742. /** Used as the internal argument placeholder. */
  1743. var PLACEHOLDER = '__lodash_placeholder__';
  1744. /** Used to compose bitmasks for cloning. */
  1745. var CLONE_DEEP_FLAG = 1,
  1746. CLONE_FLAT_FLAG = 2,
  1747. CLONE_SYMBOLS_FLAG = 4;
  1748. /** Used to compose bitmasks for value comparisons. */
  1749. var COMPARE_PARTIAL_FLAG = 1,
  1750. COMPARE_UNORDERED_FLAG = 2;
  1751. /** Used to compose bitmasks for function metadata. */
  1752. var WRAP_BIND_FLAG = 1,
  1753. WRAP_BIND_KEY_FLAG = 2,
  1754. WRAP_CURRY_BOUND_FLAG = 4,
  1755. WRAP_CURRY_FLAG = 8,
  1756. WRAP_CURRY_RIGHT_FLAG = 16,
  1757. WRAP_PARTIAL_FLAG = 32,
  1758. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1759. WRAP_ARY_FLAG = 128,
  1760. WRAP_REARG_FLAG = 256,
  1761. WRAP_FLIP_FLAG = 512;
  1762. /** Used as default options for `_.truncate`. */
  1763. var DEFAULT_TRUNC_LENGTH = 30,
  1764. DEFAULT_TRUNC_OMISSION = '...';
  1765. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1766. var HOT_COUNT = 800,
  1767. HOT_SPAN = 16;
  1768. /** Used to indicate the type of lazy iteratees. */
  1769. var LAZY_FILTER_FLAG = 1,
  1770. LAZY_MAP_FLAG = 2,
  1771. LAZY_WHILE_FLAG = 3;
  1772. /** Used as references for various `Number` constants. */
  1773. var INFINITY = 1 / 0,
  1774. MAX_SAFE_INTEGER = 9007199254740991,
  1775. MAX_INTEGER = 1.7976931348623157e+308,
  1776. NAN = 0 / 0;
  1777. /** Used as references for the maximum length and index of an array. */
  1778. var MAX_ARRAY_LENGTH = 4294967295,
  1779. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1780. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1781. /** Used to associate wrap methods with their bit flags. */
  1782. var wrapFlags = [
  1783. ['ary', WRAP_ARY_FLAG],
  1784. ['bind', WRAP_BIND_FLAG],
  1785. ['bindKey', WRAP_BIND_KEY_FLAG],
  1786. ['curry', WRAP_CURRY_FLAG],
  1787. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1788. ['flip', WRAP_FLIP_FLAG],
  1789. ['partial', WRAP_PARTIAL_FLAG],
  1790. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1791. ['rearg', WRAP_REARG_FLAG]
  1792. ];
  1793. /** `Object#toString` result references. */
  1794. var argsTag = '[object Arguments]',
  1795. arrayTag = '[object Array]',
  1796. asyncTag = '[object AsyncFunction]',
  1797. boolTag = '[object Boolean]',
  1798. dateTag = '[object Date]',
  1799. domExcTag = '[object DOMException]',
  1800. errorTag = '[object Error]',
  1801. funcTag = '[object Function]',
  1802. genTag = '[object GeneratorFunction]',
  1803. mapTag = '[object Map]',
  1804. numberTag = '[object Number]',
  1805. nullTag = '[object Null]',
  1806. objectTag = '[object Object]',
  1807. promiseTag = '[object Promise]',
  1808. proxyTag = '[object Proxy]',
  1809. regexpTag = '[object RegExp]',
  1810. setTag = '[object Set]',
  1811. stringTag = '[object String]',
  1812. symbolTag = '[object Symbol]',
  1813. undefinedTag = '[object Undefined]',
  1814. weakMapTag = '[object WeakMap]',
  1815. weakSetTag = '[object WeakSet]';
  1816. var arrayBufferTag = '[object ArrayBuffer]',
  1817. dataViewTag = '[object DataView]',
  1818. float32Tag = '[object Float32Array]',
  1819. float64Tag = '[object Float64Array]',
  1820. int8Tag = '[object Int8Array]',
  1821. int16Tag = '[object Int16Array]',
  1822. int32Tag = '[object Int32Array]',
  1823. uint8Tag = '[object Uint8Array]',
  1824. uint8ClampedTag = '[object Uint8ClampedArray]',
  1825. uint16Tag = '[object Uint16Array]',
  1826. uint32Tag = '[object Uint32Array]';
  1827. /** Used to match empty string literals in compiled template source. */
  1828. var reEmptyStringLeading = /\b__p \+= '';/g,
  1829. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1830. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1831. /** Used to match HTML entities and HTML characters. */
  1832. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1833. reUnescapedHtml = /[&<>"']/g,
  1834. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1835. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1836. /** Used to match template delimiters. */
  1837. var reEscape = /<%-([\s\S]+?)%>/g,
  1838. reEvaluate = /<%([\s\S]+?)%>/g,
  1839. reInterpolate = /<%=([\s\S]+?)%>/g;
  1840. /** Used to match property names within property paths. */
  1841. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1842. reIsPlainProp = /^\w*$/,
  1843. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1844. /**
  1845. * Used to match `RegExp`
  1846. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1847. */
  1848. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1849. reHasRegExpChar = RegExp(reRegExpChar.source);
  1850. /** Used to match leading whitespace. */
  1851. var reTrimStart = /^\s+/;
  1852. /** Used to match a single whitespace character. */
  1853. var reWhitespace = /\s/;
  1854. /** Used to match wrap detail comments. */
  1855. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1856. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1857. reSplitDetails = /,? & /;
  1858. /** Used to match words composed of alphanumeric characters. */
  1859. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1860. /**
  1861. * Used to validate the `validate` option in `_.template` variable.
  1862. *
  1863. * Forbids characters which could potentially change the meaning of the function argument definition:
  1864. * - "()," (modification of function parameters)
  1865. * - "=" (default value)
  1866. * - "[]{}" (destructuring of function parameters)
  1867. * - "/" (beginning of a comment)
  1868. * - whitespace
  1869. */
  1870. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1871. /** Used to match backslashes in property paths. */
  1872. var reEscapeChar = /\\(\\)?/g;
  1873. /**
  1874. * Used to match
  1875. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1876. */
  1877. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1878. /** Used to match `RegExp` flags from their coerced string values. */
  1879. var reFlags = /\w*$/;
  1880. /** Used to detect bad signed hexadecimal string values. */
  1881. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1882. /** Used to detect binary string values. */
  1883. var reIsBinary = /^0b[01]+$/i;
  1884. /** Used to detect host constructors (Safari). */
  1885. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1886. /** Used to detect octal string values. */
  1887. var reIsOctal = /^0o[0-7]+$/i;
  1888. /** Used to detect unsigned integer values. */
  1889. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1890. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1891. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1892. /** Used to ensure capturing order of template delimiters. */
  1893. var reNoMatch = /($^)/;
  1894. /** Used to match unescaped characters in compiled string literals. */
  1895. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1896. /** Used to compose unicode character classes. */
  1897. var rsAstralRange = '\\ud800-\\udfff',
  1898. rsComboMarksRange = '\\u0300-\\u036f',
  1899. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1900. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1901. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1902. rsDingbatRange = '\\u2700-\\u27bf',
  1903. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1904. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1905. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1906. rsPunctuationRange = '\\u2000-\\u206f',
  1907. 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',
  1908. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1909. rsVarRange = '\\ufe0e\\ufe0f',
  1910. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1911. /** Used to compose unicode capture groups. */
  1912. var rsApos = "['\u2019]",
  1913. rsAstral = '[' + rsAstralRange + ']',
  1914. rsBreak = '[' + rsBreakRange + ']',
  1915. rsCombo = '[' + rsComboRange + ']',
  1916. rsDigits = '\\d+',
  1917. rsDingbat = '[' + rsDingbatRange + ']',
  1918. rsLower = '[' + rsLowerRange + ']',
  1919. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1920. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1921. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1922. rsNonAstral = '[^' + rsAstralRange + ']',
  1923. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1924. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1925. rsUpper = '[' + rsUpperRange + ']',
  1926. rsZWJ = '\\u200d';
  1927. /** Used to compose unicode regexes. */
  1928. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1929. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1930. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1931. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1932. reOptMod = rsModifier + '?',
  1933. rsOptVar = '[' + rsVarRange + ']?',
  1934. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1935. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1936. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1937. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1938. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1939. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1940. /** Used to match apostrophes. */
  1941. var reApos = RegExp(rsApos, 'g');
  1942. /**
  1943. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1944. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1945. */
  1946. var reComboMark = RegExp(rsCombo, 'g');
  1947. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1948. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1949. /** Used to match complex or compound words. */
  1950. var reUnicodeWord = RegExp([
  1951. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1952. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1953. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1954. rsUpper + '+' + rsOptContrUpper,
  1955. rsOrdUpper,
  1956. rsOrdLower,
  1957. rsDigits,
  1958. rsEmoji
  1959. ].join('|'), 'g');
  1960. /** 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/). */
  1961. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1962. /** Used to detect strings that need a more robust regexp to match words. */
  1963. 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 ]/;
  1964. /** Used to assign default `context` object properties. */
  1965. var contextProps = [
  1966. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1967. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1968. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1969. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1970. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1971. ];
  1972. /** Used to make template sourceURLs easier to identify. */
  1973. var templateCounter = -1;
  1974. /** Used to identify `toStringTag` values of typed arrays. */
  1975. var typedArrayTags = {};
  1976. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1977. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1978. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1979. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1980. typedArrayTags[uint32Tag] = true;
  1981. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1982. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1983. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1984. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1985. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1986. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1987. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1988. typedArrayTags[weakMapTag] = false;
  1989. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1990. var cloneableTags = {};
  1991. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1992. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1993. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1994. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1995. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1996. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1997. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1998. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1999. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  2000. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  2001. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  2002. cloneableTags[errorTag] = cloneableTags[funcTag] =
  2003. cloneableTags[weakMapTag] = false;
  2004. /** Used to map Latin Unicode letters to basic Latin letters. */
  2005. var deburredLetters = {
  2006. // Latin-1 Supplement block.
  2007. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  2008. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  2009. '\xc7': 'C', '\xe7': 'c',
  2010. '\xd0': 'D', '\xf0': 'd',
  2011. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  2012. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  2013. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  2014. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  2015. '\xd1': 'N', '\xf1': 'n',
  2016. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  2017. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  2018. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  2019. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  2020. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  2021. '\xc6': 'Ae', '\xe6': 'ae',
  2022. '\xde': 'Th', '\xfe': 'th',
  2023. '\xdf': 'ss',
  2024. // Latin Extended-A block.
  2025. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  2026. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  2027. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  2028. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  2029. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  2030. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  2031. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  2032. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  2033. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  2034. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  2035. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  2036. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  2037. '\u0134': 'J', '\u0135': 'j',
  2038. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  2039. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  2040. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  2041. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  2042. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  2043. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  2044. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  2045. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  2046. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  2047. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  2048. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  2049. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  2050. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  2051. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  2052. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  2053. '\u0174': 'W', '\u0175': 'w',
  2054. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  2055. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  2056. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  2057. '\u0132': 'IJ', '\u0133': 'ij',
  2058. '\u0152': 'Oe', '\u0153': 'oe',
  2059. '\u0149': "'n", '\u017f': 's'
  2060. };
  2061. /** Used to map characters to HTML entities. */
  2062. var htmlEscapes = {
  2063. '&': '&amp;',
  2064. '<': '&lt;',
  2065. '>': '&gt;',
  2066. '"': '&quot;',
  2067. "'": '&#39;'
  2068. };
  2069. /** Used to map HTML entities to characters. */
  2070. var htmlUnescapes = {
  2071. '&amp;': '&',
  2072. '&lt;': '<',
  2073. '&gt;': '>',
  2074. '&quot;': '"',
  2075. '&#39;': "'"
  2076. };
  2077. /** Used to escape characters for inclusion in compiled string literals. */
  2078. var stringEscapes = {
  2079. '\\': '\\',
  2080. "'": "'",
  2081. '\n': 'n',
  2082. '\r': 'r',
  2083. '\u2028': 'u2028',
  2084. '\u2029': 'u2029'
  2085. };
  2086. /** Built-in method references without a dependency on `root`. */
  2087. var freeParseFloat = parseFloat,
  2088. freeParseInt = parseInt;
  2089. /** Detect free variable `global` from Node.js. */
  2090. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  2091. /** Detect free variable `self`. */
  2092. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  2093. /** Used as a reference to the global object. */
  2094. var root = freeGlobal || freeSelf || Function('return this')();
  2095. /** Detect free variable `exports`. */
  2096. var freeExports = true && exports && !exports.nodeType && exports;
  2097. /** Detect free variable `module`. */
  2098. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  2099. /** Detect the popular CommonJS extension `module.exports`. */
  2100. var moduleExports = freeModule && freeModule.exports === freeExports;
  2101. /** Detect free variable `process` from Node.js. */
  2102. var freeProcess = moduleExports && freeGlobal.process;
  2103. /** Used to access faster Node.js helpers. */
  2104. var nodeUtil = (function() {
  2105. try {
  2106. // Use `util.types` for Node.js 10+.
  2107. var types = freeModule && freeModule.require && freeModule.require('util').types;
  2108. if (types) {
  2109. return types;
  2110. }
  2111. // Legacy `process.binding('util')` for Node.js < 10.
  2112. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  2113. } catch (e) {}
  2114. }());
  2115. /* Node.js helper references. */
  2116. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  2117. nodeIsDate = nodeUtil && nodeUtil.isDate,
  2118. nodeIsMap = nodeUtil && nodeUtil.isMap,
  2119. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  2120. nodeIsSet = nodeUtil && nodeUtil.isSet,
  2121. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  2122. /*--------------------------------------------------------------------------*/
  2123. /**
  2124. * A faster alternative to `Function#apply`, this function invokes `func`
  2125. * with the `this` binding of `thisArg` and the arguments of `args`.
  2126. *
  2127. * @private
  2128. * @param {Function} func The function to invoke.
  2129. * @param {*} thisArg The `this` binding of `func`.
  2130. * @param {Array} args The arguments to invoke `func` with.
  2131. * @returns {*} Returns the result of `func`.
  2132. */
  2133. function apply(func, thisArg, args) {
  2134. switch (args.length) {
  2135. case 0: return func.call(thisArg);
  2136. case 1: return func.call(thisArg, args[0]);
  2137. case 2: return func.call(thisArg, args[0], args[1]);
  2138. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  2139. }
  2140. return func.apply(thisArg, args);
  2141. }
  2142. /**
  2143. * A specialized version of `baseAggregator` for arrays.
  2144. *
  2145. * @private
  2146. * @param {Array} [array] The array to iterate over.
  2147. * @param {Function} setter The function to set `accumulator` values.
  2148. * @param {Function} iteratee The iteratee to transform keys.
  2149. * @param {Object} accumulator The initial aggregated object.
  2150. * @returns {Function} Returns `accumulator`.
  2151. */
  2152. function arrayAggregator(array, setter, iteratee, accumulator) {
  2153. var index = -1,
  2154. length = array == null ? 0 : array.length;
  2155. while (++index < length) {
  2156. var value = array[index];
  2157. setter(accumulator, value, iteratee(value), array);
  2158. }
  2159. return accumulator;
  2160. }
  2161. /**
  2162. * A specialized version of `_.forEach` for arrays without support for
  2163. * iteratee shorthands.
  2164. *
  2165. * @private
  2166. * @param {Array} [array] The array to iterate over.
  2167. * @param {Function} iteratee The function invoked per iteration.
  2168. * @returns {Array} Returns `array`.
  2169. */
  2170. function arrayEach(array, iteratee) {
  2171. var index = -1,
  2172. length = array == null ? 0 : array.length;
  2173. while (++index < length) {
  2174. if (iteratee(array[index], index, array) === false) {
  2175. break;
  2176. }
  2177. }
  2178. return array;
  2179. }
  2180. /**
  2181. * A specialized version of `_.forEachRight` for arrays without support for
  2182. * iteratee shorthands.
  2183. *
  2184. * @private
  2185. * @param {Array} [array] The array to iterate over.
  2186. * @param {Function} iteratee The function invoked per iteration.
  2187. * @returns {Array} Returns `array`.
  2188. */
  2189. function arrayEachRight(array, iteratee) {
  2190. var length = array == null ? 0 : array.length;
  2191. while (length--) {
  2192. if (iteratee(array[length], length, array) === false) {
  2193. break;
  2194. }
  2195. }
  2196. return array;
  2197. }
  2198. /**
  2199. * A specialized version of `_.every` for arrays without support for
  2200. * iteratee shorthands.
  2201. *
  2202. * @private
  2203. * @param {Array} [array] The array to iterate over.
  2204. * @param {Function} predicate The function invoked per iteration.
  2205. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  2206. * else `false`.
  2207. */
  2208. function arrayEvery(array, predicate) {
  2209. var index = -1,
  2210. length = array == null ? 0 : array.length;
  2211. while (++index < length) {
  2212. if (!predicate(array[index], index, array)) {
  2213. return false;
  2214. }
  2215. }
  2216. return true;
  2217. }
  2218. /**
  2219. * A specialized version of `_.filter` for arrays without support for
  2220. * iteratee shorthands.
  2221. *
  2222. * @private
  2223. * @param {Array} [array] The array to iterate over.
  2224. * @param {Function} predicate The function invoked per iteration.
  2225. * @returns {Array} Returns the new filtered array.
  2226. */
  2227. function arrayFilter(array, predicate) {
  2228. var index = -1,
  2229. length = array == null ? 0 : array.length,
  2230. resIndex = 0,
  2231. result = [];
  2232. while (++index < length) {
  2233. var value = array[index];
  2234. if (predicate(value, index, array)) {
  2235. result[resIndex++] = value;
  2236. }
  2237. }
  2238. return result;
  2239. }
  2240. /**
  2241. * A specialized version of `_.includes` for arrays without support for
  2242. * specifying an index to search from.
  2243. *
  2244. * @private
  2245. * @param {Array} [array] The array to inspect.
  2246. * @param {*} target The value to search for.
  2247. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  2248. */
  2249. function arrayIncludes(array, value) {
  2250. var length = array == null ? 0 : array.length;
  2251. return !!length && baseIndexOf(array, value, 0) > -1;
  2252. }
  2253. /**
  2254. * This function is like `arrayIncludes` except that it accepts a comparator.
  2255. *
  2256. * @private
  2257. * @param {Array} [array] The array to inspect.
  2258. * @param {*} target The value to search for.
  2259. * @param {Function} comparator The comparator invoked per element.
  2260. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  2261. */
  2262. function arrayIncludesWith(array, value, comparator) {
  2263. var index = -1,
  2264. length = array == null ? 0 : array.length;
  2265. while (++index < length) {
  2266. if (comparator(value, array[index])) {
  2267. return true;
  2268. }
  2269. }
  2270. return false;
  2271. }
  2272. /**
  2273. * A specialized version of `_.map` for arrays without support for iteratee
  2274. * shorthands.
  2275. *
  2276. * @private
  2277. * @param {Array} [array] The array to iterate over.
  2278. * @param {Function} iteratee The function invoked per iteration.
  2279. * @returns {Array} Returns the new mapped array.
  2280. */
  2281. function arrayMap(array, iteratee) {
  2282. var index = -1,
  2283. length = array == null ? 0 : array.length,
  2284. result = Array(length);
  2285. while (++index < length) {
  2286. result[index] = iteratee(array[index], index, array);
  2287. }
  2288. return result;
  2289. }
  2290. /**
  2291. * Appends the elements of `values` to `array`.
  2292. *
  2293. * @private
  2294. * @param {Array} array The array to modify.
  2295. * @param {Array} values The values to append.
  2296. * @returns {Array} Returns `array`.
  2297. */
  2298. function arrayPush(array, values) {
  2299. var index = -1,
  2300. length = values.length,
  2301. offset = array.length;
  2302. while (++index < length) {
  2303. array[offset + index] = values[index];
  2304. }
  2305. return array;
  2306. }
  2307. /**
  2308. * A specialized version of `_.reduce` for arrays without support for
  2309. * iteratee shorthands.
  2310. *
  2311. * @private
  2312. * @param {Array} [array] The array to iterate over.
  2313. * @param {Function} iteratee The function invoked per iteration.
  2314. * @param {*} [accumulator] The initial value.
  2315. * @param {boolean} [initAccum] Specify using the first element of `array` as
  2316. * the initial value.
  2317. * @returns {*} Returns the accumulated value.
  2318. */
  2319. function arrayReduce(array, iteratee, accumulator, initAccum) {
  2320. var index = -1,
  2321. length = array == null ? 0 : array.length;
  2322. if (initAccum && length) {
  2323. accumulator = array[++index];
  2324. }
  2325. while (++index < length) {
  2326. accumulator = iteratee(accumulator, array[index], index, array);
  2327. }
  2328. return accumulator;
  2329. }
  2330. /**
  2331. * A specialized version of `_.reduceRight` for arrays without support for
  2332. * iteratee shorthands.
  2333. *
  2334. * @private
  2335. * @param {Array} [array] The array to iterate over.
  2336. * @param {Function} iteratee The function invoked per iteration.
  2337. * @param {*} [accumulator] The initial value.
  2338. * @param {boolean} [initAccum] Specify using the last element of `array` as
  2339. * the initial value.
  2340. * @returns {*} Returns the accumulated value.
  2341. */
  2342. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  2343. var length = array == null ? 0 : array.length;
  2344. if (initAccum && length) {
  2345. accumulator = array[--length];
  2346. }
  2347. while (length--) {
  2348. accumulator = iteratee(accumulator, array[length], length, array);
  2349. }
  2350. return accumulator;
  2351. }
  2352. /**
  2353. * A specialized version of `_.some` for arrays without support for iteratee
  2354. * shorthands.
  2355. *
  2356. * @private
  2357. * @param {Array} [array] The array to iterate over.
  2358. * @param {Function} predicate The function invoked per iteration.
  2359. * @returns {boolean} Returns `true` if any element passes the predicate check,
  2360. * else `false`.
  2361. */
  2362. function arraySome(array, predicate) {
  2363. var index = -1,
  2364. length = array == null ? 0 : array.length;
  2365. while (++index < length) {
  2366. if (predicate(array[index], index, array)) {
  2367. return true;
  2368. }
  2369. }
  2370. return false;
  2371. }
  2372. /**
  2373. * Gets the size of an ASCII `string`.
  2374. *
  2375. * @private
  2376. * @param {string} string The string inspect.
  2377. * @returns {number} Returns the string size.
  2378. */
  2379. var asciiSize = baseProperty('length');
  2380. /**
  2381. * Converts an ASCII `string` to an array.
  2382. *
  2383. * @private
  2384. * @param {string} string The string to convert.
  2385. * @returns {Array} Returns the converted array.
  2386. */
  2387. function asciiToArray(string) {
  2388. return string.split('');
  2389. }
  2390. /**
  2391. * Splits an ASCII `string` into an array of its words.
  2392. *
  2393. * @private
  2394. * @param {string} The string to inspect.
  2395. * @returns {Array} Returns the words of `string`.
  2396. */
  2397. function asciiWords(string) {
  2398. return string.match(reAsciiWord) || [];
  2399. }
  2400. /**
  2401. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  2402. * without support for iteratee shorthands, which iterates over `collection`
  2403. * using `eachFunc`.
  2404. *
  2405. * @private
  2406. * @param {Array|Object} collection The collection to inspect.
  2407. * @param {Function} predicate The function invoked per iteration.
  2408. * @param {Function} eachFunc The function to iterate over `collection`.
  2409. * @returns {*} Returns the found element or its key, else `undefined`.
  2410. */
  2411. function baseFindKey(collection, predicate, eachFunc) {
  2412. var result;
  2413. eachFunc(collection, function(value, key, collection) {
  2414. if (predicate(value, key, collection)) {
  2415. result = key;
  2416. return false;
  2417. }
  2418. });
  2419. return result;
  2420. }
  2421. /**
  2422. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  2423. * support for iteratee shorthands.
  2424. *
  2425. * @private
  2426. * @param {Array} array The array to inspect.
  2427. * @param {Function} predicate The function invoked per iteration.
  2428. * @param {number} fromIndex The index to search from.
  2429. * @param {boolean} [fromRight] Specify iterating from right to left.
  2430. * @returns {number} Returns the index of the matched value, else `-1`.
  2431. */
  2432. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  2433. var length = array.length,
  2434. index = fromIndex + (fromRight ? 1 : -1);
  2435. while ((fromRight ? index-- : ++index < length)) {
  2436. if (predicate(array[index], index, array)) {
  2437. return index;
  2438. }
  2439. }
  2440. return -1;
  2441. }
  2442. /**
  2443. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  2444. *
  2445. * @private
  2446. * @param {Array} array The array to inspect.
  2447. * @param {*} value The value to search for.
  2448. * @param {number} fromIndex The index to search from.
  2449. * @returns {number} Returns the index of the matched value, else `-1`.
  2450. */
  2451. function baseIndexOf(array, value, fromIndex) {
  2452. return value === value
  2453. ? strictIndexOf(array, value, fromIndex)
  2454. : baseFindIndex(array, baseIsNaN, fromIndex);
  2455. }
  2456. /**
  2457. * This function is like `baseIndexOf` except that it accepts a comparator.
  2458. *
  2459. * @private
  2460. * @param {Array} array The array to inspect.
  2461. * @param {*} value The value to search for.
  2462. * @param {number} fromIndex The index to search from.
  2463. * @param {Function} comparator The comparator invoked per element.
  2464. * @returns {number} Returns the index of the matched value, else `-1`.
  2465. */
  2466. function baseIndexOfWith(array, value, fromIndex, comparator) {
  2467. var index = fromIndex - 1,
  2468. length = array.length;
  2469. while (++index < length) {
  2470. if (comparator(array[index], value)) {
  2471. return index;
  2472. }
  2473. }
  2474. return -1;
  2475. }
  2476. /**
  2477. * The base implementation of `_.isNaN` without support for number objects.
  2478. *
  2479. * @private
  2480. * @param {*} value The value to check.
  2481. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  2482. */
  2483. function baseIsNaN(value) {
  2484. return value !== value;
  2485. }
  2486. /**
  2487. * The base implementation of `_.mean` and `_.meanBy` without support for
  2488. * iteratee shorthands.
  2489. *
  2490. * @private
  2491. * @param {Array} array The array to iterate over.
  2492. * @param {Function} iteratee The function invoked per iteration.
  2493. * @returns {number} Returns the mean.
  2494. */
  2495. function baseMean(array, iteratee) {
  2496. var length = array == null ? 0 : array.length;
  2497. return length ? (baseSum(array, iteratee) / length) : NAN;
  2498. }
  2499. /**
  2500. * The base implementation of `_.property` without support for deep paths.
  2501. *
  2502. * @private
  2503. * @param {string} key The key of the property to get.
  2504. * @returns {Function} Returns the new accessor function.
  2505. */
  2506. function baseProperty(key) {
  2507. return function(object) {
  2508. return object == null ? undefined : object[key];
  2509. };
  2510. }
  2511. /**
  2512. * The base implementation of `_.propertyOf` without support for deep paths.
  2513. *
  2514. * @private
  2515. * @param {Object} object The object to query.
  2516. * @returns {Function} Returns the new accessor function.
  2517. */
  2518. function basePropertyOf(object) {
  2519. return function(key) {
  2520. return object == null ? undefined : object[key];
  2521. };
  2522. }
  2523. /**
  2524. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2525. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2526. *
  2527. * @private
  2528. * @param {Array|Object} collection The collection to iterate over.
  2529. * @param {Function} iteratee The function invoked per iteration.
  2530. * @param {*} accumulator The initial value.
  2531. * @param {boolean} initAccum Specify using the first or last element of
  2532. * `collection` as the initial value.
  2533. * @param {Function} eachFunc The function to iterate over `collection`.
  2534. * @returns {*} Returns the accumulated value.
  2535. */
  2536. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2537. eachFunc(collection, function(value, index, collection) {
  2538. accumulator = initAccum
  2539. ? (initAccum = false, value)
  2540. : iteratee(accumulator, value, index, collection);
  2541. });
  2542. return accumulator;
  2543. }
  2544. /**
  2545. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2546. * sort order of `array` and replaces criteria objects with their corresponding
  2547. * values.
  2548. *
  2549. * @private
  2550. * @param {Array} array The array to sort.
  2551. * @param {Function} comparer The function to define sort order.
  2552. * @returns {Array} Returns `array`.
  2553. */
  2554. function baseSortBy(array, comparer) {
  2555. var length = array.length;
  2556. array.sort(comparer);
  2557. while (length--) {
  2558. array[length] = array[length].value;
  2559. }
  2560. return array;
  2561. }
  2562. /**
  2563. * The base implementation of `_.sum` and `_.sumBy` without support for
  2564. * iteratee shorthands.
  2565. *
  2566. * @private
  2567. * @param {Array} array The array to iterate over.
  2568. * @param {Function} iteratee The function invoked per iteration.
  2569. * @returns {number} Returns the sum.
  2570. */
  2571. function baseSum(array, iteratee) {
  2572. var result,
  2573. index = -1,
  2574. length = array.length;
  2575. while (++index < length) {
  2576. var current = iteratee(array[index]);
  2577. if (current !== undefined) {
  2578. result = result === undefined ? current : (result + current);
  2579. }
  2580. }
  2581. return result;
  2582. }
  2583. /**
  2584. * The base implementation of `_.times` without support for iteratee shorthands
  2585. * or max array length checks.
  2586. *
  2587. * @private
  2588. * @param {number} n The number of times to invoke `iteratee`.
  2589. * @param {Function} iteratee The function invoked per iteration.
  2590. * @returns {Array} Returns the array of results.
  2591. */
  2592. function baseTimes(n, iteratee) {
  2593. var index = -1,
  2594. result = Array(n);
  2595. while (++index < n) {
  2596. result[index] = iteratee(index);
  2597. }
  2598. return result;
  2599. }
  2600. /**
  2601. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2602. * of key-value pairs for `object` corresponding to the property names of `props`.
  2603. *
  2604. * @private
  2605. * @param {Object} object The object to query.
  2606. * @param {Array} props The property names to get values for.
  2607. * @returns {Object} Returns the key-value pairs.
  2608. */
  2609. function baseToPairs(object, props) {
  2610. return arrayMap(props, function(key) {
  2611. return [key, object[key]];
  2612. });
  2613. }
  2614. /**
  2615. * The base implementation of `_.trim`.
  2616. *
  2617. * @private
  2618. * @param {string} string The string to trim.
  2619. * @returns {string} Returns the trimmed string.
  2620. */
  2621. function baseTrim(string) {
  2622. return string
  2623. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2624. : string;
  2625. }
  2626. /**
  2627. * The base implementation of `_.unary` without support for storing metadata.
  2628. *
  2629. * @private
  2630. * @param {Function} func The function to cap arguments for.
  2631. * @returns {Function} Returns the new capped function.
  2632. */
  2633. function baseUnary(func) {
  2634. return function(value) {
  2635. return func(value);
  2636. };
  2637. }
  2638. /**
  2639. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2640. * array of `object` property values corresponding to the property names
  2641. * of `props`.
  2642. *
  2643. * @private
  2644. * @param {Object} object The object to query.
  2645. * @param {Array} props The property names to get values for.
  2646. * @returns {Object} Returns the array of property values.
  2647. */
  2648. function baseValues(object, props) {
  2649. return arrayMap(props, function(key) {
  2650. return object[key];
  2651. });
  2652. }
  2653. /**
  2654. * Checks if a `cache` value for `key` exists.
  2655. *
  2656. * @private
  2657. * @param {Object} cache The cache to query.
  2658. * @param {string} key The key of the entry to check.
  2659. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2660. */
  2661. function cacheHas(cache, key) {
  2662. return cache.has(key);
  2663. }
  2664. /**
  2665. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2666. * that is not found in the character symbols.
  2667. *
  2668. * @private
  2669. * @param {Array} strSymbols The string symbols to inspect.
  2670. * @param {Array} chrSymbols The character symbols to find.
  2671. * @returns {number} Returns the index of the first unmatched string symbol.
  2672. */
  2673. function charsStartIndex(strSymbols, chrSymbols) {
  2674. var index = -1,
  2675. length = strSymbols.length;
  2676. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2677. return index;
  2678. }
  2679. /**
  2680. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2681. * that is not found in the character symbols.
  2682. *
  2683. * @private
  2684. * @param {Array} strSymbols The string symbols to inspect.
  2685. * @param {Array} chrSymbols The character symbols to find.
  2686. * @returns {number} Returns the index of the last unmatched string symbol.
  2687. */
  2688. function charsEndIndex(strSymbols, chrSymbols) {
  2689. var index = strSymbols.length;
  2690. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2691. return index;
  2692. }
  2693. /**
  2694. * Gets the number of `placeholder` occurrences in `array`.
  2695. *
  2696. * @private
  2697. * @param {Array} array The array to inspect.
  2698. * @param {*} placeholder The placeholder to search for.
  2699. * @returns {number} Returns the placeholder count.
  2700. */
  2701. function countHolders(array, placeholder) {
  2702. var length = array.length,
  2703. result = 0;
  2704. while (length--) {
  2705. if (array[length] === placeholder) {
  2706. ++result;
  2707. }
  2708. }
  2709. return result;
  2710. }
  2711. /**
  2712. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2713. * letters to basic Latin letters.
  2714. *
  2715. * @private
  2716. * @param {string} letter The matched letter to deburr.
  2717. * @returns {string} Returns the deburred letter.
  2718. */
  2719. var deburrLetter = basePropertyOf(deburredLetters);
  2720. /**
  2721. * Used by `_.escape` to convert characters to HTML entities.
  2722. *
  2723. * @private
  2724. * @param {string} chr The matched character to escape.
  2725. * @returns {string} Returns the escaped character.
  2726. */
  2727. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2728. /**
  2729. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2730. *
  2731. * @private
  2732. * @param {string} chr The matched character to escape.
  2733. * @returns {string} Returns the escaped character.
  2734. */
  2735. function escapeStringChar(chr) {
  2736. return '\\' + stringEscapes[chr];
  2737. }
  2738. /**
  2739. * Gets the value at `key` of `object`.
  2740. *
  2741. * @private
  2742. * @param {Object} [object] The object to query.
  2743. * @param {string} key The key of the property to get.
  2744. * @returns {*} Returns the property value.
  2745. */
  2746. function getValue(object, key) {
  2747. return object == null ? undefined : object[key];
  2748. }
  2749. /**
  2750. * Checks if `string` contains Unicode symbols.
  2751. *
  2752. * @private
  2753. * @param {string} string The string to inspect.
  2754. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2755. */
  2756. function hasUnicode(string) {
  2757. return reHasUnicode.test(string);
  2758. }
  2759. /**
  2760. * Checks if `string` contains a word composed of Unicode symbols.
  2761. *
  2762. * @private
  2763. * @param {string} string The string to inspect.
  2764. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2765. */
  2766. function hasUnicodeWord(string) {
  2767. return reHasUnicodeWord.test(string);
  2768. }
  2769. /**
  2770. * Converts `iterator` to an array.
  2771. *
  2772. * @private
  2773. * @param {Object} iterator The iterator to convert.
  2774. * @returns {Array} Returns the converted array.
  2775. */
  2776. function iteratorToArray(iterator) {
  2777. var data,
  2778. result = [];
  2779. while (!(data = iterator.next()).done) {
  2780. result.push(data.value);
  2781. }
  2782. return result;
  2783. }
  2784. /**
  2785. * Converts `map` to its key-value pairs.
  2786. *
  2787. * @private
  2788. * @param {Object} map The map to convert.
  2789. * @returns {Array} Returns the key-value pairs.
  2790. */
  2791. function mapToArray(map) {
  2792. var index = -1,
  2793. result = Array(map.size);
  2794. map.forEach(function(value, key) {
  2795. result[++index] = [key, value];
  2796. });
  2797. return result;
  2798. }
  2799. /**
  2800. * Creates a unary function that invokes `func` with its argument transformed.
  2801. *
  2802. * @private
  2803. * @param {Function} func The function to wrap.
  2804. * @param {Function} transform The argument transform.
  2805. * @returns {Function} Returns the new function.
  2806. */
  2807. function overArg(func, transform) {
  2808. return function(arg) {
  2809. return func(transform(arg));
  2810. };
  2811. }
  2812. /**
  2813. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2814. * and returns an array of their indexes.
  2815. *
  2816. * @private
  2817. * @param {Array} array The array to modify.
  2818. * @param {*} placeholder The placeholder to replace.
  2819. * @returns {Array} Returns the new array of placeholder indexes.
  2820. */
  2821. function replaceHolders(array, placeholder) {
  2822. var index = -1,
  2823. length = array.length,
  2824. resIndex = 0,
  2825. result = [];
  2826. while (++index < length) {
  2827. var value = array[index];
  2828. if (value === placeholder || value === PLACEHOLDER) {
  2829. array[index] = PLACEHOLDER;
  2830. result[resIndex++] = index;
  2831. }
  2832. }
  2833. return result;
  2834. }
  2835. /**
  2836. * Converts `set` to an array of its values.
  2837. *
  2838. * @private
  2839. * @param {Object} set The set to convert.
  2840. * @returns {Array} Returns the values.
  2841. */
  2842. function setToArray(set) {
  2843. var index = -1,
  2844. result = Array(set.size);
  2845. set.forEach(function(value) {
  2846. result[++index] = value;
  2847. });
  2848. return result;
  2849. }
  2850. /**
  2851. * Converts `set` to its value-value pairs.
  2852. *
  2853. * @private
  2854. * @param {Object} set The set to convert.
  2855. * @returns {Array} Returns the value-value pairs.
  2856. */
  2857. function setToPairs(set) {
  2858. var index = -1,
  2859. result = Array(set.size);
  2860. set.forEach(function(value) {
  2861. result[++index] = [value, value];
  2862. });
  2863. return result;
  2864. }
  2865. /**
  2866. * A specialized version of `_.indexOf` which performs strict equality
  2867. * comparisons of values, i.e. `===`.
  2868. *
  2869. * @private
  2870. * @param {Array} array The array to inspect.
  2871. * @param {*} value The value to search for.
  2872. * @param {number} fromIndex The index to search from.
  2873. * @returns {number} Returns the index of the matched value, else `-1`.
  2874. */
  2875. function strictIndexOf(array, value, fromIndex) {
  2876. var index = fromIndex - 1,
  2877. length = array.length;
  2878. while (++index < length) {
  2879. if (array[index] === value) {
  2880. return index;
  2881. }
  2882. }
  2883. return -1;
  2884. }
  2885. /**
  2886. * A specialized version of `_.lastIndexOf` which performs strict equality
  2887. * comparisons of values, i.e. `===`.
  2888. *
  2889. * @private
  2890. * @param {Array} array The array to inspect.
  2891. * @param {*} value The value to search for.
  2892. * @param {number} fromIndex The index to search from.
  2893. * @returns {number} Returns the index of the matched value, else `-1`.
  2894. */
  2895. function strictLastIndexOf(array, value, fromIndex) {
  2896. var index = fromIndex + 1;
  2897. while (index--) {
  2898. if (array[index] === value) {
  2899. return index;
  2900. }
  2901. }
  2902. return index;
  2903. }
  2904. /**
  2905. * Gets the number of symbols in `string`.
  2906. *
  2907. * @private
  2908. * @param {string} string The string to inspect.
  2909. * @returns {number} Returns the string size.
  2910. */
  2911. function stringSize(string) {
  2912. return hasUnicode(string)
  2913. ? unicodeSize(string)
  2914. : asciiSize(string);
  2915. }
  2916. /**
  2917. * Converts `string` to an array.
  2918. *
  2919. * @private
  2920. * @param {string} string The string to convert.
  2921. * @returns {Array} Returns the converted array.
  2922. */
  2923. function stringToArray(string) {
  2924. return hasUnicode(string)
  2925. ? unicodeToArray(string)
  2926. : asciiToArray(string);
  2927. }
  2928. /**
  2929. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2930. * character of `string`.
  2931. *
  2932. * @private
  2933. * @param {string} string The string to inspect.
  2934. * @returns {number} Returns the index of the last non-whitespace character.
  2935. */
  2936. function trimmedEndIndex(string) {
  2937. var index = string.length;
  2938. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2939. return index;
  2940. }
  2941. /**
  2942. * Used by `_.unescape` to convert HTML entities to characters.
  2943. *
  2944. * @private
  2945. * @param {string} chr The matched character to unescape.
  2946. * @returns {string} Returns the unescaped character.
  2947. */
  2948. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2949. /**
  2950. * Gets the size of a Unicode `string`.
  2951. *
  2952. * @private
  2953. * @param {string} string The string inspect.
  2954. * @returns {number} Returns the string size.
  2955. */
  2956. function unicodeSize(string) {
  2957. var result = reUnicode.lastIndex = 0;
  2958. while (reUnicode.test(string)) {
  2959. ++result;
  2960. }
  2961. return result;
  2962. }
  2963. /**
  2964. * Converts a Unicode `string` to an array.
  2965. *
  2966. * @private
  2967. * @param {string} string The string to convert.
  2968. * @returns {Array} Returns the converted array.
  2969. */
  2970. function unicodeToArray(string) {
  2971. return string.match(reUnicode) || [];
  2972. }
  2973. /**
  2974. * Splits a Unicode `string` into an array of its words.
  2975. *
  2976. * @private
  2977. * @param {string} The string to inspect.
  2978. * @returns {Array} Returns the words of `string`.
  2979. */
  2980. function unicodeWords(string) {
  2981. return string.match(reUnicodeWord) || [];
  2982. }
  2983. /*--------------------------------------------------------------------------*/
  2984. /**
  2985. * Create a new pristine `lodash` function using the `context` object.
  2986. *
  2987. * @static
  2988. * @memberOf _
  2989. * @since 1.1.0
  2990. * @category Util
  2991. * @param {Object} [context=root] The context object.
  2992. * @returns {Function} Returns a new `lodash` function.
  2993. * @example
  2994. *
  2995. * _.mixin({ 'foo': _.constant('foo') });
  2996. *
  2997. * var lodash = _.runInContext();
  2998. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2999. *
  3000. * _.isFunction(_.foo);
  3001. * // => true
  3002. * _.isFunction(_.bar);
  3003. * // => false
  3004. *
  3005. * lodash.isFunction(lodash.foo);
  3006. * // => false
  3007. * lodash.isFunction(lodash.bar);
  3008. * // => true
  3009. *
  3010. * // Create a suped-up `defer` in Node.js.
  3011. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  3012. */
  3013. var runInContext = (function runInContext(context) {
  3014. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  3015. /** Built-in constructor references. */
  3016. var Array = context.Array,
  3017. Date = context.Date,
  3018. Error = context.Error,
  3019. Function = context.Function,
  3020. Math = context.Math,
  3021. Object = context.Object,
  3022. RegExp = context.RegExp,
  3023. String = context.String,
  3024. TypeError = context.TypeError;
  3025. /** Used for built-in method references. */
  3026. var arrayProto = Array.prototype,
  3027. funcProto = Function.prototype,
  3028. objectProto = Object.prototype;
  3029. /** Used to detect overreaching core-js shims. */
  3030. var coreJsData = context['__core-js_shared__'];
  3031. /** Used to resolve the decompiled source of functions. */
  3032. var funcToString = funcProto.toString;
  3033. /** Used to check objects for own properties. */
  3034. var hasOwnProperty = objectProto.hasOwnProperty;
  3035. /** Used to generate unique IDs. */
  3036. var idCounter = 0;
  3037. /** Used to detect methods masquerading as native. */
  3038. var maskSrcKey = (function() {
  3039. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  3040. return uid ? ('Symbol(src)_1.' + uid) : '';
  3041. }());
  3042. /**
  3043. * Used to resolve the
  3044. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  3045. * of values.
  3046. */
  3047. var nativeObjectToString = objectProto.toString;
  3048. /** Used to infer the `Object` constructor. */
  3049. var objectCtorString = funcToString.call(Object);
  3050. /** Used to restore the original `_` reference in `_.noConflict`. */
  3051. var oldDash = root._;
  3052. /** Used to detect if a method is native. */
  3053. var reIsNative = RegExp('^' +
  3054. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  3055. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  3056. );
  3057. /** Built-in value references. */
  3058. var Buffer = moduleExports ? context.Buffer : undefined,
  3059. Symbol = context.Symbol,
  3060. Uint8Array = context.Uint8Array,
  3061. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  3062. getPrototype = overArg(Object.getPrototypeOf, Object),
  3063. objectCreate = Object.create,
  3064. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  3065. splice = arrayProto.splice,
  3066. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  3067. symIterator = Symbol ? Symbol.iterator : undefined,
  3068. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  3069. var defineProperty = (function() {
  3070. try {
  3071. var func = getNative(Object, 'defineProperty');
  3072. func({}, '', {});
  3073. return func;
  3074. } catch (e) {}
  3075. }());
  3076. /** Mocked built-ins. */
  3077. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  3078. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  3079. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  3080. /* Built-in method references for those with the same name as other `lodash` methods. */
  3081. var nativeCeil = Math.ceil,
  3082. nativeFloor = Math.floor,
  3083. nativeGetSymbols = Object.getOwnPropertySymbols,
  3084. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  3085. nativeIsFinite = context.isFinite,
  3086. nativeJoin = arrayProto.join,
  3087. nativeKeys = overArg(Object.keys, Object),
  3088. nativeMax = Math.max,
  3089. nativeMin = Math.min,
  3090. nativeNow = Date.now,
  3091. nativeParseInt = context.parseInt,
  3092. nativeRandom = Math.random,
  3093. nativeReverse = arrayProto.reverse;
  3094. /* Built-in method references that are verified to be native. */
  3095. var DataView = getNative(context, 'DataView'),
  3096. Map = getNative(context, 'Map'),
  3097. Promise = getNative(context, 'Promise'),
  3098. Set = getNative(context, 'Set'),
  3099. WeakMap = getNative(context, 'WeakMap'),
  3100. nativeCreate = getNative(Object, 'create');
  3101. /** Used to store function metadata. */
  3102. var metaMap = WeakMap && new WeakMap;
  3103. /** Used to lookup unminified function names. */
  3104. var realNames = {};
  3105. /** Used to detect maps, sets, and weakmaps. */
  3106. var dataViewCtorString = toSource(DataView),
  3107. mapCtorString = toSource(Map),
  3108. promiseCtorString = toSource(Promise),
  3109. setCtorString = toSource(Set),
  3110. weakMapCtorString = toSource(WeakMap);
  3111. /** Used to convert symbols to primitives and strings. */
  3112. var symbolProto = Symbol ? Symbol.prototype : undefined,
  3113. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  3114. symbolToString = symbolProto ? symbolProto.toString : undefined;
  3115. /*------------------------------------------------------------------------*/
  3116. /**
  3117. * Creates a `lodash` object which wraps `value` to enable implicit method
  3118. * chain sequences. Methods that operate on and return arrays, collections,
  3119. * and functions can be chained together. Methods that retrieve a single value
  3120. * or may return a primitive value will automatically end the chain sequence
  3121. * and return the unwrapped value. Otherwise, the value must be unwrapped
  3122. * with `_#value`.
  3123. *
  3124. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  3125. * enabled using `_.chain`.
  3126. *
  3127. * The execution of chained methods is lazy, that is, it's deferred until
  3128. * `_#value` is implicitly or explicitly called.
  3129. *
  3130. * Lazy evaluation allows several methods to support shortcut fusion.
  3131. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  3132. * the creation of intermediate arrays and can greatly reduce the number of
  3133. * iteratee executions. Sections of a chain sequence qualify for shortcut
  3134. * fusion if the section is applied to an array and iteratees accept only
  3135. * one argument. The heuristic for whether a section qualifies for shortcut
  3136. * fusion is subject to change.
  3137. *
  3138. * Chaining is supported in custom builds as long as the `_#value` method is
  3139. * directly or indirectly included in the build.
  3140. *
  3141. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  3142. *
  3143. * The wrapper `Array` methods are:
  3144. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  3145. *
  3146. * The wrapper `String` methods are:
  3147. * `replace` and `split`
  3148. *
  3149. * The wrapper methods that support shortcut fusion are:
  3150. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  3151. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  3152. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  3153. *
  3154. * The chainable wrapper methods are:
  3155. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  3156. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  3157. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  3158. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  3159. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  3160. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  3161. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  3162. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  3163. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  3164. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  3165. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  3166. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  3167. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  3168. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  3169. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  3170. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  3171. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  3172. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  3173. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  3174. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  3175. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  3176. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  3177. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  3178. * `zipObject`, `zipObjectDeep`, and `zipWith`
  3179. *
  3180. * The wrapper methods that are **not** chainable by default are:
  3181. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  3182. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  3183. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  3184. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  3185. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  3186. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  3187. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  3188. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  3189. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  3190. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  3191. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  3192. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  3193. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  3194. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  3195. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  3196. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  3197. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  3198. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  3199. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  3200. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  3201. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  3202. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  3203. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  3204. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  3205. * `upperFirst`, `value`, and `words`
  3206. *
  3207. * @name _
  3208. * @constructor
  3209. * @category Seq
  3210. * @param {*} value The value to wrap in a `lodash` instance.
  3211. * @returns {Object} Returns the new `lodash` wrapper instance.
  3212. * @example
  3213. *
  3214. * function square(n) {
  3215. * return n * n;
  3216. * }
  3217. *
  3218. * var wrapped = _([1, 2, 3]);
  3219. *
  3220. * // Returns an unwrapped value.
  3221. * wrapped.reduce(_.add);
  3222. * // => 6
  3223. *
  3224. * // Returns a wrapped value.
  3225. * var squares = wrapped.map(square);
  3226. *
  3227. * _.isArray(squares);
  3228. * // => false
  3229. *
  3230. * _.isArray(squares.value());
  3231. * // => true
  3232. */
  3233. function lodash(value) {
  3234. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  3235. if (value instanceof LodashWrapper) {
  3236. return value;
  3237. }
  3238. if (hasOwnProperty.call(value, '__wrapped__')) {
  3239. return wrapperClone(value);
  3240. }
  3241. }
  3242. return new LodashWrapper(value);
  3243. }
  3244. /**
  3245. * The base implementation of `_.create` without support for assigning
  3246. * properties to the created object.
  3247. *
  3248. * @private
  3249. * @param {Object} proto The object to inherit from.
  3250. * @returns {Object} Returns the new object.
  3251. */
  3252. var baseCreate = (function() {
  3253. function object() {}
  3254. return function(proto) {
  3255. if (!isObject(proto)) {
  3256. return {};
  3257. }
  3258. if (objectCreate) {
  3259. return objectCreate(proto);
  3260. }
  3261. object.prototype = proto;
  3262. var result = new object;
  3263. object.prototype = undefined;
  3264. return result;
  3265. };
  3266. }());
  3267. /**
  3268. * The function whose prototype chain sequence wrappers inherit from.
  3269. *
  3270. * @private
  3271. */
  3272. function baseLodash() {
  3273. // No operation performed.
  3274. }
  3275. /**
  3276. * The base constructor for creating `lodash` wrapper objects.
  3277. *
  3278. * @private
  3279. * @param {*} value The value to wrap.
  3280. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  3281. */
  3282. function LodashWrapper(value, chainAll) {
  3283. this.__wrapped__ = value;
  3284. this.__actions__ = [];
  3285. this.__chain__ = !!chainAll;
  3286. this.__index__ = 0;
  3287. this.__values__ = undefined;
  3288. }
  3289. /**
  3290. * By default, the template delimiters used by lodash are like those in
  3291. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  3292. * following template settings to use alternative delimiters.
  3293. *
  3294. * @static
  3295. * @memberOf _
  3296. * @type {Object}
  3297. */
  3298. lodash.templateSettings = {
  3299. /**
  3300. * Used to detect `data` property values to be HTML-escaped.
  3301. *
  3302. * @memberOf _.templateSettings
  3303. * @type {RegExp}
  3304. */
  3305. 'escape': reEscape,
  3306. /**
  3307. * Used to detect code to be evaluated.
  3308. *
  3309. * @memberOf _.templateSettings
  3310. * @type {RegExp}
  3311. */
  3312. 'evaluate': reEvaluate,
  3313. /**
  3314. * Used to detect `data` property values to inject.
  3315. *
  3316. * @memberOf _.templateSettings
  3317. * @type {RegExp}
  3318. */
  3319. 'interpolate': reInterpolate,
  3320. /**
  3321. * Used to reference the data object in the template text.
  3322. *
  3323. * @memberOf _.templateSettings
  3324. * @type {string}
  3325. */
  3326. 'variable': '',
  3327. /**
  3328. * Used to import variables into the compiled template.
  3329. *
  3330. * @memberOf _.templateSettings
  3331. * @type {Object}
  3332. */
  3333. 'imports': {
  3334. /**
  3335. * A reference to the `lodash` function.
  3336. *
  3337. * @memberOf _.templateSettings.imports
  3338. * @type {Function}
  3339. */
  3340. '_': lodash
  3341. }
  3342. };
  3343. // Ensure wrappers are instances of `baseLodash`.
  3344. lodash.prototype = baseLodash.prototype;
  3345. lodash.prototype.constructor = lodash;
  3346. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  3347. LodashWrapper.prototype.constructor = LodashWrapper;
  3348. /*------------------------------------------------------------------------*/
  3349. /**
  3350. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  3351. *
  3352. * @private
  3353. * @constructor
  3354. * @param {*} value The value to wrap.
  3355. */
  3356. function LazyWrapper(value) {
  3357. this.__wrapped__ = value;
  3358. this.__actions__ = [];
  3359. this.__dir__ = 1;
  3360. this.__filtered__ = false;
  3361. this.__iteratees__ = [];
  3362. this.__takeCount__ = MAX_ARRAY_LENGTH;
  3363. this.__views__ = [];
  3364. }
  3365. /**
  3366. * Creates a clone of the lazy wrapper object.
  3367. *
  3368. * @private
  3369. * @name clone
  3370. * @memberOf LazyWrapper
  3371. * @returns {Object} Returns the cloned `LazyWrapper` object.
  3372. */
  3373. function lazyClone() {
  3374. var result = new LazyWrapper(this.__wrapped__);
  3375. result.__actions__ = copyArray(this.__actions__);
  3376. result.__dir__ = this.__dir__;
  3377. result.__filtered__ = this.__filtered__;
  3378. result.__iteratees__ = copyArray(this.__iteratees__);
  3379. result.__takeCount__ = this.__takeCount__;
  3380. result.__views__ = copyArray(this.__views__);
  3381. return result;
  3382. }
  3383. /**
  3384. * Reverses the direction of lazy iteration.
  3385. *
  3386. * @private
  3387. * @name reverse
  3388. * @memberOf LazyWrapper
  3389. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  3390. */
  3391. function lazyReverse() {
  3392. if (this.__filtered__) {
  3393. var result = new LazyWrapper(this);
  3394. result.__dir__ = -1;
  3395. result.__filtered__ = true;
  3396. } else {
  3397. result = this.clone();
  3398. result.__dir__ *= -1;
  3399. }
  3400. return result;
  3401. }
  3402. /**
  3403. * Extracts the unwrapped value from its lazy wrapper.
  3404. *
  3405. * @private
  3406. * @name value
  3407. * @memberOf LazyWrapper
  3408. * @returns {*} Returns the unwrapped value.
  3409. */
  3410. function lazyValue() {
  3411. var array = this.__wrapped__.value(),
  3412. dir = this.__dir__,
  3413. isArr = isArray(array),
  3414. isRight = dir < 0,
  3415. arrLength = isArr ? array.length : 0,
  3416. view = getView(0, arrLength, this.__views__),
  3417. start = view.start,
  3418. end = view.end,
  3419. length = end - start,
  3420. index = isRight ? end : (start - 1),
  3421. iteratees = this.__iteratees__,
  3422. iterLength = iteratees.length,
  3423. resIndex = 0,
  3424. takeCount = nativeMin(length, this.__takeCount__);
  3425. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  3426. return baseWrapperValue(array, this.__actions__);
  3427. }
  3428. var result = [];
  3429. outer:
  3430. while (length-- && resIndex < takeCount) {
  3431. index += dir;
  3432. var iterIndex = -1,
  3433. value = array[index];
  3434. while (++iterIndex < iterLength) {
  3435. var data = iteratees[iterIndex],
  3436. iteratee = data.iteratee,
  3437. type = data.type,
  3438. computed = iteratee(value);
  3439. if (type == LAZY_MAP_FLAG) {
  3440. value = computed;
  3441. } else if (!computed) {
  3442. if (type == LAZY_FILTER_FLAG) {
  3443. continue outer;
  3444. } else {
  3445. break outer;
  3446. }
  3447. }
  3448. }
  3449. result[resIndex++] = value;
  3450. }
  3451. return result;
  3452. }
  3453. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  3454. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  3455. LazyWrapper.prototype.constructor = LazyWrapper;
  3456. /*------------------------------------------------------------------------*/
  3457. /**
  3458. * Creates a hash object.
  3459. *
  3460. * @private
  3461. * @constructor
  3462. * @param {Array} [entries] The key-value pairs to cache.
  3463. */
  3464. function Hash(entries) {
  3465. var index = -1,
  3466. length = entries == null ? 0 : entries.length;
  3467. this.clear();
  3468. while (++index < length) {
  3469. var entry = entries[index];
  3470. this.set(entry[0], entry[1]);
  3471. }
  3472. }
  3473. /**
  3474. * Removes all key-value entries from the hash.
  3475. *
  3476. * @private
  3477. * @name clear
  3478. * @memberOf Hash
  3479. */
  3480. function hashClear() {
  3481. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3482. this.size = 0;
  3483. }
  3484. /**
  3485. * Removes `key` and its value from the hash.
  3486. *
  3487. * @private
  3488. * @name delete
  3489. * @memberOf Hash
  3490. * @param {Object} hash The hash to modify.
  3491. * @param {string} key The key of the value to remove.
  3492. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3493. */
  3494. function hashDelete(key) {
  3495. var result = this.has(key) && delete this.__data__[key];
  3496. this.size -= result ? 1 : 0;
  3497. return result;
  3498. }
  3499. /**
  3500. * Gets the hash value for `key`.
  3501. *
  3502. * @private
  3503. * @name get
  3504. * @memberOf Hash
  3505. * @param {string} key The key of the value to get.
  3506. * @returns {*} Returns the entry value.
  3507. */
  3508. function hashGet(key) {
  3509. var data = this.__data__;
  3510. if (nativeCreate) {
  3511. var result = data[key];
  3512. return result === HASH_UNDEFINED ? undefined : result;
  3513. }
  3514. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3515. }
  3516. /**
  3517. * Checks if a hash value for `key` exists.
  3518. *
  3519. * @private
  3520. * @name has
  3521. * @memberOf Hash
  3522. * @param {string} key The key of the entry to check.
  3523. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3524. */
  3525. function hashHas(key) {
  3526. var data = this.__data__;
  3527. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3528. }
  3529. /**
  3530. * Sets the hash `key` to `value`.
  3531. *
  3532. * @private
  3533. * @name set
  3534. * @memberOf Hash
  3535. * @param {string} key The key of the value to set.
  3536. * @param {*} value The value to set.
  3537. * @returns {Object} Returns the hash instance.
  3538. */
  3539. function hashSet(key, value) {
  3540. var data = this.__data__;
  3541. this.size += this.has(key) ? 0 : 1;
  3542. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3543. return this;
  3544. }
  3545. // Add methods to `Hash`.
  3546. Hash.prototype.clear = hashClear;
  3547. Hash.prototype['delete'] = hashDelete;
  3548. Hash.prototype.get = hashGet;
  3549. Hash.prototype.has = hashHas;
  3550. Hash.prototype.set = hashSet;
  3551. /*------------------------------------------------------------------------*/
  3552. /**
  3553. * Creates an list cache object.
  3554. *
  3555. * @private
  3556. * @constructor
  3557. * @param {Array} [entries] The key-value pairs to cache.
  3558. */
  3559. function ListCache(entries) {
  3560. var index = -1,
  3561. length = entries == null ? 0 : entries.length;
  3562. this.clear();
  3563. while (++index < length) {
  3564. var entry = entries[index];
  3565. this.set(entry[0], entry[1]);
  3566. }
  3567. }
  3568. /**
  3569. * Removes all key-value entries from the list cache.
  3570. *
  3571. * @private
  3572. * @name clear
  3573. * @memberOf ListCache
  3574. */
  3575. function listCacheClear() {
  3576. this.__data__ = [];
  3577. this.size = 0;
  3578. }
  3579. /**
  3580. * Removes `key` and its value from the list cache.
  3581. *
  3582. * @private
  3583. * @name delete
  3584. * @memberOf ListCache
  3585. * @param {string} key The key of the value to remove.
  3586. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3587. */
  3588. function listCacheDelete(key) {
  3589. var data = this.__data__,
  3590. index = assocIndexOf(data, key);
  3591. if (index < 0) {
  3592. return false;
  3593. }
  3594. var lastIndex = data.length - 1;
  3595. if (index == lastIndex) {
  3596. data.pop();
  3597. } else {
  3598. splice.call(data, index, 1);
  3599. }
  3600. --this.size;
  3601. return true;
  3602. }
  3603. /**
  3604. * Gets the list cache value for `key`.
  3605. *
  3606. * @private
  3607. * @name get
  3608. * @memberOf ListCache
  3609. * @param {string} key The key of the value to get.
  3610. * @returns {*} Returns the entry value.
  3611. */
  3612. function listCacheGet(key) {
  3613. var data = this.__data__,
  3614. index = assocIndexOf(data, key);
  3615. return index < 0 ? undefined : data[index][1];
  3616. }
  3617. /**
  3618. * Checks if a list cache value for `key` exists.
  3619. *
  3620. * @private
  3621. * @name has
  3622. * @memberOf ListCache
  3623. * @param {string} key The key of the entry to check.
  3624. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3625. */
  3626. function listCacheHas(key) {
  3627. return assocIndexOf(this.__data__, key) > -1;
  3628. }
  3629. /**
  3630. * Sets the list cache `key` to `value`.
  3631. *
  3632. * @private
  3633. * @name set
  3634. * @memberOf ListCache
  3635. * @param {string} key The key of the value to set.
  3636. * @param {*} value The value to set.
  3637. * @returns {Object} Returns the list cache instance.
  3638. */
  3639. function listCacheSet(key, value) {
  3640. var data = this.__data__,
  3641. index = assocIndexOf(data, key);
  3642. if (index < 0) {
  3643. ++this.size;
  3644. data.push([key, value]);
  3645. } else {
  3646. data[index][1] = value;
  3647. }
  3648. return this;
  3649. }
  3650. // Add methods to `ListCache`.
  3651. ListCache.prototype.clear = listCacheClear;
  3652. ListCache.prototype['delete'] = listCacheDelete;
  3653. ListCache.prototype.get = listCacheGet;
  3654. ListCache.prototype.has = listCacheHas;
  3655. ListCache.prototype.set = listCacheSet;
  3656. /*------------------------------------------------------------------------*/
  3657. /**
  3658. * Creates a map cache object to store key-value pairs.
  3659. *
  3660. * @private
  3661. * @constructor
  3662. * @param {Array} [entries] The key-value pairs to cache.
  3663. */
  3664. function MapCache(entries) {
  3665. var index = -1,
  3666. length = entries == null ? 0 : entries.length;
  3667. this.clear();
  3668. while (++index < length) {
  3669. var entry = entries[index];
  3670. this.set(entry[0], entry[1]);
  3671. }
  3672. }
  3673. /**
  3674. * Removes all key-value entries from the map.
  3675. *
  3676. * @private
  3677. * @name clear
  3678. * @memberOf MapCache
  3679. */
  3680. function mapCacheClear() {
  3681. this.size = 0;
  3682. this.__data__ = {
  3683. 'hash': new Hash,
  3684. 'map': new (Map || ListCache),
  3685. 'string': new Hash
  3686. };
  3687. }
  3688. /**
  3689. * Removes `key` and its value from the map.
  3690. *
  3691. * @private
  3692. * @name delete
  3693. * @memberOf MapCache
  3694. * @param {string} key The key of the value to remove.
  3695. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3696. */
  3697. function mapCacheDelete(key) {
  3698. var result = getMapData(this, key)['delete'](key);
  3699. this.size -= result ? 1 : 0;
  3700. return result;
  3701. }
  3702. /**
  3703. * Gets the map value for `key`.
  3704. *
  3705. * @private
  3706. * @name get
  3707. * @memberOf MapCache
  3708. * @param {string} key The key of the value to get.
  3709. * @returns {*} Returns the entry value.
  3710. */
  3711. function mapCacheGet(key) {
  3712. return getMapData(this, key).get(key);
  3713. }
  3714. /**
  3715. * Checks if a map value for `key` exists.
  3716. *
  3717. * @private
  3718. * @name has
  3719. * @memberOf MapCache
  3720. * @param {string} key The key of the entry to check.
  3721. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3722. */
  3723. function mapCacheHas(key) {
  3724. return getMapData(this, key).has(key);
  3725. }
  3726. /**
  3727. * Sets the map `key` to `value`.
  3728. *
  3729. * @private
  3730. * @name set
  3731. * @memberOf MapCache
  3732. * @param {string} key The key of the value to set.
  3733. * @param {*} value The value to set.
  3734. * @returns {Object} Returns the map cache instance.
  3735. */
  3736. function mapCacheSet(key, value) {
  3737. var data = getMapData(this, key),
  3738. size = data.size;
  3739. data.set(key, value);
  3740. this.size += data.size == size ? 0 : 1;
  3741. return this;
  3742. }
  3743. // Add methods to `MapCache`.
  3744. MapCache.prototype.clear = mapCacheClear;
  3745. MapCache.prototype['delete'] = mapCacheDelete;
  3746. MapCache.prototype.get = mapCacheGet;
  3747. MapCache.prototype.has = mapCacheHas;
  3748. MapCache.prototype.set = mapCacheSet;
  3749. /*------------------------------------------------------------------------*/
  3750. /**
  3751. *
  3752. * Creates an array cache object to store unique values.
  3753. *
  3754. * @private
  3755. * @constructor
  3756. * @param {Array} [values] The values to cache.
  3757. */
  3758. function SetCache(values) {
  3759. var index = -1,
  3760. length = values == null ? 0 : values.length;
  3761. this.__data__ = new MapCache;
  3762. while (++index < length) {
  3763. this.add(values[index]);
  3764. }
  3765. }
  3766. /**
  3767. * Adds `value` to the array cache.
  3768. *
  3769. * @private
  3770. * @name add
  3771. * @memberOf SetCache
  3772. * @alias push
  3773. * @param {*} value The value to cache.
  3774. * @returns {Object} Returns the cache instance.
  3775. */
  3776. function setCacheAdd(value) {
  3777. this.__data__.set(value, HASH_UNDEFINED);
  3778. return this;
  3779. }
  3780. /**
  3781. * Checks if `value` is in the array cache.
  3782. *
  3783. * @private
  3784. * @name has
  3785. * @memberOf SetCache
  3786. * @param {*} value The value to search for.
  3787. * @returns {number} Returns `true` if `value` is found, else `false`.
  3788. */
  3789. function setCacheHas(value) {
  3790. return this.__data__.has(value);
  3791. }
  3792. // Add methods to `SetCache`.
  3793. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3794. SetCache.prototype.has = setCacheHas;
  3795. /*------------------------------------------------------------------------*/
  3796. /**
  3797. * Creates a stack cache object to store key-value pairs.
  3798. *
  3799. * @private
  3800. * @constructor
  3801. * @param {Array} [entries] The key-value pairs to cache.
  3802. */
  3803. function Stack(entries) {
  3804. var data = this.__data__ = new ListCache(entries);
  3805. this.size = data.size;
  3806. }
  3807. /**
  3808. * Removes all key-value entries from the stack.
  3809. *
  3810. * @private
  3811. * @name clear
  3812. * @memberOf Stack
  3813. */
  3814. function stackClear() {
  3815. this.__data__ = new ListCache;
  3816. this.size = 0;
  3817. }
  3818. /**
  3819. * Removes `key` and its value from the stack.
  3820. *
  3821. * @private
  3822. * @name delete
  3823. * @memberOf Stack
  3824. * @param {string} key The key of the value to remove.
  3825. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3826. */
  3827. function stackDelete(key) {
  3828. var data = this.__data__,
  3829. result = data['delete'](key);
  3830. this.size = data.size;
  3831. return result;
  3832. }
  3833. /**
  3834. * Gets the stack value for `key`.
  3835. *
  3836. * @private
  3837. * @name get
  3838. * @memberOf Stack
  3839. * @param {string} key The key of the value to get.
  3840. * @returns {*} Returns the entry value.
  3841. */
  3842. function stackGet(key) {
  3843. return this.__data__.get(key);
  3844. }
  3845. /**
  3846. * Checks if a stack value for `key` exists.
  3847. *
  3848. * @private
  3849. * @name has
  3850. * @memberOf Stack
  3851. * @param {string} key The key of the entry to check.
  3852. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3853. */
  3854. function stackHas(key) {
  3855. return this.__data__.has(key);
  3856. }
  3857. /**
  3858. * Sets the stack `key` to `value`.
  3859. *
  3860. * @private
  3861. * @name set
  3862. * @memberOf Stack
  3863. * @param {string} key The key of the value to set.
  3864. * @param {*} value The value to set.
  3865. * @returns {Object} Returns the stack cache instance.
  3866. */
  3867. function stackSet(key, value) {
  3868. var data = this.__data__;
  3869. if (data instanceof ListCache) {
  3870. var pairs = data.__data__;
  3871. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3872. pairs.push([key, value]);
  3873. this.size = ++data.size;
  3874. return this;
  3875. }
  3876. data = this.__data__ = new MapCache(pairs);
  3877. }
  3878. data.set(key, value);
  3879. this.size = data.size;
  3880. return this;
  3881. }
  3882. // Add methods to `Stack`.
  3883. Stack.prototype.clear = stackClear;
  3884. Stack.prototype['delete'] = stackDelete;
  3885. Stack.prototype.get = stackGet;
  3886. Stack.prototype.has = stackHas;
  3887. Stack.prototype.set = stackSet;
  3888. /*------------------------------------------------------------------------*/
  3889. /**
  3890. * Creates an array of the enumerable property names of the array-like `value`.
  3891. *
  3892. * @private
  3893. * @param {*} value The value to query.
  3894. * @param {boolean} inherited Specify returning inherited property names.
  3895. * @returns {Array} Returns the array of property names.
  3896. */
  3897. function arrayLikeKeys(value, inherited) {
  3898. var isArr = isArray(value),
  3899. isArg = !isArr && isArguments(value),
  3900. isBuff = !isArr && !isArg && isBuffer(value),
  3901. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3902. skipIndexes = isArr || isArg || isBuff || isType,
  3903. result = skipIndexes ? baseTimes(value.length, String) : [],
  3904. length = result.length;
  3905. for (var key in value) {
  3906. if ((inherited || hasOwnProperty.call(value, key)) &&
  3907. !(skipIndexes && (
  3908. // Safari 9 has enumerable `arguments.length` in strict mode.
  3909. key == 'length' ||
  3910. // Node.js 0.10 has enumerable non-index properties on buffers.
  3911. (isBuff && (key == 'offset' || key == 'parent')) ||
  3912. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3913. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3914. // Skip index properties.
  3915. isIndex(key, length)
  3916. ))) {
  3917. result.push(key);
  3918. }
  3919. }
  3920. return result;
  3921. }
  3922. /**
  3923. * A specialized version of `_.sample` for arrays.
  3924. *
  3925. * @private
  3926. * @param {Array} array The array to sample.
  3927. * @returns {*} Returns the random element.
  3928. */
  3929. function arraySample(array) {
  3930. var length = array.length;
  3931. return length ? array[baseRandom(0, length - 1)] : undefined;
  3932. }
  3933. /**
  3934. * A specialized version of `_.sampleSize` for arrays.
  3935. *
  3936. * @private
  3937. * @param {Array} array The array to sample.
  3938. * @param {number} n The number of elements to sample.
  3939. * @returns {Array} Returns the random elements.
  3940. */
  3941. function arraySampleSize(array, n) {
  3942. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3943. }
  3944. /**
  3945. * A specialized version of `_.shuffle` for arrays.
  3946. *
  3947. * @private
  3948. * @param {Array} array The array to shuffle.
  3949. * @returns {Array} Returns the new shuffled array.
  3950. */
  3951. function arrayShuffle(array) {
  3952. return shuffleSelf(copyArray(array));
  3953. }
  3954. /**
  3955. * This function is like `assignValue` except that it doesn't assign
  3956. * `undefined` values.
  3957. *
  3958. * @private
  3959. * @param {Object} object The object to modify.
  3960. * @param {string} key The key of the property to assign.
  3961. * @param {*} value The value to assign.
  3962. */
  3963. function assignMergeValue(object, key, value) {
  3964. if ((value !== undefined && !eq(object[key], value)) ||
  3965. (value === undefined && !(key in object))) {
  3966. baseAssignValue(object, key, value);
  3967. }
  3968. }
  3969. /**
  3970. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3971. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3972. * for equality comparisons.
  3973. *
  3974. * @private
  3975. * @param {Object} object The object to modify.
  3976. * @param {string} key The key of the property to assign.
  3977. * @param {*} value The value to assign.
  3978. */
  3979. function assignValue(object, key, value) {
  3980. var objValue = object[key];
  3981. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3982. (value === undefined && !(key in object))) {
  3983. baseAssignValue(object, key, value);
  3984. }
  3985. }
  3986. /**
  3987. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3988. *
  3989. * @private
  3990. * @param {Array} array The array to inspect.
  3991. * @param {*} key The key to search for.
  3992. * @returns {number} Returns the index of the matched value, else `-1`.
  3993. */
  3994. function assocIndexOf(array, key) {
  3995. var length = array.length;
  3996. while (length--) {
  3997. if (eq(array[length][0], key)) {
  3998. return length;
  3999. }
  4000. }
  4001. return -1;
  4002. }
  4003. /**
  4004. * Aggregates elements of `collection` on `accumulator` with keys transformed
  4005. * by `iteratee` and values set by `setter`.
  4006. *
  4007. * @private
  4008. * @param {Array|Object} collection The collection to iterate over.
  4009. * @param {Function} setter The function to set `accumulator` values.
  4010. * @param {Function} iteratee The iteratee to transform keys.
  4011. * @param {Object} accumulator The initial aggregated object.
  4012. * @returns {Function} Returns `accumulator`.
  4013. */
  4014. function baseAggregator(collection, setter, iteratee, accumulator) {
  4015. baseEach(collection, function(value, key, collection) {
  4016. setter(accumulator, value, iteratee(value), collection);
  4017. });
  4018. return accumulator;
  4019. }
  4020. /**
  4021. * The base implementation of `_.assign` without support for multiple sources
  4022. * or `customizer` functions.
  4023. *
  4024. * @private
  4025. * @param {Object} object The destination object.
  4026. * @param {Object} source The source object.
  4027. * @returns {Object} Returns `object`.
  4028. */
  4029. function baseAssign(object, source) {
  4030. return object && copyObject(source, keys(source), object);
  4031. }
  4032. /**
  4033. * The base implementation of `_.assignIn` without support for multiple sources
  4034. * or `customizer` functions.
  4035. *
  4036. * @private
  4037. * @param {Object} object The destination object.
  4038. * @param {Object} source The source object.
  4039. * @returns {Object} Returns `object`.
  4040. */
  4041. function baseAssignIn(object, source) {
  4042. return object && copyObject(source, keysIn(source), object);
  4043. }
  4044. /**
  4045. * The base implementation of `assignValue` and `assignMergeValue` without
  4046. * value checks.
  4047. *
  4048. * @private
  4049. * @param {Object} object The object to modify.
  4050. * @param {string} key The key of the property to assign.
  4051. * @param {*} value The value to assign.
  4052. */
  4053. function baseAssignValue(object, key, value) {
  4054. if (key == '__proto__' && defineProperty) {
  4055. defineProperty(object, key, {
  4056. 'configurable': true,
  4057. 'enumerable': true,
  4058. 'value': value,
  4059. 'writable': true
  4060. });
  4061. } else {
  4062. object[key] = value;
  4063. }
  4064. }
  4065. /**
  4066. * The base implementation of `_.at` without support for individual paths.
  4067. *
  4068. * @private
  4069. * @param {Object} object The object to iterate over.
  4070. * @param {string[]} paths The property paths to pick.
  4071. * @returns {Array} Returns the picked elements.
  4072. */
  4073. function baseAt(object, paths) {
  4074. var index = -1,
  4075. length = paths.length,
  4076. result = Array(length),
  4077. skip = object == null;
  4078. while (++index < length) {
  4079. result[index] = skip ? undefined : get(object, paths[index]);
  4080. }
  4081. return result;
  4082. }
  4083. /**
  4084. * The base implementation of `_.clamp` which doesn't coerce arguments.
  4085. *
  4086. * @private
  4087. * @param {number} number The number to clamp.
  4088. * @param {number} [lower] The lower bound.
  4089. * @param {number} upper The upper bound.
  4090. * @returns {number} Returns the clamped number.
  4091. */
  4092. function baseClamp(number, lower, upper) {
  4093. if (number === number) {
  4094. if (upper !== undefined) {
  4095. number = number <= upper ? number : upper;
  4096. }
  4097. if (lower !== undefined) {
  4098. number = number >= lower ? number : lower;
  4099. }
  4100. }
  4101. return number;
  4102. }
  4103. /**
  4104. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  4105. * traversed objects.
  4106. *
  4107. * @private
  4108. * @param {*} value The value to clone.
  4109. * @param {boolean} bitmask The bitmask flags.
  4110. * 1 - Deep clone
  4111. * 2 - Flatten inherited properties
  4112. * 4 - Clone symbols
  4113. * @param {Function} [customizer] The function to customize cloning.
  4114. * @param {string} [key] The key of `value`.
  4115. * @param {Object} [object] The parent object of `value`.
  4116. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  4117. * @returns {*} Returns the cloned value.
  4118. */
  4119. function baseClone(value, bitmask, customizer, key, object, stack) {
  4120. var result,
  4121. isDeep = bitmask & CLONE_DEEP_FLAG,
  4122. isFlat = bitmask & CLONE_FLAT_FLAG,
  4123. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  4124. if (customizer) {
  4125. result = object ? customizer(value, key, object, stack) : customizer(value);
  4126. }
  4127. if (result !== undefined) {
  4128. return result;
  4129. }
  4130. if (!isObject(value)) {
  4131. return value;
  4132. }
  4133. var isArr = isArray(value);
  4134. if (isArr) {
  4135. result = initCloneArray(value);
  4136. if (!isDeep) {
  4137. return copyArray(value, result);
  4138. }
  4139. } else {
  4140. var tag = getTag(value),
  4141. isFunc = tag == funcTag || tag == genTag;
  4142. if (isBuffer(value)) {
  4143. return cloneBuffer(value, isDeep);
  4144. }
  4145. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  4146. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  4147. if (!isDeep) {
  4148. return isFlat
  4149. ? copySymbolsIn(value, baseAssignIn(result, value))
  4150. : copySymbols(value, baseAssign(result, value));
  4151. }
  4152. } else {
  4153. if (!cloneableTags[tag]) {
  4154. return object ? value : {};
  4155. }
  4156. result = initCloneByTag(value, tag, isDeep);
  4157. }
  4158. }
  4159. // Check for circular references and return its corresponding clone.
  4160. stack || (stack = new Stack);
  4161. var stacked = stack.get(value);
  4162. if (stacked) {
  4163. return stacked;
  4164. }
  4165. stack.set(value, result);
  4166. if (isSet(value)) {
  4167. value.forEach(function(subValue) {
  4168. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  4169. });
  4170. } else if (isMap(value)) {
  4171. value.forEach(function(subValue, key) {
  4172. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  4173. });
  4174. }
  4175. var keysFunc = isFull
  4176. ? (isFlat ? getAllKeysIn : getAllKeys)
  4177. : (isFlat ? keysIn : keys);
  4178. var props = isArr ? undefined : keysFunc(value);
  4179. arrayEach(props || value, function(subValue, key) {
  4180. if (props) {
  4181. key = subValue;
  4182. subValue = value[key];
  4183. }
  4184. // Recursively populate clone (susceptible to call stack limits).
  4185. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  4186. });
  4187. return result;
  4188. }
  4189. /**
  4190. * The base implementation of `_.conforms` which doesn't clone `source`.
  4191. *
  4192. * @private
  4193. * @param {Object} source The object of property predicates to conform to.
  4194. * @returns {Function} Returns the new spec function.
  4195. */
  4196. function baseConforms(source) {
  4197. var props = keys(source);
  4198. return function(object) {
  4199. return baseConformsTo(object, source, props);
  4200. };
  4201. }
  4202. /**
  4203. * The base implementation of `_.conformsTo` which accepts `props` to check.
  4204. *
  4205. * @private
  4206. * @param {Object} object The object to inspect.
  4207. * @param {Object} source The object of property predicates to conform to.
  4208. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  4209. */
  4210. function baseConformsTo(object, source, props) {
  4211. var length = props.length;
  4212. if (object == null) {
  4213. return !length;
  4214. }
  4215. object = Object(object);
  4216. while (length--) {
  4217. var key = props[length],
  4218. predicate = source[key],
  4219. value = object[key];
  4220. if ((value === undefined && !(key in object)) || !predicate(value)) {
  4221. return false;
  4222. }
  4223. }
  4224. return true;
  4225. }
  4226. /**
  4227. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  4228. * to provide to `func`.
  4229. *
  4230. * @private
  4231. * @param {Function} func The function to delay.
  4232. * @param {number} wait The number of milliseconds to delay invocation.
  4233. * @param {Array} args The arguments to provide to `func`.
  4234. * @returns {number|Object} Returns the timer id or timeout object.
  4235. */
  4236. function baseDelay(func, wait, args) {
  4237. if (typeof func != 'function') {
  4238. throw new TypeError(FUNC_ERROR_TEXT);
  4239. }
  4240. return setTimeout(function() { func.apply(undefined, args); }, wait);
  4241. }
  4242. /**
  4243. * The base implementation of methods like `_.difference` without support
  4244. * for excluding multiple arrays or iteratee shorthands.
  4245. *
  4246. * @private
  4247. * @param {Array} array The array to inspect.
  4248. * @param {Array} values The values to exclude.
  4249. * @param {Function} [iteratee] The iteratee invoked per element.
  4250. * @param {Function} [comparator] The comparator invoked per element.
  4251. * @returns {Array} Returns the new array of filtered values.
  4252. */
  4253. function baseDifference(array, values, iteratee, comparator) {
  4254. var index = -1,
  4255. includes = arrayIncludes,
  4256. isCommon = true,
  4257. length = array.length,
  4258. result = [],
  4259. valuesLength = values.length;
  4260. if (!length) {
  4261. return result;
  4262. }
  4263. if (iteratee) {
  4264. values = arrayMap(values, baseUnary(iteratee));
  4265. }
  4266. if (comparator) {
  4267. includes = arrayIncludesWith;
  4268. isCommon = false;
  4269. }
  4270. else if (values.length >= LARGE_ARRAY_SIZE) {
  4271. includes = cacheHas;
  4272. isCommon = false;
  4273. values = new SetCache(values);
  4274. }
  4275. outer:
  4276. while (++index < length) {
  4277. var value = array[index],
  4278. computed = iteratee == null ? value : iteratee(value);
  4279. value = (comparator || value !== 0) ? value : 0;
  4280. if (isCommon && computed === computed) {
  4281. var valuesIndex = valuesLength;
  4282. while (valuesIndex--) {
  4283. if (values[valuesIndex] === computed) {
  4284. continue outer;
  4285. }
  4286. }
  4287. result.push(value);
  4288. }
  4289. else if (!includes(values, computed, comparator)) {
  4290. result.push(value);
  4291. }
  4292. }
  4293. return result;
  4294. }
  4295. /**
  4296. * The base implementation of `_.forEach` without support for iteratee shorthands.
  4297. *
  4298. * @private
  4299. * @param {Array|Object} collection The collection to iterate over.
  4300. * @param {Function} iteratee The function invoked per iteration.
  4301. * @returns {Array|Object} Returns `collection`.
  4302. */
  4303. var baseEach = createBaseEach(baseForOwn);
  4304. /**
  4305. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  4306. *
  4307. * @private
  4308. * @param {Array|Object} collection The collection to iterate over.
  4309. * @param {Function} iteratee The function invoked per iteration.
  4310. * @returns {Array|Object} Returns `collection`.
  4311. */
  4312. var baseEachRight = createBaseEach(baseForOwnRight, true);
  4313. /**
  4314. * The base implementation of `_.every` without support for iteratee shorthands.
  4315. *
  4316. * @private
  4317. * @param {Array|Object} collection The collection to iterate over.
  4318. * @param {Function} predicate The function invoked per iteration.
  4319. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  4320. * else `false`
  4321. */
  4322. function baseEvery(collection, predicate) {
  4323. var result = true;
  4324. baseEach(collection, function(value, index, collection) {
  4325. result = !!predicate(value, index, collection);
  4326. return result;
  4327. });
  4328. return result;
  4329. }
  4330. /**
  4331. * The base implementation of methods like `_.max` and `_.min` which accepts a
  4332. * `comparator` to determine the extremum value.
  4333. *
  4334. * @private
  4335. * @param {Array} array The array to iterate over.
  4336. * @param {Function} iteratee The iteratee invoked per iteration.
  4337. * @param {Function} comparator The comparator used to compare values.
  4338. * @returns {*} Returns the extremum value.
  4339. */
  4340. function baseExtremum(array, iteratee, comparator) {
  4341. var index = -1,
  4342. length = array.length;
  4343. while (++index < length) {
  4344. var value = array[index],
  4345. current = iteratee(value);
  4346. if (current != null && (computed === undefined
  4347. ? (current === current && !isSymbol(current))
  4348. : comparator(current, computed)
  4349. )) {
  4350. var computed = current,
  4351. result = value;
  4352. }
  4353. }
  4354. return result;
  4355. }
  4356. /**
  4357. * The base implementation of `_.fill` without an iteratee call guard.
  4358. *
  4359. * @private
  4360. * @param {Array} array The array to fill.
  4361. * @param {*} value The value to fill `array` with.
  4362. * @param {number} [start=0] The start position.
  4363. * @param {number} [end=array.length] The end position.
  4364. * @returns {Array} Returns `array`.
  4365. */
  4366. function baseFill(array, value, start, end) {
  4367. var length = array.length;
  4368. start = toInteger(start);
  4369. if (start < 0) {
  4370. start = -start > length ? 0 : (length + start);
  4371. }
  4372. end = (end === undefined || end > length) ? length : toInteger(end);
  4373. if (end < 0) {
  4374. end += length;
  4375. }
  4376. end = start > end ? 0 : toLength(end);
  4377. while (start < end) {
  4378. array[start++] = value;
  4379. }
  4380. return array;
  4381. }
  4382. /**
  4383. * The base implementation of `_.filter` without support for iteratee shorthands.
  4384. *
  4385. * @private
  4386. * @param {Array|Object} collection The collection to iterate over.
  4387. * @param {Function} predicate The function invoked per iteration.
  4388. * @returns {Array} Returns the new filtered array.
  4389. */
  4390. function baseFilter(collection, predicate) {
  4391. var result = [];
  4392. baseEach(collection, function(value, index, collection) {
  4393. if (predicate(value, index, collection)) {
  4394. result.push(value);
  4395. }
  4396. });
  4397. return result;
  4398. }
  4399. /**
  4400. * The base implementation of `_.flatten` with support for restricting flattening.
  4401. *
  4402. * @private
  4403. * @param {Array} array The array to flatten.
  4404. * @param {number} depth The maximum recursion depth.
  4405. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  4406. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  4407. * @param {Array} [result=[]] The initial result value.
  4408. * @returns {Array} Returns the new flattened array.
  4409. */
  4410. function baseFlatten(array, depth, predicate, isStrict, result) {
  4411. var index = -1,
  4412. length = array.length;
  4413. predicate || (predicate = isFlattenable);
  4414. result || (result = []);
  4415. while (++index < length) {
  4416. var value = array[index];
  4417. if (depth > 0 && predicate(value)) {
  4418. if (depth > 1) {
  4419. // Recursively flatten arrays (susceptible to call stack limits).
  4420. baseFlatten(value, depth - 1, predicate, isStrict, result);
  4421. } else {
  4422. arrayPush(result, value);
  4423. }
  4424. } else if (!isStrict) {
  4425. result[result.length] = value;
  4426. }
  4427. }
  4428. return result;
  4429. }
  4430. /**
  4431. * The base implementation of `baseForOwn` which iterates over `object`
  4432. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  4433. * Iteratee functions may exit iteration early by explicitly returning `false`.
  4434. *
  4435. * @private
  4436. * @param {Object} object The object to iterate over.
  4437. * @param {Function} iteratee The function invoked per iteration.
  4438. * @param {Function} keysFunc The function to get the keys of `object`.
  4439. * @returns {Object} Returns `object`.
  4440. */
  4441. var baseFor = createBaseFor();
  4442. /**
  4443. * This function is like `baseFor` except that it iterates over properties
  4444. * in the opposite order.
  4445. *
  4446. * @private
  4447. * @param {Object} object The object to iterate over.
  4448. * @param {Function} iteratee The function invoked per iteration.
  4449. * @param {Function} keysFunc The function to get the keys of `object`.
  4450. * @returns {Object} Returns `object`.
  4451. */
  4452. var baseForRight = createBaseFor(true);
  4453. /**
  4454. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  4455. *
  4456. * @private
  4457. * @param {Object} object The object to iterate over.
  4458. * @param {Function} iteratee The function invoked per iteration.
  4459. * @returns {Object} Returns `object`.
  4460. */
  4461. function baseForOwn(object, iteratee) {
  4462. return object && baseFor(object, iteratee, keys);
  4463. }
  4464. /**
  4465. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  4466. *
  4467. * @private
  4468. * @param {Object} object The object to iterate over.
  4469. * @param {Function} iteratee The function invoked per iteration.
  4470. * @returns {Object} Returns `object`.
  4471. */
  4472. function baseForOwnRight(object, iteratee) {
  4473. return object && baseForRight(object, iteratee, keys);
  4474. }
  4475. /**
  4476. * The base implementation of `_.functions` which creates an array of
  4477. * `object` function property names filtered from `props`.
  4478. *
  4479. * @private
  4480. * @param {Object} object The object to inspect.
  4481. * @param {Array} props The property names to filter.
  4482. * @returns {Array} Returns the function names.
  4483. */
  4484. function baseFunctions(object, props) {
  4485. return arrayFilter(props, function(key) {
  4486. return isFunction(object[key]);
  4487. });
  4488. }
  4489. /**
  4490. * The base implementation of `_.get` without support for default values.
  4491. *
  4492. * @private
  4493. * @param {Object} object The object to query.
  4494. * @param {Array|string} path The path of the property to get.
  4495. * @returns {*} Returns the resolved value.
  4496. */
  4497. function baseGet(object, path) {
  4498. path = castPath(path, object);
  4499. var index = 0,
  4500. length = path.length;
  4501. while (object != null && index < length) {
  4502. object = object[toKey(path[index++])];
  4503. }
  4504. return (index && index == length) ? object : undefined;
  4505. }
  4506. /**
  4507. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4508. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4509. * symbols of `object`.
  4510. *
  4511. * @private
  4512. * @param {Object} object The object to query.
  4513. * @param {Function} keysFunc The function to get the keys of `object`.
  4514. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4515. * @returns {Array} Returns the array of property names and symbols.
  4516. */
  4517. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4518. var result = keysFunc(object);
  4519. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4520. }
  4521. /**
  4522. * The base implementation of `getTag` without fallbacks for buggy environments.
  4523. *
  4524. * @private
  4525. * @param {*} value The value to query.
  4526. * @returns {string} Returns the `toStringTag`.
  4527. */
  4528. function baseGetTag(value) {
  4529. if (value == null) {
  4530. return value === undefined ? undefinedTag : nullTag;
  4531. }
  4532. return (symToStringTag && symToStringTag in Object(value))
  4533. ? getRawTag(value)
  4534. : objectToString(value);
  4535. }
  4536. /**
  4537. * The base implementation of `_.gt` which doesn't coerce arguments.
  4538. *
  4539. * @private
  4540. * @param {*} value The value to compare.
  4541. * @param {*} other The other value to compare.
  4542. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4543. * else `false`.
  4544. */
  4545. function baseGt(value, other) {
  4546. return value > other;
  4547. }
  4548. /**
  4549. * The base implementation of `_.has` without support for deep paths.
  4550. *
  4551. * @private
  4552. * @param {Object} [object] The object to query.
  4553. * @param {Array|string} key The key to check.
  4554. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4555. */
  4556. function baseHas(object, key) {
  4557. return object != null && hasOwnProperty.call(object, key);
  4558. }
  4559. /**
  4560. * The base implementation of `_.hasIn` without support for deep paths.
  4561. *
  4562. * @private
  4563. * @param {Object} [object] The object to query.
  4564. * @param {Array|string} key The key to check.
  4565. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4566. */
  4567. function baseHasIn(object, key) {
  4568. return object != null && key in Object(object);
  4569. }
  4570. /**
  4571. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4572. *
  4573. * @private
  4574. * @param {number} number The number to check.
  4575. * @param {number} start The start of the range.
  4576. * @param {number} end The end of the range.
  4577. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4578. */
  4579. function baseInRange(number, start, end) {
  4580. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4581. }
  4582. /**
  4583. * The base implementation of methods like `_.intersection`, without support
  4584. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4585. *
  4586. * @private
  4587. * @param {Array} arrays The arrays to inspect.
  4588. * @param {Function} [iteratee] The iteratee invoked per element.
  4589. * @param {Function} [comparator] The comparator invoked per element.
  4590. * @returns {Array} Returns the new array of shared values.
  4591. */
  4592. function baseIntersection(arrays, iteratee, comparator) {
  4593. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4594. length = arrays[0].length,
  4595. othLength = arrays.length,
  4596. othIndex = othLength,
  4597. caches = Array(othLength),
  4598. maxLength = Infinity,
  4599. result = [];
  4600. while (othIndex--) {
  4601. var array = arrays[othIndex];
  4602. if (othIndex && iteratee) {
  4603. array = arrayMap(array, baseUnary(iteratee));
  4604. }
  4605. maxLength = nativeMin(array.length, maxLength);
  4606. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4607. ? new SetCache(othIndex && array)
  4608. : undefined;
  4609. }
  4610. array = arrays[0];
  4611. var index = -1,
  4612. seen = caches[0];
  4613. outer:
  4614. while (++index < length && result.length < maxLength) {
  4615. var value = array[index],
  4616. computed = iteratee ? iteratee(value) : value;
  4617. value = (comparator || value !== 0) ? value : 0;
  4618. if (!(seen
  4619. ? cacheHas(seen, computed)
  4620. : includes(result, computed, comparator)
  4621. )) {
  4622. othIndex = othLength;
  4623. while (--othIndex) {
  4624. var cache = caches[othIndex];
  4625. if (!(cache
  4626. ? cacheHas(cache, computed)
  4627. : includes(arrays[othIndex], computed, comparator))
  4628. ) {
  4629. continue outer;
  4630. }
  4631. }
  4632. if (seen) {
  4633. seen.push(computed);
  4634. }
  4635. result.push(value);
  4636. }
  4637. }
  4638. return result;
  4639. }
  4640. /**
  4641. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4642. * `object` with values transformed by `iteratee` and set by `setter`.
  4643. *
  4644. * @private
  4645. * @param {Object} object The object to iterate over.
  4646. * @param {Function} setter The function to set `accumulator` values.
  4647. * @param {Function} iteratee The iteratee to transform values.
  4648. * @param {Object} accumulator The initial inverted object.
  4649. * @returns {Function} Returns `accumulator`.
  4650. */
  4651. function baseInverter(object, setter, iteratee, accumulator) {
  4652. baseForOwn(object, function(value, key, object) {
  4653. setter(accumulator, iteratee(value), key, object);
  4654. });
  4655. return accumulator;
  4656. }
  4657. /**
  4658. * The base implementation of `_.invoke` without support for individual
  4659. * method arguments.
  4660. *
  4661. * @private
  4662. * @param {Object} object The object to query.
  4663. * @param {Array|string} path The path of the method to invoke.
  4664. * @param {Array} args The arguments to invoke the method with.
  4665. * @returns {*} Returns the result of the invoked method.
  4666. */
  4667. function baseInvoke(object, path, args) {
  4668. path = castPath(path, object);
  4669. object = parent(object, path);
  4670. var func = object == null ? object : object[toKey(last(path))];
  4671. return func == null ? undefined : apply(func, object, args);
  4672. }
  4673. /**
  4674. * The base implementation of `_.isArguments`.
  4675. *
  4676. * @private
  4677. * @param {*} value The value to check.
  4678. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4679. */
  4680. function baseIsArguments(value) {
  4681. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4682. }
  4683. /**
  4684. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4685. *
  4686. * @private
  4687. * @param {*} value The value to check.
  4688. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4689. */
  4690. function baseIsArrayBuffer(value) {
  4691. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4692. }
  4693. /**
  4694. * The base implementation of `_.isDate` without Node.js optimizations.
  4695. *
  4696. * @private
  4697. * @param {*} value The value to check.
  4698. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4699. */
  4700. function baseIsDate(value) {
  4701. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4702. }
  4703. /**
  4704. * The base implementation of `_.isEqual` which supports partial comparisons
  4705. * and tracks traversed objects.
  4706. *
  4707. * @private
  4708. * @param {*} value The value to compare.
  4709. * @param {*} other The other value to compare.
  4710. * @param {boolean} bitmask The bitmask flags.
  4711. * 1 - Unordered comparison
  4712. * 2 - Partial comparison
  4713. * @param {Function} [customizer] The function to customize comparisons.
  4714. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4715. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4716. */
  4717. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4718. if (value === other) {
  4719. return true;
  4720. }
  4721. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4722. return value !== value && other !== other;
  4723. }
  4724. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4725. }
  4726. /**
  4727. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4728. * deep comparisons and tracks traversed objects enabling objects with circular
  4729. * references to be compared.
  4730. *
  4731. * @private
  4732. * @param {Object} object The object to compare.
  4733. * @param {Object} other The other object to compare.
  4734. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4735. * @param {Function} customizer The function to customize comparisons.
  4736. * @param {Function} equalFunc The function to determine equivalents of values.
  4737. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4738. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4739. */
  4740. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4741. var objIsArr = isArray(object),
  4742. othIsArr = isArray(other),
  4743. objTag = objIsArr ? arrayTag : getTag(object),
  4744. othTag = othIsArr ? arrayTag : getTag(other);
  4745. objTag = objTag == argsTag ? objectTag : objTag;
  4746. othTag = othTag == argsTag ? objectTag : othTag;
  4747. var objIsObj = objTag == objectTag,
  4748. othIsObj = othTag == objectTag,
  4749. isSameTag = objTag == othTag;
  4750. if (isSameTag && isBuffer(object)) {
  4751. if (!isBuffer(other)) {
  4752. return false;
  4753. }
  4754. objIsArr = true;
  4755. objIsObj = false;
  4756. }
  4757. if (isSameTag && !objIsObj) {
  4758. stack || (stack = new Stack);
  4759. return (objIsArr || isTypedArray(object))
  4760. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4761. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4762. }
  4763. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4764. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4765. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4766. if (objIsWrapped || othIsWrapped) {
  4767. var objUnwrapped = objIsWrapped ? object.value() : object,
  4768. othUnwrapped = othIsWrapped ? other.value() : other;
  4769. stack || (stack = new Stack);
  4770. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4771. }
  4772. }
  4773. if (!isSameTag) {
  4774. return false;
  4775. }
  4776. stack || (stack = new Stack);
  4777. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4778. }
  4779. /**
  4780. * The base implementation of `_.isMap` without Node.js optimizations.
  4781. *
  4782. * @private
  4783. * @param {*} value The value to check.
  4784. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4785. */
  4786. function baseIsMap(value) {
  4787. return isObjectLike(value) && getTag(value) == mapTag;
  4788. }
  4789. /**
  4790. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4791. *
  4792. * @private
  4793. * @param {Object} object The object to inspect.
  4794. * @param {Object} source The object of property values to match.
  4795. * @param {Array} matchData The property names, values, and compare flags to match.
  4796. * @param {Function} [customizer] The function to customize comparisons.
  4797. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4798. */
  4799. function baseIsMatch(object, source, matchData, customizer) {
  4800. var index = matchData.length,
  4801. length = index,
  4802. noCustomizer = !customizer;
  4803. if (object == null) {
  4804. return !length;
  4805. }
  4806. object = Object(object);
  4807. while (index--) {
  4808. var data = matchData[index];
  4809. if ((noCustomizer && data[2])
  4810. ? data[1] !== object[data[0]]
  4811. : !(data[0] in object)
  4812. ) {
  4813. return false;
  4814. }
  4815. }
  4816. while (++index < length) {
  4817. data = matchData[index];
  4818. var key = data[0],
  4819. objValue = object[key],
  4820. srcValue = data[1];
  4821. if (noCustomizer && data[2]) {
  4822. if (objValue === undefined && !(key in object)) {
  4823. return false;
  4824. }
  4825. } else {
  4826. var stack = new Stack;
  4827. if (customizer) {
  4828. var result = customizer(objValue, srcValue, key, object, source, stack);
  4829. }
  4830. if (!(result === undefined
  4831. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4832. : result
  4833. )) {
  4834. return false;
  4835. }
  4836. }
  4837. }
  4838. return true;
  4839. }
  4840. /**
  4841. * The base implementation of `_.isNative` without bad shim checks.
  4842. *
  4843. * @private
  4844. * @param {*} value The value to check.
  4845. * @returns {boolean} Returns `true` if `value` is a native function,
  4846. * else `false`.
  4847. */
  4848. function baseIsNative(value) {
  4849. if (!isObject(value) || isMasked(value)) {
  4850. return false;
  4851. }
  4852. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4853. return pattern.test(toSource(value));
  4854. }
  4855. /**
  4856. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4857. *
  4858. * @private
  4859. * @param {*} value The value to check.
  4860. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4861. */
  4862. function baseIsRegExp(value) {
  4863. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4864. }
  4865. /**
  4866. * The base implementation of `_.isSet` without Node.js optimizations.
  4867. *
  4868. * @private
  4869. * @param {*} value The value to check.
  4870. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4871. */
  4872. function baseIsSet(value) {
  4873. return isObjectLike(value) && getTag(value) == setTag;
  4874. }
  4875. /**
  4876. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4877. *
  4878. * @private
  4879. * @param {*} value The value to check.
  4880. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4881. */
  4882. function baseIsTypedArray(value) {
  4883. return isObjectLike(value) &&
  4884. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4885. }
  4886. /**
  4887. * The base implementation of `_.iteratee`.
  4888. *
  4889. * @private
  4890. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4891. * @returns {Function} Returns the iteratee.
  4892. */
  4893. function baseIteratee(value) {
  4894. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4895. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4896. if (typeof value == 'function') {
  4897. return value;
  4898. }
  4899. if (value == null) {
  4900. return identity;
  4901. }
  4902. if (typeof value == 'object') {
  4903. return isArray(value)
  4904. ? baseMatchesProperty(value[0], value[1])
  4905. : baseMatches(value);
  4906. }
  4907. return property(value);
  4908. }
  4909. /**
  4910. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4911. *
  4912. * @private
  4913. * @param {Object} object The object to query.
  4914. * @returns {Array} Returns the array of property names.
  4915. */
  4916. function baseKeys(object) {
  4917. if (!isPrototype(object)) {
  4918. return nativeKeys(object);
  4919. }
  4920. var result = [];
  4921. for (var key in Object(object)) {
  4922. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4923. result.push(key);
  4924. }
  4925. }
  4926. return result;
  4927. }
  4928. /**
  4929. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4930. *
  4931. * @private
  4932. * @param {Object} object The object to query.
  4933. * @returns {Array} Returns the array of property names.
  4934. */
  4935. function baseKeysIn(object) {
  4936. if (!isObject(object)) {
  4937. return nativeKeysIn(object);
  4938. }
  4939. var isProto = isPrototype(object),
  4940. result = [];
  4941. for (var key in object) {
  4942. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4943. result.push(key);
  4944. }
  4945. }
  4946. return result;
  4947. }
  4948. /**
  4949. * The base implementation of `_.lt` which doesn't coerce arguments.
  4950. *
  4951. * @private
  4952. * @param {*} value The value to compare.
  4953. * @param {*} other The other value to compare.
  4954. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4955. * else `false`.
  4956. */
  4957. function baseLt(value, other) {
  4958. return value < other;
  4959. }
  4960. /**
  4961. * The base implementation of `_.map` without support for iteratee shorthands.
  4962. *
  4963. * @private
  4964. * @param {Array|Object} collection The collection to iterate over.
  4965. * @param {Function} iteratee The function invoked per iteration.
  4966. * @returns {Array} Returns the new mapped array.
  4967. */
  4968. function baseMap(collection, iteratee) {
  4969. var index = -1,
  4970. result = isArrayLike(collection) ? Array(collection.length) : [];
  4971. baseEach(collection, function(value, key, collection) {
  4972. result[++index] = iteratee(value, key, collection);
  4973. });
  4974. return result;
  4975. }
  4976. /**
  4977. * The base implementation of `_.matches` which doesn't clone `source`.
  4978. *
  4979. * @private
  4980. * @param {Object} source The object of property values to match.
  4981. * @returns {Function} Returns the new spec function.
  4982. */
  4983. function baseMatches(source) {
  4984. var matchData = getMatchData(source);
  4985. if (matchData.length == 1 && matchData[0][2]) {
  4986. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4987. }
  4988. return function(object) {
  4989. return object === source || baseIsMatch(object, source, matchData);
  4990. };
  4991. }
  4992. /**
  4993. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4994. *
  4995. * @private
  4996. * @param {string} path The path of the property to get.
  4997. * @param {*} srcValue The value to match.
  4998. * @returns {Function} Returns the new spec function.
  4999. */
  5000. function baseMatchesProperty(path, srcValue) {
  5001. if (isKey(path) && isStrictComparable(srcValue)) {
  5002. return matchesStrictComparable(toKey(path), srcValue);
  5003. }
  5004. return function(object) {
  5005. var objValue = get(object, path);
  5006. return (objValue === undefined && objValue === srcValue)
  5007. ? hasIn(object, path)
  5008. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  5009. };
  5010. }
  5011. /**
  5012. * The base implementation of `_.merge` without support for multiple sources.
  5013. *
  5014. * @private
  5015. * @param {Object} object The destination object.
  5016. * @param {Object} source The source object.
  5017. * @param {number} srcIndex The index of `source`.
  5018. * @param {Function} [customizer] The function to customize merged values.
  5019. * @param {Object} [stack] Tracks traversed source values and their merged
  5020. * counterparts.
  5021. */
  5022. function baseMerge(object, source, srcIndex, customizer, stack) {
  5023. if (object === source) {
  5024. return;
  5025. }
  5026. baseFor(source, function(srcValue, key) {
  5027. stack || (stack = new Stack);
  5028. if (isObject(srcValue)) {
  5029. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  5030. }
  5031. else {
  5032. var newValue = customizer
  5033. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  5034. : undefined;
  5035. if (newValue === undefined) {
  5036. newValue = srcValue;
  5037. }
  5038. assignMergeValue(object, key, newValue);
  5039. }
  5040. }, keysIn);
  5041. }
  5042. /**
  5043. * A specialized version of `baseMerge` for arrays and objects which performs
  5044. * deep merges and tracks traversed objects enabling objects with circular
  5045. * references to be merged.
  5046. *
  5047. * @private
  5048. * @param {Object} object The destination object.
  5049. * @param {Object} source The source object.
  5050. * @param {string} key The key of the value to merge.
  5051. * @param {number} srcIndex The index of `source`.
  5052. * @param {Function} mergeFunc The function to merge values.
  5053. * @param {Function} [customizer] The function to customize assigned values.
  5054. * @param {Object} [stack] Tracks traversed source values and their merged
  5055. * counterparts.
  5056. */
  5057. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  5058. var objValue = safeGet(object, key),
  5059. srcValue = safeGet(source, key),
  5060. stacked = stack.get(srcValue);
  5061. if (stacked) {
  5062. assignMergeValue(object, key, stacked);
  5063. return;
  5064. }
  5065. var newValue = customizer
  5066. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  5067. : undefined;
  5068. var isCommon = newValue === undefined;
  5069. if (isCommon) {
  5070. var isArr = isArray(srcValue),
  5071. isBuff = !isArr && isBuffer(srcValue),
  5072. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  5073. newValue = srcValue;
  5074. if (isArr || isBuff || isTyped) {
  5075. if (isArray(objValue)) {
  5076. newValue = objValue;
  5077. }
  5078. else if (isArrayLikeObject(objValue)) {
  5079. newValue = copyArray(objValue);
  5080. }
  5081. else if (isBuff) {
  5082. isCommon = false;
  5083. newValue = cloneBuffer(srcValue, true);
  5084. }
  5085. else if (isTyped) {
  5086. isCommon = false;
  5087. newValue = cloneTypedArray(srcValue, true);
  5088. }
  5089. else {
  5090. newValue = [];
  5091. }
  5092. }
  5093. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  5094. newValue = objValue;
  5095. if (isArguments(objValue)) {
  5096. newValue = toPlainObject(objValue);
  5097. }
  5098. else if (!isObject(objValue) || isFunction(objValue)) {
  5099. newValue = initCloneObject(srcValue);
  5100. }
  5101. }
  5102. else {
  5103. isCommon = false;
  5104. }
  5105. }
  5106. if (isCommon) {
  5107. // Recursively merge objects and arrays (susceptible to call stack limits).
  5108. stack.set(srcValue, newValue);
  5109. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  5110. stack['delete'](srcValue);
  5111. }
  5112. assignMergeValue(object, key, newValue);
  5113. }
  5114. /**
  5115. * The base implementation of `_.nth` which doesn't coerce arguments.
  5116. *
  5117. * @private
  5118. * @param {Array} array The array to query.
  5119. * @param {number} n The index of the element to return.
  5120. * @returns {*} Returns the nth element of `array`.
  5121. */
  5122. function baseNth(array, n) {
  5123. var length = array.length;
  5124. if (!length) {
  5125. return;
  5126. }
  5127. n += n < 0 ? length : 0;
  5128. return isIndex(n, length) ? array[n] : undefined;
  5129. }
  5130. /**
  5131. * The base implementation of `_.orderBy` without param guards.
  5132. *
  5133. * @private
  5134. * @param {Array|Object} collection The collection to iterate over.
  5135. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  5136. * @param {string[]} orders The sort orders of `iteratees`.
  5137. * @returns {Array} Returns the new sorted array.
  5138. */
  5139. function baseOrderBy(collection, iteratees, orders) {
  5140. if (iteratees.length) {
  5141. iteratees = arrayMap(iteratees, function(iteratee) {
  5142. if (isArray(iteratee)) {
  5143. return function(value) {
  5144. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  5145. }
  5146. }
  5147. return iteratee;
  5148. });
  5149. } else {
  5150. iteratees = [identity];
  5151. }
  5152. var index = -1;
  5153. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  5154. var result = baseMap(collection, function(value, key, collection) {
  5155. var criteria = arrayMap(iteratees, function(iteratee) {
  5156. return iteratee(value);
  5157. });
  5158. return { 'criteria': criteria, 'index': ++index, 'value': value };
  5159. });
  5160. return baseSortBy(result, function(object, other) {
  5161. return compareMultiple(object, other, orders);
  5162. });
  5163. }
  5164. /**
  5165. * The base implementation of `_.pick` without support for individual
  5166. * property identifiers.
  5167. *
  5168. * @private
  5169. * @param {Object} object The source object.
  5170. * @param {string[]} paths The property paths to pick.
  5171. * @returns {Object} Returns the new object.
  5172. */
  5173. function basePick(object, paths) {
  5174. return basePickBy(object, paths, function(value, path) {
  5175. return hasIn(object, path);
  5176. });
  5177. }
  5178. /**
  5179. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  5180. *
  5181. * @private
  5182. * @param {Object} object The source object.
  5183. * @param {string[]} paths The property paths to pick.
  5184. * @param {Function} predicate The function invoked per property.
  5185. * @returns {Object} Returns the new object.
  5186. */
  5187. function basePickBy(object, paths, predicate) {
  5188. var index = -1,
  5189. length = paths.length,
  5190. result = {};
  5191. while (++index < length) {
  5192. var path = paths[index],
  5193. value = baseGet(object, path);
  5194. if (predicate(value, path)) {
  5195. baseSet(result, castPath(path, object), value);
  5196. }
  5197. }
  5198. return result;
  5199. }
  5200. /**
  5201. * A specialized version of `baseProperty` which supports deep paths.
  5202. *
  5203. * @private
  5204. * @param {Array|string} path The path of the property to get.
  5205. * @returns {Function} Returns the new accessor function.
  5206. */
  5207. function basePropertyDeep(path) {
  5208. return function(object) {
  5209. return baseGet(object, path);
  5210. };
  5211. }
  5212. /**
  5213. * The base implementation of `_.pullAllBy` without support for iteratee
  5214. * shorthands.
  5215. *
  5216. * @private
  5217. * @param {Array} array The array to modify.
  5218. * @param {Array} values The values to remove.
  5219. * @param {Function} [iteratee] The iteratee invoked per element.
  5220. * @param {Function} [comparator] The comparator invoked per element.
  5221. * @returns {Array} Returns `array`.
  5222. */
  5223. function basePullAll(array, values, iteratee, comparator) {
  5224. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  5225. index = -1,
  5226. length = values.length,
  5227. seen = array;
  5228. if (array === values) {
  5229. values = copyArray(values);
  5230. }
  5231. if (iteratee) {
  5232. seen = arrayMap(array, baseUnary(iteratee));
  5233. }
  5234. while (++index < length) {
  5235. var fromIndex = 0,
  5236. value = values[index],
  5237. computed = iteratee ? iteratee(value) : value;
  5238. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  5239. if (seen !== array) {
  5240. splice.call(seen, fromIndex, 1);
  5241. }
  5242. splice.call(array, fromIndex, 1);
  5243. }
  5244. }
  5245. return array;
  5246. }
  5247. /**
  5248. * The base implementation of `_.pullAt` without support for individual
  5249. * indexes or capturing the removed elements.
  5250. *
  5251. * @private
  5252. * @param {Array} array The array to modify.
  5253. * @param {number[]} indexes The indexes of elements to remove.
  5254. * @returns {Array} Returns `array`.
  5255. */
  5256. function basePullAt(array, indexes) {
  5257. var length = array ? indexes.length : 0,
  5258. lastIndex = length - 1;
  5259. while (length--) {
  5260. var index = indexes[length];
  5261. if (length == lastIndex || index !== previous) {
  5262. var previous = index;
  5263. if (isIndex(index)) {
  5264. splice.call(array, index, 1);
  5265. } else {
  5266. baseUnset(array, index);
  5267. }
  5268. }
  5269. }
  5270. return array;
  5271. }
  5272. /**
  5273. * The base implementation of `_.random` without support for returning
  5274. * floating-point numbers.
  5275. *
  5276. * @private
  5277. * @param {number} lower The lower bound.
  5278. * @param {number} upper The upper bound.
  5279. * @returns {number} Returns the random number.
  5280. */
  5281. function baseRandom(lower, upper) {
  5282. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  5283. }
  5284. /**
  5285. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  5286. * coerce arguments.
  5287. *
  5288. * @private
  5289. * @param {number} start The start of the range.
  5290. * @param {number} end The end of the range.
  5291. * @param {number} step The value to increment or decrement by.
  5292. * @param {boolean} [fromRight] Specify iterating from right to left.
  5293. * @returns {Array} Returns the range of numbers.
  5294. */
  5295. function baseRange(start, end, step, fromRight) {
  5296. var index = -1,
  5297. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  5298. result = Array(length);
  5299. while (length--) {
  5300. result[fromRight ? length : ++index] = start;
  5301. start += step;
  5302. }
  5303. return result;
  5304. }
  5305. /**
  5306. * The base implementation of `_.repeat` which doesn't coerce arguments.
  5307. *
  5308. * @private
  5309. * @param {string} string The string to repeat.
  5310. * @param {number} n The number of times to repeat the string.
  5311. * @returns {string} Returns the repeated string.
  5312. */
  5313. function baseRepeat(string, n) {
  5314. var result = '';
  5315. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  5316. return result;
  5317. }
  5318. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  5319. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  5320. do {
  5321. if (n % 2) {
  5322. result += string;
  5323. }
  5324. n = nativeFloor(n / 2);
  5325. if (n) {
  5326. string += string;
  5327. }
  5328. } while (n);
  5329. return result;
  5330. }
  5331. /**
  5332. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  5333. *
  5334. * @private
  5335. * @param {Function} func The function to apply a rest parameter to.
  5336. * @param {number} [start=func.length-1] The start position of the rest parameter.
  5337. * @returns {Function} Returns the new function.
  5338. */
  5339. function baseRest(func, start) {
  5340. return setToString(overRest(func, start, identity), func + '');
  5341. }
  5342. /**
  5343. * The base implementation of `_.sample`.
  5344. *
  5345. * @private
  5346. * @param {Array|Object} collection The collection to sample.
  5347. * @returns {*} Returns the random element.
  5348. */
  5349. function baseSample(collection) {
  5350. return arraySample(values(collection));
  5351. }
  5352. /**
  5353. * The base implementation of `_.sampleSize` without param guards.
  5354. *
  5355. * @private
  5356. * @param {Array|Object} collection The collection to sample.
  5357. * @param {number} n The number of elements to sample.
  5358. * @returns {Array} Returns the random elements.
  5359. */
  5360. function baseSampleSize(collection, n) {
  5361. var array = values(collection);
  5362. return shuffleSelf(array, baseClamp(n, 0, array.length));
  5363. }
  5364. /**
  5365. * The base implementation of `_.set`.
  5366. *
  5367. * @private
  5368. * @param {Object} object The object to modify.
  5369. * @param {Array|string} path The path of the property to set.
  5370. * @param {*} value The value to set.
  5371. * @param {Function} [customizer] The function to customize path creation.
  5372. * @returns {Object} Returns `object`.
  5373. */
  5374. function baseSet(object, path, value, customizer) {
  5375. if (!isObject(object)) {
  5376. return object;
  5377. }
  5378. path = castPath(path, object);
  5379. var index = -1,
  5380. length = path.length,
  5381. lastIndex = length - 1,
  5382. nested = object;
  5383. while (nested != null && ++index < length) {
  5384. var key = toKey(path[index]),
  5385. newValue = value;
  5386. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  5387. return object;
  5388. }
  5389. if (index != lastIndex) {
  5390. var objValue = nested[key];
  5391. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  5392. if (newValue === undefined) {
  5393. newValue = isObject(objValue)
  5394. ? objValue
  5395. : (isIndex(path[index + 1]) ? [] : {});
  5396. }
  5397. }
  5398. assignValue(nested, key, newValue);
  5399. nested = nested[key];
  5400. }
  5401. return object;
  5402. }
  5403. /**
  5404. * The base implementation of `setData` without support for hot loop shorting.
  5405. *
  5406. * @private
  5407. * @param {Function} func The function to associate metadata with.
  5408. * @param {*} data The metadata.
  5409. * @returns {Function} Returns `func`.
  5410. */
  5411. var baseSetData = !metaMap ? identity : function(func, data) {
  5412. metaMap.set(func, data);
  5413. return func;
  5414. };
  5415. /**
  5416. * The base implementation of `setToString` without support for hot loop shorting.
  5417. *
  5418. * @private
  5419. * @param {Function} func The function to modify.
  5420. * @param {Function} string The `toString` result.
  5421. * @returns {Function} Returns `func`.
  5422. */
  5423. var baseSetToString = !defineProperty ? identity : function(func, string) {
  5424. return defineProperty(func, 'toString', {
  5425. 'configurable': true,
  5426. 'enumerable': false,
  5427. 'value': constant(string),
  5428. 'writable': true
  5429. });
  5430. };
  5431. /**
  5432. * The base implementation of `_.shuffle`.
  5433. *
  5434. * @private
  5435. * @param {Array|Object} collection The collection to shuffle.
  5436. * @returns {Array} Returns the new shuffled array.
  5437. */
  5438. function baseShuffle(collection) {
  5439. return shuffleSelf(values(collection));
  5440. }
  5441. /**
  5442. * The base implementation of `_.slice` without an iteratee call guard.
  5443. *
  5444. * @private
  5445. * @param {Array} array The array to slice.
  5446. * @param {number} [start=0] The start position.
  5447. * @param {number} [end=array.length] The end position.
  5448. * @returns {Array} Returns the slice of `array`.
  5449. */
  5450. function baseSlice(array, start, end) {
  5451. var index = -1,
  5452. length = array.length;
  5453. if (start < 0) {
  5454. start = -start > length ? 0 : (length + start);
  5455. }
  5456. end = end > length ? length : end;
  5457. if (end < 0) {
  5458. end += length;
  5459. }
  5460. length = start > end ? 0 : ((end - start) >>> 0);
  5461. start >>>= 0;
  5462. var result = Array(length);
  5463. while (++index < length) {
  5464. result[index] = array[index + start];
  5465. }
  5466. return result;
  5467. }
  5468. /**
  5469. * The base implementation of `_.some` without support for iteratee shorthands.
  5470. *
  5471. * @private
  5472. * @param {Array|Object} collection The collection to iterate over.
  5473. * @param {Function} predicate The function invoked per iteration.
  5474. * @returns {boolean} Returns `true` if any element passes the predicate check,
  5475. * else `false`.
  5476. */
  5477. function baseSome(collection, predicate) {
  5478. var result;
  5479. baseEach(collection, function(value, index, collection) {
  5480. result = predicate(value, index, collection);
  5481. return !result;
  5482. });
  5483. return !!result;
  5484. }
  5485. /**
  5486. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5487. * performs a binary search of `array` to determine the index at which `value`
  5488. * should be inserted into `array` in order to maintain its sort order.
  5489. *
  5490. * @private
  5491. * @param {Array} array The sorted array to inspect.
  5492. * @param {*} value The value to evaluate.
  5493. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5494. * @returns {number} Returns the index at which `value` should be inserted
  5495. * into `array`.
  5496. */
  5497. function baseSortedIndex(array, value, retHighest) {
  5498. var low = 0,
  5499. high = array == null ? low : array.length;
  5500. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5501. while (low < high) {
  5502. var mid = (low + high) >>> 1,
  5503. computed = array[mid];
  5504. if (computed !== null && !isSymbol(computed) &&
  5505. (retHighest ? (computed <= value) : (computed < value))) {
  5506. low = mid + 1;
  5507. } else {
  5508. high = mid;
  5509. }
  5510. }
  5511. return high;
  5512. }
  5513. return baseSortedIndexBy(array, value, identity, retHighest);
  5514. }
  5515. /**
  5516. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5517. * which invokes `iteratee` for `value` and each element of `array` to compute
  5518. * their sort ranking. The iteratee is invoked with one argument; (value).
  5519. *
  5520. * @private
  5521. * @param {Array} array The sorted array to inspect.
  5522. * @param {*} value The value to evaluate.
  5523. * @param {Function} iteratee The iteratee invoked per element.
  5524. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5525. * @returns {number} Returns the index at which `value` should be inserted
  5526. * into `array`.
  5527. */
  5528. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5529. var low = 0,
  5530. high = array == null ? 0 : array.length;
  5531. if (high === 0) {
  5532. return 0;
  5533. }
  5534. value = iteratee(value);
  5535. var valIsNaN = value !== value,
  5536. valIsNull = value === null,
  5537. valIsSymbol = isSymbol(value),
  5538. valIsUndefined = value === undefined;
  5539. while (low < high) {
  5540. var mid = nativeFloor((low + high) / 2),
  5541. computed = iteratee(array[mid]),
  5542. othIsDefined = computed !== undefined,
  5543. othIsNull = computed === null,
  5544. othIsReflexive = computed === computed,
  5545. othIsSymbol = isSymbol(computed);
  5546. if (valIsNaN) {
  5547. var setLow = retHighest || othIsReflexive;
  5548. } else if (valIsUndefined) {
  5549. setLow = othIsReflexive && (retHighest || othIsDefined);
  5550. } else if (valIsNull) {
  5551. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5552. } else if (valIsSymbol) {
  5553. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5554. } else if (othIsNull || othIsSymbol) {
  5555. setLow = false;
  5556. } else {
  5557. setLow = retHighest ? (computed <= value) : (computed < value);
  5558. }
  5559. if (setLow) {
  5560. low = mid + 1;
  5561. } else {
  5562. high = mid;
  5563. }
  5564. }
  5565. return nativeMin(high, MAX_ARRAY_INDEX);
  5566. }
  5567. /**
  5568. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5569. * support for iteratee shorthands.
  5570. *
  5571. * @private
  5572. * @param {Array} array The array to inspect.
  5573. * @param {Function} [iteratee] The iteratee invoked per element.
  5574. * @returns {Array} Returns the new duplicate free array.
  5575. */
  5576. function baseSortedUniq(array, iteratee) {
  5577. var index = -1,
  5578. length = array.length,
  5579. resIndex = 0,
  5580. result = [];
  5581. while (++index < length) {
  5582. var value = array[index],
  5583. computed = iteratee ? iteratee(value) : value;
  5584. if (!index || !eq(computed, seen)) {
  5585. var seen = computed;
  5586. result[resIndex++] = value === 0 ? 0 : value;
  5587. }
  5588. }
  5589. return result;
  5590. }
  5591. /**
  5592. * The base implementation of `_.toNumber` which doesn't ensure correct
  5593. * conversions of binary, hexadecimal, or octal string values.
  5594. *
  5595. * @private
  5596. * @param {*} value The value to process.
  5597. * @returns {number} Returns the number.
  5598. */
  5599. function baseToNumber(value) {
  5600. if (typeof value == 'number') {
  5601. return value;
  5602. }
  5603. if (isSymbol(value)) {
  5604. return NAN;
  5605. }
  5606. return +value;
  5607. }
  5608. /**
  5609. * The base implementation of `_.toString` which doesn't convert nullish
  5610. * values to empty strings.
  5611. *
  5612. * @private
  5613. * @param {*} value The value to process.
  5614. * @returns {string} Returns the string.
  5615. */
  5616. function baseToString(value) {
  5617. // Exit early for strings to avoid a performance hit in some environments.
  5618. if (typeof value == 'string') {
  5619. return value;
  5620. }
  5621. if (isArray(value)) {
  5622. // Recursively convert values (susceptible to call stack limits).
  5623. return arrayMap(value, baseToString) + '';
  5624. }
  5625. if (isSymbol(value)) {
  5626. return symbolToString ? symbolToString.call(value) : '';
  5627. }
  5628. var result = (value + '');
  5629. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5630. }
  5631. /**
  5632. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5633. *
  5634. * @private
  5635. * @param {Array} array The array to inspect.
  5636. * @param {Function} [iteratee] The iteratee invoked per element.
  5637. * @param {Function} [comparator] The comparator invoked per element.
  5638. * @returns {Array} Returns the new duplicate free array.
  5639. */
  5640. function baseUniq(array, iteratee, comparator) {
  5641. var index = -1,
  5642. includes = arrayIncludes,
  5643. length = array.length,
  5644. isCommon = true,
  5645. result = [],
  5646. seen = result;
  5647. if (comparator) {
  5648. isCommon = false;
  5649. includes = arrayIncludesWith;
  5650. }
  5651. else if (length >= LARGE_ARRAY_SIZE) {
  5652. var set = iteratee ? null : createSet(array);
  5653. if (set) {
  5654. return setToArray(set);
  5655. }
  5656. isCommon = false;
  5657. includes = cacheHas;
  5658. seen = new SetCache;
  5659. }
  5660. else {
  5661. seen = iteratee ? [] : result;
  5662. }
  5663. outer:
  5664. while (++index < length) {
  5665. var value = array[index],
  5666. computed = iteratee ? iteratee(value) : value;
  5667. value = (comparator || value !== 0) ? value : 0;
  5668. if (isCommon && computed === computed) {
  5669. var seenIndex = seen.length;
  5670. while (seenIndex--) {
  5671. if (seen[seenIndex] === computed) {
  5672. continue outer;
  5673. }
  5674. }
  5675. if (iteratee) {
  5676. seen.push(computed);
  5677. }
  5678. result.push(value);
  5679. }
  5680. else if (!includes(seen, computed, comparator)) {
  5681. if (seen !== result) {
  5682. seen.push(computed);
  5683. }
  5684. result.push(value);
  5685. }
  5686. }
  5687. return result;
  5688. }
  5689. /**
  5690. * The base implementation of `_.unset`.
  5691. *
  5692. * @private
  5693. * @param {Object} object The object to modify.
  5694. * @param {Array|string} path The property path to unset.
  5695. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5696. */
  5697. function baseUnset(object, path) {
  5698. path = castPath(path, object);
  5699. object = parent(object, path);
  5700. return object == null || delete object[toKey(last(path))];
  5701. }
  5702. /**
  5703. * The base implementation of `_.update`.
  5704. *
  5705. * @private
  5706. * @param {Object} object The object to modify.
  5707. * @param {Array|string} path The path of the property to update.
  5708. * @param {Function} updater The function to produce the updated value.
  5709. * @param {Function} [customizer] The function to customize path creation.
  5710. * @returns {Object} Returns `object`.
  5711. */
  5712. function baseUpdate(object, path, updater, customizer) {
  5713. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5714. }
  5715. /**
  5716. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5717. * without support for iteratee shorthands.
  5718. *
  5719. * @private
  5720. * @param {Array} array The array to query.
  5721. * @param {Function} predicate The function invoked per iteration.
  5722. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5723. * @param {boolean} [fromRight] Specify iterating from right to left.
  5724. * @returns {Array} Returns the slice of `array`.
  5725. */
  5726. function baseWhile(array, predicate, isDrop, fromRight) {
  5727. var length = array.length,
  5728. index = fromRight ? length : -1;
  5729. while ((fromRight ? index-- : ++index < length) &&
  5730. predicate(array[index], index, array)) {}
  5731. return isDrop
  5732. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5733. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5734. }
  5735. /**
  5736. * The base implementation of `wrapperValue` which returns the result of
  5737. * performing a sequence of actions on the unwrapped `value`, where each
  5738. * successive action is supplied the return value of the previous.
  5739. *
  5740. * @private
  5741. * @param {*} value The unwrapped value.
  5742. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5743. * @returns {*} Returns the resolved value.
  5744. */
  5745. function baseWrapperValue(value, actions) {
  5746. var result = value;
  5747. if (result instanceof LazyWrapper) {
  5748. result = result.value();
  5749. }
  5750. return arrayReduce(actions, function(result, action) {
  5751. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5752. }, result);
  5753. }
  5754. /**
  5755. * The base implementation of methods like `_.xor`, without support for
  5756. * iteratee shorthands, that accepts an array of arrays to inspect.
  5757. *
  5758. * @private
  5759. * @param {Array} arrays The arrays to inspect.
  5760. * @param {Function} [iteratee] The iteratee invoked per element.
  5761. * @param {Function} [comparator] The comparator invoked per element.
  5762. * @returns {Array} Returns the new array of values.
  5763. */
  5764. function baseXor(arrays, iteratee, comparator) {
  5765. var length = arrays.length;
  5766. if (length < 2) {
  5767. return length ? baseUniq(arrays[0]) : [];
  5768. }
  5769. var index = -1,
  5770. result = Array(length);
  5771. while (++index < length) {
  5772. var array = arrays[index],
  5773. othIndex = -1;
  5774. while (++othIndex < length) {
  5775. if (othIndex != index) {
  5776. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5777. }
  5778. }
  5779. }
  5780. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5781. }
  5782. /**
  5783. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5784. *
  5785. * @private
  5786. * @param {Array} props The property identifiers.
  5787. * @param {Array} values The property values.
  5788. * @param {Function} assignFunc The function to assign values.
  5789. * @returns {Object} Returns the new object.
  5790. */
  5791. function baseZipObject(props, values, assignFunc) {
  5792. var index = -1,
  5793. length = props.length,
  5794. valsLength = values.length,
  5795. result = {};
  5796. while (++index < length) {
  5797. var value = index < valsLength ? values[index] : undefined;
  5798. assignFunc(result, props[index], value);
  5799. }
  5800. return result;
  5801. }
  5802. /**
  5803. * Casts `value` to an empty array if it's not an array like object.
  5804. *
  5805. * @private
  5806. * @param {*} value The value to inspect.
  5807. * @returns {Array|Object} Returns the cast array-like object.
  5808. */
  5809. function castArrayLikeObject(value) {
  5810. return isArrayLikeObject(value) ? value : [];
  5811. }
  5812. /**
  5813. * Casts `value` to `identity` if it's not a function.
  5814. *
  5815. * @private
  5816. * @param {*} value The value to inspect.
  5817. * @returns {Function} Returns cast function.
  5818. */
  5819. function castFunction(value) {
  5820. return typeof value == 'function' ? value : identity;
  5821. }
  5822. /**
  5823. * Casts `value` to a path array if it's not one.
  5824. *
  5825. * @private
  5826. * @param {*} value The value to inspect.
  5827. * @param {Object} [object] The object to query keys on.
  5828. * @returns {Array} Returns the cast property path array.
  5829. */
  5830. function castPath(value, object) {
  5831. if (isArray(value)) {
  5832. return value;
  5833. }
  5834. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5835. }
  5836. /**
  5837. * A `baseRest` alias which can be replaced with `identity` by module
  5838. * replacement plugins.
  5839. *
  5840. * @private
  5841. * @type {Function}
  5842. * @param {Function} func The function to apply a rest parameter to.
  5843. * @returns {Function} Returns the new function.
  5844. */
  5845. var castRest = baseRest;
  5846. /**
  5847. * Casts `array` to a slice if it's needed.
  5848. *
  5849. * @private
  5850. * @param {Array} array The array to inspect.
  5851. * @param {number} start The start position.
  5852. * @param {number} [end=array.length] The end position.
  5853. * @returns {Array} Returns the cast slice.
  5854. */
  5855. function castSlice(array, start, end) {
  5856. var length = array.length;
  5857. end = end === undefined ? length : end;
  5858. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5859. }
  5860. /**
  5861. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5862. *
  5863. * @private
  5864. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5865. */
  5866. var clearTimeout = ctxClearTimeout || function(id) {
  5867. return root.clearTimeout(id);
  5868. };
  5869. /**
  5870. * Creates a clone of `buffer`.
  5871. *
  5872. * @private
  5873. * @param {Buffer} buffer The buffer to clone.
  5874. * @param {boolean} [isDeep] Specify a deep clone.
  5875. * @returns {Buffer} Returns the cloned buffer.
  5876. */
  5877. function cloneBuffer(buffer, isDeep) {
  5878. if (isDeep) {
  5879. return buffer.slice();
  5880. }
  5881. var length = buffer.length,
  5882. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5883. buffer.copy(result);
  5884. return result;
  5885. }
  5886. /**
  5887. * Creates a clone of `arrayBuffer`.
  5888. *
  5889. * @private
  5890. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5891. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5892. */
  5893. function cloneArrayBuffer(arrayBuffer) {
  5894. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5895. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5896. return result;
  5897. }
  5898. /**
  5899. * Creates a clone of `dataView`.
  5900. *
  5901. * @private
  5902. * @param {Object} dataView The data view to clone.
  5903. * @param {boolean} [isDeep] Specify a deep clone.
  5904. * @returns {Object} Returns the cloned data view.
  5905. */
  5906. function cloneDataView(dataView, isDeep) {
  5907. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5908. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5909. }
  5910. /**
  5911. * Creates a clone of `regexp`.
  5912. *
  5913. * @private
  5914. * @param {Object} regexp The regexp to clone.
  5915. * @returns {Object} Returns the cloned regexp.
  5916. */
  5917. function cloneRegExp(regexp) {
  5918. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5919. result.lastIndex = regexp.lastIndex;
  5920. return result;
  5921. }
  5922. /**
  5923. * Creates a clone of the `symbol` object.
  5924. *
  5925. * @private
  5926. * @param {Object} symbol The symbol object to clone.
  5927. * @returns {Object} Returns the cloned symbol object.
  5928. */
  5929. function cloneSymbol(symbol) {
  5930. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5931. }
  5932. /**
  5933. * Creates a clone of `typedArray`.
  5934. *
  5935. * @private
  5936. * @param {Object} typedArray The typed array to clone.
  5937. * @param {boolean} [isDeep] Specify a deep clone.
  5938. * @returns {Object} Returns the cloned typed array.
  5939. */
  5940. function cloneTypedArray(typedArray, isDeep) {
  5941. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5942. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5943. }
  5944. /**
  5945. * Compares values to sort them in ascending order.
  5946. *
  5947. * @private
  5948. * @param {*} value The value to compare.
  5949. * @param {*} other The other value to compare.
  5950. * @returns {number} Returns the sort order indicator for `value`.
  5951. */
  5952. function compareAscending(value, other) {
  5953. if (value !== other) {
  5954. var valIsDefined = value !== undefined,
  5955. valIsNull = value === null,
  5956. valIsReflexive = value === value,
  5957. valIsSymbol = isSymbol(value);
  5958. var othIsDefined = other !== undefined,
  5959. othIsNull = other === null,
  5960. othIsReflexive = other === other,
  5961. othIsSymbol = isSymbol(other);
  5962. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5963. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5964. (valIsNull && othIsDefined && othIsReflexive) ||
  5965. (!valIsDefined && othIsReflexive) ||
  5966. !valIsReflexive) {
  5967. return 1;
  5968. }
  5969. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5970. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5971. (othIsNull && valIsDefined && valIsReflexive) ||
  5972. (!othIsDefined && valIsReflexive) ||
  5973. !othIsReflexive) {
  5974. return -1;
  5975. }
  5976. }
  5977. return 0;
  5978. }
  5979. /**
  5980. * Used by `_.orderBy` to compare multiple properties of a value to another
  5981. * and stable sort them.
  5982. *
  5983. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5984. * specify an order of "desc" for descending or "asc" for ascending sort order
  5985. * of corresponding values.
  5986. *
  5987. * @private
  5988. * @param {Object} object The object to compare.
  5989. * @param {Object} other The other object to compare.
  5990. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5991. * @returns {number} Returns the sort order indicator for `object`.
  5992. */
  5993. function compareMultiple(object, other, orders) {
  5994. var index = -1,
  5995. objCriteria = object.criteria,
  5996. othCriteria = other.criteria,
  5997. length = objCriteria.length,
  5998. ordersLength = orders.length;
  5999. while (++index < length) {
  6000. var result = compareAscending(objCriteria[index], othCriteria[index]);
  6001. if (result) {
  6002. if (index >= ordersLength) {
  6003. return result;
  6004. }
  6005. var order = orders[index];
  6006. return result * (order == 'desc' ? -1 : 1);
  6007. }
  6008. }
  6009. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  6010. // that causes it, under certain circumstances, to provide the same value for
  6011. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  6012. // for more details.
  6013. //
  6014. // This also ensures a stable sort in V8 and other engines.
  6015. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  6016. return object.index - other.index;
  6017. }
  6018. /**
  6019. * Creates an array that is the composition of partially applied arguments,
  6020. * placeholders, and provided arguments into a single array of arguments.
  6021. *
  6022. * @private
  6023. * @param {Array} args The provided arguments.
  6024. * @param {Array} partials The arguments to prepend to those provided.
  6025. * @param {Array} holders The `partials` placeholder indexes.
  6026. * @params {boolean} [isCurried] Specify composing for a curried function.
  6027. * @returns {Array} Returns the new array of composed arguments.
  6028. */
  6029. function composeArgs(args, partials, holders, isCurried) {
  6030. var argsIndex = -1,
  6031. argsLength = args.length,
  6032. holdersLength = holders.length,
  6033. leftIndex = -1,
  6034. leftLength = partials.length,
  6035. rangeLength = nativeMax(argsLength - holdersLength, 0),
  6036. result = Array(leftLength + rangeLength),
  6037. isUncurried = !isCurried;
  6038. while (++leftIndex < leftLength) {
  6039. result[leftIndex] = partials[leftIndex];
  6040. }
  6041. while (++argsIndex < holdersLength) {
  6042. if (isUncurried || argsIndex < argsLength) {
  6043. result[holders[argsIndex]] = args[argsIndex];
  6044. }
  6045. }
  6046. while (rangeLength--) {
  6047. result[leftIndex++] = args[argsIndex++];
  6048. }
  6049. return result;
  6050. }
  6051. /**
  6052. * This function is like `composeArgs` except that the arguments composition
  6053. * is tailored for `_.partialRight`.
  6054. *
  6055. * @private
  6056. * @param {Array} args The provided arguments.
  6057. * @param {Array} partials The arguments to append to those provided.
  6058. * @param {Array} holders The `partials` placeholder indexes.
  6059. * @params {boolean} [isCurried] Specify composing for a curried function.
  6060. * @returns {Array} Returns the new array of composed arguments.
  6061. */
  6062. function composeArgsRight(args, partials, holders, isCurried) {
  6063. var argsIndex = -1,
  6064. argsLength = args.length,
  6065. holdersIndex = -1,
  6066. holdersLength = holders.length,
  6067. rightIndex = -1,
  6068. rightLength = partials.length,
  6069. rangeLength = nativeMax(argsLength - holdersLength, 0),
  6070. result = Array(rangeLength + rightLength),
  6071. isUncurried = !isCurried;
  6072. while (++argsIndex < rangeLength) {
  6073. result[argsIndex] = args[argsIndex];
  6074. }
  6075. var offset = argsIndex;
  6076. while (++rightIndex < rightLength) {
  6077. result[offset + rightIndex] = partials[rightIndex];
  6078. }
  6079. while (++holdersIndex < holdersLength) {
  6080. if (isUncurried || argsIndex < argsLength) {
  6081. result[offset + holders[holdersIndex]] = args[argsIndex++];
  6082. }
  6083. }
  6084. return result;
  6085. }
  6086. /**
  6087. * Copies the values of `source` to `array`.
  6088. *
  6089. * @private
  6090. * @param {Array} source The array to copy values from.
  6091. * @param {Array} [array=[]] The array to copy values to.
  6092. * @returns {Array} Returns `array`.
  6093. */
  6094. function copyArray(source, array) {
  6095. var index = -1,
  6096. length = source.length;
  6097. array || (array = Array(length));
  6098. while (++index < length) {
  6099. array[index] = source[index];
  6100. }
  6101. return array;
  6102. }
  6103. /**
  6104. * Copies properties of `source` to `object`.
  6105. *
  6106. * @private
  6107. * @param {Object} source The object to copy properties from.
  6108. * @param {Array} props The property identifiers to copy.
  6109. * @param {Object} [object={}] The object to copy properties to.
  6110. * @param {Function} [customizer] The function to customize copied values.
  6111. * @returns {Object} Returns `object`.
  6112. */
  6113. function copyObject(source, props, object, customizer) {
  6114. var isNew = !object;
  6115. object || (object = {});
  6116. var index = -1,
  6117. length = props.length;
  6118. while (++index < length) {
  6119. var key = props[index];
  6120. var newValue = customizer
  6121. ? customizer(object[key], source[key], key, object, source)
  6122. : undefined;
  6123. if (newValue === undefined) {
  6124. newValue = source[key];
  6125. }
  6126. if (isNew) {
  6127. baseAssignValue(object, key, newValue);
  6128. } else {
  6129. assignValue(object, key, newValue);
  6130. }
  6131. }
  6132. return object;
  6133. }
  6134. /**
  6135. * Copies own symbols of `source` to `object`.
  6136. *
  6137. * @private
  6138. * @param {Object} source The object to copy symbols from.
  6139. * @param {Object} [object={}] The object to copy symbols to.
  6140. * @returns {Object} Returns `object`.
  6141. */
  6142. function copySymbols(source, object) {
  6143. return copyObject(source, getSymbols(source), object);
  6144. }
  6145. /**
  6146. * Copies own and inherited symbols of `source` to `object`.
  6147. *
  6148. * @private
  6149. * @param {Object} source The object to copy symbols from.
  6150. * @param {Object} [object={}] The object to copy symbols to.
  6151. * @returns {Object} Returns `object`.
  6152. */
  6153. function copySymbolsIn(source, object) {
  6154. return copyObject(source, getSymbolsIn(source), object);
  6155. }
  6156. /**
  6157. * Creates a function like `_.groupBy`.
  6158. *
  6159. * @private
  6160. * @param {Function} setter The function to set accumulator values.
  6161. * @param {Function} [initializer] The accumulator object initializer.
  6162. * @returns {Function} Returns the new aggregator function.
  6163. */
  6164. function createAggregator(setter, initializer) {
  6165. return function(collection, iteratee) {
  6166. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  6167. accumulator = initializer ? initializer() : {};
  6168. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  6169. };
  6170. }
  6171. /**
  6172. * Creates a function like `_.assign`.
  6173. *
  6174. * @private
  6175. * @param {Function} assigner The function to assign values.
  6176. * @returns {Function} Returns the new assigner function.
  6177. */
  6178. function createAssigner(assigner) {
  6179. return baseRest(function(object, sources) {
  6180. var index = -1,
  6181. length = sources.length,
  6182. customizer = length > 1 ? sources[length - 1] : undefined,
  6183. guard = length > 2 ? sources[2] : undefined;
  6184. customizer = (assigner.length > 3 && typeof customizer == 'function')
  6185. ? (length--, customizer)
  6186. : undefined;
  6187. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  6188. customizer = length < 3 ? undefined : customizer;
  6189. length = 1;
  6190. }
  6191. object = Object(object);
  6192. while (++index < length) {
  6193. var source = sources[index];
  6194. if (source) {
  6195. assigner(object, source, index, customizer);
  6196. }
  6197. }
  6198. return object;
  6199. });
  6200. }
  6201. /**
  6202. * Creates a `baseEach` or `baseEachRight` function.
  6203. *
  6204. * @private
  6205. * @param {Function} eachFunc The function to iterate over a collection.
  6206. * @param {boolean} [fromRight] Specify iterating from right to left.
  6207. * @returns {Function} Returns the new base function.
  6208. */
  6209. function createBaseEach(eachFunc, fromRight) {
  6210. return function(collection, iteratee) {
  6211. if (collection == null) {
  6212. return collection;
  6213. }
  6214. if (!isArrayLike(collection)) {
  6215. return eachFunc(collection, iteratee);
  6216. }
  6217. var length = collection.length,
  6218. index = fromRight ? length : -1,
  6219. iterable = Object(collection);
  6220. while ((fromRight ? index-- : ++index < length)) {
  6221. if (iteratee(iterable[index], index, iterable) === false) {
  6222. break;
  6223. }
  6224. }
  6225. return collection;
  6226. };
  6227. }
  6228. /**
  6229. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  6230. *
  6231. * @private
  6232. * @param {boolean} [fromRight] Specify iterating from right to left.
  6233. * @returns {Function} Returns the new base function.
  6234. */
  6235. function createBaseFor(fromRight) {
  6236. return function(object, iteratee, keysFunc) {
  6237. var index = -1,
  6238. iterable = Object(object),
  6239. props = keysFunc(object),
  6240. length = props.length;
  6241. while (length--) {
  6242. var key = props[fromRight ? length : ++index];
  6243. if (iteratee(iterable[key], key, iterable) === false) {
  6244. break;
  6245. }
  6246. }
  6247. return object;
  6248. };
  6249. }
  6250. /**
  6251. * Creates a function that wraps `func` to invoke it with the optional `this`
  6252. * binding of `thisArg`.
  6253. *
  6254. * @private
  6255. * @param {Function} func The function to wrap.
  6256. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6257. * @param {*} [thisArg] The `this` binding of `func`.
  6258. * @returns {Function} Returns the new wrapped function.
  6259. */
  6260. function createBind(func, bitmask, thisArg) {
  6261. var isBind = bitmask & WRAP_BIND_FLAG,
  6262. Ctor = createCtor(func);
  6263. function wrapper() {
  6264. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6265. return fn.apply(isBind ? thisArg : this, arguments);
  6266. }
  6267. return wrapper;
  6268. }
  6269. /**
  6270. * Creates a function like `_.lowerFirst`.
  6271. *
  6272. * @private
  6273. * @param {string} methodName The name of the `String` case method to use.
  6274. * @returns {Function} Returns the new case function.
  6275. */
  6276. function createCaseFirst(methodName) {
  6277. return function(string) {
  6278. string = toString(string);
  6279. var strSymbols = hasUnicode(string)
  6280. ? stringToArray(string)
  6281. : undefined;
  6282. var chr = strSymbols
  6283. ? strSymbols[0]
  6284. : string.charAt(0);
  6285. var trailing = strSymbols
  6286. ? castSlice(strSymbols, 1).join('')
  6287. : string.slice(1);
  6288. return chr[methodName]() + trailing;
  6289. };
  6290. }
  6291. /**
  6292. * Creates a function like `_.camelCase`.
  6293. *
  6294. * @private
  6295. * @param {Function} callback The function to combine each word.
  6296. * @returns {Function} Returns the new compounder function.
  6297. */
  6298. function createCompounder(callback) {
  6299. return function(string) {
  6300. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  6301. };
  6302. }
  6303. /**
  6304. * Creates a function that produces an instance of `Ctor` regardless of
  6305. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  6306. *
  6307. * @private
  6308. * @param {Function} Ctor The constructor to wrap.
  6309. * @returns {Function} Returns the new wrapped function.
  6310. */
  6311. function createCtor(Ctor) {
  6312. return function() {
  6313. // Use a `switch` statement to work with class constructors. See
  6314. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  6315. // for more details.
  6316. var args = arguments;
  6317. switch (args.length) {
  6318. case 0: return new Ctor;
  6319. case 1: return new Ctor(args[0]);
  6320. case 2: return new Ctor(args[0], args[1]);
  6321. case 3: return new Ctor(args[0], args[1], args[2]);
  6322. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  6323. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  6324. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  6325. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  6326. }
  6327. var thisBinding = baseCreate(Ctor.prototype),
  6328. result = Ctor.apply(thisBinding, args);
  6329. // Mimic the constructor's `return` behavior.
  6330. // See https://es5.github.io/#x13.2.2 for more details.
  6331. return isObject(result) ? result : thisBinding;
  6332. };
  6333. }
  6334. /**
  6335. * Creates a function that wraps `func` to enable currying.
  6336. *
  6337. * @private
  6338. * @param {Function} func The function to wrap.
  6339. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6340. * @param {number} arity The arity of `func`.
  6341. * @returns {Function} Returns the new wrapped function.
  6342. */
  6343. function createCurry(func, bitmask, arity) {
  6344. var Ctor = createCtor(func);
  6345. function wrapper() {
  6346. var length = arguments.length,
  6347. args = Array(length),
  6348. index = length,
  6349. placeholder = getHolder(wrapper);
  6350. while (index--) {
  6351. args[index] = arguments[index];
  6352. }
  6353. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  6354. ? []
  6355. : replaceHolders(args, placeholder);
  6356. length -= holders.length;
  6357. if (length < arity) {
  6358. return createRecurry(
  6359. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  6360. args, holders, undefined, undefined, arity - length);
  6361. }
  6362. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6363. return apply(fn, this, args);
  6364. }
  6365. return wrapper;
  6366. }
  6367. /**
  6368. * Creates a `_.find` or `_.findLast` function.
  6369. *
  6370. * @private
  6371. * @param {Function} findIndexFunc The function to find the collection index.
  6372. * @returns {Function} Returns the new find function.
  6373. */
  6374. function createFind(findIndexFunc) {
  6375. return function(collection, predicate, fromIndex) {
  6376. var iterable = Object(collection);
  6377. if (!isArrayLike(collection)) {
  6378. var iteratee = getIteratee(predicate, 3);
  6379. collection = keys(collection);
  6380. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  6381. }
  6382. var index = findIndexFunc(collection, predicate, fromIndex);
  6383. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  6384. };
  6385. }
  6386. /**
  6387. * Creates a `_.flow` or `_.flowRight` function.
  6388. *
  6389. * @private
  6390. * @param {boolean} [fromRight] Specify iterating from right to left.
  6391. * @returns {Function} Returns the new flow function.
  6392. */
  6393. function createFlow(fromRight) {
  6394. return flatRest(function(funcs) {
  6395. var length = funcs.length,
  6396. index = length,
  6397. prereq = LodashWrapper.prototype.thru;
  6398. if (fromRight) {
  6399. funcs.reverse();
  6400. }
  6401. while (index--) {
  6402. var func = funcs[index];
  6403. if (typeof func != 'function') {
  6404. throw new TypeError(FUNC_ERROR_TEXT);
  6405. }
  6406. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  6407. var wrapper = new LodashWrapper([], true);
  6408. }
  6409. }
  6410. index = wrapper ? index : length;
  6411. while (++index < length) {
  6412. func = funcs[index];
  6413. var funcName = getFuncName(func),
  6414. data = funcName == 'wrapper' ? getData(func) : undefined;
  6415. if (data && isLaziable(data[0]) &&
  6416. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  6417. !data[4].length && data[9] == 1
  6418. ) {
  6419. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  6420. } else {
  6421. wrapper = (func.length == 1 && isLaziable(func))
  6422. ? wrapper[funcName]()
  6423. : wrapper.thru(func);
  6424. }
  6425. }
  6426. return function() {
  6427. var args = arguments,
  6428. value = args[0];
  6429. if (wrapper && args.length == 1 && isArray(value)) {
  6430. return wrapper.plant(value).value();
  6431. }
  6432. var index = 0,
  6433. result = length ? funcs[index].apply(this, args) : value;
  6434. while (++index < length) {
  6435. result = funcs[index].call(this, result);
  6436. }
  6437. return result;
  6438. };
  6439. });
  6440. }
  6441. /**
  6442. * Creates a function that wraps `func` to invoke it with optional `this`
  6443. * binding of `thisArg`, partial application, and currying.
  6444. *
  6445. * @private
  6446. * @param {Function|string} func The function or method name to wrap.
  6447. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6448. * @param {*} [thisArg] The `this` binding of `func`.
  6449. * @param {Array} [partials] The arguments to prepend to those provided to
  6450. * the new function.
  6451. * @param {Array} [holders] The `partials` placeholder indexes.
  6452. * @param {Array} [partialsRight] The arguments to append to those provided
  6453. * to the new function.
  6454. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  6455. * @param {Array} [argPos] The argument positions of the new function.
  6456. * @param {number} [ary] The arity cap of `func`.
  6457. * @param {number} [arity] The arity of `func`.
  6458. * @returns {Function} Returns the new wrapped function.
  6459. */
  6460. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  6461. var isAry = bitmask & WRAP_ARY_FLAG,
  6462. isBind = bitmask & WRAP_BIND_FLAG,
  6463. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  6464. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  6465. isFlip = bitmask & WRAP_FLIP_FLAG,
  6466. Ctor = isBindKey ? undefined : createCtor(func);
  6467. function wrapper() {
  6468. var length = arguments.length,
  6469. args = Array(length),
  6470. index = length;
  6471. while (index--) {
  6472. args[index] = arguments[index];
  6473. }
  6474. if (isCurried) {
  6475. var placeholder = getHolder(wrapper),
  6476. holdersCount = countHolders(args, placeholder);
  6477. }
  6478. if (partials) {
  6479. args = composeArgs(args, partials, holders, isCurried);
  6480. }
  6481. if (partialsRight) {
  6482. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  6483. }
  6484. length -= holdersCount;
  6485. if (isCurried && length < arity) {
  6486. var newHolders = replaceHolders(args, placeholder);
  6487. return createRecurry(
  6488. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6489. args, newHolders, argPos, ary, arity - length
  6490. );
  6491. }
  6492. var thisBinding = isBind ? thisArg : this,
  6493. fn = isBindKey ? thisBinding[func] : func;
  6494. length = args.length;
  6495. if (argPos) {
  6496. args = reorder(args, argPos);
  6497. } else if (isFlip && length > 1) {
  6498. args.reverse();
  6499. }
  6500. if (isAry && ary < length) {
  6501. args.length = ary;
  6502. }
  6503. if (this && this !== root && this instanceof wrapper) {
  6504. fn = Ctor || createCtor(fn);
  6505. }
  6506. return fn.apply(thisBinding, args);
  6507. }
  6508. return wrapper;
  6509. }
  6510. /**
  6511. * Creates a function like `_.invertBy`.
  6512. *
  6513. * @private
  6514. * @param {Function} setter The function to set accumulator values.
  6515. * @param {Function} toIteratee The function to resolve iteratees.
  6516. * @returns {Function} Returns the new inverter function.
  6517. */
  6518. function createInverter(setter, toIteratee) {
  6519. return function(object, iteratee) {
  6520. return baseInverter(object, setter, toIteratee(iteratee), {});
  6521. };
  6522. }
  6523. /**
  6524. * Creates a function that performs a mathematical operation on two values.
  6525. *
  6526. * @private
  6527. * @param {Function} operator The function to perform the operation.
  6528. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6529. * @returns {Function} Returns the new mathematical operation function.
  6530. */
  6531. function createMathOperation(operator, defaultValue) {
  6532. return function(value, other) {
  6533. var result;
  6534. if (value === undefined && other === undefined) {
  6535. return defaultValue;
  6536. }
  6537. if (value !== undefined) {
  6538. result = value;
  6539. }
  6540. if (other !== undefined) {
  6541. if (result === undefined) {
  6542. return other;
  6543. }
  6544. if (typeof value == 'string' || typeof other == 'string') {
  6545. value = baseToString(value);
  6546. other = baseToString(other);
  6547. } else {
  6548. value = baseToNumber(value);
  6549. other = baseToNumber(other);
  6550. }
  6551. result = operator(value, other);
  6552. }
  6553. return result;
  6554. };
  6555. }
  6556. /**
  6557. * Creates a function like `_.over`.
  6558. *
  6559. * @private
  6560. * @param {Function} arrayFunc The function to iterate over iteratees.
  6561. * @returns {Function} Returns the new over function.
  6562. */
  6563. function createOver(arrayFunc) {
  6564. return flatRest(function(iteratees) {
  6565. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6566. return baseRest(function(args) {
  6567. var thisArg = this;
  6568. return arrayFunc(iteratees, function(iteratee) {
  6569. return apply(iteratee, thisArg, args);
  6570. });
  6571. });
  6572. });
  6573. }
  6574. /**
  6575. * Creates the padding for `string` based on `length`. The `chars` string
  6576. * is truncated if the number of characters exceeds `length`.
  6577. *
  6578. * @private
  6579. * @param {number} length The padding length.
  6580. * @param {string} [chars=' '] The string used as padding.
  6581. * @returns {string} Returns the padding for `string`.
  6582. */
  6583. function createPadding(length, chars) {
  6584. chars = chars === undefined ? ' ' : baseToString(chars);
  6585. var charsLength = chars.length;
  6586. if (charsLength < 2) {
  6587. return charsLength ? baseRepeat(chars, length) : chars;
  6588. }
  6589. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6590. return hasUnicode(chars)
  6591. ? castSlice(stringToArray(result), 0, length).join('')
  6592. : result.slice(0, length);
  6593. }
  6594. /**
  6595. * Creates a function that wraps `func` to invoke it with the `this` binding
  6596. * of `thisArg` and `partials` prepended to the arguments it receives.
  6597. *
  6598. * @private
  6599. * @param {Function} func The function to wrap.
  6600. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6601. * @param {*} thisArg The `this` binding of `func`.
  6602. * @param {Array} partials The arguments to prepend to those provided to
  6603. * the new function.
  6604. * @returns {Function} Returns the new wrapped function.
  6605. */
  6606. function createPartial(func, bitmask, thisArg, partials) {
  6607. var isBind = bitmask & WRAP_BIND_FLAG,
  6608. Ctor = createCtor(func);
  6609. function wrapper() {
  6610. var argsIndex = -1,
  6611. argsLength = arguments.length,
  6612. leftIndex = -1,
  6613. leftLength = partials.length,
  6614. args = Array(leftLength + argsLength),
  6615. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6616. while (++leftIndex < leftLength) {
  6617. args[leftIndex] = partials[leftIndex];
  6618. }
  6619. while (argsLength--) {
  6620. args[leftIndex++] = arguments[++argsIndex];
  6621. }
  6622. return apply(fn, isBind ? thisArg : this, args);
  6623. }
  6624. return wrapper;
  6625. }
  6626. /**
  6627. * Creates a `_.range` or `_.rangeRight` function.
  6628. *
  6629. * @private
  6630. * @param {boolean} [fromRight] Specify iterating from right to left.
  6631. * @returns {Function} Returns the new range function.
  6632. */
  6633. function createRange(fromRight) {
  6634. return function(start, end, step) {
  6635. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6636. end = step = undefined;
  6637. }
  6638. // Ensure the sign of `-0` is preserved.
  6639. start = toFinite(start);
  6640. if (end === undefined) {
  6641. end = start;
  6642. start = 0;
  6643. } else {
  6644. end = toFinite(end);
  6645. }
  6646. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6647. return baseRange(start, end, step, fromRight);
  6648. };
  6649. }
  6650. /**
  6651. * Creates a function that performs a relational operation on two values.
  6652. *
  6653. * @private
  6654. * @param {Function} operator The function to perform the operation.
  6655. * @returns {Function} Returns the new relational operation function.
  6656. */
  6657. function createRelationalOperation(operator) {
  6658. return function(value, other) {
  6659. if (!(typeof value == 'string' && typeof other == 'string')) {
  6660. value = toNumber(value);
  6661. other = toNumber(other);
  6662. }
  6663. return operator(value, other);
  6664. };
  6665. }
  6666. /**
  6667. * Creates a function that wraps `func` to continue currying.
  6668. *
  6669. * @private
  6670. * @param {Function} func The function to wrap.
  6671. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6672. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6673. * @param {*} placeholder The placeholder value.
  6674. * @param {*} [thisArg] The `this` binding of `func`.
  6675. * @param {Array} [partials] The arguments to prepend to those provided to
  6676. * the new function.
  6677. * @param {Array} [holders] The `partials` placeholder indexes.
  6678. * @param {Array} [argPos] The argument positions of the new function.
  6679. * @param {number} [ary] The arity cap of `func`.
  6680. * @param {number} [arity] The arity of `func`.
  6681. * @returns {Function} Returns the new wrapped function.
  6682. */
  6683. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6684. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6685. newHolders = isCurry ? holders : undefined,
  6686. newHoldersRight = isCurry ? undefined : holders,
  6687. newPartials = isCurry ? partials : undefined,
  6688. newPartialsRight = isCurry ? undefined : partials;
  6689. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6690. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6691. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6692. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6693. }
  6694. var newData = [
  6695. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6696. newHoldersRight, argPos, ary, arity
  6697. ];
  6698. var result = wrapFunc.apply(undefined, newData);
  6699. if (isLaziable(func)) {
  6700. setData(result, newData);
  6701. }
  6702. result.placeholder = placeholder;
  6703. return setWrapToString(result, func, bitmask);
  6704. }
  6705. /**
  6706. * Creates a function like `_.round`.
  6707. *
  6708. * @private
  6709. * @param {string} methodName The name of the `Math` method to use when rounding.
  6710. * @returns {Function} Returns the new round function.
  6711. */
  6712. function createRound(methodName) {
  6713. var func = Math[methodName];
  6714. return function(number, precision) {
  6715. number = toNumber(number);
  6716. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6717. if (precision && nativeIsFinite(number)) {
  6718. // Shift with exponential notation to avoid floating-point issues.
  6719. // See [MDN](https://mdn.io/round#Examples) for more details.
  6720. var pair = (toString(number) + 'e').split('e'),
  6721. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6722. pair = (toString(value) + 'e').split('e');
  6723. return +(pair[0] + 'e' + (+pair[1] - precision));
  6724. }
  6725. return func(number);
  6726. };
  6727. }
  6728. /**
  6729. * Creates a set object of `values`.
  6730. *
  6731. * @private
  6732. * @param {Array} values The values to add to the set.
  6733. * @returns {Object} Returns the new set.
  6734. */
  6735. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6736. return new Set(values);
  6737. };
  6738. /**
  6739. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6740. *
  6741. * @private
  6742. * @param {Function} keysFunc The function to get the keys of a given object.
  6743. * @returns {Function} Returns the new pairs function.
  6744. */
  6745. function createToPairs(keysFunc) {
  6746. return function(object) {
  6747. var tag = getTag(object);
  6748. if (tag == mapTag) {
  6749. return mapToArray(object);
  6750. }
  6751. if (tag == setTag) {
  6752. return setToPairs(object);
  6753. }
  6754. return baseToPairs(object, keysFunc(object));
  6755. };
  6756. }
  6757. /**
  6758. * Creates a function that either curries or invokes `func` with optional
  6759. * `this` binding and partially applied arguments.
  6760. *
  6761. * @private
  6762. * @param {Function|string} func The function or method name to wrap.
  6763. * @param {number} bitmask The bitmask flags.
  6764. * 1 - `_.bind`
  6765. * 2 - `_.bindKey`
  6766. * 4 - `_.curry` or `_.curryRight` of a bound function
  6767. * 8 - `_.curry`
  6768. * 16 - `_.curryRight`
  6769. * 32 - `_.partial`
  6770. * 64 - `_.partialRight`
  6771. * 128 - `_.rearg`
  6772. * 256 - `_.ary`
  6773. * 512 - `_.flip`
  6774. * @param {*} [thisArg] The `this` binding of `func`.
  6775. * @param {Array} [partials] The arguments to be partially applied.
  6776. * @param {Array} [holders] The `partials` placeholder indexes.
  6777. * @param {Array} [argPos] The argument positions of the new function.
  6778. * @param {number} [ary] The arity cap of `func`.
  6779. * @param {number} [arity] The arity of `func`.
  6780. * @returns {Function} Returns the new wrapped function.
  6781. */
  6782. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6783. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6784. if (!isBindKey && typeof func != 'function') {
  6785. throw new TypeError(FUNC_ERROR_TEXT);
  6786. }
  6787. var length = partials ? partials.length : 0;
  6788. if (!length) {
  6789. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6790. partials = holders = undefined;
  6791. }
  6792. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6793. arity = arity === undefined ? arity : toInteger(arity);
  6794. length -= holders ? holders.length : 0;
  6795. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6796. var partialsRight = partials,
  6797. holdersRight = holders;
  6798. partials = holders = undefined;
  6799. }
  6800. var data = isBindKey ? undefined : getData(func);
  6801. var newData = [
  6802. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6803. argPos, ary, arity
  6804. ];
  6805. if (data) {
  6806. mergeData(newData, data);
  6807. }
  6808. func = newData[0];
  6809. bitmask = newData[1];
  6810. thisArg = newData[2];
  6811. partials = newData[3];
  6812. holders = newData[4];
  6813. arity = newData[9] = newData[9] === undefined
  6814. ? (isBindKey ? 0 : func.length)
  6815. : nativeMax(newData[9] - length, 0);
  6816. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6817. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6818. }
  6819. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6820. var result = createBind(func, bitmask, thisArg);
  6821. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6822. result = createCurry(func, bitmask, arity);
  6823. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6824. result = createPartial(func, bitmask, thisArg, partials);
  6825. } else {
  6826. result = createHybrid.apply(undefined, newData);
  6827. }
  6828. var setter = data ? baseSetData : setData;
  6829. return setWrapToString(setter(result, newData), func, bitmask);
  6830. }
  6831. /**
  6832. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6833. * of source objects to the destination object for all destination properties
  6834. * that resolve to `undefined`.
  6835. *
  6836. * @private
  6837. * @param {*} objValue The destination value.
  6838. * @param {*} srcValue The source value.
  6839. * @param {string} key The key of the property to assign.
  6840. * @param {Object} object The parent object of `objValue`.
  6841. * @returns {*} Returns the value to assign.
  6842. */
  6843. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6844. if (objValue === undefined ||
  6845. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6846. return srcValue;
  6847. }
  6848. return objValue;
  6849. }
  6850. /**
  6851. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6852. * objects into destination objects that are passed thru.
  6853. *
  6854. * @private
  6855. * @param {*} objValue The destination value.
  6856. * @param {*} srcValue The source value.
  6857. * @param {string} key The key of the property to merge.
  6858. * @param {Object} object The parent object of `objValue`.
  6859. * @param {Object} source The parent object of `srcValue`.
  6860. * @param {Object} [stack] Tracks traversed source values and their merged
  6861. * counterparts.
  6862. * @returns {*} Returns the value to assign.
  6863. */
  6864. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6865. if (isObject(objValue) && isObject(srcValue)) {
  6866. // Recursively merge objects and arrays (susceptible to call stack limits).
  6867. stack.set(srcValue, objValue);
  6868. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6869. stack['delete'](srcValue);
  6870. }
  6871. return objValue;
  6872. }
  6873. /**
  6874. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6875. * objects.
  6876. *
  6877. * @private
  6878. * @param {*} value The value to inspect.
  6879. * @param {string} key The key of the property to inspect.
  6880. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6881. */
  6882. function customOmitClone(value) {
  6883. return isPlainObject(value) ? undefined : value;
  6884. }
  6885. /**
  6886. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6887. * partial deep comparisons.
  6888. *
  6889. * @private
  6890. * @param {Array} array The array to compare.
  6891. * @param {Array} other The other array to compare.
  6892. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6893. * @param {Function} customizer The function to customize comparisons.
  6894. * @param {Function} equalFunc The function to determine equivalents of values.
  6895. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6896. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6897. */
  6898. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6899. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6900. arrLength = array.length,
  6901. othLength = other.length;
  6902. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6903. return false;
  6904. }
  6905. // Check that cyclic values are equal.
  6906. var arrStacked = stack.get(array);
  6907. var othStacked = stack.get(other);
  6908. if (arrStacked && othStacked) {
  6909. return arrStacked == other && othStacked == array;
  6910. }
  6911. var index = -1,
  6912. result = true,
  6913. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6914. stack.set(array, other);
  6915. stack.set(other, array);
  6916. // Ignore non-index properties.
  6917. while (++index < arrLength) {
  6918. var arrValue = array[index],
  6919. othValue = other[index];
  6920. if (customizer) {
  6921. var compared = isPartial
  6922. ? customizer(othValue, arrValue, index, other, array, stack)
  6923. : customizer(arrValue, othValue, index, array, other, stack);
  6924. }
  6925. if (compared !== undefined) {
  6926. if (compared) {
  6927. continue;
  6928. }
  6929. result = false;
  6930. break;
  6931. }
  6932. // Recursively compare arrays (susceptible to call stack limits).
  6933. if (seen) {
  6934. if (!arraySome(other, function(othValue, othIndex) {
  6935. if (!cacheHas(seen, othIndex) &&
  6936. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6937. return seen.push(othIndex);
  6938. }
  6939. })) {
  6940. result = false;
  6941. break;
  6942. }
  6943. } else if (!(
  6944. arrValue === othValue ||
  6945. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6946. )) {
  6947. result = false;
  6948. break;
  6949. }
  6950. }
  6951. stack['delete'](array);
  6952. stack['delete'](other);
  6953. return result;
  6954. }
  6955. /**
  6956. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6957. * the same `toStringTag`.
  6958. *
  6959. * **Note:** This function only supports comparing values with tags of
  6960. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6961. *
  6962. * @private
  6963. * @param {Object} object The object to compare.
  6964. * @param {Object} other The other object to compare.
  6965. * @param {string} tag The `toStringTag` of the objects to compare.
  6966. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6967. * @param {Function} customizer The function to customize comparisons.
  6968. * @param {Function} equalFunc The function to determine equivalents of values.
  6969. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6970. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6971. */
  6972. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6973. switch (tag) {
  6974. case dataViewTag:
  6975. if ((object.byteLength != other.byteLength) ||
  6976. (object.byteOffset != other.byteOffset)) {
  6977. return false;
  6978. }
  6979. object = object.buffer;
  6980. other = other.buffer;
  6981. case arrayBufferTag:
  6982. if ((object.byteLength != other.byteLength) ||
  6983. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6984. return false;
  6985. }
  6986. return true;
  6987. case boolTag:
  6988. case dateTag:
  6989. case numberTag:
  6990. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6991. // Invalid dates are coerced to `NaN`.
  6992. return eq(+object, +other);
  6993. case errorTag:
  6994. return object.name == other.name && object.message == other.message;
  6995. case regexpTag:
  6996. case stringTag:
  6997. // Coerce regexes to strings and treat strings, primitives and objects,
  6998. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6999. // for more details.
  7000. return object == (other + '');
  7001. case mapTag:
  7002. var convert = mapToArray;
  7003. case setTag:
  7004. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  7005. convert || (convert = setToArray);
  7006. if (object.size != other.size && !isPartial) {
  7007. return false;
  7008. }
  7009. // Assume cyclic values are equal.
  7010. var stacked = stack.get(object);
  7011. if (stacked) {
  7012. return stacked == other;
  7013. }
  7014. bitmask |= COMPARE_UNORDERED_FLAG;
  7015. // Recursively compare objects (susceptible to call stack limits).
  7016. stack.set(object, other);
  7017. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  7018. stack['delete'](object);
  7019. return result;
  7020. case symbolTag:
  7021. if (symbolValueOf) {
  7022. return symbolValueOf.call(object) == symbolValueOf.call(other);
  7023. }
  7024. }
  7025. return false;
  7026. }
  7027. /**
  7028. * A specialized version of `baseIsEqualDeep` for objects with support for
  7029. * partial deep comparisons.
  7030. *
  7031. * @private
  7032. * @param {Object} object The object to compare.
  7033. * @param {Object} other The other object to compare.
  7034. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  7035. * @param {Function} customizer The function to customize comparisons.
  7036. * @param {Function} equalFunc The function to determine equivalents of values.
  7037. * @param {Object} stack Tracks traversed `object` and `other` objects.
  7038. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  7039. */
  7040. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  7041. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  7042. objProps = getAllKeys(object),
  7043. objLength = objProps.length,
  7044. othProps = getAllKeys(other),
  7045. othLength = othProps.length;
  7046. if (objLength != othLength && !isPartial) {
  7047. return false;
  7048. }
  7049. var index = objLength;
  7050. while (index--) {
  7051. var key = objProps[index];
  7052. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  7053. return false;
  7054. }
  7055. }
  7056. // Check that cyclic values are equal.
  7057. var objStacked = stack.get(object);
  7058. var othStacked = stack.get(other);
  7059. if (objStacked && othStacked) {
  7060. return objStacked == other && othStacked == object;
  7061. }
  7062. var result = true;
  7063. stack.set(object, other);
  7064. stack.set(other, object);
  7065. var skipCtor = isPartial;
  7066. while (++index < objLength) {
  7067. key = objProps[index];
  7068. var objValue = object[key],
  7069. othValue = other[key];
  7070. if (customizer) {
  7071. var compared = isPartial
  7072. ? customizer(othValue, objValue, key, other, object, stack)
  7073. : customizer(objValue, othValue, key, object, other, stack);
  7074. }
  7075. // Recursively compare objects (susceptible to call stack limits).
  7076. if (!(compared === undefined
  7077. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  7078. : compared
  7079. )) {
  7080. result = false;
  7081. break;
  7082. }
  7083. skipCtor || (skipCtor = key == 'constructor');
  7084. }
  7085. if (result && !skipCtor) {
  7086. var objCtor = object.constructor,
  7087. othCtor = other.constructor;
  7088. // Non `Object` object instances with different constructors are not equal.
  7089. if (objCtor != othCtor &&
  7090. ('constructor' in object && 'constructor' in other) &&
  7091. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  7092. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  7093. result = false;
  7094. }
  7095. }
  7096. stack['delete'](object);
  7097. stack['delete'](other);
  7098. return result;
  7099. }
  7100. /**
  7101. * A specialized version of `baseRest` which flattens the rest array.
  7102. *
  7103. * @private
  7104. * @param {Function} func The function to apply a rest parameter to.
  7105. * @returns {Function} Returns the new function.
  7106. */
  7107. function flatRest(func) {
  7108. return setToString(overRest(func, undefined, flatten), func + '');
  7109. }
  7110. /**
  7111. * Creates an array of own enumerable property names and symbols of `object`.
  7112. *
  7113. * @private
  7114. * @param {Object} object The object to query.
  7115. * @returns {Array} Returns the array of property names and symbols.
  7116. */
  7117. function getAllKeys(object) {
  7118. return baseGetAllKeys(object, keys, getSymbols);
  7119. }
  7120. /**
  7121. * Creates an array of own and inherited enumerable property names and
  7122. * symbols of `object`.
  7123. *
  7124. * @private
  7125. * @param {Object} object The object to query.
  7126. * @returns {Array} Returns the array of property names and symbols.
  7127. */
  7128. function getAllKeysIn(object) {
  7129. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  7130. }
  7131. /**
  7132. * Gets metadata for `func`.
  7133. *
  7134. * @private
  7135. * @param {Function} func The function to query.
  7136. * @returns {*} Returns the metadata for `func`.
  7137. */
  7138. var getData = !metaMap ? noop : function(func) {
  7139. return metaMap.get(func);
  7140. };
  7141. /**
  7142. * Gets the name of `func`.
  7143. *
  7144. * @private
  7145. * @param {Function} func The function to query.
  7146. * @returns {string} Returns the function name.
  7147. */
  7148. function getFuncName(func) {
  7149. var result = (func.name + ''),
  7150. array = realNames[result],
  7151. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  7152. while (length--) {
  7153. var data = array[length],
  7154. otherFunc = data.func;
  7155. if (otherFunc == null || otherFunc == func) {
  7156. return data.name;
  7157. }
  7158. }
  7159. return result;
  7160. }
  7161. /**
  7162. * Gets the argument placeholder value for `func`.
  7163. *
  7164. * @private
  7165. * @param {Function} func The function to inspect.
  7166. * @returns {*} Returns the placeholder value.
  7167. */
  7168. function getHolder(func) {
  7169. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  7170. return object.placeholder;
  7171. }
  7172. /**
  7173. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  7174. * this function returns the custom method, otherwise it returns `baseIteratee`.
  7175. * If arguments are provided, the chosen function is invoked with them and
  7176. * its result is returned.
  7177. *
  7178. * @private
  7179. * @param {*} [value] The value to convert to an iteratee.
  7180. * @param {number} [arity] The arity of the created iteratee.
  7181. * @returns {Function} Returns the chosen function or its result.
  7182. */
  7183. function getIteratee() {
  7184. var result = lodash.iteratee || iteratee;
  7185. result = result === iteratee ? baseIteratee : result;
  7186. return arguments.length ? result(arguments[0], arguments[1]) : result;
  7187. }
  7188. /**
  7189. * Gets the data for `map`.
  7190. *
  7191. * @private
  7192. * @param {Object} map The map to query.
  7193. * @param {string} key The reference key.
  7194. * @returns {*} Returns the map data.
  7195. */
  7196. function getMapData(map, key) {
  7197. var data = map.__data__;
  7198. return isKeyable(key)
  7199. ? data[typeof key == 'string' ? 'string' : 'hash']
  7200. : data.map;
  7201. }
  7202. /**
  7203. * Gets the property names, values, and compare flags of `object`.
  7204. *
  7205. * @private
  7206. * @param {Object} object The object to query.
  7207. * @returns {Array} Returns the match data of `object`.
  7208. */
  7209. function getMatchData(object) {
  7210. var result = keys(object),
  7211. length = result.length;
  7212. while (length--) {
  7213. var key = result[length],
  7214. value = object[key];
  7215. result[length] = [key, value, isStrictComparable(value)];
  7216. }
  7217. return result;
  7218. }
  7219. /**
  7220. * Gets the native function at `key` of `object`.
  7221. *
  7222. * @private
  7223. * @param {Object} object The object to query.
  7224. * @param {string} key The key of the method to get.
  7225. * @returns {*} Returns the function if it's native, else `undefined`.
  7226. */
  7227. function getNative(object, key) {
  7228. var value = getValue(object, key);
  7229. return baseIsNative(value) ? value : undefined;
  7230. }
  7231. /**
  7232. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  7233. *
  7234. * @private
  7235. * @param {*} value The value to query.
  7236. * @returns {string} Returns the raw `toStringTag`.
  7237. */
  7238. function getRawTag(value) {
  7239. var isOwn = hasOwnProperty.call(value, symToStringTag),
  7240. tag = value[symToStringTag];
  7241. try {
  7242. value[symToStringTag] = undefined;
  7243. var unmasked = true;
  7244. } catch (e) {}
  7245. var result = nativeObjectToString.call(value);
  7246. if (unmasked) {
  7247. if (isOwn) {
  7248. value[symToStringTag] = tag;
  7249. } else {
  7250. delete value[symToStringTag];
  7251. }
  7252. }
  7253. return result;
  7254. }
  7255. /**
  7256. * Creates an array of the own enumerable symbols of `object`.
  7257. *
  7258. * @private
  7259. * @param {Object} object The object to query.
  7260. * @returns {Array} Returns the array of symbols.
  7261. */
  7262. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  7263. if (object == null) {
  7264. return [];
  7265. }
  7266. object = Object(object);
  7267. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  7268. return propertyIsEnumerable.call(object, symbol);
  7269. });
  7270. };
  7271. /**
  7272. * Creates an array of the own and inherited enumerable symbols of `object`.
  7273. *
  7274. * @private
  7275. * @param {Object} object The object to query.
  7276. * @returns {Array} Returns the array of symbols.
  7277. */
  7278. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  7279. var result = [];
  7280. while (object) {
  7281. arrayPush(result, getSymbols(object));
  7282. object = getPrototype(object);
  7283. }
  7284. return result;
  7285. };
  7286. /**
  7287. * Gets the `toStringTag` of `value`.
  7288. *
  7289. * @private
  7290. * @param {*} value The value to query.
  7291. * @returns {string} Returns the `toStringTag`.
  7292. */
  7293. var getTag = baseGetTag;
  7294. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  7295. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  7296. (Map && getTag(new Map) != mapTag) ||
  7297. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  7298. (Set && getTag(new Set) != setTag) ||
  7299. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  7300. getTag = function(value) {
  7301. var result = baseGetTag(value),
  7302. Ctor = result == objectTag ? value.constructor : undefined,
  7303. ctorString = Ctor ? toSource(Ctor) : '';
  7304. if (ctorString) {
  7305. switch (ctorString) {
  7306. case dataViewCtorString: return dataViewTag;
  7307. case mapCtorString: return mapTag;
  7308. case promiseCtorString: return promiseTag;
  7309. case setCtorString: return setTag;
  7310. case weakMapCtorString: return weakMapTag;
  7311. }
  7312. }
  7313. return result;
  7314. };
  7315. }
  7316. /**
  7317. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  7318. *
  7319. * @private
  7320. * @param {number} start The start of the view.
  7321. * @param {number} end The end of the view.
  7322. * @param {Array} transforms The transformations to apply to the view.
  7323. * @returns {Object} Returns an object containing the `start` and `end`
  7324. * positions of the view.
  7325. */
  7326. function getView(start, end, transforms) {
  7327. var index = -1,
  7328. length = transforms.length;
  7329. while (++index < length) {
  7330. var data = transforms[index],
  7331. size = data.size;
  7332. switch (data.type) {
  7333. case 'drop': start += size; break;
  7334. case 'dropRight': end -= size; break;
  7335. case 'take': end = nativeMin(end, start + size); break;
  7336. case 'takeRight': start = nativeMax(start, end - size); break;
  7337. }
  7338. }
  7339. return { 'start': start, 'end': end };
  7340. }
  7341. /**
  7342. * Extracts wrapper details from the `source` body comment.
  7343. *
  7344. * @private
  7345. * @param {string} source The source to inspect.
  7346. * @returns {Array} Returns the wrapper details.
  7347. */
  7348. function getWrapDetails(source) {
  7349. var match = source.match(reWrapDetails);
  7350. return match ? match[1].split(reSplitDetails) : [];
  7351. }
  7352. /**
  7353. * Checks if `path` exists on `object`.
  7354. *
  7355. * @private
  7356. * @param {Object} object The object to query.
  7357. * @param {Array|string} path The path to check.
  7358. * @param {Function} hasFunc The function to check properties.
  7359. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  7360. */
  7361. function hasPath(object, path, hasFunc) {
  7362. path = castPath(path, object);
  7363. var index = -1,
  7364. length = path.length,
  7365. result = false;
  7366. while (++index < length) {
  7367. var key = toKey(path[index]);
  7368. if (!(result = object != null && hasFunc(object, key))) {
  7369. break;
  7370. }
  7371. object = object[key];
  7372. }
  7373. if (result || ++index != length) {
  7374. return result;
  7375. }
  7376. length = object == null ? 0 : object.length;
  7377. return !!length && isLength(length) && isIndex(key, length) &&
  7378. (isArray(object) || isArguments(object));
  7379. }
  7380. /**
  7381. * Initializes an array clone.
  7382. *
  7383. * @private
  7384. * @param {Array} array The array to clone.
  7385. * @returns {Array} Returns the initialized clone.
  7386. */
  7387. function initCloneArray(array) {
  7388. var length = array.length,
  7389. result = new array.constructor(length);
  7390. // Add properties assigned by `RegExp#exec`.
  7391. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  7392. result.index = array.index;
  7393. result.input = array.input;
  7394. }
  7395. return result;
  7396. }
  7397. /**
  7398. * Initializes an object clone.
  7399. *
  7400. * @private
  7401. * @param {Object} object The object to clone.
  7402. * @returns {Object} Returns the initialized clone.
  7403. */
  7404. function initCloneObject(object) {
  7405. return (typeof object.constructor == 'function' && !isPrototype(object))
  7406. ? baseCreate(getPrototype(object))
  7407. : {};
  7408. }
  7409. /**
  7410. * Initializes an object clone based on its `toStringTag`.
  7411. *
  7412. * **Note:** This function only supports cloning values with tags of
  7413. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  7414. *
  7415. * @private
  7416. * @param {Object} object The object to clone.
  7417. * @param {string} tag The `toStringTag` of the object to clone.
  7418. * @param {boolean} [isDeep] Specify a deep clone.
  7419. * @returns {Object} Returns the initialized clone.
  7420. */
  7421. function initCloneByTag(object, tag, isDeep) {
  7422. var Ctor = object.constructor;
  7423. switch (tag) {
  7424. case arrayBufferTag:
  7425. return cloneArrayBuffer(object);
  7426. case boolTag:
  7427. case dateTag:
  7428. return new Ctor(+object);
  7429. case dataViewTag:
  7430. return cloneDataView(object, isDeep);
  7431. case float32Tag: case float64Tag:
  7432. case int8Tag: case int16Tag: case int32Tag:
  7433. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  7434. return cloneTypedArray(object, isDeep);
  7435. case mapTag:
  7436. return new Ctor;
  7437. case numberTag:
  7438. case stringTag:
  7439. return new Ctor(object);
  7440. case regexpTag:
  7441. return cloneRegExp(object);
  7442. case setTag:
  7443. return new Ctor;
  7444. case symbolTag:
  7445. return cloneSymbol(object);
  7446. }
  7447. }
  7448. /**
  7449. * Inserts wrapper `details` in a comment at the top of the `source` body.
  7450. *
  7451. * @private
  7452. * @param {string} source The source to modify.
  7453. * @returns {Array} details The details to insert.
  7454. * @returns {string} Returns the modified source.
  7455. */
  7456. function insertWrapDetails(source, details) {
  7457. var length = details.length;
  7458. if (!length) {
  7459. return source;
  7460. }
  7461. var lastIndex = length - 1;
  7462. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  7463. details = details.join(length > 2 ? ', ' : ' ');
  7464. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  7465. }
  7466. /**
  7467. * Checks if `value` is a flattenable `arguments` object or array.
  7468. *
  7469. * @private
  7470. * @param {*} value The value to check.
  7471. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  7472. */
  7473. function isFlattenable(value) {
  7474. return isArray(value) || isArguments(value) ||
  7475. !!(spreadableSymbol && value && value[spreadableSymbol]);
  7476. }
  7477. /**
  7478. * Checks if `value` is a valid array-like index.
  7479. *
  7480. * @private
  7481. * @param {*} value The value to check.
  7482. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7483. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7484. */
  7485. function isIndex(value, length) {
  7486. var type = typeof value;
  7487. length = length == null ? MAX_SAFE_INTEGER : length;
  7488. return !!length &&
  7489. (type == 'number' ||
  7490. (type != 'symbol' && reIsUint.test(value))) &&
  7491. (value > -1 && value % 1 == 0 && value < length);
  7492. }
  7493. /**
  7494. * Checks if the given arguments are from an iteratee call.
  7495. *
  7496. * @private
  7497. * @param {*} value The potential iteratee value argument.
  7498. * @param {*} index The potential iteratee index or key argument.
  7499. * @param {*} object The potential iteratee object argument.
  7500. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7501. * else `false`.
  7502. */
  7503. function isIterateeCall(value, index, object) {
  7504. if (!isObject(object)) {
  7505. return false;
  7506. }
  7507. var type = typeof index;
  7508. if (type == 'number'
  7509. ? (isArrayLike(object) && isIndex(index, object.length))
  7510. : (type == 'string' && index in object)
  7511. ) {
  7512. return eq(object[index], value);
  7513. }
  7514. return false;
  7515. }
  7516. /**
  7517. * Checks if `value` is a property name and not a property path.
  7518. *
  7519. * @private
  7520. * @param {*} value The value to check.
  7521. * @param {Object} [object] The object to query keys on.
  7522. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7523. */
  7524. function isKey(value, object) {
  7525. if (isArray(value)) {
  7526. return false;
  7527. }
  7528. var type = typeof value;
  7529. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7530. value == null || isSymbol(value)) {
  7531. return true;
  7532. }
  7533. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7534. (object != null && value in Object(object));
  7535. }
  7536. /**
  7537. * Checks if `value` is suitable for use as unique object key.
  7538. *
  7539. * @private
  7540. * @param {*} value The value to check.
  7541. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7542. */
  7543. function isKeyable(value) {
  7544. var type = typeof value;
  7545. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7546. ? (value !== '__proto__')
  7547. : (value === null);
  7548. }
  7549. /**
  7550. * Checks if `func` has a lazy counterpart.
  7551. *
  7552. * @private
  7553. * @param {Function} func The function to check.
  7554. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7555. * else `false`.
  7556. */
  7557. function isLaziable(func) {
  7558. var funcName = getFuncName(func),
  7559. other = lodash[funcName];
  7560. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7561. return false;
  7562. }
  7563. if (func === other) {
  7564. return true;
  7565. }
  7566. var data = getData(other);
  7567. return !!data && func === data[0];
  7568. }
  7569. /**
  7570. * Checks if `func` has its source masked.
  7571. *
  7572. * @private
  7573. * @param {Function} func The function to check.
  7574. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7575. */
  7576. function isMasked(func) {
  7577. return !!maskSrcKey && (maskSrcKey in func);
  7578. }
  7579. /**
  7580. * Checks if `func` is capable of being masked.
  7581. *
  7582. * @private
  7583. * @param {*} value The value to check.
  7584. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7585. */
  7586. var isMaskable = coreJsData ? isFunction : stubFalse;
  7587. /**
  7588. * Checks if `value` is likely a prototype object.
  7589. *
  7590. * @private
  7591. * @param {*} value The value to check.
  7592. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7593. */
  7594. function isPrototype(value) {
  7595. var Ctor = value && value.constructor,
  7596. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7597. return value === proto;
  7598. }
  7599. /**
  7600. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7601. *
  7602. * @private
  7603. * @param {*} value The value to check.
  7604. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7605. * equality comparisons, else `false`.
  7606. */
  7607. function isStrictComparable(value) {
  7608. return value === value && !isObject(value);
  7609. }
  7610. /**
  7611. * A specialized version of `matchesProperty` for source values suitable
  7612. * for strict equality comparisons, i.e. `===`.
  7613. *
  7614. * @private
  7615. * @param {string} key The key of the property to get.
  7616. * @param {*} srcValue The value to match.
  7617. * @returns {Function} Returns the new spec function.
  7618. */
  7619. function matchesStrictComparable(key, srcValue) {
  7620. return function(object) {
  7621. if (object == null) {
  7622. return false;
  7623. }
  7624. return object[key] === srcValue &&
  7625. (srcValue !== undefined || (key in Object(object)));
  7626. };
  7627. }
  7628. /**
  7629. * A specialized version of `_.memoize` which clears the memoized function's
  7630. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7631. *
  7632. * @private
  7633. * @param {Function} func The function to have its output memoized.
  7634. * @returns {Function} Returns the new memoized function.
  7635. */
  7636. function memoizeCapped(func) {
  7637. var result = memoize(func, function(key) {
  7638. if (cache.size === MAX_MEMOIZE_SIZE) {
  7639. cache.clear();
  7640. }
  7641. return key;
  7642. });
  7643. var cache = result.cache;
  7644. return result;
  7645. }
  7646. /**
  7647. * Merges the function metadata of `source` into `data`.
  7648. *
  7649. * Merging metadata reduces the number of wrappers used to invoke a function.
  7650. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7651. * may be applied regardless of execution order. Methods like `_.ary` and
  7652. * `_.rearg` modify function arguments, making the order in which they are
  7653. * executed important, preventing the merging of metadata. However, we make
  7654. * an exception for a safe combined case where curried functions have `_.ary`
  7655. * and or `_.rearg` applied.
  7656. *
  7657. * @private
  7658. * @param {Array} data The destination metadata.
  7659. * @param {Array} source The source metadata.
  7660. * @returns {Array} Returns `data`.
  7661. */
  7662. function mergeData(data, source) {
  7663. var bitmask = data[1],
  7664. srcBitmask = source[1],
  7665. newBitmask = bitmask | srcBitmask,
  7666. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7667. var isCombo =
  7668. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7669. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7670. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7671. // Exit early if metadata can't be merged.
  7672. if (!(isCommon || isCombo)) {
  7673. return data;
  7674. }
  7675. // Use source `thisArg` if available.
  7676. if (srcBitmask & WRAP_BIND_FLAG) {
  7677. data[2] = source[2];
  7678. // Set when currying a bound function.
  7679. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7680. }
  7681. // Compose partial arguments.
  7682. var value = source[3];
  7683. if (value) {
  7684. var partials = data[3];
  7685. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7686. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7687. }
  7688. // Compose partial right arguments.
  7689. value = source[5];
  7690. if (value) {
  7691. partials = data[5];
  7692. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7693. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7694. }
  7695. // Use source `argPos` if available.
  7696. value = source[7];
  7697. if (value) {
  7698. data[7] = value;
  7699. }
  7700. // Use source `ary` if it's smaller.
  7701. if (srcBitmask & WRAP_ARY_FLAG) {
  7702. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7703. }
  7704. // Use source `arity` if one is not provided.
  7705. if (data[9] == null) {
  7706. data[9] = source[9];
  7707. }
  7708. // Use source `func` and merge bitmasks.
  7709. data[0] = source[0];
  7710. data[1] = newBitmask;
  7711. return data;
  7712. }
  7713. /**
  7714. * This function is like
  7715. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7716. * except that it includes inherited enumerable properties.
  7717. *
  7718. * @private
  7719. * @param {Object} object The object to query.
  7720. * @returns {Array} Returns the array of property names.
  7721. */
  7722. function nativeKeysIn(object) {
  7723. var result = [];
  7724. if (object != null) {
  7725. for (var key in Object(object)) {
  7726. result.push(key);
  7727. }
  7728. }
  7729. return result;
  7730. }
  7731. /**
  7732. * Converts `value` to a string using `Object.prototype.toString`.
  7733. *
  7734. * @private
  7735. * @param {*} value The value to convert.
  7736. * @returns {string} Returns the converted string.
  7737. */
  7738. function objectToString(value) {
  7739. return nativeObjectToString.call(value);
  7740. }
  7741. /**
  7742. * A specialized version of `baseRest` which transforms the rest array.
  7743. *
  7744. * @private
  7745. * @param {Function} func The function to apply a rest parameter to.
  7746. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7747. * @param {Function} transform The rest array transform.
  7748. * @returns {Function} Returns the new function.
  7749. */
  7750. function overRest(func, start, transform) {
  7751. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7752. return function() {
  7753. var args = arguments,
  7754. index = -1,
  7755. length = nativeMax(args.length - start, 0),
  7756. array = Array(length);
  7757. while (++index < length) {
  7758. array[index] = args[start + index];
  7759. }
  7760. index = -1;
  7761. var otherArgs = Array(start + 1);
  7762. while (++index < start) {
  7763. otherArgs[index] = args[index];
  7764. }
  7765. otherArgs[start] = transform(array);
  7766. return apply(func, this, otherArgs);
  7767. };
  7768. }
  7769. /**
  7770. * Gets the parent value at `path` of `object`.
  7771. *
  7772. * @private
  7773. * @param {Object} object The object to query.
  7774. * @param {Array} path The path to get the parent value of.
  7775. * @returns {*} Returns the parent value.
  7776. */
  7777. function parent(object, path) {
  7778. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7779. }
  7780. /**
  7781. * Reorder `array` according to the specified indexes where the element at
  7782. * the first index is assigned as the first element, the element at
  7783. * the second index is assigned as the second element, and so on.
  7784. *
  7785. * @private
  7786. * @param {Array} array The array to reorder.
  7787. * @param {Array} indexes The arranged array indexes.
  7788. * @returns {Array} Returns `array`.
  7789. */
  7790. function reorder(array, indexes) {
  7791. var arrLength = array.length,
  7792. length = nativeMin(indexes.length, arrLength),
  7793. oldArray = copyArray(array);
  7794. while (length--) {
  7795. var index = indexes[length];
  7796. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7797. }
  7798. return array;
  7799. }
  7800. /**
  7801. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7802. *
  7803. * @private
  7804. * @param {Object} object The object to query.
  7805. * @param {string} key The key of the property to get.
  7806. * @returns {*} Returns the property value.
  7807. */
  7808. function safeGet(object, key) {
  7809. if (key === 'constructor' && typeof object[key] === 'function') {
  7810. return;
  7811. }
  7812. if (key == '__proto__') {
  7813. return;
  7814. }
  7815. return object[key];
  7816. }
  7817. /**
  7818. * Sets metadata for `func`.
  7819. *
  7820. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7821. * period of time, it will trip its breaker and transition to an identity
  7822. * function to avoid garbage collection pauses in V8. See
  7823. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7824. * for more details.
  7825. *
  7826. * @private
  7827. * @param {Function} func The function to associate metadata with.
  7828. * @param {*} data The metadata.
  7829. * @returns {Function} Returns `func`.
  7830. */
  7831. var setData = shortOut(baseSetData);
  7832. /**
  7833. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7834. *
  7835. * @private
  7836. * @param {Function} func The function to delay.
  7837. * @param {number} wait The number of milliseconds to delay invocation.
  7838. * @returns {number|Object} Returns the timer id or timeout object.
  7839. */
  7840. var setTimeout = ctxSetTimeout || function(func, wait) {
  7841. return root.setTimeout(func, wait);
  7842. };
  7843. /**
  7844. * Sets the `toString` method of `func` to return `string`.
  7845. *
  7846. * @private
  7847. * @param {Function} func The function to modify.
  7848. * @param {Function} string The `toString` result.
  7849. * @returns {Function} Returns `func`.
  7850. */
  7851. var setToString = shortOut(baseSetToString);
  7852. /**
  7853. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7854. * with wrapper details in a comment at the top of the source body.
  7855. *
  7856. * @private
  7857. * @param {Function} wrapper The function to modify.
  7858. * @param {Function} reference The reference function.
  7859. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7860. * @returns {Function} Returns `wrapper`.
  7861. */
  7862. function setWrapToString(wrapper, reference, bitmask) {
  7863. var source = (reference + '');
  7864. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7865. }
  7866. /**
  7867. * Creates a function that'll short out and invoke `identity` instead
  7868. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7869. * milliseconds.
  7870. *
  7871. * @private
  7872. * @param {Function} func The function to restrict.
  7873. * @returns {Function} Returns the new shortable function.
  7874. */
  7875. function shortOut(func) {
  7876. var count = 0,
  7877. lastCalled = 0;
  7878. return function() {
  7879. var stamp = nativeNow(),
  7880. remaining = HOT_SPAN - (stamp - lastCalled);
  7881. lastCalled = stamp;
  7882. if (remaining > 0) {
  7883. if (++count >= HOT_COUNT) {
  7884. return arguments[0];
  7885. }
  7886. } else {
  7887. count = 0;
  7888. }
  7889. return func.apply(undefined, arguments);
  7890. };
  7891. }
  7892. /**
  7893. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7894. *
  7895. * @private
  7896. * @param {Array} array The array to shuffle.
  7897. * @param {number} [size=array.length] The size of `array`.
  7898. * @returns {Array} Returns `array`.
  7899. */
  7900. function shuffleSelf(array, size) {
  7901. var index = -1,
  7902. length = array.length,
  7903. lastIndex = length - 1;
  7904. size = size === undefined ? length : size;
  7905. while (++index < size) {
  7906. var rand = baseRandom(index, lastIndex),
  7907. value = array[rand];
  7908. array[rand] = array[index];
  7909. array[index] = value;
  7910. }
  7911. array.length = size;
  7912. return array;
  7913. }
  7914. /**
  7915. * Converts `string` to a property path array.
  7916. *
  7917. * @private
  7918. * @param {string} string The string to convert.
  7919. * @returns {Array} Returns the property path array.
  7920. */
  7921. var stringToPath = memoizeCapped(function(string) {
  7922. var result = [];
  7923. if (string.charCodeAt(0) === 46 /* . */) {
  7924. result.push('');
  7925. }
  7926. string.replace(rePropName, function(match, number, quote, subString) {
  7927. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7928. });
  7929. return result;
  7930. });
  7931. /**
  7932. * Converts `value` to a string key if it's not a string or symbol.
  7933. *
  7934. * @private
  7935. * @param {*} value The value to inspect.
  7936. * @returns {string|symbol} Returns the key.
  7937. */
  7938. function toKey(value) {
  7939. if (typeof value == 'string' || isSymbol(value)) {
  7940. return value;
  7941. }
  7942. var result = (value + '');
  7943. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7944. }
  7945. /**
  7946. * Converts `func` to its source code.
  7947. *
  7948. * @private
  7949. * @param {Function} func The function to convert.
  7950. * @returns {string} Returns the source code.
  7951. */
  7952. function toSource(func) {
  7953. if (func != null) {
  7954. try {
  7955. return funcToString.call(func);
  7956. } catch (e) {}
  7957. try {
  7958. return (func + '');
  7959. } catch (e) {}
  7960. }
  7961. return '';
  7962. }
  7963. /**
  7964. * Updates wrapper `details` based on `bitmask` flags.
  7965. *
  7966. * @private
  7967. * @returns {Array} details The details to modify.
  7968. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7969. * @returns {Array} Returns `details`.
  7970. */
  7971. function updateWrapDetails(details, bitmask) {
  7972. arrayEach(wrapFlags, function(pair) {
  7973. var value = '_.' + pair[0];
  7974. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7975. details.push(value);
  7976. }
  7977. });
  7978. return details.sort();
  7979. }
  7980. /**
  7981. * Creates a clone of `wrapper`.
  7982. *
  7983. * @private
  7984. * @param {Object} wrapper The wrapper to clone.
  7985. * @returns {Object} Returns the cloned wrapper.
  7986. */
  7987. function wrapperClone(wrapper) {
  7988. if (wrapper instanceof LazyWrapper) {
  7989. return wrapper.clone();
  7990. }
  7991. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7992. result.__actions__ = copyArray(wrapper.__actions__);
  7993. result.__index__ = wrapper.__index__;
  7994. result.__values__ = wrapper.__values__;
  7995. return result;
  7996. }
  7997. /*------------------------------------------------------------------------*/
  7998. /**
  7999. * Creates an array of elements split into groups the length of `size`.
  8000. * If `array` can't be split evenly, the final chunk will be the remaining
  8001. * elements.
  8002. *
  8003. * @static
  8004. * @memberOf _
  8005. * @since 3.0.0
  8006. * @category Array
  8007. * @param {Array} array The array to process.
  8008. * @param {number} [size=1] The length of each chunk
  8009. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8010. * @returns {Array} Returns the new array of chunks.
  8011. * @example
  8012. *
  8013. * _.chunk(['a', 'b', 'c', 'd'], 2);
  8014. * // => [['a', 'b'], ['c', 'd']]
  8015. *
  8016. * _.chunk(['a', 'b', 'c', 'd'], 3);
  8017. * // => [['a', 'b', 'c'], ['d']]
  8018. */
  8019. function chunk(array, size, guard) {
  8020. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  8021. size = 1;
  8022. } else {
  8023. size = nativeMax(toInteger(size), 0);
  8024. }
  8025. var length = array == null ? 0 : array.length;
  8026. if (!length || size < 1) {
  8027. return [];
  8028. }
  8029. var index = 0,
  8030. resIndex = 0,
  8031. result = Array(nativeCeil(length / size));
  8032. while (index < length) {
  8033. result[resIndex++] = baseSlice(array, index, (index += size));
  8034. }
  8035. return result;
  8036. }
  8037. /**
  8038. * Creates an array with all falsey values removed. The values `false`, `null`,
  8039. * `0`, `""`, `undefined`, and `NaN` are falsey.
  8040. *
  8041. * @static
  8042. * @memberOf _
  8043. * @since 0.1.0
  8044. * @category Array
  8045. * @param {Array} array The array to compact.
  8046. * @returns {Array} Returns the new array of filtered values.
  8047. * @example
  8048. *
  8049. * _.compact([0, 1, false, 2, '', 3]);
  8050. * // => [1, 2, 3]
  8051. */
  8052. function compact(array) {
  8053. var index = -1,
  8054. length = array == null ? 0 : array.length,
  8055. resIndex = 0,
  8056. result = [];
  8057. while (++index < length) {
  8058. var value = array[index];
  8059. if (value) {
  8060. result[resIndex++] = value;
  8061. }
  8062. }
  8063. return result;
  8064. }
  8065. /**
  8066. * Creates a new array concatenating `array` with any additional arrays
  8067. * and/or values.
  8068. *
  8069. * @static
  8070. * @memberOf _
  8071. * @since 4.0.0
  8072. * @category Array
  8073. * @param {Array} array The array to concatenate.
  8074. * @param {...*} [values] The values to concatenate.
  8075. * @returns {Array} Returns the new concatenated array.
  8076. * @example
  8077. *
  8078. * var array = [1];
  8079. * var other = _.concat(array, 2, [3], [[4]]);
  8080. *
  8081. * console.log(other);
  8082. * // => [1, 2, 3, [4]]
  8083. *
  8084. * console.log(array);
  8085. * // => [1]
  8086. */
  8087. function concat() {
  8088. var length = arguments.length;
  8089. if (!length) {
  8090. return [];
  8091. }
  8092. var args = Array(length - 1),
  8093. array = arguments[0],
  8094. index = length;
  8095. while (index--) {
  8096. args[index - 1] = arguments[index];
  8097. }
  8098. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  8099. }
  8100. /**
  8101. * Creates an array of `array` values not included in the other given arrays
  8102. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8103. * for equality comparisons. The order and references of result values are
  8104. * determined by the first array.
  8105. *
  8106. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  8107. *
  8108. * @static
  8109. * @memberOf _
  8110. * @since 0.1.0
  8111. * @category Array
  8112. * @param {Array} array The array to inspect.
  8113. * @param {...Array} [values] The values to exclude.
  8114. * @returns {Array} Returns the new array of filtered values.
  8115. * @see _.without, _.xor
  8116. * @example
  8117. *
  8118. * _.difference([2, 1], [2, 3]);
  8119. * // => [1]
  8120. */
  8121. var difference = baseRest(function(array, values) {
  8122. return isArrayLikeObject(array)
  8123. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  8124. : [];
  8125. });
  8126. /**
  8127. * This method is like `_.difference` except that it accepts `iteratee` which
  8128. * is invoked for each element of `array` and `values` to generate the criterion
  8129. * by which they're compared. The order and references of result values are
  8130. * determined by the first array. The iteratee is invoked with one argument:
  8131. * (value).
  8132. *
  8133. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  8134. *
  8135. * @static
  8136. * @memberOf _
  8137. * @since 4.0.0
  8138. * @category Array
  8139. * @param {Array} array The array to inspect.
  8140. * @param {...Array} [values] The values to exclude.
  8141. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8142. * @returns {Array} Returns the new array of filtered values.
  8143. * @example
  8144. *
  8145. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8146. * // => [1.2]
  8147. *
  8148. * // The `_.property` iteratee shorthand.
  8149. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  8150. * // => [{ 'x': 2 }]
  8151. */
  8152. var differenceBy = baseRest(function(array, values) {
  8153. var iteratee = last(values);
  8154. if (isArrayLikeObject(iteratee)) {
  8155. iteratee = undefined;
  8156. }
  8157. return isArrayLikeObject(array)
  8158. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  8159. : [];
  8160. });
  8161. /**
  8162. * This method is like `_.difference` except that it accepts `comparator`
  8163. * which is invoked to compare elements of `array` to `values`. The order and
  8164. * references of result values are determined by the first array. The comparator
  8165. * is invoked with two arguments: (arrVal, othVal).
  8166. *
  8167. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  8168. *
  8169. * @static
  8170. * @memberOf _
  8171. * @since 4.0.0
  8172. * @category Array
  8173. * @param {Array} array The array to inspect.
  8174. * @param {...Array} [values] The values to exclude.
  8175. * @param {Function} [comparator] The comparator invoked per element.
  8176. * @returns {Array} Returns the new array of filtered values.
  8177. * @example
  8178. *
  8179. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8180. *
  8181. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  8182. * // => [{ 'x': 2, 'y': 1 }]
  8183. */
  8184. var differenceWith = baseRest(function(array, values) {
  8185. var comparator = last(values);
  8186. if (isArrayLikeObject(comparator)) {
  8187. comparator = undefined;
  8188. }
  8189. return isArrayLikeObject(array)
  8190. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  8191. : [];
  8192. });
  8193. /**
  8194. * Creates a slice of `array` with `n` elements dropped from the beginning.
  8195. *
  8196. * @static
  8197. * @memberOf _
  8198. * @since 0.5.0
  8199. * @category Array
  8200. * @param {Array} array The array to query.
  8201. * @param {number} [n=1] The number of elements to drop.
  8202. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8203. * @returns {Array} Returns the slice of `array`.
  8204. * @example
  8205. *
  8206. * _.drop([1, 2, 3]);
  8207. * // => [2, 3]
  8208. *
  8209. * _.drop([1, 2, 3], 2);
  8210. * // => [3]
  8211. *
  8212. * _.drop([1, 2, 3], 5);
  8213. * // => []
  8214. *
  8215. * _.drop([1, 2, 3], 0);
  8216. * // => [1, 2, 3]
  8217. */
  8218. function drop(array, n, guard) {
  8219. var length = array == null ? 0 : array.length;
  8220. if (!length) {
  8221. return [];
  8222. }
  8223. n = (guard || n === undefined) ? 1 : toInteger(n);
  8224. return baseSlice(array, n < 0 ? 0 : n, length);
  8225. }
  8226. /**
  8227. * Creates a slice of `array` with `n` elements dropped from the end.
  8228. *
  8229. * @static
  8230. * @memberOf _
  8231. * @since 3.0.0
  8232. * @category Array
  8233. * @param {Array} array The array to query.
  8234. * @param {number} [n=1] The number of elements to drop.
  8235. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8236. * @returns {Array} Returns the slice of `array`.
  8237. * @example
  8238. *
  8239. * _.dropRight([1, 2, 3]);
  8240. * // => [1, 2]
  8241. *
  8242. * _.dropRight([1, 2, 3], 2);
  8243. * // => [1]
  8244. *
  8245. * _.dropRight([1, 2, 3], 5);
  8246. * // => []
  8247. *
  8248. * _.dropRight([1, 2, 3], 0);
  8249. * // => [1, 2, 3]
  8250. */
  8251. function dropRight(array, n, guard) {
  8252. var length = array == null ? 0 : array.length;
  8253. if (!length) {
  8254. return [];
  8255. }
  8256. n = (guard || n === undefined) ? 1 : toInteger(n);
  8257. n = length - n;
  8258. return baseSlice(array, 0, n < 0 ? 0 : n);
  8259. }
  8260. /**
  8261. * Creates a slice of `array` excluding elements dropped from the end.
  8262. * Elements are dropped until `predicate` returns falsey. The predicate is
  8263. * invoked with three arguments: (value, index, array).
  8264. *
  8265. * @static
  8266. * @memberOf _
  8267. * @since 3.0.0
  8268. * @category Array
  8269. * @param {Array} array The array to query.
  8270. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8271. * @returns {Array} Returns the slice of `array`.
  8272. * @example
  8273. *
  8274. * var users = [
  8275. * { 'user': 'barney', 'active': true },
  8276. * { 'user': 'fred', 'active': false },
  8277. * { 'user': 'pebbles', 'active': false }
  8278. * ];
  8279. *
  8280. * _.dropRightWhile(users, function(o) { return !o.active; });
  8281. * // => objects for ['barney']
  8282. *
  8283. * // The `_.matches` iteratee shorthand.
  8284. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  8285. * // => objects for ['barney', 'fred']
  8286. *
  8287. * // The `_.matchesProperty` iteratee shorthand.
  8288. * _.dropRightWhile(users, ['active', false]);
  8289. * // => objects for ['barney']
  8290. *
  8291. * // The `_.property` iteratee shorthand.
  8292. * _.dropRightWhile(users, 'active');
  8293. * // => objects for ['barney', 'fred', 'pebbles']
  8294. */
  8295. function dropRightWhile(array, predicate) {
  8296. return (array && array.length)
  8297. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  8298. : [];
  8299. }
  8300. /**
  8301. * Creates a slice of `array` excluding elements dropped from the beginning.
  8302. * Elements are dropped until `predicate` returns falsey. The predicate is
  8303. * invoked with three arguments: (value, index, array).
  8304. *
  8305. * @static
  8306. * @memberOf _
  8307. * @since 3.0.0
  8308. * @category Array
  8309. * @param {Array} array The array to query.
  8310. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8311. * @returns {Array} Returns the slice of `array`.
  8312. * @example
  8313. *
  8314. * var users = [
  8315. * { 'user': 'barney', 'active': false },
  8316. * { 'user': 'fred', 'active': false },
  8317. * { 'user': 'pebbles', 'active': true }
  8318. * ];
  8319. *
  8320. * _.dropWhile(users, function(o) { return !o.active; });
  8321. * // => objects for ['pebbles']
  8322. *
  8323. * // The `_.matches` iteratee shorthand.
  8324. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  8325. * // => objects for ['fred', 'pebbles']
  8326. *
  8327. * // The `_.matchesProperty` iteratee shorthand.
  8328. * _.dropWhile(users, ['active', false]);
  8329. * // => objects for ['pebbles']
  8330. *
  8331. * // The `_.property` iteratee shorthand.
  8332. * _.dropWhile(users, 'active');
  8333. * // => objects for ['barney', 'fred', 'pebbles']
  8334. */
  8335. function dropWhile(array, predicate) {
  8336. return (array && array.length)
  8337. ? baseWhile(array, getIteratee(predicate, 3), true)
  8338. : [];
  8339. }
  8340. /**
  8341. * Fills elements of `array` with `value` from `start` up to, but not
  8342. * including, `end`.
  8343. *
  8344. * **Note:** This method mutates `array`.
  8345. *
  8346. * @static
  8347. * @memberOf _
  8348. * @since 3.2.0
  8349. * @category Array
  8350. * @param {Array} array The array to fill.
  8351. * @param {*} value The value to fill `array` with.
  8352. * @param {number} [start=0] The start position.
  8353. * @param {number} [end=array.length] The end position.
  8354. * @returns {Array} Returns `array`.
  8355. * @example
  8356. *
  8357. * var array = [1, 2, 3];
  8358. *
  8359. * _.fill(array, 'a');
  8360. * console.log(array);
  8361. * // => ['a', 'a', 'a']
  8362. *
  8363. * _.fill(Array(3), 2);
  8364. * // => [2, 2, 2]
  8365. *
  8366. * _.fill([4, 6, 8, 10], '*', 1, 3);
  8367. * // => [4, '*', '*', 10]
  8368. */
  8369. function fill(array, value, start, end) {
  8370. var length = array == null ? 0 : array.length;
  8371. if (!length) {
  8372. return [];
  8373. }
  8374. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  8375. start = 0;
  8376. end = length;
  8377. }
  8378. return baseFill(array, value, start, end);
  8379. }
  8380. /**
  8381. * This method is like `_.find` except that it returns the index of the first
  8382. * element `predicate` returns truthy for instead of the element itself.
  8383. *
  8384. * @static
  8385. * @memberOf _
  8386. * @since 1.1.0
  8387. * @category Array
  8388. * @param {Array} array The array to inspect.
  8389. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8390. * @param {number} [fromIndex=0] The index to search from.
  8391. * @returns {number} Returns the index of the found element, else `-1`.
  8392. * @example
  8393. *
  8394. * var users = [
  8395. * { 'user': 'barney', 'active': false },
  8396. * { 'user': 'fred', 'active': false },
  8397. * { 'user': 'pebbles', 'active': true }
  8398. * ];
  8399. *
  8400. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  8401. * // => 0
  8402. *
  8403. * // The `_.matches` iteratee shorthand.
  8404. * _.findIndex(users, { 'user': 'fred', 'active': false });
  8405. * // => 1
  8406. *
  8407. * // The `_.matchesProperty` iteratee shorthand.
  8408. * _.findIndex(users, ['active', false]);
  8409. * // => 0
  8410. *
  8411. * // The `_.property` iteratee shorthand.
  8412. * _.findIndex(users, 'active');
  8413. * // => 2
  8414. */
  8415. function findIndex(array, predicate, fromIndex) {
  8416. var length = array == null ? 0 : array.length;
  8417. if (!length) {
  8418. return -1;
  8419. }
  8420. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8421. if (index < 0) {
  8422. index = nativeMax(length + index, 0);
  8423. }
  8424. return baseFindIndex(array, getIteratee(predicate, 3), index);
  8425. }
  8426. /**
  8427. * This method is like `_.findIndex` except that it iterates over elements
  8428. * of `collection` from right to left.
  8429. *
  8430. * @static
  8431. * @memberOf _
  8432. * @since 2.0.0
  8433. * @category Array
  8434. * @param {Array} array The array to inspect.
  8435. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8436. * @param {number} [fromIndex=array.length-1] The index to search from.
  8437. * @returns {number} Returns the index of the found element, else `-1`.
  8438. * @example
  8439. *
  8440. * var users = [
  8441. * { 'user': 'barney', 'active': true },
  8442. * { 'user': 'fred', 'active': false },
  8443. * { 'user': 'pebbles', 'active': false }
  8444. * ];
  8445. *
  8446. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  8447. * // => 2
  8448. *
  8449. * // The `_.matches` iteratee shorthand.
  8450. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  8451. * // => 0
  8452. *
  8453. * // The `_.matchesProperty` iteratee shorthand.
  8454. * _.findLastIndex(users, ['active', false]);
  8455. * // => 2
  8456. *
  8457. * // The `_.property` iteratee shorthand.
  8458. * _.findLastIndex(users, 'active');
  8459. * // => 0
  8460. */
  8461. function findLastIndex(array, predicate, fromIndex) {
  8462. var length = array == null ? 0 : array.length;
  8463. if (!length) {
  8464. return -1;
  8465. }
  8466. var index = length - 1;
  8467. if (fromIndex !== undefined) {
  8468. index = toInteger(fromIndex);
  8469. index = fromIndex < 0
  8470. ? nativeMax(length + index, 0)
  8471. : nativeMin(index, length - 1);
  8472. }
  8473. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  8474. }
  8475. /**
  8476. * Flattens `array` a single level deep.
  8477. *
  8478. * @static
  8479. * @memberOf _
  8480. * @since 0.1.0
  8481. * @category Array
  8482. * @param {Array} array The array to flatten.
  8483. * @returns {Array} Returns the new flattened array.
  8484. * @example
  8485. *
  8486. * _.flatten([1, [2, [3, [4]], 5]]);
  8487. * // => [1, 2, [3, [4]], 5]
  8488. */
  8489. function flatten(array) {
  8490. var length = array == null ? 0 : array.length;
  8491. return length ? baseFlatten(array, 1) : [];
  8492. }
  8493. /**
  8494. * Recursively flattens `array`.
  8495. *
  8496. * @static
  8497. * @memberOf _
  8498. * @since 3.0.0
  8499. * @category Array
  8500. * @param {Array} array The array to flatten.
  8501. * @returns {Array} Returns the new flattened array.
  8502. * @example
  8503. *
  8504. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8505. * // => [1, 2, 3, 4, 5]
  8506. */
  8507. function flattenDeep(array) {
  8508. var length = array == null ? 0 : array.length;
  8509. return length ? baseFlatten(array, INFINITY) : [];
  8510. }
  8511. /**
  8512. * Recursively flatten `array` up to `depth` times.
  8513. *
  8514. * @static
  8515. * @memberOf _
  8516. * @since 4.4.0
  8517. * @category Array
  8518. * @param {Array} array The array to flatten.
  8519. * @param {number} [depth=1] The maximum recursion depth.
  8520. * @returns {Array} Returns the new flattened array.
  8521. * @example
  8522. *
  8523. * var array = [1, [2, [3, [4]], 5]];
  8524. *
  8525. * _.flattenDepth(array, 1);
  8526. * // => [1, 2, [3, [4]], 5]
  8527. *
  8528. * _.flattenDepth(array, 2);
  8529. * // => [1, 2, 3, [4], 5]
  8530. */
  8531. function flattenDepth(array, depth) {
  8532. var length = array == null ? 0 : array.length;
  8533. if (!length) {
  8534. return [];
  8535. }
  8536. depth = depth === undefined ? 1 : toInteger(depth);
  8537. return baseFlatten(array, depth);
  8538. }
  8539. /**
  8540. * The inverse of `_.toPairs`; this method returns an object composed
  8541. * from key-value `pairs`.
  8542. *
  8543. * @static
  8544. * @memberOf _
  8545. * @since 4.0.0
  8546. * @category Array
  8547. * @param {Array} pairs The key-value pairs.
  8548. * @returns {Object} Returns the new object.
  8549. * @example
  8550. *
  8551. * _.fromPairs([['a', 1], ['b', 2]]);
  8552. * // => { 'a': 1, 'b': 2 }
  8553. */
  8554. function fromPairs(pairs) {
  8555. var index = -1,
  8556. length = pairs == null ? 0 : pairs.length,
  8557. result = {};
  8558. while (++index < length) {
  8559. var pair = pairs[index];
  8560. result[pair[0]] = pair[1];
  8561. }
  8562. return result;
  8563. }
  8564. /**
  8565. * Gets the first element of `array`.
  8566. *
  8567. * @static
  8568. * @memberOf _
  8569. * @since 0.1.0
  8570. * @alias first
  8571. * @category Array
  8572. * @param {Array} array The array to query.
  8573. * @returns {*} Returns the first element of `array`.
  8574. * @example
  8575. *
  8576. * _.head([1, 2, 3]);
  8577. * // => 1
  8578. *
  8579. * _.head([]);
  8580. * // => undefined
  8581. */
  8582. function head(array) {
  8583. return (array && array.length) ? array[0] : undefined;
  8584. }
  8585. /**
  8586. * Gets the index at which the first occurrence of `value` is found in `array`
  8587. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8588. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8589. * offset from the end of `array`.
  8590. *
  8591. * @static
  8592. * @memberOf _
  8593. * @since 0.1.0
  8594. * @category Array
  8595. * @param {Array} array The array to inspect.
  8596. * @param {*} value The value to search for.
  8597. * @param {number} [fromIndex=0] The index to search from.
  8598. * @returns {number} Returns the index of the matched value, else `-1`.
  8599. * @example
  8600. *
  8601. * _.indexOf([1, 2, 1, 2], 2);
  8602. * // => 1
  8603. *
  8604. * // Search from the `fromIndex`.
  8605. * _.indexOf([1, 2, 1, 2], 2, 2);
  8606. * // => 3
  8607. */
  8608. function indexOf(array, value, fromIndex) {
  8609. var length = array == null ? 0 : array.length;
  8610. if (!length) {
  8611. return -1;
  8612. }
  8613. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8614. if (index < 0) {
  8615. index = nativeMax(length + index, 0);
  8616. }
  8617. return baseIndexOf(array, value, index);
  8618. }
  8619. /**
  8620. * Gets all but the last element of `array`.
  8621. *
  8622. * @static
  8623. * @memberOf _
  8624. * @since 0.1.0
  8625. * @category Array
  8626. * @param {Array} array The array to query.
  8627. * @returns {Array} Returns the slice of `array`.
  8628. * @example
  8629. *
  8630. * _.initial([1, 2, 3]);
  8631. * // => [1, 2]
  8632. */
  8633. function initial(array) {
  8634. var length = array == null ? 0 : array.length;
  8635. return length ? baseSlice(array, 0, -1) : [];
  8636. }
  8637. /**
  8638. * Creates an array of unique values that are included in all given arrays
  8639. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8640. * for equality comparisons. The order and references of result values are
  8641. * determined by the first array.
  8642. *
  8643. * @static
  8644. * @memberOf _
  8645. * @since 0.1.0
  8646. * @category Array
  8647. * @param {...Array} [arrays] The arrays to inspect.
  8648. * @returns {Array} Returns the new array of intersecting values.
  8649. * @example
  8650. *
  8651. * _.intersection([2, 1], [2, 3]);
  8652. * // => [2]
  8653. */
  8654. var intersection = baseRest(function(arrays) {
  8655. var mapped = arrayMap(arrays, castArrayLikeObject);
  8656. return (mapped.length && mapped[0] === arrays[0])
  8657. ? baseIntersection(mapped)
  8658. : [];
  8659. });
  8660. /**
  8661. * This method is like `_.intersection` except that it accepts `iteratee`
  8662. * which is invoked for each element of each `arrays` to generate the criterion
  8663. * by which they're compared. The order and references of result values are
  8664. * determined by the first array. The iteratee is invoked with one argument:
  8665. * (value).
  8666. *
  8667. * @static
  8668. * @memberOf _
  8669. * @since 4.0.0
  8670. * @category Array
  8671. * @param {...Array} [arrays] The arrays to inspect.
  8672. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8673. * @returns {Array} Returns the new array of intersecting values.
  8674. * @example
  8675. *
  8676. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8677. * // => [2.1]
  8678. *
  8679. * // The `_.property` iteratee shorthand.
  8680. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8681. * // => [{ 'x': 1 }]
  8682. */
  8683. var intersectionBy = baseRest(function(arrays) {
  8684. var iteratee = last(arrays),
  8685. mapped = arrayMap(arrays, castArrayLikeObject);
  8686. if (iteratee === last(mapped)) {
  8687. iteratee = undefined;
  8688. } else {
  8689. mapped.pop();
  8690. }
  8691. return (mapped.length && mapped[0] === arrays[0])
  8692. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8693. : [];
  8694. });
  8695. /**
  8696. * This method is like `_.intersection` except that it accepts `comparator`
  8697. * which is invoked to compare elements of `arrays`. The order and references
  8698. * of result values are determined by the first array. The comparator is
  8699. * invoked with two arguments: (arrVal, othVal).
  8700. *
  8701. * @static
  8702. * @memberOf _
  8703. * @since 4.0.0
  8704. * @category Array
  8705. * @param {...Array} [arrays] The arrays to inspect.
  8706. * @param {Function} [comparator] The comparator invoked per element.
  8707. * @returns {Array} Returns the new array of intersecting values.
  8708. * @example
  8709. *
  8710. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8711. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8712. *
  8713. * _.intersectionWith(objects, others, _.isEqual);
  8714. * // => [{ 'x': 1, 'y': 2 }]
  8715. */
  8716. var intersectionWith = baseRest(function(arrays) {
  8717. var comparator = last(arrays),
  8718. mapped = arrayMap(arrays, castArrayLikeObject);
  8719. comparator = typeof comparator == 'function' ? comparator : undefined;
  8720. if (comparator) {
  8721. mapped.pop();
  8722. }
  8723. return (mapped.length && mapped[0] === arrays[0])
  8724. ? baseIntersection(mapped, undefined, comparator)
  8725. : [];
  8726. });
  8727. /**
  8728. * Converts all elements in `array` into a string separated by `separator`.
  8729. *
  8730. * @static
  8731. * @memberOf _
  8732. * @since 4.0.0
  8733. * @category Array
  8734. * @param {Array} array The array to convert.
  8735. * @param {string} [separator=','] The element separator.
  8736. * @returns {string} Returns the joined string.
  8737. * @example
  8738. *
  8739. * _.join(['a', 'b', 'c'], '~');
  8740. * // => 'a~b~c'
  8741. */
  8742. function join(array, separator) {
  8743. return array == null ? '' : nativeJoin.call(array, separator);
  8744. }
  8745. /**
  8746. * Gets the last element of `array`.
  8747. *
  8748. * @static
  8749. * @memberOf _
  8750. * @since 0.1.0
  8751. * @category Array
  8752. * @param {Array} array The array to query.
  8753. * @returns {*} Returns the last element of `array`.
  8754. * @example
  8755. *
  8756. * _.last([1, 2, 3]);
  8757. * // => 3
  8758. */
  8759. function last(array) {
  8760. var length = array == null ? 0 : array.length;
  8761. return length ? array[length - 1] : undefined;
  8762. }
  8763. /**
  8764. * This method is like `_.indexOf` except that it iterates over elements of
  8765. * `array` from right to left.
  8766. *
  8767. * @static
  8768. * @memberOf _
  8769. * @since 0.1.0
  8770. * @category Array
  8771. * @param {Array} array The array to inspect.
  8772. * @param {*} value The value to search for.
  8773. * @param {number} [fromIndex=array.length-1] The index to search from.
  8774. * @returns {number} Returns the index of the matched value, else `-1`.
  8775. * @example
  8776. *
  8777. * _.lastIndexOf([1, 2, 1, 2], 2);
  8778. * // => 3
  8779. *
  8780. * // Search from the `fromIndex`.
  8781. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8782. * // => 1
  8783. */
  8784. function lastIndexOf(array, value, fromIndex) {
  8785. var length = array == null ? 0 : array.length;
  8786. if (!length) {
  8787. return -1;
  8788. }
  8789. var index = length;
  8790. if (fromIndex !== undefined) {
  8791. index = toInteger(fromIndex);
  8792. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8793. }
  8794. return value === value
  8795. ? strictLastIndexOf(array, value, index)
  8796. : baseFindIndex(array, baseIsNaN, index, true);
  8797. }
  8798. /**
  8799. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8800. * element from the end is returned.
  8801. *
  8802. * @static
  8803. * @memberOf _
  8804. * @since 4.11.0
  8805. * @category Array
  8806. * @param {Array} array The array to query.
  8807. * @param {number} [n=0] The index of the element to return.
  8808. * @returns {*} Returns the nth element of `array`.
  8809. * @example
  8810. *
  8811. * var array = ['a', 'b', 'c', 'd'];
  8812. *
  8813. * _.nth(array, 1);
  8814. * // => 'b'
  8815. *
  8816. * _.nth(array, -2);
  8817. * // => 'c';
  8818. */
  8819. function nth(array, n) {
  8820. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8821. }
  8822. /**
  8823. * Removes all given values from `array` using
  8824. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8825. * for equality comparisons.
  8826. *
  8827. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8828. * to remove elements from an array by predicate.
  8829. *
  8830. * @static
  8831. * @memberOf _
  8832. * @since 2.0.0
  8833. * @category Array
  8834. * @param {Array} array The array to modify.
  8835. * @param {...*} [values] The values to remove.
  8836. * @returns {Array} Returns `array`.
  8837. * @example
  8838. *
  8839. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8840. *
  8841. * _.pull(array, 'a', 'c');
  8842. * console.log(array);
  8843. * // => ['b', 'b']
  8844. */
  8845. var pull = baseRest(pullAll);
  8846. /**
  8847. * This method is like `_.pull` except that it accepts an array of values to remove.
  8848. *
  8849. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8850. *
  8851. * @static
  8852. * @memberOf _
  8853. * @since 4.0.0
  8854. * @category Array
  8855. * @param {Array} array The array to modify.
  8856. * @param {Array} values The values to remove.
  8857. * @returns {Array} Returns `array`.
  8858. * @example
  8859. *
  8860. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8861. *
  8862. * _.pullAll(array, ['a', 'c']);
  8863. * console.log(array);
  8864. * // => ['b', 'b']
  8865. */
  8866. function pullAll(array, values) {
  8867. return (array && array.length && values && values.length)
  8868. ? basePullAll(array, values)
  8869. : array;
  8870. }
  8871. /**
  8872. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8873. * invoked for each element of `array` and `values` to generate the criterion
  8874. * by which they're compared. The iteratee is invoked with one argument: (value).
  8875. *
  8876. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8877. *
  8878. * @static
  8879. * @memberOf _
  8880. * @since 4.0.0
  8881. * @category Array
  8882. * @param {Array} array The array to modify.
  8883. * @param {Array} values The values to remove.
  8884. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8885. * @returns {Array} Returns `array`.
  8886. * @example
  8887. *
  8888. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8889. *
  8890. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8891. * console.log(array);
  8892. * // => [{ 'x': 2 }]
  8893. */
  8894. function pullAllBy(array, values, iteratee) {
  8895. return (array && array.length && values && values.length)
  8896. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8897. : array;
  8898. }
  8899. /**
  8900. * This method is like `_.pullAll` except that it accepts `comparator` which
  8901. * is invoked to compare elements of `array` to `values`. The comparator is
  8902. * invoked with two arguments: (arrVal, othVal).
  8903. *
  8904. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8905. *
  8906. * @static
  8907. * @memberOf _
  8908. * @since 4.6.0
  8909. * @category Array
  8910. * @param {Array} array The array to modify.
  8911. * @param {Array} values The values to remove.
  8912. * @param {Function} [comparator] The comparator invoked per element.
  8913. * @returns {Array} Returns `array`.
  8914. * @example
  8915. *
  8916. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8917. *
  8918. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8919. * console.log(array);
  8920. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8921. */
  8922. function pullAllWith(array, values, comparator) {
  8923. return (array && array.length && values && values.length)
  8924. ? basePullAll(array, values, undefined, comparator)
  8925. : array;
  8926. }
  8927. /**
  8928. * Removes elements from `array` corresponding to `indexes` and returns an
  8929. * array of removed elements.
  8930. *
  8931. * **Note:** Unlike `_.at`, this method mutates `array`.
  8932. *
  8933. * @static
  8934. * @memberOf _
  8935. * @since 3.0.0
  8936. * @category Array
  8937. * @param {Array} array The array to modify.
  8938. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8939. * @returns {Array} Returns the new array of removed elements.
  8940. * @example
  8941. *
  8942. * var array = ['a', 'b', 'c', 'd'];
  8943. * var pulled = _.pullAt(array, [1, 3]);
  8944. *
  8945. * console.log(array);
  8946. * // => ['a', 'c']
  8947. *
  8948. * console.log(pulled);
  8949. * // => ['b', 'd']
  8950. */
  8951. var pullAt = flatRest(function(array, indexes) {
  8952. var length = array == null ? 0 : array.length,
  8953. result = baseAt(array, indexes);
  8954. basePullAt(array, arrayMap(indexes, function(index) {
  8955. return isIndex(index, length) ? +index : index;
  8956. }).sort(compareAscending));
  8957. return result;
  8958. });
  8959. /**
  8960. * Removes all elements from `array` that `predicate` returns truthy for
  8961. * and returns an array of the removed elements. The predicate is invoked
  8962. * with three arguments: (value, index, array).
  8963. *
  8964. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8965. * to pull elements from an array by value.
  8966. *
  8967. * @static
  8968. * @memberOf _
  8969. * @since 2.0.0
  8970. * @category Array
  8971. * @param {Array} array The array to modify.
  8972. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8973. * @returns {Array} Returns the new array of removed elements.
  8974. * @example
  8975. *
  8976. * var array = [1, 2, 3, 4];
  8977. * var evens = _.remove(array, function(n) {
  8978. * return n % 2 == 0;
  8979. * });
  8980. *
  8981. * console.log(array);
  8982. * // => [1, 3]
  8983. *
  8984. * console.log(evens);
  8985. * // => [2, 4]
  8986. */
  8987. function remove(array, predicate) {
  8988. var result = [];
  8989. if (!(array && array.length)) {
  8990. return result;
  8991. }
  8992. var index = -1,
  8993. indexes = [],
  8994. length = array.length;
  8995. predicate = getIteratee(predicate, 3);
  8996. while (++index < length) {
  8997. var value = array[index];
  8998. if (predicate(value, index, array)) {
  8999. result.push(value);
  9000. indexes.push(index);
  9001. }
  9002. }
  9003. basePullAt(array, indexes);
  9004. return result;
  9005. }
  9006. /**
  9007. * Reverses `array` so that the first element becomes the last, the second
  9008. * element becomes the second to last, and so on.
  9009. *
  9010. * **Note:** This method mutates `array` and is based on
  9011. * [`Array#reverse`](https://mdn.io/Array/reverse).
  9012. *
  9013. * @static
  9014. * @memberOf _
  9015. * @since 4.0.0
  9016. * @category Array
  9017. * @param {Array} array The array to modify.
  9018. * @returns {Array} Returns `array`.
  9019. * @example
  9020. *
  9021. * var array = [1, 2, 3];
  9022. *
  9023. * _.reverse(array);
  9024. * // => [3, 2, 1]
  9025. *
  9026. * console.log(array);
  9027. * // => [3, 2, 1]
  9028. */
  9029. function reverse(array) {
  9030. return array == null ? array : nativeReverse.call(array);
  9031. }
  9032. /**
  9033. * Creates a slice of `array` from `start` up to, but not including, `end`.
  9034. *
  9035. * **Note:** This method is used instead of
  9036. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  9037. * returned.
  9038. *
  9039. * @static
  9040. * @memberOf _
  9041. * @since 3.0.0
  9042. * @category Array
  9043. * @param {Array} array The array to slice.
  9044. * @param {number} [start=0] The start position.
  9045. * @param {number} [end=array.length] The end position.
  9046. * @returns {Array} Returns the slice of `array`.
  9047. */
  9048. function slice(array, start, end) {
  9049. var length = array == null ? 0 : array.length;
  9050. if (!length) {
  9051. return [];
  9052. }
  9053. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  9054. start = 0;
  9055. end = length;
  9056. }
  9057. else {
  9058. start = start == null ? 0 : toInteger(start);
  9059. end = end === undefined ? length : toInteger(end);
  9060. }
  9061. return baseSlice(array, start, end);
  9062. }
  9063. /**
  9064. * Uses a binary search to determine the lowest index at which `value`
  9065. * should be inserted into `array` in order to maintain its sort order.
  9066. *
  9067. * @static
  9068. * @memberOf _
  9069. * @since 0.1.0
  9070. * @category Array
  9071. * @param {Array} array The sorted array to inspect.
  9072. * @param {*} value The value to evaluate.
  9073. * @returns {number} Returns the index at which `value` should be inserted
  9074. * into `array`.
  9075. * @example
  9076. *
  9077. * _.sortedIndex([30, 50], 40);
  9078. * // => 1
  9079. */
  9080. function sortedIndex(array, value) {
  9081. return baseSortedIndex(array, value);
  9082. }
  9083. /**
  9084. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  9085. * which is invoked for `value` and each element of `array` to compute their
  9086. * sort ranking. The iteratee is invoked with one argument: (value).
  9087. *
  9088. * @static
  9089. * @memberOf _
  9090. * @since 4.0.0
  9091. * @category Array
  9092. * @param {Array} array The sorted array to inspect.
  9093. * @param {*} value The value to evaluate.
  9094. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9095. * @returns {number} Returns the index at which `value` should be inserted
  9096. * into `array`.
  9097. * @example
  9098. *
  9099. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  9100. *
  9101. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  9102. * // => 0
  9103. *
  9104. * // The `_.property` iteratee shorthand.
  9105. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  9106. * // => 0
  9107. */
  9108. function sortedIndexBy(array, value, iteratee) {
  9109. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  9110. }
  9111. /**
  9112. * This method is like `_.indexOf` except that it performs a binary
  9113. * search on a sorted `array`.
  9114. *
  9115. * @static
  9116. * @memberOf _
  9117. * @since 4.0.0
  9118. * @category Array
  9119. * @param {Array} array The array to inspect.
  9120. * @param {*} value The value to search for.
  9121. * @returns {number} Returns the index of the matched value, else `-1`.
  9122. * @example
  9123. *
  9124. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  9125. * // => 1
  9126. */
  9127. function sortedIndexOf(array, value) {
  9128. var length = array == null ? 0 : array.length;
  9129. if (length) {
  9130. var index = baseSortedIndex(array, value);
  9131. if (index < length && eq(array[index], value)) {
  9132. return index;
  9133. }
  9134. }
  9135. return -1;
  9136. }
  9137. /**
  9138. * This method is like `_.sortedIndex` except that it returns the highest
  9139. * index at which `value` should be inserted into `array` in order to
  9140. * maintain its sort order.
  9141. *
  9142. * @static
  9143. * @memberOf _
  9144. * @since 3.0.0
  9145. * @category Array
  9146. * @param {Array} array The sorted array to inspect.
  9147. * @param {*} value The value to evaluate.
  9148. * @returns {number} Returns the index at which `value` should be inserted
  9149. * into `array`.
  9150. * @example
  9151. *
  9152. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  9153. * // => 4
  9154. */
  9155. function sortedLastIndex(array, value) {
  9156. return baseSortedIndex(array, value, true);
  9157. }
  9158. /**
  9159. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  9160. * which is invoked for `value` and each element of `array` to compute their
  9161. * sort ranking. The iteratee is invoked with one argument: (value).
  9162. *
  9163. * @static
  9164. * @memberOf _
  9165. * @since 4.0.0
  9166. * @category Array
  9167. * @param {Array} array The sorted array to inspect.
  9168. * @param {*} value The value to evaluate.
  9169. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9170. * @returns {number} Returns the index at which `value` should be inserted
  9171. * into `array`.
  9172. * @example
  9173. *
  9174. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  9175. *
  9176. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  9177. * // => 1
  9178. *
  9179. * // The `_.property` iteratee shorthand.
  9180. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  9181. * // => 1
  9182. */
  9183. function sortedLastIndexBy(array, value, iteratee) {
  9184. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  9185. }
  9186. /**
  9187. * This method is like `_.lastIndexOf` except that it performs a binary
  9188. * search on a sorted `array`.
  9189. *
  9190. * @static
  9191. * @memberOf _
  9192. * @since 4.0.0
  9193. * @category Array
  9194. * @param {Array} array The array to inspect.
  9195. * @param {*} value The value to search for.
  9196. * @returns {number} Returns the index of the matched value, else `-1`.
  9197. * @example
  9198. *
  9199. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  9200. * // => 3
  9201. */
  9202. function sortedLastIndexOf(array, value) {
  9203. var length = array == null ? 0 : array.length;
  9204. if (length) {
  9205. var index = baseSortedIndex(array, value, true) - 1;
  9206. if (eq(array[index], value)) {
  9207. return index;
  9208. }
  9209. }
  9210. return -1;
  9211. }
  9212. /**
  9213. * This method is like `_.uniq` except that it's designed and optimized
  9214. * for sorted arrays.
  9215. *
  9216. * @static
  9217. * @memberOf _
  9218. * @since 4.0.0
  9219. * @category Array
  9220. * @param {Array} array The array to inspect.
  9221. * @returns {Array} Returns the new duplicate free array.
  9222. * @example
  9223. *
  9224. * _.sortedUniq([1, 1, 2]);
  9225. * // => [1, 2]
  9226. */
  9227. function sortedUniq(array) {
  9228. return (array && array.length)
  9229. ? baseSortedUniq(array)
  9230. : [];
  9231. }
  9232. /**
  9233. * This method is like `_.uniqBy` except that it's designed and optimized
  9234. * for sorted arrays.
  9235. *
  9236. * @static
  9237. * @memberOf _
  9238. * @since 4.0.0
  9239. * @category Array
  9240. * @param {Array} array The array to inspect.
  9241. * @param {Function} [iteratee] The iteratee invoked per element.
  9242. * @returns {Array} Returns the new duplicate free array.
  9243. * @example
  9244. *
  9245. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  9246. * // => [1.1, 2.3]
  9247. */
  9248. function sortedUniqBy(array, iteratee) {
  9249. return (array && array.length)
  9250. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  9251. : [];
  9252. }
  9253. /**
  9254. * Gets all but the first element of `array`.
  9255. *
  9256. * @static
  9257. * @memberOf _
  9258. * @since 4.0.0
  9259. * @category Array
  9260. * @param {Array} array The array to query.
  9261. * @returns {Array} Returns the slice of `array`.
  9262. * @example
  9263. *
  9264. * _.tail([1, 2, 3]);
  9265. * // => [2, 3]
  9266. */
  9267. function tail(array) {
  9268. var length = array == null ? 0 : array.length;
  9269. return length ? baseSlice(array, 1, length) : [];
  9270. }
  9271. /**
  9272. * Creates a slice of `array` with `n` elements taken from the beginning.
  9273. *
  9274. * @static
  9275. * @memberOf _
  9276. * @since 0.1.0
  9277. * @category Array
  9278. * @param {Array} array The array to query.
  9279. * @param {number} [n=1] The number of elements to take.
  9280. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9281. * @returns {Array} Returns the slice of `array`.
  9282. * @example
  9283. *
  9284. * _.take([1, 2, 3]);
  9285. * // => [1]
  9286. *
  9287. * _.take([1, 2, 3], 2);
  9288. * // => [1, 2]
  9289. *
  9290. * _.take([1, 2, 3], 5);
  9291. * // => [1, 2, 3]
  9292. *
  9293. * _.take([1, 2, 3], 0);
  9294. * // => []
  9295. */
  9296. function take(array, n, guard) {
  9297. if (!(array && array.length)) {
  9298. return [];
  9299. }
  9300. n = (guard || n === undefined) ? 1 : toInteger(n);
  9301. return baseSlice(array, 0, n < 0 ? 0 : n);
  9302. }
  9303. /**
  9304. * Creates a slice of `array` with `n` elements taken from the end.
  9305. *
  9306. * @static
  9307. * @memberOf _
  9308. * @since 3.0.0
  9309. * @category Array
  9310. * @param {Array} array The array to query.
  9311. * @param {number} [n=1] The number of elements to take.
  9312. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9313. * @returns {Array} Returns the slice of `array`.
  9314. * @example
  9315. *
  9316. * _.takeRight([1, 2, 3]);
  9317. * // => [3]
  9318. *
  9319. * _.takeRight([1, 2, 3], 2);
  9320. * // => [2, 3]
  9321. *
  9322. * _.takeRight([1, 2, 3], 5);
  9323. * // => [1, 2, 3]
  9324. *
  9325. * _.takeRight([1, 2, 3], 0);
  9326. * // => []
  9327. */
  9328. function takeRight(array, n, guard) {
  9329. var length = array == null ? 0 : array.length;
  9330. if (!length) {
  9331. return [];
  9332. }
  9333. n = (guard || n === undefined) ? 1 : toInteger(n);
  9334. n = length - n;
  9335. return baseSlice(array, n < 0 ? 0 : n, length);
  9336. }
  9337. /**
  9338. * Creates a slice of `array` with elements taken from the end. Elements are
  9339. * taken until `predicate` returns falsey. The predicate is invoked with
  9340. * three arguments: (value, index, array).
  9341. *
  9342. * @static
  9343. * @memberOf _
  9344. * @since 3.0.0
  9345. * @category Array
  9346. * @param {Array} array The array to query.
  9347. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9348. * @returns {Array} Returns the slice of `array`.
  9349. * @example
  9350. *
  9351. * var users = [
  9352. * { 'user': 'barney', 'active': true },
  9353. * { 'user': 'fred', 'active': false },
  9354. * { 'user': 'pebbles', 'active': false }
  9355. * ];
  9356. *
  9357. * _.takeRightWhile(users, function(o) { return !o.active; });
  9358. * // => objects for ['fred', 'pebbles']
  9359. *
  9360. * // The `_.matches` iteratee shorthand.
  9361. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  9362. * // => objects for ['pebbles']
  9363. *
  9364. * // The `_.matchesProperty` iteratee shorthand.
  9365. * _.takeRightWhile(users, ['active', false]);
  9366. * // => objects for ['fred', 'pebbles']
  9367. *
  9368. * // The `_.property` iteratee shorthand.
  9369. * _.takeRightWhile(users, 'active');
  9370. * // => []
  9371. */
  9372. function takeRightWhile(array, predicate) {
  9373. return (array && array.length)
  9374. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  9375. : [];
  9376. }
  9377. /**
  9378. * Creates a slice of `array` with elements taken from the beginning. Elements
  9379. * are taken until `predicate` returns falsey. The predicate is invoked with
  9380. * three arguments: (value, index, array).
  9381. *
  9382. * @static
  9383. * @memberOf _
  9384. * @since 3.0.0
  9385. * @category Array
  9386. * @param {Array} array The array to query.
  9387. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9388. * @returns {Array} Returns the slice of `array`.
  9389. * @example
  9390. *
  9391. * var users = [
  9392. * { 'user': 'barney', 'active': false },
  9393. * { 'user': 'fred', 'active': false },
  9394. * { 'user': 'pebbles', 'active': true }
  9395. * ];
  9396. *
  9397. * _.takeWhile(users, function(o) { return !o.active; });
  9398. * // => objects for ['barney', 'fred']
  9399. *
  9400. * // The `_.matches` iteratee shorthand.
  9401. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  9402. * // => objects for ['barney']
  9403. *
  9404. * // The `_.matchesProperty` iteratee shorthand.
  9405. * _.takeWhile(users, ['active', false]);
  9406. * // => objects for ['barney', 'fred']
  9407. *
  9408. * // The `_.property` iteratee shorthand.
  9409. * _.takeWhile(users, 'active');
  9410. * // => []
  9411. */
  9412. function takeWhile(array, predicate) {
  9413. return (array && array.length)
  9414. ? baseWhile(array, getIteratee(predicate, 3))
  9415. : [];
  9416. }
  9417. /**
  9418. * Creates an array of unique values, in order, from all given arrays using
  9419. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9420. * for equality comparisons.
  9421. *
  9422. * @static
  9423. * @memberOf _
  9424. * @since 0.1.0
  9425. * @category Array
  9426. * @param {...Array} [arrays] The arrays to inspect.
  9427. * @returns {Array} Returns the new array of combined values.
  9428. * @example
  9429. *
  9430. * _.union([2], [1, 2]);
  9431. * // => [2, 1]
  9432. */
  9433. var union = baseRest(function(arrays) {
  9434. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  9435. });
  9436. /**
  9437. * This method is like `_.union` except that it accepts `iteratee` which is
  9438. * invoked for each element of each `arrays` to generate the criterion by
  9439. * which uniqueness is computed. Result values are chosen from the first
  9440. * array in which the value occurs. The iteratee is invoked with one argument:
  9441. * (value).
  9442. *
  9443. * @static
  9444. * @memberOf _
  9445. * @since 4.0.0
  9446. * @category Array
  9447. * @param {...Array} [arrays] The arrays to inspect.
  9448. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9449. * @returns {Array} Returns the new array of combined values.
  9450. * @example
  9451. *
  9452. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  9453. * // => [2.1, 1.2]
  9454. *
  9455. * // The `_.property` iteratee shorthand.
  9456. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9457. * // => [{ 'x': 1 }, { 'x': 2 }]
  9458. */
  9459. var unionBy = baseRest(function(arrays) {
  9460. var iteratee = last(arrays);
  9461. if (isArrayLikeObject(iteratee)) {
  9462. iteratee = undefined;
  9463. }
  9464. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  9465. });
  9466. /**
  9467. * This method is like `_.union` except that it accepts `comparator` which
  9468. * is invoked to compare elements of `arrays`. Result values are chosen from
  9469. * the first array in which the value occurs. The comparator is invoked
  9470. * with two arguments: (arrVal, othVal).
  9471. *
  9472. * @static
  9473. * @memberOf _
  9474. * @since 4.0.0
  9475. * @category Array
  9476. * @param {...Array} [arrays] The arrays to inspect.
  9477. * @param {Function} [comparator] The comparator invoked per element.
  9478. * @returns {Array} Returns the new array of combined values.
  9479. * @example
  9480. *
  9481. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9482. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9483. *
  9484. * _.unionWith(objects, others, _.isEqual);
  9485. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9486. */
  9487. var unionWith = baseRest(function(arrays) {
  9488. var comparator = last(arrays);
  9489. comparator = typeof comparator == 'function' ? comparator : undefined;
  9490. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9491. });
  9492. /**
  9493. * Creates a duplicate-free version of an array, using
  9494. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9495. * for equality comparisons, in which only the first occurrence of each element
  9496. * is kept. The order of result values is determined by the order they occur
  9497. * in the array.
  9498. *
  9499. * @static
  9500. * @memberOf _
  9501. * @since 0.1.0
  9502. * @category Array
  9503. * @param {Array} array The array to inspect.
  9504. * @returns {Array} Returns the new duplicate free array.
  9505. * @example
  9506. *
  9507. * _.uniq([2, 1, 2]);
  9508. * // => [2, 1]
  9509. */
  9510. function uniq(array) {
  9511. return (array && array.length) ? baseUniq(array) : [];
  9512. }
  9513. /**
  9514. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9515. * invoked for each element in `array` to generate the criterion by which
  9516. * uniqueness is computed. The order of result values is determined by the
  9517. * order they occur in the array. The iteratee is invoked with one argument:
  9518. * (value).
  9519. *
  9520. * @static
  9521. * @memberOf _
  9522. * @since 4.0.0
  9523. * @category Array
  9524. * @param {Array} array The array to inspect.
  9525. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9526. * @returns {Array} Returns the new duplicate free array.
  9527. * @example
  9528. *
  9529. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9530. * // => [2.1, 1.2]
  9531. *
  9532. * // The `_.property` iteratee shorthand.
  9533. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9534. * // => [{ 'x': 1 }, { 'x': 2 }]
  9535. */
  9536. function uniqBy(array, iteratee) {
  9537. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9538. }
  9539. /**
  9540. * This method is like `_.uniq` except that it accepts `comparator` which
  9541. * is invoked to compare elements of `array`. The order of result values is
  9542. * determined by the order they occur in the array.The comparator is invoked
  9543. * with two arguments: (arrVal, othVal).
  9544. *
  9545. * @static
  9546. * @memberOf _
  9547. * @since 4.0.0
  9548. * @category Array
  9549. * @param {Array} array The array to inspect.
  9550. * @param {Function} [comparator] The comparator invoked per element.
  9551. * @returns {Array} Returns the new duplicate free array.
  9552. * @example
  9553. *
  9554. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9555. *
  9556. * _.uniqWith(objects, _.isEqual);
  9557. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9558. */
  9559. function uniqWith(array, comparator) {
  9560. comparator = typeof comparator == 'function' ? comparator : undefined;
  9561. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9562. }
  9563. /**
  9564. * This method is like `_.zip` except that it accepts an array of grouped
  9565. * elements and creates an array regrouping the elements to their pre-zip
  9566. * configuration.
  9567. *
  9568. * @static
  9569. * @memberOf _
  9570. * @since 1.2.0
  9571. * @category Array
  9572. * @param {Array} array The array of grouped elements to process.
  9573. * @returns {Array} Returns the new array of regrouped elements.
  9574. * @example
  9575. *
  9576. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9577. * // => [['a', 1, true], ['b', 2, false]]
  9578. *
  9579. * _.unzip(zipped);
  9580. * // => [['a', 'b'], [1, 2], [true, false]]
  9581. */
  9582. function unzip(array) {
  9583. if (!(array && array.length)) {
  9584. return [];
  9585. }
  9586. var length = 0;
  9587. array = arrayFilter(array, function(group) {
  9588. if (isArrayLikeObject(group)) {
  9589. length = nativeMax(group.length, length);
  9590. return true;
  9591. }
  9592. });
  9593. return baseTimes(length, function(index) {
  9594. return arrayMap(array, baseProperty(index));
  9595. });
  9596. }
  9597. /**
  9598. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9599. * how regrouped values should be combined. The iteratee is invoked with the
  9600. * elements of each group: (...group).
  9601. *
  9602. * @static
  9603. * @memberOf _
  9604. * @since 3.8.0
  9605. * @category Array
  9606. * @param {Array} array The array of grouped elements to process.
  9607. * @param {Function} [iteratee=_.identity] The function to combine
  9608. * regrouped values.
  9609. * @returns {Array} Returns the new array of regrouped elements.
  9610. * @example
  9611. *
  9612. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9613. * // => [[1, 10, 100], [2, 20, 200]]
  9614. *
  9615. * _.unzipWith(zipped, _.add);
  9616. * // => [3, 30, 300]
  9617. */
  9618. function unzipWith(array, iteratee) {
  9619. if (!(array && array.length)) {
  9620. return [];
  9621. }
  9622. var result = unzip(array);
  9623. if (iteratee == null) {
  9624. return result;
  9625. }
  9626. return arrayMap(result, function(group) {
  9627. return apply(iteratee, undefined, group);
  9628. });
  9629. }
  9630. /**
  9631. * Creates an array excluding all given values using
  9632. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9633. * for equality comparisons.
  9634. *
  9635. * **Note:** Unlike `_.pull`, this method returns a new array.
  9636. *
  9637. * @static
  9638. * @memberOf _
  9639. * @since 0.1.0
  9640. * @category Array
  9641. * @param {Array} array The array to inspect.
  9642. * @param {...*} [values] The values to exclude.
  9643. * @returns {Array} Returns the new array of filtered values.
  9644. * @see _.difference, _.xor
  9645. * @example
  9646. *
  9647. * _.without([2, 1, 2, 3], 1, 2);
  9648. * // => [3]
  9649. */
  9650. var without = baseRest(function(array, values) {
  9651. return isArrayLikeObject(array)
  9652. ? baseDifference(array, values)
  9653. : [];
  9654. });
  9655. /**
  9656. * Creates an array of unique values that is the
  9657. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9658. * of the given arrays. The order of result values is determined by the order
  9659. * they occur in the arrays.
  9660. *
  9661. * @static
  9662. * @memberOf _
  9663. * @since 2.4.0
  9664. * @category Array
  9665. * @param {...Array} [arrays] The arrays to inspect.
  9666. * @returns {Array} Returns the new array of filtered values.
  9667. * @see _.difference, _.without
  9668. * @example
  9669. *
  9670. * _.xor([2, 1], [2, 3]);
  9671. * // => [1, 3]
  9672. */
  9673. var xor = baseRest(function(arrays) {
  9674. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9675. });
  9676. /**
  9677. * This method is like `_.xor` except that it accepts `iteratee` which is
  9678. * invoked for each element of each `arrays` to generate the criterion by
  9679. * which by which they're compared. The order of result values is determined
  9680. * by the order they occur in the arrays. The iteratee is invoked with one
  9681. * argument: (value).
  9682. *
  9683. * @static
  9684. * @memberOf _
  9685. * @since 4.0.0
  9686. * @category Array
  9687. * @param {...Array} [arrays] The arrays to inspect.
  9688. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9689. * @returns {Array} Returns the new array of filtered values.
  9690. * @example
  9691. *
  9692. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9693. * // => [1.2, 3.4]
  9694. *
  9695. * // The `_.property` iteratee shorthand.
  9696. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9697. * // => [{ 'x': 2 }]
  9698. */
  9699. var xorBy = baseRest(function(arrays) {
  9700. var iteratee = last(arrays);
  9701. if (isArrayLikeObject(iteratee)) {
  9702. iteratee = undefined;
  9703. }
  9704. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9705. });
  9706. /**
  9707. * This method is like `_.xor` except that it accepts `comparator` which is
  9708. * invoked to compare elements of `arrays`. The order of result values is
  9709. * determined by the order they occur in the arrays. The comparator is invoked
  9710. * with two arguments: (arrVal, othVal).
  9711. *
  9712. * @static
  9713. * @memberOf _
  9714. * @since 4.0.0
  9715. * @category Array
  9716. * @param {...Array} [arrays] The arrays to inspect.
  9717. * @param {Function} [comparator] The comparator invoked per element.
  9718. * @returns {Array} Returns the new array of filtered values.
  9719. * @example
  9720. *
  9721. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9722. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9723. *
  9724. * _.xorWith(objects, others, _.isEqual);
  9725. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9726. */
  9727. var xorWith = baseRest(function(arrays) {
  9728. var comparator = last(arrays);
  9729. comparator = typeof comparator == 'function' ? comparator : undefined;
  9730. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9731. });
  9732. /**
  9733. * Creates an array of grouped elements, the first of which contains the
  9734. * first elements of the given arrays, the second of which contains the
  9735. * second elements of the given arrays, and so on.
  9736. *
  9737. * @static
  9738. * @memberOf _
  9739. * @since 0.1.0
  9740. * @category Array
  9741. * @param {...Array} [arrays] The arrays to process.
  9742. * @returns {Array} Returns the new array of grouped elements.
  9743. * @example
  9744. *
  9745. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9746. * // => [['a', 1, true], ['b', 2, false]]
  9747. */
  9748. var zip = baseRest(unzip);
  9749. /**
  9750. * This method is like `_.fromPairs` except that it accepts two arrays,
  9751. * one of property identifiers and one of corresponding values.
  9752. *
  9753. * @static
  9754. * @memberOf _
  9755. * @since 0.4.0
  9756. * @category Array
  9757. * @param {Array} [props=[]] The property identifiers.
  9758. * @param {Array} [values=[]] The property values.
  9759. * @returns {Object} Returns the new object.
  9760. * @example
  9761. *
  9762. * _.zipObject(['a', 'b'], [1, 2]);
  9763. * // => { 'a': 1, 'b': 2 }
  9764. */
  9765. function zipObject(props, values) {
  9766. return baseZipObject(props || [], values || [], assignValue);
  9767. }
  9768. /**
  9769. * This method is like `_.zipObject` except that it supports property paths.
  9770. *
  9771. * @static
  9772. * @memberOf _
  9773. * @since 4.1.0
  9774. * @category Array
  9775. * @param {Array} [props=[]] The property identifiers.
  9776. * @param {Array} [values=[]] The property values.
  9777. * @returns {Object} Returns the new object.
  9778. * @example
  9779. *
  9780. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9781. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9782. */
  9783. function zipObjectDeep(props, values) {
  9784. return baseZipObject(props || [], values || [], baseSet);
  9785. }
  9786. /**
  9787. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9788. * how grouped values should be combined. The iteratee is invoked with the
  9789. * elements of each group: (...group).
  9790. *
  9791. * @static
  9792. * @memberOf _
  9793. * @since 3.8.0
  9794. * @category Array
  9795. * @param {...Array} [arrays] The arrays to process.
  9796. * @param {Function} [iteratee=_.identity] The function to combine
  9797. * grouped values.
  9798. * @returns {Array} Returns the new array of grouped elements.
  9799. * @example
  9800. *
  9801. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9802. * return a + b + c;
  9803. * });
  9804. * // => [111, 222]
  9805. */
  9806. var zipWith = baseRest(function(arrays) {
  9807. var length = arrays.length,
  9808. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9809. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9810. return unzipWith(arrays, iteratee);
  9811. });
  9812. /*------------------------------------------------------------------------*/
  9813. /**
  9814. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9815. * chain sequences enabled. The result of such sequences must be unwrapped
  9816. * with `_#value`.
  9817. *
  9818. * @static
  9819. * @memberOf _
  9820. * @since 1.3.0
  9821. * @category Seq
  9822. * @param {*} value The value to wrap.
  9823. * @returns {Object} Returns the new `lodash` wrapper instance.
  9824. * @example
  9825. *
  9826. * var users = [
  9827. * { 'user': 'barney', 'age': 36 },
  9828. * { 'user': 'fred', 'age': 40 },
  9829. * { 'user': 'pebbles', 'age': 1 }
  9830. * ];
  9831. *
  9832. * var youngest = _
  9833. * .chain(users)
  9834. * .sortBy('age')
  9835. * .map(function(o) {
  9836. * return o.user + ' is ' + o.age;
  9837. * })
  9838. * .head()
  9839. * .value();
  9840. * // => 'pebbles is 1'
  9841. */
  9842. function chain(value) {
  9843. var result = lodash(value);
  9844. result.__chain__ = true;
  9845. return result;
  9846. }
  9847. /**
  9848. * This method invokes `interceptor` and returns `value`. The interceptor
  9849. * is invoked with one argument; (value). The purpose of this method is to
  9850. * "tap into" a method chain sequence in order to modify intermediate results.
  9851. *
  9852. * @static
  9853. * @memberOf _
  9854. * @since 0.1.0
  9855. * @category Seq
  9856. * @param {*} value The value to provide to `interceptor`.
  9857. * @param {Function} interceptor The function to invoke.
  9858. * @returns {*} Returns `value`.
  9859. * @example
  9860. *
  9861. * _([1, 2, 3])
  9862. * .tap(function(array) {
  9863. * // Mutate input array.
  9864. * array.pop();
  9865. * })
  9866. * .reverse()
  9867. * .value();
  9868. * // => [2, 1]
  9869. */
  9870. function tap(value, interceptor) {
  9871. interceptor(value);
  9872. return value;
  9873. }
  9874. /**
  9875. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9876. * The purpose of this method is to "pass thru" values replacing intermediate
  9877. * results in a method chain sequence.
  9878. *
  9879. * @static
  9880. * @memberOf _
  9881. * @since 3.0.0
  9882. * @category Seq
  9883. * @param {*} value The value to provide to `interceptor`.
  9884. * @param {Function} interceptor The function to invoke.
  9885. * @returns {*} Returns the result of `interceptor`.
  9886. * @example
  9887. *
  9888. * _(' abc ')
  9889. * .chain()
  9890. * .trim()
  9891. * .thru(function(value) {
  9892. * return [value];
  9893. * })
  9894. * .value();
  9895. * // => ['abc']
  9896. */
  9897. function thru(value, interceptor) {
  9898. return interceptor(value);
  9899. }
  9900. /**
  9901. * This method is the wrapper version of `_.at`.
  9902. *
  9903. * @name at
  9904. * @memberOf _
  9905. * @since 1.0.0
  9906. * @category Seq
  9907. * @param {...(string|string[])} [paths] The property paths to pick.
  9908. * @returns {Object} Returns the new `lodash` wrapper instance.
  9909. * @example
  9910. *
  9911. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9912. *
  9913. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9914. * // => [3, 4]
  9915. */
  9916. var wrapperAt = flatRest(function(paths) {
  9917. var length = paths.length,
  9918. start = length ? paths[0] : 0,
  9919. value = this.__wrapped__,
  9920. interceptor = function(object) { return baseAt(object, paths); };
  9921. if (length > 1 || this.__actions__.length ||
  9922. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9923. return this.thru(interceptor);
  9924. }
  9925. value = value.slice(start, +start + (length ? 1 : 0));
  9926. value.__actions__.push({
  9927. 'func': thru,
  9928. 'args': [interceptor],
  9929. 'thisArg': undefined
  9930. });
  9931. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9932. if (length && !array.length) {
  9933. array.push(undefined);
  9934. }
  9935. return array;
  9936. });
  9937. });
  9938. /**
  9939. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9940. *
  9941. * @name chain
  9942. * @memberOf _
  9943. * @since 0.1.0
  9944. * @category Seq
  9945. * @returns {Object} Returns the new `lodash` wrapper instance.
  9946. * @example
  9947. *
  9948. * var users = [
  9949. * { 'user': 'barney', 'age': 36 },
  9950. * { 'user': 'fred', 'age': 40 }
  9951. * ];
  9952. *
  9953. * // A sequence without explicit chaining.
  9954. * _(users).head();
  9955. * // => { 'user': 'barney', 'age': 36 }
  9956. *
  9957. * // A sequence with explicit chaining.
  9958. * _(users)
  9959. * .chain()
  9960. * .head()
  9961. * .pick('user')
  9962. * .value();
  9963. * // => { 'user': 'barney' }
  9964. */
  9965. function wrapperChain() {
  9966. return chain(this);
  9967. }
  9968. /**
  9969. * Executes the chain sequence and returns the wrapped result.
  9970. *
  9971. * @name commit
  9972. * @memberOf _
  9973. * @since 3.2.0
  9974. * @category Seq
  9975. * @returns {Object} Returns the new `lodash` wrapper instance.
  9976. * @example
  9977. *
  9978. * var array = [1, 2];
  9979. * var wrapped = _(array).push(3);
  9980. *
  9981. * console.log(array);
  9982. * // => [1, 2]
  9983. *
  9984. * wrapped = wrapped.commit();
  9985. * console.log(array);
  9986. * // => [1, 2, 3]
  9987. *
  9988. * wrapped.last();
  9989. * // => 3
  9990. *
  9991. * console.log(array);
  9992. * // => [1, 2, 3]
  9993. */
  9994. function wrapperCommit() {
  9995. return new LodashWrapper(this.value(), this.__chain__);
  9996. }
  9997. /**
  9998. * Gets the next value on a wrapped object following the
  9999. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  10000. *
  10001. * @name next
  10002. * @memberOf _
  10003. * @since 4.0.0
  10004. * @category Seq
  10005. * @returns {Object} Returns the next iterator value.
  10006. * @example
  10007. *
  10008. * var wrapped = _([1, 2]);
  10009. *
  10010. * wrapped.next();
  10011. * // => { 'done': false, 'value': 1 }
  10012. *
  10013. * wrapped.next();
  10014. * // => { 'done': false, 'value': 2 }
  10015. *
  10016. * wrapped.next();
  10017. * // => { 'done': true, 'value': undefined }
  10018. */
  10019. function wrapperNext() {
  10020. if (this.__values__ === undefined) {
  10021. this.__values__ = toArray(this.value());
  10022. }
  10023. var done = this.__index__ >= this.__values__.length,
  10024. value = done ? undefined : this.__values__[this.__index__++];
  10025. return { 'done': done, 'value': value };
  10026. }
  10027. /**
  10028. * Enables the wrapper to be iterable.
  10029. *
  10030. * @name Symbol.iterator
  10031. * @memberOf _
  10032. * @since 4.0.0
  10033. * @category Seq
  10034. * @returns {Object} Returns the wrapper object.
  10035. * @example
  10036. *
  10037. * var wrapped = _([1, 2]);
  10038. *
  10039. * wrapped[Symbol.iterator]() === wrapped;
  10040. * // => true
  10041. *
  10042. * Array.from(wrapped);
  10043. * // => [1, 2]
  10044. */
  10045. function wrapperToIterator() {
  10046. return this;
  10047. }
  10048. /**
  10049. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  10050. *
  10051. * @name plant
  10052. * @memberOf _
  10053. * @since 3.2.0
  10054. * @category Seq
  10055. * @param {*} value The value to plant.
  10056. * @returns {Object} Returns the new `lodash` wrapper instance.
  10057. * @example
  10058. *
  10059. * function square(n) {
  10060. * return n * n;
  10061. * }
  10062. *
  10063. * var wrapped = _([1, 2]).map(square);
  10064. * var other = wrapped.plant([3, 4]);
  10065. *
  10066. * other.value();
  10067. * // => [9, 16]
  10068. *
  10069. * wrapped.value();
  10070. * // => [1, 4]
  10071. */
  10072. function wrapperPlant(value) {
  10073. var result,
  10074. parent = this;
  10075. while (parent instanceof baseLodash) {
  10076. var clone = wrapperClone(parent);
  10077. clone.__index__ = 0;
  10078. clone.__values__ = undefined;
  10079. if (result) {
  10080. previous.__wrapped__ = clone;
  10081. } else {
  10082. result = clone;
  10083. }
  10084. var previous = clone;
  10085. parent = parent.__wrapped__;
  10086. }
  10087. previous.__wrapped__ = value;
  10088. return result;
  10089. }
  10090. /**
  10091. * This method is the wrapper version of `_.reverse`.
  10092. *
  10093. * **Note:** This method mutates the wrapped array.
  10094. *
  10095. * @name reverse
  10096. * @memberOf _
  10097. * @since 0.1.0
  10098. * @category Seq
  10099. * @returns {Object} Returns the new `lodash` wrapper instance.
  10100. * @example
  10101. *
  10102. * var array = [1, 2, 3];
  10103. *
  10104. * _(array).reverse().value()
  10105. * // => [3, 2, 1]
  10106. *
  10107. * console.log(array);
  10108. * // => [3, 2, 1]
  10109. */
  10110. function wrapperReverse() {
  10111. var value = this.__wrapped__;
  10112. if (value instanceof LazyWrapper) {
  10113. var wrapped = value;
  10114. if (this.__actions__.length) {
  10115. wrapped = new LazyWrapper(this);
  10116. }
  10117. wrapped = wrapped.reverse();
  10118. wrapped.__actions__.push({
  10119. 'func': thru,
  10120. 'args': [reverse],
  10121. 'thisArg': undefined
  10122. });
  10123. return new LodashWrapper(wrapped, this.__chain__);
  10124. }
  10125. return this.thru(reverse);
  10126. }
  10127. /**
  10128. * Executes the chain sequence to resolve the unwrapped value.
  10129. *
  10130. * @name value
  10131. * @memberOf _
  10132. * @since 0.1.0
  10133. * @alias toJSON, valueOf
  10134. * @category Seq
  10135. * @returns {*} Returns the resolved unwrapped value.
  10136. * @example
  10137. *
  10138. * _([1, 2, 3]).value();
  10139. * // => [1, 2, 3]
  10140. */
  10141. function wrapperValue() {
  10142. return baseWrapperValue(this.__wrapped__, this.__actions__);
  10143. }
  10144. /*------------------------------------------------------------------------*/
  10145. /**
  10146. * Creates an object composed of keys generated from the results of running
  10147. * each element of `collection` thru `iteratee`. The corresponding value of
  10148. * each key is the number of times the key was returned by `iteratee`. The
  10149. * iteratee is invoked with one argument: (value).
  10150. *
  10151. * @static
  10152. * @memberOf _
  10153. * @since 0.5.0
  10154. * @category Collection
  10155. * @param {Array|Object} collection The collection to iterate over.
  10156. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10157. * @returns {Object} Returns the composed aggregate object.
  10158. * @example
  10159. *
  10160. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  10161. * // => { '4': 1, '6': 2 }
  10162. *
  10163. * // The `_.property` iteratee shorthand.
  10164. * _.countBy(['one', 'two', 'three'], 'length');
  10165. * // => { '3': 2, '5': 1 }
  10166. */
  10167. var countBy = createAggregator(function(result, value, key) {
  10168. if (hasOwnProperty.call(result, key)) {
  10169. ++result[key];
  10170. } else {
  10171. baseAssignValue(result, key, 1);
  10172. }
  10173. });
  10174. /**
  10175. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  10176. * Iteration is stopped once `predicate` returns falsey. The predicate is
  10177. * invoked with three arguments: (value, index|key, collection).
  10178. *
  10179. * **Note:** This method returns `true` for
  10180. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  10181. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  10182. * elements of empty collections.
  10183. *
  10184. * @static
  10185. * @memberOf _
  10186. * @since 0.1.0
  10187. * @category Collection
  10188. * @param {Array|Object} collection The collection to iterate over.
  10189. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10190. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10191. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  10192. * else `false`.
  10193. * @example
  10194. *
  10195. * _.every([true, 1, null, 'yes'], Boolean);
  10196. * // => false
  10197. *
  10198. * var users = [
  10199. * { 'user': 'barney', 'age': 36, 'active': false },
  10200. * { 'user': 'fred', 'age': 40, 'active': false }
  10201. * ];
  10202. *
  10203. * // The `_.matches` iteratee shorthand.
  10204. * _.every(users, { 'user': 'barney', 'active': false });
  10205. * // => false
  10206. *
  10207. * // The `_.matchesProperty` iteratee shorthand.
  10208. * _.every(users, ['active', false]);
  10209. * // => true
  10210. *
  10211. * // The `_.property` iteratee shorthand.
  10212. * _.every(users, 'active');
  10213. * // => false
  10214. */
  10215. function every(collection, predicate, guard) {
  10216. var func = isArray(collection) ? arrayEvery : baseEvery;
  10217. if (guard && isIterateeCall(collection, predicate, guard)) {
  10218. predicate = undefined;
  10219. }
  10220. return func(collection, getIteratee(predicate, 3));
  10221. }
  10222. /**
  10223. * Iterates over elements of `collection`, returning an array of all elements
  10224. * `predicate` returns truthy for. The predicate is invoked with three
  10225. * arguments: (value, index|key, collection).
  10226. *
  10227. * **Note:** Unlike `_.remove`, this method returns a new array.
  10228. *
  10229. * @static
  10230. * @memberOf _
  10231. * @since 0.1.0
  10232. * @category Collection
  10233. * @param {Array|Object} collection The collection to iterate over.
  10234. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10235. * @returns {Array} Returns the new filtered array.
  10236. * @see _.reject
  10237. * @example
  10238. *
  10239. * var users = [
  10240. * { 'user': 'barney', 'age': 36, 'active': true },
  10241. * { 'user': 'fred', 'age': 40, 'active': false }
  10242. * ];
  10243. *
  10244. * _.filter(users, function(o) { return !o.active; });
  10245. * // => objects for ['fred']
  10246. *
  10247. * // The `_.matches` iteratee shorthand.
  10248. * _.filter(users, { 'age': 36, 'active': true });
  10249. * // => objects for ['barney']
  10250. *
  10251. * // The `_.matchesProperty` iteratee shorthand.
  10252. * _.filter(users, ['active', false]);
  10253. * // => objects for ['fred']
  10254. *
  10255. * // The `_.property` iteratee shorthand.
  10256. * _.filter(users, 'active');
  10257. * // => objects for ['barney']
  10258. *
  10259. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  10260. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  10261. * // => objects for ['fred', 'barney']
  10262. */
  10263. function filter(collection, predicate) {
  10264. var func = isArray(collection) ? arrayFilter : baseFilter;
  10265. return func(collection, getIteratee(predicate, 3));
  10266. }
  10267. /**
  10268. * Iterates over elements of `collection`, returning the first element
  10269. * `predicate` returns truthy for. The predicate is invoked with three
  10270. * arguments: (value, index|key, collection).
  10271. *
  10272. * @static
  10273. * @memberOf _
  10274. * @since 0.1.0
  10275. * @category Collection
  10276. * @param {Array|Object} collection The collection to inspect.
  10277. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10278. * @param {number} [fromIndex=0] The index to search from.
  10279. * @returns {*} Returns the matched element, else `undefined`.
  10280. * @example
  10281. *
  10282. * var users = [
  10283. * { 'user': 'barney', 'age': 36, 'active': true },
  10284. * { 'user': 'fred', 'age': 40, 'active': false },
  10285. * { 'user': 'pebbles', 'age': 1, 'active': true }
  10286. * ];
  10287. *
  10288. * _.find(users, function(o) { return o.age < 40; });
  10289. * // => object for 'barney'
  10290. *
  10291. * // The `_.matches` iteratee shorthand.
  10292. * _.find(users, { 'age': 1, 'active': true });
  10293. * // => object for 'pebbles'
  10294. *
  10295. * // The `_.matchesProperty` iteratee shorthand.
  10296. * _.find(users, ['active', false]);
  10297. * // => object for 'fred'
  10298. *
  10299. * // The `_.property` iteratee shorthand.
  10300. * _.find(users, 'active');
  10301. * // => object for 'barney'
  10302. */
  10303. var find = createFind(findIndex);
  10304. /**
  10305. * This method is like `_.find` except that it iterates over elements of
  10306. * `collection` from right to left.
  10307. *
  10308. * @static
  10309. * @memberOf _
  10310. * @since 2.0.0
  10311. * @category Collection
  10312. * @param {Array|Object} collection The collection to inspect.
  10313. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10314. * @param {number} [fromIndex=collection.length-1] The index to search from.
  10315. * @returns {*} Returns the matched element, else `undefined`.
  10316. * @example
  10317. *
  10318. * _.findLast([1, 2, 3, 4], function(n) {
  10319. * return n % 2 == 1;
  10320. * });
  10321. * // => 3
  10322. */
  10323. var findLast = createFind(findLastIndex);
  10324. /**
  10325. * Creates a flattened array of values by running each element in `collection`
  10326. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  10327. * with three arguments: (value, index|key, collection).
  10328. *
  10329. * @static
  10330. * @memberOf _
  10331. * @since 4.0.0
  10332. * @category Collection
  10333. * @param {Array|Object} collection The collection to iterate over.
  10334. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10335. * @returns {Array} Returns the new flattened array.
  10336. * @example
  10337. *
  10338. * function duplicate(n) {
  10339. * return [n, n];
  10340. * }
  10341. *
  10342. * _.flatMap([1, 2], duplicate);
  10343. * // => [1, 1, 2, 2]
  10344. */
  10345. function flatMap(collection, iteratee) {
  10346. return baseFlatten(map(collection, iteratee), 1);
  10347. }
  10348. /**
  10349. * This method is like `_.flatMap` except that it recursively flattens the
  10350. * mapped results.
  10351. *
  10352. * @static
  10353. * @memberOf _
  10354. * @since 4.7.0
  10355. * @category Collection
  10356. * @param {Array|Object} collection The collection to iterate over.
  10357. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10358. * @returns {Array} Returns the new flattened array.
  10359. * @example
  10360. *
  10361. * function duplicate(n) {
  10362. * return [[[n, n]]];
  10363. * }
  10364. *
  10365. * _.flatMapDeep([1, 2], duplicate);
  10366. * // => [1, 1, 2, 2]
  10367. */
  10368. function flatMapDeep(collection, iteratee) {
  10369. return baseFlatten(map(collection, iteratee), INFINITY);
  10370. }
  10371. /**
  10372. * This method is like `_.flatMap` except that it recursively flattens the
  10373. * mapped results up to `depth` times.
  10374. *
  10375. * @static
  10376. * @memberOf _
  10377. * @since 4.7.0
  10378. * @category Collection
  10379. * @param {Array|Object} collection The collection to iterate over.
  10380. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10381. * @param {number} [depth=1] The maximum recursion depth.
  10382. * @returns {Array} Returns the new flattened array.
  10383. * @example
  10384. *
  10385. * function duplicate(n) {
  10386. * return [[[n, n]]];
  10387. * }
  10388. *
  10389. * _.flatMapDepth([1, 2], duplicate, 2);
  10390. * // => [[1, 1], [2, 2]]
  10391. */
  10392. function flatMapDepth(collection, iteratee, depth) {
  10393. depth = depth === undefined ? 1 : toInteger(depth);
  10394. return baseFlatten(map(collection, iteratee), depth);
  10395. }
  10396. /**
  10397. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  10398. * The iteratee is invoked with three arguments: (value, index|key, collection).
  10399. * Iteratee functions may exit iteration early by explicitly returning `false`.
  10400. *
  10401. * **Note:** As with other "Collections" methods, objects with a "length"
  10402. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  10403. * or `_.forOwn` for object iteration.
  10404. *
  10405. * @static
  10406. * @memberOf _
  10407. * @since 0.1.0
  10408. * @alias each
  10409. * @category Collection
  10410. * @param {Array|Object} collection The collection to iterate over.
  10411. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10412. * @returns {Array|Object} Returns `collection`.
  10413. * @see _.forEachRight
  10414. * @example
  10415. *
  10416. * _.forEach([1, 2], function(value) {
  10417. * console.log(value);
  10418. * });
  10419. * // => Logs `1` then `2`.
  10420. *
  10421. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  10422. * console.log(key);
  10423. * });
  10424. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  10425. */
  10426. function forEach(collection, iteratee) {
  10427. var func = isArray(collection) ? arrayEach : baseEach;
  10428. return func(collection, getIteratee(iteratee, 3));
  10429. }
  10430. /**
  10431. * This method is like `_.forEach` except that it iterates over elements of
  10432. * `collection` from right to left.
  10433. *
  10434. * @static
  10435. * @memberOf _
  10436. * @since 2.0.0
  10437. * @alias eachRight
  10438. * @category Collection
  10439. * @param {Array|Object} collection The collection to iterate over.
  10440. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10441. * @returns {Array|Object} Returns `collection`.
  10442. * @see _.forEach
  10443. * @example
  10444. *
  10445. * _.forEachRight([1, 2], function(value) {
  10446. * console.log(value);
  10447. * });
  10448. * // => Logs `2` then `1`.
  10449. */
  10450. function forEachRight(collection, iteratee) {
  10451. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  10452. return func(collection, getIteratee(iteratee, 3));
  10453. }
  10454. /**
  10455. * Creates an object composed of keys generated from the results of running
  10456. * each element of `collection` thru `iteratee`. The order of grouped values
  10457. * is determined by the order they occur in `collection`. The corresponding
  10458. * value of each key is an array of elements responsible for generating the
  10459. * key. The iteratee is invoked with one argument: (value).
  10460. *
  10461. * @static
  10462. * @memberOf _
  10463. * @since 0.1.0
  10464. * @category Collection
  10465. * @param {Array|Object} collection The collection to iterate over.
  10466. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10467. * @returns {Object} Returns the composed aggregate object.
  10468. * @example
  10469. *
  10470. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  10471. * // => { '4': [4.2], '6': [6.1, 6.3] }
  10472. *
  10473. * // The `_.property` iteratee shorthand.
  10474. * _.groupBy(['one', 'two', 'three'], 'length');
  10475. * // => { '3': ['one', 'two'], '5': ['three'] }
  10476. */
  10477. var groupBy = createAggregator(function(result, value, key) {
  10478. if (hasOwnProperty.call(result, key)) {
  10479. result[key].push(value);
  10480. } else {
  10481. baseAssignValue(result, key, [value]);
  10482. }
  10483. });
  10484. /**
  10485. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10486. * checked for a substring of `value`, otherwise
  10487. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10488. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10489. * the offset from the end of `collection`.
  10490. *
  10491. * @static
  10492. * @memberOf _
  10493. * @since 0.1.0
  10494. * @category Collection
  10495. * @param {Array|Object|string} collection The collection to inspect.
  10496. * @param {*} value The value to search for.
  10497. * @param {number} [fromIndex=0] The index to search from.
  10498. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10499. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10500. * @example
  10501. *
  10502. * _.includes([1, 2, 3], 1);
  10503. * // => true
  10504. *
  10505. * _.includes([1, 2, 3], 1, 2);
  10506. * // => false
  10507. *
  10508. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10509. * // => true
  10510. *
  10511. * _.includes('abcd', 'bc');
  10512. * // => true
  10513. */
  10514. function includes(collection, value, fromIndex, guard) {
  10515. collection = isArrayLike(collection) ? collection : values(collection);
  10516. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10517. var length = collection.length;
  10518. if (fromIndex < 0) {
  10519. fromIndex = nativeMax(length + fromIndex, 0);
  10520. }
  10521. return isString(collection)
  10522. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10523. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10524. }
  10525. /**
  10526. * Invokes the method at `path` of each element in `collection`, returning
  10527. * an array of the results of each invoked method. Any additional arguments
  10528. * are provided to each invoked method. If `path` is a function, it's invoked
  10529. * for, and `this` bound to, each element in `collection`.
  10530. *
  10531. * @static
  10532. * @memberOf _
  10533. * @since 4.0.0
  10534. * @category Collection
  10535. * @param {Array|Object} collection The collection to iterate over.
  10536. * @param {Array|Function|string} path The path of the method to invoke or
  10537. * the function invoked per iteration.
  10538. * @param {...*} [args] The arguments to invoke each method with.
  10539. * @returns {Array} Returns the array of results.
  10540. * @example
  10541. *
  10542. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10543. * // => [[1, 5, 7], [1, 2, 3]]
  10544. *
  10545. * _.invokeMap([123, 456], String.prototype.split, '');
  10546. * // => [['1', '2', '3'], ['4', '5', '6']]
  10547. */
  10548. var invokeMap = baseRest(function(collection, path, args) {
  10549. var index = -1,
  10550. isFunc = typeof path == 'function',
  10551. result = isArrayLike(collection) ? Array(collection.length) : [];
  10552. baseEach(collection, function(value) {
  10553. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10554. });
  10555. return result;
  10556. });
  10557. /**
  10558. * Creates an object composed of keys generated from the results of running
  10559. * each element of `collection` thru `iteratee`. The corresponding value of
  10560. * each key is the last element responsible for generating the key. The
  10561. * iteratee is invoked with one argument: (value).
  10562. *
  10563. * @static
  10564. * @memberOf _
  10565. * @since 4.0.0
  10566. * @category Collection
  10567. * @param {Array|Object} collection The collection to iterate over.
  10568. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10569. * @returns {Object} Returns the composed aggregate object.
  10570. * @example
  10571. *
  10572. * var array = [
  10573. * { 'dir': 'left', 'code': 97 },
  10574. * { 'dir': 'right', 'code': 100 }
  10575. * ];
  10576. *
  10577. * _.keyBy(array, function(o) {
  10578. * return String.fromCharCode(o.code);
  10579. * });
  10580. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10581. *
  10582. * _.keyBy(array, 'dir');
  10583. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10584. */
  10585. var keyBy = createAggregator(function(result, value, key) {
  10586. baseAssignValue(result, key, value);
  10587. });
  10588. /**
  10589. * Creates an array of values by running each element in `collection` thru
  10590. * `iteratee`. The iteratee is invoked with three arguments:
  10591. * (value, index|key, collection).
  10592. *
  10593. * Many lodash methods are guarded to work as iteratees for methods like
  10594. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10595. *
  10596. * The guarded methods are:
  10597. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10598. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10599. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10600. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10601. *
  10602. * @static
  10603. * @memberOf _
  10604. * @since 0.1.0
  10605. * @category Collection
  10606. * @param {Array|Object} collection The collection to iterate over.
  10607. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10608. * @returns {Array} Returns the new mapped array.
  10609. * @example
  10610. *
  10611. * function square(n) {
  10612. * return n * n;
  10613. * }
  10614. *
  10615. * _.map([4, 8], square);
  10616. * // => [16, 64]
  10617. *
  10618. * _.map({ 'a': 4, 'b': 8 }, square);
  10619. * // => [16, 64] (iteration order is not guaranteed)
  10620. *
  10621. * var users = [
  10622. * { 'user': 'barney' },
  10623. * { 'user': 'fred' }
  10624. * ];
  10625. *
  10626. * // The `_.property` iteratee shorthand.
  10627. * _.map(users, 'user');
  10628. * // => ['barney', 'fred']
  10629. */
  10630. function map(collection, iteratee) {
  10631. var func = isArray(collection) ? arrayMap : baseMap;
  10632. return func(collection, getIteratee(iteratee, 3));
  10633. }
  10634. /**
  10635. * This method is like `_.sortBy` except that it allows specifying the sort
  10636. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10637. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10638. * descending or "asc" for ascending sort order of corresponding values.
  10639. *
  10640. * @static
  10641. * @memberOf _
  10642. * @since 4.0.0
  10643. * @category Collection
  10644. * @param {Array|Object} collection The collection to iterate over.
  10645. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10646. * The iteratees to sort by.
  10647. * @param {string[]} [orders] The sort orders of `iteratees`.
  10648. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10649. * @returns {Array} Returns the new sorted array.
  10650. * @example
  10651. *
  10652. * var users = [
  10653. * { 'user': 'fred', 'age': 48 },
  10654. * { 'user': 'barney', 'age': 34 },
  10655. * { 'user': 'fred', 'age': 40 },
  10656. * { 'user': 'barney', 'age': 36 }
  10657. * ];
  10658. *
  10659. * // Sort by `user` in ascending order and by `age` in descending order.
  10660. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10661. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10662. */
  10663. function orderBy(collection, iteratees, orders, guard) {
  10664. if (collection == null) {
  10665. return [];
  10666. }
  10667. if (!isArray(iteratees)) {
  10668. iteratees = iteratees == null ? [] : [iteratees];
  10669. }
  10670. orders = guard ? undefined : orders;
  10671. if (!isArray(orders)) {
  10672. orders = orders == null ? [] : [orders];
  10673. }
  10674. return baseOrderBy(collection, iteratees, orders);
  10675. }
  10676. /**
  10677. * Creates an array of elements split into two groups, the first of which
  10678. * contains elements `predicate` returns truthy for, the second of which
  10679. * contains elements `predicate` returns falsey for. The predicate is
  10680. * invoked with one argument: (value).
  10681. *
  10682. * @static
  10683. * @memberOf _
  10684. * @since 3.0.0
  10685. * @category Collection
  10686. * @param {Array|Object} collection The collection to iterate over.
  10687. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10688. * @returns {Array} Returns the array of grouped elements.
  10689. * @example
  10690. *
  10691. * var users = [
  10692. * { 'user': 'barney', 'age': 36, 'active': false },
  10693. * { 'user': 'fred', 'age': 40, 'active': true },
  10694. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10695. * ];
  10696. *
  10697. * _.partition(users, function(o) { return o.active; });
  10698. * // => objects for [['fred'], ['barney', 'pebbles']]
  10699. *
  10700. * // The `_.matches` iteratee shorthand.
  10701. * _.partition(users, { 'age': 1, 'active': false });
  10702. * // => objects for [['pebbles'], ['barney', 'fred']]
  10703. *
  10704. * // The `_.matchesProperty` iteratee shorthand.
  10705. * _.partition(users, ['active', false]);
  10706. * // => objects for [['barney', 'pebbles'], ['fred']]
  10707. *
  10708. * // The `_.property` iteratee shorthand.
  10709. * _.partition(users, 'active');
  10710. * // => objects for [['fred'], ['barney', 'pebbles']]
  10711. */
  10712. var partition = createAggregator(function(result, value, key) {
  10713. result[key ? 0 : 1].push(value);
  10714. }, function() { return [[], []]; });
  10715. /**
  10716. * Reduces `collection` to a value which is the accumulated result of running
  10717. * each element in `collection` thru `iteratee`, where each successive
  10718. * invocation is supplied the return value of the previous. If `accumulator`
  10719. * is not given, the first element of `collection` is used as the initial
  10720. * value. The iteratee is invoked with four arguments:
  10721. * (accumulator, value, index|key, collection).
  10722. *
  10723. * Many lodash methods are guarded to work as iteratees for methods like
  10724. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10725. *
  10726. * The guarded methods are:
  10727. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10728. * and `sortBy`
  10729. *
  10730. * @static
  10731. * @memberOf _
  10732. * @since 0.1.0
  10733. * @category Collection
  10734. * @param {Array|Object} collection The collection to iterate over.
  10735. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10736. * @param {*} [accumulator] The initial value.
  10737. * @returns {*} Returns the accumulated value.
  10738. * @see _.reduceRight
  10739. * @example
  10740. *
  10741. * _.reduce([1, 2], function(sum, n) {
  10742. * return sum + n;
  10743. * }, 0);
  10744. * // => 3
  10745. *
  10746. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10747. * (result[value] || (result[value] = [])).push(key);
  10748. * return result;
  10749. * }, {});
  10750. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10751. */
  10752. function reduce(collection, iteratee, accumulator) {
  10753. var func = isArray(collection) ? arrayReduce : baseReduce,
  10754. initAccum = arguments.length < 3;
  10755. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10756. }
  10757. /**
  10758. * This method is like `_.reduce` except that it iterates over elements of
  10759. * `collection` from right to left.
  10760. *
  10761. * @static
  10762. * @memberOf _
  10763. * @since 0.1.0
  10764. * @category Collection
  10765. * @param {Array|Object} collection The collection to iterate over.
  10766. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10767. * @param {*} [accumulator] The initial value.
  10768. * @returns {*} Returns the accumulated value.
  10769. * @see _.reduce
  10770. * @example
  10771. *
  10772. * var array = [[0, 1], [2, 3], [4, 5]];
  10773. *
  10774. * _.reduceRight(array, function(flattened, other) {
  10775. * return flattened.concat(other);
  10776. * }, []);
  10777. * // => [4, 5, 2, 3, 0, 1]
  10778. */
  10779. function reduceRight(collection, iteratee, accumulator) {
  10780. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10781. initAccum = arguments.length < 3;
  10782. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10783. }
  10784. /**
  10785. * The opposite of `_.filter`; this method returns the elements of `collection`
  10786. * that `predicate` does **not** return truthy for.
  10787. *
  10788. * @static
  10789. * @memberOf _
  10790. * @since 0.1.0
  10791. * @category Collection
  10792. * @param {Array|Object} collection The collection to iterate over.
  10793. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10794. * @returns {Array} Returns the new filtered array.
  10795. * @see _.filter
  10796. * @example
  10797. *
  10798. * var users = [
  10799. * { 'user': 'barney', 'age': 36, 'active': false },
  10800. * { 'user': 'fred', 'age': 40, 'active': true }
  10801. * ];
  10802. *
  10803. * _.reject(users, function(o) { return !o.active; });
  10804. * // => objects for ['fred']
  10805. *
  10806. * // The `_.matches` iteratee shorthand.
  10807. * _.reject(users, { 'age': 40, 'active': true });
  10808. * // => objects for ['barney']
  10809. *
  10810. * // The `_.matchesProperty` iteratee shorthand.
  10811. * _.reject(users, ['active', false]);
  10812. * // => objects for ['fred']
  10813. *
  10814. * // The `_.property` iteratee shorthand.
  10815. * _.reject(users, 'active');
  10816. * // => objects for ['barney']
  10817. */
  10818. function reject(collection, predicate) {
  10819. var func = isArray(collection) ? arrayFilter : baseFilter;
  10820. return func(collection, negate(getIteratee(predicate, 3)));
  10821. }
  10822. /**
  10823. * Gets a random element from `collection`.
  10824. *
  10825. * @static
  10826. * @memberOf _
  10827. * @since 2.0.0
  10828. * @category Collection
  10829. * @param {Array|Object} collection The collection to sample.
  10830. * @returns {*} Returns the random element.
  10831. * @example
  10832. *
  10833. * _.sample([1, 2, 3, 4]);
  10834. * // => 2
  10835. */
  10836. function sample(collection) {
  10837. var func = isArray(collection) ? arraySample : baseSample;
  10838. return func(collection);
  10839. }
  10840. /**
  10841. * Gets `n` random elements at unique keys from `collection` up to the
  10842. * size of `collection`.
  10843. *
  10844. * @static
  10845. * @memberOf _
  10846. * @since 4.0.0
  10847. * @category Collection
  10848. * @param {Array|Object} collection The collection to sample.
  10849. * @param {number} [n=1] The number of elements to sample.
  10850. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10851. * @returns {Array} Returns the random elements.
  10852. * @example
  10853. *
  10854. * _.sampleSize([1, 2, 3], 2);
  10855. * // => [3, 1]
  10856. *
  10857. * _.sampleSize([1, 2, 3], 4);
  10858. * // => [2, 3, 1]
  10859. */
  10860. function sampleSize(collection, n, guard) {
  10861. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10862. n = 1;
  10863. } else {
  10864. n = toInteger(n);
  10865. }
  10866. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10867. return func(collection, n);
  10868. }
  10869. /**
  10870. * Creates an array of shuffled values, using a version of the
  10871. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10872. *
  10873. * @static
  10874. * @memberOf _
  10875. * @since 0.1.0
  10876. * @category Collection
  10877. * @param {Array|Object} collection The collection to shuffle.
  10878. * @returns {Array} Returns the new shuffled array.
  10879. * @example
  10880. *
  10881. * _.shuffle([1, 2, 3, 4]);
  10882. * // => [4, 1, 3, 2]
  10883. */
  10884. function shuffle(collection) {
  10885. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10886. return func(collection);
  10887. }
  10888. /**
  10889. * Gets the size of `collection` by returning its length for array-like
  10890. * values or the number of own enumerable string keyed properties for objects.
  10891. *
  10892. * @static
  10893. * @memberOf _
  10894. * @since 0.1.0
  10895. * @category Collection
  10896. * @param {Array|Object|string} collection The collection to inspect.
  10897. * @returns {number} Returns the collection size.
  10898. * @example
  10899. *
  10900. * _.size([1, 2, 3]);
  10901. * // => 3
  10902. *
  10903. * _.size({ 'a': 1, 'b': 2 });
  10904. * // => 2
  10905. *
  10906. * _.size('pebbles');
  10907. * // => 7
  10908. */
  10909. function size(collection) {
  10910. if (collection == null) {
  10911. return 0;
  10912. }
  10913. if (isArrayLike(collection)) {
  10914. return isString(collection) ? stringSize(collection) : collection.length;
  10915. }
  10916. var tag = getTag(collection);
  10917. if (tag == mapTag || tag == setTag) {
  10918. return collection.size;
  10919. }
  10920. return baseKeys(collection).length;
  10921. }
  10922. /**
  10923. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10924. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10925. * invoked with three arguments: (value, index|key, collection).
  10926. *
  10927. * @static
  10928. * @memberOf _
  10929. * @since 0.1.0
  10930. * @category Collection
  10931. * @param {Array|Object} collection The collection to iterate over.
  10932. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10933. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10934. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10935. * else `false`.
  10936. * @example
  10937. *
  10938. * _.some([null, 0, 'yes', false], Boolean);
  10939. * // => true
  10940. *
  10941. * var users = [
  10942. * { 'user': 'barney', 'active': true },
  10943. * { 'user': 'fred', 'active': false }
  10944. * ];
  10945. *
  10946. * // The `_.matches` iteratee shorthand.
  10947. * _.some(users, { 'user': 'barney', 'active': false });
  10948. * // => false
  10949. *
  10950. * // The `_.matchesProperty` iteratee shorthand.
  10951. * _.some(users, ['active', false]);
  10952. * // => true
  10953. *
  10954. * // The `_.property` iteratee shorthand.
  10955. * _.some(users, 'active');
  10956. * // => true
  10957. */
  10958. function some(collection, predicate, guard) {
  10959. var func = isArray(collection) ? arraySome : baseSome;
  10960. if (guard && isIterateeCall(collection, predicate, guard)) {
  10961. predicate = undefined;
  10962. }
  10963. return func(collection, getIteratee(predicate, 3));
  10964. }
  10965. /**
  10966. * Creates an array of elements, sorted in ascending order by the results of
  10967. * running each element in a collection thru each iteratee. This method
  10968. * performs a stable sort, that is, it preserves the original sort order of
  10969. * equal elements. The iteratees are invoked with one argument: (value).
  10970. *
  10971. * @static
  10972. * @memberOf _
  10973. * @since 0.1.0
  10974. * @category Collection
  10975. * @param {Array|Object} collection The collection to iterate over.
  10976. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10977. * The iteratees to sort by.
  10978. * @returns {Array} Returns the new sorted array.
  10979. * @example
  10980. *
  10981. * var users = [
  10982. * { 'user': 'fred', 'age': 48 },
  10983. * { 'user': 'barney', 'age': 36 },
  10984. * { 'user': 'fred', 'age': 30 },
  10985. * { 'user': 'barney', 'age': 34 }
  10986. * ];
  10987. *
  10988. * _.sortBy(users, [function(o) { return o.user; }]);
  10989. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10990. *
  10991. * _.sortBy(users, ['user', 'age']);
  10992. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10993. */
  10994. var sortBy = baseRest(function(collection, iteratees) {
  10995. if (collection == null) {
  10996. return [];
  10997. }
  10998. var length = iteratees.length;
  10999. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  11000. iteratees = [];
  11001. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  11002. iteratees = [iteratees[0]];
  11003. }
  11004. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  11005. });
  11006. /*------------------------------------------------------------------------*/
  11007. /**
  11008. * Gets the timestamp of the number of milliseconds that have elapsed since
  11009. * the Unix epoch (1 January 1970 00:00:00 UTC).
  11010. *
  11011. * @static
  11012. * @memberOf _
  11013. * @since 2.4.0
  11014. * @category Date
  11015. * @returns {number} Returns the timestamp.
  11016. * @example
  11017. *
  11018. * _.defer(function(stamp) {
  11019. * console.log(_.now() - stamp);
  11020. * }, _.now());
  11021. * // => Logs the number of milliseconds it took for the deferred invocation.
  11022. */
  11023. var now = ctxNow || function() {
  11024. return root.Date.now();
  11025. };
  11026. /*------------------------------------------------------------------------*/
  11027. /**
  11028. * The opposite of `_.before`; this method creates a function that invokes
  11029. * `func` once it's called `n` or more times.
  11030. *
  11031. * @static
  11032. * @memberOf _
  11033. * @since 0.1.0
  11034. * @category Function
  11035. * @param {number} n The number of calls before `func` is invoked.
  11036. * @param {Function} func The function to restrict.
  11037. * @returns {Function} Returns the new restricted function.
  11038. * @example
  11039. *
  11040. * var saves = ['profile', 'settings'];
  11041. *
  11042. * var done = _.after(saves.length, function() {
  11043. * console.log('done saving!');
  11044. * });
  11045. *
  11046. * _.forEach(saves, function(type) {
  11047. * asyncSave({ 'type': type, 'complete': done });
  11048. * });
  11049. * // => Logs 'done saving!' after the two async saves have completed.
  11050. */
  11051. function after(n, func) {
  11052. if (typeof func != 'function') {
  11053. throw new TypeError(FUNC_ERROR_TEXT);
  11054. }
  11055. n = toInteger(n);
  11056. return function() {
  11057. if (--n < 1) {
  11058. return func.apply(this, arguments);
  11059. }
  11060. };
  11061. }
  11062. /**
  11063. * Creates a function that invokes `func`, with up to `n` arguments,
  11064. * ignoring any additional arguments.
  11065. *
  11066. * @static
  11067. * @memberOf _
  11068. * @since 3.0.0
  11069. * @category Function
  11070. * @param {Function} func The function to cap arguments for.
  11071. * @param {number} [n=func.length] The arity cap.
  11072. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  11073. * @returns {Function} Returns the new capped function.
  11074. * @example
  11075. *
  11076. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  11077. * // => [6, 8, 10]
  11078. */
  11079. function ary(func, n, guard) {
  11080. n = guard ? undefined : n;
  11081. n = (func && n == null) ? func.length : n;
  11082. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  11083. }
  11084. /**
  11085. * Creates a function that invokes `func`, with the `this` binding and arguments
  11086. * of the created function, while it's called less than `n` times. Subsequent
  11087. * calls to the created function return the result of the last `func` invocation.
  11088. *
  11089. * @static
  11090. * @memberOf _
  11091. * @since 3.0.0
  11092. * @category Function
  11093. * @param {number} n The number of calls at which `func` is no longer invoked.
  11094. * @param {Function} func The function to restrict.
  11095. * @returns {Function} Returns the new restricted function.
  11096. * @example
  11097. *
  11098. * jQuery(element).on('click', _.before(5, addContactToList));
  11099. * // => Allows adding up to 4 contacts to the list.
  11100. */
  11101. function before(n, func) {
  11102. var result;
  11103. if (typeof func != 'function') {
  11104. throw new TypeError(FUNC_ERROR_TEXT);
  11105. }
  11106. n = toInteger(n);
  11107. return function() {
  11108. if (--n > 0) {
  11109. result = func.apply(this, arguments);
  11110. }
  11111. if (n <= 1) {
  11112. func = undefined;
  11113. }
  11114. return result;
  11115. };
  11116. }
  11117. /**
  11118. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  11119. * and `partials` prepended to the arguments it receives.
  11120. *
  11121. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  11122. * may be used as a placeholder for partially applied arguments.
  11123. *
  11124. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  11125. * property of bound functions.
  11126. *
  11127. * @static
  11128. * @memberOf _
  11129. * @since 0.1.0
  11130. * @category Function
  11131. * @param {Function} func The function to bind.
  11132. * @param {*} thisArg The `this` binding of `func`.
  11133. * @param {...*} [partials] The arguments to be partially applied.
  11134. * @returns {Function} Returns the new bound function.
  11135. * @example
  11136. *
  11137. * function greet(greeting, punctuation) {
  11138. * return greeting + ' ' + this.user + punctuation;
  11139. * }
  11140. *
  11141. * var object = { 'user': 'fred' };
  11142. *
  11143. * var bound = _.bind(greet, object, 'hi');
  11144. * bound('!');
  11145. * // => 'hi fred!'
  11146. *
  11147. * // Bound with placeholders.
  11148. * var bound = _.bind(greet, object, _, '!');
  11149. * bound('hi');
  11150. * // => 'hi fred!'
  11151. */
  11152. var bind = baseRest(function(func, thisArg, partials) {
  11153. var bitmask = WRAP_BIND_FLAG;
  11154. if (partials.length) {
  11155. var holders = replaceHolders(partials, getHolder(bind));
  11156. bitmask |= WRAP_PARTIAL_FLAG;
  11157. }
  11158. return createWrap(func, bitmask, thisArg, partials, holders);
  11159. });
  11160. /**
  11161. * Creates a function that invokes the method at `object[key]` with `partials`
  11162. * prepended to the arguments it receives.
  11163. *
  11164. * This method differs from `_.bind` by allowing bound functions to reference
  11165. * methods that may be redefined or don't yet exist. See
  11166. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  11167. * for more details.
  11168. *
  11169. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  11170. * builds, may be used as a placeholder for partially applied arguments.
  11171. *
  11172. * @static
  11173. * @memberOf _
  11174. * @since 0.10.0
  11175. * @category Function
  11176. * @param {Object} object The object to invoke the method on.
  11177. * @param {string} key The key of the method.
  11178. * @param {...*} [partials] The arguments to be partially applied.
  11179. * @returns {Function} Returns the new bound function.
  11180. * @example
  11181. *
  11182. * var object = {
  11183. * 'user': 'fred',
  11184. * 'greet': function(greeting, punctuation) {
  11185. * return greeting + ' ' + this.user + punctuation;
  11186. * }
  11187. * };
  11188. *
  11189. * var bound = _.bindKey(object, 'greet', 'hi');
  11190. * bound('!');
  11191. * // => 'hi fred!'
  11192. *
  11193. * object.greet = function(greeting, punctuation) {
  11194. * return greeting + 'ya ' + this.user + punctuation;
  11195. * };
  11196. *
  11197. * bound('!');
  11198. * // => 'hiya fred!'
  11199. *
  11200. * // Bound with placeholders.
  11201. * var bound = _.bindKey(object, 'greet', _, '!');
  11202. * bound('hi');
  11203. * // => 'hiya fred!'
  11204. */
  11205. var bindKey = baseRest(function(object, key, partials) {
  11206. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  11207. if (partials.length) {
  11208. var holders = replaceHolders(partials, getHolder(bindKey));
  11209. bitmask |= WRAP_PARTIAL_FLAG;
  11210. }
  11211. return createWrap(key, bitmask, object, partials, holders);
  11212. });
  11213. /**
  11214. * Creates a function that accepts arguments of `func` and either invokes
  11215. * `func` returning its result, if at least `arity` number of arguments have
  11216. * been provided, or returns a function that accepts the remaining `func`
  11217. * arguments, and so on. The arity of `func` may be specified if `func.length`
  11218. * is not sufficient.
  11219. *
  11220. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  11221. * may be used as a placeholder for provided arguments.
  11222. *
  11223. * **Note:** This method doesn't set the "length" property of curried functions.
  11224. *
  11225. * @static
  11226. * @memberOf _
  11227. * @since 2.0.0
  11228. * @category Function
  11229. * @param {Function} func The function to curry.
  11230. * @param {number} [arity=func.length] The arity of `func`.
  11231. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  11232. * @returns {Function} Returns the new curried function.
  11233. * @example
  11234. *
  11235. * var abc = function(a, b, c) {
  11236. * return [a, b, c];
  11237. * };
  11238. *
  11239. * var curried = _.curry(abc);
  11240. *
  11241. * curried(1)(2)(3);
  11242. * // => [1, 2, 3]
  11243. *
  11244. * curried(1, 2)(3);
  11245. * // => [1, 2, 3]
  11246. *
  11247. * curried(1, 2, 3);
  11248. * // => [1, 2, 3]
  11249. *
  11250. * // Curried with placeholders.
  11251. * curried(1)(_, 3)(2);
  11252. * // => [1, 2, 3]
  11253. */
  11254. function curry(func, arity, guard) {
  11255. arity = guard ? undefined : arity;
  11256. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  11257. result.placeholder = curry.placeholder;
  11258. return result;
  11259. }
  11260. /**
  11261. * This method is like `_.curry` except that arguments are applied to `func`
  11262. * in the manner of `_.partialRight` instead of `_.partial`.
  11263. *
  11264. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  11265. * builds, may be used as a placeholder for provided arguments.
  11266. *
  11267. * **Note:** This method doesn't set the "length" property of curried functions.
  11268. *
  11269. * @static
  11270. * @memberOf _
  11271. * @since 3.0.0
  11272. * @category Function
  11273. * @param {Function} func The function to curry.
  11274. * @param {number} [arity=func.length] The arity of `func`.
  11275. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  11276. * @returns {Function} Returns the new curried function.
  11277. * @example
  11278. *
  11279. * var abc = function(a, b, c) {
  11280. * return [a, b, c];
  11281. * };
  11282. *
  11283. * var curried = _.curryRight(abc);
  11284. *
  11285. * curried(3)(2)(1);
  11286. * // => [1, 2, 3]
  11287. *
  11288. * curried(2, 3)(1);
  11289. * // => [1, 2, 3]
  11290. *
  11291. * curried(1, 2, 3);
  11292. * // => [1, 2, 3]
  11293. *
  11294. * // Curried with placeholders.
  11295. * curried(3)(1, _)(2);
  11296. * // => [1, 2, 3]
  11297. */
  11298. function curryRight(func, arity, guard) {
  11299. arity = guard ? undefined : arity;
  11300. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  11301. result.placeholder = curryRight.placeholder;
  11302. return result;
  11303. }
  11304. /**
  11305. * Creates a debounced function that delays invoking `func` until after `wait`
  11306. * milliseconds have elapsed since the last time the debounced function was
  11307. * invoked. The debounced function comes with a `cancel` method to cancel
  11308. * delayed `func` invocations and a `flush` method to immediately invoke them.
  11309. * Provide `options` to indicate whether `func` should be invoked on the
  11310. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  11311. * with the last arguments provided to the debounced function. Subsequent
  11312. * calls to the debounced function return the result of the last `func`
  11313. * invocation.
  11314. *
  11315. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11316. * invoked on the trailing edge of the timeout only if the debounced function
  11317. * is invoked more than once during the `wait` timeout.
  11318. *
  11319. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11320. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11321. *
  11322. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11323. * for details over the differences between `_.debounce` and `_.throttle`.
  11324. *
  11325. * @static
  11326. * @memberOf _
  11327. * @since 0.1.0
  11328. * @category Function
  11329. * @param {Function} func The function to debounce.
  11330. * @param {number} [wait=0] The number of milliseconds to delay.
  11331. * @param {Object} [options={}] The options object.
  11332. * @param {boolean} [options.leading=false]
  11333. * Specify invoking on the leading edge of the timeout.
  11334. * @param {number} [options.maxWait]
  11335. * The maximum time `func` is allowed to be delayed before it's invoked.
  11336. * @param {boolean} [options.trailing=true]
  11337. * Specify invoking on the trailing edge of the timeout.
  11338. * @returns {Function} Returns the new debounced function.
  11339. * @example
  11340. *
  11341. * // Avoid costly calculations while the window size is in flux.
  11342. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  11343. *
  11344. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  11345. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  11346. * 'leading': true,
  11347. * 'trailing': false
  11348. * }));
  11349. *
  11350. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  11351. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  11352. * var source = new EventSource('/stream');
  11353. * jQuery(source).on('message', debounced);
  11354. *
  11355. * // Cancel the trailing debounced invocation.
  11356. * jQuery(window).on('popstate', debounced.cancel);
  11357. */
  11358. function debounce(func, wait, options) {
  11359. var lastArgs,
  11360. lastThis,
  11361. maxWait,
  11362. result,
  11363. timerId,
  11364. lastCallTime,
  11365. lastInvokeTime = 0,
  11366. leading = false,
  11367. maxing = false,
  11368. trailing = true;
  11369. if (typeof func != 'function') {
  11370. throw new TypeError(FUNC_ERROR_TEXT);
  11371. }
  11372. wait = toNumber(wait) || 0;
  11373. if (isObject(options)) {
  11374. leading = !!options.leading;
  11375. maxing = 'maxWait' in options;
  11376. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  11377. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11378. }
  11379. function invokeFunc(time) {
  11380. var args = lastArgs,
  11381. thisArg = lastThis;
  11382. lastArgs = lastThis = undefined;
  11383. lastInvokeTime = time;
  11384. result = func.apply(thisArg, args);
  11385. return result;
  11386. }
  11387. function leadingEdge(time) {
  11388. // Reset any `maxWait` timer.
  11389. lastInvokeTime = time;
  11390. // Start the timer for the trailing edge.
  11391. timerId = setTimeout(timerExpired, wait);
  11392. // Invoke the leading edge.
  11393. return leading ? invokeFunc(time) : result;
  11394. }
  11395. function remainingWait(time) {
  11396. var timeSinceLastCall = time - lastCallTime,
  11397. timeSinceLastInvoke = time - lastInvokeTime,
  11398. timeWaiting = wait - timeSinceLastCall;
  11399. return maxing
  11400. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  11401. : timeWaiting;
  11402. }
  11403. function shouldInvoke(time) {
  11404. var timeSinceLastCall = time - lastCallTime,
  11405. timeSinceLastInvoke = time - lastInvokeTime;
  11406. // Either this is the first call, activity has stopped and we're at the
  11407. // trailing edge, the system time has gone backwards and we're treating
  11408. // it as the trailing edge, or we've hit the `maxWait` limit.
  11409. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  11410. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  11411. }
  11412. function timerExpired() {
  11413. var time = now();
  11414. if (shouldInvoke(time)) {
  11415. return trailingEdge(time);
  11416. }
  11417. // Restart the timer.
  11418. timerId = setTimeout(timerExpired, remainingWait(time));
  11419. }
  11420. function trailingEdge(time) {
  11421. timerId = undefined;
  11422. // Only invoke if we have `lastArgs` which means `func` has been
  11423. // debounced at least once.
  11424. if (trailing && lastArgs) {
  11425. return invokeFunc(time);
  11426. }
  11427. lastArgs = lastThis = undefined;
  11428. return result;
  11429. }
  11430. function cancel() {
  11431. if (timerId !== undefined) {
  11432. clearTimeout(timerId);
  11433. }
  11434. lastInvokeTime = 0;
  11435. lastArgs = lastCallTime = lastThis = timerId = undefined;
  11436. }
  11437. function flush() {
  11438. return timerId === undefined ? result : trailingEdge(now());
  11439. }
  11440. function debounced() {
  11441. var time = now(),
  11442. isInvoking = shouldInvoke(time);
  11443. lastArgs = arguments;
  11444. lastThis = this;
  11445. lastCallTime = time;
  11446. if (isInvoking) {
  11447. if (timerId === undefined) {
  11448. return leadingEdge(lastCallTime);
  11449. }
  11450. if (maxing) {
  11451. // Handle invocations in a tight loop.
  11452. clearTimeout(timerId);
  11453. timerId = setTimeout(timerExpired, wait);
  11454. return invokeFunc(lastCallTime);
  11455. }
  11456. }
  11457. if (timerId === undefined) {
  11458. timerId = setTimeout(timerExpired, wait);
  11459. }
  11460. return result;
  11461. }
  11462. debounced.cancel = cancel;
  11463. debounced.flush = flush;
  11464. return debounced;
  11465. }
  11466. /**
  11467. * Defers invoking the `func` until the current call stack has cleared. Any
  11468. * additional arguments are provided to `func` when it's invoked.
  11469. *
  11470. * @static
  11471. * @memberOf _
  11472. * @since 0.1.0
  11473. * @category Function
  11474. * @param {Function} func The function to defer.
  11475. * @param {...*} [args] The arguments to invoke `func` with.
  11476. * @returns {number} Returns the timer id.
  11477. * @example
  11478. *
  11479. * _.defer(function(text) {
  11480. * console.log(text);
  11481. * }, 'deferred');
  11482. * // => Logs 'deferred' after one millisecond.
  11483. */
  11484. var defer = baseRest(function(func, args) {
  11485. return baseDelay(func, 1, args);
  11486. });
  11487. /**
  11488. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11489. * provided to `func` when it's invoked.
  11490. *
  11491. * @static
  11492. * @memberOf _
  11493. * @since 0.1.0
  11494. * @category Function
  11495. * @param {Function} func The function to delay.
  11496. * @param {number} wait The number of milliseconds to delay invocation.
  11497. * @param {...*} [args] The arguments to invoke `func` with.
  11498. * @returns {number} Returns the timer id.
  11499. * @example
  11500. *
  11501. * _.delay(function(text) {
  11502. * console.log(text);
  11503. * }, 1000, 'later');
  11504. * // => Logs 'later' after one second.
  11505. */
  11506. var delay = baseRest(function(func, wait, args) {
  11507. return baseDelay(func, toNumber(wait) || 0, args);
  11508. });
  11509. /**
  11510. * Creates a function that invokes `func` with arguments reversed.
  11511. *
  11512. * @static
  11513. * @memberOf _
  11514. * @since 4.0.0
  11515. * @category Function
  11516. * @param {Function} func The function to flip arguments for.
  11517. * @returns {Function} Returns the new flipped function.
  11518. * @example
  11519. *
  11520. * var flipped = _.flip(function() {
  11521. * return _.toArray(arguments);
  11522. * });
  11523. *
  11524. * flipped('a', 'b', 'c', 'd');
  11525. * // => ['d', 'c', 'b', 'a']
  11526. */
  11527. function flip(func) {
  11528. return createWrap(func, WRAP_FLIP_FLAG);
  11529. }
  11530. /**
  11531. * Creates a function that memoizes the result of `func`. If `resolver` is
  11532. * provided, it determines the cache key for storing the result based on the
  11533. * arguments provided to the memoized function. By default, the first argument
  11534. * provided to the memoized function is used as the map cache key. The `func`
  11535. * is invoked with the `this` binding of the memoized function.
  11536. *
  11537. * **Note:** The cache is exposed as the `cache` property on the memoized
  11538. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11539. * constructor with one whose instances implement the
  11540. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11541. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11542. *
  11543. * @static
  11544. * @memberOf _
  11545. * @since 0.1.0
  11546. * @category Function
  11547. * @param {Function} func The function to have its output memoized.
  11548. * @param {Function} [resolver] The function to resolve the cache key.
  11549. * @returns {Function} Returns the new memoized function.
  11550. * @example
  11551. *
  11552. * var object = { 'a': 1, 'b': 2 };
  11553. * var other = { 'c': 3, 'd': 4 };
  11554. *
  11555. * var values = _.memoize(_.values);
  11556. * values(object);
  11557. * // => [1, 2]
  11558. *
  11559. * values(other);
  11560. * // => [3, 4]
  11561. *
  11562. * object.a = 2;
  11563. * values(object);
  11564. * // => [1, 2]
  11565. *
  11566. * // Modify the result cache.
  11567. * values.cache.set(object, ['a', 'b']);
  11568. * values(object);
  11569. * // => ['a', 'b']
  11570. *
  11571. * // Replace `_.memoize.Cache`.
  11572. * _.memoize.Cache = WeakMap;
  11573. */
  11574. function memoize(func, resolver) {
  11575. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11576. throw new TypeError(FUNC_ERROR_TEXT);
  11577. }
  11578. var memoized = function() {
  11579. var args = arguments,
  11580. key = resolver ? resolver.apply(this, args) : args[0],
  11581. cache = memoized.cache;
  11582. if (cache.has(key)) {
  11583. return cache.get(key);
  11584. }
  11585. var result = func.apply(this, args);
  11586. memoized.cache = cache.set(key, result) || cache;
  11587. return result;
  11588. };
  11589. memoized.cache = new (memoize.Cache || MapCache);
  11590. return memoized;
  11591. }
  11592. // Expose `MapCache`.
  11593. memoize.Cache = MapCache;
  11594. /**
  11595. * Creates a function that negates the result of the predicate `func`. The
  11596. * `func` predicate is invoked with the `this` binding and arguments of the
  11597. * created function.
  11598. *
  11599. * @static
  11600. * @memberOf _
  11601. * @since 3.0.0
  11602. * @category Function
  11603. * @param {Function} predicate The predicate to negate.
  11604. * @returns {Function} Returns the new negated function.
  11605. * @example
  11606. *
  11607. * function isEven(n) {
  11608. * return n % 2 == 0;
  11609. * }
  11610. *
  11611. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11612. * // => [1, 3, 5]
  11613. */
  11614. function negate(predicate) {
  11615. if (typeof predicate != 'function') {
  11616. throw new TypeError(FUNC_ERROR_TEXT);
  11617. }
  11618. return function() {
  11619. var args = arguments;
  11620. switch (args.length) {
  11621. case 0: return !predicate.call(this);
  11622. case 1: return !predicate.call(this, args[0]);
  11623. case 2: return !predicate.call(this, args[0], args[1]);
  11624. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11625. }
  11626. return !predicate.apply(this, args);
  11627. };
  11628. }
  11629. /**
  11630. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11631. * to the function return the value of the first invocation. The `func` is
  11632. * invoked with the `this` binding and arguments of the created function.
  11633. *
  11634. * @static
  11635. * @memberOf _
  11636. * @since 0.1.0
  11637. * @category Function
  11638. * @param {Function} func The function to restrict.
  11639. * @returns {Function} Returns the new restricted function.
  11640. * @example
  11641. *
  11642. * var initialize = _.once(createApplication);
  11643. * initialize();
  11644. * initialize();
  11645. * // => `createApplication` is invoked once
  11646. */
  11647. function once(func) {
  11648. return before(2, func);
  11649. }
  11650. /**
  11651. * Creates a function that invokes `func` with its arguments transformed.
  11652. *
  11653. * @static
  11654. * @since 4.0.0
  11655. * @memberOf _
  11656. * @category Function
  11657. * @param {Function} func The function to wrap.
  11658. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11659. * The argument transforms.
  11660. * @returns {Function} Returns the new function.
  11661. * @example
  11662. *
  11663. * function doubled(n) {
  11664. * return n * 2;
  11665. * }
  11666. *
  11667. * function square(n) {
  11668. * return n * n;
  11669. * }
  11670. *
  11671. * var func = _.overArgs(function(x, y) {
  11672. * return [x, y];
  11673. * }, [square, doubled]);
  11674. *
  11675. * func(9, 3);
  11676. * // => [81, 6]
  11677. *
  11678. * func(10, 5);
  11679. * // => [100, 10]
  11680. */
  11681. var overArgs = castRest(function(func, transforms) {
  11682. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11683. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11684. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11685. var funcsLength = transforms.length;
  11686. return baseRest(function(args) {
  11687. var index = -1,
  11688. length = nativeMin(args.length, funcsLength);
  11689. while (++index < length) {
  11690. args[index] = transforms[index].call(this, args[index]);
  11691. }
  11692. return apply(func, this, args);
  11693. });
  11694. });
  11695. /**
  11696. * Creates a function that invokes `func` with `partials` prepended to the
  11697. * arguments it receives. This method is like `_.bind` except it does **not**
  11698. * alter the `this` binding.
  11699. *
  11700. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11701. * builds, may be used as a placeholder for partially applied arguments.
  11702. *
  11703. * **Note:** This method doesn't set the "length" property of partially
  11704. * applied functions.
  11705. *
  11706. * @static
  11707. * @memberOf _
  11708. * @since 0.2.0
  11709. * @category Function
  11710. * @param {Function} func The function to partially apply arguments to.
  11711. * @param {...*} [partials] The arguments to be partially applied.
  11712. * @returns {Function} Returns the new partially applied function.
  11713. * @example
  11714. *
  11715. * function greet(greeting, name) {
  11716. * return greeting + ' ' + name;
  11717. * }
  11718. *
  11719. * var sayHelloTo = _.partial(greet, 'hello');
  11720. * sayHelloTo('fred');
  11721. * // => 'hello fred'
  11722. *
  11723. * // Partially applied with placeholders.
  11724. * var greetFred = _.partial(greet, _, 'fred');
  11725. * greetFred('hi');
  11726. * // => 'hi fred'
  11727. */
  11728. var partial = baseRest(function(func, partials) {
  11729. var holders = replaceHolders(partials, getHolder(partial));
  11730. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11731. });
  11732. /**
  11733. * This method is like `_.partial` except that partially applied arguments
  11734. * are appended to the arguments it receives.
  11735. *
  11736. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11737. * builds, may be used as a placeholder for partially applied arguments.
  11738. *
  11739. * **Note:** This method doesn't set the "length" property of partially
  11740. * applied functions.
  11741. *
  11742. * @static
  11743. * @memberOf _
  11744. * @since 1.0.0
  11745. * @category Function
  11746. * @param {Function} func The function to partially apply arguments to.
  11747. * @param {...*} [partials] The arguments to be partially applied.
  11748. * @returns {Function} Returns the new partially applied function.
  11749. * @example
  11750. *
  11751. * function greet(greeting, name) {
  11752. * return greeting + ' ' + name;
  11753. * }
  11754. *
  11755. * var greetFred = _.partialRight(greet, 'fred');
  11756. * greetFred('hi');
  11757. * // => 'hi fred'
  11758. *
  11759. * // Partially applied with placeholders.
  11760. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11761. * sayHelloTo('fred');
  11762. * // => 'hello fred'
  11763. */
  11764. var partialRight = baseRest(function(func, partials) {
  11765. var holders = replaceHolders(partials, getHolder(partialRight));
  11766. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11767. });
  11768. /**
  11769. * Creates a function that invokes `func` with arguments arranged according
  11770. * to the specified `indexes` where the argument value at the first index is
  11771. * provided as the first argument, the argument value at the second index is
  11772. * provided as the second argument, and so on.
  11773. *
  11774. * @static
  11775. * @memberOf _
  11776. * @since 3.0.0
  11777. * @category Function
  11778. * @param {Function} func The function to rearrange arguments for.
  11779. * @param {...(number|number[])} indexes The arranged argument indexes.
  11780. * @returns {Function} Returns the new function.
  11781. * @example
  11782. *
  11783. * var rearged = _.rearg(function(a, b, c) {
  11784. * return [a, b, c];
  11785. * }, [2, 0, 1]);
  11786. *
  11787. * rearged('b', 'c', 'a')
  11788. * // => ['a', 'b', 'c']
  11789. */
  11790. var rearg = flatRest(function(func, indexes) {
  11791. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11792. });
  11793. /**
  11794. * Creates a function that invokes `func` with the `this` binding of the
  11795. * created function and arguments from `start` and beyond provided as
  11796. * an array.
  11797. *
  11798. * **Note:** This method is based on the
  11799. * [rest parameter](https://mdn.io/rest_parameters).
  11800. *
  11801. * @static
  11802. * @memberOf _
  11803. * @since 4.0.0
  11804. * @category Function
  11805. * @param {Function} func The function to apply a rest parameter to.
  11806. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11807. * @returns {Function} Returns the new function.
  11808. * @example
  11809. *
  11810. * var say = _.rest(function(what, names) {
  11811. * return what + ' ' + _.initial(names).join(', ') +
  11812. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11813. * });
  11814. *
  11815. * say('hello', 'fred', 'barney', 'pebbles');
  11816. * // => 'hello fred, barney, & pebbles'
  11817. */
  11818. function rest(func, start) {
  11819. if (typeof func != 'function') {
  11820. throw new TypeError(FUNC_ERROR_TEXT);
  11821. }
  11822. start = start === undefined ? start : toInteger(start);
  11823. return baseRest(func, start);
  11824. }
  11825. /**
  11826. * Creates a function that invokes `func` with the `this` binding of the
  11827. * create function and an array of arguments much like
  11828. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11829. *
  11830. * **Note:** This method is based on the
  11831. * [spread operator](https://mdn.io/spread_operator).
  11832. *
  11833. * @static
  11834. * @memberOf _
  11835. * @since 3.2.0
  11836. * @category Function
  11837. * @param {Function} func The function to spread arguments over.
  11838. * @param {number} [start=0] The start position of the spread.
  11839. * @returns {Function} Returns the new function.
  11840. * @example
  11841. *
  11842. * var say = _.spread(function(who, what) {
  11843. * return who + ' says ' + what;
  11844. * });
  11845. *
  11846. * say(['fred', 'hello']);
  11847. * // => 'fred says hello'
  11848. *
  11849. * var numbers = Promise.all([
  11850. * Promise.resolve(40),
  11851. * Promise.resolve(36)
  11852. * ]);
  11853. *
  11854. * numbers.then(_.spread(function(x, y) {
  11855. * return x + y;
  11856. * }));
  11857. * // => a Promise of 76
  11858. */
  11859. function spread(func, start) {
  11860. if (typeof func != 'function') {
  11861. throw new TypeError(FUNC_ERROR_TEXT);
  11862. }
  11863. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11864. return baseRest(function(args) {
  11865. var array = args[start],
  11866. otherArgs = castSlice(args, 0, start);
  11867. if (array) {
  11868. arrayPush(otherArgs, array);
  11869. }
  11870. return apply(func, this, otherArgs);
  11871. });
  11872. }
  11873. /**
  11874. * Creates a throttled function that only invokes `func` at most once per
  11875. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11876. * method to cancel delayed `func` invocations and a `flush` method to
  11877. * immediately invoke them. Provide `options` to indicate whether `func`
  11878. * should be invoked on the leading and/or trailing edge of the `wait`
  11879. * timeout. The `func` is invoked with the last arguments provided to the
  11880. * throttled function. Subsequent calls to the throttled function return the
  11881. * result of the last `func` invocation.
  11882. *
  11883. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11884. * invoked on the trailing edge of the timeout only if the throttled function
  11885. * is invoked more than once during the `wait` timeout.
  11886. *
  11887. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11888. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11889. *
  11890. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11891. * for details over the differences between `_.throttle` and `_.debounce`.
  11892. *
  11893. * @static
  11894. * @memberOf _
  11895. * @since 0.1.0
  11896. * @category Function
  11897. * @param {Function} func The function to throttle.
  11898. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11899. * @param {Object} [options={}] The options object.
  11900. * @param {boolean} [options.leading=true]
  11901. * Specify invoking on the leading edge of the timeout.
  11902. * @param {boolean} [options.trailing=true]
  11903. * Specify invoking on the trailing edge of the timeout.
  11904. * @returns {Function} Returns the new throttled function.
  11905. * @example
  11906. *
  11907. * // Avoid excessively updating the position while scrolling.
  11908. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11909. *
  11910. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11911. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11912. * jQuery(element).on('click', throttled);
  11913. *
  11914. * // Cancel the trailing throttled invocation.
  11915. * jQuery(window).on('popstate', throttled.cancel);
  11916. */
  11917. function throttle(func, wait, options) {
  11918. var leading = true,
  11919. trailing = true;
  11920. if (typeof func != 'function') {
  11921. throw new TypeError(FUNC_ERROR_TEXT);
  11922. }
  11923. if (isObject(options)) {
  11924. leading = 'leading' in options ? !!options.leading : leading;
  11925. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11926. }
  11927. return debounce(func, wait, {
  11928. 'leading': leading,
  11929. 'maxWait': wait,
  11930. 'trailing': trailing
  11931. });
  11932. }
  11933. /**
  11934. * Creates a function that accepts up to one argument, ignoring any
  11935. * additional arguments.
  11936. *
  11937. * @static
  11938. * @memberOf _
  11939. * @since 4.0.0
  11940. * @category Function
  11941. * @param {Function} func The function to cap arguments for.
  11942. * @returns {Function} Returns the new capped function.
  11943. * @example
  11944. *
  11945. * _.map(['6', '8', '10'], _.unary(parseInt));
  11946. * // => [6, 8, 10]
  11947. */
  11948. function unary(func) {
  11949. return ary(func, 1);
  11950. }
  11951. /**
  11952. * Creates a function that provides `value` to `wrapper` as its first
  11953. * argument. Any additional arguments provided to the function are appended
  11954. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11955. * binding of the created function.
  11956. *
  11957. * @static
  11958. * @memberOf _
  11959. * @since 0.1.0
  11960. * @category Function
  11961. * @param {*} value The value to wrap.
  11962. * @param {Function} [wrapper=identity] The wrapper function.
  11963. * @returns {Function} Returns the new function.
  11964. * @example
  11965. *
  11966. * var p = _.wrap(_.escape, function(func, text) {
  11967. * return '<p>' + func(text) + '</p>';
  11968. * });
  11969. *
  11970. * p('fred, barney, & pebbles');
  11971. * // => '<p>fred, barney, &amp; pebbles</p>'
  11972. */
  11973. function wrap(value, wrapper) {
  11974. return partial(castFunction(wrapper), value);
  11975. }
  11976. /*------------------------------------------------------------------------*/
  11977. /**
  11978. * Casts `value` as an array if it's not one.
  11979. *
  11980. * @static
  11981. * @memberOf _
  11982. * @since 4.4.0
  11983. * @category Lang
  11984. * @param {*} value The value to inspect.
  11985. * @returns {Array} Returns the cast array.
  11986. * @example
  11987. *
  11988. * _.castArray(1);
  11989. * // => [1]
  11990. *
  11991. * _.castArray({ 'a': 1 });
  11992. * // => [{ 'a': 1 }]
  11993. *
  11994. * _.castArray('abc');
  11995. * // => ['abc']
  11996. *
  11997. * _.castArray(null);
  11998. * // => [null]
  11999. *
  12000. * _.castArray(undefined);
  12001. * // => [undefined]
  12002. *
  12003. * _.castArray();
  12004. * // => []
  12005. *
  12006. * var array = [1, 2, 3];
  12007. * console.log(_.castArray(array) === array);
  12008. * // => true
  12009. */
  12010. function castArray() {
  12011. if (!arguments.length) {
  12012. return [];
  12013. }
  12014. var value = arguments[0];
  12015. return isArray(value) ? value : [value];
  12016. }
  12017. /**
  12018. * Creates a shallow clone of `value`.
  12019. *
  12020. * **Note:** This method is loosely based on the
  12021. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  12022. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  12023. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  12024. * arrays. The own enumerable properties of `arguments` objects are cloned
  12025. * as plain objects. An empty object is returned for uncloneable values such
  12026. * as error objects, functions, DOM nodes, and WeakMaps.
  12027. *
  12028. * @static
  12029. * @memberOf _
  12030. * @since 0.1.0
  12031. * @category Lang
  12032. * @param {*} value The value to clone.
  12033. * @returns {*} Returns the cloned value.
  12034. * @see _.cloneDeep
  12035. * @example
  12036. *
  12037. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  12038. *
  12039. * var shallow = _.clone(objects);
  12040. * console.log(shallow[0] === objects[0]);
  12041. * // => true
  12042. */
  12043. function clone(value) {
  12044. return baseClone(value, CLONE_SYMBOLS_FLAG);
  12045. }
  12046. /**
  12047. * This method is like `_.clone` except that it accepts `customizer` which
  12048. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  12049. * cloning is handled by the method instead. The `customizer` is invoked with
  12050. * up to four arguments; (value [, index|key, object, stack]).
  12051. *
  12052. * @static
  12053. * @memberOf _
  12054. * @since 4.0.0
  12055. * @category Lang
  12056. * @param {*} value The value to clone.
  12057. * @param {Function} [customizer] The function to customize cloning.
  12058. * @returns {*} Returns the cloned value.
  12059. * @see _.cloneDeepWith
  12060. * @example
  12061. *
  12062. * function customizer(value) {
  12063. * if (_.isElement(value)) {
  12064. * return value.cloneNode(false);
  12065. * }
  12066. * }
  12067. *
  12068. * var el = _.cloneWith(document.body, customizer);
  12069. *
  12070. * console.log(el === document.body);
  12071. * // => false
  12072. * console.log(el.nodeName);
  12073. * // => 'BODY'
  12074. * console.log(el.childNodes.length);
  12075. * // => 0
  12076. */
  12077. function cloneWith(value, customizer) {
  12078. customizer = typeof customizer == 'function' ? customizer : undefined;
  12079. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  12080. }
  12081. /**
  12082. * This method is like `_.clone` except that it recursively clones `value`.
  12083. *
  12084. * @static
  12085. * @memberOf _
  12086. * @since 1.0.0
  12087. * @category Lang
  12088. * @param {*} value The value to recursively clone.
  12089. * @returns {*} Returns the deep cloned value.
  12090. * @see _.clone
  12091. * @example
  12092. *
  12093. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  12094. *
  12095. * var deep = _.cloneDeep(objects);
  12096. * console.log(deep[0] === objects[0]);
  12097. * // => false
  12098. */
  12099. function cloneDeep(value) {
  12100. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  12101. }
  12102. /**
  12103. * This method is like `_.cloneWith` except that it recursively clones `value`.
  12104. *
  12105. * @static
  12106. * @memberOf _
  12107. * @since 4.0.0
  12108. * @category Lang
  12109. * @param {*} value The value to recursively clone.
  12110. * @param {Function} [customizer] The function to customize cloning.
  12111. * @returns {*} Returns the deep cloned value.
  12112. * @see _.cloneWith
  12113. * @example
  12114. *
  12115. * function customizer(value) {
  12116. * if (_.isElement(value)) {
  12117. * return value.cloneNode(true);
  12118. * }
  12119. * }
  12120. *
  12121. * var el = _.cloneDeepWith(document.body, customizer);
  12122. *
  12123. * console.log(el === document.body);
  12124. * // => false
  12125. * console.log(el.nodeName);
  12126. * // => 'BODY'
  12127. * console.log(el.childNodes.length);
  12128. * // => 20
  12129. */
  12130. function cloneDeepWith(value, customizer) {
  12131. customizer = typeof customizer == 'function' ? customizer : undefined;
  12132. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  12133. }
  12134. /**
  12135. * Checks if `object` conforms to `source` by invoking the predicate
  12136. * properties of `source` with the corresponding property values of `object`.
  12137. *
  12138. * **Note:** This method is equivalent to `_.conforms` when `source` is
  12139. * partially applied.
  12140. *
  12141. * @static
  12142. * @memberOf _
  12143. * @since 4.14.0
  12144. * @category Lang
  12145. * @param {Object} object The object to inspect.
  12146. * @param {Object} source The object of property predicates to conform to.
  12147. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  12148. * @example
  12149. *
  12150. * var object = { 'a': 1, 'b': 2 };
  12151. *
  12152. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  12153. * // => true
  12154. *
  12155. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  12156. * // => false
  12157. */
  12158. function conformsTo(object, source) {
  12159. return source == null || baseConformsTo(object, source, keys(source));
  12160. }
  12161. /**
  12162. * Performs a
  12163. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12164. * comparison between two values to determine if they are equivalent.
  12165. *
  12166. * @static
  12167. * @memberOf _
  12168. * @since 4.0.0
  12169. * @category Lang
  12170. * @param {*} value The value to compare.
  12171. * @param {*} other The other value to compare.
  12172. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12173. * @example
  12174. *
  12175. * var object = { 'a': 1 };
  12176. * var other = { 'a': 1 };
  12177. *
  12178. * _.eq(object, object);
  12179. * // => true
  12180. *
  12181. * _.eq(object, other);
  12182. * // => false
  12183. *
  12184. * _.eq('a', 'a');
  12185. * // => true
  12186. *
  12187. * _.eq('a', Object('a'));
  12188. * // => false
  12189. *
  12190. * _.eq(NaN, NaN);
  12191. * // => true
  12192. */
  12193. function eq(value, other) {
  12194. return value === other || (value !== value && other !== other);
  12195. }
  12196. /**
  12197. * Checks if `value` is greater than `other`.
  12198. *
  12199. * @static
  12200. * @memberOf _
  12201. * @since 3.9.0
  12202. * @category Lang
  12203. * @param {*} value The value to compare.
  12204. * @param {*} other The other value to compare.
  12205. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  12206. * else `false`.
  12207. * @see _.lt
  12208. * @example
  12209. *
  12210. * _.gt(3, 1);
  12211. * // => true
  12212. *
  12213. * _.gt(3, 3);
  12214. * // => false
  12215. *
  12216. * _.gt(1, 3);
  12217. * // => false
  12218. */
  12219. var gt = createRelationalOperation(baseGt);
  12220. /**
  12221. * Checks if `value` is greater than or equal to `other`.
  12222. *
  12223. * @static
  12224. * @memberOf _
  12225. * @since 3.9.0
  12226. * @category Lang
  12227. * @param {*} value The value to compare.
  12228. * @param {*} other The other value to compare.
  12229. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  12230. * `other`, else `false`.
  12231. * @see _.lte
  12232. * @example
  12233. *
  12234. * _.gte(3, 1);
  12235. * // => true
  12236. *
  12237. * _.gte(3, 3);
  12238. * // => true
  12239. *
  12240. * _.gte(1, 3);
  12241. * // => false
  12242. */
  12243. var gte = createRelationalOperation(function(value, other) {
  12244. return value >= other;
  12245. });
  12246. /**
  12247. * Checks if `value` is likely an `arguments` object.
  12248. *
  12249. * @static
  12250. * @memberOf _
  12251. * @since 0.1.0
  12252. * @category Lang
  12253. * @param {*} value The value to check.
  12254. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  12255. * else `false`.
  12256. * @example
  12257. *
  12258. * _.isArguments(function() { return arguments; }());
  12259. * // => true
  12260. *
  12261. * _.isArguments([1, 2, 3]);
  12262. * // => false
  12263. */
  12264. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  12265. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  12266. !propertyIsEnumerable.call(value, 'callee');
  12267. };
  12268. /**
  12269. * Checks if `value` is classified as an `Array` object.
  12270. *
  12271. * @static
  12272. * @memberOf _
  12273. * @since 0.1.0
  12274. * @category Lang
  12275. * @param {*} value The value to check.
  12276. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  12277. * @example
  12278. *
  12279. * _.isArray([1, 2, 3]);
  12280. * // => true
  12281. *
  12282. * _.isArray(document.body.children);
  12283. * // => false
  12284. *
  12285. * _.isArray('abc');
  12286. * // => false
  12287. *
  12288. * _.isArray(_.noop);
  12289. * // => false
  12290. */
  12291. var isArray = Array.isArray;
  12292. /**
  12293. * Checks if `value` is classified as an `ArrayBuffer` object.
  12294. *
  12295. * @static
  12296. * @memberOf _
  12297. * @since 4.3.0
  12298. * @category Lang
  12299. * @param {*} value The value to check.
  12300. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  12301. * @example
  12302. *
  12303. * _.isArrayBuffer(new ArrayBuffer(2));
  12304. * // => true
  12305. *
  12306. * _.isArrayBuffer(new Array(2));
  12307. * // => false
  12308. */
  12309. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  12310. /**
  12311. * Checks if `value` is array-like. A value is considered array-like if it's
  12312. * not a function and has a `value.length` that's an integer greater than or
  12313. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  12314. *
  12315. * @static
  12316. * @memberOf _
  12317. * @since 4.0.0
  12318. * @category Lang
  12319. * @param {*} value The value to check.
  12320. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  12321. * @example
  12322. *
  12323. * _.isArrayLike([1, 2, 3]);
  12324. * // => true
  12325. *
  12326. * _.isArrayLike(document.body.children);
  12327. * // => true
  12328. *
  12329. * _.isArrayLike('abc');
  12330. * // => true
  12331. *
  12332. * _.isArrayLike(_.noop);
  12333. * // => false
  12334. */
  12335. function isArrayLike(value) {
  12336. return value != null && isLength(value.length) && !isFunction(value);
  12337. }
  12338. /**
  12339. * This method is like `_.isArrayLike` except that it also checks if `value`
  12340. * is an object.
  12341. *
  12342. * @static
  12343. * @memberOf _
  12344. * @since 4.0.0
  12345. * @category Lang
  12346. * @param {*} value The value to check.
  12347. * @returns {boolean} Returns `true` if `value` is an array-like object,
  12348. * else `false`.
  12349. * @example
  12350. *
  12351. * _.isArrayLikeObject([1, 2, 3]);
  12352. * // => true
  12353. *
  12354. * _.isArrayLikeObject(document.body.children);
  12355. * // => true
  12356. *
  12357. * _.isArrayLikeObject('abc');
  12358. * // => false
  12359. *
  12360. * _.isArrayLikeObject(_.noop);
  12361. * // => false
  12362. */
  12363. function isArrayLikeObject(value) {
  12364. return isObjectLike(value) && isArrayLike(value);
  12365. }
  12366. /**
  12367. * Checks if `value` is classified as a boolean primitive or object.
  12368. *
  12369. * @static
  12370. * @memberOf _
  12371. * @since 0.1.0
  12372. * @category Lang
  12373. * @param {*} value The value to check.
  12374. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  12375. * @example
  12376. *
  12377. * _.isBoolean(false);
  12378. * // => true
  12379. *
  12380. * _.isBoolean(null);
  12381. * // => false
  12382. */
  12383. function isBoolean(value) {
  12384. return value === true || value === false ||
  12385. (isObjectLike(value) && baseGetTag(value) == boolTag);
  12386. }
  12387. /**
  12388. * Checks if `value` is a buffer.
  12389. *
  12390. * @static
  12391. * @memberOf _
  12392. * @since 4.3.0
  12393. * @category Lang
  12394. * @param {*} value The value to check.
  12395. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  12396. * @example
  12397. *
  12398. * _.isBuffer(new Buffer(2));
  12399. * // => true
  12400. *
  12401. * _.isBuffer(new Uint8Array(2));
  12402. * // => false
  12403. */
  12404. var isBuffer = nativeIsBuffer || stubFalse;
  12405. /**
  12406. * Checks if `value` is classified as a `Date` object.
  12407. *
  12408. * @static
  12409. * @memberOf _
  12410. * @since 0.1.0
  12411. * @category Lang
  12412. * @param {*} value The value to check.
  12413. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  12414. * @example
  12415. *
  12416. * _.isDate(new Date);
  12417. * // => true
  12418. *
  12419. * _.isDate('Mon April 23 2012');
  12420. * // => false
  12421. */
  12422. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  12423. /**
  12424. * Checks if `value` is likely a DOM element.
  12425. *
  12426. * @static
  12427. * @memberOf _
  12428. * @since 0.1.0
  12429. * @category Lang
  12430. * @param {*} value The value to check.
  12431. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  12432. * @example
  12433. *
  12434. * _.isElement(document.body);
  12435. * // => true
  12436. *
  12437. * _.isElement('<body>');
  12438. * // => false
  12439. */
  12440. function isElement(value) {
  12441. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  12442. }
  12443. /**
  12444. * Checks if `value` is an empty object, collection, map, or set.
  12445. *
  12446. * Objects are considered empty if they have no own enumerable string keyed
  12447. * properties.
  12448. *
  12449. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  12450. * jQuery-like collections are considered empty if they have a `length` of `0`.
  12451. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  12452. *
  12453. * @static
  12454. * @memberOf _
  12455. * @since 0.1.0
  12456. * @category Lang
  12457. * @param {*} value The value to check.
  12458. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  12459. * @example
  12460. *
  12461. * _.isEmpty(null);
  12462. * // => true
  12463. *
  12464. * _.isEmpty(true);
  12465. * // => true
  12466. *
  12467. * _.isEmpty(1);
  12468. * // => true
  12469. *
  12470. * _.isEmpty([1, 2, 3]);
  12471. * // => false
  12472. *
  12473. * _.isEmpty({ 'a': 1 });
  12474. * // => false
  12475. */
  12476. function isEmpty(value) {
  12477. if (value == null) {
  12478. return true;
  12479. }
  12480. if (isArrayLike(value) &&
  12481. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  12482. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12483. return !value.length;
  12484. }
  12485. var tag = getTag(value);
  12486. if (tag == mapTag || tag == setTag) {
  12487. return !value.size;
  12488. }
  12489. if (isPrototype(value)) {
  12490. return !baseKeys(value).length;
  12491. }
  12492. for (var key in value) {
  12493. if (hasOwnProperty.call(value, key)) {
  12494. return false;
  12495. }
  12496. }
  12497. return true;
  12498. }
  12499. /**
  12500. * Performs a deep comparison between two values to determine if they are
  12501. * equivalent.
  12502. *
  12503. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12504. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12505. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12506. * by their own, not inherited, enumerable properties. Functions and DOM
  12507. * nodes are compared by strict equality, i.e. `===`.
  12508. *
  12509. * @static
  12510. * @memberOf _
  12511. * @since 0.1.0
  12512. * @category Lang
  12513. * @param {*} value The value to compare.
  12514. * @param {*} other The other value to compare.
  12515. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12516. * @example
  12517. *
  12518. * var object = { 'a': 1 };
  12519. * var other = { 'a': 1 };
  12520. *
  12521. * _.isEqual(object, other);
  12522. * // => true
  12523. *
  12524. * object === other;
  12525. * // => false
  12526. */
  12527. function isEqual(value, other) {
  12528. return baseIsEqual(value, other);
  12529. }
  12530. /**
  12531. * This method is like `_.isEqual` except that it accepts `customizer` which
  12532. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12533. * are handled by the method instead. The `customizer` is invoked with up to
  12534. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12535. *
  12536. * @static
  12537. * @memberOf _
  12538. * @since 4.0.0
  12539. * @category Lang
  12540. * @param {*} value The value to compare.
  12541. * @param {*} other The other value to compare.
  12542. * @param {Function} [customizer] The function to customize comparisons.
  12543. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12544. * @example
  12545. *
  12546. * function isGreeting(value) {
  12547. * return /^h(?:i|ello)$/.test(value);
  12548. * }
  12549. *
  12550. * function customizer(objValue, othValue) {
  12551. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12552. * return true;
  12553. * }
  12554. * }
  12555. *
  12556. * var array = ['hello', 'goodbye'];
  12557. * var other = ['hi', 'goodbye'];
  12558. *
  12559. * _.isEqualWith(array, other, customizer);
  12560. * // => true
  12561. */
  12562. function isEqualWith(value, other, customizer) {
  12563. customizer = typeof customizer == 'function' ? customizer : undefined;
  12564. var result = customizer ? customizer(value, other) : undefined;
  12565. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12566. }
  12567. /**
  12568. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12569. * `SyntaxError`, `TypeError`, or `URIError` object.
  12570. *
  12571. * @static
  12572. * @memberOf _
  12573. * @since 3.0.0
  12574. * @category Lang
  12575. * @param {*} value The value to check.
  12576. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12577. * @example
  12578. *
  12579. * _.isError(new Error);
  12580. * // => true
  12581. *
  12582. * _.isError(Error);
  12583. * // => false
  12584. */
  12585. function isError(value) {
  12586. if (!isObjectLike(value)) {
  12587. return false;
  12588. }
  12589. var tag = baseGetTag(value);
  12590. return tag == errorTag || tag == domExcTag ||
  12591. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12592. }
  12593. /**
  12594. * Checks if `value` is a finite primitive number.
  12595. *
  12596. * **Note:** This method is based on
  12597. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12598. *
  12599. * @static
  12600. * @memberOf _
  12601. * @since 0.1.0
  12602. * @category Lang
  12603. * @param {*} value The value to check.
  12604. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12605. * @example
  12606. *
  12607. * _.isFinite(3);
  12608. * // => true
  12609. *
  12610. * _.isFinite(Number.MIN_VALUE);
  12611. * // => true
  12612. *
  12613. * _.isFinite(Infinity);
  12614. * // => false
  12615. *
  12616. * _.isFinite('3');
  12617. * // => false
  12618. */
  12619. function isFinite(value) {
  12620. return typeof value == 'number' && nativeIsFinite(value);
  12621. }
  12622. /**
  12623. * Checks if `value` is classified as a `Function` object.
  12624. *
  12625. * @static
  12626. * @memberOf _
  12627. * @since 0.1.0
  12628. * @category Lang
  12629. * @param {*} value The value to check.
  12630. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12631. * @example
  12632. *
  12633. * _.isFunction(_);
  12634. * // => true
  12635. *
  12636. * _.isFunction(/abc/);
  12637. * // => false
  12638. */
  12639. function isFunction(value) {
  12640. if (!isObject(value)) {
  12641. return false;
  12642. }
  12643. // The use of `Object#toString` avoids issues with the `typeof` operator
  12644. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12645. var tag = baseGetTag(value);
  12646. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12647. }
  12648. /**
  12649. * Checks if `value` is an integer.
  12650. *
  12651. * **Note:** This method is based on
  12652. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12653. *
  12654. * @static
  12655. * @memberOf _
  12656. * @since 4.0.0
  12657. * @category Lang
  12658. * @param {*} value The value to check.
  12659. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12660. * @example
  12661. *
  12662. * _.isInteger(3);
  12663. * // => true
  12664. *
  12665. * _.isInteger(Number.MIN_VALUE);
  12666. * // => false
  12667. *
  12668. * _.isInteger(Infinity);
  12669. * // => false
  12670. *
  12671. * _.isInteger('3');
  12672. * // => false
  12673. */
  12674. function isInteger(value) {
  12675. return typeof value == 'number' && value == toInteger(value);
  12676. }
  12677. /**
  12678. * Checks if `value` is a valid array-like length.
  12679. *
  12680. * **Note:** This method is loosely based on
  12681. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12682. *
  12683. * @static
  12684. * @memberOf _
  12685. * @since 4.0.0
  12686. * @category Lang
  12687. * @param {*} value The value to check.
  12688. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12689. * @example
  12690. *
  12691. * _.isLength(3);
  12692. * // => true
  12693. *
  12694. * _.isLength(Number.MIN_VALUE);
  12695. * // => false
  12696. *
  12697. * _.isLength(Infinity);
  12698. * // => false
  12699. *
  12700. * _.isLength('3');
  12701. * // => false
  12702. */
  12703. function isLength(value) {
  12704. return typeof value == 'number' &&
  12705. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12706. }
  12707. /**
  12708. * Checks if `value` is the
  12709. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12710. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12711. *
  12712. * @static
  12713. * @memberOf _
  12714. * @since 0.1.0
  12715. * @category Lang
  12716. * @param {*} value The value to check.
  12717. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12718. * @example
  12719. *
  12720. * _.isObject({});
  12721. * // => true
  12722. *
  12723. * _.isObject([1, 2, 3]);
  12724. * // => true
  12725. *
  12726. * _.isObject(_.noop);
  12727. * // => true
  12728. *
  12729. * _.isObject(null);
  12730. * // => false
  12731. */
  12732. function isObject(value) {
  12733. var type = typeof value;
  12734. return value != null && (type == 'object' || type == 'function');
  12735. }
  12736. /**
  12737. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12738. * and has a `typeof` result of "object".
  12739. *
  12740. * @static
  12741. * @memberOf _
  12742. * @since 4.0.0
  12743. * @category Lang
  12744. * @param {*} value The value to check.
  12745. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12746. * @example
  12747. *
  12748. * _.isObjectLike({});
  12749. * // => true
  12750. *
  12751. * _.isObjectLike([1, 2, 3]);
  12752. * // => true
  12753. *
  12754. * _.isObjectLike(_.noop);
  12755. * // => false
  12756. *
  12757. * _.isObjectLike(null);
  12758. * // => false
  12759. */
  12760. function isObjectLike(value) {
  12761. return value != null && typeof value == 'object';
  12762. }
  12763. /**
  12764. * Checks if `value` is classified as a `Map` object.
  12765. *
  12766. * @static
  12767. * @memberOf _
  12768. * @since 4.3.0
  12769. * @category Lang
  12770. * @param {*} value The value to check.
  12771. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12772. * @example
  12773. *
  12774. * _.isMap(new Map);
  12775. * // => true
  12776. *
  12777. * _.isMap(new WeakMap);
  12778. * // => false
  12779. */
  12780. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12781. /**
  12782. * Performs a partial deep comparison between `object` and `source` to
  12783. * determine if `object` contains equivalent property values.
  12784. *
  12785. * **Note:** This method is equivalent to `_.matches` when `source` is
  12786. * partially applied.
  12787. *
  12788. * Partial comparisons will match empty array and empty object `source`
  12789. * values against any array or object value, respectively. See `_.isEqual`
  12790. * for a list of supported value comparisons.
  12791. *
  12792. * @static
  12793. * @memberOf _
  12794. * @since 3.0.0
  12795. * @category Lang
  12796. * @param {Object} object The object to inspect.
  12797. * @param {Object} source The object of property values to match.
  12798. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12799. * @example
  12800. *
  12801. * var object = { 'a': 1, 'b': 2 };
  12802. *
  12803. * _.isMatch(object, { 'b': 2 });
  12804. * // => true
  12805. *
  12806. * _.isMatch(object, { 'b': 1 });
  12807. * // => false
  12808. */
  12809. function isMatch(object, source) {
  12810. return object === source || baseIsMatch(object, source, getMatchData(source));
  12811. }
  12812. /**
  12813. * This method is like `_.isMatch` except that it accepts `customizer` which
  12814. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12815. * are handled by the method instead. The `customizer` is invoked with five
  12816. * arguments: (objValue, srcValue, index|key, object, source).
  12817. *
  12818. * @static
  12819. * @memberOf _
  12820. * @since 4.0.0
  12821. * @category Lang
  12822. * @param {Object} object The object to inspect.
  12823. * @param {Object} source The object of property values to match.
  12824. * @param {Function} [customizer] The function to customize comparisons.
  12825. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12826. * @example
  12827. *
  12828. * function isGreeting(value) {
  12829. * return /^h(?:i|ello)$/.test(value);
  12830. * }
  12831. *
  12832. * function customizer(objValue, srcValue) {
  12833. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12834. * return true;
  12835. * }
  12836. * }
  12837. *
  12838. * var object = { 'greeting': 'hello' };
  12839. * var source = { 'greeting': 'hi' };
  12840. *
  12841. * _.isMatchWith(object, source, customizer);
  12842. * // => true
  12843. */
  12844. function isMatchWith(object, source, customizer) {
  12845. customizer = typeof customizer == 'function' ? customizer : undefined;
  12846. return baseIsMatch(object, source, getMatchData(source), customizer);
  12847. }
  12848. /**
  12849. * Checks if `value` is `NaN`.
  12850. *
  12851. * **Note:** This method is based on
  12852. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12853. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12854. * `undefined` and other non-number values.
  12855. *
  12856. * @static
  12857. * @memberOf _
  12858. * @since 0.1.0
  12859. * @category Lang
  12860. * @param {*} value The value to check.
  12861. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12862. * @example
  12863. *
  12864. * _.isNaN(NaN);
  12865. * // => true
  12866. *
  12867. * _.isNaN(new Number(NaN));
  12868. * // => true
  12869. *
  12870. * isNaN(undefined);
  12871. * // => true
  12872. *
  12873. * _.isNaN(undefined);
  12874. * // => false
  12875. */
  12876. function isNaN(value) {
  12877. // An `NaN` primitive is the only value that is not equal to itself.
  12878. // Perform the `toStringTag` check first to avoid errors with some
  12879. // ActiveX objects in IE.
  12880. return isNumber(value) && value != +value;
  12881. }
  12882. /**
  12883. * Checks if `value` is a pristine native function.
  12884. *
  12885. * **Note:** This method can't reliably detect native functions in the presence
  12886. * of the core-js package because core-js circumvents this kind of detection.
  12887. * Despite multiple requests, the core-js maintainer has made it clear: any
  12888. * attempt to fix the detection will be obstructed. As a result, we're left
  12889. * with little choice but to throw an error. Unfortunately, this also affects
  12890. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12891. * which rely on core-js.
  12892. *
  12893. * @static
  12894. * @memberOf _
  12895. * @since 3.0.0
  12896. * @category Lang
  12897. * @param {*} value The value to check.
  12898. * @returns {boolean} Returns `true` if `value` is a native function,
  12899. * else `false`.
  12900. * @example
  12901. *
  12902. * _.isNative(Array.prototype.push);
  12903. * // => true
  12904. *
  12905. * _.isNative(_);
  12906. * // => false
  12907. */
  12908. function isNative(value) {
  12909. if (isMaskable(value)) {
  12910. throw new Error(CORE_ERROR_TEXT);
  12911. }
  12912. return baseIsNative(value);
  12913. }
  12914. /**
  12915. * Checks if `value` is `null`.
  12916. *
  12917. * @static
  12918. * @memberOf _
  12919. * @since 0.1.0
  12920. * @category Lang
  12921. * @param {*} value The value to check.
  12922. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12923. * @example
  12924. *
  12925. * _.isNull(null);
  12926. * // => true
  12927. *
  12928. * _.isNull(void 0);
  12929. * // => false
  12930. */
  12931. function isNull(value) {
  12932. return value === null;
  12933. }
  12934. /**
  12935. * Checks if `value` is `null` or `undefined`.
  12936. *
  12937. * @static
  12938. * @memberOf _
  12939. * @since 4.0.0
  12940. * @category Lang
  12941. * @param {*} value The value to check.
  12942. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12943. * @example
  12944. *
  12945. * _.isNil(null);
  12946. * // => true
  12947. *
  12948. * _.isNil(void 0);
  12949. * // => true
  12950. *
  12951. * _.isNil(NaN);
  12952. * // => false
  12953. */
  12954. function isNil(value) {
  12955. return value == null;
  12956. }
  12957. /**
  12958. * Checks if `value` is classified as a `Number` primitive or object.
  12959. *
  12960. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12961. * classified as numbers, use the `_.isFinite` method.
  12962. *
  12963. * @static
  12964. * @memberOf _
  12965. * @since 0.1.0
  12966. * @category Lang
  12967. * @param {*} value The value to check.
  12968. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12969. * @example
  12970. *
  12971. * _.isNumber(3);
  12972. * // => true
  12973. *
  12974. * _.isNumber(Number.MIN_VALUE);
  12975. * // => true
  12976. *
  12977. * _.isNumber(Infinity);
  12978. * // => true
  12979. *
  12980. * _.isNumber('3');
  12981. * // => false
  12982. */
  12983. function isNumber(value) {
  12984. return typeof value == 'number' ||
  12985. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12986. }
  12987. /**
  12988. * Checks if `value` is a plain object, that is, an object created by the
  12989. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12990. *
  12991. * @static
  12992. * @memberOf _
  12993. * @since 0.8.0
  12994. * @category Lang
  12995. * @param {*} value The value to check.
  12996. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12997. * @example
  12998. *
  12999. * function Foo() {
  13000. * this.a = 1;
  13001. * }
  13002. *
  13003. * _.isPlainObject(new Foo);
  13004. * // => false
  13005. *
  13006. * _.isPlainObject([1, 2, 3]);
  13007. * // => false
  13008. *
  13009. * _.isPlainObject({ 'x': 0, 'y': 0 });
  13010. * // => true
  13011. *
  13012. * _.isPlainObject(Object.create(null));
  13013. * // => true
  13014. */
  13015. function isPlainObject(value) {
  13016. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  13017. return false;
  13018. }
  13019. var proto = getPrototype(value);
  13020. if (proto === null) {
  13021. return true;
  13022. }
  13023. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  13024. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  13025. funcToString.call(Ctor) == objectCtorString;
  13026. }
  13027. /**
  13028. * Checks if `value` is classified as a `RegExp` object.
  13029. *
  13030. * @static
  13031. * @memberOf _
  13032. * @since 0.1.0
  13033. * @category Lang
  13034. * @param {*} value The value to check.
  13035. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  13036. * @example
  13037. *
  13038. * _.isRegExp(/abc/);
  13039. * // => true
  13040. *
  13041. * _.isRegExp('/abc/');
  13042. * // => false
  13043. */
  13044. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  13045. /**
  13046. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  13047. * double precision number which isn't the result of a rounded unsafe integer.
  13048. *
  13049. * **Note:** This method is based on
  13050. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  13051. *
  13052. * @static
  13053. * @memberOf _
  13054. * @since 4.0.0
  13055. * @category Lang
  13056. * @param {*} value The value to check.
  13057. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  13058. * @example
  13059. *
  13060. * _.isSafeInteger(3);
  13061. * // => true
  13062. *
  13063. * _.isSafeInteger(Number.MIN_VALUE);
  13064. * // => false
  13065. *
  13066. * _.isSafeInteger(Infinity);
  13067. * // => false
  13068. *
  13069. * _.isSafeInteger('3');
  13070. * // => false
  13071. */
  13072. function isSafeInteger(value) {
  13073. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  13074. }
  13075. /**
  13076. * Checks if `value` is classified as a `Set` object.
  13077. *
  13078. * @static
  13079. * @memberOf _
  13080. * @since 4.3.0
  13081. * @category Lang
  13082. * @param {*} value The value to check.
  13083. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  13084. * @example
  13085. *
  13086. * _.isSet(new Set);
  13087. * // => true
  13088. *
  13089. * _.isSet(new WeakSet);
  13090. * // => false
  13091. */
  13092. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  13093. /**
  13094. * Checks if `value` is classified as a `String` primitive or object.
  13095. *
  13096. * @static
  13097. * @since 0.1.0
  13098. * @memberOf _
  13099. * @category Lang
  13100. * @param {*} value The value to check.
  13101. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  13102. * @example
  13103. *
  13104. * _.isString('abc');
  13105. * // => true
  13106. *
  13107. * _.isString(1);
  13108. * // => false
  13109. */
  13110. function isString(value) {
  13111. return typeof value == 'string' ||
  13112. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  13113. }
  13114. /**
  13115. * Checks if `value` is classified as a `Symbol` primitive or object.
  13116. *
  13117. * @static
  13118. * @memberOf _
  13119. * @since 4.0.0
  13120. * @category Lang
  13121. * @param {*} value The value to check.
  13122. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  13123. * @example
  13124. *
  13125. * _.isSymbol(Symbol.iterator);
  13126. * // => true
  13127. *
  13128. * _.isSymbol('abc');
  13129. * // => false
  13130. */
  13131. function isSymbol(value) {
  13132. return typeof value == 'symbol' ||
  13133. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  13134. }
  13135. /**
  13136. * Checks if `value` is classified as a typed array.
  13137. *
  13138. * @static
  13139. * @memberOf _
  13140. * @since 3.0.0
  13141. * @category Lang
  13142. * @param {*} value The value to check.
  13143. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  13144. * @example
  13145. *
  13146. * _.isTypedArray(new Uint8Array);
  13147. * // => true
  13148. *
  13149. * _.isTypedArray([]);
  13150. * // => false
  13151. */
  13152. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  13153. /**
  13154. * Checks if `value` is `undefined`.
  13155. *
  13156. * @static
  13157. * @since 0.1.0
  13158. * @memberOf _
  13159. * @category Lang
  13160. * @param {*} value The value to check.
  13161. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  13162. * @example
  13163. *
  13164. * _.isUndefined(void 0);
  13165. * // => true
  13166. *
  13167. * _.isUndefined(null);
  13168. * // => false
  13169. */
  13170. function isUndefined(value) {
  13171. return value === undefined;
  13172. }
  13173. /**
  13174. * Checks if `value` is classified as a `WeakMap` object.
  13175. *
  13176. * @static
  13177. * @memberOf _
  13178. * @since 4.3.0
  13179. * @category Lang
  13180. * @param {*} value The value to check.
  13181. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  13182. * @example
  13183. *
  13184. * _.isWeakMap(new WeakMap);
  13185. * // => true
  13186. *
  13187. * _.isWeakMap(new Map);
  13188. * // => false
  13189. */
  13190. function isWeakMap(value) {
  13191. return isObjectLike(value) && getTag(value) == weakMapTag;
  13192. }
  13193. /**
  13194. * Checks if `value` is classified as a `WeakSet` object.
  13195. *
  13196. * @static
  13197. * @memberOf _
  13198. * @since 4.3.0
  13199. * @category Lang
  13200. * @param {*} value The value to check.
  13201. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  13202. * @example
  13203. *
  13204. * _.isWeakSet(new WeakSet);
  13205. * // => true
  13206. *
  13207. * _.isWeakSet(new Set);
  13208. * // => false
  13209. */
  13210. function isWeakSet(value) {
  13211. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  13212. }
  13213. /**
  13214. * Checks if `value` is less than `other`.
  13215. *
  13216. * @static
  13217. * @memberOf _
  13218. * @since 3.9.0
  13219. * @category Lang
  13220. * @param {*} value The value to compare.
  13221. * @param {*} other The other value to compare.
  13222. * @returns {boolean} Returns `true` if `value` is less than `other`,
  13223. * else `false`.
  13224. * @see _.gt
  13225. * @example
  13226. *
  13227. * _.lt(1, 3);
  13228. * // => true
  13229. *
  13230. * _.lt(3, 3);
  13231. * // => false
  13232. *
  13233. * _.lt(3, 1);
  13234. * // => false
  13235. */
  13236. var lt = createRelationalOperation(baseLt);
  13237. /**
  13238. * Checks if `value` is less than or equal to `other`.
  13239. *
  13240. * @static
  13241. * @memberOf _
  13242. * @since 3.9.0
  13243. * @category Lang
  13244. * @param {*} value The value to compare.
  13245. * @param {*} other The other value to compare.
  13246. * @returns {boolean} Returns `true` if `value` is less than or equal to
  13247. * `other`, else `false`.
  13248. * @see _.gte
  13249. * @example
  13250. *
  13251. * _.lte(1, 3);
  13252. * // => true
  13253. *
  13254. * _.lte(3, 3);
  13255. * // => true
  13256. *
  13257. * _.lte(3, 1);
  13258. * // => false
  13259. */
  13260. var lte = createRelationalOperation(function(value, other) {
  13261. return value <= other;
  13262. });
  13263. /**
  13264. * Converts `value` to an array.
  13265. *
  13266. * @static
  13267. * @since 0.1.0
  13268. * @memberOf _
  13269. * @category Lang
  13270. * @param {*} value The value to convert.
  13271. * @returns {Array} Returns the converted array.
  13272. * @example
  13273. *
  13274. * _.toArray({ 'a': 1, 'b': 2 });
  13275. * // => [1, 2]
  13276. *
  13277. * _.toArray('abc');
  13278. * // => ['a', 'b', 'c']
  13279. *
  13280. * _.toArray(1);
  13281. * // => []
  13282. *
  13283. * _.toArray(null);
  13284. * // => []
  13285. */
  13286. function toArray(value) {
  13287. if (!value) {
  13288. return [];
  13289. }
  13290. if (isArrayLike(value)) {
  13291. return isString(value) ? stringToArray(value) : copyArray(value);
  13292. }
  13293. if (symIterator && value[symIterator]) {
  13294. return iteratorToArray(value[symIterator]());
  13295. }
  13296. var tag = getTag(value),
  13297. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  13298. return func(value);
  13299. }
  13300. /**
  13301. * Converts `value` to a finite number.
  13302. *
  13303. * @static
  13304. * @memberOf _
  13305. * @since 4.12.0
  13306. * @category Lang
  13307. * @param {*} value The value to convert.
  13308. * @returns {number} Returns the converted number.
  13309. * @example
  13310. *
  13311. * _.toFinite(3.2);
  13312. * // => 3.2
  13313. *
  13314. * _.toFinite(Number.MIN_VALUE);
  13315. * // => 5e-324
  13316. *
  13317. * _.toFinite(Infinity);
  13318. * // => 1.7976931348623157e+308
  13319. *
  13320. * _.toFinite('3.2');
  13321. * // => 3.2
  13322. */
  13323. function toFinite(value) {
  13324. if (!value) {
  13325. return value === 0 ? value : 0;
  13326. }
  13327. value = toNumber(value);
  13328. if (value === INFINITY || value === -INFINITY) {
  13329. var sign = (value < 0 ? -1 : 1);
  13330. return sign * MAX_INTEGER;
  13331. }
  13332. return value === value ? value : 0;
  13333. }
  13334. /**
  13335. * Converts `value` to an integer.
  13336. *
  13337. * **Note:** This method is loosely based on
  13338. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  13339. *
  13340. * @static
  13341. * @memberOf _
  13342. * @since 4.0.0
  13343. * @category Lang
  13344. * @param {*} value The value to convert.
  13345. * @returns {number} Returns the converted integer.
  13346. * @example
  13347. *
  13348. * _.toInteger(3.2);
  13349. * // => 3
  13350. *
  13351. * _.toInteger(Number.MIN_VALUE);
  13352. * // => 0
  13353. *
  13354. * _.toInteger(Infinity);
  13355. * // => 1.7976931348623157e+308
  13356. *
  13357. * _.toInteger('3.2');
  13358. * // => 3
  13359. */
  13360. function toInteger(value) {
  13361. var result = toFinite(value),
  13362. remainder = result % 1;
  13363. return result === result ? (remainder ? result - remainder : result) : 0;
  13364. }
  13365. /**
  13366. * Converts `value` to an integer suitable for use as the length of an
  13367. * array-like object.
  13368. *
  13369. * **Note:** This method is based on
  13370. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  13371. *
  13372. * @static
  13373. * @memberOf _
  13374. * @since 4.0.0
  13375. * @category Lang
  13376. * @param {*} value The value to convert.
  13377. * @returns {number} Returns the converted integer.
  13378. * @example
  13379. *
  13380. * _.toLength(3.2);
  13381. * // => 3
  13382. *
  13383. * _.toLength(Number.MIN_VALUE);
  13384. * // => 0
  13385. *
  13386. * _.toLength(Infinity);
  13387. * // => 4294967295
  13388. *
  13389. * _.toLength('3.2');
  13390. * // => 3
  13391. */
  13392. function toLength(value) {
  13393. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  13394. }
  13395. /**
  13396. * Converts `value` to a number.
  13397. *
  13398. * @static
  13399. * @memberOf _
  13400. * @since 4.0.0
  13401. * @category Lang
  13402. * @param {*} value The value to process.
  13403. * @returns {number} Returns the number.
  13404. * @example
  13405. *
  13406. * _.toNumber(3.2);
  13407. * // => 3.2
  13408. *
  13409. * _.toNumber(Number.MIN_VALUE);
  13410. * // => 5e-324
  13411. *
  13412. * _.toNumber(Infinity);
  13413. * // => Infinity
  13414. *
  13415. * _.toNumber('3.2');
  13416. * // => 3.2
  13417. */
  13418. function toNumber(value) {
  13419. if (typeof value == 'number') {
  13420. return value;
  13421. }
  13422. if (isSymbol(value)) {
  13423. return NAN;
  13424. }
  13425. if (isObject(value)) {
  13426. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  13427. value = isObject(other) ? (other + '') : other;
  13428. }
  13429. if (typeof value != 'string') {
  13430. return value === 0 ? value : +value;
  13431. }
  13432. value = baseTrim(value);
  13433. var isBinary = reIsBinary.test(value);
  13434. return (isBinary || reIsOctal.test(value))
  13435. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  13436. : (reIsBadHex.test(value) ? NAN : +value);
  13437. }
  13438. /**
  13439. * Converts `value` to a plain object flattening inherited enumerable string
  13440. * keyed properties of `value` to own properties of the plain object.
  13441. *
  13442. * @static
  13443. * @memberOf _
  13444. * @since 3.0.0
  13445. * @category Lang
  13446. * @param {*} value The value to convert.
  13447. * @returns {Object} Returns the converted plain object.
  13448. * @example
  13449. *
  13450. * function Foo() {
  13451. * this.b = 2;
  13452. * }
  13453. *
  13454. * Foo.prototype.c = 3;
  13455. *
  13456. * _.assign({ 'a': 1 }, new Foo);
  13457. * // => { 'a': 1, 'b': 2 }
  13458. *
  13459. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  13460. * // => { 'a': 1, 'b': 2, 'c': 3 }
  13461. */
  13462. function toPlainObject(value) {
  13463. return copyObject(value, keysIn(value));
  13464. }
  13465. /**
  13466. * Converts `value` to a safe integer. A safe integer can be compared and
  13467. * represented correctly.
  13468. *
  13469. * @static
  13470. * @memberOf _
  13471. * @since 4.0.0
  13472. * @category Lang
  13473. * @param {*} value The value to convert.
  13474. * @returns {number} Returns the converted integer.
  13475. * @example
  13476. *
  13477. * _.toSafeInteger(3.2);
  13478. * // => 3
  13479. *
  13480. * _.toSafeInteger(Number.MIN_VALUE);
  13481. * // => 0
  13482. *
  13483. * _.toSafeInteger(Infinity);
  13484. * // => 9007199254740991
  13485. *
  13486. * _.toSafeInteger('3.2');
  13487. * // => 3
  13488. */
  13489. function toSafeInteger(value) {
  13490. return value
  13491. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13492. : (value === 0 ? value : 0);
  13493. }
  13494. /**
  13495. * Converts `value` to a string. An empty string is returned for `null`
  13496. * and `undefined` values. The sign of `-0` is preserved.
  13497. *
  13498. * @static
  13499. * @memberOf _
  13500. * @since 4.0.0
  13501. * @category Lang
  13502. * @param {*} value The value to convert.
  13503. * @returns {string} Returns the converted string.
  13504. * @example
  13505. *
  13506. * _.toString(null);
  13507. * // => ''
  13508. *
  13509. * _.toString(-0);
  13510. * // => '-0'
  13511. *
  13512. * _.toString([1, 2, 3]);
  13513. * // => '1,2,3'
  13514. */
  13515. function toString(value) {
  13516. return value == null ? '' : baseToString(value);
  13517. }
  13518. /*------------------------------------------------------------------------*/
  13519. /**
  13520. * Assigns own enumerable string keyed properties of source objects to the
  13521. * destination object. Source objects are applied from left to right.
  13522. * Subsequent sources overwrite property assignments of previous sources.
  13523. *
  13524. * **Note:** This method mutates `object` and is loosely based on
  13525. * [`Object.assign`](https://mdn.io/Object/assign).
  13526. *
  13527. * @static
  13528. * @memberOf _
  13529. * @since 0.10.0
  13530. * @category Object
  13531. * @param {Object} object The destination object.
  13532. * @param {...Object} [sources] The source objects.
  13533. * @returns {Object} Returns `object`.
  13534. * @see _.assignIn
  13535. * @example
  13536. *
  13537. * function Foo() {
  13538. * this.a = 1;
  13539. * }
  13540. *
  13541. * function Bar() {
  13542. * this.c = 3;
  13543. * }
  13544. *
  13545. * Foo.prototype.b = 2;
  13546. * Bar.prototype.d = 4;
  13547. *
  13548. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13549. * // => { 'a': 1, 'c': 3 }
  13550. */
  13551. var assign = createAssigner(function(object, source) {
  13552. if (isPrototype(source) || isArrayLike(source)) {
  13553. copyObject(source, keys(source), object);
  13554. return;
  13555. }
  13556. for (var key in source) {
  13557. if (hasOwnProperty.call(source, key)) {
  13558. assignValue(object, key, source[key]);
  13559. }
  13560. }
  13561. });
  13562. /**
  13563. * This method is like `_.assign` except that it iterates over own and
  13564. * inherited source properties.
  13565. *
  13566. * **Note:** This method mutates `object`.
  13567. *
  13568. * @static
  13569. * @memberOf _
  13570. * @since 4.0.0
  13571. * @alias extend
  13572. * @category Object
  13573. * @param {Object} object The destination object.
  13574. * @param {...Object} [sources] The source objects.
  13575. * @returns {Object} Returns `object`.
  13576. * @see _.assign
  13577. * @example
  13578. *
  13579. * function Foo() {
  13580. * this.a = 1;
  13581. * }
  13582. *
  13583. * function Bar() {
  13584. * this.c = 3;
  13585. * }
  13586. *
  13587. * Foo.prototype.b = 2;
  13588. * Bar.prototype.d = 4;
  13589. *
  13590. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13591. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13592. */
  13593. var assignIn = createAssigner(function(object, source) {
  13594. copyObject(source, keysIn(source), object);
  13595. });
  13596. /**
  13597. * This method is like `_.assignIn` except that it accepts `customizer`
  13598. * which is invoked to produce the assigned values. If `customizer` returns
  13599. * `undefined`, assignment is handled by the method instead. The `customizer`
  13600. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13601. *
  13602. * **Note:** This method mutates `object`.
  13603. *
  13604. * @static
  13605. * @memberOf _
  13606. * @since 4.0.0
  13607. * @alias extendWith
  13608. * @category Object
  13609. * @param {Object} object The destination object.
  13610. * @param {...Object} sources The source objects.
  13611. * @param {Function} [customizer] The function to customize assigned values.
  13612. * @returns {Object} Returns `object`.
  13613. * @see _.assignWith
  13614. * @example
  13615. *
  13616. * function customizer(objValue, srcValue) {
  13617. * return _.isUndefined(objValue) ? srcValue : objValue;
  13618. * }
  13619. *
  13620. * var defaults = _.partialRight(_.assignInWith, customizer);
  13621. *
  13622. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13623. * // => { 'a': 1, 'b': 2 }
  13624. */
  13625. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13626. copyObject(source, keysIn(source), object, customizer);
  13627. });
  13628. /**
  13629. * This method is like `_.assign` except that it accepts `customizer`
  13630. * which is invoked to produce the assigned values. If `customizer` returns
  13631. * `undefined`, assignment is handled by the method instead. The `customizer`
  13632. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13633. *
  13634. * **Note:** This method mutates `object`.
  13635. *
  13636. * @static
  13637. * @memberOf _
  13638. * @since 4.0.0
  13639. * @category Object
  13640. * @param {Object} object The destination object.
  13641. * @param {...Object} sources The source objects.
  13642. * @param {Function} [customizer] The function to customize assigned values.
  13643. * @returns {Object} Returns `object`.
  13644. * @see _.assignInWith
  13645. * @example
  13646. *
  13647. * function customizer(objValue, srcValue) {
  13648. * return _.isUndefined(objValue) ? srcValue : objValue;
  13649. * }
  13650. *
  13651. * var defaults = _.partialRight(_.assignWith, customizer);
  13652. *
  13653. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13654. * // => { 'a': 1, 'b': 2 }
  13655. */
  13656. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13657. copyObject(source, keys(source), object, customizer);
  13658. });
  13659. /**
  13660. * Creates an array of values corresponding to `paths` of `object`.
  13661. *
  13662. * @static
  13663. * @memberOf _
  13664. * @since 1.0.0
  13665. * @category Object
  13666. * @param {Object} object The object to iterate over.
  13667. * @param {...(string|string[])} [paths] The property paths to pick.
  13668. * @returns {Array} Returns the picked values.
  13669. * @example
  13670. *
  13671. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13672. *
  13673. * _.at(object, ['a[0].b.c', 'a[1]']);
  13674. * // => [3, 4]
  13675. */
  13676. var at = flatRest(baseAt);
  13677. /**
  13678. * Creates an object that inherits from the `prototype` object. If a
  13679. * `properties` object is given, its own enumerable string keyed properties
  13680. * are assigned to the created object.
  13681. *
  13682. * @static
  13683. * @memberOf _
  13684. * @since 2.3.0
  13685. * @category Object
  13686. * @param {Object} prototype The object to inherit from.
  13687. * @param {Object} [properties] The properties to assign to the object.
  13688. * @returns {Object} Returns the new object.
  13689. * @example
  13690. *
  13691. * function Shape() {
  13692. * this.x = 0;
  13693. * this.y = 0;
  13694. * }
  13695. *
  13696. * function Circle() {
  13697. * Shape.call(this);
  13698. * }
  13699. *
  13700. * Circle.prototype = _.create(Shape.prototype, {
  13701. * 'constructor': Circle
  13702. * });
  13703. *
  13704. * var circle = new Circle;
  13705. * circle instanceof Circle;
  13706. * // => true
  13707. *
  13708. * circle instanceof Shape;
  13709. * // => true
  13710. */
  13711. function create(prototype, properties) {
  13712. var result = baseCreate(prototype);
  13713. return properties == null ? result : baseAssign(result, properties);
  13714. }
  13715. /**
  13716. * Assigns own and inherited enumerable string keyed properties of source
  13717. * objects to the destination object for all destination properties that
  13718. * resolve to `undefined`. Source objects are applied from left to right.
  13719. * Once a property is set, additional values of the same property are ignored.
  13720. *
  13721. * **Note:** This method mutates `object`.
  13722. *
  13723. * @static
  13724. * @since 0.1.0
  13725. * @memberOf _
  13726. * @category Object
  13727. * @param {Object} object The destination object.
  13728. * @param {...Object} [sources] The source objects.
  13729. * @returns {Object} Returns `object`.
  13730. * @see _.defaultsDeep
  13731. * @example
  13732. *
  13733. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13734. * // => { 'a': 1, 'b': 2 }
  13735. */
  13736. var defaults = baseRest(function(object, sources) {
  13737. object = Object(object);
  13738. var index = -1;
  13739. var length = sources.length;
  13740. var guard = length > 2 ? sources[2] : undefined;
  13741. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13742. length = 1;
  13743. }
  13744. while (++index < length) {
  13745. var source = sources[index];
  13746. var props = keysIn(source);
  13747. var propsIndex = -1;
  13748. var propsLength = props.length;
  13749. while (++propsIndex < propsLength) {
  13750. var key = props[propsIndex];
  13751. var value = object[key];
  13752. if (value === undefined ||
  13753. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13754. object[key] = source[key];
  13755. }
  13756. }
  13757. }
  13758. return object;
  13759. });
  13760. /**
  13761. * This method is like `_.defaults` except that it recursively assigns
  13762. * default properties.
  13763. *
  13764. * **Note:** This method mutates `object`.
  13765. *
  13766. * @static
  13767. * @memberOf _
  13768. * @since 3.10.0
  13769. * @category Object
  13770. * @param {Object} object The destination object.
  13771. * @param {...Object} [sources] The source objects.
  13772. * @returns {Object} Returns `object`.
  13773. * @see _.defaults
  13774. * @example
  13775. *
  13776. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13777. * // => { 'a': { 'b': 2, 'c': 3 } }
  13778. */
  13779. var defaultsDeep = baseRest(function(args) {
  13780. args.push(undefined, customDefaultsMerge);
  13781. return apply(mergeWith, undefined, args);
  13782. });
  13783. /**
  13784. * This method is like `_.find` except that it returns the key of the first
  13785. * element `predicate` returns truthy for instead of the element itself.
  13786. *
  13787. * @static
  13788. * @memberOf _
  13789. * @since 1.1.0
  13790. * @category Object
  13791. * @param {Object} object The object to inspect.
  13792. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13793. * @returns {string|undefined} Returns the key of the matched element,
  13794. * else `undefined`.
  13795. * @example
  13796. *
  13797. * var users = {
  13798. * 'barney': { 'age': 36, 'active': true },
  13799. * 'fred': { 'age': 40, 'active': false },
  13800. * 'pebbles': { 'age': 1, 'active': true }
  13801. * };
  13802. *
  13803. * _.findKey(users, function(o) { return o.age < 40; });
  13804. * // => 'barney' (iteration order is not guaranteed)
  13805. *
  13806. * // The `_.matches` iteratee shorthand.
  13807. * _.findKey(users, { 'age': 1, 'active': true });
  13808. * // => 'pebbles'
  13809. *
  13810. * // The `_.matchesProperty` iteratee shorthand.
  13811. * _.findKey(users, ['active', false]);
  13812. * // => 'fred'
  13813. *
  13814. * // The `_.property` iteratee shorthand.
  13815. * _.findKey(users, 'active');
  13816. * // => 'barney'
  13817. */
  13818. function findKey(object, predicate) {
  13819. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13820. }
  13821. /**
  13822. * This method is like `_.findKey` except that it iterates over elements of
  13823. * a collection in the opposite order.
  13824. *
  13825. * @static
  13826. * @memberOf _
  13827. * @since 2.0.0
  13828. * @category Object
  13829. * @param {Object} object The object to inspect.
  13830. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13831. * @returns {string|undefined} Returns the key of the matched element,
  13832. * else `undefined`.
  13833. * @example
  13834. *
  13835. * var users = {
  13836. * 'barney': { 'age': 36, 'active': true },
  13837. * 'fred': { 'age': 40, 'active': false },
  13838. * 'pebbles': { 'age': 1, 'active': true }
  13839. * };
  13840. *
  13841. * _.findLastKey(users, function(o) { return o.age < 40; });
  13842. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13843. *
  13844. * // The `_.matches` iteratee shorthand.
  13845. * _.findLastKey(users, { 'age': 36, 'active': true });
  13846. * // => 'barney'
  13847. *
  13848. * // The `_.matchesProperty` iteratee shorthand.
  13849. * _.findLastKey(users, ['active', false]);
  13850. * // => 'fred'
  13851. *
  13852. * // The `_.property` iteratee shorthand.
  13853. * _.findLastKey(users, 'active');
  13854. * // => 'pebbles'
  13855. */
  13856. function findLastKey(object, predicate) {
  13857. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13858. }
  13859. /**
  13860. * Iterates over own and inherited enumerable string keyed properties of an
  13861. * object and invokes `iteratee` for each property. The iteratee is invoked
  13862. * with three arguments: (value, key, object). Iteratee functions may exit
  13863. * iteration early by explicitly returning `false`.
  13864. *
  13865. * @static
  13866. * @memberOf _
  13867. * @since 0.3.0
  13868. * @category Object
  13869. * @param {Object} object The object to iterate over.
  13870. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13871. * @returns {Object} Returns `object`.
  13872. * @see _.forInRight
  13873. * @example
  13874. *
  13875. * function Foo() {
  13876. * this.a = 1;
  13877. * this.b = 2;
  13878. * }
  13879. *
  13880. * Foo.prototype.c = 3;
  13881. *
  13882. * _.forIn(new Foo, function(value, key) {
  13883. * console.log(key);
  13884. * });
  13885. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13886. */
  13887. function forIn(object, iteratee) {
  13888. return object == null
  13889. ? object
  13890. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13891. }
  13892. /**
  13893. * This method is like `_.forIn` except that it iterates over properties of
  13894. * `object` in the opposite order.
  13895. *
  13896. * @static
  13897. * @memberOf _
  13898. * @since 2.0.0
  13899. * @category Object
  13900. * @param {Object} object The object to iterate over.
  13901. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13902. * @returns {Object} Returns `object`.
  13903. * @see _.forIn
  13904. * @example
  13905. *
  13906. * function Foo() {
  13907. * this.a = 1;
  13908. * this.b = 2;
  13909. * }
  13910. *
  13911. * Foo.prototype.c = 3;
  13912. *
  13913. * _.forInRight(new Foo, function(value, key) {
  13914. * console.log(key);
  13915. * });
  13916. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13917. */
  13918. function forInRight(object, iteratee) {
  13919. return object == null
  13920. ? object
  13921. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13922. }
  13923. /**
  13924. * Iterates over own enumerable string keyed properties of an object and
  13925. * invokes `iteratee` for each property. The iteratee is invoked with three
  13926. * arguments: (value, key, object). Iteratee functions may exit iteration
  13927. * early by explicitly returning `false`.
  13928. *
  13929. * @static
  13930. * @memberOf _
  13931. * @since 0.3.0
  13932. * @category Object
  13933. * @param {Object} object The object to iterate over.
  13934. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13935. * @returns {Object} Returns `object`.
  13936. * @see _.forOwnRight
  13937. * @example
  13938. *
  13939. * function Foo() {
  13940. * this.a = 1;
  13941. * this.b = 2;
  13942. * }
  13943. *
  13944. * Foo.prototype.c = 3;
  13945. *
  13946. * _.forOwn(new Foo, function(value, key) {
  13947. * console.log(key);
  13948. * });
  13949. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13950. */
  13951. function forOwn(object, iteratee) {
  13952. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13953. }
  13954. /**
  13955. * This method is like `_.forOwn` except that it iterates over properties of
  13956. * `object` in the opposite order.
  13957. *
  13958. * @static
  13959. * @memberOf _
  13960. * @since 2.0.0
  13961. * @category Object
  13962. * @param {Object} object The object to iterate over.
  13963. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13964. * @returns {Object} Returns `object`.
  13965. * @see _.forOwn
  13966. * @example
  13967. *
  13968. * function Foo() {
  13969. * this.a = 1;
  13970. * this.b = 2;
  13971. * }
  13972. *
  13973. * Foo.prototype.c = 3;
  13974. *
  13975. * _.forOwnRight(new Foo, function(value, key) {
  13976. * console.log(key);
  13977. * });
  13978. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13979. */
  13980. function forOwnRight(object, iteratee) {
  13981. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13982. }
  13983. /**
  13984. * Creates an array of function property names from own enumerable properties
  13985. * of `object`.
  13986. *
  13987. * @static
  13988. * @since 0.1.0
  13989. * @memberOf _
  13990. * @category Object
  13991. * @param {Object} object The object to inspect.
  13992. * @returns {Array} Returns the function names.
  13993. * @see _.functionsIn
  13994. * @example
  13995. *
  13996. * function Foo() {
  13997. * this.a = _.constant('a');
  13998. * this.b = _.constant('b');
  13999. * }
  14000. *
  14001. * Foo.prototype.c = _.constant('c');
  14002. *
  14003. * _.functions(new Foo);
  14004. * // => ['a', 'b']
  14005. */
  14006. function functions(object) {
  14007. return object == null ? [] : baseFunctions(object, keys(object));
  14008. }
  14009. /**
  14010. * Creates an array of function property names from own and inherited
  14011. * enumerable properties of `object`.
  14012. *
  14013. * @static
  14014. * @memberOf _
  14015. * @since 4.0.0
  14016. * @category Object
  14017. * @param {Object} object The object to inspect.
  14018. * @returns {Array} Returns the function names.
  14019. * @see _.functions
  14020. * @example
  14021. *
  14022. * function Foo() {
  14023. * this.a = _.constant('a');
  14024. * this.b = _.constant('b');
  14025. * }
  14026. *
  14027. * Foo.prototype.c = _.constant('c');
  14028. *
  14029. * _.functionsIn(new Foo);
  14030. * // => ['a', 'b', 'c']
  14031. */
  14032. function functionsIn(object) {
  14033. return object == null ? [] : baseFunctions(object, keysIn(object));
  14034. }
  14035. /**
  14036. * Gets the value at `path` of `object`. If the resolved value is
  14037. * `undefined`, the `defaultValue` is returned in its place.
  14038. *
  14039. * @static
  14040. * @memberOf _
  14041. * @since 3.7.0
  14042. * @category Object
  14043. * @param {Object} object The object to query.
  14044. * @param {Array|string} path The path of the property to get.
  14045. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14046. * @returns {*} Returns the resolved value.
  14047. * @example
  14048. *
  14049. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14050. *
  14051. * _.get(object, 'a[0].b.c');
  14052. * // => 3
  14053. *
  14054. * _.get(object, ['a', '0', 'b', 'c']);
  14055. * // => 3
  14056. *
  14057. * _.get(object, 'a.b.c', 'default');
  14058. * // => 'default'
  14059. */
  14060. function get(object, path, defaultValue) {
  14061. var result = object == null ? undefined : baseGet(object, path);
  14062. return result === undefined ? defaultValue : result;
  14063. }
  14064. /**
  14065. * Checks if `path` is a direct property of `object`.
  14066. *
  14067. * @static
  14068. * @since 0.1.0
  14069. * @memberOf _
  14070. * @category Object
  14071. * @param {Object} object The object to query.
  14072. * @param {Array|string} path The path to check.
  14073. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  14074. * @example
  14075. *
  14076. * var object = { 'a': { 'b': 2 } };
  14077. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  14078. *
  14079. * _.has(object, 'a');
  14080. * // => true
  14081. *
  14082. * _.has(object, 'a.b');
  14083. * // => true
  14084. *
  14085. * _.has(object, ['a', 'b']);
  14086. * // => true
  14087. *
  14088. * _.has(other, 'a');
  14089. * // => false
  14090. */
  14091. function has(object, path) {
  14092. return object != null && hasPath(object, path, baseHas);
  14093. }
  14094. /**
  14095. * Checks if `path` is a direct or inherited property of `object`.
  14096. *
  14097. * @static
  14098. * @memberOf _
  14099. * @since 4.0.0
  14100. * @category Object
  14101. * @param {Object} object The object to query.
  14102. * @param {Array|string} path The path to check.
  14103. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  14104. * @example
  14105. *
  14106. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  14107. *
  14108. * _.hasIn(object, 'a');
  14109. * // => true
  14110. *
  14111. * _.hasIn(object, 'a.b');
  14112. * // => true
  14113. *
  14114. * _.hasIn(object, ['a', 'b']);
  14115. * // => true
  14116. *
  14117. * _.hasIn(object, 'b');
  14118. * // => false
  14119. */
  14120. function hasIn(object, path) {
  14121. return object != null && hasPath(object, path, baseHasIn);
  14122. }
  14123. /**
  14124. * Creates an object composed of the inverted keys and values of `object`.
  14125. * If `object` contains duplicate values, subsequent values overwrite
  14126. * property assignments of previous values.
  14127. *
  14128. * @static
  14129. * @memberOf _
  14130. * @since 0.7.0
  14131. * @category Object
  14132. * @param {Object} object The object to invert.
  14133. * @returns {Object} Returns the new inverted object.
  14134. * @example
  14135. *
  14136. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  14137. *
  14138. * _.invert(object);
  14139. * // => { '1': 'c', '2': 'b' }
  14140. */
  14141. var invert = createInverter(function(result, value, key) {
  14142. if (value != null &&
  14143. typeof value.toString != 'function') {
  14144. value = nativeObjectToString.call(value);
  14145. }
  14146. result[value] = key;
  14147. }, constant(identity));
  14148. /**
  14149. * This method is like `_.invert` except that the inverted object is generated
  14150. * from the results of running each element of `object` thru `iteratee`. The
  14151. * corresponding inverted value of each inverted key is an array of keys
  14152. * responsible for generating the inverted value. The iteratee is invoked
  14153. * with one argument: (value).
  14154. *
  14155. * @static
  14156. * @memberOf _
  14157. * @since 4.1.0
  14158. * @category Object
  14159. * @param {Object} object The object to invert.
  14160. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  14161. * @returns {Object} Returns the new inverted object.
  14162. * @example
  14163. *
  14164. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  14165. *
  14166. * _.invertBy(object);
  14167. * // => { '1': ['a', 'c'], '2': ['b'] }
  14168. *
  14169. * _.invertBy(object, function(value) {
  14170. * return 'group' + value;
  14171. * });
  14172. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  14173. */
  14174. var invertBy = createInverter(function(result, value, key) {
  14175. if (value != null &&
  14176. typeof value.toString != 'function') {
  14177. value = nativeObjectToString.call(value);
  14178. }
  14179. if (hasOwnProperty.call(result, value)) {
  14180. result[value].push(key);
  14181. } else {
  14182. result[value] = [key];
  14183. }
  14184. }, getIteratee);
  14185. /**
  14186. * Invokes the method at `path` of `object`.
  14187. *
  14188. * @static
  14189. * @memberOf _
  14190. * @since 4.0.0
  14191. * @category Object
  14192. * @param {Object} object The object to query.
  14193. * @param {Array|string} path The path of the method to invoke.
  14194. * @param {...*} [args] The arguments to invoke the method with.
  14195. * @returns {*} Returns the result of the invoked method.
  14196. * @example
  14197. *
  14198. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  14199. *
  14200. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  14201. * // => [2, 3]
  14202. */
  14203. var invoke = baseRest(baseInvoke);
  14204. /**
  14205. * Creates an array of the own enumerable property names of `object`.
  14206. *
  14207. * **Note:** Non-object values are coerced to objects. See the
  14208. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  14209. * for more details.
  14210. *
  14211. * @static
  14212. * @since 0.1.0
  14213. * @memberOf _
  14214. * @category Object
  14215. * @param {Object} object The object to query.
  14216. * @returns {Array} Returns the array of property names.
  14217. * @example
  14218. *
  14219. * function Foo() {
  14220. * this.a = 1;
  14221. * this.b = 2;
  14222. * }
  14223. *
  14224. * Foo.prototype.c = 3;
  14225. *
  14226. * _.keys(new Foo);
  14227. * // => ['a', 'b'] (iteration order is not guaranteed)
  14228. *
  14229. * _.keys('hi');
  14230. * // => ['0', '1']
  14231. */
  14232. function keys(object) {
  14233. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  14234. }
  14235. /**
  14236. * Creates an array of the own and inherited enumerable property names of `object`.
  14237. *
  14238. * **Note:** Non-object values are coerced to objects.
  14239. *
  14240. * @static
  14241. * @memberOf _
  14242. * @since 3.0.0
  14243. * @category Object
  14244. * @param {Object} object The object to query.
  14245. * @returns {Array} Returns the array of property names.
  14246. * @example
  14247. *
  14248. * function Foo() {
  14249. * this.a = 1;
  14250. * this.b = 2;
  14251. * }
  14252. *
  14253. * Foo.prototype.c = 3;
  14254. *
  14255. * _.keysIn(new Foo);
  14256. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  14257. */
  14258. function keysIn(object) {
  14259. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  14260. }
  14261. /**
  14262. * The opposite of `_.mapValues`; this method creates an object with the
  14263. * same values as `object` and keys generated by running each own enumerable
  14264. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  14265. * with three arguments: (value, key, object).
  14266. *
  14267. * @static
  14268. * @memberOf _
  14269. * @since 3.8.0
  14270. * @category Object
  14271. * @param {Object} object The object to iterate over.
  14272. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14273. * @returns {Object} Returns the new mapped object.
  14274. * @see _.mapValues
  14275. * @example
  14276. *
  14277. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  14278. * return key + value;
  14279. * });
  14280. * // => { 'a1': 1, 'b2': 2 }
  14281. */
  14282. function mapKeys(object, iteratee) {
  14283. var result = {};
  14284. iteratee = getIteratee(iteratee, 3);
  14285. baseForOwn(object, function(value, key, object) {
  14286. baseAssignValue(result, iteratee(value, key, object), value);
  14287. });
  14288. return result;
  14289. }
  14290. /**
  14291. * Creates an object with the same keys as `object` and values generated
  14292. * by running each own enumerable string keyed property of `object` thru
  14293. * `iteratee`. The iteratee is invoked with three arguments:
  14294. * (value, key, object).
  14295. *
  14296. * @static
  14297. * @memberOf _
  14298. * @since 2.4.0
  14299. * @category Object
  14300. * @param {Object} object The object to iterate over.
  14301. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14302. * @returns {Object} Returns the new mapped object.
  14303. * @see _.mapKeys
  14304. * @example
  14305. *
  14306. * var users = {
  14307. * 'fred': { 'user': 'fred', 'age': 40 },
  14308. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  14309. * };
  14310. *
  14311. * _.mapValues(users, function(o) { return o.age; });
  14312. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  14313. *
  14314. * // The `_.property` iteratee shorthand.
  14315. * _.mapValues(users, 'age');
  14316. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  14317. */
  14318. function mapValues(object, iteratee) {
  14319. var result = {};
  14320. iteratee = getIteratee(iteratee, 3);
  14321. baseForOwn(object, function(value, key, object) {
  14322. baseAssignValue(result, key, iteratee(value, key, object));
  14323. });
  14324. return result;
  14325. }
  14326. /**
  14327. * This method is like `_.assign` except that it recursively merges own and
  14328. * inherited enumerable string keyed properties of source objects into the
  14329. * destination object. Source properties that resolve to `undefined` are
  14330. * skipped if a destination value exists. Array and plain object properties
  14331. * are merged recursively. Other objects and value types are overridden by
  14332. * assignment. Source objects are applied from left to right. Subsequent
  14333. * sources overwrite property assignments of previous sources.
  14334. *
  14335. * **Note:** This method mutates `object`.
  14336. *
  14337. * @static
  14338. * @memberOf _
  14339. * @since 0.5.0
  14340. * @category Object
  14341. * @param {Object} object The destination object.
  14342. * @param {...Object} [sources] The source objects.
  14343. * @returns {Object} Returns `object`.
  14344. * @example
  14345. *
  14346. * var object = {
  14347. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  14348. * };
  14349. *
  14350. * var other = {
  14351. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  14352. * };
  14353. *
  14354. * _.merge(object, other);
  14355. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  14356. */
  14357. var merge = createAssigner(function(object, source, srcIndex) {
  14358. baseMerge(object, source, srcIndex);
  14359. });
  14360. /**
  14361. * This method is like `_.merge` except that it accepts `customizer` which
  14362. * is invoked to produce the merged values of the destination and source
  14363. * properties. If `customizer` returns `undefined`, merging is handled by the
  14364. * method instead. The `customizer` is invoked with six arguments:
  14365. * (objValue, srcValue, key, object, source, stack).
  14366. *
  14367. * **Note:** This method mutates `object`.
  14368. *
  14369. * @static
  14370. * @memberOf _
  14371. * @since 4.0.0
  14372. * @category Object
  14373. * @param {Object} object The destination object.
  14374. * @param {...Object} sources The source objects.
  14375. * @param {Function} customizer The function to customize assigned values.
  14376. * @returns {Object} Returns `object`.
  14377. * @example
  14378. *
  14379. * function customizer(objValue, srcValue) {
  14380. * if (_.isArray(objValue)) {
  14381. * return objValue.concat(srcValue);
  14382. * }
  14383. * }
  14384. *
  14385. * var object = { 'a': [1], 'b': [2] };
  14386. * var other = { 'a': [3], 'b': [4] };
  14387. *
  14388. * _.mergeWith(object, other, customizer);
  14389. * // => { 'a': [1, 3], 'b': [2, 4] }
  14390. */
  14391. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  14392. baseMerge(object, source, srcIndex, customizer);
  14393. });
  14394. /**
  14395. * The opposite of `_.pick`; this method creates an object composed of the
  14396. * own and inherited enumerable property paths of `object` that are not omitted.
  14397. *
  14398. * **Note:** This method is considerably slower than `_.pick`.
  14399. *
  14400. * @static
  14401. * @since 0.1.0
  14402. * @memberOf _
  14403. * @category Object
  14404. * @param {Object} object The source object.
  14405. * @param {...(string|string[])} [paths] The property paths to omit.
  14406. * @returns {Object} Returns the new object.
  14407. * @example
  14408. *
  14409. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14410. *
  14411. * _.omit(object, ['a', 'c']);
  14412. * // => { 'b': '2' }
  14413. */
  14414. var omit = flatRest(function(object, paths) {
  14415. var result = {};
  14416. if (object == null) {
  14417. return result;
  14418. }
  14419. var isDeep = false;
  14420. paths = arrayMap(paths, function(path) {
  14421. path = castPath(path, object);
  14422. isDeep || (isDeep = path.length > 1);
  14423. return path;
  14424. });
  14425. copyObject(object, getAllKeysIn(object), result);
  14426. if (isDeep) {
  14427. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  14428. }
  14429. var length = paths.length;
  14430. while (length--) {
  14431. baseUnset(result, paths[length]);
  14432. }
  14433. return result;
  14434. });
  14435. /**
  14436. * The opposite of `_.pickBy`; this method creates an object composed of
  14437. * the own and inherited enumerable string keyed properties of `object` that
  14438. * `predicate` doesn't return truthy for. The predicate is invoked with two
  14439. * arguments: (value, key).
  14440. *
  14441. * @static
  14442. * @memberOf _
  14443. * @since 4.0.0
  14444. * @category Object
  14445. * @param {Object} object The source object.
  14446. * @param {Function} [predicate=_.identity] The function invoked per property.
  14447. * @returns {Object} Returns the new object.
  14448. * @example
  14449. *
  14450. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14451. *
  14452. * _.omitBy(object, _.isNumber);
  14453. * // => { 'b': '2' }
  14454. */
  14455. function omitBy(object, predicate) {
  14456. return pickBy(object, negate(getIteratee(predicate)));
  14457. }
  14458. /**
  14459. * Creates an object composed of the picked `object` properties.
  14460. *
  14461. * @static
  14462. * @since 0.1.0
  14463. * @memberOf _
  14464. * @category Object
  14465. * @param {Object} object The source object.
  14466. * @param {...(string|string[])} [paths] The property paths to pick.
  14467. * @returns {Object} Returns the new object.
  14468. * @example
  14469. *
  14470. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14471. *
  14472. * _.pick(object, ['a', 'c']);
  14473. * // => { 'a': 1, 'c': 3 }
  14474. */
  14475. var pick = flatRest(function(object, paths) {
  14476. return object == null ? {} : basePick(object, paths);
  14477. });
  14478. /**
  14479. * Creates an object composed of the `object` properties `predicate` returns
  14480. * truthy for. The predicate is invoked with two arguments: (value, key).
  14481. *
  14482. * @static
  14483. * @memberOf _
  14484. * @since 4.0.0
  14485. * @category Object
  14486. * @param {Object} object The source object.
  14487. * @param {Function} [predicate=_.identity] The function invoked per property.
  14488. * @returns {Object} Returns the new object.
  14489. * @example
  14490. *
  14491. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14492. *
  14493. * _.pickBy(object, _.isNumber);
  14494. * // => { 'a': 1, 'c': 3 }
  14495. */
  14496. function pickBy(object, predicate) {
  14497. if (object == null) {
  14498. return {};
  14499. }
  14500. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14501. return [prop];
  14502. });
  14503. predicate = getIteratee(predicate);
  14504. return basePickBy(object, props, function(value, path) {
  14505. return predicate(value, path[0]);
  14506. });
  14507. }
  14508. /**
  14509. * This method is like `_.get` except that if the resolved value is a
  14510. * function it's invoked with the `this` binding of its parent object and
  14511. * its result is returned.
  14512. *
  14513. * @static
  14514. * @since 0.1.0
  14515. * @memberOf _
  14516. * @category Object
  14517. * @param {Object} object The object to query.
  14518. * @param {Array|string} path The path of the property to resolve.
  14519. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14520. * @returns {*} Returns the resolved value.
  14521. * @example
  14522. *
  14523. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14524. *
  14525. * _.result(object, 'a[0].b.c1');
  14526. * // => 3
  14527. *
  14528. * _.result(object, 'a[0].b.c2');
  14529. * // => 4
  14530. *
  14531. * _.result(object, 'a[0].b.c3', 'default');
  14532. * // => 'default'
  14533. *
  14534. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14535. * // => 'default'
  14536. */
  14537. function result(object, path, defaultValue) {
  14538. path = castPath(path, object);
  14539. var index = -1,
  14540. length = path.length;
  14541. // Ensure the loop is entered when path is empty.
  14542. if (!length) {
  14543. length = 1;
  14544. object = undefined;
  14545. }
  14546. while (++index < length) {
  14547. var value = object == null ? undefined : object[toKey(path[index])];
  14548. if (value === undefined) {
  14549. index = length;
  14550. value = defaultValue;
  14551. }
  14552. object = isFunction(value) ? value.call(object) : value;
  14553. }
  14554. return object;
  14555. }
  14556. /**
  14557. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14558. * it's created. Arrays are created for missing index properties while objects
  14559. * are created for all other missing properties. Use `_.setWith` to customize
  14560. * `path` creation.
  14561. *
  14562. * **Note:** This method mutates `object`.
  14563. *
  14564. * @static
  14565. * @memberOf _
  14566. * @since 3.7.0
  14567. * @category Object
  14568. * @param {Object} object The object to modify.
  14569. * @param {Array|string} path The path of the property to set.
  14570. * @param {*} value The value to set.
  14571. * @returns {Object} Returns `object`.
  14572. * @example
  14573. *
  14574. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14575. *
  14576. * _.set(object, 'a[0].b.c', 4);
  14577. * console.log(object.a[0].b.c);
  14578. * // => 4
  14579. *
  14580. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14581. * console.log(object.x[0].y.z);
  14582. * // => 5
  14583. */
  14584. function set(object, path, value) {
  14585. return object == null ? object : baseSet(object, path, value);
  14586. }
  14587. /**
  14588. * This method is like `_.set` except that it accepts `customizer` which is
  14589. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14590. * path creation is handled by the method instead. The `customizer` is invoked
  14591. * with three arguments: (nsValue, key, nsObject).
  14592. *
  14593. * **Note:** This method mutates `object`.
  14594. *
  14595. * @static
  14596. * @memberOf _
  14597. * @since 4.0.0
  14598. * @category Object
  14599. * @param {Object} object The object to modify.
  14600. * @param {Array|string} path The path of the property to set.
  14601. * @param {*} value The value to set.
  14602. * @param {Function} [customizer] The function to customize assigned values.
  14603. * @returns {Object} Returns `object`.
  14604. * @example
  14605. *
  14606. * var object = {};
  14607. *
  14608. * _.setWith(object, '[0][1]', 'a', Object);
  14609. * // => { '0': { '1': 'a' } }
  14610. */
  14611. function setWith(object, path, value, customizer) {
  14612. customizer = typeof customizer == 'function' ? customizer : undefined;
  14613. return object == null ? object : baseSet(object, path, value, customizer);
  14614. }
  14615. /**
  14616. * Creates an array of own enumerable string keyed-value pairs for `object`
  14617. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14618. * entries are returned.
  14619. *
  14620. * @static
  14621. * @memberOf _
  14622. * @since 4.0.0
  14623. * @alias entries
  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. * _.toPairs(new Foo);
  14637. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14638. */
  14639. var toPairs = createToPairs(keys);
  14640. /**
  14641. * Creates an array of own and inherited enumerable string keyed-value pairs
  14642. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14643. * or set, its entries are returned.
  14644. *
  14645. * @static
  14646. * @memberOf _
  14647. * @since 4.0.0
  14648. * @alias entriesIn
  14649. * @category Object
  14650. * @param {Object} object The object to query.
  14651. * @returns {Array} Returns the key-value pairs.
  14652. * @example
  14653. *
  14654. * function Foo() {
  14655. * this.a = 1;
  14656. * this.b = 2;
  14657. * }
  14658. *
  14659. * Foo.prototype.c = 3;
  14660. *
  14661. * _.toPairsIn(new Foo);
  14662. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14663. */
  14664. var toPairsIn = createToPairs(keysIn);
  14665. /**
  14666. * An alternative to `_.reduce`; this method transforms `object` to a new
  14667. * `accumulator` object which is the result of running each of its own
  14668. * enumerable string keyed properties thru `iteratee`, with each invocation
  14669. * potentially mutating the `accumulator` object. If `accumulator` is not
  14670. * provided, a new object with the same `[[Prototype]]` will be used. The
  14671. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14672. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14673. *
  14674. * @static
  14675. * @memberOf _
  14676. * @since 1.3.0
  14677. * @category Object
  14678. * @param {Object} object The object to iterate over.
  14679. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14680. * @param {*} [accumulator] The custom accumulator value.
  14681. * @returns {*} Returns the accumulated value.
  14682. * @example
  14683. *
  14684. * _.transform([2, 3, 4], function(result, n) {
  14685. * result.push(n *= n);
  14686. * return n % 2 == 0;
  14687. * }, []);
  14688. * // => [4, 9]
  14689. *
  14690. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14691. * (result[value] || (result[value] = [])).push(key);
  14692. * }, {});
  14693. * // => { '1': ['a', 'c'], '2': ['b'] }
  14694. */
  14695. function transform(object, iteratee, accumulator) {
  14696. var isArr = isArray(object),
  14697. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14698. iteratee = getIteratee(iteratee, 4);
  14699. if (accumulator == null) {
  14700. var Ctor = object && object.constructor;
  14701. if (isArrLike) {
  14702. accumulator = isArr ? new Ctor : [];
  14703. }
  14704. else if (isObject(object)) {
  14705. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14706. }
  14707. else {
  14708. accumulator = {};
  14709. }
  14710. }
  14711. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14712. return iteratee(accumulator, value, index, object);
  14713. });
  14714. return accumulator;
  14715. }
  14716. /**
  14717. * Removes the property at `path` of `object`.
  14718. *
  14719. * **Note:** This method mutates `object`.
  14720. *
  14721. * @static
  14722. * @memberOf _
  14723. * @since 4.0.0
  14724. * @category Object
  14725. * @param {Object} object The object to modify.
  14726. * @param {Array|string} path The path of the property to unset.
  14727. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14728. * @example
  14729. *
  14730. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14731. * _.unset(object, 'a[0].b.c');
  14732. * // => true
  14733. *
  14734. * console.log(object);
  14735. * // => { 'a': [{ 'b': {} }] };
  14736. *
  14737. * _.unset(object, ['a', '0', 'b', 'c']);
  14738. * // => true
  14739. *
  14740. * console.log(object);
  14741. * // => { 'a': [{ 'b': {} }] };
  14742. */
  14743. function unset(object, path) {
  14744. return object == null ? true : baseUnset(object, path);
  14745. }
  14746. /**
  14747. * This method is like `_.set` except that accepts `updater` to produce the
  14748. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14749. * is invoked with one argument: (value).
  14750. *
  14751. * **Note:** This method mutates `object`.
  14752. *
  14753. * @static
  14754. * @memberOf _
  14755. * @since 4.6.0
  14756. * @category Object
  14757. * @param {Object} object The object to modify.
  14758. * @param {Array|string} path The path of the property to set.
  14759. * @param {Function} updater The function to produce the updated value.
  14760. * @returns {Object} Returns `object`.
  14761. * @example
  14762. *
  14763. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14764. *
  14765. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14766. * console.log(object.a[0].b.c);
  14767. * // => 9
  14768. *
  14769. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14770. * console.log(object.x[0].y.z);
  14771. * // => 0
  14772. */
  14773. function update(object, path, updater) {
  14774. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14775. }
  14776. /**
  14777. * This method is like `_.update` except that it accepts `customizer` which is
  14778. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14779. * path creation is handled by the method instead. The `customizer` is invoked
  14780. * with three arguments: (nsValue, key, nsObject).
  14781. *
  14782. * **Note:** This method mutates `object`.
  14783. *
  14784. * @static
  14785. * @memberOf _
  14786. * @since 4.6.0
  14787. * @category Object
  14788. * @param {Object} object The object to modify.
  14789. * @param {Array|string} path The path of the property to set.
  14790. * @param {Function} updater The function to produce the updated value.
  14791. * @param {Function} [customizer] The function to customize assigned values.
  14792. * @returns {Object} Returns `object`.
  14793. * @example
  14794. *
  14795. * var object = {};
  14796. *
  14797. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14798. * // => { '0': { '1': 'a' } }
  14799. */
  14800. function updateWith(object, path, updater, customizer) {
  14801. customizer = typeof customizer == 'function' ? customizer : undefined;
  14802. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14803. }
  14804. /**
  14805. * Creates an array of the own enumerable string keyed property values of `object`.
  14806. *
  14807. * **Note:** Non-object values are coerced to objects.
  14808. *
  14809. * @static
  14810. * @since 0.1.0
  14811. * @memberOf _
  14812. * @category Object
  14813. * @param {Object} object The object to query.
  14814. * @returns {Array} Returns the array of property values.
  14815. * @example
  14816. *
  14817. * function Foo() {
  14818. * this.a = 1;
  14819. * this.b = 2;
  14820. * }
  14821. *
  14822. * Foo.prototype.c = 3;
  14823. *
  14824. * _.values(new Foo);
  14825. * // => [1, 2] (iteration order is not guaranteed)
  14826. *
  14827. * _.values('hi');
  14828. * // => ['h', 'i']
  14829. */
  14830. function values(object) {
  14831. return object == null ? [] : baseValues(object, keys(object));
  14832. }
  14833. /**
  14834. * Creates an array of the own and inherited enumerable string keyed property
  14835. * values of `object`.
  14836. *
  14837. * **Note:** Non-object values are coerced to objects.
  14838. *
  14839. * @static
  14840. * @memberOf _
  14841. * @since 3.0.0
  14842. * @category Object
  14843. * @param {Object} object The object to query.
  14844. * @returns {Array} Returns the array of property values.
  14845. * @example
  14846. *
  14847. * function Foo() {
  14848. * this.a = 1;
  14849. * this.b = 2;
  14850. * }
  14851. *
  14852. * Foo.prototype.c = 3;
  14853. *
  14854. * _.valuesIn(new Foo);
  14855. * // => [1, 2, 3] (iteration order is not guaranteed)
  14856. */
  14857. function valuesIn(object) {
  14858. return object == null ? [] : baseValues(object, keysIn(object));
  14859. }
  14860. /*------------------------------------------------------------------------*/
  14861. /**
  14862. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14863. *
  14864. * @static
  14865. * @memberOf _
  14866. * @since 4.0.0
  14867. * @category Number
  14868. * @param {number} number The number to clamp.
  14869. * @param {number} [lower] The lower bound.
  14870. * @param {number} upper The upper bound.
  14871. * @returns {number} Returns the clamped number.
  14872. * @example
  14873. *
  14874. * _.clamp(-10, -5, 5);
  14875. * // => -5
  14876. *
  14877. * _.clamp(10, -5, 5);
  14878. * // => 5
  14879. */
  14880. function clamp(number, lower, upper) {
  14881. if (upper === undefined) {
  14882. upper = lower;
  14883. lower = undefined;
  14884. }
  14885. if (upper !== undefined) {
  14886. upper = toNumber(upper);
  14887. upper = upper === upper ? upper : 0;
  14888. }
  14889. if (lower !== undefined) {
  14890. lower = toNumber(lower);
  14891. lower = lower === lower ? lower : 0;
  14892. }
  14893. return baseClamp(toNumber(number), lower, upper);
  14894. }
  14895. /**
  14896. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14897. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14898. * If `start` is greater than `end` the params are swapped to support
  14899. * negative ranges.
  14900. *
  14901. * @static
  14902. * @memberOf _
  14903. * @since 3.3.0
  14904. * @category Number
  14905. * @param {number} number The number to check.
  14906. * @param {number} [start=0] The start of the range.
  14907. * @param {number} end The end of the range.
  14908. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14909. * @see _.range, _.rangeRight
  14910. * @example
  14911. *
  14912. * _.inRange(3, 2, 4);
  14913. * // => true
  14914. *
  14915. * _.inRange(4, 8);
  14916. * // => true
  14917. *
  14918. * _.inRange(4, 2);
  14919. * // => false
  14920. *
  14921. * _.inRange(2, 2);
  14922. * // => false
  14923. *
  14924. * _.inRange(1.2, 2);
  14925. * // => true
  14926. *
  14927. * _.inRange(5.2, 4);
  14928. * // => false
  14929. *
  14930. * _.inRange(-3, -2, -6);
  14931. * // => true
  14932. */
  14933. function inRange(number, start, end) {
  14934. start = toFinite(start);
  14935. if (end === undefined) {
  14936. end = start;
  14937. start = 0;
  14938. } else {
  14939. end = toFinite(end);
  14940. }
  14941. number = toNumber(number);
  14942. return baseInRange(number, start, end);
  14943. }
  14944. /**
  14945. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14946. * If only one argument is provided a number between `0` and the given number
  14947. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14948. * floats, a floating-point number is returned instead of an integer.
  14949. *
  14950. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14951. * floating-point values which can produce unexpected results.
  14952. *
  14953. * @static
  14954. * @memberOf _
  14955. * @since 0.7.0
  14956. * @category Number
  14957. * @param {number} [lower=0] The lower bound.
  14958. * @param {number} [upper=1] The upper bound.
  14959. * @param {boolean} [floating] Specify returning a floating-point number.
  14960. * @returns {number} Returns the random number.
  14961. * @example
  14962. *
  14963. * _.random(0, 5);
  14964. * // => an integer between 0 and 5
  14965. *
  14966. * _.random(5);
  14967. * // => also an integer between 0 and 5
  14968. *
  14969. * _.random(5, true);
  14970. * // => a floating-point number between 0 and 5
  14971. *
  14972. * _.random(1.2, 5.2);
  14973. * // => a floating-point number between 1.2 and 5.2
  14974. */
  14975. function random(lower, upper, floating) {
  14976. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14977. upper = floating = undefined;
  14978. }
  14979. if (floating === undefined) {
  14980. if (typeof upper == 'boolean') {
  14981. floating = upper;
  14982. upper = undefined;
  14983. }
  14984. else if (typeof lower == 'boolean') {
  14985. floating = lower;
  14986. lower = undefined;
  14987. }
  14988. }
  14989. if (lower === undefined && upper === undefined) {
  14990. lower = 0;
  14991. upper = 1;
  14992. }
  14993. else {
  14994. lower = toFinite(lower);
  14995. if (upper === undefined) {
  14996. upper = lower;
  14997. lower = 0;
  14998. } else {
  14999. upper = toFinite(upper);
  15000. }
  15001. }
  15002. if (lower > upper) {
  15003. var temp = lower;
  15004. lower = upper;
  15005. upper = temp;
  15006. }
  15007. if (floating || lower % 1 || upper % 1) {
  15008. var rand = nativeRandom();
  15009. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  15010. }
  15011. return baseRandom(lower, upper);
  15012. }
  15013. /*------------------------------------------------------------------------*/
  15014. /**
  15015. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  15016. *
  15017. * @static
  15018. * @memberOf _
  15019. * @since 3.0.0
  15020. * @category String
  15021. * @param {string} [string=''] The string to convert.
  15022. * @returns {string} Returns the camel cased string.
  15023. * @example
  15024. *
  15025. * _.camelCase('Foo Bar');
  15026. * // => 'fooBar'
  15027. *
  15028. * _.camelCase('--foo-bar--');
  15029. * // => 'fooBar'
  15030. *
  15031. * _.camelCase('__FOO_BAR__');
  15032. * // => 'fooBar'
  15033. */
  15034. var camelCase = createCompounder(function(result, word, index) {
  15035. word = word.toLowerCase();
  15036. return result + (index ? capitalize(word) : word);
  15037. });
  15038. /**
  15039. * Converts the first character of `string` to upper case and the remaining
  15040. * to lower case.
  15041. *
  15042. * @static
  15043. * @memberOf _
  15044. * @since 3.0.0
  15045. * @category String
  15046. * @param {string} [string=''] The string to capitalize.
  15047. * @returns {string} Returns the capitalized string.
  15048. * @example
  15049. *
  15050. * _.capitalize('FRED');
  15051. * // => 'Fred'
  15052. */
  15053. function capitalize(string) {
  15054. return upperFirst(toString(string).toLowerCase());
  15055. }
  15056. /**
  15057. * Deburrs `string` by converting
  15058. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  15059. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  15060. * letters to basic Latin letters and removing
  15061. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  15062. *
  15063. * @static
  15064. * @memberOf _
  15065. * @since 3.0.0
  15066. * @category String
  15067. * @param {string} [string=''] The string to deburr.
  15068. * @returns {string} Returns the deburred string.
  15069. * @example
  15070. *
  15071. * _.deburr('déjà vu');
  15072. * // => 'deja vu'
  15073. */
  15074. function deburr(string) {
  15075. string = toString(string);
  15076. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  15077. }
  15078. /**
  15079. * Checks if `string` ends with the given target string.
  15080. *
  15081. * @static
  15082. * @memberOf _
  15083. * @since 3.0.0
  15084. * @category String
  15085. * @param {string} [string=''] The string to inspect.
  15086. * @param {string} [target] The string to search for.
  15087. * @param {number} [position=string.length] The position to search up to.
  15088. * @returns {boolean} Returns `true` if `string` ends with `target`,
  15089. * else `false`.
  15090. * @example
  15091. *
  15092. * _.endsWith('abc', 'c');
  15093. * // => true
  15094. *
  15095. * _.endsWith('abc', 'b');
  15096. * // => false
  15097. *
  15098. * _.endsWith('abc', 'b', 2);
  15099. * // => true
  15100. */
  15101. function endsWith(string, target, position) {
  15102. string = toString(string);
  15103. target = baseToString(target);
  15104. var length = string.length;
  15105. position = position === undefined
  15106. ? length
  15107. : baseClamp(toInteger(position), 0, length);
  15108. var end = position;
  15109. position -= target.length;
  15110. return position >= 0 && string.slice(position, end) == target;
  15111. }
  15112. /**
  15113. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  15114. * corresponding HTML entities.
  15115. *
  15116. * **Note:** No other characters are escaped. To escape additional
  15117. * characters use a third-party library like [_he_](https://mths.be/he).
  15118. *
  15119. * Though the ">" character is escaped for symmetry, characters like
  15120. * ">" and "/" don't need escaping in HTML and have no special meaning
  15121. * unless they're part of a tag or unquoted attribute value. See
  15122. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  15123. * (under "semi-related fun fact") for more details.
  15124. *
  15125. * When working with HTML you should always
  15126. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  15127. * XSS vectors.
  15128. *
  15129. * @static
  15130. * @since 0.1.0
  15131. * @memberOf _
  15132. * @category String
  15133. * @param {string} [string=''] The string to escape.
  15134. * @returns {string} Returns the escaped string.
  15135. * @example
  15136. *
  15137. * _.escape('fred, barney, & pebbles');
  15138. * // => 'fred, barney, &amp; pebbles'
  15139. */
  15140. function escape(string) {
  15141. string = toString(string);
  15142. return (string && reHasUnescapedHtml.test(string))
  15143. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  15144. : string;
  15145. }
  15146. /**
  15147. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  15148. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  15149. *
  15150. * @static
  15151. * @memberOf _
  15152. * @since 3.0.0
  15153. * @category String
  15154. * @param {string} [string=''] The string to escape.
  15155. * @returns {string} Returns the escaped string.
  15156. * @example
  15157. *
  15158. * _.escapeRegExp('[lodash](https://lodash.com/)');
  15159. * // => '\[lodash\]\(https://lodash\.com/\)'
  15160. */
  15161. function escapeRegExp(string) {
  15162. string = toString(string);
  15163. return (string && reHasRegExpChar.test(string))
  15164. ? string.replace(reRegExpChar, '\\$&')
  15165. : string;
  15166. }
  15167. /**
  15168. * Converts `string` to
  15169. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  15170. *
  15171. * @static
  15172. * @memberOf _
  15173. * @since 3.0.0
  15174. * @category String
  15175. * @param {string} [string=''] The string to convert.
  15176. * @returns {string} Returns the kebab cased string.
  15177. * @example
  15178. *
  15179. * _.kebabCase('Foo Bar');
  15180. * // => 'foo-bar'
  15181. *
  15182. * _.kebabCase('fooBar');
  15183. * // => 'foo-bar'
  15184. *
  15185. * _.kebabCase('__FOO_BAR__');
  15186. * // => 'foo-bar'
  15187. */
  15188. var kebabCase = createCompounder(function(result, word, index) {
  15189. return result + (index ? '-' : '') + word.toLowerCase();
  15190. });
  15191. /**
  15192. * Converts `string`, as space separated words, to lower case.
  15193. *
  15194. * @static
  15195. * @memberOf _
  15196. * @since 4.0.0
  15197. * @category String
  15198. * @param {string} [string=''] The string to convert.
  15199. * @returns {string} Returns the lower cased string.
  15200. * @example
  15201. *
  15202. * _.lowerCase('--Foo-Bar--');
  15203. * // => 'foo bar'
  15204. *
  15205. * _.lowerCase('fooBar');
  15206. * // => 'foo bar'
  15207. *
  15208. * _.lowerCase('__FOO_BAR__');
  15209. * // => 'foo bar'
  15210. */
  15211. var lowerCase = createCompounder(function(result, word, index) {
  15212. return result + (index ? ' ' : '') + word.toLowerCase();
  15213. });
  15214. /**
  15215. * Converts the first character of `string` to lower case.
  15216. *
  15217. * @static
  15218. * @memberOf _
  15219. * @since 4.0.0
  15220. * @category String
  15221. * @param {string} [string=''] The string to convert.
  15222. * @returns {string} Returns the converted string.
  15223. * @example
  15224. *
  15225. * _.lowerFirst('Fred');
  15226. * // => 'fred'
  15227. *
  15228. * _.lowerFirst('FRED');
  15229. * // => 'fRED'
  15230. */
  15231. var lowerFirst = createCaseFirst('toLowerCase');
  15232. /**
  15233. * Pads `string` on the left and right sides if it's shorter than `length`.
  15234. * Padding characters are truncated if they can't be evenly divided by `length`.
  15235. *
  15236. * @static
  15237. * @memberOf _
  15238. * @since 3.0.0
  15239. * @category String
  15240. * @param {string} [string=''] The string to pad.
  15241. * @param {number} [length=0] The padding length.
  15242. * @param {string} [chars=' '] The string used as padding.
  15243. * @returns {string} Returns the padded string.
  15244. * @example
  15245. *
  15246. * _.pad('abc', 8);
  15247. * // => ' abc '
  15248. *
  15249. * _.pad('abc', 8, '_-');
  15250. * // => '_-abc_-_'
  15251. *
  15252. * _.pad('abc', 3);
  15253. * // => 'abc'
  15254. */
  15255. function pad(string, length, chars) {
  15256. string = toString(string);
  15257. length = toInteger(length);
  15258. var strLength = length ? stringSize(string) : 0;
  15259. if (!length || strLength >= length) {
  15260. return string;
  15261. }
  15262. var mid = (length - strLength) / 2;
  15263. return (
  15264. createPadding(nativeFloor(mid), chars) +
  15265. string +
  15266. createPadding(nativeCeil(mid), chars)
  15267. );
  15268. }
  15269. /**
  15270. * Pads `string` on the right side if it's shorter than `length`. Padding
  15271. * characters are truncated if they exceed `length`.
  15272. *
  15273. * @static
  15274. * @memberOf _
  15275. * @since 4.0.0
  15276. * @category String
  15277. * @param {string} [string=''] The string to pad.
  15278. * @param {number} [length=0] The padding length.
  15279. * @param {string} [chars=' '] The string used as padding.
  15280. * @returns {string} Returns the padded string.
  15281. * @example
  15282. *
  15283. * _.padEnd('abc', 6);
  15284. * // => 'abc '
  15285. *
  15286. * _.padEnd('abc', 6, '_-');
  15287. * // => 'abc_-_'
  15288. *
  15289. * _.padEnd('abc', 3);
  15290. * // => 'abc'
  15291. */
  15292. function padEnd(string, length, chars) {
  15293. string = toString(string);
  15294. length = toInteger(length);
  15295. var strLength = length ? stringSize(string) : 0;
  15296. return (length && strLength < length)
  15297. ? (string + createPadding(length - strLength, chars))
  15298. : string;
  15299. }
  15300. /**
  15301. * Pads `string` on the left side if it's shorter than `length`. Padding
  15302. * characters are truncated if they exceed `length`.
  15303. *
  15304. * @static
  15305. * @memberOf _
  15306. * @since 4.0.0
  15307. * @category String
  15308. * @param {string} [string=''] The string to pad.
  15309. * @param {number} [length=0] The padding length.
  15310. * @param {string} [chars=' '] The string used as padding.
  15311. * @returns {string} Returns the padded string.
  15312. * @example
  15313. *
  15314. * _.padStart('abc', 6);
  15315. * // => ' abc'
  15316. *
  15317. * _.padStart('abc', 6, '_-');
  15318. * // => '_-_abc'
  15319. *
  15320. * _.padStart('abc', 3);
  15321. * // => 'abc'
  15322. */
  15323. function padStart(string, length, chars) {
  15324. string = toString(string);
  15325. length = toInteger(length);
  15326. var strLength = length ? stringSize(string) : 0;
  15327. return (length && strLength < length)
  15328. ? (createPadding(length - strLength, chars) + string)
  15329. : string;
  15330. }
  15331. /**
  15332. * Converts `string` to an integer of the specified radix. If `radix` is
  15333. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  15334. * hexadecimal, in which case a `radix` of `16` is used.
  15335. *
  15336. * **Note:** This method aligns with the
  15337. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  15338. *
  15339. * @static
  15340. * @memberOf _
  15341. * @since 1.1.0
  15342. * @category String
  15343. * @param {string} string The string to convert.
  15344. * @param {number} [radix=10] The radix to interpret `value` by.
  15345. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15346. * @returns {number} Returns the converted integer.
  15347. * @example
  15348. *
  15349. * _.parseInt('08');
  15350. * // => 8
  15351. *
  15352. * _.map(['6', '08', '10'], _.parseInt);
  15353. * // => [6, 8, 10]
  15354. */
  15355. function parseInt(string, radix, guard) {
  15356. if (guard || radix == null) {
  15357. radix = 0;
  15358. } else if (radix) {
  15359. radix = +radix;
  15360. }
  15361. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  15362. }
  15363. /**
  15364. * Repeats the given string `n` times.
  15365. *
  15366. * @static
  15367. * @memberOf _
  15368. * @since 3.0.0
  15369. * @category String
  15370. * @param {string} [string=''] The string to repeat.
  15371. * @param {number} [n=1] The number of times to repeat the string.
  15372. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15373. * @returns {string} Returns the repeated string.
  15374. * @example
  15375. *
  15376. * _.repeat('*', 3);
  15377. * // => '***'
  15378. *
  15379. * _.repeat('abc', 2);
  15380. * // => 'abcabc'
  15381. *
  15382. * _.repeat('abc', 0);
  15383. * // => ''
  15384. */
  15385. function repeat(string, n, guard) {
  15386. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  15387. n = 1;
  15388. } else {
  15389. n = toInteger(n);
  15390. }
  15391. return baseRepeat(toString(string), n);
  15392. }
  15393. /**
  15394. * Replaces matches for `pattern` in `string` with `replacement`.
  15395. *
  15396. * **Note:** This method is based on
  15397. * [`String#replace`](https://mdn.io/String/replace).
  15398. *
  15399. * @static
  15400. * @memberOf _
  15401. * @since 4.0.0
  15402. * @category String
  15403. * @param {string} [string=''] The string to modify.
  15404. * @param {RegExp|string} pattern The pattern to replace.
  15405. * @param {Function|string} replacement The match replacement.
  15406. * @returns {string} Returns the modified string.
  15407. * @example
  15408. *
  15409. * _.replace('Hi Fred', 'Fred', 'Barney');
  15410. * // => 'Hi Barney'
  15411. */
  15412. function replace() {
  15413. var args = arguments,
  15414. string = toString(args[0]);
  15415. return args.length < 3 ? string : string.replace(args[1], args[2]);
  15416. }
  15417. /**
  15418. * Converts `string` to
  15419. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  15420. *
  15421. * @static
  15422. * @memberOf _
  15423. * @since 3.0.0
  15424. * @category String
  15425. * @param {string} [string=''] The string to convert.
  15426. * @returns {string} Returns the snake cased string.
  15427. * @example
  15428. *
  15429. * _.snakeCase('Foo Bar');
  15430. * // => 'foo_bar'
  15431. *
  15432. * _.snakeCase('fooBar');
  15433. * // => 'foo_bar'
  15434. *
  15435. * _.snakeCase('--FOO-BAR--');
  15436. * // => 'foo_bar'
  15437. */
  15438. var snakeCase = createCompounder(function(result, word, index) {
  15439. return result + (index ? '_' : '') + word.toLowerCase();
  15440. });
  15441. /**
  15442. * Splits `string` by `separator`.
  15443. *
  15444. * **Note:** This method is based on
  15445. * [`String#split`](https://mdn.io/String/split).
  15446. *
  15447. * @static
  15448. * @memberOf _
  15449. * @since 4.0.0
  15450. * @category String
  15451. * @param {string} [string=''] The string to split.
  15452. * @param {RegExp|string} separator The separator pattern to split by.
  15453. * @param {number} [limit] The length to truncate results to.
  15454. * @returns {Array} Returns the string segments.
  15455. * @example
  15456. *
  15457. * _.split('a-b-c', '-', 2);
  15458. * // => ['a', 'b']
  15459. */
  15460. function split(string, separator, limit) {
  15461. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  15462. separator = limit = undefined;
  15463. }
  15464. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  15465. if (!limit) {
  15466. return [];
  15467. }
  15468. string = toString(string);
  15469. if (string && (
  15470. typeof separator == 'string' ||
  15471. (separator != null && !isRegExp(separator))
  15472. )) {
  15473. separator = baseToString(separator);
  15474. if (!separator && hasUnicode(string)) {
  15475. return castSlice(stringToArray(string), 0, limit);
  15476. }
  15477. }
  15478. return string.split(separator, limit);
  15479. }
  15480. /**
  15481. * Converts `string` to
  15482. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  15483. *
  15484. * @static
  15485. * @memberOf _
  15486. * @since 3.1.0
  15487. * @category String
  15488. * @param {string} [string=''] The string to convert.
  15489. * @returns {string} Returns the start cased string.
  15490. * @example
  15491. *
  15492. * _.startCase('--foo-bar--');
  15493. * // => 'Foo Bar'
  15494. *
  15495. * _.startCase('fooBar');
  15496. * // => 'Foo Bar'
  15497. *
  15498. * _.startCase('__FOO_BAR__');
  15499. * // => 'FOO BAR'
  15500. */
  15501. var startCase = createCompounder(function(result, word, index) {
  15502. return result + (index ? ' ' : '') + upperFirst(word);
  15503. });
  15504. /**
  15505. * Checks if `string` starts with the given target string.
  15506. *
  15507. * @static
  15508. * @memberOf _
  15509. * @since 3.0.0
  15510. * @category String
  15511. * @param {string} [string=''] The string to inspect.
  15512. * @param {string} [target] The string to search for.
  15513. * @param {number} [position=0] The position to search from.
  15514. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15515. * else `false`.
  15516. * @example
  15517. *
  15518. * _.startsWith('abc', 'a');
  15519. * // => true
  15520. *
  15521. * _.startsWith('abc', 'b');
  15522. * // => false
  15523. *
  15524. * _.startsWith('abc', 'b', 1);
  15525. * // => true
  15526. */
  15527. function startsWith(string, target, position) {
  15528. string = toString(string);
  15529. position = position == null
  15530. ? 0
  15531. : baseClamp(toInteger(position), 0, string.length);
  15532. target = baseToString(target);
  15533. return string.slice(position, position + target.length) == target;
  15534. }
  15535. /**
  15536. * Creates a compiled template function that can interpolate data properties
  15537. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15538. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15539. * properties may be accessed as free variables in the template. If a setting
  15540. * object is given, it takes precedence over `_.templateSettings` values.
  15541. *
  15542. * **Note:** In the development build `_.template` utilizes
  15543. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15544. * for easier debugging.
  15545. *
  15546. * For more information on precompiling templates see
  15547. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15548. *
  15549. * For more information on Chrome extension sandboxes see
  15550. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15551. *
  15552. * @static
  15553. * @since 0.1.0
  15554. * @memberOf _
  15555. * @category String
  15556. * @param {string} [string=''] The template string.
  15557. * @param {Object} [options={}] The options object.
  15558. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15559. * The HTML "escape" delimiter.
  15560. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15561. * The "evaluate" delimiter.
  15562. * @param {Object} [options.imports=_.templateSettings.imports]
  15563. * An object to import into the template as free variables.
  15564. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15565. * The "interpolate" delimiter.
  15566. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15567. * The sourceURL of the compiled template.
  15568. * @param {string} [options.variable='obj']
  15569. * The data object variable name.
  15570. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15571. * @returns {Function} Returns the compiled template function.
  15572. * @example
  15573. *
  15574. * // Use the "interpolate" delimiter to create a compiled template.
  15575. * var compiled = _.template('hello <%= user %>!');
  15576. * compiled({ 'user': 'fred' });
  15577. * // => 'hello fred!'
  15578. *
  15579. * // Use the HTML "escape" delimiter to escape data property values.
  15580. * var compiled = _.template('<b><%- value %></b>');
  15581. * compiled({ 'value': '<script>' });
  15582. * // => '<b>&lt;script&gt;</b>'
  15583. *
  15584. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15585. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15586. * compiled({ 'users': ['fred', 'barney'] });
  15587. * // => '<li>fred</li><li>barney</li>'
  15588. *
  15589. * // Use the internal `print` function in "evaluate" delimiters.
  15590. * var compiled = _.template('<% print("hello " + user); %>!');
  15591. * compiled({ 'user': 'barney' });
  15592. * // => 'hello barney!'
  15593. *
  15594. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15595. * // Disable support by replacing the "interpolate" delimiter.
  15596. * var compiled = _.template('hello ${ user }!');
  15597. * compiled({ 'user': 'pebbles' });
  15598. * // => 'hello pebbles!'
  15599. *
  15600. * // Use backslashes to treat delimiters as plain text.
  15601. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15602. * compiled({ 'value': 'ignored' });
  15603. * // => '<%- value %>'
  15604. *
  15605. * // Use the `imports` option to import `jQuery` as `jq`.
  15606. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15607. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15608. * compiled({ 'users': ['fred', 'barney'] });
  15609. * // => '<li>fred</li><li>barney</li>'
  15610. *
  15611. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15612. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15613. * compiled(data);
  15614. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15615. *
  15616. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15617. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15618. * compiled.source;
  15619. * // => function(data) {
  15620. * // var __t, __p = '';
  15621. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15622. * // return __p;
  15623. * // }
  15624. *
  15625. * // Use custom template delimiters.
  15626. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15627. * var compiled = _.template('hello {{ user }}!');
  15628. * compiled({ 'user': 'mustache' });
  15629. * // => 'hello mustache!'
  15630. *
  15631. * // Use the `source` property to inline compiled templates for meaningful
  15632. * // line numbers in error messages and stack traces.
  15633. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15634. * var JST = {\
  15635. * "main": ' + _.template(mainText).source + '\
  15636. * };\
  15637. * ');
  15638. */
  15639. function template(string, options, guard) {
  15640. // Based on John Resig's `tmpl` implementation
  15641. // (http://ejohn.org/blog/javascript-micro-templating/)
  15642. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15643. var settings = lodash.templateSettings;
  15644. if (guard && isIterateeCall(string, options, guard)) {
  15645. options = undefined;
  15646. }
  15647. string = toString(string);
  15648. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15649. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15650. importsKeys = keys(imports),
  15651. importsValues = baseValues(imports, importsKeys);
  15652. var isEscaping,
  15653. isEvaluating,
  15654. index = 0,
  15655. interpolate = options.interpolate || reNoMatch,
  15656. source = "__p += '";
  15657. // Compile the regexp to match each delimiter.
  15658. var reDelimiters = RegExp(
  15659. (options.escape || reNoMatch).source + '|' +
  15660. interpolate.source + '|' +
  15661. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15662. (options.evaluate || reNoMatch).source + '|$'
  15663. , 'g');
  15664. // Use a sourceURL for easier debugging.
  15665. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15666. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15667. // and escape the comment, thus injecting code that gets evaled.
  15668. var sourceURL = '//# sourceURL=' +
  15669. (hasOwnProperty.call(options, 'sourceURL')
  15670. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15671. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15672. ) + '\n';
  15673. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15674. interpolateValue || (interpolateValue = esTemplateValue);
  15675. // Escape characters that can't be included in string literals.
  15676. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15677. // Replace delimiters with snippets.
  15678. if (escapeValue) {
  15679. isEscaping = true;
  15680. source += "' +\n__e(" + escapeValue + ") +\n'";
  15681. }
  15682. if (evaluateValue) {
  15683. isEvaluating = true;
  15684. source += "';\n" + evaluateValue + ";\n__p += '";
  15685. }
  15686. if (interpolateValue) {
  15687. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15688. }
  15689. index = offset + match.length;
  15690. // The JS engine embedded in Adobe products needs `match` returned in
  15691. // order to produce the correct `offset` value.
  15692. return match;
  15693. });
  15694. source += "';\n";
  15695. // If `variable` is not specified wrap a with-statement around the generated
  15696. // code to add the data object to the top of the scope chain.
  15697. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15698. if (!variable) {
  15699. source = 'with (obj) {\n' + source + '\n}\n';
  15700. }
  15701. // Throw an error if a forbidden character was found in `variable`, to prevent
  15702. // potential command injection attacks.
  15703. else if (reForbiddenIdentifierChars.test(variable)) {
  15704. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15705. }
  15706. // Cleanup code by stripping empty strings.
  15707. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15708. .replace(reEmptyStringMiddle, '$1')
  15709. .replace(reEmptyStringTrailing, '$1;');
  15710. // Frame code as the function body.
  15711. source = 'function(' + (variable || 'obj') + ') {\n' +
  15712. (variable
  15713. ? ''
  15714. : 'obj || (obj = {});\n'
  15715. ) +
  15716. "var __t, __p = ''" +
  15717. (isEscaping
  15718. ? ', __e = _.escape'
  15719. : ''
  15720. ) +
  15721. (isEvaluating
  15722. ? ', __j = Array.prototype.join;\n' +
  15723. "function print() { __p += __j.call(arguments, '') }\n"
  15724. : ';\n'
  15725. ) +
  15726. source +
  15727. 'return __p\n}';
  15728. var result = attempt(function() {
  15729. return Function(importsKeys, sourceURL + 'return ' + source)
  15730. .apply(undefined, importsValues);
  15731. });
  15732. // Provide the compiled function's source by its `toString` method or
  15733. // the `source` property as a convenience for inlining compiled templates.
  15734. result.source = source;
  15735. if (isError(result)) {
  15736. throw result;
  15737. }
  15738. return result;
  15739. }
  15740. /**
  15741. * Converts `string`, as a whole, to lower case just like
  15742. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15743. *
  15744. * @static
  15745. * @memberOf _
  15746. * @since 4.0.0
  15747. * @category String
  15748. * @param {string} [string=''] The string to convert.
  15749. * @returns {string} Returns the lower cased string.
  15750. * @example
  15751. *
  15752. * _.toLower('--Foo-Bar--');
  15753. * // => '--foo-bar--'
  15754. *
  15755. * _.toLower('fooBar');
  15756. * // => 'foobar'
  15757. *
  15758. * _.toLower('__FOO_BAR__');
  15759. * // => '__foo_bar__'
  15760. */
  15761. function toLower(value) {
  15762. return toString(value).toLowerCase();
  15763. }
  15764. /**
  15765. * Converts `string`, as a whole, to upper case just like
  15766. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15767. *
  15768. * @static
  15769. * @memberOf _
  15770. * @since 4.0.0
  15771. * @category String
  15772. * @param {string} [string=''] The string to convert.
  15773. * @returns {string} Returns the upper cased string.
  15774. * @example
  15775. *
  15776. * _.toUpper('--foo-bar--');
  15777. * // => '--FOO-BAR--'
  15778. *
  15779. * _.toUpper('fooBar');
  15780. * // => 'FOOBAR'
  15781. *
  15782. * _.toUpper('__foo_bar__');
  15783. * // => '__FOO_BAR__'
  15784. */
  15785. function toUpper(value) {
  15786. return toString(value).toUpperCase();
  15787. }
  15788. /**
  15789. * Removes leading and trailing whitespace or specified characters from `string`.
  15790. *
  15791. * @static
  15792. * @memberOf _
  15793. * @since 3.0.0
  15794. * @category String
  15795. * @param {string} [string=''] The string to trim.
  15796. * @param {string} [chars=whitespace] The characters to trim.
  15797. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15798. * @returns {string} Returns the trimmed string.
  15799. * @example
  15800. *
  15801. * _.trim(' abc ');
  15802. * // => 'abc'
  15803. *
  15804. * _.trim('-_-abc-_-', '_-');
  15805. * // => 'abc'
  15806. *
  15807. * _.map([' foo ', ' bar '], _.trim);
  15808. * // => ['foo', 'bar']
  15809. */
  15810. function trim(string, chars, guard) {
  15811. string = toString(string);
  15812. if (string && (guard || chars === undefined)) {
  15813. return baseTrim(string);
  15814. }
  15815. if (!string || !(chars = baseToString(chars))) {
  15816. return string;
  15817. }
  15818. var strSymbols = stringToArray(string),
  15819. chrSymbols = stringToArray(chars),
  15820. start = charsStartIndex(strSymbols, chrSymbols),
  15821. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15822. return castSlice(strSymbols, start, end).join('');
  15823. }
  15824. /**
  15825. * Removes trailing whitespace or specified characters from `string`.
  15826. *
  15827. * @static
  15828. * @memberOf _
  15829. * @since 4.0.0
  15830. * @category String
  15831. * @param {string} [string=''] The string to trim.
  15832. * @param {string} [chars=whitespace] The characters to trim.
  15833. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15834. * @returns {string} Returns the trimmed string.
  15835. * @example
  15836. *
  15837. * _.trimEnd(' abc ');
  15838. * // => ' abc'
  15839. *
  15840. * _.trimEnd('-_-abc-_-', '_-');
  15841. * // => '-_-abc'
  15842. */
  15843. function trimEnd(string, chars, guard) {
  15844. string = toString(string);
  15845. if (string && (guard || chars === undefined)) {
  15846. return string.slice(0, trimmedEndIndex(string) + 1);
  15847. }
  15848. if (!string || !(chars = baseToString(chars))) {
  15849. return string;
  15850. }
  15851. var strSymbols = stringToArray(string),
  15852. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15853. return castSlice(strSymbols, 0, end).join('');
  15854. }
  15855. /**
  15856. * Removes leading whitespace or specified characters from `string`.
  15857. *
  15858. * @static
  15859. * @memberOf _
  15860. * @since 4.0.0
  15861. * @category String
  15862. * @param {string} [string=''] The string to trim.
  15863. * @param {string} [chars=whitespace] The characters to trim.
  15864. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15865. * @returns {string} Returns the trimmed string.
  15866. * @example
  15867. *
  15868. * _.trimStart(' abc ');
  15869. * // => 'abc '
  15870. *
  15871. * _.trimStart('-_-abc-_-', '_-');
  15872. * // => 'abc-_-'
  15873. */
  15874. function trimStart(string, chars, guard) {
  15875. string = toString(string);
  15876. if (string && (guard || chars === undefined)) {
  15877. return string.replace(reTrimStart, '');
  15878. }
  15879. if (!string || !(chars = baseToString(chars))) {
  15880. return string;
  15881. }
  15882. var strSymbols = stringToArray(string),
  15883. start = charsStartIndex(strSymbols, stringToArray(chars));
  15884. return castSlice(strSymbols, start).join('');
  15885. }
  15886. /**
  15887. * Truncates `string` if it's longer than the given maximum string length.
  15888. * The last characters of the truncated string are replaced with the omission
  15889. * string which defaults to "...".
  15890. *
  15891. * @static
  15892. * @memberOf _
  15893. * @since 4.0.0
  15894. * @category String
  15895. * @param {string} [string=''] The string to truncate.
  15896. * @param {Object} [options={}] The options object.
  15897. * @param {number} [options.length=30] The maximum string length.
  15898. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15899. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15900. * @returns {string} Returns the truncated string.
  15901. * @example
  15902. *
  15903. * _.truncate('hi-diddly-ho there, neighborino');
  15904. * // => 'hi-diddly-ho there, neighbo...'
  15905. *
  15906. * _.truncate('hi-diddly-ho there, neighborino', {
  15907. * 'length': 24,
  15908. * 'separator': ' '
  15909. * });
  15910. * // => 'hi-diddly-ho there,...'
  15911. *
  15912. * _.truncate('hi-diddly-ho there, neighborino', {
  15913. * 'length': 24,
  15914. * 'separator': /,? +/
  15915. * });
  15916. * // => 'hi-diddly-ho there...'
  15917. *
  15918. * _.truncate('hi-diddly-ho there, neighborino', {
  15919. * 'omission': ' [...]'
  15920. * });
  15921. * // => 'hi-diddly-ho there, neig [...]'
  15922. */
  15923. function truncate(string, options) {
  15924. var length = DEFAULT_TRUNC_LENGTH,
  15925. omission = DEFAULT_TRUNC_OMISSION;
  15926. if (isObject(options)) {
  15927. var separator = 'separator' in options ? options.separator : separator;
  15928. length = 'length' in options ? toInteger(options.length) : length;
  15929. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15930. }
  15931. string = toString(string);
  15932. var strLength = string.length;
  15933. if (hasUnicode(string)) {
  15934. var strSymbols = stringToArray(string);
  15935. strLength = strSymbols.length;
  15936. }
  15937. if (length >= strLength) {
  15938. return string;
  15939. }
  15940. var end = length - stringSize(omission);
  15941. if (end < 1) {
  15942. return omission;
  15943. }
  15944. var result = strSymbols
  15945. ? castSlice(strSymbols, 0, end).join('')
  15946. : string.slice(0, end);
  15947. if (separator === undefined) {
  15948. return result + omission;
  15949. }
  15950. if (strSymbols) {
  15951. end += (result.length - end);
  15952. }
  15953. if (isRegExp(separator)) {
  15954. if (string.slice(end).search(separator)) {
  15955. var match,
  15956. substring = result;
  15957. if (!separator.global) {
  15958. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15959. }
  15960. separator.lastIndex = 0;
  15961. while ((match = separator.exec(substring))) {
  15962. var newEnd = match.index;
  15963. }
  15964. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15965. }
  15966. } else if (string.indexOf(baseToString(separator), end) != end) {
  15967. var index = result.lastIndexOf(separator);
  15968. if (index > -1) {
  15969. result = result.slice(0, index);
  15970. }
  15971. }
  15972. return result + omission;
  15973. }
  15974. /**
  15975. * The inverse of `_.escape`; this method converts the HTML entities
  15976. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15977. * their corresponding characters.
  15978. *
  15979. * **Note:** No other HTML entities are unescaped. To unescape additional
  15980. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15981. *
  15982. * @static
  15983. * @memberOf _
  15984. * @since 0.6.0
  15985. * @category String
  15986. * @param {string} [string=''] The string to unescape.
  15987. * @returns {string} Returns the unescaped string.
  15988. * @example
  15989. *
  15990. * _.unescape('fred, barney, &amp; pebbles');
  15991. * // => 'fred, barney, & pebbles'
  15992. */
  15993. function unescape(string) {
  15994. string = toString(string);
  15995. return (string && reHasEscapedHtml.test(string))
  15996. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15997. : string;
  15998. }
  15999. /**
  16000. * Converts `string`, as space separated words, to upper case.
  16001. *
  16002. * @static
  16003. * @memberOf _
  16004. * @since 4.0.0
  16005. * @category String
  16006. * @param {string} [string=''] The string to convert.
  16007. * @returns {string} Returns the upper cased string.
  16008. * @example
  16009. *
  16010. * _.upperCase('--foo-bar');
  16011. * // => 'FOO BAR'
  16012. *
  16013. * _.upperCase('fooBar');
  16014. * // => 'FOO BAR'
  16015. *
  16016. * _.upperCase('__foo_bar__');
  16017. * // => 'FOO BAR'
  16018. */
  16019. var upperCase = createCompounder(function(result, word, index) {
  16020. return result + (index ? ' ' : '') + word.toUpperCase();
  16021. });
  16022. /**
  16023. * Converts the first character of `string` to upper case.
  16024. *
  16025. * @static
  16026. * @memberOf _
  16027. * @since 4.0.0
  16028. * @category String
  16029. * @param {string} [string=''] The string to convert.
  16030. * @returns {string} Returns the converted string.
  16031. * @example
  16032. *
  16033. * _.upperFirst('fred');
  16034. * // => 'Fred'
  16035. *
  16036. * _.upperFirst('FRED');
  16037. * // => 'FRED'
  16038. */
  16039. var upperFirst = createCaseFirst('toUpperCase');
  16040. /**
  16041. * Splits `string` into an array of its words.
  16042. *
  16043. * @static
  16044. * @memberOf _
  16045. * @since 3.0.0
  16046. * @category String
  16047. * @param {string} [string=''] The string to inspect.
  16048. * @param {RegExp|string} [pattern] The pattern to match words.
  16049. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  16050. * @returns {Array} Returns the words of `string`.
  16051. * @example
  16052. *
  16053. * _.words('fred, barney, & pebbles');
  16054. * // => ['fred', 'barney', 'pebbles']
  16055. *
  16056. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  16057. * // => ['fred', 'barney', '&', 'pebbles']
  16058. */
  16059. function words(string, pattern, guard) {
  16060. string = toString(string);
  16061. pattern = guard ? undefined : pattern;
  16062. if (pattern === undefined) {
  16063. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  16064. }
  16065. return string.match(pattern) || [];
  16066. }
  16067. /*------------------------------------------------------------------------*/
  16068. /**
  16069. * Attempts to invoke `func`, returning either the result or the caught error
  16070. * object. Any additional arguments are provided to `func` when it's invoked.
  16071. *
  16072. * @static
  16073. * @memberOf _
  16074. * @since 3.0.0
  16075. * @category Util
  16076. * @param {Function} func The function to attempt.
  16077. * @param {...*} [args] The arguments to invoke `func` with.
  16078. * @returns {*} Returns the `func` result or error object.
  16079. * @example
  16080. *
  16081. * // Avoid throwing errors for invalid selectors.
  16082. * var elements = _.attempt(function(selector) {
  16083. * return document.querySelectorAll(selector);
  16084. * }, '>_>');
  16085. *
  16086. * if (_.isError(elements)) {
  16087. * elements = [];
  16088. * }
  16089. */
  16090. var attempt = baseRest(function(func, args) {
  16091. try {
  16092. return apply(func, undefined, args);
  16093. } catch (e) {
  16094. return isError(e) ? e : new Error(e);
  16095. }
  16096. });
  16097. /**
  16098. * Binds methods of an object to the object itself, overwriting the existing
  16099. * method.
  16100. *
  16101. * **Note:** This method doesn't set the "length" property of bound functions.
  16102. *
  16103. * @static
  16104. * @since 0.1.0
  16105. * @memberOf _
  16106. * @category Util
  16107. * @param {Object} object The object to bind and assign the bound methods to.
  16108. * @param {...(string|string[])} methodNames The object method names to bind.
  16109. * @returns {Object} Returns `object`.
  16110. * @example
  16111. *
  16112. * var view = {
  16113. * 'label': 'docs',
  16114. * 'click': function() {
  16115. * console.log('clicked ' + this.label);
  16116. * }
  16117. * };
  16118. *
  16119. * _.bindAll(view, ['click']);
  16120. * jQuery(element).on('click', view.click);
  16121. * // => Logs 'clicked docs' when clicked.
  16122. */
  16123. var bindAll = flatRest(function(object, methodNames) {
  16124. arrayEach(methodNames, function(key) {
  16125. key = toKey(key);
  16126. baseAssignValue(object, key, bind(object[key], object));
  16127. });
  16128. return object;
  16129. });
  16130. /**
  16131. * Creates a function that iterates over `pairs` and invokes the corresponding
  16132. * function of the first predicate to return truthy. The predicate-function
  16133. * pairs are invoked with the `this` binding and arguments of the created
  16134. * function.
  16135. *
  16136. * @static
  16137. * @memberOf _
  16138. * @since 4.0.0
  16139. * @category Util
  16140. * @param {Array} pairs The predicate-function pairs.
  16141. * @returns {Function} Returns the new composite function.
  16142. * @example
  16143. *
  16144. * var func = _.cond([
  16145. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  16146. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  16147. * [_.stubTrue, _.constant('no match')]
  16148. * ]);
  16149. *
  16150. * func({ 'a': 1, 'b': 2 });
  16151. * // => 'matches A'
  16152. *
  16153. * func({ 'a': 0, 'b': 1 });
  16154. * // => 'matches B'
  16155. *
  16156. * func({ 'a': '1', 'b': '2' });
  16157. * // => 'no match'
  16158. */
  16159. function cond(pairs) {
  16160. var length = pairs == null ? 0 : pairs.length,
  16161. toIteratee = getIteratee();
  16162. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  16163. if (typeof pair[1] != 'function') {
  16164. throw new TypeError(FUNC_ERROR_TEXT);
  16165. }
  16166. return [toIteratee(pair[0]), pair[1]];
  16167. });
  16168. return baseRest(function(args) {
  16169. var index = -1;
  16170. while (++index < length) {
  16171. var pair = pairs[index];
  16172. if (apply(pair[0], this, args)) {
  16173. return apply(pair[1], this, args);
  16174. }
  16175. }
  16176. });
  16177. }
  16178. /**
  16179. * Creates a function that invokes the predicate properties of `source` with
  16180. * the corresponding property values of a given object, returning `true` if
  16181. * all predicates return truthy, else `false`.
  16182. *
  16183. * **Note:** The created function is equivalent to `_.conformsTo` with
  16184. * `source` partially applied.
  16185. *
  16186. * @static
  16187. * @memberOf _
  16188. * @since 4.0.0
  16189. * @category Util
  16190. * @param {Object} source The object of property predicates to conform to.
  16191. * @returns {Function} Returns the new spec function.
  16192. * @example
  16193. *
  16194. * var objects = [
  16195. * { 'a': 2, 'b': 1 },
  16196. * { 'a': 1, 'b': 2 }
  16197. * ];
  16198. *
  16199. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  16200. * // => [{ 'a': 1, 'b': 2 }]
  16201. */
  16202. function conforms(source) {
  16203. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  16204. }
  16205. /**
  16206. * Creates a function that returns `value`.
  16207. *
  16208. * @static
  16209. * @memberOf _
  16210. * @since 2.4.0
  16211. * @category Util
  16212. * @param {*} value The value to return from the new function.
  16213. * @returns {Function} Returns the new constant function.
  16214. * @example
  16215. *
  16216. * var objects = _.times(2, _.constant({ 'a': 1 }));
  16217. *
  16218. * console.log(objects);
  16219. * // => [{ 'a': 1 }, { 'a': 1 }]
  16220. *
  16221. * console.log(objects[0] === objects[1]);
  16222. * // => true
  16223. */
  16224. function constant(value) {
  16225. return function() {
  16226. return value;
  16227. };
  16228. }
  16229. /**
  16230. * Checks `value` to determine whether a default value should be returned in
  16231. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  16232. * or `undefined`.
  16233. *
  16234. * @static
  16235. * @memberOf _
  16236. * @since 4.14.0
  16237. * @category Util
  16238. * @param {*} value The value to check.
  16239. * @param {*} defaultValue The default value.
  16240. * @returns {*} Returns the resolved value.
  16241. * @example
  16242. *
  16243. * _.defaultTo(1, 10);
  16244. * // => 1
  16245. *
  16246. * _.defaultTo(undefined, 10);
  16247. * // => 10
  16248. */
  16249. function defaultTo(value, defaultValue) {
  16250. return (value == null || value !== value) ? defaultValue : value;
  16251. }
  16252. /**
  16253. * Creates a function that returns the result of invoking the given functions
  16254. * with the `this` binding of the created function, where each successive
  16255. * invocation is supplied the return value of the previous.
  16256. *
  16257. * @static
  16258. * @memberOf _
  16259. * @since 3.0.0
  16260. * @category Util
  16261. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  16262. * @returns {Function} Returns the new composite function.
  16263. * @see _.flowRight
  16264. * @example
  16265. *
  16266. * function square(n) {
  16267. * return n * n;
  16268. * }
  16269. *
  16270. * var addSquare = _.flow([_.add, square]);
  16271. * addSquare(1, 2);
  16272. * // => 9
  16273. */
  16274. var flow = createFlow();
  16275. /**
  16276. * This method is like `_.flow` except that it creates a function that
  16277. * invokes the given functions from right to left.
  16278. *
  16279. * @static
  16280. * @since 3.0.0
  16281. * @memberOf _
  16282. * @category Util
  16283. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  16284. * @returns {Function} Returns the new composite function.
  16285. * @see _.flow
  16286. * @example
  16287. *
  16288. * function square(n) {
  16289. * return n * n;
  16290. * }
  16291. *
  16292. * var addSquare = _.flowRight([square, _.add]);
  16293. * addSquare(1, 2);
  16294. * // => 9
  16295. */
  16296. var flowRight = createFlow(true);
  16297. /**
  16298. * This method returns the first argument it receives.
  16299. *
  16300. * @static
  16301. * @since 0.1.0
  16302. * @memberOf _
  16303. * @category Util
  16304. * @param {*} value Any value.
  16305. * @returns {*} Returns `value`.
  16306. * @example
  16307. *
  16308. * var object = { 'a': 1 };
  16309. *
  16310. * console.log(_.identity(object) === object);
  16311. * // => true
  16312. */
  16313. function identity(value) {
  16314. return value;
  16315. }
  16316. /**
  16317. * Creates a function that invokes `func` with the arguments of the created
  16318. * function. If `func` is a property name, the created function returns the
  16319. * property value for a given element. If `func` is an array or object, the
  16320. * created function returns `true` for elements that contain the equivalent
  16321. * source properties, otherwise it returns `false`.
  16322. *
  16323. * @static
  16324. * @since 4.0.0
  16325. * @memberOf _
  16326. * @category Util
  16327. * @param {*} [func=_.identity] The value to convert to a callback.
  16328. * @returns {Function} Returns the callback.
  16329. * @example
  16330. *
  16331. * var users = [
  16332. * { 'user': 'barney', 'age': 36, 'active': true },
  16333. * { 'user': 'fred', 'age': 40, 'active': false }
  16334. * ];
  16335. *
  16336. * // The `_.matches` iteratee shorthand.
  16337. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  16338. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  16339. *
  16340. * // The `_.matchesProperty` iteratee shorthand.
  16341. * _.filter(users, _.iteratee(['user', 'fred']));
  16342. * // => [{ 'user': 'fred', 'age': 40 }]
  16343. *
  16344. * // The `_.property` iteratee shorthand.
  16345. * _.map(users, _.iteratee('user'));
  16346. * // => ['barney', 'fred']
  16347. *
  16348. * // Create custom iteratee shorthands.
  16349. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  16350. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  16351. * return func.test(string);
  16352. * };
  16353. * });
  16354. *
  16355. * _.filter(['abc', 'def'], /ef/);
  16356. * // => ['def']
  16357. */
  16358. function iteratee(func) {
  16359. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  16360. }
  16361. /**
  16362. * Creates a function that performs a partial deep comparison between a given
  16363. * object and `source`, returning `true` if the given object has equivalent
  16364. * property values, else `false`.
  16365. *
  16366. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  16367. * partially applied.
  16368. *
  16369. * Partial comparisons will match empty array and empty object `source`
  16370. * values against any array or object value, respectively. See `_.isEqual`
  16371. * for a list of supported value comparisons.
  16372. *
  16373. * **Note:** Multiple values can be checked by combining several matchers
  16374. * using `_.overSome`
  16375. *
  16376. * @static
  16377. * @memberOf _
  16378. * @since 3.0.0
  16379. * @category Util
  16380. * @param {Object} source The object of property values to match.
  16381. * @returns {Function} Returns the new spec function.
  16382. * @example
  16383. *
  16384. * var objects = [
  16385. * { 'a': 1, 'b': 2, 'c': 3 },
  16386. * { 'a': 4, 'b': 5, 'c': 6 }
  16387. * ];
  16388. *
  16389. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  16390. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  16391. *
  16392. * // Checking for several possible values
  16393. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  16394. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16395. */
  16396. function matches(source) {
  16397. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  16398. }
  16399. /**
  16400. * Creates a function that performs a partial deep comparison between the
  16401. * value at `path` of a given object to `srcValue`, returning `true` if the
  16402. * object value is equivalent, else `false`.
  16403. *
  16404. * **Note:** Partial comparisons will match empty array and empty object
  16405. * `srcValue` values against any array or object value, respectively. See
  16406. * `_.isEqual` for a list of supported value comparisons.
  16407. *
  16408. * **Note:** Multiple values can be checked by combining several matchers
  16409. * using `_.overSome`
  16410. *
  16411. * @static
  16412. * @memberOf _
  16413. * @since 3.2.0
  16414. * @category Util
  16415. * @param {Array|string} path The path of the property to get.
  16416. * @param {*} srcValue The value to match.
  16417. * @returns {Function} Returns the new spec function.
  16418. * @example
  16419. *
  16420. * var objects = [
  16421. * { 'a': 1, 'b': 2, 'c': 3 },
  16422. * { 'a': 4, 'b': 5, 'c': 6 }
  16423. * ];
  16424. *
  16425. * _.find(objects, _.matchesProperty('a', 4));
  16426. * // => { 'a': 4, 'b': 5, 'c': 6 }
  16427. *
  16428. * // Checking for several possible values
  16429. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  16430. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16431. */
  16432. function matchesProperty(path, srcValue) {
  16433. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  16434. }
  16435. /**
  16436. * Creates a function that invokes the method at `path` of a given object.
  16437. * Any additional arguments are provided to the invoked method.
  16438. *
  16439. * @static
  16440. * @memberOf _
  16441. * @since 3.7.0
  16442. * @category Util
  16443. * @param {Array|string} path The path of the method to invoke.
  16444. * @param {...*} [args] The arguments to invoke the method with.
  16445. * @returns {Function} Returns the new invoker function.
  16446. * @example
  16447. *
  16448. * var objects = [
  16449. * { 'a': { 'b': _.constant(2) } },
  16450. * { 'a': { 'b': _.constant(1) } }
  16451. * ];
  16452. *
  16453. * _.map(objects, _.method('a.b'));
  16454. * // => [2, 1]
  16455. *
  16456. * _.map(objects, _.method(['a', 'b']));
  16457. * // => [2, 1]
  16458. */
  16459. var method = baseRest(function(path, args) {
  16460. return function(object) {
  16461. return baseInvoke(object, path, args);
  16462. };
  16463. });
  16464. /**
  16465. * The opposite of `_.method`; this method creates a function that invokes
  16466. * the method at a given path of `object`. Any additional arguments are
  16467. * provided to the invoked method.
  16468. *
  16469. * @static
  16470. * @memberOf _
  16471. * @since 3.7.0
  16472. * @category Util
  16473. * @param {Object} object The object to query.
  16474. * @param {...*} [args] The arguments to invoke the method with.
  16475. * @returns {Function} Returns the new invoker function.
  16476. * @example
  16477. *
  16478. * var array = _.times(3, _.constant),
  16479. * object = { 'a': array, 'b': array, 'c': array };
  16480. *
  16481. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  16482. * // => [2, 0]
  16483. *
  16484. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  16485. * // => [2, 0]
  16486. */
  16487. var methodOf = baseRest(function(object, args) {
  16488. return function(path) {
  16489. return baseInvoke(object, path, args);
  16490. };
  16491. });
  16492. /**
  16493. * Adds all own enumerable string keyed function properties of a source
  16494. * object to the destination object. If `object` is a function, then methods
  16495. * are added to its prototype as well.
  16496. *
  16497. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16498. * avoid conflicts caused by modifying the original.
  16499. *
  16500. * @static
  16501. * @since 0.1.0
  16502. * @memberOf _
  16503. * @category Util
  16504. * @param {Function|Object} [object=lodash] The destination object.
  16505. * @param {Object} source The object of functions to add.
  16506. * @param {Object} [options={}] The options object.
  16507. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16508. * @returns {Function|Object} Returns `object`.
  16509. * @example
  16510. *
  16511. * function vowels(string) {
  16512. * return _.filter(string, function(v) {
  16513. * return /[aeiou]/i.test(v);
  16514. * });
  16515. * }
  16516. *
  16517. * _.mixin({ 'vowels': vowels });
  16518. * _.vowels('fred');
  16519. * // => ['e']
  16520. *
  16521. * _('fred').vowels().value();
  16522. * // => ['e']
  16523. *
  16524. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16525. * _('fred').vowels();
  16526. * // => ['e']
  16527. */
  16528. function mixin(object, source, options) {
  16529. var props = keys(source),
  16530. methodNames = baseFunctions(source, props);
  16531. if (options == null &&
  16532. !(isObject(source) && (methodNames.length || !props.length))) {
  16533. options = source;
  16534. source = object;
  16535. object = this;
  16536. methodNames = baseFunctions(source, keys(source));
  16537. }
  16538. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16539. isFunc = isFunction(object);
  16540. arrayEach(methodNames, function(methodName) {
  16541. var func = source[methodName];
  16542. object[methodName] = func;
  16543. if (isFunc) {
  16544. object.prototype[methodName] = function() {
  16545. var chainAll = this.__chain__;
  16546. if (chain || chainAll) {
  16547. var result = object(this.__wrapped__),
  16548. actions = result.__actions__ = copyArray(this.__actions__);
  16549. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16550. result.__chain__ = chainAll;
  16551. return result;
  16552. }
  16553. return func.apply(object, arrayPush([this.value()], arguments));
  16554. };
  16555. }
  16556. });
  16557. return object;
  16558. }
  16559. /**
  16560. * Reverts the `_` variable to its previous value and returns a reference to
  16561. * the `lodash` function.
  16562. *
  16563. * @static
  16564. * @since 0.1.0
  16565. * @memberOf _
  16566. * @category Util
  16567. * @returns {Function} Returns the `lodash` function.
  16568. * @example
  16569. *
  16570. * var lodash = _.noConflict();
  16571. */
  16572. function noConflict() {
  16573. if (root._ === this) {
  16574. root._ = oldDash;
  16575. }
  16576. return this;
  16577. }
  16578. /**
  16579. * This method returns `undefined`.
  16580. *
  16581. * @static
  16582. * @memberOf _
  16583. * @since 2.3.0
  16584. * @category Util
  16585. * @example
  16586. *
  16587. * _.times(2, _.noop);
  16588. * // => [undefined, undefined]
  16589. */
  16590. function noop() {
  16591. // No operation performed.
  16592. }
  16593. /**
  16594. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16595. * the nth argument from the end is returned.
  16596. *
  16597. * @static
  16598. * @memberOf _
  16599. * @since 4.0.0
  16600. * @category Util
  16601. * @param {number} [n=0] The index of the argument to return.
  16602. * @returns {Function} Returns the new pass-thru function.
  16603. * @example
  16604. *
  16605. * var func = _.nthArg(1);
  16606. * func('a', 'b', 'c', 'd');
  16607. * // => 'b'
  16608. *
  16609. * var func = _.nthArg(-2);
  16610. * func('a', 'b', 'c', 'd');
  16611. * // => 'c'
  16612. */
  16613. function nthArg(n) {
  16614. n = toInteger(n);
  16615. return baseRest(function(args) {
  16616. return baseNth(args, n);
  16617. });
  16618. }
  16619. /**
  16620. * Creates a function that invokes `iteratees` with the arguments it receives
  16621. * and returns their results.
  16622. *
  16623. * @static
  16624. * @memberOf _
  16625. * @since 4.0.0
  16626. * @category Util
  16627. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16628. * The iteratees to invoke.
  16629. * @returns {Function} Returns the new function.
  16630. * @example
  16631. *
  16632. * var func = _.over([Math.max, Math.min]);
  16633. *
  16634. * func(1, 2, 3, 4);
  16635. * // => [4, 1]
  16636. */
  16637. var over = createOver(arrayMap);
  16638. /**
  16639. * Creates a function that checks if **all** of the `predicates` return
  16640. * truthy when invoked with the arguments it receives.
  16641. *
  16642. * Following shorthands are possible for providing predicates.
  16643. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16644. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16645. *
  16646. * @static
  16647. * @memberOf _
  16648. * @since 4.0.0
  16649. * @category Util
  16650. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16651. * The predicates to check.
  16652. * @returns {Function} Returns the new function.
  16653. * @example
  16654. *
  16655. * var func = _.overEvery([Boolean, isFinite]);
  16656. *
  16657. * func('1');
  16658. * // => true
  16659. *
  16660. * func(null);
  16661. * // => false
  16662. *
  16663. * func(NaN);
  16664. * // => false
  16665. */
  16666. var overEvery = createOver(arrayEvery);
  16667. /**
  16668. * Creates a function that checks if **any** of the `predicates` return
  16669. * truthy when invoked with the arguments it receives.
  16670. *
  16671. * Following shorthands are possible for providing predicates.
  16672. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16673. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16674. *
  16675. * @static
  16676. * @memberOf _
  16677. * @since 4.0.0
  16678. * @category Util
  16679. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16680. * The predicates to check.
  16681. * @returns {Function} Returns the new function.
  16682. * @example
  16683. *
  16684. * var func = _.overSome([Boolean, isFinite]);
  16685. *
  16686. * func('1');
  16687. * // => true
  16688. *
  16689. * func(null);
  16690. * // => true
  16691. *
  16692. * func(NaN);
  16693. * // => false
  16694. *
  16695. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16696. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16697. */
  16698. var overSome = createOver(arraySome);
  16699. /**
  16700. * Creates a function that returns the value at `path` of a given object.
  16701. *
  16702. * @static
  16703. * @memberOf _
  16704. * @since 2.4.0
  16705. * @category Util
  16706. * @param {Array|string} path The path of the property to get.
  16707. * @returns {Function} Returns the new accessor function.
  16708. * @example
  16709. *
  16710. * var objects = [
  16711. * { 'a': { 'b': 2 } },
  16712. * { 'a': { 'b': 1 } }
  16713. * ];
  16714. *
  16715. * _.map(objects, _.property('a.b'));
  16716. * // => [2, 1]
  16717. *
  16718. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16719. * // => [1, 2]
  16720. */
  16721. function property(path) {
  16722. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16723. }
  16724. /**
  16725. * The opposite of `_.property`; this method creates a function that returns
  16726. * the value at a given path of `object`.
  16727. *
  16728. * @static
  16729. * @memberOf _
  16730. * @since 3.0.0
  16731. * @category Util
  16732. * @param {Object} object The object to query.
  16733. * @returns {Function} Returns the new accessor function.
  16734. * @example
  16735. *
  16736. * var array = [0, 1, 2],
  16737. * object = { 'a': array, 'b': array, 'c': array };
  16738. *
  16739. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16740. * // => [2, 0]
  16741. *
  16742. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16743. * // => [2, 0]
  16744. */
  16745. function propertyOf(object) {
  16746. return function(path) {
  16747. return object == null ? undefined : baseGet(object, path);
  16748. };
  16749. }
  16750. /**
  16751. * Creates an array of numbers (positive and/or negative) progressing from
  16752. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16753. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16754. * it's set to `start` with `start` then set to `0`.
  16755. *
  16756. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16757. * floating-point values which can produce unexpected results.
  16758. *
  16759. * @static
  16760. * @since 0.1.0
  16761. * @memberOf _
  16762. * @category Util
  16763. * @param {number} [start=0] The start of the range.
  16764. * @param {number} end The end of the range.
  16765. * @param {number} [step=1] The value to increment or decrement by.
  16766. * @returns {Array} Returns the range of numbers.
  16767. * @see _.inRange, _.rangeRight
  16768. * @example
  16769. *
  16770. * _.range(4);
  16771. * // => [0, 1, 2, 3]
  16772. *
  16773. * _.range(-4);
  16774. * // => [0, -1, -2, -3]
  16775. *
  16776. * _.range(1, 5);
  16777. * // => [1, 2, 3, 4]
  16778. *
  16779. * _.range(0, 20, 5);
  16780. * // => [0, 5, 10, 15]
  16781. *
  16782. * _.range(0, -4, -1);
  16783. * // => [0, -1, -2, -3]
  16784. *
  16785. * _.range(1, 4, 0);
  16786. * // => [1, 1, 1]
  16787. *
  16788. * _.range(0);
  16789. * // => []
  16790. */
  16791. var range = createRange();
  16792. /**
  16793. * This method is like `_.range` except that it populates values in
  16794. * descending order.
  16795. *
  16796. * @static
  16797. * @memberOf _
  16798. * @since 4.0.0
  16799. * @category Util
  16800. * @param {number} [start=0] The start of the range.
  16801. * @param {number} end The end of the range.
  16802. * @param {number} [step=1] The value to increment or decrement by.
  16803. * @returns {Array} Returns the range of numbers.
  16804. * @see _.inRange, _.range
  16805. * @example
  16806. *
  16807. * _.rangeRight(4);
  16808. * // => [3, 2, 1, 0]
  16809. *
  16810. * _.rangeRight(-4);
  16811. * // => [-3, -2, -1, 0]
  16812. *
  16813. * _.rangeRight(1, 5);
  16814. * // => [4, 3, 2, 1]
  16815. *
  16816. * _.rangeRight(0, 20, 5);
  16817. * // => [15, 10, 5, 0]
  16818. *
  16819. * _.rangeRight(0, -4, -1);
  16820. * // => [-3, -2, -1, 0]
  16821. *
  16822. * _.rangeRight(1, 4, 0);
  16823. * // => [1, 1, 1]
  16824. *
  16825. * _.rangeRight(0);
  16826. * // => []
  16827. */
  16828. var rangeRight = createRange(true);
  16829. /**
  16830. * This method returns a new empty array.
  16831. *
  16832. * @static
  16833. * @memberOf _
  16834. * @since 4.13.0
  16835. * @category Util
  16836. * @returns {Array} Returns the new empty array.
  16837. * @example
  16838. *
  16839. * var arrays = _.times(2, _.stubArray);
  16840. *
  16841. * console.log(arrays);
  16842. * // => [[], []]
  16843. *
  16844. * console.log(arrays[0] === arrays[1]);
  16845. * // => false
  16846. */
  16847. function stubArray() {
  16848. return [];
  16849. }
  16850. /**
  16851. * This method returns `false`.
  16852. *
  16853. * @static
  16854. * @memberOf _
  16855. * @since 4.13.0
  16856. * @category Util
  16857. * @returns {boolean} Returns `false`.
  16858. * @example
  16859. *
  16860. * _.times(2, _.stubFalse);
  16861. * // => [false, false]
  16862. */
  16863. function stubFalse() {
  16864. return false;
  16865. }
  16866. /**
  16867. * This method returns a new empty object.
  16868. *
  16869. * @static
  16870. * @memberOf _
  16871. * @since 4.13.0
  16872. * @category Util
  16873. * @returns {Object} Returns the new empty object.
  16874. * @example
  16875. *
  16876. * var objects = _.times(2, _.stubObject);
  16877. *
  16878. * console.log(objects);
  16879. * // => [{}, {}]
  16880. *
  16881. * console.log(objects[0] === objects[1]);
  16882. * // => false
  16883. */
  16884. function stubObject() {
  16885. return {};
  16886. }
  16887. /**
  16888. * This method returns an empty string.
  16889. *
  16890. * @static
  16891. * @memberOf _
  16892. * @since 4.13.0
  16893. * @category Util
  16894. * @returns {string} Returns the empty string.
  16895. * @example
  16896. *
  16897. * _.times(2, _.stubString);
  16898. * // => ['', '']
  16899. */
  16900. function stubString() {
  16901. return '';
  16902. }
  16903. /**
  16904. * This method returns `true`.
  16905. *
  16906. * @static
  16907. * @memberOf _
  16908. * @since 4.13.0
  16909. * @category Util
  16910. * @returns {boolean} Returns `true`.
  16911. * @example
  16912. *
  16913. * _.times(2, _.stubTrue);
  16914. * // => [true, true]
  16915. */
  16916. function stubTrue() {
  16917. return true;
  16918. }
  16919. /**
  16920. * Invokes the iteratee `n` times, returning an array of the results of
  16921. * each invocation. The iteratee is invoked with one argument; (index).
  16922. *
  16923. * @static
  16924. * @since 0.1.0
  16925. * @memberOf _
  16926. * @category Util
  16927. * @param {number} n The number of times to invoke `iteratee`.
  16928. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16929. * @returns {Array} Returns the array of results.
  16930. * @example
  16931. *
  16932. * _.times(3, String);
  16933. * // => ['0', '1', '2']
  16934. *
  16935. * _.times(4, _.constant(0));
  16936. * // => [0, 0, 0, 0]
  16937. */
  16938. function times(n, iteratee) {
  16939. n = toInteger(n);
  16940. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16941. return [];
  16942. }
  16943. var index = MAX_ARRAY_LENGTH,
  16944. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16945. iteratee = getIteratee(iteratee);
  16946. n -= MAX_ARRAY_LENGTH;
  16947. var result = baseTimes(length, iteratee);
  16948. while (++index < n) {
  16949. iteratee(index);
  16950. }
  16951. return result;
  16952. }
  16953. /**
  16954. * Converts `value` to a property path array.
  16955. *
  16956. * @static
  16957. * @memberOf _
  16958. * @since 4.0.0
  16959. * @category Util
  16960. * @param {*} value The value to convert.
  16961. * @returns {Array} Returns the new property path array.
  16962. * @example
  16963. *
  16964. * _.toPath('a.b.c');
  16965. * // => ['a', 'b', 'c']
  16966. *
  16967. * _.toPath('a[0].b.c');
  16968. * // => ['a', '0', 'b', 'c']
  16969. */
  16970. function toPath(value) {
  16971. if (isArray(value)) {
  16972. return arrayMap(value, toKey);
  16973. }
  16974. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16975. }
  16976. /**
  16977. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16978. *
  16979. * @static
  16980. * @since 0.1.0
  16981. * @memberOf _
  16982. * @category Util
  16983. * @param {string} [prefix=''] The value to prefix the ID with.
  16984. * @returns {string} Returns the unique ID.
  16985. * @example
  16986. *
  16987. * _.uniqueId('contact_');
  16988. * // => 'contact_104'
  16989. *
  16990. * _.uniqueId();
  16991. * // => '105'
  16992. */
  16993. function uniqueId(prefix) {
  16994. var id = ++idCounter;
  16995. return toString(prefix) + id;
  16996. }
  16997. /*------------------------------------------------------------------------*/
  16998. /**
  16999. * Adds two numbers.
  17000. *
  17001. * @static
  17002. * @memberOf _
  17003. * @since 3.4.0
  17004. * @category Math
  17005. * @param {number} augend The first number in an addition.
  17006. * @param {number} addend The second number in an addition.
  17007. * @returns {number} Returns the total.
  17008. * @example
  17009. *
  17010. * _.add(6, 4);
  17011. * // => 10
  17012. */
  17013. var add = createMathOperation(function(augend, addend) {
  17014. return augend + addend;
  17015. }, 0);
  17016. /**
  17017. * Computes `number` rounded up to `precision`.
  17018. *
  17019. * @static
  17020. * @memberOf _
  17021. * @since 3.10.0
  17022. * @category Math
  17023. * @param {number} number The number to round up.
  17024. * @param {number} [precision=0] The precision to round up to.
  17025. * @returns {number} Returns the rounded up number.
  17026. * @example
  17027. *
  17028. * _.ceil(4.006);
  17029. * // => 5
  17030. *
  17031. * _.ceil(6.004, 2);
  17032. * // => 6.01
  17033. *
  17034. * _.ceil(6040, -2);
  17035. * // => 6100
  17036. */
  17037. var ceil = createRound('ceil');
  17038. /**
  17039. * Divide two numbers.
  17040. *
  17041. * @static
  17042. * @memberOf _
  17043. * @since 4.7.0
  17044. * @category Math
  17045. * @param {number} dividend The first number in a division.
  17046. * @param {number} divisor The second number in a division.
  17047. * @returns {number} Returns the quotient.
  17048. * @example
  17049. *
  17050. * _.divide(6, 4);
  17051. * // => 1.5
  17052. */
  17053. var divide = createMathOperation(function(dividend, divisor) {
  17054. return dividend / divisor;
  17055. }, 1);
  17056. /**
  17057. * Computes `number` rounded down to `precision`.
  17058. *
  17059. * @static
  17060. * @memberOf _
  17061. * @since 3.10.0
  17062. * @category Math
  17063. * @param {number} number The number to round down.
  17064. * @param {number} [precision=0] The precision to round down to.
  17065. * @returns {number} Returns the rounded down number.
  17066. * @example
  17067. *
  17068. * _.floor(4.006);
  17069. * // => 4
  17070. *
  17071. * _.floor(0.046, 2);
  17072. * // => 0.04
  17073. *
  17074. * _.floor(4060, -2);
  17075. * // => 4000
  17076. */
  17077. var floor = createRound('floor');
  17078. /**
  17079. * Computes the maximum value of `array`. If `array` is empty or falsey,
  17080. * `undefined` is returned.
  17081. *
  17082. * @static
  17083. * @since 0.1.0
  17084. * @memberOf _
  17085. * @category Math
  17086. * @param {Array} array The array to iterate over.
  17087. * @returns {*} Returns the maximum value.
  17088. * @example
  17089. *
  17090. * _.max([4, 2, 8, 6]);
  17091. * // => 8
  17092. *
  17093. * _.max([]);
  17094. * // => undefined
  17095. */
  17096. function max(array) {
  17097. return (array && array.length)
  17098. ? baseExtremum(array, identity, baseGt)
  17099. : undefined;
  17100. }
  17101. /**
  17102. * This method is like `_.max` except that it accepts `iteratee` which is
  17103. * invoked for each element in `array` to generate the criterion by which
  17104. * the value is ranked. The iteratee is invoked with one argument: (value).
  17105. *
  17106. * @static
  17107. * @memberOf _
  17108. * @since 4.0.0
  17109. * @category Math
  17110. * @param {Array} array The array to iterate over.
  17111. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17112. * @returns {*} Returns the maximum value.
  17113. * @example
  17114. *
  17115. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  17116. *
  17117. * _.maxBy(objects, function(o) { return o.n; });
  17118. * // => { 'n': 2 }
  17119. *
  17120. * // The `_.property` iteratee shorthand.
  17121. * _.maxBy(objects, 'n');
  17122. * // => { 'n': 2 }
  17123. */
  17124. function maxBy(array, iteratee) {
  17125. return (array && array.length)
  17126. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  17127. : undefined;
  17128. }
  17129. /**
  17130. * Computes the mean of the values in `array`.
  17131. *
  17132. * @static
  17133. * @memberOf _
  17134. * @since 4.0.0
  17135. * @category Math
  17136. * @param {Array} array The array to iterate over.
  17137. * @returns {number} Returns the mean.
  17138. * @example
  17139. *
  17140. * _.mean([4, 2, 8, 6]);
  17141. * // => 5
  17142. */
  17143. function mean(array) {
  17144. return baseMean(array, identity);
  17145. }
  17146. /**
  17147. * This method is like `_.mean` except that it accepts `iteratee` which is
  17148. * invoked for each element in `array` to generate the value to be averaged.
  17149. * The iteratee is invoked with one argument: (value).
  17150. *
  17151. * @static
  17152. * @memberOf _
  17153. * @since 4.7.0
  17154. * @category Math
  17155. * @param {Array} array The array to iterate over.
  17156. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17157. * @returns {number} Returns the mean.
  17158. * @example
  17159. *
  17160. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  17161. *
  17162. * _.meanBy(objects, function(o) { return o.n; });
  17163. * // => 5
  17164. *
  17165. * // The `_.property` iteratee shorthand.
  17166. * _.meanBy(objects, 'n');
  17167. * // => 5
  17168. */
  17169. function meanBy(array, iteratee) {
  17170. return baseMean(array, getIteratee(iteratee, 2));
  17171. }
  17172. /**
  17173. * Computes the minimum value of `array`. If `array` is empty or falsey,
  17174. * `undefined` is returned.
  17175. *
  17176. * @static
  17177. * @since 0.1.0
  17178. * @memberOf _
  17179. * @category Math
  17180. * @param {Array} array The array to iterate over.
  17181. * @returns {*} Returns the minimum value.
  17182. * @example
  17183. *
  17184. * _.min([4, 2, 8, 6]);
  17185. * // => 2
  17186. *
  17187. * _.min([]);
  17188. * // => undefined
  17189. */
  17190. function min(array) {
  17191. return (array && array.length)
  17192. ? baseExtremum(array, identity, baseLt)
  17193. : undefined;
  17194. }
  17195. /**
  17196. * This method is like `_.min` except that it accepts `iteratee` which is
  17197. * invoked for each element in `array` to generate the criterion by which
  17198. * the value is ranked. The iteratee is invoked with one argument: (value).
  17199. *
  17200. * @static
  17201. * @memberOf _
  17202. * @since 4.0.0
  17203. * @category Math
  17204. * @param {Array} array The array to iterate over.
  17205. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17206. * @returns {*} Returns the minimum value.
  17207. * @example
  17208. *
  17209. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  17210. *
  17211. * _.minBy(objects, function(o) { return o.n; });
  17212. * // => { 'n': 1 }
  17213. *
  17214. * // The `_.property` iteratee shorthand.
  17215. * _.minBy(objects, 'n');
  17216. * // => { 'n': 1 }
  17217. */
  17218. function minBy(array, iteratee) {
  17219. return (array && array.length)
  17220. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  17221. : undefined;
  17222. }
  17223. /**
  17224. * Multiply two numbers.
  17225. *
  17226. * @static
  17227. * @memberOf _
  17228. * @since 4.7.0
  17229. * @category Math
  17230. * @param {number} multiplier The first number in a multiplication.
  17231. * @param {number} multiplicand The second number in a multiplication.
  17232. * @returns {number} Returns the product.
  17233. * @example
  17234. *
  17235. * _.multiply(6, 4);
  17236. * // => 24
  17237. */
  17238. var multiply = createMathOperation(function(multiplier, multiplicand) {
  17239. return multiplier * multiplicand;
  17240. }, 1);
  17241. /**
  17242. * Computes `number` rounded to `precision`.
  17243. *
  17244. * @static
  17245. * @memberOf _
  17246. * @since 3.10.0
  17247. * @category Math
  17248. * @param {number} number The number to round.
  17249. * @param {number} [precision=0] The precision to round to.
  17250. * @returns {number} Returns the rounded number.
  17251. * @example
  17252. *
  17253. * _.round(4.006);
  17254. * // => 4
  17255. *
  17256. * _.round(4.006, 2);
  17257. * // => 4.01
  17258. *
  17259. * _.round(4060, -2);
  17260. * // => 4100
  17261. */
  17262. var round = createRound('round');
  17263. /**
  17264. * Subtract two numbers.
  17265. *
  17266. * @static
  17267. * @memberOf _
  17268. * @since 4.0.0
  17269. * @category Math
  17270. * @param {number} minuend The first number in a subtraction.
  17271. * @param {number} subtrahend The second number in a subtraction.
  17272. * @returns {number} Returns the difference.
  17273. * @example
  17274. *
  17275. * _.subtract(6, 4);
  17276. * // => 2
  17277. */
  17278. var subtract = createMathOperation(function(minuend, subtrahend) {
  17279. return minuend - subtrahend;
  17280. }, 0);
  17281. /**
  17282. * Computes the sum of the values in `array`.
  17283. *
  17284. * @static
  17285. * @memberOf _
  17286. * @since 3.4.0
  17287. * @category Math
  17288. * @param {Array} array The array to iterate over.
  17289. * @returns {number} Returns the sum.
  17290. * @example
  17291. *
  17292. * _.sum([4, 2, 8, 6]);
  17293. * // => 20
  17294. */
  17295. function sum(array) {
  17296. return (array && array.length)
  17297. ? baseSum(array, identity)
  17298. : 0;
  17299. }
  17300. /**
  17301. * This method is like `_.sum` except that it accepts `iteratee` which is
  17302. * invoked for each element in `array` to generate the value to be summed.
  17303. * The iteratee is invoked with one argument: (value).
  17304. *
  17305. * @static
  17306. * @memberOf _
  17307. * @since 4.0.0
  17308. * @category Math
  17309. * @param {Array} array The array to iterate over.
  17310. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  17311. * @returns {number} Returns the sum.
  17312. * @example
  17313. *
  17314. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  17315. *
  17316. * _.sumBy(objects, function(o) { return o.n; });
  17317. * // => 20
  17318. *
  17319. * // The `_.property` iteratee shorthand.
  17320. * _.sumBy(objects, 'n');
  17321. * // => 20
  17322. */
  17323. function sumBy(array, iteratee) {
  17324. return (array && array.length)
  17325. ? baseSum(array, getIteratee(iteratee, 2))
  17326. : 0;
  17327. }
  17328. /*------------------------------------------------------------------------*/
  17329. // Add methods that return wrapped values in chain sequences.
  17330. lodash.after = after;
  17331. lodash.ary = ary;
  17332. lodash.assign = assign;
  17333. lodash.assignIn = assignIn;
  17334. lodash.assignInWith = assignInWith;
  17335. lodash.assignWith = assignWith;
  17336. lodash.at = at;
  17337. lodash.before = before;
  17338. lodash.bind = bind;
  17339. lodash.bindAll = bindAll;
  17340. lodash.bindKey = bindKey;
  17341. lodash.castArray = castArray;
  17342. lodash.chain = chain;
  17343. lodash.chunk = chunk;
  17344. lodash.compact = compact;
  17345. lodash.concat = concat;
  17346. lodash.cond = cond;
  17347. lodash.conforms = conforms;
  17348. lodash.constant = constant;
  17349. lodash.countBy = countBy;
  17350. lodash.create = create;
  17351. lodash.curry = curry;
  17352. lodash.curryRight = curryRight;
  17353. lodash.debounce = debounce;
  17354. lodash.defaults = defaults;
  17355. lodash.defaultsDeep = defaultsDeep;
  17356. lodash.defer = defer;
  17357. lodash.delay = delay;
  17358. lodash.difference = difference;
  17359. lodash.differenceBy = differenceBy;
  17360. lodash.differenceWith = differenceWith;
  17361. lodash.drop = drop;
  17362. lodash.dropRight = dropRight;
  17363. lodash.dropRightWhile = dropRightWhile;
  17364. lodash.dropWhile = dropWhile;
  17365. lodash.fill = fill;
  17366. lodash.filter = filter;
  17367. lodash.flatMap = flatMap;
  17368. lodash.flatMapDeep = flatMapDeep;
  17369. lodash.flatMapDepth = flatMapDepth;
  17370. lodash.flatten = flatten;
  17371. lodash.flattenDeep = flattenDeep;
  17372. lodash.flattenDepth = flattenDepth;
  17373. lodash.flip = flip;
  17374. lodash.flow = flow;
  17375. lodash.flowRight = flowRight;
  17376. lodash.fromPairs = fromPairs;
  17377. lodash.functions = functions;
  17378. lodash.functionsIn = functionsIn;
  17379. lodash.groupBy = groupBy;
  17380. lodash.initial = initial;
  17381. lodash.intersection = intersection;
  17382. lodash.intersectionBy = intersectionBy;
  17383. lodash.intersectionWith = intersectionWith;
  17384. lodash.invert = invert;
  17385. lodash.invertBy = invertBy;
  17386. lodash.invokeMap = invokeMap;
  17387. lodash.iteratee = iteratee;
  17388. lodash.keyBy = keyBy;
  17389. lodash.keys = keys;
  17390. lodash.keysIn = keysIn;
  17391. lodash.map = map;
  17392. lodash.mapKeys = mapKeys;
  17393. lodash.mapValues = mapValues;
  17394. lodash.matches = matches;
  17395. lodash.matchesProperty = matchesProperty;
  17396. lodash.memoize = memoize;
  17397. lodash.merge = merge;
  17398. lodash.mergeWith = mergeWith;
  17399. lodash.method = method;
  17400. lodash.methodOf = methodOf;
  17401. lodash.mixin = mixin;
  17402. lodash.negate = negate;
  17403. lodash.nthArg = nthArg;
  17404. lodash.omit = omit;
  17405. lodash.omitBy = omitBy;
  17406. lodash.once = once;
  17407. lodash.orderBy = orderBy;
  17408. lodash.over = over;
  17409. lodash.overArgs = overArgs;
  17410. lodash.overEvery = overEvery;
  17411. lodash.overSome = overSome;
  17412. lodash.partial = partial;
  17413. lodash.partialRight = partialRight;
  17414. lodash.partition = partition;
  17415. lodash.pick = pick;
  17416. lodash.pickBy = pickBy;
  17417. lodash.property = property;
  17418. lodash.propertyOf = propertyOf;
  17419. lodash.pull = pull;
  17420. lodash.pullAll = pullAll;
  17421. lodash.pullAllBy = pullAllBy;
  17422. lodash.pullAllWith = pullAllWith;
  17423. lodash.pullAt = pullAt;
  17424. lodash.range = range;
  17425. lodash.rangeRight = rangeRight;
  17426. lodash.rearg = rearg;
  17427. lodash.reject = reject;
  17428. lodash.remove = remove;
  17429. lodash.rest = rest;
  17430. lodash.reverse = reverse;
  17431. lodash.sampleSize = sampleSize;
  17432. lodash.set = set;
  17433. lodash.setWith = setWith;
  17434. lodash.shuffle = shuffle;
  17435. lodash.slice = slice;
  17436. lodash.sortBy = sortBy;
  17437. lodash.sortedUniq = sortedUniq;
  17438. lodash.sortedUniqBy = sortedUniqBy;
  17439. lodash.split = split;
  17440. lodash.spread = spread;
  17441. lodash.tail = tail;
  17442. lodash.take = take;
  17443. lodash.takeRight = takeRight;
  17444. lodash.takeRightWhile = takeRightWhile;
  17445. lodash.takeWhile = takeWhile;
  17446. lodash.tap = tap;
  17447. lodash.throttle = throttle;
  17448. lodash.thru = thru;
  17449. lodash.toArray = toArray;
  17450. lodash.toPairs = toPairs;
  17451. lodash.toPairsIn = toPairsIn;
  17452. lodash.toPath = toPath;
  17453. lodash.toPlainObject = toPlainObject;
  17454. lodash.transform = transform;
  17455. lodash.unary = unary;
  17456. lodash.union = union;
  17457. lodash.unionBy = unionBy;
  17458. lodash.unionWith = unionWith;
  17459. lodash.uniq = uniq;
  17460. lodash.uniqBy = uniqBy;
  17461. lodash.uniqWith = uniqWith;
  17462. lodash.unset = unset;
  17463. lodash.unzip = unzip;
  17464. lodash.unzipWith = unzipWith;
  17465. lodash.update = update;
  17466. lodash.updateWith = updateWith;
  17467. lodash.values = values;
  17468. lodash.valuesIn = valuesIn;
  17469. lodash.without = without;
  17470. lodash.words = words;
  17471. lodash.wrap = wrap;
  17472. lodash.xor = xor;
  17473. lodash.xorBy = xorBy;
  17474. lodash.xorWith = xorWith;
  17475. lodash.zip = zip;
  17476. lodash.zipObject = zipObject;
  17477. lodash.zipObjectDeep = zipObjectDeep;
  17478. lodash.zipWith = zipWith;
  17479. // Add aliases.
  17480. lodash.entries = toPairs;
  17481. lodash.entriesIn = toPairsIn;
  17482. lodash.extend = assignIn;
  17483. lodash.extendWith = assignInWith;
  17484. // Add methods to `lodash.prototype`.
  17485. mixin(lodash, lodash);
  17486. /*------------------------------------------------------------------------*/
  17487. // Add methods that return unwrapped values in chain sequences.
  17488. lodash.add = add;
  17489. lodash.attempt = attempt;
  17490. lodash.camelCase = camelCase;
  17491. lodash.capitalize = capitalize;
  17492. lodash.ceil = ceil;
  17493. lodash.clamp = clamp;
  17494. lodash.clone = clone;
  17495. lodash.cloneDeep = cloneDeep;
  17496. lodash.cloneDeepWith = cloneDeepWith;
  17497. lodash.cloneWith = cloneWith;
  17498. lodash.conformsTo = conformsTo;
  17499. lodash.deburr = deburr;
  17500. lodash.defaultTo = defaultTo;
  17501. lodash.divide = divide;
  17502. lodash.endsWith = endsWith;
  17503. lodash.eq = eq;
  17504. lodash.escape = escape;
  17505. lodash.escapeRegExp = escapeRegExp;
  17506. lodash.every = every;
  17507. lodash.find = find;
  17508. lodash.findIndex = findIndex;
  17509. lodash.findKey = findKey;
  17510. lodash.findLast = findLast;
  17511. lodash.findLastIndex = findLastIndex;
  17512. lodash.findLastKey = findLastKey;
  17513. lodash.floor = floor;
  17514. lodash.forEach = forEach;
  17515. lodash.forEachRight = forEachRight;
  17516. lodash.forIn = forIn;
  17517. lodash.forInRight = forInRight;
  17518. lodash.forOwn = forOwn;
  17519. lodash.forOwnRight = forOwnRight;
  17520. lodash.get = get;
  17521. lodash.gt = gt;
  17522. lodash.gte = gte;
  17523. lodash.has = has;
  17524. lodash.hasIn = hasIn;
  17525. lodash.head = head;
  17526. lodash.identity = identity;
  17527. lodash.includes = includes;
  17528. lodash.indexOf = indexOf;
  17529. lodash.inRange = inRange;
  17530. lodash.invoke = invoke;
  17531. lodash.isArguments = isArguments;
  17532. lodash.isArray = isArray;
  17533. lodash.isArrayBuffer = isArrayBuffer;
  17534. lodash.isArrayLike = isArrayLike;
  17535. lodash.isArrayLikeObject = isArrayLikeObject;
  17536. lodash.isBoolean = isBoolean;
  17537. lodash.isBuffer = isBuffer;
  17538. lodash.isDate = isDate;
  17539. lodash.isElement = isElement;
  17540. lodash.isEmpty = isEmpty;
  17541. lodash.isEqual = isEqual;
  17542. lodash.isEqualWith = isEqualWith;
  17543. lodash.isError = isError;
  17544. lodash.isFinite = isFinite;
  17545. lodash.isFunction = isFunction;
  17546. lodash.isInteger = isInteger;
  17547. lodash.isLength = isLength;
  17548. lodash.isMap = isMap;
  17549. lodash.isMatch = isMatch;
  17550. lodash.isMatchWith = isMatchWith;
  17551. lodash.isNaN = isNaN;
  17552. lodash.isNative = isNative;
  17553. lodash.isNil = isNil;
  17554. lodash.isNull = isNull;
  17555. lodash.isNumber = isNumber;
  17556. lodash.isObject = isObject;
  17557. lodash.isObjectLike = isObjectLike;
  17558. lodash.isPlainObject = isPlainObject;
  17559. lodash.isRegExp = isRegExp;
  17560. lodash.isSafeInteger = isSafeInteger;
  17561. lodash.isSet = isSet;
  17562. lodash.isString = isString;
  17563. lodash.isSymbol = isSymbol;
  17564. lodash.isTypedArray = isTypedArray;
  17565. lodash.isUndefined = isUndefined;
  17566. lodash.isWeakMap = isWeakMap;
  17567. lodash.isWeakSet = isWeakSet;
  17568. lodash.join = join;
  17569. lodash.kebabCase = kebabCase;
  17570. lodash.last = last;
  17571. lodash.lastIndexOf = lastIndexOf;
  17572. lodash.lowerCase = lowerCase;
  17573. lodash.lowerFirst = lowerFirst;
  17574. lodash.lt = lt;
  17575. lodash.lte = lte;
  17576. lodash.max = max;
  17577. lodash.maxBy = maxBy;
  17578. lodash.mean = mean;
  17579. lodash.meanBy = meanBy;
  17580. lodash.min = min;
  17581. lodash.minBy = minBy;
  17582. lodash.stubArray = stubArray;
  17583. lodash.stubFalse = stubFalse;
  17584. lodash.stubObject = stubObject;
  17585. lodash.stubString = stubString;
  17586. lodash.stubTrue = stubTrue;
  17587. lodash.multiply = multiply;
  17588. lodash.nth = nth;
  17589. lodash.noConflict = noConflict;
  17590. lodash.noop = noop;
  17591. lodash.now = now;
  17592. lodash.pad = pad;
  17593. lodash.padEnd = padEnd;
  17594. lodash.padStart = padStart;
  17595. lodash.parseInt = parseInt;
  17596. lodash.random = random;
  17597. lodash.reduce = reduce;
  17598. lodash.reduceRight = reduceRight;
  17599. lodash.repeat = repeat;
  17600. lodash.replace = replace;
  17601. lodash.result = result;
  17602. lodash.round = round;
  17603. lodash.runInContext = runInContext;
  17604. lodash.sample = sample;
  17605. lodash.size = size;
  17606. lodash.snakeCase = snakeCase;
  17607. lodash.some = some;
  17608. lodash.sortedIndex = sortedIndex;
  17609. lodash.sortedIndexBy = sortedIndexBy;
  17610. lodash.sortedIndexOf = sortedIndexOf;
  17611. lodash.sortedLastIndex = sortedLastIndex;
  17612. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17613. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17614. lodash.startCase = startCase;
  17615. lodash.startsWith = startsWith;
  17616. lodash.subtract = subtract;
  17617. lodash.sum = sum;
  17618. lodash.sumBy = sumBy;
  17619. lodash.template = template;
  17620. lodash.times = times;
  17621. lodash.toFinite = toFinite;
  17622. lodash.toInteger = toInteger;
  17623. lodash.toLength = toLength;
  17624. lodash.toLower = toLower;
  17625. lodash.toNumber = toNumber;
  17626. lodash.toSafeInteger = toSafeInteger;
  17627. lodash.toString = toString;
  17628. lodash.toUpper = toUpper;
  17629. lodash.trim = trim;
  17630. lodash.trimEnd = trimEnd;
  17631. lodash.trimStart = trimStart;
  17632. lodash.truncate = truncate;
  17633. lodash.unescape = unescape;
  17634. lodash.uniqueId = uniqueId;
  17635. lodash.upperCase = upperCase;
  17636. lodash.upperFirst = upperFirst;
  17637. // Add aliases.
  17638. lodash.each = forEach;
  17639. lodash.eachRight = forEachRight;
  17640. lodash.first = head;
  17641. mixin(lodash, (function() {
  17642. var source = {};
  17643. baseForOwn(lodash, function(func, methodName) {
  17644. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17645. source[methodName] = func;
  17646. }
  17647. });
  17648. return source;
  17649. }()), { 'chain': false });
  17650. /*------------------------------------------------------------------------*/
  17651. /**
  17652. * The semantic version number.
  17653. *
  17654. * @static
  17655. * @memberOf _
  17656. * @type {string}
  17657. */
  17658. lodash.VERSION = VERSION;
  17659. // Assign default placeholders.
  17660. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17661. lodash[methodName].placeholder = lodash;
  17662. });
  17663. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17664. arrayEach(['drop', 'take'], function(methodName, index) {
  17665. LazyWrapper.prototype[methodName] = function(n) {
  17666. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17667. var result = (this.__filtered__ && !index)
  17668. ? new LazyWrapper(this)
  17669. : this.clone();
  17670. if (result.__filtered__) {
  17671. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17672. } else {
  17673. result.__views__.push({
  17674. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17675. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17676. });
  17677. }
  17678. return result;
  17679. };
  17680. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17681. return this.reverse()[methodName](n).reverse();
  17682. };
  17683. });
  17684. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17685. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17686. var type = index + 1,
  17687. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17688. LazyWrapper.prototype[methodName] = function(iteratee) {
  17689. var result = this.clone();
  17690. result.__iteratees__.push({
  17691. 'iteratee': getIteratee(iteratee, 3),
  17692. 'type': type
  17693. });
  17694. result.__filtered__ = result.__filtered__ || isFilter;
  17695. return result;
  17696. };
  17697. });
  17698. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17699. arrayEach(['head', 'last'], function(methodName, index) {
  17700. var takeName = 'take' + (index ? 'Right' : '');
  17701. LazyWrapper.prototype[methodName] = function() {
  17702. return this[takeName](1).value()[0];
  17703. };
  17704. });
  17705. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17706. arrayEach(['initial', 'tail'], function(methodName, index) {
  17707. var dropName = 'drop' + (index ? '' : 'Right');
  17708. LazyWrapper.prototype[methodName] = function() {
  17709. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17710. };
  17711. });
  17712. LazyWrapper.prototype.compact = function() {
  17713. return this.filter(identity);
  17714. };
  17715. LazyWrapper.prototype.find = function(predicate) {
  17716. return this.filter(predicate).head();
  17717. };
  17718. LazyWrapper.prototype.findLast = function(predicate) {
  17719. return this.reverse().find(predicate);
  17720. };
  17721. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17722. if (typeof path == 'function') {
  17723. return new LazyWrapper(this);
  17724. }
  17725. return this.map(function(value) {
  17726. return baseInvoke(value, path, args);
  17727. });
  17728. });
  17729. LazyWrapper.prototype.reject = function(predicate) {
  17730. return this.filter(negate(getIteratee(predicate)));
  17731. };
  17732. LazyWrapper.prototype.slice = function(start, end) {
  17733. start = toInteger(start);
  17734. var result = this;
  17735. if (result.__filtered__ && (start > 0 || end < 0)) {
  17736. return new LazyWrapper(result);
  17737. }
  17738. if (start < 0) {
  17739. result = result.takeRight(-start);
  17740. } else if (start) {
  17741. result = result.drop(start);
  17742. }
  17743. if (end !== undefined) {
  17744. end = toInteger(end);
  17745. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17746. }
  17747. return result;
  17748. };
  17749. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17750. return this.reverse().takeWhile(predicate).reverse();
  17751. };
  17752. LazyWrapper.prototype.toArray = function() {
  17753. return this.take(MAX_ARRAY_LENGTH);
  17754. };
  17755. // Add `LazyWrapper` methods to `lodash.prototype`.
  17756. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17757. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17758. isTaker = /^(?:head|last)$/.test(methodName),
  17759. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17760. retUnwrapped = isTaker || /^find/.test(methodName);
  17761. if (!lodashFunc) {
  17762. return;
  17763. }
  17764. lodash.prototype[methodName] = function() {
  17765. var value = this.__wrapped__,
  17766. args = isTaker ? [1] : arguments,
  17767. isLazy = value instanceof LazyWrapper,
  17768. iteratee = args[0],
  17769. useLazy = isLazy || isArray(value);
  17770. var interceptor = function(value) {
  17771. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17772. return (isTaker && chainAll) ? result[0] : result;
  17773. };
  17774. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17775. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17776. isLazy = useLazy = false;
  17777. }
  17778. var chainAll = this.__chain__,
  17779. isHybrid = !!this.__actions__.length,
  17780. isUnwrapped = retUnwrapped && !chainAll,
  17781. onlyLazy = isLazy && !isHybrid;
  17782. if (!retUnwrapped && useLazy) {
  17783. value = onlyLazy ? value : new LazyWrapper(this);
  17784. var result = func.apply(value, args);
  17785. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17786. return new LodashWrapper(result, chainAll);
  17787. }
  17788. if (isUnwrapped && onlyLazy) {
  17789. return func.apply(this, args);
  17790. }
  17791. result = this.thru(interceptor);
  17792. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17793. };
  17794. });
  17795. // Add `Array` methods to `lodash.prototype`.
  17796. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17797. var func = arrayProto[methodName],
  17798. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17799. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17800. lodash.prototype[methodName] = function() {
  17801. var args = arguments;
  17802. if (retUnwrapped && !this.__chain__) {
  17803. var value = this.value();
  17804. return func.apply(isArray(value) ? value : [], args);
  17805. }
  17806. return this[chainName](function(value) {
  17807. return func.apply(isArray(value) ? value : [], args);
  17808. });
  17809. };
  17810. });
  17811. // Map minified method names to their real names.
  17812. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17813. var lodashFunc = lodash[methodName];
  17814. if (lodashFunc) {
  17815. var key = lodashFunc.name + '';
  17816. if (!hasOwnProperty.call(realNames, key)) {
  17817. realNames[key] = [];
  17818. }
  17819. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17820. }
  17821. });
  17822. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17823. 'name': 'wrapper',
  17824. 'func': undefined
  17825. }];
  17826. // Add methods to `LazyWrapper`.
  17827. LazyWrapper.prototype.clone = lazyClone;
  17828. LazyWrapper.prototype.reverse = lazyReverse;
  17829. LazyWrapper.prototype.value = lazyValue;
  17830. // Add chain sequence methods to the `lodash` wrapper.
  17831. lodash.prototype.at = wrapperAt;
  17832. lodash.prototype.chain = wrapperChain;
  17833. lodash.prototype.commit = wrapperCommit;
  17834. lodash.prototype.next = wrapperNext;
  17835. lodash.prototype.plant = wrapperPlant;
  17836. lodash.prototype.reverse = wrapperReverse;
  17837. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17838. // Add lazy aliases.
  17839. lodash.prototype.first = lodash.prototype.head;
  17840. if (symIterator) {
  17841. lodash.prototype[symIterator] = wrapperToIterator;
  17842. }
  17843. return lodash;
  17844. });
  17845. /*--------------------------------------------------------------------------*/
  17846. // Export lodash.
  17847. var _ = runInContext();
  17848. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17849. if (true) {
  17850. // Expose Lodash on the global object to prevent errors when Lodash is
  17851. // loaded by a script tag in the presence of an AMD loader.
  17852. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17853. // Use `_.noConflict` to remove Lodash from the global object.
  17854. root._ = _;
  17855. // Define as an anonymous module so, through path mapping, it can be
  17856. // referenced as the "underscore" module.
  17857. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17858. return _;
  17859. }).call(exports, __webpack_require__, exports, module),
  17860. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17861. }
  17862. // Check for `exports` after `define` in case a build optimizer adds it.
  17863. else {}
  17864. }.call(this));
  17865. /***/ }),
  17866. /***/ "./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":
  17867. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17868. !*** ./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 ***!
  17869. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17870. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17871. "use strict";
  17872. __webpack_require__.r(__webpack_exports__);
  17873. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17874. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17875. /* harmony export */ });
  17876. /* 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");
  17877. /* 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__);
  17878. /* 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");
  17879. var options = {};
  17880. options.insert = "head";
  17881. options.singleton = false;
  17882. 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);
  17883. /* 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 || {});
  17884. /***/ }),
  17885. /***/ "./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":
  17886. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17887. !*** ./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 ***!
  17888. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17889. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17890. "use strict";
  17891. __webpack_require__.r(__webpack_exports__);
  17892. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17893. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17894. /* harmony export */ });
  17895. /* 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");
  17896. /* 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__);
  17897. /* 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");
  17898. var options = {};
  17899. options.insert = "head";
  17900. options.singleton = false;
  17901. 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);
  17902. /* 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 || {});
  17903. /***/ }),
  17904. /***/ "./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":
  17905. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17906. !*** ./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 ***!
  17907. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17908. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17909. "use strict";
  17910. __webpack_require__.r(__webpack_exports__);
  17911. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17912. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17913. /* harmony export */ });
  17914. /* 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");
  17915. /* 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__);
  17916. /* 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");
  17917. var options = {};
  17918. options.insert = "head";
  17919. options.singleton = false;
  17920. 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);
  17921. /* 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 || {});
  17922. /***/ }),
  17923. /***/ "./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":
  17924. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17925. !*** ./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 ***!
  17926. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17927. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17928. "use strict";
  17929. __webpack_require__.r(__webpack_exports__);
  17930. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17931. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17932. /* harmony export */ });
  17933. /* 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");
  17934. /* 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__);
  17935. /* 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");
  17936. var options = {};
  17937. options.insert = "head";
  17938. options.singleton = false;
  17939. 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);
  17940. /* 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 || {});
  17941. /***/ }),
  17942. /***/ "./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":
  17943. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17944. !*** ./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 ***!
  17945. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17946. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17947. "use strict";
  17948. __webpack_require__.r(__webpack_exports__);
  17949. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17950. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17951. /* harmony export */ });
  17952. /* 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");
  17953. /* 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__);
  17954. /* 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");
  17955. var options = {};
  17956. options.insert = "head";
  17957. options.singleton = false;
  17958. 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);
  17959. /* 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 || {});
  17960. /***/ }),
  17961. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17962. /*!******************************************************!*\
  17963. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17964. \******************************************************/
  17965. /***/ ((__unused_webpack_module, exports) => {
  17966. "use strict";
  17967. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17968. // runtime helper for setting properties on components
  17969. // in a tree-shakable way
  17970. exports["default"] = (sfc, props) => {
  17971. const target = sfc.__vccOpts || sfc;
  17972. for (const [key, val] of props) {
  17973. target[key] = val;
  17974. }
  17975. return target;
  17976. };
  17977. /***/ }),
  17978. /***/ "./resources/js/components/AppDropdown.vue":
  17979. /*!*************************************************!*\
  17980. !*** ./resources/js/components/AppDropdown.vue ***!
  17981. \*************************************************/
  17982. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17983. "use strict";
  17984. __webpack_require__.r(__webpack_exports__);
  17985. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17986. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17987. /* harmony export */ });
  17988. /* 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");
  17989. /* 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");
  17990. /* 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");
  17991. ;
  17992. 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"]])
  17993. /* hot reload */
  17994. if (false) {}
  17995. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17996. /***/ }),
  17997. /***/ "./resources/js/components/AppFooter.vue":
  17998. /*!***********************************************!*\
  17999. !*** ./resources/js/components/AppFooter.vue ***!
  18000. \***********************************************/
  18001. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18002. "use strict";
  18003. __webpack_require__.r(__webpack_exports__);
  18004. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18005. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18006. /* harmony export */ });
  18007. /* 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");
  18008. /* 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");
  18009. /* 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");
  18010. const script = {}
  18011. ;
  18012. 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"]])
  18013. /* hot reload */
  18014. if (false) {}
  18015. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18016. /***/ }),
  18017. /***/ "./resources/js/components/AppInputText.vue":
  18018. /*!**************************************************!*\
  18019. !*** ./resources/js/components/AppInputText.vue ***!
  18020. \**************************************************/
  18021. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18022. "use strict";
  18023. __webpack_require__.r(__webpack_exports__);
  18024. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18025. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18026. /* harmony export */ });
  18027. /* 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");
  18028. /* 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");
  18029. /* 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");
  18030. ;
  18031. 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"]])
  18032. /* hot reload */
  18033. if (false) {}
  18034. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18035. /***/ }),
  18036. /***/ "./resources/js/components/AppMessage.vue":
  18037. /*!************************************************!*\
  18038. !*** ./resources/js/components/AppMessage.vue ***!
  18039. \************************************************/
  18040. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18041. "use strict";
  18042. __webpack_require__.r(__webpack_exports__);
  18043. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18044. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18045. /* harmony export */ });
  18046. /* 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");
  18047. /* 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");
  18048. /* 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");
  18049. ;
  18050. 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"]])
  18051. /* hot reload */
  18052. if (false) {}
  18053. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18054. /***/ }),
  18055. /***/ "./resources/js/components/AppSidebar.vue":
  18056. /*!************************************************!*\
  18057. !*** ./resources/js/components/AppSidebar.vue ***!
  18058. \************************************************/
  18059. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18060. "use strict";
  18061. __webpack_require__.r(__webpack_exports__);
  18062. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18063. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18064. /* harmony export */ });
  18065. /* 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");
  18066. /* 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");
  18067. /* 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");
  18068. /* 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");
  18069. ;
  18070. 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"]])
  18071. /* hot reload */
  18072. if (false) {}
  18073. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18074. /***/ }),
  18075. /***/ "./resources/js/components/AppSubSidebar.vue":
  18076. /*!***************************************************!*\
  18077. !*** ./resources/js/components/AppSubSidebar.vue ***!
  18078. \***************************************************/
  18079. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18080. "use strict";
  18081. __webpack_require__.r(__webpack_exports__);
  18082. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18083. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18084. /* harmony export */ });
  18085. /* 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");
  18086. /* 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");
  18087. /* 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");
  18088. /* 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");
  18089. ;
  18090. 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"]])
  18091. /* hot reload */
  18092. if (false) {}
  18093. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18094. /***/ }),
  18095. /***/ "./resources/js/components/AppTopBar.vue":
  18096. /*!***********************************************!*\
  18097. !*** ./resources/js/components/AppTopBar.vue ***!
  18098. \***********************************************/
  18099. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18100. "use strict";
  18101. __webpack_require__.r(__webpack_exports__);
  18102. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18103. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18104. /* harmony export */ });
  18105. /* 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");
  18106. /* 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");
  18107. /* 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");
  18108. /* 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");
  18109. ;
  18110. 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"]])
  18111. /* hot reload */
  18112. if (false) {}
  18113. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18114. /***/ }),
  18115. /***/ "./resources/js/layouts/DashboardLayout.vue":
  18116. /*!**************************************************!*\
  18117. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  18118. \**************************************************/
  18119. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18120. "use strict";
  18121. __webpack_require__.r(__webpack_exports__);
  18122. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18123. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18124. /* harmony export */ });
  18125. /* 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");
  18126. /* 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");
  18127. /* 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");
  18128. /* 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");
  18129. ;
  18130. 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"]])
  18131. /* hot reload */
  18132. if (false) {}
  18133. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18134. /***/ }),
  18135. /***/ "./resources/js/pages/member/Edit.vue":
  18136. /*!********************************************!*\
  18137. !*** ./resources/js/pages/member/Edit.vue ***!
  18138. \********************************************/
  18139. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18140. "use strict";
  18141. __webpack_require__.r(__webpack_exports__);
  18142. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18143. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  18144. /* harmony export */ });
  18145. /* 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");
  18146. /* 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");
  18147. /* 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");
  18148. ;
  18149. 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"]])
  18150. /* hot reload */
  18151. if (false) {}
  18152. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  18153. /***/ }),
  18154. /***/ "./resources/js/components/AppDropdown.vue?vue&type=script&setup=true&lang=js":
  18155. /*!************************************************************************************!*\
  18156. !*** ./resources/js/components/AppDropdown.vue?vue&type=script&setup=true&lang=js ***!
  18157. \************************************************************************************/
  18158. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18159. "use strict";
  18160. __webpack_require__.r(__webpack_exports__);
  18161. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18162. /* 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"])
  18163. /* harmony export */ });
  18164. /* 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");
  18165. /***/ }),
  18166. /***/ "./resources/js/components/AppInputText.vue?vue&type=script&setup=true&lang=js":
  18167. /*!*************************************************************************************!*\
  18168. !*** ./resources/js/components/AppInputText.vue?vue&type=script&setup=true&lang=js ***!
  18169. \*************************************************************************************/
  18170. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18171. "use strict";
  18172. __webpack_require__.r(__webpack_exports__);
  18173. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18174. /* 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"])
  18175. /* harmony export */ });
  18176. /* 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");
  18177. /***/ }),
  18178. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  18179. /*!***********************************************************************************!*\
  18180. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  18181. \***********************************************************************************/
  18182. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18183. "use strict";
  18184. __webpack_require__.r(__webpack_exports__);
  18185. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18186. /* 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"])
  18187. /* harmony export */ });
  18188. /* 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");
  18189. /***/ }),
  18190. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  18191. /*!***********************************************************************************!*\
  18192. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  18193. \***********************************************************************************/
  18194. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18195. "use strict";
  18196. __webpack_require__.r(__webpack_exports__);
  18197. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18198. /* 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"])
  18199. /* harmony export */ });
  18200. /* 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");
  18201. /***/ }),
  18202. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  18203. /*!**************************************************************************************!*\
  18204. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  18205. \**************************************************************************************/
  18206. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18207. "use strict";
  18208. __webpack_require__.r(__webpack_exports__);
  18209. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18210. /* 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"])
  18211. /* harmony export */ });
  18212. /* 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");
  18213. /***/ }),
  18214. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  18215. /*!**********************************************************************************!*\
  18216. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  18217. \**********************************************************************************/
  18218. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18219. "use strict";
  18220. __webpack_require__.r(__webpack_exports__);
  18221. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18222. /* 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"])
  18223. /* harmony export */ });
  18224. /* 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");
  18225. /***/ }),
  18226. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  18227. /*!*************************************************************************************!*\
  18228. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  18229. \*************************************************************************************/
  18230. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18231. "use strict";
  18232. __webpack_require__.r(__webpack_exports__);
  18233. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18234. /* 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"])
  18235. /* harmony export */ });
  18236. /* 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");
  18237. /***/ }),
  18238. /***/ "./resources/js/pages/member/Edit.vue?vue&type=script&setup=true&lang=js":
  18239. /*!*******************************************************************************!*\
  18240. !*** ./resources/js/pages/member/Edit.vue?vue&type=script&setup=true&lang=js ***!
  18241. \*******************************************************************************/
  18242. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18243. "use strict";
  18244. __webpack_require__.r(__webpack_exports__);
  18245. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18246. /* 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"])
  18247. /* harmony export */ });
  18248. /* 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");
  18249. /***/ }),
  18250. /***/ "./resources/js/components/AppDropdown.vue?vue&type=template&id=ce0d1992":
  18251. /*!*******************************************************************************!*\
  18252. !*** ./resources/js/components/AppDropdown.vue?vue&type=template&id=ce0d1992 ***!
  18253. \*******************************************************************************/
  18254. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18255. "use strict";
  18256. __webpack_require__.r(__webpack_exports__);
  18257. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18258. /* 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)
  18259. /* harmony export */ });
  18260. /* 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");
  18261. /***/ }),
  18262. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  18263. /*!*****************************************************************************************!*\
  18264. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  18265. \*****************************************************************************************/
  18266. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18267. "use strict";
  18268. __webpack_require__.r(__webpack_exports__);
  18269. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18270. /* 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)
  18271. /* harmony export */ });
  18272. /* 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");
  18273. /***/ }),
  18274. /***/ "./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1":
  18275. /*!********************************************************************************!*\
  18276. !*** ./resources/js/components/AppInputText.vue?vue&type=template&id=16729fe1 ***!
  18277. \********************************************************************************/
  18278. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18279. "use strict";
  18280. __webpack_require__.r(__webpack_exports__);
  18281. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18282. /* 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)
  18283. /* harmony export */ });
  18284. /* 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");
  18285. /***/ }),
  18286. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  18287. /*!******************************************************************************!*\
  18288. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  18289. \******************************************************************************/
  18290. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18291. "use strict";
  18292. __webpack_require__.r(__webpack_exports__);
  18293. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18294. /* 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)
  18295. /* harmony export */ });
  18296. /* 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");
  18297. /***/ }),
  18298. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  18299. /*!******************************************************************************************!*\
  18300. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  18301. \******************************************************************************************/
  18302. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18303. "use strict";
  18304. __webpack_require__.r(__webpack_exports__);
  18305. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18306. /* 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)
  18307. /* harmony export */ });
  18308. /* 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");
  18309. /***/ }),
  18310. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  18311. /*!*********************************************************************************************!*\
  18312. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  18313. \*********************************************************************************************/
  18314. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18315. "use strict";
  18316. __webpack_require__.r(__webpack_exports__);
  18317. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18318. /* 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)
  18319. /* harmony export */ });
  18320. /* 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");
  18321. /***/ }),
  18322. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  18323. /*!*****************************************************************************************!*\
  18324. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  18325. \*****************************************************************************************/
  18326. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18327. "use strict";
  18328. __webpack_require__.r(__webpack_exports__);
  18329. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18330. /* 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)
  18331. /* harmony export */ });
  18332. /* 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");
  18333. /***/ }),
  18334. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  18335. /*!********************************************************************************************!*\
  18336. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  18337. \********************************************************************************************/
  18338. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18339. "use strict";
  18340. __webpack_require__.r(__webpack_exports__);
  18341. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18342. /* 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)
  18343. /* harmony export */ });
  18344. /* 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");
  18345. /***/ }),
  18346. /***/ "./resources/js/pages/member/Edit.vue?vue&type=template&id=1a9fb226":
  18347. /*!**************************************************************************!*\
  18348. !*** ./resources/js/pages/member/Edit.vue?vue&type=template&id=1a9fb226 ***!
  18349. \**************************************************************************/
  18350. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18351. "use strict";
  18352. __webpack_require__.r(__webpack_exports__);
  18353. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  18354. /* 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)
  18355. /* harmony export */ });
  18356. /* 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");
  18357. /***/ }),
  18358. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  18359. /*!********************************************************************************************************!*\
  18360. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  18361. \********************************************************************************************************/
  18362. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18363. "use strict";
  18364. __webpack_require__.r(__webpack_exports__);
  18365. /* 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");
  18366. /***/ }),
  18367. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  18368. /*!*********************************************************************************************************!*\
  18369. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  18370. \*********************************************************************************************************/
  18371. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18372. "use strict";
  18373. __webpack_require__.r(__webpack_exports__);
  18374. /* 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");
  18375. /***/ }),
  18376. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  18377. /*!************************************************************************************************************!*\
  18378. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  18379. \************************************************************************************************************/
  18380. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18381. "use strict";
  18382. __webpack_require__.r(__webpack_exports__);
  18383. /* 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");
  18384. /***/ }),
  18385. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  18386. /*!********************************************************************************************************!*\
  18387. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  18388. \********************************************************************************************************/
  18389. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18390. "use strict";
  18391. __webpack_require__.r(__webpack_exports__);
  18392. /* 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");
  18393. /***/ }),
  18394. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  18395. /*!***********************************************************************************************************!*\
  18396. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  18397. \***********************************************************************************************************/
  18398. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18399. "use strict";
  18400. __webpack_require__.r(__webpack_exports__);
  18401. /* 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");
  18402. /***/ })
  18403. }]);