app.js 2.5 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992279932799427995279962799727998279992800028001280022800328004280052800628007280082800928010280112801228013280142801528016280172801828019280202802128022280232802428025280262802728028280292803028031280322803328034280352803628037280382803928040280412804228043280442804528046280472804828049280502805128052280532805428055280562805728058280592806028061280622806328064280652806628067280682806928070280712807228073280742807528076280772807828079280802808128082280832808428085280862808728088280892809028091280922809328094280952809628097280982809928100281012810228103281042810528106281072810828109281102811128112281132811428115281162811728118281192812028121281222812328124281252812628127281282812928130281312813228133281342813528136281372813828139281402814128142281432814428145281462814728148281492815028151281522815328154281552815628157281582815928160281612816228163281642816528166281672816828169281702817128172281732817428175281762817728178281792818028181281822818328184281852818628187281882818928190281912819228193281942819528196281972819828199282002820128202282032820428205282062820728208282092821028211282122821328214282152821628217282182821928220282212822228223282242822528226282272822828229282302823128232282332823428235282362823728238282392824028241282422824328244282452824628247282482824928250282512825228253282542825528256282572825828259282602826128262282632826428265282662826728268282692827028271282722827328274282752827628277282782827928280282812828228283282842828528286282872828828289282902829128292282932829428295282962829728298282992830028301283022830328304283052830628307283082830928310283112831228313283142831528316283172831828319283202832128322283232832428325283262832728328283292833028331283322833328334283352833628337283382833928340283412834228343283442834528346283472834828349283502835128352283532835428355283562835728358283592836028361283622836328364283652836628367283682836928370283712837228373283742837528376283772837828379283802838128382283832838428385283862838728388283892839028391283922839328394283952839628397283982839928400284012840228403284042840528406284072840828409284102841128412284132841428415284162841728418284192842028421284222842328424284252842628427284282842928430284312843228433284342843528436284372843828439284402844128442284432844428445284462844728448284492845028451284522845328454284552845628457284582845928460284612846228463284642846528466284672846828469284702847128472284732847428475284762847728478284792848028481284822848328484284852848628487284882848928490284912849228493284942849528496284972849828499285002850128502285032850428505285062850728508285092851028511285122851328514285152851628517285182851928520285212852228523285242852528526285272852828529285302853128532285332853428535285362853728538285392854028541285422854328544285452854628547285482854928550285512855228553285542855528556285572855828559285602856128562285632856428565285662856728568285692857028571285722857328574285752857628577285782857928580285812858228583285842858528586285872858828589285902859128592285932859428595285962859728598285992860028601286022860328604286052860628607286082860928610286112861228613286142861528616286172861828619286202862128622286232862428625286262862728628286292863028631286322863328634286352863628637286382863928640286412864228643286442864528646286472864828649286502865128652286532865428655286562865728658286592866028661286622866328664286652866628667286682866928670286712867228673286742867528676286772867828679286802868128682286832868428685286862868728688286892869028691286922869328694286952869628697286982869928700287012870228703287042870528706287072870828709287102871128712287132871428715287162871728718287192872028721287222872328724287252872628727287282872928730287312873228733287342873528736287372873828739287402874128742287432874428745287462874728748287492875028751287522875328754287552875628757287582875928760287612876228763287642876528766287672876828769287702877128772287732877428775287762877728778287792878028781287822878328784287852878628787287882878928790287912879228793287942879528796287972879828799288002880128802288032880428805288062880728808288092881028811288122881328814288152881628817288182881928820288212882228823288242882528826288272882828829288302883128832288332883428835288362883728838288392884028841288422884328844288452884628847288482884928850288512885228853288542885528856288572885828859288602886128862288632886428865288662886728868288692887028871288722887328874288752887628877288782887928880288812888228883288842888528886288872888828889288902889128892288932889428895288962889728898288992890028901289022890328904289052890628907289082890928910289112891228913289142891528916289172891828919289202892128922289232892428925289262892728928289292893028931289322893328934289352893628937289382893928940289412894228943289442894528946289472894828949289502895128952289532895428955289562895728958289592896028961289622896328964289652896628967289682896928970289712897228973289742897528976289772897828979289802898128982289832898428985289862898728988289892899028991289922899328994289952899628997289982899929000290012900229003290042900529006290072900829009290102901129012290132901429015290162901729018290192902029021290222902329024290252902629027290282902929030290312903229033290342903529036290372903829039290402904129042290432904429045290462904729048290492905029051290522905329054290552905629057290582905929060290612906229063290642906529066290672906829069290702907129072290732907429075290762907729078290792908029081290822908329084290852908629087290882908929090290912909229093290942909529096290972909829099291002910129102291032910429105291062910729108291092911029111291122911329114291152911629117291182911929120291212912229123291242912529126291272912829129291302913129132291332913429135291362913729138291392914029141291422914329144291452914629147291482914929150291512915229153291542915529156291572915829159291602916129162291632916429165291662916729168291692917029171291722917329174291752917629177291782917929180291812918229183291842918529186291872918829189291902919129192291932919429195291962919729198291992920029201292022920329204292052920629207292082920929210292112921229213292142921529216292172921829219292202922129222292232922429225292262922729228292292923029231292322923329234292352923629237292382923929240292412924229243292442924529246292472924829249292502925129252292532925429255292562925729258292592926029261292622926329264292652926629267292682926929270292712927229273292742927529276292772927829279292802928129282292832928429285292862928729288292892929029291292922929329294292952929629297292982929929300293012930229303293042930529306293072930829309293102931129312293132931429315293162931729318293192932029321293222932329324293252932629327293282932929330293312933229333293342933529336293372933829339293402934129342293432934429345293462934729348293492935029351293522935329354293552935629357293582935929360293612936229363293642936529366293672936829369293702937129372293732937429375293762937729378293792938029381293822938329384293852938629387293882938929390293912939229393293942939529396293972939829399294002940129402294032940429405294062940729408294092941029411294122941329414294152941629417294182941929420294212942229423294242942529426294272942829429294302943129432294332943429435294362943729438294392944029441294422944329444294452944629447294482944929450294512945229453294542945529456294572945829459294602946129462294632946429465294662946729468294692947029471294722947329474294752947629477294782947929480294812948229483294842948529486294872948829489294902949129492294932949429495294962949729498294992950029501295022950329504295052950629507295082950929510295112951229513295142951529516295172951829519295202952129522295232952429525295262952729528295292953029531295322953329534295352953629537295382953929540295412954229543295442954529546295472954829549295502955129552295532955429555295562955729558295592956029561295622956329564295652956629567295682956929570295712957229573295742957529576295772957829579295802958129582295832958429585295862958729588295892959029591295922959329594295952959629597295982959929600296012960229603296042960529606296072960829609296102961129612296132961429615296162961729618296192962029621296222962329624296252962629627296282962929630296312963229633296342963529636296372963829639296402964129642296432964429645296462964729648296492965029651296522965329654296552965629657296582965929660296612966229663296642966529666296672966829669296702967129672296732967429675296762967729678296792968029681296822968329684296852968629687296882968929690296912969229693296942969529696296972969829699297002970129702297032970429705297062970729708297092971029711297122971329714297152971629717297182971929720297212972229723297242972529726297272972829729297302973129732297332973429735297362973729738297392974029741297422974329744297452974629747297482974929750297512975229753297542975529756297572975829759297602976129762297632976429765297662976729768297692977029771297722977329774297752977629777297782977929780297812978229783297842978529786297872978829789297902979129792297932979429795297962979729798297992980029801298022980329804298052980629807298082980929810298112981229813298142981529816298172981829819298202982129822298232982429825298262982729828298292983029831298322983329834298352983629837298382983929840298412984229843298442984529846298472984829849298502985129852298532985429855298562985729858298592986029861298622986329864298652986629867298682986929870298712987229873298742987529876298772987829879298802988129882298832988429885298862988729888298892989029891298922989329894298952989629897298982989929900299012990229903299042990529906299072990829909299102991129912299132991429915299162991729918299192992029921299222992329924299252992629927299282992929930299312993229933299342993529936299372993829939299402994129942299432994429945299462994729948299492995029951299522995329954299552995629957299582995929960299612996229963299642996529966299672996829969299702997129972299732997429975299762997729978299792998029981299822998329984299852998629987299882998929990299912999229993299942999529996299972999829999300003000130002300033000430005300063000730008300093001030011300123001330014300153001630017300183001930020300213002230023300243002530026300273002830029300303003130032300333003430035300363003730038300393004030041300423004330044300453004630047300483004930050300513005230053300543005530056300573005830059300603006130062300633006430065300663006730068300693007030071300723007330074300753007630077300783007930080300813008230083300843008530086300873008830089300903009130092300933009430095300963009730098300993010030101301023010330104301053010630107301083010930110301113011230113301143011530116301173011830119301203012130122301233012430125301263012730128301293013030131301323013330134301353013630137301383013930140301413014230143301443014530146301473014830149301503015130152301533015430155301563015730158301593016030161301623016330164301653016630167301683016930170301713017230173301743017530176301773017830179301803018130182301833018430185301863018730188301893019030191301923019330194301953019630197301983019930200302013020230203302043020530206302073020830209302103021130212302133021430215302163021730218302193022030221302223022330224302253022630227302283022930230302313023230233302343023530236302373023830239302403024130242302433024430245302463024730248302493025030251302523025330254302553025630257302583025930260302613026230263302643026530266302673026830269302703027130272302733027430275302763027730278302793028030281302823028330284302853028630287302883028930290302913029230293302943029530296302973029830299303003030130302303033030430305303063030730308303093031030311303123031330314303153031630317303183031930320303213032230323303243032530326303273032830329303303033130332303333033430335303363033730338303393034030341303423034330344303453034630347303483034930350303513035230353303543035530356303573035830359303603036130362303633036430365303663036730368303693037030371303723037330374303753037630377303783037930380303813038230383303843038530386303873038830389303903039130392303933039430395303963039730398303993040030401304023040330404304053040630407304083040930410304113041230413304143041530416304173041830419304203042130422304233042430425304263042730428304293043030431304323043330434304353043630437304383043930440304413044230443304443044530446304473044830449304503045130452304533045430455304563045730458304593046030461304623046330464304653046630467304683046930470304713047230473304743047530476304773047830479304803048130482304833048430485304863048730488304893049030491304923049330494304953049630497304983049930500305013050230503305043050530506305073050830509305103051130512305133051430515305163051730518305193052030521305223052330524305253052630527305283052930530305313053230533305343053530536305373053830539305403054130542305433054430545305463054730548305493055030551305523055330554305553055630557305583055930560305613056230563305643056530566305673056830569305703057130572305733057430575305763057730578305793058030581305823058330584305853058630587305883058930590305913059230593305943059530596305973059830599306003060130602306033060430605306063060730608306093061030611306123061330614306153061630617306183061930620306213062230623306243062530626306273062830629306303063130632306333063430635306363063730638306393064030641306423064330644306453064630647306483064930650306513065230653306543065530656306573065830659306603066130662306633066430665306663066730668306693067030671306723067330674306753067630677306783067930680306813068230683306843068530686306873068830689306903069130692306933069430695306963069730698306993070030701307023070330704307053070630707307083070930710307113071230713307143071530716307173071830719307203072130722307233072430725307263072730728307293073030731307323073330734307353073630737307383073930740307413074230743307443074530746307473074830749307503075130752307533075430755307563075730758307593076030761307623076330764307653076630767307683076930770307713077230773307743077530776307773077830779307803078130782307833078430785307863078730788307893079030791307923079330794307953079630797307983079930800308013080230803308043080530806308073080830809308103081130812308133081430815308163081730818308193082030821308223082330824308253082630827308283082930830308313083230833308343083530836308373083830839308403084130842308433084430845308463084730848308493085030851308523085330854308553085630857308583085930860308613086230863308643086530866308673086830869308703087130872308733087430875308763087730878308793088030881308823088330884308853088630887308883088930890308913089230893308943089530896308973089830899309003090130902309033090430905309063090730908309093091030911309123091330914309153091630917309183091930920309213092230923309243092530926309273092830929309303093130932309333093430935309363093730938309393094030941309423094330944309453094630947309483094930950309513095230953309543095530956309573095830959309603096130962309633096430965309663096730968309693097030971309723097330974309753097630977309783097930980309813098230983309843098530986309873098830989309903099130992309933099430995309963099730998309993100031001310023100331004310053100631007310083100931010310113101231013310143101531016310173101831019310203102131022310233102431025310263102731028310293103031031310323103331034310353103631037310383103931040310413104231043310443104531046310473104831049310503105131052310533105431055310563105731058310593106031061310623106331064310653106631067310683106931070310713107231073310743107531076310773107831079310803108131082310833108431085310863108731088310893109031091310923109331094310953109631097310983109931100311013110231103311043110531106311073110831109311103111131112311133111431115311163111731118311193112031121311223112331124311253112631127311283112931130311313113231133311343113531136311373113831139311403114131142311433114431145311463114731148311493115031151311523115331154311553115631157311583115931160311613116231163311643116531166311673116831169311703117131172311733117431175311763117731178311793118031181311823118331184311853118631187311883118931190311913119231193311943119531196311973119831199312003120131202312033120431205312063120731208312093121031211312123121331214312153121631217312183121931220312213122231223312243122531226312273122831229312303123131232312333123431235312363123731238312393124031241312423124331244312453124631247312483124931250312513125231253312543125531256312573125831259312603126131262312633126431265312663126731268312693127031271312723127331274312753127631277312783127931280312813128231283312843128531286312873128831289312903129131292312933129431295312963129731298312993130031301313023130331304313053130631307313083130931310313113131231313313143131531316313173131831319313203132131322313233132431325313263132731328313293133031331313323133331334313353133631337313383133931340313413134231343313443134531346313473134831349313503135131352313533135431355313563135731358313593136031361313623136331364313653136631367313683136931370313713137231373313743137531376313773137831379313803138131382313833138431385313863138731388313893139031391313923139331394313953139631397313983139931400314013140231403314043140531406314073140831409314103141131412314133141431415314163141731418314193142031421314223142331424314253142631427314283142931430314313143231433314343143531436314373143831439314403144131442314433144431445314463144731448314493145031451314523145331454314553145631457314583145931460314613146231463314643146531466314673146831469314703147131472314733147431475314763147731478314793148031481314823148331484314853148631487314883148931490314913149231493314943149531496314973149831499315003150131502315033150431505315063150731508315093151031511315123151331514315153151631517315183151931520315213152231523315243152531526315273152831529315303153131532315333153431535315363153731538315393154031541315423154331544315453154631547315483154931550315513155231553315543155531556315573155831559315603156131562315633156431565315663156731568315693157031571315723157331574315753157631577315783157931580315813158231583315843158531586315873158831589315903159131592315933159431595315963159731598315993160031601316023160331604316053160631607316083160931610316113161231613316143161531616316173161831619316203162131622316233162431625316263162731628316293163031631316323163331634316353163631637316383163931640316413164231643316443164531646316473164831649316503165131652316533165431655316563165731658316593166031661316623166331664316653166631667316683166931670316713167231673316743167531676316773167831679316803168131682316833168431685316863168731688316893169031691316923169331694316953169631697316983169931700317013170231703317043170531706317073170831709317103171131712317133171431715317163171731718317193172031721317223172331724317253172631727317283172931730317313173231733317343173531736317373173831739317403174131742317433174431745317463174731748317493175031751317523175331754317553175631757317583175931760317613176231763317643176531766317673176831769317703177131772317733177431775317763177731778317793178031781317823178331784317853178631787317883178931790317913179231793317943179531796317973179831799318003180131802318033180431805318063180731808318093181031811318123181331814318153181631817318183181931820318213182231823318243182531826318273182831829318303183131832318333183431835318363183731838318393184031841318423184331844318453184631847318483184931850318513185231853318543185531856318573185831859318603186131862318633186431865318663186731868318693187031871318723187331874318753187631877318783187931880318813188231883318843188531886318873188831889318903189131892318933189431895318963189731898318993190031901319023190331904319053190631907319083190931910319113191231913319143191531916319173191831919319203192131922319233192431925319263192731928319293193031931319323193331934319353193631937319383193931940319413194231943319443194531946319473194831949319503195131952319533195431955319563195731958319593196031961319623196331964319653196631967319683196931970319713197231973319743197531976319773197831979319803198131982319833198431985319863198731988319893199031991319923199331994319953199631997319983199932000320013200232003320043200532006320073200832009320103201132012320133201432015320163201732018320193202032021320223202332024320253202632027320283202932030320313203232033320343203532036320373203832039320403204132042320433204432045320463204732048320493205032051320523205332054320553205632057320583205932060320613206232063320643206532066320673206832069320703207132072320733207432075320763207732078320793208032081320823208332084320853208632087320883208932090320913209232093320943209532096320973209832099321003210132102321033210432105321063210732108321093211032111321123211332114321153211632117321183211932120321213212232123321243212532126321273212832129321303213132132321333213432135321363213732138321393214032141321423214332144321453214632147321483214932150321513215232153321543215532156321573215832159321603216132162321633216432165321663216732168321693217032171321723217332174321753217632177321783217932180321813218232183321843218532186321873218832189321903219132192321933219432195321963219732198321993220032201322023220332204322053220632207322083220932210322113221232213322143221532216322173221832219322203222132222322233222432225322263222732228322293223032231322323223332234322353223632237322383223932240322413224232243322443224532246322473224832249322503225132252322533225432255322563225732258322593226032261322623226332264322653226632267322683226932270322713227232273322743227532276322773227832279322803228132282322833228432285322863228732288322893229032291322923229332294322953229632297322983229932300323013230232303323043230532306323073230832309323103231132312323133231432315323163231732318323193232032321323223232332324323253232632327323283232932330323313233232333323343233532336323373233832339323403234132342323433234432345323463234732348323493235032351323523235332354323553235632357323583235932360323613236232363323643236532366323673236832369323703237132372323733237432375323763237732378323793238032381323823238332384323853238632387323883238932390323913239232393323943239532396323973239832399324003240132402324033240432405324063240732408324093241032411324123241332414324153241632417324183241932420324213242232423324243242532426324273242832429324303243132432324333243432435324363243732438324393244032441324423244332444324453244632447324483244932450324513245232453324543245532456324573245832459324603246132462324633246432465324663246732468324693247032471324723247332474324753247632477324783247932480324813248232483324843248532486324873248832489324903249132492324933249432495324963249732498324993250032501325023250332504325053250632507325083250932510325113251232513325143251532516325173251832519325203252132522325233252432525325263252732528325293253032531325323253332534325353253632537325383253932540325413254232543325443254532546325473254832549325503255132552325533255432555325563255732558325593256032561325623256332564325653256632567325683256932570325713257232573325743257532576325773257832579325803258132582325833258432585325863258732588325893259032591325923259332594325953259632597325983259932600326013260232603326043260532606326073260832609326103261132612326133261432615326163261732618326193262032621326223262332624326253262632627326283262932630326313263232633326343263532636326373263832639326403264132642326433264432645326463264732648326493265032651326523265332654326553265632657326583265932660326613266232663326643266532666326673266832669326703267132672326733267432675326763267732678326793268032681326823268332684326853268632687326883268932690326913269232693326943269532696326973269832699327003270132702327033270432705327063270732708327093271032711327123271332714327153271632717327183271932720327213272232723327243272532726327273272832729327303273132732327333273432735327363273732738327393274032741327423274332744327453274632747327483274932750327513275232753327543275532756327573275832759327603276132762327633276432765327663276732768327693277032771327723277332774327753277632777327783277932780327813278232783327843278532786327873278832789327903279132792327933279432795327963279732798327993280032801328023280332804328053280632807328083280932810328113281232813328143281532816328173281832819328203282132822328233282432825328263282732828328293283032831328323283332834328353283632837328383283932840328413284232843328443284532846328473284832849328503285132852328533285432855328563285732858328593286032861328623286332864328653286632867328683286932870328713287232873328743287532876328773287832879328803288132882328833288432885328863288732888328893289032891328923289332894328953289632897328983289932900329013290232903329043290532906329073290832909329103291132912329133291432915329163291732918329193292032921329223292332924329253292632927329283292932930329313293232933329343293532936329373293832939329403294132942329433294432945329463294732948329493295032951329523295332954329553295632957329583295932960329613296232963329643296532966329673296832969329703297132972329733297432975329763297732978329793298032981329823298332984329853298632987329883298932990329913299232993329943299532996329973299832999330003300133002330033300433005330063300733008330093301033011330123301333014330153301633017330183301933020330213302233023330243302533026330273302833029330303303133032330333303433035330363303733038330393304033041330423304333044330453304633047330483304933050330513305233053330543305533056330573305833059330603306133062330633306433065330663306733068330693307033071330723307333074330753307633077330783307933080330813308233083330843308533086330873308833089330903309133092330933309433095330963309733098330993310033101331023310333104331053310633107331083310933110331113311233113331143311533116331173311833119331203312133122331233312433125331263312733128331293313033131331323313333134331353313633137331383313933140331413314233143331443314533146331473314833149331503315133152331533315433155331563315733158331593316033161331623316333164331653316633167331683316933170331713317233173331743317533176331773317833179331803318133182331833318433185331863318733188331893319033191331923319333194331953319633197331983319933200332013320233203332043320533206332073320833209332103321133212332133321433215332163321733218332193322033221332223322333224332253322633227332283322933230332313323233233332343323533236332373323833239332403324133242332433324433245332463324733248332493325033251332523325333254332553325633257332583325933260332613326233263332643326533266332673326833269332703327133272332733327433275332763327733278332793328033281332823328333284332853328633287332883328933290332913329233293332943329533296332973329833299333003330133302333033330433305333063330733308333093331033311333123331333314333153331633317333183331933320333213332233323333243332533326333273332833329333303333133332333333333433335333363333733338333393334033341333423334333344333453334633347333483334933350333513335233353333543335533356333573335833359333603336133362333633336433365333663336733368333693337033371333723337333374333753337633377333783337933380333813338233383333843338533386333873338833389333903339133392333933339433395333963339733398333993340033401334023340333404334053340633407334083340933410334113341233413334143341533416334173341833419334203342133422334233342433425334263342733428334293343033431334323343333434334353343633437334383343933440334413344233443334443344533446334473344833449334503345133452334533345433455334563345733458334593346033461334623346333464334653346633467334683346933470334713347233473334743347533476334773347833479334803348133482334833348433485334863348733488334893349033491334923349333494334953349633497334983349933500335013350233503335043350533506335073350833509335103351133512335133351433515335163351733518335193352033521335223352333524335253352633527335283352933530335313353233533335343353533536335373353833539335403354133542335433354433545335463354733548335493355033551335523355333554335553355633557335583355933560335613356233563335643356533566335673356833569335703357133572335733357433575335763357733578335793358033581335823358333584335853358633587335883358933590335913359233593335943359533596335973359833599336003360133602336033360433605336063360733608336093361033611336123361333614336153361633617336183361933620336213362233623336243362533626336273362833629336303363133632336333363433635336363363733638336393364033641336423364333644336453364633647336483364933650336513365233653336543365533656336573365833659336603366133662336633366433665336663366733668336693367033671336723367333674336753367633677336783367933680336813368233683336843368533686336873368833689336903369133692336933369433695336963369733698336993370033701337023370333704337053370633707337083370933710337113371233713337143371533716337173371833719337203372133722337233372433725337263372733728337293373033731337323373333734337353373633737337383373933740337413374233743337443374533746337473374833749337503375133752337533375433755337563375733758337593376033761337623376333764337653376633767337683376933770337713377233773337743377533776337773377833779337803378133782337833378433785337863378733788337893379033791337923379333794337953379633797337983379933800338013380233803338043380533806338073380833809338103381133812338133381433815338163381733818338193382033821338223382333824338253382633827338283382933830338313383233833338343383533836338373383833839338403384133842338433384433845338463384733848338493385033851338523385333854338553385633857338583385933860338613386233863338643386533866338673386833869338703387133872338733387433875338763387733878338793388033881338823388333884338853388633887338883388933890338913389233893338943389533896338973389833899339003390133902339033390433905339063390733908339093391033911339123391333914339153391633917339183391933920339213392233923339243392533926339273392833929339303393133932339333393433935339363393733938339393394033941339423394333944339453394633947339483394933950339513395233953339543395533956339573395833959339603396133962339633396433965339663396733968339693397033971339723397333974339753397633977339783397933980339813398233983339843398533986339873398833989339903399133992339933399433995339963399733998339993400034001340023400334004340053400634007340083400934010340113401234013340143401534016340173401834019340203402134022340233402434025340263402734028340293403034031340323403334034340353403634037340383403934040340413404234043340443404534046340473404834049340503405134052340533405434055340563405734058340593406034061340623406334064340653406634067340683406934070340713407234073340743407534076340773407834079340803408134082340833408434085340863408734088340893409034091340923409334094340953409634097340983409934100341013410234103341043410534106341073410834109341103411134112341133411434115341163411734118341193412034121341223412334124341253412634127341283412934130341313413234133341343413534136341373413834139341403414134142341433414434145341463414734148341493415034151341523415334154341553415634157341583415934160341613416234163341643416534166341673416834169341703417134172341733417434175341763417734178341793418034181341823418334184341853418634187341883418934190341913419234193341943419534196341973419834199342003420134202342033420434205342063420734208342093421034211342123421334214342153421634217342183421934220342213422234223342243422534226342273422834229342303423134232342333423434235342363423734238342393424034241342423424334244342453424634247342483424934250342513425234253342543425534256342573425834259342603426134262342633426434265342663426734268342693427034271342723427334274342753427634277342783427934280342813428234283342843428534286342873428834289342903429134292342933429434295342963429734298342993430034301343023430334304343053430634307343083430934310343113431234313343143431534316343173431834319343203432134322343233432434325343263432734328343293433034331343323433334334343353433634337343383433934340343413434234343343443434534346343473434834349343503435134352343533435434355343563435734358343593436034361343623436334364343653436634367343683436934370343713437234373343743437534376343773437834379343803438134382343833438434385343863438734388343893439034391343923439334394343953439634397343983439934400344013440234403344043440534406344073440834409344103441134412344133441434415344163441734418344193442034421344223442334424344253442634427344283442934430344313443234433344343443534436344373443834439344403444134442344433444434445344463444734448344493445034451344523445334454344553445634457344583445934460344613446234463344643446534466344673446834469344703447134472344733447434475344763447734478344793448034481344823448334484344853448634487344883448934490344913449234493344943449534496344973449834499345003450134502345033450434505345063450734508345093451034511345123451334514345153451634517345183451934520345213452234523345243452534526345273452834529345303453134532345333453434535345363453734538345393454034541345423454334544345453454634547345483454934550345513455234553345543455534556345573455834559345603456134562345633456434565345663456734568345693457034571345723457334574345753457634577345783457934580345813458234583345843458534586345873458834589345903459134592345933459434595345963459734598345993460034601346023460334604346053460634607346083460934610346113461234613346143461534616346173461834619346203462134622346233462434625346263462734628346293463034631346323463334634346353463634637346383463934640346413464234643346443464534646346473464834649346503465134652346533465434655346563465734658346593466034661346623466334664346653466634667346683466934670346713467234673346743467534676346773467834679346803468134682346833468434685346863468734688346893469034691346923469334694346953469634697346983469934700347013470234703347043470534706347073470834709347103471134712347133471434715347163471734718347193472034721347223472334724347253472634727347283472934730347313473234733347343473534736347373473834739347403474134742347433474434745347463474734748347493475034751347523475334754347553475634757347583475934760347613476234763347643476534766347673476834769347703477134772347733477434775347763477734778347793478034781347823478334784347853478634787347883478934790347913479234793347943479534796347973479834799348003480134802348033480434805348063480734808348093481034811348123481334814348153481634817348183481934820348213482234823348243482534826348273482834829348303483134832348333483434835348363483734838348393484034841348423484334844348453484634847348483484934850348513485234853348543485534856348573485834859348603486134862348633486434865348663486734868348693487034871348723487334874348753487634877348783487934880348813488234883348843488534886348873488834889348903489134892348933489434895348963489734898348993490034901349023490334904349053490634907349083490934910349113491234913349143491534916349173491834919349203492134922349233492434925349263492734928349293493034931349323493334934349353493634937349383493934940349413494234943349443494534946349473494834949349503495134952349533495434955349563495734958349593496034961349623496334964349653496634967349683496934970349713497234973349743497534976349773497834979349803498134982349833498434985349863498734988349893499034991349923499334994349953499634997349983499935000350013500235003350043500535006350073500835009350103501135012350133501435015350163501735018350193502035021350223502335024350253502635027350283502935030350313503235033350343503535036350373503835039350403504135042350433504435045350463504735048350493505035051350523505335054350553505635057350583505935060350613506235063350643506535066350673506835069350703507135072350733507435075350763507735078350793508035081350823508335084350853508635087350883508935090350913509235093350943509535096350973509835099351003510135102351033510435105351063510735108351093511035111351123511335114351153511635117351183511935120351213512235123351243512535126351273512835129351303513135132351333513435135351363513735138351393514035141351423514335144351453514635147351483514935150351513515235153351543515535156351573515835159351603516135162351633516435165351663516735168351693517035171351723517335174351753517635177351783517935180351813518235183351843518535186351873518835189351903519135192351933519435195351963519735198351993520035201352023520335204352053520635207352083520935210352113521235213352143521535216352173521835219352203522135222352233522435225352263522735228352293523035231352323523335234352353523635237352383523935240352413524235243352443524535246352473524835249352503525135252352533525435255352563525735258352593526035261352623526335264352653526635267352683526935270352713527235273352743527535276352773527835279352803528135282352833528435285352863528735288352893529035291352923529335294352953529635297352983529935300353013530235303353043530535306353073530835309353103531135312353133531435315353163531735318353193532035321353223532335324353253532635327353283532935330353313533235333353343533535336353373533835339353403534135342353433534435345353463534735348353493535035351353523535335354353553535635357353583535935360353613536235363353643536535366353673536835369353703537135372353733537435375353763537735378353793538035381353823538335384353853538635387353883538935390353913539235393353943539535396353973539835399354003540135402354033540435405354063540735408354093541035411354123541335414354153541635417354183541935420354213542235423354243542535426354273542835429354303543135432354333543435435354363543735438354393544035441354423544335444354453544635447354483544935450354513545235453354543545535456354573545835459354603546135462354633546435465354663546735468354693547035471354723547335474354753547635477354783547935480354813548235483354843548535486354873548835489354903549135492354933549435495354963549735498354993550035501355023550335504355053550635507355083550935510355113551235513355143551535516355173551835519355203552135522355233552435525355263552735528355293553035531355323553335534355353553635537355383553935540355413554235543355443554535546355473554835549355503555135552355533555435555355563555735558355593556035561355623556335564355653556635567355683556935570355713557235573355743557535576355773557835579355803558135582355833558435585355863558735588355893559035591355923559335594355953559635597355983559935600356013560235603356043560535606356073560835609356103561135612356133561435615356163561735618356193562035621356223562335624356253562635627356283562935630356313563235633356343563535636356373563835639356403564135642356433564435645356463564735648356493565035651356523565335654356553565635657356583565935660356613566235663356643566535666356673566835669356703567135672356733567435675356763567735678356793568035681356823568335684356853568635687356883568935690356913569235693356943569535696356973569835699357003570135702357033570435705357063570735708357093571035711357123571335714357153571635717357183571935720357213572235723357243572535726357273572835729357303573135732357333573435735357363573735738357393574035741357423574335744357453574635747357483574935750357513575235753357543575535756357573575835759357603576135762357633576435765357663576735768357693577035771357723577335774357753577635777357783577935780357813578235783357843578535786357873578835789357903579135792357933579435795357963579735798357993580035801358023580335804358053580635807358083580935810358113581235813358143581535816358173581835819358203582135822358233582435825358263582735828358293583035831358323583335834358353583635837358383583935840358413584235843358443584535846358473584835849358503585135852358533585435855358563585735858358593586035861358623586335864358653586635867358683586935870358713587235873358743587535876358773587835879358803588135882358833588435885358863588735888358893589035891358923589335894358953589635897358983589935900359013590235903359043590535906359073590835909359103591135912359133591435915359163591735918359193592035921359223592335924359253592635927359283592935930359313593235933359343593535936359373593835939359403594135942359433594435945359463594735948359493595035951359523595335954359553595635957359583595935960359613596235963359643596535966359673596835969359703597135972359733597435975359763597735978359793598035981359823598335984359853598635987359883598935990359913599235993359943599535996359973599835999360003600136002360033600436005360063600736008360093601036011360123601336014360153601636017360183601936020360213602236023360243602536026360273602836029360303603136032360333603436035360363603736038360393604036041360423604336044360453604636047360483604936050360513605236053360543605536056360573605836059360603606136062360633606436065360663606736068360693607036071360723607336074360753607636077360783607936080360813608236083360843608536086360873608836089360903609136092360933609436095360963609736098360993610036101361023610336104361053610636107361083610936110361113611236113361143611536116361173611836119361203612136122361233612436125361263612736128361293613036131361323613336134361353613636137361383613936140361413614236143361443614536146361473614836149361503615136152361533615436155361563615736158361593616036161361623616336164361653616636167361683616936170361713617236173361743617536176361773617836179361803618136182361833618436185361863618736188361893619036191361923619336194361953619636197361983619936200362013620236203362043620536206362073620836209362103621136212362133621436215362163621736218362193622036221362223622336224362253622636227362283622936230362313623236233362343623536236362373623836239362403624136242362433624436245362463624736248362493625036251362523625336254362553625636257362583625936260362613626236263362643626536266362673626836269362703627136272362733627436275362763627736278362793628036281362823628336284362853628636287362883628936290362913629236293362943629536296362973629836299363003630136302363033630436305363063630736308363093631036311363123631336314363153631636317363183631936320363213632236323363243632536326363273632836329363303633136332363333633436335363363633736338363393634036341363423634336344363453634636347363483634936350363513635236353363543635536356363573635836359363603636136362363633636436365363663636736368363693637036371363723637336374363753637636377363783637936380363813638236383363843638536386363873638836389363903639136392363933639436395363963639736398363993640036401364023640336404364053640636407364083640936410364113641236413364143641536416364173641836419364203642136422364233642436425364263642736428364293643036431364323643336434364353643636437364383643936440364413644236443364443644536446364473644836449364503645136452364533645436455364563645736458364593646036461364623646336464364653646636467364683646936470364713647236473364743647536476364773647836479364803648136482364833648436485364863648736488364893649036491364923649336494364953649636497364983649936500365013650236503365043650536506365073650836509365103651136512365133651436515365163651736518365193652036521365223652336524365253652636527365283652936530365313653236533365343653536536365373653836539365403654136542365433654436545365463654736548365493655036551365523655336554365553655636557365583655936560365613656236563365643656536566365673656836569365703657136572365733657436575365763657736578365793658036581365823658336584365853658636587365883658936590365913659236593365943659536596365973659836599366003660136602366033660436605366063660736608366093661036611366123661336614366153661636617366183661936620366213662236623366243662536626366273662836629366303663136632366333663436635366363663736638366393664036641366423664336644366453664636647366483664936650366513665236653366543665536656366573665836659366603666136662366633666436665366663666736668366693667036671366723667336674366753667636677366783667936680366813668236683366843668536686366873668836689366903669136692366933669436695366963669736698366993670036701367023670336704367053670636707367083670936710367113671236713367143671536716367173671836719367203672136722367233672436725367263672736728367293673036731367323673336734367353673636737367383673936740367413674236743367443674536746367473674836749367503675136752367533675436755367563675736758367593676036761367623676336764367653676636767367683676936770367713677236773367743677536776367773677836779367803678136782367833678436785367863678736788367893679036791367923679336794367953679636797367983679936800368013680236803368043680536806368073680836809368103681136812368133681436815368163681736818368193682036821368223682336824368253682636827368283682936830368313683236833368343683536836368373683836839368403684136842368433684436845368463684736848368493685036851368523685336854368553685636857368583685936860368613686236863368643686536866368673686836869368703687136872368733687436875368763687736878368793688036881368823688336884368853688636887368883688936890368913689236893368943689536896368973689836899369003690136902369033690436905369063690736908369093691036911369123691336914369153691636917369183691936920369213692236923369243692536926369273692836929369303693136932369333693436935369363693736938369393694036941369423694336944369453694636947369483694936950369513695236953369543695536956369573695836959369603696136962369633696436965369663696736968369693697036971369723697336974369753697636977369783697936980369813698236983369843698536986369873698836989369903699136992369933699436995369963699736998369993700037001370023700337004370053700637007370083700937010370113701237013370143701537016370173701837019370203702137022370233702437025370263702737028370293703037031370323703337034370353703637037370383703937040370413704237043370443704537046370473704837049370503705137052370533705437055370563705737058370593706037061370623706337064370653706637067370683706937070370713707237073370743707537076370773707837079370803708137082370833708437085370863708737088370893709037091370923709337094370953709637097370983709937100371013710237103371043710537106371073710837109371103711137112371133711437115371163711737118371193712037121371223712337124371253712637127371283712937130371313713237133371343713537136371373713837139371403714137142371433714437145371463714737148371493715037151371523715337154371553715637157371583715937160371613716237163371643716537166371673716837169371703717137172371733717437175371763717737178371793718037181371823718337184371853718637187371883718937190371913719237193371943719537196371973719837199372003720137202372033720437205372063720737208372093721037211372123721337214372153721637217372183721937220372213722237223372243722537226372273722837229372303723137232372333723437235372363723737238372393724037241372423724337244372453724637247372483724937250372513725237253372543725537256372573725837259372603726137262372633726437265372663726737268372693727037271372723727337274372753727637277372783727937280372813728237283372843728537286372873728837289372903729137292372933729437295372963729737298372993730037301373023730337304373053730637307373083730937310373113731237313373143731537316373173731837319373203732137322373233732437325373263732737328373293733037331373323733337334373353733637337373383733937340373413734237343373443734537346373473734837349373503735137352373533735437355373563735737358373593736037361373623736337364373653736637367373683736937370373713737237373373743737537376373773737837379373803738137382373833738437385373863738737388373893739037391373923739337394373953739637397373983739937400374013740237403374043740537406374073740837409374103741137412374133741437415374163741737418374193742037421374223742337424374253742637427374283742937430374313743237433374343743537436374373743837439374403744137442374433744437445374463744737448374493745037451374523745337454374553745637457374583745937460374613746237463374643746537466374673746837469374703747137472374733747437475374763747737478374793748037481374823748337484374853748637487374883748937490374913749237493374943749537496374973749837499375003750137502375033750437505375063750737508375093751037511375123751337514375153751637517375183751937520375213752237523375243752537526375273752837529375303753137532375333753437535375363753737538375393754037541375423754337544375453754637547375483754937550375513755237553375543755537556375573755837559375603756137562375633756437565375663756737568375693757037571375723757337574375753757637577375783757937580375813758237583375843758537586375873758837589375903759137592375933759437595375963759737598375993760037601376023760337604376053760637607376083760937610376113761237613376143761537616376173761837619376203762137622376233762437625376263762737628376293763037631376323763337634376353763637637376383763937640376413764237643376443764537646376473764837649376503765137652376533765437655376563765737658376593766037661376623766337664376653766637667376683766937670376713767237673376743767537676376773767837679376803768137682376833768437685376863768737688376893769037691376923769337694376953769637697376983769937700377013770237703377043770537706377073770837709377103771137712377133771437715377163771737718377193772037721377223772337724377253772637727377283772937730377313773237733377343773537736377373773837739377403774137742377433774437745377463774737748377493775037751377523775337754377553775637757377583775937760377613776237763377643776537766377673776837769377703777137772377733777437775377763777737778377793778037781377823778337784377853778637787377883778937790377913779237793377943779537796377973779837799378003780137802378033780437805378063780737808378093781037811378123781337814378153781637817378183781937820378213782237823378243782537826378273782837829378303783137832378333783437835378363783737838378393784037841378423784337844378453784637847378483784937850378513785237853378543785537856378573785837859378603786137862378633786437865378663786737868378693787037871378723787337874378753787637877378783787937880378813788237883378843788537886378873788837889378903789137892378933789437895378963789737898378993790037901379023790337904379053790637907379083790937910379113791237913379143791537916379173791837919379203792137922379233792437925379263792737928379293793037931379323793337934379353793637937379383793937940379413794237943379443794537946379473794837949379503795137952379533795437955379563795737958379593796037961379623796337964379653796637967379683796937970379713797237973379743797537976379773797837979379803798137982379833798437985379863798737988379893799037991379923799337994379953799637997379983799938000380013800238003380043800538006380073800838009380103801138012380133801438015380163801738018380193802038021380223802338024380253802638027380283802938030380313803238033380343803538036380373803838039380403804138042380433804438045380463804738048380493805038051380523805338054380553805638057380583805938060380613806238063380643806538066380673806838069380703807138072380733807438075380763807738078380793808038081380823808338084380853808638087380883808938090380913809238093380943809538096380973809838099381003810138102381033810438105381063810738108381093811038111381123811338114381153811638117381183811938120381213812238123381243812538126381273812838129381303813138132381333813438135381363813738138381393814038141381423814338144381453814638147381483814938150381513815238153381543815538156381573815838159381603816138162381633816438165381663816738168381693817038171381723817338174381753817638177381783817938180381813818238183381843818538186381873818838189381903819138192381933819438195381963819738198381993820038201382023820338204382053820638207382083820938210382113821238213382143821538216382173821838219382203822138222382233822438225382263822738228382293823038231382323823338234382353823638237382383823938240382413824238243382443824538246382473824838249382503825138252382533825438255382563825738258382593826038261382623826338264382653826638267382683826938270382713827238273382743827538276382773827838279382803828138282382833828438285382863828738288382893829038291382923829338294382953829638297382983829938300383013830238303383043830538306383073830838309383103831138312383133831438315383163831738318383193832038321383223832338324383253832638327383283832938330383313833238333383343833538336383373833838339383403834138342383433834438345383463834738348383493835038351383523835338354383553835638357383583835938360383613836238363383643836538366383673836838369383703837138372383733837438375383763837738378383793838038381383823838338384383853838638387383883838938390383913839238393383943839538396383973839838399384003840138402384033840438405384063840738408384093841038411384123841338414384153841638417384183841938420384213842238423384243842538426384273842838429384303843138432384333843438435384363843738438384393844038441384423844338444384453844638447384483844938450384513845238453384543845538456384573845838459384603846138462384633846438465384663846738468384693847038471384723847338474384753847638477384783847938480384813848238483384843848538486384873848838489384903849138492384933849438495384963849738498384993850038501385023850338504385053850638507385083850938510385113851238513385143851538516385173851838519385203852138522385233852438525385263852738528385293853038531385323853338534385353853638537385383853938540385413854238543385443854538546385473854838549385503855138552385533855438555385563855738558385593856038561385623856338564385653856638567385683856938570385713857238573385743857538576385773857838579385803858138582385833858438585385863858738588385893859038591385923859338594385953859638597385983859938600386013860238603386043860538606386073860838609386103861138612386133861438615386163861738618386193862038621386223862338624386253862638627386283862938630386313863238633386343863538636386373863838639386403864138642386433864438645386463864738648386493865038651386523865338654386553865638657386583865938660386613866238663386643866538666386673866838669386703867138672386733867438675386763867738678386793868038681386823868338684386853868638687386883868938690386913869238693386943869538696386973869838699387003870138702387033870438705387063870738708387093871038711387123871338714387153871638717387183871938720387213872238723387243872538726387273872838729387303873138732387333873438735387363873738738387393874038741387423874338744387453874638747387483874938750387513875238753387543875538756387573875838759387603876138762387633876438765387663876738768387693877038771387723877338774387753877638777387783877938780387813878238783387843878538786387873878838789387903879138792387933879438795387963879738798387993880038801388023880338804388053880638807388083880938810388113881238813388143881538816388173881838819388203882138822388233882438825388263882738828388293883038831388323883338834388353883638837388383883938840388413884238843388443884538846388473884838849388503885138852388533885438855388563885738858388593886038861388623886338864388653886638867388683886938870388713887238873388743887538876388773887838879388803888138882388833888438885388863888738888388893889038891388923889338894388953889638897388983889938900389013890238903389043890538906389073890838909389103891138912389133891438915389163891738918389193892038921389223892338924389253892638927389283892938930389313893238933389343893538936389373893838939389403894138942389433894438945389463894738948389493895038951389523895338954389553895638957389583895938960389613896238963389643896538966389673896838969389703897138972389733897438975389763897738978389793898038981389823898338984389853898638987389883898938990389913899238993389943899538996389973899838999390003900139002390033900439005390063900739008390093901039011390123901339014390153901639017390183901939020390213902239023390243902539026390273902839029390303903139032390333903439035390363903739038390393904039041390423904339044390453904639047390483904939050390513905239053390543905539056390573905839059390603906139062390633906439065390663906739068390693907039071390723907339074390753907639077390783907939080390813908239083390843908539086390873908839089390903909139092390933909439095390963909739098390993910039101391023910339104391053910639107391083910939110391113911239113391143911539116391173911839119391203912139122391233912439125391263912739128391293913039131391323913339134391353913639137391383913939140391413914239143391443914539146391473914839149391503915139152391533915439155391563915739158391593916039161391623916339164391653916639167391683916939170391713917239173391743917539176391773917839179391803918139182391833918439185391863918739188391893919039191391923919339194391953919639197391983919939200392013920239203392043920539206392073920839209392103921139212392133921439215392163921739218392193922039221392223922339224392253922639227392283922939230392313923239233392343923539236392373923839239392403924139242392433924439245392463924739248392493925039251392523925339254392553925639257392583925939260392613926239263392643926539266392673926839269392703927139272392733927439275392763927739278392793928039281392823928339284392853928639287392883928939290392913929239293392943929539296392973929839299393003930139302393033930439305393063930739308393093931039311393123931339314393153931639317393183931939320393213932239323393243932539326393273932839329393303933139332393333933439335393363933739338393393934039341393423934339344393453934639347393483934939350393513935239353393543935539356393573935839359393603936139362393633936439365393663936739368393693937039371393723937339374393753937639377393783937939380393813938239383393843938539386393873938839389393903939139392393933939439395393963939739398393993940039401394023940339404394053940639407394083940939410394113941239413394143941539416394173941839419394203942139422394233942439425394263942739428394293943039431394323943339434394353943639437394383943939440394413944239443394443944539446394473944839449394503945139452394533945439455394563945739458394593946039461394623946339464394653946639467394683946939470394713947239473394743947539476394773947839479394803948139482394833948439485394863948739488394893949039491394923949339494394953949639497394983949939500395013950239503395043950539506395073950839509395103951139512395133951439515395163951739518395193952039521395223952339524395253952639527395283952939530395313953239533395343953539536395373953839539395403954139542395433954439545395463954739548395493955039551395523955339554395553955639557395583955939560395613956239563395643956539566395673956839569395703957139572395733957439575395763957739578395793958039581395823958339584395853958639587395883958939590395913959239593395943959539596395973959839599396003960139602396033960439605396063960739608396093961039611396123961339614396153961639617396183961939620396213962239623396243962539626396273962839629396303963139632396333963439635396363963739638396393964039641396423964339644396453964639647396483964939650396513965239653396543965539656396573965839659396603966139662396633966439665396663966739668396693967039671396723967339674396753967639677396783967939680396813968239683396843968539686396873968839689396903969139692396933969439695396963969739698396993970039701397023970339704397053970639707397083970939710397113971239713397143971539716397173971839719397203972139722397233972439725397263972739728397293973039731397323973339734397353973639737397383973939740397413974239743397443974539746397473974839749397503975139752397533975439755397563975739758397593976039761397623976339764397653976639767397683976939770397713977239773397743977539776397773977839779397803978139782397833978439785397863978739788397893979039791397923979339794397953979639797397983979939800398013980239803398043980539806398073980839809398103981139812398133981439815398163981739818398193982039821398223982339824398253982639827398283982939830398313983239833398343983539836398373983839839398403984139842398433984439845398463984739848398493985039851398523985339854398553985639857398583985939860398613986239863398643986539866398673986839869398703987139872398733987439875398763987739878398793988039881398823988339884398853988639887398883988939890398913989239893398943989539896398973989839899399003990139902399033990439905399063990739908399093991039911399123991339914399153991639917399183991939920399213992239923399243992539926399273992839929399303993139932399333993439935399363993739938399393994039941399423994339944399453994639947399483994939950399513995239953399543995539956399573995839959399603996139962399633996439965399663996739968399693997039971399723997339974399753997639977399783997939980399813998239983399843998539986399873998839989399903999139992399933999439995399963999739998399994000040001400024000340004400054000640007400084000940010400114001240013400144001540016400174001840019400204002140022400234002440025400264002740028400294003040031400324003340034400354003640037400384003940040400414004240043400444004540046400474004840049400504005140052400534005440055400564005740058400594006040061400624006340064400654006640067400684006940070400714007240073400744007540076400774007840079400804008140082400834008440085400864008740088400894009040091400924009340094400954009640097400984009940100401014010240103401044010540106401074010840109401104011140112401134011440115401164011740118401194012040121401224012340124401254012640127401284012940130401314013240133401344013540136401374013840139401404014140142401434014440145401464014740148401494015040151401524015340154401554015640157401584015940160401614016240163401644016540166401674016840169401704017140172401734017440175401764017740178401794018040181401824018340184401854018640187401884018940190401914019240193401944019540196401974019840199402004020140202402034020440205402064020740208402094021040211402124021340214402154021640217402184021940220402214022240223402244022540226402274022840229402304023140232402334023440235402364023740238402394024040241402424024340244402454024640247402484024940250402514025240253402544025540256402574025840259402604026140262402634026440265402664026740268402694027040271402724027340274402754027640277402784027940280402814028240283402844028540286402874028840289402904029140292402934029440295402964029740298402994030040301403024030340304403054030640307403084030940310403114031240313403144031540316403174031840319403204032140322403234032440325403264032740328403294033040331403324033340334403354033640337403384033940340403414034240343403444034540346403474034840349403504035140352403534035440355403564035740358403594036040361403624036340364403654036640367403684036940370403714037240373403744037540376403774037840379403804038140382403834038440385403864038740388403894039040391403924039340394403954039640397403984039940400404014040240403404044040540406404074040840409404104041140412404134041440415404164041740418404194042040421404224042340424404254042640427404284042940430404314043240433404344043540436404374043840439404404044140442404434044440445404464044740448404494045040451404524045340454404554045640457404584045940460404614046240463404644046540466404674046840469404704047140472404734047440475404764047740478404794048040481404824048340484404854048640487404884048940490404914049240493404944049540496404974049840499405004050140502405034050440505405064050740508405094051040511405124051340514405154051640517405184051940520405214052240523405244052540526405274052840529405304053140532405334053440535405364053740538405394054040541405424054340544405454054640547405484054940550405514055240553405544055540556405574055840559405604056140562405634056440565405664056740568405694057040571405724057340574405754057640577405784057940580405814058240583405844058540586405874058840589405904059140592405934059440595405964059740598405994060040601406024060340604406054060640607406084060940610406114061240613406144061540616406174061840619406204062140622406234062440625406264062740628406294063040631406324063340634406354063640637406384063940640406414064240643406444064540646406474064840649406504065140652406534065440655406564065740658406594066040661406624066340664406654066640667406684066940670406714067240673406744067540676406774067840679406804068140682406834068440685406864068740688406894069040691406924069340694406954069640697406984069940700407014070240703407044070540706407074070840709407104071140712407134071440715407164071740718407194072040721407224072340724407254072640727407284072940730407314073240733407344073540736407374073840739407404074140742407434074440745407464074740748407494075040751407524075340754407554075640757407584075940760407614076240763407644076540766407674076840769407704077140772407734077440775407764077740778407794078040781407824078340784407854078640787407884078940790407914079240793407944079540796407974079840799408004080140802408034080440805408064080740808408094081040811408124081340814408154081640817408184081940820408214082240823408244082540826408274082840829408304083140832408334083440835408364083740838408394084040841408424084340844408454084640847408484084940850408514085240853408544085540856408574085840859408604086140862408634086440865408664086740868408694087040871408724087340874408754087640877408784087940880408814088240883408844088540886408874088840889408904089140892408934089440895408964089740898408994090040901409024090340904409054090640907409084090940910409114091240913409144091540916409174091840919409204092140922409234092440925409264092740928409294093040931409324093340934409354093640937409384093940940409414094240943409444094540946409474094840949409504095140952409534095440955409564095740958409594096040961409624096340964409654096640967409684096940970409714097240973409744097540976409774097840979409804098140982409834098440985409864098740988409894099040991409924099340994409954099640997409984099941000410014100241003410044100541006410074100841009410104101141012410134101441015410164101741018410194102041021410224102341024410254102641027410284102941030410314103241033410344103541036410374103841039410404104141042410434104441045410464104741048410494105041051410524105341054410554105641057410584105941060410614106241063410644106541066410674106841069410704107141072410734107441075410764107741078410794108041081410824108341084410854108641087410884108941090410914109241093410944109541096410974109841099411004110141102411034110441105411064110741108411094111041111411124111341114411154111641117411184111941120411214112241123411244112541126411274112841129411304113141132411334113441135411364113741138411394114041141411424114341144411454114641147411484114941150411514115241153411544115541156411574115841159411604116141162411634116441165411664116741168411694117041171411724117341174411754117641177411784117941180411814118241183411844118541186411874118841189411904119141192411934119441195411964119741198411994120041201412024120341204412054120641207412084120941210412114121241213412144121541216412174121841219412204122141222412234122441225412264122741228412294123041231412324123341234412354123641237412384123941240412414124241243412444124541246412474124841249412504125141252412534125441255412564125741258412594126041261412624126341264412654126641267412684126941270412714127241273412744127541276412774127841279412804128141282412834128441285412864128741288412894129041291412924129341294412954129641297412984129941300413014130241303413044130541306413074130841309413104131141312413134131441315413164131741318413194132041321413224132341324413254132641327413284132941330413314133241333413344133541336413374133841339413404134141342413434134441345413464134741348413494135041351413524135341354413554135641357413584135941360413614136241363413644136541366413674136841369413704137141372413734137441375413764137741378413794138041381413824138341384413854138641387413884138941390413914139241393413944139541396413974139841399414004140141402414034140441405414064140741408414094141041411414124141341414414154141641417414184141941420414214142241423414244142541426414274142841429414304143141432414334143441435414364143741438414394144041441414424144341444414454144641447414484144941450414514145241453414544145541456414574145841459414604146141462414634146441465414664146741468414694147041471414724147341474414754147641477414784147941480414814148241483414844148541486414874148841489414904149141492414934149441495414964149741498414994150041501415024150341504415054150641507415084150941510415114151241513415144151541516415174151841519415204152141522415234152441525415264152741528415294153041531415324153341534415354153641537415384153941540415414154241543415444154541546415474154841549415504155141552415534155441555415564155741558415594156041561415624156341564415654156641567415684156941570415714157241573415744157541576415774157841579415804158141582415834158441585415864158741588415894159041591415924159341594415954159641597415984159941600416014160241603416044160541606416074160841609416104161141612416134161441615416164161741618416194162041621416224162341624416254162641627416284162941630416314163241633416344163541636416374163841639416404164141642416434164441645416464164741648416494165041651416524165341654416554165641657416584165941660416614166241663416644166541666416674166841669416704167141672416734167441675416764167741678416794168041681416824168341684416854168641687416884168941690416914169241693416944169541696416974169841699417004170141702417034170441705417064170741708417094171041711417124171341714417154171641717417184171941720417214172241723417244172541726417274172841729417304173141732417334173441735417364173741738417394174041741417424174341744417454174641747417484174941750417514175241753417544175541756417574175841759417604176141762417634176441765417664176741768417694177041771417724177341774417754177641777417784177941780417814178241783417844178541786417874178841789417904179141792417934179441795417964179741798417994180041801418024180341804418054180641807418084180941810418114181241813418144181541816418174181841819418204182141822418234182441825418264182741828418294183041831418324183341834418354183641837418384183941840418414184241843418444184541846418474184841849418504185141852418534185441855418564185741858418594186041861418624186341864418654186641867418684186941870418714187241873418744187541876418774187841879418804188141882418834188441885418864188741888418894189041891418924189341894418954189641897418984189941900419014190241903419044190541906419074190841909419104191141912419134191441915419164191741918419194192041921419224192341924419254192641927419284192941930419314193241933419344193541936419374193841939419404194141942419434194441945419464194741948419494195041951419524195341954419554195641957419584195941960419614196241963419644196541966419674196841969419704197141972419734197441975419764197741978419794198041981419824198341984419854198641987419884198941990419914199241993419944199541996419974199841999420004200142002420034200442005420064200742008420094201042011420124201342014420154201642017420184201942020420214202242023420244202542026420274202842029420304203142032420334203442035420364203742038420394204042041420424204342044420454204642047420484204942050420514205242053420544205542056420574205842059420604206142062420634206442065420664206742068420694207042071420724207342074420754207642077420784207942080420814208242083420844208542086420874208842089420904209142092420934209442095420964209742098420994210042101421024210342104421054210642107421084210942110421114211242113421144211542116421174211842119421204212142122421234212442125421264212742128421294213042131421324213342134421354213642137421384213942140421414214242143421444214542146421474214842149421504215142152421534215442155421564215742158421594216042161421624216342164421654216642167421684216942170421714217242173421744217542176421774217842179421804218142182421834218442185421864218742188421894219042191421924219342194421954219642197421984219942200422014220242203422044220542206422074220842209422104221142212422134221442215422164221742218422194222042221422224222342224422254222642227422284222942230422314223242233422344223542236422374223842239422404224142242422434224442245422464224742248422494225042251422524225342254422554225642257422584225942260422614226242263422644226542266422674226842269422704227142272422734227442275422764227742278422794228042281422824228342284422854228642287422884228942290422914229242293422944229542296422974229842299423004230142302423034230442305423064230742308423094231042311423124231342314423154231642317423184231942320423214232242323423244232542326423274232842329423304233142332423334233442335423364233742338423394234042341423424234342344423454234642347423484234942350423514235242353423544235542356423574235842359423604236142362423634236442365423664236742368423694237042371423724237342374423754237642377423784237942380423814238242383423844238542386423874238842389423904239142392423934239442395423964239742398423994240042401424024240342404424054240642407424084240942410424114241242413424144241542416424174241842419424204242142422424234242442425424264242742428424294243042431424324243342434424354243642437424384243942440424414244242443424444244542446424474244842449424504245142452424534245442455424564245742458424594246042461424624246342464424654246642467424684246942470424714247242473424744247542476424774247842479424804248142482424834248442485424864248742488424894249042491424924249342494424954249642497424984249942500425014250242503425044250542506425074250842509425104251142512425134251442515425164251742518425194252042521425224252342524425254252642527425284252942530425314253242533425344253542536425374253842539425404254142542425434254442545425464254742548425494255042551425524255342554425554255642557425584255942560425614256242563425644256542566425674256842569425704257142572425734257442575425764257742578425794258042581425824258342584425854258642587425884258942590425914259242593425944259542596425974259842599426004260142602426034260442605426064260742608426094261042611426124261342614426154261642617426184261942620426214262242623426244262542626426274262842629426304263142632426334263442635426364263742638426394264042641426424264342644426454264642647426484264942650426514265242653426544265542656426574265842659426604266142662426634266442665426664266742668426694267042671426724267342674426754267642677426784267942680426814268242683426844268542686426874268842689426904269142692426934269442695426964269742698426994270042701427024270342704427054270642707427084270942710427114271242713427144271542716427174271842719427204272142722427234272442725427264272742728427294273042731427324273342734427354273642737427384273942740427414274242743427444274542746427474274842749427504275142752427534275442755427564275742758427594276042761427624276342764427654276642767427684276942770427714277242773427744277542776427774277842779427804278142782427834278442785427864278742788427894279042791427924279342794427954279642797427984279942800428014280242803428044280542806428074280842809428104281142812428134281442815428164281742818428194282042821428224282342824428254282642827428284282942830428314283242833428344283542836428374283842839428404284142842428434284442845428464284742848428494285042851428524285342854428554285642857428584285942860428614286242863428644286542866428674286842869428704287142872428734287442875428764287742878428794288042881428824288342884428854288642887428884288942890428914289242893428944289542896428974289842899429004290142902429034290442905429064290742908429094291042911429124291342914429154291642917429184291942920429214292242923429244292542926429274292842929429304293142932429334293442935429364293742938429394294042941429424294342944429454294642947429484294942950429514295242953429544295542956429574295842959429604296142962429634296442965429664296742968429694297042971429724297342974429754297642977429784297942980429814298242983429844298542986429874298842989429904299142992429934299442995429964299742998429994300043001430024300343004430054300643007430084300943010430114301243013430144301543016430174301843019430204302143022430234302443025430264302743028430294303043031430324303343034430354303643037430384303943040430414304243043430444304543046430474304843049430504305143052430534305443055430564305743058430594306043061430624306343064430654306643067430684306943070430714307243073430744307543076430774307843079430804308143082430834308443085430864308743088430894309043091430924309343094430954309643097430984309943100431014310243103431044310543106431074310843109431104311143112431134311443115431164311743118431194312043121431224312343124431254312643127431284312943130431314313243133431344313543136431374313843139431404314143142431434314443145431464314743148431494315043151431524315343154431554315643157431584315943160431614316243163431644316543166431674316843169431704317143172431734317443175431764317743178431794318043181431824318343184431854318643187431884318943190431914319243193431944319543196431974319843199432004320143202432034320443205432064320743208432094321043211432124321343214432154321643217432184321943220432214322243223432244322543226432274322843229432304323143232432334323443235432364323743238432394324043241432424324343244432454324643247432484324943250432514325243253432544325543256432574325843259432604326143262432634326443265432664326743268432694327043271432724327343274432754327643277432784327943280432814328243283432844328543286432874328843289432904329143292432934329443295432964329743298432994330043301433024330343304433054330643307433084330943310433114331243313433144331543316433174331843319433204332143322433234332443325433264332743328433294333043331433324333343334433354333643337433384333943340433414334243343433444334543346433474334843349433504335143352433534335443355433564335743358433594336043361433624336343364433654336643367433684336943370433714337243373433744337543376433774337843379433804338143382433834338443385433864338743388433894339043391433924339343394433954339643397433984339943400434014340243403434044340543406434074340843409434104341143412434134341443415434164341743418434194342043421434224342343424434254342643427434284342943430434314343243433434344343543436434374343843439434404344143442434434344443445434464344743448434494345043451434524345343454434554345643457434584345943460434614346243463434644346543466434674346843469434704347143472434734347443475434764347743478434794348043481434824348343484434854348643487434884348943490434914349243493434944349543496434974349843499435004350143502435034350443505435064350743508435094351043511435124351343514435154351643517435184351943520435214352243523435244352543526435274352843529435304353143532435334353443535435364353743538435394354043541435424354343544435454354643547435484354943550435514355243553435544355543556435574355843559435604356143562435634356443565435664356743568435694357043571435724357343574435754357643577435784357943580435814358243583435844358543586435874358843589435904359143592435934359443595435964359743598435994360043601436024360343604436054360643607436084360943610436114361243613436144361543616436174361843619436204362143622436234362443625436264362743628436294363043631436324363343634436354363643637436384363943640436414364243643436444364543646436474364843649436504365143652436534365443655436564365743658436594366043661436624366343664436654366643667436684366943670436714367243673436744367543676436774367843679436804368143682436834368443685436864368743688436894369043691436924369343694436954369643697436984369943700437014370243703437044370543706437074370843709437104371143712437134371443715437164371743718437194372043721437224372343724437254372643727437284372943730437314373243733437344373543736437374373843739437404374143742437434374443745437464374743748437494375043751437524375343754437554375643757437584375943760437614376243763437644376543766437674376843769437704377143772437734377443775437764377743778437794378043781437824378343784437854378643787437884378943790437914379243793437944379543796437974379843799438004380143802438034380443805438064380743808438094381043811438124381343814438154381643817438184381943820438214382243823438244382543826438274382843829438304383143832438334383443835438364383743838438394384043841438424384343844438454384643847438484384943850438514385243853438544385543856438574385843859438604386143862438634386443865438664386743868438694387043871438724387343874438754387643877438784387943880438814388243883438844388543886438874388843889438904389143892438934389443895438964389743898438994390043901439024390343904439054390643907439084390943910439114391243913439144391543916439174391843919439204392143922439234392443925439264392743928439294393043931439324393343934439354393643937439384393943940439414394243943439444394543946439474394843949439504395143952439534395443955439564395743958439594396043961439624396343964439654396643967439684396943970439714397243973439744397543976439774397843979439804398143982439834398443985439864398743988439894399043991439924399343994439954399643997439984399944000440014400244003440044400544006440074400844009440104401144012440134401444015440164401744018440194402044021440224402344024440254402644027440284402944030440314403244033440344403544036440374403844039440404404144042440434404444045440464404744048440494405044051440524405344054440554405644057440584405944060440614406244063440644406544066440674406844069440704407144072440734407444075440764407744078440794408044081440824408344084440854408644087440884408944090440914409244093440944409544096440974409844099441004410144102441034410444105441064410744108441094411044111441124411344114441154411644117441184411944120441214412244123441244412544126441274412844129441304413144132441334413444135441364413744138441394414044141441424414344144441454414644147441484414944150441514415244153441544415544156441574415844159441604416144162441634416444165441664416744168441694417044171441724417344174441754417644177441784417944180441814418244183441844418544186441874418844189441904419144192441934419444195441964419744198441994420044201442024420344204442054420644207442084420944210442114421244213442144421544216442174421844219442204422144222442234422444225442264422744228442294423044231442324423344234442354423644237442384423944240442414424244243442444424544246442474424844249442504425144252442534425444255442564425744258442594426044261442624426344264442654426644267442684426944270442714427244273442744427544276442774427844279442804428144282442834428444285442864428744288442894429044291442924429344294442954429644297442984429944300443014430244303443044430544306443074430844309443104431144312443134431444315443164431744318443194432044321443224432344324443254432644327443284432944330443314433244333443344433544336443374433844339443404434144342443434434444345443464434744348443494435044351443524435344354443554435644357443584435944360443614436244363443644436544366443674436844369443704437144372443734437444375443764437744378443794438044381443824438344384443854438644387443884438944390443914439244393443944439544396443974439844399444004440144402444034440444405444064440744408444094441044411444124441344414444154441644417444184441944420444214442244423444244442544426444274442844429444304443144432444334443444435444364443744438444394444044441444424444344444444454444644447444484444944450444514445244453444544445544456444574445844459444604446144462444634446444465444664446744468444694447044471444724447344474444754447644477444784447944480444814448244483444844448544486444874448844489444904449144492444934449444495444964449744498444994450044501445024450344504445054450644507445084450944510445114451244513445144451544516445174451844519445204452144522445234452444525445264452744528445294453044531445324453344534445354453644537445384453944540445414454244543445444454544546445474454844549445504455144552445534455444555445564455744558445594456044561445624456344564445654456644567445684456944570445714457244573445744457544576445774457844579445804458144582445834458444585445864458744588445894459044591445924459344594445954459644597445984459944600446014460244603446044460544606446074460844609446104461144612446134461444615446164461744618446194462044621446224462344624446254462644627446284462944630446314463244633446344463544636446374463844639446404464144642446434464444645446464464744648446494465044651446524465344654446554465644657446584465944660446614466244663446644466544666446674466844669446704467144672446734467444675446764467744678446794468044681446824468344684446854468644687446884468944690446914469244693446944469544696446974469844699447004470144702447034470444705447064470744708447094471044711447124471344714447154471644717447184471944720447214472244723447244472544726447274472844729447304473144732447334473444735447364473744738447394474044741447424474344744447454474644747447484474944750447514475244753447544475544756447574475844759447604476144762447634476444765447664476744768447694477044771447724477344774447754477644777447784477944780447814478244783447844478544786447874478844789447904479144792447934479444795447964479744798447994480044801448024480344804448054480644807448084480944810448114481244813448144481544816448174481844819448204482144822448234482444825448264482744828448294483044831448324483344834448354483644837448384483944840448414484244843448444484544846448474484844849448504485144852448534485444855448564485744858448594486044861448624486344864448654486644867448684486944870448714487244873448744487544876448774487844879448804488144882448834488444885448864488744888448894489044891448924489344894448954489644897448984489944900449014490244903449044490544906449074490844909449104491144912449134491444915449164491744918449194492044921449224492344924449254492644927449284492944930449314493244933449344493544936449374493844939449404494144942449434494444945449464494744948449494495044951449524495344954449554495644957449584495944960449614496244963449644496544966449674496844969449704497144972449734497444975449764497744978449794498044981449824498344984449854498644987449884498944990449914499244993449944499544996449974499844999450004500145002450034500445005450064500745008450094501045011450124501345014450154501645017450184501945020450214502245023450244502545026450274502845029450304503145032450334503445035450364503745038450394504045041450424504345044450454504645047450484504945050450514505245053450544505545056450574505845059450604506145062450634506445065450664506745068450694507045071450724507345074450754507645077450784507945080450814508245083450844508545086450874508845089450904509145092450934509445095450964509745098450994510045101451024510345104451054510645107451084510945110451114511245113451144511545116451174511845119451204512145122451234512445125451264512745128451294513045131451324513345134451354513645137451384513945140451414514245143451444514545146451474514845149451504515145152451534515445155451564515745158451594516045161451624516345164451654516645167451684516945170451714517245173451744517545176451774517845179451804518145182451834518445185451864518745188451894519045191451924519345194451954519645197451984519945200452014520245203452044520545206452074520845209452104521145212452134521445215452164521745218452194522045221452224522345224452254522645227452284522945230452314523245233452344523545236452374523845239452404524145242452434524445245452464524745248452494525045251452524525345254452554525645257452584525945260452614526245263452644526545266452674526845269452704527145272452734527445275452764527745278452794528045281452824528345284452854528645287452884528945290452914529245293452944529545296452974529845299453004530145302453034530445305453064530745308453094531045311453124531345314453154531645317453184531945320453214532245323453244532545326453274532845329453304533145332453334533445335453364533745338453394534045341453424534345344453454534645347453484534945350453514535245353453544535545356453574535845359453604536145362453634536445365453664536745368453694537045371453724537345374453754537645377453784537945380453814538245383453844538545386453874538845389453904539145392453934539445395453964539745398453994540045401454024540345404454054540645407454084540945410454114541245413454144541545416454174541845419454204542145422454234542445425454264542745428454294543045431454324543345434454354543645437454384543945440454414544245443454444544545446454474544845449454504545145452454534545445455454564545745458454594546045461454624546345464454654546645467454684546945470454714547245473454744547545476454774547845479454804548145482454834548445485454864548745488454894549045491454924549345494454954549645497454984549945500455014550245503455044550545506455074550845509455104551145512455134551445515455164551745518455194552045521455224552345524455254552645527455284552945530455314553245533455344553545536455374553845539455404554145542455434554445545455464554745548455494555045551455524555345554455554555645557455584555945560455614556245563455644556545566455674556845569455704557145572455734557445575455764557745578455794558045581455824558345584455854558645587455884558945590455914559245593455944559545596455974559845599456004560145602456034560445605456064560745608456094561045611456124561345614456154561645617456184561945620456214562245623456244562545626456274562845629456304563145632456334563445635456364563745638456394564045641456424564345644456454564645647456484564945650456514565245653456544565545656456574565845659456604566145662456634566445665456664566745668456694567045671456724567345674456754567645677456784567945680456814568245683456844568545686456874568845689456904569145692456934569445695456964569745698456994570045701457024570345704457054570645707457084570945710457114571245713457144571545716457174571845719457204572145722457234572445725457264572745728457294573045731457324573345734457354573645737457384573945740457414574245743457444574545746457474574845749457504575145752457534575445755457564575745758457594576045761457624576345764457654576645767457684576945770457714577245773457744577545776457774577845779457804578145782457834578445785457864578745788457894579045791457924579345794457954579645797457984579945800458014580245803458044580545806458074580845809458104581145812458134581445815458164581745818458194582045821458224582345824458254582645827458284582945830458314583245833458344583545836458374583845839458404584145842458434584445845458464584745848458494585045851458524585345854458554585645857458584585945860458614586245863458644586545866458674586845869458704587145872458734587445875458764587745878458794588045881458824588345884458854588645887458884588945890458914589245893458944589545896458974589845899459004590145902459034590445905459064590745908459094591045911459124591345914459154591645917459184591945920459214592245923459244592545926459274592845929459304593145932459334593445935459364593745938459394594045941459424594345944459454594645947459484594945950459514595245953459544595545956459574595845959459604596145962459634596445965459664596745968459694597045971459724597345974459754597645977459784597945980459814598245983459844598545986459874598845989459904599145992459934599445995459964599745998459994600046001460024600346004460054600646007460084600946010460114601246013460144601546016460174601846019460204602146022460234602446025460264602746028460294603046031460324603346034460354603646037460384603946040460414604246043460444604546046460474604846049460504605146052460534605446055460564605746058460594606046061460624606346064460654606646067460684606946070460714607246073460744607546076460774607846079460804608146082460834608446085460864608746088460894609046091460924609346094460954609646097460984609946100461014610246103461044610546106461074610846109461104611146112461134611446115461164611746118461194612046121461224612346124461254612646127461284612946130461314613246133461344613546136461374613846139461404614146142461434614446145461464614746148461494615046151461524615346154461554615646157461584615946160461614616246163461644616546166461674616846169461704617146172461734617446175461764617746178461794618046181461824618346184461854618646187461884618946190461914619246193461944619546196461974619846199462004620146202462034620446205462064620746208462094621046211462124621346214462154621646217462184621946220462214622246223462244622546226462274622846229462304623146232462334623446235462364623746238462394624046241462424624346244462454624646247462484624946250462514625246253462544625546256462574625846259462604626146262462634626446265462664626746268462694627046271462724627346274462754627646277462784627946280462814628246283462844628546286462874628846289462904629146292462934629446295462964629746298462994630046301463024630346304463054630646307463084630946310463114631246313463144631546316463174631846319463204632146322463234632446325463264632746328463294633046331463324633346334463354633646337463384633946340463414634246343463444634546346463474634846349463504635146352463534635446355463564635746358463594636046361463624636346364463654636646367463684636946370463714637246373463744637546376463774637846379463804638146382463834638446385463864638746388463894639046391463924639346394463954639646397463984639946400464014640246403464044640546406464074640846409464104641146412464134641446415464164641746418464194642046421464224642346424464254642646427464284642946430464314643246433464344643546436464374643846439464404644146442464434644446445464464644746448464494645046451464524645346454464554645646457464584645946460464614646246463464644646546466464674646846469464704647146472464734647446475464764647746478464794648046481464824648346484464854648646487464884648946490464914649246493464944649546496464974649846499465004650146502465034650446505465064650746508465094651046511465124651346514465154651646517465184651946520465214652246523465244652546526465274652846529465304653146532465334653446535465364653746538465394654046541465424654346544465454654646547465484654946550465514655246553465544655546556465574655846559465604656146562465634656446565465664656746568465694657046571465724657346574465754657646577465784657946580465814658246583465844658546586465874658846589465904659146592465934659446595465964659746598465994660046601466024660346604466054660646607466084660946610466114661246613466144661546616466174661846619466204662146622466234662446625466264662746628466294663046631466324663346634466354663646637466384663946640466414664246643466444664546646466474664846649466504665146652466534665446655466564665746658466594666046661466624666346664466654666646667466684666946670466714667246673466744667546676466774667846679466804668146682466834668446685466864668746688466894669046691466924669346694466954669646697466984669946700467014670246703467044670546706467074670846709467104671146712467134671446715467164671746718467194672046721467224672346724467254672646727467284672946730467314673246733467344673546736467374673846739467404674146742467434674446745467464674746748467494675046751467524675346754467554675646757467584675946760467614676246763467644676546766467674676846769467704677146772467734677446775467764677746778467794678046781467824678346784467854678646787467884678946790467914679246793467944679546796467974679846799468004680146802468034680446805468064680746808468094681046811468124681346814468154681646817468184681946820468214682246823468244682546826468274682846829468304683146832468334683446835468364683746838468394684046841468424684346844468454684646847468484684946850468514685246853468544685546856468574685846859468604686146862468634686446865468664686746868468694687046871468724687346874468754687646877468784687946880468814688246883468844688546886468874688846889468904689146892468934689446895468964689746898468994690046901469024690346904469054690646907469084690946910469114691246913469144691546916469174691846919469204692146922469234692446925469264692746928469294693046931469324693346934469354693646937469384693946940469414694246943469444694546946469474694846949469504695146952469534695446955469564695746958469594696046961469624696346964469654696646967469684696946970469714697246973469744697546976469774697846979469804698146982469834698446985469864698746988469894699046991469924699346994469954699646997469984699947000470014700247003470044700547006470074700847009470104701147012470134701447015470164701747018470194702047021470224702347024470254702647027470284702947030470314703247033470344703547036470374703847039470404704147042470434704447045470464704747048470494705047051470524705347054470554705647057470584705947060470614706247063470644706547066470674706847069470704707147072470734707447075470764707747078470794708047081470824708347084470854708647087470884708947090470914709247093470944709547096470974709847099471004710147102471034710447105471064710747108471094711047111471124711347114471154711647117471184711947120471214712247123471244712547126471274712847129471304713147132471334713447135471364713747138471394714047141471424714347144471454714647147471484714947150471514715247153471544715547156471574715847159471604716147162471634716447165471664716747168471694717047171471724717347174471754717647177471784717947180471814718247183471844718547186471874718847189471904719147192471934719447195471964719747198471994720047201472024720347204472054720647207472084720947210472114721247213472144721547216472174721847219472204722147222472234722447225472264722747228472294723047231472324723347234472354723647237472384723947240472414724247243472444724547246472474724847249472504725147252472534725447255472564725747258472594726047261472624726347264472654726647267472684726947270472714727247273472744727547276472774727847279472804728147282472834728447285472864728747288472894729047291472924729347294472954729647297472984729947300473014730247303473044730547306473074730847309473104731147312473134731447315473164731747318473194732047321473224732347324473254732647327473284732947330473314733247333473344733547336473374733847339473404734147342473434734447345473464734747348473494735047351473524735347354473554735647357473584735947360473614736247363473644736547366473674736847369473704737147372473734737447375473764737747378473794738047381473824738347384473854738647387473884738947390473914739247393473944739547396473974739847399474004740147402474034740447405474064740747408474094741047411474124741347414474154741647417474184741947420474214742247423474244742547426474274742847429474304743147432474334743447435474364743747438474394744047441474424744347444474454744647447474484744947450474514745247453474544745547456474574745847459474604746147462474634746447465474664746747468474694747047471474724747347474474754747647477474784747947480474814748247483474844748547486474874748847489474904749147492474934749447495474964749747498474994750047501475024750347504475054750647507475084750947510475114751247513475144751547516475174751847519475204752147522475234752447525475264752747528475294753047531475324753347534475354753647537475384753947540475414754247543475444754547546475474754847549475504755147552475534755447555475564755747558475594756047561475624756347564475654756647567475684756947570475714757247573475744757547576475774757847579475804758147582475834758447585475864758747588475894759047591475924759347594475954759647597475984759947600476014760247603476044760547606476074760847609476104761147612476134761447615476164761747618476194762047621476224762347624476254762647627476284762947630476314763247633476344763547636476374763847639476404764147642476434764447645476464764747648476494765047651476524765347654476554765647657476584765947660476614766247663476644766547666476674766847669476704767147672476734767447675476764767747678476794768047681476824768347684476854768647687476884768947690476914769247693476944769547696476974769847699477004770147702477034770447705477064770747708477094771047711477124771347714477154771647717477184771947720477214772247723477244772547726477274772847729477304773147732477334773447735477364773747738477394774047741477424774347744477454774647747477484774947750477514775247753477544775547756477574775847759477604776147762477634776447765477664776747768477694777047771477724777347774477754777647777477784777947780477814778247783477844778547786477874778847789477904779147792477934779447795477964779747798477994780047801478024780347804478054780647807478084780947810478114781247813478144781547816478174781847819478204782147822478234782447825478264782747828478294783047831478324783347834478354783647837478384783947840478414784247843478444784547846478474784847849478504785147852478534785447855478564785747858478594786047861478624786347864478654786647867478684786947870478714787247873478744787547876478774787847879478804788147882478834788447885478864788747888478894789047891478924789347894478954789647897478984789947900479014790247903479044790547906479074790847909479104791147912479134791447915479164791747918479194792047921479224792347924479254792647927479284792947930479314793247933479344793547936479374793847939479404794147942479434794447945479464794747948479494795047951479524795347954479554795647957479584795947960479614796247963479644796547966479674796847969479704797147972479734797447975479764797747978479794798047981479824798347984479854798647987479884798947990479914799247993479944799547996479974799847999480004800148002480034800448005480064800748008480094801048011480124801348014480154801648017480184801948020480214802248023480244802548026480274802848029480304803148032480334803448035480364803748038480394804048041480424804348044480454804648047480484804948050480514805248053480544805548056480574805848059480604806148062480634806448065480664806748068480694807048071480724807348074480754807648077480784807948080480814808248083480844808548086480874808848089480904809148092480934809448095480964809748098480994810048101481024810348104481054810648107481084810948110481114811248113481144811548116481174811848119481204812148122481234812448125481264812748128481294813048131481324813348134481354813648137481384813948140481414814248143481444814548146481474814848149481504815148152481534815448155481564815748158481594816048161481624816348164481654816648167481684816948170481714817248173481744817548176481774817848179481804818148182481834818448185481864818748188481894819048191481924819348194481954819648197481984819948200482014820248203482044820548206482074820848209482104821148212482134821448215482164821748218482194822048221482224822348224482254822648227482284822948230482314823248233482344823548236482374823848239482404824148242482434824448245482464824748248482494825048251482524825348254482554825648257482584825948260482614826248263482644826548266482674826848269482704827148272482734827448275482764827748278482794828048281482824828348284482854828648287482884828948290482914829248293482944829548296482974829848299483004830148302483034830448305483064830748308483094831048311483124831348314483154831648317483184831948320483214832248323483244832548326483274832848329483304833148332483334833448335483364833748338483394834048341483424834348344483454834648347483484834948350483514835248353483544835548356483574835848359483604836148362483634836448365483664836748368483694837048371483724837348374483754837648377483784837948380483814838248383483844838548386483874838848389483904839148392483934839448395483964839748398483994840048401484024840348404484054840648407484084840948410484114841248413484144841548416484174841848419484204842148422484234842448425484264842748428484294843048431484324843348434484354843648437484384843948440484414844248443484444844548446484474844848449484504845148452484534845448455484564845748458484594846048461484624846348464484654846648467484684846948470484714847248473484744847548476484774847848479484804848148482484834848448485484864848748488484894849048491484924849348494484954849648497484984849948500485014850248503485044850548506485074850848509485104851148512485134851448515485164851748518485194852048521485224852348524485254852648527485284852948530485314853248533485344853548536485374853848539485404854148542485434854448545485464854748548485494855048551485524855348554485554855648557485584855948560485614856248563485644856548566485674856848569485704857148572485734857448575485764857748578485794858048581485824858348584485854858648587485884858948590485914859248593485944859548596485974859848599486004860148602486034860448605486064860748608486094861048611486124861348614486154861648617486184861948620486214862248623486244862548626486274862848629486304863148632486334863448635486364863748638486394864048641486424864348644486454864648647486484864948650486514865248653486544865548656486574865848659486604866148662486634866448665486664866748668486694867048671486724867348674486754867648677486784867948680486814868248683486844868548686486874868848689486904869148692486934869448695486964869748698486994870048701487024870348704487054870648707487084870948710487114871248713487144871548716487174871848719487204872148722487234872448725487264872748728487294873048731487324873348734487354873648737487384873948740487414874248743487444874548746487474874848749487504875148752487534875448755487564875748758487594876048761487624876348764487654876648767487684876948770487714877248773487744877548776487774877848779487804878148782487834878448785487864878748788487894879048791487924879348794487954879648797487984879948800488014880248803488044880548806488074880848809488104881148812488134881448815488164881748818488194882048821488224882348824488254882648827488284882948830488314883248833488344883548836488374883848839488404884148842488434884448845488464884748848488494885048851488524885348854488554885648857488584885948860488614886248863488644886548866488674886848869488704887148872488734887448875488764887748878488794888048881488824888348884488854888648887488884888948890488914889248893488944889548896488974889848899489004890148902489034890448905489064890748908489094891048911489124891348914489154891648917489184891948920489214892248923489244892548926489274892848929489304893148932489334893448935489364893748938489394894048941489424894348944489454894648947489484894948950489514895248953489544895548956489574895848959489604896148962489634896448965489664896748968489694897048971489724897348974489754897648977489784897948980489814898248983489844898548986489874898848989489904899148992489934899448995489964899748998489994900049001490024900349004490054900649007490084900949010490114901249013490144901549016490174901849019490204902149022490234902449025490264902749028490294903049031490324903349034490354903649037490384903949040490414904249043490444904549046490474904849049490504905149052490534905449055490564905749058490594906049061490624906349064490654906649067490684906949070490714907249073490744907549076490774907849079490804908149082490834908449085490864908749088490894909049091490924909349094490954909649097490984909949100491014910249103491044910549106491074910849109491104911149112491134911449115491164911749118491194912049121491224912349124491254912649127491284912949130491314913249133491344913549136491374913849139491404914149142491434914449145491464914749148491494915049151491524915349154491554915649157491584915949160491614916249163491644916549166491674916849169491704917149172491734917449175491764917749178491794918049181491824918349184491854918649187491884918949190491914919249193491944919549196491974919849199492004920149202492034920449205492064920749208492094921049211492124921349214492154921649217492184921949220492214922249223492244922549226492274922849229492304923149232492334923449235492364923749238492394924049241492424924349244492454924649247492484924949250492514925249253492544925549256492574925849259492604926149262492634926449265492664926749268492694927049271492724927349274492754927649277492784927949280492814928249283492844928549286492874928849289492904929149292492934929449295492964929749298492994930049301493024930349304493054930649307493084930949310493114931249313493144931549316493174931849319493204932149322493234932449325493264932749328493294933049331493324933349334493354933649337493384933949340493414934249343493444934549346493474934849349493504935149352493534935449355493564935749358493594936049361493624936349364493654936649367493684936949370493714937249373493744937549376493774937849379493804938149382493834938449385493864938749388493894939049391493924939349394493954939649397493984939949400494014940249403494044940549406494074940849409494104941149412494134941449415494164941749418494194942049421494224942349424494254942649427494284942949430494314943249433494344943549436494374943849439494404944149442494434944449445494464944749448494494945049451494524945349454494554945649457494584945949460494614946249463494644946549466494674946849469494704947149472494734947449475494764947749478494794948049481494824948349484494854948649487494884948949490494914949249493494944949549496494974949849499495004950149502495034950449505495064950749508495094951049511495124951349514495154951649517495184951949520495214952249523495244952549526495274952849529495304953149532495334953449535495364953749538495394954049541495424954349544495454954649547495484954949550495514955249553495544955549556495574955849559495604956149562495634956449565495664956749568495694957049571495724957349574495754957649577495784957949580495814958249583495844958549586495874958849589495904959149592495934959449595495964959749598495994960049601496024960349604496054960649607496084960949610496114961249613496144961549616496174961849619496204962149622496234962449625496264962749628496294963049631496324963349634496354963649637496384963949640496414964249643496444964549646496474964849649496504965149652496534965449655496564965749658496594966049661496624966349664496654966649667496684966949670496714967249673496744967549676496774967849679496804968149682496834968449685496864968749688496894969049691496924969349694496954969649697496984969949700497014970249703497044970549706497074970849709497104971149712497134971449715497164971749718497194972049721497224972349724497254972649727497284972949730497314973249733497344973549736497374973849739497404974149742497434974449745497464974749748497494975049751497524975349754497554975649757497584975949760497614976249763497644976549766497674976849769497704977149772497734977449775497764977749778497794978049781497824978349784497854978649787497884978949790497914979249793497944979549796497974979849799498004980149802498034980449805498064980749808498094981049811498124981349814498154981649817498184981949820498214982249823498244982549826498274982849829498304983149832498334983449835498364983749838498394984049841498424984349844498454984649847498484984949850498514985249853498544985549856498574985849859498604986149862498634986449865498664986749868498694987049871498724987349874498754987649877498784987949880498814988249883498844988549886498874988849889498904989149892498934989449895498964989749898498994990049901499024990349904499054990649907499084990949910499114991249913499144991549916499174991849919499204992149922499234992449925499264992749928499294993049931499324993349934499354993649937499384993949940499414994249943499444994549946499474994849949499504995149952499534995449955499564995749958499594996049961499624996349964499654996649967499684996949970499714997249973499744997549976499774997849979499804998149982499834998449985499864998749988499894999049991499924999349994499954999649997499984999950000500015000250003500045000550006500075000850009500105001150012500135001450015500165001750018500195002050021500225002350024500255002650027500285002950030500315003250033500345003550036500375003850039500405004150042500435004450045500465004750048500495005050051500525005350054500555005650057500585005950060500615006250063500645006550066500675006850069500705007150072500735007450075500765007750078500795008050081500825008350084500855008650087500885008950090500915009250093500945009550096500975009850099501005010150102501035010450105501065010750108501095011050111501125011350114501155011650117501185011950120501215012250123501245012550126501275012850129501305013150132501335013450135501365013750138501395014050141501425014350144501455014650147501485014950150501515015250153501545015550156501575015850159501605016150162501635016450165501665016750168501695017050171501725017350174501755017650177501785017950180501815018250183501845018550186501875018850189501905019150192501935019450195501965019750198501995020050201502025020350204502055020650207502085020950210502115021250213502145021550216502175021850219502205022150222502235022450225502265022750228502295023050231502325023350234502355023650237502385023950240502415024250243502445024550246502475024850249502505025150252502535025450255502565025750258502595026050261502625026350264502655026650267502685026950270502715027250273502745027550276502775027850279502805028150282502835028450285502865028750288502895029050291502925029350294502955029650297502985029950300503015030250303503045030550306503075030850309503105031150312503135031450315503165031750318503195032050321503225032350324503255032650327503285032950330503315033250333503345033550336503375033850339503405034150342503435034450345503465034750348503495035050351503525035350354503555035650357503585035950360503615036250363503645036550366503675036850369503705037150372503735037450375503765037750378503795038050381503825038350384503855038650387503885038950390503915039250393503945039550396503975039850399504005040150402504035040450405504065040750408504095041050411504125041350414504155041650417504185041950420504215042250423504245042550426504275042850429504305043150432504335043450435504365043750438504395044050441504425044350444504455044650447504485044950450504515045250453504545045550456504575045850459504605046150462504635046450465504665046750468504695047050471504725047350474504755047650477504785047950480504815048250483504845048550486504875048850489504905049150492504935049450495504965049750498504995050050501505025050350504505055050650507505085050950510505115051250513505145051550516505175051850519505205052150522505235052450525505265052750528505295053050531505325053350534505355053650537505385053950540505415054250543505445054550546505475054850549505505055150552505535055450555505565055750558505595056050561505625056350564505655056650567505685056950570505715057250573505745057550576505775057850579505805058150582505835058450585505865058750588505895059050591505925059350594505955059650597505985059950600506015060250603506045060550606506075060850609506105061150612506135061450615506165061750618506195062050621506225062350624506255062650627506285062950630506315063250633506345063550636506375063850639506405064150642506435064450645506465064750648506495065050651506525065350654506555065650657506585065950660506615066250663506645066550666506675066850669506705067150672506735067450675506765067750678506795068050681506825068350684506855068650687506885068950690506915069250693506945069550696506975069850699507005070150702507035070450705507065070750708507095071050711507125071350714507155071650717507185071950720507215072250723507245072550726507275072850729507305073150732507335073450735507365073750738507395074050741507425074350744507455074650747507485074950750507515075250753507545075550756507575075850759507605076150762507635076450765507665076750768507695077050771507725077350774507755077650777507785077950780507815078250783507845078550786507875078850789507905079150792507935079450795507965079750798507995080050801508025080350804508055080650807508085080950810508115081250813508145081550816508175081850819508205082150822508235082450825508265082750828508295083050831508325083350834508355083650837508385083950840508415084250843508445084550846508475084850849508505085150852508535085450855508565085750858508595086050861508625086350864508655086650867508685086950870508715087250873508745087550876508775087850879508805088150882508835088450885508865088750888508895089050891508925089350894508955089650897508985089950900509015090250903509045090550906509075090850909509105091150912509135091450915509165091750918509195092050921509225092350924509255092650927509285092950930509315093250933509345093550936509375093850939509405094150942509435094450945509465094750948509495095050951509525095350954509555095650957509585095950960509615096250963509645096550966509675096850969509705097150972509735097450975509765097750978509795098050981509825098350984509855098650987509885098950990509915099250993509945099550996509975099850999510005100151002510035100451005510065100751008510095101051011510125101351014510155101651017510185101951020510215102251023510245102551026510275102851029510305103151032510335103451035510365103751038510395104051041510425104351044510455104651047510485104951050510515105251053510545105551056510575105851059510605106151062510635106451065510665106751068510695107051071510725107351074510755107651077510785107951080510815108251083510845108551086510875108851089510905109151092510935109451095510965109751098510995110051101511025110351104511055110651107511085110951110511115111251113511145111551116511175111851119511205112151122511235112451125511265112751128511295113051131511325113351134511355113651137511385113951140511415114251143511445114551146511475114851149511505115151152511535115451155511565115751158511595116051161511625116351164511655116651167511685116951170511715117251173511745117551176511775117851179511805118151182511835118451185511865118751188511895119051191511925119351194511955119651197511985119951200512015120251203512045120551206512075120851209512105121151212512135121451215512165121751218512195122051221512225122351224512255122651227512285122951230512315123251233512345123551236512375123851239512405124151242512435124451245512465124751248512495125051251512525125351254512555125651257512585125951260512615126251263512645126551266512675126851269512705127151272512735127451275512765127751278512795128051281512825128351284512855128651287512885128951290512915129251293512945129551296512975129851299513005130151302513035130451305513065130751308513095131051311513125131351314513155131651317513185131951320513215132251323513245132551326513275132851329513305133151332513335133451335513365133751338513395134051341513425134351344513455134651347513485134951350513515135251353513545135551356513575135851359513605136151362513635136451365513665136751368513695137051371513725137351374513755137651377513785137951380513815138251383513845138551386513875138851389513905139151392513935139451395513965139751398513995140051401514025140351404514055140651407514085140951410514115141251413514145141551416514175141851419514205142151422514235142451425514265142751428514295143051431514325143351434514355143651437514385143951440514415144251443514445144551446514475144851449514505145151452514535145451455514565145751458514595146051461514625146351464514655146651467514685146951470514715147251473514745147551476514775147851479514805148151482514835148451485514865148751488514895149051491514925149351494514955149651497514985149951500515015150251503515045150551506515075150851509515105151151512515135151451515515165151751518515195152051521515225152351524515255152651527515285152951530515315153251533515345153551536515375153851539515405154151542515435154451545515465154751548515495155051551515525155351554515555155651557515585155951560515615156251563515645156551566515675156851569515705157151572515735157451575515765157751578515795158051581515825158351584515855158651587515885158951590515915159251593515945159551596515975159851599516005160151602516035160451605516065160751608516095161051611516125161351614516155161651617516185161951620516215162251623516245162551626516275162851629516305163151632516335163451635516365163751638516395164051641516425164351644516455164651647516485164951650516515165251653516545165551656516575165851659516605166151662516635166451665516665166751668516695167051671516725167351674516755167651677516785167951680516815168251683516845168551686516875168851689516905169151692516935169451695516965169751698516995170051701517025170351704517055170651707517085170951710517115171251713517145171551716517175171851719517205172151722517235172451725517265172751728517295173051731517325173351734517355173651737517385173951740517415174251743517445174551746517475174851749517505175151752517535175451755517565175751758517595176051761517625176351764517655176651767517685176951770517715177251773517745177551776517775177851779517805178151782517835178451785517865178751788517895179051791517925179351794517955179651797517985179951800518015180251803518045180551806518075180851809518105181151812518135181451815518165181751818518195182051821518225182351824518255182651827518285182951830518315183251833518345183551836518375183851839518405184151842518435184451845518465184751848518495185051851518525185351854518555185651857518585185951860518615186251863518645186551866518675186851869518705187151872518735187451875518765187751878518795188051881518825188351884518855188651887518885188951890518915189251893518945189551896518975189851899519005190151902519035190451905519065190751908519095191051911519125191351914519155191651917519185191951920519215192251923519245192551926519275192851929519305193151932519335193451935519365193751938519395194051941519425194351944519455194651947519485194951950519515195251953519545195551956519575195851959519605196151962519635196451965519665196751968519695197051971519725197351974519755197651977519785197951980519815198251983519845198551986519875198851989519905199151992519935199451995519965199751998519995200052001520025200352004520055200652007520085200952010520115201252013520145201552016520175201852019520205202152022520235202452025520265202752028520295203052031520325203352034520355203652037520385203952040520415204252043520445204552046520475204852049520505205152052520535205452055520565205752058520595206052061520625206352064520655206652067520685206952070520715207252073520745207552076520775207852079520805208152082520835208452085520865208752088520895209052091520925209352094520955209652097520985209952100521015210252103521045210552106521075210852109521105211152112521135211452115521165211752118521195212052121521225212352124521255212652127521285212952130521315213252133521345213552136521375213852139521405214152142521435214452145521465214752148521495215052151521525215352154521555215652157521585215952160521615216252163521645216552166521675216852169521705217152172521735217452175521765217752178521795218052181521825218352184521855218652187521885218952190521915219252193521945219552196521975219852199522005220152202522035220452205522065220752208522095221052211522125221352214522155221652217522185221952220522215222252223522245222552226522275222852229522305223152232522335223452235522365223752238522395224052241522425224352244522455224652247522485224952250522515225252253522545225552256522575225852259522605226152262522635226452265522665226752268522695227052271522725227352274522755227652277522785227952280522815228252283522845228552286522875228852289522905229152292522935229452295522965229752298522995230052301523025230352304523055230652307523085230952310523115231252313523145231552316523175231852319523205232152322523235232452325523265232752328523295233052331523325233352334523355233652337523385233952340523415234252343523445234552346523475234852349523505235152352523535235452355523565235752358523595236052361523625236352364523655236652367523685236952370523715237252373523745237552376523775237852379523805238152382523835238452385523865238752388523895239052391523925239352394523955239652397523985239952400524015240252403524045240552406524075240852409524105241152412524135241452415524165241752418524195242052421524225242352424524255242652427524285242952430524315243252433524345243552436524375243852439524405244152442524435244452445524465244752448524495245052451524525245352454524555245652457524585245952460524615246252463524645246552466524675246852469524705247152472524735247452475524765247752478524795248052481524825248352484524855248652487524885248952490524915249252493524945249552496524975249852499525005250152502525035250452505525065250752508525095251052511525125251352514525155251652517525185251952520525215252252523525245252552526525275252852529525305253152532525335253452535525365253752538525395254052541525425254352544525455254652547525485254952550525515255252553525545255552556525575255852559525605256152562525635256452565525665256752568525695257052571525725257352574525755257652577525785257952580525815258252583525845258552586525875258852589525905259152592525935259452595525965259752598525995260052601526025260352604526055260652607526085260952610526115261252613526145261552616526175261852619526205262152622526235262452625526265262752628526295263052631526325263352634526355263652637526385263952640526415264252643526445264552646526475264852649526505265152652526535265452655526565265752658526595266052661526625266352664526655266652667526685266952670526715267252673526745267552676526775267852679526805268152682526835268452685526865268752688526895269052691526925269352694526955269652697526985269952700527015270252703527045270552706527075270852709527105271152712527135271452715527165271752718527195272052721527225272352724527255272652727527285272952730527315273252733527345273552736527375273852739527405274152742527435274452745527465274752748527495275052751527525275352754527555275652757527585275952760527615276252763527645276552766527675276852769527705277152772527735277452775527765277752778527795278052781527825278352784527855278652787527885278952790527915279252793527945279552796527975279852799528005280152802528035280452805528065280752808528095281052811528125281352814528155281652817528185281952820528215282252823528245282552826528275282852829528305283152832528335283452835528365283752838528395284052841528425284352844528455284652847528485284952850528515285252853528545285552856528575285852859528605286152862528635286452865528665286752868528695287052871528725287352874528755287652877528785287952880528815288252883528845288552886528875288852889528905289152892528935289452895528965289752898528995290052901529025290352904529055290652907529085290952910529115291252913529145291552916529175291852919529205292152922529235292452925529265292752928529295293052931529325293352934529355293652937529385293952940529415294252943529445294552946529475294852949529505295152952529535295452955529565295752958529595296052961529625296352964529655296652967529685296952970529715297252973529745297552976529775297852979529805298152982529835298452985529865298752988529895299052991529925299352994529955299652997529985299953000530015300253003530045300553006530075300853009530105301153012530135301453015530165301753018530195302053021530225302353024530255302653027530285302953030530315303253033530345303553036530375303853039530405304153042530435304453045530465304753048530495305053051530525305353054530555305653057530585305953060530615306253063530645306553066530675306853069530705307153072530735307453075530765307753078530795308053081530825308353084530855308653087530885308953090530915309253093530945309553096530975309853099531005310153102531035310453105531065310753108531095311053111531125311353114531155311653117531185311953120531215312253123531245312553126531275312853129531305313153132531335313453135531365313753138531395314053141531425314353144531455314653147531485314953150531515315253153531545315553156531575315853159531605316153162531635316453165531665316753168531695317053171531725317353174531755317653177531785317953180531815318253183531845318553186531875318853189531905319153192531935319453195531965319753198531995320053201532025320353204532055320653207532085320953210532115321253213532145321553216532175321853219532205322153222532235322453225532265322753228532295323053231532325323353234532355323653237532385323953240532415324253243532445324553246532475324853249532505325153252532535325453255532565325753258532595326053261532625326353264532655326653267532685326953270532715327253273532745327553276532775327853279532805328153282532835328453285532865328753288532895329053291532925329353294532955329653297532985329953300533015330253303533045330553306533075330853309533105331153312533135331453315533165331753318533195332053321533225332353324533255332653327533285332953330533315333253333533345333553336533375333853339533405334153342533435334453345533465334753348533495335053351533525335353354533555335653357533585335953360533615336253363533645336553366533675336853369533705337153372533735337453375533765337753378533795338053381533825338353384533855338653387533885338953390533915339253393533945339553396533975339853399534005340153402534035340453405534065340753408534095341053411534125341353414534155341653417534185341953420534215342253423534245342553426534275342853429534305343153432534335343453435534365343753438534395344053441534425344353444534455344653447534485344953450534515345253453534545345553456534575345853459534605346153462534635346453465534665346753468534695347053471534725347353474534755347653477534785347953480534815348253483534845348553486534875348853489534905349153492534935349453495534965349753498534995350053501535025350353504535055350653507535085350953510535115351253513535145351553516535175351853519535205352153522535235352453525535265352753528535295353053531535325353353534535355353653537535385353953540535415354253543535445354553546535475354853549535505355153552535535355453555535565355753558535595356053561535625356353564535655356653567535685356953570535715357253573535745357553576535775357853579535805358153582535835358453585535865358753588535895359053591535925359353594535955359653597535985359953600536015360253603536045360553606536075360853609536105361153612536135361453615536165361753618536195362053621536225362353624536255362653627536285362953630536315363253633536345363553636536375363853639536405364153642536435364453645536465364753648536495365053651536525365353654536555365653657536585365953660536615366253663536645366553666536675366853669536705367153672536735367453675536765367753678536795368053681536825368353684536855368653687536885368953690536915369253693536945369553696536975369853699537005370153702537035370453705537065370753708537095371053711537125371353714537155371653717537185371953720537215372253723537245372553726537275372853729537305373153732537335373453735537365373753738537395374053741537425374353744537455374653747537485374953750537515375253753537545375553756537575375853759537605376153762537635376453765537665376753768537695377053771537725377353774537755377653777537785377953780537815378253783537845378553786537875378853789537905379153792537935379453795537965379753798537995380053801538025380353804538055380653807538085380953810538115381253813538145381553816538175381853819538205382153822538235382453825538265382753828538295383053831538325383353834538355383653837538385383953840538415384253843538445384553846538475384853849538505385153852538535385453855538565385753858538595386053861538625386353864538655386653867538685386953870538715387253873538745387553876538775387853879538805388153882538835388453885538865388753888538895389053891538925389353894538955389653897538985389953900539015390253903539045390553906539075390853909539105391153912539135391453915539165391753918539195392053921539225392353924539255392653927539285392953930539315393253933539345393553936539375393853939539405394153942539435394453945539465394753948539495395053951539525395353954539555395653957539585395953960539615396253963539645396553966539675396853969539705397153972539735397453975539765397753978539795398053981539825398353984539855398653987539885398953990539915399253993539945399553996539975399853999540005400154002540035400454005540065400754008540095401054011540125401354014540155401654017540185401954020540215402254023540245402554026540275402854029540305403154032540335403454035540365403754038540395404054041540425404354044540455404654047540485404954050540515405254053540545405554056540575405854059540605406154062540635406454065540665406754068540695407054071540725407354074540755407654077540785407954080540815408254083540845408554086540875408854089540905409154092540935409454095540965409754098540995410054101541025410354104541055410654107541085410954110541115411254113541145411554116541175411854119541205412154122541235412454125541265412754128541295413054131541325413354134541355413654137541385413954140541415414254143541445414554146541475414854149541505415154152541535415454155541565415754158541595416054161541625416354164541655416654167541685416954170541715417254173541745417554176541775417854179541805418154182541835418454185541865418754188541895419054191541925419354194541955419654197541985419954200542015420254203542045420554206542075420854209542105421154212542135421454215542165421754218542195422054221542225422354224542255422654227542285422954230542315423254233542345423554236542375423854239542405424154242542435424454245542465424754248542495425054251542525425354254542555425654257542585425954260542615426254263542645426554266542675426854269542705427154272542735427454275542765427754278542795428054281542825428354284542855428654287542885428954290542915429254293542945429554296542975429854299543005430154302543035430454305543065430754308543095431054311543125431354314543155431654317543185431954320543215432254323543245432554326543275432854329543305433154332543335433454335543365433754338543395434054341543425434354344543455434654347543485434954350543515435254353543545435554356543575435854359543605436154362543635436454365543665436754368543695437054371543725437354374543755437654377543785437954380543815438254383543845438554386543875438854389543905439154392543935439454395543965439754398543995440054401544025440354404544055440654407544085440954410544115441254413544145441554416544175441854419544205442154422544235442454425544265442754428544295443054431544325443354434544355443654437544385443954440544415444254443544445444554446544475444854449544505445154452544535445454455544565445754458544595446054461544625446354464544655446654467544685446954470544715447254473544745447554476544775447854479544805448154482544835448454485544865448754488544895449054491544925449354494544955449654497544985449954500545015450254503545045450554506545075450854509545105451154512545135451454515545165451754518545195452054521545225452354524545255452654527545285452954530545315453254533545345453554536545375453854539545405454154542545435454454545545465454754548545495455054551545525455354554545555455654557545585455954560545615456254563545645456554566545675456854569545705457154572545735457454575545765457754578545795458054581545825458354584545855458654587545885458954590545915459254593545945459554596545975459854599546005460154602546035460454605546065460754608546095461054611546125461354614546155461654617546185461954620546215462254623546245462554626546275462854629546305463154632546335463454635546365463754638546395464054641546425464354644546455464654647546485464954650546515465254653546545465554656546575465854659546605466154662546635466454665546665466754668546695467054671546725467354674546755467654677546785467954680546815468254683546845468554686546875468854689546905469154692546935469454695546965469754698546995470054701547025470354704547055470654707547085470954710547115471254713547145471554716547175471854719547205472154722547235472454725547265472754728547295473054731547325473354734547355473654737547385473954740547415474254743547445474554746547475474854749547505475154752547535475454755547565475754758547595476054761547625476354764547655476654767547685476954770547715477254773547745477554776547775477854779547805478154782547835478454785547865478754788547895479054791547925479354794547955479654797547985479954800548015480254803548045480554806548075480854809548105481154812548135481454815548165481754818548195482054821548225482354824548255482654827548285482954830548315483254833548345483554836548375483854839548405484154842548435484454845548465484754848548495485054851548525485354854548555485654857548585485954860548615486254863548645486554866548675486854869548705487154872548735487454875548765487754878548795488054881548825488354884548855488654887548885488954890548915489254893548945489554896548975489854899549005490154902549035490454905549065490754908549095491054911549125491354914549155491654917549185491954920549215492254923549245492554926549275492854929549305493154932549335493454935549365493754938549395494054941549425494354944549455494654947549485494954950549515495254953549545495554956549575495854959549605496154962549635496454965549665496754968549695497054971549725497354974549755497654977549785497954980549815498254983549845498554986549875498854989549905499154992549935499454995549965499754998549995500055001550025500355004550055500655007550085500955010550115501255013550145501555016550175501855019550205502155022550235502455025550265502755028550295503055031550325503355034550355503655037550385503955040550415504255043550445504555046550475504855049550505505155052550535505455055550565505755058550595506055061550625506355064550655506655067550685506955070550715507255073550745507555076550775507855079550805508155082550835508455085550865508755088550895509055091550925509355094550955509655097550985509955100551015510255103551045510555106551075510855109551105511155112551135511455115551165511755118551195512055121551225512355124551255512655127551285512955130551315513255133551345513555136551375513855139551405514155142551435514455145551465514755148551495515055151551525515355154551555515655157551585515955160551615516255163551645516555166551675516855169551705517155172551735517455175551765517755178551795518055181551825518355184551855518655187551885518955190551915519255193551945519555196551975519855199552005520155202552035520455205552065520755208552095521055211552125521355214552155521655217552185521955220552215522255223552245522555226552275522855229552305523155232552335523455235552365523755238552395524055241552425524355244552455524655247552485524955250552515525255253552545525555256552575525855259552605526155262552635526455265552665526755268552695527055271552725527355274552755527655277552785527955280552815528255283552845528555286552875528855289552905529155292552935529455295552965529755298552995530055301553025530355304553055530655307553085530955310553115531255313553145531555316553175531855319553205532155322553235532455325553265532755328553295533055331553325533355334553355533655337553385533955340553415534255343553445534555346553475534855349553505535155352553535535455355553565535755358553595536055361553625536355364553655536655367553685536955370553715537255373553745537555376553775537855379553805538155382553835538455385553865538755388553895539055391553925539355394553955539655397553985539955400554015540255403554045540555406554075540855409554105541155412554135541455415554165541755418554195542055421554225542355424554255542655427554285542955430554315543255433554345543555436554375543855439554405544155442554435544455445554465544755448554495545055451554525545355454554555545655457554585545955460554615546255463554645546555466554675546855469554705547155472554735547455475554765547755478554795548055481554825548355484554855548655487554885548955490554915549255493554945549555496554975549855499555005550155502555035550455505555065550755508555095551055511555125551355514555155551655517555185551955520555215552255523555245552555526555275552855529555305553155532555335553455535555365553755538555395554055541555425554355544555455554655547555485554955550555515555255553555545555555556555575555855559555605556155562555635556455565555665556755568555695557055571555725557355574555755557655577555785557955580555815558255583555845558555586555875558855589555905559155592555935559455595555965559755598555995560055601556025560355604556055560655607556085560955610556115561255613556145561555616556175561855619556205562155622556235562455625556265562755628556295563055631556325563355634556355563655637556385563955640556415564255643556445564555646556475564855649556505565155652556535565455655556565565755658556595566055661556625566355664556655566655667556685566955670556715567255673556745567555676556775567855679556805568155682556835568455685556865568755688556895569055691556925569355694556955569655697556985569955700557015570255703557045570555706557075570855709557105571155712557135571455715557165571755718557195572055721557225572355724557255572655727557285572955730557315573255733557345573555736557375573855739557405574155742557435574455745557465574755748557495575055751557525575355754557555575655757557585575955760557615576255763557645576555766557675576855769557705577155772557735577455775557765577755778557795578055781557825578355784557855578655787557885578955790557915579255793557945579555796557975579855799558005580155802558035580455805558065580755808558095581055811558125581355814558155581655817558185581955820558215582255823558245582555826558275582855829558305583155832558335583455835558365583755838558395584055841558425584355844558455584655847558485584955850558515585255853558545585555856558575585855859558605586155862558635586455865558665586755868558695587055871558725587355874558755587655877558785587955880558815588255883558845588555886558875588855889558905589155892558935589455895558965589755898558995590055901559025590355904559055590655907559085590955910559115591255913559145591555916559175591855919559205592155922559235592455925559265592755928559295593055931559325593355934559355593655937559385593955940559415594255943559445594555946559475594855949559505595155952559535595455955559565595755958559595596055961559625596355964559655596655967559685596955970559715597255973559745597555976559775597855979559805598155982559835598455985559865598755988559895599055991559925599355994559955599655997559985599956000560015600256003560045600556006560075600856009560105601156012560135601456015560165601756018560195602056021560225602356024560255602656027560285602956030560315603256033560345603556036560375603856039560405604156042560435604456045560465604756048560495605056051560525605356054560555605656057560585605956060560615606256063560645606556066560675606856069560705607156072560735607456075560765607756078560795608056081560825608356084560855608656087560885608956090560915609256093560945609556096560975609856099561005610156102561035610456105561065610756108561095611056111561125611356114561155611656117561185611956120561215612256123561245612556126561275612856129561305613156132561335613456135561365613756138561395614056141561425614356144561455614656147561485614956150561515615256153561545615556156561575615856159561605616156162561635616456165561665616756168561695617056171561725617356174561755617656177561785617956180561815618256183561845618556186561875618856189561905619156192561935619456195561965619756198561995620056201562025620356204562055620656207562085620956210562115621256213562145621556216562175621856219562205622156222562235622456225562265622756228562295623056231562325623356234562355623656237562385623956240562415624256243562445624556246562475624856249562505625156252562535625456255562565625756258562595626056261562625626356264562655626656267562685626956270562715627256273562745627556276562775627856279562805628156282562835628456285562865628756288562895629056291562925629356294562955629656297562985629956300563015630256303563045630556306563075630856309563105631156312563135631456315563165631756318563195632056321563225632356324563255632656327563285632956330563315633256333563345633556336563375633856339563405634156342563435634456345563465634756348563495635056351563525635356354563555635656357563585635956360563615636256363563645636556366563675636856369563705637156372563735637456375563765637756378563795638056381563825638356384563855638656387563885638956390563915639256393563945639556396563975639856399564005640156402564035640456405564065640756408564095641056411564125641356414564155641656417564185641956420564215642256423564245642556426564275642856429564305643156432564335643456435564365643756438564395644056441564425644356444564455644656447564485644956450564515645256453564545645556456564575645856459564605646156462564635646456465564665646756468564695647056471564725647356474564755647656477564785647956480564815648256483564845648556486564875648856489564905649156492564935649456495564965649756498564995650056501565025650356504565055650656507565085650956510565115651256513565145651556516565175651856519565205652156522565235652456525565265652756528565295653056531565325653356534565355653656537565385653956540565415654256543565445654556546565475654856549565505655156552565535655456555565565655756558565595656056561565625656356564565655656656567565685656956570565715657256573565745657556576565775657856579565805658156582565835658456585565865658756588565895659056591565925659356594565955659656597565985659956600566015660256603566045660556606566075660856609566105661156612566135661456615566165661756618566195662056621566225662356624566255662656627566285662956630566315663256633566345663556636566375663856639566405664156642566435664456645566465664756648566495665056651566525665356654566555665656657566585665956660566615666256663566645666556666566675666856669566705667156672566735667456675566765667756678566795668056681566825668356684566855668656687566885668956690566915669256693566945669556696566975669856699567005670156702567035670456705567065670756708567095671056711567125671356714567155671656717567185671956720567215672256723567245672556726567275672856729567305673156732567335673456735567365673756738567395674056741567425674356744567455674656747567485674956750567515675256753567545675556756567575675856759567605676156762567635676456765567665676756768567695677056771567725677356774567755677656777567785677956780567815678256783567845678556786567875678856789567905679156792567935679456795567965679756798567995680056801568025680356804568055680656807568085680956810568115681256813568145681556816568175681856819568205682156822568235682456825568265682756828568295683056831568325683356834568355683656837568385683956840568415684256843568445684556846568475684856849568505685156852568535685456855568565685756858568595686056861568625686356864568655686656867568685686956870568715687256873568745687556876568775687856879568805688156882568835688456885568865688756888568895689056891568925689356894568955689656897568985689956900569015690256903569045690556906569075690856909569105691156912569135691456915569165691756918569195692056921569225692356924569255692656927569285692956930569315693256933569345693556936569375693856939569405694156942569435694456945569465694756948569495695056951569525695356954569555695656957569585695956960569615696256963569645696556966569675696856969569705697156972569735697456975569765697756978569795698056981569825698356984569855698656987569885698956990569915699256993569945699556996569975699856999570005700157002570035700457005570065700757008570095701057011570125701357014570155701657017570185701957020570215702257023570245702557026570275702857029570305703157032570335703457035570365703757038570395704057041570425704357044570455704657047570485704957050570515705257053570545705557056570575705857059570605706157062570635706457065570665706757068570695707057071570725707357074570755707657077570785707957080570815708257083570845708557086570875708857089570905709157092570935709457095570965709757098570995710057101571025710357104571055710657107571085710957110571115711257113571145711557116571175711857119571205712157122571235712457125571265712757128571295713057131571325713357134571355713657137571385713957140571415714257143571445714557146571475714857149571505715157152571535715457155571565715757158571595716057161571625716357164571655716657167571685716957170571715717257173571745717557176571775717857179571805718157182571835718457185571865718757188571895719057191571925719357194571955719657197571985719957200572015720257203572045720557206572075720857209572105721157212572135721457215572165721757218572195722057221572225722357224572255722657227572285722957230572315723257233572345723557236572375723857239572405724157242572435724457245572465724757248572495725057251572525725357254572555725657257572585725957260572615726257263572645726557266572675726857269572705727157272572735727457275572765727757278572795728057281572825728357284572855728657287572885728957290572915729257293572945729557296572975729857299573005730157302573035730457305573065730757308573095731057311573125731357314573155731657317573185731957320573215732257323573245732557326573275732857329573305733157332573335733457335573365733757338573395734057341573425734357344573455734657347573485734957350573515735257353573545735557356573575735857359573605736157362573635736457365573665736757368573695737057371573725737357374573755737657377573785737957380573815738257383573845738557386573875738857389573905739157392573935739457395573965739757398573995740057401574025740357404574055740657407574085740957410574115741257413574145741557416574175741857419574205742157422574235742457425574265742757428574295743057431574325743357434574355743657437574385743957440574415744257443574445744557446574475744857449574505745157452574535745457455574565745757458574595746057461574625746357464574655746657467574685746957470574715747257473574745747557476574775747857479574805748157482574835748457485574865748757488574895749057491574925749357494574955749657497574985749957500575015750257503575045750557506575075750857509575105751157512575135751457515575165751757518575195752057521575225752357524575255752657527575285752957530575315753257533575345753557536575375753857539575405754157542575435754457545575465754757548575495755057551575525755357554575555755657557575585755957560575615756257563575645756557566575675756857569575705757157572575735757457575575765757757578575795758057581575825758357584575855758657587575885758957590575915759257593575945759557596575975759857599576005760157602576035760457605576065760757608576095761057611576125761357614576155761657617576185761957620576215762257623576245762557626576275762857629576305763157632576335763457635576365763757638576395764057641576425764357644576455764657647576485764957650576515765257653576545765557656576575765857659576605766157662576635766457665576665766757668576695767057671576725767357674576755767657677576785767957680576815768257683576845768557686576875768857689576905769157692576935769457695576965769757698576995770057701577025770357704577055770657707577085770957710577115771257713577145771557716577175771857719577205772157722577235772457725577265772757728577295773057731577325773357734577355773657737577385773957740577415774257743577445774557746577475774857749577505775157752577535775457755577565775757758577595776057761577625776357764577655776657767577685776957770577715777257773577745777557776577775777857779577805778157782577835778457785577865778757788577895779057791577925779357794577955779657797577985779957800578015780257803578045780557806578075780857809578105781157812578135781457815578165781757818578195782057821578225782357824578255782657827578285782957830578315783257833578345783557836578375783857839578405784157842578435784457845578465784757848578495785057851578525785357854578555785657857578585785957860578615786257863578645786557866578675786857869578705787157872578735787457875578765787757878578795788057881578825788357884578855788657887578885788957890578915789257893578945789557896578975789857899579005790157902579035790457905579065790757908579095791057911579125791357914579155791657917579185791957920579215792257923579245792557926579275792857929579305793157932579335793457935579365793757938579395794057941579425794357944579455794657947579485794957950579515795257953579545795557956579575795857959579605796157962579635796457965579665796757968579695797057971579725797357974579755797657977579785797957980579815798257983579845798557986579875798857989579905799157992579935799457995579965799757998579995800058001580025800358004580055800658007580085800958010580115801258013580145801558016580175801858019580205802158022580235802458025580265802758028580295803058031580325803358034580355803658037580385803958040580415804258043580445804558046580475804858049580505805158052580535805458055580565805758058580595806058061580625806358064580655806658067580685806958070580715807258073580745807558076580775807858079580805808158082580835808458085580865808758088580895809058091580925809358094580955809658097580985809958100581015810258103581045810558106581075810858109581105811158112581135811458115581165811758118581195812058121581225812358124581255812658127581285812958130581315813258133581345813558136581375813858139581405814158142581435814458145581465814758148581495815058151581525815358154581555815658157581585815958160581615816258163581645816558166581675816858169581705817158172581735817458175581765817758178581795818058181581825818358184581855818658187581885818958190581915819258193581945819558196581975819858199582005820158202582035820458205582065820758208582095821058211582125821358214582155821658217582185821958220582215822258223582245822558226582275822858229582305823158232582335823458235582365823758238582395824058241582425824358244582455824658247582485824958250582515825258253582545825558256582575825858259582605826158262582635826458265582665826758268582695827058271582725827358274582755827658277582785827958280582815828258283582845828558286582875828858289582905829158292582935829458295582965829758298582995830058301583025830358304583055830658307583085830958310583115831258313583145831558316583175831858319583205832158322583235832458325583265832758328583295833058331583325833358334583355833658337583385833958340583415834258343583445834558346583475834858349583505835158352583535835458355583565835758358583595836058361583625836358364583655836658367583685836958370583715837258373583745837558376583775837858379583805838158382583835838458385583865838758388583895839058391583925839358394583955839658397583985839958400584015840258403584045840558406584075840858409584105841158412584135841458415584165841758418584195842058421584225842358424584255842658427584285842958430584315843258433584345843558436584375843858439584405844158442584435844458445584465844758448584495845058451584525845358454584555845658457584585845958460584615846258463584645846558466584675846858469584705847158472584735847458475584765847758478584795848058481584825848358484584855848658487584885848958490584915849258493584945849558496584975849858499585005850158502585035850458505585065850758508585095851058511585125851358514585155851658517585185851958520585215852258523585245852558526585275852858529585305853158532585335853458535585365853758538585395854058541585425854358544585455854658547585485854958550585515855258553585545855558556585575855858559585605856158562585635856458565585665856758568585695857058571585725857358574585755857658577585785857958580585815858258583585845858558586585875858858589585905859158592585935859458595585965859758598585995860058601586025860358604586055860658607586085860958610586115861258613586145861558616586175861858619586205862158622586235862458625586265862758628586295863058631586325863358634586355863658637586385863958640586415864258643586445864558646586475864858649586505865158652586535865458655586565865758658586595866058661586625866358664586655866658667586685866958670586715867258673586745867558676586775867858679586805868158682586835868458685586865868758688586895869058691586925869358694586955869658697586985869958700587015870258703587045870558706587075870858709587105871158712587135871458715587165871758718587195872058721587225872358724587255872658727587285872958730587315873258733587345873558736587375873858739587405874158742587435874458745587465874758748587495875058751587525875358754587555875658757587585875958760587615876258763587645876558766587675876858769587705877158772587735877458775587765877758778587795878058781587825878358784587855878658787587885878958790587915879258793587945879558796587975879858799588005880158802588035880458805588065880758808588095881058811588125881358814588155881658817588185881958820588215882258823588245882558826588275882858829588305883158832588335883458835588365883758838588395884058841588425884358844588455884658847588485884958850588515885258853588545885558856588575885858859588605886158862588635886458865588665886758868588695887058871588725887358874588755887658877588785887958880588815888258883588845888558886588875888858889588905889158892588935889458895588965889758898588995890058901589025890358904589055890658907589085890958910589115891258913589145891558916589175891858919589205892158922589235892458925589265892758928589295893058931589325893358934589355893658937589385893958940589415894258943589445894558946589475894858949589505895158952589535895458955589565895758958589595896058961589625896358964589655896658967589685896958970589715897258973589745897558976589775897858979589805898158982589835898458985589865898758988589895899058991589925899358994589955899658997589985899959000590015900259003590045900559006590075900859009590105901159012590135901459015590165901759018590195902059021590225902359024590255902659027590285902959030590315903259033590345903559036590375903859039590405904159042590435904459045590465904759048590495905059051590525905359054590555905659057590585905959060590615906259063590645906559066590675906859069590705907159072590735907459075590765907759078590795908059081590825908359084590855908659087590885908959090590915909259093590945909559096590975909859099591005910159102591035910459105591065910759108591095911059111591125911359114591155911659117591185911959120591215912259123591245912559126591275912859129591305913159132591335913459135591365913759138591395914059141591425914359144591455914659147591485914959150591515915259153591545915559156591575915859159591605916159162591635916459165591665916759168591695917059171591725917359174591755917659177591785917959180591815918259183591845918559186591875918859189591905919159192591935919459195591965919759198591995920059201592025920359204592055920659207592085920959210592115921259213592145921559216592175921859219592205922159222592235922459225592265922759228592295923059231592325923359234592355923659237592385923959240592415924259243592445924559246592475924859249592505925159252592535925459255592565925759258592595926059261592625926359264592655926659267592685926959270592715927259273592745927559276592775927859279592805928159282592835928459285592865928759288592895929059291592925929359294592955929659297592985929959300593015930259303593045930559306593075930859309593105931159312593135931459315593165931759318593195932059321593225932359324593255932659327593285932959330593315933259333593345933559336593375933859339593405934159342593435934459345593465934759348593495935059351593525935359354593555935659357593585935959360593615936259363593645936559366593675936859369593705937159372593735937459375593765937759378593795938059381593825938359384593855938659387593885938959390593915939259393593945939559396593975939859399594005940159402594035940459405594065940759408594095941059411594125941359414594155941659417594185941959420594215942259423594245942559426594275942859429594305943159432594335943459435594365943759438594395944059441594425944359444594455944659447594485944959450594515945259453594545945559456594575945859459594605946159462594635946459465594665946759468594695947059471594725947359474594755947659477594785947959480594815948259483594845948559486594875948859489594905949159492594935949459495594965949759498594995950059501595025950359504595055950659507595085950959510595115951259513595145951559516595175951859519595205952159522595235952459525595265952759528595295953059531595325953359534595355953659537595385953959540595415954259543595445954559546595475954859549595505955159552595535955459555595565955759558595595956059561595625956359564595655956659567595685956959570595715957259573595745957559576595775957859579595805958159582595835958459585595865958759588595895959059591595925959359594595955959659597595985959959600596015960259603596045960559606596075960859609596105961159612596135961459615596165961759618596195962059621596225962359624596255962659627596285962959630596315963259633596345963559636596375963859639596405964159642596435964459645596465964759648596495965059651596525965359654596555965659657596585965959660596615966259663596645966559666596675966859669596705967159672596735967459675596765967759678596795968059681596825968359684596855968659687596885968959690596915969259693596945969559696596975969859699597005970159702597035970459705597065970759708597095971059711597125971359714597155971659717597185971959720597215972259723597245972559726597275972859729597305973159732597335973459735597365973759738597395974059741597425974359744597455974659747597485974959750597515975259753597545975559756597575975859759597605976159762597635976459765597665976759768597695977059771597725977359774597755977659777597785977959780597815978259783597845978559786597875978859789597905979159792597935979459795597965979759798597995980059801598025980359804598055980659807598085980959810598115981259813598145981559816598175981859819598205982159822598235982459825598265982759828598295983059831598325983359834598355983659837598385983959840598415984259843598445984559846598475984859849598505985159852598535985459855598565985759858598595986059861598625986359864598655986659867598685986959870598715987259873598745987559876598775987859879598805988159882598835988459885598865988759888598895989059891598925989359894598955989659897598985989959900599015990259903599045990559906599075990859909599105991159912599135991459915599165991759918599195992059921599225992359924599255992659927599285992959930599315993259933599345993559936599375993859939599405994159942599435994459945599465994759948599495995059951599525995359954599555995659957599585995959960599615996259963599645996559966599675996859969599705997159972599735997459975599765997759978599795998059981599825998359984599855998659987599885998959990599915999259993599945999559996599975999859999600006000160002600036000460005600066000760008600096001060011600126001360014600156001660017600186001960020600216002260023600246002560026600276002860029600306003160032600336003460035600366003760038600396004060041600426004360044600456004660047600486004960050600516005260053600546005560056600576005860059600606006160062600636006460065600666006760068600696007060071600726007360074600756007660077600786007960080600816008260083600846008560086600876008860089600906009160092600936009460095600966009760098600996010060101601026010360104601056010660107601086010960110601116011260113601146011560116601176011860119601206012160122601236012460125601266012760128601296013060131601326013360134601356013660137601386013960140601416014260143601446014560146601476014860149601506015160152601536015460155601566015760158601596016060161601626016360164601656016660167601686016960170601716017260173601746017560176601776017860179601806018160182601836018460185601866018760188601896019060191601926019360194601956019660197601986019960200602016020260203602046020560206602076020860209602106021160212602136021460215602166021760218602196022060221602226022360224602256022660227602286022960230602316023260233602346023560236602376023860239602406024160242602436024460245602466024760248602496025060251602526025360254602556025660257602586025960260602616026260263602646026560266602676026860269602706027160272602736027460275602766027760278602796028060281602826028360284602856028660287602886028960290602916029260293602946029560296602976029860299603006030160302603036030460305603066030760308603096031060311603126031360314603156031660317603186031960320603216032260323603246032560326603276032860329603306033160332603336033460335603366033760338603396034060341603426034360344603456034660347603486034960350603516035260353603546035560356603576035860359603606036160362603636036460365603666036760368603696037060371603726037360374603756037660377603786037960380603816038260383603846038560386603876038860389603906039160392603936039460395603966039760398603996040060401604026040360404604056040660407604086040960410604116041260413604146041560416604176041860419604206042160422604236042460425604266042760428604296043060431604326043360434604356043660437604386043960440604416044260443604446044560446604476044860449604506045160452604536045460455604566045760458604596046060461604626046360464604656046660467604686046960470604716047260473604746047560476604776047860479604806048160482604836048460485604866048760488604896049060491604926049360494604956049660497604986049960500605016050260503605046050560506605076050860509605106051160512605136051460515605166051760518605196052060521605226052360524605256052660527605286052960530605316053260533605346053560536605376053860539605406054160542605436054460545605466054760548605496055060551605526055360554605556055660557605586055960560605616056260563605646056560566605676056860569605706057160572605736057460575605766057760578605796058060581605826058360584605856058660587605886058960590605916059260593605946059560596605976059860599606006060160602606036060460605606066060760608606096061060611606126061360614606156061660617606186061960620606216062260623606246062560626606276062860629606306063160632606336063460635606366063760638606396064060641606426064360644606456064660647606486064960650606516065260653606546065560656606576065860659606606066160662606636066460665606666066760668606696067060671606726067360674606756067660677606786067960680606816068260683606846068560686606876068860689606906069160692606936069460695606966069760698606996070060701607026070360704607056070660707607086070960710607116071260713607146071560716607176071860719607206072160722607236072460725607266072760728607296073060731607326073360734607356073660737607386073960740607416074260743607446074560746607476074860749607506075160752607536075460755607566075760758607596076060761607626076360764607656076660767607686076960770607716077260773607746077560776607776077860779607806078160782607836078460785607866078760788607896079060791607926079360794607956079660797607986079960800608016080260803608046080560806608076080860809608106081160812608136081460815608166081760818608196082060821608226082360824608256082660827608286082960830608316083260833608346083560836608376083860839608406084160842608436084460845608466084760848608496085060851608526085360854608556085660857608586085960860608616086260863608646086560866608676086860869608706087160872608736087460875608766087760878608796088060881608826088360884608856088660887608886088960890608916089260893608946089560896608976089860899609006090160902609036090460905609066090760908609096091060911609126091360914609156091660917609186091960920609216092260923609246092560926609276092860929609306093160932609336093460935609366093760938609396094060941609426094360944609456094660947609486094960950609516095260953609546095560956609576095860959609606096160962609636096460965609666096760968609696097060971609726097360974609756097660977609786097960980609816098260983609846098560986609876098860989609906099160992609936099460995609966099760998609996100061001610026100361004610056100661007610086100961010610116101261013610146101561016610176101861019610206102161022610236102461025610266102761028610296103061031610326103361034610356103661037610386103961040610416104261043610446104561046610476104861049610506105161052610536105461055610566105761058610596106061061610626106361064610656106661067610686106961070610716107261073610746107561076610776107861079610806108161082610836108461085610866108761088610896109061091610926109361094610956109661097610986109961100611016110261103611046110561106611076110861109611106111161112611136111461115611166111761118611196112061121611226112361124611256112661127611286112961130611316113261133611346113561136611376113861139611406114161142611436114461145611466114761148611496115061151611526115361154611556115661157611586115961160611616116261163611646116561166611676116861169611706117161172611736117461175611766117761178611796118061181611826118361184611856118661187611886118961190611916119261193611946119561196611976119861199612006120161202612036120461205612066120761208612096121061211612126121361214612156121661217612186121961220612216122261223612246122561226612276122861229612306123161232612336123461235612366123761238612396124061241612426124361244612456124661247612486124961250612516125261253612546125561256612576125861259612606126161262612636126461265612666126761268612696127061271612726127361274612756127661277612786127961280612816128261283612846128561286612876128861289612906129161292612936129461295612966129761298612996130061301613026130361304613056130661307613086130961310613116131261313613146131561316613176131861319613206132161322613236132461325613266132761328613296133061331613326133361334613356133661337613386133961340613416134261343613446134561346613476134861349613506135161352613536135461355613566135761358613596136061361613626136361364613656136661367613686136961370613716137261373613746137561376613776137861379613806138161382613836138461385613866138761388613896139061391613926139361394613956139661397613986139961400614016140261403614046140561406614076140861409614106141161412614136141461415614166141761418614196142061421614226142361424614256142661427614286142961430614316143261433614346143561436614376143861439614406144161442614436144461445614466144761448614496145061451614526145361454614556145661457614586145961460614616146261463614646146561466614676146861469614706147161472614736147461475614766147761478614796148061481614826148361484614856148661487614886148961490614916149261493614946149561496614976149861499615006150161502615036150461505615066150761508615096151061511615126151361514615156151661517615186151961520615216152261523615246152561526615276152861529615306153161532615336153461535615366153761538615396154061541615426154361544615456154661547615486154961550615516155261553615546155561556615576155861559615606156161562615636156461565615666156761568615696157061571615726157361574615756157661577615786157961580615816158261583615846158561586615876158861589615906159161592615936159461595615966159761598615996160061601616026160361604616056160661607616086160961610616116161261613616146161561616616176161861619616206162161622616236162461625616266162761628616296163061631616326163361634616356163661637616386163961640616416164261643616446164561646616476164861649616506165161652616536165461655616566165761658616596166061661616626166361664616656166661667616686166961670616716167261673616746167561676616776167861679616806168161682616836168461685616866168761688616896169061691616926169361694616956169661697616986169961700617016170261703617046170561706617076170861709617106171161712617136171461715617166171761718617196172061721617226172361724617256172661727617286172961730617316173261733617346173561736617376173861739617406174161742617436174461745617466174761748617496175061751617526175361754617556175661757617586175961760617616176261763617646176561766617676176861769617706177161772617736177461775617766177761778617796178061781617826178361784617856178661787617886178961790617916179261793617946179561796617976179861799618006180161802618036180461805618066180761808618096181061811618126181361814618156181661817618186181961820618216182261823618246182561826618276182861829618306183161832618336183461835618366183761838618396184061841618426184361844618456184661847618486184961850618516185261853618546185561856618576185861859618606186161862618636186461865618666186761868618696187061871618726187361874618756187661877618786187961880618816188261883618846188561886618876188861889618906189161892618936189461895618966189761898618996190061901619026190361904619056190661907619086190961910619116191261913619146191561916619176191861919619206192161922619236192461925619266192761928619296193061931619326193361934619356193661937619386193961940619416194261943619446194561946619476194861949619506195161952619536195461955619566195761958619596196061961619626196361964619656196661967619686196961970619716197261973619746197561976619776197861979619806198161982619836198461985619866198761988619896199061991619926199361994619956199661997619986199962000620016200262003620046200562006620076200862009620106201162012620136201462015620166201762018620196202062021620226202362024620256202662027620286202962030620316203262033620346203562036620376203862039620406204162042620436204462045620466204762048620496205062051620526205362054620556205662057620586205962060620616206262063620646206562066620676206862069620706207162072620736207462075620766207762078620796208062081620826208362084620856208662087620886208962090620916209262093620946209562096620976209862099621006210162102621036210462105621066210762108621096211062111621126211362114621156211662117621186211962120621216212262123621246212562126621276212862129621306213162132621336213462135621366213762138621396214062141621426214362144621456214662147621486214962150621516215262153621546215562156621576215862159621606216162162621636216462165621666216762168621696217062171621726217362174621756217662177621786217962180621816218262183621846218562186621876218862189621906219162192621936219462195621966219762198621996220062201622026220362204622056220662207622086220962210622116221262213622146221562216622176221862219622206222162222622236222462225622266222762228622296223062231622326223362234622356223662237622386223962240622416224262243622446224562246622476224862249622506225162252622536225462255622566225762258622596226062261622626226362264622656226662267622686226962270622716227262273622746227562276622776227862279622806228162282622836228462285622866228762288622896229062291622926229362294622956229662297622986229962300623016230262303623046230562306623076230862309623106231162312623136231462315623166231762318623196232062321623226232362324623256232662327623286232962330623316233262333623346233562336623376233862339623406234162342623436234462345623466234762348623496235062351623526235362354623556235662357623586235962360623616236262363623646236562366623676236862369623706237162372623736237462375623766237762378623796238062381623826238362384623856238662387623886238962390623916239262393623946239562396623976239862399624006240162402624036240462405624066240762408624096241062411624126241362414624156241662417624186241962420624216242262423624246242562426624276242862429624306243162432624336243462435624366243762438624396244062441624426244362444624456244662447624486244962450624516245262453624546245562456624576245862459624606246162462624636246462465624666246762468624696247062471624726247362474624756247662477624786247962480624816248262483624846248562486624876248862489624906249162492624936249462495624966249762498624996250062501625026250362504625056250662507625086250962510625116251262513625146251562516625176251862519625206252162522625236252462525625266252762528625296253062531625326253362534625356253662537625386253962540625416254262543625446254562546625476254862549625506255162552625536255462555625566255762558625596256062561625626256362564625656256662567625686256962570625716257262573625746257562576625776257862579625806258162582625836258462585625866258762588625896259062591625926259362594625956259662597625986259962600626016260262603626046260562606626076260862609626106261162612626136261462615626166261762618626196262062621626226262362624626256262662627626286262962630626316263262633626346263562636626376263862639626406264162642626436264462645626466264762648626496265062651626526265362654626556265662657626586265962660626616266262663626646266562666626676266862669626706267162672626736267462675626766267762678626796268062681626826268362684626856268662687626886268962690626916269262693626946269562696626976269862699627006270162702627036270462705627066270762708627096271062711627126271362714627156271662717627186271962720627216272262723627246272562726627276272862729627306273162732627336273462735627366273762738627396274062741627426274362744627456274662747627486274962750627516275262753627546275562756627576275862759627606276162762627636276462765627666276762768627696277062771627726277362774627756277662777627786277962780627816278262783627846278562786627876278862789627906279162792627936279462795627966279762798627996280062801628026280362804628056280662807628086280962810628116281262813628146281562816628176281862819628206282162822628236282462825628266282762828628296283062831628326283362834628356283662837628386283962840628416284262843628446284562846628476284862849628506285162852628536285462855628566285762858628596286062861628626286362864628656286662867628686286962870628716287262873628746287562876628776287862879628806288162882628836288462885628866288762888628896289062891628926289362894628956289662897628986289962900629016290262903629046290562906629076290862909629106291162912629136291462915629166291762918629196292062921629226292362924629256292662927629286292962930629316293262933629346293562936629376293862939629406294162942629436294462945629466294762948629496295062951629526295362954629556295662957629586295962960629616296262963629646296562966629676296862969629706297162972629736297462975629766297762978629796298062981629826298362984629856298662987629886298962990629916299262993629946299562996629976299862999630006300163002630036300463005630066300763008630096301063011630126301363014630156301663017630186301963020630216302263023630246302563026630276302863029630306303163032630336303463035630366303763038630396304063041630426304363044630456304663047630486304963050630516305263053630546305563056630576305863059630606306163062630636306463065630666306763068630696307063071630726307363074630756307663077630786307963080630816308263083630846308563086630876308863089630906309163092630936309463095630966309763098630996310063101631026310363104631056310663107631086310963110631116311263113631146311563116631176311863119631206312163122631236312463125631266312763128631296313063131631326313363134631356313663137631386313963140631416314263143631446314563146631476314863149631506315163152631536315463155631566315763158631596316063161631626316363164631656316663167631686316963170631716317263173631746317563176631776317863179631806318163182631836318463185631866318763188631896319063191631926319363194631956319663197631986319963200632016320263203632046320563206632076320863209632106321163212632136321463215632166321763218632196322063221632226322363224632256322663227632286322963230632316323263233632346323563236632376323863239632406324163242632436324463245632466324763248632496325063251632526325363254632556325663257632586325963260632616326263263632646326563266632676326863269632706327163272632736327463275632766327763278632796328063281632826328363284632856328663287632886328963290632916329263293632946329563296632976329863299633006330163302633036330463305633066330763308633096331063311633126331363314633156331663317633186331963320633216332263323633246332563326633276332863329633306333163332633336333463335633366333763338633396334063341633426334363344633456334663347633486334963350633516335263353633546335563356633576335863359633606336163362633636336463365633666336763368633696337063371633726337363374633756337663377633786337963380633816338263383633846338563386633876338863389633906339163392633936339463395633966339763398633996340063401634026340363404634056340663407634086340963410634116341263413634146341563416634176341863419634206342163422634236342463425634266342763428634296343063431634326343363434634356343663437634386343963440634416344263443634446344563446634476344863449634506345163452634536345463455634566345763458634596346063461634626346363464634656346663467634686346963470634716347263473634746347563476634776347863479634806348163482634836348463485634866348763488634896349063491634926349363494634956349663497634986349963500635016350263503635046350563506635076350863509635106351163512635136351463515635166351763518635196352063521635226352363524635256352663527635286352963530635316353263533635346353563536635376353863539635406354163542635436354463545635466354763548635496355063551635526355363554635556355663557635586355963560635616356263563635646356563566635676356863569635706357163572635736357463575635766357763578635796358063581635826358363584635856358663587635886358963590635916359263593635946359563596635976359863599636006360163602636036360463605636066360763608636096361063611636126361363614636156361663617636186361963620636216362263623636246362563626636276362863629636306363163632636336363463635636366363763638636396364063641636426364363644636456364663647636486364963650636516365263653636546365563656636576365863659636606366163662636636366463665636666366763668636696367063671636726367363674636756367663677636786367963680636816368263683636846368563686636876368863689636906369163692636936369463695636966369763698636996370063701637026370363704637056370663707637086370963710637116371263713637146371563716637176371863719637206372163722637236372463725637266372763728637296373063731637326373363734637356373663737637386373963740637416374263743637446374563746637476374863749637506375163752637536375463755637566375763758637596376063761637626376363764637656376663767637686376963770637716377263773637746377563776637776377863779637806378163782637836378463785637866378763788637896379063791637926379363794637956379663797637986379963800638016380263803638046380563806638076380863809638106381163812638136381463815638166381763818638196382063821638226382363824638256382663827638286382963830638316383263833638346383563836638376383863839638406384163842638436384463845638466384763848638496385063851638526385363854638556385663857638586385963860638616386263863638646386563866638676386863869638706387163872638736387463875638766387763878638796388063881638826388363884638856388663887638886388963890638916389263893638946389563896638976389863899639006390163902639036390463905639066390763908639096391063911639126391363914639156391663917639186391963920639216392263923639246392563926639276392863929639306393163932639336393463935639366393763938639396394063941639426394363944639456394663947639486394963950639516395263953639546395563956639576395863959639606396163962639636396463965639666396763968639696397063971639726397363974639756397663977639786397963980639816398263983639846398563986639876398863989639906399163992639936399463995639966399763998639996400064001640026400364004640056400664007640086400964010640116401264013640146401564016640176401864019640206402164022640236402464025640266402764028640296403064031640326403364034640356403664037640386403964040640416404264043640446404564046640476404864049640506405164052640536405464055640566405764058640596406064061640626406364064640656406664067640686406964070640716407264073640746407564076640776407864079640806408164082640836408464085640866408764088640896409064091640926409364094640956409664097640986409964100641016410264103641046410564106641076410864109641106411164112641136411464115641166411764118641196412064121641226412364124641256412664127641286412964130641316413264133641346413564136641376413864139641406414164142641436414464145641466414764148641496415064151641526415364154641556415664157641586415964160641616416264163641646416564166641676416864169641706417164172641736417464175641766417764178641796418064181641826418364184641856418664187641886418964190641916419264193641946419564196641976419864199642006420164202642036420464205642066420764208642096421064211642126421364214642156421664217642186421964220642216422264223642246422564226642276422864229642306423164232642336423464235642366423764238642396424064241642426424364244642456424664247642486424964250642516425264253642546425564256642576425864259642606426164262642636426464265642666426764268642696427064271642726427364274642756427664277642786427964280642816428264283642846428564286642876428864289642906429164292642936429464295642966429764298642996430064301643026430364304643056430664307643086430964310643116431264313643146431564316643176431864319643206432164322643236432464325643266432764328643296433064331643326433364334643356433664337643386433964340643416434264343643446434564346643476434864349643506435164352643536435464355643566435764358643596436064361643626436364364643656436664367643686436964370643716437264373643746437564376643776437864379643806438164382643836438464385643866438764388643896439064391643926439364394643956439664397643986439964400644016440264403644046440564406644076440864409644106441164412644136441464415644166441764418644196442064421644226442364424644256442664427644286442964430644316443264433644346443564436644376443864439644406444164442644436444464445644466444764448644496445064451644526445364454644556445664457644586445964460644616446264463644646446564466644676446864469644706447164472644736447464475644766447764478644796448064481644826448364484644856448664487644886448964490644916449264493644946449564496644976449864499645006450164502645036450464505645066450764508645096451064511645126451364514645156451664517645186451964520645216452264523645246452564526645276452864529645306453164532645336453464535645366453764538645396454064541645426454364544645456454664547645486454964550645516455264553645546455564556645576455864559645606456164562645636456464565645666456764568645696457064571645726457364574645756457664577645786457964580645816458264583645846458564586645876458864589645906459164592645936459464595645966459764598645996460064601646026460364604646056460664607646086460964610646116461264613646146461564616646176461864619646206462164622646236462464625646266462764628646296463064631646326463364634646356463664637646386463964640646416464264643646446464564646646476464864649646506465164652646536465464655646566465764658646596466064661646626466364664646656466664667646686466964670646716467264673646746467564676646776467864679646806468164682646836468464685646866468764688646896469064691646926469364694646956469664697646986469964700647016470264703647046470564706647076470864709647106471164712647136471464715647166471764718647196472064721647226472364724647256472664727647286472964730647316473264733647346473564736647376473864739647406474164742647436474464745647466474764748647496475064751647526475364754647556475664757647586475964760647616476264763647646476564766647676476864769647706477164772647736477464775647766477764778647796478064781647826478364784647856478664787647886478964790647916479264793647946479564796647976479864799648006480164802648036480464805648066480764808648096481064811648126481364814648156481664817648186481964820648216482264823648246482564826648276482864829648306483164832648336483464835648366483764838648396484064841648426484364844648456484664847648486484964850648516485264853648546485564856648576485864859648606486164862648636486464865648666486764868648696487064871648726487364874648756487664877648786487964880648816488264883648846488564886648876488864889648906489164892648936489464895648966489764898648996490064901649026490364904649056490664907649086490964910649116491264913649146491564916649176491864919649206492164922649236492464925649266492764928649296493064931649326493364934649356493664937649386493964940649416494264943649446494564946649476494864949649506495164952649536495464955649566495764958649596496064961649626496364964649656496664967649686496964970649716497264973649746497564976649776497864979649806498164982649836498464985649866498764988649896499064991649926499364994649956499664997649986499965000650016500265003650046500565006650076500865009650106501165012650136501465015650166501765018650196502065021650226502365024650256502665027650286502965030650316503265033650346503565036650376503865039650406504165042650436504465045650466504765048650496505065051650526505365054650556505665057650586505965060650616506265063650646506565066650676506865069650706507165072650736507465075650766507765078650796508065081650826508365084650856508665087650886508965090650916509265093650946509565096650976509865099651006510165102651036510465105651066510765108651096511065111651126511365114651156511665117651186511965120651216512265123651246512565126651276512865129651306513165132651336513465135651366513765138651396514065141651426514365144651456514665147651486514965150651516515265153651546515565156651576515865159651606516165162651636516465165651666516765168651696517065171651726517365174651756517665177651786517965180651816518265183651846518565186651876518865189651906519165192651936519465195651966519765198651996520065201652026520365204652056520665207652086520965210652116521265213652146521565216652176521865219652206522165222652236522465225652266522765228652296523065231652326523365234652356523665237652386523965240652416524265243652446524565246652476524865249652506525165252652536525465255652566525765258652596526065261652626526365264652656526665267652686526965270652716527265273652746527565276652776527865279652806528165282652836528465285652866528765288652896529065291652926529365294652956529665297652986529965300653016530265303653046530565306653076530865309653106531165312653136531465315653166531765318653196532065321653226532365324653256532665327653286532965330653316533265333653346533565336653376533865339653406534165342653436534465345653466534765348653496535065351653526535365354653556535665357653586535965360653616536265363653646536565366653676536865369653706537165372653736537465375653766537765378653796538065381653826538365384653856538665387653886538965390653916539265393653946539565396653976539865399654006540165402654036540465405654066540765408654096541065411654126541365414654156541665417654186541965420654216542265423654246542565426654276542865429654306543165432654336543465435654366543765438654396544065441654426544365444654456544665447654486544965450654516545265453654546545565456654576545865459654606546165462654636546465465654666546765468654696547065471654726547365474654756547665477654786547965480654816548265483654846548565486654876548865489654906549165492654936549465495654966549765498654996550065501655026550365504655056550665507655086550965510655116551265513655146551565516655176551865519655206552165522655236552465525655266552765528655296553065531655326553365534655356553665537655386553965540655416554265543655446554565546655476554865549655506555165552655536555465555655566555765558655596556065561655626556365564655656556665567655686556965570655716557265573655746557565576655776557865579655806558165582655836558465585655866558765588655896559065591655926559365594655956559665597655986559965600656016560265603656046560565606656076560865609656106561165612656136561465615656166561765618656196562065621656226562365624656256562665627656286562965630656316563265633656346563565636656376563865639656406564165642656436564465645656466564765648656496565065651656526565365654656556565665657656586565965660656616566265663656646566565666656676566865669656706567165672656736567465675656766567765678656796568065681656826568365684656856568665687656886568965690656916569265693656946569565696656976569865699657006570165702657036570465705657066570765708657096571065711657126571365714657156571665717657186571965720657216572265723657246572565726657276572865729657306573165732657336573465735657366573765738657396574065741657426574365744657456574665747657486574965750657516575265753657546575565756657576575865759657606576165762657636576465765657666576765768657696577065771657726577365774657756577665777657786577965780657816578265783657846578565786657876578865789657906579165792657936579465795657966579765798657996580065801658026580365804658056580665807658086580965810658116581265813658146581565816658176581865819658206582165822658236582465825658266582765828658296583065831658326583365834658356583665837658386583965840658416584265843658446584565846658476584865849658506585165852658536585465855658566585765858658596586065861658626586365864658656586665867658686586965870658716587265873658746587565876658776587865879658806588165882658836588465885658866588765888658896589065891658926589365894658956589665897658986589965900659016590265903659046590565906659076590865909659106591165912659136591465915659166591765918659196592065921659226592365924659256592665927659286592965930659316593265933659346593565936659376593865939659406594165942659436594465945659466594765948659496595065951659526595365954659556595665957659586595965960659616596265963659646596565966659676596865969659706597165972659736597465975659766597765978659796598065981659826598365984659856598665987659886598965990659916599265993659946599565996659976599865999660006600166002660036600466005660066600766008660096601066011660126601366014660156601666017660186601966020660216602266023660246602566026660276602866029660306603166032660336603466035660366603766038660396604066041660426604366044660456604666047660486604966050660516605266053660546605566056660576605866059660606606166062660636606466065660666606766068660696607066071660726607366074660756607666077660786607966080660816608266083660846608566086660876608866089660906609166092660936609466095660966609766098660996610066101661026610366104661056610666107661086610966110661116611266113661146611566116661176611866119661206612166122661236612466125661266612766128661296613066131661326613366134661356613666137661386613966140661416614266143661446614566146661476614866149661506615166152661536615466155661566615766158661596616066161661626616366164661656616666167661686616966170661716617266173661746617566176661776617866179661806618166182661836618466185661866618766188661896619066191661926619366194661956619666197661986619966200662016620266203662046620566206662076620866209662106621166212662136621466215662166621766218662196622066221662226622366224662256622666227662286622966230662316623266233662346623566236662376623866239662406624166242662436624466245662466624766248662496625066251662526625366254662556625666257662586625966260662616626266263662646626566266662676626866269662706627166272662736627466275662766627766278662796628066281662826628366284662856628666287662886628966290662916629266293662946629566296662976629866299663006630166302663036630466305663066630766308663096631066311663126631366314663156631666317663186631966320663216632266323663246632566326663276632866329663306633166332663336633466335663366633766338663396634066341663426634366344663456634666347663486634966350663516635266353663546635566356663576635866359663606636166362663636636466365663666636766368663696637066371663726637366374663756637666377663786637966380663816638266383663846638566386663876638866389663906639166392663936639466395663966639766398663996640066401664026640366404664056640666407664086640966410664116641266413664146641566416664176641866419664206642166422664236642466425664266642766428664296643066431664326643366434664356643666437664386643966440664416644266443664446644566446664476644866449664506645166452664536645466455664566645766458664596646066461664626646366464664656646666467664686646966470664716647266473664746647566476664776647866479664806648166482664836648466485664866648766488664896649066491664926649366494664956649666497664986649966500665016650266503665046650566506665076650866509665106651166512665136651466515665166651766518665196652066521665226652366524665256652666527665286652966530665316653266533665346653566536665376653866539665406654166542665436654466545665466654766548665496655066551665526655366554665556655666557665586655966560665616656266563665646656566566665676656866569665706657166572665736657466575665766657766578665796658066581665826658366584665856658666587665886658966590665916659266593665946659566596665976659866599666006660166602666036660466605666066660766608666096661066611666126661366614666156661666617666186661966620666216662266623666246662566626666276662866629666306663166632666336663466635666366663766638666396664066641666426664366644666456664666647666486664966650666516665266653666546665566656666576665866659666606666166662666636666466665666666666766668666696667066671666726667366674666756667666677666786667966680666816668266683666846668566686666876668866689666906669166692666936669466695666966669766698666996670066701667026670366704667056670666707667086670966710667116671266713667146671566716667176671866719667206672166722667236672466725667266672766728667296673066731667326673366734667356673666737667386673966740667416674266743667446674566746667476674866749667506675166752667536675466755667566675766758667596676066761667626676366764667656676666767667686676966770667716677266773667746677566776667776677866779667806678166782667836678466785667866678766788667896679066791667926679366794667956679666797667986679966800668016680266803668046680566806668076680866809668106681166812668136681466815668166681766818668196682066821668226682366824668256682666827668286682966830668316683266833668346683566836668376683866839668406684166842668436684466845668466684766848668496685066851668526685366854668556685666857668586685966860668616686266863668646686566866668676686866869668706687166872668736687466875668766687766878668796688066881668826688366884668856688666887668886688966890668916689266893668946689566896668976689866899669006690166902669036690466905669066690766908669096691066911669126691366914669156691666917669186691966920669216692266923669246692566926669276692866929669306693166932669336693466935669366693766938669396694066941669426694366944669456694666947669486694966950669516695266953669546695566956669576695866959669606696166962669636696466965669666696766968669696697066971669726697366974669756697666977669786697966980669816698266983669846698566986669876698866989669906699166992669936699466995669966699766998669996700067001670026700367004670056700667007670086700967010670116701267013670146701567016670176701867019670206702167022670236702467025670266702767028670296703067031670326703367034670356703667037670386703967040670416704267043670446704567046670476704867049670506705167052670536705467055670566705767058670596706067061670626706367064670656706667067670686706967070670716707267073670746707567076670776707867079670806708167082670836708467085670866708767088670896709067091670926709367094670956709667097670986709967100671016710267103671046710567106671076710867109671106711167112671136711467115671166711767118671196712067121671226712367124671256712667127671286712967130671316713267133671346713567136671376713867139671406714167142671436714467145671466714767148671496715067151671526715367154671556715667157671586715967160671616716267163671646716567166671676716867169671706717167172671736717467175671766717767178671796718067181671826718367184671856718667187671886718967190671916719267193671946719567196671976719867199672006720167202672036720467205672066720767208672096721067211672126721367214672156721667217672186721967220672216722267223672246722567226672276722867229672306723167232672336723467235672366723767238672396724067241672426724367244672456724667247672486724967250672516725267253672546725567256672576725867259672606726167262672636726467265672666726767268672696727067271672726727367274672756727667277672786727967280672816728267283672846728567286672876728867289672906729167292672936729467295672966729767298672996730067301673026730367304673056730667307673086730967310673116731267313673146731567316673176731867319673206732167322673236732467325673266732767328673296733067331673326733367334673356733667337673386733967340673416734267343673446734567346673476734867349673506735167352673536735467355673566735767358673596736067361673626736367364673656736667367673686736967370673716737267373673746737567376673776737867379673806738167382673836738467385673866738767388673896739067391673926739367394673956739667397673986739967400674016740267403674046740567406674076740867409674106741167412674136741467415674166741767418674196742067421674226742367424674256742667427674286742967430674316743267433674346743567436674376743867439674406744167442674436744467445674466744767448674496745067451674526745367454674556745667457674586745967460674616746267463674646746567466674676746867469674706747167472674736747467475674766747767478674796748067481674826748367484674856748667487674886748967490674916749267493674946749567496674976749867499675006750167502675036750467505675066750767508675096751067511675126751367514675156751667517675186751967520675216752267523675246752567526675276752867529675306753167532675336753467535675366753767538675396754067541675426754367544675456754667547675486754967550675516755267553675546755567556675576755867559675606756167562675636756467565675666756767568675696757067571675726757367574675756757667577675786757967580675816758267583675846758567586675876758867589675906759167592675936759467595675966759767598675996760067601676026760367604676056760667607676086760967610676116761267613676146761567616676176761867619676206762167622676236762467625676266762767628676296763067631676326763367634676356763667637676386763967640676416764267643676446764567646676476764867649676506765167652676536765467655676566765767658676596766067661676626766367664676656766667667676686766967670676716767267673676746767567676676776767867679676806768167682676836768467685676866768767688676896769067691676926769367694676956769667697676986769967700677016770267703677046770567706677076770867709677106771167712677136771467715677166771767718677196772067721677226772367724677256772667727677286772967730677316773267733677346773567736677376773867739677406774167742677436774467745677466774767748677496775067751677526775367754677556775667757677586775967760677616776267763677646776567766677676776867769677706777167772677736777467775677766777767778677796778067781677826778367784677856778667787677886778967790677916779267793677946779567796677976779867799678006780167802678036780467805678066780767808678096781067811678126781367814678156781667817678186781967820678216782267823678246782567826678276782867829678306783167832678336783467835678366783767838678396784067841678426784367844678456784667847678486784967850678516785267853678546785567856678576785867859678606786167862678636786467865678666786767868678696787067871678726787367874678756787667877678786787967880678816788267883678846788567886678876788867889678906789167892678936789467895678966789767898678996790067901679026790367904679056790667907679086790967910679116791267913679146791567916679176791867919679206792167922679236792467925679266792767928679296793067931679326793367934679356793667937679386793967940679416794267943679446794567946679476794867949679506795167952679536795467955679566795767958679596796067961679626796367964679656796667967679686796967970679716797267973679746797567976679776797867979679806798167982679836798467985679866798767988679896799067991679926799367994679956799667997679986799968000680016800268003680046800568006680076800868009680106801168012680136801468015680166801768018680196802068021680226802368024680256802668027680286802968030680316803268033680346803568036680376803868039680406804168042680436804468045680466804768048680496805068051680526805368054680556805668057680586805968060680616806268063680646806568066680676806868069680706807168072680736807468075680766807768078680796808068081680826808368084680856808668087680886808968090680916809268093680946809568096680976809868099681006810168102681036810468105681066810768108681096811068111681126811368114681156811668117681186811968120681216812268123681246812568126681276812868129681306813168132681336813468135681366813768138681396814068141681426814368144681456814668147681486814968150681516815268153681546815568156681576815868159681606816168162681636816468165681666816768168681696817068171681726817368174681756817668177681786817968180681816818268183681846818568186681876818868189681906819168192681936819468195681966819768198681996820068201682026820368204682056820668207682086820968210682116821268213682146821568216682176821868219682206822168222682236822468225682266822768228682296823068231682326823368234682356823668237682386823968240682416824268243682446824568246682476824868249682506825168252682536825468255682566825768258682596826068261682626826368264682656826668267682686826968270682716827268273682746827568276682776827868279682806828168282682836828468285682866828768288682896829068291682926829368294682956829668297682986829968300683016830268303683046830568306683076830868309683106831168312683136831468315683166831768318683196832068321683226832368324683256832668327683286832968330683316833268333683346833568336683376833868339683406834168342683436834468345683466834768348683496835068351683526835368354683556835668357683586835968360683616836268363683646836568366683676836868369683706837168372683736837468375683766837768378683796838068381683826838368384683856838668387683886838968390683916839268393683946839568396683976839868399684006840168402684036840468405684066840768408684096841068411684126841368414684156841668417684186841968420684216842268423684246842568426684276842868429684306843168432684336843468435684366843768438684396844068441684426844368444684456844668447684486844968450684516845268453684546845568456684576845868459684606846168462684636846468465684666846768468684696847068471684726847368474684756847668477684786847968480684816848268483684846848568486684876848868489684906849168492684936849468495684966849768498684996850068501685026850368504685056850668507685086850968510685116851268513685146851568516685176851868519685206852168522685236852468525685266852768528685296853068531685326853368534685356853668537685386853968540685416854268543685446854568546685476854868549685506855168552685536855468555685566855768558685596856068561685626856368564685656856668567685686856968570685716857268573685746857568576685776857868579685806858168582685836858468585685866858768588685896859068591685926859368594685956859668597685986859968600686016860268603686046860568606686076860868609686106861168612686136861468615686166861768618686196862068621686226862368624686256862668627686286862968630686316863268633686346863568636686376863868639686406864168642686436864468645686466864768648686496865068651686526865368654686556865668657686586865968660686616866268663686646866568666686676866868669686706867168672686736867468675686766867768678686796868068681686826868368684686856868668687686886868968690686916869268693686946869568696686976869868699687006870168702687036870468705687066870768708687096871068711687126871368714687156871668717687186871968720687216872268723687246872568726687276872868729687306873168732687336873468735687366873768738687396874068741687426874368744687456874668747687486874968750687516875268753687546875568756687576875868759687606876168762687636876468765687666876768768687696877068771687726877368774687756877668777687786877968780687816878268783687846878568786687876878868789687906879168792687936879468795687966879768798687996880068801688026880368804688056880668807688086880968810688116881268813688146881568816688176881868819688206882168822688236882468825688266882768828688296883068831688326883368834688356883668837688386883968840688416884268843688446884568846688476884868849688506885168852688536885468855688566885768858688596886068861688626886368864688656886668867688686886968870688716887268873688746887568876688776887868879688806888168882688836888468885688866888768888688896889068891688926889368894688956889668897688986889968900689016890268903689046890568906689076890868909689106891168912689136891468915689166891768918689196892068921689226892368924689256892668927689286892968930689316893268933689346893568936689376893868939689406894168942689436894468945689466894768948689496895068951689526895368954689556895668957689586895968960689616896268963689646896568966689676896868969689706897168972689736897468975689766897768978689796898068981689826898368984689856898668987689886898968990689916899268993689946899568996689976899868999690006900169002690036900469005690066900769008690096901069011690126901369014690156901669017690186901969020690216902269023690246902569026690276902869029690306903169032690336903469035690366903769038690396904069041690426904369044690456904669047690486904969050690516905269053690546905569056690576905869059690606906169062690636906469065690666906769068690696907069071690726907369074690756907669077690786907969080690816908269083690846908569086690876908869089690906909169092690936909469095690966909769098690996910069101691026910369104691056910669107691086910969110691116911269113691146911569116691176911869119691206912169122691236912469125691266912769128691296913069131691326913369134691356913669137691386913969140691416914269143691446914569146691476914869149691506915169152691536915469155691566915769158691596916069161691626916369164691656916669167691686916969170691716917269173691746917569176691776917869179691806918169182691836918469185691866918769188691896919069191691926919369194691956919669197691986919969200692016920269203692046920569206692076920869209692106921169212692136921469215692166921769218692196922069221692226922369224692256922669227692286922969230692316923269233692346923569236692376923869239692406924169242692436924469245692466924769248692496925069251692526925369254692556925669257692586925969260692616926269263692646926569266692676926869269692706927169272692736927469275692766927769278692796928069281692826928369284692856928669287692886928969290692916929269293692946929569296692976929869299693006930169302693036930469305693066930769308693096931069311693126931369314693156931669317693186931969320693216932269323693246932569326693276932869329693306933169332693336933469335693366933769338693396934069341693426934369344693456934669347693486934969350693516935269353693546935569356693576935869359693606936169362693636936469365693666936769368693696937069371693726937369374693756937669377693786937969380693816938269383693846938569386693876938869389693906939169392693936939469395693966939769398693996940069401694026940369404694056940669407694086940969410694116941269413694146941569416694176941869419694206942169422694236942469425694266942769428694296943069431694326943369434694356943669437694386943969440694416944269443694446944569446694476944869449694506945169452694536945469455694566945769458694596946069461694626946369464694656946669467694686946969470694716947269473694746947569476694776947869479694806948169482694836948469485694866948769488694896949069491694926949369494694956949669497694986949969500695016950269503695046950569506695076950869509695106951169512695136951469515695166951769518695196952069521695226952369524695256952669527695286952969530695316953269533695346953569536695376953869539695406954169542695436954469545695466954769548695496955069551695526955369554695556955669557695586955969560695616956269563695646956569566695676956869569695706957169572695736957469575695766957769578695796958069581695826958369584695856958669587695886958969590695916959269593695946959569596695976959869599696006960169602696036960469605696066960769608696096961069611696126961369614696156961669617696186961969620696216962269623696246962569626696276962869629696306963169632696336963469635696366963769638696396964069641696426964369644696456964669647696486964969650696516965269653696546965569656696576965869659696606966169662696636966469665696666966769668696696967069671696726967369674696756967669677696786967969680696816968269683696846968569686696876968869689696906969169692696936969469695696966969769698696996970069701697026970369704697056970669707697086970969710697116971269713697146971569716697176971869719697206972169722697236972469725697266972769728697296973069731697326973369734697356973669737697386973969740697416974269743697446974569746697476974869749697506975169752697536975469755697566975769758697596976069761697626976369764697656976669767697686976969770697716977269773697746977569776697776977869779697806978169782697836978469785697866978769788697896979069791697926979369794697956979669797697986979969800698016980269803698046980569806698076980869809698106981169812698136981469815698166981769818698196982069821698226982369824698256982669827698286982969830698316983269833698346983569836698376983869839698406984169842698436984469845698466984769848698496985069851698526985369854698556985669857698586985969860698616986269863698646986569866698676986869869698706987169872698736987469875698766987769878698796988069881698826988369884698856988669887698886988969890698916989269893698946989569896698976989869899699006990169902699036990469905699066990769908699096991069911699126991369914699156991669917699186991969920699216992269923699246992569926699276992869929699306993169932699336993469935699366993769938699396994069941699426994369944699456994669947699486994969950699516995269953699546995569956699576995869959699606996169962699636996469965699666996769968699696997069971699726997369974699756997669977699786997969980699816998269983699846998569986699876998869989699906999169992699936999469995699966999769998699997000070001700027000370004700057000670007700087000970010700117001270013700147001570016700177001870019700207002170022700237002470025700267002770028700297003070031700327003370034700357003670037700387003970040700417004270043700447004570046700477004870049700507005170052700537005470055700567005770058700597006070061700627006370064700657006670067700687006970070700717007270073700747007570076700777007870079700807008170082700837008470085700867008770088700897009070091700927009370094700957009670097700987009970100701017010270103701047010570106701077010870109701107011170112701137011470115701167011770118701197012070121701227012370124701257012670127701287012970130701317013270133701347013570136701377013870139701407014170142701437014470145701467014770148701497015070151701527015370154701557015670157701587015970160701617016270163701647016570166701677016870169701707017170172701737017470175701767017770178701797018070181701827018370184701857018670187701887018970190701917019270193701947019570196701977019870199702007020170202702037020470205702067020770208702097021070211702127021370214702157021670217702187021970220702217022270223702247022570226702277022870229702307023170232702337023470235702367023770238702397024070241702427024370244702457024670247702487024970250702517025270253702547025570256702577025870259702607026170262702637026470265702667026770268702697027070271702727027370274702757027670277702787027970280702817028270283702847028570286702877028870289702907029170292702937029470295702967029770298702997030070301703027030370304703057030670307703087030970310703117031270313703147031570316703177031870319703207032170322703237032470325703267032770328703297033070331703327033370334703357033670337703387033970340703417034270343703447034570346703477034870349703507035170352703537035470355703567035770358703597036070361703627036370364703657036670367703687036970370703717037270373703747037570376703777037870379703807038170382703837038470385703867038770388703897039070391703927039370394703957039670397703987039970400704017040270403704047040570406704077040870409704107041170412704137041470415704167041770418704197042070421704227042370424704257042670427704287042970430704317043270433704347043570436704377043870439704407044170442704437044470445704467044770448704497045070451704527045370454704557045670457704587045970460704617046270463704647046570466704677046870469704707047170472704737047470475704767047770478704797048070481704827048370484704857048670487704887048970490704917049270493704947049570496704977049870499705007050170502705037050470505705067050770508705097051070511705127051370514705157051670517705187051970520705217052270523705247052570526705277052870529705307053170532705337053470535705367053770538705397054070541705427054370544705457054670547705487054970550705517055270553705547055570556705577055870559705607056170562705637056470565705667056770568705697057070571705727057370574705757057670577705787057970580705817058270583705847058570586705877058870589705907059170592705937059470595705967059770598705997060070601706027060370604706057060670607706087060970610706117061270613706147061570616706177061870619706207062170622706237062470625706267062770628706297063070631706327063370634706357063670637706387063970640706417064270643706447064570646706477064870649706507065170652706537065470655706567065770658706597066070661706627066370664706657066670667706687066970670706717067270673706747067570676706777067870679706807068170682706837068470685706867068770688706897069070691706927069370694706957069670697706987069970700707017070270703707047070570706707077070870709707107071170712707137071470715707167071770718707197072070721707227072370724707257072670727707287072970730707317073270733707347073570736707377073870739707407074170742707437074470745707467074770748707497075070751707527075370754707557075670757707587075970760707617076270763707647076570766707677076870769707707077170772707737077470775707767077770778707797078070781707827078370784707857078670787707887078970790707917079270793707947079570796707977079870799708007080170802708037080470805708067080770808708097081070811708127081370814708157081670817708187081970820708217082270823708247082570826708277082870829708307083170832708337083470835708367083770838708397084070841708427084370844708457084670847708487084970850708517085270853708547085570856708577085870859708607086170862708637086470865708667086770868708697087070871708727087370874708757087670877708787087970880708817088270883708847088570886708877088870889708907089170892708937089470895708967089770898708997090070901709027090370904709057090670907709087090970910709117091270913709147091570916709177091870919709207092170922709237092470925709267092770928709297093070931709327093370934709357093670937709387093970940709417094270943709447094570946709477094870949709507095170952709537095470955709567095770958709597096070961709627096370964709657096670967709687096970970709717097270973709747097570976709777097870979709807098170982709837098470985709867098770988709897099070991709927099370994709957099670997709987099971000710017100271003710047100571006710077100871009710107101171012710137101471015710167101771018710197102071021710227102371024710257102671027710287102971030710317103271033710347103571036710377103871039710407104171042710437104471045710467104771048710497105071051710527105371054710557105671057710587105971060710617106271063710647106571066710677106871069710707107171072710737107471075710767107771078710797108071081710827108371084710857108671087710887108971090710917109271093710947109571096710977109871099711007110171102711037110471105711067110771108711097111071111711127111371114711157111671117711187111971120711217112271123711247112571126711277112871129711307113171132711337113471135711367113771138711397114071141711427114371144711457114671147711487114971150711517115271153711547115571156711577115871159711607116171162711637116471165711667116771168711697117071171711727117371174711757117671177711787117971180711817118271183711847118571186711877118871189711907119171192711937119471195711967119771198711997120071201712027120371204712057120671207712087120971210712117121271213712147121571216712177121871219712207122171222712237122471225712267122771228712297123071231712327123371234712357123671237712387123971240712417124271243712447124571246712477124871249712507125171252712537125471255712567125771258712597126071261712627126371264712657126671267712687126971270712717127271273712747127571276712777127871279712807128171282712837128471285712867128771288712897129071291712927129371294712957129671297712987129971300713017130271303713047130571306713077130871309713107131171312713137131471315713167131771318713197132071321713227132371324713257132671327713287132971330713317133271333713347133571336713377133871339713407134171342713437134471345713467134771348713497135071351713527135371354713557135671357713587135971360713617136271363713647136571366713677136871369713707137171372713737137471375713767137771378713797138071381713827138371384713857138671387713887138971390713917139271393713947139571396713977139871399714007140171402714037140471405714067140771408714097141071411714127141371414714157141671417714187141971420714217142271423714247142571426714277142871429714307143171432714337143471435714367143771438714397144071441714427144371444714457144671447714487144971450714517145271453714547145571456714577145871459714607146171462714637146471465714667146771468714697147071471714727147371474714757147671477714787147971480714817148271483714847148571486714877148871489714907149171492714937149471495714967149771498714997150071501715027150371504715057150671507715087150971510715117151271513715147151571516715177151871519715207152171522715237152471525715267152771528715297153071531715327153371534715357153671537715387153971540715417154271543715447154571546715477154871549715507155171552715537155471555715567155771558715597156071561715627156371564715657156671567715687156971570715717157271573715747157571576715777157871579715807158171582715837158471585715867158771588715897159071591715927159371594715957159671597715987159971600716017160271603716047160571606716077160871609716107161171612716137161471615716167161771618716197162071621716227162371624716257162671627716287162971630716317163271633716347163571636716377163871639716407164171642716437164471645716467164771648716497165071651716527165371654716557165671657716587165971660716617166271663716647166571666716677166871669716707167171672716737167471675716767167771678716797168071681716827168371684716857168671687716887168971690716917169271693716947169571696716977169871699717007170171702717037170471705717067170771708717097171071711717127171371714717157171671717717187171971720717217172271723717247172571726717277172871729717307173171732717337173471735717367173771738717397174071741717427174371744717457174671747717487174971750717517175271753717547175571756717577175871759717607176171762717637176471765717667176771768717697177071771717727177371774717757177671777717787177971780717817178271783717847178571786717877178871789717907179171792717937179471795717967179771798717997180071801718027180371804718057180671807718087180971810718117181271813718147181571816718177181871819718207182171822718237182471825718267182771828718297183071831718327183371834718357183671837718387183971840718417184271843718447184571846718477184871849718507185171852718537185471855718567185771858718597186071861718627186371864718657186671867718687186971870718717187271873718747187571876718777187871879718807188171882718837188471885718867188771888718897189071891718927189371894718957189671897718987189971900719017190271903719047190571906719077190871909719107191171912719137191471915719167191771918719197192071921719227192371924719257192671927719287192971930719317193271933719347193571936719377193871939719407194171942719437194471945719467194771948719497195071951719527195371954719557195671957719587195971960719617196271963719647196571966719677196871969719707197171972719737197471975719767197771978719797198071981719827198371984719857198671987719887198971990719917199271993719947199571996719977199871999720007200172002720037200472005720067200772008720097201072011720127201372014720157201672017720187201972020720217202272023720247202572026720277202872029720307203172032720337203472035720367203772038720397204072041720427204372044720457204672047720487204972050720517205272053720547205572056720577205872059720607206172062720637206472065720667206772068720697207072071720727207372074720757207672077720787207972080720817208272083720847208572086720877208872089720907209172092720937209472095720967209772098720997210072101721027210372104721057210672107721087210972110721117211272113721147211572116721177211872119721207212172122721237212472125721267212772128721297213072131721327213372134721357213672137721387213972140721417214272143721447214572146721477214872149721507215172152721537215472155721567215772158721597216072161721627216372164721657216672167721687216972170721717217272173721747217572176721777217872179721807218172182721837218472185721867218772188721897219072191721927219372194721957219672197721987219972200722017220272203722047220572206722077220872209722107221172212722137221472215722167221772218722197222072221722227222372224722257222672227722287222972230722317223272233722347223572236722377223872239722407224172242722437224472245722467224772248722497225072251722527225372254722557225672257722587225972260722617226272263722647226572266722677226872269722707227172272722737227472275722767227772278722797228072281722827228372284722857228672287722887228972290722917229272293722947229572296722977229872299723007230172302723037230472305723067230772308723097231072311723127231372314723157231672317723187231972320723217232272323723247232572326723277232872329723307233172332723337233472335723367233772338723397234072341723427234372344723457234672347723487234972350723517235272353723547235572356723577235872359723607236172362723637236472365723667236772368723697237072371723727237372374723757237672377723787237972380723817238272383723847238572386723877238872389723907239172392723937239472395723967239772398723997240072401724027240372404724057240672407724087240972410724117241272413724147241572416724177241872419724207242172422724237242472425724267242772428724297243072431724327243372434724357243672437724387243972440724417244272443724447244572446724477244872449724507245172452724537245472455724567245772458724597246072461724627246372464724657246672467724687246972470724717247272473724747247572476724777247872479724807248172482724837248472485724867248772488724897249072491724927249372494724957249672497724987249972500725017250272503725047250572506725077250872509725107251172512725137251472515725167251772518725197252072521725227252372524725257252672527725287252972530725317253272533725347253572536725377253872539725407254172542725437254472545725467254772548725497255072551725527255372554725557255672557725587255972560725617256272563725647256572566725677256872569725707257172572725737257472575725767257772578725797258072581725827258372584725857258672587725887258972590725917259272593725947259572596725977259872599726007260172602726037260472605726067260772608726097261072611726127261372614726157261672617726187261972620726217262272623726247262572626726277262872629726307263172632726337263472635726367263772638726397264072641726427264372644726457264672647726487264972650726517265272653726547265572656726577265872659726607266172662726637266472665726667266772668726697267072671726727267372674726757267672677726787267972680726817268272683726847268572686726877268872689726907269172692726937269472695726967269772698726997270072701727027270372704727057270672707727087270972710727117271272713727147271572716727177271872719727207272172722727237272472725727267272772728727297273072731727327273372734727357273672737727387273972740727417274272743727447274572746727477274872749727507275172752727537275472755727567275772758727597276072761727627276372764727657276672767727687276972770727717277272773727747277572776727777277872779727807278172782727837278472785727867278772788727897279072791727927279372794727957279672797727987279972800728017280272803728047280572806728077280872809728107281172812728137281472815728167281772818728197282072821728227282372824728257282672827728287282972830728317283272833728347283572836728377283872839728407284172842728437284472845728467284772848728497285072851728527285372854728557285672857728587285972860728617286272863728647286572866728677286872869728707287172872728737287472875728767287772878728797288072881728827288372884728857288672887728887288972890728917289272893728947289572896728977289872899729007290172902729037290472905729067290772908729097291072911729127291372914729157291672917729187291972920729217292272923729247292572926729277292872929729307293172932729337293472935729367293772938729397294072941729427294372944729457294672947729487294972950729517295272953729547295572956729577295872959729607296172962729637296472965729667296772968729697297072971729727297372974729757297672977729787297972980729817298272983729847298572986729877298872989729907299172992729937299472995729967299772998729997300073001730027300373004730057300673007730087300973010730117301273013730147301573016730177301873019730207302173022730237302473025730267302773028730297303073031730327303373034730357303673037730387303973040730417304273043730447304573046730477304873049730507305173052730537305473055730567305773058730597306073061730627306373064730657306673067730687306973070730717307273073730747307573076730777307873079730807308173082730837308473085730867308773088730897309073091730927309373094730957309673097730987309973100731017310273103731047310573106731077310873109731107311173112731137311473115731167311773118731197312073121731227312373124731257312673127731287312973130731317313273133731347313573136731377313873139731407314173142731437314473145731467314773148731497315073151731527315373154731557315673157731587315973160731617316273163731647316573166731677316873169731707317173172731737317473175731767317773178731797318073181731827318373184731857318673187731887318973190731917319273193731947319573196731977319873199732007320173202732037320473205732067320773208732097321073211732127321373214732157321673217732187321973220732217322273223732247322573226732277322873229732307323173232732337323473235732367323773238732397324073241732427324373244732457324673247732487324973250732517325273253732547325573256732577325873259732607326173262732637326473265732667326773268732697327073271732727327373274732757327673277732787327973280732817328273283732847328573286732877328873289732907329173292732937329473295732967329773298732997330073301733027330373304733057330673307733087330973310733117331273313733147331573316733177331873319733207332173322733237332473325733267332773328733297333073331733327333373334733357333673337733387333973340733417334273343733447334573346733477334873349733507335173352733537335473355733567335773358733597336073361733627336373364733657336673367733687336973370733717337273373733747337573376733777337873379733807338173382733837338473385733867338773388733897339073391733927339373394733957339673397733987339973400734017340273403734047340573406734077340873409734107341173412734137341473415734167341773418734197342073421734227342373424734257342673427734287342973430734317343273433734347343573436734377343873439734407344173442734437344473445734467344773448734497345073451734527345373454734557345673457734587345973460734617346273463734647346573466734677346873469734707347173472734737347473475734767347773478734797348073481734827348373484734857348673487734887348973490734917349273493734947349573496734977349873499735007350173502735037350473505735067350773508735097351073511735127351373514735157351673517735187351973520735217352273523735247352573526735277352873529735307353173532735337353473535735367353773538735397354073541735427354373544735457354673547735487354973550735517355273553735547355573556735577355873559735607356173562735637356473565735667356773568735697357073571735727357373574735757357673577735787357973580735817358273583735847358573586735877358873589735907359173592735937359473595735967359773598735997360073601736027360373604736057360673607736087360973610736117361273613736147361573616736177361873619736207362173622736237362473625736267362773628736297363073631736327363373634736357363673637736387363973640736417364273643736447364573646736477364873649736507365173652736537365473655736567365773658736597366073661736627366373664736657366673667736687366973670736717367273673736747367573676736777367873679736807368173682736837368473685736867368773688736897369073691736927369373694736957369673697736987369973700737017370273703737047370573706737077370873709737107371173712737137371473715737167371773718737197372073721737227372373724737257372673727737287372973730737317373273733737347373573736737377373873739737407374173742737437374473745737467374773748737497375073751737527375373754737557375673757737587375973760737617376273763737647376573766737677376873769737707377173772737737377473775737767377773778737797378073781737827378373784737857378673787737887378973790737917379273793737947379573796737977379873799738007380173802738037380473805738067380773808738097381073811738127381373814738157381673817738187381973820738217382273823738247382573826738277382873829738307383173832738337383473835738367383773838738397384073841738427384373844738457384673847738487384973850738517385273853738547385573856738577385873859738607386173862738637386473865738667386773868738697387073871738727387373874738757387673877738787387973880738817388273883738847388573886738877388873889738907389173892738937389473895738967389773898738997390073901739027390373904739057390673907739087390973910739117391273913739147391573916739177391873919739207392173922739237392473925739267392773928739297393073931739327393373934739357393673937739387393973940739417394273943739447394573946739477394873949739507395173952739537395473955739567395773958739597396073961739627396373964739657396673967739687396973970739717397273973739747397573976739777397873979739807398173982739837398473985739867398773988739897399073991739927399373994739957399673997739987399974000740017400274003740047400574006740077400874009740107401174012740137401474015740167401774018740197402074021740227402374024740257402674027740287402974030740317403274033740347403574036740377403874039740407404174042740437404474045740467404774048740497405074051740527405374054740557405674057740587405974060740617406274063740647406574066740677406874069740707407174072740737407474075740767407774078740797408074081740827408374084740857408674087740887408974090740917409274093740947409574096740977409874099741007410174102741037410474105741067410774108741097411074111741127411374114741157411674117741187411974120741217412274123741247412574126741277412874129741307413174132741337413474135741367413774138741397414074141741427414374144741457414674147741487414974150741517415274153741547415574156741577415874159741607416174162741637416474165741667416774168741697417074171741727417374174741757417674177741787417974180741817418274183741847418574186741877418874189741907419174192741937419474195741967419774198741997420074201742027420374204742057420674207742087420974210742117421274213742147421574216742177421874219742207422174222742237422474225742267422774228742297423074231742327423374234742357423674237742387423974240742417424274243742447424574246742477424874249742507425174252742537425474255742567425774258742597426074261742627426374264742657426674267742687426974270742717427274273742747427574276742777427874279742807428174282742837428474285742867428774288742897429074291742927429374294742957429674297742987429974300743017430274303743047430574306743077430874309743107431174312743137431474315743167431774318743197432074321743227432374324743257432674327743287432974330743317433274333743347433574336743377433874339743407434174342743437434474345743467434774348743497435074351743527435374354743557435674357743587435974360743617436274363743647436574366743677436874369743707437174372743737437474375743767437774378743797438074381743827438374384743857438674387743887438974390743917439274393743947439574396743977439874399744007440174402744037440474405744067440774408744097441074411744127441374414744157441674417744187441974420744217442274423744247442574426744277442874429744307443174432744337443474435744367443774438744397444074441744427444374444744457444674447744487444974450744517445274453744547445574456744577445874459744607446174462744637446474465744667446774468744697447074471744727447374474744757447674477744787447974480744817448274483744847448574486744877448874489744907449174492744937449474495744967449774498744997450074501745027450374504745057450674507745087450974510745117451274513745147451574516745177451874519745207452174522745237452474525745267452774528745297453074531745327453374534745357453674537745387453974540745417454274543745447454574546745477454874549745507455174552745537455474555745567455774558745597456074561745627456374564745657456674567745687456974570745717457274573745747457574576745777457874579745807458174582745837458474585745867458774588745897459074591745927459374594745957459674597745987459974600746017460274603746047460574606746077460874609746107461174612746137461474615746167461774618746197462074621746227462374624746257462674627746287462974630746317463274633746347463574636746377463874639746407464174642746437464474645746467464774648746497465074651746527465374654746557465674657746587465974660746617466274663746647466574666746677466874669746707467174672746737467474675746767467774678746797468074681746827468374684746857468674687746887468974690746917469274693746947469574696746977469874699747007470174702747037470474705747067470774708747097471074711747127471374714747157471674717747187471974720747217472274723747247472574726747277472874729747307473174732747337473474735747367473774738747397474074741747427474374744747457474674747747487474974750747517475274753747547475574756747577475874759747607476174762747637476474765747667476774768747697477074771747727477374774747757477674777747787477974780747817478274783747847478574786747877478874789747907479174792747937479474795747967479774798747997480074801748027480374804748057480674807748087480974810748117481274813748147481574816748177481874819748207482174822748237482474825748267482774828748297483074831748327483374834748357483674837748387483974840748417484274843748447484574846748477484874849748507485174852748537485474855748567485774858748597486074861748627486374864748657486674867748687486974870748717487274873748747487574876748777487874879748807488174882748837488474885748867488774888748897489074891748927489374894748957489674897748987489974900749017490274903749047490574906749077490874909749107491174912749137491474915749167491774918749197492074921749227492374924749257492674927749287492974930749317493274933749347493574936749377493874939749407494174942749437494474945749467494774948749497495074951749527495374954749557495674957749587495974960749617496274963749647496574966749677496874969749707497174972749737497474975749767497774978749797498074981749827498374984749857498674987749887498974990749917499274993749947499574996749977499874999750007500175002750037500475005750067500775008750097501075011750127501375014750157501675017750187501975020750217502275023750247502575026750277502875029750307503175032750337503475035750367503775038750397504075041750427504375044750457504675047750487504975050750517505275053750547505575056750577505875059750607506175062750637506475065750667506775068750697507075071750727507375074750757507675077750787507975080750817508275083750847508575086750877508875089750907509175092750937509475095750967509775098750997510075101751027510375104751057510675107751087510975110751117511275113751147511575116751177511875119751207512175122751237512475125751267512775128751297513075131751327513375134751357513675137751387513975140751417514275143751447514575146751477514875149751507515175152751537515475155751567515775158751597516075161751627516375164751657516675167751687516975170751717517275173751747517575176751777517875179751807518175182751837518475185751867518775188751897519075191751927519375194751957519675197751987519975200752017520275203752047520575206752077520875209752107521175212752137521475215752167521775218752197522075221752227522375224752257522675227752287522975230752317523275233752347523575236752377523875239752407524175242752437524475245752467524775248752497525075251752527525375254752557525675257752587525975260752617526275263752647526575266752677526875269752707527175272752737527475275752767527775278752797528075281752827528375284752857528675287752887528975290752917529275293752947529575296752977529875299753007530175302753037530475305753067530775308753097531075311753127531375314753157531675317753187531975320753217532275323753247532575326753277532875329753307533175332753337533475335753367533775338753397534075341753427534375344753457534675347753487534975350753517535275353753547535575356753577535875359753607536175362753637536475365753667536775368753697537075371753727537375374753757537675377753787537975380753817538275383753847538575386753877538875389753907539175392753937539475395753967539775398753997540075401754027540375404754057540675407754087540975410754117541275413754147541575416754177541875419754207542175422754237542475425754267542775428754297543075431754327543375434754357543675437754387543975440754417544275443754447544575446754477544875449754507545175452754537545475455754567545775458754597546075461754627546375464754657546675467754687546975470754717547275473754747547575476754777547875479754807548175482754837548475485754867548775488754897549075491754927549375494754957549675497754987549975500755017550275503755047550575506755077550875509755107551175512755137551475515755167551775518755197552075521755227552375524755257552675527755287552975530755317553275533755347553575536755377553875539755407554175542755437554475545755467554775548755497555075551755527555375554755557555675557755587555975560755617556275563755647556575566755677556875569755707557175572755737557475575755767557775578755797558075581755827558375584755857558675587755887558975590755917559275593755947559575596755977559875599756007560175602756037560475605756067560775608756097561075611756127561375614756157561675617756187561975620756217562275623756247562575626756277562875629756307563175632756337563475635756367563775638756397564075641756427564375644756457564675647756487564975650756517565275653756547565575656756577565875659756607566175662756637566475665756667566775668756697567075671756727567375674756757567675677756787567975680756817568275683756847568575686756877568875689756907569175692756937569475695756967569775698756997570075701757027570375704757057570675707757087570975710757117571275713757147571575716757177571875719757207572175722757237572475725757267572775728757297573075731757327573375734757357573675737757387573975740757417574275743757447574575746757477574875749757507575175752757537575475755757567575775758757597576075761757627576375764757657576675767757687576975770757717577275773757747577575776757777577875779757807578175782757837578475785757867578775788757897579075791757927579375794757957579675797757987579975800758017580275803758047580575806758077580875809758107581175812758137581475815758167581775818758197582075821758227582375824758257582675827758287582975830758317583275833758347583575836758377583875839758407584175842758437584475845758467584775848758497585075851758527585375854758557585675857758587585975860758617586275863758647586575866758677586875869758707587175872758737587475875758767587775878758797588075881758827588375884758857588675887758887588975890758917589275893758947589575896758977589875899759007590175902759037590475905759067590775908759097591075911759127591375914759157591675917759187591975920759217592275923759247592575926759277592875929759307593175932759337593475935759367593775938759397594075941759427594375944759457594675947759487594975950759517595275953759547595575956759577595875959759607596175962759637596475965759667596775968759697597075971759727597375974759757597675977759787597975980759817598275983759847598575986759877598875989759907599175992759937599475995759967599775998759997600076001760027600376004760057600676007760087600976010760117601276013760147601576016760177601876019760207602176022760237602476025760267602776028760297603076031760327603376034760357603676037760387603976040760417604276043760447604576046760477604876049760507605176052760537605476055760567605776058760597606076061760627606376064760657606676067760687606976070760717607276073760747607576076760777607876079760807608176082760837608476085760867608776088760897609076091760927609376094760957609676097760987609976100761017610276103761047610576106761077610876109761107611176112761137611476115761167611776118761197612076121761227612376124761257612676127761287612976130761317613276133761347613576136761377613876139761407614176142761437614476145761467614776148761497615076151761527615376154761557615676157761587615976160761617616276163761647616576166761677616876169761707617176172761737617476175761767617776178761797618076181761827618376184761857618676187761887618976190761917619276193761947619576196761977619876199762007620176202762037620476205762067620776208762097621076211762127621376214762157621676217762187621976220762217622276223762247622576226762277622876229762307623176232762337623476235762367623776238762397624076241762427624376244762457624676247762487624976250762517625276253762547625576256762577625876259762607626176262762637626476265762667626776268762697627076271762727627376274762757627676277762787627976280762817628276283762847628576286762877628876289762907629176292762937629476295762967629776298762997630076301763027630376304763057630676307763087630976310763117631276313763147631576316763177631876319763207632176322763237632476325763267632776328763297633076331763327633376334763357633676337763387633976340763417634276343763447634576346763477634876349763507635176352763537635476355763567635776358763597636076361763627636376364763657636676367763687636976370763717637276373763747637576376763777637876379763807638176382763837638476385763867638776388763897639076391763927639376394763957639676397763987639976400764017640276403764047640576406764077640876409764107641176412764137641476415764167641776418764197642076421764227642376424764257642676427764287642976430764317643276433764347643576436764377643876439764407644176442764437644476445764467644776448764497645076451764527645376454764557645676457764587645976460764617646276463764647646576466764677646876469764707647176472764737647476475764767647776478764797648076481764827648376484764857648676487764887648976490764917649276493764947649576496764977649876499765007650176502765037650476505765067650776508765097651076511765127651376514765157651676517765187651976520765217652276523765247652576526765277652876529765307653176532765337653476535765367653776538765397654076541765427654376544765457654676547765487654976550765517655276553765547655576556765577655876559765607656176562765637656476565765667656776568765697657076571765727657376574765757657676577765787657976580765817658276583765847658576586765877658876589765907659176592765937659476595765967659776598765997660076601766027660376604766057660676607766087660976610766117661276613766147661576616766177661876619766207662176622766237662476625766267662776628766297663076631766327663376634766357663676637766387663976640766417664276643766447664576646766477664876649766507665176652766537665476655766567665776658766597666076661766627666376664766657666676667766687666976670766717667276673766747667576676766777667876679766807668176682766837668476685766867668776688766897669076691766927669376694766957669676697766987669976700767017670276703767047670576706767077670876709767107671176712767137671476715767167671776718767197672076721767227672376724767257672676727767287672976730767317673276733767347673576736767377673876739767407674176742767437674476745767467674776748767497675076751767527675376754767557675676757767587675976760767617676276763767647676576766767677676876769767707677176772767737677476775767767677776778767797678076781767827678376784767857678676787767887678976790767917679276793767947679576796767977679876799768007680176802768037680476805768067680776808768097681076811768127681376814768157681676817768187681976820768217682276823768247682576826768277682876829768307683176832768337683476835768367683776838768397684076841768427684376844768457684676847768487684976850768517685276853768547685576856768577685876859768607686176862768637686476865768667686776868768697687076871768727687376874768757687676877768787687976880768817688276883768847688576886768877688876889768907689176892768937689476895768967689776898768997690076901769027690376904769057690676907769087690976910769117691276913769147691576916769177691876919769207692176922769237692476925769267692776928769297693076931769327693376934769357693676937769387693976940769417694276943769447694576946769477694876949769507695176952769537695476955769567695776958769597696076961769627696376964769657696676967769687696976970769717697276973769747697576976769777697876979769807698176982769837698476985769867698776988769897699076991769927699376994769957699676997769987699977000770017700277003770047700577006770077700877009770107701177012770137701477015770167701777018770197702077021770227702377024770257702677027770287702977030770317703277033770347703577036770377703877039770407704177042770437704477045770467704777048770497705077051770527705377054770557705677057770587705977060770617706277063770647706577066770677706877069770707707177072770737707477075770767707777078770797708077081770827708377084770857708677087770887708977090770917709277093770947709577096770977709877099771007710177102771037710477105771067710777108771097711077111771127711377114771157711677117771187711977120771217712277123771247712577126771277712877129771307713177132771337713477135771367713777138771397714077141771427714377144771457714677147771487714977150771517715277153771547715577156771577715877159771607716177162771637716477165771667716777168771697717077171771727717377174771757717677177771787717977180771817718277183771847718577186771877718877189771907719177192771937719477195771967719777198771997720077201772027720377204772057720677207772087720977210772117721277213772147721577216772177721877219772207722177222772237722477225772267722777228772297723077231772327723377234772357723677237772387723977240772417724277243772447724577246772477724877249772507725177252772537725477255772567725777258772597726077261772627726377264772657726677267772687726977270772717727277273772747727577276772777727877279772807728177282772837728477285772867728777288772897729077291772927729377294772957729677297772987729977300773017730277303773047730577306773077730877309773107731177312773137731477315773167731777318773197732077321773227732377324773257732677327773287732977330773317733277333773347733577336773377733877339773407734177342773437734477345773467734777348773497735077351773527735377354773557735677357773587735977360773617736277363773647736577366773677736877369773707737177372773737737477375773767737777378773797738077381773827738377384773857738677387773887738977390773917739277393773947739577396773977739877399774007740177402774037740477405774067740777408774097741077411774127741377414774157741677417774187741977420774217742277423774247742577426774277742877429774307743177432774337743477435774367743777438774397744077441774427744377444774457744677447774487744977450774517745277453774547745577456774577745877459774607746177462774637746477465774667746777468774697747077471774727747377474774757747677477774787747977480774817748277483774847748577486774877748877489774907749177492774937749477495774967749777498774997750077501775027750377504775057750677507775087750977510775117751277513775147751577516775177751877519775207752177522775237752477525775267752777528775297753077531775327753377534775357753677537775387753977540775417754277543775447754577546775477754877549775507755177552775537755477555775567755777558775597756077561775627756377564775657756677567775687756977570775717757277573775747757577576775777757877579775807758177582775837758477585775867758777588775897759077591775927759377594775957759677597775987759977600776017760277603776047760577606776077760877609776107761177612776137761477615776167761777618776197762077621776227762377624776257762677627776287762977630776317763277633776347763577636776377763877639776407764177642776437764477645776467764777648776497765077651776527765377654776557765677657776587765977660776617766277663776647766577666776677766877669776707767177672776737767477675776767767777678776797768077681776827768377684776857768677687776887768977690776917769277693776947769577696776977769877699777007770177702777037770477705777067770777708777097771077711777127771377714777157771677717777187771977720777217772277723777247772577726777277772877729777307773177732777337773477735777367773777738777397774077741777427774377744777457774677747777487774977750777517775277753777547775577756777577775877759777607776177762777637776477765777667776777768777697777077771777727777377774777757777677777777787777977780777817778277783777847778577786777877778877789777907779177792777937779477795777967779777798777997780077801778027780377804778057780677807778087780977810778117781277813778147781577816778177781877819778207782177822778237782477825778267782777828778297783077831778327783377834778357783677837778387783977840778417784277843778447784577846778477784877849778507785177852778537785477855778567785777858778597786077861778627786377864778657786677867778687786977870778717787277873778747787577876778777787877879778807788177882778837788477885778867788777888778897789077891778927789377894778957789677897778987789977900779017790277903779047790577906779077790877909779107791177912779137791477915779167791777918779197792077921779227792377924779257792677927779287792977930779317793277933779347793577936779377793877939779407794177942779437794477945779467794777948779497795077951779527795377954779557795677957779587795977960779617796277963779647796577966779677796877969779707797177972779737797477975779767797777978779797798077981779827798377984779857798677987779887798977990779917799277993779947799577996779977799877999780007800178002780037800478005780067800778008780097801078011780127801378014780157801678017780187801978020780217802278023780247802578026780277802878029780307803178032780337803478035780367803778038780397804078041780427804378044780457804678047780487804978050780517805278053780547805578056780577805878059780607806178062780637806478065780667806778068780697807078071780727807378074780757807678077780787807978080780817808278083780847808578086780877808878089780907809178092780937809478095780967809778098780997810078101781027810378104781057810678107781087810978110781117811278113781147811578116781177811878119781207812178122781237812478125781267812778128781297813078131781327813378134781357813678137781387813978140781417814278143781447814578146781477814878149781507815178152781537815478155781567815778158781597816078161781627816378164781657816678167781687816978170781717817278173781747817578176781777817878179781807818178182781837818478185781867818778188781897819078191781927819378194781957819678197781987819978200782017820278203782047820578206782077820878209782107821178212782137821478215782167821778218782197822078221782227822378224782257822678227782287822978230782317823278233782347823578236782377823878239782407824178242782437824478245782467824778248782497825078251782527825378254782557825678257782587825978260782617826278263782647826578266782677826878269782707827178272782737827478275782767827778278782797828078281782827828378284782857828678287782887828978290782917829278293782947829578296782977829878299783007830178302783037830478305783067830778308783097831078311783127831378314783157831678317783187831978320783217832278323783247832578326783277832878329783307833178332783337833478335783367833778338783397834078341783427834378344783457834678347783487834978350783517835278353783547835578356783577835878359783607836178362783637836478365783667836778368783697837078371783727837378374783757837678377783787837978380783817838278383783847838578386783877838878389783907839178392783937839478395783967839778398783997840078401784027840378404784057840678407784087840978410784117841278413784147841578416784177841878419784207842178422784237842478425784267842778428784297843078431784327843378434784357843678437784387843978440784417844278443784447844578446784477844878449784507845178452784537845478455784567845778458784597846078461784627846378464784657846678467784687846978470784717847278473784747847578476784777847878479784807848178482784837848478485784867848778488784897849078491784927849378494784957849678497784987849978500785017850278503785047850578506785077850878509785107851178512785137851478515785167851778518785197852078521785227852378524785257852678527785287852978530785317853278533785347853578536785377853878539785407854178542785437854478545785467854778548785497855078551785527855378554785557855678557785587855978560785617856278563785647856578566785677856878569785707857178572785737857478575785767857778578785797858078581785827858378584785857858678587785887858978590785917859278593785947859578596785977859878599786007860178602786037860478605786067860778608786097861078611786127861378614786157861678617786187861978620786217862278623786247862578626786277862878629786307863178632786337863478635786367863778638786397864078641786427864378644786457864678647786487864978650786517865278653786547865578656786577865878659786607866178662786637866478665786667866778668786697867078671786727867378674786757867678677786787867978680786817868278683786847868578686786877868878689786907869178692786937869478695786967869778698786997870078701787027870378704787057870678707787087870978710787117871278713787147871578716787177871878719787207872178722787237872478725787267872778728787297873078731787327873378734787357873678737787387873978740787417874278743787447874578746787477874878749787507875178752787537875478755787567875778758787597876078761787627876378764787657876678767787687876978770787717877278773787747877578776787777877878779787807878178782787837878478785787867878778788787897879078791787927879378794787957879678797787987879978800788017880278803788047880578806788077880878809788107881178812788137881478815788167881778818788197882078821788227882378824788257882678827788287882978830788317883278833788347883578836788377883878839788407884178842788437884478845788467884778848788497885078851788527885378854788557885678857788587885978860788617886278863788647886578866788677886878869788707887178872788737887478875788767887778878788797888078881788827888378884788857888678887788887888978890788917889278893788947889578896788977889878899789007890178902789037890478905789067890778908789097891078911789127891378914789157891678917789187891978920789217892278923789247892578926789277892878929789307893178932789337893478935789367893778938789397894078941789427894378944789457894678947789487894978950789517895278953789547895578956789577895878959789607896178962789637896478965789667896778968789697897078971789727897378974789757897678977789787897978980789817898278983789847898578986789877898878989789907899178992789937899478995789967899778998789997900079001790027900379004790057900679007790087900979010790117901279013790147901579016790177901879019790207902179022790237902479025790267902779028790297903079031790327903379034790357903679037790387903979040790417904279043790447904579046790477904879049790507905179052790537905479055790567905779058790597906079061790627906379064790657906679067790687906979070790717907279073790747907579076790777907879079790807908179082790837908479085790867908779088790897909079091790927909379094790957909679097790987909979100791017910279103791047910579106791077910879109791107911179112791137911479115791167911779118791197912079121791227912379124791257912679127791287912979130791317913279133791347913579136791377913879139791407914179142791437914479145791467914779148791497915079151791527915379154791557915679157791587915979160791617916279163791647916579166791677916879169791707917179172791737917479175791767917779178791797918079181791827918379184791857918679187791887918979190791917919279193791947919579196791977919879199792007920179202792037920479205792067920779208792097921079211792127921379214792157921679217792187921979220792217922279223792247922579226792277922879229792307923179232792337923479235792367923779238792397924079241792427924379244792457924679247792487924979250792517925279253792547925579256792577925879259792607926179262792637926479265792667926779268792697927079271792727927379274792757927679277792787927979280792817928279283792847928579286792877928879289792907929179292792937929479295792967929779298792997930079301793027930379304793057930679307793087930979310793117931279313793147931579316793177931879319793207932179322793237932479325793267932779328793297933079331793327933379334793357933679337793387933979340793417934279343793447934579346793477934879349793507935179352793537935479355793567935779358793597936079361793627936379364793657936679367793687936979370793717937279373793747937579376793777937879379793807938179382793837938479385793867938779388793897939079391793927939379394793957939679397793987939979400794017940279403794047940579406794077940879409794107941179412794137941479415794167941779418794197942079421794227942379424794257942679427794287942979430794317943279433794347943579436794377943879439794407944179442794437944479445794467944779448794497945079451794527945379454794557945679457794587945979460794617946279463794647946579466794677946879469794707947179472794737947479475794767947779478794797948079481794827948379484794857948679487794887948979490794917949279493794947949579496794977949879499795007950179502795037950479505795067950779508795097951079511795127951379514795157951679517795187951979520795217952279523795247952579526795277952879529795307953179532795337953479535795367953779538795397954079541795427954379544795457954679547795487954979550795517955279553795547955579556795577955879559795607956179562795637956479565795667956779568795697957079571795727957379574795757957679577795787957979580795817958279583795847958579586795877958879589795907959179592795937959479595795967959779598795997960079601796027960379604796057960679607796087960979610796117961279613796147961579616796177961879619796207962179622796237962479625796267962779628796297963079631796327963379634796357963679637796387963979640796417964279643796447964579646796477964879649796507965179652796537965479655796567965779658796597966079661796627966379664796657966679667796687966979670796717967279673796747967579676796777967879679796807968179682796837968479685796867968779688796897969079691796927969379694796957969679697796987969979700797017970279703797047970579706797077970879709797107971179712797137971479715797167971779718797197972079721797227972379724797257972679727797287972979730797317973279733797347973579736797377973879739797407974179742797437974479745797467974779748797497975079751797527975379754797557975679757797587975979760797617976279763797647976579766797677976879769797707977179772797737977479775797767977779778797797978079781797827978379784797857978679787797887978979790797917979279793797947979579796797977979879799798007980179802798037980479805798067980779808798097981079811798127981379814798157981679817798187981979820798217982279823798247982579826798277982879829798307983179832798337983479835798367983779838798397984079841798427984379844798457984679847798487984979850798517985279853798547985579856798577985879859798607986179862798637986479865798667986779868798697987079871798727987379874798757987679877798787987979880798817988279883798847988579886798877988879889798907989179892798937989479895798967989779898798997990079901799027990379904799057990679907799087990979910799117991279913799147991579916799177991879919799207992179922799237992479925799267992779928799297993079931799327993379934799357993679937799387993979940799417994279943799447994579946799477994879949799507995179952799537995479955799567995779958799597996079961799627996379964799657996679967799687996979970799717997279973799747997579976799777997879979799807998179982799837998479985799867998779988799897999079991799927999379994799957999679997799987999980000800018000280003800048000580006800078000880009800108001180012800138001480015800168001780018800198002080021800228002380024800258002680027800288002980030800318003280033800348003580036800378003880039800408004180042800438004480045800468004780048800498005080051800528005380054800558005680057800588005980060800618006280063800648006580066800678006880069800708007180072800738007480075800768007780078800798008080081800828008380084800858008680087800888008980090800918009280093800948009580096800978009880099801008010180102801038010480105801068010780108801098011080111801128011380114801158011680117801188011980120801218012280123801248012580126801278012880129801308013180132801338013480135801368013780138801398014080141801428014380144801458014680147801488014980150801518015280153801548015580156801578015880159801608016180162801638016480165801668016780168801698017080171801728017380174801758017680177801788017980180801818018280183801848018580186801878018880189801908019180192801938019480195801968019780198801998020080201802028020380204802058020680207802088020980210802118021280213802148021580216802178021880219802208022180222802238022480225802268022780228802298023080231802328023380234802358023680237802388023980240802418024280243802448024580246802478024880249802508025180252802538025480255802568025780258802598026080261802628026380264802658026680267802688026980270802718027280273802748027580276802778027880279802808028180282802838028480285802868028780288802898029080291802928029380294802958029680297802988029980300803018030280303803048030580306803078030880309803108031180312803138031480315803168031780318803198032080321803228032380324803258032680327803288032980330803318033280333803348033580336803378033880339803408034180342803438034480345803468034780348803498035080351803528035380354803558035680357803588035980360803618036280363803648036580366803678036880369803708037180372803738037480375803768037780378803798038080381803828038380384803858038680387803888038980390803918039280393803948039580396803978039880399804008040180402804038040480405804068040780408804098041080411804128041380414804158041680417804188041980420804218042280423804248042580426804278042880429804308043180432804338043480435804368043780438804398044080441804428044380444804458044680447804488044980450804518045280453804548045580456804578045880459804608046180462804638046480465804668046780468804698047080471804728047380474804758047680477804788047980480804818048280483804848048580486804878048880489804908049180492804938049480495804968049780498804998050080501805028050380504805058050680507805088050980510805118051280513805148051580516805178051880519805208052180522805238052480525805268052780528805298053080531805328053380534805358053680537805388053980540805418054280543805448054580546805478054880549805508055180552805538055480555805568055780558805598056080561805628056380564805658056680567805688056980570805718057280573805748057580576805778057880579805808058180582805838058480585805868058780588805898059080591805928059380594805958059680597805988059980600806018060280603806048060580606806078060880609806108061180612806138061480615806168061780618806198062080621806228062380624806258062680627806288062980630806318063280633806348063580636806378063880639806408064180642806438064480645806468064780648806498065080651806528065380654806558065680657806588065980660806618066280663806648066580666806678066880669806708067180672806738067480675806768067780678806798068080681806828068380684806858068680687806888068980690806918069280693806948069580696806978069880699807008070180702807038070480705807068070780708807098071080711807128071380714807158071680717807188071980720807218072280723807248072580726807278072880729807308073180732807338073480735807368073780738807398074080741807428074380744807458074680747807488074980750807518075280753807548075580756807578075880759807608076180762807638076480765807668076780768807698077080771807728077380774807758077680777807788077980780807818078280783807848078580786807878078880789807908079180792807938079480795807968079780798807998080080801808028080380804808058080680807808088080980810808118081280813808148081580816808178081880819808208082180822808238082480825808268082780828808298083080831808328083380834808358083680837808388083980840808418084280843808448084580846808478084880849808508085180852808538085480855808568085780858808598086080861808628086380864808658086680867808688086980870808718087280873808748087580876808778087880879808808088180882808838088480885808868088780888808898089080891808928089380894808958089680897808988089980900809018090280903809048090580906809078090880909809108091180912809138091480915809168091780918809198092080921809228092380924809258092680927809288092980930809318093280933809348093580936809378093880939809408094180942809438094480945809468094780948809498095080951809528095380954809558095680957809588095980960809618096280963809648096580966809678096880969809708097180972809738097480975809768097780978809798098080981809828098380984809858098680987809888098980990809918099280993809948099580996809978099880999810008100181002810038100481005810068100781008810098101081011810128101381014810158101681017810188101981020810218102281023810248102581026810278102881029810308103181032810338103481035810368103781038810398104081041810428104381044810458104681047810488104981050810518105281053810548105581056810578105881059810608106181062810638106481065810668106781068810698107081071810728107381074810758107681077810788107981080810818108281083810848108581086810878108881089810908109181092810938109481095810968109781098810998110081101811028110381104811058110681107811088110981110811118111281113811148111581116811178111881119811208112181122811238112481125811268112781128811298113081131811328113381134811358113681137811388113981140811418114281143811448114581146811478114881149811508115181152811538115481155811568115781158811598116081161811628116381164811658116681167811688116981170811718117281173811748117581176811778117881179811808118181182811838118481185811868118781188811898119081191811928119381194811958119681197811988119981200812018120281203812048120581206812078120881209812108121181212812138121481215812168121781218812198122081221812228122381224812258122681227812288122981230812318123281233812348123581236812378123881239812408124181242812438124481245812468124781248812498125081251812528125381254812558125681257812588125981260812618126281263812648126581266812678126881269812708127181272812738127481275812768127781278812798128081281812828128381284812858128681287812888128981290812918129281293812948129581296812978129881299813008130181302813038130481305813068130781308813098131081311813128131381314813158131681317813188131981320813218132281323813248132581326813278132881329813308133181332813338133481335813368133781338813398134081341813428134381344813458134681347813488134981350813518135281353813548135581356813578135881359813608136181362813638136481365813668136781368813698137081371813728137381374813758137681377813788137981380813818138281383813848138581386813878138881389813908139181392813938139481395813968139781398813998140081401814028140381404814058140681407814088140981410814118141281413814148141581416814178141881419814208142181422814238142481425814268142781428814298143081431814328143381434814358143681437814388143981440814418144281443814448144581446814478144881449814508145181452814538145481455814568145781458814598146081461814628146381464814658146681467814688146981470814718147281473814748147581476814778147881479814808148181482814838148481485814868148781488814898149081491814928149381494814958149681497814988149981500815018150281503815048150581506815078150881509815108151181512815138151481515815168151781518815198152081521815228152381524815258152681527815288152981530815318153281533815348153581536815378153881539815408154181542815438154481545815468154781548815498155081551815528155381554815558155681557815588155981560815618156281563815648156581566815678156881569815708157181572815738157481575815768157781578815798158081581815828158381584815858158681587815888158981590815918159281593815948159581596815978159881599816008160181602816038160481605816068160781608816098161081611816128161381614816158161681617816188161981620816218162281623816248162581626816278162881629816308163181632816338163481635816368163781638816398164081641816428164381644816458164681647816488164981650816518165281653816548165581656816578165881659816608166181662816638166481665816668166781668816698167081671816728167381674816758167681677816788167981680816818168281683816848168581686816878168881689816908169181692816938169481695816968169781698816998170081701817028170381704817058170681707817088170981710817118171281713817148171581716817178171881719817208172181722817238172481725817268172781728817298173081731817328173381734817358173681737817388173981740817418174281743817448174581746817478174881749817508175181752817538175481755817568175781758817598176081761817628176381764817658176681767817688176981770817718177281773817748177581776817778177881779817808178181782817838178481785817868178781788817898179081791817928179381794817958179681797817988179981800818018180281803818048180581806818078180881809818108181181812818138181481815818168181781818818198182081821818228182381824818258182681827818288182981830818318183281833818348183581836818378183881839818408184181842818438184481845818468184781848818498185081851818528185381854818558185681857818588185981860818618186281863818648186581866818678186881869818708187181872818738187481875818768187781878818798188081881818828188381884818858188681887818888188981890818918189281893818948189581896818978189881899819008190181902819038190481905819068190781908819098191081911819128191381914819158191681917819188191981920819218192281923819248192581926819278192881929819308193181932819338193481935819368193781938819398194081941819428194381944819458194681947819488194981950819518195281953819548195581956819578195881959819608196181962819638196481965819668196781968819698197081971819728197381974819758197681977819788197981980819818198281983819848198581986819878198881989819908199181992819938199481995819968199781998819998200082001820028200382004820058200682007820088200982010820118201282013820148201582016820178201882019820208202182022820238202482025820268202782028820298203082031820328203382034820358203682037820388203982040820418204282043820448204582046820478204882049820508205182052820538205482055820568205782058820598206082061820628206382064820658206682067820688206982070820718207282073820748207582076820778207882079820808208182082820838208482085820868208782088820898209082091820928209382094820958209682097820988209982100821018210282103821048210582106821078210882109821108211182112821138211482115821168211782118821198212082121821228212382124821258212682127821288212982130821318213282133821348213582136821378213882139821408214182142821438214482145821468214782148821498215082151821528215382154821558215682157821588215982160821618216282163821648216582166821678216882169821708217182172821738217482175821768217782178821798218082181821828218382184821858218682187821888218982190821918219282193821948219582196821978219882199822008220182202822038220482205822068220782208822098221082211822128221382214822158221682217822188221982220822218222282223822248222582226822278222882229822308223182232822338223482235822368223782238822398224082241822428224382244822458224682247822488224982250822518225282253822548225582256822578225882259822608226182262822638226482265822668226782268822698227082271822728227382274822758227682277822788227982280822818228282283822848228582286822878228882289822908229182292822938229482295822968229782298822998230082301823028230382304823058230682307823088230982310823118231282313823148231582316823178231882319823208232182322823238232482325823268232782328823298233082331823328233382334823358233682337823388233982340823418234282343823448234582346823478234882349823508235182352823538235482355823568235782358823598236082361823628236382364823658236682367823688236982370823718237282373823748237582376823778237882379823808238182382823838238482385823868238782388823898239082391823928239382394823958239682397823988239982400824018240282403824048240582406824078240882409824108241182412824138241482415824168241782418824198242082421824228242382424824258242682427824288242982430824318243282433824348243582436824378243882439824408244182442824438244482445824468244782448824498245082451824528245382454824558245682457824588245982460824618246282463824648246582466824678246882469824708247182472824738247482475824768247782478824798248082481824828248382484824858248682487824888248982490824918249282493824948249582496824978249882499825008250182502825038250482505825068250782508825098251082511825128251382514825158251682517825188251982520825218252282523825248252582526825278252882529825308253182532825338253482535825368253782538825398254082541825428254382544825458254682547825488254982550825518255282553825548255582556825578255882559825608256182562825638256482565825668256782568825698257082571825728257382574825758257682577825788257982580825818258282583825848258582586825878258882589825908259182592825938259482595825968259782598825998260082601826028260382604826058260682607826088260982610826118261282613826148261582616826178261882619826208262182622826238262482625826268262782628826298263082631826328263382634826358263682637826388263982640826418264282643826448264582646826478264882649826508265182652826538265482655826568265782658826598266082661826628266382664826658266682667826688266982670826718267282673826748267582676826778267882679826808268182682826838268482685826868268782688826898269082691826928269382694826958269682697826988269982700827018270282703827048270582706827078270882709827108271182712827138271482715827168271782718827198272082721827228272382724827258272682727827288272982730827318273282733827348273582736827378273882739827408274182742827438274482745827468274782748827498275082751827528275382754827558275682757827588275982760827618276282763827648276582766827678276882769827708277182772827738277482775827768277782778827798278082781827828278382784827858278682787827888278982790827918279282793827948279582796827978279882799828008280182802828038280482805828068280782808828098281082811828128281382814828158281682817828188281982820828218282282823828248282582826828278282882829828308283182832828338283482835828368283782838828398284082841828428284382844828458284682847828488284982850828518285282853828548285582856828578285882859828608286182862828638286482865828668286782868828698287082871828728287382874828758287682877828788287982880828818288282883828848288582886828878288882889828908289182892828938289482895828968289782898828998290082901829028290382904829058290682907829088290982910829118291282913829148291582916829178291882919829208292182922829238292482925829268292782928829298293082931829328293382934829358293682937829388293982940829418294282943829448294582946829478294882949829508295182952829538295482955829568295782958829598296082961829628296382964829658296682967829688296982970829718297282973829748297582976829778297882979829808298182982829838298482985829868298782988829898299082991829928299382994829958299682997829988299983000830018300283003830048300583006830078300883009830108301183012830138301483015830168301783018830198302083021830228302383024830258302683027830288302983030830318303283033830348303583036830378303883039830408304183042830438304483045830468304783048830498305083051830528305383054830558305683057830588305983060830618306283063830648306583066830678306883069830708307183072830738307483075830768307783078830798308083081830828308383084830858308683087830888308983090830918309283093830948309583096830978309883099831008310183102831038310483105831068310783108831098311083111831128311383114831158311683117831188311983120831218312283123831248312583126831278312883129831308313183132831338313483135831368313783138831398314083141831428314383144831458314683147831488314983150831518315283153831548315583156831578315883159831608316183162831638316483165831668316783168831698317083171831728317383174831758317683177831788317983180831818318283183831848318583186831878318883189831908319183192831938319483195831968319783198831998320083201832028320383204832058320683207832088320983210832118321283213832148321583216832178321883219832208322183222832238322483225832268322783228832298323083231832328323383234832358323683237832388323983240832418324283243832448324583246832478324883249832508325183252832538325483255832568325783258832598326083261832628326383264832658326683267832688326983270832718327283273832748327583276832778327883279832808328183282832838328483285832868328783288832898329083291832928329383294832958329683297832988329983300833018330283303833048330583306833078330883309833108331183312833138331483315833168331783318833198332083321833228332383324833258332683327833288332983330833318333283333833348333583336833378333883339833408334183342833438334483345833468334783348833498335083351833528335383354833558335683357833588335983360833618336283363833648336583366833678336883369833708337183372833738337483375833768337783378833798338083381833828338383384833858338683387833888338983390833918339283393833948339583396833978339883399834008340183402834038340483405834068340783408834098341083411834128341383414834158341683417834188341983420834218342283423834248342583426834278342883429834308343183432834338343483435834368343783438834398344083441834428344383444834458344683447834488344983450834518345283453834548345583456834578345883459834608346183462834638346483465834668346783468834698347083471834728347383474834758347683477834788347983480834818348283483834848348583486834878348883489834908349183492834938349483495834968349783498834998350083501835028350383504835058350683507835088350983510835118351283513835148351583516835178351883519835208352183522835238352483525835268352783528835298353083531835328353383534835358353683537835388353983540835418354283543835448354583546835478354883549835508355183552835538355483555835568355783558835598356083561835628356383564835658356683567835688356983570835718357283573835748357583576835778357883579835808358183582835838358483585835868358783588835898359083591835928359383594835958359683597835988359983600836018360283603836048360583606836078360883609836108361183612836138361483615836168361783618836198362083621836228362383624836258362683627836288362983630836318363283633836348363583636836378363883639836408364183642836438364483645836468364783648836498365083651836528365383654836558365683657836588365983660836618366283663836648366583666836678366883669836708367183672836738367483675836768367783678836798368083681836828368383684836858368683687836888368983690836918369283693836948369583696836978369883699837008370183702837038370483705837068370783708837098371083711837128371383714837158371683717837188371983720837218372283723837248372583726837278372883729837308373183732837338373483735837368373783738837398374083741837428374383744837458374683747837488374983750837518375283753837548375583756837578375883759837608376183762837638376483765837668376783768837698377083771837728377383774837758377683777837788377983780837818378283783837848378583786837878378883789837908379183792837938379483795837968379783798837998380083801838028380383804838058380683807838088380983810838118381283813838148381583816838178381883819838208382183822838238382483825838268382783828838298383083831838328383383834838358383683837838388383983840838418384283843838448384583846838478384883849838508385183852838538385483855838568385783858838598386083861838628386383864838658386683867838688386983870838718387283873838748387583876838778387883879838808388183882838838388483885838868388783888838898389083891838928389383894838958389683897838988389983900839018390283903839048390583906839078390883909839108391183912839138391483915839168391783918839198392083921839228392383924839258392683927839288392983930839318393283933839348393583936839378393883939839408394183942839438394483945839468394783948839498395083951839528395383954839558395683957839588395983960839618396283963839648396583966839678396883969839708397183972839738397483975839768397783978839798398083981839828398383984839858398683987839888398983990839918399283993839948399583996839978399883999840008400184002840038400484005840068400784008840098401084011840128401384014840158401684017840188401984020840218402284023840248402584026840278402884029840308403184032840338403484035840368403784038840398404084041840428404384044840458404684047840488404984050840518405284053840548405584056840578405884059840608406184062840638406484065840668406784068840698407084071840728407384074840758407684077840788407984080840818408284083840848408584086840878408884089840908409184092840938409484095840968409784098840998410084101841028410384104841058410684107841088410984110841118411284113841148411584116841178411884119841208412184122841238412484125841268412784128841298413084131841328413384134841358413684137841388413984140841418414284143841448414584146841478414884149841508415184152841538415484155841568415784158841598416084161841628416384164841658416684167841688416984170841718417284173841748417584176841778417884179841808418184182841838418484185841868418784188841898419084191841928419384194841958419684197841988419984200842018420284203842048420584206842078420884209842108421184212842138421484215842168421784218842198422084221842228422384224842258422684227842288422984230842318423284233842348423584236842378423884239842408424184242842438424484245842468424784248842498425084251842528425384254842558425684257842588425984260842618426284263842648426584266842678426884269842708427184272842738427484275842768427784278842798428084281842828428384284842858428684287842888428984290842918429284293842948429584296842978429884299843008430184302843038430484305843068430784308843098431084311843128431384314843158431684317843188431984320843218432284323843248432584326843278432884329843308433184332843338433484335843368433784338843398434084341843428434384344843458434684347843488434984350843518435284353843548435584356843578435884359843608436184362843638436484365843668436784368843698437084371843728437384374843758437684377843788437984380843818438284383843848438584386843878438884389843908439184392843938439484395843968439784398843998440084401844028440384404844058440684407844088440984410844118441284413844148441584416844178441884419844208442184422844238442484425844268442784428844298443084431844328443384434844358443684437844388443984440844418444284443844448444584446844478444884449844508445184452844538445484455844568445784458844598446084461844628446384464844658446684467844688446984470844718447284473844748447584476844778447884479844808448184482844838448484485844868448784488844898449084491844928449384494844958449684497844988449984500845018450284503845048450584506845078450884509845108451184512845138451484515845168451784518845198452084521845228452384524845258452684527845288452984530845318453284533845348453584536845378453884539845408454184542845438454484545845468454784548845498455084551845528455384554845558455684557845588455984560845618456284563845648456584566845678456884569845708457184572845738457484575845768457784578845798458084581845828458384584845858458684587845888458984590845918459284593845948459584596845978459884599846008460184602846038460484605846068460784608846098461084611846128461384614846158461684617846188461984620846218462284623846248462584626846278462884629846308463184632846338463484635846368463784638846398464084641846428464384644846458464684647846488464984650846518465284653846548465584656846578465884659846608466184662846638466484665846668466784668846698467084671846728467384674846758467684677846788467984680846818468284683846848468584686846878468884689846908469184692846938469484695846968469784698846998470084701847028470384704847058470684707847088470984710847118471284713847148471584716847178471884719847208472184722847238472484725847268472784728847298473084731847328473384734847358473684737847388473984740847418474284743847448474584746847478474884749847508475184752847538475484755847568475784758847598476084761847628476384764847658476684767847688476984770847718477284773847748477584776847778477884779847808478184782847838478484785847868478784788847898479084791847928479384794847958479684797847988479984800848018480284803848048480584806848078480884809848108481184812848138481484815848168481784818848198482084821848228482384824848258482684827848288482984830848318483284833848348483584836848378483884839848408484184842848438484484845848468484784848848498485084851848528485384854848558485684857848588485984860848618486284863848648486584866848678486884869848708487184872848738487484875848768487784878848798488084881848828488384884848858488684887848888488984890848918489284893848948489584896848978489884899849008490184902849038490484905849068490784908849098491084911849128491384914849158491684917849188491984920849218492284923849248492584926849278492884929849308493184932849338493484935849368493784938849398494084941849428494384944849458494684947849488494984950849518495284953849548495584956849578495884959849608496184962849638496484965849668496784968849698497084971849728497384974849758497684977849788497984980849818498284983849848498584986849878498884989849908499184992849938499484995849968499784998849998500085001850028500385004850058500685007850088500985010850118501285013850148501585016850178501885019850208502185022850238502485025850268502785028850298503085031850328503385034850358503685037850388503985040850418504285043850448504585046850478504885049850508505185052850538505485055850568505785058850598506085061850628506385064850658506685067850688506985070850718507285073850748507585076850778507885079850808508185082850838508485085850868508785088850898509085091850928509385094850958509685097850988509985100851018510285103851048510585106851078510885109851108511185112851138511485115851168511785118851198512085121851228512385124851258512685127851288512985130851318513285133851348513585136851378513885139851408514185142851438514485145851468514785148851498515085151851528515385154851558515685157851588515985160851618516285163851648516585166851678516885169851708517185172851738517485175851768517785178851798518085181851828518385184851858518685187851888518985190851918519285193851948519585196851978519885199852008520185202852038520485205852068520785208852098521085211852128521385214852158521685217852188521985220852218522285223852248522585226852278522885229852308523185232852338523485235852368523785238852398524085241852428524385244852458524685247852488524985250852518525285253852548525585256852578525885259852608526185262852638526485265852668526785268852698527085271852728527385274852758527685277852788527985280852818528285283852848528585286852878528885289852908529185292852938529485295852968529785298852998530085301853028530385304853058530685307853088530985310853118531285313853148531585316853178531885319853208532185322853238532485325853268532785328853298533085331853328533385334853358533685337853388533985340853418534285343853448534585346853478534885349853508535185352853538535485355853568535785358853598536085361853628536385364853658536685367853688536985370853718537285373853748537585376853778537885379853808538185382853838538485385853868538785388853898539085391853928539385394853958539685397853988539985400854018540285403854048540585406854078540885409854108541185412854138541485415854168541785418854198542085421854228542385424854258542685427854288542985430854318543285433854348543585436854378543885439854408544185442854438544485445854468544785448854498545085451854528545385454854558545685457854588545985460854618546285463854648546585466854678546885469854708547185472854738547485475854768547785478854798548085481854828548385484854858548685487854888548985490854918549285493854948549585496854978549885499855008550185502855038550485505855068550785508855098551085511855128551385514855158551685517855188551985520855218552285523855248552585526855278552885529855308553185532855338553485535855368553785538855398554085541855428554385544855458554685547855488554985550855518555285553855548555585556855578555885559855608556185562855638556485565855668556785568855698557085571855728557385574855758557685577855788557985580855818558285583855848558585586855878558885589855908559185592855938559485595855968559785598855998560085601856028560385604856058560685607856088560985610856118561285613856148561585616856178561885619856208562185622856238562485625856268562785628856298563085631856328563385634856358563685637856388563985640856418564285643856448564585646856478564885649856508565185652856538565485655856568565785658856598566085661856628566385664856658566685667856688566985670856718567285673856748567585676856778567885679856808568185682856838568485685856868568785688856898569085691856928569385694856958569685697856988569985700857018570285703857048570585706857078570885709857108571185712857138571485715857168571785718857198572085721857228572385724857258572685727857288572985730857318573285733857348573585736857378573885739857408574185742857438574485745857468574785748857498575085751857528575385754857558575685757857588575985760857618576285763857648576585766857678576885769857708577185772857738577485775857768577785778857798578085781857828578385784857858578685787857888578985790857918579285793857948579585796857978579885799858008580185802858038580485805858068580785808858098581085811858128581385814858158581685817858188581985820858218582285823858248582585826858278582885829858308583185832858338583485835858368583785838858398584085841858428584385844858458584685847858488584985850858518585285853858548585585856858578585885859858608586185862858638586485865858668586785868858698587085871858728587385874858758587685877858788587985880858818588285883858848588585886858878588885889858908589185892858938589485895858968589785898858998590085901859028590385904859058590685907859088590985910859118591285913859148591585916859178591885919859208592185922859238592485925859268592785928859298593085931859328593385934859358593685937859388593985940859418594285943859448594585946859478594885949859508595185952859538595485955859568595785958859598596085961859628596385964859658596685967859688596985970859718597285973859748597585976859778597885979859808598185982859838598485985859868598785988859898599085991859928599385994859958599685997859988599986000860018600286003860048600586006860078600886009860108601186012860138601486015860168601786018860198602086021860228602386024860258602686027860288602986030860318603286033860348603586036860378603886039860408604186042860438604486045860468604786048860498605086051860528605386054860558605686057860588605986060860618606286063860648606586066860678606886069860708607186072860738607486075860768607786078860798608086081860828608386084860858608686087860888608986090860918609286093860948609586096860978609886099861008610186102861038610486105861068610786108861098611086111861128611386114861158611686117861188611986120861218612286123861248612586126861278612886129861308613186132861338613486135861368613786138861398614086141861428614386144861458614686147861488614986150861518615286153861548615586156861578615886159861608616186162861638616486165861668616786168861698617086171861728617386174861758617686177861788617986180861818618286183861848618586186861878618886189861908619186192861938619486195861968619786198861998620086201862028620386204862058620686207862088620986210862118621286213862148621586216862178621886219862208622186222862238622486225862268622786228862298623086231862328623386234862358623686237862388623986240862418624286243862448624586246862478624886249862508625186252862538625486255862568625786258862598626086261862628626386264862658626686267862688626986270862718627286273862748627586276862778627886279862808628186282862838628486285862868628786288862898629086291862928629386294862958629686297862988629986300863018630286303863048630586306863078630886309863108631186312863138631486315863168631786318863198632086321863228632386324863258632686327863288632986330863318633286333863348633586336863378633886339863408634186342863438634486345863468634786348863498635086351863528635386354863558635686357863588635986360863618636286363863648636586366863678636886369863708637186372863738637486375863768637786378863798638086381863828638386384863858638686387863888638986390863918639286393863948639586396863978639886399864008640186402864038640486405864068640786408864098641086411864128641386414864158641686417864188641986420864218642286423864248642586426864278642886429864308643186432864338643486435864368643786438864398644086441864428644386444864458644686447864488644986450864518645286453864548645586456864578645886459864608646186462864638646486465864668646786468864698647086471864728647386474864758647686477864788647986480864818648286483864848648586486864878648886489864908649186492
  1. /******/ (function(modules) { // webpackBootstrap
  2. /******/ // The module cache
  3. /******/ var installedModules = {};
  4. /******/
  5. /******/ // The require function
  6. /******/ function __webpack_require__(moduleId) {
  7. /******/
  8. /******/ // Check if module is in cache
  9. /******/ if(installedModules[moduleId]) {
  10. /******/ return installedModules[moduleId].exports;
  11. /******/ }
  12. /******/ // Create a new module (and put it into the cache)
  13. /******/ var module = installedModules[moduleId] = {
  14. /******/ i: moduleId,
  15. /******/ l: false,
  16. /******/ exports: {}
  17. /******/ };
  18. /******/
  19. /******/ // Execute the module function
  20. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  21. /******/
  22. /******/ // Flag the module as loaded
  23. /******/ module.l = true;
  24. /******/
  25. /******/ // Return the exports of the module
  26. /******/ return module.exports;
  27. /******/ }
  28. /******/
  29. /******/
  30. /******/ // expose the modules object (__webpack_modules__)
  31. /******/ __webpack_require__.m = modules;
  32. /******/
  33. /******/ // expose the module cache
  34. /******/ __webpack_require__.c = installedModules;
  35. /******/
  36. /******/ // define getter function for harmony exports
  37. /******/ __webpack_require__.d = function(exports, name, getter) {
  38. /******/ if(!__webpack_require__.o(exports, name)) {
  39. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  40. /******/ }
  41. /******/ };
  42. /******/
  43. /******/ // define __esModule on exports
  44. /******/ __webpack_require__.r = function(exports) {
  45. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  46. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  47. /******/ }
  48. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  49. /******/ };
  50. /******/
  51. /******/ // create a fake namespace object
  52. /******/ // mode & 1: value is a module id, require it
  53. /******/ // mode & 2: merge all properties of value into the ns
  54. /******/ // mode & 4: return value when already ns object
  55. /******/ // mode & 8|1: behave like require
  56. /******/ __webpack_require__.t = function(value, mode) {
  57. /******/ if(mode & 1) value = __webpack_require__(value);
  58. /******/ if(mode & 8) return value;
  59. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  60. /******/ var ns = Object.create(null);
  61. /******/ __webpack_require__.r(ns);
  62. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  63. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  64. /******/ return ns;
  65. /******/ };
  66. /******/
  67. /******/ // getDefaultExport function for compatibility with non-harmony modules
  68. /******/ __webpack_require__.n = function(module) {
  69. /******/ var getter = module && module.__esModule ?
  70. /******/ function getDefault() { return module['default']; } :
  71. /******/ function getModuleExports() { return module; };
  72. /******/ __webpack_require__.d(getter, 'a', getter);
  73. /******/ return getter;
  74. /******/ };
  75. /******/
  76. /******/ // Object.prototype.hasOwnProperty.call
  77. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  78. /******/
  79. /******/ // __webpack_public_path__
  80. /******/ __webpack_require__.p = "/";
  81. /******/
  82. /******/
  83. /******/ // Load entry module and return exports
  84. /******/ return __webpack_require__(__webpack_require__.s = 0);
  85. /******/ })
  86. /************************************************************************/
  87. /******/ ({
  88. /***/ "./node_modules/after/index.js":
  89. /*!*************************************!*\
  90. !*** ./node_modules/after/index.js ***!
  91. \*************************************/
  92. /*! no static exports found */
  93. /***/ (function(module, exports) {
  94. module.exports = after
  95. function after(count, callback, err_cb) {
  96. var bail = false
  97. err_cb = err_cb || noop
  98. proxy.count = count
  99. return (count === 0) ? callback() : proxy
  100. function proxy(err, result) {
  101. if (proxy.count <= 0) {
  102. throw new Error('after called too many times')
  103. }
  104. --proxy.count
  105. // after first error, rest are passed to err_cb
  106. if (err) {
  107. bail = true
  108. callback(err)
  109. // future error callbacks will go to error handler
  110. callback = err_cb
  111. } else if (proxy.count === 0 && !bail) {
  112. callback(null, result)
  113. }
  114. }
  115. }
  116. function noop() {}
  117. /***/ }),
  118. /***/ "./node_modules/arraybuffer.slice/index.js":
  119. /*!*************************************************!*\
  120. !*** ./node_modules/arraybuffer.slice/index.js ***!
  121. \*************************************************/
  122. /*! no static exports found */
  123. /***/ (function(module, exports) {
  124. /**
  125. * An abstraction for slicing an arraybuffer even when
  126. * ArrayBuffer.prototype.slice is not supported
  127. *
  128. * @api public
  129. */
  130. module.exports = function(arraybuffer, start, end) {
  131. var bytes = arraybuffer.byteLength;
  132. start = start || 0;
  133. end = end || bytes;
  134. if (arraybuffer.slice) { return arraybuffer.slice(start, end); }
  135. if (start < 0) { start += bytes; }
  136. if (end < 0) { end += bytes; }
  137. if (end > bytes) { end = bytes; }
  138. if (start >= bytes || start >= end || bytes === 0) {
  139. return new ArrayBuffer(0);
  140. }
  141. var abv = new Uint8Array(arraybuffer);
  142. var result = new Uint8Array(end - start);
  143. for (var i = start, ii = 0; i < end; i++, ii++) {
  144. result[ii] = abv[i];
  145. }
  146. return result.buffer;
  147. };
  148. /***/ }),
  149. /***/ "./node_modules/axios/index.js":
  150. /*!*************************************!*\
  151. !*** ./node_modules/axios/index.js ***!
  152. \*************************************/
  153. /*! no static exports found */
  154. /***/ (function(module, exports, __webpack_require__) {
  155. module.exports = __webpack_require__(/*! ./lib/axios */ "./node_modules/axios/lib/axios.js");
  156. /***/ }),
  157. /***/ "./node_modules/axios/lib/adapters/xhr.js":
  158. /*!************************************************!*\
  159. !*** ./node_modules/axios/lib/adapters/xhr.js ***!
  160. \************************************************/
  161. /*! no static exports found */
  162. /***/ (function(module, exports, __webpack_require__) {
  163. "use strict";
  164. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  165. var settle = __webpack_require__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js");
  166. var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js");
  167. var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js");
  168. var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js");
  169. var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js");
  170. var createError = __webpack_require__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js");
  171. module.exports = function xhrAdapter(config) {
  172. return new Promise(function dispatchXhrRequest(resolve, reject) {
  173. var requestData = config.data;
  174. var requestHeaders = config.headers;
  175. if (utils.isFormData(requestData)) {
  176. delete requestHeaders['Content-Type']; // Let the browser set it
  177. }
  178. var request = new XMLHttpRequest();
  179. // HTTP basic authentication
  180. if (config.auth) {
  181. var username = config.auth.username || '';
  182. var password = config.auth.password || '';
  183. requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);
  184. }
  185. var fullPath = buildFullPath(config.baseURL, config.url);
  186. request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
  187. // Set the request timeout in MS
  188. request.timeout = config.timeout;
  189. // Listen for ready state
  190. request.onreadystatechange = function handleLoad() {
  191. if (!request || request.readyState !== 4) {
  192. return;
  193. }
  194. // The request errored out and we didn't get a response, this will be
  195. // handled by onerror instead
  196. // With one exception: request that using file: protocol, most browsers
  197. // will return status as 0 even though it's a successful request
  198. if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
  199. return;
  200. }
  201. // Prepare the response
  202. var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;
  203. var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;
  204. var response = {
  205. data: responseData,
  206. status: request.status,
  207. statusText: request.statusText,
  208. headers: responseHeaders,
  209. config: config,
  210. request: request
  211. };
  212. settle(resolve, reject, response);
  213. // Clean up request
  214. request = null;
  215. };
  216. // Handle browser request cancellation (as opposed to a manual cancellation)
  217. request.onabort = function handleAbort() {
  218. if (!request) {
  219. return;
  220. }
  221. reject(createError('Request aborted', config, 'ECONNABORTED', request));
  222. // Clean up request
  223. request = null;
  224. };
  225. // Handle low level network errors
  226. request.onerror = function handleError() {
  227. // Real errors are hidden from us by the browser
  228. // onerror should only fire if it's a network error
  229. reject(createError('Network Error', config, null, request));
  230. // Clean up request
  231. request = null;
  232. };
  233. // Handle timeout
  234. request.ontimeout = function handleTimeout() {
  235. var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded';
  236. if (config.timeoutErrorMessage) {
  237. timeoutErrorMessage = config.timeoutErrorMessage;
  238. }
  239. reject(createError(timeoutErrorMessage, config, 'ECONNABORTED',
  240. request));
  241. // Clean up request
  242. request = null;
  243. };
  244. // Add xsrf header
  245. // This is only done if running in a standard browser environment.
  246. // Specifically not if we're in a web worker, or react-native.
  247. if (utils.isStandardBrowserEnv()) {
  248. var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./node_modules/axios/lib/helpers/cookies.js");
  249. // Add xsrf header
  250. var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ?
  251. cookies.read(config.xsrfCookieName) :
  252. undefined;
  253. if (xsrfValue) {
  254. requestHeaders[config.xsrfHeaderName] = xsrfValue;
  255. }
  256. }
  257. // Add headers to the request
  258. if ('setRequestHeader' in request) {
  259. utils.forEach(requestHeaders, function setRequestHeader(val, key) {
  260. if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {
  261. // Remove Content-Type if data is undefined
  262. delete requestHeaders[key];
  263. } else {
  264. // Otherwise add header to the request
  265. request.setRequestHeader(key, val);
  266. }
  267. });
  268. }
  269. // Add withCredentials to request if needed
  270. if (!utils.isUndefined(config.withCredentials)) {
  271. request.withCredentials = !!config.withCredentials;
  272. }
  273. // Add responseType to request if needed
  274. if (config.responseType) {
  275. try {
  276. request.responseType = config.responseType;
  277. } catch (e) {
  278. // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.
  279. // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.
  280. if (config.responseType !== 'json') {
  281. throw e;
  282. }
  283. }
  284. }
  285. // Handle progress if needed
  286. if (typeof config.onDownloadProgress === 'function') {
  287. request.addEventListener('progress', config.onDownloadProgress);
  288. }
  289. // Not all browsers support upload events
  290. if (typeof config.onUploadProgress === 'function' && request.upload) {
  291. request.upload.addEventListener('progress', config.onUploadProgress);
  292. }
  293. if (config.cancelToken) {
  294. // Handle cancellation
  295. config.cancelToken.promise.then(function onCanceled(cancel) {
  296. if (!request) {
  297. return;
  298. }
  299. request.abort();
  300. reject(cancel);
  301. // Clean up request
  302. request = null;
  303. });
  304. }
  305. if (requestData === undefined) {
  306. requestData = null;
  307. }
  308. // Send the request
  309. request.send(requestData);
  310. });
  311. };
  312. /***/ }),
  313. /***/ "./node_modules/axios/lib/axios.js":
  314. /*!*****************************************!*\
  315. !*** ./node_modules/axios/lib/axios.js ***!
  316. \*****************************************/
  317. /*! no static exports found */
  318. /***/ (function(module, exports, __webpack_require__) {
  319. "use strict";
  320. var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js");
  321. var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js");
  322. var Axios = __webpack_require__(/*! ./core/Axios */ "./node_modules/axios/lib/core/Axios.js");
  323. var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js");
  324. var defaults = __webpack_require__(/*! ./defaults */ "./node_modules/axios/lib/defaults.js");
  325. /**
  326. * Create an instance of Axios
  327. *
  328. * @param {Object} defaultConfig The default config for the instance
  329. * @return {Axios} A new instance of Axios
  330. */
  331. function createInstance(defaultConfig) {
  332. var context = new Axios(defaultConfig);
  333. var instance = bind(Axios.prototype.request, context);
  334. // Copy axios.prototype to instance
  335. utils.extend(instance, Axios.prototype, context);
  336. // Copy context to instance
  337. utils.extend(instance, context);
  338. return instance;
  339. }
  340. // Create the default instance to be exported
  341. var axios = createInstance(defaults);
  342. // Expose Axios class to allow class inheritance
  343. axios.Axios = Axios;
  344. // Factory for creating new instances
  345. axios.create = function create(instanceConfig) {
  346. return createInstance(mergeConfig(axios.defaults, instanceConfig));
  347. };
  348. // Expose Cancel & CancelToken
  349. axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
  350. axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./node_modules/axios/lib/cancel/CancelToken.js");
  351. axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
  352. // Expose all/spread
  353. axios.all = function all(promises) {
  354. return Promise.all(promises);
  355. };
  356. axios.spread = __webpack_require__(/*! ./helpers/spread */ "./node_modules/axios/lib/helpers/spread.js");
  357. module.exports = axios;
  358. // Allow use of default import syntax in TypeScript
  359. module.exports.default = axios;
  360. /***/ }),
  361. /***/ "./node_modules/axios/lib/cancel/Cancel.js":
  362. /*!*************************************************!*\
  363. !*** ./node_modules/axios/lib/cancel/Cancel.js ***!
  364. \*************************************************/
  365. /*! no static exports found */
  366. /***/ (function(module, exports, __webpack_require__) {
  367. "use strict";
  368. /**
  369. * A `Cancel` is an object that is thrown when an operation is canceled.
  370. *
  371. * @class
  372. * @param {string=} message The message.
  373. */
  374. function Cancel(message) {
  375. this.message = message;
  376. }
  377. Cancel.prototype.toString = function toString() {
  378. return 'Cancel' + (this.message ? ': ' + this.message : '');
  379. };
  380. Cancel.prototype.__CANCEL__ = true;
  381. module.exports = Cancel;
  382. /***/ }),
  383. /***/ "./node_modules/axios/lib/cancel/CancelToken.js":
  384. /*!******************************************************!*\
  385. !*** ./node_modules/axios/lib/cancel/CancelToken.js ***!
  386. \******************************************************/
  387. /*! no static exports found */
  388. /***/ (function(module, exports, __webpack_require__) {
  389. "use strict";
  390. var Cancel = __webpack_require__(/*! ./Cancel */ "./node_modules/axios/lib/cancel/Cancel.js");
  391. /**
  392. * A `CancelToken` is an object that can be used to request cancellation of an operation.
  393. *
  394. * @class
  395. * @param {Function} executor The executor function.
  396. */
  397. function CancelToken(executor) {
  398. if (typeof executor !== 'function') {
  399. throw new TypeError('executor must be a function.');
  400. }
  401. var resolvePromise;
  402. this.promise = new Promise(function promiseExecutor(resolve) {
  403. resolvePromise = resolve;
  404. });
  405. var token = this;
  406. executor(function cancel(message) {
  407. if (token.reason) {
  408. // Cancellation has already been requested
  409. return;
  410. }
  411. token.reason = new Cancel(message);
  412. resolvePromise(token.reason);
  413. });
  414. }
  415. /**
  416. * Throws a `Cancel` if cancellation has been requested.
  417. */
  418. CancelToken.prototype.throwIfRequested = function throwIfRequested() {
  419. if (this.reason) {
  420. throw this.reason;
  421. }
  422. };
  423. /**
  424. * Returns an object that contains a new `CancelToken` and a function that, when called,
  425. * cancels the `CancelToken`.
  426. */
  427. CancelToken.source = function source() {
  428. var cancel;
  429. var token = new CancelToken(function executor(c) {
  430. cancel = c;
  431. });
  432. return {
  433. token: token,
  434. cancel: cancel
  435. };
  436. };
  437. module.exports = CancelToken;
  438. /***/ }),
  439. /***/ "./node_modules/axios/lib/cancel/isCancel.js":
  440. /*!***************************************************!*\
  441. !*** ./node_modules/axios/lib/cancel/isCancel.js ***!
  442. \***************************************************/
  443. /*! no static exports found */
  444. /***/ (function(module, exports, __webpack_require__) {
  445. "use strict";
  446. module.exports = function isCancel(value) {
  447. return !!(value && value.__CANCEL__);
  448. };
  449. /***/ }),
  450. /***/ "./node_modules/axios/lib/core/Axios.js":
  451. /*!**********************************************!*\
  452. !*** ./node_modules/axios/lib/core/Axios.js ***!
  453. \**********************************************/
  454. /*! no static exports found */
  455. /***/ (function(module, exports, __webpack_require__) {
  456. "use strict";
  457. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  458. var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js");
  459. var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./node_modules/axios/lib/core/InterceptorManager.js");
  460. var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./node_modules/axios/lib/core/dispatchRequest.js");
  461. var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js");
  462. /**
  463. * Create a new instance of Axios
  464. *
  465. * @param {Object} instanceConfig The default config for the instance
  466. */
  467. function Axios(instanceConfig) {
  468. this.defaults = instanceConfig;
  469. this.interceptors = {
  470. request: new InterceptorManager(),
  471. response: new InterceptorManager()
  472. };
  473. }
  474. /**
  475. * Dispatch a request
  476. *
  477. * @param {Object} config The config specific for this request (merged with this.defaults)
  478. */
  479. Axios.prototype.request = function request(config) {
  480. /*eslint no-param-reassign:0*/
  481. // Allow for axios('example/url'[, config]) a la fetch API
  482. if (typeof config === 'string') {
  483. config = arguments[1] || {};
  484. config.url = arguments[0];
  485. } else {
  486. config = config || {};
  487. }
  488. config = mergeConfig(this.defaults, config);
  489. // Set config.method
  490. if (config.method) {
  491. config.method = config.method.toLowerCase();
  492. } else if (this.defaults.method) {
  493. config.method = this.defaults.method.toLowerCase();
  494. } else {
  495. config.method = 'get';
  496. }
  497. // Hook up interceptors middleware
  498. var chain = [dispatchRequest, undefined];
  499. var promise = Promise.resolve(config);
  500. this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
  501. chain.unshift(interceptor.fulfilled, interceptor.rejected);
  502. });
  503. this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
  504. chain.push(interceptor.fulfilled, interceptor.rejected);
  505. });
  506. while (chain.length) {
  507. promise = promise.then(chain.shift(), chain.shift());
  508. }
  509. return promise;
  510. };
  511. Axios.prototype.getUri = function getUri(config) {
  512. config = mergeConfig(this.defaults, config);
  513. return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, '');
  514. };
  515. // Provide aliases for supported request methods
  516. utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
  517. /*eslint func-names:0*/
  518. Axios.prototype[method] = function(url, config) {
  519. return this.request(utils.merge(config || {}, {
  520. method: method,
  521. url: url
  522. }));
  523. };
  524. });
  525. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  526. /*eslint func-names:0*/
  527. Axios.prototype[method] = function(url, data, config) {
  528. return this.request(utils.merge(config || {}, {
  529. method: method,
  530. url: url,
  531. data: data
  532. }));
  533. };
  534. });
  535. module.exports = Axios;
  536. /***/ }),
  537. /***/ "./node_modules/axios/lib/core/InterceptorManager.js":
  538. /*!***********************************************************!*\
  539. !*** ./node_modules/axios/lib/core/InterceptorManager.js ***!
  540. \***********************************************************/
  541. /*! no static exports found */
  542. /***/ (function(module, exports, __webpack_require__) {
  543. "use strict";
  544. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  545. function InterceptorManager() {
  546. this.handlers = [];
  547. }
  548. /**
  549. * Add a new interceptor to the stack
  550. *
  551. * @param {Function} fulfilled The function to handle `then` for a `Promise`
  552. * @param {Function} rejected The function to handle `reject` for a `Promise`
  553. *
  554. * @return {Number} An ID used to remove interceptor later
  555. */
  556. InterceptorManager.prototype.use = function use(fulfilled, rejected) {
  557. this.handlers.push({
  558. fulfilled: fulfilled,
  559. rejected: rejected
  560. });
  561. return this.handlers.length - 1;
  562. };
  563. /**
  564. * Remove an interceptor from the stack
  565. *
  566. * @param {Number} id The ID that was returned by `use`
  567. */
  568. InterceptorManager.prototype.eject = function eject(id) {
  569. if (this.handlers[id]) {
  570. this.handlers[id] = null;
  571. }
  572. };
  573. /**
  574. * Iterate over all the registered interceptors
  575. *
  576. * This method is particularly useful for skipping over any
  577. * interceptors that may have become `null` calling `eject`.
  578. *
  579. * @param {Function} fn The function to call for each interceptor
  580. */
  581. InterceptorManager.prototype.forEach = function forEach(fn) {
  582. utils.forEach(this.handlers, function forEachHandler(h) {
  583. if (h !== null) {
  584. fn(h);
  585. }
  586. });
  587. };
  588. module.exports = InterceptorManager;
  589. /***/ }),
  590. /***/ "./node_modules/axios/lib/core/buildFullPath.js":
  591. /*!******************************************************!*\
  592. !*** ./node_modules/axios/lib/core/buildFullPath.js ***!
  593. \******************************************************/
  594. /*! no static exports found */
  595. /***/ (function(module, exports, __webpack_require__) {
  596. "use strict";
  597. var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js");
  598. var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./node_modules/axios/lib/helpers/combineURLs.js");
  599. /**
  600. * Creates a new URL by combining the baseURL with the requestedURL,
  601. * only when the requestedURL is not already an absolute URL.
  602. * If the requestURL is absolute, this function returns the requestedURL untouched.
  603. *
  604. * @param {string} baseURL The base URL
  605. * @param {string} requestedURL Absolute or relative URL to combine
  606. * @returns {string} The combined full path
  607. */
  608. module.exports = function buildFullPath(baseURL, requestedURL) {
  609. if (baseURL && !isAbsoluteURL(requestedURL)) {
  610. return combineURLs(baseURL, requestedURL);
  611. }
  612. return requestedURL;
  613. };
  614. /***/ }),
  615. /***/ "./node_modules/axios/lib/core/createError.js":
  616. /*!****************************************************!*\
  617. !*** ./node_modules/axios/lib/core/createError.js ***!
  618. \****************************************************/
  619. /*! no static exports found */
  620. /***/ (function(module, exports, __webpack_require__) {
  621. "use strict";
  622. var enhanceError = __webpack_require__(/*! ./enhanceError */ "./node_modules/axios/lib/core/enhanceError.js");
  623. /**
  624. * Create an Error with the specified message, config, error code, request and response.
  625. *
  626. * @param {string} message The error message.
  627. * @param {Object} config The config.
  628. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  629. * @param {Object} [request] The request.
  630. * @param {Object} [response] The response.
  631. * @returns {Error} The created error.
  632. */
  633. module.exports = function createError(message, config, code, request, response) {
  634. var error = new Error(message);
  635. return enhanceError(error, config, code, request, response);
  636. };
  637. /***/ }),
  638. /***/ "./node_modules/axios/lib/core/dispatchRequest.js":
  639. /*!********************************************************!*\
  640. !*** ./node_modules/axios/lib/core/dispatchRequest.js ***!
  641. \********************************************************/
  642. /*! no static exports found */
  643. /***/ (function(module, exports, __webpack_require__) {
  644. "use strict";
  645. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  646. var transformData = __webpack_require__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js");
  647. var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js");
  648. var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js");
  649. /**
  650. * Throws a `Cancel` if cancellation has been requested.
  651. */
  652. function throwIfCancellationRequested(config) {
  653. if (config.cancelToken) {
  654. config.cancelToken.throwIfRequested();
  655. }
  656. }
  657. /**
  658. * Dispatch a request to the server using the configured adapter.
  659. *
  660. * @param {object} config The config that is to be used for the request
  661. * @returns {Promise} The Promise to be fulfilled
  662. */
  663. module.exports = function dispatchRequest(config) {
  664. throwIfCancellationRequested(config);
  665. // Ensure headers exist
  666. config.headers = config.headers || {};
  667. // Transform request data
  668. config.data = transformData(
  669. config.data,
  670. config.headers,
  671. config.transformRequest
  672. );
  673. // Flatten headers
  674. config.headers = utils.merge(
  675. config.headers.common || {},
  676. config.headers[config.method] || {},
  677. config.headers
  678. );
  679. utils.forEach(
  680. ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
  681. function cleanHeaderConfig(method) {
  682. delete config.headers[method];
  683. }
  684. );
  685. var adapter = config.adapter || defaults.adapter;
  686. return adapter(config).then(function onAdapterResolution(response) {
  687. throwIfCancellationRequested(config);
  688. // Transform response data
  689. response.data = transformData(
  690. response.data,
  691. response.headers,
  692. config.transformResponse
  693. );
  694. return response;
  695. }, function onAdapterRejection(reason) {
  696. if (!isCancel(reason)) {
  697. throwIfCancellationRequested(config);
  698. // Transform response data
  699. if (reason && reason.response) {
  700. reason.response.data = transformData(
  701. reason.response.data,
  702. reason.response.headers,
  703. config.transformResponse
  704. );
  705. }
  706. }
  707. return Promise.reject(reason);
  708. });
  709. };
  710. /***/ }),
  711. /***/ "./node_modules/axios/lib/core/enhanceError.js":
  712. /*!*****************************************************!*\
  713. !*** ./node_modules/axios/lib/core/enhanceError.js ***!
  714. \*****************************************************/
  715. /*! no static exports found */
  716. /***/ (function(module, exports, __webpack_require__) {
  717. "use strict";
  718. /**
  719. * Update an Error with the specified config, error code, and response.
  720. *
  721. * @param {Error} error The error to update.
  722. * @param {Object} config The config.
  723. * @param {string} [code] The error code (for example, 'ECONNABORTED').
  724. * @param {Object} [request] The request.
  725. * @param {Object} [response] The response.
  726. * @returns {Error} The error.
  727. */
  728. module.exports = function enhanceError(error, config, code, request, response) {
  729. error.config = config;
  730. if (code) {
  731. error.code = code;
  732. }
  733. error.request = request;
  734. error.response = response;
  735. error.isAxiosError = true;
  736. error.toJSON = function() {
  737. return {
  738. // Standard
  739. message: this.message,
  740. name: this.name,
  741. // Microsoft
  742. description: this.description,
  743. number: this.number,
  744. // Mozilla
  745. fileName: this.fileName,
  746. lineNumber: this.lineNumber,
  747. columnNumber: this.columnNumber,
  748. stack: this.stack,
  749. // Axios
  750. config: this.config,
  751. code: this.code
  752. };
  753. };
  754. return error;
  755. };
  756. /***/ }),
  757. /***/ "./node_modules/axios/lib/core/mergeConfig.js":
  758. /*!****************************************************!*\
  759. !*** ./node_modules/axios/lib/core/mergeConfig.js ***!
  760. \****************************************************/
  761. /*! no static exports found */
  762. /***/ (function(module, exports, __webpack_require__) {
  763. "use strict";
  764. var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js");
  765. /**
  766. * Config-specific merge-function which creates a new config-object
  767. * by merging two configuration objects together.
  768. *
  769. * @param {Object} config1
  770. * @param {Object} config2
  771. * @returns {Object} New object resulting from merging config2 to config1
  772. */
  773. module.exports = function mergeConfig(config1, config2) {
  774. // eslint-disable-next-line no-param-reassign
  775. config2 = config2 || {};
  776. var config = {};
  777. var valueFromConfig2Keys = ['url', 'method', 'params', 'data'];
  778. var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy'];
  779. var defaultToConfig2Keys = [
  780. 'baseURL', 'url', 'transformRequest', 'transformResponse', 'paramsSerializer',
  781. 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',
  782. 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress',
  783. 'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent',
  784. 'httpsAgent', 'cancelToken', 'socketPath'
  785. ];
  786. utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) {
  787. if (typeof config2[prop] !== 'undefined') {
  788. config[prop] = config2[prop];
  789. }
  790. });
  791. utils.forEach(mergeDeepPropertiesKeys, function mergeDeepProperties(prop) {
  792. if (utils.isObject(config2[prop])) {
  793. config[prop] = utils.deepMerge(config1[prop], config2[prop]);
  794. } else if (typeof config2[prop] !== 'undefined') {
  795. config[prop] = config2[prop];
  796. } else if (utils.isObject(config1[prop])) {
  797. config[prop] = utils.deepMerge(config1[prop]);
  798. } else if (typeof config1[prop] !== 'undefined') {
  799. config[prop] = config1[prop];
  800. }
  801. });
  802. utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) {
  803. if (typeof config2[prop] !== 'undefined') {
  804. config[prop] = config2[prop];
  805. } else if (typeof config1[prop] !== 'undefined') {
  806. config[prop] = config1[prop];
  807. }
  808. });
  809. var axiosKeys = valueFromConfig2Keys
  810. .concat(mergeDeepPropertiesKeys)
  811. .concat(defaultToConfig2Keys);
  812. var otherKeys = Object
  813. .keys(config2)
  814. .filter(function filterAxiosKeys(key) {
  815. return axiosKeys.indexOf(key) === -1;
  816. });
  817. utils.forEach(otherKeys, function otherKeysDefaultToConfig2(prop) {
  818. if (typeof config2[prop] !== 'undefined') {
  819. config[prop] = config2[prop];
  820. } else if (typeof config1[prop] !== 'undefined') {
  821. config[prop] = config1[prop];
  822. }
  823. });
  824. return config;
  825. };
  826. /***/ }),
  827. /***/ "./node_modules/axios/lib/core/settle.js":
  828. /*!***********************************************!*\
  829. !*** ./node_modules/axios/lib/core/settle.js ***!
  830. \***********************************************/
  831. /*! no static exports found */
  832. /***/ (function(module, exports, __webpack_require__) {
  833. "use strict";
  834. var createError = __webpack_require__(/*! ./createError */ "./node_modules/axios/lib/core/createError.js");
  835. /**
  836. * Resolve or reject a Promise based on response status.
  837. *
  838. * @param {Function} resolve A function that resolves the promise.
  839. * @param {Function} reject A function that rejects the promise.
  840. * @param {object} response The response.
  841. */
  842. module.exports = function settle(resolve, reject, response) {
  843. var validateStatus = response.config.validateStatus;
  844. if (!validateStatus || validateStatus(response.status)) {
  845. resolve(response);
  846. } else {
  847. reject(createError(
  848. 'Request failed with status code ' + response.status,
  849. response.config,
  850. null,
  851. response.request,
  852. response
  853. ));
  854. }
  855. };
  856. /***/ }),
  857. /***/ "./node_modules/axios/lib/core/transformData.js":
  858. /*!******************************************************!*\
  859. !*** ./node_modules/axios/lib/core/transformData.js ***!
  860. \******************************************************/
  861. /*! no static exports found */
  862. /***/ (function(module, exports, __webpack_require__) {
  863. "use strict";
  864. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  865. /**
  866. * Transform the data for a request or a response
  867. *
  868. * @param {Object|String} data The data to be transformed
  869. * @param {Array} headers The headers for the request or response
  870. * @param {Array|Function} fns A single function or Array of functions
  871. * @returns {*} The resulting transformed data
  872. */
  873. module.exports = function transformData(data, headers, fns) {
  874. /*eslint no-param-reassign:0*/
  875. utils.forEach(fns, function transform(fn) {
  876. data = fn(data, headers);
  877. });
  878. return data;
  879. };
  880. /***/ }),
  881. /***/ "./node_modules/axios/lib/defaults.js":
  882. /*!********************************************!*\
  883. !*** ./node_modules/axios/lib/defaults.js ***!
  884. \********************************************/
  885. /*! no static exports found */
  886. /***/ (function(module, exports, __webpack_require__) {
  887. "use strict";
  888. /* WEBPACK VAR INJECTION */(function(process) {
  889. var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js");
  890. var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js");
  891. var DEFAULT_CONTENT_TYPE = {
  892. 'Content-Type': 'application/x-www-form-urlencoded'
  893. };
  894. function setContentTypeIfUnset(headers, value) {
  895. if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {
  896. headers['Content-Type'] = value;
  897. }
  898. }
  899. function getDefaultAdapter() {
  900. var adapter;
  901. if (typeof XMLHttpRequest !== 'undefined') {
  902. // For browsers use XHR adapter
  903. adapter = __webpack_require__(/*! ./adapters/xhr */ "./node_modules/axios/lib/adapters/xhr.js");
  904. } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {
  905. // For node use HTTP adapter
  906. adapter = __webpack_require__(/*! ./adapters/http */ "./node_modules/axios/lib/adapters/xhr.js");
  907. }
  908. return adapter;
  909. }
  910. var defaults = {
  911. adapter: getDefaultAdapter(),
  912. transformRequest: [function transformRequest(data, headers) {
  913. normalizeHeaderName(headers, 'Accept');
  914. normalizeHeaderName(headers, 'Content-Type');
  915. if (utils.isFormData(data) ||
  916. utils.isArrayBuffer(data) ||
  917. utils.isBuffer(data) ||
  918. utils.isStream(data) ||
  919. utils.isFile(data) ||
  920. utils.isBlob(data)
  921. ) {
  922. return data;
  923. }
  924. if (utils.isArrayBufferView(data)) {
  925. return data.buffer;
  926. }
  927. if (utils.isURLSearchParams(data)) {
  928. setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');
  929. return data.toString();
  930. }
  931. if (utils.isObject(data)) {
  932. setContentTypeIfUnset(headers, 'application/json;charset=utf-8');
  933. return JSON.stringify(data);
  934. }
  935. return data;
  936. }],
  937. transformResponse: [function transformResponse(data) {
  938. /*eslint no-param-reassign:0*/
  939. if (typeof data === 'string') {
  940. try {
  941. data = JSON.parse(data);
  942. } catch (e) { /* Ignore */ }
  943. }
  944. return data;
  945. }],
  946. /**
  947. * A timeout in milliseconds to abort a request. If set to 0 (default) a
  948. * timeout is not created.
  949. */
  950. timeout: 0,
  951. xsrfCookieName: 'XSRF-TOKEN',
  952. xsrfHeaderName: 'X-XSRF-TOKEN',
  953. maxContentLength: -1,
  954. validateStatus: function validateStatus(status) {
  955. return status >= 200 && status < 300;
  956. }
  957. };
  958. defaults.headers = {
  959. common: {
  960. 'Accept': 'application/json, text/plain, */*'
  961. }
  962. };
  963. utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
  964. defaults.headers[method] = {};
  965. });
  966. utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
  967. defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);
  968. });
  969. module.exports = defaults;
  970. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "./node_modules/process/browser.js")))
  971. /***/ }),
  972. /***/ "./node_modules/axios/lib/helpers/bind.js":
  973. /*!************************************************!*\
  974. !*** ./node_modules/axios/lib/helpers/bind.js ***!
  975. \************************************************/
  976. /*! no static exports found */
  977. /***/ (function(module, exports, __webpack_require__) {
  978. "use strict";
  979. module.exports = function bind(fn, thisArg) {
  980. return function wrap() {
  981. var args = new Array(arguments.length);
  982. for (var i = 0; i < args.length; i++) {
  983. args[i] = arguments[i];
  984. }
  985. return fn.apply(thisArg, args);
  986. };
  987. };
  988. /***/ }),
  989. /***/ "./node_modules/axios/lib/helpers/buildURL.js":
  990. /*!****************************************************!*\
  991. !*** ./node_modules/axios/lib/helpers/buildURL.js ***!
  992. \****************************************************/
  993. /*! no static exports found */
  994. /***/ (function(module, exports, __webpack_require__) {
  995. "use strict";
  996. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  997. function encode(val) {
  998. return encodeURIComponent(val).
  999. replace(/%40/gi, '@').
  1000. replace(/%3A/gi, ':').
  1001. replace(/%24/g, '$').
  1002. replace(/%2C/gi, ',').
  1003. replace(/%20/g, '+').
  1004. replace(/%5B/gi, '[').
  1005. replace(/%5D/gi, ']');
  1006. }
  1007. /**
  1008. * Build a URL by appending params to the end
  1009. *
  1010. * @param {string} url The base of the url (e.g., http://www.google.com)
  1011. * @param {object} [params] The params to be appended
  1012. * @returns {string} The formatted url
  1013. */
  1014. module.exports = function buildURL(url, params, paramsSerializer) {
  1015. /*eslint no-param-reassign:0*/
  1016. if (!params) {
  1017. return url;
  1018. }
  1019. var serializedParams;
  1020. if (paramsSerializer) {
  1021. serializedParams = paramsSerializer(params);
  1022. } else if (utils.isURLSearchParams(params)) {
  1023. serializedParams = params.toString();
  1024. } else {
  1025. var parts = [];
  1026. utils.forEach(params, function serialize(val, key) {
  1027. if (val === null || typeof val === 'undefined') {
  1028. return;
  1029. }
  1030. if (utils.isArray(val)) {
  1031. key = key + '[]';
  1032. } else {
  1033. val = [val];
  1034. }
  1035. utils.forEach(val, function parseValue(v) {
  1036. if (utils.isDate(v)) {
  1037. v = v.toISOString();
  1038. } else if (utils.isObject(v)) {
  1039. v = JSON.stringify(v);
  1040. }
  1041. parts.push(encode(key) + '=' + encode(v));
  1042. });
  1043. });
  1044. serializedParams = parts.join('&');
  1045. }
  1046. if (serializedParams) {
  1047. var hashmarkIndex = url.indexOf('#');
  1048. if (hashmarkIndex !== -1) {
  1049. url = url.slice(0, hashmarkIndex);
  1050. }
  1051. url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;
  1052. }
  1053. return url;
  1054. };
  1055. /***/ }),
  1056. /***/ "./node_modules/axios/lib/helpers/combineURLs.js":
  1057. /*!*******************************************************!*\
  1058. !*** ./node_modules/axios/lib/helpers/combineURLs.js ***!
  1059. \*******************************************************/
  1060. /*! no static exports found */
  1061. /***/ (function(module, exports, __webpack_require__) {
  1062. "use strict";
  1063. /**
  1064. * Creates a new URL by combining the specified URLs
  1065. *
  1066. * @param {string} baseURL The base URL
  1067. * @param {string} relativeURL The relative URL
  1068. * @returns {string} The combined URL
  1069. */
  1070. module.exports = function combineURLs(baseURL, relativeURL) {
  1071. return relativeURL
  1072. ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '')
  1073. : baseURL;
  1074. };
  1075. /***/ }),
  1076. /***/ "./node_modules/axios/lib/helpers/cookies.js":
  1077. /*!***************************************************!*\
  1078. !*** ./node_modules/axios/lib/helpers/cookies.js ***!
  1079. \***************************************************/
  1080. /*! no static exports found */
  1081. /***/ (function(module, exports, __webpack_require__) {
  1082. "use strict";
  1083. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  1084. module.exports = (
  1085. utils.isStandardBrowserEnv() ?
  1086. // Standard browser envs support document.cookie
  1087. (function standardBrowserEnv() {
  1088. return {
  1089. write: function write(name, value, expires, path, domain, secure) {
  1090. var cookie = [];
  1091. cookie.push(name + '=' + encodeURIComponent(value));
  1092. if (utils.isNumber(expires)) {
  1093. cookie.push('expires=' + new Date(expires).toGMTString());
  1094. }
  1095. if (utils.isString(path)) {
  1096. cookie.push('path=' + path);
  1097. }
  1098. if (utils.isString(domain)) {
  1099. cookie.push('domain=' + domain);
  1100. }
  1101. if (secure === true) {
  1102. cookie.push('secure');
  1103. }
  1104. document.cookie = cookie.join('; ');
  1105. },
  1106. read: function read(name) {
  1107. var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
  1108. return (match ? decodeURIComponent(match[3]) : null);
  1109. },
  1110. remove: function remove(name) {
  1111. this.write(name, '', Date.now() - 86400000);
  1112. }
  1113. };
  1114. })() :
  1115. // Non standard browser env (web workers, react-native) lack needed support.
  1116. (function nonStandardBrowserEnv() {
  1117. return {
  1118. write: function write() {},
  1119. read: function read() { return null; },
  1120. remove: function remove() {}
  1121. };
  1122. })()
  1123. );
  1124. /***/ }),
  1125. /***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js":
  1126. /*!*********************************************************!*\
  1127. !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***!
  1128. \*********************************************************/
  1129. /*! no static exports found */
  1130. /***/ (function(module, exports, __webpack_require__) {
  1131. "use strict";
  1132. /**
  1133. * Determines whether the specified URL is absolute
  1134. *
  1135. * @param {string} url The URL to test
  1136. * @returns {boolean} True if the specified URL is absolute, otherwise false
  1137. */
  1138. module.exports = function isAbsoluteURL(url) {
  1139. // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL).
  1140. // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed
  1141. // by any combination of letters, digits, plus, period, or hyphen.
  1142. return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url);
  1143. };
  1144. /***/ }),
  1145. /***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js":
  1146. /*!***********************************************************!*\
  1147. !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***!
  1148. \***********************************************************/
  1149. /*! no static exports found */
  1150. /***/ (function(module, exports, __webpack_require__) {
  1151. "use strict";
  1152. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  1153. module.exports = (
  1154. utils.isStandardBrowserEnv() ?
  1155. // Standard browser envs have full support of the APIs needed to test
  1156. // whether the request URL is of the same origin as current location.
  1157. (function standardBrowserEnv() {
  1158. var msie = /(msie|trident)/i.test(navigator.userAgent);
  1159. var urlParsingNode = document.createElement('a');
  1160. var originURL;
  1161. /**
  1162. * Parse a URL to discover it's components
  1163. *
  1164. * @param {String} url The URL to be parsed
  1165. * @returns {Object}
  1166. */
  1167. function resolveURL(url) {
  1168. var href = url;
  1169. if (msie) {
  1170. // IE needs attribute set twice to normalize properties
  1171. urlParsingNode.setAttribute('href', href);
  1172. href = urlParsingNode.href;
  1173. }
  1174. urlParsingNode.setAttribute('href', href);
  1175. // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
  1176. return {
  1177. href: urlParsingNode.href,
  1178. protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
  1179. host: urlParsingNode.host,
  1180. search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
  1181. hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
  1182. hostname: urlParsingNode.hostname,
  1183. port: urlParsingNode.port,
  1184. pathname: (urlParsingNode.pathname.charAt(0) === '/') ?
  1185. urlParsingNode.pathname :
  1186. '/' + urlParsingNode.pathname
  1187. };
  1188. }
  1189. originURL = resolveURL(window.location.href);
  1190. /**
  1191. * Determine if a URL shares the same origin as the current location
  1192. *
  1193. * @param {String} requestURL The URL to test
  1194. * @returns {boolean} True if URL shares the same origin, otherwise false
  1195. */
  1196. return function isURLSameOrigin(requestURL) {
  1197. var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;
  1198. return (parsed.protocol === originURL.protocol &&
  1199. parsed.host === originURL.host);
  1200. };
  1201. })() :
  1202. // Non standard browser envs (web workers, react-native) lack needed support.
  1203. (function nonStandardBrowserEnv() {
  1204. return function isURLSameOrigin() {
  1205. return true;
  1206. };
  1207. })()
  1208. );
  1209. /***/ }),
  1210. /***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js":
  1211. /*!***************************************************************!*\
  1212. !*** ./node_modules/axios/lib/helpers/normalizeHeaderName.js ***!
  1213. \***************************************************************/
  1214. /*! no static exports found */
  1215. /***/ (function(module, exports, __webpack_require__) {
  1216. "use strict";
  1217. var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js");
  1218. module.exports = function normalizeHeaderName(headers, normalizedName) {
  1219. utils.forEach(headers, function processHeader(value, name) {
  1220. if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {
  1221. headers[normalizedName] = value;
  1222. delete headers[name];
  1223. }
  1224. });
  1225. };
  1226. /***/ }),
  1227. /***/ "./node_modules/axios/lib/helpers/parseHeaders.js":
  1228. /*!********************************************************!*\
  1229. !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***!
  1230. \********************************************************/
  1231. /*! no static exports found */
  1232. /***/ (function(module, exports, __webpack_require__) {
  1233. "use strict";
  1234. var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js");
  1235. // Headers whose duplicates are ignored by node
  1236. // c.f. https://nodejs.org/api/http.html#http_message_headers
  1237. var ignoreDuplicateOf = [
  1238. 'age', 'authorization', 'content-length', 'content-type', 'etag',
  1239. 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',
  1240. 'last-modified', 'location', 'max-forwards', 'proxy-authorization',
  1241. 'referer', 'retry-after', 'user-agent'
  1242. ];
  1243. /**
  1244. * Parse headers into an object
  1245. *
  1246. * ```
  1247. * Date: Wed, 27 Aug 2014 08:58:49 GMT
  1248. * Content-Type: application/json
  1249. * Connection: keep-alive
  1250. * Transfer-Encoding: chunked
  1251. * ```
  1252. *
  1253. * @param {String} headers Headers needing to be parsed
  1254. * @returns {Object} Headers parsed into an object
  1255. */
  1256. module.exports = function parseHeaders(headers) {
  1257. var parsed = {};
  1258. var key;
  1259. var val;
  1260. var i;
  1261. if (!headers) { return parsed; }
  1262. utils.forEach(headers.split('\n'), function parser(line) {
  1263. i = line.indexOf(':');
  1264. key = utils.trim(line.substr(0, i)).toLowerCase();
  1265. val = utils.trim(line.substr(i + 1));
  1266. if (key) {
  1267. if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {
  1268. return;
  1269. }
  1270. if (key === 'set-cookie') {
  1271. parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);
  1272. } else {
  1273. parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
  1274. }
  1275. }
  1276. });
  1277. return parsed;
  1278. };
  1279. /***/ }),
  1280. /***/ "./node_modules/axios/lib/helpers/spread.js":
  1281. /*!**************************************************!*\
  1282. !*** ./node_modules/axios/lib/helpers/spread.js ***!
  1283. \**************************************************/
  1284. /*! no static exports found */
  1285. /***/ (function(module, exports, __webpack_require__) {
  1286. "use strict";
  1287. /**
  1288. * Syntactic sugar for invoking a function and expanding an array for arguments.
  1289. *
  1290. * Common use case would be to use `Function.prototype.apply`.
  1291. *
  1292. * ```js
  1293. * function f(x, y, z) {}
  1294. * var args = [1, 2, 3];
  1295. * f.apply(null, args);
  1296. * ```
  1297. *
  1298. * With `spread` this example can be re-written.
  1299. *
  1300. * ```js
  1301. * spread(function(x, y, z) {})([1, 2, 3]);
  1302. * ```
  1303. *
  1304. * @param {Function} callback
  1305. * @returns {Function}
  1306. */
  1307. module.exports = function spread(callback) {
  1308. return function wrap(arr) {
  1309. return callback.apply(null, arr);
  1310. };
  1311. };
  1312. /***/ }),
  1313. /***/ "./node_modules/axios/lib/utils.js":
  1314. /*!*****************************************!*\
  1315. !*** ./node_modules/axios/lib/utils.js ***!
  1316. \*****************************************/
  1317. /*! no static exports found */
  1318. /***/ (function(module, exports, __webpack_require__) {
  1319. "use strict";
  1320. var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js");
  1321. /*global toString:true*/
  1322. // utils is a library of generic helper functions non-specific to axios
  1323. var toString = Object.prototype.toString;
  1324. /**
  1325. * Determine if a value is an Array
  1326. *
  1327. * @param {Object} val The value to test
  1328. * @returns {boolean} True if value is an Array, otherwise false
  1329. */
  1330. function isArray(val) {
  1331. return toString.call(val) === '[object Array]';
  1332. }
  1333. /**
  1334. * Determine if a value is undefined
  1335. *
  1336. * @param {Object} val The value to test
  1337. * @returns {boolean} True if the value is undefined, otherwise false
  1338. */
  1339. function isUndefined(val) {
  1340. return typeof val === 'undefined';
  1341. }
  1342. /**
  1343. * Determine if a value is a Buffer
  1344. *
  1345. * @param {Object} val The value to test
  1346. * @returns {boolean} True if value is a Buffer, otherwise false
  1347. */
  1348. function isBuffer(val) {
  1349. return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)
  1350. && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);
  1351. }
  1352. /**
  1353. * Determine if a value is an ArrayBuffer
  1354. *
  1355. * @param {Object} val The value to test
  1356. * @returns {boolean} True if value is an ArrayBuffer, otherwise false
  1357. */
  1358. function isArrayBuffer(val) {
  1359. return toString.call(val) === '[object ArrayBuffer]';
  1360. }
  1361. /**
  1362. * Determine if a value is a FormData
  1363. *
  1364. * @param {Object} val The value to test
  1365. * @returns {boolean} True if value is an FormData, otherwise false
  1366. */
  1367. function isFormData(val) {
  1368. return (typeof FormData !== 'undefined') && (val instanceof FormData);
  1369. }
  1370. /**
  1371. * Determine if a value is a view on an ArrayBuffer
  1372. *
  1373. * @param {Object} val The value to test
  1374. * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false
  1375. */
  1376. function isArrayBufferView(val) {
  1377. var result;
  1378. if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {
  1379. result = ArrayBuffer.isView(val);
  1380. } else {
  1381. result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);
  1382. }
  1383. return result;
  1384. }
  1385. /**
  1386. * Determine if a value is a String
  1387. *
  1388. * @param {Object} val The value to test
  1389. * @returns {boolean} True if value is a String, otherwise false
  1390. */
  1391. function isString(val) {
  1392. return typeof val === 'string';
  1393. }
  1394. /**
  1395. * Determine if a value is a Number
  1396. *
  1397. * @param {Object} val The value to test
  1398. * @returns {boolean} True if value is a Number, otherwise false
  1399. */
  1400. function isNumber(val) {
  1401. return typeof val === 'number';
  1402. }
  1403. /**
  1404. * Determine if a value is an Object
  1405. *
  1406. * @param {Object} val The value to test
  1407. * @returns {boolean} True if value is an Object, otherwise false
  1408. */
  1409. function isObject(val) {
  1410. return val !== null && typeof val === 'object';
  1411. }
  1412. /**
  1413. * Determine if a value is a Date
  1414. *
  1415. * @param {Object} val The value to test
  1416. * @returns {boolean} True if value is a Date, otherwise false
  1417. */
  1418. function isDate(val) {
  1419. return toString.call(val) === '[object Date]';
  1420. }
  1421. /**
  1422. * Determine if a value is a File
  1423. *
  1424. * @param {Object} val The value to test
  1425. * @returns {boolean} True if value is a File, otherwise false
  1426. */
  1427. function isFile(val) {
  1428. return toString.call(val) === '[object File]';
  1429. }
  1430. /**
  1431. * Determine if a value is a Blob
  1432. *
  1433. * @param {Object} val The value to test
  1434. * @returns {boolean} True if value is a Blob, otherwise false
  1435. */
  1436. function isBlob(val) {
  1437. return toString.call(val) === '[object Blob]';
  1438. }
  1439. /**
  1440. * Determine if a value is a Function
  1441. *
  1442. * @param {Object} val The value to test
  1443. * @returns {boolean} True if value is a Function, otherwise false
  1444. */
  1445. function isFunction(val) {
  1446. return toString.call(val) === '[object Function]';
  1447. }
  1448. /**
  1449. * Determine if a value is a Stream
  1450. *
  1451. * @param {Object} val The value to test
  1452. * @returns {boolean} True if value is a Stream, otherwise false
  1453. */
  1454. function isStream(val) {
  1455. return isObject(val) && isFunction(val.pipe);
  1456. }
  1457. /**
  1458. * Determine if a value is a URLSearchParams object
  1459. *
  1460. * @param {Object} val The value to test
  1461. * @returns {boolean} True if value is a URLSearchParams object, otherwise false
  1462. */
  1463. function isURLSearchParams(val) {
  1464. return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;
  1465. }
  1466. /**
  1467. * Trim excess whitespace off the beginning and end of a string
  1468. *
  1469. * @param {String} str The String to trim
  1470. * @returns {String} The String freed of excess whitespace
  1471. */
  1472. function trim(str) {
  1473. return str.replace(/^\s*/, '').replace(/\s*$/, '');
  1474. }
  1475. /**
  1476. * Determine if we're running in a standard browser environment
  1477. *
  1478. * This allows axios to run in a web worker, and react-native.
  1479. * Both environments support XMLHttpRequest, but not fully standard globals.
  1480. *
  1481. * web workers:
  1482. * typeof window -> undefined
  1483. * typeof document -> undefined
  1484. *
  1485. * react-native:
  1486. * navigator.product -> 'ReactNative'
  1487. * nativescript
  1488. * navigator.product -> 'NativeScript' or 'NS'
  1489. */
  1490. function isStandardBrowserEnv() {
  1491. if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||
  1492. navigator.product === 'NativeScript' ||
  1493. navigator.product === 'NS')) {
  1494. return false;
  1495. }
  1496. return (
  1497. typeof window !== 'undefined' &&
  1498. typeof document !== 'undefined'
  1499. );
  1500. }
  1501. /**
  1502. * Iterate over an Array or an Object invoking a function for each item.
  1503. *
  1504. * If `obj` is an Array callback will be called passing
  1505. * the value, index, and complete array for each item.
  1506. *
  1507. * If 'obj' is an Object callback will be called passing
  1508. * the value, key, and complete object for each property.
  1509. *
  1510. * @param {Object|Array} obj The object to iterate
  1511. * @param {Function} fn The callback to invoke for each item
  1512. */
  1513. function forEach(obj, fn) {
  1514. // Don't bother if no value provided
  1515. if (obj === null || typeof obj === 'undefined') {
  1516. return;
  1517. }
  1518. // Force an array if not already something iterable
  1519. if (typeof obj !== 'object') {
  1520. /*eslint no-param-reassign:0*/
  1521. obj = [obj];
  1522. }
  1523. if (isArray(obj)) {
  1524. // Iterate over array values
  1525. for (var i = 0, l = obj.length; i < l; i++) {
  1526. fn.call(null, obj[i], i, obj);
  1527. }
  1528. } else {
  1529. // Iterate over object keys
  1530. for (var key in obj) {
  1531. if (Object.prototype.hasOwnProperty.call(obj, key)) {
  1532. fn.call(null, obj[key], key, obj);
  1533. }
  1534. }
  1535. }
  1536. }
  1537. /**
  1538. * Accepts varargs expecting each argument to be an object, then
  1539. * immutably merges the properties of each object and returns result.
  1540. *
  1541. * When multiple objects contain the same key the later object in
  1542. * the arguments list will take precedence.
  1543. *
  1544. * Example:
  1545. *
  1546. * ```js
  1547. * var result = merge({foo: 123}, {foo: 456});
  1548. * console.log(result.foo); // outputs 456
  1549. * ```
  1550. *
  1551. * @param {Object} obj1 Object to merge
  1552. * @returns {Object} Result of all merge properties
  1553. */
  1554. function merge(/* obj1, obj2, obj3, ... */) {
  1555. var result = {};
  1556. function assignValue(val, key) {
  1557. if (typeof result[key] === 'object' && typeof val === 'object') {
  1558. result[key] = merge(result[key], val);
  1559. } else {
  1560. result[key] = val;
  1561. }
  1562. }
  1563. for (var i = 0, l = arguments.length; i < l; i++) {
  1564. forEach(arguments[i], assignValue);
  1565. }
  1566. return result;
  1567. }
  1568. /**
  1569. * Function equal to merge with the difference being that no reference
  1570. * to original objects is kept.
  1571. *
  1572. * @see merge
  1573. * @param {Object} obj1 Object to merge
  1574. * @returns {Object} Result of all merge properties
  1575. */
  1576. function deepMerge(/* obj1, obj2, obj3, ... */) {
  1577. var result = {};
  1578. function assignValue(val, key) {
  1579. if (typeof result[key] === 'object' && typeof val === 'object') {
  1580. result[key] = deepMerge(result[key], val);
  1581. } else if (typeof val === 'object') {
  1582. result[key] = deepMerge({}, val);
  1583. } else {
  1584. result[key] = val;
  1585. }
  1586. }
  1587. for (var i = 0, l = arguments.length; i < l; i++) {
  1588. forEach(arguments[i], assignValue);
  1589. }
  1590. return result;
  1591. }
  1592. /**
  1593. * Extends object a by mutably adding to it the properties of object b.
  1594. *
  1595. * @param {Object} a The object to be extended
  1596. * @param {Object} b The object to copy properties from
  1597. * @param {Object} thisArg The object to bind function to
  1598. * @return {Object} The resulting value of object a
  1599. */
  1600. function extend(a, b, thisArg) {
  1601. forEach(b, function assignValue(val, key) {
  1602. if (thisArg && typeof val === 'function') {
  1603. a[key] = bind(val, thisArg);
  1604. } else {
  1605. a[key] = val;
  1606. }
  1607. });
  1608. return a;
  1609. }
  1610. module.exports = {
  1611. isArray: isArray,
  1612. isArrayBuffer: isArrayBuffer,
  1613. isBuffer: isBuffer,
  1614. isFormData: isFormData,
  1615. isArrayBufferView: isArrayBufferView,
  1616. isString: isString,
  1617. isNumber: isNumber,
  1618. isObject: isObject,
  1619. isUndefined: isUndefined,
  1620. isDate: isDate,
  1621. isFile: isFile,
  1622. isBlob: isBlob,
  1623. isFunction: isFunction,
  1624. isStream: isStream,
  1625. isURLSearchParams: isURLSearchParams,
  1626. isStandardBrowserEnv: isStandardBrowserEnv,
  1627. forEach: forEach,
  1628. merge: merge,
  1629. deepMerge: deepMerge,
  1630. extend: extend,
  1631. trim: trim
  1632. };
  1633. /***/ }),
  1634. /***/ "./node_modules/backo2/index.js":
  1635. /*!**************************************!*\
  1636. !*** ./node_modules/backo2/index.js ***!
  1637. \**************************************/
  1638. /*! no static exports found */
  1639. /***/ (function(module, exports) {
  1640. /**
  1641. * Expose `Backoff`.
  1642. */
  1643. module.exports = Backoff;
  1644. /**
  1645. * Initialize backoff timer with `opts`.
  1646. *
  1647. * - `min` initial timeout in milliseconds [100]
  1648. * - `max` max timeout [10000]
  1649. * - `jitter` [0]
  1650. * - `factor` [2]
  1651. *
  1652. * @param {Object} opts
  1653. * @api public
  1654. */
  1655. function Backoff(opts) {
  1656. opts = opts || {};
  1657. this.ms = opts.min || 100;
  1658. this.max = opts.max || 10000;
  1659. this.factor = opts.factor || 2;
  1660. this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;
  1661. this.attempts = 0;
  1662. }
  1663. /**
  1664. * Return the backoff duration.
  1665. *
  1666. * @return {Number}
  1667. * @api public
  1668. */
  1669. Backoff.prototype.duration = function(){
  1670. var ms = this.ms * Math.pow(this.factor, this.attempts++);
  1671. if (this.jitter) {
  1672. var rand = Math.random();
  1673. var deviation = Math.floor(rand * this.jitter * ms);
  1674. ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation;
  1675. }
  1676. return Math.min(ms, this.max) | 0;
  1677. };
  1678. /**
  1679. * Reset the number of attempts.
  1680. *
  1681. * @api public
  1682. */
  1683. Backoff.prototype.reset = function(){
  1684. this.attempts = 0;
  1685. };
  1686. /**
  1687. * Set the minimum duration
  1688. *
  1689. * @api public
  1690. */
  1691. Backoff.prototype.setMin = function(min){
  1692. this.ms = min;
  1693. };
  1694. /**
  1695. * Set the maximum duration
  1696. *
  1697. * @api public
  1698. */
  1699. Backoff.prototype.setMax = function(max){
  1700. this.max = max;
  1701. };
  1702. /**
  1703. * Set the jitter
  1704. *
  1705. * @api public
  1706. */
  1707. Backoff.prototype.setJitter = function(jitter){
  1708. this.jitter = jitter;
  1709. };
  1710. /***/ }),
  1711. /***/ "./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js":
  1712. /*!*******************************************************************!*\
  1713. !*** ./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js ***!
  1714. \*******************************************************************/
  1715. /*! no static exports found */
  1716. /***/ (function(module, exports) {
  1717. /*
  1718. * base64-arraybuffer
  1719. * https://github.com/niklasvh/base64-arraybuffer
  1720. *
  1721. * Copyright (c) 2012 Niklas von Hertzen
  1722. * Licensed under the MIT license.
  1723. */
  1724. (function(){
  1725. "use strict";
  1726. var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  1727. // Use a lookup table to find the index.
  1728. var lookup = new Uint8Array(256);
  1729. for (var i = 0; i < chars.length; i++) {
  1730. lookup[chars.charCodeAt(i)] = i;
  1731. }
  1732. exports.encode = function(arraybuffer) {
  1733. var bytes = new Uint8Array(arraybuffer),
  1734. i, len = bytes.length, base64 = "";
  1735. for (i = 0; i < len; i+=3) {
  1736. base64 += chars[bytes[i] >> 2];
  1737. base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];
  1738. base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];
  1739. base64 += chars[bytes[i + 2] & 63];
  1740. }
  1741. if ((len % 3) === 2) {
  1742. base64 = base64.substring(0, base64.length - 1) + "=";
  1743. } else if (len % 3 === 1) {
  1744. base64 = base64.substring(0, base64.length - 2) + "==";
  1745. }
  1746. return base64;
  1747. };
  1748. exports.decode = function(base64) {
  1749. var bufferLength = base64.length * 0.75,
  1750. len = base64.length, i, p = 0,
  1751. encoded1, encoded2, encoded3, encoded4;
  1752. if (base64[base64.length - 1] === "=") {
  1753. bufferLength--;
  1754. if (base64[base64.length - 2] === "=") {
  1755. bufferLength--;
  1756. }
  1757. }
  1758. var arraybuffer = new ArrayBuffer(bufferLength),
  1759. bytes = new Uint8Array(arraybuffer);
  1760. for (i = 0; i < len; i+=4) {
  1761. encoded1 = lookup[base64.charCodeAt(i)];
  1762. encoded2 = lookup[base64.charCodeAt(i+1)];
  1763. encoded3 = lookup[base64.charCodeAt(i+2)];
  1764. encoded4 = lookup[base64.charCodeAt(i+3)];
  1765. bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);
  1766. bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);
  1767. bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);
  1768. }
  1769. return arraybuffer;
  1770. };
  1771. })();
  1772. /***/ }),
  1773. /***/ "./node_modules/base64-js/index.js":
  1774. /*!*****************************************!*\
  1775. !*** ./node_modules/base64-js/index.js ***!
  1776. \*****************************************/
  1777. /*! no static exports found */
  1778. /***/ (function(module, exports, __webpack_require__) {
  1779. "use strict";
  1780. exports.byteLength = byteLength
  1781. exports.toByteArray = toByteArray
  1782. exports.fromByteArray = fromByteArray
  1783. var lookup = []
  1784. var revLookup = []
  1785. var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
  1786. var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
  1787. for (var i = 0, len = code.length; i < len; ++i) {
  1788. lookup[i] = code[i]
  1789. revLookup[code.charCodeAt(i)] = i
  1790. }
  1791. // Support decoding URL-safe base64 strings, as Node.js does.
  1792. // See: https://en.wikipedia.org/wiki/Base64#URL_applications
  1793. revLookup['-'.charCodeAt(0)] = 62
  1794. revLookup['_'.charCodeAt(0)] = 63
  1795. function getLens (b64) {
  1796. var len = b64.length
  1797. if (len % 4 > 0) {
  1798. throw new Error('Invalid string. Length must be a multiple of 4')
  1799. }
  1800. // Trim off extra bytes after placeholder bytes are found
  1801. // See: https://github.com/beatgammit/base64-js/issues/42
  1802. var validLen = b64.indexOf('=')
  1803. if (validLen === -1) validLen = len
  1804. var placeHoldersLen = validLen === len
  1805. ? 0
  1806. : 4 - (validLen % 4)
  1807. return [validLen, placeHoldersLen]
  1808. }
  1809. // base64 is 4/3 + up to two characters of the original data
  1810. function byteLength (b64) {
  1811. var lens = getLens(b64)
  1812. var validLen = lens[0]
  1813. var placeHoldersLen = lens[1]
  1814. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  1815. }
  1816. function _byteLength (b64, validLen, placeHoldersLen) {
  1817. return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
  1818. }
  1819. function toByteArray (b64) {
  1820. var tmp
  1821. var lens = getLens(b64)
  1822. var validLen = lens[0]
  1823. var placeHoldersLen = lens[1]
  1824. var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
  1825. var curByte = 0
  1826. // if there are placeholders, only get up to the last complete 4 chars
  1827. var len = placeHoldersLen > 0
  1828. ? validLen - 4
  1829. : validLen
  1830. var i
  1831. for (i = 0; i < len; i += 4) {
  1832. tmp =
  1833. (revLookup[b64.charCodeAt(i)] << 18) |
  1834. (revLookup[b64.charCodeAt(i + 1)] << 12) |
  1835. (revLookup[b64.charCodeAt(i + 2)] << 6) |
  1836. revLookup[b64.charCodeAt(i + 3)]
  1837. arr[curByte++] = (tmp >> 16) & 0xFF
  1838. arr[curByte++] = (tmp >> 8) & 0xFF
  1839. arr[curByte++] = tmp & 0xFF
  1840. }
  1841. if (placeHoldersLen === 2) {
  1842. tmp =
  1843. (revLookup[b64.charCodeAt(i)] << 2) |
  1844. (revLookup[b64.charCodeAt(i + 1)] >> 4)
  1845. arr[curByte++] = tmp & 0xFF
  1846. }
  1847. if (placeHoldersLen === 1) {
  1848. tmp =
  1849. (revLookup[b64.charCodeAt(i)] << 10) |
  1850. (revLookup[b64.charCodeAt(i + 1)] << 4) |
  1851. (revLookup[b64.charCodeAt(i + 2)] >> 2)
  1852. arr[curByte++] = (tmp >> 8) & 0xFF
  1853. arr[curByte++] = tmp & 0xFF
  1854. }
  1855. return arr
  1856. }
  1857. function tripletToBase64 (num) {
  1858. return lookup[num >> 18 & 0x3F] +
  1859. lookup[num >> 12 & 0x3F] +
  1860. lookup[num >> 6 & 0x3F] +
  1861. lookup[num & 0x3F]
  1862. }
  1863. function encodeChunk (uint8, start, end) {
  1864. var tmp
  1865. var output = []
  1866. for (var i = start; i < end; i += 3) {
  1867. tmp =
  1868. ((uint8[i] << 16) & 0xFF0000) +
  1869. ((uint8[i + 1] << 8) & 0xFF00) +
  1870. (uint8[i + 2] & 0xFF)
  1871. output.push(tripletToBase64(tmp))
  1872. }
  1873. return output.join('')
  1874. }
  1875. function fromByteArray (uint8) {
  1876. var tmp
  1877. var len = uint8.length
  1878. var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
  1879. var parts = []
  1880. var maxChunkLength = 16383 // must be multiple of 3
  1881. // go through the array every three bytes, we'll deal with trailing stuff later
  1882. for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  1883. parts.push(encodeChunk(
  1884. uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
  1885. ))
  1886. }
  1887. // pad the end with zeros, but make sure to not forget the extra bytes
  1888. if (extraBytes === 1) {
  1889. tmp = uint8[len - 1]
  1890. parts.push(
  1891. lookup[tmp >> 2] +
  1892. lookup[(tmp << 4) & 0x3F] +
  1893. '=='
  1894. )
  1895. } else if (extraBytes === 2) {
  1896. tmp = (uint8[len - 2] << 8) + uint8[len - 1]
  1897. parts.push(
  1898. lookup[tmp >> 10] +
  1899. lookup[(tmp >> 4) & 0x3F] +
  1900. lookup[(tmp << 2) & 0x3F] +
  1901. '='
  1902. )
  1903. }
  1904. return parts.join('')
  1905. }
  1906. /***/ }),
  1907. /***/ "./node_modules/blob/index.js":
  1908. /*!************************************!*\
  1909. !*** ./node_modules/blob/index.js ***!
  1910. \************************************/
  1911. /*! no static exports found */
  1912. /***/ (function(module, exports) {
  1913. /**
  1914. * Create a blob builder even when vendor prefixes exist
  1915. */
  1916. var BlobBuilder = typeof BlobBuilder !== 'undefined' ? BlobBuilder :
  1917. typeof WebKitBlobBuilder !== 'undefined' ? WebKitBlobBuilder :
  1918. typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder :
  1919. typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder :
  1920. false;
  1921. /**
  1922. * Check if Blob constructor is supported
  1923. */
  1924. var blobSupported = (function() {
  1925. try {
  1926. var a = new Blob(['hi']);
  1927. return a.size === 2;
  1928. } catch(e) {
  1929. return false;
  1930. }
  1931. })();
  1932. /**
  1933. * Check if Blob constructor supports ArrayBufferViews
  1934. * Fails in Safari 6, so we need to map to ArrayBuffers there.
  1935. */
  1936. var blobSupportsArrayBufferView = blobSupported && (function() {
  1937. try {
  1938. var b = new Blob([new Uint8Array([1,2])]);
  1939. return b.size === 2;
  1940. } catch(e) {
  1941. return false;
  1942. }
  1943. })();
  1944. /**
  1945. * Check if BlobBuilder is supported
  1946. */
  1947. var blobBuilderSupported = BlobBuilder
  1948. && BlobBuilder.prototype.append
  1949. && BlobBuilder.prototype.getBlob;
  1950. /**
  1951. * Helper function that maps ArrayBufferViews to ArrayBuffers
  1952. * Used by BlobBuilder constructor and old browsers that didn't
  1953. * support it in the Blob constructor.
  1954. */
  1955. function mapArrayBufferViews(ary) {
  1956. return ary.map(function(chunk) {
  1957. if (chunk.buffer instanceof ArrayBuffer) {
  1958. var buf = chunk.buffer;
  1959. // if this is a subarray, make a copy so we only
  1960. // include the subarray region from the underlying buffer
  1961. if (chunk.byteLength !== buf.byteLength) {
  1962. var copy = new Uint8Array(chunk.byteLength);
  1963. copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));
  1964. buf = copy.buffer;
  1965. }
  1966. return buf;
  1967. }
  1968. return chunk;
  1969. });
  1970. }
  1971. function BlobBuilderConstructor(ary, options) {
  1972. options = options || {};
  1973. var bb = new BlobBuilder();
  1974. mapArrayBufferViews(ary).forEach(function(part) {
  1975. bb.append(part);
  1976. });
  1977. return (options.type) ? bb.getBlob(options.type) : bb.getBlob();
  1978. };
  1979. function BlobConstructor(ary, options) {
  1980. return new Blob(mapArrayBufferViews(ary), options || {});
  1981. };
  1982. if (typeof Blob !== 'undefined') {
  1983. BlobBuilderConstructor.prototype = Blob.prototype;
  1984. BlobConstructor.prototype = Blob.prototype;
  1985. }
  1986. module.exports = (function() {
  1987. if (blobSupported) {
  1988. return blobSupportsArrayBufferView ? Blob : BlobConstructor;
  1989. } else if (blobBuilderSupported) {
  1990. return BlobBuilderConstructor;
  1991. } else {
  1992. return undefined;
  1993. }
  1994. })();
  1995. /***/ }),
  1996. /***/ "./node_modules/bootstrap-select/dist/js/bootstrap-select.js":
  1997. /*!*******************************************************************!*\
  1998. !*** ./node_modules/bootstrap-select/dist/js/bootstrap-select.js ***!
  1999. \*******************************************************************/
  2000. /*! no static exports found */
  2001. /***/ (function(module, exports, __webpack_require__) {
  2002. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  2003. * Bootstrap-select v1.13.18 (https://developer.snapappointments.com/bootstrap-select)
  2004. *
  2005. * Copyright 2012-2020 SnapAppointments, LLC
  2006. * Licensed under MIT (https://github.com/snapappointments/bootstrap-select/blob/master/LICENSE)
  2007. */
  2008. (function (root, factory) {
  2009. if (root === undefined && window !== undefined) root = window;
  2010. if (true) {
  2011. // AMD. Register as an anonymous module unless amdModuleId is set
  2012. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js")], __WEBPACK_AMD_DEFINE_RESULT__ = (function (a0) {
  2013. return (factory(a0));
  2014. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  2015. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  2016. } else {}
  2017. }(this, function (jQuery) {
  2018. (function ($) {
  2019. 'use strict';
  2020. var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
  2021. var uriAttrs = [
  2022. 'background',
  2023. 'cite',
  2024. 'href',
  2025. 'itemtype',
  2026. 'longdesc',
  2027. 'poster',
  2028. 'src',
  2029. 'xlink:href'
  2030. ];
  2031. var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
  2032. var DefaultWhitelist = {
  2033. // Global attributes allowed on any supplied element below.
  2034. '*': ['class', 'dir', 'id', 'lang', 'role', 'tabindex', 'style', ARIA_ATTRIBUTE_PATTERN],
  2035. a: ['target', 'href', 'title', 'rel'],
  2036. area: [],
  2037. b: [],
  2038. br: [],
  2039. col: [],
  2040. code: [],
  2041. div: [],
  2042. em: [],
  2043. hr: [],
  2044. h1: [],
  2045. h2: [],
  2046. h3: [],
  2047. h4: [],
  2048. h5: [],
  2049. h6: [],
  2050. i: [],
  2051. img: ['src', 'alt', 'title', 'width', 'height'],
  2052. li: [],
  2053. ol: [],
  2054. p: [],
  2055. pre: [],
  2056. s: [],
  2057. small: [],
  2058. span: [],
  2059. sub: [],
  2060. sup: [],
  2061. strong: [],
  2062. u: [],
  2063. ul: []
  2064. }
  2065. /**
  2066. * A pattern that recognizes a commonly useful subset of URLs that are safe.
  2067. *
  2068. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  2069. */
  2070. var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;
  2071. /**
  2072. * A pattern that matches safe data URLs. Only matches image, video and audio types.
  2073. *
  2074. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  2075. */
  2076. var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
  2077. function allowedAttribute (attr, allowedAttributeList) {
  2078. var attrName = attr.nodeName.toLowerCase()
  2079. if ($.inArray(attrName, allowedAttributeList) !== -1) {
  2080. if ($.inArray(attrName, uriAttrs) !== -1) {
  2081. return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN))
  2082. }
  2083. return true
  2084. }
  2085. var regExp = $(allowedAttributeList).filter(function (index, value) {
  2086. return value instanceof RegExp
  2087. })
  2088. // Check if a regular expression validates the attribute.
  2089. for (var i = 0, l = regExp.length; i < l; i++) {
  2090. if (attrName.match(regExp[i])) {
  2091. return true
  2092. }
  2093. }
  2094. return false
  2095. }
  2096. function sanitizeHtml (unsafeElements, whiteList, sanitizeFn) {
  2097. if (sanitizeFn && typeof sanitizeFn === 'function') {
  2098. return sanitizeFn(unsafeElements);
  2099. }
  2100. var whitelistKeys = Object.keys(whiteList);
  2101. for (var i = 0, len = unsafeElements.length; i < len; i++) {
  2102. var elements = unsafeElements[i].querySelectorAll('*');
  2103. for (var j = 0, len2 = elements.length; j < len2; j++) {
  2104. var el = elements[j];
  2105. var elName = el.nodeName.toLowerCase();
  2106. if (whitelistKeys.indexOf(elName) === -1) {
  2107. el.parentNode.removeChild(el);
  2108. continue;
  2109. }
  2110. var attributeList = [].slice.call(el.attributes);
  2111. var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
  2112. for (var k = 0, len3 = attributeList.length; k < len3; k++) {
  2113. var attr = attributeList[k];
  2114. if (!allowedAttribute(attr, whitelistedAttributes)) {
  2115. el.removeAttribute(attr.nodeName);
  2116. }
  2117. }
  2118. }
  2119. }
  2120. }
  2121. // Polyfill for browsers with no classList support
  2122. // Remove in v2
  2123. if (!('classList' in document.createElement('_'))) {
  2124. (function (view) {
  2125. if (!('Element' in view)) return;
  2126. var classListProp = 'classList',
  2127. protoProp = 'prototype',
  2128. elemCtrProto = view.Element[protoProp],
  2129. objCtr = Object,
  2130. classListGetter = function () {
  2131. var $elem = $(this);
  2132. return {
  2133. add: function (classes) {
  2134. classes = Array.prototype.slice.call(arguments).join(' ');
  2135. return $elem.addClass(classes);
  2136. },
  2137. remove: function (classes) {
  2138. classes = Array.prototype.slice.call(arguments).join(' ');
  2139. return $elem.removeClass(classes);
  2140. },
  2141. toggle: function (classes, force) {
  2142. return $elem.toggleClass(classes, force);
  2143. },
  2144. contains: function (classes) {
  2145. return $elem.hasClass(classes);
  2146. }
  2147. }
  2148. };
  2149. if (objCtr.defineProperty) {
  2150. var classListPropDesc = {
  2151. get: classListGetter,
  2152. enumerable: true,
  2153. configurable: true
  2154. };
  2155. try {
  2156. objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
  2157. } catch (ex) { // IE 8 doesn't support enumerable:true
  2158. // adding undefined to fight this issue https://github.com/eligrey/classList.js/issues/36
  2159. // modernie IE8-MSW7 machine has IE8 8.0.6001.18702 and is affected
  2160. if (ex.number === undefined || ex.number === -0x7FF5EC54) {
  2161. classListPropDesc.enumerable = false;
  2162. objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc);
  2163. }
  2164. }
  2165. } else if (objCtr[protoProp].__defineGetter__) {
  2166. elemCtrProto.__defineGetter__(classListProp, classListGetter);
  2167. }
  2168. }(window));
  2169. }
  2170. var testElement = document.createElement('_');
  2171. testElement.classList.add('c1', 'c2');
  2172. if (!testElement.classList.contains('c2')) {
  2173. var _add = DOMTokenList.prototype.add,
  2174. _remove = DOMTokenList.prototype.remove;
  2175. DOMTokenList.prototype.add = function () {
  2176. Array.prototype.forEach.call(arguments, _add.bind(this));
  2177. }
  2178. DOMTokenList.prototype.remove = function () {
  2179. Array.prototype.forEach.call(arguments, _remove.bind(this));
  2180. }
  2181. }
  2182. testElement.classList.toggle('c3', false);
  2183. // Polyfill for IE 10 and Firefox <24, where classList.toggle does not
  2184. // support the second argument.
  2185. if (testElement.classList.contains('c3')) {
  2186. var _toggle = DOMTokenList.prototype.toggle;
  2187. DOMTokenList.prototype.toggle = function (token, force) {
  2188. if (1 in arguments && !this.contains(token) === !force) {
  2189. return force;
  2190. } else {
  2191. return _toggle.call(this, token);
  2192. }
  2193. };
  2194. }
  2195. testElement = null;
  2196. // shallow array comparison
  2197. function isEqual (array1, array2) {
  2198. return array1.length === array2.length && array1.every(function (element, index) {
  2199. return element === array2[index];
  2200. });
  2201. };
  2202. // <editor-fold desc="Shims">
  2203. if (!String.prototype.startsWith) {
  2204. (function () {
  2205. 'use strict'; // needed to support `apply`/`call` with `undefined`/`null`
  2206. var defineProperty = (function () {
  2207. // IE 8 only supports `Object.defineProperty` on DOM elements
  2208. try {
  2209. var object = {};
  2210. var $defineProperty = Object.defineProperty;
  2211. var result = $defineProperty(object, object, object) && $defineProperty;
  2212. } catch (error) {
  2213. }
  2214. return result;
  2215. }());
  2216. var toString = {}.toString;
  2217. var startsWith = function (search) {
  2218. if (this == null) {
  2219. throw new TypeError();
  2220. }
  2221. var string = String(this);
  2222. if (search && toString.call(search) == '[object RegExp]') {
  2223. throw new TypeError();
  2224. }
  2225. var stringLength = string.length;
  2226. var searchString = String(search);
  2227. var searchLength = searchString.length;
  2228. var position = arguments.length > 1 ? arguments[1] : undefined;
  2229. // `ToInteger`
  2230. var pos = position ? Number(position) : 0;
  2231. if (pos != pos) { // better `isNaN`
  2232. pos = 0;
  2233. }
  2234. var start = Math.min(Math.max(pos, 0), stringLength);
  2235. // Avoid the `indexOf` call if no match is possible
  2236. if (searchLength + start > stringLength) {
  2237. return false;
  2238. }
  2239. var index = -1;
  2240. while (++index < searchLength) {
  2241. if (string.charCodeAt(start + index) != searchString.charCodeAt(index)) {
  2242. return false;
  2243. }
  2244. }
  2245. return true;
  2246. };
  2247. if (defineProperty) {
  2248. defineProperty(String.prototype, 'startsWith', {
  2249. 'value': startsWith,
  2250. 'configurable': true,
  2251. 'writable': true
  2252. });
  2253. } else {
  2254. String.prototype.startsWith = startsWith;
  2255. }
  2256. }());
  2257. }
  2258. if (!Object.keys) {
  2259. Object.keys = function (
  2260. o, // object
  2261. k, // key
  2262. r // result array
  2263. ) {
  2264. // initialize object and result
  2265. r = [];
  2266. // iterate over object keys
  2267. for (k in o) {
  2268. // fill result array with non-prototypical keys
  2269. r.hasOwnProperty.call(o, k) && r.push(k);
  2270. }
  2271. // return result
  2272. return r;
  2273. };
  2274. }
  2275. if (HTMLSelectElement && !HTMLSelectElement.prototype.hasOwnProperty('selectedOptions')) {
  2276. Object.defineProperty(HTMLSelectElement.prototype, 'selectedOptions', {
  2277. get: function () {
  2278. return this.querySelectorAll(':checked');
  2279. }
  2280. });
  2281. }
  2282. function getSelectedOptions (select, ignoreDisabled) {
  2283. var selectedOptions = select.selectedOptions,
  2284. options = [],
  2285. opt;
  2286. if (ignoreDisabled) {
  2287. for (var i = 0, len = selectedOptions.length; i < len; i++) {
  2288. opt = selectedOptions[i];
  2289. if (!(opt.disabled || opt.parentNode.tagName === 'OPTGROUP' && opt.parentNode.disabled)) {
  2290. options.push(opt);
  2291. }
  2292. }
  2293. return options;
  2294. }
  2295. return selectedOptions;
  2296. }
  2297. // much faster than $.val()
  2298. function getSelectValues (select, selectedOptions) {
  2299. var value = [],
  2300. options = selectedOptions || select.selectedOptions,
  2301. opt;
  2302. for (var i = 0, len = options.length; i < len; i++) {
  2303. opt = options[i];
  2304. if (!(opt.disabled || opt.parentNode.tagName === 'OPTGROUP' && opt.parentNode.disabled)) {
  2305. value.push(opt.value);
  2306. }
  2307. }
  2308. if (!select.multiple) {
  2309. return !value.length ? null : value[0];
  2310. }
  2311. return value;
  2312. }
  2313. // set data-selected on select element if the value has been programmatically selected
  2314. // prior to initialization of bootstrap-select
  2315. // * consider removing or replacing an alternative method *
  2316. var valHooks = {
  2317. useDefault: false,
  2318. _set: $.valHooks.select.set
  2319. };
  2320. $.valHooks.select.set = function (elem, value) {
  2321. if (value && !valHooks.useDefault) $(elem).data('selected', true);
  2322. return valHooks._set.apply(this, arguments);
  2323. };
  2324. var changedArguments = null;
  2325. var EventIsSupported = (function () {
  2326. try {
  2327. new Event('change');
  2328. return true;
  2329. } catch (e) {
  2330. return false;
  2331. }
  2332. })();
  2333. $.fn.triggerNative = function (eventName) {
  2334. var el = this[0],
  2335. event;
  2336. if (el.dispatchEvent) { // for modern browsers & IE9+
  2337. if (EventIsSupported) {
  2338. // For modern browsers
  2339. event = new Event(eventName, {
  2340. bubbles: true
  2341. });
  2342. } else {
  2343. // For IE since it doesn't support Event constructor
  2344. event = document.createEvent('Event');
  2345. event.initEvent(eventName, true, false);
  2346. }
  2347. el.dispatchEvent(event);
  2348. } else if (el.fireEvent) { // for IE8
  2349. event = document.createEventObject();
  2350. event.eventType = eventName;
  2351. el.fireEvent('on' + eventName, event);
  2352. } else {
  2353. // fall back to jQuery.trigger
  2354. this.trigger(eventName);
  2355. }
  2356. };
  2357. // </editor-fold>
  2358. function stringSearch (li, searchString, method, normalize) {
  2359. var stringTypes = [
  2360. 'display',
  2361. 'subtext',
  2362. 'tokens'
  2363. ],
  2364. searchSuccess = false;
  2365. for (var i = 0; i < stringTypes.length; i++) {
  2366. var stringType = stringTypes[i],
  2367. string = li[stringType];
  2368. if (string) {
  2369. string = string.toString();
  2370. // Strip HTML tags. This isn't perfect, but it's much faster than any other method
  2371. if (stringType === 'display') {
  2372. string = string.replace(/<[^>]+>/g, '');
  2373. }
  2374. if (normalize) string = normalizeToBase(string);
  2375. string = string.toUpperCase();
  2376. if (method === 'contains') {
  2377. searchSuccess = string.indexOf(searchString) >= 0;
  2378. } else {
  2379. searchSuccess = string.startsWith(searchString);
  2380. }
  2381. if (searchSuccess) break;
  2382. }
  2383. }
  2384. return searchSuccess;
  2385. }
  2386. function toInteger (value) {
  2387. return parseInt(value, 10) || 0;
  2388. }
  2389. // Borrowed from Lodash (_.deburr)
  2390. /** Used to map Latin Unicode letters to basic Latin letters. */
  2391. var deburredLetters = {
  2392. // Latin-1 Supplement block.
  2393. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  2394. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  2395. '\xc7': 'C', '\xe7': 'c',
  2396. '\xd0': 'D', '\xf0': 'd',
  2397. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  2398. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  2399. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  2400. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  2401. '\xd1': 'N', '\xf1': 'n',
  2402. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  2403. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  2404. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  2405. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  2406. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  2407. '\xc6': 'Ae', '\xe6': 'ae',
  2408. '\xde': 'Th', '\xfe': 'th',
  2409. '\xdf': 'ss',
  2410. // Latin Extended-A block.
  2411. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  2412. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  2413. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  2414. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  2415. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  2416. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  2417. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  2418. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  2419. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  2420. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  2421. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  2422. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  2423. '\u0134': 'J', '\u0135': 'j',
  2424. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  2425. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  2426. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  2427. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  2428. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  2429. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  2430. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  2431. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  2432. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  2433. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  2434. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  2435. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  2436. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  2437. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  2438. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  2439. '\u0174': 'W', '\u0175': 'w',
  2440. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  2441. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  2442. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  2443. '\u0132': 'IJ', '\u0133': 'ij',
  2444. '\u0152': 'Oe', '\u0153': 'oe',
  2445. '\u0149': "'n", '\u017f': 's'
  2446. };
  2447. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  2448. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  2449. /** Used to compose unicode character classes. */
  2450. var rsComboMarksRange = '\\u0300-\\u036f',
  2451. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  2452. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  2453. rsComboMarksExtendedRange = '\\u1ab0-\\u1aff',
  2454. rsComboMarksSupplementRange = '\\u1dc0-\\u1dff',
  2455. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange + rsComboMarksExtendedRange + rsComboMarksSupplementRange;
  2456. /** Used to compose unicode capture groups. */
  2457. var rsCombo = '[' + rsComboRange + ']';
  2458. /**
  2459. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  2460. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  2461. */
  2462. var reComboMark = RegExp(rsCombo, 'g');
  2463. function deburrLetter (key) {
  2464. return deburredLetters[key];
  2465. };
  2466. function normalizeToBase (string) {
  2467. string = string.toString();
  2468. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  2469. }
  2470. // List of HTML entities for escaping.
  2471. var escapeMap = {
  2472. '&': '&amp;',
  2473. '<': '&lt;',
  2474. '>': '&gt;',
  2475. '"': '&quot;',
  2476. "'": '&#x27;',
  2477. '`': '&#x60;'
  2478. };
  2479. // Functions for escaping and unescaping strings to/from HTML interpolation.
  2480. var createEscaper = function (map) {
  2481. var escaper = function (match) {
  2482. return map[match];
  2483. };
  2484. // Regexes for identifying a key that needs to be escaped.
  2485. var source = '(?:' + Object.keys(map).join('|') + ')';
  2486. var testRegexp = RegExp(source);
  2487. var replaceRegexp = RegExp(source, 'g');
  2488. return function (string) {
  2489. string = string == null ? '' : '' + string;
  2490. return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
  2491. };
  2492. };
  2493. var htmlEscape = createEscaper(escapeMap);
  2494. /**
  2495. * ------------------------------------------------------------------------
  2496. * Constants
  2497. * ------------------------------------------------------------------------
  2498. */
  2499. var keyCodeMap = {
  2500. 32: ' ',
  2501. 48: '0',
  2502. 49: '1',
  2503. 50: '2',
  2504. 51: '3',
  2505. 52: '4',
  2506. 53: '5',
  2507. 54: '6',
  2508. 55: '7',
  2509. 56: '8',
  2510. 57: '9',
  2511. 59: ';',
  2512. 65: 'A',
  2513. 66: 'B',
  2514. 67: 'C',
  2515. 68: 'D',
  2516. 69: 'E',
  2517. 70: 'F',
  2518. 71: 'G',
  2519. 72: 'H',
  2520. 73: 'I',
  2521. 74: 'J',
  2522. 75: 'K',
  2523. 76: 'L',
  2524. 77: 'M',
  2525. 78: 'N',
  2526. 79: 'O',
  2527. 80: 'P',
  2528. 81: 'Q',
  2529. 82: 'R',
  2530. 83: 'S',
  2531. 84: 'T',
  2532. 85: 'U',
  2533. 86: 'V',
  2534. 87: 'W',
  2535. 88: 'X',
  2536. 89: 'Y',
  2537. 90: 'Z',
  2538. 96: '0',
  2539. 97: '1',
  2540. 98: '2',
  2541. 99: '3',
  2542. 100: '4',
  2543. 101: '5',
  2544. 102: '6',
  2545. 103: '7',
  2546. 104: '8',
  2547. 105: '9'
  2548. };
  2549. var keyCodes = {
  2550. ESCAPE: 27, // KeyboardEvent.which value for Escape (Esc) key
  2551. ENTER: 13, // KeyboardEvent.which value for Enter key
  2552. SPACE: 32, // KeyboardEvent.which value for space key
  2553. TAB: 9, // KeyboardEvent.which value for tab key
  2554. ARROW_UP: 38, // KeyboardEvent.which value for up arrow key
  2555. ARROW_DOWN: 40 // KeyboardEvent.which value for down arrow key
  2556. }
  2557. var version = {
  2558. success: false,
  2559. major: '3'
  2560. };
  2561. try {
  2562. version.full = ($.fn.dropdown.Constructor.VERSION || '').split(' ')[0].split('.');
  2563. version.major = version.full[0];
  2564. version.success = true;
  2565. } catch (err) {
  2566. // do nothing
  2567. }
  2568. var selectId = 0;
  2569. var EVENT_KEY = '.bs.select';
  2570. var classNames = {
  2571. DISABLED: 'disabled',
  2572. DIVIDER: 'divider',
  2573. SHOW: 'open',
  2574. DROPUP: 'dropup',
  2575. MENU: 'dropdown-menu',
  2576. MENURIGHT: 'dropdown-menu-right',
  2577. MENULEFT: 'dropdown-menu-left',
  2578. // to-do: replace with more advanced template/customization options
  2579. BUTTONCLASS: 'btn-default',
  2580. POPOVERHEADER: 'popover-title',
  2581. ICONBASE: 'glyphicon',
  2582. TICKICON: 'glyphicon-ok'
  2583. }
  2584. var Selector = {
  2585. MENU: '.' + classNames.MENU
  2586. }
  2587. var elementTemplates = {
  2588. div: document.createElement('div'),
  2589. span: document.createElement('span'),
  2590. i: document.createElement('i'),
  2591. subtext: document.createElement('small'),
  2592. a: document.createElement('a'),
  2593. li: document.createElement('li'),
  2594. whitespace: document.createTextNode('\u00A0'),
  2595. fragment: document.createDocumentFragment()
  2596. }
  2597. elementTemplates.noResults = elementTemplates.li.cloneNode(false);
  2598. elementTemplates.noResults.className = 'no-results';
  2599. elementTemplates.a.setAttribute('role', 'option');
  2600. elementTemplates.a.className = 'dropdown-item';
  2601. elementTemplates.subtext.className = 'text-muted';
  2602. elementTemplates.text = elementTemplates.span.cloneNode(false);
  2603. elementTemplates.text.className = 'text';
  2604. elementTemplates.checkMark = elementTemplates.span.cloneNode(false);
  2605. var REGEXP_ARROW = new RegExp(keyCodes.ARROW_UP + '|' + keyCodes.ARROW_DOWN);
  2606. var REGEXP_TAB_OR_ESCAPE = new RegExp('^' + keyCodes.TAB + '$|' + keyCodes.ESCAPE);
  2607. var generateOption = {
  2608. li: function (content, classes, optgroup) {
  2609. var li = elementTemplates.li.cloneNode(false);
  2610. if (content) {
  2611. if (content.nodeType === 1 || content.nodeType === 11) {
  2612. li.appendChild(content);
  2613. } else {
  2614. li.innerHTML = content;
  2615. }
  2616. }
  2617. if (typeof classes !== 'undefined' && classes !== '') li.className = classes;
  2618. if (typeof optgroup !== 'undefined' && optgroup !== null) li.classList.add('optgroup-' + optgroup);
  2619. return li;
  2620. },
  2621. a: function (text, classes, inline) {
  2622. var a = elementTemplates.a.cloneNode(true);
  2623. if (text) {
  2624. if (text.nodeType === 11) {
  2625. a.appendChild(text);
  2626. } else {
  2627. a.insertAdjacentHTML('beforeend', text);
  2628. }
  2629. }
  2630. if (typeof classes !== 'undefined' && classes !== '') a.classList.add.apply(a.classList, classes.split(/\s+/));
  2631. if (inline) a.setAttribute('style', inline);
  2632. return a;
  2633. },
  2634. text: function (options, useFragment) {
  2635. var textElement = elementTemplates.text.cloneNode(false),
  2636. subtextElement,
  2637. iconElement;
  2638. if (options.content) {
  2639. textElement.innerHTML = options.content;
  2640. } else {
  2641. textElement.textContent = options.text;
  2642. if (options.icon) {
  2643. var whitespace = elementTemplates.whitespace.cloneNode(false);
  2644. // need to use <i> for icons in the button to prevent a breaking change
  2645. // note: switch to span in next major release
  2646. iconElement = (useFragment === true ? elementTemplates.i : elementTemplates.span).cloneNode(false);
  2647. iconElement.className = this.options.iconBase + ' ' + options.icon;
  2648. elementTemplates.fragment.appendChild(iconElement);
  2649. elementTemplates.fragment.appendChild(whitespace);
  2650. }
  2651. if (options.subtext) {
  2652. subtextElement = elementTemplates.subtext.cloneNode(false);
  2653. subtextElement.textContent = options.subtext;
  2654. textElement.appendChild(subtextElement);
  2655. }
  2656. }
  2657. if (useFragment === true) {
  2658. while (textElement.childNodes.length > 0) {
  2659. elementTemplates.fragment.appendChild(textElement.childNodes[0]);
  2660. }
  2661. } else {
  2662. elementTemplates.fragment.appendChild(textElement);
  2663. }
  2664. return elementTemplates.fragment;
  2665. },
  2666. label: function (options) {
  2667. var textElement = elementTemplates.text.cloneNode(false),
  2668. subtextElement,
  2669. iconElement;
  2670. textElement.innerHTML = options.display;
  2671. if (options.icon) {
  2672. var whitespace = elementTemplates.whitespace.cloneNode(false);
  2673. iconElement = elementTemplates.span.cloneNode(false);
  2674. iconElement.className = this.options.iconBase + ' ' + options.icon;
  2675. elementTemplates.fragment.appendChild(iconElement);
  2676. elementTemplates.fragment.appendChild(whitespace);
  2677. }
  2678. if (options.subtext) {
  2679. subtextElement = elementTemplates.subtext.cloneNode(false);
  2680. subtextElement.textContent = options.subtext;
  2681. textElement.appendChild(subtextElement);
  2682. }
  2683. elementTemplates.fragment.appendChild(textElement);
  2684. return elementTemplates.fragment;
  2685. }
  2686. }
  2687. function showNoResults (searchMatch, searchValue) {
  2688. if (!searchMatch.length) {
  2689. elementTemplates.noResults.innerHTML = this.options.noneResultsText.replace('{0}', '"' + htmlEscape(searchValue) + '"');
  2690. this.$menuInner[0].firstChild.appendChild(elementTemplates.noResults);
  2691. }
  2692. }
  2693. var Selectpicker = function (element, options) {
  2694. var that = this;
  2695. // bootstrap-select has been initialized - revert valHooks.select.set back to its original function
  2696. if (!valHooks.useDefault) {
  2697. $.valHooks.select.set = valHooks._set;
  2698. valHooks.useDefault = true;
  2699. }
  2700. this.$element = $(element);
  2701. this.$newElement = null;
  2702. this.$button = null;
  2703. this.$menu = null;
  2704. this.options = options;
  2705. this.selectpicker = {
  2706. main: {},
  2707. search: {},
  2708. current: {}, // current changes if a search is in progress
  2709. view: {},
  2710. isSearching: false,
  2711. keydown: {
  2712. keyHistory: '',
  2713. resetKeyHistory: {
  2714. start: function () {
  2715. return setTimeout(function () {
  2716. that.selectpicker.keydown.keyHistory = '';
  2717. }, 800);
  2718. }
  2719. }
  2720. }
  2721. };
  2722. this.sizeInfo = {};
  2723. // If we have no title yet, try to pull it from the html title attribute (jQuery doesnt' pick it up as it's not a
  2724. // data-attribute)
  2725. if (this.options.title === null) {
  2726. this.options.title = this.$element.attr('title');
  2727. }
  2728. // Format window padding
  2729. var winPad = this.options.windowPadding;
  2730. if (typeof winPad === 'number') {
  2731. this.options.windowPadding = [winPad, winPad, winPad, winPad];
  2732. }
  2733. // Expose public methods
  2734. this.val = Selectpicker.prototype.val;
  2735. this.render = Selectpicker.prototype.render;
  2736. this.refresh = Selectpicker.prototype.refresh;
  2737. this.setStyle = Selectpicker.prototype.setStyle;
  2738. this.selectAll = Selectpicker.prototype.selectAll;
  2739. this.deselectAll = Selectpicker.prototype.deselectAll;
  2740. this.destroy = Selectpicker.prototype.destroy;
  2741. this.remove = Selectpicker.prototype.remove;
  2742. this.show = Selectpicker.prototype.show;
  2743. this.hide = Selectpicker.prototype.hide;
  2744. this.init();
  2745. };
  2746. Selectpicker.VERSION = '1.13.18';
  2747. // part of this is duplicated in i18n/defaults-en_US.js. Make sure to update both.
  2748. Selectpicker.DEFAULTS = {
  2749. noneSelectedText: 'Nothing selected',
  2750. noneResultsText: 'No results matched {0}',
  2751. countSelectedText: function (numSelected, numTotal) {
  2752. return (numSelected == 1) ? '{0} item selected' : '{0} items selected';
  2753. },
  2754. maxOptionsText: function (numAll, numGroup) {
  2755. return [
  2756. (numAll == 1) ? 'Limit reached ({n} item max)' : 'Limit reached ({n} items max)',
  2757. (numGroup == 1) ? 'Group limit reached ({n} item max)' : 'Group limit reached ({n} items max)'
  2758. ];
  2759. },
  2760. selectAllText: 'Select All',
  2761. deselectAllText: 'Deselect All',
  2762. doneButton: false,
  2763. doneButtonText: 'Close',
  2764. multipleSeparator: ', ',
  2765. styleBase: 'btn',
  2766. style: classNames.BUTTONCLASS,
  2767. size: 'auto',
  2768. title: null,
  2769. selectedTextFormat: 'values',
  2770. width: false,
  2771. container: false,
  2772. hideDisabled: false,
  2773. showSubtext: false,
  2774. showIcon: true,
  2775. showContent: true,
  2776. dropupAuto: true,
  2777. header: false,
  2778. liveSearch: false,
  2779. liveSearchPlaceholder: null,
  2780. liveSearchNormalize: false,
  2781. liveSearchStyle: 'contains',
  2782. actionsBox: false,
  2783. iconBase: classNames.ICONBASE,
  2784. tickIcon: classNames.TICKICON,
  2785. showTick: false,
  2786. template: {
  2787. caret: '<span class="caret"></span>'
  2788. },
  2789. maxOptions: false,
  2790. mobile: false,
  2791. selectOnTab: false,
  2792. dropdownAlignRight: false,
  2793. windowPadding: 0,
  2794. virtualScroll: 600,
  2795. display: false,
  2796. sanitize: true,
  2797. sanitizeFn: null,
  2798. whiteList: DefaultWhitelist
  2799. };
  2800. Selectpicker.prototype = {
  2801. constructor: Selectpicker,
  2802. init: function () {
  2803. var that = this,
  2804. id = this.$element.attr('id'),
  2805. element = this.$element[0],
  2806. form = element.form;
  2807. selectId++;
  2808. this.selectId = 'bs-select-' + selectId;
  2809. element.classList.add('bs-select-hidden');
  2810. this.multiple = this.$element.prop('multiple');
  2811. this.autofocus = this.$element.prop('autofocus');
  2812. if (element.classList.contains('show-tick')) {
  2813. this.options.showTick = true;
  2814. }
  2815. this.$newElement = this.createDropdown();
  2816. this.buildData();
  2817. this.$element
  2818. .after(this.$newElement)
  2819. .prependTo(this.$newElement);
  2820. // ensure select is associated with form element if it got unlinked after moving it inside newElement
  2821. if (form && element.form === null) {
  2822. if (!form.id) form.id = 'form-' + this.selectId;
  2823. element.setAttribute('form', form.id);
  2824. }
  2825. this.$button = this.$newElement.children('button');
  2826. this.$menu = this.$newElement.children(Selector.MENU);
  2827. this.$menuInner = this.$menu.children('.inner');
  2828. this.$searchbox = this.$menu.find('input');
  2829. element.classList.remove('bs-select-hidden');
  2830. if (this.options.dropdownAlignRight === true) this.$menu[0].classList.add(classNames.MENURIGHT);
  2831. if (typeof id !== 'undefined') {
  2832. this.$button.attr('data-id', id);
  2833. }
  2834. this.checkDisabled();
  2835. this.clickListener();
  2836. if (this.options.liveSearch) {
  2837. this.liveSearchListener();
  2838. this.focusedParent = this.$searchbox[0];
  2839. } else {
  2840. this.focusedParent = this.$menuInner[0];
  2841. }
  2842. this.setStyle();
  2843. this.render();
  2844. this.setWidth();
  2845. if (this.options.container) {
  2846. this.selectPosition();
  2847. } else {
  2848. this.$element.on('hide' + EVENT_KEY, function () {
  2849. if (that.isVirtual()) {
  2850. // empty menu on close
  2851. var menuInner = that.$menuInner[0],
  2852. emptyMenu = menuInner.firstChild.cloneNode(false);
  2853. // replace the existing UL with an empty one - this is faster than $.empty() or innerHTML = ''
  2854. menuInner.replaceChild(emptyMenu, menuInner.firstChild);
  2855. menuInner.scrollTop = 0;
  2856. }
  2857. });
  2858. }
  2859. this.$menu.data('this', this);
  2860. this.$newElement.data('this', this);
  2861. if (this.options.mobile) this.mobile();
  2862. this.$newElement.on({
  2863. 'hide.bs.dropdown': function (e) {
  2864. that.$element.trigger('hide' + EVENT_KEY, e);
  2865. },
  2866. 'hidden.bs.dropdown': function (e) {
  2867. that.$element.trigger('hidden' + EVENT_KEY, e);
  2868. },
  2869. 'show.bs.dropdown': function (e) {
  2870. that.$element.trigger('show' + EVENT_KEY, e);
  2871. },
  2872. 'shown.bs.dropdown': function (e) {
  2873. that.$element.trigger('shown' + EVENT_KEY, e);
  2874. }
  2875. });
  2876. if (element.hasAttribute('required')) {
  2877. this.$element.on('invalid' + EVENT_KEY, function () {
  2878. that.$button[0].classList.add('bs-invalid');
  2879. that.$element
  2880. .on('shown' + EVENT_KEY + '.invalid', function () {
  2881. that.$element
  2882. .val(that.$element.val()) // set the value to hide the validation message in Chrome when menu is opened
  2883. .off('shown' + EVENT_KEY + '.invalid');
  2884. })
  2885. .on('rendered' + EVENT_KEY, function () {
  2886. // if select is no longer invalid, remove the bs-invalid class
  2887. if (this.validity.valid) that.$button[0].classList.remove('bs-invalid');
  2888. that.$element.off('rendered' + EVENT_KEY);
  2889. });
  2890. that.$button.on('blur' + EVENT_KEY, function () {
  2891. that.$element.trigger('focus').trigger('blur');
  2892. that.$button.off('blur' + EVENT_KEY);
  2893. });
  2894. });
  2895. }
  2896. setTimeout(function () {
  2897. that.buildList();
  2898. that.$element.trigger('loaded' + EVENT_KEY);
  2899. });
  2900. },
  2901. createDropdown: function () {
  2902. // Options
  2903. // If we are multiple or showTick option is set, then add the show-tick class
  2904. var showTick = (this.multiple || this.options.showTick) ? ' show-tick' : '',
  2905. multiselectable = this.multiple ? ' aria-multiselectable="true"' : '',
  2906. inputGroup = '',
  2907. autofocus = this.autofocus ? ' autofocus' : '';
  2908. if (version.major < 4 && this.$element.parent().hasClass('input-group')) {
  2909. inputGroup = ' input-group-btn';
  2910. }
  2911. // Elements
  2912. var drop,
  2913. header = '',
  2914. searchbox = '',
  2915. actionsbox = '',
  2916. donebutton = '';
  2917. if (this.options.header) {
  2918. header =
  2919. '<div class="' + classNames.POPOVERHEADER + '">' +
  2920. '<button type="button" class="close" aria-hidden="true">&times;</button>' +
  2921. this.options.header +
  2922. '</div>';
  2923. }
  2924. if (this.options.liveSearch) {
  2925. searchbox =
  2926. '<div class="bs-searchbox">' +
  2927. '<input type="search" class="form-control" autocomplete="off"' +
  2928. (
  2929. this.options.liveSearchPlaceholder === null ? ''
  2930. :
  2931. ' placeholder="' + htmlEscape(this.options.liveSearchPlaceholder) + '"'
  2932. ) +
  2933. ' role="combobox" aria-label="Search" aria-controls="' + this.selectId + '" aria-autocomplete="list">' +
  2934. '</div>';
  2935. }
  2936. if (this.multiple && this.options.actionsBox) {
  2937. actionsbox =
  2938. '<div class="bs-actionsbox">' +
  2939. '<div class="btn-group btn-group-sm btn-block">' +
  2940. '<button type="button" class="actions-btn bs-select-all btn ' + classNames.BUTTONCLASS + '">' +
  2941. this.options.selectAllText +
  2942. '</button>' +
  2943. '<button type="button" class="actions-btn bs-deselect-all btn ' + classNames.BUTTONCLASS + '">' +
  2944. this.options.deselectAllText +
  2945. '</button>' +
  2946. '</div>' +
  2947. '</div>';
  2948. }
  2949. if (this.multiple && this.options.doneButton) {
  2950. donebutton =
  2951. '<div class="bs-donebutton">' +
  2952. '<div class="btn-group btn-block">' +
  2953. '<button type="button" class="btn btn-sm ' + classNames.BUTTONCLASS + '">' +
  2954. this.options.doneButtonText +
  2955. '</button>' +
  2956. '</div>' +
  2957. '</div>';
  2958. }
  2959. drop =
  2960. '<div class="dropdown bootstrap-select' + showTick + inputGroup + '">' +
  2961. '<button type="button" tabindex="-1" class="' + this.options.styleBase + ' dropdown-toggle" ' + (this.options.display === 'static' ? 'data-display="static"' : '') + 'data-toggle="dropdown"' + autofocus + ' role="combobox" aria-owns="' + this.selectId + '" aria-haspopup="listbox" aria-expanded="false">' +
  2962. '<div class="filter-option">' +
  2963. '<div class="filter-option-inner">' +
  2964. '<div class="filter-option-inner-inner"></div>' +
  2965. '</div> ' +
  2966. '</div>' +
  2967. (
  2968. version.major === '4' ? ''
  2969. :
  2970. '<span class="bs-caret">' +
  2971. this.options.template.caret +
  2972. '</span>'
  2973. ) +
  2974. '</button>' +
  2975. '<div class="' + classNames.MENU + ' ' + (version.major === '4' ? '' : classNames.SHOW) + '">' +
  2976. header +
  2977. searchbox +
  2978. actionsbox +
  2979. '<div class="inner ' + classNames.SHOW + '" role="listbox" id="' + this.selectId + '" tabindex="-1" ' + multiselectable + '>' +
  2980. '<ul class="' + classNames.MENU + ' inner ' + (version.major === '4' ? classNames.SHOW : '') + '" role="presentation">' +
  2981. '</ul>' +
  2982. '</div>' +
  2983. donebutton +
  2984. '</div>' +
  2985. '</div>';
  2986. return $(drop);
  2987. },
  2988. setPositionData: function () {
  2989. this.selectpicker.view.canHighlight = [];
  2990. this.selectpicker.view.size = 0;
  2991. this.selectpicker.view.firstHighlightIndex = false;
  2992. for (var i = 0; i < this.selectpicker.current.data.length; i++) {
  2993. var li = this.selectpicker.current.data[i],
  2994. canHighlight = true;
  2995. if (li.type === 'divider') {
  2996. canHighlight = false;
  2997. li.height = this.sizeInfo.dividerHeight;
  2998. } else if (li.type === 'optgroup-label') {
  2999. canHighlight = false;
  3000. li.height = this.sizeInfo.dropdownHeaderHeight;
  3001. } else {
  3002. li.height = this.sizeInfo.liHeight;
  3003. }
  3004. if (li.disabled) canHighlight = false;
  3005. this.selectpicker.view.canHighlight.push(canHighlight);
  3006. if (canHighlight) {
  3007. this.selectpicker.view.size++;
  3008. li.posinset = this.selectpicker.view.size;
  3009. if (this.selectpicker.view.firstHighlightIndex === false) this.selectpicker.view.firstHighlightIndex = i;
  3010. }
  3011. li.position = (i === 0 ? 0 : this.selectpicker.current.data[i - 1].position) + li.height;
  3012. }
  3013. },
  3014. isVirtual: function () {
  3015. return (this.options.virtualScroll !== false) && (this.selectpicker.main.elements.length >= this.options.virtualScroll) || this.options.virtualScroll === true;
  3016. },
  3017. createView: function (isSearching, setSize, refresh) {
  3018. var that = this,
  3019. scrollTop = 0,
  3020. active = [],
  3021. selected,
  3022. prevActive;
  3023. this.selectpicker.isSearching = isSearching;
  3024. this.selectpicker.current = isSearching ? this.selectpicker.search : this.selectpicker.main;
  3025. this.setPositionData();
  3026. if (setSize) {
  3027. if (refresh) {
  3028. scrollTop = this.$menuInner[0].scrollTop;
  3029. } else if (!that.multiple) {
  3030. var element = that.$element[0],
  3031. selectedIndex = (element.options[element.selectedIndex] || {}).liIndex;
  3032. if (typeof selectedIndex === 'number' && that.options.size !== false) {
  3033. var selectedData = that.selectpicker.main.data[selectedIndex],
  3034. position = selectedData && selectedData.position;
  3035. if (position) {
  3036. scrollTop = position - ((that.sizeInfo.menuInnerHeight + that.sizeInfo.liHeight) / 2);
  3037. }
  3038. }
  3039. }
  3040. }
  3041. scroll(scrollTop, true);
  3042. this.$menuInner.off('scroll.createView').on('scroll.createView', function (e, updateValue) {
  3043. if (!that.noScroll) scroll(this.scrollTop, updateValue);
  3044. that.noScroll = false;
  3045. });
  3046. function scroll (scrollTop, init) {
  3047. var size = that.selectpicker.current.elements.length,
  3048. chunks = [],
  3049. chunkSize,
  3050. chunkCount,
  3051. firstChunk,
  3052. lastChunk,
  3053. currentChunk,
  3054. prevPositions,
  3055. positionIsDifferent,
  3056. previousElements,
  3057. menuIsDifferent = true,
  3058. isVirtual = that.isVirtual();
  3059. that.selectpicker.view.scrollTop = scrollTop;
  3060. chunkSize = Math.ceil(that.sizeInfo.menuInnerHeight / that.sizeInfo.liHeight * 1.5); // number of options in a chunk
  3061. chunkCount = Math.round(size / chunkSize) || 1; // number of chunks
  3062. for (var i = 0; i < chunkCount; i++) {
  3063. var endOfChunk = (i + 1) * chunkSize;
  3064. if (i === chunkCount - 1) {
  3065. endOfChunk = size;
  3066. }
  3067. chunks[i] = [
  3068. (i) * chunkSize + (!i ? 0 : 1),
  3069. endOfChunk
  3070. ];
  3071. if (!size) break;
  3072. if (currentChunk === undefined && scrollTop - 1 <= that.selectpicker.current.data[endOfChunk - 1].position - that.sizeInfo.menuInnerHeight) {
  3073. currentChunk = i;
  3074. }
  3075. }
  3076. if (currentChunk === undefined) currentChunk = 0;
  3077. prevPositions = [that.selectpicker.view.position0, that.selectpicker.view.position1];
  3078. // always display previous, current, and next chunks
  3079. firstChunk = Math.max(0, currentChunk - 1);
  3080. lastChunk = Math.min(chunkCount - 1, currentChunk + 1);
  3081. that.selectpicker.view.position0 = isVirtual === false ? 0 : (Math.max(0, chunks[firstChunk][0]) || 0);
  3082. that.selectpicker.view.position1 = isVirtual === false ? size : (Math.min(size, chunks[lastChunk][1]) || 0);
  3083. positionIsDifferent = prevPositions[0] !== that.selectpicker.view.position0 || prevPositions[1] !== that.selectpicker.view.position1;
  3084. if (that.activeIndex !== undefined) {
  3085. prevActive = that.selectpicker.main.elements[that.prevActiveIndex];
  3086. active = that.selectpicker.main.elements[that.activeIndex];
  3087. selected = that.selectpicker.main.elements[that.selectedIndex];
  3088. if (init) {
  3089. if (that.activeIndex !== that.selectedIndex) {
  3090. that.defocusItem(active);
  3091. }
  3092. that.activeIndex = undefined;
  3093. }
  3094. if (that.activeIndex && that.activeIndex !== that.selectedIndex) {
  3095. that.defocusItem(selected);
  3096. }
  3097. }
  3098. if (that.prevActiveIndex !== undefined && that.prevActiveIndex !== that.activeIndex && that.prevActiveIndex !== that.selectedIndex) {
  3099. that.defocusItem(prevActive);
  3100. }
  3101. if (init || positionIsDifferent) {
  3102. previousElements = that.selectpicker.view.visibleElements ? that.selectpicker.view.visibleElements.slice() : [];
  3103. if (isVirtual === false) {
  3104. that.selectpicker.view.visibleElements = that.selectpicker.current.elements;
  3105. } else {
  3106. that.selectpicker.view.visibleElements = that.selectpicker.current.elements.slice(that.selectpicker.view.position0, that.selectpicker.view.position1);
  3107. }
  3108. that.setOptionStatus();
  3109. // if searching, check to make sure the list has actually been updated before updating DOM
  3110. // this prevents unnecessary repaints
  3111. if (isSearching || (isVirtual === false && init)) menuIsDifferent = !isEqual(previousElements, that.selectpicker.view.visibleElements);
  3112. // if virtual scroll is disabled and not searching,
  3113. // menu should never need to be updated more than once
  3114. if ((init || isVirtual === true) && menuIsDifferent) {
  3115. var menuInner = that.$menuInner[0],
  3116. menuFragment = document.createDocumentFragment(),
  3117. emptyMenu = menuInner.firstChild.cloneNode(false),
  3118. marginTop,
  3119. marginBottom,
  3120. elements = that.selectpicker.view.visibleElements,
  3121. toSanitize = [];
  3122. // replace the existing UL with an empty one - this is faster than $.empty()
  3123. menuInner.replaceChild(emptyMenu, menuInner.firstChild);
  3124. for (var i = 0, visibleElementsLen = elements.length; i < visibleElementsLen; i++) {
  3125. var element = elements[i],
  3126. elText,
  3127. elementData;
  3128. if (that.options.sanitize) {
  3129. elText = element.lastChild;
  3130. if (elText) {
  3131. elementData = that.selectpicker.current.data[i + that.selectpicker.view.position0];
  3132. if (elementData && elementData.content && !elementData.sanitized) {
  3133. toSanitize.push(elText);
  3134. elementData.sanitized = true;
  3135. }
  3136. }
  3137. }
  3138. menuFragment.appendChild(element);
  3139. }
  3140. if (that.options.sanitize && toSanitize.length) {
  3141. sanitizeHtml(toSanitize, that.options.whiteList, that.options.sanitizeFn);
  3142. }
  3143. if (isVirtual === true) {
  3144. marginTop = (that.selectpicker.view.position0 === 0 ? 0 : that.selectpicker.current.data[that.selectpicker.view.position0 - 1].position);
  3145. marginBottom = (that.selectpicker.view.position1 > size - 1 ? 0 : that.selectpicker.current.data[size - 1].position - that.selectpicker.current.data[that.selectpicker.view.position1 - 1].position);
  3146. menuInner.firstChild.style.marginTop = marginTop + 'px';
  3147. menuInner.firstChild.style.marginBottom = marginBottom + 'px';
  3148. } else {
  3149. menuInner.firstChild.style.marginTop = 0;
  3150. menuInner.firstChild.style.marginBottom = 0;
  3151. }
  3152. menuInner.firstChild.appendChild(menuFragment);
  3153. // if an option is encountered that is wider than the current menu width, update the menu width accordingly
  3154. // switch to ResizeObserver with increased browser support
  3155. if (isVirtual === true && that.sizeInfo.hasScrollBar) {
  3156. var menuInnerInnerWidth = menuInner.firstChild.offsetWidth;
  3157. if (init && menuInnerInnerWidth < that.sizeInfo.menuInnerInnerWidth && that.sizeInfo.totalMenuWidth > that.sizeInfo.selectWidth) {
  3158. menuInner.firstChild.style.minWidth = that.sizeInfo.menuInnerInnerWidth + 'px';
  3159. } else if (menuInnerInnerWidth > that.sizeInfo.menuInnerInnerWidth) {
  3160. // set to 0 to get actual width of menu
  3161. that.$menu[0].style.minWidth = 0;
  3162. var actualMenuWidth = menuInner.firstChild.offsetWidth;
  3163. if (actualMenuWidth > that.sizeInfo.menuInnerInnerWidth) {
  3164. that.sizeInfo.menuInnerInnerWidth = actualMenuWidth;
  3165. menuInner.firstChild.style.minWidth = that.sizeInfo.menuInnerInnerWidth + 'px';
  3166. }
  3167. // reset to default CSS styling
  3168. that.$menu[0].style.minWidth = '';
  3169. }
  3170. }
  3171. }
  3172. }
  3173. that.prevActiveIndex = that.activeIndex;
  3174. if (!that.options.liveSearch) {
  3175. that.$menuInner.trigger('focus');
  3176. } else if (isSearching && init) {
  3177. var index = 0,
  3178. newActive;
  3179. if (!that.selectpicker.view.canHighlight[index]) {
  3180. index = 1 + that.selectpicker.view.canHighlight.slice(1).indexOf(true);
  3181. }
  3182. newActive = that.selectpicker.view.visibleElements[index];
  3183. that.defocusItem(that.selectpicker.view.currentActive);
  3184. that.activeIndex = (that.selectpicker.current.data[index] || {}).index;
  3185. that.focusItem(newActive);
  3186. }
  3187. }
  3188. $(window)
  3189. .off('resize' + EVENT_KEY + '.' + this.selectId + '.createView')
  3190. .on('resize' + EVENT_KEY + '.' + this.selectId + '.createView', function () {
  3191. var isActive = that.$newElement.hasClass(classNames.SHOW);
  3192. if (isActive) scroll(that.$menuInner[0].scrollTop);
  3193. });
  3194. },
  3195. focusItem: function (li, liData, noStyle) {
  3196. if (li) {
  3197. liData = liData || this.selectpicker.main.data[this.activeIndex];
  3198. var a = li.firstChild;
  3199. if (a) {
  3200. a.setAttribute('aria-setsize', this.selectpicker.view.size);
  3201. a.setAttribute('aria-posinset', liData.posinset);
  3202. if (noStyle !== true) {
  3203. this.focusedParent.setAttribute('aria-activedescendant', a.id);
  3204. li.classList.add('active');
  3205. a.classList.add('active');
  3206. }
  3207. }
  3208. }
  3209. },
  3210. defocusItem: function (li) {
  3211. if (li) {
  3212. li.classList.remove('active');
  3213. if (li.firstChild) li.firstChild.classList.remove('active');
  3214. }
  3215. },
  3216. setPlaceholder: function () {
  3217. var that = this,
  3218. updateIndex = false;
  3219. if (this.options.title && !this.multiple) {
  3220. if (!this.selectpicker.view.titleOption) this.selectpicker.view.titleOption = document.createElement('option');
  3221. // this option doesn't create a new <li> element, but does add a new option at the start,
  3222. // so startIndex should increase to prevent having to check every option for the bs-title-option class
  3223. updateIndex = true;
  3224. var element = this.$element[0],
  3225. selectTitleOption = false,
  3226. titleNotAppended = !this.selectpicker.view.titleOption.parentNode,
  3227. selectedIndex = element.selectedIndex,
  3228. selectedOption = element.options[selectedIndex],
  3229. navigation = window.performance && window.performance.getEntriesByType('navigation'),
  3230. // Safari doesn't support getEntriesByType('navigation') - fall back to performance.navigation
  3231. isNotBackForward = (navigation && navigation.length) ? navigation[0].type !== 'back_forward' : window.performance.navigation.type !== 2;
  3232. if (titleNotAppended) {
  3233. // Use native JS to prepend option (faster)
  3234. this.selectpicker.view.titleOption.className = 'bs-title-option';
  3235. this.selectpicker.view.titleOption.value = '';
  3236. // Check if selected or data-selected attribute is already set on an option. If not, select the titleOption option.
  3237. // the selected item may have been changed by user or programmatically before the bootstrap select plugin runs,
  3238. // if so, the select will have the data-selected attribute
  3239. selectTitleOption = !selectedOption || (selectedIndex === 0 && selectedOption.defaultSelected === false && this.$element.data('selected') === undefined);
  3240. }
  3241. if (titleNotAppended || this.selectpicker.view.titleOption.index !== 0) {
  3242. element.insertBefore(this.selectpicker.view.titleOption, element.firstChild);
  3243. }
  3244. // Set selected *after* appending to select,
  3245. // otherwise the option doesn't get selected in IE
  3246. // set using selectedIndex, as setting the selected attr to true here doesn't work in IE11
  3247. if (selectTitleOption && isNotBackForward) {
  3248. element.selectedIndex = 0;
  3249. } else if (document.readyState !== 'complete') {
  3250. // if navigation type is back_forward, there's a chance the select will have its value set by BFCache
  3251. // wait for that value to be set, then run render again
  3252. window.addEventListener('pageshow', function () {
  3253. if (that.selectpicker.view.displayedValue !== element.value) that.render();
  3254. });
  3255. }
  3256. }
  3257. return updateIndex;
  3258. },
  3259. buildData: function () {
  3260. var optionSelector = ':not([hidden]):not([data-hidden="true"])',
  3261. mainData = [],
  3262. optID = 0,
  3263. startIndex = this.setPlaceholder() ? 1 : 0; // append the titleOption if necessary and skip the first option in the loop
  3264. if (this.options.hideDisabled) optionSelector += ':not(:disabled)';
  3265. var selectOptions = this.$element[0].querySelectorAll('select > *' + optionSelector);
  3266. function addDivider (config) {
  3267. var previousData = mainData[mainData.length - 1];
  3268. // ensure optgroup doesn't create back-to-back dividers
  3269. if (
  3270. previousData &&
  3271. previousData.type === 'divider' &&
  3272. (previousData.optID || config.optID)
  3273. ) {
  3274. return;
  3275. }
  3276. config = config || {};
  3277. config.type = 'divider';
  3278. mainData.push(config);
  3279. }
  3280. function addOption (option, config) {
  3281. config = config || {};
  3282. config.divider = option.getAttribute('data-divider') === 'true';
  3283. if (config.divider) {
  3284. addDivider({
  3285. optID: config.optID
  3286. });
  3287. } else {
  3288. var liIndex = mainData.length,
  3289. cssText = option.style.cssText,
  3290. inlineStyle = cssText ? htmlEscape(cssText) : '',
  3291. optionClass = (option.className || '') + (config.optgroupClass || '');
  3292. if (config.optID) optionClass = 'opt ' + optionClass;
  3293. config.optionClass = optionClass.trim();
  3294. config.inlineStyle = inlineStyle;
  3295. config.text = option.textContent;
  3296. config.content = option.getAttribute('data-content');
  3297. config.tokens = option.getAttribute('data-tokens');
  3298. config.subtext = option.getAttribute('data-subtext');
  3299. config.icon = option.getAttribute('data-icon');
  3300. option.liIndex = liIndex;
  3301. config.display = config.content || config.text;
  3302. config.type = 'option';
  3303. config.index = liIndex;
  3304. config.option = option;
  3305. config.selected = !!option.selected;
  3306. config.disabled = config.disabled || !!option.disabled;
  3307. mainData.push(config);
  3308. }
  3309. }
  3310. function addOptgroup (index, selectOptions) {
  3311. var optgroup = selectOptions[index],
  3312. // skip placeholder option
  3313. previous = index - 1 < startIndex ? false : selectOptions[index - 1],
  3314. next = selectOptions[index + 1],
  3315. options = optgroup.querySelectorAll('option' + optionSelector);
  3316. if (!options.length) return;
  3317. var config = {
  3318. display: htmlEscape(optgroup.label),
  3319. subtext: optgroup.getAttribute('data-subtext'),
  3320. icon: optgroup.getAttribute('data-icon'),
  3321. type: 'optgroup-label',
  3322. optgroupClass: ' ' + (optgroup.className || '')
  3323. },
  3324. headerIndex,
  3325. lastIndex;
  3326. optID++;
  3327. if (previous) {
  3328. addDivider({ optID: optID });
  3329. }
  3330. config.optID = optID;
  3331. mainData.push(config);
  3332. for (var j = 0, len = options.length; j < len; j++) {
  3333. var option = options[j];
  3334. if (j === 0) {
  3335. headerIndex = mainData.length - 1;
  3336. lastIndex = headerIndex + len;
  3337. }
  3338. addOption(option, {
  3339. headerIndex: headerIndex,
  3340. lastIndex: lastIndex,
  3341. optID: config.optID,
  3342. optgroupClass: config.optgroupClass,
  3343. disabled: optgroup.disabled
  3344. });
  3345. }
  3346. if (next) {
  3347. addDivider({ optID: optID });
  3348. }
  3349. }
  3350. for (var len = selectOptions.length, i = startIndex; i < len; i++) {
  3351. var item = selectOptions[i];
  3352. if (item.tagName !== 'OPTGROUP') {
  3353. addOption(item, {});
  3354. } else {
  3355. addOptgroup(i, selectOptions);
  3356. }
  3357. }
  3358. this.selectpicker.main.data = this.selectpicker.current.data = mainData;
  3359. },
  3360. buildList: function () {
  3361. var that = this,
  3362. selectData = this.selectpicker.main.data,
  3363. mainElements = [],
  3364. widestOptionLength = 0;
  3365. if ((that.options.showTick || that.multiple) && !elementTemplates.checkMark.parentNode) {
  3366. elementTemplates.checkMark.className = this.options.iconBase + ' ' + that.options.tickIcon + ' check-mark';
  3367. elementTemplates.a.appendChild(elementTemplates.checkMark);
  3368. }
  3369. function buildElement (item) {
  3370. var liElement,
  3371. combinedLength = 0;
  3372. switch (item.type) {
  3373. case 'divider':
  3374. liElement = generateOption.li(
  3375. false,
  3376. classNames.DIVIDER,
  3377. (item.optID ? item.optID + 'div' : undefined)
  3378. );
  3379. break;
  3380. case 'option':
  3381. liElement = generateOption.li(
  3382. generateOption.a(
  3383. generateOption.text.call(that, item),
  3384. item.optionClass,
  3385. item.inlineStyle
  3386. ),
  3387. '',
  3388. item.optID
  3389. );
  3390. if (liElement.firstChild) {
  3391. liElement.firstChild.id = that.selectId + '-' + item.index;
  3392. }
  3393. break;
  3394. case 'optgroup-label':
  3395. liElement = generateOption.li(
  3396. generateOption.label.call(that, item),
  3397. 'dropdown-header' + item.optgroupClass,
  3398. item.optID
  3399. );
  3400. break;
  3401. }
  3402. item.element = liElement;
  3403. mainElements.push(liElement);
  3404. // count the number of characters in the option - not perfect, but should work in most cases
  3405. if (item.display) combinedLength += item.display.length;
  3406. if (item.subtext) combinedLength += item.subtext.length;
  3407. // if there is an icon, ensure this option's width is checked
  3408. if (item.icon) combinedLength += 1;
  3409. if (combinedLength > widestOptionLength) {
  3410. widestOptionLength = combinedLength;
  3411. // guess which option is the widest
  3412. // use this when calculating menu width
  3413. // not perfect, but it's fast, and the width will be updating accordingly when scrolling
  3414. that.selectpicker.view.widestOption = mainElements[mainElements.length - 1];
  3415. }
  3416. }
  3417. for (var len = selectData.length, i = 0; i < len; i++) {
  3418. var item = selectData[i];
  3419. buildElement(item);
  3420. }
  3421. this.selectpicker.main.elements = this.selectpicker.current.elements = mainElements;
  3422. },
  3423. findLis: function () {
  3424. return this.$menuInner.find('.inner > li');
  3425. },
  3426. render: function () {
  3427. var that = this,
  3428. element = this.$element[0],
  3429. // ensure titleOption is appended and selected (if necessary) before getting selectedOptions
  3430. placeholderSelected = this.setPlaceholder() && element.selectedIndex === 0,
  3431. selectedOptions = getSelectedOptions(element, this.options.hideDisabled),
  3432. selectedCount = selectedOptions.length,
  3433. button = this.$button[0],
  3434. buttonInner = button.querySelector('.filter-option-inner-inner'),
  3435. multipleSeparator = document.createTextNode(this.options.multipleSeparator),
  3436. titleFragment = elementTemplates.fragment.cloneNode(false),
  3437. showCount,
  3438. countMax,
  3439. hasContent = false;
  3440. button.classList.toggle('bs-placeholder', that.multiple ? !selectedCount : !getSelectValues(element, selectedOptions));
  3441. if (!that.multiple && selectedOptions.length === 1) {
  3442. that.selectpicker.view.displayedValue = getSelectValues(element, selectedOptions);
  3443. }
  3444. if (this.options.selectedTextFormat === 'static') {
  3445. titleFragment = generateOption.text.call(this, { text: this.options.title }, true);
  3446. } else {
  3447. showCount = this.multiple && this.options.selectedTextFormat.indexOf('count') !== -1 && selectedCount > 1;
  3448. // determine if the number of selected options will be shown (showCount === true)
  3449. if (showCount) {
  3450. countMax = this.options.selectedTextFormat.split('>');
  3451. showCount = (countMax.length > 1 && selectedCount > countMax[1]) || (countMax.length === 1 && selectedCount >= 2);
  3452. }
  3453. // only loop through all selected options if the count won't be shown
  3454. if (showCount === false) {
  3455. if (!placeholderSelected) {
  3456. for (var selectedIndex = 0; selectedIndex < selectedCount; selectedIndex++) {
  3457. if (selectedIndex < 50) {
  3458. var option = selectedOptions[selectedIndex],
  3459. thisData = this.selectpicker.main.data[option.liIndex],
  3460. titleOptions = {};
  3461. if (this.multiple && selectedIndex > 0) {
  3462. titleFragment.appendChild(multipleSeparator.cloneNode(false));
  3463. }
  3464. if (option.title) {
  3465. titleOptions.text = option.title;
  3466. } else if (thisData) {
  3467. if (thisData.content && that.options.showContent) {
  3468. titleOptions.content = thisData.content.toString();
  3469. hasContent = true;
  3470. } else {
  3471. if (that.options.showIcon) {
  3472. titleOptions.icon = thisData.icon;
  3473. }
  3474. if (that.options.showSubtext && !that.multiple && thisData.subtext) titleOptions.subtext = ' ' + thisData.subtext;
  3475. titleOptions.text = option.textContent.trim();
  3476. }
  3477. }
  3478. titleFragment.appendChild(generateOption.text.call(this, titleOptions, true));
  3479. } else {
  3480. break;
  3481. }
  3482. }
  3483. // add ellipsis
  3484. if (selectedCount > 49) {
  3485. titleFragment.appendChild(document.createTextNode('...'));
  3486. }
  3487. }
  3488. } else {
  3489. var optionSelector = ':not([hidden]):not([data-hidden="true"]):not([data-divider="true"])';
  3490. if (this.options.hideDisabled) optionSelector += ':not(:disabled)';
  3491. // If this is a multiselect, and selectedTextFormat is count, then show 1 of 2 selected, etc.
  3492. var totalCount = this.$element[0].querySelectorAll('select > option' + optionSelector + ', optgroup' + optionSelector + ' option' + optionSelector).length,
  3493. tr8nText = (typeof this.options.countSelectedText === 'function') ? this.options.countSelectedText(selectedCount, totalCount) : this.options.countSelectedText;
  3494. titleFragment = generateOption.text.call(this, {
  3495. text: tr8nText.replace('{0}', selectedCount.toString()).replace('{1}', totalCount.toString())
  3496. }, true);
  3497. }
  3498. }
  3499. if (this.options.title == undefined) {
  3500. // use .attr to ensure undefined is returned if title attribute is not set
  3501. this.options.title = this.$element.attr('title');
  3502. }
  3503. // If the select doesn't have a title, then use the default, or if nothing is set at all, use noneSelectedText
  3504. if (!titleFragment.childNodes.length) {
  3505. titleFragment = generateOption.text.call(this, {
  3506. text: typeof this.options.title !== 'undefined' ? this.options.title : this.options.noneSelectedText
  3507. }, true);
  3508. }
  3509. // strip all HTML tags and trim the result, then unescape any escaped tags
  3510. button.title = titleFragment.textContent.replace(/<[^>]*>?/g, '').trim();
  3511. if (this.options.sanitize && hasContent) {
  3512. sanitizeHtml([titleFragment], that.options.whiteList, that.options.sanitizeFn);
  3513. }
  3514. buttonInner.innerHTML = '';
  3515. buttonInner.appendChild(titleFragment);
  3516. if (version.major < 4 && this.$newElement[0].classList.contains('bs3-has-addon')) {
  3517. var filterExpand = button.querySelector('.filter-expand'),
  3518. clone = buttonInner.cloneNode(true);
  3519. clone.className = 'filter-expand';
  3520. if (filterExpand) {
  3521. button.replaceChild(clone, filterExpand);
  3522. } else {
  3523. button.appendChild(clone);
  3524. }
  3525. }
  3526. this.$element.trigger('rendered' + EVENT_KEY);
  3527. },
  3528. /**
  3529. * @param [style]
  3530. * @param [status]
  3531. */
  3532. setStyle: function (newStyle, status) {
  3533. var button = this.$button[0],
  3534. newElement = this.$newElement[0],
  3535. style = this.options.style.trim(),
  3536. buttonClass;
  3537. if (this.$element.attr('class')) {
  3538. this.$newElement.addClass(this.$element.attr('class').replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi, ''));
  3539. }
  3540. if (version.major < 4) {
  3541. newElement.classList.add('bs3');
  3542. if (newElement.parentNode.classList && newElement.parentNode.classList.contains('input-group') &&
  3543. (newElement.previousElementSibling || newElement.nextElementSibling) &&
  3544. (newElement.previousElementSibling || newElement.nextElementSibling).classList.contains('input-group-addon')
  3545. ) {
  3546. newElement.classList.add('bs3-has-addon');
  3547. }
  3548. }
  3549. if (newStyle) {
  3550. buttonClass = newStyle.trim();
  3551. } else {
  3552. buttonClass = style;
  3553. }
  3554. if (status == 'add') {
  3555. if (buttonClass) button.classList.add.apply(button.classList, buttonClass.split(' '));
  3556. } else if (status == 'remove') {
  3557. if (buttonClass) button.classList.remove.apply(button.classList, buttonClass.split(' '));
  3558. } else {
  3559. if (style) button.classList.remove.apply(button.classList, style.split(' '));
  3560. if (buttonClass) button.classList.add.apply(button.classList, buttonClass.split(' '));
  3561. }
  3562. },
  3563. liHeight: function (refresh) {
  3564. if (!refresh && (this.options.size === false || Object.keys(this.sizeInfo).length)) return;
  3565. var newElement = elementTemplates.div.cloneNode(false),
  3566. menu = elementTemplates.div.cloneNode(false),
  3567. menuInner = elementTemplates.div.cloneNode(false),
  3568. menuInnerInner = document.createElement('ul'),
  3569. divider = elementTemplates.li.cloneNode(false),
  3570. dropdownHeader = elementTemplates.li.cloneNode(false),
  3571. li,
  3572. a = elementTemplates.a.cloneNode(false),
  3573. text = elementTemplates.span.cloneNode(false),
  3574. header = this.options.header && this.$menu.find('.' + classNames.POPOVERHEADER).length > 0 ? this.$menu.find('.' + classNames.POPOVERHEADER)[0].cloneNode(true) : null,
  3575. search = this.options.liveSearch ? elementTemplates.div.cloneNode(false) : null,
  3576. actions = this.options.actionsBox && this.multiple && this.$menu.find('.bs-actionsbox').length > 0 ? this.$menu.find('.bs-actionsbox')[0].cloneNode(true) : null,
  3577. doneButton = this.options.doneButton && this.multiple && this.$menu.find('.bs-donebutton').length > 0 ? this.$menu.find('.bs-donebutton')[0].cloneNode(true) : null,
  3578. firstOption = this.$element.find('option')[0];
  3579. this.sizeInfo.selectWidth = this.$newElement[0].offsetWidth;
  3580. text.className = 'text';
  3581. a.className = 'dropdown-item ' + (firstOption ? firstOption.className : '');
  3582. newElement.className = this.$menu[0].parentNode.className + ' ' + classNames.SHOW;
  3583. newElement.style.width = 0; // ensure button width doesn't affect natural width of menu when calculating
  3584. if (this.options.width === 'auto') menu.style.minWidth = 0;
  3585. menu.className = classNames.MENU + ' ' + classNames.SHOW;
  3586. menuInner.className = 'inner ' + classNames.SHOW;
  3587. menuInnerInner.className = classNames.MENU + ' inner ' + (version.major === '4' ? classNames.SHOW : '');
  3588. divider.className = classNames.DIVIDER;
  3589. dropdownHeader.className = 'dropdown-header';
  3590. text.appendChild(document.createTextNode('\u200b'));
  3591. if (this.selectpicker.current.data.length) {
  3592. for (var i = 0; i < this.selectpicker.current.data.length; i++) {
  3593. var data = this.selectpicker.current.data[i];
  3594. if (data.type === 'option') {
  3595. li = data.element;
  3596. break;
  3597. }
  3598. }
  3599. } else {
  3600. li = elementTemplates.li.cloneNode(false);
  3601. a.appendChild(text);
  3602. li.appendChild(a);
  3603. }
  3604. dropdownHeader.appendChild(text.cloneNode(true));
  3605. if (this.selectpicker.view.widestOption) {
  3606. menuInnerInner.appendChild(this.selectpicker.view.widestOption.cloneNode(true));
  3607. }
  3608. menuInnerInner.appendChild(li);
  3609. menuInnerInner.appendChild(divider);
  3610. menuInnerInner.appendChild(dropdownHeader);
  3611. if (header) menu.appendChild(header);
  3612. if (search) {
  3613. var input = document.createElement('input');
  3614. search.className = 'bs-searchbox';
  3615. input.className = 'form-control';
  3616. search.appendChild(input);
  3617. menu.appendChild(search);
  3618. }
  3619. if (actions) menu.appendChild(actions);
  3620. menuInner.appendChild(menuInnerInner);
  3621. menu.appendChild(menuInner);
  3622. if (doneButton) menu.appendChild(doneButton);
  3623. newElement.appendChild(menu);
  3624. document.body.appendChild(newElement);
  3625. var liHeight = li.offsetHeight,
  3626. dropdownHeaderHeight = dropdownHeader ? dropdownHeader.offsetHeight : 0,
  3627. headerHeight = header ? header.offsetHeight : 0,
  3628. searchHeight = search ? search.offsetHeight : 0,
  3629. actionsHeight = actions ? actions.offsetHeight : 0,
  3630. doneButtonHeight = doneButton ? doneButton.offsetHeight : 0,
  3631. dividerHeight = $(divider).outerHeight(true),
  3632. // fall back to jQuery if getComputedStyle is not supported
  3633. menuStyle = window.getComputedStyle ? window.getComputedStyle(menu) : false,
  3634. menuWidth = menu.offsetWidth,
  3635. $menu = menuStyle ? null : $(menu),
  3636. menuPadding = {
  3637. vert: toInteger(menuStyle ? menuStyle.paddingTop : $menu.css('paddingTop')) +
  3638. toInteger(menuStyle ? menuStyle.paddingBottom : $menu.css('paddingBottom')) +
  3639. toInteger(menuStyle ? menuStyle.borderTopWidth : $menu.css('borderTopWidth')) +
  3640. toInteger(menuStyle ? menuStyle.borderBottomWidth : $menu.css('borderBottomWidth')),
  3641. horiz: toInteger(menuStyle ? menuStyle.paddingLeft : $menu.css('paddingLeft')) +
  3642. toInteger(menuStyle ? menuStyle.paddingRight : $menu.css('paddingRight')) +
  3643. toInteger(menuStyle ? menuStyle.borderLeftWidth : $menu.css('borderLeftWidth')) +
  3644. toInteger(menuStyle ? menuStyle.borderRightWidth : $menu.css('borderRightWidth'))
  3645. },
  3646. menuExtras = {
  3647. vert: menuPadding.vert +
  3648. toInteger(menuStyle ? menuStyle.marginTop : $menu.css('marginTop')) +
  3649. toInteger(menuStyle ? menuStyle.marginBottom : $menu.css('marginBottom')) + 2,
  3650. horiz: menuPadding.horiz +
  3651. toInteger(menuStyle ? menuStyle.marginLeft : $menu.css('marginLeft')) +
  3652. toInteger(menuStyle ? menuStyle.marginRight : $menu.css('marginRight')) + 2
  3653. },
  3654. scrollBarWidth;
  3655. menuInner.style.overflowY = 'scroll';
  3656. scrollBarWidth = menu.offsetWidth - menuWidth;
  3657. document.body.removeChild(newElement);
  3658. this.sizeInfo.liHeight = liHeight;
  3659. this.sizeInfo.dropdownHeaderHeight = dropdownHeaderHeight;
  3660. this.sizeInfo.headerHeight = headerHeight;
  3661. this.sizeInfo.searchHeight = searchHeight;
  3662. this.sizeInfo.actionsHeight = actionsHeight;
  3663. this.sizeInfo.doneButtonHeight = doneButtonHeight;
  3664. this.sizeInfo.dividerHeight = dividerHeight;
  3665. this.sizeInfo.menuPadding = menuPadding;
  3666. this.sizeInfo.menuExtras = menuExtras;
  3667. this.sizeInfo.menuWidth = menuWidth;
  3668. this.sizeInfo.menuInnerInnerWidth = menuWidth - menuPadding.horiz;
  3669. this.sizeInfo.totalMenuWidth = this.sizeInfo.menuWidth;
  3670. this.sizeInfo.scrollBarWidth = scrollBarWidth;
  3671. this.sizeInfo.selectHeight = this.$newElement[0].offsetHeight;
  3672. this.setPositionData();
  3673. },
  3674. getSelectPosition: function () {
  3675. var that = this,
  3676. $window = $(window),
  3677. pos = that.$newElement.offset(),
  3678. $container = $(that.options.container),
  3679. containerPos;
  3680. if (that.options.container && $container.length && !$container.is('body')) {
  3681. containerPos = $container.offset();
  3682. containerPos.top += parseInt($container.css('borderTopWidth'));
  3683. containerPos.left += parseInt($container.css('borderLeftWidth'));
  3684. } else {
  3685. containerPos = { top: 0, left: 0 };
  3686. }
  3687. var winPad = that.options.windowPadding;
  3688. this.sizeInfo.selectOffsetTop = pos.top - containerPos.top - $window.scrollTop();
  3689. this.sizeInfo.selectOffsetBot = $window.height() - this.sizeInfo.selectOffsetTop - this.sizeInfo.selectHeight - containerPos.top - winPad[2];
  3690. this.sizeInfo.selectOffsetLeft = pos.left - containerPos.left - $window.scrollLeft();
  3691. this.sizeInfo.selectOffsetRight = $window.width() - this.sizeInfo.selectOffsetLeft - this.sizeInfo.selectWidth - containerPos.left - winPad[1];
  3692. this.sizeInfo.selectOffsetTop -= winPad[0];
  3693. this.sizeInfo.selectOffsetLeft -= winPad[3];
  3694. },
  3695. setMenuSize: function (isAuto) {
  3696. this.getSelectPosition();
  3697. var selectWidth = this.sizeInfo.selectWidth,
  3698. liHeight = this.sizeInfo.liHeight,
  3699. headerHeight = this.sizeInfo.headerHeight,
  3700. searchHeight = this.sizeInfo.searchHeight,
  3701. actionsHeight = this.sizeInfo.actionsHeight,
  3702. doneButtonHeight = this.sizeInfo.doneButtonHeight,
  3703. divHeight = this.sizeInfo.dividerHeight,
  3704. menuPadding = this.sizeInfo.menuPadding,
  3705. menuInnerHeight,
  3706. menuHeight,
  3707. divLength = 0,
  3708. minHeight,
  3709. _minHeight,
  3710. maxHeight,
  3711. menuInnerMinHeight,
  3712. estimate,
  3713. isDropup;
  3714. if (this.options.dropupAuto) {
  3715. // Get the estimated height of the menu without scrollbars.
  3716. // This is useful for smaller menus, where there might be plenty of room
  3717. // below the button without setting dropup, but we can't know
  3718. // the exact height of the menu until createView is called later
  3719. estimate = liHeight * this.selectpicker.current.elements.length + menuPadding.vert;
  3720. isDropup = this.sizeInfo.selectOffsetTop - this.sizeInfo.selectOffsetBot > this.sizeInfo.menuExtras.vert && estimate + this.sizeInfo.menuExtras.vert + 50 > this.sizeInfo.selectOffsetBot;
  3721. // ensure dropup doesn't change while searching (so menu doesn't bounce back and forth)
  3722. if (this.selectpicker.isSearching === true) {
  3723. isDropup = this.selectpicker.dropup;
  3724. }
  3725. this.$newElement.toggleClass(classNames.DROPUP, isDropup);
  3726. this.selectpicker.dropup = isDropup;
  3727. }
  3728. if (this.options.size === 'auto') {
  3729. _minHeight = this.selectpicker.current.elements.length > 3 ? this.sizeInfo.liHeight * 3 + this.sizeInfo.menuExtras.vert - 2 : 0;
  3730. menuHeight = this.sizeInfo.selectOffsetBot - this.sizeInfo.menuExtras.vert;
  3731. minHeight = _minHeight + headerHeight + searchHeight + actionsHeight + doneButtonHeight;
  3732. menuInnerMinHeight = Math.max(_minHeight - menuPadding.vert, 0);
  3733. if (this.$newElement.hasClass(classNames.DROPUP)) {
  3734. menuHeight = this.sizeInfo.selectOffsetTop - this.sizeInfo.menuExtras.vert;
  3735. }
  3736. maxHeight = menuHeight;
  3737. menuInnerHeight = menuHeight - headerHeight - searchHeight - actionsHeight - doneButtonHeight - menuPadding.vert;
  3738. } else if (this.options.size && this.options.size != 'auto' && this.selectpicker.current.elements.length > this.options.size) {
  3739. for (var i = 0; i < this.options.size; i++) {
  3740. if (this.selectpicker.current.data[i].type === 'divider') divLength++;
  3741. }
  3742. menuHeight = liHeight * this.options.size + divLength * divHeight + menuPadding.vert;
  3743. menuInnerHeight = menuHeight - menuPadding.vert;
  3744. maxHeight = menuHeight + headerHeight + searchHeight + actionsHeight + doneButtonHeight;
  3745. minHeight = menuInnerMinHeight = '';
  3746. }
  3747. this.$menu.css({
  3748. 'max-height': maxHeight + 'px',
  3749. 'overflow': 'hidden',
  3750. 'min-height': minHeight + 'px'
  3751. });
  3752. this.$menuInner.css({
  3753. 'max-height': menuInnerHeight + 'px',
  3754. 'overflow-y': 'auto',
  3755. 'min-height': menuInnerMinHeight + 'px'
  3756. });
  3757. // ensure menuInnerHeight is always a positive number to prevent issues calculating chunkSize in createView
  3758. this.sizeInfo.menuInnerHeight = Math.max(menuInnerHeight, 1);
  3759. if (this.selectpicker.current.data.length && this.selectpicker.current.data[this.selectpicker.current.data.length - 1].position > this.sizeInfo.menuInnerHeight) {
  3760. this.sizeInfo.hasScrollBar = true;
  3761. this.sizeInfo.totalMenuWidth = this.sizeInfo.menuWidth + this.sizeInfo.scrollBarWidth;
  3762. }
  3763. if (this.options.dropdownAlignRight === 'auto') {
  3764. this.$menu.toggleClass(classNames.MENURIGHT, this.sizeInfo.selectOffsetLeft > this.sizeInfo.selectOffsetRight && this.sizeInfo.selectOffsetRight < (this.sizeInfo.totalMenuWidth - selectWidth));
  3765. }
  3766. if (this.dropdown && this.dropdown._popper) this.dropdown._popper.update();
  3767. },
  3768. setSize: function (refresh) {
  3769. this.liHeight(refresh);
  3770. if (this.options.header) this.$menu.css('padding-top', 0);
  3771. if (this.options.size !== false) {
  3772. var that = this,
  3773. $window = $(window);
  3774. this.setMenuSize();
  3775. if (this.options.liveSearch) {
  3776. this.$searchbox
  3777. .off('input.setMenuSize propertychange.setMenuSize')
  3778. .on('input.setMenuSize propertychange.setMenuSize', function () {
  3779. return that.setMenuSize();
  3780. });
  3781. }
  3782. if (this.options.size === 'auto') {
  3783. $window
  3784. .off('resize' + EVENT_KEY + '.' + this.selectId + '.setMenuSize' + ' scroll' + EVENT_KEY + '.' + this.selectId + '.setMenuSize')
  3785. .on('resize' + EVENT_KEY + '.' + this.selectId + '.setMenuSize' + ' scroll' + EVENT_KEY + '.' + this.selectId + '.setMenuSize', function () {
  3786. return that.setMenuSize();
  3787. });
  3788. } else if (this.options.size && this.options.size != 'auto' && this.selectpicker.current.elements.length > this.options.size) {
  3789. $window.off('resize' + EVENT_KEY + '.' + this.selectId + '.setMenuSize' + ' scroll' + EVENT_KEY + '.' + this.selectId + '.setMenuSize');
  3790. }
  3791. }
  3792. this.createView(false, true, refresh);
  3793. },
  3794. setWidth: function () {
  3795. var that = this;
  3796. if (this.options.width === 'auto') {
  3797. requestAnimationFrame(function () {
  3798. that.$menu.css('min-width', '0');
  3799. that.$element.on('loaded' + EVENT_KEY, function () {
  3800. that.liHeight();
  3801. that.setMenuSize();
  3802. // Get correct width if element is hidden
  3803. var $selectClone = that.$newElement.clone().appendTo('body'),
  3804. btnWidth = $selectClone.css('width', 'auto').children('button').outerWidth();
  3805. $selectClone.remove();
  3806. // Set width to whatever's larger, button title or longest option
  3807. that.sizeInfo.selectWidth = Math.max(that.sizeInfo.totalMenuWidth, btnWidth);
  3808. that.$newElement.css('width', that.sizeInfo.selectWidth + 'px');
  3809. });
  3810. });
  3811. } else if (this.options.width === 'fit') {
  3812. // Remove inline min-width so width can be changed from 'auto'
  3813. this.$menu.css('min-width', '');
  3814. this.$newElement.css('width', '').addClass('fit-width');
  3815. } else if (this.options.width) {
  3816. // Remove inline min-width so width can be changed from 'auto'
  3817. this.$menu.css('min-width', '');
  3818. this.$newElement.css('width', this.options.width);
  3819. } else {
  3820. // Remove inline min-width/width so width can be changed
  3821. this.$menu.css('min-width', '');
  3822. this.$newElement.css('width', '');
  3823. }
  3824. // Remove fit-width class if width is changed programmatically
  3825. if (this.$newElement.hasClass('fit-width') && this.options.width !== 'fit') {
  3826. this.$newElement[0].classList.remove('fit-width');
  3827. }
  3828. },
  3829. selectPosition: function () {
  3830. this.$bsContainer = $('<div class="bs-container" />');
  3831. var that = this,
  3832. $container = $(this.options.container),
  3833. pos,
  3834. containerPos,
  3835. actualHeight,
  3836. getPlacement = function ($element) {
  3837. var containerPosition = {},
  3838. // fall back to dropdown's default display setting if display is not manually set
  3839. display = that.options.display || (
  3840. // Bootstrap 3 doesn't have $.fn.dropdown.Constructor.Default
  3841. $.fn.dropdown.Constructor.Default ? $.fn.dropdown.Constructor.Default.display
  3842. : false
  3843. );
  3844. that.$bsContainer.addClass($element.attr('class').replace(/form-control|fit-width/gi, '')).toggleClass(classNames.DROPUP, $element.hasClass(classNames.DROPUP));
  3845. pos = $element.offset();
  3846. if (!$container.is('body')) {
  3847. containerPos = $container.offset();
  3848. containerPos.top += parseInt($container.css('borderTopWidth')) - $container.scrollTop();
  3849. containerPos.left += parseInt($container.css('borderLeftWidth')) - $container.scrollLeft();
  3850. } else {
  3851. containerPos = { top: 0, left: 0 };
  3852. }
  3853. actualHeight = $element.hasClass(classNames.DROPUP) ? 0 : $element[0].offsetHeight;
  3854. // Bootstrap 4+ uses Popper for menu positioning
  3855. if (version.major < 4 || display === 'static') {
  3856. containerPosition.top = pos.top - containerPos.top + actualHeight;
  3857. containerPosition.left = pos.left - containerPos.left;
  3858. }
  3859. containerPosition.width = $element[0].offsetWidth;
  3860. that.$bsContainer.css(containerPosition);
  3861. };
  3862. this.$button.on('click.bs.dropdown.data-api', function () {
  3863. if (that.isDisabled()) {
  3864. return;
  3865. }
  3866. getPlacement(that.$newElement);
  3867. that.$bsContainer
  3868. .appendTo(that.options.container)
  3869. .toggleClass(classNames.SHOW, !that.$button.hasClass(classNames.SHOW))
  3870. .append(that.$menu);
  3871. });
  3872. $(window)
  3873. .off('resize' + EVENT_KEY + '.' + this.selectId + ' scroll' + EVENT_KEY + '.' + this.selectId)
  3874. .on('resize' + EVENT_KEY + '.' + this.selectId + ' scroll' + EVENT_KEY + '.' + this.selectId, function () {
  3875. var isActive = that.$newElement.hasClass(classNames.SHOW);
  3876. if (isActive) getPlacement(that.$newElement);
  3877. });
  3878. this.$element.on('hide' + EVENT_KEY, function () {
  3879. that.$menu.data('height', that.$menu.height());
  3880. that.$bsContainer.detach();
  3881. });
  3882. },
  3883. setOptionStatus: function (selectedOnly) {
  3884. var that = this;
  3885. that.noScroll = false;
  3886. if (that.selectpicker.view.visibleElements && that.selectpicker.view.visibleElements.length) {
  3887. for (var i = 0; i < that.selectpicker.view.visibleElements.length; i++) {
  3888. var liData = that.selectpicker.current.data[i + that.selectpicker.view.position0],
  3889. option = liData.option;
  3890. if (option) {
  3891. if (selectedOnly !== true) {
  3892. that.setDisabled(
  3893. liData.index,
  3894. liData.disabled
  3895. );
  3896. }
  3897. that.setSelected(
  3898. liData.index,
  3899. option.selected
  3900. );
  3901. }
  3902. }
  3903. }
  3904. },
  3905. /**
  3906. * @param {number} index - the index of the option that is being changed
  3907. * @param {boolean} selected - true if the option is being selected, false if being deselected
  3908. */
  3909. setSelected: function (index, selected) {
  3910. var li = this.selectpicker.main.elements[index],
  3911. liData = this.selectpicker.main.data[index],
  3912. activeIndexIsSet = this.activeIndex !== undefined,
  3913. thisIsActive = this.activeIndex === index,
  3914. prevActive,
  3915. a,
  3916. // if current option is already active
  3917. // OR
  3918. // if the current option is being selected, it's NOT multiple, and
  3919. // activeIndex is undefined:
  3920. // - when the menu is first being opened, OR
  3921. // - after a search has been performed, OR
  3922. // - when retainActive is false when selecting a new option (i.e. index of the newly selected option is not the same as the current activeIndex)
  3923. keepActive = thisIsActive || (selected && !this.multiple && !activeIndexIsSet);
  3924. liData.selected = selected;
  3925. a = li.firstChild;
  3926. if (selected) {
  3927. this.selectedIndex = index;
  3928. }
  3929. li.classList.toggle('selected', selected);
  3930. if (keepActive) {
  3931. this.focusItem(li, liData);
  3932. this.selectpicker.view.currentActive = li;
  3933. this.activeIndex = index;
  3934. } else {
  3935. this.defocusItem(li);
  3936. }
  3937. if (a) {
  3938. a.classList.toggle('selected', selected);
  3939. if (selected) {
  3940. a.setAttribute('aria-selected', true);
  3941. } else {
  3942. if (this.multiple) {
  3943. a.setAttribute('aria-selected', false);
  3944. } else {
  3945. a.removeAttribute('aria-selected');
  3946. }
  3947. }
  3948. }
  3949. if (!keepActive && !activeIndexIsSet && selected && this.prevActiveIndex !== undefined) {
  3950. prevActive = this.selectpicker.main.elements[this.prevActiveIndex];
  3951. this.defocusItem(prevActive);
  3952. }
  3953. },
  3954. /**
  3955. * @param {number} index - the index of the option that is being disabled
  3956. * @param {boolean} disabled - true if the option is being disabled, false if being enabled
  3957. */
  3958. setDisabled: function (index, disabled) {
  3959. var li = this.selectpicker.main.elements[index],
  3960. a;
  3961. this.selectpicker.main.data[index].disabled = disabled;
  3962. a = li.firstChild;
  3963. li.classList.toggle(classNames.DISABLED, disabled);
  3964. if (a) {
  3965. if (version.major === '4') a.classList.toggle(classNames.DISABLED, disabled);
  3966. if (disabled) {
  3967. a.setAttribute('aria-disabled', disabled);
  3968. a.setAttribute('tabindex', -1);
  3969. } else {
  3970. a.removeAttribute('aria-disabled');
  3971. a.setAttribute('tabindex', 0);
  3972. }
  3973. }
  3974. },
  3975. isDisabled: function () {
  3976. return this.$element[0].disabled;
  3977. },
  3978. checkDisabled: function () {
  3979. if (this.isDisabled()) {
  3980. this.$newElement[0].classList.add(classNames.DISABLED);
  3981. this.$button.addClass(classNames.DISABLED).attr('aria-disabled', true);
  3982. } else {
  3983. if (this.$button[0].classList.contains(classNames.DISABLED)) {
  3984. this.$newElement[0].classList.remove(classNames.DISABLED);
  3985. this.$button.removeClass(classNames.DISABLED).attr('aria-disabled', false);
  3986. }
  3987. }
  3988. },
  3989. clickListener: function () {
  3990. var that = this,
  3991. $document = $(document);
  3992. $document.data('spaceSelect', false);
  3993. this.$button.on('keyup', function (e) {
  3994. if (/(32)/.test(e.keyCode.toString(10)) && $document.data('spaceSelect')) {
  3995. e.preventDefault();
  3996. $document.data('spaceSelect', false);
  3997. }
  3998. });
  3999. this.$newElement.on('show.bs.dropdown', function () {
  4000. if (version.major > 3 && !that.dropdown) {
  4001. that.dropdown = that.$button.data('bs.dropdown');
  4002. that.dropdown._menu = that.$menu[0];
  4003. }
  4004. });
  4005. this.$button.on('click.bs.dropdown.data-api', function () {
  4006. if (!that.$newElement.hasClass(classNames.SHOW)) {
  4007. that.setSize();
  4008. }
  4009. });
  4010. function setFocus () {
  4011. if (that.options.liveSearch) {
  4012. that.$searchbox.trigger('focus');
  4013. } else {
  4014. that.$menuInner.trigger('focus');
  4015. }
  4016. }
  4017. function checkPopperExists () {
  4018. if (that.dropdown && that.dropdown._popper && that.dropdown._popper.state.isCreated) {
  4019. setFocus();
  4020. } else {
  4021. requestAnimationFrame(checkPopperExists);
  4022. }
  4023. }
  4024. this.$element.on('shown' + EVENT_KEY, function () {
  4025. if (that.$menuInner[0].scrollTop !== that.selectpicker.view.scrollTop) {
  4026. that.$menuInner[0].scrollTop = that.selectpicker.view.scrollTop;
  4027. }
  4028. if (version.major > 3) {
  4029. requestAnimationFrame(checkPopperExists);
  4030. } else {
  4031. setFocus();
  4032. }
  4033. });
  4034. // ensure posinset and setsize are correct before selecting an option via a click
  4035. this.$menuInner.on('mouseenter', 'li a', function (e) {
  4036. var hoverLi = this.parentElement,
  4037. position0 = that.isVirtual() ? that.selectpicker.view.position0 : 0,
  4038. index = Array.prototype.indexOf.call(hoverLi.parentElement.children, hoverLi),
  4039. hoverData = that.selectpicker.current.data[index + position0];
  4040. that.focusItem(hoverLi, hoverData, true);
  4041. });
  4042. this.$menuInner.on('click', 'li a', function (e, retainActive) {
  4043. var $this = $(this),
  4044. element = that.$element[0],
  4045. position0 = that.isVirtual() ? that.selectpicker.view.position0 : 0,
  4046. clickedData = that.selectpicker.current.data[$this.parent().index() + position0],
  4047. clickedIndex = clickedData.index,
  4048. prevValue = getSelectValues(element),
  4049. prevIndex = element.selectedIndex,
  4050. prevOption = element.options[prevIndex],
  4051. triggerChange = true;
  4052. // Don't close on multi choice menu
  4053. if (that.multiple && that.options.maxOptions !== 1) {
  4054. e.stopPropagation();
  4055. }
  4056. e.preventDefault();
  4057. // Don't run if the select is disabled
  4058. if (!that.isDisabled() && !$this.parent().hasClass(classNames.DISABLED)) {
  4059. var option = clickedData.option,
  4060. $option = $(option),
  4061. state = option.selected,
  4062. $optgroup = $option.parent('optgroup'),
  4063. $optgroupOptions = $optgroup.find('option'),
  4064. maxOptions = that.options.maxOptions,
  4065. maxOptionsGrp = $optgroup.data('maxOptions') || false;
  4066. if (clickedIndex === that.activeIndex) retainActive = true;
  4067. if (!retainActive) {
  4068. that.prevActiveIndex = that.activeIndex;
  4069. that.activeIndex = undefined;
  4070. }
  4071. if (!that.multiple) { // Deselect all others if not multi select box
  4072. if (prevOption) prevOption.selected = false;
  4073. option.selected = true;
  4074. that.setSelected(clickedIndex, true);
  4075. } else { // Toggle the one we have chosen if we are multi select.
  4076. option.selected = !state;
  4077. that.setSelected(clickedIndex, !state);
  4078. that.focusedParent.focus();
  4079. if (maxOptions !== false || maxOptionsGrp !== false) {
  4080. var maxReached = maxOptions < getSelectedOptions(element).length,
  4081. maxReachedGrp = maxOptionsGrp < $optgroup.find('option:selected').length;
  4082. if ((maxOptions && maxReached) || (maxOptionsGrp && maxReachedGrp)) {
  4083. if (maxOptions && maxOptions == 1) {
  4084. element.selectedIndex = -1;
  4085. option.selected = true;
  4086. that.setOptionStatus(true);
  4087. } else if (maxOptionsGrp && maxOptionsGrp == 1) {
  4088. for (var i = 0; i < $optgroupOptions.length; i++) {
  4089. var _option = $optgroupOptions[i];
  4090. _option.selected = false;
  4091. that.setSelected(_option.liIndex, false);
  4092. }
  4093. option.selected = true;
  4094. that.setSelected(clickedIndex, true);
  4095. } else {
  4096. var maxOptionsText = typeof that.options.maxOptionsText === 'string' ? [that.options.maxOptionsText, that.options.maxOptionsText] : that.options.maxOptionsText,
  4097. maxOptionsArr = typeof maxOptionsText === 'function' ? maxOptionsText(maxOptions, maxOptionsGrp) : maxOptionsText,
  4098. maxTxt = maxOptionsArr[0].replace('{n}', maxOptions),
  4099. maxTxtGrp = maxOptionsArr[1].replace('{n}', maxOptionsGrp),
  4100. $notify = $('<div class="notify"></div>');
  4101. // If {var} is set in array, replace it
  4102. /** @deprecated */
  4103. if (maxOptionsArr[2]) {
  4104. maxTxt = maxTxt.replace('{var}', maxOptionsArr[2][maxOptions > 1 ? 0 : 1]);
  4105. maxTxtGrp = maxTxtGrp.replace('{var}', maxOptionsArr[2][maxOptionsGrp > 1 ? 0 : 1]);
  4106. }
  4107. option.selected = false;
  4108. that.$menu.append($notify);
  4109. if (maxOptions && maxReached) {
  4110. $notify.append($('<div>' + maxTxt + '</div>'));
  4111. triggerChange = false;
  4112. that.$element.trigger('maxReached' + EVENT_KEY);
  4113. }
  4114. if (maxOptionsGrp && maxReachedGrp) {
  4115. $notify.append($('<div>' + maxTxtGrp + '</div>'));
  4116. triggerChange = false;
  4117. that.$element.trigger('maxReachedGrp' + EVENT_KEY);
  4118. }
  4119. setTimeout(function () {
  4120. that.setSelected(clickedIndex, false);
  4121. }, 10);
  4122. $notify[0].classList.add('fadeOut');
  4123. setTimeout(function () {
  4124. $notify.remove();
  4125. }, 1050);
  4126. }
  4127. }
  4128. }
  4129. }
  4130. if (!that.multiple || (that.multiple && that.options.maxOptions === 1)) {
  4131. that.$button.trigger('focus');
  4132. } else if (that.options.liveSearch) {
  4133. that.$searchbox.trigger('focus');
  4134. }
  4135. // Trigger select 'change'
  4136. if (triggerChange) {
  4137. if (that.multiple || prevIndex !== element.selectedIndex) {
  4138. // $option.prop('selected') is current option state (selected/unselected). prevValue is the value of the select prior to being changed.
  4139. changedArguments = [option.index, $option.prop('selected'), prevValue];
  4140. that.$element
  4141. .triggerNative('change');
  4142. }
  4143. }
  4144. }
  4145. });
  4146. this.$menu.on('click', 'li.' + classNames.DISABLED + ' a, .' + classNames.POPOVERHEADER + ', .' + classNames.POPOVERHEADER + ' :not(.close)', function (e) {
  4147. if (e.currentTarget == this) {
  4148. e.preventDefault();
  4149. e.stopPropagation();
  4150. if (that.options.liveSearch && !$(e.target).hasClass('close')) {
  4151. that.$searchbox.trigger('focus');
  4152. } else {
  4153. that.$button.trigger('focus');
  4154. }
  4155. }
  4156. });
  4157. this.$menuInner.on('click', '.divider, .dropdown-header', function (e) {
  4158. e.preventDefault();
  4159. e.stopPropagation();
  4160. if (that.options.liveSearch) {
  4161. that.$searchbox.trigger('focus');
  4162. } else {
  4163. that.$button.trigger('focus');
  4164. }
  4165. });
  4166. this.$menu.on('click', '.' + classNames.POPOVERHEADER + ' .close', function () {
  4167. that.$button.trigger('click');
  4168. });
  4169. this.$searchbox.on('click', function (e) {
  4170. e.stopPropagation();
  4171. });
  4172. this.$menu.on('click', '.actions-btn', function (e) {
  4173. if (that.options.liveSearch) {
  4174. that.$searchbox.trigger('focus');
  4175. } else {
  4176. that.$button.trigger('focus');
  4177. }
  4178. e.preventDefault();
  4179. e.stopPropagation();
  4180. if ($(this).hasClass('bs-select-all')) {
  4181. that.selectAll();
  4182. } else {
  4183. that.deselectAll();
  4184. }
  4185. });
  4186. this.$button
  4187. .on('focus' + EVENT_KEY, function (e) {
  4188. var tabindex = that.$element[0].getAttribute('tabindex');
  4189. // only change when button is actually focused
  4190. if (tabindex !== undefined && e.originalEvent && e.originalEvent.isTrusted) {
  4191. // apply select element's tabindex to ensure correct order is followed when tabbing to the next element
  4192. this.setAttribute('tabindex', tabindex);
  4193. // set element's tabindex to -1 to allow for reverse tabbing
  4194. that.$element[0].setAttribute('tabindex', -1);
  4195. that.selectpicker.view.tabindex = tabindex;
  4196. }
  4197. })
  4198. .on('blur' + EVENT_KEY, function (e) {
  4199. // revert everything to original tabindex
  4200. if (that.selectpicker.view.tabindex !== undefined && e.originalEvent && e.originalEvent.isTrusted) {
  4201. that.$element[0].setAttribute('tabindex', that.selectpicker.view.tabindex);
  4202. this.setAttribute('tabindex', -1);
  4203. that.selectpicker.view.tabindex = undefined;
  4204. }
  4205. });
  4206. this.$element
  4207. .on('change' + EVENT_KEY, function () {
  4208. that.render();
  4209. that.$element.trigger('changed' + EVENT_KEY, changedArguments);
  4210. changedArguments = null;
  4211. })
  4212. .on('focus' + EVENT_KEY, function () {
  4213. if (!that.options.mobile) that.$button[0].focus();
  4214. });
  4215. },
  4216. liveSearchListener: function () {
  4217. var that = this;
  4218. this.$button.on('click.bs.dropdown.data-api', function () {
  4219. if (!!that.$searchbox.val()) {
  4220. that.$searchbox.val('');
  4221. that.selectpicker.search.previousValue = undefined;
  4222. }
  4223. });
  4224. this.$searchbox.on('click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api', function (e) {
  4225. e.stopPropagation();
  4226. });
  4227. this.$searchbox.on('input propertychange', function () {
  4228. var searchValue = that.$searchbox[0].value;
  4229. that.selectpicker.search.elements = [];
  4230. that.selectpicker.search.data = [];
  4231. if (searchValue) {
  4232. var i,
  4233. searchMatch = [],
  4234. q = searchValue.toUpperCase(),
  4235. cache = {},
  4236. cacheArr = [],
  4237. searchStyle = that._searchStyle(),
  4238. normalizeSearch = that.options.liveSearchNormalize;
  4239. if (normalizeSearch) q = normalizeToBase(q);
  4240. for (var i = 0; i < that.selectpicker.main.data.length; i++) {
  4241. var li = that.selectpicker.main.data[i];
  4242. if (!cache[i]) {
  4243. cache[i] = stringSearch(li, q, searchStyle, normalizeSearch);
  4244. }
  4245. if (cache[i] && li.headerIndex !== undefined && cacheArr.indexOf(li.headerIndex) === -1) {
  4246. if (li.headerIndex > 0) {
  4247. cache[li.headerIndex - 1] = true;
  4248. cacheArr.push(li.headerIndex - 1);
  4249. }
  4250. cache[li.headerIndex] = true;
  4251. cacheArr.push(li.headerIndex);
  4252. cache[li.lastIndex + 1] = true;
  4253. }
  4254. if (cache[i] && li.type !== 'optgroup-label') cacheArr.push(i);
  4255. }
  4256. for (var i = 0, cacheLen = cacheArr.length; i < cacheLen; i++) {
  4257. var index = cacheArr[i],
  4258. prevIndex = cacheArr[i - 1],
  4259. li = that.selectpicker.main.data[index],
  4260. liPrev = that.selectpicker.main.data[prevIndex];
  4261. if (li.type !== 'divider' || (li.type === 'divider' && liPrev && liPrev.type !== 'divider' && cacheLen - 1 !== i)) {
  4262. that.selectpicker.search.data.push(li);
  4263. searchMatch.push(that.selectpicker.main.elements[index]);
  4264. }
  4265. }
  4266. that.activeIndex = undefined;
  4267. that.noScroll = true;
  4268. that.$menuInner.scrollTop(0);
  4269. that.selectpicker.search.elements = searchMatch;
  4270. that.createView(true);
  4271. showNoResults.call(that, searchMatch, searchValue);
  4272. } else if (that.selectpicker.search.previousValue) { // for IE11 (#2402)
  4273. that.$menuInner.scrollTop(0);
  4274. that.createView(false);
  4275. }
  4276. that.selectpicker.search.previousValue = searchValue;
  4277. });
  4278. },
  4279. _searchStyle: function () {
  4280. return this.options.liveSearchStyle || 'contains';
  4281. },
  4282. val: function (value) {
  4283. var element = this.$element[0];
  4284. if (typeof value !== 'undefined') {
  4285. var prevValue = getSelectValues(element);
  4286. changedArguments = [null, null, prevValue];
  4287. this.$element
  4288. .val(value)
  4289. .trigger('changed' + EVENT_KEY, changedArguments);
  4290. if (this.$newElement.hasClass(classNames.SHOW)) {
  4291. if (this.multiple) {
  4292. this.setOptionStatus(true);
  4293. } else {
  4294. var liSelectedIndex = (element.options[element.selectedIndex] || {}).liIndex;
  4295. if (typeof liSelectedIndex === 'number') {
  4296. this.setSelected(this.selectedIndex, false);
  4297. this.setSelected(liSelectedIndex, true);
  4298. }
  4299. }
  4300. }
  4301. this.render();
  4302. changedArguments = null;
  4303. return this.$element;
  4304. } else {
  4305. return this.$element.val();
  4306. }
  4307. },
  4308. changeAll: function (status) {
  4309. if (!this.multiple) return;
  4310. if (typeof status === 'undefined') status = true;
  4311. var element = this.$element[0],
  4312. previousSelected = 0,
  4313. currentSelected = 0,
  4314. prevValue = getSelectValues(element);
  4315. element.classList.add('bs-select-hidden');
  4316. for (var i = 0, data = this.selectpicker.current.data, len = data.length; i < len; i++) {
  4317. var liData = data[i],
  4318. option = liData.option;
  4319. if (option && !liData.disabled && liData.type !== 'divider') {
  4320. if (liData.selected) previousSelected++;
  4321. option.selected = status;
  4322. if (status === true) currentSelected++;
  4323. }
  4324. }
  4325. element.classList.remove('bs-select-hidden');
  4326. if (previousSelected === currentSelected) return;
  4327. this.setOptionStatus();
  4328. changedArguments = [null, null, prevValue];
  4329. this.$element
  4330. .triggerNative('change');
  4331. },
  4332. selectAll: function () {
  4333. return this.changeAll(true);
  4334. },
  4335. deselectAll: function () {
  4336. return this.changeAll(false);
  4337. },
  4338. toggle: function (e) {
  4339. e = e || window.event;
  4340. if (e) e.stopPropagation();
  4341. this.$button.trigger('click.bs.dropdown.data-api');
  4342. },
  4343. keydown: function (e) {
  4344. var $this = $(this),
  4345. isToggle = $this.hasClass('dropdown-toggle'),
  4346. $parent = isToggle ? $this.closest('.dropdown') : $this.closest(Selector.MENU),
  4347. that = $parent.data('this'),
  4348. $items = that.findLis(),
  4349. index,
  4350. isActive,
  4351. liActive,
  4352. activeLi,
  4353. offset,
  4354. updateScroll = false,
  4355. downOnTab = e.which === keyCodes.TAB && !isToggle && !that.options.selectOnTab,
  4356. isArrowKey = REGEXP_ARROW.test(e.which) || downOnTab,
  4357. scrollTop = that.$menuInner[0].scrollTop,
  4358. isVirtual = that.isVirtual(),
  4359. position0 = isVirtual === true ? that.selectpicker.view.position0 : 0;
  4360. // do nothing if a function key is pressed
  4361. if (e.which >= 112 && e.which <= 123) return;
  4362. isActive = that.$newElement.hasClass(classNames.SHOW);
  4363. if (
  4364. !isActive &&
  4365. (
  4366. isArrowKey ||
  4367. (e.which >= 48 && e.which <= 57) ||
  4368. (e.which >= 96 && e.which <= 105) ||
  4369. (e.which >= 65 && e.which <= 90)
  4370. )
  4371. ) {
  4372. that.$button.trigger('click.bs.dropdown.data-api');
  4373. if (that.options.liveSearch) {
  4374. that.$searchbox.trigger('focus');
  4375. return;
  4376. }
  4377. }
  4378. if (e.which === keyCodes.ESCAPE && isActive) {
  4379. e.preventDefault();
  4380. that.$button.trigger('click.bs.dropdown.data-api').trigger('focus');
  4381. }
  4382. if (isArrowKey) { // if up or down
  4383. if (!$items.length) return;
  4384. liActive = that.selectpicker.main.elements[that.activeIndex];
  4385. index = liActive ? Array.prototype.indexOf.call(liActive.parentElement.children, liActive) : -1;
  4386. if (index !== -1) {
  4387. that.defocusItem(liActive);
  4388. }
  4389. if (e.which === keyCodes.ARROW_UP) { // up
  4390. if (index !== -1) index--;
  4391. if (index + position0 < 0) index += $items.length;
  4392. if (!that.selectpicker.view.canHighlight[index + position0]) {
  4393. index = that.selectpicker.view.canHighlight.slice(0, index + position0).lastIndexOf(true) - position0;
  4394. if (index === -1) index = $items.length - 1;
  4395. }
  4396. } else if (e.which === keyCodes.ARROW_DOWN || downOnTab) { // down
  4397. index++;
  4398. if (index + position0 >= that.selectpicker.view.canHighlight.length) index = that.selectpicker.view.firstHighlightIndex;
  4399. if (!that.selectpicker.view.canHighlight[index + position0]) {
  4400. index = index + 1 + that.selectpicker.view.canHighlight.slice(index + position0 + 1).indexOf(true);
  4401. }
  4402. }
  4403. e.preventDefault();
  4404. var liActiveIndex = position0 + index;
  4405. if (e.which === keyCodes.ARROW_UP) { // up
  4406. // scroll to bottom and highlight last option
  4407. if (position0 === 0 && index === $items.length - 1) {
  4408. that.$menuInner[0].scrollTop = that.$menuInner[0].scrollHeight;
  4409. liActiveIndex = that.selectpicker.current.elements.length - 1;
  4410. } else {
  4411. activeLi = that.selectpicker.current.data[liActiveIndex];
  4412. offset = activeLi.position - activeLi.height;
  4413. updateScroll = offset < scrollTop;
  4414. }
  4415. } else if (e.which === keyCodes.ARROW_DOWN || downOnTab) { // down
  4416. // scroll to top and highlight first option
  4417. if (index === that.selectpicker.view.firstHighlightIndex) {
  4418. that.$menuInner[0].scrollTop = 0;
  4419. liActiveIndex = that.selectpicker.view.firstHighlightIndex;
  4420. } else {
  4421. activeLi = that.selectpicker.current.data[liActiveIndex];
  4422. offset = activeLi.position - that.sizeInfo.menuInnerHeight;
  4423. updateScroll = offset > scrollTop;
  4424. }
  4425. }
  4426. liActive = that.selectpicker.current.elements[liActiveIndex];
  4427. that.activeIndex = that.selectpicker.current.data[liActiveIndex].index;
  4428. that.focusItem(liActive);
  4429. that.selectpicker.view.currentActive = liActive;
  4430. if (updateScroll) that.$menuInner[0].scrollTop = offset;
  4431. if (that.options.liveSearch) {
  4432. that.$searchbox.trigger('focus');
  4433. } else {
  4434. $this.trigger('focus');
  4435. }
  4436. } else if (
  4437. (!$this.is('input') && !REGEXP_TAB_OR_ESCAPE.test(e.which)) ||
  4438. (e.which === keyCodes.SPACE && that.selectpicker.keydown.keyHistory)
  4439. ) {
  4440. var searchMatch,
  4441. matches = [],
  4442. keyHistory;
  4443. e.preventDefault();
  4444. that.selectpicker.keydown.keyHistory += keyCodeMap[e.which];
  4445. if (that.selectpicker.keydown.resetKeyHistory.cancel) clearTimeout(that.selectpicker.keydown.resetKeyHistory.cancel);
  4446. that.selectpicker.keydown.resetKeyHistory.cancel = that.selectpicker.keydown.resetKeyHistory.start();
  4447. keyHistory = that.selectpicker.keydown.keyHistory;
  4448. // if all letters are the same, set keyHistory to just the first character when searching
  4449. if (/^(.)\1+$/.test(keyHistory)) {
  4450. keyHistory = keyHistory.charAt(0);
  4451. }
  4452. // find matches
  4453. for (var i = 0; i < that.selectpicker.current.data.length; i++) {
  4454. var li = that.selectpicker.current.data[i],
  4455. hasMatch;
  4456. hasMatch = stringSearch(li, keyHistory, 'startsWith', true);
  4457. if (hasMatch && that.selectpicker.view.canHighlight[i]) {
  4458. matches.push(li.index);
  4459. }
  4460. }
  4461. if (matches.length) {
  4462. var matchIndex = 0;
  4463. $items.removeClass('active').find('a').removeClass('active');
  4464. // either only one key has been pressed or they are all the same key
  4465. if (keyHistory.length === 1) {
  4466. matchIndex = matches.indexOf(that.activeIndex);
  4467. if (matchIndex === -1 || matchIndex === matches.length - 1) {
  4468. matchIndex = 0;
  4469. } else {
  4470. matchIndex++;
  4471. }
  4472. }
  4473. searchMatch = matches[matchIndex];
  4474. activeLi = that.selectpicker.main.data[searchMatch];
  4475. if (scrollTop - activeLi.position > 0) {
  4476. offset = activeLi.position - activeLi.height;
  4477. updateScroll = true;
  4478. } else {
  4479. offset = activeLi.position - that.sizeInfo.menuInnerHeight;
  4480. // if the option is already visible at the current scroll position, just keep it the same
  4481. updateScroll = activeLi.position > scrollTop + that.sizeInfo.menuInnerHeight;
  4482. }
  4483. liActive = that.selectpicker.main.elements[searchMatch];
  4484. that.activeIndex = matches[matchIndex];
  4485. that.focusItem(liActive);
  4486. if (liActive) liActive.firstChild.focus();
  4487. if (updateScroll) that.$menuInner[0].scrollTop = offset;
  4488. $this.trigger('focus');
  4489. }
  4490. }
  4491. // Select focused option if "Enter", "Spacebar" or "Tab" (when selectOnTab is true) are pressed inside the menu.
  4492. if (
  4493. isActive &&
  4494. (
  4495. (e.which === keyCodes.SPACE && !that.selectpicker.keydown.keyHistory) ||
  4496. e.which === keyCodes.ENTER ||
  4497. (e.which === keyCodes.TAB && that.options.selectOnTab)
  4498. )
  4499. ) {
  4500. if (e.which !== keyCodes.SPACE) e.preventDefault();
  4501. if (!that.options.liveSearch || e.which !== keyCodes.SPACE) {
  4502. that.$menuInner.find('.active a').trigger('click', true); // retain active class
  4503. $this.trigger('focus');
  4504. if (!that.options.liveSearch) {
  4505. // Prevent screen from scrolling if the user hits the spacebar
  4506. e.preventDefault();
  4507. // Fixes spacebar selection of dropdown items in FF & IE
  4508. $(document).data('spaceSelect', true);
  4509. }
  4510. }
  4511. }
  4512. },
  4513. mobile: function () {
  4514. // ensure mobile is set to true if mobile function is called after init
  4515. this.options.mobile = true;
  4516. this.$element[0].classList.add('mobile-device');
  4517. },
  4518. refresh: function () {
  4519. // update options if data attributes have been changed
  4520. var config = $.extend({}, this.options, this.$element.data());
  4521. this.options = config;
  4522. this.checkDisabled();
  4523. this.buildData();
  4524. this.setStyle();
  4525. this.render();
  4526. this.buildList();
  4527. this.setWidth();
  4528. this.setSize(true);
  4529. this.$element.trigger('refreshed' + EVENT_KEY);
  4530. },
  4531. hide: function () {
  4532. this.$newElement.hide();
  4533. },
  4534. show: function () {
  4535. this.$newElement.show();
  4536. },
  4537. remove: function () {
  4538. this.$newElement.remove();
  4539. this.$element.remove();
  4540. },
  4541. destroy: function () {
  4542. this.$newElement.before(this.$element).remove();
  4543. if (this.$bsContainer) {
  4544. this.$bsContainer.remove();
  4545. } else {
  4546. this.$menu.remove();
  4547. }
  4548. if (this.selectpicker.view.titleOption && this.selectpicker.view.titleOption.parentNode) {
  4549. this.selectpicker.view.titleOption.parentNode.removeChild(this.selectpicker.view.titleOption);
  4550. }
  4551. this.$element
  4552. .off(EVENT_KEY)
  4553. .removeData('selectpicker')
  4554. .removeClass('bs-select-hidden selectpicker');
  4555. $(window).off(EVENT_KEY + '.' + this.selectId);
  4556. }
  4557. };
  4558. // SELECTPICKER PLUGIN DEFINITION
  4559. // ==============================
  4560. function Plugin (option) {
  4561. // get the args of the outer function..
  4562. var args = arguments;
  4563. // The arguments of the function are explicitly re-defined from the argument list, because the shift causes them
  4564. // to get lost/corrupted in android 2.3 and IE9 #715 #775
  4565. var _option = option;
  4566. [].shift.apply(args);
  4567. // if the version was not set successfully
  4568. if (!version.success) {
  4569. // try to retreive it again
  4570. try {
  4571. version.full = ($.fn.dropdown.Constructor.VERSION || '').split(' ')[0].split('.');
  4572. } catch (err) {
  4573. // fall back to use BootstrapVersion if set
  4574. if (Selectpicker.BootstrapVersion) {
  4575. version.full = Selectpicker.BootstrapVersion.split(' ')[0].split('.');
  4576. } else {
  4577. version.full = [version.major, '0', '0'];
  4578. console.warn(
  4579. 'There was an issue retrieving Bootstrap\'s version. ' +
  4580. 'Ensure Bootstrap is being loaded before bootstrap-select and there is no namespace collision. ' +
  4581. 'If loading Bootstrap asynchronously, the version may need to be manually specified via $.fn.selectpicker.Constructor.BootstrapVersion.',
  4582. err
  4583. );
  4584. }
  4585. }
  4586. version.major = version.full[0];
  4587. version.success = true;
  4588. }
  4589. if (version.major === '4') {
  4590. // some defaults need to be changed if using Bootstrap 4
  4591. // check to see if they have already been manually changed before forcing them to update
  4592. var toUpdate = [];
  4593. if (Selectpicker.DEFAULTS.style === classNames.BUTTONCLASS) toUpdate.push({ name: 'style', className: 'BUTTONCLASS' });
  4594. if (Selectpicker.DEFAULTS.iconBase === classNames.ICONBASE) toUpdate.push({ name: 'iconBase', className: 'ICONBASE' });
  4595. if (Selectpicker.DEFAULTS.tickIcon === classNames.TICKICON) toUpdate.push({ name: 'tickIcon', className: 'TICKICON' });
  4596. classNames.DIVIDER = 'dropdown-divider';
  4597. classNames.SHOW = 'show';
  4598. classNames.BUTTONCLASS = 'btn-light';
  4599. classNames.POPOVERHEADER = 'popover-header';
  4600. classNames.ICONBASE = '';
  4601. classNames.TICKICON = 'bs-ok-default';
  4602. for (var i = 0; i < toUpdate.length; i++) {
  4603. var option = toUpdate[i];
  4604. Selectpicker.DEFAULTS[option.name] = classNames[option.className];
  4605. }
  4606. }
  4607. var value;
  4608. var chain = this.each(function () {
  4609. var $this = $(this);
  4610. if ($this.is('select')) {
  4611. var data = $this.data('selectpicker'),
  4612. options = typeof _option == 'object' && _option;
  4613. if (!data) {
  4614. var dataAttributes = $this.data();
  4615. for (var dataAttr in dataAttributes) {
  4616. if (Object.prototype.hasOwnProperty.call(dataAttributes, dataAttr) && $.inArray(dataAttr, DISALLOWED_ATTRIBUTES) !== -1) {
  4617. delete dataAttributes[dataAttr];
  4618. }
  4619. }
  4620. var config = $.extend({}, Selectpicker.DEFAULTS, $.fn.selectpicker.defaults || {}, dataAttributes, options);
  4621. config.template = $.extend({}, Selectpicker.DEFAULTS.template, ($.fn.selectpicker.defaults ? $.fn.selectpicker.defaults.template : {}), dataAttributes.template, options.template);
  4622. $this.data('selectpicker', (data = new Selectpicker(this, config)));
  4623. } else if (options) {
  4624. for (var i in options) {
  4625. if (Object.prototype.hasOwnProperty.call(options, i)) {
  4626. data.options[i] = options[i];
  4627. }
  4628. }
  4629. }
  4630. if (typeof _option == 'string') {
  4631. if (data[_option] instanceof Function) {
  4632. value = data[_option].apply(data, args);
  4633. } else {
  4634. value = data.options[_option];
  4635. }
  4636. }
  4637. }
  4638. });
  4639. if (typeof value !== 'undefined') {
  4640. // noinspection JSUnusedAssignment
  4641. return value;
  4642. } else {
  4643. return chain;
  4644. }
  4645. }
  4646. var old = $.fn.selectpicker;
  4647. $.fn.selectpicker = Plugin;
  4648. $.fn.selectpicker.Constructor = Selectpicker;
  4649. // SELECTPICKER NO CONFLICT
  4650. // ========================
  4651. $.fn.selectpicker.noConflict = function () {
  4652. $.fn.selectpicker = old;
  4653. return this;
  4654. };
  4655. // get Bootstrap's keydown event handler for either Bootstrap 4 or Bootstrap 3
  4656. function keydownHandler () {
  4657. if ($.fn.dropdown) {
  4658. // wait to define until function is called in case Bootstrap isn't loaded yet
  4659. var bootstrapKeydown = $.fn.dropdown.Constructor._dataApiKeydownHandler || $.fn.dropdown.Constructor.prototype.keydown;
  4660. return bootstrapKeydown.apply(this, arguments);
  4661. }
  4662. }
  4663. $(document)
  4664. .off('keydown.bs.dropdown.data-api')
  4665. .on('keydown.bs.dropdown.data-api', ':not(.bootstrap-select) > [data-toggle="dropdown"]', keydownHandler)
  4666. .on('keydown.bs.dropdown.data-api', ':not(.bootstrap-select) > .dropdown-menu', keydownHandler)
  4667. .on('keydown' + EVENT_KEY, '.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input', Selectpicker.prototype.keydown)
  4668. .on('focusin.modal', '.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input', function (e) {
  4669. e.stopPropagation();
  4670. });
  4671. // SELECTPICKER DATA-API
  4672. // =====================
  4673. $(window).on('load' + EVENT_KEY + '.data-api', function () {
  4674. $('.selectpicker').each(function () {
  4675. var $selectpicker = $(this);
  4676. Plugin.call($selectpicker, $selectpicker.data());
  4677. })
  4678. });
  4679. })(jQuery);
  4680. }));
  4681. //# sourceMappingURL=bootstrap-select.js.map
  4682. /***/ }),
  4683. /***/ "./node_modules/bootstrap/dist/js/bootstrap.js":
  4684. /*!*****************************************************!*\
  4685. !*** ./node_modules/bootstrap/dist/js/bootstrap.js ***!
  4686. \*****************************************************/
  4687. /*! no static exports found */
  4688. /***/ (function(module, exports, __webpack_require__) {
  4689. /*!
  4690. * Bootstrap v4.5.0 (https://getbootstrap.com/)
  4691. * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
  4692. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  4693. */
  4694. (function (global, factory) {
  4695. true ? factory(exports, __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"), __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js")) :
  4696. undefined;
  4697. }(this, (function (exports, $, Popper) { 'use strict';
  4698. $ = $ && Object.prototype.hasOwnProperty.call($, 'default') ? $['default'] : $;
  4699. Popper = Popper && Object.prototype.hasOwnProperty.call(Popper, 'default') ? Popper['default'] : Popper;
  4700. function _defineProperties(target, props) {
  4701. for (var i = 0; i < props.length; i++) {
  4702. var descriptor = props[i];
  4703. descriptor.enumerable = descriptor.enumerable || false;
  4704. descriptor.configurable = true;
  4705. if ("value" in descriptor) descriptor.writable = true;
  4706. Object.defineProperty(target, descriptor.key, descriptor);
  4707. }
  4708. }
  4709. function _createClass(Constructor, protoProps, staticProps) {
  4710. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  4711. if (staticProps) _defineProperties(Constructor, staticProps);
  4712. return Constructor;
  4713. }
  4714. function _defineProperty(obj, key, value) {
  4715. if (key in obj) {
  4716. Object.defineProperty(obj, key, {
  4717. value: value,
  4718. enumerable: true,
  4719. configurable: true,
  4720. writable: true
  4721. });
  4722. } else {
  4723. obj[key] = value;
  4724. }
  4725. return obj;
  4726. }
  4727. function ownKeys(object, enumerableOnly) {
  4728. var keys = Object.keys(object);
  4729. if (Object.getOwnPropertySymbols) {
  4730. var symbols = Object.getOwnPropertySymbols(object);
  4731. if (enumerableOnly) symbols = symbols.filter(function (sym) {
  4732. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  4733. });
  4734. keys.push.apply(keys, symbols);
  4735. }
  4736. return keys;
  4737. }
  4738. function _objectSpread2(target) {
  4739. for (var i = 1; i < arguments.length; i++) {
  4740. var source = arguments[i] != null ? arguments[i] : {};
  4741. if (i % 2) {
  4742. ownKeys(Object(source), true).forEach(function (key) {
  4743. _defineProperty(target, key, source[key]);
  4744. });
  4745. } else if (Object.getOwnPropertyDescriptors) {
  4746. Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
  4747. } else {
  4748. ownKeys(Object(source)).forEach(function (key) {
  4749. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  4750. });
  4751. }
  4752. }
  4753. return target;
  4754. }
  4755. function _inheritsLoose(subClass, superClass) {
  4756. subClass.prototype = Object.create(superClass.prototype);
  4757. subClass.prototype.constructor = subClass;
  4758. subClass.__proto__ = superClass;
  4759. }
  4760. /**
  4761. * --------------------------------------------------------------------------
  4762. * Bootstrap (v4.5.0): util.js
  4763. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  4764. * --------------------------------------------------------------------------
  4765. */
  4766. /**
  4767. * ------------------------------------------------------------------------
  4768. * Private TransitionEnd Helpers
  4769. * ------------------------------------------------------------------------
  4770. */
  4771. var TRANSITION_END = 'transitionend';
  4772. var MAX_UID = 1000000;
  4773. var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
  4774. function toType(obj) {
  4775. if (obj === null || typeof obj === 'undefined') {
  4776. return "" + obj;
  4777. }
  4778. return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
  4779. }
  4780. function getSpecialTransitionEndEvent() {
  4781. return {
  4782. bindType: TRANSITION_END,
  4783. delegateType: TRANSITION_END,
  4784. handle: function handle(event) {
  4785. if ($(event.target).is(this)) {
  4786. return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
  4787. }
  4788. return undefined;
  4789. }
  4790. };
  4791. }
  4792. function transitionEndEmulator(duration) {
  4793. var _this = this;
  4794. var called = false;
  4795. $(this).one(Util.TRANSITION_END, function () {
  4796. called = true;
  4797. });
  4798. setTimeout(function () {
  4799. if (!called) {
  4800. Util.triggerTransitionEnd(_this);
  4801. }
  4802. }, duration);
  4803. return this;
  4804. }
  4805. function setTransitionEndSupport() {
  4806. $.fn.emulateTransitionEnd = transitionEndEmulator;
  4807. $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
  4808. }
  4809. /**
  4810. * --------------------------------------------------------------------------
  4811. * Public Util Api
  4812. * --------------------------------------------------------------------------
  4813. */
  4814. var Util = {
  4815. TRANSITION_END: 'bsTransitionEnd',
  4816. getUID: function getUID(prefix) {
  4817. do {
  4818. // eslint-disable-next-line no-bitwise
  4819. prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
  4820. } while (document.getElementById(prefix));
  4821. return prefix;
  4822. },
  4823. getSelectorFromElement: function getSelectorFromElement(element) {
  4824. var selector = element.getAttribute('data-target');
  4825. if (!selector || selector === '#') {
  4826. var hrefAttr = element.getAttribute('href');
  4827. selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';
  4828. }
  4829. try {
  4830. return document.querySelector(selector) ? selector : null;
  4831. } catch (err) {
  4832. return null;
  4833. }
  4834. },
  4835. getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
  4836. if (!element) {
  4837. return 0;
  4838. } // Get transition-duration of the element
  4839. var transitionDuration = $(element).css('transition-duration');
  4840. var transitionDelay = $(element).css('transition-delay');
  4841. var floatTransitionDuration = parseFloat(transitionDuration);
  4842. var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
  4843. if (!floatTransitionDuration && !floatTransitionDelay) {
  4844. return 0;
  4845. } // If multiple durations are defined, take the first
  4846. transitionDuration = transitionDuration.split(',')[0];
  4847. transitionDelay = transitionDelay.split(',')[0];
  4848. return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
  4849. },
  4850. reflow: function reflow(element) {
  4851. return element.offsetHeight;
  4852. },
  4853. triggerTransitionEnd: function triggerTransitionEnd(element) {
  4854. $(element).trigger(TRANSITION_END);
  4855. },
  4856. // TODO: Remove in v5
  4857. supportsTransitionEnd: function supportsTransitionEnd() {
  4858. return Boolean(TRANSITION_END);
  4859. },
  4860. isElement: function isElement(obj) {
  4861. return (obj[0] || obj).nodeType;
  4862. },
  4863. typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
  4864. for (var property in configTypes) {
  4865. if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
  4866. var expectedTypes = configTypes[property];
  4867. var value = config[property];
  4868. var valueType = value && Util.isElement(value) ? 'element' : toType(value);
  4869. if (!new RegExp(expectedTypes).test(valueType)) {
  4870. throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
  4871. }
  4872. }
  4873. }
  4874. },
  4875. findShadowRoot: function findShadowRoot(element) {
  4876. if (!document.documentElement.attachShadow) {
  4877. return null;
  4878. } // Can find the shadow root otherwise it'll return the document
  4879. if (typeof element.getRootNode === 'function') {
  4880. var root = element.getRootNode();
  4881. return root instanceof ShadowRoot ? root : null;
  4882. }
  4883. if (element instanceof ShadowRoot) {
  4884. return element;
  4885. } // when we don't find a shadow root
  4886. if (!element.parentNode) {
  4887. return null;
  4888. }
  4889. return Util.findShadowRoot(element.parentNode);
  4890. },
  4891. jQueryDetection: function jQueryDetection() {
  4892. if (typeof $ === 'undefined') {
  4893. throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
  4894. }
  4895. var version = $.fn.jquery.split(' ')[0].split('.');
  4896. var minMajor = 1;
  4897. var ltMajor = 2;
  4898. var minMinor = 9;
  4899. var minPatch = 1;
  4900. var maxMajor = 4;
  4901. if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
  4902. throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
  4903. }
  4904. }
  4905. };
  4906. Util.jQueryDetection();
  4907. setTransitionEndSupport();
  4908. /**
  4909. * ------------------------------------------------------------------------
  4910. * Constants
  4911. * ------------------------------------------------------------------------
  4912. */
  4913. var NAME = 'alert';
  4914. var VERSION = '4.5.0';
  4915. var DATA_KEY = 'bs.alert';
  4916. var EVENT_KEY = "." + DATA_KEY;
  4917. var DATA_API_KEY = '.data-api';
  4918. var JQUERY_NO_CONFLICT = $.fn[NAME];
  4919. var SELECTOR_DISMISS = '[data-dismiss="alert"]';
  4920. var EVENT_CLOSE = "close" + EVENT_KEY;
  4921. var EVENT_CLOSED = "closed" + EVENT_KEY;
  4922. var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
  4923. var CLASS_NAME_ALERT = 'alert';
  4924. var CLASS_NAME_FADE = 'fade';
  4925. var CLASS_NAME_SHOW = 'show';
  4926. /**
  4927. * ------------------------------------------------------------------------
  4928. * Class Definition
  4929. * ------------------------------------------------------------------------
  4930. */
  4931. var Alert = /*#__PURE__*/function () {
  4932. function Alert(element) {
  4933. this._element = element;
  4934. } // Getters
  4935. var _proto = Alert.prototype;
  4936. // Public
  4937. _proto.close = function close(element) {
  4938. var rootElement = this._element;
  4939. if (element) {
  4940. rootElement = this._getRootElement(element);
  4941. }
  4942. var customEvent = this._triggerCloseEvent(rootElement);
  4943. if (customEvent.isDefaultPrevented()) {
  4944. return;
  4945. }
  4946. this._removeElement(rootElement);
  4947. };
  4948. _proto.dispose = function dispose() {
  4949. $.removeData(this._element, DATA_KEY);
  4950. this._element = null;
  4951. } // Private
  4952. ;
  4953. _proto._getRootElement = function _getRootElement(element) {
  4954. var selector = Util.getSelectorFromElement(element);
  4955. var parent = false;
  4956. if (selector) {
  4957. parent = document.querySelector(selector);
  4958. }
  4959. if (!parent) {
  4960. parent = $(element).closest("." + CLASS_NAME_ALERT)[0];
  4961. }
  4962. return parent;
  4963. };
  4964. _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
  4965. var closeEvent = $.Event(EVENT_CLOSE);
  4966. $(element).trigger(closeEvent);
  4967. return closeEvent;
  4968. };
  4969. _proto._removeElement = function _removeElement(element) {
  4970. var _this = this;
  4971. $(element).removeClass(CLASS_NAME_SHOW);
  4972. if (!$(element).hasClass(CLASS_NAME_FADE)) {
  4973. this._destroyElement(element);
  4974. return;
  4975. }
  4976. var transitionDuration = Util.getTransitionDurationFromElement(element);
  4977. $(element).one(Util.TRANSITION_END, function (event) {
  4978. return _this._destroyElement(element, event);
  4979. }).emulateTransitionEnd(transitionDuration);
  4980. };
  4981. _proto._destroyElement = function _destroyElement(element) {
  4982. $(element).detach().trigger(EVENT_CLOSED).remove();
  4983. } // Static
  4984. ;
  4985. Alert._jQueryInterface = function _jQueryInterface(config) {
  4986. return this.each(function () {
  4987. var $element = $(this);
  4988. var data = $element.data(DATA_KEY);
  4989. if (!data) {
  4990. data = new Alert(this);
  4991. $element.data(DATA_KEY, data);
  4992. }
  4993. if (config === 'close') {
  4994. data[config](this);
  4995. }
  4996. });
  4997. };
  4998. Alert._handleDismiss = function _handleDismiss(alertInstance) {
  4999. return function (event) {
  5000. if (event) {
  5001. event.preventDefault();
  5002. }
  5003. alertInstance.close(this);
  5004. };
  5005. };
  5006. _createClass(Alert, null, [{
  5007. key: "VERSION",
  5008. get: function get() {
  5009. return VERSION;
  5010. }
  5011. }]);
  5012. return Alert;
  5013. }();
  5014. /**
  5015. * ------------------------------------------------------------------------
  5016. * Data Api implementation
  5017. * ------------------------------------------------------------------------
  5018. */
  5019. $(document).on(EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert._handleDismiss(new Alert()));
  5020. /**
  5021. * ------------------------------------------------------------------------
  5022. * jQuery
  5023. * ------------------------------------------------------------------------
  5024. */
  5025. $.fn[NAME] = Alert._jQueryInterface;
  5026. $.fn[NAME].Constructor = Alert;
  5027. $.fn[NAME].noConflict = function () {
  5028. $.fn[NAME] = JQUERY_NO_CONFLICT;
  5029. return Alert._jQueryInterface;
  5030. };
  5031. /**
  5032. * ------------------------------------------------------------------------
  5033. * Constants
  5034. * ------------------------------------------------------------------------
  5035. */
  5036. var NAME$1 = 'button';
  5037. var VERSION$1 = '4.5.0';
  5038. var DATA_KEY$1 = 'bs.button';
  5039. var EVENT_KEY$1 = "." + DATA_KEY$1;
  5040. var DATA_API_KEY$1 = '.data-api';
  5041. var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1];
  5042. var CLASS_NAME_ACTIVE = 'active';
  5043. var CLASS_NAME_BUTTON = 'btn';
  5044. var CLASS_NAME_FOCUS = 'focus';
  5045. var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]';
  5046. var SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]';
  5047. var SELECTOR_DATA_TOGGLE = '[data-toggle="button"]';
  5048. var SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle="buttons"] .btn';
  5049. var SELECTOR_INPUT = 'input:not([type="hidden"])';
  5050. var SELECTOR_ACTIVE = '.active';
  5051. var SELECTOR_BUTTON = '.btn';
  5052. var EVENT_CLICK_DATA_API$1 = "click" + EVENT_KEY$1 + DATA_API_KEY$1;
  5053. var EVENT_FOCUS_BLUR_DATA_API = "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1);
  5054. var EVENT_LOAD_DATA_API = "load" + EVENT_KEY$1 + DATA_API_KEY$1;
  5055. /**
  5056. * ------------------------------------------------------------------------
  5057. * Class Definition
  5058. * ------------------------------------------------------------------------
  5059. */
  5060. var Button = /*#__PURE__*/function () {
  5061. function Button(element) {
  5062. this._element = element;
  5063. } // Getters
  5064. var _proto = Button.prototype;
  5065. // Public
  5066. _proto.toggle = function toggle() {
  5067. var triggerChangeEvent = true;
  5068. var addAriaPressed = true;
  5069. var rootElement = $(this._element).closest(SELECTOR_DATA_TOGGLES)[0];
  5070. if (rootElement) {
  5071. var input = this._element.querySelector(SELECTOR_INPUT);
  5072. if (input) {
  5073. if (input.type === 'radio') {
  5074. if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE)) {
  5075. triggerChangeEvent = false;
  5076. } else {
  5077. var activeElement = rootElement.querySelector(SELECTOR_ACTIVE);
  5078. if (activeElement) {
  5079. $(activeElement).removeClass(CLASS_NAME_ACTIVE);
  5080. }
  5081. }
  5082. }
  5083. if (triggerChangeEvent) {
  5084. // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input
  5085. if (input.type === 'checkbox' || input.type === 'radio') {
  5086. input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE);
  5087. }
  5088. $(input).trigger('change');
  5089. }
  5090. input.focus();
  5091. addAriaPressed = false;
  5092. }
  5093. }
  5094. if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {
  5095. if (addAriaPressed) {
  5096. this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE));
  5097. }
  5098. if (triggerChangeEvent) {
  5099. $(this._element).toggleClass(CLASS_NAME_ACTIVE);
  5100. }
  5101. }
  5102. };
  5103. _proto.dispose = function dispose() {
  5104. $.removeData(this._element, DATA_KEY$1);
  5105. this._element = null;
  5106. } // Static
  5107. ;
  5108. Button._jQueryInterface = function _jQueryInterface(config) {
  5109. return this.each(function () {
  5110. var data = $(this).data(DATA_KEY$1);
  5111. if (!data) {
  5112. data = new Button(this);
  5113. $(this).data(DATA_KEY$1, data);
  5114. }
  5115. if (config === 'toggle') {
  5116. data[config]();
  5117. }
  5118. });
  5119. };
  5120. _createClass(Button, null, [{
  5121. key: "VERSION",
  5122. get: function get() {
  5123. return VERSION$1;
  5124. }
  5125. }]);
  5126. return Button;
  5127. }();
  5128. /**
  5129. * ------------------------------------------------------------------------
  5130. * Data Api implementation
  5131. * ------------------------------------------------------------------------
  5132. */
  5133. $(document).on(EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
  5134. var button = event.target;
  5135. var initialButton = button;
  5136. if (!$(button).hasClass(CLASS_NAME_BUTTON)) {
  5137. button = $(button).closest(SELECTOR_BUTTON)[0];
  5138. }
  5139. if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {
  5140. event.preventDefault(); // work around Firefox bug #1540995
  5141. } else {
  5142. var inputBtn = button.querySelector(SELECTOR_INPUT);
  5143. if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) {
  5144. event.preventDefault(); // work around Firefox bug #1540995
  5145. return;
  5146. }
  5147. if (initialButton.tagName === 'LABEL' && inputBtn && inputBtn.type === 'checkbox') {
  5148. event.preventDefault(); // work around event sent to label and input
  5149. }
  5150. Button._jQueryInterface.call($(button), 'toggle');
  5151. }
  5152. }).on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
  5153. var button = $(event.target).closest(SELECTOR_BUTTON)[0];
  5154. $(button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type));
  5155. });
  5156. $(window).on(EVENT_LOAD_DATA_API, function () {
  5157. // ensure correct active class is set to match the controls' actual values/states
  5158. // find all checkboxes/readio buttons inside data-toggle groups
  5159. var buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS));
  5160. for (var i = 0, len = buttons.length; i < len; i++) {
  5161. var button = buttons[i];
  5162. var input = button.querySelector(SELECTOR_INPUT);
  5163. if (input.checked || input.hasAttribute('checked')) {
  5164. button.classList.add(CLASS_NAME_ACTIVE);
  5165. } else {
  5166. button.classList.remove(CLASS_NAME_ACTIVE);
  5167. }
  5168. } // find all button toggles
  5169. buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE));
  5170. for (var _i = 0, _len = buttons.length; _i < _len; _i++) {
  5171. var _button = buttons[_i];
  5172. if (_button.getAttribute('aria-pressed') === 'true') {
  5173. _button.classList.add(CLASS_NAME_ACTIVE);
  5174. } else {
  5175. _button.classList.remove(CLASS_NAME_ACTIVE);
  5176. }
  5177. }
  5178. });
  5179. /**
  5180. * ------------------------------------------------------------------------
  5181. * jQuery
  5182. * ------------------------------------------------------------------------
  5183. */
  5184. $.fn[NAME$1] = Button._jQueryInterface;
  5185. $.fn[NAME$1].Constructor = Button;
  5186. $.fn[NAME$1].noConflict = function () {
  5187. $.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
  5188. return Button._jQueryInterface;
  5189. };
  5190. /**
  5191. * ------------------------------------------------------------------------
  5192. * Constants
  5193. * ------------------------------------------------------------------------
  5194. */
  5195. var NAME$2 = 'carousel';
  5196. var VERSION$2 = '4.5.0';
  5197. var DATA_KEY$2 = 'bs.carousel';
  5198. var EVENT_KEY$2 = "." + DATA_KEY$2;
  5199. var DATA_API_KEY$2 = '.data-api';
  5200. var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2];
  5201. var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
  5202. var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
  5203. var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
  5204. var SWIPE_THRESHOLD = 40;
  5205. var Default = {
  5206. interval: 5000,
  5207. keyboard: true,
  5208. slide: false,
  5209. pause: 'hover',
  5210. wrap: true,
  5211. touch: true
  5212. };
  5213. var DefaultType = {
  5214. interval: '(number|boolean)',
  5215. keyboard: 'boolean',
  5216. slide: '(boolean|string)',
  5217. pause: '(string|boolean)',
  5218. wrap: 'boolean',
  5219. touch: 'boolean'
  5220. };
  5221. var DIRECTION_NEXT = 'next';
  5222. var DIRECTION_PREV = 'prev';
  5223. var DIRECTION_LEFT = 'left';
  5224. var DIRECTION_RIGHT = 'right';
  5225. var EVENT_SLIDE = "slide" + EVENT_KEY$2;
  5226. var EVENT_SLID = "slid" + EVENT_KEY$2;
  5227. var EVENT_KEYDOWN = "keydown" + EVENT_KEY$2;
  5228. var EVENT_MOUSEENTER = "mouseenter" + EVENT_KEY$2;
  5229. var EVENT_MOUSELEAVE = "mouseleave" + EVENT_KEY$2;
  5230. var EVENT_TOUCHSTART = "touchstart" + EVENT_KEY$2;
  5231. var EVENT_TOUCHMOVE = "touchmove" + EVENT_KEY$2;
  5232. var EVENT_TOUCHEND = "touchend" + EVENT_KEY$2;
  5233. var EVENT_POINTERDOWN = "pointerdown" + EVENT_KEY$2;
  5234. var EVENT_POINTERUP = "pointerup" + EVENT_KEY$2;
  5235. var EVENT_DRAG_START = "dragstart" + EVENT_KEY$2;
  5236. var EVENT_LOAD_DATA_API$1 = "load" + EVENT_KEY$2 + DATA_API_KEY$2;
  5237. var EVENT_CLICK_DATA_API$2 = "click" + EVENT_KEY$2 + DATA_API_KEY$2;
  5238. var CLASS_NAME_CAROUSEL = 'carousel';
  5239. var CLASS_NAME_ACTIVE$1 = 'active';
  5240. var CLASS_NAME_SLIDE = 'slide';
  5241. var CLASS_NAME_RIGHT = 'carousel-item-right';
  5242. var CLASS_NAME_LEFT = 'carousel-item-left';
  5243. var CLASS_NAME_NEXT = 'carousel-item-next';
  5244. var CLASS_NAME_PREV = 'carousel-item-prev';
  5245. var CLASS_NAME_POINTER_EVENT = 'pointer-event';
  5246. var SELECTOR_ACTIVE$1 = '.active';
  5247. var SELECTOR_ACTIVE_ITEM = '.active.carousel-item';
  5248. var SELECTOR_ITEM = '.carousel-item';
  5249. var SELECTOR_ITEM_IMG = '.carousel-item img';
  5250. var SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev';
  5251. var SELECTOR_INDICATORS = '.carousel-indicators';
  5252. var SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]';
  5253. var SELECTOR_DATA_RIDE = '[data-ride="carousel"]';
  5254. var PointerType = {
  5255. TOUCH: 'touch',
  5256. PEN: 'pen'
  5257. };
  5258. /**
  5259. * ------------------------------------------------------------------------
  5260. * Class Definition
  5261. * ------------------------------------------------------------------------
  5262. */
  5263. var Carousel = /*#__PURE__*/function () {
  5264. function Carousel(element, config) {
  5265. this._items = null;
  5266. this._interval = null;
  5267. this._activeElement = null;
  5268. this._isPaused = false;
  5269. this._isSliding = false;
  5270. this.touchTimeout = null;
  5271. this.touchStartX = 0;
  5272. this.touchDeltaX = 0;
  5273. this._config = this._getConfig(config);
  5274. this._element = element;
  5275. this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS);
  5276. this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
  5277. this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);
  5278. this._addEventListeners();
  5279. } // Getters
  5280. var _proto = Carousel.prototype;
  5281. // Public
  5282. _proto.next = function next() {
  5283. if (!this._isSliding) {
  5284. this._slide(DIRECTION_NEXT);
  5285. }
  5286. };
  5287. _proto.nextWhenVisible = function nextWhenVisible() {
  5288. // Don't call next when the page isn't visible
  5289. // or the carousel or its parent isn't visible
  5290. if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {
  5291. this.next();
  5292. }
  5293. };
  5294. _proto.prev = function prev() {
  5295. if (!this._isSliding) {
  5296. this._slide(DIRECTION_PREV);
  5297. }
  5298. };
  5299. _proto.pause = function pause(event) {
  5300. if (!event) {
  5301. this._isPaused = true;
  5302. }
  5303. if (this._element.querySelector(SELECTOR_NEXT_PREV)) {
  5304. Util.triggerTransitionEnd(this._element);
  5305. this.cycle(true);
  5306. }
  5307. clearInterval(this._interval);
  5308. this._interval = null;
  5309. };
  5310. _proto.cycle = function cycle(event) {
  5311. if (!event) {
  5312. this._isPaused = false;
  5313. }
  5314. if (this._interval) {
  5315. clearInterval(this._interval);
  5316. this._interval = null;
  5317. }
  5318. if (this._config.interval && !this._isPaused) {
  5319. this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
  5320. }
  5321. };
  5322. _proto.to = function to(index) {
  5323. var _this = this;
  5324. this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);
  5325. var activeIndex = this._getItemIndex(this._activeElement);
  5326. if (index > this._items.length - 1 || index < 0) {
  5327. return;
  5328. }
  5329. if (this._isSliding) {
  5330. $(this._element).one(EVENT_SLID, function () {
  5331. return _this.to(index);
  5332. });
  5333. return;
  5334. }
  5335. if (activeIndex === index) {
  5336. this.pause();
  5337. this.cycle();
  5338. return;
  5339. }
  5340. var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV;
  5341. this._slide(direction, this._items[index]);
  5342. };
  5343. _proto.dispose = function dispose() {
  5344. $(this._element).off(EVENT_KEY$2);
  5345. $.removeData(this._element, DATA_KEY$2);
  5346. this._items = null;
  5347. this._config = null;
  5348. this._element = null;
  5349. this._interval = null;
  5350. this._isPaused = null;
  5351. this._isSliding = null;
  5352. this._activeElement = null;
  5353. this._indicatorsElement = null;
  5354. } // Private
  5355. ;
  5356. _proto._getConfig = function _getConfig(config) {
  5357. config = _objectSpread2(_objectSpread2({}, Default), config);
  5358. Util.typeCheckConfig(NAME$2, config, DefaultType);
  5359. return config;
  5360. };
  5361. _proto._handleSwipe = function _handleSwipe() {
  5362. var absDeltax = Math.abs(this.touchDeltaX);
  5363. if (absDeltax <= SWIPE_THRESHOLD) {
  5364. return;
  5365. }
  5366. var direction = absDeltax / this.touchDeltaX;
  5367. this.touchDeltaX = 0; // swipe left
  5368. if (direction > 0) {
  5369. this.prev();
  5370. } // swipe right
  5371. if (direction < 0) {
  5372. this.next();
  5373. }
  5374. };
  5375. _proto._addEventListeners = function _addEventListeners() {
  5376. var _this2 = this;
  5377. if (this._config.keyboard) {
  5378. $(this._element).on(EVENT_KEYDOWN, function (event) {
  5379. return _this2._keydown(event);
  5380. });
  5381. }
  5382. if (this._config.pause === 'hover') {
  5383. $(this._element).on(EVENT_MOUSEENTER, function (event) {
  5384. return _this2.pause(event);
  5385. }).on(EVENT_MOUSELEAVE, function (event) {
  5386. return _this2.cycle(event);
  5387. });
  5388. }
  5389. if (this._config.touch) {
  5390. this._addTouchEventListeners();
  5391. }
  5392. };
  5393. _proto._addTouchEventListeners = function _addTouchEventListeners() {
  5394. var _this3 = this;
  5395. if (!this._touchSupported) {
  5396. return;
  5397. }
  5398. var start = function start(event) {
  5399. if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
  5400. _this3.touchStartX = event.originalEvent.clientX;
  5401. } else if (!_this3._pointerEvent) {
  5402. _this3.touchStartX = event.originalEvent.touches[0].clientX;
  5403. }
  5404. };
  5405. var move = function move(event) {
  5406. // ensure swiping with one touch and not pinching
  5407. if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
  5408. _this3.touchDeltaX = 0;
  5409. } else {
  5410. _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX;
  5411. }
  5412. };
  5413. var end = function end(event) {
  5414. if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
  5415. _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;
  5416. }
  5417. _this3._handleSwipe();
  5418. if (_this3._config.pause === 'hover') {
  5419. // If it's a touch-enabled device, mouseenter/leave are fired as
  5420. // part of the mouse compatibility events on first tap - the carousel
  5421. // would stop cycling until user tapped out of it;
  5422. // here, we listen for touchend, explicitly pause the carousel
  5423. // (as if it's the second time we tap on it, mouseenter compat event
  5424. // is NOT fired) and after a timeout (to allow for mouse compatibility
  5425. // events to fire) we explicitly restart cycling
  5426. _this3.pause();
  5427. if (_this3.touchTimeout) {
  5428. clearTimeout(_this3.touchTimeout);
  5429. }
  5430. _this3.touchTimeout = setTimeout(function (event) {
  5431. return _this3.cycle(event);
  5432. }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
  5433. }
  5434. };
  5435. $(this._element.querySelectorAll(SELECTOR_ITEM_IMG)).on(EVENT_DRAG_START, function (e) {
  5436. return e.preventDefault();
  5437. });
  5438. if (this._pointerEvent) {
  5439. $(this._element).on(EVENT_POINTERDOWN, function (event) {
  5440. return start(event);
  5441. });
  5442. $(this._element).on(EVENT_POINTERUP, function (event) {
  5443. return end(event);
  5444. });
  5445. this._element.classList.add(CLASS_NAME_POINTER_EVENT);
  5446. } else {
  5447. $(this._element).on(EVENT_TOUCHSTART, function (event) {
  5448. return start(event);
  5449. });
  5450. $(this._element).on(EVENT_TOUCHMOVE, function (event) {
  5451. return move(event);
  5452. });
  5453. $(this._element).on(EVENT_TOUCHEND, function (event) {
  5454. return end(event);
  5455. });
  5456. }
  5457. };
  5458. _proto._keydown = function _keydown(event) {
  5459. if (/input|textarea/i.test(event.target.tagName)) {
  5460. return;
  5461. }
  5462. switch (event.which) {
  5463. case ARROW_LEFT_KEYCODE:
  5464. event.preventDefault();
  5465. this.prev();
  5466. break;
  5467. case ARROW_RIGHT_KEYCODE:
  5468. event.preventDefault();
  5469. this.next();
  5470. break;
  5471. }
  5472. };
  5473. _proto._getItemIndex = function _getItemIndex(element) {
  5474. this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM)) : [];
  5475. return this._items.indexOf(element);
  5476. };
  5477. _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
  5478. var isNextDirection = direction === DIRECTION_NEXT;
  5479. var isPrevDirection = direction === DIRECTION_PREV;
  5480. var activeIndex = this._getItemIndex(activeElement);
  5481. var lastItemIndex = this._items.length - 1;
  5482. var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
  5483. if (isGoingToWrap && !this._config.wrap) {
  5484. return activeElement;
  5485. }
  5486. var delta = direction === DIRECTION_PREV ? -1 : 1;
  5487. var itemIndex = (activeIndex + delta) % this._items.length;
  5488. return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
  5489. };
  5490. _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
  5491. var targetIndex = this._getItemIndex(relatedTarget);
  5492. var fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM));
  5493. var slideEvent = $.Event(EVENT_SLIDE, {
  5494. relatedTarget: relatedTarget,
  5495. direction: eventDirectionName,
  5496. from: fromIndex,
  5497. to: targetIndex
  5498. });
  5499. $(this._element).trigger(slideEvent);
  5500. return slideEvent;
  5501. };
  5502. _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
  5503. if (this._indicatorsElement) {
  5504. var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE$1));
  5505. $(indicators).removeClass(CLASS_NAME_ACTIVE$1);
  5506. var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
  5507. if (nextIndicator) {
  5508. $(nextIndicator).addClass(CLASS_NAME_ACTIVE$1);
  5509. }
  5510. }
  5511. };
  5512. _proto._slide = function _slide(direction, element) {
  5513. var _this4 = this;
  5514. var activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);
  5515. var activeElementIndex = this._getItemIndex(activeElement);
  5516. var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
  5517. var nextElementIndex = this._getItemIndex(nextElement);
  5518. var isCycling = Boolean(this._interval);
  5519. var directionalClassName;
  5520. var orderClassName;
  5521. var eventDirectionName;
  5522. if (direction === DIRECTION_NEXT) {
  5523. directionalClassName = CLASS_NAME_LEFT;
  5524. orderClassName = CLASS_NAME_NEXT;
  5525. eventDirectionName = DIRECTION_LEFT;
  5526. } else {
  5527. directionalClassName = CLASS_NAME_RIGHT;
  5528. orderClassName = CLASS_NAME_PREV;
  5529. eventDirectionName = DIRECTION_RIGHT;
  5530. }
  5531. if (nextElement && $(nextElement).hasClass(CLASS_NAME_ACTIVE$1)) {
  5532. this._isSliding = false;
  5533. return;
  5534. }
  5535. var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
  5536. if (slideEvent.isDefaultPrevented()) {
  5537. return;
  5538. }
  5539. if (!activeElement || !nextElement) {
  5540. // Some weirdness is happening, so we bail
  5541. return;
  5542. }
  5543. this._isSliding = true;
  5544. if (isCycling) {
  5545. this.pause();
  5546. }
  5547. this._setActiveIndicatorElement(nextElement);
  5548. var slidEvent = $.Event(EVENT_SLID, {
  5549. relatedTarget: nextElement,
  5550. direction: eventDirectionName,
  5551. from: activeElementIndex,
  5552. to: nextElementIndex
  5553. });
  5554. if ($(this._element).hasClass(CLASS_NAME_SLIDE)) {
  5555. $(nextElement).addClass(orderClassName);
  5556. Util.reflow(nextElement);
  5557. $(activeElement).addClass(directionalClassName);
  5558. $(nextElement).addClass(directionalClassName);
  5559. var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);
  5560. if (nextElementInterval) {
  5561. this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
  5562. this._config.interval = nextElementInterval;
  5563. } else {
  5564. this._config.interval = this._config.defaultInterval || this._config.interval;
  5565. }
  5566. var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
  5567. $(activeElement).one(Util.TRANSITION_END, function () {
  5568. $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(CLASS_NAME_ACTIVE$1);
  5569. $(activeElement).removeClass(CLASS_NAME_ACTIVE$1 + " " + orderClassName + " " + directionalClassName);
  5570. _this4._isSliding = false;
  5571. setTimeout(function () {
  5572. return $(_this4._element).trigger(slidEvent);
  5573. }, 0);
  5574. }).emulateTransitionEnd(transitionDuration);
  5575. } else {
  5576. $(activeElement).removeClass(CLASS_NAME_ACTIVE$1);
  5577. $(nextElement).addClass(CLASS_NAME_ACTIVE$1);
  5578. this._isSliding = false;
  5579. $(this._element).trigger(slidEvent);
  5580. }
  5581. if (isCycling) {
  5582. this.cycle();
  5583. }
  5584. } // Static
  5585. ;
  5586. Carousel._jQueryInterface = function _jQueryInterface(config) {
  5587. return this.each(function () {
  5588. var data = $(this).data(DATA_KEY$2);
  5589. var _config = _objectSpread2(_objectSpread2({}, Default), $(this).data());
  5590. if (typeof config === 'object') {
  5591. _config = _objectSpread2(_objectSpread2({}, _config), config);
  5592. }
  5593. var action = typeof config === 'string' ? config : _config.slide;
  5594. if (!data) {
  5595. data = new Carousel(this, _config);
  5596. $(this).data(DATA_KEY$2, data);
  5597. }
  5598. if (typeof config === 'number') {
  5599. data.to(config);
  5600. } else if (typeof action === 'string') {
  5601. if (typeof data[action] === 'undefined') {
  5602. throw new TypeError("No method named \"" + action + "\"");
  5603. }
  5604. data[action]();
  5605. } else if (_config.interval && _config.ride) {
  5606. data.pause();
  5607. data.cycle();
  5608. }
  5609. });
  5610. };
  5611. Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
  5612. var selector = Util.getSelectorFromElement(this);
  5613. if (!selector) {
  5614. return;
  5615. }
  5616. var target = $(selector)[0];
  5617. if (!target || !$(target).hasClass(CLASS_NAME_CAROUSEL)) {
  5618. return;
  5619. }
  5620. var config = _objectSpread2(_objectSpread2({}, $(target).data()), $(this).data());
  5621. var slideIndex = this.getAttribute('data-slide-to');
  5622. if (slideIndex) {
  5623. config.interval = false;
  5624. }
  5625. Carousel._jQueryInterface.call($(target), config);
  5626. if (slideIndex) {
  5627. $(target).data(DATA_KEY$2).to(slideIndex);
  5628. }
  5629. event.preventDefault();
  5630. };
  5631. _createClass(Carousel, null, [{
  5632. key: "VERSION",
  5633. get: function get() {
  5634. return VERSION$2;
  5635. }
  5636. }, {
  5637. key: "Default",
  5638. get: function get() {
  5639. return Default;
  5640. }
  5641. }]);
  5642. return Carousel;
  5643. }();
  5644. /**
  5645. * ------------------------------------------------------------------------
  5646. * Data Api implementation
  5647. * ------------------------------------------------------------------------
  5648. */
  5649. $(document).on(EVENT_CLICK_DATA_API$2, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler);
  5650. $(window).on(EVENT_LOAD_DATA_API$1, function () {
  5651. var carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE));
  5652. for (var i = 0, len = carousels.length; i < len; i++) {
  5653. var $carousel = $(carousels[i]);
  5654. Carousel._jQueryInterface.call($carousel, $carousel.data());
  5655. }
  5656. });
  5657. /**
  5658. * ------------------------------------------------------------------------
  5659. * jQuery
  5660. * ------------------------------------------------------------------------
  5661. */
  5662. $.fn[NAME$2] = Carousel._jQueryInterface;
  5663. $.fn[NAME$2].Constructor = Carousel;
  5664. $.fn[NAME$2].noConflict = function () {
  5665. $.fn[NAME$2] = JQUERY_NO_CONFLICT$2;
  5666. return Carousel._jQueryInterface;
  5667. };
  5668. /**
  5669. * ------------------------------------------------------------------------
  5670. * Constants
  5671. * ------------------------------------------------------------------------
  5672. */
  5673. var NAME$3 = 'collapse';
  5674. var VERSION$3 = '4.5.0';
  5675. var DATA_KEY$3 = 'bs.collapse';
  5676. var EVENT_KEY$3 = "." + DATA_KEY$3;
  5677. var DATA_API_KEY$3 = '.data-api';
  5678. var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3];
  5679. var Default$1 = {
  5680. toggle: true,
  5681. parent: ''
  5682. };
  5683. var DefaultType$1 = {
  5684. toggle: 'boolean',
  5685. parent: '(string|element)'
  5686. };
  5687. var EVENT_SHOW = "show" + EVENT_KEY$3;
  5688. var EVENT_SHOWN = "shown" + EVENT_KEY$3;
  5689. var EVENT_HIDE = "hide" + EVENT_KEY$3;
  5690. var EVENT_HIDDEN = "hidden" + EVENT_KEY$3;
  5691. var EVENT_CLICK_DATA_API$3 = "click" + EVENT_KEY$3 + DATA_API_KEY$3;
  5692. var CLASS_NAME_SHOW$1 = 'show';
  5693. var CLASS_NAME_COLLAPSE = 'collapse';
  5694. var CLASS_NAME_COLLAPSING = 'collapsing';
  5695. var CLASS_NAME_COLLAPSED = 'collapsed';
  5696. var DIMENSION_WIDTH = 'width';
  5697. var DIMENSION_HEIGHT = 'height';
  5698. var SELECTOR_ACTIVES = '.show, .collapsing';
  5699. var SELECTOR_DATA_TOGGLE$1 = '[data-toggle="collapse"]';
  5700. /**
  5701. * ------------------------------------------------------------------------
  5702. * Class Definition
  5703. * ------------------------------------------------------------------------
  5704. */
  5705. var Collapse = /*#__PURE__*/function () {
  5706. function Collapse(element, config) {
  5707. this._isTransitioning = false;
  5708. this._element = element;
  5709. this._config = this._getConfig(config);
  5710. this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
  5711. var toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$1));
  5712. for (var i = 0, len = toggleList.length; i < len; i++) {
  5713. var elem = toggleList[i];
  5714. var selector = Util.getSelectorFromElement(elem);
  5715. var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
  5716. return foundElem === element;
  5717. });
  5718. if (selector !== null && filterElement.length > 0) {
  5719. this._selector = selector;
  5720. this._triggerArray.push(elem);
  5721. }
  5722. }
  5723. this._parent = this._config.parent ? this._getParent() : null;
  5724. if (!this._config.parent) {
  5725. this._addAriaAndCollapsedClass(this._element, this._triggerArray);
  5726. }
  5727. if (this._config.toggle) {
  5728. this.toggle();
  5729. }
  5730. } // Getters
  5731. var _proto = Collapse.prototype;
  5732. // Public
  5733. _proto.toggle = function toggle() {
  5734. if ($(this._element).hasClass(CLASS_NAME_SHOW$1)) {
  5735. this.hide();
  5736. } else {
  5737. this.show();
  5738. }
  5739. };
  5740. _proto.show = function show() {
  5741. var _this = this;
  5742. if (this._isTransitioning || $(this._element).hasClass(CLASS_NAME_SHOW$1)) {
  5743. return;
  5744. }
  5745. var actives;
  5746. var activesData;
  5747. if (this._parent) {
  5748. actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES)).filter(function (elem) {
  5749. if (typeof _this._config.parent === 'string') {
  5750. return elem.getAttribute('data-parent') === _this._config.parent;
  5751. }
  5752. return elem.classList.contains(CLASS_NAME_COLLAPSE);
  5753. });
  5754. if (actives.length === 0) {
  5755. actives = null;
  5756. }
  5757. }
  5758. if (actives) {
  5759. activesData = $(actives).not(this._selector).data(DATA_KEY$3);
  5760. if (activesData && activesData._isTransitioning) {
  5761. return;
  5762. }
  5763. }
  5764. var startEvent = $.Event(EVENT_SHOW);
  5765. $(this._element).trigger(startEvent);
  5766. if (startEvent.isDefaultPrevented()) {
  5767. return;
  5768. }
  5769. if (actives) {
  5770. Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide');
  5771. if (!activesData) {
  5772. $(actives).data(DATA_KEY$3, null);
  5773. }
  5774. }
  5775. var dimension = this._getDimension();
  5776. $(this._element).removeClass(CLASS_NAME_COLLAPSE).addClass(CLASS_NAME_COLLAPSING);
  5777. this._element.style[dimension] = 0;
  5778. if (this._triggerArray.length) {
  5779. $(this._triggerArray).removeClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', true);
  5780. }
  5781. this.setTransitioning(true);
  5782. var complete = function complete() {
  5783. $(_this._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$1);
  5784. _this._element.style[dimension] = '';
  5785. _this.setTransitioning(false);
  5786. $(_this._element).trigger(EVENT_SHOWN);
  5787. };
  5788. var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
  5789. var scrollSize = "scroll" + capitalizedDimension;
  5790. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  5791. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  5792. this._element.style[dimension] = this._element[scrollSize] + "px";
  5793. };
  5794. _proto.hide = function hide() {
  5795. var _this2 = this;
  5796. if (this._isTransitioning || !$(this._element).hasClass(CLASS_NAME_SHOW$1)) {
  5797. return;
  5798. }
  5799. var startEvent = $.Event(EVENT_HIDE);
  5800. $(this._element).trigger(startEvent);
  5801. if (startEvent.isDefaultPrevented()) {
  5802. return;
  5803. }
  5804. var dimension = this._getDimension();
  5805. this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
  5806. Util.reflow(this._element);
  5807. $(this._element).addClass(CLASS_NAME_COLLAPSING).removeClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$1);
  5808. var triggerArrayLength = this._triggerArray.length;
  5809. if (triggerArrayLength > 0) {
  5810. for (var i = 0; i < triggerArrayLength; i++) {
  5811. var trigger = this._triggerArray[i];
  5812. var selector = Util.getSelectorFromElement(trigger);
  5813. if (selector !== null) {
  5814. var $elem = $([].slice.call(document.querySelectorAll(selector)));
  5815. if (!$elem.hasClass(CLASS_NAME_SHOW$1)) {
  5816. $(trigger).addClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', false);
  5817. }
  5818. }
  5819. }
  5820. }
  5821. this.setTransitioning(true);
  5822. var complete = function complete() {
  5823. _this2.setTransitioning(false);
  5824. $(_this2._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE).trigger(EVENT_HIDDEN);
  5825. };
  5826. this._element.style[dimension] = '';
  5827. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  5828. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  5829. };
  5830. _proto.setTransitioning = function setTransitioning(isTransitioning) {
  5831. this._isTransitioning = isTransitioning;
  5832. };
  5833. _proto.dispose = function dispose() {
  5834. $.removeData(this._element, DATA_KEY$3);
  5835. this._config = null;
  5836. this._parent = null;
  5837. this._element = null;
  5838. this._triggerArray = null;
  5839. this._isTransitioning = null;
  5840. } // Private
  5841. ;
  5842. _proto._getConfig = function _getConfig(config) {
  5843. config = _objectSpread2(_objectSpread2({}, Default$1), config);
  5844. config.toggle = Boolean(config.toggle); // Coerce string values
  5845. Util.typeCheckConfig(NAME$3, config, DefaultType$1);
  5846. return config;
  5847. };
  5848. _proto._getDimension = function _getDimension() {
  5849. var hasWidth = $(this._element).hasClass(DIMENSION_WIDTH);
  5850. return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT;
  5851. };
  5852. _proto._getParent = function _getParent() {
  5853. var _this3 = this;
  5854. var parent;
  5855. if (Util.isElement(this._config.parent)) {
  5856. parent = this._config.parent; // It's a jQuery object
  5857. if (typeof this._config.parent.jquery !== 'undefined') {
  5858. parent = this._config.parent[0];
  5859. }
  5860. } else {
  5861. parent = document.querySelector(this._config.parent);
  5862. }
  5863. var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
  5864. var children = [].slice.call(parent.querySelectorAll(selector));
  5865. $(children).each(function (i, element) {
  5866. _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
  5867. });
  5868. return parent;
  5869. };
  5870. _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
  5871. var isOpen = $(element).hasClass(CLASS_NAME_SHOW$1);
  5872. if (triggerArray.length) {
  5873. $(triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
  5874. }
  5875. } // Static
  5876. ;
  5877. Collapse._getTargetFromElement = function _getTargetFromElement(element) {
  5878. var selector = Util.getSelectorFromElement(element);
  5879. return selector ? document.querySelector(selector) : null;
  5880. };
  5881. Collapse._jQueryInterface = function _jQueryInterface(config) {
  5882. return this.each(function () {
  5883. var $this = $(this);
  5884. var data = $this.data(DATA_KEY$3);
  5885. var _config = _objectSpread2(_objectSpread2(_objectSpread2({}, Default$1), $this.data()), typeof config === 'object' && config ? config : {});
  5886. if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {
  5887. _config.toggle = false;
  5888. }
  5889. if (!data) {
  5890. data = new Collapse(this, _config);
  5891. $this.data(DATA_KEY$3, data);
  5892. }
  5893. if (typeof config === 'string') {
  5894. if (typeof data[config] === 'undefined') {
  5895. throw new TypeError("No method named \"" + config + "\"");
  5896. }
  5897. data[config]();
  5898. }
  5899. });
  5900. };
  5901. _createClass(Collapse, null, [{
  5902. key: "VERSION",
  5903. get: function get() {
  5904. return VERSION$3;
  5905. }
  5906. }, {
  5907. key: "Default",
  5908. get: function get() {
  5909. return Default$1;
  5910. }
  5911. }]);
  5912. return Collapse;
  5913. }();
  5914. /**
  5915. * ------------------------------------------------------------------------
  5916. * Data Api implementation
  5917. * ------------------------------------------------------------------------
  5918. */
  5919. $(document).on(EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$1, function (event) {
  5920. // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
  5921. if (event.currentTarget.tagName === 'A') {
  5922. event.preventDefault();
  5923. }
  5924. var $trigger = $(this);
  5925. var selector = Util.getSelectorFromElement(this);
  5926. var selectors = [].slice.call(document.querySelectorAll(selector));
  5927. $(selectors).each(function () {
  5928. var $target = $(this);
  5929. var data = $target.data(DATA_KEY$3);
  5930. var config = data ? 'toggle' : $trigger.data();
  5931. Collapse._jQueryInterface.call($target, config);
  5932. });
  5933. });
  5934. /**
  5935. * ------------------------------------------------------------------------
  5936. * jQuery
  5937. * ------------------------------------------------------------------------
  5938. */
  5939. $.fn[NAME$3] = Collapse._jQueryInterface;
  5940. $.fn[NAME$3].Constructor = Collapse;
  5941. $.fn[NAME$3].noConflict = function () {
  5942. $.fn[NAME$3] = JQUERY_NO_CONFLICT$3;
  5943. return Collapse._jQueryInterface;
  5944. };
  5945. /**
  5946. * ------------------------------------------------------------------------
  5947. * Constants
  5948. * ------------------------------------------------------------------------
  5949. */
  5950. var NAME$4 = 'dropdown';
  5951. var VERSION$4 = '4.5.0';
  5952. var DATA_KEY$4 = 'bs.dropdown';
  5953. var EVENT_KEY$4 = "." + DATA_KEY$4;
  5954. var DATA_API_KEY$4 = '.data-api';
  5955. var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4];
  5956. var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
  5957. var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
  5958. var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
  5959. var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
  5960. var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
  5961. var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
  5962. var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
  5963. var EVENT_HIDE$1 = "hide" + EVENT_KEY$4;
  5964. var EVENT_HIDDEN$1 = "hidden" + EVENT_KEY$4;
  5965. var EVENT_SHOW$1 = "show" + EVENT_KEY$4;
  5966. var EVENT_SHOWN$1 = "shown" + EVENT_KEY$4;
  5967. var EVENT_CLICK = "click" + EVENT_KEY$4;
  5968. var EVENT_CLICK_DATA_API$4 = "click" + EVENT_KEY$4 + DATA_API_KEY$4;
  5969. var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY$4 + DATA_API_KEY$4;
  5970. var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY$4 + DATA_API_KEY$4;
  5971. var CLASS_NAME_DISABLED = 'disabled';
  5972. var CLASS_NAME_SHOW$2 = 'show';
  5973. var CLASS_NAME_DROPUP = 'dropup';
  5974. var CLASS_NAME_DROPRIGHT = 'dropright';
  5975. var CLASS_NAME_DROPLEFT = 'dropleft';
  5976. var CLASS_NAME_MENURIGHT = 'dropdown-menu-right';
  5977. var CLASS_NAME_POSITION_STATIC = 'position-static';
  5978. var SELECTOR_DATA_TOGGLE$2 = '[data-toggle="dropdown"]';
  5979. var SELECTOR_FORM_CHILD = '.dropdown form';
  5980. var SELECTOR_MENU = '.dropdown-menu';
  5981. var SELECTOR_NAVBAR_NAV = '.navbar-nav';
  5982. var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';
  5983. var PLACEMENT_TOP = 'top-start';
  5984. var PLACEMENT_TOPEND = 'top-end';
  5985. var PLACEMENT_BOTTOM = 'bottom-start';
  5986. var PLACEMENT_BOTTOMEND = 'bottom-end';
  5987. var PLACEMENT_RIGHT = 'right-start';
  5988. var PLACEMENT_LEFT = 'left-start';
  5989. var Default$2 = {
  5990. offset: 0,
  5991. flip: true,
  5992. boundary: 'scrollParent',
  5993. reference: 'toggle',
  5994. display: 'dynamic',
  5995. popperConfig: null
  5996. };
  5997. var DefaultType$2 = {
  5998. offset: '(number|string|function)',
  5999. flip: 'boolean',
  6000. boundary: '(string|element)',
  6001. reference: '(string|element)',
  6002. display: 'string',
  6003. popperConfig: '(null|object)'
  6004. };
  6005. /**
  6006. * ------------------------------------------------------------------------
  6007. * Class Definition
  6008. * ------------------------------------------------------------------------
  6009. */
  6010. var Dropdown = /*#__PURE__*/function () {
  6011. function Dropdown(element, config) {
  6012. this._element = element;
  6013. this._popper = null;
  6014. this._config = this._getConfig(config);
  6015. this._menu = this._getMenuElement();
  6016. this._inNavbar = this._detectNavbar();
  6017. this._addEventListeners();
  6018. } // Getters
  6019. var _proto = Dropdown.prototype;
  6020. // Public
  6021. _proto.toggle = function toggle() {
  6022. if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED)) {
  6023. return;
  6024. }
  6025. var isActive = $(this._menu).hasClass(CLASS_NAME_SHOW$2);
  6026. Dropdown._clearMenus();
  6027. if (isActive) {
  6028. return;
  6029. }
  6030. this.show(true);
  6031. };
  6032. _proto.show = function show(usePopper) {
  6033. if (usePopper === void 0) {
  6034. usePopper = false;
  6035. }
  6036. if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED) || $(this._menu).hasClass(CLASS_NAME_SHOW$2)) {
  6037. return;
  6038. }
  6039. var relatedTarget = {
  6040. relatedTarget: this._element
  6041. };
  6042. var showEvent = $.Event(EVENT_SHOW$1, relatedTarget);
  6043. var parent = Dropdown._getParentFromElement(this._element);
  6044. $(parent).trigger(showEvent);
  6045. if (showEvent.isDefaultPrevented()) {
  6046. return;
  6047. } // Disable totally Popper.js for Dropdown in Navbar
  6048. if (!this._inNavbar && usePopper) {
  6049. /**
  6050. * Check for Popper dependency
  6051. * Popper - https://popper.js.org
  6052. */
  6053. if (typeof Popper === 'undefined') {
  6054. throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)');
  6055. }
  6056. var referenceElement = this._element;
  6057. if (this._config.reference === 'parent') {
  6058. referenceElement = parent;
  6059. } else if (Util.isElement(this._config.reference)) {
  6060. referenceElement = this._config.reference; // Check if it's jQuery element
  6061. if (typeof this._config.reference.jquery !== 'undefined') {
  6062. referenceElement = this._config.reference[0];
  6063. }
  6064. } // If boundary is not `scrollParent`, then set position to `static`
  6065. // to allow the menu to "escape" the scroll parent's boundaries
  6066. // https://github.com/twbs/bootstrap/issues/24251
  6067. if (this._config.boundary !== 'scrollParent') {
  6068. $(parent).addClass(CLASS_NAME_POSITION_STATIC);
  6069. }
  6070. this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
  6071. } // If this is a touch-enabled device we add extra
  6072. // empty mouseover listeners to the body's immediate children;
  6073. // only needed because of broken event delegation on iOS
  6074. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  6075. if ('ontouchstart' in document.documentElement && $(parent).closest(SELECTOR_NAVBAR_NAV).length === 0) {
  6076. $(document.body).children().on('mouseover', null, $.noop);
  6077. }
  6078. this._element.focus();
  6079. this._element.setAttribute('aria-expanded', true);
  6080. $(this._menu).toggleClass(CLASS_NAME_SHOW$2);
  6081. $(parent).toggleClass(CLASS_NAME_SHOW$2).trigger($.Event(EVENT_SHOWN$1, relatedTarget));
  6082. };
  6083. _proto.hide = function hide() {
  6084. if (this._element.disabled || $(this._element).hasClass(CLASS_NAME_DISABLED) || !$(this._menu).hasClass(CLASS_NAME_SHOW$2)) {
  6085. return;
  6086. }
  6087. var relatedTarget = {
  6088. relatedTarget: this._element
  6089. };
  6090. var hideEvent = $.Event(EVENT_HIDE$1, relatedTarget);
  6091. var parent = Dropdown._getParentFromElement(this._element);
  6092. $(parent).trigger(hideEvent);
  6093. if (hideEvent.isDefaultPrevented()) {
  6094. return;
  6095. }
  6096. if (this._popper) {
  6097. this._popper.destroy();
  6098. }
  6099. $(this._menu).toggleClass(CLASS_NAME_SHOW$2);
  6100. $(parent).toggleClass(CLASS_NAME_SHOW$2).trigger($.Event(EVENT_HIDDEN$1, relatedTarget));
  6101. };
  6102. _proto.dispose = function dispose() {
  6103. $.removeData(this._element, DATA_KEY$4);
  6104. $(this._element).off(EVENT_KEY$4);
  6105. this._element = null;
  6106. this._menu = null;
  6107. if (this._popper !== null) {
  6108. this._popper.destroy();
  6109. this._popper = null;
  6110. }
  6111. };
  6112. _proto.update = function update() {
  6113. this._inNavbar = this._detectNavbar();
  6114. if (this._popper !== null) {
  6115. this._popper.scheduleUpdate();
  6116. }
  6117. } // Private
  6118. ;
  6119. _proto._addEventListeners = function _addEventListeners() {
  6120. var _this = this;
  6121. $(this._element).on(EVENT_CLICK, function (event) {
  6122. event.preventDefault();
  6123. event.stopPropagation();
  6124. _this.toggle();
  6125. });
  6126. };
  6127. _proto._getConfig = function _getConfig(config) {
  6128. config = _objectSpread2(_objectSpread2(_objectSpread2({}, this.constructor.Default), $(this._element).data()), config);
  6129. Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType);
  6130. return config;
  6131. };
  6132. _proto._getMenuElement = function _getMenuElement() {
  6133. if (!this._menu) {
  6134. var parent = Dropdown._getParentFromElement(this._element);
  6135. if (parent) {
  6136. this._menu = parent.querySelector(SELECTOR_MENU);
  6137. }
  6138. }
  6139. return this._menu;
  6140. };
  6141. _proto._getPlacement = function _getPlacement() {
  6142. var $parentDropdown = $(this._element.parentNode);
  6143. var placement = PLACEMENT_BOTTOM; // Handle dropup
  6144. if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) {
  6145. placement = $(this._menu).hasClass(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP;
  6146. } else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) {
  6147. placement = PLACEMENT_RIGHT;
  6148. } else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) {
  6149. placement = PLACEMENT_LEFT;
  6150. } else if ($(this._menu).hasClass(CLASS_NAME_MENURIGHT)) {
  6151. placement = PLACEMENT_BOTTOMEND;
  6152. }
  6153. return placement;
  6154. };
  6155. _proto._detectNavbar = function _detectNavbar() {
  6156. return $(this._element).closest('.navbar').length > 0;
  6157. };
  6158. _proto._getOffset = function _getOffset() {
  6159. var _this2 = this;
  6160. var offset = {};
  6161. if (typeof this._config.offset === 'function') {
  6162. offset.fn = function (data) {
  6163. data.offsets = _objectSpread2(_objectSpread2({}, data.offsets), _this2._config.offset(data.offsets, _this2._element) || {});
  6164. return data;
  6165. };
  6166. } else {
  6167. offset.offset = this._config.offset;
  6168. }
  6169. return offset;
  6170. };
  6171. _proto._getPopperConfig = function _getPopperConfig() {
  6172. var popperConfig = {
  6173. placement: this._getPlacement(),
  6174. modifiers: {
  6175. offset: this._getOffset(),
  6176. flip: {
  6177. enabled: this._config.flip
  6178. },
  6179. preventOverflow: {
  6180. boundariesElement: this._config.boundary
  6181. }
  6182. }
  6183. }; // Disable Popper.js if we have a static display
  6184. if (this._config.display === 'static') {
  6185. popperConfig.modifiers.applyStyle = {
  6186. enabled: false
  6187. };
  6188. }
  6189. return _objectSpread2(_objectSpread2({}, popperConfig), this._config.popperConfig);
  6190. } // Static
  6191. ;
  6192. Dropdown._jQueryInterface = function _jQueryInterface(config) {
  6193. return this.each(function () {
  6194. var data = $(this).data(DATA_KEY$4);
  6195. var _config = typeof config === 'object' ? config : null;
  6196. if (!data) {
  6197. data = new Dropdown(this, _config);
  6198. $(this).data(DATA_KEY$4, data);
  6199. }
  6200. if (typeof config === 'string') {
  6201. if (typeof data[config] === 'undefined') {
  6202. throw new TypeError("No method named \"" + config + "\"");
  6203. }
  6204. data[config]();
  6205. }
  6206. });
  6207. };
  6208. Dropdown._clearMenus = function _clearMenus(event) {
  6209. if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
  6210. return;
  6211. }
  6212. var toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$2));
  6213. for (var i = 0, len = toggles.length; i < len; i++) {
  6214. var parent = Dropdown._getParentFromElement(toggles[i]);
  6215. var context = $(toggles[i]).data(DATA_KEY$4);
  6216. var relatedTarget = {
  6217. relatedTarget: toggles[i]
  6218. };
  6219. if (event && event.type === 'click') {
  6220. relatedTarget.clickEvent = event;
  6221. }
  6222. if (!context) {
  6223. continue;
  6224. }
  6225. var dropdownMenu = context._menu;
  6226. if (!$(parent).hasClass(CLASS_NAME_SHOW$2)) {
  6227. continue;
  6228. }
  6229. if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {
  6230. continue;
  6231. }
  6232. var hideEvent = $.Event(EVENT_HIDE$1, relatedTarget);
  6233. $(parent).trigger(hideEvent);
  6234. if (hideEvent.isDefaultPrevented()) {
  6235. continue;
  6236. } // If this is a touch-enabled device we remove the extra
  6237. // empty mouseover listeners we added for iOS support
  6238. if ('ontouchstart' in document.documentElement) {
  6239. $(document.body).children().off('mouseover', null, $.noop);
  6240. }
  6241. toggles[i].setAttribute('aria-expanded', 'false');
  6242. if (context._popper) {
  6243. context._popper.destroy();
  6244. }
  6245. $(dropdownMenu).removeClass(CLASS_NAME_SHOW$2);
  6246. $(parent).removeClass(CLASS_NAME_SHOW$2).trigger($.Event(EVENT_HIDDEN$1, relatedTarget));
  6247. }
  6248. };
  6249. Dropdown._getParentFromElement = function _getParentFromElement(element) {
  6250. var parent;
  6251. var selector = Util.getSelectorFromElement(element);
  6252. if (selector) {
  6253. parent = document.querySelector(selector);
  6254. }
  6255. return parent || element.parentNode;
  6256. } // eslint-disable-next-line complexity
  6257. ;
  6258. Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
  6259. // If not input/textarea:
  6260. // - And not a key in REGEXP_KEYDOWN => not a dropdown command
  6261. // If input/textarea:
  6262. // - If space key => not a dropdown command
  6263. // - If key is other than escape
  6264. // - If key is not up or down => not a dropdown command
  6265. // - If trigger inside the menu => not a dropdown command
  6266. if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
  6267. return;
  6268. }
  6269. if (this.disabled || $(this).hasClass(CLASS_NAME_DISABLED)) {
  6270. return;
  6271. }
  6272. var parent = Dropdown._getParentFromElement(this);
  6273. var isActive = $(parent).hasClass(CLASS_NAME_SHOW$2);
  6274. if (!isActive && event.which === ESCAPE_KEYCODE) {
  6275. return;
  6276. }
  6277. event.preventDefault();
  6278. event.stopPropagation();
  6279. if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
  6280. if (event.which === ESCAPE_KEYCODE) {
  6281. $(parent.querySelector(SELECTOR_DATA_TOGGLE$2)).trigger('focus');
  6282. }
  6283. $(this).trigger('click');
  6284. return;
  6285. }
  6286. var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) {
  6287. return $(item).is(':visible');
  6288. });
  6289. if (items.length === 0) {
  6290. return;
  6291. }
  6292. var index = items.indexOf(event.target);
  6293. if (event.which === ARROW_UP_KEYCODE && index > 0) {
  6294. // Up
  6295. index--;
  6296. }
  6297. if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
  6298. // Down
  6299. index++;
  6300. }
  6301. if (index < 0) {
  6302. index = 0;
  6303. }
  6304. items[index].focus();
  6305. };
  6306. _createClass(Dropdown, null, [{
  6307. key: "VERSION",
  6308. get: function get() {
  6309. return VERSION$4;
  6310. }
  6311. }, {
  6312. key: "Default",
  6313. get: function get() {
  6314. return Default$2;
  6315. }
  6316. }, {
  6317. key: "DefaultType",
  6318. get: function get() {
  6319. return DefaultType$2;
  6320. }
  6321. }]);
  6322. return Dropdown;
  6323. }();
  6324. /**
  6325. * ------------------------------------------------------------------------
  6326. * Data Api implementation
  6327. * ------------------------------------------------------------------------
  6328. */
  6329. $(document).on(EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$2, Dropdown._dataApiKeydownHandler).on(EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown._dataApiKeydownHandler).on(EVENT_CLICK_DATA_API$4 + " " + EVENT_KEYUP_DATA_API, Dropdown._clearMenus).on(EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$2, function (event) {
  6330. event.preventDefault();
  6331. event.stopPropagation();
  6332. Dropdown._jQueryInterface.call($(this), 'toggle');
  6333. }).on(EVENT_CLICK_DATA_API$4, SELECTOR_FORM_CHILD, function (e) {
  6334. e.stopPropagation();
  6335. });
  6336. /**
  6337. * ------------------------------------------------------------------------
  6338. * jQuery
  6339. * ------------------------------------------------------------------------
  6340. */
  6341. $.fn[NAME$4] = Dropdown._jQueryInterface;
  6342. $.fn[NAME$4].Constructor = Dropdown;
  6343. $.fn[NAME$4].noConflict = function () {
  6344. $.fn[NAME$4] = JQUERY_NO_CONFLICT$4;
  6345. return Dropdown._jQueryInterface;
  6346. };
  6347. /**
  6348. * ------------------------------------------------------------------------
  6349. * Constants
  6350. * ------------------------------------------------------------------------
  6351. */
  6352. var NAME$5 = 'modal';
  6353. var VERSION$5 = '4.5.0';
  6354. var DATA_KEY$5 = 'bs.modal';
  6355. var EVENT_KEY$5 = "." + DATA_KEY$5;
  6356. var DATA_API_KEY$5 = '.data-api';
  6357. var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5];
  6358. var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key
  6359. var Default$3 = {
  6360. backdrop: true,
  6361. keyboard: true,
  6362. focus: true,
  6363. show: true
  6364. };
  6365. var DefaultType$3 = {
  6366. backdrop: '(boolean|string)',
  6367. keyboard: 'boolean',
  6368. focus: 'boolean',
  6369. show: 'boolean'
  6370. };
  6371. var EVENT_HIDE$2 = "hide" + EVENT_KEY$5;
  6372. var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY$5;
  6373. var EVENT_HIDDEN$2 = "hidden" + EVENT_KEY$5;
  6374. var EVENT_SHOW$2 = "show" + EVENT_KEY$5;
  6375. var EVENT_SHOWN$2 = "shown" + EVENT_KEY$5;
  6376. var EVENT_FOCUSIN = "focusin" + EVENT_KEY$5;
  6377. var EVENT_RESIZE = "resize" + EVENT_KEY$5;
  6378. var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY$5;
  6379. var EVENT_KEYDOWN_DISMISS = "keydown.dismiss" + EVENT_KEY$5;
  6380. var EVENT_MOUSEUP_DISMISS = "mouseup.dismiss" + EVENT_KEY$5;
  6381. var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss" + EVENT_KEY$5;
  6382. var EVENT_CLICK_DATA_API$5 = "click" + EVENT_KEY$5 + DATA_API_KEY$5;
  6383. var CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable';
  6384. var CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure';
  6385. var CLASS_NAME_BACKDROP = 'modal-backdrop';
  6386. var CLASS_NAME_OPEN = 'modal-open';
  6387. var CLASS_NAME_FADE$1 = 'fade';
  6388. var CLASS_NAME_SHOW$3 = 'show';
  6389. var CLASS_NAME_STATIC = 'modal-static';
  6390. var SELECTOR_DIALOG = '.modal-dialog';
  6391. var SELECTOR_MODAL_BODY = '.modal-body';
  6392. var SELECTOR_DATA_TOGGLE$3 = '[data-toggle="modal"]';
  6393. var SELECTOR_DATA_DISMISS = '[data-dismiss="modal"]';
  6394. var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
  6395. var SELECTOR_STICKY_CONTENT = '.sticky-top';
  6396. /**
  6397. * ------------------------------------------------------------------------
  6398. * Class Definition
  6399. * ------------------------------------------------------------------------
  6400. */
  6401. var Modal = /*#__PURE__*/function () {
  6402. function Modal(element, config) {
  6403. this._config = this._getConfig(config);
  6404. this._element = element;
  6405. this._dialog = element.querySelector(SELECTOR_DIALOG);
  6406. this._backdrop = null;
  6407. this._isShown = false;
  6408. this._isBodyOverflowing = false;
  6409. this._ignoreBackdropClick = false;
  6410. this._isTransitioning = false;
  6411. this._scrollbarWidth = 0;
  6412. } // Getters
  6413. var _proto = Modal.prototype;
  6414. // Public
  6415. _proto.toggle = function toggle(relatedTarget) {
  6416. return this._isShown ? this.hide() : this.show(relatedTarget);
  6417. };
  6418. _proto.show = function show(relatedTarget) {
  6419. var _this = this;
  6420. if (this._isShown || this._isTransitioning) {
  6421. return;
  6422. }
  6423. if ($(this._element).hasClass(CLASS_NAME_FADE$1)) {
  6424. this._isTransitioning = true;
  6425. }
  6426. var showEvent = $.Event(EVENT_SHOW$2, {
  6427. relatedTarget: relatedTarget
  6428. });
  6429. $(this._element).trigger(showEvent);
  6430. if (this._isShown || showEvent.isDefaultPrevented()) {
  6431. return;
  6432. }
  6433. this._isShown = true;
  6434. this._checkScrollbar();
  6435. this._setScrollbar();
  6436. this._adjustDialog();
  6437. this._setEscapeEvent();
  6438. this._setResizeEvent();
  6439. $(this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function (event) {
  6440. return _this.hide(event);
  6441. });
  6442. $(this._dialog).on(EVENT_MOUSEDOWN_DISMISS, function () {
  6443. $(_this._element).one(EVENT_MOUSEUP_DISMISS, function (event) {
  6444. if ($(event.target).is(_this._element)) {
  6445. _this._ignoreBackdropClick = true;
  6446. }
  6447. });
  6448. });
  6449. this._showBackdrop(function () {
  6450. return _this._showElement(relatedTarget);
  6451. });
  6452. };
  6453. _proto.hide = function hide(event) {
  6454. var _this2 = this;
  6455. if (event) {
  6456. event.preventDefault();
  6457. }
  6458. if (!this._isShown || this._isTransitioning) {
  6459. return;
  6460. }
  6461. var hideEvent = $.Event(EVENT_HIDE$2);
  6462. $(this._element).trigger(hideEvent);
  6463. if (!this._isShown || hideEvent.isDefaultPrevented()) {
  6464. return;
  6465. }
  6466. this._isShown = false;
  6467. var transition = $(this._element).hasClass(CLASS_NAME_FADE$1);
  6468. if (transition) {
  6469. this._isTransitioning = true;
  6470. }
  6471. this._setEscapeEvent();
  6472. this._setResizeEvent();
  6473. $(document).off(EVENT_FOCUSIN);
  6474. $(this._element).removeClass(CLASS_NAME_SHOW$3);
  6475. $(this._element).off(EVENT_CLICK_DISMISS);
  6476. $(this._dialog).off(EVENT_MOUSEDOWN_DISMISS);
  6477. if (transition) {
  6478. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  6479. $(this._element).one(Util.TRANSITION_END, function (event) {
  6480. return _this2._hideModal(event);
  6481. }).emulateTransitionEnd(transitionDuration);
  6482. } else {
  6483. this._hideModal();
  6484. }
  6485. };
  6486. _proto.dispose = function dispose() {
  6487. [window, this._element, this._dialog].forEach(function (htmlElement) {
  6488. return $(htmlElement).off(EVENT_KEY$5);
  6489. });
  6490. /**
  6491. * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
  6492. * Do not move `document` in `htmlElements` array
  6493. * It will remove `EVENT_CLICK_DATA_API` event that should remain
  6494. */
  6495. $(document).off(EVENT_FOCUSIN);
  6496. $.removeData(this._element, DATA_KEY$5);
  6497. this._config = null;
  6498. this._element = null;
  6499. this._dialog = null;
  6500. this._backdrop = null;
  6501. this._isShown = null;
  6502. this._isBodyOverflowing = null;
  6503. this._ignoreBackdropClick = null;
  6504. this._isTransitioning = null;
  6505. this._scrollbarWidth = null;
  6506. };
  6507. _proto.handleUpdate = function handleUpdate() {
  6508. this._adjustDialog();
  6509. } // Private
  6510. ;
  6511. _proto._getConfig = function _getConfig(config) {
  6512. config = _objectSpread2(_objectSpread2({}, Default$3), config);
  6513. Util.typeCheckConfig(NAME$5, config, DefaultType$3);
  6514. return config;
  6515. };
  6516. _proto._triggerBackdropTransition = function _triggerBackdropTransition() {
  6517. var _this3 = this;
  6518. if (this._config.backdrop === 'static') {
  6519. var hideEventPrevented = $.Event(EVENT_HIDE_PREVENTED);
  6520. $(this._element).trigger(hideEventPrevented);
  6521. if (hideEventPrevented.defaultPrevented) {
  6522. return;
  6523. }
  6524. this._element.classList.add(CLASS_NAME_STATIC);
  6525. var modalTransitionDuration = Util.getTransitionDurationFromElement(this._element);
  6526. $(this._element).one(Util.TRANSITION_END, function () {
  6527. _this3._element.classList.remove(CLASS_NAME_STATIC);
  6528. }).emulateTransitionEnd(modalTransitionDuration);
  6529. this._element.focus();
  6530. } else {
  6531. this.hide();
  6532. }
  6533. };
  6534. _proto._showElement = function _showElement(relatedTarget) {
  6535. var _this4 = this;
  6536. var transition = $(this._element).hasClass(CLASS_NAME_FADE$1);
  6537. var modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null;
  6538. if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
  6539. // Don't move modal's DOM position
  6540. document.body.appendChild(this._element);
  6541. }
  6542. this._element.style.display = 'block';
  6543. this._element.removeAttribute('aria-hidden');
  6544. this._element.setAttribute('aria-modal', true);
  6545. if ($(this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) {
  6546. modalBody.scrollTop = 0;
  6547. } else {
  6548. this._element.scrollTop = 0;
  6549. }
  6550. if (transition) {
  6551. Util.reflow(this._element);
  6552. }
  6553. $(this._element).addClass(CLASS_NAME_SHOW$3);
  6554. if (this._config.focus) {
  6555. this._enforceFocus();
  6556. }
  6557. var shownEvent = $.Event(EVENT_SHOWN$2, {
  6558. relatedTarget: relatedTarget
  6559. });
  6560. var transitionComplete = function transitionComplete() {
  6561. if (_this4._config.focus) {
  6562. _this4._element.focus();
  6563. }
  6564. _this4._isTransitioning = false;
  6565. $(_this4._element).trigger(shownEvent);
  6566. };
  6567. if (transition) {
  6568. var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);
  6569. $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
  6570. } else {
  6571. transitionComplete();
  6572. }
  6573. };
  6574. _proto._enforceFocus = function _enforceFocus() {
  6575. var _this5 = this;
  6576. $(document).off(EVENT_FOCUSIN) // Guard against infinite focus loop
  6577. .on(EVENT_FOCUSIN, function (event) {
  6578. if (document !== event.target && _this5._element !== event.target && $(_this5._element).has(event.target).length === 0) {
  6579. _this5._element.focus();
  6580. }
  6581. });
  6582. };
  6583. _proto._setEscapeEvent = function _setEscapeEvent() {
  6584. var _this6 = this;
  6585. if (this._isShown) {
  6586. $(this._element).on(EVENT_KEYDOWN_DISMISS, function (event) {
  6587. if (_this6._config.keyboard && event.which === ESCAPE_KEYCODE$1) {
  6588. event.preventDefault();
  6589. _this6.hide();
  6590. } else if (!_this6._config.keyboard && event.which === ESCAPE_KEYCODE$1) {
  6591. _this6._triggerBackdropTransition();
  6592. }
  6593. });
  6594. } else if (!this._isShown) {
  6595. $(this._element).off(EVENT_KEYDOWN_DISMISS);
  6596. }
  6597. };
  6598. _proto._setResizeEvent = function _setResizeEvent() {
  6599. var _this7 = this;
  6600. if (this._isShown) {
  6601. $(window).on(EVENT_RESIZE, function (event) {
  6602. return _this7.handleUpdate(event);
  6603. });
  6604. } else {
  6605. $(window).off(EVENT_RESIZE);
  6606. }
  6607. };
  6608. _proto._hideModal = function _hideModal() {
  6609. var _this8 = this;
  6610. this._element.style.display = 'none';
  6611. this._element.setAttribute('aria-hidden', true);
  6612. this._element.removeAttribute('aria-modal');
  6613. this._isTransitioning = false;
  6614. this._showBackdrop(function () {
  6615. $(document.body).removeClass(CLASS_NAME_OPEN);
  6616. _this8._resetAdjustments();
  6617. _this8._resetScrollbar();
  6618. $(_this8._element).trigger(EVENT_HIDDEN$2);
  6619. });
  6620. };
  6621. _proto._removeBackdrop = function _removeBackdrop() {
  6622. if (this._backdrop) {
  6623. $(this._backdrop).remove();
  6624. this._backdrop = null;
  6625. }
  6626. };
  6627. _proto._showBackdrop = function _showBackdrop(callback) {
  6628. var _this9 = this;
  6629. var animate = $(this._element).hasClass(CLASS_NAME_FADE$1) ? CLASS_NAME_FADE$1 : '';
  6630. if (this._isShown && this._config.backdrop) {
  6631. this._backdrop = document.createElement('div');
  6632. this._backdrop.className = CLASS_NAME_BACKDROP;
  6633. if (animate) {
  6634. this._backdrop.classList.add(animate);
  6635. }
  6636. $(this._backdrop).appendTo(document.body);
  6637. $(this._element).on(EVENT_CLICK_DISMISS, function (event) {
  6638. if (_this9._ignoreBackdropClick) {
  6639. _this9._ignoreBackdropClick = false;
  6640. return;
  6641. }
  6642. if (event.target !== event.currentTarget) {
  6643. return;
  6644. }
  6645. _this9._triggerBackdropTransition();
  6646. });
  6647. if (animate) {
  6648. Util.reflow(this._backdrop);
  6649. }
  6650. $(this._backdrop).addClass(CLASS_NAME_SHOW$3);
  6651. if (!callback) {
  6652. return;
  6653. }
  6654. if (!animate) {
  6655. callback();
  6656. return;
  6657. }
  6658. var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  6659. $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
  6660. } else if (!this._isShown && this._backdrop) {
  6661. $(this._backdrop).removeClass(CLASS_NAME_SHOW$3);
  6662. var callbackRemove = function callbackRemove() {
  6663. _this9._removeBackdrop();
  6664. if (callback) {
  6665. callback();
  6666. }
  6667. };
  6668. if ($(this._element).hasClass(CLASS_NAME_FADE$1)) {
  6669. var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  6670. $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
  6671. } else {
  6672. callbackRemove();
  6673. }
  6674. } else if (callback) {
  6675. callback();
  6676. }
  6677. } // ----------------------------------------------------------------------
  6678. // the following methods are used to handle overflowing modals
  6679. // todo (fat): these should probably be refactored out of modal.js
  6680. // ----------------------------------------------------------------------
  6681. ;
  6682. _proto._adjustDialog = function _adjustDialog() {
  6683. var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
  6684. if (!this._isBodyOverflowing && isModalOverflowing) {
  6685. this._element.style.paddingLeft = this._scrollbarWidth + "px";
  6686. }
  6687. if (this._isBodyOverflowing && !isModalOverflowing) {
  6688. this._element.style.paddingRight = this._scrollbarWidth + "px";
  6689. }
  6690. };
  6691. _proto._resetAdjustments = function _resetAdjustments() {
  6692. this._element.style.paddingLeft = '';
  6693. this._element.style.paddingRight = '';
  6694. };
  6695. _proto._checkScrollbar = function _checkScrollbar() {
  6696. var rect = document.body.getBoundingClientRect();
  6697. this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth;
  6698. this._scrollbarWidth = this._getScrollbarWidth();
  6699. };
  6700. _proto._setScrollbar = function _setScrollbar() {
  6701. var _this10 = this;
  6702. if (this._isBodyOverflowing) {
  6703. // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
  6704. // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
  6705. var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));
  6706. var stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT)); // Adjust fixed content padding
  6707. $(fixedContent).each(function (index, element) {
  6708. var actualPadding = element.style.paddingRight;
  6709. var calculatedPadding = $(element).css('padding-right');
  6710. $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px");
  6711. }); // Adjust sticky content margin
  6712. $(stickyContent).each(function (index, element) {
  6713. var actualMargin = element.style.marginRight;
  6714. var calculatedMargin = $(element).css('margin-right');
  6715. $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px");
  6716. }); // Adjust body padding
  6717. var actualPadding = document.body.style.paddingRight;
  6718. var calculatedPadding = $(document.body).css('padding-right');
  6719. $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
  6720. }
  6721. $(document.body).addClass(CLASS_NAME_OPEN);
  6722. };
  6723. _proto._resetScrollbar = function _resetScrollbar() {
  6724. // Restore fixed content padding
  6725. var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));
  6726. $(fixedContent).each(function (index, element) {
  6727. var padding = $(element).data('padding-right');
  6728. $(element).removeData('padding-right');
  6729. element.style.paddingRight = padding ? padding : '';
  6730. }); // Restore sticky content
  6731. var elements = [].slice.call(document.querySelectorAll("" + SELECTOR_STICKY_CONTENT));
  6732. $(elements).each(function (index, element) {
  6733. var margin = $(element).data('margin-right');
  6734. if (typeof margin !== 'undefined') {
  6735. $(element).css('margin-right', margin).removeData('margin-right');
  6736. }
  6737. }); // Restore body padding
  6738. var padding = $(document.body).data('padding-right');
  6739. $(document.body).removeData('padding-right');
  6740. document.body.style.paddingRight = padding ? padding : '';
  6741. };
  6742. _proto._getScrollbarWidth = function _getScrollbarWidth() {
  6743. // thx d.walsh
  6744. var scrollDiv = document.createElement('div');
  6745. scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER;
  6746. document.body.appendChild(scrollDiv);
  6747. var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
  6748. document.body.removeChild(scrollDiv);
  6749. return scrollbarWidth;
  6750. } // Static
  6751. ;
  6752. Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
  6753. return this.each(function () {
  6754. var data = $(this).data(DATA_KEY$5);
  6755. var _config = _objectSpread2(_objectSpread2(_objectSpread2({}, Default$3), $(this).data()), typeof config === 'object' && config ? config : {});
  6756. if (!data) {
  6757. data = new Modal(this, _config);
  6758. $(this).data(DATA_KEY$5, data);
  6759. }
  6760. if (typeof config === 'string') {
  6761. if (typeof data[config] === 'undefined') {
  6762. throw new TypeError("No method named \"" + config + "\"");
  6763. }
  6764. data[config](relatedTarget);
  6765. } else if (_config.show) {
  6766. data.show(relatedTarget);
  6767. }
  6768. });
  6769. };
  6770. _createClass(Modal, null, [{
  6771. key: "VERSION",
  6772. get: function get() {
  6773. return VERSION$5;
  6774. }
  6775. }, {
  6776. key: "Default",
  6777. get: function get() {
  6778. return Default$3;
  6779. }
  6780. }]);
  6781. return Modal;
  6782. }();
  6783. /**
  6784. * ------------------------------------------------------------------------
  6785. * Data Api implementation
  6786. * ------------------------------------------------------------------------
  6787. */
  6788. $(document).on(EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$3, function (event) {
  6789. var _this11 = this;
  6790. var target;
  6791. var selector = Util.getSelectorFromElement(this);
  6792. if (selector) {
  6793. target = document.querySelector(selector);
  6794. }
  6795. var config = $(target).data(DATA_KEY$5) ? 'toggle' : _objectSpread2(_objectSpread2({}, $(target).data()), $(this).data());
  6796. if (this.tagName === 'A' || this.tagName === 'AREA') {
  6797. event.preventDefault();
  6798. }
  6799. var $target = $(target).one(EVENT_SHOW$2, function (showEvent) {
  6800. if (showEvent.isDefaultPrevented()) {
  6801. // Only register focus restorer if modal will actually get shown
  6802. return;
  6803. }
  6804. $target.one(EVENT_HIDDEN$2, function () {
  6805. if ($(_this11).is(':visible')) {
  6806. _this11.focus();
  6807. }
  6808. });
  6809. });
  6810. Modal._jQueryInterface.call($(target), config, this);
  6811. });
  6812. /**
  6813. * ------------------------------------------------------------------------
  6814. * jQuery
  6815. * ------------------------------------------------------------------------
  6816. */
  6817. $.fn[NAME$5] = Modal._jQueryInterface;
  6818. $.fn[NAME$5].Constructor = Modal;
  6819. $.fn[NAME$5].noConflict = function () {
  6820. $.fn[NAME$5] = JQUERY_NO_CONFLICT$5;
  6821. return Modal._jQueryInterface;
  6822. };
  6823. /**
  6824. * --------------------------------------------------------------------------
  6825. * Bootstrap (v4.5.0): tools/sanitizer.js
  6826. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  6827. * --------------------------------------------------------------------------
  6828. */
  6829. var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
  6830. var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
  6831. var DefaultWhitelist = {
  6832. // Global attributes allowed on any supplied element below.
  6833. '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
  6834. a: ['target', 'href', 'title', 'rel'],
  6835. area: [],
  6836. b: [],
  6837. br: [],
  6838. col: [],
  6839. code: [],
  6840. div: [],
  6841. em: [],
  6842. hr: [],
  6843. h1: [],
  6844. h2: [],
  6845. h3: [],
  6846. h4: [],
  6847. h5: [],
  6848. h6: [],
  6849. i: [],
  6850. img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
  6851. li: [],
  6852. ol: [],
  6853. p: [],
  6854. pre: [],
  6855. s: [],
  6856. small: [],
  6857. span: [],
  6858. sub: [],
  6859. sup: [],
  6860. strong: [],
  6861. u: [],
  6862. ul: []
  6863. };
  6864. /**
  6865. * A pattern that recognizes a commonly useful subset of URLs that are safe.
  6866. *
  6867. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  6868. */
  6869. var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi;
  6870. /**
  6871. * A pattern that matches safe data URLs. Only matches image, video and audio types.
  6872. *
  6873. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  6874. */
  6875. var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;
  6876. function allowedAttribute(attr, allowedAttributeList) {
  6877. var attrName = attr.nodeName.toLowerCase();
  6878. if (allowedAttributeList.indexOf(attrName) !== -1) {
  6879. if (uriAttrs.indexOf(attrName) !== -1) {
  6880. return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
  6881. }
  6882. return true;
  6883. }
  6884. var regExp = allowedAttributeList.filter(function (attrRegex) {
  6885. return attrRegex instanceof RegExp;
  6886. }); // Check if a regular expression validates the attribute.
  6887. for (var i = 0, len = regExp.length; i < len; i++) {
  6888. if (attrName.match(regExp[i])) {
  6889. return true;
  6890. }
  6891. }
  6892. return false;
  6893. }
  6894. function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
  6895. if (unsafeHtml.length === 0) {
  6896. return unsafeHtml;
  6897. }
  6898. if (sanitizeFn && typeof sanitizeFn === 'function') {
  6899. return sanitizeFn(unsafeHtml);
  6900. }
  6901. var domParser = new window.DOMParser();
  6902. var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
  6903. var whitelistKeys = Object.keys(whiteList);
  6904. var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));
  6905. var _loop = function _loop(i, len) {
  6906. var el = elements[i];
  6907. var elName = el.nodeName.toLowerCase();
  6908. if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
  6909. el.parentNode.removeChild(el);
  6910. return "continue";
  6911. }
  6912. var attributeList = [].slice.call(el.attributes);
  6913. var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
  6914. attributeList.forEach(function (attr) {
  6915. if (!allowedAttribute(attr, whitelistedAttributes)) {
  6916. el.removeAttribute(attr.nodeName);
  6917. }
  6918. });
  6919. };
  6920. for (var i = 0, len = elements.length; i < len; i++) {
  6921. var _ret = _loop(i);
  6922. if (_ret === "continue") continue;
  6923. }
  6924. return createdDocument.body.innerHTML;
  6925. }
  6926. /**
  6927. * ------------------------------------------------------------------------
  6928. * Constants
  6929. * ------------------------------------------------------------------------
  6930. */
  6931. var NAME$6 = 'tooltip';
  6932. var VERSION$6 = '4.5.0';
  6933. var DATA_KEY$6 = 'bs.tooltip';
  6934. var EVENT_KEY$6 = "." + DATA_KEY$6;
  6935. var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6];
  6936. var CLASS_PREFIX = 'bs-tooltip';
  6937. var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
  6938. var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
  6939. var DefaultType$4 = {
  6940. animation: 'boolean',
  6941. template: 'string',
  6942. title: '(string|element|function)',
  6943. trigger: 'string',
  6944. delay: '(number|object)',
  6945. html: 'boolean',
  6946. selector: '(string|boolean)',
  6947. placement: '(string|function)',
  6948. offset: '(number|string|function)',
  6949. container: '(string|element|boolean)',
  6950. fallbackPlacement: '(string|array)',
  6951. boundary: '(string|element)',
  6952. sanitize: 'boolean',
  6953. sanitizeFn: '(null|function)',
  6954. whiteList: 'object',
  6955. popperConfig: '(null|object)'
  6956. };
  6957. var AttachmentMap = {
  6958. AUTO: 'auto',
  6959. TOP: 'top',
  6960. RIGHT: 'right',
  6961. BOTTOM: 'bottom',
  6962. LEFT: 'left'
  6963. };
  6964. var Default$4 = {
  6965. animation: true,
  6966. template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
  6967. trigger: 'hover focus',
  6968. title: '',
  6969. delay: 0,
  6970. html: false,
  6971. selector: false,
  6972. placement: 'top',
  6973. offset: 0,
  6974. container: false,
  6975. fallbackPlacement: 'flip',
  6976. boundary: 'scrollParent',
  6977. sanitize: true,
  6978. sanitizeFn: null,
  6979. whiteList: DefaultWhitelist,
  6980. popperConfig: null
  6981. };
  6982. var HOVER_STATE_SHOW = 'show';
  6983. var HOVER_STATE_OUT = 'out';
  6984. var Event = {
  6985. HIDE: "hide" + EVENT_KEY$6,
  6986. HIDDEN: "hidden" + EVENT_KEY$6,
  6987. SHOW: "show" + EVENT_KEY$6,
  6988. SHOWN: "shown" + EVENT_KEY$6,
  6989. INSERTED: "inserted" + EVENT_KEY$6,
  6990. CLICK: "click" + EVENT_KEY$6,
  6991. FOCUSIN: "focusin" + EVENT_KEY$6,
  6992. FOCUSOUT: "focusout" + EVENT_KEY$6,
  6993. MOUSEENTER: "mouseenter" + EVENT_KEY$6,
  6994. MOUSELEAVE: "mouseleave" + EVENT_KEY$6
  6995. };
  6996. var CLASS_NAME_FADE$2 = 'fade';
  6997. var CLASS_NAME_SHOW$4 = 'show';
  6998. var SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
  6999. var SELECTOR_ARROW = '.arrow';
  7000. var TRIGGER_HOVER = 'hover';
  7001. var TRIGGER_FOCUS = 'focus';
  7002. var TRIGGER_CLICK = 'click';
  7003. var TRIGGER_MANUAL = 'manual';
  7004. /**
  7005. * ------------------------------------------------------------------------
  7006. * Class Definition
  7007. * ------------------------------------------------------------------------
  7008. */
  7009. var Tooltip = /*#__PURE__*/function () {
  7010. function Tooltip(element, config) {
  7011. if (typeof Popper === 'undefined') {
  7012. throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
  7013. } // private
  7014. this._isEnabled = true;
  7015. this._timeout = 0;
  7016. this._hoverState = '';
  7017. this._activeTrigger = {};
  7018. this._popper = null; // Protected
  7019. this.element = element;
  7020. this.config = this._getConfig(config);
  7021. this.tip = null;
  7022. this._setListeners();
  7023. } // Getters
  7024. var _proto = Tooltip.prototype;
  7025. // Public
  7026. _proto.enable = function enable() {
  7027. this._isEnabled = true;
  7028. };
  7029. _proto.disable = function disable() {
  7030. this._isEnabled = false;
  7031. };
  7032. _proto.toggleEnabled = function toggleEnabled() {
  7033. this._isEnabled = !this._isEnabled;
  7034. };
  7035. _proto.toggle = function toggle(event) {
  7036. if (!this._isEnabled) {
  7037. return;
  7038. }
  7039. if (event) {
  7040. var dataKey = this.constructor.DATA_KEY;
  7041. var context = $(event.currentTarget).data(dataKey);
  7042. if (!context) {
  7043. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  7044. $(event.currentTarget).data(dataKey, context);
  7045. }
  7046. context._activeTrigger.click = !context._activeTrigger.click;
  7047. if (context._isWithActiveTrigger()) {
  7048. context._enter(null, context);
  7049. } else {
  7050. context._leave(null, context);
  7051. }
  7052. } else {
  7053. if ($(this.getTipElement()).hasClass(CLASS_NAME_SHOW$4)) {
  7054. this._leave(null, this);
  7055. return;
  7056. }
  7057. this._enter(null, this);
  7058. }
  7059. };
  7060. _proto.dispose = function dispose() {
  7061. clearTimeout(this._timeout);
  7062. $.removeData(this.element, this.constructor.DATA_KEY);
  7063. $(this.element).off(this.constructor.EVENT_KEY);
  7064. $(this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);
  7065. if (this.tip) {
  7066. $(this.tip).remove();
  7067. }
  7068. this._isEnabled = null;
  7069. this._timeout = null;
  7070. this._hoverState = null;
  7071. this._activeTrigger = null;
  7072. if (this._popper) {
  7073. this._popper.destroy();
  7074. }
  7075. this._popper = null;
  7076. this.element = null;
  7077. this.config = null;
  7078. this.tip = null;
  7079. };
  7080. _proto.show = function show() {
  7081. var _this = this;
  7082. if ($(this.element).css('display') === 'none') {
  7083. throw new Error('Please use show on visible elements');
  7084. }
  7085. var showEvent = $.Event(this.constructor.Event.SHOW);
  7086. if (this.isWithContent() && this._isEnabled) {
  7087. $(this.element).trigger(showEvent);
  7088. var shadowRoot = Util.findShadowRoot(this.element);
  7089. var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
  7090. if (showEvent.isDefaultPrevented() || !isInTheDom) {
  7091. return;
  7092. }
  7093. var tip = this.getTipElement();
  7094. var tipId = Util.getUID(this.constructor.NAME);
  7095. tip.setAttribute('id', tipId);
  7096. this.element.setAttribute('aria-describedby', tipId);
  7097. this.setContent();
  7098. if (this.config.animation) {
  7099. $(tip).addClass(CLASS_NAME_FADE$2);
  7100. }
  7101. var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
  7102. var attachment = this._getAttachment(placement);
  7103. this.addAttachmentClass(attachment);
  7104. var container = this._getContainer();
  7105. $(tip).data(this.constructor.DATA_KEY, this);
  7106. if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
  7107. $(tip).appendTo(container);
  7108. }
  7109. $(this.element).trigger(this.constructor.Event.INSERTED);
  7110. this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment));
  7111. $(tip).addClass(CLASS_NAME_SHOW$4); // If this is a touch-enabled device we add extra
  7112. // empty mouseover listeners to the body's immediate children;
  7113. // only needed because of broken event delegation on iOS
  7114. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  7115. if ('ontouchstart' in document.documentElement) {
  7116. $(document.body).children().on('mouseover', null, $.noop);
  7117. }
  7118. var complete = function complete() {
  7119. if (_this.config.animation) {
  7120. _this._fixTransition();
  7121. }
  7122. var prevHoverState = _this._hoverState;
  7123. _this._hoverState = null;
  7124. $(_this.element).trigger(_this.constructor.Event.SHOWN);
  7125. if (prevHoverState === HOVER_STATE_OUT) {
  7126. _this._leave(null, _this);
  7127. }
  7128. };
  7129. if ($(this.tip).hasClass(CLASS_NAME_FADE$2)) {
  7130. var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
  7131. $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  7132. } else {
  7133. complete();
  7134. }
  7135. }
  7136. };
  7137. _proto.hide = function hide(callback) {
  7138. var _this2 = this;
  7139. var tip = this.getTipElement();
  7140. var hideEvent = $.Event(this.constructor.Event.HIDE);
  7141. var complete = function complete() {
  7142. if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
  7143. tip.parentNode.removeChild(tip);
  7144. }
  7145. _this2._cleanTipClass();
  7146. _this2.element.removeAttribute('aria-describedby');
  7147. $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
  7148. if (_this2._popper !== null) {
  7149. _this2._popper.destroy();
  7150. }
  7151. if (callback) {
  7152. callback();
  7153. }
  7154. };
  7155. $(this.element).trigger(hideEvent);
  7156. if (hideEvent.isDefaultPrevented()) {
  7157. return;
  7158. }
  7159. $(tip).removeClass(CLASS_NAME_SHOW$4); // If this is a touch-enabled device we remove the extra
  7160. // empty mouseover listeners we added for iOS support
  7161. if ('ontouchstart' in document.documentElement) {
  7162. $(document.body).children().off('mouseover', null, $.noop);
  7163. }
  7164. this._activeTrigger[TRIGGER_CLICK] = false;
  7165. this._activeTrigger[TRIGGER_FOCUS] = false;
  7166. this._activeTrigger[TRIGGER_HOVER] = false;
  7167. if ($(this.tip).hasClass(CLASS_NAME_FADE$2)) {
  7168. var transitionDuration = Util.getTransitionDurationFromElement(tip);
  7169. $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  7170. } else {
  7171. complete();
  7172. }
  7173. this._hoverState = '';
  7174. };
  7175. _proto.update = function update() {
  7176. if (this._popper !== null) {
  7177. this._popper.scheduleUpdate();
  7178. }
  7179. } // Protected
  7180. ;
  7181. _proto.isWithContent = function isWithContent() {
  7182. return Boolean(this.getTitle());
  7183. };
  7184. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  7185. $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
  7186. };
  7187. _proto.getTipElement = function getTipElement() {
  7188. this.tip = this.tip || $(this.config.template)[0];
  7189. return this.tip;
  7190. };
  7191. _proto.setContent = function setContent() {
  7192. var tip = this.getTipElement();
  7193. this.setElementContent($(tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle());
  7194. $(tip).removeClass(CLASS_NAME_FADE$2 + " " + CLASS_NAME_SHOW$4);
  7195. };
  7196. _proto.setElementContent = function setElementContent($element, content) {
  7197. if (typeof content === 'object' && (content.nodeType || content.jquery)) {
  7198. // Content is a DOM node or a jQuery
  7199. if (this.config.html) {
  7200. if (!$(content).parent().is($element)) {
  7201. $element.empty().append(content);
  7202. }
  7203. } else {
  7204. $element.text($(content).text());
  7205. }
  7206. return;
  7207. }
  7208. if (this.config.html) {
  7209. if (this.config.sanitize) {
  7210. content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
  7211. }
  7212. $element.html(content);
  7213. } else {
  7214. $element.text(content);
  7215. }
  7216. };
  7217. _proto.getTitle = function getTitle() {
  7218. var title = this.element.getAttribute('data-original-title');
  7219. if (!title) {
  7220. title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
  7221. }
  7222. return title;
  7223. } // Private
  7224. ;
  7225. _proto._getPopperConfig = function _getPopperConfig(attachment) {
  7226. var _this3 = this;
  7227. var defaultBsConfig = {
  7228. placement: attachment,
  7229. modifiers: {
  7230. offset: this._getOffset(),
  7231. flip: {
  7232. behavior: this.config.fallbackPlacement
  7233. },
  7234. arrow: {
  7235. element: SELECTOR_ARROW
  7236. },
  7237. preventOverflow: {
  7238. boundariesElement: this.config.boundary
  7239. }
  7240. },
  7241. onCreate: function onCreate(data) {
  7242. if (data.originalPlacement !== data.placement) {
  7243. _this3._handlePopperPlacementChange(data);
  7244. }
  7245. },
  7246. onUpdate: function onUpdate(data) {
  7247. return _this3._handlePopperPlacementChange(data);
  7248. }
  7249. };
  7250. return _objectSpread2(_objectSpread2({}, defaultBsConfig), this.config.popperConfig);
  7251. };
  7252. _proto._getOffset = function _getOffset() {
  7253. var _this4 = this;
  7254. var offset = {};
  7255. if (typeof this.config.offset === 'function') {
  7256. offset.fn = function (data) {
  7257. data.offsets = _objectSpread2(_objectSpread2({}, data.offsets), _this4.config.offset(data.offsets, _this4.element) || {});
  7258. return data;
  7259. };
  7260. } else {
  7261. offset.offset = this.config.offset;
  7262. }
  7263. return offset;
  7264. };
  7265. _proto._getContainer = function _getContainer() {
  7266. if (this.config.container === false) {
  7267. return document.body;
  7268. }
  7269. if (Util.isElement(this.config.container)) {
  7270. return $(this.config.container);
  7271. }
  7272. return $(document).find(this.config.container);
  7273. };
  7274. _proto._getAttachment = function _getAttachment(placement) {
  7275. return AttachmentMap[placement.toUpperCase()];
  7276. };
  7277. _proto._setListeners = function _setListeners() {
  7278. var _this5 = this;
  7279. var triggers = this.config.trigger.split(' ');
  7280. triggers.forEach(function (trigger) {
  7281. if (trigger === 'click') {
  7282. $(_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
  7283. return _this5.toggle(event);
  7284. });
  7285. } else if (trigger !== TRIGGER_MANUAL) {
  7286. var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
  7287. var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
  7288. $(_this5.element).on(eventIn, _this5.config.selector, function (event) {
  7289. return _this5._enter(event);
  7290. }).on(eventOut, _this5.config.selector, function (event) {
  7291. return _this5._leave(event);
  7292. });
  7293. }
  7294. });
  7295. this._hideModalHandler = function () {
  7296. if (_this5.element) {
  7297. _this5.hide();
  7298. }
  7299. };
  7300. $(this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
  7301. if (this.config.selector) {
  7302. this.config = _objectSpread2(_objectSpread2({}, this.config), {}, {
  7303. trigger: 'manual',
  7304. selector: ''
  7305. });
  7306. } else {
  7307. this._fixTitle();
  7308. }
  7309. };
  7310. _proto._fixTitle = function _fixTitle() {
  7311. var titleType = typeof this.element.getAttribute('data-original-title');
  7312. if (this.element.getAttribute('title') || titleType !== 'string') {
  7313. this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
  7314. this.element.setAttribute('title', '');
  7315. }
  7316. };
  7317. _proto._enter = function _enter(event, context) {
  7318. var dataKey = this.constructor.DATA_KEY;
  7319. context = context || $(event.currentTarget).data(dataKey);
  7320. if (!context) {
  7321. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  7322. $(event.currentTarget).data(dataKey, context);
  7323. }
  7324. if (event) {
  7325. context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
  7326. }
  7327. if ($(context.getTipElement()).hasClass(CLASS_NAME_SHOW$4) || context._hoverState === HOVER_STATE_SHOW) {
  7328. context._hoverState = HOVER_STATE_SHOW;
  7329. return;
  7330. }
  7331. clearTimeout(context._timeout);
  7332. context._hoverState = HOVER_STATE_SHOW;
  7333. if (!context.config.delay || !context.config.delay.show) {
  7334. context.show();
  7335. return;
  7336. }
  7337. context._timeout = setTimeout(function () {
  7338. if (context._hoverState === HOVER_STATE_SHOW) {
  7339. context.show();
  7340. }
  7341. }, context.config.delay.show);
  7342. };
  7343. _proto._leave = function _leave(event, context) {
  7344. var dataKey = this.constructor.DATA_KEY;
  7345. context = context || $(event.currentTarget).data(dataKey);
  7346. if (!context) {
  7347. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  7348. $(event.currentTarget).data(dataKey, context);
  7349. }
  7350. if (event) {
  7351. context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;
  7352. }
  7353. if (context._isWithActiveTrigger()) {
  7354. return;
  7355. }
  7356. clearTimeout(context._timeout);
  7357. context._hoverState = HOVER_STATE_OUT;
  7358. if (!context.config.delay || !context.config.delay.hide) {
  7359. context.hide();
  7360. return;
  7361. }
  7362. context._timeout = setTimeout(function () {
  7363. if (context._hoverState === HOVER_STATE_OUT) {
  7364. context.hide();
  7365. }
  7366. }, context.config.delay.hide);
  7367. };
  7368. _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
  7369. for (var trigger in this._activeTrigger) {
  7370. if (this._activeTrigger[trigger]) {
  7371. return true;
  7372. }
  7373. }
  7374. return false;
  7375. };
  7376. _proto._getConfig = function _getConfig(config) {
  7377. var dataAttributes = $(this.element).data();
  7378. Object.keys(dataAttributes).forEach(function (dataAttr) {
  7379. if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
  7380. delete dataAttributes[dataAttr];
  7381. }
  7382. });
  7383. config = _objectSpread2(_objectSpread2(_objectSpread2({}, this.constructor.Default), dataAttributes), typeof config === 'object' && config ? config : {});
  7384. if (typeof config.delay === 'number') {
  7385. config.delay = {
  7386. show: config.delay,
  7387. hide: config.delay
  7388. };
  7389. }
  7390. if (typeof config.title === 'number') {
  7391. config.title = config.title.toString();
  7392. }
  7393. if (typeof config.content === 'number') {
  7394. config.content = config.content.toString();
  7395. }
  7396. Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType);
  7397. if (config.sanitize) {
  7398. config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
  7399. }
  7400. return config;
  7401. };
  7402. _proto._getDelegateConfig = function _getDelegateConfig() {
  7403. var config = {};
  7404. if (this.config) {
  7405. for (var key in this.config) {
  7406. if (this.constructor.Default[key] !== this.config[key]) {
  7407. config[key] = this.config[key];
  7408. }
  7409. }
  7410. }
  7411. return config;
  7412. };
  7413. _proto._cleanTipClass = function _cleanTipClass() {
  7414. var $tip = $(this.getTipElement());
  7415. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
  7416. if (tabClass !== null && tabClass.length) {
  7417. $tip.removeClass(tabClass.join(''));
  7418. }
  7419. };
  7420. _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
  7421. this.tip = popperData.instance.popper;
  7422. this._cleanTipClass();
  7423. this.addAttachmentClass(this._getAttachment(popperData.placement));
  7424. };
  7425. _proto._fixTransition = function _fixTransition() {
  7426. var tip = this.getTipElement();
  7427. var initConfigAnimation = this.config.animation;
  7428. if (tip.getAttribute('x-placement') !== null) {
  7429. return;
  7430. }
  7431. $(tip).removeClass(CLASS_NAME_FADE$2);
  7432. this.config.animation = false;
  7433. this.hide();
  7434. this.show();
  7435. this.config.animation = initConfigAnimation;
  7436. } // Static
  7437. ;
  7438. Tooltip._jQueryInterface = function _jQueryInterface(config) {
  7439. return this.each(function () {
  7440. var data = $(this).data(DATA_KEY$6);
  7441. var _config = typeof config === 'object' && config;
  7442. if (!data && /dispose|hide/.test(config)) {
  7443. return;
  7444. }
  7445. if (!data) {
  7446. data = new Tooltip(this, _config);
  7447. $(this).data(DATA_KEY$6, data);
  7448. }
  7449. if (typeof config === 'string') {
  7450. if (typeof data[config] === 'undefined') {
  7451. throw new TypeError("No method named \"" + config + "\"");
  7452. }
  7453. data[config]();
  7454. }
  7455. });
  7456. };
  7457. _createClass(Tooltip, null, [{
  7458. key: "VERSION",
  7459. get: function get() {
  7460. return VERSION$6;
  7461. }
  7462. }, {
  7463. key: "Default",
  7464. get: function get() {
  7465. return Default$4;
  7466. }
  7467. }, {
  7468. key: "NAME",
  7469. get: function get() {
  7470. return NAME$6;
  7471. }
  7472. }, {
  7473. key: "DATA_KEY",
  7474. get: function get() {
  7475. return DATA_KEY$6;
  7476. }
  7477. }, {
  7478. key: "Event",
  7479. get: function get() {
  7480. return Event;
  7481. }
  7482. }, {
  7483. key: "EVENT_KEY",
  7484. get: function get() {
  7485. return EVENT_KEY$6;
  7486. }
  7487. }, {
  7488. key: "DefaultType",
  7489. get: function get() {
  7490. return DefaultType$4;
  7491. }
  7492. }]);
  7493. return Tooltip;
  7494. }();
  7495. /**
  7496. * ------------------------------------------------------------------------
  7497. * jQuery
  7498. * ------------------------------------------------------------------------
  7499. */
  7500. $.fn[NAME$6] = Tooltip._jQueryInterface;
  7501. $.fn[NAME$6].Constructor = Tooltip;
  7502. $.fn[NAME$6].noConflict = function () {
  7503. $.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
  7504. return Tooltip._jQueryInterface;
  7505. };
  7506. /**
  7507. * ------------------------------------------------------------------------
  7508. * Constants
  7509. * ------------------------------------------------------------------------
  7510. */
  7511. var NAME$7 = 'popover';
  7512. var VERSION$7 = '4.5.0';
  7513. var DATA_KEY$7 = 'bs.popover';
  7514. var EVENT_KEY$7 = "." + DATA_KEY$7;
  7515. var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7];
  7516. var CLASS_PREFIX$1 = 'bs-popover';
  7517. var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');
  7518. var Default$5 = _objectSpread2(_objectSpread2({}, Tooltip.Default), {}, {
  7519. placement: 'right',
  7520. trigger: 'click',
  7521. content: '',
  7522. template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
  7523. });
  7524. var DefaultType$5 = _objectSpread2(_objectSpread2({}, Tooltip.DefaultType), {}, {
  7525. content: '(string|element|function)'
  7526. });
  7527. var CLASS_NAME_FADE$3 = 'fade';
  7528. var CLASS_NAME_SHOW$5 = 'show';
  7529. var SELECTOR_TITLE = '.popover-header';
  7530. var SELECTOR_CONTENT = '.popover-body';
  7531. var Event$1 = {
  7532. HIDE: "hide" + EVENT_KEY$7,
  7533. HIDDEN: "hidden" + EVENT_KEY$7,
  7534. SHOW: "show" + EVENT_KEY$7,
  7535. SHOWN: "shown" + EVENT_KEY$7,
  7536. INSERTED: "inserted" + EVENT_KEY$7,
  7537. CLICK: "click" + EVENT_KEY$7,
  7538. FOCUSIN: "focusin" + EVENT_KEY$7,
  7539. FOCUSOUT: "focusout" + EVENT_KEY$7,
  7540. MOUSEENTER: "mouseenter" + EVENT_KEY$7,
  7541. MOUSELEAVE: "mouseleave" + EVENT_KEY$7
  7542. };
  7543. /**
  7544. * ------------------------------------------------------------------------
  7545. * Class Definition
  7546. * ------------------------------------------------------------------------
  7547. */
  7548. var Popover = /*#__PURE__*/function (_Tooltip) {
  7549. _inheritsLoose(Popover, _Tooltip);
  7550. function Popover() {
  7551. return _Tooltip.apply(this, arguments) || this;
  7552. }
  7553. var _proto = Popover.prototype;
  7554. // Overrides
  7555. _proto.isWithContent = function isWithContent() {
  7556. return this.getTitle() || this._getContent();
  7557. };
  7558. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  7559. $(this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment);
  7560. };
  7561. _proto.getTipElement = function getTipElement() {
  7562. this.tip = this.tip || $(this.config.template)[0];
  7563. return this.tip;
  7564. };
  7565. _proto.setContent = function setContent() {
  7566. var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events
  7567. this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle());
  7568. var content = this._getContent();
  7569. if (typeof content === 'function') {
  7570. content = content.call(this.element);
  7571. }
  7572. this.setElementContent($tip.find(SELECTOR_CONTENT), content);
  7573. $tip.removeClass(CLASS_NAME_FADE$3 + " " + CLASS_NAME_SHOW$5);
  7574. } // Private
  7575. ;
  7576. _proto._getContent = function _getContent() {
  7577. return this.element.getAttribute('data-content') || this.config.content;
  7578. };
  7579. _proto._cleanTipClass = function _cleanTipClass() {
  7580. var $tip = $(this.getTipElement());
  7581. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1);
  7582. if (tabClass !== null && tabClass.length > 0) {
  7583. $tip.removeClass(tabClass.join(''));
  7584. }
  7585. } // Static
  7586. ;
  7587. Popover._jQueryInterface = function _jQueryInterface(config) {
  7588. return this.each(function () {
  7589. var data = $(this).data(DATA_KEY$7);
  7590. var _config = typeof config === 'object' ? config : null;
  7591. if (!data && /dispose|hide/.test(config)) {
  7592. return;
  7593. }
  7594. if (!data) {
  7595. data = new Popover(this, _config);
  7596. $(this).data(DATA_KEY$7, data);
  7597. }
  7598. if (typeof config === 'string') {
  7599. if (typeof data[config] === 'undefined') {
  7600. throw new TypeError("No method named \"" + config + "\"");
  7601. }
  7602. data[config]();
  7603. }
  7604. });
  7605. };
  7606. _createClass(Popover, null, [{
  7607. key: "VERSION",
  7608. // Getters
  7609. get: function get() {
  7610. return VERSION$7;
  7611. }
  7612. }, {
  7613. key: "Default",
  7614. get: function get() {
  7615. return Default$5;
  7616. }
  7617. }, {
  7618. key: "NAME",
  7619. get: function get() {
  7620. return NAME$7;
  7621. }
  7622. }, {
  7623. key: "DATA_KEY",
  7624. get: function get() {
  7625. return DATA_KEY$7;
  7626. }
  7627. }, {
  7628. key: "Event",
  7629. get: function get() {
  7630. return Event$1;
  7631. }
  7632. }, {
  7633. key: "EVENT_KEY",
  7634. get: function get() {
  7635. return EVENT_KEY$7;
  7636. }
  7637. }, {
  7638. key: "DefaultType",
  7639. get: function get() {
  7640. return DefaultType$5;
  7641. }
  7642. }]);
  7643. return Popover;
  7644. }(Tooltip);
  7645. /**
  7646. * ------------------------------------------------------------------------
  7647. * jQuery
  7648. * ------------------------------------------------------------------------
  7649. */
  7650. $.fn[NAME$7] = Popover._jQueryInterface;
  7651. $.fn[NAME$7].Constructor = Popover;
  7652. $.fn[NAME$7].noConflict = function () {
  7653. $.fn[NAME$7] = JQUERY_NO_CONFLICT$7;
  7654. return Popover._jQueryInterface;
  7655. };
  7656. /**
  7657. * ------------------------------------------------------------------------
  7658. * Constants
  7659. * ------------------------------------------------------------------------
  7660. */
  7661. var NAME$8 = 'scrollspy';
  7662. var VERSION$8 = '4.5.0';
  7663. var DATA_KEY$8 = 'bs.scrollspy';
  7664. var EVENT_KEY$8 = "." + DATA_KEY$8;
  7665. var DATA_API_KEY$6 = '.data-api';
  7666. var JQUERY_NO_CONFLICT$8 = $.fn[NAME$8];
  7667. var Default$6 = {
  7668. offset: 10,
  7669. method: 'auto',
  7670. target: ''
  7671. };
  7672. var DefaultType$6 = {
  7673. offset: 'number',
  7674. method: 'string',
  7675. target: '(string|element)'
  7676. };
  7677. var EVENT_ACTIVATE = "activate" + EVENT_KEY$8;
  7678. var EVENT_SCROLL = "scroll" + EVENT_KEY$8;
  7679. var EVENT_LOAD_DATA_API$2 = "load" + EVENT_KEY$8 + DATA_API_KEY$6;
  7680. var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';
  7681. var CLASS_NAME_ACTIVE$2 = 'active';
  7682. var SELECTOR_DATA_SPY = '[data-spy="scroll"]';
  7683. var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
  7684. var SELECTOR_NAV_LINKS = '.nav-link';
  7685. var SELECTOR_NAV_ITEMS = '.nav-item';
  7686. var SELECTOR_LIST_ITEMS = '.list-group-item';
  7687. var SELECTOR_DROPDOWN = '.dropdown';
  7688. var SELECTOR_DROPDOWN_ITEMS = '.dropdown-item';
  7689. var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
  7690. var METHOD_OFFSET = 'offset';
  7691. var METHOD_POSITION = 'position';
  7692. /**
  7693. * ------------------------------------------------------------------------
  7694. * Class Definition
  7695. * ------------------------------------------------------------------------
  7696. */
  7697. var ScrollSpy = /*#__PURE__*/function () {
  7698. function ScrollSpy(element, config) {
  7699. var _this = this;
  7700. this._element = element;
  7701. this._scrollElement = element.tagName === 'BODY' ? window : element;
  7702. this._config = this._getConfig(config);
  7703. this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + "," + (this._config.target + " " + SELECTOR_LIST_ITEMS + ",") + (this._config.target + " " + SELECTOR_DROPDOWN_ITEMS);
  7704. this._offsets = [];
  7705. this._targets = [];
  7706. this._activeTarget = null;
  7707. this._scrollHeight = 0;
  7708. $(this._scrollElement).on(EVENT_SCROLL, function (event) {
  7709. return _this._process(event);
  7710. });
  7711. this.refresh();
  7712. this._process();
  7713. } // Getters
  7714. var _proto = ScrollSpy.prototype;
  7715. // Public
  7716. _proto.refresh = function refresh() {
  7717. var _this2 = this;
  7718. var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION;
  7719. var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
  7720. var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0;
  7721. this._offsets = [];
  7722. this._targets = [];
  7723. this._scrollHeight = this._getScrollHeight();
  7724. var targets = [].slice.call(document.querySelectorAll(this._selector));
  7725. targets.map(function (element) {
  7726. var target;
  7727. var targetSelector = Util.getSelectorFromElement(element);
  7728. if (targetSelector) {
  7729. target = document.querySelector(targetSelector);
  7730. }
  7731. if (target) {
  7732. var targetBCR = target.getBoundingClientRect();
  7733. if (targetBCR.width || targetBCR.height) {
  7734. // TODO (fat): remove sketch reliance on jQuery position/offset
  7735. return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
  7736. }
  7737. }
  7738. return null;
  7739. }).filter(function (item) {
  7740. return item;
  7741. }).sort(function (a, b) {
  7742. return a[0] - b[0];
  7743. }).forEach(function (item) {
  7744. _this2._offsets.push(item[0]);
  7745. _this2._targets.push(item[1]);
  7746. });
  7747. };
  7748. _proto.dispose = function dispose() {
  7749. $.removeData(this._element, DATA_KEY$8);
  7750. $(this._scrollElement).off(EVENT_KEY$8);
  7751. this._element = null;
  7752. this._scrollElement = null;
  7753. this._config = null;
  7754. this._selector = null;
  7755. this._offsets = null;
  7756. this._targets = null;
  7757. this._activeTarget = null;
  7758. this._scrollHeight = null;
  7759. } // Private
  7760. ;
  7761. _proto._getConfig = function _getConfig(config) {
  7762. config = _objectSpread2(_objectSpread2({}, Default$6), typeof config === 'object' && config ? config : {});
  7763. if (typeof config.target !== 'string' && Util.isElement(config.target)) {
  7764. var id = $(config.target).attr('id');
  7765. if (!id) {
  7766. id = Util.getUID(NAME$8);
  7767. $(config.target).attr('id', id);
  7768. }
  7769. config.target = "#" + id;
  7770. }
  7771. Util.typeCheckConfig(NAME$8, config, DefaultType$6);
  7772. return config;
  7773. };
  7774. _proto._getScrollTop = function _getScrollTop() {
  7775. return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
  7776. };
  7777. _proto._getScrollHeight = function _getScrollHeight() {
  7778. return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
  7779. };
  7780. _proto._getOffsetHeight = function _getOffsetHeight() {
  7781. return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
  7782. };
  7783. _proto._process = function _process() {
  7784. var scrollTop = this._getScrollTop() + this._config.offset;
  7785. var scrollHeight = this._getScrollHeight();
  7786. var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
  7787. if (this._scrollHeight !== scrollHeight) {
  7788. this.refresh();
  7789. }
  7790. if (scrollTop >= maxScroll) {
  7791. var target = this._targets[this._targets.length - 1];
  7792. if (this._activeTarget !== target) {
  7793. this._activate(target);
  7794. }
  7795. return;
  7796. }
  7797. if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
  7798. this._activeTarget = null;
  7799. this._clear();
  7800. return;
  7801. }
  7802. for (var i = this._offsets.length; i--;) {
  7803. var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
  7804. if (isActiveTarget) {
  7805. this._activate(this._targets[i]);
  7806. }
  7807. }
  7808. };
  7809. _proto._activate = function _activate(target) {
  7810. this._activeTarget = target;
  7811. this._clear();
  7812. var queries = this._selector.split(',').map(function (selector) {
  7813. return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
  7814. });
  7815. var $link = $([].slice.call(document.querySelectorAll(queries.join(','))));
  7816. if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) {
  7817. $link.closest(SELECTOR_DROPDOWN).find(SELECTOR_DROPDOWN_TOGGLE).addClass(CLASS_NAME_ACTIVE$2);
  7818. $link.addClass(CLASS_NAME_ACTIVE$2);
  7819. } else {
  7820. // Set triggered link as active
  7821. $link.addClass(CLASS_NAME_ACTIVE$2); // Set triggered links parents as active
  7822. // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
  7823. $link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_LINKS + ", " + SELECTOR_LIST_ITEMS).addClass(CLASS_NAME_ACTIVE$2); // Handle special case when .nav-link is inside .nav-item
  7824. $link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_ITEMS).children(SELECTOR_NAV_LINKS).addClass(CLASS_NAME_ACTIVE$2);
  7825. }
  7826. $(this._scrollElement).trigger(EVENT_ACTIVATE, {
  7827. relatedTarget: target
  7828. });
  7829. };
  7830. _proto._clear = function _clear() {
  7831. [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) {
  7832. return node.classList.contains(CLASS_NAME_ACTIVE$2);
  7833. }).forEach(function (node) {
  7834. return node.classList.remove(CLASS_NAME_ACTIVE$2);
  7835. });
  7836. } // Static
  7837. ;
  7838. ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
  7839. return this.each(function () {
  7840. var data = $(this).data(DATA_KEY$8);
  7841. var _config = typeof config === 'object' && config;
  7842. if (!data) {
  7843. data = new ScrollSpy(this, _config);
  7844. $(this).data(DATA_KEY$8, data);
  7845. }
  7846. if (typeof config === 'string') {
  7847. if (typeof data[config] === 'undefined') {
  7848. throw new TypeError("No method named \"" + config + "\"");
  7849. }
  7850. data[config]();
  7851. }
  7852. });
  7853. };
  7854. _createClass(ScrollSpy, null, [{
  7855. key: "VERSION",
  7856. get: function get() {
  7857. return VERSION$8;
  7858. }
  7859. }, {
  7860. key: "Default",
  7861. get: function get() {
  7862. return Default$6;
  7863. }
  7864. }]);
  7865. return ScrollSpy;
  7866. }();
  7867. /**
  7868. * ------------------------------------------------------------------------
  7869. * Data Api implementation
  7870. * ------------------------------------------------------------------------
  7871. */
  7872. $(window).on(EVENT_LOAD_DATA_API$2, function () {
  7873. var scrollSpys = [].slice.call(document.querySelectorAll(SELECTOR_DATA_SPY));
  7874. var scrollSpysLength = scrollSpys.length;
  7875. for (var i = scrollSpysLength; i--;) {
  7876. var $spy = $(scrollSpys[i]);
  7877. ScrollSpy._jQueryInterface.call($spy, $spy.data());
  7878. }
  7879. });
  7880. /**
  7881. * ------------------------------------------------------------------------
  7882. * jQuery
  7883. * ------------------------------------------------------------------------
  7884. */
  7885. $.fn[NAME$8] = ScrollSpy._jQueryInterface;
  7886. $.fn[NAME$8].Constructor = ScrollSpy;
  7887. $.fn[NAME$8].noConflict = function () {
  7888. $.fn[NAME$8] = JQUERY_NO_CONFLICT$8;
  7889. return ScrollSpy._jQueryInterface;
  7890. };
  7891. /**
  7892. * ------------------------------------------------------------------------
  7893. * Constants
  7894. * ------------------------------------------------------------------------
  7895. */
  7896. var NAME$9 = 'tab';
  7897. var VERSION$9 = '4.5.0';
  7898. var DATA_KEY$9 = 'bs.tab';
  7899. var EVENT_KEY$9 = "." + DATA_KEY$9;
  7900. var DATA_API_KEY$7 = '.data-api';
  7901. var JQUERY_NO_CONFLICT$9 = $.fn[NAME$9];
  7902. var EVENT_HIDE$3 = "hide" + EVENT_KEY$9;
  7903. var EVENT_HIDDEN$3 = "hidden" + EVENT_KEY$9;
  7904. var EVENT_SHOW$3 = "show" + EVENT_KEY$9;
  7905. var EVENT_SHOWN$3 = "shown" + EVENT_KEY$9;
  7906. var EVENT_CLICK_DATA_API$6 = "click" + EVENT_KEY$9 + DATA_API_KEY$7;
  7907. var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';
  7908. var CLASS_NAME_ACTIVE$3 = 'active';
  7909. var CLASS_NAME_DISABLED$1 = 'disabled';
  7910. var CLASS_NAME_FADE$4 = 'fade';
  7911. var CLASS_NAME_SHOW$6 = 'show';
  7912. var SELECTOR_DROPDOWN$1 = '.dropdown';
  7913. var SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group';
  7914. var SELECTOR_ACTIVE$2 = '.active';
  7915. var SELECTOR_ACTIVE_UL = '> li > .active';
  7916. var SELECTOR_DATA_TOGGLE$4 = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]';
  7917. var SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';
  7918. var SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active';
  7919. /**
  7920. * ------------------------------------------------------------------------
  7921. * Class Definition
  7922. * ------------------------------------------------------------------------
  7923. */
  7924. var Tab = /*#__PURE__*/function () {
  7925. function Tab(element) {
  7926. this._element = element;
  7927. } // Getters
  7928. var _proto = Tab.prototype;
  7929. // Public
  7930. _proto.show = function show() {
  7931. var _this = this;
  7932. if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(CLASS_NAME_ACTIVE$3) || $(this._element).hasClass(CLASS_NAME_DISABLED$1)) {
  7933. return;
  7934. }
  7935. var target;
  7936. var previous;
  7937. var listElement = $(this._element).closest(SELECTOR_NAV_LIST_GROUP$1)[0];
  7938. var selector = Util.getSelectorFromElement(this._element);
  7939. if (listElement) {
  7940. var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE$2;
  7941. previous = $.makeArray($(listElement).find(itemSelector));
  7942. previous = previous[previous.length - 1];
  7943. }
  7944. var hideEvent = $.Event(EVENT_HIDE$3, {
  7945. relatedTarget: this._element
  7946. });
  7947. var showEvent = $.Event(EVENT_SHOW$3, {
  7948. relatedTarget: previous
  7949. });
  7950. if (previous) {
  7951. $(previous).trigger(hideEvent);
  7952. }
  7953. $(this._element).trigger(showEvent);
  7954. if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
  7955. return;
  7956. }
  7957. if (selector) {
  7958. target = document.querySelector(selector);
  7959. }
  7960. this._activate(this._element, listElement);
  7961. var complete = function complete() {
  7962. var hiddenEvent = $.Event(EVENT_HIDDEN$3, {
  7963. relatedTarget: _this._element
  7964. });
  7965. var shownEvent = $.Event(EVENT_SHOWN$3, {
  7966. relatedTarget: previous
  7967. });
  7968. $(previous).trigger(hiddenEvent);
  7969. $(_this._element).trigger(shownEvent);
  7970. };
  7971. if (target) {
  7972. this._activate(target, target.parentNode, complete);
  7973. } else {
  7974. complete();
  7975. }
  7976. };
  7977. _proto.dispose = function dispose() {
  7978. $.removeData(this._element, DATA_KEY$9);
  7979. this._element = null;
  7980. } // Private
  7981. ;
  7982. _proto._activate = function _activate(element, container, callback) {
  7983. var _this2 = this;
  7984. var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(SELECTOR_ACTIVE_UL) : $(container).children(SELECTOR_ACTIVE$2);
  7985. var active = activeElements[0];
  7986. var isTransitioning = callback && active && $(active).hasClass(CLASS_NAME_FADE$4);
  7987. var complete = function complete() {
  7988. return _this2._transitionComplete(element, active, callback);
  7989. };
  7990. if (active && isTransitioning) {
  7991. var transitionDuration = Util.getTransitionDurationFromElement(active);
  7992. $(active).removeClass(CLASS_NAME_SHOW$6).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  7993. } else {
  7994. complete();
  7995. }
  7996. };
  7997. _proto._transitionComplete = function _transitionComplete(element, active, callback) {
  7998. if (active) {
  7999. $(active).removeClass(CLASS_NAME_ACTIVE$3);
  8000. var dropdownChild = $(active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0];
  8001. if (dropdownChild) {
  8002. $(dropdownChild).removeClass(CLASS_NAME_ACTIVE$3);
  8003. }
  8004. if (active.getAttribute('role') === 'tab') {
  8005. active.setAttribute('aria-selected', false);
  8006. }
  8007. }
  8008. $(element).addClass(CLASS_NAME_ACTIVE$3);
  8009. if (element.getAttribute('role') === 'tab') {
  8010. element.setAttribute('aria-selected', true);
  8011. }
  8012. Util.reflow(element);
  8013. if (element.classList.contains(CLASS_NAME_FADE$4)) {
  8014. element.classList.add(CLASS_NAME_SHOW$6);
  8015. }
  8016. if (element.parentNode && $(element.parentNode).hasClass(CLASS_NAME_DROPDOWN_MENU)) {
  8017. var dropdownElement = $(element).closest(SELECTOR_DROPDOWN$1)[0];
  8018. if (dropdownElement) {
  8019. var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE$1));
  8020. $(dropdownToggleList).addClass(CLASS_NAME_ACTIVE$3);
  8021. }
  8022. element.setAttribute('aria-expanded', true);
  8023. }
  8024. if (callback) {
  8025. callback();
  8026. }
  8027. } // Static
  8028. ;
  8029. Tab._jQueryInterface = function _jQueryInterface(config) {
  8030. return this.each(function () {
  8031. var $this = $(this);
  8032. var data = $this.data(DATA_KEY$9);
  8033. if (!data) {
  8034. data = new Tab(this);
  8035. $this.data(DATA_KEY$9, data);
  8036. }
  8037. if (typeof config === 'string') {
  8038. if (typeof data[config] === 'undefined') {
  8039. throw new TypeError("No method named \"" + config + "\"");
  8040. }
  8041. data[config]();
  8042. }
  8043. });
  8044. };
  8045. _createClass(Tab, null, [{
  8046. key: "VERSION",
  8047. get: function get() {
  8048. return VERSION$9;
  8049. }
  8050. }]);
  8051. return Tab;
  8052. }();
  8053. /**
  8054. * ------------------------------------------------------------------------
  8055. * Data Api implementation
  8056. * ------------------------------------------------------------------------
  8057. */
  8058. $(document).on(EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$4, function (event) {
  8059. event.preventDefault();
  8060. Tab._jQueryInterface.call($(this), 'show');
  8061. });
  8062. /**
  8063. * ------------------------------------------------------------------------
  8064. * jQuery
  8065. * ------------------------------------------------------------------------
  8066. */
  8067. $.fn[NAME$9] = Tab._jQueryInterface;
  8068. $.fn[NAME$9].Constructor = Tab;
  8069. $.fn[NAME$9].noConflict = function () {
  8070. $.fn[NAME$9] = JQUERY_NO_CONFLICT$9;
  8071. return Tab._jQueryInterface;
  8072. };
  8073. /**
  8074. * ------------------------------------------------------------------------
  8075. * Constants
  8076. * ------------------------------------------------------------------------
  8077. */
  8078. var NAME$a = 'toast';
  8079. var VERSION$a = '4.5.0';
  8080. var DATA_KEY$a = 'bs.toast';
  8081. var EVENT_KEY$a = "." + DATA_KEY$a;
  8082. var JQUERY_NO_CONFLICT$a = $.fn[NAME$a];
  8083. var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$a;
  8084. var EVENT_HIDE$4 = "hide" + EVENT_KEY$a;
  8085. var EVENT_HIDDEN$4 = "hidden" + EVENT_KEY$a;
  8086. var EVENT_SHOW$4 = "show" + EVENT_KEY$a;
  8087. var EVENT_SHOWN$4 = "shown" + EVENT_KEY$a;
  8088. var CLASS_NAME_FADE$5 = 'fade';
  8089. var CLASS_NAME_HIDE = 'hide';
  8090. var CLASS_NAME_SHOW$7 = 'show';
  8091. var CLASS_NAME_SHOWING = 'showing';
  8092. var DefaultType$7 = {
  8093. animation: 'boolean',
  8094. autohide: 'boolean',
  8095. delay: 'number'
  8096. };
  8097. var Default$7 = {
  8098. animation: true,
  8099. autohide: true,
  8100. delay: 500
  8101. };
  8102. var SELECTOR_DATA_DISMISS$1 = '[data-dismiss="toast"]';
  8103. /**
  8104. * ------------------------------------------------------------------------
  8105. * Class Definition
  8106. * ------------------------------------------------------------------------
  8107. */
  8108. var Toast = /*#__PURE__*/function () {
  8109. function Toast(element, config) {
  8110. this._element = element;
  8111. this._config = this._getConfig(config);
  8112. this._timeout = null;
  8113. this._setListeners();
  8114. } // Getters
  8115. var _proto = Toast.prototype;
  8116. // Public
  8117. _proto.show = function show() {
  8118. var _this = this;
  8119. var showEvent = $.Event(EVENT_SHOW$4);
  8120. $(this._element).trigger(showEvent);
  8121. if (showEvent.isDefaultPrevented()) {
  8122. return;
  8123. }
  8124. if (this._config.animation) {
  8125. this._element.classList.add(CLASS_NAME_FADE$5);
  8126. }
  8127. var complete = function complete() {
  8128. _this._element.classList.remove(CLASS_NAME_SHOWING);
  8129. _this._element.classList.add(CLASS_NAME_SHOW$7);
  8130. $(_this._element).trigger(EVENT_SHOWN$4);
  8131. if (_this._config.autohide) {
  8132. _this._timeout = setTimeout(function () {
  8133. _this.hide();
  8134. }, _this._config.delay);
  8135. }
  8136. };
  8137. this._element.classList.remove(CLASS_NAME_HIDE);
  8138. Util.reflow(this._element);
  8139. this._element.classList.add(CLASS_NAME_SHOWING);
  8140. if (this._config.animation) {
  8141. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  8142. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  8143. } else {
  8144. complete();
  8145. }
  8146. };
  8147. _proto.hide = function hide() {
  8148. if (!this._element.classList.contains(CLASS_NAME_SHOW$7)) {
  8149. return;
  8150. }
  8151. var hideEvent = $.Event(EVENT_HIDE$4);
  8152. $(this._element).trigger(hideEvent);
  8153. if (hideEvent.isDefaultPrevented()) {
  8154. return;
  8155. }
  8156. this._close();
  8157. };
  8158. _proto.dispose = function dispose() {
  8159. clearTimeout(this._timeout);
  8160. this._timeout = null;
  8161. if (this._element.classList.contains(CLASS_NAME_SHOW$7)) {
  8162. this._element.classList.remove(CLASS_NAME_SHOW$7);
  8163. }
  8164. $(this._element).off(EVENT_CLICK_DISMISS$1);
  8165. $.removeData(this._element, DATA_KEY$a);
  8166. this._element = null;
  8167. this._config = null;
  8168. } // Private
  8169. ;
  8170. _proto._getConfig = function _getConfig(config) {
  8171. config = _objectSpread2(_objectSpread2(_objectSpread2({}, Default$7), $(this._element).data()), typeof config === 'object' && config ? config : {});
  8172. Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType);
  8173. return config;
  8174. };
  8175. _proto._setListeners = function _setListeners() {
  8176. var _this2 = this;
  8177. $(this._element).on(EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function () {
  8178. return _this2.hide();
  8179. });
  8180. };
  8181. _proto._close = function _close() {
  8182. var _this3 = this;
  8183. var complete = function complete() {
  8184. _this3._element.classList.add(CLASS_NAME_HIDE);
  8185. $(_this3._element).trigger(EVENT_HIDDEN$4);
  8186. };
  8187. this._element.classList.remove(CLASS_NAME_SHOW$7);
  8188. if (this._config.animation) {
  8189. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  8190. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  8191. } else {
  8192. complete();
  8193. }
  8194. } // Static
  8195. ;
  8196. Toast._jQueryInterface = function _jQueryInterface(config) {
  8197. return this.each(function () {
  8198. var $element = $(this);
  8199. var data = $element.data(DATA_KEY$a);
  8200. var _config = typeof config === 'object' && config;
  8201. if (!data) {
  8202. data = new Toast(this, _config);
  8203. $element.data(DATA_KEY$a, data);
  8204. }
  8205. if (typeof config === 'string') {
  8206. if (typeof data[config] === 'undefined') {
  8207. throw new TypeError("No method named \"" + config + "\"");
  8208. }
  8209. data[config](this);
  8210. }
  8211. });
  8212. };
  8213. _createClass(Toast, null, [{
  8214. key: "VERSION",
  8215. get: function get() {
  8216. return VERSION$a;
  8217. }
  8218. }, {
  8219. key: "DefaultType",
  8220. get: function get() {
  8221. return DefaultType$7;
  8222. }
  8223. }, {
  8224. key: "Default",
  8225. get: function get() {
  8226. return Default$7;
  8227. }
  8228. }]);
  8229. return Toast;
  8230. }();
  8231. /**
  8232. * ------------------------------------------------------------------------
  8233. * jQuery
  8234. * ------------------------------------------------------------------------
  8235. */
  8236. $.fn[NAME$a] = Toast._jQueryInterface;
  8237. $.fn[NAME$a].Constructor = Toast;
  8238. $.fn[NAME$a].noConflict = function () {
  8239. $.fn[NAME$a] = JQUERY_NO_CONFLICT$a;
  8240. return Toast._jQueryInterface;
  8241. };
  8242. exports.Alert = Alert;
  8243. exports.Button = Button;
  8244. exports.Carousel = Carousel;
  8245. exports.Collapse = Collapse;
  8246. exports.Dropdown = Dropdown;
  8247. exports.Modal = Modal;
  8248. exports.Popover = Popover;
  8249. exports.Scrollspy = ScrollSpy;
  8250. exports.Tab = Tab;
  8251. exports.Toast = Toast;
  8252. exports.Tooltip = Tooltip;
  8253. exports.Util = Util;
  8254. Object.defineProperty(exports, '__esModule', { value: true });
  8255. })));
  8256. //# sourceMappingURL=bootstrap.js.map
  8257. /***/ }),
  8258. /***/ "./node_modules/buffer/index.js":
  8259. /*!**************************************!*\
  8260. !*** ./node_modules/buffer/index.js ***!
  8261. \**************************************/
  8262. /*! no static exports found */
  8263. /***/ (function(module, exports, __webpack_require__) {
  8264. "use strict";
  8265. /* WEBPACK VAR INJECTION */(function(global) {/*!
  8266. * The buffer module from node.js, for the browser.
  8267. *
  8268. * @author Feross Aboukhadijeh <http://feross.org>
  8269. * @license MIT
  8270. */
  8271. /* eslint-disable no-proto */
  8272. var base64 = __webpack_require__(/*! base64-js */ "./node_modules/base64-js/index.js")
  8273. var ieee754 = __webpack_require__(/*! ieee754 */ "./node_modules/ieee754/index.js")
  8274. var isArray = __webpack_require__(/*! isarray */ "./node_modules/isarray/index.js")
  8275. exports.Buffer = Buffer
  8276. exports.SlowBuffer = SlowBuffer
  8277. exports.INSPECT_MAX_BYTES = 50
  8278. /**
  8279. * If `Buffer.TYPED_ARRAY_SUPPORT`:
  8280. * === true Use Uint8Array implementation (fastest)
  8281. * === false Use Object implementation (most compatible, even IE6)
  8282. *
  8283. * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
  8284. * Opera 11.6+, iOS 4.2+.
  8285. *
  8286. * Due to various browser bugs, sometimes the Object implementation will be used even
  8287. * when the browser supports typed arrays.
  8288. *
  8289. * Note:
  8290. *
  8291. * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
  8292. * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
  8293. *
  8294. * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
  8295. *
  8296. * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
  8297. * incorrect length in some situations.
  8298. * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
  8299. * get the Object implementation, which is slower but behaves correctly.
  8300. */
  8301. Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
  8302. ? global.TYPED_ARRAY_SUPPORT
  8303. : typedArraySupport()
  8304. /*
  8305. * Export kMaxLength after typed array support is determined.
  8306. */
  8307. exports.kMaxLength = kMaxLength()
  8308. function typedArraySupport () {
  8309. try {
  8310. var arr = new Uint8Array(1)
  8311. arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
  8312. return arr.foo() === 42 && // typed array instances can be augmented
  8313. typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
  8314. arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
  8315. } catch (e) {
  8316. return false
  8317. }
  8318. }
  8319. function kMaxLength () {
  8320. return Buffer.TYPED_ARRAY_SUPPORT
  8321. ? 0x7fffffff
  8322. : 0x3fffffff
  8323. }
  8324. function createBuffer (that, length) {
  8325. if (kMaxLength() < length) {
  8326. throw new RangeError('Invalid typed array length')
  8327. }
  8328. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8329. // Return an augmented `Uint8Array` instance, for best performance
  8330. that = new Uint8Array(length)
  8331. that.__proto__ = Buffer.prototype
  8332. } else {
  8333. // Fallback: Return an object instance of the Buffer class
  8334. if (that === null) {
  8335. that = new Buffer(length)
  8336. }
  8337. that.length = length
  8338. }
  8339. return that
  8340. }
  8341. /**
  8342. * The Buffer constructor returns instances of `Uint8Array` that have their
  8343. * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
  8344. * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
  8345. * and the `Uint8Array` methods. Square bracket notation works as expected -- it
  8346. * returns a single octet.
  8347. *
  8348. * The `Uint8Array` prototype remains unmodified.
  8349. */
  8350. function Buffer (arg, encodingOrOffset, length) {
  8351. if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
  8352. return new Buffer(arg, encodingOrOffset, length)
  8353. }
  8354. // Common case.
  8355. if (typeof arg === 'number') {
  8356. if (typeof encodingOrOffset === 'string') {
  8357. throw new Error(
  8358. 'If encoding is specified then the first argument must be a string'
  8359. )
  8360. }
  8361. return allocUnsafe(this, arg)
  8362. }
  8363. return from(this, arg, encodingOrOffset, length)
  8364. }
  8365. Buffer.poolSize = 8192 // not used by this implementation
  8366. // TODO: Legacy, not needed anymore. Remove in next major version.
  8367. Buffer._augment = function (arr) {
  8368. arr.__proto__ = Buffer.prototype
  8369. return arr
  8370. }
  8371. function from (that, value, encodingOrOffset, length) {
  8372. if (typeof value === 'number') {
  8373. throw new TypeError('"value" argument must not be a number')
  8374. }
  8375. if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
  8376. return fromArrayBuffer(that, value, encodingOrOffset, length)
  8377. }
  8378. if (typeof value === 'string') {
  8379. return fromString(that, value, encodingOrOffset)
  8380. }
  8381. return fromObject(that, value)
  8382. }
  8383. /**
  8384. * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
  8385. * if value is a number.
  8386. * Buffer.from(str[, encoding])
  8387. * Buffer.from(array)
  8388. * Buffer.from(buffer)
  8389. * Buffer.from(arrayBuffer[, byteOffset[, length]])
  8390. **/
  8391. Buffer.from = function (value, encodingOrOffset, length) {
  8392. return from(null, value, encodingOrOffset, length)
  8393. }
  8394. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8395. Buffer.prototype.__proto__ = Uint8Array.prototype
  8396. Buffer.__proto__ = Uint8Array
  8397. if (typeof Symbol !== 'undefined' && Symbol.species &&
  8398. Buffer[Symbol.species] === Buffer) {
  8399. // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
  8400. Object.defineProperty(Buffer, Symbol.species, {
  8401. value: null,
  8402. configurable: true
  8403. })
  8404. }
  8405. }
  8406. function assertSize (size) {
  8407. if (typeof size !== 'number') {
  8408. throw new TypeError('"size" argument must be a number')
  8409. } else if (size < 0) {
  8410. throw new RangeError('"size" argument must not be negative')
  8411. }
  8412. }
  8413. function alloc (that, size, fill, encoding) {
  8414. assertSize(size)
  8415. if (size <= 0) {
  8416. return createBuffer(that, size)
  8417. }
  8418. if (fill !== undefined) {
  8419. // Only pay attention to encoding if it's a string. This
  8420. // prevents accidentally sending in a number that would
  8421. // be interpretted as a start offset.
  8422. return typeof encoding === 'string'
  8423. ? createBuffer(that, size).fill(fill, encoding)
  8424. : createBuffer(that, size).fill(fill)
  8425. }
  8426. return createBuffer(that, size)
  8427. }
  8428. /**
  8429. * Creates a new filled Buffer instance.
  8430. * alloc(size[, fill[, encoding]])
  8431. **/
  8432. Buffer.alloc = function (size, fill, encoding) {
  8433. return alloc(null, size, fill, encoding)
  8434. }
  8435. function allocUnsafe (that, size) {
  8436. assertSize(size)
  8437. that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
  8438. if (!Buffer.TYPED_ARRAY_SUPPORT) {
  8439. for (var i = 0; i < size; ++i) {
  8440. that[i] = 0
  8441. }
  8442. }
  8443. return that
  8444. }
  8445. /**
  8446. * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
  8447. * */
  8448. Buffer.allocUnsafe = function (size) {
  8449. return allocUnsafe(null, size)
  8450. }
  8451. /**
  8452. * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
  8453. */
  8454. Buffer.allocUnsafeSlow = function (size) {
  8455. return allocUnsafe(null, size)
  8456. }
  8457. function fromString (that, string, encoding) {
  8458. if (typeof encoding !== 'string' || encoding === '') {
  8459. encoding = 'utf8'
  8460. }
  8461. if (!Buffer.isEncoding(encoding)) {
  8462. throw new TypeError('"encoding" must be a valid string encoding')
  8463. }
  8464. var length = byteLength(string, encoding) | 0
  8465. that = createBuffer(that, length)
  8466. var actual = that.write(string, encoding)
  8467. if (actual !== length) {
  8468. // Writing a hex string, for example, that contains invalid characters will
  8469. // cause everything after the first invalid character to be ignored. (e.g.
  8470. // 'abxxcd' will be treated as 'ab')
  8471. that = that.slice(0, actual)
  8472. }
  8473. return that
  8474. }
  8475. function fromArrayLike (that, array) {
  8476. var length = array.length < 0 ? 0 : checked(array.length) | 0
  8477. that = createBuffer(that, length)
  8478. for (var i = 0; i < length; i += 1) {
  8479. that[i] = array[i] & 255
  8480. }
  8481. return that
  8482. }
  8483. function fromArrayBuffer (that, array, byteOffset, length) {
  8484. array.byteLength // this throws if `array` is not a valid ArrayBuffer
  8485. if (byteOffset < 0 || array.byteLength < byteOffset) {
  8486. throw new RangeError('\'offset\' is out of bounds')
  8487. }
  8488. if (array.byteLength < byteOffset + (length || 0)) {
  8489. throw new RangeError('\'length\' is out of bounds')
  8490. }
  8491. if (byteOffset === undefined && length === undefined) {
  8492. array = new Uint8Array(array)
  8493. } else if (length === undefined) {
  8494. array = new Uint8Array(array, byteOffset)
  8495. } else {
  8496. array = new Uint8Array(array, byteOffset, length)
  8497. }
  8498. if (Buffer.TYPED_ARRAY_SUPPORT) {
  8499. // Return an augmented `Uint8Array` instance, for best performance
  8500. that = array
  8501. that.__proto__ = Buffer.prototype
  8502. } else {
  8503. // Fallback: Return an object instance of the Buffer class
  8504. that = fromArrayLike(that, array)
  8505. }
  8506. return that
  8507. }
  8508. function fromObject (that, obj) {
  8509. if (Buffer.isBuffer(obj)) {
  8510. var len = checked(obj.length) | 0
  8511. that = createBuffer(that, len)
  8512. if (that.length === 0) {
  8513. return that
  8514. }
  8515. obj.copy(that, 0, 0, len)
  8516. return that
  8517. }
  8518. if (obj) {
  8519. if ((typeof ArrayBuffer !== 'undefined' &&
  8520. obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
  8521. if (typeof obj.length !== 'number' || isnan(obj.length)) {
  8522. return createBuffer(that, 0)
  8523. }
  8524. return fromArrayLike(that, obj)
  8525. }
  8526. if (obj.type === 'Buffer' && isArray(obj.data)) {
  8527. return fromArrayLike(that, obj.data)
  8528. }
  8529. }
  8530. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  8531. }
  8532. function checked (length) {
  8533. // Note: cannot use `length < kMaxLength()` here because that fails when
  8534. // length is NaN (which is otherwise coerced to zero.)
  8535. if (length >= kMaxLength()) {
  8536. throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
  8537. 'size: 0x' + kMaxLength().toString(16) + ' bytes')
  8538. }
  8539. return length | 0
  8540. }
  8541. function SlowBuffer (length) {
  8542. if (+length != length) { // eslint-disable-line eqeqeq
  8543. length = 0
  8544. }
  8545. return Buffer.alloc(+length)
  8546. }
  8547. Buffer.isBuffer = function isBuffer (b) {
  8548. return !!(b != null && b._isBuffer)
  8549. }
  8550. Buffer.compare = function compare (a, b) {
  8551. if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  8552. throw new TypeError('Arguments must be Buffers')
  8553. }
  8554. if (a === b) return 0
  8555. var x = a.length
  8556. var y = b.length
  8557. for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  8558. if (a[i] !== b[i]) {
  8559. x = a[i]
  8560. y = b[i]
  8561. break
  8562. }
  8563. }
  8564. if (x < y) return -1
  8565. if (y < x) return 1
  8566. return 0
  8567. }
  8568. Buffer.isEncoding = function isEncoding (encoding) {
  8569. switch (String(encoding).toLowerCase()) {
  8570. case 'hex':
  8571. case 'utf8':
  8572. case 'utf-8':
  8573. case 'ascii':
  8574. case 'latin1':
  8575. case 'binary':
  8576. case 'base64':
  8577. case 'ucs2':
  8578. case 'ucs-2':
  8579. case 'utf16le':
  8580. case 'utf-16le':
  8581. return true
  8582. default:
  8583. return false
  8584. }
  8585. }
  8586. Buffer.concat = function concat (list, length) {
  8587. if (!isArray(list)) {
  8588. throw new TypeError('"list" argument must be an Array of Buffers')
  8589. }
  8590. if (list.length === 0) {
  8591. return Buffer.alloc(0)
  8592. }
  8593. var i
  8594. if (length === undefined) {
  8595. length = 0
  8596. for (i = 0; i < list.length; ++i) {
  8597. length += list[i].length
  8598. }
  8599. }
  8600. var buffer = Buffer.allocUnsafe(length)
  8601. var pos = 0
  8602. for (i = 0; i < list.length; ++i) {
  8603. var buf = list[i]
  8604. if (!Buffer.isBuffer(buf)) {
  8605. throw new TypeError('"list" argument must be an Array of Buffers')
  8606. }
  8607. buf.copy(buffer, pos)
  8608. pos += buf.length
  8609. }
  8610. return buffer
  8611. }
  8612. function byteLength (string, encoding) {
  8613. if (Buffer.isBuffer(string)) {
  8614. return string.length
  8615. }
  8616. if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
  8617. (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
  8618. return string.byteLength
  8619. }
  8620. if (typeof string !== 'string') {
  8621. string = '' + string
  8622. }
  8623. var len = string.length
  8624. if (len === 0) return 0
  8625. // Use a for loop to avoid recursion
  8626. var loweredCase = false
  8627. for (;;) {
  8628. switch (encoding) {
  8629. case 'ascii':
  8630. case 'latin1':
  8631. case 'binary':
  8632. return len
  8633. case 'utf8':
  8634. case 'utf-8':
  8635. case undefined:
  8636. return utf8ToBytes(string).length
  8637. case 'ucs2':
  8638. case 'ucs-2':
  8639. case 'utf16le':
  8640. case 'utf-16le':
  8641. return len * 2
  8642. case 'hex':
  8643. return len >>> 1
  8644. case 'base64':
  8645. return base64ToBytes(string).length
  8646. default:
  8647. if (loweredCase) return utf8ToBytes(string).length // assume utf8
  8648. encoding = ('' + encoding).toLowerCase()
  8649. loweredCase = true
  8650. }
  8651. }
  8652. }
  8653. Buffer.byteLength = byteLength
  8654. function slowToString (encoding, start, end) {
  8655. var loweredCase = false
  8656. // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
  8657. // property of a typed array.
  8658. // This behaves neither like String nor Uint8Array in that we set start/end
  8659. // to their upper/lower bounds if the value passed is out of range.
  8660. // undefined is handled specially as per ECMA-262 6th Edition,
  8661. // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  8662. if (start === undefined || start < 0) {
  8663. start = 0
  8664. }
  8665. // Return early if start > this.length. Done here to prevent potential uint32
  8666. // coercion fail below.
  8667. if (start > this.length) {
  8668. return ''
  8669. }
  8670. if (end === undefined || end > this.length) {
  8671. end = this.length
  8672. }
  8673. if (end <= 0) {
  8674. return ''
  8675. }
  8676. // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  8677. end >>>= 0
  8678. start >>>= 0
  8679. if (end <= start) {
  8680. return ''
  8681. }
  8682. if (!encoding) encoding = 'utf8'
  8683. while (true) {
  8684. switch (encoding) {
  8685. case 'hex':
  8686. return hexSlice(this, start, end)
  8687. case 'utf8':
  8688. case 'utf-8':
  8689. return utf8Slice(this, start, end)
  8690. case 'ascii':
  8691. return asciiSlice(this, start, end)
  8692. case 'latin1':
  8693. case 'binary':
  8694. return latin1Slice(this, start, end)
  8695. case 'base64':
  8696. return base64Slice(this, start, end)
  8697. case 'ucs2':
  8698. case 'ucs-2':
  8699. case 'utf16le':
  8700. case 'utf-16le':
  8701. return utf16leSlice(this, start, end)
  8702. default:
  8703. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  8704. encoding = (encoding + '').toLowerCase()
  8705. loweredCase = true
  8706. }
  8707. }
  8708. }
  8709. // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  8710. // Buffer instances.
  8711. Buffer.prototype._isBuffer = true
  8712. function swap (b, n, m) {
  8713. var i = b[n]
  8714. b[n] = b[m]
  8715. b[m] = i
  8716. }
  8717. Buffer.prototype.swap16 = function swap16 () {
  8718. var len = this.length
  8719. if (len % 2 !== 0) {
  8720. throw new RangeError('Buffer size must be a multiple of 16-bits')
  8721. }
  8722. for (var i = 0; i < len; i += 2) {
  8723. swap(this, i, i + 1)
  8724. }
  8725. return this
  8726. }
  8727. Buffer.prototype.swap32 = function swap32 () {
  8728. var len = this.length
  8729. if (len % 4 !== 0) {
  8730. throw new RangeError('Buffer size must be a multiple of 32-bits')
  8731. }
  8732. for (var i = 0; i < len; i += 4) {
  8733. swap(this, i, i + 3)
  8734. swap(this, i + 1, i + 2)
  8735. }
  8736. return this
  8737. }
  8738. Buffer.prototype.swap64 = function swap64 () {
  8739. var len = this.length
  8740. if (len % 8 !== 0) {
  8741. throw new RangeError('Buffer size must be a multiple of 64-bits')
  8742. }
  8743. for (var i = 0; i < len; i += 8) {
  8744. swap(this, i, i + 7)
  8745. swap(this, i + 1, i + 6)
  8746. swap(this, i + 2, i + 5)
  8747. swap(this, i + 3, i + 4)
  8748. }
  8749. return this
  8750. }
  8751. Buffer.prototype.toString = function toString () {
  8752. var length = this.length | 0
  8753. if (length === 0) return ''
  8754. if (arguments.length === 0) return utf8Slice(this, 0, length)
  8755. return slowToString.apply(this, arguments)
  8756. }
  8757. Buffer.prototype.equals = function equals (b) {
  8758. if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
  8759. if (this === b) return true
  8760. return Buffer.compare(this, b) === 0
  8761. }
  8762. Buffer.prototype.inspect = function inspect () {
  8763. var str = ''
  8764. var max = exports.INSPECT_MAX_BYTES
  8765. if (this.length > 0) {
  8766. str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
  8767. if (this.length > max) str += ' ... '
  8768. }
  8769. return '<Buffer ' + str + '>'
  8770. }
  8771. Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
  8772. if (!Buffer.isBuffer(target)) {
  8773. throw new TypeError('Argument must be a Buffer')
  8774. }
  8775. if (start === undefined) {
  8776. start = 0
  8777. }
  8778. if (end === undefined) {
  8779. end = target ? target.length : 0
  8780. }
  8781. if (thisStart === undefined) {
  8782. thisStart = 0
  8783. }
  8784. if (thisEnd === undefined) {
  8785. thisEnd = this.length
  8786. }
  8787. if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  8788. throw new RangeError('out of range index')
  8789. }
  8790. if (thisStart >= thisEnd && start >= end) {
  8791. return 0
  8792. }
  8793. if (thisStart >= thisEnd) {
  8794. return -1
  8795. }
  8796. if (start >= end) {
  8797. return 1
  8798. }
  8799. start >>>= 0
  8800. end >>>= 0
  8801. thisStart >>>= 0
  8802. thisEnd >>>= 0
  8803. if (this === target) return 0
  8804. var x = thisEnd - thisStart
  8805. var y = end - start
  8806. var len = Math.min(x, y)
  8807. var thisCopy = this.slice(thisStart, thisEnd)
  8808. var targetCopy = target.slice(start, end)
  8809. for (var i = 0; i < len; ++i) {
  8810. if (thisCopy[i] !== targetCopy[i]) {
  8811. x = thisCopy[i]
  8812. y = targetCopy[i]
  8813. break
  8814. }
  8815. }
  8816. if (x < y) return -1
  8817. if (y < x) return 1
  8818. return 0
  8819. }
  8820. // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  8821. // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  8822. //
  8823. // Arguments:
  8824. // - buffer - a Buffer to search
  8825. // - val - a string, Buffer, or number
  8826. // - byteOffset - an index into `buffer`; will be clamped to an int32
  8827. // - encoding - an optional encoding, relevant is val is a string
  8828. // - dir - true for indexOf, false for lastIndexOf
  8829. function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
  8830. // Empty buffer means no match
  8831. if (buffer.length === 0) return -1
  8832. // Normalize byteOffset
  8833. if (typeof byteOffset === 'string') {
  8834. encoding = byteOffset
  8835. byteOffset = 0
  8836. } else if (byteOffset > 0x7fffffff) {
  8837. byteOffset = 0x7fffffff
  8838. } else if (byteOffset < -0x80000000) {
  8839. byteOffset = -0x80000000
  8840. }
  8841. byteOffset = +byteOffset // Coerce to Number.
  8842. if (isNaN(byteOffset)) {
  8843. // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
  8844. byteOffset = dir ? 0 : (buffer.length - 1)
  8845. }
  8846. // Normalize byteOffset: negative offsets start from the end of the buffer
  8847. if (byteOffset < 0) byteOffset = buffer.length + byteOffset
  8848. if (byteOffset >= buffer.length) {
  8849. if (dir) return -1
  8850. else byteOffset = buffer.length - 1
  8851. } else if (byteOffset < 0) {
  8852. if (dir) byteOffset = 0
  8853. else return -1
  8854. }
  8855. // Normalize val
  8856. if (typeof val === 'string') {
  8857. val = Buffer.from(val, encoding)
  8858. }
  8859. // Finally, search either indexOf (if dir is true) or lastIndexOf
  8860. if (Buffer.isBuffer(val)) {
  8861. // Special case: looking for empty string/buffer always fails
  8862. if (val.length === 0) {
  8863. return -1
  8864. }
  8865. return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  8866. } else if (typeof val === 'number') {
  8867. val = val & 0xFF // Search for a byte value [0-255]
  8868. if (Buffer.TYPED_ARRAY_SUPPORT &&
  8869. typeof Uint8Array.prototype.indexOf === 'function') {
  8870. if (dir) {
  8871. return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  8872. } else {
  8873. return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  8874. }
  8875. }
  8876. return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
  8877. }
  8878. throw new TypeError('val must be string, number or Buffer')
  8879. }
  8880. function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
  8881. var indexSize = 1
  8882. var arrLength = arr.length
  8883. var valLength = val.length
  8884. if (encoding !== undefined) {
  8885. encoding = String(encoding).toLowerCase()
  8886. if (encoding === 'ucs2' || encoding === 'ucs-2' ||
  8887. encoding === 'utf16le' || encoding === 'utf-16le') {
  8888. if (arr.length < 2 || val.length < 2) {
  8889. return -1
  8890. }
  8891. indexSize = 2
  8892. arrLength /= 2
  8893. valLength /= 2
  8894. byteOffset /= 2
  8895. }
  8896. }
  8897. function read (buf, i) {
  8898. if (indexSize === 1) {
  8899. return buf[i]
  8900. } else {
  8901. return buf.readUInt16BE(i * indexSize)
  8902. }
  8903. }
  8904. var i
  8905. if (dir) {
  8906. var foundIndex = -1
  8907. for (i = byteOffset; i < arrLength; i++) {
  8908. if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  8909. if (foundIndex === -1) foundIndex = i
  8910. if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  8911. } else {
  8912. if (foundIndex !== -1) i -= i - foundIndex
  8913. foundIndex = -1
  8914. }
  8915. }
  8916. } else {
  8917. if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
  8918. for (i = byteOffset; i >= 0; i--) {
  8919. var found = true
  8920. for (var j = 0; j < valLength; j++) {
  8921. if (read(arr, i + j) !== read(val, j)) {
  8922. found = false
  8923. break
  8924. }
  8925. }
  8926. if (found) return i
  8927. }
  8928. }
  8929. return -1
  8930. }
  8931. Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
  8932. return this.indexOf(val, byteOffset, encoding) !== -1
  8933. }
  8934. Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
  8935. return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  8936. }
  8937. Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
  8938. return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  8939. }
  8940. function hexWrite (buf, string, offset, length) {
  8941. offset = Number(offset) || 0
  8942. var remaining = buf.length - offset
  8943. if (!length) {
  8944. length = remaining
  8945. } else {
  8946. length = Number(length)
  8947. if (length > remaining) {
  8948. length = remaining
  8949. }
  8950. }
  8951. // must be an even number of digits
  8952. var strLen = string.length
  8953. if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
  8954. if (length > strLen / 2) {
  8955. length = strLen / 2
  8956. }
  8957. for (var i = 0; i < length; ++i) {
  8958. var parsed = parseInt(string.substr(i * 2, 2), 16)
  8959. if (isNaN(parsed)) return i
  8960. buf[offset + i] = parsed
  8961. }
  8962. return i
  8963. }
  8964. function utf8Write (buf, string, offset, length) {
  8965. return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  8966. }
  8967. function asciiWrite (buf, string, offset, length) {
  8968. return blitBuffer(asciiToBytes(string), buf, offset, length)
  8969. }
  8970. function latin1Write (buf, string, offset, length) {
  8971. return asciiWrite(buf, string, offset, length)
  8972. }
  8973. function base64Write (buf, string, offset, length) {
  8974. return blitBuffer(base64ToBytes(string), buf, offset, length)
  8975. }
  8976. function ucs2Write (buf, string, offset, length) {
  8977. return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  8978. }
  8979. Buffer.prototype.write = function write (string, offset, length, encoding) {
  8980. // Buffer#write(string)
  8981. if (offset === undefined) {
  8982. encoding = 'utf8'
  8983. length = this.length
  8984. offset = 0
  8985. // Buffer#write(string, encoding)
  8986. } else if (length === undefined && typeof offset === 'string') {
  8987. encoding = offset
  8988. length = this.length
  8989. offset = 0
  8990. // Buffer#write(string, offset[, length][, encoding])
  8991. } else if (isFinite(offset)) {
  8992. offset = offset | 0
  8993. if (isFinite(length)) {
  8994. length = length | 0
  8995. if (encoding === undefined) encoding = 'utf8'
  8996. } else {
  8997. encoding = length
  8998. length = undefined
  8999. }
  9000. // legacy write(string, encoding, offset, length) - remove in v0.13
  9001. } else {
  9002. throw new Error(
  9003. 'Buffer.write(string, encoding, offset[, length]) is no longer supported'
  9004. )
  9005. }
  9006. var remaining = this.length - offset
  9007. if (length === undefined || length > remaining) length = remaining
  9008. if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
  9009. throw new RangeError('Attempt to write outside buffer bounds')
  9010. }
  9011. if (!encoding) encoding = 'utf8'
  9012. var loweredCase = false
  9013. for (;;) {
  9014. switch (encoding) {
  9015. case 'hex':
  9016. return hexWrite(this, string, offset, length)
  9017. case 'utf8':
  9018. case 'utf-8':
  9019. return utf8Write(this, string, offset, length)
  9020. case 'ascii':
  9021. return asciiWrite(this, string, offset, length)
  9022. case 'latin1':
  9023. case 'binary':
  9024. return latin1Write(this, string, offset, length)
  9025. case 'base64':
  9026. // Warning: maxLength not taken into account in base64Write
  9027. return base64Write(this, string, offset, length)
  9028. case 'ucs2':
  9029. case 'ucs-2':
  9030. case 'utf16le':
  9031. case 'utf-16le':
  9032. return ucs2Write(this, string, offset, length)
  9033. default:
  9034. if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
  9035. encoding = ('' + encoding).toLowerCase()
  9036. loweredCase = true
  9037. }
  9038. }
  9039. }
  9040. Buffer.prototype.toJSON = function toJSON () {
  9041. return {
  9042. type: 'Buffer',
  9043. data: Array.prototype.slice.call(this._arr || this, 0)
  9044. }
  9045. }
  9046. function base64Slice (buf, start, end) {
  9047. if (start === 0 && end === buf.length) {
  9048. return base64.fromByteArray(buf)
  9049. } else {
  9050. return base64.fromByteArray(buf.slice(start, end))
  9051. }
  9052. }
  9053. function utf8Slice (buf, start, end) {
  9054. end = Math.min(buf.length, end)
  9055. var res = []
  9056. var i = start
  9057. while (i < end) {
  9058. var firstByte = buf[i]
  9059. var codePoint = null
  9060. var bytesPerSequence = (firstByte > 0xEF) ? 4
  9061. : (firstByte > 0xDF) ? 3
  9062. : (firstByte > 0xBF) ? 2
  9063. : 1
  9064. if (i + bytesPerSequence <= end) {
  9065. var secondByte, thirdByte, fourthByte, tempCodePoint
  9066. switch (bytesPerSequence) {
  9067. case 1:
  9068. if (firstByte < 0x80) {
  9069. codePoint = firstByte
  9070. }
  9071. break
  9072. case 2:
  9073. secondByte = buf[i + 1]
  9074. if ((secondByte & 0xC0) === 0x80) {
  9075. tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
  9076. if (tempCodePoint > 0x7F) {
  9077. codePoint = tempCodePoint
  9078. }
  9079. }
  9080. break
  9081. case 3:
  9082. secondByte = buf[i + 1]
  9083. thirdByte = buf[i + 2]
  9084. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
  9085. tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
  9086. if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
  9087. codePoint = tempCodePoint
  9088. }
  9089. }
  9090. break
  9091. case 4:
  9092. secondByte = buf[i + 1]
  9093. thirdByte = buf[i + 2]
  9094. fourthByte = buf[i + 3]
  9095. if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
  9096. tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
  9097. if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
  9098. codePoint = tempCodePoint
  9099. }
  9100. }
  9101. }
  9102. }
  9103. if (codePoint === null) {
  9104. // we did not generate a valid codePoint so insert a
  9105. // replacement char (U+FFFD) and advance only 1 byte
  9106. codePoint = 0xFFFD
  9107. bytesPerSequence = 1
  9108. } else if (codePoint > 0xFFFF) {
  9109. // encode to utf16 (surrogate pair dance)
  9110. codePoint -= 0x10000
  9111. res.push(codePoint >>> 10 & 0x3FF | 0xD800)
  9112. codePoint = 0xDC00 | codePoint & 0x3FF
  9113. }
  9114. res.push(codePoint)
  9115. i += bytesPerSequence
  9116. }
  9117. return decodeCodePointsArray(res)
  9118. }
  9119. // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  9120. // the lowest limit is Chrome, with 0x10000 args.
  9121. // We go 1 magnitude less, for safety
  9122. var MAX_ARGUMENTS_LENGTH = 0x1000
  9123. function decodeCodePointsArray (codePoints) {
  9124. var len = codePoints.length
  9125. if (len <= MAX_ARGUMENTS_LENGTH) {
  9126. return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
  9127. }
  9128. // Decode in chunks to avoid "call stack size exceeded".
  9129. var res = ''
  9130. var i = 0
  9131. while (i < len) {
  9132. res += String.fromCharCode.apply(
  9133. String,
  9134. codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
  9135. )
  9136. }
  9137. return res
  9138. }
  9139. function asciiSlice (buf, start, end) {
  9140. var ret = ''
  9141. end = Math.min(buf.length, end)
  9142. for (var i = start; i < end; ++i) {
  9143. ret += String.fromCharCode(buf[i] & 0x7F)
  9144. }
  9145. return ret
  9146. }
  9147. function latin1Slice (buf, start, end) {
  9148. var ret = ''
  9149. end = Math.min(buf.length, end)
  9150. for (var i = start; i < end; ++i) {
  9151. ret += String.fromCharCode(buf[i])
  9152. }
  9153. return ret
  9154. }
  9155. function hexSlice (buf, start, end) {
  9156. var len = buf.length
  9157. if (!start || start < 0) start = 0
  9158. if (!end || end < 0 || end > len) end = len
  9159. var out = ''
  9160. for (var i = start; i < end; ++i) {
  9161. out += toHex(buf[i])
  9162. }
  9163. return out
  9164. }
  9165. function utf16leSlice (buf, start, end) {
  9166. var bytes = buf.slice(start, end)
  9167. var res = ''
  9168. for (var i = 0; i < bytes.length; i += 2) {
  9169. res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  9170. }
  9171. return res
  9172. }
  9173. Buffer.prototype.slice = function slice (start, end) {
  9174. var len = this.length
  9175. start = ~~start
  9176. end = end === undefined ? len : ~~end
  9177. if (start < 0) {
  9178. start += len
  9179. if (start < 0) start = 0
  9180. } else if (start > len) {
  9181. start = len
  9182. }
  9183. if (end < 0) {
  9184. end += len
  9185. if (end < 0) end = 0
  9186. } else if (end > len) {
  9187. end = len
  9188. }
  9189. if (end < start) end = start
  9190. var newBuf
  9191. if (Buffer.TYPED_ARRAY_SUPPORT) {
  9192. newBuf = this.subarray(start, end)
  9193. newBuf.__proto__ = Buffer.prototype
  9194. } else {
  9195. var sliceLen = end - start
  9196. newBuf = new Buffer(sliceLen, undefined)
  9197. for (var i = 0; i < sliceLen; ++i) {
  9198. newBuf[i] = this[i + start]
  9199. }
  9200. }
  9201. return newBuf
  9202. }
  9203. /*
  9204. * Need to make sure that buffer isn't trying to write out of bounds.
  9205. */
  9206. function checkOffset (offset, ext, length) {
  9207. if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
  9208. if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
  9209. }
  9210. Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
  9211. offset = offset | 0
  9212. byteLength = byteLength | 0
  9213. if (!noAssert) checkOffset(offset, byteLength, this.length)
  9214. var val = this[offset]
  9215. var mul = 1
  9216. var i = 0
  9217. while (++i < byteLength && (mul *= 0x100)) {
  9218. val += this[offset + i] * mul
  9219. }
  9220. return val
  9221. }
  9222. Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
  9223. offset = offset | 0
  9224. byteLength = byteLength | 0
  9225. if (!noAssert) {
  9226. checkOffset(offset, byteLength, this.length)
  9227. }
  9228. var val = this[offset + --byteLength]
  9229. var mul = 1
  9230. while (byteLength > 0 && (mul *= 0x100)) {
  9231. val += this[offset + --byteLength] * mul
  9232. }
  9233. return val
  9234. }
  9235. Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
  9236. if (!noAssert) checkOffset(offset, 1, this.length)
  9237. return this[offset]
  9238. }
  9239. Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
  9240. if (!noAssert) checkOffset(offset, 2, this.length)
  9241. return this[offset] | (this[offset + 1] << 8)
  9242. }
  9243. Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
  9244. if (!noAssert) checkOffset(offset, 2, this.length)
  9245. return (this[offset] << 8) | this[offset + 1]
  9246. }
  9247. Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
  9248. if (!noAssert) checkOffset(offset, 4, this.length)
  9249. return ((this[offset]) |
  9250. (this[offset + 1] << 8) |
  9251. (this[offset + 2] << 16)) +
  9252. (this[offset + 3] * 0x1000000)
  9253. }
  9254. Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
  9255. if (!noAssert) checkOffset(offset, 4, this.length)
  9256. return (this[offset] * 0x1000000) +
  9257. ((this[offset + 1] << 16) |
  9258. (this[offset + 2] << 8) |
  9259. this[offset + 3])
  9260. }
  9261. Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
  9262. offset = offset | 0
  9263. byteLength = byteLength | 0
  9264. if (!noAssert) checkOffset(offset, byteLength, this.length)
  9265. var val = this[offset]
  9266. var mul = 1
  9267. var i = 0
  9268. while (++i < byteLength && (mul *= 0x100)) {
  9269. val += this[offset + i] * mul
  9270. }
  9271. mul *= 0x80
  9272. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  9273. return val
  9274. }
  9275. Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
  9276. offset = offset | 0
  9277. byteLength = byteLength | 0
  9278. if (!noAssert) checkOffset(offset, byteLength, this.length)
  9279. var i = byteLength
  9280. var mul = 1
  9281. var val = this[offset + --i]
  9282. while (i > 0 && (mul *= 0x100)) {
  9283. val += this[offset + --i] * mul
  9284. }
  9285. mul *= 0x80
  9286. if (val >= mul) val -= Math.pow(2, 8 * byteLength)
  9287. return val
  9288. }
  9289. Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
  9290. if (!noAssert) checkOffset(offset, 1, this.length)
  9291. if (!(this[offset] & 0x80)) return (this[offset])
  9292. return ((0xff - this[offset] + 1) * -1)
  9293. }
  9294. Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
  9295. if (!noAssert) checkOffset(offset, 2, this.length)
  9296. var val = this[offset] | (this[offset + 1] << 8)
  9297. return (val & 0x8000) ? val | 0xFFFF0000 : val
  9298. }
  9299. Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
  9300. if (!noAssert) checkOffset(offset, 2, this.length)
  9301. var val = this[offset + 1] | (this[offset] << 8)
  9302. return (val & 0x8000) ? val | 0xFFFF0000 : val
  9303. }
  9304. Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
  9305. if (!noAssert) checkOffset(offset, 4, this.length)
  9306. return (this[offset]) |
  9307. (this[offset + 1] << 8) |
  9308. (this[offset + 2] << 16) |
  9309. (this[offset + 3] << 24)
  9310. }
  9311. Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
  9312. if (!noAssert) checkOffset(offset, 4, this.length)
  9313. return (this[offset] << 24) |
  9314. (this[offset + 1] << 16) |
  9315. (this[offset + 2] << 8) |
  9316. (this[offset + 3])
  9317. }
  9318. Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
  9319. if (!noAssert) checkOffset(offset, 4, this.length)
  9320. return ieee754.read(this, offset, true, 23, 4)
  9321. }
  9322. Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
  9323. if (!noAssert) checkOffset(offset, 4, this.length)
  9324. return ieee754.read(this, offset, false, 23, 4)
  9325. }
  9326. Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
  9327. if (!noAssert) checkOffset(offset, 8, this.length)
  9328. return ieee754.read(this, offset, true, 52, 8)
  9329. }
  9330. Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
  9331. if (!noAssert) checkOffset(offset, 8, this.length)
  9332. return ieee754.read(this, offset, false, 52, 8)
  9333. }
  9334. function checkInt (buf, value, offset, ext, max, min) {
  9335. if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
  9336. if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
  9337. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  9338. }
  9339. Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
  9340. value = +value
  9341. offset = offset | 0
  9342. byteLength = byteLength | 0
  9343. if (!noAssert) {
  9344. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  9345. checkInt(this, value, offset, byteLength, maxBytes, 0)
  9346. }
  9347. var mul = 1
  9348. var i = 0
  9349. this[offset] = value & 0xFF
  9350. while (++i < byteLength && (mul *= 0x100)) {
  9351. this[offset + i] = (value / mul) & 0xFF
  9352. }
  9353. return offset + byteLength
  9354. }
  9355. Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
  9356. value = +value
  9357. offset = offset | 0
  9358. byteLength = byteLength | 0
  9359. if (!noAssert) {
  9360. var maxBytes = Math.pow(2, 8 * byteLength) - 1
  9361. checkInt(this, value, offset, byteLength, maxBytes, 0)
  9362. }
  9363. var i = byteLength - 1
  9364. var mul = 1
  9365. this[offset + i] = value & 0xFF
  9366. while (--i >= 0 && (mul *= 0x100)) {
  9367. this[offset + i] = (value / mul) & 0xFF
  9368. }
  9369. return offset + byteLength
  9370. }
  9371. Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
  9372. value = +value
  9373. offset = offset | 0
  9374. if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
  9375. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  9376. this[offset] = (value & 0xff)
  9377. return offset + 1
  9378. }
  9379. function objectWriteUInt16 (buf, value, offset, littleEndian) {
  9380. if (value < 0) value = 0xffff + value + 1
  9381. for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
  9382. buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
  9383. (littleEndian ? i : 1 - i) * 8
  9384. }
  9385. }
  9386. Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
  9387. value = +value
  9388. offset = offset | 0
  9389. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  9390. if (Buffer.TYPED_ARRAY_SUPPORT) {
  9391. this[offset] = (value & 0xff)
  9392. this[offset + 1] = (value >>> 8)
  9393. } else {
  9394. objectWriteUInt16(this, value, offset, true)
  9395. }
  9396. return offset + 2
  9397. }
  9398. Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
  9399. value = +value
  9400. offset = offset | 0
  9401. if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
  9402. if (Buffer.TYPED_ARRAY_SUPPORT) {
  9403. this[offset] = (value >>> 8)
  9404. this[offset + 1] = (value & 0xff)
  9405. } else {
  9406. objectWriteUInt16(this, value, offset, false)
  9407. }
  9408. return offset + 2
  9409. }
  9410. function objectWriteUInt32 (buf, value, offset, littleEndian) {
  9411. if (value < 0) value = 0xffffffff + value + 1
  9412. for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
  9413. buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
  9414. }
  9415. }
  9416. Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
  9417. value = +value
  9418. offset = offset | 0
  9419. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  9420. if (Buffer.TYPED_ARRAY_SUPPORT) {
  9421. this[offset + 3] = (value >>> 24)
  9422. this[offset + 2] = (value >>> 16)
  9423. this[offset + 1] = (value >>> 8)
  9424. this[offset] = (value & 0xff)
  9425. } else {
  9426. objectWriteUInt32(this, value, offset, true)
  9427. }
  9428. return offset + 4
  9429. }
  9430. Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
  9431. value = +value
  9432. offset = offset | 0
  9433. if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
  9434. if (Buffer.TYPED_ARRAY_SUPPORT) {
  9435. this[offset] = (value >>> 24)
  9436. this[offset + 1] = (value >>> 16)
  9437. this[offset + 2] = (value >>> 8)
  9438. this[offset + 3] = (value & 0xff)
  9439. } else {
  9440. objectWriteUInt32(this, value, offset, false)
  9441. }
  9442. return offset + 4
  9443. }
  9444. Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
  9445. value = +value
  9446. offset = offset | 0
  9447. if (!noAssert) {
  9448. var limit = Math.pow(2, 8 * byteLength - 1)
  9449. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  9450. }
  9451. var i = 0
  9452. var mul = 1
  9453. var sub = 0
  9454. this[offset] = value & 0xFF
  9455. while (++i < byteLength && (mul *= 0x100)) {
  9456. if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  9457. sub = 1
  9458. }
  9459. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  9460. }
  9461. return offset + byteLength
  9462. }
  9463. Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
  9464. value = +value
  9465. offset = offset | 0
  9466. if (!noAssert) {
  9467. var limit = Math.pow(2, 8 * byteLength - 1)
  9468. checkInt(this, value, offset, byteLength, limit - 1, -limit)
  9469. }
  9470. var i = byteLength - 1
  9471. var mul = 1
  9472. var sub = 0
  9473. this[offset + i] = value & 0xFF
  9474. while (--i >= 0 && (mul *= 0x100)) {
  9475. if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  9476. sub = 1
  9477. }
  9478. this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
  9479. }
  9480. return offset + byteLength
  9481. }
  9482. Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
  9483. value = +value
  9484. offset = offset | 0
  9485. if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
  9486. if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
  9487. if (value < 0) value = 0xff + value + 1
  9488. this[offset] = (value & 0xff)
  9489. return offset + 1
  9490. }
  9491. Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
  9492. value = +value
  9493. offset = offset | 0
  9494. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  9495. if (Buffer.TYPED_ARRAY_SUPPORT) {
  9496. this[offset] = (value & 0xff)
  9497. this[offset + 1] = (value >>> 8)
  9498. } else {
  9499. objectWriteUInt16(this, value, offset, true)
  9500. }
  9501. return offset + 2
  9502. }
  9503. Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
  9504. value = +value
  9505. offset = offset | 0
  9506. if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
  9507. if (Buffer.TYPED_ARRAY_SUPPORT) {
  9508. this[offset] = (value >>> 8)
  9509. this[offset + 1] = (value & 0xff)
  9510. } else {
  9511. objectWriteUInt16(this, value, offset, false)
  9512. }
  9513. return offset + 2
  9514. }
  9515. Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
  9516. value = +value
  9517. offset = offset | 0
  9518. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  9519. if (Buffer.TYPED_ARRAY_SUPPORT) {
  9520. this[offset] = (value & 0xff)
  9521. this[offset + 1] = (value >>> 8)
  9522. this[offset + 2] = (value >>> 16)
  9523. this[offset + 3] = (value >>> 24)
  9524. } else {
  9525. objectWriteUInt32(this, value, offset, true)
  9526. }
  9527. return offset + 4
  9528. }
  9529. Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
  9530. value = +value
  9531. offset = offset | 0
  9532. if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
  9533. if (value < 0) value = 0xffffffff + value + 1
  9534. if (Buffer.TYPED_ARRAY_SUPPORT) {
  9535. this[offset] = (value >>> 24)
  9536. this[offset + 1] = (value >>> 16)
  9537. this[offset + 2] = (value >>> 8)
  9538. this[offset + 3] = (value & 0xff)
  9539. } else {
  9540. objectWriteUInt32(this, value, offset, false)
  9541. }
  9542. return offset + 4
  9543. }
  9544. function checkIEEE754 (buf, value, offset, ext, max, min) {
  9545. if (offset + ext > buf.length) throw new RangeError('Index out of range')
  9546. if (offset < 0) throw new RangeError('Index out of range')
  9547. }
  9548. function writeFloat (buf, value, offset, littleEndian, noAssert) {
  9549. if (!noAssert) {
  9550. checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
  9551. }
  9552. ieee754.write(buf, value, offset, littleEndian, 23, 4)
  9553. return offset + 4
  9554. }
  9555. Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
  9556. return writeFloat(this, value, offset, true, noAssert)
  9557. }
  9558. Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
  9559. return writeFloat(this, value, offset, false, noAssert)
  9560. }
  9561. function writeDouble (buf, value, offset, littleEndian, noAssert) {
  9562. if (!noAssert) {
  9563. checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
  9564. }
  9565. ieee754.write(buf, value, offset, littleEndian, 52, 8)
  9566. return offset + 8
  9567. }
  9568. Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
  9569. return writeDouble(this, value, offset, true, noAssert)
  9570. }
  9571. Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
  9572. return writeDouble(this, value, offset, false, noAssert)
  9573. }
  9574. // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  9575. Buffer.prototype.copy = function copy (target, targetStart, start, end) {
  9576. if (!start) start = 0
  9577. if (!end && end !== 0) end = this.length
  9578. if (targetStart >= target.length) targetStart = target.length
  9579. if (!targetStart) targetStart = 0
  9580. if (end > 0 && end < start) end = start
  9581. // Copy 0 bytes; we're done
  9582. if (end === start) return 0
  9583. if (target.length === 0 || this.length === 0) return 0
  9584. // Fatal error conditions
  9585. if (targetStart < 0) {
  9586. throw new RangeError('targetStart out of bounds')
  9587. }
  9588. if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
  9589. if (end < 0) throw new RangeError('sourceEnd out of bounds')
  9590. // Are we oob?
  9591. if (end > this.length) end = this.length
  9592. if (target.length - targetStart < end - start) {
  9593. end = target.length - targetStart + start
  9594. }
  9595. var len = end - start
  9596. var i
  9597. if (this === target && start < targetStart && targetStart < end) {
  9598. // descending copy from end
  9599. for (i = len - 1; i >= 0; --i) {
  9600. target[i + targetStart] = this[i + start]
  9601. }
  9602. } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
  9603. // ascending copy from start
  9604. for (i = 0; i < len; ++i) {
  9605. target[i + targetStart] = this[i + start]
  9606. }
  9607. } else {
  9608. Uint8Array.prototype.set.call(
  9609. target,
  9610. this.subarray(start, start + len),
  9611. targetStart
  9612. )
  9613. }
  9614. return len
  9615. }
  9616. // Usage:
  9617. // buffer.fill(number[, offset[, end]])
  9618. // buffer.fill(buffer[, offset[, end]])
  9619. // buffer.fill(string[, offset[, end]][, encoding])
  9620. Buffer.prototype.fill = function fill (val, start, end, encoding) {
  9621. // Handle string cases:
  9622. if (typeof val === 'string') {
  9623. if (typeof start === 'string') {
  9624. encoding = start
  9625. start = 0
  9626. end = this.length
  9627. } else if (typeof end === 'string') {
  9628. encoding = end
  9629. end = this.length
  9630. }
  9631. if (val.length === 1) {
  9632. var code = val.charCodeAt(0)
  9633. if (code < 256) {
  9634. val = code
  9635. }
  9636. }
  9637. if (encoding !== undefined && typeof encoding !== 'string') {
  9638. throw new TypeError('encoding must be a string')
  9639. }
  9640. if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
  9641. throw new TypeError('Unknown encoding: ' + encoding)
  9642. }
  9643. } else if (typeof val === 'number') {
  9644. val = val & 255
  9645. }
  9646. // Invalid ranges are not set to a default, so can range check early.
  9647. if (start < 0 || this.length < start || this.length < end) {
  9648. throw new RangeError('Out of range index')
  9649. }
  9650. if (end <= start) {
  9651. return this
  9652. }
  9653. start = start >>> 0
  9654. end = end === undefined ? this.length : end >>> 0
  9655. if (!val) val = 0
  9656. var i
  9657. if (typeof val === 'number') {
  9658. for (i = start; i < end; ++i) {
  9659. this[i] = val
  9660. }
  9661. } else {
  9662. var bytes = Buffer.isBuffer(val)
  9663. ? val
  9664. : utf8ToBytes(new Buffer(val, encoding).toString())
  9665. var len = bytes.length
  9666. for (i = 0; i < end - start; ++i) {
  9667. this[i + start] = bytes[i % len]
  9668. }
  9669. }
  9670. return this
  9671. }
  9672. // HELPER FUNCTIONS
  9673. // ================
  9674. var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
  9675. function base64clean (str) {
  9676. // Node strips out invalid characters like \n and \t from the string, base64-js does not
  9677. str = stringtrim(str).replace(INVALID_BASE64_RE, '')
  9678. // Node converts strings with length < 2 to ''
  9679. if (str.length < 2) return ''
  9680. // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  9681. while (str.length % 4 !== 0) {
  9682. str = str + '='
  9683. }
  9684. return str
  9685. }
  9686. function stringtrim (str) {
  9687. if (str.trim) return str.trim()
  9688. return str.replace(/^\s+|\s+$/g, '')
  9689. }
  9690. function toHex (n) {
  9691. if (n < 16) return '0' + n.toString(16)
  9692. return n.toString(16)
  9693. }
  9694. function utf8ToBytes (string, units) {
  9695. units = units || Infinity
  9696. var codePoint
  9697. var length = string.length
  9698. var leadSurrogate = null
  9699. var bytes = []
  9700. for (var i = 0; i < length; ++i) {
  9701. codePoint = string.charCodeAt(i)
  9702. // is surrogate component
  9703. if (codePoint > 0xD7FF && codePoint < 0xE000) {
  9704. // last char was a lead
  9705. if (!leadSurrogate) {
  9706. // no lead yet
  9707. if (codePoint > 0xDBFF) {
  9708. // unexpected trail
  9709. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  9710. continue
  9711. } else if (i + 1 === length) {
  9712. // unpaired lead
  9713. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  9714. continue
  9715. }
  9716. // valid lead
  9717. leadSurrogate = codePoint
  9718. continue
  9719. }
  9720. // 2 leads in a row
  9721. if (codePoint < 0xDC00) {
  9722. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  9723. leadSurrogate = codePoint
  9724. continue
  9725. }
  9726. // valid surrogate pair
  9727. codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
  9728. } else if (leadSurrogate) {
  9729. // valid bmp char, but last char was a lead
  9730. if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
  9731. }
  9732. leadSurrogate = null
  9733. // encode utf8
  9734. if (codePoint < 0x80) {
  9735. if ((units -= 1) < 0) break
  9736. bytes.push(codePoint)
  9737. } else if (codePoint < 0x800) {
  9738. if ((units -= 2) < 0) break
  9739. bytes.push(
  9740. codePoint >> 0x6 | 0xC0,
  9741. codePoint & 0x3F | 0x80
  9742. )
  9743. } else if (codePoint < 0x10000) {
  9744. if ((units -= 3) < 0) break
  9745. bytes.push(
  9746. codePoint >> 0xC | 0xE0,
  9747. codePoint >> 0x6 & 0x3F | 0x80,
  9748. codePoint & 0x3F | 0x80
  9749. )
  9750. } else if (codePoint < 0x110000) {
  9751. if ((units -= 4) < 0) break
  9752. bytes.push(
  9753. codePoint >> 0x12 | 0xF0,
  9754. codePoint >> 0xC & 0x3F | 0x80,
  9755. codePoint >> 0x6 & 0x3F | 0x80,
  9756. codePoint & 0x3F | 0x80
  9757. )
  9758. } else {
  9759. throw new Error('Invalid code point')
  9760. }
  9761. }
  9762. return bytes
  9763. }
  9764. function asciiToBytes (str) {
  9765. var byteArray = []
  9766. for (var i = 0; i < str.length; ++i) {
  9767. // Node's code seems to be doing this and not & 0x7F..
  9768. byteArray.push(str.charCodeAt(i) & 0xFF)
  9769. }
  9770. return byteArray
  9771. }
  9772. function utf16leToBytes (str, units) {
  9773. var c, hi, lo
  9774. var byteArray = []
  9775. for (var i = 0; i < str.length; ++i) {
  9776. if ((units -= 2) < 0) break
  9777. c = str.charCodeAt(i)
  9778. hi = c >> 8
  9779. lo = c % 256
  9780. byteArray.push(lo)
  9781. byteArray.push(hi)
  9782. }
  9783. return byteArray
  9784. }
  9785. function base64ToBytes (str) {
  9786. return base64.toByteArray(base64clean(str))
  9787. }
  9788. function blitBuffer (src, dst, offset, length) {
  9789. for (var i = 0; i < length; ++i) {
  9790. if ((i + offset >= dst.length) || (i >= src.length)) break
  9791. dst[i + offset] = src[i]
  9792. }
  9793. return i
  9794. }
  9795. function isnan (val) {
  9796. return val !== val // eslint-disable-line no-self-compare
  9797. }
  9798. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  9799. /***/ }),
  9800. /***/ "./node_modules/component-bind/index.js":
  9801. /*!**********************************************!*\
  9802. !*** ./node_modules/component-bind/index.js ***!
  9803. \**********************************************/
  9804. /*! no static exports found */
  9805. /***/ (function(module, exports) {
  9806. /**
  9807. * Slice reference.
  9808. */
  9809. var slice = [].slice;
  9810. /**
  9811. * Bind `obj` to `fn`.
  9812. *
  9813. * @param {Object} obj
  9814. * @param {Function|String} fn or string
  9815. * @return {Function}
  9816. * @api public
  9817. */
  9818. module.exports = function(obj, fn){
  9819. if ('string' == typeof fn) fn = obj[fn];
  9820. if ('function' != typeof fn) throw new Error('bind() requires a function');
  9821. var args = slice.call(arguments, 2);
  9822. return function(){
  9823. return fn.apply(obj, args.concat(slice.call(arguments)));
  9824. }
  9825. };
  9826. /***/ }),
  9827. /***/ "./node_modules/component-emitter/index.js":
  9828. /*!*************************************************!*\
  9829. !*** ./node_modules/component-emitter/index.js ***!
  9830. \*************************************************/
  9831. /*! no static exports found */
  9832. /***/ (function(module, exports, __webpack_require__) {
  9833. /**
  9834. * Expose `Emitter`.
  9835. */
  9836. if (true) {
  9837. module.exports = Emitter;
  9838. }
  9839. /**
  9840. * Initialize a new `Emitter`.
  9841. *
  9842. * @api public
  9843. */
  9844. function Emitter(obj) {
  9845. if (obj) return mixin(obj);
  9846. };
  9847. /**
  9848. * Mixin the emitter properties.
  9849. *
  9850. * @param {Object} obj
  9851. * @return {Object}
  9852. * @api private
  9853. */
  9854. function mixin(obj) {
  9855. for (var key in Emitter.prototype) {
  9856. obj[key] = Emitter.prototype[key];
  9857. }
  9858. return obj;
  9859. }
  9860. /**
  9861. * Listen on the given `event` with `fn`.
  9862. *
  9863. * @param {String} event
  9864. * @param {Function} fn
  9865. * @return {Emitter}
  9866. * @api public
  9867. */
  9868. Emitter.prototype.on =
  9869. Emitter.prototype.addEventListener = function(event, fn){
  9870. this._callbacks = this._callbacks || {};
  9871. (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
  9872. .push(fn);
  9873. return this;
  9874. };
  9875. /**
  9876. * Adds an `event` listener that will be invoked a single
  9877. * time then automatically removed.
  9878. *
  9879. * @param {String} event
  9880. * @param {Function} fn
  9881. * @return {Emitter}
  9882. * @api public
  9883. */
  9884. Emitter.prototype.once = function(event, fn){
  9885. function on() {
  9886. this.off(event, on);
  9887. fn.apply(this, arguments);
  9888. }
  9889. on.fn = fn;
  9890. this.on(event, on);
  9891. return this;
  9892. };
  9893. /**
  9894. * Remove the given callback for `event` or all
  9895. * registered callbacks.
  9896. *
  9897. * @param {String} event
  9898. * @param {Function} fn
  9899. * @return {Emitter}
  9900. * @api public
  9901. */
  9902. Emitter.prototype.off =
  9903. Emitter.prototype.removeListener =
  9904. Emitter.prototype.removeAllListeners =
  9905. Emitter.prototype.removeEventListener = function(event, fn){
  9906. this._callbacks = this._callbacks || {};
  9907. // all
  9908. if (0 == arguments.length) {
  9909. this._callbacks = {};
  9910. return this;
  9911. }
  9912. // specific event
  9913. var callbacks = this._callbacks['$' + event];
  9914. if (!callbacks) return this;
  9915. // remove all handlers
  9916. if (1 == arguments.length) {
  9917. delete this._callbacks['$' + event];
  9918. return this;
  9919. }
  9920. // remove specific handler
  9921. var cb;
  9922. for (var i = 0; i < callbacks.length; i++) {
  9923. cb = callbacks[i];
  9924. if (cb === fn || cb.fn === fn) {
  9925. callbacks.splice(i, 1);
  9926. break;
  9927. }
  9928. }
  9929. // Remove event specific arrays for event types that no
  9930. // one is subscribed for to avoid memory leak.
  9931. if (callbacks.length === 0) {
  9932. delete this._callbacks['$' + event];
  9933. }
  9934. return this;
  9935. };
  9936. /**
  9937. * Emit `event` with the given args.
  9938. *
  9939. * @param {String} event
  9940. * @param {Mixed} ...
  9941. * @return {Emitter}
  9942. */
  9943. Emitter.prototype.emit = function(event){
  9944. this._callbacks = this._callbacks || {};
  9945. var args = new Array(arguments.length - 1)
  9946. , callbacks = this._callbacks['$' + event];
  9947. for (var i = 1; i < arguments.length; i++) {
  9948. args[i - 1] = arguments[i];
  9949. }
  9950. if (callbacks) {
  9951. callbacks = callbacks.slice(0);
  9952. for (var i = 0, len = callbacks.length; i < len; ++i) {
  9953. callbacks[i].apply(this, args);
  9954. }
  9955. }
  9956. return this;
  9957. };
  9958. /**
  9959. * Return array of callbacks for `event`.
  9960. *
  9961. * @param {String} event
  9962. * @return {Array}
  9963. * @api public
  9964. */
  9965. Emitter.prototype.listeners = function(event){
  9966. this._callbacks = this._callbacks || {};
  9967. return this._callbacks['$' + event] || [];
  9968. };
  9969. /**
  9970. * Check if this emitter has `event` handlers.
  9971. *
  9972. * @param {String} event
  9973. * @return {Boolean}
  9974. * @api public
  9975. */
  9976. Emitter.prototype.hasListeners = function(event){
  9977. return !! this.listeners(event).length;
  9978. };
  9979. /***/ }),
  9980. /***/ "./node_modules/component-inherit/index.js":
  9981. /*!*************************************************!*\
  9982. !*** ./node_modules/component-inherit/index.js ***!
  9983. \*************************************************/
  9984. /*! no static exports found */
  9985. /***/ (function(module, exports) {
  9986. module.exports = function(a, b){
  9987. var fn = function(){};
  9988. fn.prototype = b.prototype;
  9989. a.prototype = new fn;
  9990. a.prototype.constructor = a;
  9991. };
  9992. /***/ }),
  9993. /***/ "./node_modules/debug/src/browser.js":
  9994. /*!*******************************************!*\
  9995. !*** ./node_modules/debug/src/browser.js ***!
  9996. \*******************************************/
  9997. /*! no static exports found */
  9998. /***/ (function(module, exports, __webpack_require__) {
  9999. /* WEBPACK VAR INJECTION */(function(process) {/**
  10000. * This is the web browser implementation of `debug()`.
  10001. *
  10002. * Expose `debug()` as the module.
  10003. */
  10004. exports = module.exports = __webpack_require__(/*! ./debug */ "./node_modules/debug/src/debug.js");
  10005. exports.log = log;
  10006. exports.formatArgs = formatArgs;
  10007. exports.save = save;
  10008. exports.load = load;
  10009. exports.useColors = useColors;
  10010. exports.storage = 'undefined' != typeof chrome
  10011. && 'undefined' != typeof chrome.storage
  10012. ? chrome.storage.local
  10013. : localstorage();
  10014. /**
  10015. * Colors.
  10016. */
  10017. exports.colors = [
  10018. '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC',
  10019. '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF',
  10020. '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC',
  10021. '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF',
  10022. '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC',
  10023. '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033',
  10024. '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366',
  10025. '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933',
  10026. '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC',
  10027. '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF',
  10028. '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'
  10029. ];
  10030. /**
  10031. * Currently only WebKit-based Web Inspectors, Firefox >= v31,
  10032. * and the Firebug extension (any Firefox version) are known
  10033. * to support "%c" CSS customizations.
  10034. *
  10035. * TODO: add a `localStorage` variable to explicitly enable/disable colors
  10036. */
  10037. function useColors() {
  10038. // NB: In an Electron preload script, document will be defined but not fully
  10039. // initialized. Since we know we're in Chrome, we'll just detect this case
  10040. // explicitly
  10041. if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
  10042. return true;
  10043. }
  10044. // Internet Explorer and Edge do not support colors.
  10045. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
  10046. return false;
  10047. }
  10048. // is webkit? http://stackoverflow.com/a/16459606/376773
  10049. // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  10050. return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
  10051. // is firebug? http://stackoverflow.com/a/398120/376773
  10052. (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
  10053. // is firefox >= v31?
  10054. // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
  10055. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
  10056. // double check webkit in userAgent just in case we are in a worker
  10057. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
  10058. }
  10059. /**
  10060. * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
  10061. */
  10062. exports.formatters.j = function(v) {
  10063. try {
  10064. return JSON.stringify(v);
  10065. } catch (err) {
  10066. return '[UnexpectedJSONParseError]: ' + err.message;
  10067. }
  10068. };
  10069. /**
  10070. * Colorize log arguments if enabled.
  10071. *
  10072. * @api public
  10073. */
  10074. function formatArgs(args) {
  10075. var useColors = this.useColors;
  10076. args[0] = (useColors ? '%c' : '')
  10077. + this.namespace
  10078. + (useColors ? ' %c' : ' ')
  10079. + args[0]
  10080. + (useColors ? '%c ' : ' ')
  10081. + '+' + exports.humanize(this.diff);
  10082. if (!useColors) return;
  10083. var c = 'color: ' + this.color;
  10084. args.splice(1, 0, c, 'color: inherit')
  10085. // the final "%c" is somewhat tricky, because there could be other
  10086. // arguments passed either before or after the %c, so we need to
  10087. // figure out the correct index to insert the CSS into
  10088. var index = 0;
  10089. var lastC = 0;
  10090. args[0].replace(/%[a-zA-Z%]/g, function(match) {
  10091. if ('%%' === match) return;
  10092. index++;
  10093. if ('%c' === match) {
  10094. // we only are interested in the *last* %c
  10095. // (the user may have provided their own)
  10096. lastC = index;
  10097. }
  10098. });
  10099. args.splice(lastC, 0, c);
  10100. }
  10101. /**
  10102. * Invokes `console.log()` when available.
  10103. * No-op when `console.log` is not a "function".
  10104. *
  10105. * @api public
  10106. */
  10107. function log() {
  10108. // this hackery is required for IE8/9, where
  10109. // the `console.log` function doesn't have 'apply'
  10110. return 'object' === typeof console
  10111. && console.log
  10112. && Function.prototype.apply.call(console.log, console, arguments);
  10113. }
  10114. /**
  10115. * Save `namespaces`.
  10116. *
  10117. * @param {String} namespaces
  10118. * @api private
  10119. */
  10120. function save(namespaces) {
  10121. try {
  10122. if (null == namespaces) {
  10123. exports.storage.removeItem('debug');
  10124. } else {
  10125. exports.storage.debug = namespaces;
  10126. }
  10127. } catch(e) {}
  10128. }
  10129. /**
  10130. * Load `namespaces`.
  10131. *
  10132. * @return {String} returns the previously persisted debug modes
  10133. * @api private
  10134. */
  10135. function load() {
  10136. var r;
  10137. try {
  10138. r = exports.storage.debug;
  10139. } catch(e) {}
  10140. // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  10141. if (!r && typeof process !== 'undefined' && 'env' in process) {
  10142. r = process.env.DEBUG;
  10143. }
  10144. return r;
  10145. }
  10146. /**
  10147. * Enable namespaces listed in `localStorage.debug` initially.
  10148. */
  10149. exports.enable(load());
  10150. /**
  10151. * Localstorage attempts to return the localstorage.
  10152. *
  10153. * This is necessary because safari throws
  10154. * when a user disables cookies/localstorage
  10155. * and you attempt to access it.
  10156. *
  10157. * @return {LocalStorage}
  10158. * @api private
  10159. */
  10160. function localstorage() {
  10161. try {
  10162. return window.localStorage;
  10163. } catch (e) {}
  10164. }
  10165. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "./node_modules/process/browser.js")))
  10166. /***/ }),
  10167. /***/ "./node_modules/debug/src/debug.js":
  10168. /*!*****************************************!*\
  10169. !*** ./node_modules/debug/src/debug.js ***!
  10170. \*****************************************/
  10171. /*! no static exports found */
  10172. /***/ (function(module, exports, __webpack_require__) {
  10173. /**
  10174. * This is the common logic for both the Node.js and web browser
  10175. * implementations of `debug()`.
  10176. *
  10177. * Expose `debug()` as the module.
  10178. */
  10179. exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
  10180. exports.coerce = coerce;
  10181. exports.disable = disable;
  10182. exports.enable = enable;
  10183. exports.enabled = enabled;
  10184. exports.humanize = __webpack_require__(/*! ms */ "./node_modules/ms/index.js");
  10185. /**
  10186. * Active `debug` instances.
  10187. */
  10188. exports.instances = [];
  10189. /**
  10190. * The currently active debug mode names, and names to skip.
  10191. */
  10192. exports.names = [];
  10193. exports.skips = [];
  10194. /**
  10195. * Map of special "%n" handling functions, for the debug "format" argument.
  10196. *
  10197. * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
  10198. */
  10199. exports.formatters = {};
  10200. /**
  10201. * Select a color.
  10202. * @param {String} namespace
  10203. * @return {Number}
  10204. * @api private
  10205. */
  10206. function selectColor(namespace) {
  10207. var hash = 0, i;
  10208. for (i in namespace) {
  10209. hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
  10210. hash |= 0; // Convert to 32bit integer
  10211. }
  10212. return exports.colors[Math.abs(hash) % exports.colors.length];
  10213. }
  10214. /**
  10215. * Create a debugger with the given `namespace`.
  10216. *
  10217. * @param {String} namespace
  10218. * @return {Function}
  10219. * @api public
  10220. */
  10221. function createDebug(namespace) {
  10222. var prevTime;
  10223. function debug() {
  10224. // disabled?
  10225. if (!debug.enabled) return;
  10226. var self = debug;
  10227. // set `diff` timestamp
  10228. var curr = +new Date();
  10229. var ms = curr - (prevTime || curr);
  10230. self.diff = ms;
  10231. self.prev = prevTime;
  10232. self.curr = curr;
  10233. prevTime = curr;
  10234. // turn the `arguments` into a proper Array
  10235. var args = new Array(arguments.length);
  10236. for (var i = 0; i < args.length; i++) {
  10237. args[i] = arguments[i];
  10238. }
  10239. args[0] = exports.coerce(args[0]);
  10240. if ('string' !== typeof args[0]) {
  10241. // anything else let's inspect with %O
  10242. args.unshift('%O');
  10243. }
  10244. // apply any `formatters` transformations
  10245. var index = 0;
  10246. args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
  10247. // if we encounter an escaped % then don't increase the array index
  10248. if (match === '%%') return match;
  10249. index++;
  10250. var formatter = exports.formatters[format];
  10251. if ('function' === typeof formatter) {
  10252. var val = args[index];
  10253. match = formatter.call(self, val);
  10254. // now we need to remove `args[index]` since it's inlined in the `format`
  10255. args.splice(index, 1);
  10256. index--;
  10257. }
  10258. return match;
  10259. });
  10260. // apply env-specific formatting (colors, etc.)
  10261. exports.formatArgs.call(self, args);
  10262. var logFn = debug.log || exports.log || console.log.bind(console);
  10263. logFn.apply(self, args);
  10264. }
  10265. debug.namespace = namespace;
  10266. debug.enabled = exports.enabled(namespace);
  10267. debug.useColors = exports.useColors();
  10268. debug.color = selectColor(namespace);
  10269. debug.destroy = destroy;
  10270. // env-specific initialization logic for debug instances
  10271. if ('function' === typeof exports.init) {
  10272. exports.init(debug);
  10273. }
  10274. exports.instances.push(debug);
  10275. return debug;
  10276. }
  10277. function destroy () {
  10278. var index = exports.instances.indexOf(this);
  10279. if (index !== -1) {
  10280. exports.instances.splice(index, 1);
  10281. return true;
  10282. } else {
  10283. return false;
  10284. }
  10285. }
  10286. /**
  10287. * Enables a debug mode by namespaces. This can include modes
  10288. * separated by a colon and wildcards.
  10289. *
  10290. * @param {String} namespaces
  10291. * @api public
  10292. */
  10293. function enable(namespaces) {
  10294. exports.save(namespaces);
  10295. exports.names = [];
  10296. exports.skips = [];
  10297. var i;
  10298. var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
  10299. var len = split.length;
  10300. for (i = 0; i < len; i++) {
  10301. if (!split[i]) continue; // ignore empty strings
  10302. namespaces = split[i].replace(/\*/g, '.*?');
  10303. if (namespaces[0] === '-') {
  10304. exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
  10305. } else {
  10306. exports.names.push(new RegExp('^' + namespaces + '$'));
  10307. }
  10308. }
  10309. for (i = 0; i < exports.instances.length; i++) {
  10310. var instance = exports.instances[i];
  10311. instance.enabled = exports.enabled(instance.namespace);
  10312. }
  10313. }
  10314. /**
  10315. * Disable debug output.
  10316. *
  10317. * @api public
  10318. */
  10319. function disable() {
  10320. exports.enable('');
  10321. }
  10322. /**
  10323. * Returns true if the given mode name is enabled, false otherwise.
  10324. *
  10325. * @param {String} name
  10326. * @return {Boolean}
  10327. * @api public
  10328. */
  10329. function enabled(name) {
  10330. if (name[name.length - 1] === '*') {
  10331. return true;
  10332. }
  10333. var i, len;
  10334. for (i = 0, len = exports.skips.length; i < len; i++) {
  10335. if (exports.skips[i].test(name)) {
  10336. return false;
  10337. }
  10338. }
  10339. for (i = 0, len = exports.names.length; i < len; i++) {
  10340. if (exports.names[i].test(name)) {
  10341. return true;
  10342. }
  10343. }
  10344. return false;
  10345. }
  10346. /**
  10347. * Coerce `val`.
  10348. *
  10349. * @param {Mixed} val
  10350. * @return {Mixed}
  10351. * @api private
  10352. */
  10353. function coerce(val) {
  10354. if (val instanceof Error) return val.stack || val.message;
  10355. return val;
  10356. }
  10357. /***/ }),
  10358. /***/ "./node_modules/engine.io-client/lib/globalThis.browser.js":
  10359. /*!*****************************************************************!*\
  10360. !*** ./node_modules/engine.io-client/lib/globalThis.browser.js ***!
  10361. \*****************************************************************/
  10362. /*! no static exports found */
  10363. /***/ (function(module, exports) {
  10364. module.exports = (function () {
  10365. if (typeof self !== 'undefined') {
  10366. return self;
  10367. } else if (typeof window !== 'undefined') {
  10368. return window;
  10369. } else {
  10370. return Function('return this')(); // eslint-disable-line no-new-func
  10371. }
  10372. })();
  10373. /***/ }),
  10374. /***/ "./node_modules/engine.io-client/lib/index.js":
  10375. /*!****************************************************!*\
  10376. !*** ./node_modules/engine.io-client/lib/index.js ***!
  10377. \****************************************************/
  10378. /*! no static exports found */
  10379. /***/ (function(module, exports, __webpack_require__) {
  10380. module.exports = __webpack_require__(/*! ./socket */ "./node_modules/engine.io-client/lib/socket.js");
  10381. /**
  10382. * Exports parser
  10383. *
  10384. * @api public
  10385. *
  10386. */
  10387. module.exports.parser = __webpack_require__(/*! engine.io-parser */ "./node_modules/engine.io-parser/lib/browser.js");
  10388. /***/ }),
  10389. /***/ "./node_modules/engine.io-client/lib/socket.js":
  10390. /*!*****************************************************!*\
  10391. !*** ./node_modules/engine.io-client/lib/socket.js ***!
  10392. \*****************************************************/
  10393. /*! no static exports found */
  10394. /***/ (function(module, exports, __webpack_require__) {
  10395. /**
  10396. * Module dependencies.
  10397. */
  10398. var transports = __webpack_require__(/*! ./transports/index */ "./node_modules/engine.io-client/lib/transports/index.js");
  10399. var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/component-emitter/index.js");
  10400. var debug = __webpack_require__(/*! debug */ "./node_modules/engine.io-client/node_modules/debug/src/browser.js")('engine.io-client:socket');
  10401. var index = __webpack_require__(/*! indexof */ "./node_modules/indexof/index.js");
  10402. var parser = __webpack_require__(/*! engine.io-parser */ "./node_modules/engine.io-parser/lib/browser.js");
  10403. var parseuri = __webpack_require__(/*! parseuri */ "./node_modules/parseuri/index.js");
  10404. var parseqs = __webpack_require__(/*! parseqs */ "./node_modules/parseqs/index.js");
  10405. /**
  10406. * Module exports.
  10407. */
  10408. module.exports = Socket;
  10409. /**
  10410. * Socket constructor.
  10411. *
  10412. * @param {String|Object} uri or options
  10413. * @param {Object} options
  10414. * @api public
  10415. */
  10416. function Socket (uri, opts) {
  10417. if (!(this instanceof Socket)) return new Socket(uri, opts);
  10418. opts = opts || {};
  10419. if (uri && 'object' === typeof uri) {
  10420. opts = uri;
  10421. uri = null;
  10422. }
  10423. if (uri) {
  10424. uri = parseuri(uri);
  10425. opts.hostname = uri.host;
  10426. opts.secure = uri.protocol === 'https' || uri.protocol === 'wss';
  10427. opts.port = uri.port;
  10428. if (uri.query) opts.query = uri.query;
  10429. } else if (opts.host) {
  10430. opts.hostname = parseuri(opts.host).host;
  10431. }
  10432. this.secure = null != opts.secure ? opts.secure
  10433. : (typeof location !== 'undefined' && 'https:' === location.protocol);
  10434. if (opts.hostname && !opts.port) {
  10435. // if no port is specified manually, use the protocol default
  10436. opts.port = this.secure ? '443' : '80';
  10437. }
  10438. this.agent = opts.agent || false;
  10439. this.hostname = opts.hostname ||
  10440. (typeof location !== 'undefined' ? location.hostname : 'localhost');
  10441. this.port = opts.port || (typeof location !== 'undefined' && location.port
  10442. ? location.port
  10443. : (this.secure ? 443 : 80));
  10444. this.query = opts.query || {};
  10445. if ('string' === typeof this.query) this.query = parseqs.decode(this.query);
  10446. this.upgrade = false !== opts.upgrade;
  10447. this.path = (opts.path || '/engine.io').replace(/\/$/, '') + '/';
  10448. this.forceJSONP = !!opts.forceJSONP;
  10449. this.jsonp = false !== opts.jsonp;
  10450. this.forceBase64 = !!opts.forceBase64;
  10451. this.enablesXDR = !!opts.enablesXDR;
  10452. this.withCredentials = false !== opts.withCredentials;
  10453. this.timestampParam = opts.timestampParam || 't';
  10454. this.timestampRequests = opts.timestampRequests;
  10455. this.transports = opts.transports || ['polling', 'websocket'];
  10456. this.transportOptions = opts.transportOptions || {};
  10457. this.readyState = '';
  10458. this.writeBuffer = [];
  10459. this.prevBufferLen = 0;
  10460. this.policyPort = opts.policyPort || 843;
  10461. this.rememberUpgrade = opts.rememberUpgrade || false;
  10462. this.binaryType = null;
  10463. this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades;
  10464. this.perMessageDeflate = false !== opts.perMessageDeflate ? (opts.perMessageDeflate || {}) : false;
  10465. if (true === this.perMessageDeflate) this.perMessageDeflate = {};
  10466. if (this.perMessageDeflate && null == this.perMessageDeflate.threshold) {
  10467. this.perMessageDeflate.threshold = 1024;
  10468. }
  10469. // SSL options for Node.js client
  10470. this.pfx = opts.pfx || null;
  10471. this.key = opts.key || null;
  10472. this.passphrase = opts.passphrase || null;
  10473. this.cert = opts.cert || null;
  10474. this.ca = opts.ca || null;
  10475. this.ciphers = opts.ciphers || null;
  10476. this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? true : opts.rejectUnauthorized;
  10477. this.forceNode = !!opts.forceNode;
  10478. // detect ReactNative environment
  10479. this.isReactNative = (typeof navigator !== 'undefined' && typeof navigator.product === 'string' && navigator.product.toLowerCase() === 'reactnative');
  10480. // other options for Node.js or ReactNative client
  10481. if (typeof self === 'undefined' || this.isReactNative) {
  10482. if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) {
  10483. this.extraHeaders = opts.extraHeaders;
  10484. }
  10485. if (opts.localAddress) {
  10486. this.localAddress = opts.localAddress;
  10487. }
  10488. }
  10489. // set on handshake
  10490. this.id = null;
  10491. this.upgrades = null;
  10492. this.pingInterval = null;
  10493. this.pingTimeout = null;
  10494. // set on heartbeat
  10495. this.pingIntervalTimer = null;
  10496. this.pingTimeoutTimer = null;
  10497. this.open();
  10498. }
  10499. Socket.priorWebsocketSuccess = false;
  10500. /**
  10501. * Mix in `Emitter`.
  10502. */
  10503. Emitter(Socket.prototype);
  10504. /**
  10505. * Protocol version.
  10506. *
  10507. * @api public
  10508. */
  10509. Socket.protocol = parser.protocol; // this is an int
  10510. /**
  10511. * Expose deps for legacy compatibility
  10512. * and standalone browser access.
  10513. */
  10514. Socket.Socket = Socket;
  10515. Socket.Transport = __webpack_require__(/*! ./transport */ "./node_modules/engine.io-client/lib/transport.js");
  10516. Socket.transports = __webpack_require__(/*! ./transports/index */ "./node_modules/engine.io-client/lib/transports/index.js");
  10517. Socket.parser = __webpack_require__(/*! engine.io-parser */ "./node_modules/engine.io-parser/lib/browser.js");
  10518. /**
  10519. * Creates transport of the given type.
  10520. *
  10521. * @param {String} transport name
  10522. * @return {Transport}
  10523. * @api private
  10524. */
  10525. Socket.prototype.createTransport = function (name) {
  10526. debug('creating transport "%s"', name);
  10527. var query = clone(this.query);
  10528. // append engine.io protocol identifier
  10529. query.EIO = parser.protocol;
  10530. // transport name
  10531. query.transport = name;
  10532. // per-transport options
  10533. var options = this.transportOptions[name] || {};
  10534. // session id if we already have one
  10535. if (this.id) query.sid = this.id;
  10536. var transport = new transports[name]({
  10537. query: query,
  10538. socket: this,
  10539. agent: options.agent || this.agent,
  10540. hostname: options.hostname || this.hostname,
  10541. port: options.port || this.port,
  10542. secure: options.secure || this.secure,
  10543. path: options.path || this.path,
  10544. forceJSONP: options.forceJSONP || this.forceJSONP,
  10545. jsonp: options.jsonp || this.jsonp,
  10546. forceBase64: options.forceBase64 || this.forceBase64,
  10547. enablesXDR: options.enablesXDR || this.enablesXDR,
  10548. withCredentials: options.withCredentials || this.withCredentials,
  10549. timestampRequests: options.timestampRequests || this.timestampRequests,
  10550. timestampParam: options.timestampParam || this.timestampParam,
  10551. policyPort: options.policyPort || this.policyPort,
  10552. pfx: options.pfx || this.pfx,
  10553. key: options.key || this.key,
  10554. passphrase: options.passphrase || this.passphrase,
  10555. cert: options.cert || this.cert,
  10556. ca: options.ca || this.ca,
  10557. ciphers: options.ciphers || this.ciphers,
  10558. rejectUnauthorized: options.rejectUnauthorized || this.rejectUnauthorized,
  10559. perMessageDeflate: options.perMessageDeflate || this.perMessageDeflate,
  10560. extraHeaders: options.extraHeaders || this.extraHeaders,
  10561. forceNode: options.forceNode || this.forceNode,
  10562. localAddress: options.localAddress || this.localAddress,
  10563. requestTimeout: options.requestTimeout || this.requestTimeout,
  10564. protocols: options.protocols || void (0),
  10565. isReactNative: this.isReactNative
  10566. });
  10567. return transport;
  10568. };
  10569. function clone (obj) {
  10570. var o = {};
  10571. for (var i in obj) {
  10572. if (obj.hasOwnProperty(i)) {
  10573. o[i] = obj[i];
  10574. }
  10575. }
  10576. return o;
  10577. }
  10578. /**
  10579. * Initializes transport to use and starts probe.
  10580. *
  10581. * @api private
  10582. */
  10583. Socket.prototype.open = function () {
  10584. var transport;
  10585. if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') !== -1) {
  10586. transport = 'websocket';
  10587. } else if (0 === this.transports.length) {
  10588. // Emit error on next tick so it can be listened to
  10589. var self = this;
  10590. setTimeout(function () {
  10591. self.emit('error', 'No transports available');
  10592. }, 0);
  10593. return;
  10594. } else {
  10595. transport = this.transports[0];
  10596. }
  10597. this.readyState = 'opening';
  10598. // Retry with the next transport if the transport is disabled (jsonp: false)
  10599. try {
  10600. transport = this.createTransport(transport);
  10601. } catch (e) {
  10602. this.transports.shift();
  10603. this.open();
  10604. return;
  10605. }
  10606. transport.open();
  10607. this.setTransport(transport);
  10608. };
  10609. /**
  10610. * Sets the current transport. Disables the existing one (if any).
  10611. *
  10612. * @api private
  10613. */
  10614. Socket.prototype.setTransport = function (transport) {
  10615. debug('setting transport %s', transport.name);
  10616. var self = this;
  10617. if (this.transport) {
  10618. debug('clearing existing transport %s', this.transport.name);
  10619. this.transport.removeAllListeners();
  10620. }
  10621. // set up transport
  10622. this.transport = transport;
  10623. // set up transport listeners
  10624. transport
  10625. .on('drain', function () {
  10626. self.onDrain();
  10627. })
  10628. .on('packet', function (packet) {
  10629. self.onPacket(packet);
  10630. })
  10631. .on('error', function (e) {
  10632. self.onError(e);
  10633. })
  10634. .on('close', function () {
  10635. self.onClose('transport close');
  10636. });
  10637. };
  10638. /**
  10639. * Probes a transport.
  10640. *
  10641. * @param {String} transport name
  10642. * @api private
  10643. */
  10644. Socket.prototype.probe = function (name) {
  10645. debug('probing transport "%s"', name);
  10646. var transport = this.createTransport(name, { probe: 1 });
  10647. var failed = false;
  10648. var self = this;
  10649. Socket.priorWebsocketSuccess = false;
  10650. function onTransportOpen () {
  10651. if (self.onlyBinaryUpgrades) {
  10652. var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary;
  10653. failed = failed || upgradeLosesBinary;
  10654. }
  10655. if (failed) return;
  10656. debug('probe transport "%s" opened', name);
  10657. transport.send([{ type: 'ping', data: 'probe' }]);
  10658. transport.once('packet', function (msg) {
  10659. if (failed) return;
  10660. if ('pong' === msg.type && 'probe' === msg.data) {
  10661. debug('probe transport "%s" pong', name);
  10662. self.upgrading = true;
  10663. self.emit('upgrading', transport);
  10664. if (!transport) return;
  10665. Socket.priorWebsocketSuccess = 'websocket' === transport.name;
  10666. debug('pausing current transport "%s"', self.transport.name);
  10667. self.transport.pause(function () {
  10668. if (failed) return;
  10669. if ('closed' === self.readyState) return;
  10670. debug('changing transport and sending upgrade packet');
  10671. cleanup();
  10672. self.setTransport(transport);
  10673. transport.send([{ type: 'upgrade' }]);
  10674. self.emit('upgrade', transport);
  10675. transport = null;
  10676. self.upgrading = false;
  10677. self.flush();
  10678. });
  10679. } else {
  10680. debug('probe transport "%s" failed', name);
  10681. var err = new Error('probe error');
  10682. err.transport = transport.name;
  10683. self.emit('upgradeError', err);
  10684. }
  10685. });
  10686. }
  10687. function freezeTransport () {
  10688. if (failed) return;
  10689. // Any callback called by transport should be ignored since now
  10690. failed = true;
  10691. cleanup();
  10692. transport.close();
  10693. transport = null;
  10694. }
  10695. // Handle any error that happens while probing
  10696. function onerror (err) {
  10697. var error = new Error('probe error: ' + err);
  10698. error.transport = transport.name;
  10699. freezeTransport();
  10700. debug('probe transport "%s" failed because of error: %s', name, err);
  10701. self.emit('upgradeError', error);
  10702. }
  10703. function onTransportClose () {
  10704. onerror('transport closed');
  10705. }
  10706. // When the socket is closed while we're probing
  10707. function onclose () {
  10708. onerror('socket closed');
  10709. }
  10710. // When the socket is upgraded while we're probing
  10711. function onupgrade (to) {
  10712. if (transport && to.name !== transport.name) {
  10713. debug('"%s" works - aborting "%s"', to.name, transport.name);
  10714. freezeTransport();
  10715. }
  10716. }
  10717. // Remove all listeners on the transport and on self
  10718. function cleanup () {
  10719. transport.removeListener('open', onTransportOpen);
  10720. transport.removeListener('error', onerror);
  10721. transport.removeListener('close', onTransportClose);
  10722. self.removeListener('close', onclose);
  10723. self.removeListener('upgrading', onupgrade);
  10724. }
  10725. transport.once('open', onTransportOpen);
  10726. transport.once('error', onerror);
  10727. transport.once('close', onTransportClose);
  10728. this.once('close', onclose);
  10729. this.once('upgrading', onupgrade);
  10730. transport.open();
  10731. };
  10732. /**
  10733. * Called when connection is deemed open.
  10734. *
  10735. * @api public
  10736. */
  10737. Socket.prototype.onOpen = function () {
  10738. debug('socket open');
  10739. this.readyState = 'open';
  10740. Socket.priorWebsocketSuccess = 'websocket' === this.transport.name;
  10741. this.emit('open');
  10742. this.flush();
  10743. // we check for `readyState` in case an `open`
  10744. // listener already closed the socket
  10745. if ('open' === this.readyState && this.upgrade && this.transport.pause) {
  10746. debug('starting upgrade probes');
  10747. for (var i = 0, l = this.upgrades.length; i < l; i++) {
  10748. this.probe(this.upgrades[i]);
  10749. }
  10750. }
  10751. };
  10752. /**
  10753. * Handles a packet.
  10754. *
  10755. * @api private
  10756. */
  10757. Socket.prototype.onPacket = function (packet) {
  10758. if ('opening' === this.readyState || 'open' === this.readyState ||
  10759. 'closing' === this.readyState) {
  10760. debug('socket receive: type "%s", data "%s"', packet.type, packet.data);
  10761. this.emit('packet', packet);
  10762. // Socket is live - any packet counts
  10763. this.emit('heartbeat');
  10764. switch (packet.type) {
  10765. case 'open':
  10766. this.onHandshake(JSON.parse(packet.data));
  10767. break;
  10768. case 'pong':
  10769. this.setPing();
  10770. this.emit('pong');
  10771. break;
  10772. case 'error':
  10773. var err = new Error('server error');
  10774. err.code = packet.data;
  10775. this.onError(err);
  10776. break;
  10777. case 'message':
  10778. this.emit('data', packet.data);
  10779. this.emit('message', packet.data);
  10780. break;
  10781. }
  10782. } else {
  10783. debug('packet received with socket readyState "%s"', this.readyState);
  10784. }
  10785. };
  10786. /**
  10787. * Called upon handshake completion.
  10788. *
  10789. * @param {Object} handshake obj
  10790. * @api private
  10791. */
  10792. Socket.prototype.onHandshake = function (data) {
  10793. this.emit('handshake', data);
  10794. this.id = data.sid;
  10795. this.transport.query.sid = data.sid;
  10796. this.upgrades = this.filterUpgrades(data.upgrades);
  10797. this.pingInterval = data.pingInterval;
  10798. this.pingTimeout = data.pingTimeout;
  10799. this.onOpen();
  10800. // In case open handler closes socket
  10801. if ('closed' === this.readyState) return;
  10802. this.setPing();
  10803. // Prolong liveness of socket on heartbeat
  10804. this.removeListener('heartbeat', this.onHeartbeat);
  10805. this.on('heartbeat', this.onHeartbeat);
  10806. };
  10807. /**
  10808. * Resets ping timeout.
  10809. *
  10810. * @api private
  10811. */
  10812. Socket.prototype.onHeartbeat = function (timeout) {
  10813. clearTimeout(this.pingTimeoutTimer);
  10814. var self = this;
  10815. self.pingTimeoutTimer = setTimeout(function () {
  10816. if ('closed' === self.readyState) return;
  10817. self.onClose('ping timeout');
  10818. }, timeout || (self.pingInterval + self.pingTimeout));
  10819. };
  10820. /**
  10821. * Pings server every `this.pingInterval` and expects response
  10822. * within `this.pingTimeout` or closes connection.
  10823. *
  10824. * @api private
  10825. */
  10826. Socket.prototype.setPing = function () {
  10827. var self = this;
  10828. clearTimeout(self.pingIntervalTimer);
  10829. self.pingIntervalTimer = setTimeout(function () {
  10830. debug('writing ping packet - expecting pong within %sms', self.pingTimeout);
  10831. self.ping();
  10832. self.onHeartbeat(self.pingTimeout);
  10833. }, self.pingInterval);
  10834. };
  10835. /**
  10836. * Sends a ping packet.
  10837. *
  10838. * @api private
  10839. */
  10840. Socket.prototype.ping = function () {
  10841. var self = this;
  10842. this.sendPacket('ping', function () {
  10843. self.emit('ping');
  10844. });
  10845. };
  10846. /**
  10847. * Called on `drain` event
  10848. *
  10849. * @api private
  10850. */
  10851. Socket.prototype.onDrain = function () {
  10852. this.writeBuffer.splice(0, this.prevBufferLen);
  10853. // setting prevBufferLen = 0 is very important
  10854. // for example, when upgrading, upgrade packet is sent over,
  10855. // and a nonzero prevBufferLen could cause problems on `drain`
  10856. this.prevBufferLen = 0;
  10857. if (0 === this.writeBuffer.length) {
  10858. this.emit('drain');
  10859. } else {
  10860. this.flush();
  10861. }
  10862. };
  10863. /**
  10864. * Flush write buffers.
  10865. *
  10866. * @api private
  10867. */
  10868. Socket.prototype.flush = function () {
  10869. if ('closed' !== this.readyState && this.transport.writable &&
  10870. !this.upgrading && this.writeBuffer.length) {
  10871. debug('flushing %d packets in socket', this.writeBuffer.length);
  10872. this.transport.send(this.writeBuffer);
  10873. // keep track of current length of writeBuffer
  10874. // splice writeBuffer and callbackBuffer on `drain`
  10875. this.prevBufferLen = this.writeBuffer.length;
  10876. this.emit('flush');
  10877. }
  10878. };
  10879. /**
  10880. * Sends a message.
  10881. *
  10882. * @param {String} message.
  10883. * @param {Function} callback function.
  10884. * @param {Object} options.
  10885. * @return {Socket} for chaining.
  10886. * @api public
  10887. */
  10888. Socket.prototype.write =
  10889. Socket.prototype.send = function (msg, options, fn) {
  10890. this.sendPacket('message', msg, options, fn);
  10891. return this;
  10892. };
  10893. /**
  10894. * Sends a packet.
  10895. *
  10896. * @param {String} packet type.
  10897. * @param {String} data.
  10898. * @param {Object} options.
  10899. * @param {Function} callback function.
  10900. * @api private
  10901. */
  10902. Socket.prototype.sendPacket = function (type, data, options, fn) {
  10903. if ('function' === typeof data) {
  10904. fn = data;
  10905. data = undefined;
  10906. }
  10907. if ('function' === typeof options) {
  10908. fn = options;
  10909. options = null;
  10910. }
  10911. if ('closing' === this.readyState || 'closed' === this.readyState) {
  10912. return;
  10913. }
  10914. options = options || {};
  10915. options.compress = false !== options.compress;
  10916. var packet = {
  10917. type: type,
  10918. data: data,
  10919. options: options
  10920. };
  10921. this.emit('packetCreate', packet);
  10922. this.writeBuffer.push(packet);
  10923. if (fn) this.once('flush', fn);
  10924. this.flush();
  10925. };
  10926. /**
  10927. * Closes the connection.
  10928. *
  10929. * @api private
  10930. */
  10931. Socket.prototype.close = function () {
  10932. if ('opening' === this.readyState || 'open' === this.readyState) {
  10933. this.readyState = 'closing';
  10934. var self = this;
  10935. if (this.writeBuffer.length) {
  10936. this.once('drain', function () {
  10937. if (this.upgrading) {
  10938. waitForUpgrade();
  10939. } else {
  10940. close();
  10941. }
  10942. });
  10943. } else if (this.upgrading) {
  10944. waitForUpgrade();
  10945. } else {
  10946. close();
  10947. }
  10948. }
  10949. function close () {
  10950. self.onClose('forced close');
  10951. debug('socket closing - telling transport to close');
  10952. self.transport.close();
  10953. }
  10954. function cleanupAndClose () {
  10955. self.removeListener('upgrade', cleanupAndClose);
  10956. self.removeListener('upgradeError', cleanupAndClose);
  10957. close();
  10958. }
  10959. function waitForUpgrade () {
  10960. // wait for upgrade to finish since we can't send packets while pausing a transport
  10961. self.once('upgrade', cleanupAndClose);
  10962. self.once('upgradeError', cleanupAndClose);
  10963. }
  10964. return this;
  10965. };
  10966. /**
  10967. * Called upon transport error
  10968. *
  10969. * @api private
  10970. */
  10971. Socket.prototype.onError = function (err) {
  10972. debug('socket error %j', err);
  10973. Socket.priorWebsocketSuccess = false;
  10974. this.emit('error', err);
  10975. this.onClose('transport error', err);
  10976. };
  10977. /**
  10978. * Called upon transport close.
  10979. *
  10980. * @api private
  10981. */
  10982. Socket.prototype.onClose = function (reason, desc) {
  10983. if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) {
  10984. debug('socket close with reason: "%s"', reason);
  10985. var self = this;
  10986. // clear timers
  10987. clearTimeout(this.pingIntervalTimer);
  10988. clearTimeout(this.pingTimeoutTimer);
  10989. // stop event from firing again for transport
  10990. this.transport.removeAllListeners('close');
  10991. // ensure transport won't stay open
  10992. this.transport.close();
  10993. // ignore further transport communication
  10994. this.transport.removeAllListeners();
  10995. // set ready state
  10996. this.readyState = 'closed';
  10997. // clear session id
  10998. this.id = null;
  10999. // emit close event
  11000. this.emit('close', reason, desc);
  11001. // clean buffers after, so users can still
  11002. // grab the buffers on `close` event
  11003. self.writeBuffer = [];
  11004. self.prevBufferLen = 0;
  11005. }
  11006. };
  11007. /**
  11008. * Filters upgrades, returning only those matching client transports.
  11009. *
  11010. * @param {Array} server upgrades
  11011. * @api private
  11012. *
  11013. */
  11014. Socket.prototype.filterUpgrades = function (upgrades) {
  11015. var filteredUpgrades = [];
  11016. for (var i = 0, j = upgrades.length; i < j; i++) {
  11017. if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]);
  11018. }
  11019. return filteredUpgrades;
  11020. };
  11021. /***/ }),
  11022. /***/ "./node_modules/engine.io-client/lib/transport.js":
  11023. /*!********************************************************!*\
  11024. !*** ./node_modules/engine.io-client/lib/transport.js ***!
  11025. \********************************************************/
  11026. /*! no static exports found */
  11027. /***/ (function(module, exports, __webpack_require__) {
  11028. /**
  11029. * Module dependencies.
  11030. */
  11031. var parser = __webpack_require__(/*! engine.io-parser */ "./node_modules/engine.io-parser/lib/browser.js");
  11032. var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/component-emitter/index.js");
  11033. /**
  11034. * Module exports.
  11035. */
  11036. module.exports = Transport;
  11037. /**
  11038. * Transport abstract constructor.
  11039. *
  11040. * @param {Object} options.
  11041. * @api private
  11042. */
  11043. function Transport (opts) {
  11044. this.path = opts.path;
  11045. this.hostname = opts.hostname;
  11046. this.port = opts.port;
  11047. this.secure = opts.secure;
  11048. this.query = opts.query;
  11049. this.timestampParam = opts.timestampParam;
  11050. this.timestampRequests = opts.timestampRequests;
  11051. this.readyState = '';
  11052. this.agent = opts.agent || false;
  11053. this.socket = opts.socket;
  11054. this.enablesXDR = opts.enablesXDR;
  11055. this.withCredentials = opts.withCredentials;
  11056. // SSL options for Node.js client
  11057. this.pfx = opts.pfx;
  11058. this.key = opts.key;
  11059. this.passphrase = opts.passphrase;
  11060. this.cert = opts.cert;
  11061. this.ca = opts.ca;
  11062. this.ciphers = opts.ciphers;
  11063. this.rejectUnauthorized = opts.rejectUnauthorized;
  11064. this.forceNode = opts.forceNode;
  11065. // results of ReactNative environment detection
  11066. this.isReactNative = opts.isReactNative;
  11067. // other options for Node.js client
  11068. this.extraHeaders = opts.extraHeaders;
  11069. this.localAddress = opts.localAddress;
  11070. }
  11071. /**
  11072. * Mix in `Emitter`.
  11073. */
  11074. Emitter(Transport.prototype);
  11075. /**
  11076. * Emits an error.
  11077. *
  11078. * @param {String} str
  11079. * @return {Transport} for chaining
  11080. * @api public
  11081. */
  11082. Transport.prototype.onError = function (msg, desc) {
  11083. var err = new Error(msg);
  11084. err.type = 'TransportError';
  11085. err.description = desc;
  11086. this.emit('error', err);
  11087. return this;
  11088. };
  11089. /**
  11090. * Opens the transport.
  11091. *
  11092. * @api public
  11093. */
  11094. Transport.prototype.open = function () {
  11095. if ('closed' === this.readyState || '' === this.readyState) {
  11096. this.readyState = 'opening';
  11097. this.doOpen();
  11098. }
  11099. return this;
  11100. };
  11101. /**
  11102. * Closes the transport.
  11103. *
  11104. * @api private
  11105. */
  11106. Transport.prototype.close = function () {
  11107. if ('opening' === this.readyState || 'open' === this.readyState) {
  11108. this.doClose();
  11109. this.onClose();
  11110. }
  11111. return this;
  11112. };
  11113. /**
  11114. * Sends multiple packets.
  11115. *
  11116. * @param {Array} packets
  11117. * @api private
  11118. */
  11119. Transport.prototype.send = function (packets) {
  11120. if ('open' === this.readyState) {
  11121. this.write(packets);
  11122. } else {
  11123. throw new Error('Transport not open');
  11124. }
  11125. };
  11126. /**
  11127. * Called upon open
  11128. *
  11129. * @api private
  11130. */
  11131. Transport.prototype.onOpen = function () {
  11132. this.readyState = 'open';
  11133. this.writable = true;
  11134. this.emit('open');
  11135. };
  11136. /**
  11137. * Called with data.
  11138. *
  11139. * @param {String} data
  11140. * @api private
  11141. */
  11142. Transport.prototype.onData = function (data) {
  11143. var packet = parser.decodePacket(data, this.socket.binaryType);
  11144. this.onPacket(packet);
  11145. };
  11146. /**
  11147. * Called with a decoded packet.
  11148. */
  11149. Transport.prototype.onPacket = function (packet) {
  11150. this.emit('packet', packet);
  11151. };
  11152. /**
  11153. * Called upon close.
  11154. *
  11155. * @api private
  11156. */
  11157. Transport.prototype.onClose = function () {
  11158. this.readyState = 'closed';
  11159. this.emit('close');
  11160. };
  11161. /***/ }),
  11162. /***/ "./node_modules/engine.io-client/lib/transports/index.js":
  11163. /*!***************************************************************!*\
  11164. !*** ./node_modules/engine.io-client/lib/transports/index.js ***!
  11165. \***************************************************************/
  11166. /*! no static exports found */
  11167. /***/ (function(module, exports, __webpack_require__) {
  11168. /**
  11169. * Module dependencies
  11170. */
  11171. var XMLHttpRequest = __webpack_require__(/*! xmlhttprequest-ssl */ "./node_modules/engine.io-client/lib/xmlhttprequest.js");
  11172. var XHR = __webpack_require__(/*! ./polling-xhr */ "./node_modules/engine.io-client/lib/transports/polling-xhr.js");
  11173. var JSONP = __webpack_require__(/*! ./polling-jsonp */ "./node_modules/engine.io-client/lib/transports/polling-jsonp.js");
  11174. var websocket = __webpack_require__(/*! ./websocket */ "./node_modules/engine.io-client/lib/transports/websocket.js");
  11175. /**
  11176. * Export transports.
  11177. */
  11178. exports.polling = polling;
  11179. exports.websocket = websocket;
  11180. /**
  11181. * Polling transport polymorphic constructor.
  11182. * Decides on xhr vs jsonp based on feature detection.
  11183. *
  11184. * @api private
  11185. */
  11186. function polling (opts) {
  11187. var xhr;
  11188. var xd = false;
  11189. var xs = false;
  11190. var jsonp = false !== opts.jsonp;
  11191. if (typeof location !== 'undefined') {
  11192. var isSSL = 'https:' === location.protocol;
  11193. var port = location.port;
  11194. // some user agents have empty `location.port`
  11195. if (!port) {
  11196. port = isSSL ? 443 : 80;
  11197. }
  11198. xd = opts.hostname !== location.hostname || port !== opts.port;
  11199. xs = opts.secure !== isSSL;
  11200. }
  11201. opts.xdomain = xd;
  11202. opts.xscheme = xs;
  11203. xhr = new XMLHttpRequest(opts);
  11204. if ('open' in xhr && !opts.forceJSONP) {
  11205. return new XHR(opts);
  11206. } else {
  11207. if (!jsonp) throw new Error('JSONP disabled');
  11208. return new JSONP(opts);
  11209. }
  11210. }
  11211. /***/ }),
  11212. /***/ "./node_modules/engine.io-client/lib/transports/polling-jsonp.js":
  11213. /*!***********************************************************************!*\
  11214. !*** ./node_modules/engine.io-client/lib/transports/polling-jsonp.js ***!
  11215. \***********************************************************************/
  11216. /*! no static exports found */
  11217. /***/ (function(module, exports, __webpack_require__) {
  11218. /**
  11219. * Module requirements.
  11220. */
  11221. var Polling = __webpack_require__(/*! ./polling */ "./node_modules/engine.io-client/lib/transports/polling.js");
  11222. var inherit = __webpack_require__(/*! component-inherit */ "./node_modules/component-inherit/index.js");
  11223. var globalThis = __webpack_require__(/*! ../globalThis */ "./node_modules/engine.io-client/lib/globalThis.browser.js");
  11224. /**
  11225. * Module exports.
  11226. */
  11227. module.exports = JSONPPolling;
  11228. /**
  11229. * Cached regular expressions.
  11230. */
  11231. var rNewline = /\n/g;
  11232. var rEscapedNewline = /\\n/g;
  11233. /**
  11234. * Global JSONP callbacks.
  11235. */
  11236. var callbacks;
  11237. /**
  11238. * Noop.
  11239. */
  11240. function empty () { }
  11241. /**
  11242. * JSONP Polling constructor.
  11243. *
  11244. * @param {Object} opts.
  11245. * @api public
  11246. */
  11247. function JSONPPolling (opts) {
  11248. Polling.call(this, opts);
  11249. this.query = this.query || {};
  11250. // define global callbacks array if not present
  11251. // we do this here (lazily) to avoid unneeded global pollution
  11252. if (!callbacks) {
  11253. // we need to consider multiple engines in the same page
  11254. callbacks = globalThis.___eio = (globalThis.___eio || []);
  11255. }
  11256. // callback identifier
  11257. this.index = callbacks.length;
  11258. // add callback to jsonp global
  11259. var self = this;
  11260. callbacks.push(function (msg) {
  11261. self.onData(msg);
  11262. });
  11263. // append to query string
  11264. this.query.j = this.index;
  11265. // prevent spurious errors from being emitted when the window is unloaded
  11266. if (typeof addEventListener === 'function') {
  11267. addEventListener('beforeunload', function () {
  11268. if (self.script) self.script.onerror = empty;
  11269. }, false);
  11270. }
  11271. }
  11272. /**
  11273. * Inherits from Polling.
  11274. */
  11275. inherit(JSONPPolling, Polling);
  11276. /*
  11277. * JSONP only supports binary as base64 encoded strings
  11278. */
  11279. JSONPPolling.prototype.supportsBinary = false;
  11280. /**
  11281. * Closes the socket.
  11282. *
  11283. * @api private
  11284. */
  11285. JSONPPolling.prototype.doClose = function () {
  11286. if (this.script) {
  11287. this.script.parentNode.removeChild(this.script);
  11288. this.script = null;
  11289. }
  11290. if (this.form) {
  11291. this.form.parentNode.removeChild(this.form);
  11292. this.form = null;
  11293. this.iframe = null;
  11294. }
  11295. Polling.prototype.doClose.call(this);
  11296. };
  11297. /**
  11298. * Starts a poll cycle.
  11299. *
  11300. * @api private
  11301. */
  11302. JSONPPolling.prototype.doPoll = function () {
  11303. var self = this;
  11304. var script = document.createElement('script');
  11305. if (this.script) {
  11306. this.script.parentNode.removeChild(this.script);
  11307. this.script = null;
  11308. }
  11309. script.async = true;
  11310. script.src = this.uri();
  11311. script.onerror = function (e) {
  11312. self.onError('jsonp poll error', e);
  11313. };
  11314. var insertAt = document.getElementsByTagName('script')[0];
  11315. if (insertAt) {
  11316. insertAt.parentNode.insertBefore(script, insertAt);
  11317. } else {
  11318. (document.head || document.body).appendChild(script);
  11319. }
  11320. this.script = script;
  11321. var isUAgecko = 'undefined' !== typeof navigator && /gecko/i.test(navigator.userAgent);
  11322. if (isUAgecko) {
  11323. setTimeout(function () {
  11324. var iframe = document.createElement('iframe');
  11325. document.body.appendChild(iframe);
  11326. document.body.removeChild(iframe);
  11327. }, 100);
  11328. }
  11329. };
  11330. /**
  11331. * Writes with a hidden iframe.
  11332. *
  11333. * @param {String} data to send
  11334. * @param {Function} called upon flush.
  11335. * @api private
  11336. */
  11337. JSONPPolling.prototype.doWrite = function (data, fn) {
  11338. var self = this;
  11339. if (!this.form) {
  11340. var form = document.createElement('form');
  11341. var area = document.createElement('textarea');
  11342. var id = this.iframeId = 'eio_iframe_' + this.index;
  11343. var iframe;
  11344. form.className = 'socketio';
  11345. form.style.position = 'absolute';
  11346. form.style.top = '-1000px';
  11347. form.style.left = '-1000px';
  11348. form.target = id;
  11349. form.method = 'POST';
  11350. form.setAttribute('accept-charset', 'utf-8');
  11351. area.name = 'd';
  11352. form.appendChild(area);
  11353. document.body.appendChild(form);
  11354. this.form = form;
  11355. this.area = area;
  11356. }
  11357. this.form.action = this.uri();
  11358. function complete () {
  11359. initIframe();
  11360. fn();
  11361. }
  11362. function initIframe () {
  11363. if (self.iframe) {
  11364. try {
  11365. self.form.removeChild(self.iframe);
  11366. } catch (e) {
  11367. self.onError('jsonp polling iframe removal error', e);
  11368. }
  11369. }
  11370. try {
  11371. // ie6 dynamic iframes with target="" support (thanks Chris Lambacher)
  11372. var html = '<iframe src="javascript:0" name="' + self.iframeId + '">';
  11373. iframe = document.createElement(html);
  11374. } catch (e) {
  11375. iframe = document.createElement('iframe');
  11376. iframe.name = self.iframeId;
  11377. iframe.src = 'javascript:0';
  11378. }
  11379. iframe.id = self.iframeId;
  11380. self.form.appendChild(iframe);
  11381. self.iframe = iframe;
  11382. }
  11383. initIframe();
  11384. // escape \n to prevent it from being converted into \r\n by some UAs
  11385. // double escaping is required for escaped new lines because unescaping of new lines can be done safely on server-side
  11386. data = data.replace(rEscapedNewline, '\\\n');
  11387. this.area.value = data.replace(rNewline, '\\n');
  11388. try {
  11389. this.form.submit();
  11390. } catch (e) {}
  11391. if (this.iframe.attachEvent) {
  11392. this.iframe.onreadystatechange = function () {
  11393. if (self.iframe.readyState === 'complete') {
  11394. complete();
  11395. }
  11396. };
  11397. } else {
  11398. this.iframe.onload = complete;
  11399. }
  11400. };
  11401. /***/ }),
  11402. /***/ "./node_modules/engine.io-client/lib/transports/polling-xhr.js":
  11403. /*!*********************************************************************!*\
  11404. !*** ./node_modules/engine.io-client/lib/transports/polling-xhr.js ***!
  11405. \*********************************************************************/
  11406. /*! no static exports found */
  11407. /***/ (function(module, exports, __webpack_require__) {
  11408. /* global attachEvent */
  11409. /**
  11410. * Module requirements.
  11411. */
  11412. var XMLHttpRequest = __webpack_require__(/*! xmlhttprequest-ssl */ "./node_modules/engine.io-client/lib/xmlhttprequest.js");
  11413. var Polling = __webpack_require__(/*! ./polling */ "./node_modules/engine.io-client/lib/transports/polling.js");
  11414. var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/component-emitter/index.js");
  11415. var inherit = __webpack_require__(/*! component-inherit */ "./node_modules/component-inherit/index.js");
  11416. var debug = __webpack_require__(/*! debug */ "./node_modules/engine.io-client/node_modules/debug/src/browser.js")('engine.io-client:polling-xhr');
  11417. var globalThis = __webpack_require__(/*! ../globalThis */ "./node_modules/engine.io-client/lib/globalThis.browser.js");
  11418. /**
  11419. * Module exports.
  11420. */
  11421. module.exports = XHR;
  11422. module.exports.Request = Request;
  11423. /**
  11424. * Empty function
  11425. */
  11426. function empty () {}
  11427. /**
  11428. * XHR Polling constructor.
  11429. *
  11430. * @param {Object} opts
  11431. * @api public
  11432. */
  11433. function XHR (opts) {
  11434. Polling.call(this, opts);
  11435. this.requestTimeout = opts.requestTimeout;
  11436. this.extraHeaders = opts.extraHeaders;
  11437. if (typeof location !== 'undefined') {
  11438. var isSSL = 'https:' === location.protocol;
  11439. var port = location.port;
  11440. // some user agents have empty `location.port`
  11441. if (!port) {
  11442. port = isSSL ? 443 : 80;
  11443. }
  11444. this.xd = (typeof location !== 'undefined' && opts.hostname !== location.hostname) ||
  11445. port !== opts.port;
  11446. this.xs = opts.secure !== isSSL;
  11447. }
  11448. }
  11449. /**
  11450. * Inherits from Polling.
  11451. */
  11452. inherit(XHR, Polling);
  11453. /**
  11454. * XHR supports binary
  11455. */
  11456. XHR.prototype.supportsBinary = true;
  11457. /**
  11458. * Creates a request.
  11459. *
  11460. * @param {String} method
  11461. * @api private
  11462. */
  11463. XHR.prototype.request = function (opts) {
  11464. opts = opts || {};
  11465. opts.uri = this.uri();
  11466. opts.xd = this.xd;
  11467. opts.xs = this.xs;
  11468. opts.agent = this.agent || false;
  11469. opts.supportsBinary = this.supportsBinary;
  11470. opts.enablesXDR = this.enablesXDR;
  11471. opts.withCredentials = this.withCredentials;
  11472. // SSL options for Node.js client
  11473. opts.pfx = this.pfx;
  11474. opts.key = this.key;
  11475. opts.passphrase = this.passphrase;
  11476. opts.cert = this.cert;
  11477. opts.ca = this.ca;
  11478. opts.ciphers = this.ciphers;
  11479. opts.rejectUnauthorized = this.rejectUnauthorized;
  11480. opts.requestTimeout = this.requestTimeout;
  11481. // other options for Node.js client
  11482. opts.extraHeaders = this.extraHeaders;
  11483. return new Request(opts);
  11484. };
  11485. /**
  11486. * Sends data.
  11487. *
  11488. * @param {String} data to send.
  11489. * @param {Function} called upon flush.
  11490. * @api private
  11491. */
  11492. XHR.prototype.doWrite = function (data, fn) {
  11493. var isBinary = typeof data !== 'string' && data !== undefined;
  11494. var req = this.request({ method: 'POST', data: data, isBinary: isBinary });
  11495. var self = this;
  11496. req.on('success', fn);
  11497. req.on('error', function (err) {
  11498. self.onError('xhr post error', err);
  11499. });
  11500. this.sendXhr = req;
  11501. };
  11502. /**
  11503. * Starts a poll cycle.
  11504. *
  11505. * @api private
  11506. */
  11507. XHR.prototype.doPoll = function () {
  11508. debug('xhr poll');
  11509. var req = this.request();
  11510. var self = this;
  11511. req.on('data', function (data) {
  11512. self.onData(data);
  11513. });
  11514. req.on('error', function (err) {
  11515. self.onError('xhr poll error', err);
  11516. });
  11517. this.pollXhr = req;
  11518. };
  11519. /**
  11520. * Request constructor
  11521. *
  11522. * @param {Object} options
  11523. * @api public
  11524. */
  11525. function Request (opts) {
  11526. this.method = opts.method || 'GET';
  11527. this.uri = opts.uri;
  11528. this.xd = !!opts.xd;
  11529. this.xs = !!opts.xs;
  11530. this.async = false !== opts.async;
  11531. this.data = undefined !== opts.data ? opts.data : null;
  11532. this.agent = opts.agent;
  11533. this.isBinary = opts.isBinary;
  11534. this.supportsBinary = opts.supportsBinary;
  11535. this.enablesXDR = opts.enablesXDR;
  11536. this.withCredentials = opts.withCredentials;
  11537. this.requestTimeout = opts.requestTimeout;
  11538. // SSL options for Node.js client
  11539. this.pfx = opts.pfx;
  11540. this.key = opts.key;
  11541. this.passphrase = opts.passphrase;
  11542. this.cert = opts.cert;
  11543. this.ca = opts.ca;
  11544. this.ciphers = opts.ciphers;
  11545. this.rejectUnauthorized = opts.rejectUnauthorized;
  11546. // other options for Node.js client
  11547. this.extraHeaders = opts.extraHeaders;
  11548. this.create();
  11549. }
  11550. /**
  11551. * Mix in `Emitter`.
  11552. */
  11553. Emitter(Request.prototype);
  11554. /**
  11555. * Creates the XHR object and sends the request.
  11556. *
  11557. * @api private
  11558. */
  11559. Request.prototype.create = function () {
  11560. var opts = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };
  11561. // SSL options for Node.js client
  11562. opts.pfx = this.pfx;
  11563. opts.key = this.key;
  11564. opts.passphrase = this.passphrase;
  11565. opts.cert = this.cert;
  11566. opts.ca = this.ca;
  11567. opts.ciphers = this.ciphers;
  11568. opts.rejectUnauthorized = this.rejectUnauthorized;
  11569. var xhr = this.xhr = new XMLHttpRequest(opts);
  11570. var self = this;
  11571. try {
  11572. debug('xhr open %s: %s', this.method, this.uri);
  11573. xhr.open(this.method, this.uri, this.async);
  11574. try {
  11575. if (this.extraHeaders) {
  11576. xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);
  11577. for (var i in this.extraHeaders) {
  11578. if (this.extraHeaders.hasOwnProperty(i)) {
  11579. xhr.setRequestHeader(i, this.extraHeaders[i]);
  11580. }
  11581. }
  11582. }
  11583. } catch (e) {}
  11584. if ('POST' === this.method) {
  11585. try {
  11586. if (this.isBinary) {
  11587. xhr.setRequestHeader('Content-type', 'application/octet-stream');
  11588. } else {
  11589. xhr.setRequestHeader('Content-type', 'text/plain;charset=UTF-8');
  11590. }
  11591. } catch (e) {}
  11592. }
  11593. try {
  11594. xhr.setRequestHeader('Accept', '*/*');
  11595. } catch (e) {}
  11596. // ie6 check
  11597. if ('withCredentials' in xhr) {
  11598. xhr.withCredentials = this.withCredentials;
  11599. }
  11600. if (this.requestTimeout) {
  11601. xhr.timeout = this.requestTimeout;
  11602. }
  11603. if (this.hasXDR()) {
  11604. xhr.onload = function () {
  11605. self.onLoad();
  11606. };
  11607. xhr.onerror = function () {
  11608. self.onError(xhr.responseText);
  11609. };
  11610. } else {
  11611. xhr.onreadystatechange = function () {
  11612. if (xhr.readyState === 2) {
  11613. try {
  11614. var contentType = xhr.getResponseHeader('Content-Type');
  11615. if (self.supportsBinary && contentType === 'application/octet-stream' || contentType === 'application/octet-stream; charset=UTF-8') {
  11616. xhr.responseType = 'arraybuffer';
  11617. }
  11618. } catch (e) {}
  11619. }
  11620. if (4 !== xhr.readyState) return;
  11621. if (200 === xhr.status || 1223 === xhr.status) {
  11622. self.onLoad();
  11623. } else {
  11624. // make sure the `error` event handler that's user-set
  11625. // does not throw in the same tick and gets caught here
  11626. setTimeout(function () {
  11627. self.onError(typeof xhr.status === 'number' ? xhr.status : 0);
  11628. }, 0);
  11629. }
  11630. };
  11631. }
  11632. debug('xhr data %s', this.data);
  11633. xhr.send(this.data);
  11634. } catch (e) {
  11635. // Need to defer since .create() is called directly fhrom the constructor
  11636. // and thus the 'error' event can only be only bound *after* this exception
  11637. // occurs. Therefore, also, we cannot throw here at all.
  11638. setTimeout(function () {
  11639. self.onError(e);
  11640. }, 0);
  11641. return;
  11642. }
  11643. if (typeof document !== 'undefined') {
  11644. this.index = Request.requestsCount++;
  11645. Request.requests[this.index] = this;
  11646. }
  11647. };
  11648. /**
  11649. * Called upon successful response.
  11650. *
  11651. * @api private
  11652. */
  11653. Request.prototype.onSuccess = function () {
  11654. this.emit('success');
  11655. this.cleanup();
  11656. };
  11657. /**
  11658. * Called if we have data.
  11659. *
  11660. * @api private
  11661. */
  11662. Request.prototype.onData = function (data) {
  11663. this.emit('data', data);
  11664. this.onSuccess();
  11665. };
  11666. /**
  11667. * Called upon error.
  11668. *
  11669. * @api private
  11670. */
  11671. Request.prototype.onError = function (err) {
  11672. this.emit('error', err);
  11673. this.cleanup(true);
  11674. };
  11675. /**
  11676. * Cleans up house.
  11677. *
  11678. * @api private
  11679. */
  11680. Request.prototype.cleanup = function (fromError) {
  11681. if ('undefined' === typeof this.xhr || null === this.xhr) {
  11682. return;
  11683. }
  11684. // xmlhttprequest
  11685. if (this.hasXDR()) {
  11686. this.xhr.onload = this.xhr.onerror = empty;
  11687. } else {
  11688. this.xhr.onreadystatechange = empty;
  11689. }
  11690. if (fromError) {
  11691. try {
  11692. this.xhr.abort();
  11693. } catch (e) {}
  11694. }
  11695. if (typeof document !== 'undefined') {
  11696. delete Request.requests[this.index];
  11697. }
  11698. this.xhr = null;
  11699. };
  11700. /**
  11701. * Called upon load.
  11702. *
  11703. * @api private
  11704. */
  11705. Request.prototype.onLoad = function () {
  11706. var data;
  11707. try {
  11708. var contentType;
  11709. try {
  11710. contentType = this.xhr.getResponseHeader('Content-Type');
  11711. } catch (e) {}
  11712. if (contentType === 'application/octet-stream' || contentType === 'application/octet-stream; charset=UTF-8') {
  11713. data = this.xhr.response || this.xhr.responseText;
  11714. } else {
  11715. data = this.xhr.responseText;
  11716. }
  11717. } catch (e) {
  11718. this.onError(e);
  11719. }
  11720. if (null != data) {
  11721. this.onData(data);
  11722. }
  11723. };
  11724. /**
  11725. * Check if it has XDomainRequest.
  11726. *
  11727. * @api private
  11728. */
  11729. Request.prototype.hasXDR = function () {
  11730. return typeof XDomainRequest !== 'undefined' && !this.xs && this.enablesXDR;
  11731. };
  11732. /**
  11733. * Aborts the request.
  11734. *
  11735. * @api public
  11736. */
  11737. Request.prototype.abort = function () {
  11738. this.cleanup();
  11739. };
  11740. /**
  11741. * Aborts pending requests when unloading the window. This is needed to prevent
  11742. * memory leaks (e.g. when using IE) and to ensure that no spurious error is
  11743. * emitted.
  11744. */
  11745. Request.requestsCount = 0;
  11746. Request.requests = {};
  11747. if (typeof document !== 'undefined') {
  11748. if (typeof attachEvent === 'function') {
  11749. attachEvent('onunload', unloadHandler);
  11750. } else if (typeof addEventListener === 'function') {
  11751. var terminationEvent = 'onpagehide' in globalThis ? 'pagehide' : 'unload';
  11752. addEventListener(terminationEvent, unloadHandler, false);
  11753. }
  11754. }
  11755. function unloadHandler () {
  11756. for (var i in Request.requests) {
  11757. if (Request.requests.hasOwnProperty(i)) {
  11758. Request.requests[i].abort();
  11759. }
  11760. }
  11761. }
  11762. /***/ }),
  11763. /***/ "./node_modules/engine.io-client/lib/transports/polling.js":
  11764. /*!*****************************************************************!*\
  11765. !*** ./node_modules/engine.io-client/lib/transports/polling.js ***!
  11766. \*****************************************************************/
  11767. /*! no static exports found */
  11768. /***/ (function(module, exports, __webpack_require__) {
  11769. /**
  11770. * Module dependencies.
  11771. */
  11772. var Transport = __webpack_require__(/*! ../transport */ "./node_modules/engine.io-client/lib/transport.js");
  11773. var parseqs = __webpack_require__(/*! parseqs */ "./node_modules/parseqs/index.js");
  11774. var parser = __webpack_require__(/*! engine.io-parser */ "./node_modules/engine.io-parser/lib/browser.js");
  11775. var inherit = __webpack_require__(/*! component-inherit */ "./node_modules/component-inherit/index.js");
  11776. var yeast = __webpack_require__(/*! yeast */ "./node_modules/yeast/index.js");
  11777. var debug = __webpack_require__(/*! debug */ "./node_modules/engine.io-client/node_modules/debug/src/browser.js")('engine.io-client:polling');
  11778. /**
  11779. * Module exports.
  11780. */
  11781. module.exports = Polling;
  11782. /**
  11783. * Is XHR2 supported?
  11784. */
  11785. var hasXHR2 = (function () {
  11786. var XMLHttpRequest = __webpack_require__(/*! xmlhttprequest-ssl */ "./node_modules/engine.io-client/lib/xmlhttprequest.js");
  11787. var xhr = new XMLHttpRequest({ xdomain: false });
  11788. return null != xhr.responseType;
  11789. })();
  11790. /**
  11791. * Polling interface.
  11792. *
  11793. * @param {Object} opts
  11794. * @api private
  11795. */
  11796. function Polling (opts) {
  11797. var forceBase64 = (opts && opts.forceBase64);
  11798. if (!hasXHR2 || forceBase64) {
  11799. this.supportsBinary = false;
  11800. }
  11801. Transport.call(this, opts);
  11802. }
  11803. /**
  11804. * Inherits from Transport.
  11805. */
  11806. inherit(Polling, Transport);
  11807. /**
  11808. * Transport name.
  11809. */
  11810. Polling.prototype.name = 'polling';
  11811. /**
  11812. * Opens the socket (triggers polling). We write a PING message to determine
  11813. * when the transport is open.
  11814. *
  11815. * @api private
  11816. */
  11817. Polling.prototype.doOpen = function () {
  11818. this.poll();
  11819. };
  11820. /**
  11821. * Pauses polling.
  11822. *
  11823. * @param {Function} callback upon buffers are flushed and transport is paused
  11824. * @api private
  11825. */
  11826. Polling.prototype.pause = function (onPause) {
  11827. var self = this;
  11828. this.readyState = 'pausing';
  11829. function pause () {
  11830. debug('paused');
  11831. self.readyState = 'paused';
  11832. onPause();
  11833. }
  11834. if (this.polling || !this.writable) {
  11835. var total = 0;
  11836. if (this.polling) {
  11837. debug('we are currently polling - waiting to pause');
  11838. total++;
  11839. this.once('pollComplete', function () {
  11840. debug('pre-pause polling complete');
  11841. --total || pause();
  11842. });
  11843. }
  11844. if (!this.writable) {
  11845. debug('we are currently writing - waiting to pause');
  11846. total++;
  11847. this.once('drain', function () {
  11848. debug('pre-pause writing complete');
  11849. --total || pause();
  11850. });
  11851. }
  11852. } else {
  11853. pause();
  11854. }
  11855. };
  11856. /**
  11857. * Starts polling cycle.
  11858. *
  11859. * @api public
  11860. */
  11861. Polling.prototype.poll = function () {
  11862. debug('polling');
  11863. this.polling = true;
  11864. this.doPoll();
  11865. this.emit('poll');
  11866. };
  11867. /**
  11868. * Overloads onData to detect payloads.
  11869. *
  11870. * @api private
  11871. */
  11872. Polling.prototype.onData = function (data) {
  11873. var self = this;
  11874. debug('polling got data %s', data);
  11875. var callback = function (packet, index, total) {
  11876. // if its the first message we consider the transport open
  11877. if ('opening' === self.readyState) {
  11878. self.onOpen();
  11879. }
  11880. // if its a close packet, we close the ongoing requests
  11881. if ('close' === packet.type) {
  11882. self.onClose();
  11883. return false;
  11884. }
  11885. // otherwise bypass onData and handle the message
  11886. self.onPacket(packet);
  11887. };
  11888. // decode payload
  11889. parser.decodePayload(data, this.socket.binaryType, callback);
  11890. // if an event did not trigger closing
  11891. if ('closed' !== this.readyState) {
  11892. // if we got data we're not polling
  11893. this.polling = false;
  11894. this.emit('pollComplete');
  11895. if ('open' === this.readyState) {
  11896. this.poll();
  11897. } else {
  11898. debug('ignoring poll - transport state "%s"', this.readyState);
  11899. }
  11900. }
  11901. };
  11902. /**
  11903. * For polling, send a close packet.
  11904. *
  11905. * @api private
  11906. */
  11907. Polling.prototype.doClose = function () {
  11908. var self = this;
  11909. function close () {
  11910. debug('writing close packet');
  11911. self.write([{ type: 'close' }]);
  11912. }
  11913. if ('open' === this.readyState) {
  11914. debug('transport open - closing');
  11915. close();
  11916. } else {
  11917. // in case we're trying to close while
  11918. // handshaking is in progress (GH-164)
  11919. debug('transport not open - deferring close');
  11920. this.once('open', close);
  11921. }
  11922. };
  11923. /**
  11924. * Writes a packets payload.
  11925. *
  11926. * @param {Array} data packets
  11927. * @param {Function} drain callback
  11928. * @api private
  11929. */
  11930. Polling.prototype.write = function (packets) {
  11931. var self = this;
  11932. this.writable = false;
  11933. var callbackfn = function () {
  11934. self.writable = true;
  11935. self.emit('drain');
  11936. };
  11937. parser.encodePayload(packets, this.supportsBinary, function (data) {
  11938. self.doWrite(data, callbackfn);
  11939. });
  11940. };
  11941. /**
  11942. * Generates uri for connection.
  11943. *
  11944. * @api private
  11945. */
  11946. Polling.prototype.uri = function () {
  11947. var query = this.query || {};
  11948. var schema = this.secure ? 'https' : 'http';
  11949. var port = '';
  11950. // cache busting is forced
  11951. if (false !== this.timestampRequests) {
  11952. query[this.timestampParam] = yeast();
  11953. }
  11954. if (!this.supportsBinary && !query.sid) {
  11955. query.b64 = 1;
  11956. }
  11957. query = parseqs.encode(query);
  11958. // avoid port if default for schema
  11959. if (this.port && (('https' === schema && Number(this.port) !== 443) ||
  11960. ('http' === schema && Number(this.port) !== 80))) {
  11961. port = ':' + this.port;
  11962. }
  11963. // prepend ? to query
  11964. if (query.length) {
  11965. query = '?' + query;
  11966. }
  11967. var ipv6 = this.hostname.indexOf(':') !== -1;
  11968. return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;
  11969. };
  11970. /***/ }),
  11971. /***/ "./node_modules/engine.io-client/lib/transports/websocket.js":
  11972. /*!*******************************************************************!*\
  11973. !*** ./node_modules/engine.io-client/lib/transports/websocket.js ***!
  11974. \*******************************************************************/
  11975. /*! no static exports found */
  11976. /***/ (function(module, exports, __webpack_require__) {
  11977. /* WEBPACK VAR INJECTION */(function(Buffer) {/**
  11978. * Module dependencies.
  11979. */
  11980. var Transport = __webpack_require__(/*! ../transport */ "./node_modules/engine.io-client/lib/transport.js");
  11981. var parser = __webpack_require__(/*! engine.io-parser */ "./node_modules/engine.io-parser/lib/browser.js");
  11982. var parseqs = __webpack_require__(/*! parseqs */ "./node_modules/parseqs/index.js");
  11983. var inherit = __webpack_require__(/*! component-inherit */ "./node_modules/component-inherit/index.js");
  11984. var yeast = __webpack_require__(/*! yeast */ "./node_modules/yeast/index.js");
  11985. var debug = __webpack_require__(/*! debug */ "./node_modules/engine.io-client/node_modules/debug/src/browser.js")('engine.io-client:websocket');
  11986. var BrowserWebSocket, NodeWebSocket;
  11987. if (typeof WebSocket !== 'undefined') {
  11988. BrowserWebSocket = WebSocket;
  11989. } else if (typeof self !== 'undefined') {
  11990. BrowserWebSocket = self.WebSocket || self.MozWebSocket;
  11991. }
  11992. if (typeof window === 'undefined') {
  11993. try {
  11994. NodeWebSocket = __webpack_require__(/*! ws */ 1);
  11995. } catch (e) { }
  11996. }
  11997. /**
  11998. * Get either the `WebSocket` or `MozWebSocket` globals
  11999. * in the browser or try to resolve WebSocket-compatible
  12000. * interface exposed by `ws` for Node-like environment.
  12001. */
  12002. var WebSocketImpl = BrowserWebSocket || NodeWebSocket;
  12003. /**
  12004. * Module exports.
  12005. */
  12006. module.exports = WS;
  12007. /**
  12008. * WebSocket transport constructor.
  12009. *
  12010. * @api {Object} connection options
  12011. * @api public
  12012. */
  12013. function WS (opts) {
  12014. var forceBase64 = (opts && opts.forceBase64);
  12015. if (forceBase64) {
  12016. this.supportsBinary = false;
  12017. }
  12018. this.perMessageDeflate = opts.perMessageDeflate;
  12019. this.usingBrowserWebSocket = BrowserWebSocket && !opts.forceNode;
  12020. this.protocols = opts.protocols;
  12021. if (!this.usingBrowserWebSocket) {
  12022. WebSocketImpl = NodeWebSocket;
  12023. }
  12024. Transport.call(this, opts);
  12025. }
  12026. /**
  12027. * Inherits from Transport.
  12028. */
  12029. inherit(WS, Transport);
  12030. /**
  12031. * Transport name.
  12032. *
  12033. * @api public
  12034. */
  12035. WS.prototype.name = 'websocket';
  12036. /*
  12037. * WebSockets support binary
  12038. */
  12039. WS.prototype.supportsBinary = true;
  12040. /**
  12041. * Opens socket.
  12042. *
  12043. * @api private
  12044. */
  12045. WS.prototype.doOpen = function () {
  12046. if (!this.check()) {
  12047. // let probe timeout
  12048. return;
  12049. }
  12050. var uri = this.uri();
  12051. var protocols = this.protocols;
  12052. var opts = {
  12053. agent: this.agent,
  12054. perMessageDeflate: this.perMessageDeflate
  12055. };
  12056. // SSL options for Node.js client
  12057. opts.pfx = this.pfx;
  12058. opts.key = this.key;
  12059. opts.passphrase = this.passphrase;
  12060. opts.cert = this.cert;
  12061. opts.ca = this.ca;
  12062. opts.ciphers = this.ciphers;
  12063. opts.rejectUnauthorized = this.rejectUnauthorized;
  12064. if (this.extraHeaders) {
  12065. opts.headers = this.extraHeaders;
  12066. }
  12067. if (this.localAddress) {
  12068. opts.localAddress = this.localAddress;
  12069. }
  12070. try {
  12071. this.ws =
  12072. this.usingBrowserWebSocket && !this.isReactNative
  12073. ? protocols
  12074. ? new WebSocketImpl(uri, protocols)
  12075. : new WebSocketImpl(uri)
  12076. : new WebSocketImpl(uri, protocols, opts);
  12077. } catch (err) {
  12078. return this.emit('error', err);
  12079. }
  12080. if (this.ws.binaryType === undefined) {
  12081. this.supportsBinary = false;
  12082. }
  12083. if (this.ws.supports && this.ws.supports.binary) {
  12084. this.supportsBinary = true;
  12085. this.ws.binaryType = 'nodebuffer';
  12086. } else {
  12087. this.ws.binaryType = 'arraybuffer';
  12088. }
  12089. this.addEventListeners();
  12090. };
  12091. /**
  12092. * Adds event listeners to the socket
  12093. *
  12094. * @api private
  12095. */
  12096. WS.prototype.addEventListeners = function () {
  12097. var self = this;
  12098. this.ws.onopen = function () {
  12099. self.onOpen();
  12100. };
  12101. this.ws.onclose = function () {
  12102. self.onClose();
  12103. };
  12104. this.ws.onmessage = function (ev) {
  12105. self.onData(ev.data);
  12106. };
  12107. this.ws.onerror = function (e) {
  12108. self.onError('websocket error', e);
  12109. };
  12110. };
  12111. /**
  12112. * Writes data to socket.
  12113. *
  12114. * @param {Array} array of packets.
  12115. * @api private
  12116. */
  12117. WS.prototype.write = function (packets) {
  12118. var self = this;
  12119. this.writable = false;
  12120. // encodePacket efficient as it uses WS framing
  12121. // no need for encodePayload
  12122. var total = packets.length;
  12123. for (var i = 0, l = total; i < l; i++) {
  12124. (function (packet) {
  12125. parser.encodePacket(packet, self.supportsBinary, function (data) {
  12126. if (!self.usingBrowserWebSocket) {
  12127. // always create a new object (GH-437)
  12128. var opts = {};
  12129. if (packet.options) {
  12130. opts.compress = packet.options.compress;
  12131. }
  12132. if (self.perMessageDeflate) {
  12133. var len = 'string' === typeof data ? Buffer.byteLength(data) : data.length;
  12134. if (len < self.perMessageDeflate.threshold) {
  12135. opts.compress = false;
  12136. }
  12137. }
  12138. }
  12139. // Sometimes the websocket has already been closed but the browser didn't
  12140. // have a chance of informing us about it yet, in that case send will
  12141. // throw an error
  12142. try {
  12143. if (self.usingBrowserWebSocket) {
  12144. // TypeError is thrown when passing the second argument on Safari
  12145. self.ws.send(data);
  12146. } else {
  12147. self.ws.send(data, opts);
  12148. }
  12149. } catch (e) {
  12150. debug('websocket closed before onclose event');
  12151. }
  12152. --total || done();
  12153. });
  12154. })(packets[i]);
  12155. }
  12156. function done () {
  12157. self.emit('flush');
  12158. // fake drain
  12159. // defer to next tick to allow Socket to clear writeBuffer
  12160. setTimeout(function () {
  12161. self.writable = true;
  12162. self.emit('drain');
  12163. }, 0);
  12164. }
  12165. };
  12166. /**
  12167. * Called upon close
  12168. *
  12169. * @api private
  12170. */
  12171. WS.prototype.onClose = function () {
  12172. Transport.prototype.onClose.call(this);
  12173. };
  12174. /**
  12175. * Closes socket.
  12176. *
  12177. * @api private
  12178. */
  12179. WS.prototype.doClose = function () {
  12180. if (typeof this.ws !== 'undefined') {
  12181. this.ws.close();
  12182. }
  12183. };
  12184. /**
  12185. * Generates uri for connection.
  12186. *
  12187. * @api private
  12188. */
  12189. WS.prototype.uri = function () {
  12190. var query = this.query || {};
  12191. var schema = this.secure ? 'wss' : 'ws';
  12192. var port = '';
  12193. // avoid port if default for schema
  12194. if (this.port && (('wss' === schema && Number(this.port) !== 443) ||
  12195. ('ws' === schema && Number(this.port) !== 80))) {
  12196. port = ':' + this.port;
  12197. }
  12198. // append timestamp to URI
  12199. if (this.timestampRequests) {
  12200. query[this.timestampParam] = yeast();
  12201. }
  12202. // communicate binary support capabilities
  12203. if (!this.supportsBinary) {
  12204. query.b64 = 1;
  12205. }
  12206. query = parseqs.encode(query);
  12207. // prepend ? to query
  12208. if (query.length) {
  12209. query = '?' + query;
  12210. }
  12211. var ipv6 = this.hostname.indexOf(':') !== -1;
  12212. return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;
  12213. };
  12214. /**
  12215. * Feature detection for WebSocket.
  12216. *
  12217. * @return {Boolean} whether this transport is available.
  12218. * @api public
  12219. */
  12220. WS.prototype.check = function () {
  12221. return !!WebSocketImpl && !('__initialize' in WebSocketImpl && this.name === WS.prototype.name);
  12222. };
  12223. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../buffer/index.js */ "./node_modules/buffer/index.js").Buffer))
  12224. /***/ }),
  12225. /***/ "./node_modules/engine.io-client/lib/xmlhttprequest.js":
  12226. /*!*************************************************************!*\
  12227. !*** ./node_modules/engine.io-client/lib/xmlhttprequest.js ***!
  12228. \*************************************************************/
  12229. /*! no static exports found */
  12230. /***/ (function(module, exports, __webpack_require__) {
  12231. // browser shim for xmlhttprequest module
  12232. var hasCORS = __webpack_require__(/*! has-cors */ "./node_modules/has-cors/index.js");
  12233. var globalThis = __webpack_require__(/*! ./globalThis */ "./node_modules/engine.io-client/lib/globalThis.browser.js");
  12234. module.exports = function (opts) {
  12235. var xdomain = opts.xdomain;
  12236. // scheme must be same when usign XDomainRequest
  12237. // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx
  12238. var xscheme = opts.xscheme;
  12239. // XDomainRequest has a flow of not sending cookie, therefore it should be disabled as a default.
  12240. // https://github.com/Automattic/engine.io-client/pull/217
  12241. var enablesXDR = opts.enablesXDR;
  12242. // XMLHttpRequest can be disabled on IE
  12243. try {
  12244. if ('undefined' !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {
  12245. return new XMLHttpRequest();
  12246. }
  12247. } catch (e) { }
  12248. // Use XDomainRequest for IE8 if enablesXDR is true
  12249. // because loading bar keeps flashing when using jsonp-polling
  12250. // https://github.com/yujiosaka/socke.io-ie8-loading-example
  12251. try {
  12252. if ('undefined' !== typeof XDomainRequest && !xscheme && enablesXDR) {
  12253. return new XDomainRequest();
  12254. }
  12255. } catch (e) { }
  12256. if (!xdomain) {
  12257. try {
  12258. return new globalThis[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP');
  12259. } catch (e) { }
  12260. }
  12261. };
  12262. /***/ }),
  12263. /***/ "./node_modules/engine.io-client/node_modules/debug/src/browser.js":
  12264. /*!*************************************************************************!*\
  12265. !*** ./node_modules/engine.io-client/node_modules/debug/src/browser.js ***!
  12266. \*************************************************************************/
  12267. /*! no static exports found */
  12268. /***/ (function(module, exports, __webpack_require__) {
  12269. /* WEBPACK VAR INJECTION */(function(process) {/* eslint-env browser */
  12270. /**
  12271. * This is the web browser implementation of `debug()`.
  12272. */
  12273. exports.log = log;
  12274. exports.formatArgs = formatArgs;
  12275. exports.save = save;
  12276. exports.load = load;
  12277. exports.useColors = useColors;
  12278. exports.storage = localstorage();
  12279. /**
  12280. * Colors.
  12281. */
  12282. exports.colors = [
  12283. '#0000CC',
  12284. '#0000FF',
  12285. '#0033CC',
  12286. '#0033FF',
  12287. '#0066CC',
  12288. '#0066FF',
  12289. '#0099CC',
  12290. '#0099FF',
  12291. '#00CC00',
  12292. '#00CC33',
  12293. '#00CC66',
  12294. '#00CC99',
  12295. '#00CCCC',
  12296. '#00CCFF',
  12297. '#3300CC',
  12298. '#3300FF',
  12299. '#3333CC',
  12300. '#3333FF',
  12301. '#3366CC',
  12302. '#3366FF',
  12303. '#3399CC',
  12304. '#3399FF',
  12305. '#33CC00',
  12306. '#33CC33',
  12307. '#33CC66',
  12308. '#33CC99',
  12309. '#33CCCC',
  12310. '#33CCFF',
  12311. '#6600CC',
  12312. '#6600FF',
  12313. '#6633CC',
  12314. '#6633FF',
  12315. '#66CC00',
  12316. '#66CC33',
  12317. '#9900CC',
  12318. '#9900FF',
  12319. '#9933CC',
  12320. '#9933FF',
  12321. '#99CC00',
  12322. '#99CC33',
  12323. '#CC0000',
  12324. '#CC0033',
  12325. '#CC0066',
  12326. '#CC0099',
  12327. '#CC00CC',
  12328. '#CC00FF',
  12329. '#CC3300',
  12330. '#CC3333',
  12331. '#CC3366',
  12332. '#CC3399',
  12333. '#CC33CC',
  12334. '#CC33FF',
  12335. '#CC6600',
  12336. '#CC6633',
  12337. '#CC9900',
  12338. '#CC9933',
  12339. '#CCCC00',
  12340. '#CCCC33',
  12341. '#FF0000',
  12342. '#FF0033',
  12343. '#FF0066',
  12344. '#FF0099',
  12345. '#FF00CC',
  12346. '#FF00FF',
  12347. '#FF3300',
  12348. '#FF3333',
  12349. '#FF3366',
  12350. '#FF3399',
  12351. '#FF33CC',
  12352. '#FF33FF',
  12353. '#FF6600',
  12354. '#FF6633',
  12355. '#FF9900',
  12356. '#FF9933',
  12357. '#FFCC00',
  12358. '#FFCC33'
  12359. ];
  12360. /**
  12361. * Currently only WebKit-based Web Inspectors, Firefox >= v31,
  12362. * and the Firebug extension (any Firefox version) are known
  12363. * to support "%c" CSS customizations.
  12364. *
  12365. * TODO: add a `localStorage` variable to explicitly enable/disable colors
  12366. */
  12367. // eslint-disable-next-line complexity
  12368. function useColors() {
  12369. // NB: In an Electron preload script, document will be defined but not fully
  12370. // initialized. Since we know we're in Chrome, we'll just detect this case
  12371. // explicitly
  12372. if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
  12373. return true;
  12374. }
  12375. // Internet Explorer and Edge do not support colors.
  12376. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
  12377. return false;
  12378. }
  12379. // Is webkit? http://stackoverflow.com/a/16459606/376773
  12380. // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  12381. return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
  12382. // Is firebug? http://stackoverflow.com/a/398120/376773
  12383. (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
  12384. // Is firefox >= v31?
  12385. // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
  12386. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
  12387. // Double check webkit in userAgent just in case we are in a worker
  12388. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
  12389. }
  12390. /**
  12391. * Colorize log arguments if enabled.
  12392. *
  12393. * @api public
  12394. */
  12395. function formatArgs(args) {
  12396. args[0] = (this.useColors ? '%c' : '') +
  12397. this.namespace +
  12398. (this.useColors ? ' %c' : ' ') +
  12399. args[0] +
  12400. (this.useColors ? '%c ' : ' ') +
  12401. '+' + module.exports.humanize(this.diff);
  12402. if (!this.useColors) {
  12403. return;
  12404. }
  12405. const c = 'color: ' + this.color;
  12406. args.splice(1, 0, c, 'color: inherit');
  12407. // The final "%c" is somewhat tricky, because there could be other
  12408. // arguments passed either before or after the %c, so we need to
  12409. // figure out the correct index to insert the CSS into
  12410. let index = 0;
  12411. let lastC = 0;
  12412. args[0].replace(/%[a-zA-Z%]/g, match => {
  12413. if (match === '%%') {
  12414. return;
  12415. }
  12416. index++;
  12417. if (match === '%c') {
  12418. // We only are interested in the *last* %c
  12419. // (the user may have provided their own)
  12420. lastC = index;
  12421. }
  12422. });
  12423. args.splice(lastC, 0, c);
  12424. }
  12425. /**
  12426. * Invokes `console.log()` when available.
  12427. * No-op when `console.log` is not a "function".
  12428. *
  12429. * @api public
  12430. */
  12431. function log(...args) {
  12432. // This hackery is required for IE8/9, where
  12433. // the `console.log` function doesn't have 'apply'
  12434. return typeof console === 'object' &&
  12435. console.log &&
  12436. console.log(...args);
  12437. }
  12438. /**
  12439. * Save `namespaces`.
  12440. *
  12441. * @param {String} namespaces
  12442. * @api private
  12443. */
  12444. function save(namespaces) {
  12445. try {
  12446. if (namespaces) {
  12447. exports.storage.setItem('debug', namespaces);
  12448. } else {
  12449. exports.storage.removeItem('debug');
  12450. }
  12451. } catch (error) {
  12452. // Swallow
  12453. // XXX (@Qix-) should we be logging these?
  12454. }
  12455. }
  12456. /**
  12457. * Load `namespaces`.
  12458. *
  12459. * @return {String} returns the previously persisted debug modes
  12460. * @api private
  12461. */
  12462. function load() {
  12463. let r;
  12464. try {
  12465. r = exports.storage.getItem('debug');
  12466. } catch (error) {
  12467. // Swallow
  12468. // XXX (@Qix-) should we be logging these?
  12469. }
  12470. // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  12471. if (!r && typeof process !== 'undefined' && 'env' in process) {
  12472. r = process.env.DEBUG;
  12473. }
  12474. return r;
  12475. }
  12476. /**
  12477. * Localstorage attempts to return the localstorage.
  12478. *
  12479. * This is necessary because safari throws
  12480. * when a user disables cookies/localstorage
  12481. * and you attempt to access it.
  12482. *
  12483. * @return {LocalStorage}
  12484. * @api private
  12485. */
  12486. function localstorage() {
  12487. try {
  12488. // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
  12489. // The Browser also has localStorage in the global context.
  12490. return localStorage;
  12491. } catch (error) {
  12492. // Swallow
  12493. // XXX (@Qix-) should we be logging these?
  12494. }
  12495. }
  12496. module.exports = __webpack_require__(/*! ./common */ "./node_modules/engine.io-client/node_modules/debug/src/common.js")(exports);
  12497. const {formatters} = module.exports;
  12498. /**
  12499. * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
  12500. */
  12501. formatters.j = function (v) {
  12502. try {
  12503. return JSON.stringify(v);
  12504. } catch (error) {
  12505. return '[UnexpectedJSONParseError]: ' + error.message;
  12506. }
  12507. };
  12508. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ "./node_modules/process/browser.js")))
  12509. /***/ }),
  12510. /***/ "./node_modules/engine.io-client/node_modules/debug/src/common.js":
  12511. /*!************************************************************************!*\
  12512. !*** ./node_modules/engine.io-client/node_modules/debug/src/common.js ***!
  12513. \************************************************************************/
  12514. /*! no static exports found */
  12515. /***/ (function(module, exports, __webpack_require__) {
  12516. /**
  12517. * This is the common logic for both the Node.js and web browser
  12518. * implementations of `debug()`.
  12519. */
  12520. function setup(env) {
  12521. createDebug.debug = createDebug;
  12522. createDebug.default = createDebug;
  12523. createDebug.coerce = coerce;
  12524. createDebug.disable = disable;
  12525. createDebug.enable = enable;
  12526. createDebug.enabled = enabled;
  12527. createDebug.humanize = __webpack_require__(/*! ms */ "./node_modules/engine.io-client/node_modules/ms/index.js");
  12528. Object.keys(env).forEach(key => {
  12529. createDebug[key] = env[key];
  12530. });
  12531. /**
  12532. * Active `debug` instances.
  12533. */
  12534. createDebug.instances = [];
  12535. /**
  12536. * The currently active debug mode names, and names to skip.
  12537. */
  12538. createDebug.names = [];
  12539. createDebug.skips = [];
  12540. /**
  12541. * Map of special "%n" handling functions, for the debug "format" argument.
  12542. *
  12543. * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
  12544. */
  12545. createDebug.formatters = {};
  12546. /**
  12547. * Selects a color for a debug namespace
  12548. * @param {String} namespace The namespace string for the for the debug instance to be colored
  12549. * @return {Number|String} An ANSI color code for the given namespace
  12550. * @api private
  12551. */
  12552. function selectColor(namespace) {
  12553. let hash = 0;
  12554. for (let i = 0; i < namespace.length; i++) {
  12555. hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
  12556. hash |= 0; // Convert to 32bit integer
  12557. }
  12558. return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
  12559. }
  12560. createDebug.selectColor = selectColor;
  12561. /**
  12562. * Create a debugger with the given `namespace`.
  12563. *
  12564. * @param {String} namespace
  12565. * @return {Function}
  12566. * @api public
  12567. */
  12568. function createDebug(namespace) {
  12569. let prevTime;
  12570. function debug(...args) {
  12571. // Disabled?
  12572. if (!debug.enabled) {
  12573. return;
  12574. }
  12575. const self = debug;
  12576. // Set `diff` timestamp
  12577. const curr = Number(new Date());
  12578. const ms = curr - (prevTime || curr);
  12579. self.diff = ms;
  12580. self.prev = prevTime;
  12581. self.curr = curr;
  12582. prevTime = curr;
  12583. args[0] = createDebug.coerce(args[0]);
  12584. if (typeof args[0] !== 'string') {
  12585. // Anything else let's inspect with %O
  12586. args.unshift('%O');
  12587. }
  12588. // Apply any `formatters` transformations
  12589. let index = 0;
  12590. args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
  12591. // If we encounter an escaped % then don't increase the array index
  12592. if (match === '%%') {
  12593. return match;
  12594. }
  12595. index++;
  12596. const formatter = createDebug.formatters[format];
  12597. if (typeof formatter === 'function') {
  12598. const val = args[index];
  12599. match = formatter.call(self, val);
  12600. // Now we need to remove `args[index]` since it's inlined in the `format`
  12601. args.splice(index, 1);
  12602. index--;
  12603. }
  12604. return match;
  12605. });
  12606. // Apply env-specific formatting (colors, etc.)
  12607. createDebug.formatArgs.call(self, args);
  12608. const logFn = self.log || createDebug.log;
  12609. logFn.apply(self, args);
  12610. }
  12611. debug.namespace = namespace;
  12612. debug.enabled = createDebug.enabled(namespace);
  12613. debug.useColors = createDebug.useColors();
  12614. debug.color = selectColor(namespace);
  12615. debug.destroy = destroy;
  12616. debug.extend = extend;
  12617. // Debug.formatArgs = formatArgs;
  12618. // debug.rawLog = rawLog;
  12619. // env-specific initialization logic for debug instances
  12620. if (typeof createDebug.init === 'function') {
  12621. createDebug.init(debug);
  12622. }
  12623. createDebug.instances.push(debug);
  12624. return debug;
  12625. }
  12626. function destroy() {
  12627. const index = createDebug.instances.indexOf(this);
  12628. if (index !== -1) {
  12629. createDebug.instances.splice(index, 1);
  12630. return true;
  12631. }
  12632. return false;
  12633. }
  12634. function extend(namespace, delimiter) {
  12635. const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
  12636. newDebug.log = this.log;
  12637. return newDebug;
  12638. }
  12639. /**
  12640. * Enables a debug mode by namespaces. This can include modes
  12641. * separated by a colon and wildcards.
  12642. *
  12643. * @param {String} namespaces
  12644. * @api public
  12645. */
  12646. function enable(namespaces) {
  12647. createDebug.save(namespaces);
  12648. createDebug.names = [];
  12649. createDebug.skips = [];
  12650. let i;
  12651. const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
  12652. const len = split.length;
  12653. for (i = 0; i < len; i++) {
  12654. if (!split[i]) {
  12655. // ignore empty strings
  12656. continue;
  12657. }
  12658. namespaces = split[i].replace(/\*/g, '.*?');
  12659. if (namespaces[0] === '-') {
  12660. createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
  12661. } else {
  12662. createDebug.names.push(new RegExp('^' + namespaces + '$'));
  12663. }
  12664. }
  12665. for (i = 0; i < createDebug.instances.length; i++) {
  12666. const instance = createDebug.instances[i];
  12667. instance.enabled = createDebug.enabled(instance.namespace);
  12668. }
  12669. }
  12670. /**
  12671. * Disable debug output.
  12672. *
  12673. * @return {String} namespaces
  12674. * @api public
  12675. */
  12676. function disable() {
  12677. const namespaces = [
  12678. ...createDebug.names.map(toNamespace),
  12679. ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
  12680. ].join(',');
  12681. createDebug.enable('');
  12682. return namespaces;
  12683. }
  12684. /**
  12685. * Returns true if the given mode name is enabled, false otherwise.
  12686. *
  12687. * @param {String} name
  12688. * @return {Boolean}
  12689. * @api public
  12690. */
  12691. function enabled(name) {
  12692. if (name[name.length - 1] === '*') {
  12693. return true;
  12694. }
  12695. let i;
  12696. let len;
  12697. for (i = 0, len = createDebug.skips.length; i < len; i++) {
  12698. if (createDebug.skips[i].test(name)) {
  12699. return false;
  12700. }
  12701. }
  12702. for (i = 0, len = createDebug.names.length; i < len; i++) {
  12703. if (createDebug.names[i].test(name)) {
  12704. return true;
  12705. }
  12706. }
  12707. return false;
  12708. }
  12709. /**
  12710. * Convert regexp to namespace
  12711. *
  12712. * @param {RegExp} regxep
  12713. * @return {String} namespace
  12714. * @api private
  12715. */
  12716. function toNamespace(regexp) {
  12717. return regexp.toString()
  12718. .substring(2, regexp.toString().length - 2)
  12719. .replace(/\.\*\?$/, '*');
  12720. }
  12721. /**
  12722. * Coerce `val`.
  12723. *
  12724. * @param {Mixed} val
  12725. * @return {Mixed}
  12726. * @api private
  12727. */
  12728. function coerce(val) {
  12729. if (val instanceof Error) {
  12730. return val.stack || val.message;
  12731. }
  12732. return val;
  12733. }
  12734. createDebug.enable(createDebug.load());
  12735. return createDebug;
  12736. }
  12737. module.exports = setup;
  12738. /***/ }),
  12739. /***/ "./node_modules/engine.io-client/node_modules/ms/index.js":
  12740. /*!****************************************************************!*\
  12741. !*** ./node_modules/engine.io-client/node_modules/ms/index.js ***!
  12742. \****************************************************************/
  12743. /*! no static exports found */
  12744. /***/ (function(module, exports) {
  12745. /**
  12746. * Helpers.
  12747. */
  12748. var s = 1000;
  12749. var m = s * 60;
  12750. var h = m * 60;
  12751. var d = h * 24;
  12752. var w = d * 7;
  12753. var y = d * 365.25;
  12754. /**
  12755. * Parse or format the given `val`.
  12756. *
  12757. * Options:
  12758. *
  12759. * - `long` verbose formatting [false]
  12760. *
  12761. * @param {String|Number} val
  12762. * @param {Object} [options]
  12763. * @throws {Error} throw an error if val is not a non-empty string or a number
  12764. * @return {String|Number}
  12765. * @api public
  12766. */
  12767. module.exports = function(val, options) {
  12768. options = options || {};
  12769. var type = typeof val;
  12770. if (type === 'string' && val.length > 0) {
  12771. return parse(val);
  12772. } else if (type === 'number' && isFinite(val)) {
  12773. return options.long ? fmtLong(val) : fmtShort(val);
  12774. }
  12775. throw new Error(
  12776. 'val is not a non-empty string or a valid number. val=' +
  12777. JSON.stringify(val)
  12778. );
  12779. };
  12780. /**
  12781. * Parse the given `str` and return milliseconds.
  12782. *
  12783. * @param {String} str
  12784. * @return {Number}
  12785. * @api private
  12786. */
  12787. function parse(str) {
  12788. str = String(str);
  12789. if (str.length > 100) {
  12790. return;
  12791. }
  12792. var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
  12793. str
  12794. );
  12795. if (!match) {
  12796. return;
  12797. }
  12798. var n = parseFloat(match[1]);
  12799. var type = (match[2] || 'ms').toLowerCase();
  12800. switch (type) {
  12801. case 'years':
  12802. case 'year':
  12803. case 'yrs':
  12804. case 'yr':
  12805. case 'y':
  12806. return n * y;
  12807. case 'weeks':
  12808. case 'week':
  12809. case 'w':
  12810. return n * w;
  12811. case 'days':
  12812. case 'day':
  12813. case 'd':
  12814. return n * d;
  12815. case 'hours':
  12816. case 'hour':
  12817. case 'hrs':
  12818. case 'hr':
  12819. case 'h':
  12820. return n * h;
  12821. case 'minutes':
  12822. case 'minute':
  12823. case 'mins':
  12824. case 'min':
  12825. case 'm':
  12826. return n * m;
  12827. case 'seconds':
  12828. case 'second':
  12829. case 'secs':
  12830. case 'sec':
  12831. case 's':
  12832. return n * s;
  12833. case 'milliseconds':
  12834. case 'millisecond':
  12835. case 'msecs':
  12836. case 'msec':
  12837. case 'ms':
  12838. return n;
  12839. default:
  12840. return undefined;
  12841. }
  12842. }
  12843. /**
  12844. * Short format for `ms`.
  12845. *
  12846. * @param {Number} ms
  12847. * @return {String}
  12848. * @api private
  12849. */
  12850. function fmtShort(ms) {
  12851. var msAbs = Math.abs(ms);
  12852. if (msAbs >= d) {
  12853. return Math.round(ms / d) + 'd';
  12854. }
  12855. if (msAbs >= h) {
  12856. return Math.round(ms / h) + 'h';
  12857. }
  12858. if (msAbs >= m) {
  12859. return Math.round(ms / m) + 'm';
  12860. }
  12861. if (msAbs >= s) {
  12862. return Math.round(ms / s) + 's';
  12863. }
  12864. return ms + 'ms';
  12865. }
  12866. /**
  12867. * Long format for `ms`.
  12868. *
  12869. * @param {Number} ms
  12870. * @return {String}
  12871. * @api private
  12872. */
  12873. function fmtLong(ms) {
  12874. var msAbs = Math.abs(ms);
  12875. if (msAbs >= d) {
  12876. return plural(ms, msAbs, d, 'day');
  12877. }
  12878. if (msAbs >= h) {
  12879. return plural(ms, msAbs, h, 'hour');
  12880. }
  12881. if (msAbs >= m) {
  12882. return plural(ms, msAbs, m, 'minute');
  12883. }
  12884. if (msAbs >= s) {
  12885. return plural(ms, msAbs, s, 'second');
  12886. }
  12887. return ms + ' ms';
  12888. }
  12889. /**
  12890. * Pluralization helper.
  12891. */
  12892. function plural(ms, msAbs, n, name) {
  12893. var isPlural = msAbs >= n * 1.5;
  12894. return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
  12895. }
  12896. /***/ }),
  12897. /***/ "./node_modules/engine.io-parser/lib/browser.js":
  12898. /*!******************************************************!*\
  12899. !*** ./node_modules/engine.io-parser/lib/browser.js ***!
  12900. \******************************************************/
  12901. /*! no static exports found */
  12902. /***/ (function(module, exports, __webpack_require__) {
  12903. /**
  12904. * Module dependencies.
  12905. */
  12906. var keys = __webpack_require__(/*! ./keys */ "./node_modules/engine.io-parser/lib/keys.js");
  12907. var hasBinary = __webpack_require__(/*! has-binary2 */ "./node_modules/has-binary2/index.js");
  12908. var sliceBuffer = __webpack_require__(/*! arraybuffer.slice */ "./node_modules/arraybuffer.slice/index.js");
  12909. var after = __webpack_require__(/*! after */ "./node_modules/after/index.js");
  12910. var utf8 = __webpack_require__(/*! ./utf8 */ "./node_modules/engine.io-parser/lib/utf8.js");
  12911. var base64encoder;
  12912. if (typeof ArrayBuffer !== 'undefined') {
  12913. base64encoder = __webpack_require__(/*! base64-arraybuffer */ "./node_modules/base64-arraybuffer/lib/base64-arraybuffer.js");
  12914. }
  12915. /**
  12916. * Check if we are running an android browser. That requires us to use
  12917. * ArrayBuffer with polling transports...
  12918. *
  12919. * http://ghinda.net/jpeg-blob-ajax-android/
  12920. */
  12921. var isAndroid = typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent);
  12922. /**
  12923. * Check if we are running in PhantomJS.
  12924. * Uploading a Blob with PhantomJS does not work correctly, as reported here:
  12925. * https://github.com/ariya/phantomjs/issues/11395
  12926. * @type boolean
  12927. */
  12928. var isPhantomJS = typeof navigator !== 'undefined' && /PhantomJS/i.test(navigator.userAgent);
  12929. /**
  12930. * When true, avoids using Blobs to encode payloads.
  12931. * @type boolean
  12932. */
  12933. var dontSendBlobs = isAndroid || isPhantomJS;
  12934. /**
  12935. * Current protocol version.
  12936. */
  12937. exports.protocol = 3;
  12938. /**
  12939. * Packet types.
  12940. */
  12941. var packets = exports.packets = {
  12942. open: 0 // non-ws
  12943. , close: 1 // non-ws
  12944. , ping: 2
  12945. , pong: 3
  12946. , message: 4
  12947. , upgrade: 5
  12948. , noop: 6
  12949. };
  12950. var packetslist = keys(packets);
  12951. /**
  12952. * Premade error packet.
  12953. */
  12954. var err = { type: 'error', data: 'parser error' };
  12955. /**
  12956. * Create a blob api even for blob builder when vendor prefixes exist
  12957. */
  12958. var Blob = __webpack_require__(/*! blob */ "./node_modules/blob/index.js");
  12959. /**
  12960. * Encodes a packet.
  12961. *
  12962. * <packet type id> [ <data> ]
  12963. *
  12964. * Example:
  12965. *
  12966. * 5hello world
  12967. * 3
  12968. * 4
  12969. *
  12970. * Binary is encoded in an identical principle
  12971. *
  12972. * @api private
  12973. */
  12974. exports.encodePacket = function (packet, supportsBinary, utf8encode, callback) {
  12975. if (typeof supportsBinary === 'function') {
  12976. callback = supportsBinary;
  12977. supportsBinary = false;
  12978. }
  12979. if (typeof utf8encode === 'function') {
  12980. callback = utf8encode;
  12981. utf8encode = null;
  12982. }
  12983. var data = (packet.data === undefined)
  12984. ? undefined
  12985. : packet.data.buffer || packet.data;
  12986. if (typeof ArrayBuffer !== 'undefined' && data instanceof ArrayBuffer) {
  12987. return encodeArrayBuffer(packet, supportsBinary, callback);
  12988. } else if (typeof Blob !== 'undefined' && data instanceof Blob) {
  12989. return encodeBlob(packet, supportsBinary, callback);
  12990. }
  12991. // might be an object with { base64: true, data: dataAsBase64String }
  12992. if (data && data.base64) {
  12993. return encodeBase64Object(packet, callback);
  12994. }
  12995. // Sending data as a utf-8 string
  12996. var encoded = packets[packet.type];
  12997. // data fragment is optional
  12998. if (undefined !== packet.data) {
  12999. encoded += utf8encode ? utf8.encode(String(packet.data), { strict: false }) : String(packet.data);
  13000. }
  13001. return callback('' + encoded);
  13002. };
  13003. function encodeBase64Object(packet, callback) {
  13004. // packet data is an object { base64: true, data: dataAsBase64String }
  13005. var message = 'b' + exports.packets[packet.type] + packet.data.data;
  13006. return callback(message);
  13007. }
  13008. /**
  13009. * Encode packet helpers for binary types
  13010. */
  13011. function encodeArrayBuffer(packet, supportsBinary, callback) {
  13012. if (!supportsBinary) {
  13013. return exports.encodeBase64Packet(packet, callback);
  13014. }
  13015. var data = packet.data;
  13016. var contentArray = new Uint8Array(data);
  13017. var resultBuffer = new Uint8Array(1 + data.byteLength);
  13018. resultBuffer[0] = packets[packet.type];
  13019. for (var i = 0; i < contentArray.length; i++) {
  13020. resultBuffer[i+1] = contentArray[i];
  13021. }
  13022. return callback(resultBuffer.buffer);
  13023. }
  13024. function encodeBlobAsArrayBuffer(packet, supportsBinary, callback) {
  13025. if (!supportsBinary) {
  13026. return exports.encodeBase64Packet(packet, callback);
  13027. }
  13028. var fr = new FileReader();
  13029. fr.onload = function() {
  13030. exports.encodePacket({ type: packet.type, data: fr.result }, supportsBinary, true, callback);
  13031. };
  13032. return fr.readAsArrayBuffer(packet.data);
  13033. }
  13034. function encodeBlob(packet, supportsBinary, callback) {
  13035. if (!supportsBinary) {
  13036. return exports.encodeBase64Packet(packet, callback);
  13037. }
  13038. if (dontSendBlobs) {
  13039. return encodeBlobAsArrayBuffer(packet, supportsBinary, callback);
  13040. }
  13041. var length = new Uint8Array(1);
  13042. length[0] = packets[packet.type];
  13043. var blob = new Blob([length.buffer, packet.data]);
  13044. return callback(blob);
  13045. }
  13046. /**
  13047. * Encodes a packet with binary data in a base64 string
  13048. *
  13049. * @param {Object} packet, has `type` and `data`
  13050. * @return {String} base64 encoded message
  13051. */
  13052. exports.encodeBase64Packet = function(packet, callback) {
  13053. var message = 'b' + exports.packets[packet.type];
  13054. if (typeof Blob !== 'undefined' && packet.data instanceof Blob) {
  13055. var fr = new FileReader();
  13056. fr.onload = function() {
  13057. var b64 = fr.result.split(',')[1];
  13058. callback(message + b64);
  13059. };
  13060. return fr.readAsDataURL(packet.data);
  13061. }
  13062. var b64data;
  13063. try {
  13064. b64data = String.fromCharCode.apply(null, new Uint8Array(packet.data));
  13065. } catch (e) {
  13066. // iPhone Safari doesn't let you apply with typed arrays
  13067. var typed = new Uint8Array(packet.data);
  13068. var basic = new Array(typed.length);
  13069. for (var i = 0; i < typed.length; i++) {
  13070. basic[i] = typed[i];
  13071. }
  13072. b64data = String.fromCharCode.apply(null, basic);
  13073. }
  13074. message += btoa(b64data);
  13075. return callback(message);
  13076. };
  13077. /**
  13078. * Decodes a packet. Changes format to Blob if requested.
  13079. *
  13080. * @return {Object} with `type` and `data` (if any)
  13081. * @api private
  13082. */
  13083. exports.decodePacket = function (data, binaryType, utf8decode) {
  13084. if (data === undefined) {
  13085. return err;
  13086. }
  13087. // String data
  13088. if (typeof data === 'string') {
  13089. if (data.charAt(0) === 'b') {
  13090. return exports.decodeBase64Packet(data.substr(1), binaryType);
  13091. }
  13092. if (utf8decode) {
  13093. data = tryDecode(data);
  13094. if (data === false) {
  13095. return err;
  13096. }
  13097. }
  13098. var type = data.charAt(0);
  13099. if (Number(type) != type || !packetslist[type]) {
  13100. return err;
  13101. }
  13102. if (data.length > 1) {
  13103. return { type: packetslist[type], data: data.substring(1) };
  13104. } else {
  13105. return { type: packetslist[type] };
  13106. }
  13107. }
  13108. var asArray = new Uint8Array(data);
  13109. var type = asArray[0];
  13110. var rest = sliceBuffer(data, 1);
  13111. if (Blob && binaryType === 'blob') {
  13112. rest = new Blob([rest]);
  13113. }
  13114. return { type: packetslist[type], data: rest };
  13115. };
  13116. function tryDecode(data) {
  13117. try {
  13118. data = utf8.decode(data, { strict: false });
  13119. } catch (e) {
  13120. return false;
  13121. }
  13122. return data;
  13123. }
  13124. /**
  13125. * Decodes a packet encoded in a base64 string
  13126. *
  13127. * @param {String} base64 encoded message
  13128. * @return {Object} with `type` and `data` (if any)
  13129. */
  13130. exports.decodeBase64Packet = function(msg, binaryType) {
  13131. var type = packetslist[msg.charAt(0)];
  13132. if (!base64encoder) {
  13133. return { type: type, data: { base64: true, data: msg.substr(1) } };
  13134. }
  13135. var data = base64encoder.decode(msg.substr(1));
  13136. if (binaryType === 'blob' && Blob) {
  13137. data = new Blob([data]);
  13138. }
  13139. return { type: type, data: data };
  13140. };
  13141. /**
  13142. * Encodes multiple messages (payload).
  13143. *
  13144. * <length>:data
  13145. *
  13146. * Example:
  13147. *
  13148. * 11:hello world2:hi
  13149. *
  13150. * If any contents are binary, they will be encoded as base64 strings. Base64
  13151. * encoded strings are marked with a b before the length specifier
  13152. *
  13153. * @param {Array} packets
  13154. * @api private
  13155. */
  13156. exports.encodePayload = function (packets, supportsBinary, callback) {
  13157. if (typeof supportsBinary === 'function') {
  13158. callback = supportsBinary;
  13159. supportsBinary = null;
  13160. }
  13161. var isBinary = hasBinary(packets);
  13162. if (supportsBinary && isBinary) {
  13163. if (Blob && !dontSendBlobs) {
  13164. return exports.encodePayloadAsBlob(packets, callback);
  13165. }
  13166. return exports.encodePayloadAsArrayBuffer(packets, callback);
  13167. }
  13168. if (!packets.length) {
  13169. return callback('0:');
  13170. }
  13171. function setLengthHeader(message) {
  13172. return message.length + ':' + message;
  13173. }
  13174. function encodeOne(packet, doneCallback) {
  13175. exports.encodePacket(packet, !isBinary ? false : supportsBinary, false, function(message) {
  13176. doneCallback(null, setLengthHeader(message));
  13177. });
  13178. }
  13179. map(packets, encodeOne, function(err, results) {
  13180. return callback(results.join(''));
  13181. });
  13182. };
  13183. /**
  13184. * Async array map using after
  13185. */
  13186. function map(ary, each, done) {
  13187. var result = new Array(ary.length);
  13188. var next = after(ary.length, done);
  13189. var eachWithIndex = function(i, el, cb) {
  13190. each(el, function(error, msg) {
  13191. result[i] = msg;
  13192. cb(error, result);
  13193. });
  13194. };
  13195. for (var i = 0; i < ary.length; i++) {
  13196. eachWithIndex(i, ary[i], next);
  13197. }
  13198. }
  13199. /*
  13200. * Decodes data when a payload is maybe expected. Possible binary contents are
  13201. * decoded from their base64 representation
  13202. *
  13203. * @param {String} data, callback method
  13204. * @api public
  13205. */
  13206. exports.decodePayload = function (data, binaryType, callback) {
  13207. if (typeof data !== 'string') {
  13208. return exports.decodePayloadAsBinary(data, binaryType, callback);
  13209. }
  13210. if (typeof binaryType === 'function') {
  13211. callback = binaryType;
  13212. binaryType = null;
  13213. }
  13214. var packet;
  13215. if (data === '') {
  13216. // parser error - ignoring payload
  13217. return callback(err, 0, 1);
  13218. }
  13219. var length = '', n, msg;
  13220. for (var i = 0, l = data.length; i < l; i++) {
  13221. var chr = data.charAt(i);
  13222. if (chr !== ':') {
  13223. length += chr;
  13224. continue;
  13225. }
  13226. if (length === '' || (length != (n = Number(length)))) {
  13227. // parser error - ignoring payload
  13228. return callback(err, 0, 1);
  13229. }
  13230. msg = data.substr(i + 1, n);
  13231. if (length != msg.length) {
  13232. // parser error - ignoring payload
  13233. return callback(err, 0, 1);
  13234. }
  13235. if (msg.length) {
  13236. packet = exports.decodePacket(msg, binaryType, false);
  13237. if (err.type === packet.type && err.data === packet.data) {
  13238. // parser error in individual packet - ignoring payload
  13239. return callback(err, 0, 1);
  13240. }
  13241. var ret = callback(packet, i + n, l);
  13242. if (false === ret) return;
  13243. }
  13244. // advance cursor
  13245. i += n;
  13246. length = '';
  13247. }
  13248. if (length !== '') {
  13249. // parser error - ignoring payload
  13250. return callback(err, 0, 1);
  13251. }
  13252. };
  13253. /**
  13254. * Encodes multiple messages (payload) as binary.
  13255. *
  13256. * <1 = binary, 0 = string><number from 0-9><number from 0-9>[...]<number
  13257. * 255><data>
  13258. *
  13259. * Example:
  13260. * 1 3 255 1 2 3, if the binary contents are interpreted as 8 bit integers
  13261. *
  13262. * @param {Array} packets
  13263. * @return {ArrayBuffer} encoded payload
  13264. * @api private
  13265. */
  13266. exports.encodePayloadAsArrayBuffer = function(packets, callback) {
  13267. if (!packets.length) {
  13268. return callback(new ArrayBuffer(0));
  13269. }
  13270. function encodeOne(packet, doneCallback) {
  13271. exports.encodePacket(packet, true, true, function(data) {
  13272. return doneCallback(null, data);
  13273. });
  13274. }
  13275. map(packets, encodeOne, function(err, encodedPackets) {
  13276. var totalLength = encodedPackets.reduce(function(acc, p) {
  13277. var len;
  13278. if (typeof p === 'string'){
  13279. len = p.length;
  13280. } else {
  13281. len = p.byteLength;
  13282. }
  13283. return acc + len.toString().length + len + 2; // string/binary identifier + separator = 2
  13284. }, 0);
  13285. var resultArray = new Uint8Array(totalLength);
  13286. var bufferIndex = 0;
  13287. encodedPackets.forEach(function(p) {
  13288. var isString = typeof p === 'string';
  13289. var ab = p;
  13290. if (isString) {
  13291. var view = new Uint8Array(p.length);
  13292. for (var i = 0; i < p.length; i++) {
  13293. view[i] = p.charCodeAt(i);
  13294. }
  13295. ab = view.buffer;
  13296. }
  13297. if (isString) { // not true binary
  13298. resultArray[bufferIndex++] = 0;
  13299. } else { // true binary
  13300. resultArray[bufferIndex++] = 1;
  13301. }
  13302. var lenStr = ab.byteLength.toString();
  13303. for (var i = 0; i < lenStr.length; i++) {
  13304. resultArray[bufferIndex++] = parseInt(lenStr[i]);
  13305. }
  13306. resultArray[bufferIndex++] = 255;
  13307. var view = new Uint8Array(ab);
  13308. for (var i = 0; i < view.length; i++) {
  13309. resultArray[bufferIndex++] = view[i];
  13310. }
  13311. });
  13312. return callback(resultArray.buffer);
  13313. });
  13314. };
  13315. /**
  13316. * Encode as Blob
  13317. */
  13318. exports.encodePayloadAsBlob = function(packets, callback) {
  13319. function encodeOne(packet, doneCallback) {
  13320. exports.encodePacket(packet, true, true, function(encoded) {
  13321. var binaryIdentifier = new Uint8Array(1);
  13322. binaryIdentifier[0] = 1;
  13323. if (typeof encoded === 'string') {
  13324. var view = new Uint8Array(encoded.length);
  13325. for (var i = 0; i < encoded.length; i++) {
  13326. view[i] = encoded.charCodeAt(i);
  13327. }
  13328. encoded = view.buffer;
  13329. binaryIdentifier[0] = 0;
  13330. }
  13331. var len = (encoded instanceof ArrayBuffer)
  13332. ? encoded.byteLength
  13333. : encoded.size;
  13334. var lenStr = len.toString();
  13335. var lengthAry = new Uint8Array(lenStr.length + 1);
  13336. for (var i = 0; i < lenStr.length; i++) {
  13337. lengthAry[i] = parseInt(lenStr[i]);
  13338. }
  13339. lengthAry[lenStr.length] = 255;
  13340. if (Blob) {
  13341. var blob = new Blob([binaryIdentifier.buffer, lengthAry.buffer, encoded]);
  13342. doneCallback(null, blob);
  13343. }
  13344. });
  13345. }
  13346. map(packets, encodeOne, function(err, results) {
  13347. return callback(new Blob(results));
  13348. });
  13349. };
  13350. /*
  13351. * Decodes data when a payload is maybe expected. Strings are decoded by
  13352. * interpreting each byte as a key code for entries marked to start with 0. See
  13353. * description of encodePayloadAsBinary
  13354. *
  13355. * @param {ArrayBuffer} data, callback method
  13356. * @api public
  13357. */
  13358. exports.decodePayloadAsBinary = function (data, binaryType, callback) {
  13359. if (typeof binaryType === 'function') {
  13360. callback = binaryType;
  13361. binaryType = null;
  13362. }
  13363. var bufferTail = data;
  13364. var buffers = [];
  13365. while (bufferTail.byteLength > 0) {
  13366. var tailArray = new Uint8Array(bufferTail);
  13367. var isString = tailArray[0] === 0;
  13368. var msgLength = '';
  13369. for (var i = 1; ; i++) {
  13370. if (tailArray[i] === 255) break;
  13371. // 310 = char length of Number.MAX_VALUE
  13372. if (msgLength.length > 310) {
  13373. return callback(err, 0, 1);
  13374. }
  13375. msgLength += tailArray[i];
  13376. }
  13377. bufferTail = sliceBuffer(bufferTail, 2 + msgLength.length);
  13378. msgLength = parseInt(msgLength);
  13379. var msg = sliceBuffer(bufferTail, 0, msgLength);
  13380. if (isString) {
  13381. try {
  13382. msg = String.fromCharCode.apply(null, new Uint8Array(msg));
  13383. } catch (e) {
  13384. // iPhone Safari doesn't let you apply to typed arrays
  13385. var typed = new Uint8Array(msg);
  13386. msg = '';
  13387. for (var i = 0; i < typed.length; i++) {
  13388. msg += String.fromCharCode(typed[i]);
  13389. }
  13390. }
  13391. }
  13392. buffers.push(msg);
  13393. bufferTail = sliceBuffer(bufferTail, msgLength);
  13394. }
  13395. var total = buffers.length;
  13396. buffers.forEach(function(buffer, i) {
  13397. callback(exports.decodePacket(buffer, binaryType, true), i, total);
  13398. });
  13399. };
  13400. /***/ }),
  13401. /***/ "./node_modules/engine.io-parser/lib/keys.js":
  13402. /*!***************************************************!*\
  13403. !*** ./node_modules/engine.io-parser/lib/keys.js ***!
  13404. \***************************************************/
  13405. /*! no static exports found */
  13406. /***/ (function(module, exports) {
  13407. /**
  13408. * Gets the keys for an object.
  13409. *
  13410. * @return {Array} keys
  13411. * @api private
  13412. */
  13413. module.exports = Object.keys || function keys (obj){
  13414. var arr = [];
  13415. var has = Object.prototype.hasOwnProperty;
  13416. for (var i in obj) {
  13417. if (has.call(obj, i)) {
  13418. arr.push(i);
  13419. }
  13420. }
  13421. return arr;
  13422. };
  13423. /***/ }),
  13424. /***/ "./node_modules/engine.io-parser/lib/utf8.js":
  13425. /*!***************************************************!*\
  13426. !*** ./node_modules/engine.io-parser/lib/utf8.js ***!
  13427. \***************************************************/
  13428. /*! no static exports found */
  13429. /***/ (function(module, exports) {
  13430. /*! https://mths.be/utf8js v2.1.2 by @mathias */
  13431. var stringFromCharCode = String.fromCharCode;
  13432. // Taken from https://mths.be/punycode
  13433. function ucs2decode(string) {
  13434. var output = [];
  13435. var counter = 0;
  13436. var length = string.length;
  13437. var value;
  13438. var extra;
  13439. while (counter < length) {
  13440. value = string.charCodeAt(counter++);
  13441. if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
  13442. // high surrogate, and there is a next character
  13443. extra = string.charCodeAt(counter++);
  13444. if ((extra & 0xFC00) == 0xDC00) { // low surrogate
  13445. output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
  13446. } else {
  13447. // unmatched surrogate; only append this code unit, in case the next
  13448. // code unit is the high surrogate of a surrogate pair
  13449. output.push(value);
  13450. counter--;
  13451. }
  13452. } else {
  13453. output.push(value);
  13454. }
  13455. }
  13456. return output;
  13457. }
  13458. // Taken from https://mths.be/punycode
  13459. function ucs2encode(array) {
  13460. var length = array.length;
  13461. var index = -1;
  13462. var value;
  13463. var output = '';
  13464. while (++index < length) {
  13465. value = array[index];
  13466. if (value > 0xFFFF) {
  13467. value -= 0x10000;
  13468. output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
  13469. value = 0xDC00 | value & 0x3FF;
  13470. }
  13471. output += stringFromCharCode(value);
  13472. }
  13473. return output;
  13474. }
  13475. function checkScalarValue(codePoint, strict) {
  13476. if (codePoint >= 0xD800 && codePoint <= 0xDFFF) {
  13477. if (strict) {
  13478. throw Error(
  13479. 'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +
  13480. ' is not a scalar value'
  13481. );
  13482. }
  13483. return false;
  13484. }
  13485. return true;
  13486. }
  13487. /*--------------------------------------------------------------------------*/
  13488. function createByte(codePoint, shift) {
  13489. return stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);
  13490. }
  13491. function encodeCodePoint(codePoint, strict) {
  13492. if ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence
  13493. return stringFromCharCode(codePoint);
  13494. }
  13495. var symbol = '';
  13496. if ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence
  13497. symbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);
  13498. }
  13499. else if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence
  13500. if (!checkScalarValue(codePoint, strict)) {
  13501. codePoint = 0xFFFD;
  13502. }
  13503. symbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);
  13504. symbol += createByte(codePoint, 6);
  13505. }
  13506. else if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence
  13507. symbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);
  13508. symbol += createByte(codePoint, 12);
  13509. symbol += createByte(codePoint, 6);
  13510. }
  13511. symbol += stringFromCharCode((codePoint & 0x3F) | 0x80);
  13512. return symbol;
  13513. }
  13514. function utf8encode(string, opts) {
  13515. opts = opts || {};
  13516. var strict = false !== opts.strict;
  13517. var codePoints = ucs2decode(string);
  13518. var length = codePoints.length;
  13519. var index = -1;
  13520. var codePoint;
  13521. var byteString = '';
  13522. while (++index < length) {
  13523. codePoint = codePoints[index];
  13524. byteString += encodeCodePoint(codePoint, strict);
  13525. }
  13526. return byteString;
  13527. }
  13528. /*--------------------------------------------------------------------------*/
  13529. function readContinuationByte() {
  13530. if (byteIndex >= byteCount) {
  13531. throw Error('Invalid byte index');
  13532. }
  13533. var continuationByte = byteArray[byteIndex] & 0xFF;
  13534. byteIndex++;
  13535. if ((continuationByte & 0xC0) == 0x80) {
  13536. return continuationByte & 0x3F;
  13537. }
  13538. // If we end up here, it’s not a continuation byte
  13539. throw Error('Invalid continuation byte');
  13540. }
  13541. function decodeSymbol(strict) {
  13542. var byte1;
  13543. var byte2;
  13544. var byte3;
  13545. var byte4;
  13546. var codePoint;
  13547. if (byteIndex > byteCount) {
  13548. throw Error('Invalid byte index');
  13549. }
  13550. if (byteIndex == byteCount) {
  13551. return false;
  13552. }
  13553. // Read first byte
  13554. byte1 = byteArray[byteIndex] & 0xFF;
  13555. byteIndex++;
  13556. // 1-byte sequence (no continuation bytes)
  13557. if ((byte1 & 0x80) == 0) {
  13558. return byte1;
  13559. }
  13560. // 2-byte sequence
  13561. if ((byte1 & 0xE0) == 0xC0) {
  13562. byte2 = readContinuationByte();
  13563. codePoint = ((byte1 & 0x1F) << 6) | byte2;
  13564. if (codePoint >= 0x80) {
  13565. return codePoint;
  13566. } else {
  13567. throw Error('Invalid continuation byte');
  13568. }
  13569. }
  13570. // 3-byte sequence (may include unpaired surrogates)
  13571. if ((byte1 & 0xF0) == 0xE0) {
  13572. byte2 = readContinuationByte();
  13573. byte3 = readContinuationByte();
  13574. codePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;
  13575. if (codePoint >= 0x0800) {
  13576. return checkScalarValue(codePoint, strict) ? codePoint : 0xFFFD;
  13577. } else {
  13578. throw Error('Invalid continuation byte');
  13579. }
  13580. }
  13581. // 4-byte sequence
  13582. if ((byte1 & 0xF8) == 0xF0) {
  13583. byte2 = readContinuationByte();
  13584. byte3 = readContinuationByte();
  13585. byte4 = readContinuationByte();
  13586. codePoint = ((byte1 & 0x07) << 0x12) | (byte2 << 0x0C) |
  13587. (byte3 << 0x06) | byte4;
  13588. if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {
  13589. return codePoint;
  13590. }
  13591. }
  13592. throw Error('Invalid UTF-8 detected');
  13593. }
  13594. var byteArray;
  13595. var byteCount;
  13596. var byteIndex;
  13597. function utf8decode(byteString, opts) {
  13598. opts = opts || {};
  13599. var strict = false !== opts.strict;
  13600. byteArray = ucs2decode(byteString);
  13601. byteCount = byteArray.length;
  13602. byteIndex = 0;
  13603. var codePoints = [];
  13604. var tmp;
  13605. while ((tmp = decodeSymbol(strict)) !== false) {
  13606. codePoints.push(tmp);
  13607. }
  13608. return ucs2encode(codePoints);
  13609. }
  13610. module.exports = {
  13611. version: '2.1.2',
  13612. encode: utf8encode,
  13613. decode: utf8decode
  13614. };
  13615. /***/ }),
  13616. /***/ "./node_modules/has-binary2/index.js":
  13617. /*!*******************************************!*\
  13618. !*** ./node_modules/has-binary2/index.js ***!
  13619. \*******************************************/
  13620. /*! no static exports found */
  13621. /***/ (function(module, exports, __webpack_require__) {
  13622. /* WEBPACK VAR INJECTION */(function(Buffer) {/* global Blob File */
  13623. /*
  13624. * Module requirements.
  13625. */
  13626. var isArray = __webpack_require__(/*! isarray */ "./node_modules/has-binary2/node_modules/isarray/index.js");
  13627. var toString = Object.prototype.toString;
  13628. var withNativeBlob = typeof Blob === 'function' ||
  13629. typeof Blob !== 'undefined' && toString.call(Blob) === '[object BlobConstructor]';
  13630. var withNativeFile = typeof File === 'function' ||
  13631. typeof File !== 'undefined' && toString.call(File) === '[object FileConstructor]';
  13632. /**
  13633. * Module exports.
  13634. */
  13635. module.exports = hasBinary;
  13636. /**
  13637. * Checks for binary data.
  13638. *
  13639. * Supports Buffer, ArrayBuffer, Blob and File.
  13640. *
  13641. * @param {Object} anything
  13642. * @api public
  13643. */
  13644. function hasBinary (obj) {
  13645. if (!obj || typeof obj !== 'object') {
  13646. return false;
  13647. }
  13648. if (isArray(obj)) {
  13649. for (var i = 0, l = obj.length; i < l; i++) {
  13650. if (hasBinary(obj[i])) {
  13651. return true;
  13652. }
  13653. }
  13654. return false;
  13655. }
  13656. if ((typeof Buffer === 'function' && Buffer.isBuffer && Buffer.isBuffer(obj)) ||
  13657. (typeof ArrayBuffer === 'function' && obj instanceof ArrayBuffer) ||
  13658. (withNativeBlob && obj instanceof Blob) ||
  13659. (withNativeFile && obj instanceof File)
  13660. ) {
  13661. return true;
  13662. }
  13663. // see: https://github.com/Automattic/has-binary/pull/4
  13664. if (obj.toJSON && typeof obj.toJSON === 'function' && arguments.length === 1) {
  13665. return hasBinary(obj.toJSON(), true);
  13666. }
  13667. for (var key in obj) {
  13668. if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {
  13669. return true;
  13670. }
  13671. }
  13672. return false;
  13673. }
  13674. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer))
  13675. /***/ }),
  13676. /***/ "./node_modules/has-binary2/node_modules/isarray/index.js":
  13677. /*!****************************************************************!*\
  13678. !*** ./node_modules/has-binary2/node_modules/isarray/index.js ***!
  13679. \****************************************************************/
  13680. /*! no static exports found */
  13681. /***/ (function(module, exports) {
  13682. var toString = {}.toString;
  13683. module.exports = Array.isArray || function (arr) {
  13684. return toString.call(arr) == '[object Array]';
  13685. };
  13686. /***/ }),
  13687. /***/ "./node_modules/has-cors/index.js":
  13688. /*!****************************************!*\
  13689. !*** ./node_modules/has-cors/index.js ***!
  13690. \****************************************/
  13691. /*! no static exports found */
  13692. /***/ (function(module, exports) {
  13693. /**
  13694. * Module exports.
  13695. *
  13696. * Logic borrowed from Modernizr:
  13697. *
  13698. * - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js
  13699. */
  13700. try {
  13701. module.exports = typeof XMLHttpRequest !== 'undefined' &&
  13702. 'withCredentials' in new XMLHttpRequest();
  13703. } catch (err) {
  13704. // if XMLHttp support is disabled in IE then it will throw
  13705. // when trying to create
  13706. module.exports = false;
  13707. }
  13708. /***/ }),
  13709. /***/ "./node_modules/ieee754/index.js":
  13710. /*!***************************************!*\
  13711. !*** ./node_modules/ieee754/index.js ***!
  13712. \***************************************/
  13713. /*! no static exports found */
  13714. /***/ (function(module, exports) {
  13715. exports.read = function (buffer, offset, isLE, mLen, nBytes) {
  13716. var e, m
  13717. var eLen = (nBytes * 8) - mLen - 1
  13718. var eMax = (1 << eLen) - 1
  13719. var eBias = eMax >> 1
  13720. var nBits = -7
  13721. var i = isLE ? (nBytes - 1) : 0
  13722. var d = isLE ? -1 : 1
  13723. var s = buffer[offset + i]
  13724. i += d
  13725. e = s & ((1 << (-nBits)) - 1)
  13726. s >>= (-nBits)
  13727. nBits += eLen
  13728. for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  13729. m = e & ((1 << (-nBits)) - 1)
  13730. e >>= (-nBits)
  13731. nBits += mLen
  13732. for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
  13733. if (e === 0) {
  13734. e = 1 - eBias
  13735. } else if (e === eMax) {
  13736. return m ? NaN : ((s ? -1 : 1) * Infinity)
  13737. } else {
  13738. m = m + Math.pow(2, mLen)
  13739. e = e - eBias
  13740. }
  13741. return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  13742. }
  13743. exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
  13744. var e, m, c
  13745. var eLen = (nBytes * 8) - mLen - 1
  13746. var eMax = (1 << eLen) - 1
  13747. var eBias = eMax >> 1
  13748. var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
  13749. var i = isLE ? 0 : (nBytes - 1)
  13750. var d = isLE ? 1 : -1
  13751. var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
  13752. value = Math.abs(value)
  13753. if (isNaN(value) || value === Infinity) {
  13754. m = isNaN(value) ? 1 : 0
  13755. e = eMax
  13756. } else {
  13757. e = Math.floor(Math.log(value) / Math.LN2)
  13758. if (value * (c = Math.pow(2, -e)) < 1) {
  13759. e--
  13760. c *= 2
  13761. }
  13762. if (e + eBias >= 1) {
  13763. value += rt / c
  13764. } else {
  13765. value += rt * Math.pow(2, 1 - eBias)
  13766. }
  13767. if (value * c >= 2) {
  13768. e++
  13769. c /= 2
  13770. }
  13771. if (e + eBias >= eMax) {
  13772. m = 0
  13773. e = eMax
  13774. } else if (e + eBias >= 1) {
  13775. m = ((value * c) - 1) * Math.pow(2, mLen)
  13776. e = e + eBias
  13777. } else {
  13778. m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
  13779. e = 0
  13780. }
  13781. }
  13782. for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  13783. e = (e << mLen) | m
  13784. eLen += mLen
  13785. for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  13786. buffer[offset + i - d] |= s * 128
  13787. }
  13788. /***/ }),
  13789. /***/ "./node_modules/indexof/index.js":
  13790. /*!***************************************!*\
  13791. !*** ./node_modules/indexof/index.js ***!
  13792. \***************************************/
  13793. /*! no static exports found */
  13794. /***/ (function(module, exports) {
  13795. var indexOf = [].indexOf;
  13796. module.exports = function(arr, obj){
  13797. if (indexOf) return arr.indexOf(obj);
  13798. for (var i = 0; i < arr.length; ++i) {
  13799. if (arr[i] === obj) return i;
  13800. }
  13801. return -1;
  13802. };
  13803. /***/ }),
  13804. /***/ "./node_modules/isarray/index.js":
  13805. /*!***************************************!*\
  13806. !*** ./node_modules/isarray/index.js ***!
  13807. \***************************************/
  13808. /*! no static exports found */
  13809. /***/ (function(module, exports) {
  13810. var toString = {}.toString;
  13811. module.exports = Array.isArray || function (arr) {
  13812. return toString.call(arr) == '[object Array]';
  13813. };
  13814. /***/ }),
  13815. /***/ "./node_modules/jquery/dist/jquery.js":
  13816. /*!********************************************!*\
  13817. !*** ./node_modules/jquery/dist/jquery.js ***!
  13818. \********************************************/
  13819. /*! no static exports found */
  13820. /***/ (function(module, exports, __webpack_require__) {
  13821. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  13822. * jQuery JavaScript Library v3.5.1
  13823. * https://jquery.com/
  13824. *
  13825. * Includes Sizzle.js
  13826. * https://sizzlejs.com/
  13827. *
  13828. * Copyright JS Foundation and other contributors
  13829. * Released under the MIT license
  13830. * https://jquery.org/license
  13831. *
  13832. * Date: 2020-05-04T22:49Z
  13833. */
  13834. ( function( global, factory ) {
  13835. "use strict";
  13836. if ( true && typeof module.exports === "object" ) {
  13837. // For CommonJS and CommonJS-like environments where a proper `window`
  13838. // is present, execute the factory and get jQuery.
  13839. // For environments that do not have a `window` with a `document`
  13840. // (such as Node.js), expose a factory as module.exports.
  13841. // This accentuates the need for the creation of a real `window`.
  13842. // e.g. var jQuery = require("jquery")(window);
  13843. // See ticket #14549 for more info.
  13844. module.exports = global.document ?
  13845. factory( global, true ) :
  13846. function( w ) {
  13847. if ( !w.document ) {
  13848. throw new Error( "jQuery requires a window with a document" );
  13849. }
  13850. return factory( w );
  13851. };
  13852. } else {
  13853. factory( global );
  13854. }
  13855. // Pass this if window is not defined yet
  13856. } )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  13857. // Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
  13858. // throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
  13859. // arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
  13860. // enough that all such attempts are guarded in a try block.
  13861. "use strict";
  13862. var arr = [];
  13863. var getProto = Object.getPrototypeOf;
  13864. var slice = arr.slice;
  13865. var flat = arr.flat ? function( array ) {
  13866. return arr.flat.call( array );
  13867. } : function( array ) {
  13868. return arr.concat.apply( [], array );
  13869. };
  13870. var push = arr.push;
  13871. var indexOf = arr.indexOf;
  13872. var class2type = {};
  13873. var toString = class2type.toString;
  13874. var hasOwn = class2type.hasOwnProperty;
  13875. var fnToString = hasOwn.toString;
  13876. var ObjectFunctionString = fnToString.call( Object );
  13877. var support = {};
  13878. var isFunction = function isFunction( obj ) {
  13879. // Support: Chrome <=57, Firefox <=52
  13880. // In some browsers, typeof returns "function" for HTML <object> elements
  13881. // (i.e., `typeof document.createElement( "object" ) === "function"`).
  13882. // We don't want to classify *any* DOM node as a function.
  13883. return typeof obj === "function" && typeof obj.nodeType !== "number";
  13884. };
  13885. var isWindow = function isWindow( obj ) {
  13886. return obj != null && obj === obj.window;
  13887. };
  13888. var document = window.document;
  13889. var preservedScriptAttributes = {
  13890. type: true,
  13891. src: true,
  13892. nonce: true,
  13893. noModule: true
  13894. };
  13895. function DOMEval( code, node, doc ) {
  13896. doc = doc || document;
  13897. var i, val,
  13898. script = doc.createElement( "script" );
  13899. script.text = code;
  13900. if ( node ) {
  13901. for ( i in preservedScriptAttributes ) {
  13902. // Support: Firefox 64+, Edge 18+
  13903. // Some browsers don't support the "nonce" property on scripts.
  13904. // On the other hand, just using `getAttribute` is not enough as
  13905. // the `nonce` attribute is reset to an empty string whenever it
  13906. // becomes browsing-context connected.
  13907. // See https://github.com/whatwg/html/issues/2369
  13908. // See https://html.spec.whatwg.org/#nonce-attributes
  13909. // The `node.getAttribute` check was added for the sake of
  13910. // `jQuery.globalEval` so that it can fake a nonce-containing node
  13911. // via an object.
  13912. val = node[ i ] || node.getAttribute && node.getAttribute( i );
  13913. if ( val ) {
  13914. script.setAttribute( i, val );
  13915. }
  13916. }
  13917. }
  13918. doc.head.appendChild( script ).parentNode.removeChild( script );
  13919. }
  13920. function toType( obj ) {
  13921. if ( obj == null ) {
  13922. return obj + "";
  13923. }
  13924. // Support: Android <=2.3 only (functionish RegExp)
  13925. return typeof obj === "object" || typeof obj === "function" ?
  13926. class2type[ toString.call( obj ) ] || "object" :
  13927. typeof obj;
  13928. }
  13929. /* global Symbol */
  13930. // Defining this global in .eslintrc.json would create a danger of using the global
  13931. // unguarded in another place, it seems safer to define global only for this module
  13932. var
  13933. version = "3.5.1",
  13934. // Define a local copy of jQuery
  13935. jQuery = function( selector, context ) {
  13936. // The jQuery object is actually just the init constructor 'enhanced'
  13937. // Need init if jQuery is called (just allow error to be thrown if not included)
  13938. return new jQuery.fn.init( selector, context );
  13939. };
  13940. jQuery.fn = jQuery.prototype = {
  13941. // The current version of jQuery being used
  13942. jquery: version,
  13943. constructor: jQuery,
  13944. // The default length of a jQuery object is 0
  13945. length: 0,
  13946. toArray: function() {
  13947. return slice.call( this );
  13948. },
  13949. // Get the Nth element in the matched element set OR
  13950. // Get the whole matched element set as a clean array
  13951. get: function( num ) {
  13952. // Return all the elements in a clean array
  13953. if ( num == null ) {
  13954. return slice.call( this );
  13955. }
  13956. // Return just the one element from the set
  13957. return num < 0 ? this[ num + this.length ] : this[ num ];
  13958. },
  13959. // Take an array of elements and push it onto the stack
  13960. // (returning the new matched element set)
  13961. pushStack: function( elems ) {
  13962. // Build a new jQuery matched element set
  13963. var ret = jQuery.merge( this.constructor(), elems );
  13964. // Add the old object onto the stack (as a reference)
  13965. ret.prevObject = this;
  13966. // Return the newly-formed element set
  13967. return ret;
  13968. },
  13969. // Execute a callback for every element in the matched set.
  13970. each: function( callback ) {
  13971. return jQuery.each( this, callback );
  13972. },
  13973. map: function( callback ) {
  13974. return this.pushStack( jQuery.map( this, function( elem, i ) {
  13975. return callback.call( elem, i, elem );
  13976. } ) );
  13977. },
  13978. slice: function() {
  13979. return this.pushStack( slice.apply( this, arguments ) );
  13980. },
  13981. first: function() {
  13982. return this.eq( 0 );
  13983. },
  13984. last: function() {
  13985. return this.eq( -1 );
  13986. },
  13987. even: function() {
  13988. return this.pushStack( jQuery.grep( this, function( _elem, i ) {
  13989. return ( i + 1 ) % 2;
  13990. } ) );
  13991. },
  13992. odd: function() {
  13993. return this.pushStack( jQuery.grep( this, function( _elem, i ) {
  13994. return i % 2;
  13995. } ) );
  13996. },
  13997. eq: function( i ) {
  13998. var len = this.length,
  13999. j = +i + ( i < 0 ? len : 0 );
  14000. return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
  14001. },
  14002. end: function() {
  14003. return this.prevObject || this.constructor();
  14004. },
  14005. // For internal use only.
  14006. // Behaves like an Array's method, not like a jQuery method.
  14007. push: push,
  14008. sort: arr.sort,
  14009. splice: arr.splice
  14010. };
  14011. jQuery.extend = jQuery.fn.extend = function() {
  14012. var options, name, src, copy, copyIsArray, clone,
  14013. target = arguments[ 0 ] || {},
  14014. i = 1,
  14015. length = arguments.length,
  14016. deep = false;
  14017. // Handle a deep copy situation
  14018. if ( typeof target === "boolean" ) {
  14019. deep = target;
  14020. // Skip the boolean and the target
  14021. target = arguments[ i ] || {};
  14022. i++;
  14023. }
  14024. // Handle case when target is a string or something (possible in deep copy)
  14025. if ( typeof target !== "object" && !isFunction( target ) ) {
  14026. target = {};
  14027. }
  14028. // Extend jQuery itself if only one argument is passed
  14029. if ( i === length ) {
  14030. target = this;
  14031. i--;
  14032. }
  14033. for ( ; i < length; i++ ) {
  14034. // Only deal with non-null/undefined values
  14035. if ( ( options = arguments[ i ] ) != null ) {
  14036. // Extend the base object
  14037. for ( name in options ) {
  14038. copy = options[ name ];
  14039. // Prevent Object.prototype pollution
  14040. // Prevent never-ending loop
  14041. if ( name === "__proto__" || target === copy ) {
  14042. continue;
  14043. }
  14044. // Recurse if we're merging plain objects or arrays
  14045. if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
  14046. ( copyIsArray = Array.isArray( copy ) ) ) ) {
  14047. src = target[ name ];
  14048. // Ensure proper type for the source value
  14049. if ( copyIsArray && !Array.isArray( src ) ) {
  14050. clone = [];
  14051. } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) {
  14052. clone = {};
  14053. } else {
  14054. clone = src;
  14055. }
  14056. copyIsArray = false;
  14057. // Never move original objects, clone them
  14058. target[ name ] = jQuery.extend( deep, clone, copy );
  14059. // Don't bring in undefined values
  14060. } else if ( copy !== undefined ) {
  14061. target[ name ] = copy;
  14062. }
  14063. }
  14064. }
  14065. }
  14066. // Return the modified object
  14067. return target;
  14068. };
  14069. jQuery.extend( {
  14070. // Unique for each copy of jQuery on the page
  14071. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  14072. // Assume jQuery is ready without the ready module
  14073. isReady: true,
  14074. error: function( msg ) {
  14075. throw new Error( msg );
  14076. },
  14077. noop: function() {},
  14078. isPlainObject: function( obj ) {
  14079. var proto, Ctor;
  14080. // Detect obvious negatives
  14081. // Use toString instead of jQuery.type to catch host objects
  14082. if ( !obj || toString.call( obj ) !== "[object Object]" ) {
  14083. return false;
  14084. }
  14085. proto = getProto( obj );
  14086. // Objects with no prototype (e.g., `Object.create( null )`) are plain
  14087. if ( !proto ) {
  14088. return true;
  14089. }
  14090. // Objects with prototype are plain iff they were constructed by a global Object function
  14091. Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor;
  14092. return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString;
  14093. },
  14094. isEmptyObject: function( obj ) {
  14095. var name;
  14096. for ( name in obj ) {
  14097. return false;
  14098. }
  14099. return true;
  14100. },
  14101. // Evaluates a script in a provided context; falls back to the global one
  14102. // if not specified.
  14103. globalEval: function( code, options, doc ) {
  14104. DOMEval( code, { nonce: options && options.nonce }, doc );
  14105. },
  14106. each: function( obj, callback ) {
  14107. var length, i = 0;
  14108. if ( isArrayLike( obj ) ) {
  14109. length = obj.length;
  14110. for ( ; i < length; i++ ) {
  14111. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  14112. break;
  14113. }
  14114. }
  14115. } else {
  14116. for ( i in obj ) {
  14117. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  14118. break;
  14119. }
  14120. }
  14121. }
  14122. return obj;
  14123. },
  14124. // results is for internal usage only
  14125. makeArray: function( arr, results ) {
  14126. var ret = results || [];
  14127. if ( arr != null ) {
  14128. if ( isArrayLike( Object( arr ) ) ) {
  14129. jQuery.merge( ret,
  14130. typeof arr === "string" ?
  14131. [ arr ] : arr
  14132. );
  14133. } else {
  14134. push.call( ret, arr );
  14135. }
  14136. }
  14137. return ret;
  14138. },
  14139. inArray: function( elem, arr, i ) {
  14140. return arr == null ? -1 : indexOf.call( arr, elem, i );
  14141. },
  14142. // Support: Android <=4.0 only, PhantomJS 1 only
  14143. // push.apply(_, arraylike) throws on ancient WebKit
  14144. merge: function( first, second ) {
  14145. var len = +second.length,
  14146. j = 0,
  14147. i = first.length;
  14148. for ( ; j < len; j++ ) {
  14149. first[ i++ ] = second[ j ];
  14150. }
  14151. first.length = i;
  14152. return first;
  14153. },
  14154. grep: function( elems, callback, invert ) {
  14155. var callbackInverse,
  14156. matches = [],
  14157. i = 0,
  14158. length = elems.length,
  14159. callbackExpect = !invert;
  14160. // Go through the array, only saving the items
  14161. // that pass the validator function
  14162. for ( ; i < length; i++ ) {
  14163. callbackInverse = !callback( elems[ i ], i );
  14164. if ( callbackInverse !== callbackExpect ) {
  14165. matches.push( elems[ i ] );
  14166. }
  14167. }
  14168. return matches;
  14169. },
  14170. // arg is for internal usage only
  14171. map: function( elems, callback, arg ) {
  14172. var length, value,
  14173. i = 0,
  14174. ret = [];
  14175. // Go through the array, translating each of the items to their new values
  14176. if ( isArrayLike( elems ) ) {
  14177. length = elems.length;
  14178. for ( ; i < length; i++ ) {
  14179. value = callback( elems[ i ], i, arg );
  14180. if ( value != null ) {
  14181. ret.push( value );
  14182. }
  14183. }
  14184. // Go through every key on the object,
  14185. } else {
  14186. for ( i in elems ) {
  14187. value = callback( elems[ i ], i, arg );
  14188. if ( value != null ) {
  14189. ret.push( value );
  14190. }
  14191. }
  14192. }
  14193. // Flatten any nested arrays
  14194. return flat( ret );
  14195. },
  14196. // A global GUID counter for objects
  14197. guid: 1,
  14198. // jQuery.support is not used in Core but other projects attach their
  14199. // properties to it so it needs to exist.
  14200. support: support
  14201. } );
  14202. if ( typeof Symbol === "function" ) {
  14203. jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
  14204. }
  14205. // Populate the class2type map
  14206. jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
  14207. function( _i, name ) {
  14208. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  14209. } );
  14210. function isArrayLike( obj ) {
  14211. // Support: real iOS 8.2 only (not reproducible in simulator)
  14212. // `in` check used to prevent JIT error (gh-2145)
  14213. // hasOwn isn't used here due to false negatives
  14214. // regarding Nodelist length in IE
  14215. var length = !!obj && "length" in obj && obj.length,
  14216. type = toType( obj );
  14217. if ( isFunction( obj ) || isWindow( obj ) ) {
  14218. return false;
  14219. }
  14220. return type === "array" || length === 0 ||
  14221. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  14222. }
  14223. var Sizzle =
  14224. /*!
  14225. * Sizzle CSS Selector Engine v2.3.5
  14226. * https://sizzlejs.com/
  14227. *
  14228. * Copyright JS Foundation and other contributors
  14229. * Released under the MIT license
  14230. * https://js.foundation/
  14231. *
  14232. * Date: 2020-03-14
  14233. */
  14234. ( function( window ) {
  14235. var i,
  14236. support,
  14237. Expr,
  14238. getText,
  14239. isXML,
  14240. tokenize,
  14241. compile,
  14242. select,
  14243. outermostContext,
  14244. sortInput,
  14245. hasDuplicate,
  14246. // Local document vars
  14247. setDocument,
  14248. document,
  14249. docElem,
  14250. documentIsHTML,
  14251. rbuggyQSA,
  14252. rbuggyMatches,
  14253. matches,
  14254. contains,
  14255. // Instance-specific data
  14256. expando = "sizzle" + 1 * new Date(),
  14257. preferredDoc = window.document,
  14258. dirruns = 0,
  14259. done = 0,
  14260. classCache = createCache(),
  14261. tokenCache = createCache(),
  14262. compilerCache = createCache(),
  14263. nonnativeSelectorCache = createCache(),
  14264. sortOrder = function( a, b ) {
  14265. if ( a === b ) {
  14266. hasDuplicate = true;
  14267. }
  14268. return 0;
  14269. },
  14270. // Instance methods
  14271. hasOwn = ( {} ).hasOwnProperty,
  14272. arr = [],
  14273. pop = arr.pop,
  14274. pushNative = arr.push,
  14275. push = arr.push,
  14276. slice = arr.slice,
  14277. // Use a stripped-down indexOf as it's faster than native
  14278. // https://jsperf.com/thor-indexof-vs-for/5
  14279. indexOf = function( list, elem ) {
  14280. var i = 0,
  14281. len = list.length;
  14282. for ( ; i < len; i++ ) {
  14283. if ( list[ i ] === elem ) {
  14284. return i;
  14285. }
  14286. }
  14287. return -1;
  14288. },
  14289. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" +
  14290. "ismap|loop|multiple|open|readonly|required|scoped",
  14291. // Regular expressions
  14292. // http://www.w3.org/TR/css3-selectors/#whitespace
  14293. whitespace = "[\\x20\\t\\r\\n\\f]",
  14294. // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
  14295. identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
  14296. "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
  14297. // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  14298. attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
  14299. // Operator (capture 2)
  14300. "*([*^$|!~]?=)" + whitespace +
  14301. // "Attribute values must be CSS identifiers [capture 5]
  14302. // or strings [capture 3 or capture 4]"
  14303. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
  14304. whitespace + "*\\]",
  14305. pseudos = ":(" + identifier + ")(?:\\((" +
  14306. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  14307. // 1. quoted (capture 3; capture 4 or capture 5)
  14308. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  14309. // 2. simple (capture 6)
  14310. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  14311. // 3. anything else (capture 2)
  14312. ".*" +
  14313. ")\\)|)",
  14314. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  14315. rwhitespace = new RegExp( whitespace + "+", "g" ),
  14316. rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" +
  14317. whitespace + "+$", "g" ),
  14318. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  14319. rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace +
  14320. "*" ),
  14321. rdescend = new RegExp( whitespace + "|>" ),
  14322. rpseudo = new RegExp( pseudos ),
  14323. ridentifier = new RegExp( "^" + identifier + "$" ),
  14324. matchExpr = {
  14325. "ID": new RegExp( "^#(" + identifier + ")" ),
  14326. "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
  14327. "TAG": new RegExp( "^(" + identifier + "|[*])" ),
  14328. "ATTR": new RegExp( "^" + attributes ),
  14329. "PSEUDO": new RegExp( "^" + pseudos ),
  14330. "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
  14331. whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
  14332. whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  14333. "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  14334. // For use in libraries implementing .is()
  14335. // We use this for POS matching in `select`
  14336. "needsContext": new RegExp( "^" + whitespace +
  14337. "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
  14338. "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  14339. },
  14340. rhtml = /HTML$/i,
  14341. rinputs = /^(?:input|select|textarea|button)$/i,
  14342. rheader = /^h\d$/i,
  14343. rnative = /^[^{]+\{\s*\[native \w/,
  14344. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  14345. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  14346. rsibling = /[+~]/,
  14347. // CSS escapes
  14348. // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  14349. runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ),
  14350. funescape = function( escape, nonHex ) {
  14351. var high = "0x" + escape.slice( 1 ) - 0x10000;
  14352. return nonHex ?
  14353. // Strip the backslash prefix from a non-hex escape sequence
  14354. nonHex :
  14355. // Replace a hexadecimal escape sequence with the encoded Unicode code point
  14356. // Support: IE <=11+
  14357. // For values outside the Basic Multilingual Plane (BMP), manually construct a
  14358. // surrogate pair
  14359. high < 0 ?
  14360. String.fromCharCode( high + 0x10000 ) :
  14361. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  14362. },
  14363. // CSS string/identifier serialization
  14364. // https://drafts.csswg.org/cssom/#common-serializing-idioms
  14365. rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
  14366. fcssescape = function( ch, asCodePoint ) {
  14367. if ( asCodePoint ) {
  14368. // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
  14369. if ( ch === "\0" ) {
  14370. return "\uFFFD";
  14371. }
  14372. // Control characters and (dependent upon position) numbers get escaped as code points
  14373. return ch.slice( 0, -1 ) + "\\" +
  14374. ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
  14375. }
  14376. // Other potentially-special ASCII characters get backslash-escaped
  14377. return "\\" + ch;
  14378. },
  14379. // Used for iframes
  14380. // See setDocument()
  14381. // Removing the function wrapper causes a "Permission Denied"
  14382. // error in IE
  14383. unloadHandler = function() {
  14384. setDocument();
  14385. },
  14386. inDisabledFieldset = addCombinator(
  14387. function( elem ) {
  14388. return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
  14389. },
  14390. { dir: "parentNode", next: "legend" }
  14391. );
  14392. // Optimize for push.apply( _, NodeList )
  14393. try {
  14394. push.apply(
  14395. ( arr = slice.call( preferredDoc.childNodes ) ),
  14396. preferredDoc.childNodes
  14397. );
  14398. // Support: Android<4.0
  14399. // Detect silently failing push.apply
  14400. // eslint-disable-next-line no-unused-expressions
  14401. arr[ preferredDoc.childNodes.length ].nodeType;
  14402. } catch ( e ) {
  14403. push = { apply: arr.length ?
  14404. // Leverage slice if possible
  14405. function( target, els ) {
  14406. pushNative.apply( target, slice.call( els ) );
  14407. } :
  14408. // Support: IE<9
  14409. // Otherwise append directly
  14410. function( target, els ) {
  14411. var j = target.length,
  14412. i = 0;
  14413. // Can't trust NodeList.length
  14414. while ( ( target[ j++ ] = els[ i++ ] ) ) {}
  14415. target.length = j - 1;
  14416. }
  14417. };
  14418. }
  14419. function Sizzle( selector, context, results, seed ) {
  14420. var m, i, elem, nid, match, groups, newSelector,
  14421. newContext = context && context.ownerDocument,
  14422. // nodeType defaults to 9, since context defaults to document
  14423. nodeType = context ? context.nodeType : 9;
  14424. results = results || [];
  14425. // Return early from calls with invalid selector or context
  14426. if ( typeof selector !== "string" || !selector ||
  14427. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  14428. return results;
  14429. }
  14430. // Try to shortcut find operations (as opposed to filters) in HTML documents
  14431. if ( !seed ) {
  14432. setDocument( context );
  14433. context = context || document;
  14434. if ( documentIsHTML ) {
  14435. // If the selector is sufficiently simple, try using a "get*By*" DOM method
  14436. // (excepting DocumentFragment context, where the methods don't exist)
  14437. if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {
  14438. // ID selector
  14439. if ( ( m = match[ 1 ] ) ) {
  14440. // Document context
  14441. if ( nodeType === 9 ) {
  14442. if ( ( elem = context.getElementById( m ) ) ) {
  14443. // Support: IE, Opera, Webkit
  14444. // TODO: identify versions
  14445. // getElementById can match elements by name instead of ID
  14446. if ( elem.id === m ) {
  14447. results.push( elem );
  14448. return results;
  14449. }
  14450. } else {
  14451. return results;
  14452. }
  14453. // Element context
  14454. } else {
  14455. // Support: IE, Opera, Webkit
  14456. // TODO: identify versions
  14457. // getElementById can match elements by name instead of ID
  14458. if ( newContext && ( elem = newContext.getElementById( m ) ) &&
  14459. contains( context, elem ) &&
  14460. elem.id === m ) {
  14461. results.push( elem );
  14462. return results;
  14463. }
  14464. }
  14465. // Type selector
  14466. } else if ( match[ 2 ] ) {
  14467. push.apply( results, context.getElementsByTagName( selector ) );
  14468. return results;
  14469. // Class selector
  14470. } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&
  14471. context.getElementsByClassName ) {
  14472. push.apply( results, context.getElementsByClassName( m ) );
  14473. return results;
  14474. }
  14475. }
  14476. // Take advantage of querySelectorAll
  14477. if ( support.qsa &&
  14478. !nonnativeSelectorCache[ selector + " " ] &&
  14479. ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&
  14480. // Support: IE 8 only
  14481. // Exclude object elements
  14482. ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) {
  14483. newSelector = selector;
  14484. newContext = context;
  14485. // qSA considers elements outside a scoping root when evaluating child or
  14486. // descendant combinators, which is not what we want.
  14487. // In such cases, we work around the behavior by prefixing every selector in the
  14488. // list with an ID selector referencing the scope context.
  14489. // The technique has to be used as well when a leading combinator is used
  14490. // as such selectors are not recognized by querySelectorAll.
  14491. // Thanks to Andrew Dupont for this technique.
  14492. if ( nodeType === 1 &&
  14493. ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {
  14494. // Expand context for sibling selectors
  14495. newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
  14496. context;
  14497. // We can use :scope instead of the ID hack if the browser
  14498. // supports it & if we're not changing the context.
  14499. if ( newContext !== context || !support.scope ) {
  14500. // Capture the context ID, setting it first if necessary
  14501. if ( ( nid = context.getAttribute( "id" ) ) ) {
  14502. nid = nid.replace( rcssescape, fcssescape );
  14503. } else {
  14504. context.setAttribute( "id", ( nid = expando ) );
  14505. }
  14506. }
  14507. // Prefix every selector in the list
  14508. groups = tokenize( selector );
  14509. i = groups.length;
  14510. while ( i-- ) {
  14511. groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +
  14512. toSelector( groups[ i ] );
  14513. }
  14514. newSelector = groups.join( "," );
  14515. }
  14516. try {
  14517. push.apply( results,
  14518. newContext.querySelectorAll( newSelector )
  14519. );
  14520. return results;
  14521. } catch ( qsaError ) {
  14522. nonnativeSelectorCache( selector, true );
  14523. } finally {
  14524. if ( nid === expando ) {
  14525. context.removeAttribute( "id" );
  14526. }
  14527. }
  14528. }
  14529. }
  14530. }
  14531. // All others
  14532. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  14533. }
  14534. /**
  14535. * Create key-value caches of limited size
  14536. * @returns {function(string, object)} Returns the Object data after storing it on itself with
  14537. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  14538. * deleting the oldest entry
  14539. */
  14540. function createCache() {
  14541. var keys = [];
  14542. function cache( key, value ) {
  14543. // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  14544. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  14545. // Only keep the most recent entries
  14546. delete cache[ keys.shift() ];
  14547. }
  14548. return ( cache[ key + " " ] = value );
  14549. }
  14550. return cache;
  14551. }
  14552. /**
  14553. * Mark a function for special use by Sizzle
  14554. * @param {Function} fn The function to mark
  14555. */
  14556. function markFunction( fn ) {
  14557. fn[ expando ] = true;
  14558. return fn;
  14559. }
  14560. /**
  14561. * Support testing using an element
  14562. * @param {Function} fn Passed the created element and returns a boolean result
  14563. */
  14564. function assert( fn ) {
  14565. var el = document.createElement( "fieldset" );
  14566. try {
  14567. return !!fn( el );
  14568. } catch ( e ) {
  14569. return false;
  14570. } finally {
  14571. // Remove from its parent by default
  14572. if ( el.parentNode ) {
  14573. el.parentNode.removeChild( el );
  14574. }
  14575. // release memory in IE
  14576. el = null;
  14577. }
  14578. }
  14579. /**
  14580. * Adds the same handler for all of the specified attrs
  14581. * @param {String} attrs Pipe-separated list of attributes
  14582. * @param {Function} handler The method that will be applied
  14583. */
  14584. function addHandle( attrs, handler ) {
  14585. var arr = attrs.split( "|" ),
  14586. i = arr.length;
  14587. while ( i-- ) {
  14588. Expr.attrHandle[ arr[ i ] ] = handler;
  14589. }
  14590. }
  14591. /**
  14592. * Checks document order of two siblings
  14593. * @param {Element} a
  14594. * @param {Element} b
  14595. * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  14596. */
  14597. function siblingCheck( a, b ) {
  14598. var cur = b && a,
  14599. diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  14600. a.sourceIndex - b.sourceIndex;
  14601. // Use IE sourceIndex if available on both nodes
  14602. if ( diff ) {
  14603. return diff;
  14604. }
  14605. // Check if b follows a
  14606. if ( cur ) {
  14607. while ( ( cur = cur.nextSibling ) ) {
  14608. if ( cur === b ) {
  14609. return -1;
  14610. }
  14611. }
  14612. }
  14613. return a ? 1 : -1;
  14614. }
  14615. /**
  14616. * Returns a function to use in pseudos for input types
  14617. * @param {String} type
  14618. */
  14619. function createInputPseudo( type ) {
  14620. return function( elem ) {
  14621. var name = elem.nodeName.toLowerCase();
  14622. return name === "input" && elem.type === type;
  14623. };
  14624. }
  14625. /**
  14626. * Returns a function to use in pseudos for buttons
  14627. * @param {String} type
  14628. */
  14629. function createButtonPseudo( type ) {
  14630. return function( elem ) {
  14631. var name = elem.nodeName.toLowerCase();
  14632. return ( name === "input" || name === "button" ) && elem.type === type;
  14633. };
  14634. }
  14635. /**
  14636. * Returns a function to use in pseudos for :enabled/:disabled
  14637. * @param {Boolean} disabled true for :disabled; false for :enabled
  14638. */
  14639. function createDisabledPseudo( disabled ) {
  14640. // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
  14641. return function( elem ) {
  14642. // Only certain elements can match :enabled or :disabled
  14643. // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
  14644. // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
  14645. if ( "form" in elem ) {
  14646. // Check for inherited disabledness on relevant non-disabled elements:
  14647. // * listed form-associated elements in a disabled fieldset
  14648. // https://html.spec.whatwg.org/multipage/forms.html#category-listed
  14649. // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
  14650. // * option elements in a disabled optgroup
  14651. // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
  14652. // All such elements have a "form" property.
  14653. if ( elem.parentNode && elem.disabled === false ) {
  14654. // Option elements defer to a parent optgroup if present
  14655. if ( "label" in elem ) {
  14656. if ( "label" in elem.parentNode ) {
  14657. return elem.parentNode.disabled === disabled;
  14658. } else {
  14659. return elem.disabled === disabled;
  14660. }
  14661. }
  14662. // Support: IE 6 - 11
  14663. // Use the isDisabled shortcut property to check for disabled fieldset ancestors
  14664. return elem.isDisabled === disabled ||
  14665. // Where there is no isDisabled, check manually
  14666. /* jshint -W018 */
  14667. elem.isDisabled !== !disabled &&
  14668. inDisabledFieldset( elem ) === disabled;
  14669. }
  14670. return elem.disabled === disabled;
  14671. // Try to winnow out elements that can't be disabled before trusting the disabled property.
  14672. // Some victims get caught in our net (label, legend, menu, track), but it shouldn't
  14673. // even exist on them, let alone have a boolean value.
  14674. } else if ( "label" in elem ) {
  14675. return elem.disabled === disabled;
  14676. }
  14677. // Remaining elements are neither :enabled nor :disabled
  14678. return false;
  14679. };
  14680. }
  14681. /**
  14682. * Returns a function to use in pseudos for positionals
  14683. * @param {Function} fn
  14684. */
  14685. function createPositionalPseudo( fn ) {
  14686. return markFunction( function( argument ) {
  14687. argument = +argument;
  14688. return markFunction( function( seed, matches ) {
  14689. var j,
  14690. matchIndexes = fn( [], seed.length, argument ),
  14691. i = matchIndexes.length;
  14692. // Match elements found at the specified indexes
  14693. while ( i-- ) {
  14694. if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
  14695. seed[ j ] = !( matches[ j ] = seed[ j ] );
  14696. }
  14697. }
  14698. } );
  14699. } );
  14700. }
  14701. /**
  14702. * Checks a node for validity as a Sizzle context
  14703. * @param {Element|Object=} context
  14704. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  14705. */
  14706. function testContext( context ) {
  14707. return context && typeof context.getElementsByTagName !== "undefined" && context;
  14708. }
  14709. // Expose support vars for convenience
  14710. support = Sizzle.support = {};
  14711. /**
  14712. * Detects XML nodes
  14713. * @param {Element|Object} elem An element or a document
  14714. * @returns {Boolean} True iff elem is a non-HTML XML node
  14715. */
  14716. isXML = Sizzle.isXML = function( elem ) {
  14717. var namespace = elem.namespaceURI,
  14718. docElem = ( elem.ownerDocument || elem ).documentElement;
  14719. // Support: IE <=8
  14720. // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
  14721. // https://bugs.jquery.com/ticket/4833
  14722. return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
  14723. };
  14724. /**
  14725. * Sets document-related variables once based on the current document
  14726. * @param {Element|Object} [doc] An element or document object to use to set the document
  14727. * @returns {Object} Returns the current document
  14728. */
  14729. setDocument = Sizzle.setDocument = function( node ) {
  14730. var hasCompare, subWindow,
  14731. doc = node ? node.ownerDocument || node : preferredDoc;
  14732. // Return early if doc is invalid or already selected
  14733. // Support: IE 11+, Edge 17 - 18+
  14734. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  14735. // two documents; shallow comparisons work.
  14736. // eslint-disable-next-line eqeqeq
  14737. if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {
  14738. return document;
  14739. }
  14740. // Update global variables
  14741. document = doc;
  14742. docElem = document.documentElement;
  14743. documentIsHTML = !isXML( document );
  14744. // Support: IE 9 - 11+, Edge 12 - 18+
  14745. // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
  14746. // Support: IE 11+, Edge 17 - 18+
  14747. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  14748. // two documents; shallow comparisons work.
  14749. // eslint-disable-next-line eqeqeq
  14750. if ( preferredDoc != document &&
  14751. ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
  14752. // Support: IE 11, Edge
  14753. if ( subWindow.addEventListener ) {
  14754. subWindow.addEventListener( "unload", unloadHandler, false );
  14755. // Support: IE 9 - 10 only
  14756. } else if ( subWindow.attachEvent ) {
  14757. subWindow.attachEvent( "onunload", unloadHandler );
  14758. }
  14759. }
  14760. // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,
  14761. // Safari 4 - 5 only, Opera <=11.6 - 12.x only
  14762. // IE/Edge & older browsers don't support the :scope pseudo-class.
  14763. // Support: Safari 6.0 only
  14764. // Safari 6.0 supports :scope but it's an alias of :root there.
  14765. support.scope = assert( function( el ) {
  14766. docElem.appendChild( el ).appendChild( document.createElement( "div" ) );
  14767. return typeof el.querySelectorAll !== "undefined" &&
  14768. !el.querySelectorAll( ":scope fieldset div" ).length;
  14769. } );
  14770. /* Attributes
  14771. ---------------------------------------------------------------------- */
  14772. // Support: IE<8
  14773. // Verify that getAttribute really returns attributes and not properties
  14774. // (excepting IE8 booleans)
  14775. support.attributes = assert( function( el ) {
  14776. el.className = "i";
  14777. return !el.getAttribute( "className" );
  14778. } );
  14779. /* getElement(s)By*
  14780. ---------------------------------------------------------------------- */
  14781. // Check if getElementsByTagName("*") returns only elements
  14782. support.getElementsByTagName = assert( function( el ) {
  14783. el.appendChild( document.createComment( "" ) );
  14784. return !el.getElementsByTagName( "*" ).length;
  14785. } );
  14786. // Support: IE<9
  14787. support.getElementsByClassName = rnative.test( document.getElementsByClassName );
  14788. // Support: IE<10
  14789. // Check if getElementById returns elements by name
  14790. // The broken getElementById methods don't pick up programmatically-set names,
  14791. // so use a roundabout getElementsByName test
  14792. support.getById = assert( function( el ) {
  14793. docElem.appendChild( el ).id = expando;
  14794. return !document.getElementsByName || !document.getElementsByName( expando ).length;
  14795. } );
  14796. // ID filter and find
  14797. if ( support.getById ) {
  14798. Expr.filter[ "ID" ] = function( id ) {
  14799. var attrId = id.replace( runescape, funescape );
  14800. return function( elem ) {
  14801. return elem.getAttribute( "id" ) === attrId;
  14802. };
  14803. };
  14804. Expr.find[ "ID" ] = function( id, context ) {
  14805. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  14806. var elem = context.getElementById( id );
  14807. return elem ? [ elem ] : [];
  14808. }
  14809. };
  14810. } else {
  14811. Expr.filter[ "ID" ] = function( id ) {
  14812. var attrId = id.replace( runescape, funescape );
  14813. return function( elem ) {
  14814. var node = typeof elem.getAttributeNode !== "undefined" &&
  14815. elem.getAttributeNode( "id" );
  14816. return node && node.value === attrId;
  14817. };
  14818. };
  14819. // Support: IE 6 - 7 only
  14820. // getElementById is not reliable as a find shortcut
  14821. Expr.find[ "ID" ] = function( id, context ) {
  14822. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  14823. var node, i, elems,
  14824. elem = context.getElementById( id );
  14825. if ( elem ) {
  14826. // Verify the id attribute
  14827. node = elem.getAttributeNode( "id" );
  14828. if ( node && node.value === id ) {
  14829. return [ elem ];
  14830. }
  14831. // Fall back on getElementsByName
  14832. elems = context.getElementsByName( id );
  14833. i = 0;
  14834. while ( ( elem = elems[ i++ ] ) ) {
  14835. node = elem.getAttributeNode( "id" );
  14836. if ( node && node.value === id ) {
  14837. return [ elem ];
  14838. }
  14839. }
  14840. }
  14841. return [];
  14842. }
  14843. };
  14844. }
  14845. // Tag
  14846. Expr.find[ "TAG" ] = support.getElementsByTagName ?
  14847. function( tag, context ) {
  14848. if ( typeof context.getElementsByTagName !== "undefined" ) {
  14849. return context.getElementsByTagName( tag );
  14850. // DocumentFragment nodes don't have gEBTN
  14851. } else if ( support.qsa ) {
  14852. return context.querySelectorAll( tag );
  14853. }
  14854. } :
  14855. function( tag, context ) {
  14856. var elem,
  14857. tmp = [],
  14858. i = 0,
  14859. // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
  14860. results = context.getElementsByTagName( tag );
  14861. // Filter out possible comments
  14862. if ( tag === "*" ) {
  14863. while ( ( elem = results[ i++ ] ) ) {
  14864. if ( elem.nodeType === 1 ) {
  14865. tmp.push( elem );
  14866. }
  14867. }
  14868. return tmp;
  14869. }
  14870. return results;
  14871. };
  14872. // Class
  14873. Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) {
  14874. if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
  14875. return context.getElementsByClassName( className );
  14876. }
  14877. };
  14878. /* QSA/matchesSelector
  14879. ---------------------------------------------------------------------- */
  14880. // QSA and matchesSelector support
  14881. // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  14882. rbuggyMatches = [];
  14883. // qSa(:focus) reports false when true (Chrome 21)
  14884. // We allow this because of a bug in IE8/9 that throws an error
  14885. // whenever `document.activeElement` is accessed on an iframe
  14886. // So, we allow :focus to pass through QSA all the time to avoid the IE error
  14887. // See https://bugs.jquery.com/ticket/13378
  14888. rbuggyQSA = [];
  14889. if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {
  14890. // Build QSA regex
  14891. // Regex strategy adopted from Diego Perini
  14892. assert( function( el ) {
  14893. var input;
  14894. // Select is set to empty string on purpose
  14895. // This is to test IE's treatment of not explicitly
  14896. // setting a boolean content attribute,
  14897. // since its presence should be enough
  14898. // https://bugs.jquery.com/ticket/12359
  14899. docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" +
  14900. "<select id='" + expando + "-\r\\' msallowcapture=''>" +
  14901. "<option selected=''></option></select>";
  14902. // Support: IE8, Opera 11-12.16
  14903. // Nothing should be selected when empty strings follow ^= or $= or *=
  14904. // The test attribute must be unknown in Opera but "safe" for WinRT
  14905. // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  14906. if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) {
  14907. rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  14908. }
  14909. // Support: IE8
  14910. // Boolean attributes and "value" are not treated correctly
  14911. if ( !el.querySelectorAll( "[selected]" ).length ) {
  14912. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  14913. }
  14914. // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
  14915. if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  14916. rbuggyQSA.push( "~=" );
  14917. }
  14918. // Support: IE 11+, Edge 15 - 18+
  14919. // IE 11/Edge don't find elements on a `[name='']` query in some cases.
  14920. // Adding a temporary attribute to the document before the selection works
  14921. // around the issue.
  14922. // Interestingly, IE 10 & older don't seem to have the issue.
  14923. input = document.createElement( "input" );
  14924. input.setAttribute( "name", "" );
  14925. el.appendChild( input );
  14926. if ( !el.querySelectorAll( "[name='']" ).length ) {
  14927. rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
  14928. whitespace + "*(?:''|\"\")" );
  14929. }
  14930. // Webkit/Opera - :checked should return selected option elements
  14931. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  14932. // IE8 throws error here and will not see later tests
  14933. if ( !el.querySelectorAll( ":checked" ).length ) {
  14934. rbuggyQSA.push( ":checked" );
  14935. }
  14936. // Support: Safari 8+, iOS 8+
  14937. // https://bugs.webkit.org/show_bug.cgi?id=136851
  14938. // In-page `selector#id sibling-combinator selector` fails
  14939. if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
  14940. rbuggyQSA.push( ".#.+[+~]" );
  14941. }
  14942. // Support: Firefox <=3.6 - 5 only
  14943. // Old Firefox doesn't throw on a badly-escaped identifier.
  14944. el.querySelectorAll( "\\\f" );
  14945. rbuggyQSA.push( "[\\r\\n\\f]" );
  14946. } );
  14947. assert( function( el ) {
  14948. el.innerHTML = "<a href='' disabled='disabled'></a>" +
  14949. "<select disabled='disabled'><option/></select>";
  14950. // Support: Windows 8 Native Apps
  14951. // The type and name attributes are restricted during .innerHTML assignment
  14952. var input = document.createElement( "input" );
  14953. input.setAttribute( "type", "hidden" );
  14954. el.appendChild( input ).setAttribute( "name", "D" );
  14955. // Support: IE8
  14956. // Enforce case-sensitivity of name attribute
  14957. if ( el.querySelectorAll( "[name=d]" ).length ) {
  14958. rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  14959. }
  14960. // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  14961. // IE8 throws error here and will not see later tests
  14962. if ( el.querySelectorAll( ":enabled" ).length !== 2 ) {
  14963. rbuggyQSA.push( ":enabled", ":disabled" );
  14964. }
  14965. // Support: IE9-11+
  14966. // IE's :disabled selector does not pick up the children of disabled fieldsets
  14967. docElem.appendChild( el ).disabled = true;
  14968. if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
  14969. rbuggyQSA.push( ":enabled", ":disabled" );
  14970. }
  14971. // Support: Opera 10 - 11 only
  14972. // Opera 10-11 does not throw on post-comma invalid pseudos
  14973. el.querySelectorAll( "*,:x" );
  14974. rbuggyQSA.push( ",.*:" );
  14975. } );
  14976. }
  14977. if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||
  14978. docElem.webkitMatchesSelector ||
  14979. docElem.mozMatchesSelector ||
  14980. docElem.oMatchesSelector ||
  14981. docElem.msMatchesSelector ) ) ) ) {
  14982. assert( function( el ) {
  14983. // Check to see if it's possible to do matchesSelector
  14984. // on a disconnected node (IE 9)
  14985. support.disconnectedMatch = matches.call( el, "*" );
  14986. // This should fail with an exception
  14987. // Gecko does not error, returns false instead
  14988. matches.call( el, "[s!='']:x" );
  14989. rbuggyMatches.push( "!=", pseudos );
  14990. } );
  14991. }
  14992. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
  14993. rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );
  14994. /* Contains
  14995. ---------------------------------------------------------------------- */
  14996. hasCompare = rnative.test( docElem.compareDocumentPosition );
  14997. // Element contains another
  14998. // Purposefully self-exclusive
  14999. // As in, an element does not contain itself
  15000. contains = hasCompare || rnative.test( docElem.contains ) ?
  15001. function( a, b ) {
  15002. var adown = a.nodeType === 9 ? a.documentElement : a,
  15003. bup = b && b.parentNode;
  15004. return a === bup || !!( bup && bup.nodeType === 1 && (
  15005. adown.contains ?
  15006. adown.contains( bup ) :
  15007. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  15008. ) );
  15009. } :
  15010. function( a, b ) {
  15011. if ( b ) {
  15012. while ( ( b = b.parentNode ) ) {
  15013. if ( b === a ) {
  15014. return true;
  15015. }
  15016. }
  15017. }
  15018. return false;
  15019. };
  15020. /* Sorting
  15021. ---------------------------------------------------------------------- */
  15022. // Document order sorting
  15023. sortOrder = hasCompare ?
  15024. function( a, b ) {
  15025. // Flag for duplicate removal
  15026. if ( a === b ) {
  15027. hasDuplicate = true;
  15028. return 0;
  15029. }
  15030. // Sort on method existence if only one input has compareDocumentPosition
  15031. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  15032. if ( compare ) {
  15033. return compare;
  15034. }
  15035. // Calculate position if both inputs belong to the same document
  15036. // Support: IE 11+, Edge 17 - 18+
  15037. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  15038. // two documents; shallow comparisons work.
  15039. // eslint-disable-next-line eqeqeq
  15040. compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?
  15041. a.compareDocumentPosition( b ) :
  15042. // Otherwise we know they are disconnected
  15043. 1;
  15044. // Disconnected nodes
  15045. if ( compare & 1 ||
  15046. ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {
  15047. // Choose the first element that is related to our preferred document
  15048. // Support: IE 11+, Edge 17 - 18+
  15049. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  15050. // two documents; shallow comparisons work.
  15051. // eslint-disable-next-line eqeqeq
  15052. if ( a == document || a.ownerDocument == preferredDoc &&
  15053. contains( preferredDoc, a ) ) {
  15054. return -1;
  15055. }
  15056. // Support: IE 11+, Edge 17 - 18+
  15057. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  15058. // two documents; shallow comparisons work.
  15059. // eslint-disable-next-line eqeqeq
  15060. if ( b == document || b.ownerDocument == preferredDoc &&
  15061. contains( preferredDoc, b ) ) {
  15062. return 1;
  15063. }
  15064. // Maintain original order
  15065. return sortInput ?
  15066. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  15067. 0;
  15068. }
  15069. return compare & 4 ? -1 : 1;
  15070. } :
  15071. function( a, b ) {
  15072. // Exit early if the nodes are identical
  15073. if ( a === b ) {
  15074. hasDuplicate = true;
  15075. return 0;
  15076. }
  15077. var cur,
  15078. i = 0,
  15079. aup = a.parentNode,
  15080. bup = b.parentNode,
  15081. ap = [ a ],
  15082. bp = [ b ];
  15083. // Parentless nodes are either documents or disconnected
  15084. if ( !aup || !bup ) {
  15085. // Support: IE 11+, Edge 17 - 18+
  15086. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  15087. // two documents; shallow comparisons work.
  15088. /* eslint-disable eqeqeq */
  15089. return a == document ? -1 :
  15090. b == document ? 1 :
  15091. /* eslint-enable eqeqeq */
  15092. aup ? -1 :
  15093. bup ? 1 :
  15094. sortInput ?
  15095. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  15096. 0;
  15097. // If the nodes are siblings, we can do a quick check
  15098. } else if ( aup === bup ) {
  15099. return siblingCheck( a, b );
  15100. }
  15101. // Otherwise we need full lists of their ancestors for comparison
  15102. cur = a;
  15103. while ( ( cur = cur.parentNode ) ) {
  15104. ap.unshift( cur );
  15105. }
  15106. cur = b;
  15107. while ( ( cur = cur.parentNode ) ) {
  15108. bp.unshift( cur );
  15109. }
  15110. // Walk down the tree looking for a discrepancy
  15111. while ( ap[ i ] === bp[ i ] ) {
  15112. i++;
  15113. }
  15114. return i ?
  15115. // Do a sibling check if the nodes have a common ancestor
  15116. siblingCheck( ap[ i ], bp[ i ] ) :
  15117. // Otherwise nodes in our document sort first
  15118. // Support: IE 11+, Edge 17 - 18+
  15119. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  15120. // two documents; shallow comparisons work.
  15121. /* eslint-disable eqeqeq */
  15122. ap[ i ] == preferredDoc ? -1 :
  15123. bp[ i ] == preferredDoc ? 1 :
  15124. /* eslint-enable eqeqeq */
  15125. 0;
  15126. };
  15127. return document;
  15128. };
  15129. Sizzle.matches = function( expr, elements ) {
  15130. return Sizzle( expr, null, null, elements );
  15131. };
  15132. Sizzle.matchesSelector = function( elem, expr ) {
  15133. setDocument( elem );
  15134. if ( support.matchesSelector && documentIsHTML &&
  15135. !nonnativeSelectorCache[ expr + " " ] &&
  15136. ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  15137. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  15138. try {
  15139. var ret = matches.call( elem, expr );
  15140. // IE 9's matchesSelector returns false on disconnected nodes
  15141. if ( ret || support.disconnectedMatch ||
  15142. // As well, disconnected nodes are said to be in a document
  15143. // fragment in IE 9
  15144. elem.document && elem.document.nodeType !== 11 ) {
  15145. return ret;
  15146. }
  15147. } catch ( e ) {
  15148. nonnativeSelectorCache( expr, true );
  15149. }
  15150. }
  15151. return Sizzle( expr, document, null, [ elem ] ).length > 0;
  15152. };
  15153. Sizzle.contains = function( context, elem ) {
  15154. // Set document vars if needed
  15155. // Support: IE 11+, Edge 17 - 18+
  15156. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  15157. // two documents; shallow comparisons work.
  15158. // eslint-disable-next-line eqeqeq
  15159. if ( ( context.ownerDocument || context ) != document ) {
  15160. setDocument( context );
  15161. }
  15162. return contains( context, elem );
  15163. };
  15164. Sizzle.attr = function( elem, name ) {
  15165. // Set document vars if needed
  15166. // Support: IE 11+, Edge 17 - 18+
  15167. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  15168. // two documents; shallow comparisons work.
  15169. // eslint-disable-next-line eqeqeq
  15170. if ( ( elem.ownerDocument || elem ) != document ) {
  15171. setDocument( elem );
  15172. }
  15173. var fn = Expr.attrHandle[ name.toLowerCase() ],
  15174. // Don't get fooled by Object.prototype properties (jQuery #13807)
  15175. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  15176. fn( elem, name, !documentIsHTML ) :
  15177. undefined;
  15178. return val !== undefined ?
  15179. val :
  15180. support.attributes || !documentIsHTML ?
  15181. elem.getAttribute( name ) :
  15182. ( val = elem.getAttributeNode( name ) ) && val.specified ?
  15183. val.value :
  15184. null;
  15185. };
  15186. Sizzle.escape = function( sel ) {
  15187. return ( sel + "" ).replace( rcssescape, fcssescape );
  15188. };
  15189. Sizzle.error = function( msg ) {
  15190. throw new Error( "Syntax error, unrecognized expression: " + msg );
  15191. };
  15192. /**
  15193. * Document sorting and removing duplicates
  15194. * @param {ArrayLike} results
  15195. */
  15196. Sizzle.uniqueSort = function( results ) {
  15197. var elem,
  15198. duplicates = [],
  15199. j = 0,
  15200. i = 0;
  15201. // Unless we *know* we can detect duplicates, assume their presence
  15202. hasDuplicate = !support.detectDuplicates;
  15203. sortInput = !support.sortStable && results.slice( 0 );
  15204. results.sort( sortOrder );
  15205. if ( hasDuplicate ) {
  15206. while ( ( elem = results[ i++ ] ) ) {
  15207. if ( elem === results[ i ] ) {
  15208. j = duplicates.push( i );
  15209. }
  15210. }
  15211. while ( j-- ) {
  15212. results.splice( duplicates[ j ], 1 );
  15213. }
  15214. }
  15215. // Clear input after sorting to release objects
  15216. // See https://github.com/jquery/sizzle/pull/225
  15217. sortInput = null;
  15218. return results;
  15219. };
  15220. /**
  15221. * Utility function for retrieving the text value of an array of DOM nodes
  15222. * @param {Array|Element} elem
  15223. */
  15224. getText = Sizzle.getText = function( elem ) {
  15225. var node,
  15226. ret = "",
  15227. i = 0,
  15228. nodeType = elem.nodeType;
  15229. if ( !nodeType ) {
  15230. // If no nodeType, this is expected to be an array
  15231. while ( ( node = elem[ i++ ] ) ) {
  15232. // Do not traverse comment nodes
  15233. ret += getText( node );
  15234. }
  15235. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  15236. // Use textContent for elements
  15237. // innerText usage removed for consistency of new lines (jQuery #11153)
  15238. if ( typeof elem.textContent === "string" ) {
  15239. return elem.textContent;
  15240. } else {
  15241. // Traverse its children
  15242. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  15243. ret += getText( elem );
  15244. }
  15245. }
  15246. } else if ( nodeType === 3 || nodeType === 4 ) {
  15247. return elem.nodeValue;
  15248. }
  15249. // Do not include comment or processing instruction nodes
  15250. return ret;
  15251. };
  15252. Expr = Sizzle.selectors = {
  15253. // Can be adjusted by the user
  15254. cacheLength: 50,
  15255. createPseudo: markFunction,
  15256. match: matchExpr,
  15257. attrHandle: {},
  15258. find: {},
  15259. relative: {
  15260. ">": { dir: "parentNode", first: true },
  15261. " ": { dir: "parentNode" },
  15262. "+": { dir: "previousSibling", first: true },
  15263. "~": { dir: "previousSibling" }
  15264. },
  15265. preFilter: {
  15266. "ATTR": function( match ) {
  15267. match[ 1 ] = match[ 1 ].replace( runescape, funescape );
  15268. // Move the given value to match[3] whether quoted or unquoted
  15269. match[ 3 ] = ( match[ 3 ] || match[ 4 ] ||
  15270. match[ 5 ] || "" ).replace( runescape, funescape );
  15271. if ( match[ 2 ] === "~=" ) {
  15272. match[ 3 ] = " " + match[ 3 ] + " ";
  15273. }
  15274. return match.slice( 0, 4 );
  15275. },
  15276. "CHILD": function( match ) {
  15277. /* matches from matchExpr["CHILD"]
  15278. 1 type (only|nth|...)
  15279. 2 what (child|of-type)
  15280. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  15281. 4 xn-component of xn+y argument ([+-]?\d*n|)
  15282. 5 sign of xn-component
  15283. 6 x of xn-component
  15284. 7 sign of y-component
  15285. 8 y of y-component
  15286. */
  15287. match[ 1 ] = match[ 1 ].toLowerCase();
  15288. if ( match[ 1 ].slice( 0, 3 ) === "nth" ) {
  15289. // nth-* requires argument
  15290. if ( !match[ 3 ] ) {
  15291. Sizzle.error( match[ 0 ] );
  15292. }
  15293. // numeric x and y parameters for Expr.filter.CHILD
  15294. // remember that false/true cast respectively to 0/1
  15295. match[ 4 ] = +( match[ 4 ] ?
  15296. match[ 5 ] + ( match[ 6 ] || 1 ) :
  15297. 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) );
  15298. match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );
  15299. // other types prohibit arguments
  15300. } else if ( match[ 3 ] ) {
  15301. Sizzle.error( match[ 0 ] );
  15302. }
  15303. return match;
  15304. },
  15305. "PSEUDO": function( match ) {
  15306. var excess,
  15307. unquoted = !match[ 6 ] && match[ 2 ];
  15308. if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) {
  15309. return null;
  15310. }
  15311. // Accept quoted arguments as-is
  15312. if ( match[ 3 ] ) {
  15313. match[ 2 ] = match[ 4 ] || match[ 5 ] || "";
  15314. // Strip excess characters from unquoted arguments
  15315. } else if ( unquoted && rpseudo.test( unquoted ) &&
  15316. // Get excess from tokenize (recursively)
  15317. ( excess = tokenize( unquoted, true ) ) &&
  15318. // advance to the next closing parenthesis
  15319. ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {
  15320. // excess is a negative index
  15321. match[ 0 ] = match[ 0 ].slice( 0, excess );
  15322. match[ 2 ] = unquoted.slice( 0, excess );
  15323. }
  15324. // Return only captures needed by the pseudo filter method (type and argument)
  15325. return match.slice( 0, 3 );
  15326. }
  15327. },
  15328. filter: {
  15329. "TAG": function( nodeNameSelector ) {
  15330. var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  15331. return nodeNameSelector === "*" ?
  15332. function() {
  15333. return true;
  15334. } :
  15335. function( elem ) {
  15336. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  15337. };
  15338. },
  15339. "CLASS": function( className ) {
  15340. var pattern = classCache[ className + " " ];
  15341. return pattern ||
  15342. ( pattern = new RegExp( "(^|" + whitespace +
  15343. ")" + className + "(" + whitespace + "|$)" ) ) && classCache(
  15344. className, function( elem ) {
  15345. return pattern.test(
  15346. typeof elem.className === "string" && elem.className ||
  15347. typeof elem.getAttribute !== "undefined" &&
  15348. elem.getAttribute( "class" ) ||
  15349. ""
  15350. );
  15351. } );
  15352. },
  15353. "ATTR": function( name, operator, check ) {
  15354. return function( elem ) {
  15355. var result = Sizzle.attr( elem, name );
  15356. if ( result == null ) {
  15357. return operator === "!=";
  15358. }
  15359. if ( !operator ) {
  15360. return true;
  15361. }
  15362. result += "";
  15363. /* eslint-disable max-len */
  15364. return operator === "=" ? result === check :
  15365. operator === "!=" ? result !== check :
  15366. operator === "^=" ? check && result.indexOf( check ) === 0 :
  15367. operator === "*=" ? check && result.indexOf( check ) > -1 :
  15368. operator === "$=" ? check && result.slice( -check.length ) === check :
  15369. operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
  15370. operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  15371. false;
  15372. /* eslint-enable max-len */
  15373. };
  15374. },
  15375. "CHILD": function( type, what, _argument, first, last ) {
  15376. var simple = type.slice( 0, 3 ) !== "nth",
  15377. forward = type.slice( -4 ) !== "last",
  15378. ofType = what === "of-type";
  15379. return first === 1 && last === 0 ?
  15380. // Shortcut for :nth-*(n)
  15381. function( elem ) {
  15382. return !!elem.parentNode;
  15383. } :
  15384. function( elem, _context, xml ) {
  15385. var cache, uniqueCache, outerCache, node, nodeIndex, start,
  15386. dir = simple !== forward ? "nextSibling" : "previousSibling",
  15387. parent = elem.parentNode,
  15388. name = ofType && elem.nodeName.toLowerCase(),
  15389. useCache = !xml && !ofType,
  15390. diff = false;
  15391. if ( parent ) {
  15392. // :(first|last|only)-(child|of-type)
  15393. if ( simple ) {
  15394. while ( dir ) {
  15395. node = elem;
  15396. while ( ( node = node[ dir ] ) ) {
  15397. if ( ofType ?
  15398. node.nodeName.toLowerCase() === name :
  15399. node.nodeType === 1 ) {
  15400. return false;
  15401. }
  15402. }
  15403. // Reverse direction for :only-* (if we haven't yet done so)
  15404. start = dir = type === "only" && !start && "nextSibling";
  15405. }
  15406. return true;
  15407. }
  15408. start = [ forward ? parent.firstChild : parent.lastChild ];
  15409. // non-xml :nth-child(...) stores cache data on `parent`
  15410. if ( forward && useCache ) {
  15411. // Seek `elem` from a previously-cached index
  15412. // ...in a gzip-friendly way
  15413. node = parent;
  15414. outerCache = node[ expando ] || ( node[ expando ] = {} );
  15415. // Support: IE <9 only
  15416. // Defend against cloned attroperties (jQuery gh-1709)
  15417. uniqueCache = outerCache[ node.uniqueID ] ||
  15418. ( outerCache[ node.uniqueID ] = {} );
  15419. cache = uniqueCache[ type ] || [];
  15420. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  15421. diff = nodeIndex && cache[ 2 ];
  15422. node = nodeIndex && parent.childNodes[ nodeIndex ];
  15423. while ( ( node = ++nodeIndex && node && node[ dir ] ||
  15424. // Fallback to seeking `elem` from the start
  15425. ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  15426. // When found, cache indexes on `parent` and break
  15427. if ( node.nodeType === 1 && ++diff && node === elem ) {
  15428. uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
  15429. break;
  15430. }
  15431. }
  15432. } else {
  15433. // Use previously-cached element index if available
  15434. if ( useCache ) {
  15435. // ...in a gzip-friendly way
  15436. node = elem;
  15437. outerCache = node[ expando ] || ( node[ expando ] = {} );
  15438. // Support: IE <9 only
  15439. // Defend against cloned attroperties (jQuery gh-1709)
  15440. uniqueCache = outerCache[ node.uniqueID ] ||
  15441. ( outerCache[ node.uniqueID ] = {} );
  15442. cache = uniqueCache[ type ] || [];
  15443. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  15444. diff = nodeIndex;
  15445. }
  15446. // xml :nth-child(...)
  15447. // or :nth-last-child(...) or :nth(-last)?-of-type(...)
  15448. if ( diff === false ) {
  15449. // Use the same loop as above to seek `elem` from the start
  15450. while ( ( node = ++nodeIndex && node && node[ dir ] ||
  15451. ( diff = nodeIndex = 0 ) || start.pop() ) ) {
  15452. if ( ( ofType ?
  15453. node.nodeName.toLowerCase() === name :
  15454. node.nodeType === 1 ) &&
  15455. ++diff ) {
  15456. // Cache the index of each encountered element
  15457. if ( useCache ) {
  15458. outerCache = node[ expando ] ||
  15459. ( node[ expando ] = {} );
  15460. // Support: IE <9 only
  15461. // Defend against cloned attroperties (jQuery gh-1709)
  15462. uniqueCache = outerCache[ node.uniqueID ] ||
  15463. ( outerCache[ node.uniqueID ] = {} );
  15464. uniqueCache[ type ] = [ dirruns, diff ];
  15465. }
  15466. if ( node === elem ) {
  15467. break;
  15468. }
  15469. }
  15470. }
  15471. }
  15472. }
  15473. // Incorporate the offset, then check against cycle size
  15474. diff -= last;
  15475. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  15476. }
  15477. };
  15478. },
  15479. "PSEUDO": function( pseudo, argument ) {
  15480. // pseudo-class names are case-insensitive
  15481. // http://www.w3.org/TR/selectors/#pseudo-classes
  15482. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  15483. // Remember that setFilters inherits from pseudos
  15484. var args,
  15485. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  15486. Sizzle.error( "unsupported pseudo: " + pseudo );
  15487. // The user may use createPseudo to indicate that
  15488. // arguments are needed to create the filter function
  15489. // just as Sizzle does
  15490. if ( fn[ expando ] ) {
  15491. return fn( argument );
  15492. }
  15493. // But maintain support for old signatures
  15494. if ( fn.length > 1 ) {
  15495. args = [ pseudo, pseudo, "", argument ];
  15496. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  15497. markFunction( function( seed, matches ) {
  15498. var idx,
  15499. matched = fn( seed, argument ),
  15500. i = matched.length;
  15501. while ( i-- ) {
  15502. idx = indexOf( seed, matched[ i ] );
  15503. seed[ idx ] = !( matches[ idx ] = matched[ i ] );
  15504. }
  15505. } ) :
  15506. function( elem ) {
  15507. return fn( elem, 0, args );
  15508. };
  15509. }
  15510. return fn;
  15511. }
  15512. },
  15513. pseudos: {
  15514. // Potentially complex pseudos
  15515. "not": markFunction( function( selector ) {
  15516. // Trim the selector passed to compile
  15517. // to avoid treating leading and trailing
  15518. // spaces as combinators
  15519. var input = [],
  15520. results = [],
  15521. matcher = compile( selector.replace( rtrim, "$1" ) );
  15522. return matcher[ expando ] ?
  15523. markFunction( function( seed, matches, _context, xml ) {
  15524. var elem,
  15525. unmatched = matcher( seed, null, xml, [] ),
  15526. i = seed.length;
  15527. // Match elements unmatched by `matcher`
  15528. while ( i-- ) {
  15529. if ( ( elem = unmatched[ i ] ) ) {
  15530. seed[ i ] = !( matches[ i ] = elem );
  15531. }
  15532. }
  15533. } ) :
  15534. function( elem, _context, xml ) {
  15535. input[ 0 ] = elem;
  15536. matcher( input, null, xml, results );
  15537. // Don't keep the element (issue #299)
  15538. input[ 0 ] = null;
  15539. return !results.pop();
  15540. };
  15541. } ),
  15542. "has": markFunction( function( selector ) {
  15543. return function( elem ) {
  15544. return Sizzle( selector, elem ).length > 0;
  15545. };
  15546. } ),
  15547. "contains": markFunction( function( text ) {
  15548. text = text.replace( runescape, funescape );
  15549. return function( elem ) {
  15550. return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
  15551. };
  15552. } ),
  15553. // "Whether an element is represented by a :lang() selector
  15554. // is based solely on the element's language value
  15555. // being equal to the identifier C,
  15556. // or beginning with the identifier C immediately followed by "-".
  15557. // The matching of C against the element's language value is performed case-insensitively.
  15558. // The identifier C does not have to be a valid language name."
  15559. // http://www.w3.org/TR/selectors/#lang-pseudo
  15560. "lang": markFunction( function( lang ) {
  15561. // lang value must be a valid identifier
  15562. if ( !ridentifier.test( lang || "" ) ) {
  15563. Sizzle.error( "unsupported lang: " + lang );
  15564. }
  15565. lang = lang.replace( runescape, funescape ).toLowerCase();
  15566. return function( elem ) {
  15567. var elemLang;
  15568. do {
  15569. if ( ( elemLang = documentIsHTML ?
  15570. elem.lang :
  15571. elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {
  15572. elemLang = elemLang.toLowerCase();
  15573. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  15574. }
  15575. } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );
  15576. return false;
  15577. };
  15578. } ),
  15579. // Miscellaneous
  15580. "target": function( elem ) {
  15581. var hash = window.location && window.location.hash;
  15582. return hash && hash.slice( 1 ) === elem.id;
  15583. },
  15584. "root": function( elem ) {
  15585. return elem === docElem;
  15586. },
  15587. "focus": function( elem ) {
  15588. return elem === document.activeElement &&
  15589. ( !document.hasFocus || document.hasFocus() ) &&
  15590. !!( elem.type || elem.href || ~elem.tabIndex );
  15591. },
  15592. // Boolean properties
  15593. "enabled": createDisabledPseudo( false ),
  15594. "disabled": createDisabledPseudo( true ),
  15595. "checked": function( elem ) {
  15596. // In CSS3, :checked should return both checked and selected elements
  15597. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  15598. var nodeName = elem.nodeName.toLowerCase();
  15599. return ( nodeName === "input" && !!elem.checked ) ||
  15600. ( nodeName === "option" && !!elem.selected );
  15601. },
  15602. "selected": function( elem ) {
  15603. // Accessing this property makes selected-by-default
  15604. // options in Safari work properly
  15605. if ( elem.parentNode ) {
  15606. // eslint-disable-next-line no-unused-expressions
  15607. elem.parentNode.selectedIndex;
  15608. }
  15609. return elem.selected === true;
  15610. },
  15611. // Contents
  15612. "empty": function( elem ) {
  15613. // http://www.w3.org/TR/selectors/#empty-pseudo
  15614. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  15615. // but not by others (comment: 8; processing instruction: 7; etc.)
  15616. // nodeType < 6 works because attributes (2) do not appear as children
  15617. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  15618. if ( elem.nodeType < 6 ) {
  15619. return false;
  15620. }
  15621. }
  15622. return true;
  15623. },
  15624. "parent": function( elem ) {
  15625. return !Expr.pseudos[ "empty" ]( elem );
  15626. },
  15627. // Element/input types
  15628. "header": function( elem ) {
  15629. return rheader.test( elem.nodeName );
  15630. },
  15631. "input": function( elem ) {
  15632. return rinputs.test( elem.nodeName );
  15633. },
  15634. "button": function( elem ) {
  15635. var name = elem.nodeName.toLowerCase();
  15636. return name === "input" && elem.type === "button" || name === "button";
  15637. },
  15638. "text": function( elem ) {
  15639. var attr;
  15640. return elem.nodeName.toLowerCase() === "input" &&
  15641. elem.type === "text" &&
  15642. // Support: IE<8
  15643. // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  15644. ( ( attr = elem.getAttribute( "type" ) ) == null ||
  15645. attr.toLowerCase() === "text" );
  15646. },
  15647. // Position-in-collection
  15648. "first": createPositionalPseudo( function() {
  15649. return [ 0 ];
  15650. } ),
  15651. "last": createPositionalPseudo( function( _matchIndexes, length ) {
  15652. return [ length - 1 ];
  15653. } ),
  15654. "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) {
  15655. return [ argument < 0 ? argument + length : argument ];
  15656. } ),
  15657. "even": createPositionalPseudo( function( matchIndexes, length ) {
  15658. var i = 0;
  15659. for ( ; i < length; i += 2 ) {
  15660. matchIndexes.push( i );
  15661. }
  15662. return matchIndexes;
  15663. } ),
  15664. "odd": createPositionalPseudo( function( matchIndexes, length ) {
  15665. var i = 1;
  15666. for ( ; i < length; i += 2 ) {
  15667. matchIndexes.push( i );
  15668. }
  15669. return matchIndexes;
  15670. } ),
  15671. "lt": createPositionalPseudo( function( matchIndexes, length, argument ) {
  15672. var i = argument < 0 ?
  15673. argument + length :
  15674. argument > length ?
  15675. length :
  15676. argument;
  15677. for ( ; --i >= 0; ) {
  15678. matchIndexes.push( i );
  15679. }
  15680. return matchIndexes;
  15681. } ),
  15682. "gt": createPositionalPseudo( function( matchIndexes, length, argument ) {
  15683. var i = argument < 0 ? argument + length : argument;
  15684. for ( ; ++i < length; ) {
  15685. matchIndexes.push( i );
  15686. }
  15687. return matchIndexes;
  15688. } )
  15689. }
  15690. };
  15691. Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ];
  15692. // Add button/input type pseudos
  15693. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  15694. Expr.pseudos[ i ] = createInputPseudo( i );
  15695. }
  15696. for ( i in { submit: true, reset: true } ) {
  15697. Expr.pseudos[ i ] = createButtonPseudo( i );
  15698. }
  15699. // Easy API for creating new setFilters
  15700. function setFilters() {}
  15701. setFilters.prototype = Expr.filters = Expr.pseudos;
  15702. Expr.setFilters = new setFilters();
  15703. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  15704. var matched, match, tokens, type,
  15705. soFar, groups, preFilters,
  15706. cached = tokenCache[ selector + " " ];
  15707. if ( cached ) {
  15708. return parseOnly ? 0 : cached.slice( 0 );
  15709. }
  15710. soFar = selector;
  15711. groups = [];
  15712. preFilters = Expr.preFilter;
  15713. while ( soFar ) {
  15714. // Comma and first run
  15715. if ( !matched || ( match = rcomma.exec( soFar ) ) ) {
  15716. if ( match ) {
  15717. // Don't consume trailing commas as valid
  15718. soFar = soFar.slice( match[ 0 ].length ) || soFar;
  15719. }
  15720. groups.push( ( tokens = [] ) );
  15721. }
  15722. matched = false;
  15723. // Combinators
  15724. if ( ( match = rcombinators.exec( soFar ) ) ) {
  15725. matched = match.shift();
  15726. tokens.push( {
  15727. value: matched,
  15728. // Cast descendant combinators to space
  15729. type: match[ 0 ].replace( rtrim, " " )
  15730. } );
  15731. soFar = soFar.slice( matched.length );
  15732. }
  15733. // Filters
  15734. for ( type in Expr.filter ) {
  15735. if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||
  15736. ( match = preFilters[ type ]( match ) ) ) ) {
  15737. matched = match.shift();
  15738. tokens.push( {
  15739. value: matched,
  15740. type: type,
  15741. matches: match
  15742. } );
  15743. soFar = soFar.slice( matched.length );
  15744. }
  15745. }
  15746. if ( !matched ) {
  15747. break;
  15748. }
  15749. }
  15750. // Return the length of the invalid excess
  15751. // if we're just parsing
  15752. // Otherwise, throw an error or return tokens
  15753. return parseOnly ?
  15754. soFar.length :
  15755. soFar ?
  15756. Sizzle.error( selector ) :
  15757. // Cache the tokens
  15758. tokenCache( selector, groups ).slice( 0 );
  15759. };
  15760. function toSelector( tokens ) {
  15761. var i = 0,
  15762. len = tokens.length,
  15763. selector = "";
  15764. for ( ; i < len; i++ ) {
  15765. selector += tokens[ i ].value;
  15766. }
  15767. return selector;
  15768. }
  15769. function addCombinator( matcher, combinator, base ) {
  15770. var dir = combinator.dir,
  15771. skip = combinator.next,
  15772. key = skip || dir,
  15773. checkNonElements = base && key === "parentNode",
  15774. doneName = done++;
  15775. return combinator.first ?
  15776. // Check against closest ancestor/preceding element
  15777. function( elem, context, xml ) {
  15778. while ( ( elem = elem[ dir ] ) ) {
  15779. if ( elem.nodeType === 1 || checkNonElements ) {
  15780. return matcher( elem, context, xml );
  15781. }
  15782. }
  15783. return false;
  15784. } :
  15785. // Check against all ancestor/preceding elements
  15786. function( elem, context, xml ) {
  15787. var oldCache, uniqueCache, outerCache,
  15788. newCache = [ dirruns, doneName ];
  15789. // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
  15790. if ( xml ) {
  15791. while ( ( elem = elem[ dir ] ) ) {
  15792. if ( elem.nodeType === 1 || checkNonElements ) {
  15793. if ( matcher( elem, context, xml ) ) {
  15794. return true;
  15795. }
  15796. }
  15797. }
  15798. } else {
  15799. while ( ( elem = elem[ dir ] ) ) {
  15800. if ( elem.nodeType === 1 || checkNonElements ) {
  15801. outerCache = elem[ expando ] || ( elem[ expando ] = {} );
  15802. // Support: IE <9 only
  15803. // Defend against cloned attroperties (jQuery gh-1709)
  15804. uniqueCache = outerCache[ elem.uniqueID ] ||
  15805. ( outerCache[ elem.uniqueID ] = {} );
  15806. if ( skip && skip === elem.nodeName.toLowerCase() ) {
  15807. elem = elem[ dir ] || elem;
  15808. } else if ( ( oldCache = uniqueCache[ key ] ) &&
  15809. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  15810. // Assign to newCache so results back-propagate to previous elements
  15811. return ( newCache[ 2 ] = oldCache[ 2 ] );
  15812. } else {
  15813. // Reuse newcache so results back-propagate to previous elements
  15814. uniqueCache[ key ] = newCache;
  15815. // A match means we're done; a fail means we have to keep checking
  15816. if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
  15817. return true;
  15818. }
  15819. }
  15820. }
  15821. }
  15822. }
  15823. return false;
  15824. };
  15825. }
  15826. function elementMatcher( matchers ) {
  15827. return matchers.length > 1 ?
  15828. function( elem, context, xml ) {
  15829. var i = matchers.length;
  15830. while ( i-- ) {
  15831. if ( !matchers[ i ]( elem, context, xml ) ) {
  15832. return false;
  15833. }
  15834. }
  15835. return true;
  15836. } :
  15837. matchers[ 0 ];
  15838. }
  15839. function multipleContexts( selector, contexts, results ) {
  15840. var i = 0,
  15841. len = contexts.length;
  15842. for ( ; i < len; i++ ) {
  15843. Sizzle( selector, contexts[ i ], results );
  15844. }
  15845. return results;
  15846. }
  15847. function condense( unmatched, map, filter, context, xml ) {
  15848. var elem,
  15849. newUnmatched = [],
  15850. i = 0,
  15851. len = unmatched.length,
  15852. mapped = map != null;
  15853. for ( ; i < len; i++ ) {
  15854. if ( ( elem = unmatched[ i ] ) ) {
  15855. if ( !filter || filter( elem, context, xml ) ) {
  15856. newUnmatched.push( elem );
  15857. if ( mapped ) {
  15858. map.push( i );
  15859. }
  15860. }
  15861. }
  15862. }
  15863. return newUnmatched;
  15864. }
  15865. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  15866. if ( postFilter && !postFilter[ expando ] ) {
  15867. postFilter = setMatcher( postFilter );
  15868. }
  15869. if ( postFinder && !postFinder[ expando ] ) {
  15870. postFinder = setMatcher( postFinder, postSelector );
  15871. }
  15872. return markFunction( function( seed, results, context, xml ) {
  15873. var temp, i, elem,
  15874. preMap = [],
  15875. postMap = [],
  15876. preexisting = results.length,
  15877. // Get initial elements from seed or context
  15878. elems = seed || multipleContexts(
  15879. selector || "*",
  15880. context.nodeType ? [ context ] : context,
  15881. []
  15882. ),
  15883. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  15884. matcherIn = preFilter && ( seed || !selector ) ?
  15885. condense( elems, preMap, preFilter, context, xml ) :
  15886. elems,
  15887. matcherOut = matcher ?
  15888. // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  15889. postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  15890. // ...intermediate processing is necessary
  15891. [] :
  15892. // ...otherwise use results directly
  15893. results :
  15894. matcherIn;
  15895. // Find primary matches
  15896. if ( matcher ) {
  15897. matcher( matcherIn, matcherOut, context, xml );
  15898. }
  15899. // Apply postFilter
  15900. if ( postFilter ) {
  15901. temp = condense( matcherOut, postMap );
  15902. postFilter( temp, [], context, xml );
  15903. // Un-match failing elements by moving them back to matcherIn
  15904. i = temp.length;
  15905. while ( i-- ) {
  15906. if ( ( elem = temp[ i ] ) ) {
  15907. matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );
  15908. }
  15909. }
  15910. }
  15911. if ( seed ) {
  15912. if ( postFinder || preFilter ) {
  15913. if ( postFinder ) {
  15914. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  15915. temp = [];
  15916. i = matcherOut.length;
  15917. while ( i-- ) {
  15918. if ( ( elem = matcherOut[ i ] ) ) {
  15919. // Restore matcherIn since elem is not yet a final match
  15920. temp.push( ( matcherIn[ i ] = elem ) );
  15921. }
  15922. }
  15923. postFinder( null, ( matcherOut = [] ), temp, xml );
  15924. }
  15925. // Move matched elements from seed to results to keep them synchronized
  15926. i = matcherOut.length;
  15927. while ( i-- ) {
  15928. if ( ( elem = matcherOut[ i ] ) &&
  15929. ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {
  15930. seed[ temp ] = !( results[ temp ] = elem );
  15931. }
  15932. }
  15933. }
  15934. // Add elements to results, through postFinder if defined
  15935. } else {
  15936. matcherOut = condense(
  15937. matcherOut === results ?
  15938. matcherOut.splice( preexisting, matcherOut.length ) :
  15939. matcherOut
  15940. );
  15941. if ( postFinder ) {
  15942. postFinder( null, results, matcherOut, xml );
  15943. } else {
  15944. push.apply( results, matcherOut );
  15945. }
  15946. }
  15947. } );
  15948. }
  15949. function matcherFromTokens( tokens ) {
  15950. var checkContext, matcher, j,
  15951. len = tokens.length,
  15952. leadingRelative = Expr.relative[ tokens[ 0 ].type ],
  15953. implicitRelative = leadingRelative || Expr.relative[ " " ],
  15954. i = leadingRelative ? 1 : 0,
  15955. // The foundational matcher ensures that elements are reachable from top-level context(s)
  15956. matchContext = addCombinator( function( elem ) {
  15957. return elem === checkContext;
  15958. }, implicitRelative, true ),
  15959. matchAnyContext = addCombinator( function( elem ) {
  15960. return indexOf( checkContext, elem ) > -1;
  15961. }, implicitRelative, true ),
  15962. matchers = [ function( elem, context, xml ) {
  15963. var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  15964. ( checkContext = context ).nodeType ?
  15965. matchContext( elem, context, xml ) :
  15966. matchAnyContext( elem, context, xml ) );
  15967. // Avoid hanging onto element (issue #299)
  15968. checkContext = null;
  15969. return ret;
  15970. } ];
  15971. for ( ; i < len; i++ ) {
  15972. if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {
  15973. matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
  15974. } else {
  15975. matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );
  15976. // Return special upon seeing a positional matcher
  15977. if ( matcher[ expando ] ) {
  15978. // Find the next relative operator (if any) for proper handling
  15979. j = ++i;
  15980. for ( ; j < len; j++ ) {
  15981. if ( Expr.relative[ tokens[ j ].type ] ) {
  15982. break;
  15983. }
  15984. }
  15985. return setMatcher(
  15986. i > 1 && elementMatcher( matchers ),
  15987. i > 1 && toSelector(
  15988. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  15989. tokens
  15990. .slice( 0, i - 1 )
  15991. .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
  15992. ).replace( rtrim, "$1" ),
  15993. matcher,
  15994. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  15995. j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
  15996. j < len && toSelector( tokens )
  15997. );
  15998. }
  15999. matchers.push( matcher );
  16000. }
  16001. }
  16002. return elementMatcher( matchers );
  16003. }
  16004. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  16005. var bySet = setMatchers.length > 0,
  16006. byElement = elementMatchers.length > 0,
  16007. superMatcher = function( seed, context, xml, results, outermost ) {
  16008. var elem, j, matcher,
  16009. matchedCount = 0,
  16010. i = "0",
  16011. unmatched = seed && [],
  16012. setMatched = [],
  16013. contextBackup = outermostContext,
  16014. // We must always have either seed elements or outermost context
  16015. elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ),
  16016. // Use integer dirruns iff this is the outermost matcher
  16017. dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
  16018. len = elems.length;
  16019. if ( outermost ) {
  16020. // Support: IE 11+, Edge 17 - 18+
  16021. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  16022. // two documents; shallow comparisons work.
  16023. // eslint-disable-next-line eqeqeq
  16024. outermostContext = context == document || context || outermost;
  16025. }
  16026. // Add elements passing elementMatchers directly to results
  16027. // Support: IE<9, Safari
  16028. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  16029. for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) {
  16030. if ( byElement && elem ) {
  16031. j = 0;
  16032. // Support: IE 11+, Edge 17 - 18+
  16033. // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
  16034. // two documents; shallow comparisons work.
  16035. // eslint-disable-next-line eqeqeq
  16036. if ( !context && elem.ownerDocument != document ) {
  16037. setDocument( elem );
  16038. xml = !documentIsHTML;
  16039. }
  16040. while ( ( matcher = elementMatchers[ j++ ] ) ) {
  16041. if ( matcher( elem, context || document, xml ) ) {
  16042. results.push( elem );
  16043. break;
  16044. }
  16045. }
  16046. if ( outermost ) {
  16047. dirruns = dirrunsUnique;
  16048. }
  16049. }
  16050. // Track unmatched elements for set filters
  16051. if ( bySet ) {
  16052. // They will have gone through all possible matchers
  16053. if ( ( elem = !matcher && elem ) ) {
  16054. matchedCount--;
  16055. }
  16056. // Lengthen the array for every element, matched or not
  16057. if ( seed ) {
  16058. unmatched.push( elem );
  16059. }
  16060. }
  16061. }
  16062. // `i` is now the count of elements visited above, and adding it to `matchedCount`
  16063. // makes the latter nonnegative.
  16064. matchedCount += i;
  16065. // Apply set filters to unmatched elements
  16066. // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
  16067. // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
  16068. // no element matchers and no seed.
  16069. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
  16070. // case, which will result in a "00" `matchedCount` that differs from `i` but is also
  16071. // numerically zero.
  16072. if ( bySet && i !== matchedCount ) {
  16073. j = 0;
  16074. while ( ( matcher = setMatchers[ j++ ] ) ) {
  16075. matcher( unmatched, setMatched, context, xml );
  16076. }
  16077. if ( seed ) {
  16078. // Reintegrate element matches to eliminate the need for sorting
  16079. if ( matchedCount > 0 ) {
  16080. while ( i-- ) {
  16081. if ( !( unmatched[ i ] || setMatched[ i ] ) ) {
  16082. setMatched[ i ] = pop.call( results );
  16083. }
  16084. }
  16085. }
  16086. // Discard index placeholder values to get only actual matches
  16087. setMatched = condense( setMatched );
  16088. }
  16089. // Add matches to results
  16090. push.apply( results, setMatched );
  16091. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  16092. if ( outermost && !seed && setMatched.length > 0 &&
  16093. ( matchedCount + setMatchers.length ) > 1 ) {
  16094. Sizzle.uniqueSort( results );
  16095. }
  16096. }
  16097. // Override manipulation of globals by nested matchers
  16098. if ( outermost ) {
  16099. dirruns = dirrunsUnique;
  16100. outermostContext = contextBackup;
  16101. }
  16102. return unmatched;
  16103. };
  16104. return bySet ?
  16105. markFunction( superMatcher ) :
  16106. superMatcher;
  16107. }
  16108. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  16109. var i,
  16110. setMatchers = [],
  16111. elementMatchers = [],
  16112. cached = compilerCache[ selector + " " ];
  16113. if ( !cached ) {
  16114. // Generate a function of recursive functions that can be used to check each element
  16115. if ( !match ) {
  16116. match = tokenize( selector );
  16117. }
  16118. i = match.length;
  16119. while ( i-- ) {
  16120. cached = matcherFromTokens( match[ i ] );
  16121. if ( cached[ expando ] ) {
  16122. setMatchers.push( cached );
  16123. } else {
  16124. elementMatchers.push( cached );
  16125. }
  16126. }
  16127. // Cache the compiled function
  16128. cached = compilerCache(
  16129. selector,
  16130. matcherFromGroupMatchers( elementMatchers, setMatchers )
  16131. );
  16132. // Save selector and tokenization
  16133. cached.selector = selector;
  16134. }
  16135. return cached;
  16136. };
  16137. /**
  16138. * A low-level selection function that works with Sizzle's compiled
  16139. * selector functions
  16140. * @param {String|Function} selector A selector or a pre-compiled
  16141. * selector function built with Sizzle.compile
  16142. * @param {Element} context
  16143. * @param {Array} [results]
  16144. * @param {Array} [seed] A set of elements to match against
  16145. */
  16146. select = Sizzle.select = function( selector, context, results, seed ) {
  16147. var i, tokens, token, type, find,
  16148. compiled = typeof selector === "function" && selector,
  16149. match = !seed && tokenize( ( selector = compiled.selector || selector ) );
  16150. results = results || [];
  16151. // Try to minimize operations if there is only one selector in the list and no seed
  16152. // (the latter of which guarantees us context)
  16153. if ( match.length === 1 ) {
  16154. // Reduce context if the leading compound selector is an ID
  16155. tokens = match[ 0 ] = match[ 0 ].slice( 0 );
  16156. if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" &&
  16157. context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) {
  16158. context = ( Expr.find[ "ID" ]( token.matches[ 0 ]
  16159. .replace( runescape, funescape ), context ) || [] )[ 0 ];
  16160. if ( !context ) {
  16161. return results;
  16162. // Precompiled matchers will still verify ancestry, so step up a level
  16163. } else if ( compiled ) {
  16164. context = context.parentNode;
  16165. }
  16166. selector = selector.slice( tokens.shift().value.length );
  16167. }
  16168. // Fetch a seed set for right-to-left matching
  16169. i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length;
  16170. while ( i-- ) {
  16171. token = tokens[ i ];
  16172. // Abort if we hit a combinator
  16173. if ( Expr.relative[ ( type = token.type ) ] ) {
  16174. break;
  16175. }
  16176. if ( ( find = Expr.find[ type ] ) ) {
  16177. // Search, expanding context for leading sibling combinators
  16178. if ( ( seed = find(
  16179. token.matches[ 0 ].replace( runescape, funescape ),
  16180. rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) ||
  16181. context
  16182. ) ) ) {
  16183. // If seed is empty or no tokens remain, we can return early
  16184. tokens.splice( i, 1 );
  16185. selector = seed.length && toSelector( tokens );
  16186. if ( !selector ) {
  16187. push.apply( results, seed );
  16188. return results;
  16189. }
  16190. break;
  16191. }
  16192. }
  16193. }
  16194. }
  16195. // Compile and execute a filtering function if one is not provided
  16196. // Provide `match` to avoid retokenization if we modified the selector above
  16197. ( compiled || compile( selector, match ) )(
  16198. seed,
  16199. context,
  16200. !documentIsHTML,
  16201. results,
  16202. !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
  16203. );
  16204. return results;
  16205. };
  16206. // One-time assignments
  16207. // Sort stability
  16208. support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando;
  16209. // Support: Chrome 14-35+
  16210. // Always assume duplicates if they aren't passed to the comparison function
  16211. support.detectDuplicates = !!hasDuplicate;
  16212. // Initialize against the default document
  16213. setDocument();
  16214. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  16215. // Detached nodes confoundingly follow *each other*
  16216. support.sortDetached = assert( function( el ) {
  16217. // Should return 1, but returns 4 (following)
  16218. return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1;
  16219. } );
  16220. // Support: IE<8
  16221. // Prevent attribute/property "interpolation"
  16222. // https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  16223. if ( !assert( function( el ) {
  16224. el.innerHTML = "<a href='#'></a>";
  16225. return el.firstChild.getAttribute( "href" ) === "#";
  16226. } ) ) {
  16227. addHandle( "type|href|height|width", function( elem, name, isXML ) {
  16228. if ( !isXML ) {
  16229. return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  16230. }
  16231. } );
  16232. }
  16233. // Support: IE<9
  16234. // Use defaultValue in place of getAttribute("value")
  16235. if ( !support.attributes || !assert( function( el ) {
  16236. el.innerHTML = "<input/>";
  16237. el.firstChild.setAttribute( "value", "" );
  16238. return el.firstChild.getAttribute( "value" ) === "";
  16239. } ) ) {
  16240. addHandle( "value", function( elem, _name, isXML ) {
  16241. if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  16242. return elem.defaultValue;
  16243. }
  16244. } );
  16245. }
  16246. // Support: IE<9
  16247. // Use getAttributeNode to fetch booleans when getAttribute lies
  16248. if ( !assert( function( el ) {
  16249. return el.getAttribute( "disabled" ) == null;
  16250. } ) ) {
  16251. addHandle( booleans, function( elem, name, isXML ) {
  16252. var val;
  16253. if ( !isXML ) {
  16254. return elem[ name ] === true ? name.toLowerCase() :
  16255. ( val = elem.getAttributeNode( name ) ) && val.specified ?
  16256. val.value :
  16257. null;
  16258. }
  16259. } );
  16260. }
  16261. return Sizzle;
  16262. } )( window );
  16263. jQuery.find = Sizzle;
  16264. jQuery.expr = Sizzle.selectors;
  16265. // Deprecated
  16266. jQuery.expr[ ":" ] = jQuery.expr.pseudos;
  16267. jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
  16268. jQuery.text = Sizzle.getText;
  16269. jQuery.isXMLDoc = Sizzle.isXML;
  16270. jQuery.contains = Sizzle.contains;
  16271. jQuery.escapeSelector = Sizzle.escape;
  16272. var dir = function( elem, dir, until ) {
  16273. var matched = [],
  16274. truncate = until !== undefined;
  16275. while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
  16276. if ( elem.nodeType === 1 ) {
  16277. if ( truncate && jQuery( elem ).is( until ) ) {
  16278. break;
  16279. }
  16280. matched.push( elem );
  16281. }
  16282. }
  16283. return matched;
  16284. };
  16285. var siblings = function( n, elem ) {
  16286. var matched = [];
  16287. for ( ; n; n = n.nextSibling ) {
  16288. if ( n.nodeType === 1 && n !== elem ) {
  16289. matched.push( n );
  16290. }
  16291. }
  16292. return matched;
  16293. };
  16294. var rneedsContext = jQuery.expr.match.needsContext;
  16295. function nodeName( elem, name ) {
  16296. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  16297. };
  16298. var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i );
  16299. // Implement the identical functionality for filter and not
  16300. function winnow( elements, qualifier, not ) {
  16301. if ( isFunction( qualifier ) ) {
  16302. return jQuery.grep( elements, function( elem, i ) {
  16303. return !!qualifier.call( elem, i, elem ) !== not;
  16304. } );
  16305. }
  16306. // Single element
  16307. if ( qualifier.nodeType ) {
  16308. return jQuery.grep( elements, function( elem ) {
  16309. return ( elem === qualifier ) !== not;
  16310. } );
  16311. }
  16312. // Arraylike of elements (jQuery, arguments, Array)
  16313. if ( typeof qualifier !== "string" ) {
  16314. return jQuery.grep( elements, function( elem ) {
  16315. return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
  16316. } );
  16317. }
  16318. // Filtered directly for both simple and complex selectors
  16319. return jQuery.filter( qualifier, elements, not );
  16320. }
  16321. jQuery.filter = function( expr, elems, not ) {
  16322. var elem = elems[ 0 ];
  16323. if ( not ) {
  16324. expr = ":not(" + expr + ")";
  16325. }
  16326. if ( elems.length === 1 && elem.nodeType === 1 ) {
  16327. return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [];
  16328. }
  16329. return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  16330. return elem.nodeType === 1;
  16331. } ) );
  16332. };
  16333. jQuery.fn.extend( {
  16334. find: function( selector ) {
  16335. var i, ret,
  16336. len = this.length,
  16337. self = this;
  16338. if ( typeof selector !== "string" ) {
  16339. return this.pushStack( jQuery( selector ).filter( function() {
  16340. for ( i = 0; i < len; i++ ) {
  16341. if ( jQuery.contains( self[ i ], this ) ) {
  16342. return true;
  16343. }
  16344. }
  16345. } ) );
  16346. }
  16347. ret = this.pushStack( [] );
  16348. for ( i = 0; i < len; i++ ) {
  16349. jQuery.find( selector, self[ i ], ret );
  16350. }
  16351. return len > 1 ? jQuery.uniqueSort( ret ) : ret;
  16352. },
  16353. filter: function( selector ) {
  16354. return this.pushStack( winnow( this, selector || [], false ) );
  16355. },
  16356. not: function( selector ) {
  16357. return this.pushStack( winnow( this, selector || [], true ) );
  16358. },
  16359. is: function( selector ) {
  16360. return !!winnow(
  16361. this,
  16362. // If this is a positional/relative selector, check membership in the returned set
  16363. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  16364. typeof selector === "string" && rneedsContext.test( selector ) ?
  16365. jQuery( selector ) :
  16366. selector || [],
  16367. false
  16368. ).length;
  16369. }
  16370. } );
  16371. // Initialize a jQuery object
  16372. // A central reference to the root jQuery(document)
  16373. var rootjQuery,
  16374. // A simple way to check for HTML strings
  16375. // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  16376. // Strict HTML recognition (#11290: must start with <)
  16377. // Shortcut simple #id case for speed
  16378. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
  16379. init = jQuery.fn.init = function( selector, context, root ) {
  16380. var match, elem;
  16381. // HANDLE: $(""), $(null), $(undefined), $(false)
  16382. if ( !selector ) {
  16383. return this;
  16384. }
  16385. // Method init() accepts an alternate rootjQuery
  16386. // so migrate can support jQuery.sub (gh-2101)
  16387. root = root || rootjQuery;
  16388. // Handle HTML strings
  16389. if ( typeof selector === "string" ) {
  16390. if ( selector[ 0 ] === "<" &&
  16391. selector[ selector.length - 1 ] === ">" &&
  16392. selector.length >= 3 ) {
  16393. // Assume that strings that start and end with <> are HTML and skip the regex check
  16394. match = [ null, selector, null ];
  16395. } else {
  16396. match = rquickExpr.exec( selector );
  16397. }
  16398. // Match html or make sure no context is specified for #id
  16399. if ( match && ( match[ 1 ] || !context ) ) {
  16400. // HANDLE: $(html) -> $(array)
  16401. if ( match[ 1 ] ) {
  16402. context = context instanceof jQuery ? context[ 0 ] : context;
  16403. // Option to run scripts is true for back-compat
  16404. // Intentionally let the error be thrown if parseHTML is not present
  16405. jQuery.merge( this, jQuery.parseHTML(
  16406. match[ 1 ],
  16407. context && context.nodeType ? context.ownerDocument || context : document,
  16408. true
  16409. ) );
  16410. // HANDLE: $(html, props)
  16411. if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
  16412. for ( match in context ) {
  16413. // Properties of context are called as methods if possible
  16414. if ( isFunction( this[ match ] ) ) {
  16415. this[ match ]( context[ match ] );
  16416. // ...and otherwise set as attributes
  16417. } else {
  16418. this.attr( match, context[ match ] );
  16419. }
  16420. }
  16421. }
  16422. return this;
  16423. // HANDLE: $(#id)
  16424. } else {
  16425. elem = document.getElementById( match[ 2 ] );
  16426. if ( elem ) {
  16427. // Inject the element directly into the jQuery object
  16428. this[ 0 ] = elem;
  16429. this.length = 1;
  16430. }
  16431. return this;
  16432. }
  16433. // HANDLE: $(expr, $(...))
  16434. } else if ( !context || context.jquery ) {
  16435. return ( context || root ).find( selector );
  16436. // HANDLE: $(expr, context)
  16437. // (which is just equivalent to: $(context).find(expr)
  16438. } else {
  16439. return this.constructor( context ).find( selector );
  16440. }
  16441. // HANDLE: $(DOMElement)
  16442. } else if ( selector.nodeType ) {
  16443. this[ 0 ] = selector;
  16444. this.length = 1;
  16445. return this;
  16446. // HANDLE: $(function)
  16447. // Shortcut for document ready
  16448. } else if ( isFunction( selector ) ) {
  16449. return root.ready !== undefined ?
  16450. root.ready( selector ) :
  16451. // Execute immediately if ready is not present
  16452. selector( jQuery );
  16453. }
  16454. return jQuery.makeArray( selector, this );
  16455. };
  16456. // Give the init function the jQuery prototype for later instantiation
  16457. init.prototype = jQuery.fn;
  16458. // Initialize central reference
  16459. rootjQuery = jQuery( document );
  16460. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  16461. // Methods guaranteed to produce a unique set when starting from a unique set
  16462. guaranteedUnique = {
  16463. children: true,
  16464. contents: true,
  16465. next: true,
  16466. prev: true
  16467. };
  16468. jQuery.fn.extend( {
  16469. has: function( target ) {
  16470. var targets = jQuery( target, this ),
  16471. l = targets.length;
  16472. return this.filter( function() {
  16473. var i = 0;
  16474. for ( ; i < l; i++ ) {
  16475. if ( jQuery.contains( this, targets[ i ] ) ) {
  16476. return true;
  16477. }
  16478. }
  16479. } );
  16480. },
  16481. closest: function( selectors, context ) {
  16482. var cur,
  16483. i = 0,
  16484. l = this.length,
  16485. matched = [],
  16486. targets = typeof selectors !== "string" && jQuery( selectors );
  16487. // Positional selectors never match, since there's no _selection_ context
  16488. if ( !rneedsContext.test( selectors ) ) {
  16489. for ( ; i < l; i++ ) {
  16490. for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
  16491. // Always skip document fragments
  16492. if ( cur.nodeType < 11 && ( targets ?
  16493. targets.index( cur ) > -1 :
  16494. // Don't pass non-elements to Sizzle
  16495. cur.nodeType === 1 &&
  16496. jQuery.find.matchesSelector( cur, selectors ) ) ) {
  16497. matched.push( cur );
  16498. break;
  16499. }
  16500. }
  16501. }
  16502. }
  16503. return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
  16504. },
  16505. // Determine the position of an element within the set
  16506. index: function( elem ) {
  16507. // No argument, return index in parent
  16508. if ( !elem ) {
  16509. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  16510. }
  16511. // Index in selector
  16512. if ( typeof elem === "string" ) {
  16513. return indexOf.call( jQuery( elem ), this[ 0 ] );
  16514. }
  16515. // Locate the position of the desired element
  16516. return indexOf.call( this,
  16517. // If it receives a jQuery object, the first element is used
  16518. elem.jquery ? elem[ 0 ] : elem
  16519. );
  16520. },
  16521. add: function( selector, context ) {
  16522. return this.pushStack(
  16523. jQuery.uniqueSort(
  16524. jQuery.merge( this.get(), jQuery( selector, context ) )
  16525. )
  16526. );
  16527. },
  16528. addBack: function( selector ) {
  16529. return this.add( selector == null ?
  16530. this.prevObject : this.prevObject.filter( selector )
  16531. );
  16532. }
  16533. } );
  16534. function sibling( cur, dir ) {
  16535. while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
  16536. return cur;
  16537. }
  16538. jQuery.each( {
  16539. parent: function( elem ) {
  16540. var parent = elem.parentNode;
  16541. return parent && parent.nodeType !== 11 ? parent : null;
  16542. },
  16543. parents: function( elem ) {
  16544. return dir( elem, "parentNode" );
  16545. },
  16546. parentsUntil: function( elem, _i, until ) {
  16547. return dir( elem, "parentNode", until );
  16548. },
  16549. next: function( elem ) {
  16550. return sibling( elem, "nextSibling" );
  16551. },
  16552. prev: function( elem ) {
  16553. return sibling( elem, "previousSibling" );
  16554. },
  16555. nextAll: function( elem ) {
  16556. return dir( elem, "nextSibling" );
  16557. },
  16558. prevAll: function( elem ) {
  16559. return dir( elem, "previousSibling" );
  16560. },
  16561. nextUntil: function( elem, _i, until ) {
  16562. return dir( elem, "nextSibling", until );
  16563. },
  16564. prevUntil: function( elem, _i, until ) {
  16565. return dir( elem, "previousSibling", until );
  16566. },
  16567. siblings: function( elem ) {
  16568. return siblings( ( elem.parentNode || {} ).firstChild, elem );
  16569. },
  16570. children: function( elem ) {
  16571. return siblings( elem.firstChild );
  16572. },
  16573. contents: function( elem ) {
  16574. if ( elem.contentDocument != null &&
  16575. // Support: IE 11+
  16576. // <object> elements with no `data` attribute has an object
  16577. // `contentDocument` with a `null` prototype.
  16578. getProto( elem.contentDocument ) ) {
  16579. return elem.contentDocument;
  16580. }
  16581. // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
  16582. // Treat the template element as a regular one in browsers that
  16583. // don't support it.
  16584. if ( nodeName( elem, "template" ) ) {
  16585. elem = elem.content || elem;
  16586. }
  16587. return jQuery.merge( [], elem.childNodes );
  16588. }
  16589. }, function( name, fn ) {
  16590. jQuery.fn[ name ] = function( until, selector ) {
  16591. var matched = jQuery.map( this, fn, until );
  16592. if ( name.slice( -5 ) !== "Until" ) {
  16593. selector = until;
  16594. }
  16595. if ( selector && typeof selector === "string" ) {
  16596. matched = jQuery.filter( selector, matched );
  16597. }
  16598. if ( this.length > 1 ) {
  16599. // Remove duplicates
  16600. if ( !guaranteedUnique[ name ] ) {
  16601. jQuery.uniqueSort( matched );
  16602. }
  16603. // Reverse order for parents* and prev-derivatives
  16604. if ( rparentsprev.test( name ) ) {
  16605. matched.reverse();
  16606. }
  16607. }
  16608. return this.pushStack( matched );
  16609. };
  16610. } );
  16611. var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
  16612. // Convert String-formatted options into Object-formatted ones
  16613. function createOptions( options ) {
  16614. var object = {};
  16615. jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) {
  16616. object[ flag ] = true;
  16617. } );
  16618. return object;
  16619. }
  16620. /*
  16621. * Create a callback list using the following parameters:
  16622. *
  16623. * options: an optional list of space-separated options that will change how
  16624. * the callback list behaves or a more traditional option object
  16625. *
  16626. * By default a callback list will act like an event callback list and can be
  16627. * "fired" multiple times.
  16628. *
  16629. * Possible options:
  16630. *
  16631. * once: will ensure the callback list can only be fired once (like a Deferred)
  16632. *
  16633. * memory: will keep track of previous values and will call any callback added
  16634. * after the list has been fired right away with the latest "memorized"
  16635. * values (like a Deferred)
  16636. *
  16637. * unique: will ensure a callback can only be added once (no duplicate in the list)
  16638. *
  16639. * stopOnFalse: interrupt callings when a callback returns false
  16640. *
  16641. */
  16642. jQuery.Callbacks = function( options ) {
  16643. // Convert options from String-formatted to Object-formatted if needed
  16644. // (we check in cache first)
  16645. options = typeof options === "string" ?
  16646. createOptions( options ) :
  16647. jQuery.extend( {}, options );
  16648. var // Flag to know if list is currently firing
  16649. firing,
  16650. // Last fire value for non-forgettable lists
  16651. memory,
  16652. // Flag to know if list was already fired
  16653. fired,
  16654. // Flag to prevent firing
  16655. locked,
  16656. // Actual callback list
  16657. list = [],
  16658. // Queue of execution data for repeatable lists
  16659. queue = [],
  16660. // Index of currently firing callback (modified by add/remove as needed)
  16661. firingIndex = -1,
  16662. // Fire callbacks
  16663. fire = function() {
  16664. // Enforce single-firing
  16665. locked = locked || options.once;
  16666. // Execute callbacks for all pending executions,
  16667. // respecting firingIndex overrides and runtime changes
  16668. fired = firing = true;
  16669. for ( ; queue.length; firingIndex = -1 ) {
  16670. memory = queue.shift();
  16671. while ( ++firingIndex < list.length ) {
  16672. // Run callback and check for early termination
  16673. if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
  16674. options.stopOnFalse ) {
  16675. // Jump to end and forget the data so .add doesn't re-fire
  16676. firingIndex = list.length;
  16677. memory = false;
  16678. }
  16679. }
  16680. }
  16681. // Forget the data if we're done with it
  16682. if ( !options.memory ) {
  16683. memory = false;
  16684. }
  16685. firing = false;
  16686. // Clean up if we're done firing for good
  16687. if ( locked ) {
  16688. // Keep an empty list if we have data for future add calls
  16689. if ( memory ) {
  16690. list = [];
  16691. // Otherwise, this object is spent
  16692. } else {
  16693. list = "";
  16694. }
  16695. }
  16696. },
  16697. // Actual Callbacks object
  16698. self = {
  16699. // Add a callback or a collection of callbacks to the list
  16700. add: function() {
  16701. if ( list ) {
  16702. // If we have memory from a past run, we should fire after adding
  16703. if ( memory && !firing ) {
  16704. firingIndex = list.length - 1;
  16705. queue.push( memory );
  16706. }
  16707. ( function add( args ) {
  16708. jQuery.each( args, function( _, arg ) {
  16709. if ( isFunction( arg ) ) {
  16710. if ( !options.unique || !self.has( arg ) ) {
  16711. list.push( arg );
  16712. }
  16713. } else if ( arg && arg.length && toType( arg ) !== "string" ) {
  16714. // Inspect recursively
  16715. add( arg );
  16716. }
  16717. } );
  16718. } )( arguments );
  16719. if ( memory && !firing ) {
  16720. fire();
  16721. }
  16722. }
  16723. return this;
  16724. },
  16725. // Remove a callback from the list
  16726. remove: function() {
  16727. jQuery.each( arguments, function( _, arg ) {
  16728. var index;
  16729. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  16730. list.splice( index, 1 );
  16731. // Handle firing indexes
  16732. if ( index <= firingIndex ) {
  16733. firingIndex--;
  16734. }
  16735. }
  16736. } );
  16737. return this;
  16738. },
  16739. // Check if a given callback is in the list.
  16740. // If no argument is given, return whether or not list has callbacks attached.
  16741. has: function( fn ) {
  16742. return fn ?
  16743. jQuery.inArray( fn, list ) > -1 :
  16744. list.length > 0;
  16745. },
  16746. // Remove all callbacks from the list
  16747. empty: function() {
  16748. if ( list ) {
  16749. list = [];
  16750. }
  16751. return this;
  16752. },
  16753. // Disable .fire and .add
  16754. // Abort any current/pending executions
  16755. // Clear all callbacks and values
  16756. disable: function() {
  16757. locked = queue = [];
  16758. list = memory = "";
  16759. return this;
  16760. },
  16761. disabled: function() {
  16762. return !list;
  16763. },
  16764. // Disable .fire
  16765. // Also disable .add unless we have memory (since it would have no effect)
  16766. // Abort any pending executions
  16767. lock: function() {
  16768. locked = queue = [];
  16769. if ( !memory && !firing ) {
  16770. list = memory = "";
  16771. }
  16772. return this;
  16773. },
  16774. locked: function() {
  16775. return !!locked;
  16776. },
  16777. // Call all callbacks with the given context and arguments
  16778. fireWith: function( context, args ) {
  16779. if ( !locked ) {
  16780. args = args || [];
  16781. args = [ context, args.slice ? args.slice() : args ];
  16782. queue.push( args );
  16783. if ( !firing ) {
  16784. fire();
  16785. }
  16786. }
  16787. return this;
  16788. },
  16789. // Call all the callbacks with the given arguments
  16790. fire: function() {
  16791. self.fireWith( this, arguments );
  16792. return this;
  16793. },
  16794. // To know if the callbacks have already been called at least once
  16795. fired: function() {
  16796. return !!fired;
  16797. }
  16798. };
  16799. return self;
  16800. };
  16801. function Identity( v ) {
  16802. return v;
  16803. }
  16804. function Thrower( ex ) {
  16805. throw ex;
  16806. }
  16807. function adoptValue( value, resolve, reject, noValue ) {
  16808. var method;
  16809. try {
  16810. // Check for promise aspect first to privilege synchronous behavior
  16811. if ( value && isFunction( ( method = value.promise ) ) ) {
  16812. method.call( value ).done( resolve ).fail( reject );
  16813. // Other thenables
  16814. } else if ( value && isFunction( ( method = value.then ) ) ) {
  16815. method.call( value, resolve, reject );
  16816. // Other non-thenables
  16817. } else {
  16818. // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer:
  16819. // * false: [ value ].slice( 0 ) => resolve( value )
  16820. // * true: [ value ].slice( 1 ) => resolve()
  16821. resolve.apply( undefined, [ value ].slice( noValue ) );
  16822. }
  16823. // For Promises/A+, convert exceptions into rejections
  16824. // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in
  16825. // Deferred#then to conditionally suppress rejection.
  16826. } catch ( value ) {
  16827. // Support: Android 4.0 only
  16828. // Strict mode functions invoked without .call/.apply get global-object context
  16829. reject.apply( undefined, [ value ] );
  16830. }
  16831. }
  16832. jQuery.extend( {
  16833. Deferred: function( func ) {
  16834. var tuples = [
  16835. // action, add listener, callbacks,
  16836. // ... .then handlers, argument index, [final state]
  16837. [ "notify", "progress", jQuery.Callbacks( "memory" ),
  16838. jQuery.Callbacks( "memory" ), 2 ],
  16839. [ "resolve", "done", jQuery.Callbacks( "once memory" ),
  16840. jQuery.Callbacks( "once memory" ), 0, "resolved" ],
  16841. [ "reject", "fail", jQuery.Callbacks( "once memory" ),
  16842. jQuery.Callbacks( "once memory" ), 1, "rejected" ]
  16843. ],
  16844. state = "pending",
  16845. promise = {
  16846. state: function() {
  16847. return state;
  16848. },
  16849. always: function() {
  16850. deferred.done( arguments ).fail( arguments );
  16851. return this;
  16852. },
  16853. "catch": function( fn ) {
  16854. return promise.then( null, fn );
  16855. },
  16856. // Keep pipe for back-compat
  16857. pipe: function( /* fnDone, fnFail, fnProgress */ ) {
  16858. var fns = arguments;
  16859. return jQuery.Deferred( function( newDefer ) {
  16860. jQuery.each( tuples, function( _i, tuple ) {
  16861. // Map tuples (progress, done, fail) to arguments (done, fail, progress)
  16862. var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ];
  16863. // deferred.progress(function() { bind to newDefer or newDefer.notify })
  16864. // deferred.done(function() { bind to newDefer or newDefer.resolve })
  16865. // deferred.fail(function() { bind to newDefer or newDefer.reject })
  16866. deferred[ tuple[ 1 ] ]( function() {
  16867. var returned = fn && fn.apply( this, arguments );
  16868. if ( returned && isFunction( returned.promise ) ) {
  16869. returned.promise()
  16870. .progress( newDefer.notify )
  16871. .done( newDefer.resolve )
  16872. .fail( newDefer.reject );
  16873. } else {
  16874. newDefer[ tuple[ 0 ] + "With" ](
  16875. this,
  16876. fn ? [ returned ] : arguments
  16877. );
  16878. }
  16879. } );
  16880. } );
  16881. fns = null;
  16882. } ).promise();
  16883. },
  16884. then: function( onFulfilled, onRejected, onProgress ) {
  16885. var maxDepth = 0;
  16886. function resolve( depth, deferred, handler, special ) {
  16887. return function() {
  16888. var that = this,
  16889. args = arguments,
  16890. mightThrow = function() {
  16891. var returned, then;
  16892. // Support: Promises/A+ section 2.3.3.3.3
  16893. // https://promisesaplus.com/#point-59
  16894. // Ignore double-resolution attempts
  16895. if ( depth < maxDepth ) {
  16896. return;
  16897. }
  16898. returned = handler.apply( that, args );
  16899. // Support: Promises/A+ section 2.3.1
  16900. // https://promisesaplus.com/#point-48
  16901. if ( returned === deferred.promise() ) {
  16902. throw new TypeError( "Thenable self-resolution" );
  16903. }
  16904. // Support: Promises/A+ sections 2.3.3.1, 3.5
  16905. // https://promisesaplus.com/#point-54
  16906. // https://promisesaplus.com/#point-75
  16907. // Retrieve `then` only once
  16908. then = returned &&
  16909. // Support: Promises/A+ section 2.3.4
  16910. // https://promisesaplus.com/#point-64
  16911. // Only check objects and functions for thenability
  16912. ( typeof returned === "object" ||
  16913. typeof returned === "function" ) &&
  16914. returned.then;
  16915. // Handle a returned thenable
  16916. if ( isFunction( then ) ) {
  16917. // Special processors (notify) just wait for resolution
  16918. if ( special ) {
  16919. then.call(
  16920. returned,
  16921. resolve( maxDepth, deferred, Identity, special ),
  16922. resolve( maxDepth, deferred, Thrower, special )
  16923. );
  16924. // Normal processors (resolve) also hook into progress
  16925. } else {
  16926. // ...and disregard older resolution values
  16927. maxDepth++;
  16928. then.call(
  16929. returned,
  16930. resolve( maxDepth, deferred, Identity, special ),
  16931. resolve( maxDepth, deferred, Thrower, special ),
  16932. resolve( maxDepth, deferred, Identity,
  16933. deferred.notifyWith )
  16934. );
  16935. }
  16936. // Handle all other returned values
  16937. } else {
  16938. // Only substitute handlers pass on context
  16939. // and multiple values (non-spec behavior)
  16940. if ( handler !== Identity ) {
  16941. that = undefined;
  16942. args = [ returned ];
  16943. }
  16944. // Process the value(s)
  16945. // Default process is resolve
  16946. ( special || deferred.resolveWith )( that, args );
  16947. }
  16948. },
  16949. // Only normal processors (resolve) catch and reject exceptions
  16950. process = special ?
  16951. mightThrow :
  16952. function() {
  16953. try {
  16954. mightThrow();
  16955. } catch ( e ) {
  16956. if ( jQuery.Deferred.exceptionHook ) {
  16957. jQuery.Deferred.exceptionHook( e,
  16958. process.stackTrace );
  16959. }
  16960. // Support: Promises/A+ section 2.3.3.3.4.1
  16961. // https://promisesaplus.com/#point-61
  16962. // Ignore post-resolution exceptions
  16963. if ( depth + 1 >= maxDepth ) {
  16964. // Only substitute handlers pass on context
  16965. // and multiple values (non-spec behavior)
  16966. if ( handler !== Thrower ) {
  16967. that = undefined;
  16968. args = [ e ];
  16969. }
  16970. deferred.rejectWith( that, args );
  16971. }
  16972. }
  16973. };
  16974. // Support: Promises/A+ section 2.3.3.3.1
  16975. // https://promisesaplus.com/#point-57
  16976. // Re-resolve promises immediately to dodge false rejection from
  16977. // subsequent errors
  16978. if ( depth ) {
  16979. process();
  16980. } else {
  16981. // Call an optional hook to record the stack, in case of exception
  16982. // since it's otherwise lost when execution goes async
  16983. if ( jQuery.Deferred.getStackHook ) {
  16984. process.stackTrace = jQuery.Deferred.getStackHook();
  16985. }
  16986. window.setTimeout( process );
  16987. }
  16988. };
  16989. }
  16990. return jQuery.Deferred( function( newDefer ) {
  16991. // progress_handlers.add( ... )
  16992. tuples[ 0 ][ 3 ].add(
  16993. resolve(
  16994. 0,
  16995. newDefer,
  16996. isFunction( onProgress ) ?
  16997. onProgress :
  16998. Identity,
  16999. newDefer.notifyWith
  17000. )
  17001. );
  17002. // fulfilled_handlers.add( ... )
  17003. tuples[ 1 ][ 3 ].add(
  17004. resolve(
  17005. 0,
  17006. newDefer,
  17007. isFunction( onFulfilled ) ?
  17008. onFulfilled :
  17009. Identity
  17010. )
  17011. );
  17012. // rejected_handlers.add( ... )
  17013. tuples[ 2 ][ 3 ].add(
  17014. resolve(
  17015. 0,
  17016. newDefer,
  17017. isFunction( onRejected ) ?
  17018. onRejected :
  17019. Thrower
  17020. )
  17021. );
  17022. } ).promise();
  17023. },
  17024. // Get a promise for this deferred
  17025. // If obj is provided, the promise aspect is added to the object
  17026. promise: function( obj ) {
  17027. return obj != null ? jQuery.extend( obj, promise ) : promise;
  17028. }
  17029. },
  17030. deferred = {};
  17031. // Add list-specific methods
  17032. jQuery.each( tuples, function( i, tuple ) {
  17033. var list = tuple[ 2 ],
  17034. stateString = tuple[ 5 ];
  17035. // promise.progress = list.add
  17036. // promise.done = list.add
  17037. // promise.fail = list.add
  17038. promise[ tuple[ 1 ] ] = list.add;
  17039. // Handle state
  17040. if ( stateString ) {
  17041. list.add(
  17042. function() {
  17043. // state = "resolved" (i.e., fulfilled)
  17044. // state = "rejected"
  17045. state = stateString;
  17046. },
  17047. // rejected_callbacks.disable
  17048. // fulfilled_callbacks.disable
  17049. tuples[ 3 - i ][ 2 ].disable,
  17050. // rejected_handlers.disable
  17051. // fulfilled_handlers.disable
  17052. tuples[ 3 - i ][ 3 ].disable,
  17053. // progress_callbacks.lock
  17054. tuples[ 0 ][ 2 ].lock,
  17055. // progress_handlers.lock
  17056. tuples[ 0 ][ 3 ].lock
  17057. );
  17058. }
  17059. // progress_handlers.fire
  17060. // fulfilled_handlers.fire
  17061. // rejected_handlers.fire
  17062. list.add( tuple[ 3 ].fire );
  17063. // deferred.notify = function() { deferred.notifyWith(...) }
  17064. // deferred.resolve = function() { deferred.resolveWith(...) }
  17065. // deferred.reject = function() { deferred.rejectWith(...) }
  17066. deferred[ tuple[ 0 ] ] = function() {
  17067. deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments );
  17068. return this;
  17069. };
  17070. // deferred.notifyWith = list.fireWith
  17071. // deferred.resolveWith = list.fireWith
  17072. // deferred.rejectWith = list.fireWith
  17073. deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
  17074. } );
  17075. // Make the deferred a promise
  17076. promise.promise( deferred );
  17077. // Call given func if any
  17078. if ( func ) {
  17079. func.call( deferred, deferred );
  17080. }
  17081. // All done!
  17082. return deferred;
  17083. },
  17084. // Deferred helper
  17085. when: function( singleValue ) {
  17086. var
  17087. // count of uncompleted subordinates
  17088. remaining = arguments.length,
  17089. // count of unprocessed arguments
  17090. i = remaining,
  17091. // subordinate fulfillment data
  17092. resolveContexts = Array( i ),
  17093. resolveValues = slice.call( arguments ),
  17094. // the master Deferred
  17095. master = jQuery.Deferred(),
  17096. // subordinate callback factory
  17097. updateFunc = function( i ) {
  17098. return function( value ) {
  17099. resolveContexts[ i ] = this;
  17100. resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  17101. if ( !( --remaining ) ) {
  17102. master.resolveWith( resolveContexts, resolveValues );
  17103. }
  17104. };
  17105. };
  17106. // Single- and empty arguments are adopted like Promise.resolve
  17107. if ( remaining <= 1 ) {
  17108. adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject,
  17109. !remaining );
  17110. // Use .then() to unwrap secondary thenables (cf. gh-3000)
  17111. if ( master.state() === "pending" ||
  17112. isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) {
  17113. return master.then();
  17114. }
  17115. }
  17116. // Multiple arguments are aggregated like Promise.all array elements
  17117. while ( i-- ) {
  17118. adoptValue( resolveValues[ i ], updateFunc( i ), master.reject );
  17119. }
  17120. return master.promise();
  17121. }
  17122. } );
  17123. // These usually indicate a programmer mistake during development,
  17124. // warn about them ASAP rather than swallowing them by default.
  17125. var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
  17126. jQuery.Deferred.exceptionHook = function( error, stack ) {
  17127. // Support: IE 8 - 9 only
  17128. // Console exists when dev tools are open, which can happen at any time
  17129. if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
  17130. window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack );
  17131. }
  17132. };
  17133. jQuery.readyException = function( error ) {
  17134. window.setTimeout( function() {
  17135. throw error;
  17136. } );
  17137. };
  17138. // The deferred used on DOM ready
  17139. var readyList = jQuery.Deferred();
  17140. jQuery.fn.ready = function( fn ) {
  17141. readyList
  17142. .then( fn )
  17143. // Wrap jQuery.readyException in a function so that the lookup
  17144. // happens at the time of error handling instead of callback
  17145. // registration.
  17146. .catch( function( error ) {
  17147. jQuery.readyException( error );
  17148. } );
  17149. return this;
  17150. };
  17151. jQuery.extend( {
  17152. // Is the DOM ready to be used? Set to true once it occurs.
  17153. isReady: false,
  17154. // A counter to track how many items to wait for before
  17155. // the ready event fires. See #6781
  17156. readyWait: 1,
  17157. // Handle when the DOM is ready
  17158. ready: function( wait ) {
  17159. // Abort if there are pending holds or we're already ready
  17160. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  17161. return;
  17162. }
  17163. // Remember that the DOM is ready
  17164. jQuery.isReady = true;
  17165. // If a normal DOM Ready event fired, decrement, and wait if need be
  17166. if ( wait !== true && --jQuery.readyWait > 0 ) {
  17167. return;
  17168. }
  17169. // If there are functions bound, to execute
  17170. readyList.resolveWith( document, [ jQuery ] );
  17171. }
  17172. } );
  17173. jQuery.ready.then = readyList.then;
  17174. // The ready event handler and self cleanup method
  17175. function completed() {
  17176. document.removeEventListener( "DOMContentLoaded", completed );
  17177. window.removeEventListener( "load", completed );
  17178. jQuery.ready();
  17179. }
  17180. // Catch cases where $(document).ready() is called
  17181. // after the browser event has already occurred.
  17182. // Support: IE <=9 - 10 only
  17183. // Older IE sometimes signals "interactive" too soon
  17184. if ( document.readyState === "complete" ||
  17185. ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
  17186. // Handle it asynchronously to allow scripts the opportunity to delay ready
  17187. window.setTimeout( jQuery.ready );
  17188. } else {
  17189. // Use the handy event callback
  17190. document.addEventListener( "DOMContentLoaded", completed );
  17191. // A fallback to window.onload, that will always work
  17192. window.addEventListener( "load", completed );
  17193. }
  17194. // Multifunctional method to get and set values of a collection
  17195. // The value/s can optionally be executed if it's a function
  17196. var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  17197. var i = 0,
  17198. len = elems.length,
  17199. bulk = key == null;
  17200. // Sets many values
  17201. if ( toType( key ) === "object" ) {
  17202. chainable = true;
  17203. for ( i in key ) {
  17204. access( elems, fn, i, key[ i ], true, emptyGet, raw );
  17205. }
  17206. // Sets one value
  17207. } else if ( value !== undefined ) {
  17208. chainable = true;
  17209. if ( !isFunction( value ) ) {
  17210. raw = true;
  17211. }
  17212. if ( bulk ) {
  17213. // Bulk operations run against the entire set
  17214. if ( raw ) {
  17215. fn.call( elems, value );
  17216. fn = null;
  17217. // ...except when executing function values
  17218. } else {
  17219. bulk = fn;
  17220. fn = function( elem, _key, value ) {
  17221. return bulk.call( jQuery( elem ), value );
  17222. };
  17223. }
  17224. }
  17225. if ( fn ) {
  17226. for ( ; i < len; i++ ) {
  17227. fn(
  17228. elems[ i ], key, raw ?
  17229. value :
  17230. value.call( elems[ i ], i, fn( elems[ i ], key ) )
  17231. );
  17232. }
  17233. }
  17234. }
  17235. if ( chainable ) {
  17236. return elems;
  17237. }
  17238. // Gets
  17239. if ( bulk ) {
  17240. return fn.call( elems );
  17241. }
  17242. return len ? fn( elems[ 0 ], key ) : emptyGet;
  17243. };
  17244. // Matches dashed string for camelizing
  17245. var rmsPrefix = /^-ms-/,
  17246. rdashAlpha = /-([a-z])/g;
  17247. // Used by camelCase as callback to replace()
  17248. function fcamelCase( _all, letter ) {
  17249. return letter.toUpperCase();
  17250. }
  17251. // Convert dashed to camelCase; used by the css and data modules
  17252. // Support: IE <=9 - 11, Edge 12 - 15
  17253. // Microsoft forgot to hump their vendor prefix (#9572)
  17254. function camelCase( string ) {
  17255. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  17256. }
  17257. var acceptData = function( owner ) {
  17258. // Accepts only:
  17259. // - Node
  17260. // - Node.ELEMENT_NODE
  17261. // - Node.DOCUMENT_NODE
  17262. // - Object
  17263. // - Any
  17264. return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
  17265. };
  17266. function Data() {
  17267. this.expando = jQuery.expando + Data.uid++;
  17268. }
  17269. Data.uid = 1;
  17270. Data.prototype = {
  17271. cache: function( owner ) {
  17272. // Check if the owner object already has a cache
  17273. var value = owner[ this.expando ];
  17274. // If not, create one
  17275. if ( !value ) {
  17276. value = {};
  17277. // We can accept data for non-element nodes in modern browsers,
  17278. // but we should not, see #8335.
  17279. // Always return an empty object.
  17280. if ( acceptData( owner ) ) {
  17281. // If it is a node unlikely to be stringify-ed or looped over
  17282. // use plain assignment
  17283. if ( owner.nodeType ) {
  17284. owner[ this.expando ] = value;
  17285. // Otherwise secure it in a non-enumerable property
  17286. // configurable must be true to allow the property to be
  17287. // deleted when data is removed
  17288. } else {
  17289. Object.defineProperty( owner, this.expando, {
  17290. value: value,
  17291. configurable: true
  17292. } );
  17293. }
  17294. }
  17295. }
  17296. return value;
  17297. },
  17298. set: function( owner, data, value ) {
  17299. var prop,
  17300. cache = this.cache( owner );
  17301. // Handle: [ owner, key, value ] args
  17302. // Always use camelCase key (gh-2257)
  17303. if ( typeof data === "string" ) {
  17304. cache[ camelCase( data ) ] = value;
  17305. // Handle: [ owner, { properties } ] args
  17306. } else {
  17307. // Copy the properties one-by-one to the cache object
  17308. for ( prop in data ) {
  17309. cache[ camelCase( prop ) ] = data[ prop ];
  17310. }
  17311. }
  17312. return cache;
  17313. },
  17314. get: function( owner, key ) {
  17315. return key === undefined ?
  17316. this.cache( owner ) :
  17317. // Always use camelCase key (gh-2257)
  17318. owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ];
  17319. },
  17320. access: function( owner, key, value ) {
  17321. // In cases where either:
  17322. //
  17323. // 1. No key was specified
  17324. // 2. A string key was specified, but no value provided
  17325. //
  17326. // Take the "read" path and allow the get method to determine
  17327. // which value to return, respectively either:
  17328. //
  17329. // 1. The entire cache object
  17330. // 2. The data stored at the key
  17331. //
  17332. if ( key === undefined ||
  17333. ( ( key && typeof key === "string" ) && value === undefined ) ) {
  17334. return this.get( owner, key );
  17335. }
  17336. // When the key is not a string, or both a key and value
  17337. // are specified, set or extend (existing objects) with either:
  17338. //
  17339. // 1. An object of properties
  17340. // 2. A key and value
  17341. //
  17342. this.set( owner, key, value );
  17343. // Since the "set" path can have two possible entry points
  17344. // return the expected data based on which path was taken[*]
  17345. return value !== undefined ? value : key;
  17346. },
  17347. remove: function( owner, key ) {
  17348. var i,
  17349. cache = owner[ this.expando ];
  17350. if ( cache === undefined ) {
  17351. return;
  17352. }
  17353. if ( key !== undefined ) {
  17354. // Support array or space separated string of keys
  17355. if ( Array.isArray( key ) ) {
  17356. // If key is an array of keys...
  17357. // We always set camelCase keys, so remove that.
  17358. key = key.map( camelCase );
  17359. } else {
  17360. key = camelCase( key );
  17361. // If a key with the spaces exists, use it.
  17362. // Otherwise, create an array by matching non-whitespace
  17363. key = key in cache ?
  17364. [ key ] :
  17365. ( key.match( rnothtmlwhite ) || [] );
  17366. }
  17367. i = key.length;
  17368. while ( i-- ) {
  17369. delete cache[ key[ i ] ];
  17370. }
  17371. }
  17372. // Remove the expando if there's no more data
  17373. if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
  17374. // Support: Chrome <=35 - 45
  17375. // Webkit & Blink performance suffers when deleting properties
  17376. // from DOM nodes, so set to undefined instead
  17377. // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
  17378. if ( owner.nodeType ) {
  17379. owner[ this.expando ] = undefined;
  17380. } else {
  17381. delete owner[ this.expando ];
  17382. }
  17383. }
  17384. },
  17385. hasData: function( owner ) {
  17386. var cache = owner[ this.expando ];
  17387. return cache !== undefined && !jQuery.isEmptyObject( cache );
  17388. }
  17389. };
  17390. var dataPriv = new Data();
  17391. var dataUser = new Data();
  17392. // Implementation Summary
  17393. //
  17394. // 1. Enforce API surface and semantic compatibility with 1.9.x branch
  17395. // 2. Improve the module's maintainability by reducing the storage
  17396. // paths to a single mechanism.
  17397. // 3. Use the same single mechanism to support "private" and "user" data.
  17398. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  17399. // 5. Avoid exposing implementation details on user objects (eg. expando properties)
  17400. // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
  17401. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  17402. rmultiDash = /[A-Z]/g;
  17403. function getData( data ) {
  17404. if ( data === "true" ) {
  17405. return true;
  17406. }
  17407. if ( data === "false" ) {
  17408. return false;
  17409. }
  17410. if ( data === "null" ) {
  17411. return null;
  17412. }
  17413. // Only convert to a number if it doesn't change the string
  17414. if ( data === +data + "" ) {
  17415. return +data;
  17416. }
  17417. if ( rbrace.test( data ) ) {
  17418. return JSON.parse( data );
  17419. }
  17420. return data;
  17421. }
  17422. function dataAttr( elem, key, data ) {
  17423. var name;
  17424. // If nothing was found internally, try to fetch any
  17425. // data from the HTML5 data-* attribute
  17426. if ( data === undefined && elem.nodeType === 1 ) {
  17427. name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
  17428. data = elem.getAttribute( name );
  17429. if ( typeof data === "string" ) {
  17430. try {
  17431. data = getData( data );
  17432. } catch ( e ) {}
  17433. // Make sure we set the data so it isn't changed later
  17434. dataUser.set( elem, key, data );
  17435. } else {
  17436. data = undefined;
  17437. }
  17438. }
  17439. return data;
  17440. }
  17441. jQuery.extend( {
  17442. hasData: function( elem ) {
  17443. return dataUser.hasData( elem ) || dataPriv.hasData( elem );
  17444. },
  17445. data: function( elem, name, data ) {
  17446. return dataUser.access( elem, name, data );
  17447. },
  17448. removeData: function( elem, name ) {
  17449. dataUser.remove( elem, name );
  17450. },
  17451. // TODO: Now that all calls to _data and _removeData have been replaced
  17452. // with direct calls to dataPriv methods, these can be deprecated.
  17453. _data: function( elem, name, data ) {
  17454. return dataPriv.access( elem, name, data );
  17455. },
  17456. _removeData: function( elem, name ) {
  17457. dataPriv.remove( elem, name );
  17458. }
  17459. } );
  17460. jQuery.fn.extend( {
  17461. data: function( key, value ) {
  17462. var i, name, data,
  17463. elem = this[ 0 ],
  17464. attrs = elem && elem.attributes;
  17465. // Gets all values
  17466. if ( key === undefined ) {
  17467. if ( this.length ) {
  17468. data = dataUser.get( elem );
  17469. if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
  17470. i = attrs.length;
  17471. while ( i-- ) {
  17472. // Support: IE 11 only
  17473. // The attrs elements can be null (#14894)
  17474. if ( attrs[ i ] ) {
  17475. name = attrs[ i ].name;
  17476. if ( name.indexOf( "data-" ) === 0 ) {
  17477. name = camelCase( name.slice( 5 ) );
  17478. dataAttr( elem, name, data[ name ] );
  17479. }
  17480. }
  17481. }
  17482. dataPriv.set( elem, "hasDataAttrs", true );
  17483. }
  17484. }
  17485. return data;
  17486. }
  17487. // Sets multiple values
  17488. if ( typeof key === "object" ) {
  17489. return this.each( function() {
  17490. dataUser.set( this, key );
  17491. } );
  17492. }
  17493. return access( this, function( value ) {
  17494. var data;
  17495. // The calling jQuery object (element matches) is not empty
  17496. // (and therefore has an element appears at this[ 0 ]) and the
  17497. // `value` parameter was not undefined. An empty jQuery object
  17498. // will result in `undefined` for elem = this[ 0 ] which will
  17499. // throw an exception if an attempt to read a data cache is made.
  17500. if ( elem && value === undefined ) {
  17501. // Attempt to get data from the cache
  17502. // The key will always be camelCased in Data
  17503. data = dataUser.get( elem, key );
  17504. if ( data !== undefined ) {
  17505. return data;
  17506. }
  17507. // Attempt to "discover" the data in
  17508. // HTML5 custom data-* attrs
  17509. data = dataAttr( elem, key );
  17510. if ( data !== undefined ) {
  17511. return data;
  17512. }
  17513. // We tried really hard, but the data doesn't exist.
  17514. return;
  17515. }
  17516. // Set the data...
  17517. this.each( function() {
  17518. // We always store the camelCased key
  17519. dataUser.set( this, key, value );
  17520. } );
  17521. }, null, value, arguments.length > 1, null, true );
  17522. },
  17523. removeData: function( key ) {
  17524. return this.each( function() {
  17525. dataUser.remove( this, key );
  17526. } );
  17527. }
  17528. } );
  17529. jQuery.extend( {
  17530. queue: function( elem, type, data ) {
  17531. var queue;
  17532. if ( elem ) {
  17533. type = ( type || "fx" ) + "queue";
  17534. queue = dataPriv.get( elem, type );
  17535. // Speed up dequeue by getting out quickly if this is just a lookup
  17536. if ( data ) {
  17537. if ( !queue || Array.isArray( data ) ) {
  17538. queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
  17539. } else {
  17540. queue.push( data );
  17541. }
  17542. }
  17543. return queue || [];
  17544. }
  17545. },
  17546. dequeue: function( elem, type ) {
  17547. type = type || "fx";
  17548. var queue = jQuery.queue( elem, type ),
  17549. startLength = queue.length,
  17550. fn = queue.shift(),
  17551. hooks = jQuery._queueHooks( elem, type ),
  17552. next = function() {
  17553. jQuery.dequeue( elem, type );
  17554. };
  17555. // If the fx queue is dequeued, always remove the progress sentinel
  17556. if ( fn === "inprogress" ) {
  17557. fn = queue.shift();
  17558. startLength--;
  17559. }
  17560. if ( fn ) {
  17561. // Add a progress sentinel to prevent the fx queue from being
  17562. // automatically dequeued
  17563. if ( type === "fx" ) {
  17564. queue.unshift( "inprogress" );
  17565. }
  17566. // Clear up the last queue stop function
  17567. delete hooks.stop;
  17568. fn.call( elem, next, hooks );
  17569. }
  17570. if ( !startLength && hooks ) {
  17571. hooks.empty.fire();
  17572. }
  17573. },
  17574. // Not public - generate a queueHooks object, or return the current one
  17575. _queueHooks: function( elem, type ) {
  17576. var key = type + "queueHooks";
  17577. return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
  17578. empty: jQuery.Callbacks( "once memory" ).add( function() {
  17579. dataPriv.remove( elem, [ type + "queue", key ] );
  17580. } )
  17581. } );
  17582. }
  17583. } );
  17584. jQuery.fn.extend( {
  17585. queue: function( type, data ) {
  17586. var setter = 2;
  17587. if ( typeof type !== "string" ) {
  17588. data = type;
  17589. type = "fx";
  17590. setter--;
  17591. }
  17592. if ( arguments.length < setter ) {
  17593. return jQuery.queue( this[ 0 ], type );
  17594. }
  17595. return data === undefined ?
  17596. this :
  17597. this.each( function() {
  17598. var queue = jQuery.queue( this, type, data );
  17599. // Ensure a hooks for this queue
  17600. jQuery._queueHooks( this, type );
  17601. if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
  17602. jQuery.dequeue( this, type );
  17603. }
  17604. } );
  17605. },
  17606. dequeue: function( type ) {
  17607. return this.each( function() {
  17608. jQuery.dequeue( this, type );
  17609. } );
  17610. },
  17611. clearQueue: function( type ) {
  17612. return this.queue( type || "fx", [] );
  17613. },
  17614. // Get a promise resolved when queues of a certain type
  17615. // are emptied (fx is the type by default)
  17616. promise: function( type, obj ) {
  17617. var tmp,
  17618. count = 1,
  17619. defer = jQuery.Deferred(),
  17620. elements = this,
  17621. i = this.length,
  17622. resolve = function() {
  17623. if ( !( --count ) ) {
  17624. defer.resolveWith( elements, [ elements ] );
  17625. }
  17626. };
  17627. if ( typeof type !== "string" ) {
  17628. obj = type;
  17629. type = undefined;
  17630. }
  17631. type = type || "fx";
  17632. while ( i-- ) {
  17633. tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
  17634. if ( tmp && tmp.empty ) {
  17635. count++;
  17636. tmp.empty.add( resolve );
  17637. }
  17638. }
  17639. resolve();
  17640. return defer.promise( obj );
  17641. }
  17642. } );
  17643. var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
  17644. var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
  17645. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  17646. var documentElement = document.documentElement;
  17647. var isAttached = function( elem ) {
  17648. return jQuery.contains( elem.ownerDocument, elem );
  17649. },
  17650. composed = { composed: true };
  17651. // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only
  17652. // Check attachment across shadow DOM boundaries when possible (gh-3504)
  17653. // Support: iOS 10.0-10.2 only
  17654. // Early iOS 10 versions support `attachShadow` but not `getRootNode`,
  17655. // leading to errors. We need to check for `getRootNode`.
  17656. if ( documentElement.getRootNode ) {
  17657. isAttached = function( elem ) {
  17658. return jQuery.contains( elem.ownerDocument, elem ) ||
  17659. elem.getRootNode( composed ) === elem.ownerDocument;
  17660. };
  17661. }
  17662. var isHiddenWithinTree = function( elem, el ) {
  17663. // isHiddenWithinTree might be called from jQuery#filter function;
  17664. // in that case, element will be second argument
  17665. elem = el || elem;
  17666. // Inline style trumps all
  17667. return elem.style.display === "none" ||
  17668. elem.style.display === "" &&
  17669. // Otherwise, check computed style
  17670. // Support: Firefox <=43 - 45
  17671. // Disconnected elements can have computed display: none, so first confirm that elem is
  17672. // in the document.
  17673. isAttached( elem ) &&
  17674. jQuery.css( elem, "display" ) === "none";
  17675. };
  17676. function adjustCSS( elem, prop, valueParts, tween ) {
  17677. var adjusted, scale,
  17678. maxIterations = 20,
  17679. currentValue = tween ?
  17680. function() {
  17681. return tween.cur();
  17682. } :
  17683. function() {
  17684. return jQuery.css( elem, prop, "" );
  17685. },
  17686. initial = currentValue(),
  17687. unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  17688. // Starting value computation is required for potential unit mismatches
  17689. initialInUnit = elem.nodeType &&
  17690. ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
  17691. rcssNum.exec( jQuery.css( elem, prop ) );
  17692. if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
  17693. // Support: Firefox <=54
  17694. // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144)
  17695. initial = initial / 2;
  17696. // Trust units reported by jQuery.css
  17697. unit = unit || initialInUnit[ 3 ];
  17698. // Iteratively approximate from a nonzero starting point
  17699. initialInUnit = +initial || 1;
  17700. while ( maxIterations-- ) {
  17701. // Evaluate and update our best guess (doubling guesses that zero out).
  17702. // Finish if the scale equals or crosses 1 (making the old*new product non-positive).
  17703. jQuery.style( elem, prop, initialInUnit + unit );
  17704. if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) {
  17705. maxIterations = 0;
  17706. }
  17707. initialInUnit = initialInUnit / scale;
  17708. }
  17709. initialInUnit = initialInUnit * 2;
  17710. jQuery.style( elem, prop, initialInUnit + unit );
  17711. // Make sure we update the tween properties later on
  17712. valueParts = valueParts || [];
  17713. }
  17714. if ( valueParts ) {
  17715. initialInUnit = +initialInUnit || +initial || 0;
  17716. // Apply relative offset (+=/-=) if specified
  17717. adjusted = valueParts[ 1 ] ?
  17718. initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
  17719. +valueParts[ 2 ];
  17720. if ( tween ) {
  17721. tween.unit = unit;
  17722. tween.start = initialInUnit;
  17723. tween.end = adjusted;
  17724. }
  17725. }
  17726. return adjusted;
  17727. }
  17728. var defaultDisplayMap = {};
  17729. function getDefaultDisplay( elem ) {
  17730. var temp,
  17731. doc = elem.ownerDocument,
  17732. nodeName = elem.nodeName,
  17733. display = defaultDisplayMap[ nodeName ];
  17734. if ( display ) {
  17735. return display;
  17736. }
  17737. temp = doc.body.appendChild( doc.createElement( nodeName ) );
  17738. display = jQuery.css( temp, "display" );
  17739. temp.parentNode.removeChild( temp );
  17740. if ( display === "none" ) {
  17741. display = "block";
  17742. }
  17743. defaultDisplayMap[ nodeName ] = display;
  17744. return display;
  17745. }
  17746. function showHide( elements, show ) {
  17747. var display, elem,
  17748. values = [],
  17749. index = 0,
  17750. length = elements.length;
  17751. // Determine new display value for elements that need to change
  17752. for ( ; index < length; index++ ) {
  17753. elem = elements[ index ];
  17754. if ( !elem.style ) {
  17755. continue;
  17756. }
  17757. display = elem.style.display;
  17758. if ( show ) {
  17759. // Since we force visibility upon cascade-hidden elements, an immediate (and slow)
  17760. // check is required in this first loop unless we have a nonempty display value (either
  17761. // inline or about-to-be-restored)
  17762. if ( display === "none" ) {
  17763. values[ index ] = dataPriv.get( elem, "display" ) || null;
  17764. if ( !values[ index ] ) {
  17765. elem.style.display = "";
  17766. }
  17767. }
  17768. if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) {
  17769. values[ index ] = getDefaultDisplay( elem );
  17770. }
  17771. } else {
  17772. if ( display !== "none" ) {
  17773. values[ index ] = "none";
  17774. // Remember what we're overwriting
  17775. dataPriv.set( elem, "display", display );
  17776. }
  17777. }
  17778. }
  17779. // Set the display of the elements in a second loop to avoid constant reflow
  17780. for ( index = 0; index < length; index++ ) {
  17781. if ( values[ index ] != null ) {
  17782. elements[ index ].style.display = values[ index ];
  17783. }
  17784. }
  17785. return elements;
  17786. }
  17787. jQuery.fn.extend( {
  17788. show: function() {
  17789. return showHide( this, true );
  17790. },
  17791. hide: function() {
  17792. return showHide( this );
  17793. },
  17794. toggle: function( state ) {
  17795. if ( typeof state === "boolean" ) {
  17796. return state ? this.show() : this.hide();
  17797. }
  17798. return this.each( function() {
  17799. if ( isHiddenWithinTree( this ) ) {
  17800. jQuery( this ).show();
  17801. } else {
  17802. jQuery( this ).hide();
  17803. }
  17804. } );
  17805. }
  17806. } );
  17807. var rcheckableType = ( /^(?:checkbox|radio)$/i );
  17808. var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i );
  17809. var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i );
  17810. ( function() {
  17811. var fragment = document.createDocumentFragment(),
  17812. div = fragment.appendChild( document.createElement( "div" ) ),
  17813. input = document.createElement( "input" );
  17814. // Support: Android 4.0 - 4.3 only
  17815. // Check state lost if the name is set (#11217)
  17816. // Support: Windows Web Apps (WWA)
  17817. // `name` and `type` must use .setAttribute for WWA (#14901)
  17818. input.setAttribute( "type", "radio" );
  17819. input.setAttribute( "checked", "checked" );
  17820. input.setAttribute( "name", "t" );
  17821. div.appendChild( input );
  17822. // Support: Android <=4.1 only
  17823. // Older WebKit doesn't clone checked state correctly in fragments
  17824. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  17825. // Support: IE <=11 only
  17826. // Make sure textarea (and checkbox) defaultValue is properly cloned
  17827. div.innerHTML = "<textarea>x</textarea>";
  17828. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  17829. // Support: IE <=9 only
  17830. // IE <=9 replaces <option> tags with their contents when inserted outside of
  17831. // the select element.
  17832. div.innerHTML = "<option></option>";
  17833. support.option = !!div.lastChild;
  17834. } )();
  17835. // We have to close these tags to support XHTML (#13200)
  17836. var wrapMap = {
  17837. // XHTML parsers do not magically insert elements in the
  17838. // same way that tag soup parsers do. So we cannot shorten
  17839. // this by omitting <tbody> or other required elements.
  17840. thead: [ 1, "<table>", "</table>" ],
  17841. col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
  17842. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  17843. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  17844. _default: [ 0, "", "" ]
  17845. };
  17846. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  17847. wrapMap.th = wrapMap.td;
  17848. // Support: IE <=9 only
  17849. if ( !support.option ) {
  17850. wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ];
  17851. }
  17852. function getAll( context, tag ) {
  17853. // Support: IE <=9 - 11 only
  17854. // Use typeof to avoid zero-argument method invocation on host objects (#15151)
  17855. var ret;
  17856. if ( typeof context.getElementsByTagName !== "undefined" ) {
  17857. ret = context.getElementsByTagName( tag || "*" );
  17858. } else if ( typeof context.querySelectorAll !== "undefined" ) {
  17859. ret = context.querySelectorAll( tag || "*" );
  17860. } else {
  17861. ret = [];
  17862. }
  17863. if ( tag === undefined || tag && nodeName( context, tag ) ) {
  17864. return jQuery.merge( [ context ], ret );
  17865. }
  17866. return ret;
  17867. }
  17868. // Mark scripts as having already been evaluated
  17869. function setGlobalEval( elems, refElements ) {
  17870. var i = 0,
  17871. l = elems.length;
  17872. for ( ; i < l; i++ ) {
  17873. dataPriv.set(
  17874. elems[ i ],
  17875. "globalEval",
  17876. !refElements || dataPriv.get( refElements[ i ], "globalEval" )
  17877. );
  17878. }
  17879. }
  17880. var rhtml = /<|&#?\w+;/;
  17881. function buildFragment( elems, context, scripts, selection, ignored ) {
  17882. var elem, tmp, tag, wrap, attached, j,
  17883. fragment = context.createDocumentFragment(),
  17884. nodes = [],
  17885. i = 0,
  17886. l = elems.length;
  17887. for ( ; i < l; i++ ) {
  17888. elem = elems[ i ];
  17889. if ( elem || elem === 0 ) {
  17890. // Add nodes directly
  17891. if ( toType( elem ) === "object" ) {
  17892. // Support: Android <=4.0 only, PhantomJS 1 only
  17893. // push.apply(_, arraylike) throws on ancient WebKit
  17894. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  17895. // Convert non-html into a text node
  17896. } else if ( !rhtml.test( elem ) ) {
  17897. nodes.push( context.createTextNode( elem ) );
  17898. // Convert html into DOM nodes
  17899. } else {
  17900. tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
  17901. // Deserialize a standard representation
  17902. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  17903. wrap = wrapMap[ tag ] || wrapMap._default;
  17904. tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
  17905. // Descend through wrappers to the right content
  17906. j = wrap[ 0 ];
  17907. while ( j-- ) {
  17908. tmp = tmp.lastChild;
  17909. }
  17910. // Support: Android <=4.0 only, PhantomJS 1 only
  17911. // push.apply(_, arraylike) throws on ancient WebKit
  17912. jQuery.merge( nodes, tmp.childNodes );
  17913. // Remember the top-level container
  17914. tmp = fragment.firstChild;
  17915. // Ensure the created nodes are orphaned (#12392)
  17916. tmp.textContent = "";
  17917. }
  17918. }
  17919. }
  17920. // Remove wrapper from fragment
  17921. fragment.textContent = "";
  17922. i = 0;
  17923. while ( ( elem = nodes[ i++ ] ) ) {
  17924. // Skip elements already in the context collection (trac-4087)
  17925. if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
  17926. if ( ignored ) {
  17927. ignored.push( elem );
  17928. }
  17929. continue;
  17930. }
  17931. attached = isAttached( elem );
  17932. // Append to fragment
  17933. tmp = getAll( fragment.appendChild( elem ), "script" );
  17934. // Preserve script evaluation history
  17935. if ( attached ) {
  17936. setGlobalEval( tmp );
  17937. }
  17938. // Capture executables
  17939. if ( scripts ) {
  17940. j = 0;
  17941. while ( ( elem = tmp[ j++ ] ) ) {
  17942. if ( rscriptType.test( elem.type || "" ) ) {
  17943. scripts.push( elem );
  17944. }
  17945. }
  17946. }
  17947. }
  17948. return fragment;
  17949. }
  17950. var
  17951. rkeyEvent = /^key/,
  17952. rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
  17953. rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  17954. function returnTrue() {
  17955. return true;
  17956. }
  17957. function returnFalse() {
  17958. return false;
  17959. }
  17960. // Support: IE <=9 - 11+
  17961. // focus() and blur() are asynchronous, except when they are no-op.
  17962. // So expect focus to be synchronous when the element is already active,
  17963. // and blur to be synchronous when the element is not already active.
  17964. // (focus and blur are always synchronous in other supported browsers,
  17965. // this just defines when we can count on it).
  17966. function expectSync( elem, type ) {
  17967. return ( elem === safeActiveElement() ) === ( type === "focus" );
  17968. }
  17969. // Support: IE <=9 only
  17970. // Accessing document.activeElement can throw unexpectedly
  17971. // https://bugs.jquery.com/ticket/13393
  17972. function safeActiveElement() {
  17973. try {
  17974. return document.activeElement;
  17975. } catch ( err ) { }
  17976. }
  17977. function on( elem, types, selector, data, fn, one ) {
  17978. var origFn, type;
  17979. // Types can be a map of types/handlers
  17980. if ( typeof types === "object" ) {
  17981. // ( types-Object, selector, data )
  17982. if ( typeof selector !== "string" ) {
  17983. // ( types-Object, data )
  17984. data = data || selector;
  17985. selector = undefined;
  17986. }
  17987. for ( type in types ) {
  17988. on( elem, type, selector, data, types[ type ], one );
  17989. }
  17990. return elem;
  17991. }
  17992. if ( data == null && fn == null ) {
  17993. // ( types, fn )
  17994. fn = selector;
  17995. data = selector = undefined;
  17996. } else if ( fn == null ) {
  17997. if ( typeof selector === "string" ) {
  17998. // ( types, selector, fn )
  17999. fn = data;
  18000. data = undefined;
  18001. } else {
  18002. // ( types, data, fn )
  18003. fn = data;
  18004. data = selector;
  18005. selector = undefined;
  18006. }
  18007. }
  18008. if ( fn === false ) {
  18009. fn = returnFalse;
  18010. } else if ( !fn ) {
  18011. return elem;
  18012. }
  18013. if ( one === 1 ) {
  18014. origFn = fn;
  18015. fn = function( event ) {
  18016. // Can use an empty set, since event contains the info
  18017. jQuery().off( event );
  18018. return origFn.apply( this, arguments );
  18019. };
  18020. // Use same guid so caller can remove using origFn
  18021. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  18022. }
  18023. return elem.each( function() {
  18024. jQuery.event.add( this, types, fn, data, selector );
  18025. } );
  18026. }
  18027. /*
  18028. * Helper functions for managing events -- not part of the public interface.
  18029. * Props to Dean Edwards' addEvent library for many of the ideas.
  18030. */
  18031. jQuery.event = {
  18032. global: {},
  18033. add: function( elem, types, handler, data, selector ) {
  18034. var handleObjIn, eventHandle, tmp,
  18035. events, t, handleObj,
  18036. special, handlers, type, namespaces, origType,
  18037. elemData = dataPriv.get( elem );
  18038. // Only attach events to objects that accept data
  18039. if ( !acceptData( elem ) ) {
  18040. return;
  18041. }
  18042. // Caller can pass in an object of custom data in lieu of the handler
  18043. if ( handler.handler ) {
  18044. handleObjIn = handler;
  18045. handler = handleObjIn.handler;
  18046. selector = handleObjIn.selector;
  18047. }
  18048. // Ensure that invalid selectors throw exceptions at attach time
  18049. // Evaluate against documentElement in case elem is a non-element node (e.g., document)
  18050. if ( selector ) {
  18051. jQuery.find.matchesSelector( documentElement, selector );
  18052. }
  18053. // Make sure that the handler has a unique ID, used to find/remove it later
  18054. if ( !handler.guid ) {
  18055. handler.guid = jQuery.guid++;
  18056. }
  18057. // Init the element's event structure and main handler, if this is the first
  18058. if ( !( events = elemData.events ) ) {
  18059. events = elemData.events = Object.create( null );
  18060. }
  18061. if ( !( eventHandle = elemData.handle ) ) {
  18062. eventHandle = elemData.handle = function( e ) {
  18063. // Discard the second event of a jQuery.event.trigger() and
  18064. // when an event is called after a page has unloaded
  18065. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
  18066. jQuery.event.dispatch.apply( elem, arguments ) : undefined;
  18067. };
  18068. }
  18069. // Handle multiple events separated by a space
  18070. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  18071. t = types.length;
  18072. while ( t-- ) {
  18073. tmp = rtypenamespace.exec( types[ t ] ) || [];
  18074. type = origType = tmp[ 1 ];
  18075. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  18076. // There *must* be a type, no attaching namespace-only handlers
  18077. if ( !type ) {
  18078. continue;
  18079. }
  18080. // If event changes its type, use the special event handlers for the changed type
  18081. special = jQuery.event.special[ type ] || {};
  18082. // If selector defined, determine special event api type, otherwise given type
  18083. type = ( selector ? special.delegateType : special.bindType ) || type;
  18084. // Update special based on newly reset type
  18085. special = jQuery.event.special[ type ] || {};
  18086. // handleObj is passed to all event handlers
  18087. handleObj = jQuery.extend( {
  18088. type: type,
  18089. origType: origType,
  18090. data: data,
  18091. handler: handler,
  18092. guid: handler.guid,
  18093. selector: selector,
  18094. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  18095. namespace: namespaces.join( "." )
  18096. }, handleObjIn );
  18097. // Init the event handler queue if we're the first
  18098. if ( !( handlers = events[ type ] ) ) {
  18099. handlers = events[ type ] = [];
  18100. handlers.delegateCount = 0;
  18101. // Only use addEventListener if the special events handler returns false
  18102. if ( !special.setup ||
  18103. special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  18104. if ( elem.addEventListener ) {
  18105. elem.addEventListener( type, eventHandle );
  18106. }
  18107. }
  18108. }
  18109. if ( special.add ) {
  18110. special.add.call( elem, handleObj );
  18111. if ( !handleObj.handler.guid ) {
  18112. handleObj.handler.guid = handler.guid;
  18113. }
  18114. }
  18115. // Add to the element's handler list, delegates in front
  18116. if ( selector ) {
  18117. handlers.splice( handlers.delegateCount++, 0, handleObj );
  18118. } else {
  18119. handlers.push( handleObj );
  18120. }
  18121. // Keep track of which events have ever been used, for event optimization
  18122. jQuery.event.global[ type ] = true;
  18123. }
  18124. },
  18125. // Detach an event or set of events from an element
  18126. remove: function( elem, types, handler, selector, mappedTypes ) {
  18127. var j, origCount, tmp,
  18128. events, t, handleObj,
  18129. special, handlers, type, namespaces, origType,
  18130. elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
  18131. if ( !elemData || !( events = elemData.events ) ) {
  18132. return;
  18133. }
  18134. // Once for each type.namespace in types; type may be omitted
  18135. types = ( types || "" ).match( rnothtmlwhite ) || [ "" ];
  18136. t = types.length;
  18137. while ( t-- ) {
  18138. tmp = rtypenamespace.exec( types[ t ] ) || [];
  18139. type = origType = tmp[ 1 ];
  18140. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  18141. // Unbind all events (on this namespace, if provided) for the element
  18142. if ( !type ) {
  18143. for ( type in events ) {
  18144. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  18145. }
  18146. continue;
  18147. }
  18148. special = jQuery.event.special[ type ] || {};
  18149. type = ( selector ? special.delegateType : special.bindType ) || type;
  18150. handlers = events[ type ] || [];
  18151. tmp = tmp[ 2 ] &&
  18152. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
  18153. // Remove matching events
  18154. origCount = j = handlers.length;
  18155. while ( j-- ) {
  18156. handleObj = handlers[ j ];
  18157. if ( ( mappedTypes || origType === handleObj.origType ) &&
  18158. ( !handler || handler.guid === handleObj.guid ) &&
  18159. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  18160. ( !selector || selector === handleObj.selector ||
  18161. selector === "**" && handleObj.selector ) ) {
  18162. handlers.splice( j, 1 );
  18163. if ( handleObj.selector ) {
  18164. handlers.delegateCount--;
  18165. }
  18166. if ( special.remove ) {
  18167. special.remove.call( elem, handleObj );
  18168. }
  18169. }
  18170. }
  18171. // Remove generic event handler if we removed something and no more handlers exist
  18172. // (avoids potential for endless recursion during removal of special event handlers)
  18173. if ( origCount && !handlers.length ) {
  18174. if ( !special.teardown ||
  18175. special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  18176. jQuery.removeEvent( elem, type, elemData.handle );
  18177. }
  18178. delete events[ type ];
  18179. }
  18180. }
  18181. // Remove data and the expando if it's no longer used
  18182. if ( jQuery.isEmptyObject( events ) ) {
  18183. dataPriv.remove( elem, "handle events" );
  18184. }
  18185. },
  18186. dispatch: function( nativeEvent ) {
  18187. var i, j, ret, matched, handleObj, handlerQueue,
  18188. args = new Array( arguments.length ),
  18189. // Make a writable jQuery.Event from the native event object
  18190. event = jQuery.event.fix( nativeEvent ),
  18191. handlers = (
  18192. dataPriv.get( this, "events" ) || Object.create( null )
  18193. )[ event.type ] || [],
  18194. special = jQuery.event.special[ event.type ] || {};
  18195. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  18196. args[ 0 ] = event;
  18197. for ( i = 1; i < arguments.length; i++ ) {
  18198. args[ i ] = arguments[ i ];
  18199. }
  18200. event.delegateTarget = this;
  18201. // Call the preDispatch hook for the mapped type, and let it bail if desired
  18202. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  18203. return;
  18204. }
  18205. // Determine handlers
  18206. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  18207. // Run delegates first; they may want to stop propagation beneath us
  18208. i = 0;
  18209. while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
  18210. event.currentTarget = matched.elem;
  18211. j = 0;
  18212. while ( ( handleObj = matched.handlers[ j++ ] ) &&
  18213. !event.isImmediatePropagationStopped() ) {
  18214. // If the event is namespaced, then each handler is only invoked if it is
  18215. // specially universal or its namespaces are a superset of the event's.
  18216. if ( !event.rnamespace || handleObj.namespace === false ||
  18217. event.rnamespace.test( handleObj.namespace ) ) {
  18218. event.handleObj = handleObj;
  18219. event.data = handleObj.data;
  18220. ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
  18221. handleObj.handler ).apply( matched.elem, args );
  18222. if ( ret !== undefined ) {
  18223. if ( ( event.result = ret ) === false ) {
  18224. event.preventDefault();
  18225. event.stopPropagation();
  18226. }
  18227. }
  18228. }
  18229. }
  18230. }
  18231. // Call the postDispatch hook for the mapped type
  18232. if ( special.postDispatch ) {
  18233. special.postDispatch.call( this, event );
  18234. }
  18235. return event.result;
  18236. },
  18237. handlers: function( event, handlers ) {
  18238. var i, handleObj, sel, matchedHandlers, matchedSelectors,
  18239. handlerQueue = [],
  18240. delegateCount = handlers.delegateCount,
  18241. cur = event.target;
  18242. // Find delegate handlers
  18243. if ( delegateCount &&
  18244. // Support: IE <=9
  18245. // Black-hole SVG <use> instance trees (trac-13180)
  18246. cur.nodeType &&
  18247. // Support: Firefox <=42
  18248. // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
  18249. // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
  18250. // Support: IE 11 only
  18251. // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
  18252. !( event.type === "click" && event.button >= 1 ) ) {
  18253. for ( ; cur !== this; cur = cur.parentNode || this ) {
  18254. // Don't check non-elements (#13208)
  18255. // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
  18256. if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) {
  18257. matchedHandlers = [];
  18258. matchedSelectors = {};
  18259. for ( i = 0; i < delegateCount; i++ ) {
  18260. handleObj = handlers[ i ];
  18261. // Don't conflict with Object.prototype properties (#13203)
  18262. sel = handleObj.selector + " ";
  18263. if ( matchedSelectors[ sel ] === undefined ) {
  18264. matchedSelectors[ sel ] = handleObj.needsContext ?
  18265. jQuery( sel, this ).index( cur ) > -1 :
  18266. jQuery.find( sel, this, null, [ cur ] ).length;
  18267. }
  18268. if ( matchedSelectors[ sel ] ) {
  18269. matchedHandlers.push( handleObj );
  18270. }
  18271. }
  18272. if ( matchedHandlers.length ) {
  18273. handlerQueue.push( { elem: cur, handlers: matchedHandlers } );
  18274. }
  18275. }
  18276. }
  18277. }
  18278. // Add the remaining (directly-bound) handlers
  18279. cur = this;
  18280. if ( delegateCount < handlers.length ) {
  18281. handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } );
  18282. }
  18283. return handlerQueue;
  18284. },
  18285. addProp: function( name, hook ) {
  18286. Object.defineProperty( jQuery.Event.prototype, name, {
  18287. enumerable: true,
  18288. configurable: true,
  18289. get: isFunction( hook ) ?
  18290. function() {
  18291. if ( this.originalEvent ) {
  18292. return hook( this.originalEvent );
  18293. }
  18294. } :
  18295. function() {
  18296. if ( this.originalEvent ) {
  18297. return this.originalEvent[ name ];
  18298. }
  18299. },
  18300. set: function( value ) {
  18301. Object.defineProperty( this, name, {
  18302. enumerable: true,
  18303. configurable: true,
  18304. writable: true,
  18305. value: value
  18306. } );
  18307. }
  18308. } );
  18309. },
  18310. fix: function( originalEvent ) {
  18311. return originalEvent[ jQuery.expando ] ?
  18312. originalEvent :
  18313. new jQuery.Event( originalEvent );
  18314. },
  18315. special: {
  18316. load: {
  18317. // Prevent triggered image.load events from bubbling to window.load
  18318. noBubble: true
  18319. },
  18320. click: {
  18321. // Utilize native event to ensure correct state for checkable inputs
  18322. setup: function( data ) {
  18323. // For mutual compressibility with _default, replace `this` access with a local var.
  18324. // `|| data` is dead code meant only to preserve the variable through minification.
  18325. var el = this || data;
  18326. // Claim the first handler
  18327. if ( rcheckableType.test( el.type ) &&
  18328. el.click && nodeName( el, "input" ) ) {
  18329. // dataPriv.set( el, "click", ... )
  18330. leverageNative( el, "click", returnTrue );
  18331. }
  18332. // Return false to allow normal processing in the caller
  18333. return false;
  18334. },
  18335. trigger: function( data ) {
  18336. // For mutual compressibility with _default, replace `this` access with a local var.
  18337. // `|| data` is dead code meant only to preserve the variable through minification.
  18338. var el = this || data;
  18339. // Force setup before triggering a click
  18340. if ( rcheckableType.test( el.type ) &&
  18341. el.click && nodeName( el, "input" ) ) {
  18342. leverageNative( el, "click" );
  18343. }
  18344. // Return non-false to allow normal event-path propagation
  18345. return true;
  18346. },
  18347. // For cross-browser consistency, suppress native .click() on links
  18348. // Also prevent it if we're currently inside a leveraged native-event stack
  18349. _default: function( event ) {
  18350. var target = event.target;
  18351. return rcheckableType.test( target.type ) &&
  18352. target.click && nodeName( target, "input" ) &&
  18353. dataPriv.get( target, "click" ) ||
  18354. nodeName( target, "a" );
  18355. }
  18356. },
  18357. beforeunload: {
  18358. postDispatch: function( event ) {
  18359. // Support: Firefox 20+
  18360. // Firefox doesn't alert if the returnValue field is not set.
  18361. if ( event.result !== undefined && event.originalEvent ) {
  18362. event.originalEvent.returnValue = event.result;
  18363. }
  18364. }
  18365. }
  18366. }
  18367. };
  18368. // Ensure the presence of an event listener that handles manually-triggered
  18369. // synthetic events by interrupting progress until reinvoked in response to
  18370. // *native* events that it fires directly, ensuring that state changes have
  18371. // already occurred before other listeners are invoked.
  18372. function leverageNative( el, type, expectSync ) {
  18373. // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
  18374. if ( !expectSync ) {
  18375. if ( dataPriv.get( el, type ) === undefined ) {
  18376. jQuery.event.add( el, type, returnTrue );
  18377. }
  18378. return;
  18379. }
  18380. // Register the controller as a special universal handler for all event namespaces
  18381. dataPriv.set( el, type, false );
  18382. jQuery.event.add( el, type, {
  18383. namespace: false,
  18384. handler: function( event ) {
  18385. var notAsync, result,
  18386. saved = dataPriv.get( this, type );
  18387. if ( ( event.isTrigger & 1 ) && this[ type ] ) {
  18388. // Interrupt processing of the outer synthetic .trigger()ed event
  18389. // Saved data should be false in such cases, but might be a leftover capture object
  18390. // from an async native handler (gh-4350)
  18391. if ( !saved.length ) {
  18392. // Store arguments for use when handling the inner native event
  18393. // There will always be at least one argument (an event object), so this array
  18394. // will not be confused with a leftover capture object.
  18395. saved = slice.call( arguments );
  18396. dataPriv.set( this, type, saved );
  18397. // Trigger the native event and capture its result
  18398. // Support: IE <=9 - 11+
  18399. // focus() and blur() are asynchronous
  18400. notAsync = expectSync( this, type );
  18401. this[ type ]();
  18402. result = dataPriv.get( this, type );
  18403. if ( saved !== result || notAsync ) {
  18404. dataPriv.set( this, type, false );
  18405. } else {
  18406. result = {};
  18407. }
  18408. if ( saved !== result ) {
  18409. // Cancel the outer synthetic event
  18410. event.stopImmediatePropagation();
  18411. event.preventDefault();
  18412. return result.value;
  18413. }
  18414. // If this is an inner synthetic event for an event with a bubbling surrogate
  18415. // (focus or blur), assume that the surrogate already propagated from triggering the
  18416. // native event and prevent that from happening again here.
  18417. // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the
  18418. // bubbling surrogate propagates *after* the non-bubbling base), but that seems
  18419. // less bad than duplication.
  18420. } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) {
  18421. event.stopPropagation();
  18422. }
  18423. // If this is a native event triggered above, everything is now in order
  18424. // Fire an inner synthetic event with the original arguments
  18425. } else if ( saved.length ) {
  18426. // ...and capture the result
  18427. dataPriv.set( this, type, {
  18428. value: jQuery.event.trigger(
  18429. // Support: IE <=9 - 11+
  18430. // Extend with the prototype to reset the above stopImmediatePropagation()
  18431. jQuery.extend( saved[ 0 ], jQuery.Event.prototype ),
  18432. saved.slice( 1 ),
  18433. this
  18434. )
  18435. } );
  18436. // Abort handling of the native event
  18437. event.stopImmediatePropagation();
  18438. }
  18439. }
  18440. } );
  18441. }
  18442. jQuery.removeEvent = function( elem, type, handle ) {
  18443. // This "if" is needed for plain objects
  18444. if ( elem.removeEventListener ) {
  18445. elem.removeEventListener( type, handle );
  18446. }
  18447. };
  18448. jQuery.Event = function( src, props ) {
  18449. // Allow instantiation without the 'new' keyword
  18450. if ( !( this instanceof jQuery.Event ) ) {
  18451. return new jQuery.Event( src, props );
  18452. }
  18453. // Event object
  18454. if ( src && src.type ) {
  18455. this.originalEvent = src;
  18456. this.type = src.type;
  18457. // Events bubbling up the document may have been marked as prevented
  18458. // by a handler lower down the tree; reflect the correct value.
  18459. this.isDefaultPrevented = src.defaultPrevented ||
  18460. src.defaultPrevented === undefined &&
  18461. // Support: Android <=2.3 only
  18462. src.returnValue === false ?
  18463. returnTrue :
  18464. returnFalse;
  18465. // Create target properties
  18466. // Support: Safari <=6 - 7 only
  18467. // Target should not be a text node (#504, #13143)
  18468. this.target = ( src.target && src.target.nodeType === 3 ) ?
  18469. src.target.parentNode :
  18470. src.target;
  18471. this.currentTarget = src.currentTarget;
  18472. this.relatedTarget = src.relatedTarget;
  18473. // Event type
  18474. } else {
  18475. this.type = src;
  18476. }
  18477. // Put explicitly provided properties onto the event object
  18478. if ( props ) {
  18479. jQuery.extend( this, props );
  18480. }
  18481. // Create a timestamp if incoming event doesn't have one
  18482. this.timeStamp = src && src.timeStamp || Date.now();
  18483. // Mark it as fixed
  18484. this[ jQuery.expando ] = true;
  18485. };
  18486. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  18487. // https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  18488. jQuery.Event.prototype = {
  18489. constructor: jQuery.Event,
  18490. isDefaultPrevented: returnFalse,
  18491. isPropagationStopped: returnFalse,
  18492. isImmediatePropagationStopped: returnFalse,
  18493. isSimulated: false,
  18494. preventDefault: function() {
  18495. var e = this.originalEvent;
  18496. this.isDefaultPrevented = returnTrue;
  18497. if ( e && !this.isSimulated ) {
  18498. e.preventDefault();
  18499. }
  18500. },
  18501. stopPropagation: function() {
  18502. var e = this.originalEvent;
  18503. this.isPropagationStopped = returnTrue;
  18504. if ( e && !this.isSimulated ) {
  18505. e.stopPropagation();
  18506. }
  18507. },
  18508. stopImmediatePropagation: function() {
  18509. var e = this.originalEvent;
  18510. this.isImmediatePropagationStopped = returnTrue;
  18511. if ( e && !this.isSimulated ) {
  18512. e.stopImmediatePropagation();
  18513. }
  18514. this.stopPropagation();
  18515. }
  18516. };
  18517. // Includes all common event props including KeyEvent and MouseEvent specific props
  18518. jQuery.each( {
  18519. altKey: true,
  18520. bubbles: true,
  18521. cancelable: true,
  18522. changedTouches: true,
  18523. ctrlKey: true,
  18524. detail: true,
  18525. eventPhase: true,
  18526. metaKey: true,
  18527. pageX: true,
  18528. pageY: true,
  18529. shiftKey: true,
  18530. view: true,
  18531. "char": true,
  18532. code: true,
  18533. charCode: true,
  18534. key: true,
  18535. keyCode: true,
  18536. button: true,
  18537. buttons: true,
  18538. clientX: true,
  18539. clientY: true,
  18540. offsetX: true,
  18541. offsetY: true,
  18542. pointerId: true,
  18543. pointerType: true,
  18544. screenX: true,
  18545. screenY: true,
  18546. targetTouches: true,
  18547. toElement: true,
  18548. touches: true,
  18549. which: function( event ) {
  18550. var button = event.button;
  18551. // Add which for key events
  18552. if ( event.which == null && rkeyEvent.test( event.type ) ) {
  18553. return event.charCode != null ? event.charCode : event.keyCode;
  18554. }
  18555. // Add which for click: 1 === left; 2 === middle; 3 === right
  18556. if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) {
  18557. if ( button & 1 ) {
  18558. return 1;
  18559. }
  18560. if ( button & 2 ) {
  18561. return 3;
  18562. }
  18563. if ( button & 4 ) {
  18564. return 2;
  18565. }
  18566. return 0;
  18567. }
  18568. return event.which;
  18569. }
  18570. }, jQuery.event.addProp );
  18571. jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
  18572. jQuery.event.special[ type ] = {
  18573. // Utilize native event if possible so blur/focus sequence is correct
  18574. setup: function() {
  18575. // Claim the first handler
  18576. // dataPriv.set( this, "focus", ... )
  18577. // dataPriv.set( this, "blur", ... )
  18578. leverageNative( this, type, expectSync );
  18579. // Return false to allow normal processing in the caller
  18580. return false;
  18581. },
  18582. trigger: function() {
  18583. // Force setup before trigger
  18584. leverageNative( this, type );
  18585. // Return non-false to allow normal event-path propagation
  18586. return true;
  18587. },
  18588. delegateType: delegateType
  18589. };
  18590. } );
  18591. // Create mouseenter/leave events using mouseover/out and event-time checks
  18592. // so that event delegation works in jQuery.
  18593. // Do the same for pointerenter/pointerleave and pointerover/pointerout
  18594. //
  18595. // Support: Safari 7 only
  18596. // Safari sends mouseenter too often; see:
  18597. // https://bugs.chromium.org/p/chromium/issues/detail?id=470258
  18598. // for the description of the bug (it existed in older Chrome versions as well).
  18599. jQuery.each( {
  18600. mouseenter: "mouseover",
  18601. mouseleave: "mouseout",
  18602. pointerenter: "pointerover",
  18603. pointerleave: "pointerout"
  18604. }, function( orig, fix ) {
  18605. jQuery.event.special[ orig ] = {
  18606. delegateType: fix,
  18607. bindType: fix,
  18608. handle: function( event ) {
  18609. var ret,
  18610. target = this,
  18611. related = event.relatedTarget,
  18612. handleObj = event.handleObj;
  18613. // For mouseenter/leave call the handler if related is outside the target.
  18614. // NB: No relatedTarget if the mouse left/entered the browser window
  18615. if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
  18616. event.type = handleObj.origType;
  18617. ret = handleObj.handler.apply( this, arguments );
  18618. event.type = fix;
  18619. }
  18620. return ret;
  18621. }
  18622. };
  18623. } );
  18624. jQuery.fn.extend( {
  18625. on: function( types, selector, data, fn ) {
  18626. return on( this, types, selector, data, fn );
  18627. },
  18628. one: function( types, selector, data, fn ) {
  18629. return on( this, types, selector, data, fn, 1 );
  18630. },
  18631. off: function( types, selector, fn ) {
  18632. var handleObj, type;
  18633. if ( types && types.preventDefault && types.handleObj ) {
  18634. // ( event ) dispatched jQuery.Event
  18635. handleObj = types.handleObj;
  18636. jQuery( types.delegateTarget ).off(
  18637. handleObj.namespace ?
  18638. handleObj.origType + "." + handleObj.namespace :
  18639. handleObj.origType,
  18640. handleObj.selector,
  18641. handleObj.handler
  18642. );
  18643. return this;
  18644. }
  18645. if ( typeof types === "object" ) {
  18646. // ( types-object [, selector] )
  18647. for ( type in types ) {
  18648. this.off( type, selector, types[ type ] );
  18649. }
  18650. return this;
  18651. }
  18652. if ( selector === false || typeof selector === "function" ) {
  18653. // ( types [, fn] )
  18654. fn = selector;
  18655. selector = undefined;
  18656. }
  18657. if ( fn === false ) {
  18658. fn = returnFalse;
  18659. }
  18660. return this.each( function() {
  18661. jQuery.event.remove( this, types, fn, selector );
  18662. } );
  18663. }
  18664. } );
  18665. var
  18666. // Support: IE <=10 - 11, Edge 12 - 13 only
  18667. // In IE/Edge using regex groups here causes severe slowdowns.
  18668. // See https://connect.microsoft.com/IE/feedback/details/1736512/
  18669. rnoInnerhtml = /<script|<style|<link/i,
  18670. // checked="checked" or checked
  18671. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  18672. rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
  18673. // Prefer a tbody over its parent table for containing new rows
  18674. function manipulationTarget( elem, content ) {
  18675. if ( nodeName( elem, "table" ) &&
  18676. nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
  18677. return jQuery( elem ).children( "tbody" )[ 0 ] || elem;
  18678. }
  18679. return elem;
  18680. }
  18681. // Replace/restore the type attribute of script elements for safe DOM manipulation
  18682. function disableScript( elem ) {
  18683. elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
  18684. return elem;
  18685. }
  18686. function restoreScript( elem ) {
  18687. if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) {
  18688. elem.type = elem.type.slice( 5 );
  18689. } else {
  18690. elem.removeAttribute( "type" );
  18691. }
  18692. return elem;
  18693. }
  18694. function cloneCopyEvent( src, dest ) {
  18695. var i, l, type, pdataOld, udataOld, udataCur, events;
  18696. if ( dest.nodeType !== 1 ) {
  18697. return;
  18698. }
  18699. // 1. Copy private data: events, handlers, etc.
  18700. if ( dataPriv.hasData( src ) ) {
  18701. pdataOld = dataPriv.get( src );
  18702. events = pdataOld.events;
  18703. if ( events ) {
  18704. dataPriv.remove( dest, "handle events" );
  18705. for ( type in events ) {
  18706. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  18707. jQuery.event.add( dest, type, events[ type ][ i ] );
  18708. }
  18709. }
  18710. }
  18711. }
  18712. // 2. Copy user data
  18713. if ( dataUser.hasData( src ) ) {
  18714. udataOld = dataUser.access( src );
  18715. udataCur = jQuery.extend( {}, udataOld );
  18716. dataUser.set( dest, udataCur );
  18717. }
  18718. }
  18719. // Fix IE bugs, see support tests
  18720. function fixInput( src, dest ) {
  18721. var nodeName = dest.nodeName.toLowerCase();
  18722. // Fails to persist the checked state of a cloned checkbox or radio button.
  18723. if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  18724. dest.checked = src.checked;
  18725. // Fails to return the selected option to the default selected state when cloning options
  18726. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  18727. dest.defaultValue = src.defaultValue;
  18728. }
  18729. }
  18730. function domManip( collection, args, callback, ignored ) {
  18731. // Flatten any nested arrays
  18732. args = flat( args );
  18733. var fragment, first, scripts, hasScripts, node, doc,
  18734. i = 0,
  18735. l = collection.length,
  18736. iNoClone = l - 1,
  18737. value = args[ 0 ],
  18738. valueIsFunction = isFunction( value );
  18739. // We can't cloneNode fragments that contain checked, in WebKit
  18740. if ( valueIsFunction ||
  18741. ( l > 1 && typeof value === "string" &&
  18742. !support.checkClone && rchecked.test( value ) ) ) {
  18743. return collection.each( function( index ) {
  18744. var self = collection.eq( index );
  18745. if ( valueIsFunction ) {
  18746. args[ 0 ] = value.call( this, index, self.html() );
  18747. }
  18748. domManip( self, args, callback, ignored );
  18749. } );
  18750. }
  18751. if ( l ) {
  18752. fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
  18753. first = fragment.firstChild;
  18754. if ( fragment.childNodes.length === 1 ) {
  18755. fragment = first;
  18756. }
  18757. // Require either new content or an interest in ignored elements to invoke the callback
  18758. if ( first || ignored ) {
  18759. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  18760. hasScripts = scripts.length;
  18761. // Use the original fragment for the last item
  18762. // instead of the first because it can end up
  18763. // being emptied incorrectly in certain situations (#8070).
  18764. for ( ; i < l; i++ ) {
  18765. node = fragment;
  18766. if ( i !== iNoClone ) {
  18767. node = jQuery.clone( node, true, true );
  18768. // Keep references to cloned scripts for later restoration
  18769. if ( hasScripts ) {
  18770. // Support: Android <=4.0 only, PhantomJS 1 only
  18771. // push.apply(_, arraylike) throws on ancient WebKit
  18772. jQuery.merge( scripts, getAll( node, "script" ) );
  18773. }
  18774. }
  18775. callback.call( collection[ i ], node, i );
  18776. }
  18777. if ( hasScripts ) {
  18778. doc = scripts[ scripts.length - 1 ].ownerDocument;
  18779. // Reenable scripts
  18780. jQuery.map( scripts, restoreScript );
  18781. // Evaluate executable scripts on first document insertion
  18782. for ( i = 0; i < hasScripts; i++ ) {
  18783. node = scripts[ i ];
  18784. if ( rscriptType.test( node.type || "" ) &&
  18785. !dataPriv.access( node, "globalEval" ) &&
  18786. jQuery.contains( doc, node ) ) {
  18787. if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) {
  18788. // Optional AJAX dependency, but won't run scripts if not present
  18789. if ( jQuery._evalUrl && !node.noModule ) {
  18790. jQuery._evalUrl( node.src, {
  18791. nonce: node.nonce || node.getAttribute( "nonce" )
  18792. }, doc );
  18793. }
  18794. } else {
  18795. DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc );
  18796. }
  18797. }
  18798. }
  18799. }
  18800. }
  18801. }
  18802. return collection;
  18803. }
  18804. function remove( elem, selector, keepData ) {
  18805. var node,
  18806. nodes = selector ? jQuery.filter( selector, elem ) : elem,
  18807. i = 0;
  18808. for ( ; ( node = nodes[ i ] ) != null; i++ ) {
  18809. if ( !keepData && node.nodeType === 1 ) {
  18810. jQuery.cleanData( getAll( node ) );
  18811. }
  18812. if ( node.parentNode ) {
  18813. if ( keepData && isAttached( node ) ) {
  18814. setGlobalEval( getAll( node, "script" ) );
  18815. }
  18816. node.parentNode.removeChild( node );
  18817. }
  18818. }
  18819. return elem;
  18820. }
  18821. jQuery.extend( {
  18822. htmlPrefilter: function( html ) {
  18823. return html;
  18824. },
  18825. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  18826. var i, l, srcElements, destElements,
  18827. clone = elem.cloneNode( true ),
  18828. inPage = isAttached( elem );
  18829. // Fix IE cloning issues
  18830. if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
  18831. !jQuery.isXMLDoc( elem ) ) {
  18832. // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2
  18833. destElements = getAll( clone );
  18834. srcElements = getAll( elem );
  18835. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  18836. fixInput( srcElements[ i ], destElements[ i ] );
  18837. }
  18838. }
  18839. // Copy the events from the original to the clone
  18840. if ( dataAndEvents ) {
  18841. if ( deepDataAndEvents ) {
  18842. srcElements = srcElements || getAll( elem );
  18843. destElements = destElements || getAll( clone );
  18844. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  18845. cloneCopyEvent( srcElements[ i ], destElements[ i ] );
  18846. }
  18847. } else {
  18848. cloneCopyEvent( elem, clone );
  18849. }
  18850. }
  18851. // Preserve script evaluation history
  18852. destElements = getAll( clone, "script" );
  18853. if ( destElements.length > 0 ) {
  18854. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  18855. }
  18856. // Return the cloned set
  18857. return clone;
  18858. },
  18859. cleanData: function( elems ) {
  18860. var data, elem, type,
  18861. special = jQuery.event.special,
  18862. i = 0;
  18863. for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
  18864. if ( acceptData( elem ) ) {
  18865. if ( ( data = elem[ dataPriv.expando ] ) ) {
  18866. if ( data.events ) {
  18867. for ( type in data.events ) {
  18868. if ( special[ type ] ) {
  18869. jQuery.event.remove( elem, type );
  18870. // This is a shortcut to avoid jQuery.event.remove's overhead
  18871. } else {
  18872. jQuery.removeEvent( elem, type, data.handle );
  18873. }
  18874. }
  18875. }
  18876. // Support: Chrome <=35 - 45+
  18877. // Assign undefined instead of using delete, see Data#remove
  18878. elem[ dataPriv.expando ] = undefined;
  18879. }
  18880. if ( elem[ dataUser.expando ] ) {
  18881. // Support: Chrome <=35 - 45+
  18882. // Assign undefined instead of using delete, see Data#remove
  18883. elem[ dataUser.expando ] = undefined;
  18884. }
  18885. }
  18886. }
  18887. }
  18888. } );
  18889. jQuery.fn.extend( {
  18890. detach: function( selector ) {
  18891. return remove( this, selector, true );
  18892. },
  18893. remove: function( selector ) {
  18894. return remove( this, selector );
  18895. },
  18896. text: function( value ) {
  18897. return access( this, function( value ) {
  18898. return value === undefined ?
  18899. jQuery.text( this ) :
  18900. this.empty().each( function() {
  18901. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  18902. this.textContent = value;
  18903. }
  18904. } );
  18905. }, null, value, arguments.length );
  18906. },
  18907. append: function() {
  18908. return domManip( this, arguments, function( elem ) {
  18909. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  18910. var target = manipulationTarget( this, elem );
  18911. target.appendChild( elem );
  18912. }
  18913. } );
  18914. },
  18915. prepend: function() {
  18916. return domManip( this, arguments, function( elem ) {
  18917. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  18918. var target = manipulationTarget( this, elem );
  18919. target.insertBefore( elem, target.firstChild );
  18920. }
  18921. } );
  18922. },
  18923. before: function() {
  18924. return domManip( this, arguments, function( elem ) {
  18925. if ( this.parentNode ) {
  18926. this.parentNode.insertBefore( elem, this );
  18927. }
  18928. } );
  18929. },
  18930. after: function() {
  18931. return domManip( this, arguments, function( elem ) {
  18932. if ( this.parentNode ) {
  18933. this.parentNode.insertBefore( elem, this.nextSibling );
  18934. }
  18935. } );
  18936. },
  18937. empty: function() {
  18938. var elem,
  18939. i = 0;
  18940. for ( ; ( elem = this[ i ] ) != null; i++ ) {
  18941. if ( elem.nodeType === 1 ) {
  18942. // Prevent memory leaks
  18943. jQuery.cleanData( getAll( elem, false ) );
  18944. // Remove any remaining nodes
  18945. elem.textContent = "";
  18946. }
  18947. }
  18948. return this;
  18949. },
  18950. clone: function( dataAndEvents, deepDataAndEvents ) {
  18951. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  18952. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  18953. return this.map( function() {
  18954. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  18955. } );
  18956. },
  18957. html: function( value ) {
  18958. return access( this, function( value ) {
  18959. var elem = this[ 0 ] || {},
  18960. i = 0,
  18961. l = this.length;
  18962. if ( value === undefined && elem.nodeType === 1 ) {
  18963. return elem.innerHTML;
  18964. }
  18965. // See if we can take a shortcut and just use innerHTML
  18966. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  18967. !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
  18968. value = jQuery.htmlPrefilter( value );
  18969. try {
  18970. for ( ; i < l; i++ ) {
  18971. elem = this[ i ] || {};
  18972. // Remove element nodes and prevent memory leaks
  18973. if ( elem.nodeType === 1 ) {
  18974. jQuery.cleanData( getAll( elem, false ) );
  18975. elem.innerHTML = value;
  18976. }
  18977. }
  18978. elem = 0;
  18979. // If using innerHTML throws an exception, use the fallback method
  18980. } catch ( e ) {}
  18981. }
  18982. if ( elem ) {
  18983. this.empty().append( value );
  18984. }
  18985. }, null, value, arguments.length );
  18986. },
  18987. replaceWith: function() {
  18988. var ignored = [];
  18989. // Make the changes, replacing each non-ignored context element with the new content
  18990. return domManip( this, arguments, function( elem ) {
  18991. var parent = this.parentNode;
  18992. if ( jQuery.inArray( this, ignored ) < 0 ) {
  18993. jQuery.cleanData( getAll( this ) );
  18994. if ( parent ) {
  18995. parent.replaceChild( elem, this );
  18996. }
  18997. }
  18998. // Force callback invocation
  18999. }, ignored );
  19000. }
  19001. } );
  19002. jQuery.each( {
  19003. appendTo: "append",
  19004. prependTo: "prepend",
  19005. insertBefore: "before",
  19006. insertAfter: "after",
  19007. replaceAll: "replaceWith"
  19008. }, function( name, original ) {
  19009. jQuery.fn[ name ] = function( selector ) {
  19010. var elems,
  19011. ret = [],
  19012. insert = jQuery( selector ),
  19013. last = insert.length - 1,
  19014. i = 0;
  19015. for ( ; i <= last; i++ ) {
  19016. elems = i === last ? this : this.clone( true );
  19017. jQuery( insert[ i ] )[ original ]( elems );
  19018. // Support: Android <=4.0 only, PhantomJS 1 only
  19019. // .get() because push.apply(_, arraylike) throws on ancient WebKit
  19020. push.apply( ret, elems.get() );
  19021. }
  19022. return this.pushStack( ret );
  19023. };
  19024. } );
  19025. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  19026. var getStyles = function( elem ) {
  19027. // Support: IE <=11 only, Firefox <=30 (#15098, #14150)
  19028. // IE throws on elements created in popups
  19029. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  19030. var view = elem.ownerDocument.defaultView;
  19031. if ( !view || !view.opener ) {
  19032. view = window;
  19033. }
  19034. return view.getComputedStyle( elem );
  19035. };
  19036. var swap = function( elem, options, callback ) {
  19037. var ret, name,
  19038. old = {};
  19039. // Remember the old values, and insert the new ones
  19040. for ( name in options ) {
  19041. old[ name ] = elem.style[ name ];
  19042. elem.style[ name ] = options[ name ];
  19043. }
  19044. ret = callback.call( elem );
  19045. // Revert the old values
  19046. for ( name in options ) {
  19047. elem.style[ name ] = old[ name ];
  19048. }
  19049. return ret;
  19050. };
  19051. var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" );
  19052. ( function() {
  19053. // Executing both pixelPosition & boxSizingReliable tests require only one layout
  19054. // so they're executed at the same time to save the second computation.
  19055. function computeStyleTests() {
  19056. // This is a singleton, we need to execute it only once
  19057. if ( !div ) {
  19058. return;
  19059. }
  19060. container.style.cssText = "position:absolute;left:-11111px;width:60px;" +
  19061. "margin-top:1px;padding:0;border:0";
  19062. div.style.cssText =
  19063. "position:relative;display:block;box-sizing:border-box;overflow:scroll;" +
  19064. "margin:auto;border:1px;padding:1px;" +
  19065. "width:60%;top:1%";
  19066. documentElement.appendChild( container ).appendChild( div );
  19067. var divStyle = window.getComputedStyle( div );
  19068. pixelPositionVal = divStyle.top !== "1%";
  19069. // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
  19070. reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12;
  19071. // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3
  19072. // Some styles come back with percentage values, even though they shouldn't
  19073. div.style.right = "60%";
  19074. pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36;
  19075. // Support: IE 9 - 11 only
  19076. // Detect misreporting of content dimensions for box-sizing:border-box elements
  19077. boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36;
  19078. // Support: IE 9 only
  19079. // Detect overflow:scroll screwiness (gh-3699)
  19080. // Support: Chrome <=64
  19081. // Don't get tricked when zoom affects offsetWidth (gh-4029)
  19082. div.style.position = "absolute";
  19083. scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12;
  19084. documentElement.removeChild( container );
  19085. // Nullify the div so it wouldn't be stored in the memory and
  19086. // it will also be a sign that checks already performed
  19087. div = null;
  19088. }
  19089. function roundPixelMeasures( measure ) {
  19090. return Math.round( parseFloat( measure ) );
  19091. }
  19092. var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal,
  19093. reliableTrDimensionsVal, reliableMarginLeftVal,
  19094. container = document.createElement( "div" ),
  19095. div = document.createElement( "div" );
  19096. // Finish early in limited (non-browser) environments
  19097. if ( !div.style ) {
  19098. return;
  19099. }
  19100. // Support: IE <=9 - 11 only
  19101. // Style of cloned element affects source element cloned (#8908)
  19102. div.style.backgroundClip = "content-box";
  19103. div.cloneNode( true ).style.backgroundClip = "";
  19104. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  19105. jQuery.extend( support, {
  19106. boxSizingReliable: function() {
  19107. computeStyleTests();
  19108. return boxSizingReliableVal;
  19109. },
  19110. pixelBoxStyles: function() {
  19111. computeStyleTests();
  19112. return pixelBoxStylesVal;
  19113. },
  19114. pixelPosition: function() {
  19115. computeStyleTests();
  19116. return pixelPositionVal;
  19117. },
  19118. reliableMarginLeft: function() {
  19119. computeStyleTests();
  19120. return reliableMarginLeftVal;
  19121. },
  19122. scrollboxSize: function() {
  19123. computeStyleTests();
  19124. return scrollboxSizeVal;
  19125. },
  19126. // Support: IE 9 - 11+, Edge 15 - 18+
  19127. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  19128. // set in CSS while `offset*` properties report correct values.
  19129. // Behavior in IE 9 is more subtle than in newer versions & it passes
  19130. // some versions of this test; make sure not to make it pass there!
  19131. reliableTrDimensions: function() {
  19132. var table, tr, trChild, trStyle;
  19133. if ( reliableTrDimensionsVal == null ) {
  19134. table = document.createElement( "table" );
  19135. tr = document.createElement( "tr" );
  19136. trChild = document.createElement( "div" );
  19137. table.style.cssText = "position:absolute;left:-11111px";
  19138. tr.style.height = "1px";
  19139. trChild.style.height = "9px";
  19140. documentElement
  19141. .appendChild( table )
  19142. .appendChild( tr )
  19143. .appendChild( trChild );
  19144. trStyle = window.getComputedStyle( tr );
  19145. reliableTrDimensionsVal = parseInt( trStyle.height ) > 3;
  19146. documentElement.removeChild( table );
  19147. }
  19148. return reliableTrDimensionsVal;
  19149. }
  19150. } );
  19151. } )();
  19152. function curCSS( elem, name, computed ) {
  19153. var width, minWidth, maxWidth, ret,
  19154. // Support: Firefox 51+
  19155. // Retrieving style before computed somehow
  19156. // fixes an issue with getting wrong values
  19157. // on detached elements
  19158. style = elem.style;
  19159. computed = computed || getStyles( elem );
  19160. // getPropertyValue is needed for:
  19161. // .css('filter') (IE 9 only, #12537)
  19162. // .css('--customProperty) (#3144)
  19163. if ( computed ) {
  19164. ret = computed.getPropertyValue( name ) || computed[ name ];
  19165. if ( ret === "" && !isAttached( elem ) ) {
  19166. ret = jQuery.style( elem, name );
  19167. }
  19168. // A tribute to the "awesome hack by Dean Edwards"
  19169. // Android Browser returns percentage for some values,
  19170. // but width seems to be reliably pixels.
  19171. // This is against the CSSOM draft spec:
  19172. // https://drafts.csswg.org/cssom/#resolved-values
  19173. if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) {
  19174. // Remember the original values
  19175. width = style.width;
  19176. minWidth = style.minWidth;
  19177. maxWidth = style.maxWidth;
  19178. // Put in the new values to get a computed value out
  19179. style.minWidth = style.maxWidth = style.width = ret;
  19180. ret = computed.width;
  19181. // Revert the changed values
  19182. style.width = width;
  19183. style.minWidth = minWidth;
  19184. style.maxWidth = maxWidth;
  19185. }
  19186. }
  19187. return ret !== undefined ?
  19188. // Support: IE <=9 - 11 only
  19189. // IE returns zIndex value as an integer.
  19190. ret + "" :
  19191. ret;
  19192. }
  19193. function addGetHookIf( conditionFn, hookFn ) {
  19194. // Define the hook, we'll check on the first run if it's really needed.
  19195. return {
  19196. get: function() {
  19197. if ( conditionFn() ) {
  19198. // Hook not needed (or it's not possible to use it due
  19199. // to missing dependency), remove it.
  19200. delete this.get;
  19201. return;
  19202. }
  19203. // Hook needed; redefine it so that the support test is not executed again.
  19204. return ( this.get = hookFn ).apply( this, arguments );
  19205. }
  19206. };
  19207. }
  19208. var cssPrefixes = [ "Webkit", "Moz", "ms" ],
  19209. emptyStyle = document.createElement( "div" ).style,
  19210. vendorProps = {};
  19211. // Return a vendor-prefixed property or undefined
  19212. function vendorPropName( name ) {
  19213. // Check for vendor prefixed names
  19214. var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
  19215. i = cssPrefixes.length;
  19216. while ( i-- ) {
  19217. name = cssPrefixes[ i ] + capName;
  19218. if ( name in emptyStyle ) {
  19219. return name;
  19220. }
  19221. }
  19222. }
  19223. // Return a potentially-mapped jQuery.cssProps or vendor prefixed property
  19224. function finalPropName( name ) {
  19225. var final = jQuery.cssProps[ name ] || vendorProps[ name ];
  19226. if ( final ) {
  19227. return final;
  19228. }
  19229. if ( name in emptyStyle ) {
  19230. return name;
  19231. }
  19232. return vendorProps[ name ] = vendorPropName( name ) || name;
  19233. }
  19234. var
  19235. // Swappable if display is none or starts with table
  19236. // except "table", "table-cell", or "table-caption"
  19237. // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
  19238. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  19239. rcustomProp = /^--/,
  19240. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  19241. cssNormalTransform = {
  19242. letterSpacing: "0",
  19243. fontWeight: "400"
  19244. };
  19245. function setPositiveNumber( _elem, value, subtract ) {
  19246. // Any relative (+/-) values have already been
  19247. // normalized at this point
  19248. var matches = rcssNum.exec( value );
  19249. return matches ?
  19250. // Guard against undefined "subtract", e.g., when used as in cssHooks
  19251. Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
  19252. value;
  19253. }
  19254. function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) {
  19255. var i = dimension === "width" ? 1 : 0,
  19256. extra = 0,
  19257. delta = 0;
  19258. // Adjustment may not be necessary
  19259. if ( box === ( isBorderBox ? "border" : "content" ) ) {
  19260. return 0;
  19261. }
  19262. for ( ; i < 4; i += 2 ) {
  19263. // Both box models exclude margin
  19264. if ( box === "margin" ) {
  19265. delta += jQuery.css( elem, box + cssExpand[ i ], true, styles );
  19266. }
  19267. // If we get here with a content-box, we're seeking "padding" or "border" or "margin"
  19268. if ( !isBorderBox ) {
  19269. // Add padding
  19270. delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  19271. // For "border" or "margin", add border
  19272. if ( box !== "padding" ) {
  19273. delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  19274. // But still keep track of it otherwise
  19275. } else {
  19276. extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  19277. }
  19278. // If we get here with a border-box (content + padding + border), we're seeking "content" or
  19279. // "padding" or "margin"
  19280. } else {
  19281. // For "content", subtract padding
  19282. if ( box === "content" ) {
  19283. delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  19284. }
  19285. // For "content" or "padding", subtract border
  19286. if ( box !== "margin" ) {
  19287. delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  19288. }
  19289. }
  19290. }
  19291. // Account for positive content-box scroll gutter when requested by providing computedVal
  19292. if ( !isBorderBox && computedVal >= 0 ) {
  19293. // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border
  19294. // Assuming integer scroll gutter, subtract the rest and round down
  19295. delta += Math.max( 0, Math.ceil(
  19296. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  19297. computedVal -
  19298. delta -
  19299. extra -
  19300. 0.5
  19301. // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
  19302. // Use an explicit zero to avoid NaN (gh-3964)
  19303. ) ) || 0;
  19304. }
  19305. return delta;
  19306. }
  19307. function getWidthOrHeight( elem, dimension, extra ) {
  19308. // Start with computed style
  19309. var styles = getStyles( elem ),
  19310. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
  19311. // Fake content-box until we know it's needed to know the true value.
  19312. boxSizingNeeded = !support.boxSizingReliable() || extra,
  19313. isBorderBox = boxSizingNeeded &&
  19314. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  19315. valueIsBorderBox = isBorderBox,
  19316. val = curCSS( elem, dimension, styles ),
  19317. offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 );
  19318. // Support: Firefox <=54
  19319. // Return a confounding non-pixel value or feign ignorance, as appropriate.
  19320. if ( rnumnonpx.test( val ) ) {
  19321. if ( !extra ) {
  19322. return val;
  19323. }
  19324. val = "auto";
  19325. }
  19326. // Support: IE 9 - 11 only
  19327. // Use offsetWidth/offsetHeight for when box sizing is unreliable.
  19328. // In those cases, the computed value can be trusted to be border-box.
  19329. if ( ( !support.boxSizingReliable() && isBorderBox ||
  19330. // Support: IE 10 - 11+, Edge 15 - 18+
  19331. // IE/Edge misreport `getComputedStyle` of table rows with width/height
  19332. // set in CSS while `offset*` properties report correct values.
  19333. // Interestingly, in some cases IE 9 doesn't suffer from this issue.
  19334. !support.reliableTrDimensions() && nodeName( elem, "tr" ) ||
  19335. // Fall back to offsetWidth/offsetHeight when value is "auto"
  19336. // This happens for inline elements with no explicit setting (gh-3571)
  19337. val === "auto" ||
  19338. // Support: Android <=4.1 - 4.3 only
  19339. // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
  19340. !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) &&
  19341. // Make sure the element is visible & connected
  19342. elem.getClientRects().length ) {
  19343. isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  19344. // Where available, offsetWidth/offsetHeight approximate border box dimensions.
  19345. // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the
  19346. // retrieved value as a content box dimension.
  19347. valueIsBorderBox = offsetProp in elem;
  19348. if ( valueIsBorderBox ) {
  19349. val = elem[ offsetProp ];
  19350. }
  19351. }
  19352. // Normalize "" and auto
  19353. val = parseFloat( val ) || 0;
  19354. // Adjust for the element's box model
  19355. return ( val +
  19356. boxModelAdjustment(
  19357. elem,
  19358. dimension,
  19359. extra || ( isBorderBox ? "border" : "content" ),
  19360. valueIsBorderBox,
  19361. styles,
  19362. // Provide the current computed size to request scroll gutter calculation (gh-3589)
  19363. val
  19364. )
  19365. ) + "px";
  19366. }
  19367. jQuery.extend( {
  19368. // Add in style property hooks for overriding the default
  19369. // behavior of getting and setting a style property
  19370. cssHooks: {
  19371. opacity: {
  19372. get: function( elem, computed ) {
  19373. if ( computed ) {
  19374. // We should always get a number back from opacity
  19375. var ret = curCSS( elem, "opacity" );
  19376. return ret === "" ? "1" : ret;
  19377. }
  19378. }
  19379. }
  19380. },
  19381. // Don't automatically add "px" to these possibly-unitless properties
  19382. cssNumber: {
  19383. "animationIterationCount": true,
  19384. "columnCount": true,
  19385. "fillOpacity": true,
  19386. "flexGrow": true,
  19387. "flexShrink": true,
  19388. "fontWeight": true,
  19389. "gridArea": true,
  19390. "gridColumn": true,
  19391. "gridColumnEnd": true,
  19392. "gridColumnStart": true,
  19393. "gridRow": true,
  19394. "gridRowEnd": true,
  19395. "gridRowStart": true,
  19396. "lineHeight": true,
  19397. "opacity": true,
  19398. "order": true,
  19399. "orphans": true,
  19400. "widows": true,
  19401. "zIndex": true,
  19402. "zoom": true
  19403. },
  19404. // Add in properties whose names you wish to fix before
  19405. // setting or getting the value
  19406. cssProps: {},
  19407. // Get and set the style property on a DOM Node
  19408. style: function( elem, name, value, extra ) {
  19409. // Don't set styles on text and comment nodes
  19410. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  19411. return;
  19412. }
  19413. // Make sure that we're working with the right name
  19414. var ret, type, hooks,
  19415. origName = camelCase( name ),
  19416. isCustomProp = rcustomProp.test( name ),
  19417. style = elem.style;
  19418. // Make sure that we're working with the right name. We don't
  19419. // want to query the value if it is a CSS custom property
  19420. // since they are user-defined.
  19421. if ( !isCustomProp ) {
  19422. name = finalPropName( origName );
  19423. }
  19424. // Gets hook for the prefixed version, then unprefixed version
  19425. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  19426. // Check if we're setting a value
  19427. if ( value !== undefined ) {
  19428. type = typeof value;
  19429. // Convert "+=" or "-=" to relative numbers (#7345)
  19430. if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
  19431. value = adjustCSS( elem, name, ret );
  19432. // Fixes bug #9237
  19433. type = "number";
  19434. }
  19435. // Make sure that null and NaN values aren't set (#7116)
  19436. if ( value == null || value !== value ) {
  19437. return;
  19438. }
  19439. // If a number was passed in, add the unit (except for certain CSS properties)
  19440. // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append
  19441. // "px" to a few hardcoded values.
  19442. if ( type === "number" && !isCustomProp ) {
  19443. value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
  19444. }
  19445. // background-* props affect original clone's values
  19446. if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
  19447. style[ name ] = "inherit";
  19448. }
  19449. // If a hook was provided, use that value, otherwise just set the specified value
  19450. if ( !hooks || !( "set" in hooks ) ||
  19451. ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
  19452. if ( isCustomProp ) {
  19453. style.setProperty( name, value );
  19454. } else {
  19455. style[ name ] = value;
  19456. }
  19457. }
  19458. } else {
  19459. // If a hook was provided get the non-computed value from there
  19460. if ( hooks && "get" in hooks &&
  19461. ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
  19462. return ret;
  19463. }
  19464. // Otherwise just get the value from the style object
  19465. return style[ name ];
  19466. }
  19467. },
  19468. css: function( elem, name, extra, styles ) {
  19469. var val, num, hooks,
  19470. origName = camelCase( name ),
  19471. isCustomProp = rcustomProp.test( name );
  19472. // Make sure that we're working with the right name. We don't
  19473. // want to modify the value if it is a CSS custom property
  19474. // since they are user-defined.
  19475. if ( !isCustomProp ) {
  19476. name = finalPropName( origName );
  19477. }
  19478. // Try prefixed name followed by the unprefixed name
  19479. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  19480. // If a hook was provided get the computed value from there
  19481. if ( hooks && "get" in hooks ) {
  19482. val = hooks.get( elem, true, extra );
  19483. }
  19484. // Otherwise, if a way to get the computed value exists, use that
  19485. if ( val === undefined ) {
  19486. val = curCSS( elem, name, styles );
  19487. }
  19488. // Convert "normal" to computed value
  19489. if ( val === "normal" && name in cssNormalTransform ) {
  19490. val = cssNormalTransform[ name ];
  19491. }
  19492. // Make numeric if forced or a qualifier was provided and val looks numeric
  19493. if ( extra === "" || extra ) {
  19494. num = parseFloat( val );
  19495. return extra === true || isFinite( num ) ? num || 0 : val;
  19496. }
  19497. return val;
  19498. }
  19499. } );
  19500. jQuery.each( [ "height", "width" ], function( _i, dimension ) {
  19501. jQuery.cssHooks[ dimension ] = {
  19502. get: function( elem, computed, extra ) {
  19503. if ( computed ) {
  19504. // Certain elements can have dimension info if we invisibly show them
  19505. // but it must have a current display style that would benefit
  19506. return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
  19507. // Support: Safari 8+
  19508. // Table columns in Safari have non-zero offsetWidth & zero
  19509. // getBoundingClientRect().width unless display is changed.
  19510. // Support: IE <=11 only
  19511. // Running getBoundingClientRect on a disconnected node
  19512. // in IE throws an error.
  19513. ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
  19514. swap( elem, cssShow, function() {
  19515. return getWidthOrHeight( elem, dimension, extra );
  19516. } ) :
  19517. getWidthOrHeight( elem, dimension, extra );
  19518. }
  19519. },
  19520. set: function( elem, value, extra ) {
  19521. var matches,
  19522. styles = getStyles( elem ),
  19523. // Only read styles.position if the test has a chance to fail
  19524. // to avoid forcing a reflow.
  19525. scrollboxSizeBuggy = !support.scrollboxSize() &&
  19526. styles.position === "absolute",
  19527. // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991)
  19528. boxSizingNeeded = scrollboxSizeBuggy || extra,
  19529. isBorderBox = boxSizingNeeded &&
  19530. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  19531. subtract = extra ?
  19532. boxModelAdjustment(
  19533. elem,
  19534. dimension,
  19535. extra,
  19536. isBorderBox,
  19537. styles
  19538. ) :
  19539. 0;
  19540. // Account for unreliable border-box dimensions by comparing offset* to computed and
  19541. // faking a content-box to get border and padding (gh-3699)
  19542. if ( isBorderBox && scrollboxSizeBuggy ) {
  19543. subtract -= Math.ceil(
  19544. elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] -
  19545. parseFloat( styles[ dimension ] ) -
  19546. boxModelAdjustment( elem, dimension, "border", false, styles ) -
  19547. 0.5
  19548. );
  19549. }
  19550. // Convert to pixels if value adjustment is needed
  19551. if ( subtract && ( matches = rcssNum.exec( value ) ) &&
  19552. ( matches[ 3 ] || "px" ) !== "px" ) {
  19553. elem.style[ dimension ] = value;
  19554. value = jQuery.css( elem, dimension );
  19555. }
  19556. return setPositiveNumber( elem, value, subtract );
  19557. }
  19558. };
  19559. } );
  19560. jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
  19561. function( elem, computed ) {
  19562. if ( computed ) {
  19563. return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
  19564. elem.getBoundingClientRect().left -
  19565. swap( elem, { marginLeft: 0 }, function() {
  19566. return elem.getBoundingClientRect().left;
  19567. } )
  19568. ) + "px";
  19569. }
  19570. }
  19571. );
  19572. // These hooks are used by animate to expand properties
  19573. jQuery.each( {
  19574. margin: "",
  19575. padding: "",
  19576. border: "Width"
  19577. }, function( prefix, suffix ) {
  19578. jQuery.cssHooks[ prefix + suffix ] = {
  19579. expand: function( value ) {
  19580. var i = 0,
  19581. expanded = {},
  19582. // Assumes a single number if not a string
  19583. parts = typeof value === "string" ? value.split( " " ) : [ value ];
  19584. for ( ; i < 4; i++ ) {
  19585. expanded[ prefix + cssExpand[ i ] + suffix ] =
  19586. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  19587. }
  19588. return expanded;
  19589. }
  19590. };
  19591. if ( prefix !== "margin" ) {
  19592. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  19593. }
  19594. } );
  19595. jQuery.fn.extend( {
  19596. css: function( name, value ) {
  19597. return access( this, function( elem, name, value ) {
  19598. var styles, len,
  19599. map = {},
  19600. i = 0;
  19601. if ( Array.isArray( name ) ) {
  19602. styles = getStyles( elem );
  19603. len = name.length;
  19604. for ( ; i < len; i++ ) {
  19605. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  19606. }
  19607. return map;
  19608. }
  19609. return value !== undefined ?
  19610. jQuery.style( elem, name, value ) :
  19611. jQuery.css( elem, name );
  19612. }, name, value, arguments.length > 1 );
  19613. }
  19614. } );
  19615. function Tween( elem, options, prop, end, easing ) {
  19616. return new Tween.prototype.init( elem, options, prop, end, easing );
  19617. }
  19618. jQuery.Tween = Tween;
  19619. Tween.prototype = {
  19620. constructor: Tween,
  19621. init: function( elem, options, prop, end, easing, unit ) {
  19622. this.elem = elem;
  19623. this.prop = prop;
  19624. this.easing = easing || jQuery.easing._default;
  19625. this.options = options;
  19626. this.start = this.now = this.cur();
  19627. this.end = end;
  19628. this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
  19629. },
  19630. cur: function() {
  19631. var hooks = Tween.propHooks[ this.prop ];
  19632. return hooks && hooks.get ?
  19633. hooks.get( this ) :
  19634. Tween.propHooks._default.get( this );
  19635. },
  19636. run: function( percent ) {
  19637. var eased,
  19638. hooks = Tween.propHooks[ this.prop ];
  19639. if ( this.options.duration ) {
  19640. this.pos = eased = jQuery.easing[ this.easing ](
  19641. percent, this.options.duration * percent, 0, 1, this.options.duration
  19642. );
  19643. } else {
  19644. this.pos = eased = percent;
  19645. }
  19646. this.now = ( this.end - this.start ) * eased + this.start;
  19647. if ( this.options.step ) {
  19648. this.options.step.call( this.elem, this.now, this );
  19649. }
  19650. if ( hooks && hooks.set ) {
  19651. hooks.set( this );
  19652. } else {
  19653. Tween.propHooks._default.set( this );
  19654. }
  19655. return this;
  19656. }
  19657. };
  19658. Tween.prototype.init.prototype = Tween.prototype;
  19659. Tween.propHooks = {
  19660. _default: {
  19661. get: function( tween ) {
  19662. var result;
  19663. // Use a property on the element directly when it is not a DOM element,
  19664. // or when there is no matching style property that exists.
  19665. if ( tween.elem.nodeType !== 1 ||
  19666. tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
  19667. return tween.elem[ tween.prop ];
  19668. }
  19669. // Passing an empty string as a 3rd parameter to .css will automatically
  19670. // attempt a parseFloat and fallback to a string if the parse fails.
  19671. // Simple values such as "10px" are parsed to Float;
  19672. // complex values such as "rotate(1rad)" are returned as-is.
  19673. result = jQuery.css( tween.elem, tween.prop, "" );
  19674. // Empty strings, null, undefined and "auto" are converted to 0.
  19675. return !result || result === "auto" ? 0 : result;
  19676. },
  19677. set: function( tween ) {
  19678. // Use step hook for back compat.
  19679. // Use cssHook if its there.
  19680. // Use .style if available and use plain properties where available.
  19681. if ( jQuery.fx.step[ tween.prop ] ) {
  19682. jQuery.fx.step[ tween.prop ]( tween );
  19683. } else if ( tween.elem.nodeType === 1 && (
  19684. jQuery.cssHooks[ tween.prop ] ||
  19685. tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) {
  19686. jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
  19687. } else {
  19688. tween.elem[ tween.prop ] = tween.now;
  19689. }
  19690. }
  19691. }
  19692. };
  19693. // Support: IE <=9 only
  19694. // Panic based approach to setting things on disconnected nodes
  19695. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  19696. set: function( tween ) {
  19697. if ( tween.elem.nodeType && tween.elem.parentNode ) {
  19698. tween.elem[ tween.prop ] = tween.now;
  19699. }
  19700. }
  19701. };
  19702. jQuery.easing = {
  19703. linear: function( p ) {
  19704. return p;
  19705. },
  19706. swing: function( p ) {
  19707. return 0.5 - Math.cos( p * Math.PI ) / 2;
  19708. },
  19709. _default: "swing"
  19710. };
  19711. jQuery.fx = Tween.prototype.init;
  19712. // Back compat <1.8 extension point
  19713. jQuery.fx.step = {};
  19714. var
  19715. fxNow, inProgress,
  19716. rfxtypes = /^(?:toggle|show|hide)$/,
  19717. rrun = /queueHooks$/;
  19718. function schedule() {
  19719. if ( inProgress ) {
  19720. if ( document.hidden === false && window.requestAnimationFrame ) {
  19721. window.requestAnimationFrame( schedule );
  19722. } else {
  19723. window.setTimeout( schedule, jQuery.fx.interval );
  19724. }
  19725. jQuery.fx.tick();
  19726. }
  19727. }
  19728. // Animations created synchronously will run synchronously
  19729. function createFxNow() {
  19730. window.setTimeout( function() {
  19731. fxNow = undefined;
  19732. } );
  19733. return ( fxNow = Date.now() );
  19734. }
  19735. // Generate parameters to create a standard animation
  19736. function genFx( type, includeWidth ) {
  19737. var which,
  19738. i = 0,
  19739. attrs = { height: type };
  19740. // If we include width, step value is 1 to do all cssExpand values,
  19741. // otherwise step value is 2 to skip over Left and Right
  19742. includeWidth = includeWidth ? 1 : 0;
  19743. for ( ; i < 4; i += 2 - includeWidth ) {
  19744. which = cssExpand[ i ];
  19745. attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
  19746. }
  19747. if ( includeWidth ) {
  19748. attrs.opacity = attrs.width = type;
  19749. }
  19750. return attrs;
  19751. }
  19752. function createTween( value, prop, animation ) {
  19753. var tween,
  19754. collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
  19755. index = 0,
  19756. length = collection.length;
  19757. for ( ; index < length; index++ ) {
  19758. if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
  19759. // We're done with this property
  19760. return tween;
  19761. }
  19762. }
  19763. }
  19764. function defaultPrefilter( elem, props, opts ) {
  19765. var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display,
  19766. isBox = "width" in props || "height" in props,
  19767. anim = this,
  19768. orig = {},
  19769. style = elem.style,
  19770. hidden = elem.nodeType && isHiddenWithinTree( elem ),
  19771. dataShow = dataPriv.get( elem, "fxshow" );
  19772. // Queue-skipping animations hijack the fx hooks
  19773. if ( !opts.queue ) {
  19774. hooks = jQuery._queueHooks( elem, "fx" );
  19775. if ( hooks.unqueued == null ) {
  19776. hooks.unqueued = 0;
  19777. oldfire = hooks.empty.fire;
  19778. hooks.empty.fire = function() {
  19779. if ( !hooks.unqueued ) {
  19780. oldfire();
  19781. }
  19782. };
  19783. }
  19784. hooks.unqueued++;
  19785. anim.always( function() {
  19786. // Ensure the complete handler is called before this completes
  19787. anim.always( function() {
  19788. hooks.unqueued--;
  19789. if ( !jQuery.queue( elem, "fx" ).length ) {
  19790. hooks.empty.fire();
  19791. }
  19792. } );
  19793. } );
  19794. }
  19795. // Detect show/hide animations
  19796. for ( prop in props ) {
  19797. value = props[ prop ];
  19798. if ( rfxtypes.test( value ) ) {
  19799. delete props[ prop ];
  19800. toggle = toggle || value === "toggle";
  19801. if ( value === ( hidden ? "hide" : "show" ) ) {
  19802. // Pretend to be hidden if this is a "show" and
  19803. // there is still data from a stopped show/hide
  19804. if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
  19805. hidden = true;
  19806. // Ignore all other no-op show/hide data
  19807. } else {
  19808. continue;
  19809. }
  19810. }
  19811. orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
  19812. }
  19813. }
  19814. // Bail out if this is a no-op like .hide().hide()
  19815. propTween = !jQuery.isEmptyObject( props );
  19816. if ( !propTween && jQuery.isEmptyObject( orig ) ) {
  19817. return;
  19818. }
  19819. // Restrict "overflow" and "display" styles during box animations
  19820. if ( isBox && elem.nodeType === 1 ) {
  19821. // Support: IE <=9 - 11, Edge 12 - 15
  19822. // Record all 3 overflow attributes because IE does not infer the shorthand
  19823. // from identically-valued overflowX and overflowY and Edge just mirrors
  19824. // the overflowX value there.
  19825. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
  19826. // Identify a display type, preferring old show/hide data over the CSS cascade
  19827. restoreDisplay = dataShow && dataShow.display;
  19828. if ( restoreDisplay == null ) {
  19829. restoreDisplay = dataPriv.get( elem, "display" );
  19830. }
  19831. display = jQuery.css( elem, "display" );
  19832. if ( display === "none" ) {
  19833. if ( restoreDisplay ) {
  19834. display = restoreDisplay;
  19835. } else {
  19836. // Get nonempty value(s) by temporarily forcing visibility
  19837. showHide( [ elem ], true );
  19838. restoreDisplay = elem.style.display || restoreDisplay;
  19839. display = jQuery.css( elem, "display" );
  19840. showHide( [ elem ] );
  19841. }
  19842. }
  19843. // Animate inline elements as inline-block
  19844. if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) {
  19845. if ( jQuery.css( elem, "float" ) === "none" ) {
  19846. // Restore the original display value at the end of pure show/hide animations
  19847. if ( !propTween ) {
  19848. anim.done( function() {
  19849. style.display = restoreDisplay;
  19850. } );
  19851. if ( restoreDisplay == null ) {
  19852. display = style.display;
  19853. restoreDisplay = display === "none" ? "" : display;
  19854. }
  19855. }
  19856. style.display = "inline-block";
  19857. }
  19858. }
  19859. }
  19860. if ( opts.overflow ) {
  19861. style.overflow = "hidden";
  19862. anim.always( function() {
  19863. style.overflow = opts.overflow[ 0 ];
  19864. style.overflowX = opts.overflow[ 1 ];
  19865. style.overflowY = opts.overflow[ 2 ];
  19866. } );
  19867. }
  19868. // Implement show/hide animations
  19869. propTween = false;
  19870. for ( prop in orig ) {
  19871. // General show/hide setup for this element animation
  19872. if ( !propTween ) {
  19873. if ( dataShow ) {
  19874. if ( "hidden" in dataShow ) {
  19875. hidden = dataShow.hidden;
  19876. }
  19877. } else {
  19878. dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } );
  19879. }
  19880. // Store hidden/visible for toggle so `.stop().toggle()` "reverses"
  19881. if ( toggle ) {
  19882. dataShow.hidden = !hidden;
  19883. }
  19884. // Show elements before animating them
  19885. if ( hidden ) {
  19886. showHide( [ elem ], true );
  19887. }
  19888. /* eslint-disable no-loop-func */
  19889. anim.done( function() {
  19890. /* eslint-enable no-loop-func */
  19891. // The final step of a "hide" animation is actually hiding the element
  19892. if ( !hidden ) {
  19893. showHide( [ elem ] );
  19894. }
  19895. dataPriv.remove( elem, "fxshow" );
  19896. for ( prop in orig ) {
  19897. jQuery.style( elem, prop, orig[ prop ] );
  19898. }
  19899. } );
  19900. }
  19901. // Per-property setup
  19902. propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
  19903. if ( !( prop in dataShow ) ) {
  19904. dataShow[ prop ] = propTween.start;
  19905. if ( hidden ) {
  19906. propTween.end = propTween.start;
  19907. propTween.start = 0;
  19908. }
  19909. }
  19910. }
  19911. }
  19912. function propFilter( props, specialEasing ) {
  19913. var index, name, easing, value, hooks;
  19914. // camelCase, specialEasing and expand cssHook pass
  19915. for ( index in props ) {
  19916. name = camelCase( index );
  19917. easing = specialEasing[ name ];
  19918. value = props[ index ];
  19919. if ( Array.isArray( value ) ) {
  19920. easing = value[ 1 ];
  19921. value = props[ index ] = value[ 0 ];
  19922. }
  19923. if ( index !== name ) {
  19924. props[ name ] = value;
  19925. delete props[ index ];
  19926. }
  19927. hooks = jQuery.cssHooks[ name ];
  19928. if ( hooks && "expand" in hooks ) {
  19929. value = hooks.expand( value );
  19930. delete props[ name ];
  19931. // Not quite $.extend, this won't overwrite existing keys.
  19932. // Reusing 'index' because we have the correct "name"
  19933. for ( index in value ) {
  19934. if ( !( index in props ) ) {
  19935. props[ index ] = value[ index ];
  19936. specialEasing[ index ] = easing;
  19937. }
  19938. }
  19939. } else {
  19940. specialEasing[ name ] = easing;
  19941. }
  19942. }
  19943. }
  19944. function Animation( elem, properties, options ) {
  19945. var result,
  19946. stopped,
  19947. index = 0,
  19948. length = Animation.prefilters.length,
  19949. deferred = jQuery.Deferred().always( function() {
  19950. // Don't match elem in the :animated selector
  19951. delete tick.elem;
  19952. } ),
  19953. tick = function() {
  19954. if ( stopped ) {
  19955. return false;
  19956. }
  19957. var currentTime = fxNow || createFxNow(),
  19958. remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
  19959. // Support: Android 2.3 only
  19960. // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
  19961. temp = remaining / animation.duration || 0,
  19962. percent = 1 - temp,
  19963. index = 0,
  19964. length = animation.tweens.length;
  19965. for ( ; index < length; index++ ) {
  19966. animation.tweens[ index ].run( percent );
  19967. }
  19968. deferred.notifyWith( elem, [ animation, percent, remaining ] );
  19969. // If there's more to do, yield
  19970. if ( percent < 1 && length ) {
  19971. return remaining;
  19972. }
  19973. // If this was an empty animation, synthesize a final progress notification
  19974. if ( !length ) {
  19975. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  19976. }
  19977. // Resolve the animation and report its conclusion
  19978. deferred.resolveWith( elem, [ animation ] );
  19979. return false;
  19980. },
  19981. animation = deferred.promise( {
  19982. elem: elem,
  19983. props: jQuery.extend( {}, properties ),
  19984. opts: jQuery.extend( true, {
  19985. specialEasing: {},
  19986. easing: jQuery.easing._default
  19987. }, options ),
  19988. originalProperties: properties,
  19989. originalOptions: options,
  19990. startTime: fxNow || createFxNow(),
  19991. duration: options.duration,
  19992. tweens: [],
  19993. createTween: function( prop, end ) {
  19994. var tween = jQuery.Tween( elem, animation.opts, prop, end,
  19995. animation.opts.specialEasing[ prop ] || animation.opts.easing );
  19996. animation.tweens.push( tween );
  19997. return tween;
  19998. },
  19999. stop: function( gotoEnd ) {
  20000. var index = 0,
  20001. // If we are going to the end, we want to run all the tweens
  20002. // otherwise we skip this part
  20003. length = gotoEnd ? animation.tweens.length : 0;
  20004. if ( stopped ) {
  20005. return this;
  20006. }
  20007. stopped = true;
  20008. for ( ; index < length; index++ ) {
  20009. animation.tweens[ index ].run( 1 );
  20010. }
  20011. // Resolve when we played the last frame; otherwise, reject
  20012. if ( gotoEnd ) {
  20013. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  20014. deferred.resolveWith( elem, [ animation, gotoEnd ] );
  20015. } else {
  20016. deferred.rejectWith( elem, [ animation, gotoEnd ] );
  20017. }
  20018. return this;
  20019. }
  20020. } ),
  20021. props = animation.props;
  20022. propFilter( props, animation.opts.specialEasing );
  20023. for ( ; index < length; index++ ) {
  20024. result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
  20025. if ( result ) {
  20026. if ( isFunction( result.stop ) ) {
  20027. jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
  20028. result.stop.bind( result );
  20029. }
  20030. return result;
  20031. }
  20032. }
  20033. jQuery.map( props, createTween, animation );
  20034. if ( isFunction( animation.opts.start ) ) {
  20035. animation.opts.start.call( elem, animation );
  20036. }
  20037. // Attach callbacks from options
  20038. animation
  20039. .progress( animation.opts.progress )
  20040. .done( animation.opts.done, animation.opts.complete )
  20041. .fail( animation.opts.fail )
  20042. .always( animation.opts.always );
  20043. jQuery.fx.timer(
  20044. jQuery.extend( tick, {
  20045. elem: elem,
  20046. anim: animation,
  20047. queue: animation.opts.queue
  20048. } )
  20049. );
  20050. return animation;
  20051. }
  20052. jQuery.Animation = jQuery.extend( Animation, {
  20053. tweeners: {
  20054. "*": [ function( prop, value ) {
  20055. var tween = this.createTween( prop, value );
  20056. adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
  20057. return tween;
  20058. } ]
  20059. },
  20060. tweener: function( props, callback ) {
  20061. if ( isFunction( props ) ) {
  20062. callback = props;
  20063. props = [ "*" ];
  20064. } else {
  20065. props = props.match( rnothtmlwhite );
  20066. }
  20067. var prop,
  20068. index = 0,
  20069. length = props.length;
  20070. for ( ; index < length; index++ ) {
  20071. prop = props[ index ];
  20072. Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
  20073. Animation.tweeners[ prop ].unshift( callback );
  20074. }
  20075. },
  20076. prefilters: [ defaultPrefilter ],
  20077. prefilter: function( callback, prepend ) {
  20078. if ( prepend ) {
  20079. Animation.prefilters.unshift( callback );
  20080. } else {
  20081. Animation.prefilters.push( callback );
  20082. }
  20083. }
  20084. } );
  20085. jQuery.speed = function( speed, easing, fn ) {
  20086. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  20087. complete: fn || !fn && easing ||
  20088. isFunction( speed ) && speed,
  20089. duration: speed,
  20090. easing: fn && easing || easing && !isFunction( easing ) && easing
  20091. };
  20092. // Go to the end state if fx are off
  20093. if ( jQuery.fx.off ) {
  20094. opt.duration = 0;
  20095. } else {
  20096. if ( typeof opt.duration !== "number" ) {
  20097. if ( opt.duration in jQuery.fx.speeds ) {
  20098. opt.duration = jQuery.fx.speeds[ opt.duration ];
  20099. } else {
  20100. opt.duration = jQuery.fx.speeds._default;
  20101. }
  20102. }
  20103. }
  20104. // Normalize opt.queue - true/undefined/null -> "fx"
  20105. if ( opt.queue == null || opt.queue === true ) {
  20106. opt.queue = "fx";
  20107. }
  20108. // Queueing
  20109. opt.old = opt.complete;
  20110. opt.complete = function() {
  20111. if ( isFunction( opt.old ) ) {
  20112. opt.old.call( this );
  20113. }
  20114. if ( opt.queue ) {
  20115. jQuery.dequeue( this, opt.queue );
  20116. }
  20117. };
  20118. return opt;
  20119. };
  20120. jQuery.fn.extend( {
  20121. fadeTo: function( speed, to, easing, callback ) {
  20122. // Show any hidden elements after setting opacity to 0
  20123. return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show()
  20124. // Animate to the value specified
  20125. .end().animate( { opacity: to }, speed, easing, callback );
  20126. },
  20127. animate: function( prop, speed, easing, callback ) {
  20128. var empty = jQuery.isEmptyObject( prop ),
  20129. optall = jQuery.speed( speed, easing, callback ),
  20130. doAnimation = function() {
  20131. // Operate on a copy of prop so per-property easing won't be lost
  20132. var anim = Animation( this, jQuery.extend( {}, prop ), optall );
  20133. // Empty animations, or finishing resolves immediately
  20134. if ( empty || dataPriv.get( this, "finish" ) ) {
  20135. anim.stop( true );
  20136. }
  20137. };
  20138. doAnimation.finish = doAnimation;
  20139. return empty || optall.queue === false ?
  20140. this.each( doAnimation ) :
  20141. this.queue( optall.queue, doAnimation );
  20142. },
  20143. stop: function( type, clearQueue, gotoEnd ) {
  20144. var stopQueue = function( hooks ) {
  20145. var stop = hooks.stop;
  20146. delete hooks.stop;
  20147. stop( gotoEnd );
  20148. };
  20149. if ( typeof type !== "string" ) {
  20150. gotoEnd = clearQueue;
  20151. clearQueue = type;
  20152. type = undefined;
  20153. }
  20154. if ( clearQueue ) {
  20155. this.queue( type || "fx", [] );
  20156. }
  20157. return this.each( function() {
  20158. var dequeue = true,
  20159. index = type != null && type + "queueHooks",
  20160. timers = jQuery.timers,
  20161. data = dataPriv.get( this );
  20162. if ( index ) {
  20163. if ( data[ index ] && data[ index ].stop ) {
  20164. stopQueue( data[ index ] );
  20165. }
  20166. } else {
  20167. for ( index in data ) {
  20168. if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
  20169. stopQueue( data[ index ] );
  20170. }
  20171. }
  20172. }
  20173. for ( index = timers.length; index--; ) {
  20174. if ( timers[ index ].elem === this &&
  20175. ( type == null || timers[ index ].queue === type ) ) {
  20176. timers[ index ].anim.stop( gotoEnd );
  20177. dequeue = false;
  20178. timers.splice( index, 1 );
  20179. }
  20180. }
  20181. // Start the next in the queue if the last step wasn't forced.
  20182. // Timers currently will call their complete callbacks, which
  20183. // will dequeue but only if they were gotoEnd.
  20184. if ( dequeue || !gotoEnd ) {
  20185. jQuery.dequeue( this, type );
  20186. }
  20187. } );
  20188. },
  20189. finish: function( type ) {
  20190. if ( type !== false ) {
  20191. type = type || "fx";
  20192. }
  20193. return this.each( function() {
  20194. var index,
  20195. data = dataPriv.get( this ),
  20196. queue = data[ type + "queue" ],
  20197. hooks = data[ type + "queueHooks" ],
  20198. timers = jQuery.timers,
  20199. length = queue ? queue.length : 0;
  20200. // Enable finishing flag on private data
  20201. data.finish = true;
  20202. // Empty the queue first
  20203. jQuery.queue( this, type, [] );
  20204. if ( hooks && hooks.stop ) {
  20205. hooks.stop.call( this, true );
  20206. }
  20207. // Look for any active animations, and finish them
  20208. for ( index = timers.length; index--; ) {
  20209. if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
  20210. timers[ index ].anim.stop( true );
  20211. timers.splice( index, 1 );
  20212. }
  20213. }
  20214. // Look for any animations in the old queue and finish them
  20215. for ( index = 0; index < length; index++ ) {
  20216. if ( queue[ index ] && queue[ index ].finish ) {
  20217. queue[ index ].finish.call( this );
  20218. }
  20219. }
  20220. // Turn off finishing flag
  20221. delete data.finish;
  20222. } );
  20223. }
  20224. } );
  20225. jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) {
  20226. var cssFn = jQuery.fn[ name ];
  20227. jQuery.fn[ name ] = function( speed, easing, callback ) {
  20228. return speed == null || typeof speed === "boolean" ?
  20229. cssFn.apply( this, arguments ) :
  20230. this.animate( genFx( name, true ), speed, easing, callback );
  20231. };
  20232. } );
  20233. // Generate shortcuts for custom animations
  20234. jQuery.each( {
  20235. slideDown: genFx( "show" ),
  20236. slideUp: genFx( "hide" ),
  20237. slideToggle: genFx( "toggle" ),
  20238. fadeIn: { opacity: "show" },
  20239. fadeOut: { opacity: "hide" },
  20240. fadeToggle: { opacity: "toggle" }
  20241. }, function( name, props ) {
  20242. jQuery.fn[ name ] = function( speed, easing, callback ) {
  20243. return this.animate( props, speed, easing, callback );
  20244. };
  20245. } );
  20246. jQuery.timers = [];
  20247. jQuery.fx.tick = function() {
  20248. var timer,
  20249. i = 0,
  20250. timers = jQuery.timers;
  20251. fxNow = Date.now();
  20252. for ( ; i < timers.length; i++ ) {
  20253. timer = timers[ i ];
  20254. // Run the timer and safely remove it when done (allowing for external removal)
  20255. if ( !timer() && timers[ i ] === timer ) {
  20256. timers.splice( i--, 1 );
  20257. }
  20258. }
  20259. if ( !timers.length ) {
  20260. jQuery.fx.stop();
  20261. }
  20262. fxNow = undefined;
  20263. };
  20264. jQuery.fx.timer = function( timer ) {
  20265. jQuery.timers.push( timer );
  20266. jQuery.fx.start();
  20267. };
  20268. jQuery.fx.interval = 13;
  20269. jQuery.fx.start = function() {
  20270. if ( inProgress ) {
  20271. return;
  20272. }
  20273. inProgress = true;
  20274. schedule();
  20275. };
  20276. jQuery.fx.stop = function() {
  20277. inProgress = null;
  20278. };
  20279. jQuery.fx.speeds = {
  20280. slow: 600,
  20281. fast: 200,
  20282. // Default speed
  20283. _default: 400
  20284. };
  20285. // Based off of the plugin by Clint Helfers, with permission.
  20286. // https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
  20287. jQuery.fn.delay = function( time, type ) {
  20288. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  20289. type = type || "fx";
  20290. return this.queue( type, function( next, hooks ) {
  20291. var timeout = window.setTimeout( next, time );
  20292. hooks.stop = function() {
  20293. window.clearTimeout( timeout );
  20294. };
  20295. } );
  20296. };
  20297. ( function() {
  20298. var input = document.createElement( "input" ),
  20299. select = document.createElement( "select" ),
  20300. opt = select.appendChild( document.createElement( "option" ) );
  20301. input.type = "checkbox";
  20302. // Support: Android <=4.3 only
  20303. // Default value for a checkbox should be "on"
  20304. support.checkOn = input.value !== "";
  20305. // Support: IE <=11 only
  20306. // Must access selectedIndex to make default options select
  20307. support.optSelected = opt.selected;
  20308. // Support: IE <=11 only
  20309. // An input loses its value after becoming a radio
  20310. input = document.createElement( "input" );
  20311. input.value = "t";
  20312. input.type = "radio";
  20313. support.radioValue = input.value === "t";
  20314. } )();
  20315. var boolHook,
  20316. attrHandle = jQuery.expr.attrHandle;
  20317. jQuery.fn.extend( {
  20318. attr: function( name, value ) {
  20319. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  20320. },
  20321. removeAttr: function( name ) {
  20322. return this.each( function() {
  20323. jQuery.removeAttr( this, name );
  20324. } );
  20325. }
  20326. } );
  20327. jQuery.extend( {
  20328. attr: function( elem, name, value ) {
  20329. var ret, hooks,
  20330. nType = elem.nodeType;
  20331. // Don't get/set attributes on text, comment and attribute nodes
  20332. if ( nType === 3 || nType === 8 || nType === 2 ) {
  20333. return;
  20334. }
  20335. // Fallback to prop when attributes are not supported
  20336. if ( typeof elem.getAttribute === "undefined" ) {
  20337. return jQuery.prop( elem, name, value );
  20338. }
  20339. // Attribute hooks are determined by the lowercase version
  20340. // Grab necessary hook if one is defined
  20341. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  20342. hooks = jQuery.attrHooks[ name.toLowerCase() ] ||
  20343. ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
  20344. }
  20345. if ( value !== undefined ) {
  20346. if ( value === null ) {
  20347. jQuery.removeAttr( elem, name );
  20348. return;
  20349. }
  20350. if ( hooks && "set" in hooks &&
  20351. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  20352. return ret;
  20353. }
  20354. elem.setAttribute( name, value + "" );
  20355. return value;
  20356. }
  20357. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  20358. return ret;
  20359. }
  20360. ret = jQuery.find.attr( elem, name );
  20361. // Non-existent attributes return null, we normalize to undefined
  20362. return ret == null ? undefined : ret;
  20363. },
  20364. attrHooks: {
  20365. type: {
  20366. set: function( elem, value ) {
  20367. if ( !support.radioValue && value === "radio" &&
  20368. nodeName( elem, "input" ) ) {
  20369. var val = elem.value;
  20370. elem.setAttribute( "type", value );
  20371. if ( val ) {
  20372. elem.value = val;
  20373. }
  20374. return value;
  20375. }
  20376. }
  20377. }
  20378. },
  20379. removeAttr: function( elem, value ) {
  20380. var name,
  20381. i = 0,
  20382. // Attribute names can contain non-HTML whitespace characters
  20383. // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
  20384. attrNames = value && value.match( rnothtmlwhite );
  20385. if ( attrNames && elem.nodeType === 1 ) {
  20386. while ( ( name = attrNames[ i++ ] ) ) {
  20387. elem.removeAttribute( name );
  20388. }
  20389. }
  20390. }
  20391. } );
  20392. // Hooks for boolean attributes
  20393. boolHook = {
  20394. set: function( elem, value, name ) {
  20395. if ( value === false ) {
  20396. // Remove boolean attributes when set to false
  20397. jQuery.removeAttr( elem, name );
  20398. } else {
  20399. elem.setAttribute( name, name );
  20400. }
  20401. return name;
  20402. }
  20403. };
  20404. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) {
  20405. var getter = attrHandle[ name ] || jQuery.find.attr;
  20406. attrHandle[ name ] = function( elem, name, isXML ) {
  20407. var ret, handle,
  20408. lowercaseName = name.toLowerCase();
  20409. if ( !isXML ) {
  20410. // Avoid an infinite loop by temporarily removing this function from the getter
  20411. handle = attrHandle[ lowercaseName ];
  20412. attrHandle[ lowercaseName ] = ret;
  20413. ret = getter( elem, name, isXML ) != null ?
  20414. lowercaseName :
  20415. null;
  20416. attrHandle[ lowercaseName ] = handle;
  20417. }
  20418. return ret;
  20419. };
  20420. } );
  20421. var rfocusable = /^(?:input|select|textarea|button)$/i,
  20422. rclickable = /^(?:a|area)$/i;
  20423. jQuery.fn.extend( {
  20424. prop: function( name, value ) {
  20425. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  20426. },
  20427. removeProp: function( name ) {
  20428. return this.each( function() {
  20429. delete this[ jQuery.propFix[ name ] || name ];
  20430. } );
  20431. }
  20432. } );
  20433. jQuery.extend( {
  20434. prop: function( elem, name, value ) {
  20435. var ret, hooks,
  20436. nType = elem.nodeType;
  20437. // Don't get/set properties on text, comment and attribute nodes
  20438. if ( nType === 3 || nType === 8 || nType === 2 ) {
  20439. return;
  20440. }
  20441. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  20442. // Fix name and attach hooks
  20443. name = jQuery.propFix[ name ] || name;
  20444. hooks = jQuery.propHooks[ name ];
  20445. }
  20446. if ( value !== undefined ) {
  20447. if ( hooks && "set" in hooks &&
  20448. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  20449. return ret;
  20450. }
  20451. return ( elem[ name ] = value );
  20452. }
  20453. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  20454. return ret;
  20455. }
  20456. return elem[ name ];
  20457. },
  20458. propHooks: {
  20459. tabIndex: {
  20460. get: function( elem ) {
  20461. // Support: IE <=9 - 11 only
  20462. // elem.tabIndex doesn't always return the
  20463. // correct value when it hasn't been explicitly set
  20464. // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
  20465. // Use proper attribute retrieval(#12072)
  20466. var tabindex = jQuery.find.attr( elem, "tabindex" );
  20467. if ( tabindex ) {
  20468. return parseInt( tabindex, 10 );
  20469. }
  20470. if (
  20471. rfocusable.test( elem.nodeName ) ||
  20472. rclickable.test( elem.nodeName ) &&
  20473. elem.href
  20474. ) {
  20475. return 0;
  20476. }
  20477. return -1;
  20478. }
  20479. }
  20480. },
  20481. propFix: {
  20482. "for": "htmlFor",
  20483. "class": "className"
  20484. }
  20485. } );
  20486. // Support: IE <=11 only
  20487. // Accessing the selectedIndex property
  20488. // forces the browser to respect setting selected
  20489. // on the option
  20490. // The getter ensures a default option is selected
  20491. // when in an optgroup
  20492. // eslint rule "no-unused-expressions" is disabled for this code
  20493. // since it considers such accessions noop
  20494. if ( !support.optSelected ) {
  20495. jQuery.propHooks.selected = {
  20496. get: function( elem ) {
  20497. /* eslint no-unused-expressions: "off" */
  20498. var parent = elem.parentNode;
  20499. if ( parent && parent.parentNode ) {
  20500. parent.parentNode.selectedIndex;
  20501. }
  20502. return null;
  20503. },
  20504. set: function( elem ) {
  20505. /* eslint no-unused-expressions: "off" */
  20506. var parent = elem.parentNode;
  20507. if ( parent ) {
  20508. parent.selectedIndex;
  20509. if ( parent.parentNode ) {
  20510. parent.parentNode.selectedIndex;
  20511. }
  20512. }
  20513. }
  20514. };
  20515. }
  20516. jQuery.each( [
  20517. "tabIndex",
  20518. "readOnly",
  20519. "maxLength",
  20520. "cellSpacing",
  20521. "cellPadding",
  20522. "rowSpan",
  20523. "colSpan",
  20524. "useMap",
  20525. "frameBorder",
  20526. "contentEditable"
  20527. ], function() {
  20528. jQuery.propFix[ this.toLowerCase() ] = this;
  20529. } );
  20530. // Strip and collapse whitespace according to HTML spec
  20531. // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace
  20532. function stripAndCollapse( value ) {
  20533. var tokens = value.match( rnothtmlwhite ) || [];
  20534. return tokens.join( " " );
  20535. }
  20536. function getClass( elem ) {
  20537. return elem.getAttribute && elem.getAttribute( "class" ) || "";
  20538. }
  20539. function classesToArray( value ) {
  20540. if ( Array.isArray( value ) ) {
  20541. return value;
  20542. }
  20543. if ( typeof value === "string" ) {
  20544. return value.match( rnothtmlwhite ) || [];
  20545. }
  20546. return [];
  20547. }
  20548. jQuery.fn.extend( {
  20549. addClass: function( value ) {
  20550. var classes, elem, cur, curValue, clazz, j, finalValue,
  20551. i = 0;
  20552. if ( isFunction( value ) ) {
  20553. return this.each( function( j ) {
  20554. jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
  20555. } );
  20556. }
  20557. classes = classesToArray( value );
  20558. if ( classes.length ) {
  20559. while ( ( elem = this[ i++ ] ) ) {
  20560. curValue = getClass( elem );
  20561. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  20562. if ( cur ) {
  20563. j = 0;
  20564. while ( ( clazz = classes[ j++ ] ) ) {
  20565. if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
  20566. cur += clazz + " ";
  20567. }
  20568. }
  20569. // Only assign if different to avoid unneeded rendering.
  20570. finalValue = stripAndCollapse( cur );
  20571. if ( curValue !== finalValue ) {
  20572. elem.setAttribute( "class", finalValue );
  20573. }
  20574. }
  20575. }
  20576. }
  20577. return this;
  20578. },
  20579. removeClass: function( value ) {
  20580. var classes, elem, cur, curValue, clazz, j, finalValue,
  20581. i = 0;
  20582. if ( isFunction( value ) ) {
  20583. return this.each( function( j ) {
  20584. jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
  20585. } );
  20586. }
  20587. if ( !arguments.length ) {
  20588. return this.attr( "class", "" );
  20589. }
  20590. classes = classesToArray( value );
  20591. if ( classes.length ) {
  20592. while ( ( elem = this[ i++ ] ) ) {
  20593. curValue = getClass( elem );
  20594. // This expression is here for better compressibility (see addClass)
  20595. cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " );
  20596. if ( cur ) {
  20597. j = 0;
  20598. while ( ( clazz = classes[ j++ ] ) ) {
  20599. // Remove *all* instances
  20600. while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
  20601. cur = cur.replace( " " + clazz + " ", " " );
  20602. }
  20603. }
  20604. // Only assign if different to avoid unneeded rendering.
  20605. finalValue = stripAndCollapse( cur );
  20606. if ( curValue !== finalValue ) {
  20607. elem.setAttribute( "class", finalValue );
  20608. }
  20609. }
  20610. }
  20611. }
  20612. return this;
  20613. },
  20614. toggleClass: function( value, stateVal ) {
  20615. var type = typeof value,
  20616. isValidValue = type === "string" || Array.isArray( value );
  20617. if ( typeof stateVal === "boolean" && isValidValue ) {
  20618. return stateVal ? this.addClass( value ) : this.removeClass( value );
  20619. }
  20620. if ( isFunction( value ) ) {
  20621. return this.each( function( i ) {
  20622. jQuery( this ).toggleClass(
  20623. value.call( this, i, getClass( this ), stateVal ),
  20624. stateVal
  20625. );
  20626. } );
  20627. }
  20628. return this.each( function() {
  20629. var className, i, self, classNames;
  20630. if ( isValidValue ) {
  20631. // Toggle individual class names
  20632. i = 0;
  20633. self = jQuery( this );
  20634. classNames = classesToArray( value );
  20635. while ( ( className = classNames[ i++ ] ) ) {
  20636. // Check each className given, space separated list
  20637. if ( self.hasClass( className ) ) {
  20638. self.removeClass( className );
  20639. } else {
  20640. self.addClass( className );
  20641. }
  20642. }
  20643. // Toggle whole class name
  20644. } else if ( value === undefined || type === "boolean" ) {
  20645. className = getClass( this );
  20646. if ( className ) {
  20647. // Store className if set
  20648. dataPriv.set( this, "__className__", className );
  20649. }
  20650. // If the element has a class name or if we're passed `false`,
  20651. // then remove the whole classname (if there was one, the above saved it).
  20652. // Otherwise bring back whatever was previously saved (if anything),
  20653. // falling back to the empty string if nothing was stored.
  20654. if ( this.setAttribute ) {
  20655. this.setAttribute( "class",
  20656. className || value === false ?
  20657. "" :
  20658. dataPriv.get( this, "__className__" ) || ""
  20659. );
  20660. }
  20661. }
  20662. } );
  20663. },
  20664. hasClass: function( selector ) {
  20665. var className, elem,
  20666. i = 0;
  20667. className = " " + selector + " ";
  20668. while ( ( elem = this[ i++ ] ) ) {
  20669. if ( elem.nodeType === 1 &&
  20670. ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) {
  20671. return true;
  20672. }
  20673. }
  20674. return false;
  20675. }
  20676. } );
  20677. var rreturn = /\r/g;
  20678. jQuery.fn.extend( {
  20679. val: function( value ) {
  20680. var hooks, ret, valueIsFunction,
  20681. elem = this[ 0 ];
  20682. if ( !arguments.length ) {
  20683. if ( elem ) {
  20684. hooks = jQuery.valHooks[ elem.type ] ||
  20685. jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  20686. if ( hooks &&
  20687. "get" in hooks &&
  20688. ( ret = hooks.get( elem, "value" ) ) !== undefined
  20689. ) {
  20690. return ret;
  20691. }
  20692. ret = elem.value;
  20693. // Handle most common string cases
  20694. if ( typeof ret === "string" ) {
  20695. return ret.replace( rreturn, "" );
  20696. }
  20697. // Handle cases where value is null/undef or number
  20698. return ret == null ? "" : ret;
  20699. }
  20700. return;
  20701. }
  20702. valueIsFunction = isFunction( value );
  20703. return this.each( function( i ) {
  20704. var val;
  20705. if ( this.nodeType !== 1 ) {
  20706. return;
  20707. }
  20708. if ( valueIsFunction ) {
  20709. val = value.call( this, i, jQuery( this ).val() );
  20710. } else {
  20711. val = value;
  20712. }
  20713. // Treat null/undefined as ""; convert numbers to string
  20714. if ( val == null ) {
  20715. val = "";
  20716. } else if ( typeof val === "number" ) {
  20717. val += "";
  20718. } else if ( Array.isArray( val ) ) {
  20719. val = jQuery.map( val, function( value ) {
  20720. return value == null ? "" : value + "";
  20721. } );
  20722. }
  20723. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  20724. // If set returns undefined, fall back to normal setting
  20725. if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
  20726. this.value = val;
  20727. }
  20728. } );
  20729. }
  20730. } );
  20731. jQuery.extend( {
  20732. valHooks: {
  20733. option: {
  20734. get: function( elem ) {
  20735. var val = jQuery.find.attr( elem, "value" );
  20736. return val != null ?
  20737. val :
  20738. // Support: IE <=10 - 11 only
  20739. // option.text throws exceptions (#14686, #14858)
  20740. // Strip and collapse whitespace
  20741. // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
  20742. stripAndCollapse( jQuery.text( elem ) );
  20743. }
  20744. },
  20745. select: {
  20746. get: function( elem ) {
  20747. var value, option, i,
  20748. options = elem.options,
  20749. index = elem.selectedIndex,
  20750. one = elem.type === "select-one",
  20751. values = one ? null : [],
  20752. max = one ? index + 1 : options.length;
  20753. if ( index < 0 ) {
  20754. i = max;
  20755. } else {
  20756. i = one ? index : 0;
  20757. }
  20758. // Loop through all the selected options
  20759. for ( ; i < max; i++ ) {
  20760. option = options[ i ];
  20761. // Support: IE <=9 only
  20762. // IE8-9 doesn't update selected after form reset (#2551)
  20763. if ( ( option.selected || i === index ) &&
  20764. // Don't return options that are disabled or in a disabled optgroup
  20765. !option.disabled &&
  20766. ( !option.parentNode.disabled ||
  20767. !nodeName( option.parentNode, "optgroup" ) ) ) {
  20768. // Get the specific value for the option
  20769. value = jQuery( option ).val();
  20770. // We don't need an array for one selects
  20771. if ( one ) {
  20772. return value;
  20773. }
  20774. // Multi-Selects return an array
  20775. values.push( value );
  20776. }
  20777. }
  20778. return values;
  20779. },
  20780. set: function( elem, value ) {
  20781. var optionSet, option,
  20782. options = elem.options,
  20783. values = jQuery.makeArray( value ),
  20784. i = options.length;
  20785. while ( i-- ) {
  20786. option = options[ i ];
  20787. /* eslint-disable no-cond-assign */
  20788. if ( option.selected =
  20789. jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
  20790. ) {
  20791. optionSet = true;
  20792. }
  20793. /* eslint-enable no-cond-assign */
  20794. }
  20795. // Force browsers to behave consistently when non-matching value is set
  20796. if ( !optionSet ) {
  20797. elem.selectedIndex = -1;
  20798. }
  20799. return values;
  20800. }
  20801. }
  20802. }
  20803. } );
  20804. // Radios and checkboxes getter/setter
  20805. jQuery.each( [ "radio", "checkbox" ], function() {
  20806. jQuery.valHooks[ this ] = {
  20807. set: function( elem, value ) {
  20808. if ( Array.isArray( value ) ) {
  20809. return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
  20810. }
  20811. }
  20812. };
  20813. if ( !support.checkOn ) {
  20814. jQuery.valHooks[ this ].get = function( elem ) {
  20815. return elem.getAttribute( "value" ) === null ? "on" : elem.value;
  20816. };
  20817. }
  20818. } );
  20819. // Return jQuery for attributes-only inclusion
  20820. support.focusin = "onfocusin" in window;
  20821. var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
  20822. stopPropagationCallback = function( e ) {
  20823. e.stopPropagation();
  20824. };
  20825. jQuery.extend( jQuery.event, {
  20826. trigger: function( event, data, elem, onlyHandlers ) {
  20827. var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
  20828. eventPath = [ elem || document ],
  20829. type = hasOwn.call( event, "type" ) ? event.type : event,
  20830. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
  20831. cur = lastElement = tmp = elem = elem || document;
  20832. // Don't do events on text and comment nodes
  20833. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  20834. return;
  20835. }
  20836. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  20837. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  20838. return;
  20839. }
  20840. if ( type.indexOf( "." ) > -1 ) {
  20841. // Namespaced trigger; create a regexp to match event type in handle()
  20842. namespaces = type.split( "." );
  20843. type = namespaces.shift();
  20844. namespaces.sort();
  20845. }
  20846. ontype = type.indexOf( ":" ) < 0 && "on" + type;
  20847. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  20848. event = event[ jQuery.expando ] ?
  20849. event :
  20850. new jQuery.Event( type, typeof event === "object" && event );
  20851. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  20852. event.isTrigger = onlyHandlers ? 2 : 3;
  20853. event.namespace = namespaces.join( "." );
  20854. event.rnamespace = event.namespace ?
  20855. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
  20856. null;
  20857. // Clean up the event in case it is being reused
  20858. event.result = undefined;
  20859. if ( !event.target ) {
  20860. event.target = elem;
  20861. }
  20862. // Clone any incoming data and prepend the event, creating the handler arg list
  20863. data = data == null ?
  20864. [ event ] :
  20865. jQuery.makeArray( data, [ event ] );
  20866. // Allow special events to draw outside the lines
  20867. special = jQuery.event.special[ type ] || {};
  20868. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  20869. return;
  20870. }
  20871. // Determine event propagation path in advance, per W3C events spec (#9951)
  20872. // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
  20873. if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) {
  20874. bubbleType = special.delegateType || type;
  20875. if ( !rfocusMorph.test( bubbleType + type ) ) {
  20876. cur = cur.parentNode;
  20877. }
  20878. for ( ; cur; cur = cur.parentNode ) {
  20879. eventPath.push( cur );
  20880. tmp = cur;
  20881. }
  20882. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  20883. if ( tmp === ( elem.ownerDocument || document ) ) {
  20884. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  20885. }
  20886. }
  20887. // Fire handlers on the event path
  20888. i = 0;
  20889. while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
  20890. lastElement = cur;
  20891. event.type = i > 1 ?
  20892. bubbleType :
  20893. special.bindType || type;
  20894. // jQuery handler
  20895. handle = (
  20896. dataPriv.get( cur, "events" ) || Object.create( null )
  20897. )[ event.type ] &&
  20898. dataPriv.get( cur, "handle" );
  20899. if ( handle ) {
  20900. handle.apply( cur, data );
  20901. }
  20902. // Native handler
  20903. handle = ontype && cur[ ontype ];
  20904. if ( handle && handle.apply && acceptData( cur ) ) {
  20905. event.result = handle.apply( cur, data );
  20906. if ( event.result === false ) {
  20907. event.preventDefault();
  20908. }
  20909. }
  20910. }
  20911. event.type = type;
  20912. // If nobody prevented the default action, do it now
  20913. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  20914. if ( ( !special._default ||
  20915. special._default.apply( eventPath.pop(), data ) === false ) &&
  20916. acceptData( elem ) ) {
  20917. // Call a native DOM method on the target with the same name as the event.
  20918. // Don't do default actions on window, that's where global variables be (#6170)
  20919. if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) {
  20920. // Don't re-trigger an onFOO event when we call its FOO() method
  20921. tmp = elem[ ontype ];
  20922. if ( tmp ) {
  20923. elem[ ontype ] = null;
  20924. }
  20925. // Prevent re-triggering of the same event, since we already bubbled it above
  20926. jQuery.event.triggered = type;
  20927. if ( event.isPropagationStopped() ) {
  20928. lastElement.addEventListener( type, stopPropagationCallback );
  20929. }
  20930. elem[ type ]();
  20931. if ( event.isPropagationStopped() ) {
  20932. lastElement.removeEventListener( type, stopPropagationCallback );
  20933. }
  20934. jQuery.event.triggered = undefined;
  20935. if ( tmp ) {
  20936. elem[ ontype ] = tmp;
  20937. }
  20938. }
  20939. }
  20940. }
  20941. return event.result;
  20942. },
  20943. // Piggyback on a donor event to simulate a different one
  20944. // Used only for `focus(in | out)` events
  20945. simulate: function( type, elem, event ) {
  20946. var e = jQuery.extend(
  20947. new jQuery.Event(),
  20948. event,
  20949. {
  20950. type: type,
  20951. isSimulated: true
  20952. }
  20953. );
  20954. jQuery.event.trigger( e, null, elem );
  20955. }
  20956. } );
  20957. jQuery.fn.extend( {
  20958. trigger: function( type, data ) {
  20959. return this.each( function() {
  20960. jQuery.event.trigger( type, data, this );
  20961. } );
  20962. },
  20963. triggerHandler: function( type, data ) {
  20964. var elem = this[ 0 ];
  20965. if ( elem ) {
  20966. return jQuery.event.trigger( type, data, elem, true );
  20967. }
  20968. }
  20969. } );
  20970. // Support: Firefox <=44
  20971. // Firefox doesn't have focus(in | out) events
  20972. // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  20973. //
  20974. // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
  20975. // focus(in | out) events fire after focus & blur events,
  20976. // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
  20977. // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
  20978. if ( !support.focusin ) {
  20979. jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  20980. // Attach a single capturing handler on the document while someone wants focusin/focusout
  20981. var handler = function( event ) {
  20982. jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
  20983. };
  20984. jQuery.event.special[ fix ] = {
  20985. setup: function() {
  20986. // Handle: regular nodes (via `this.ownerDocument`), window
  20987. // (via `this.document`) & document (via `this`).
  20988. var doc = this.ownerDocument || this.document || this,
  20989. attaches = dataPriv.access( doc, fix );
  20990. if ( !attaches ) {
  20991. doc.addEventListener( orig, handler, true );
  20992. }
  20993. dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
  20994. },
  20995. teardown: function() {
  20996. var doc = this.ownerDocument || this.document || this,
  20997. attaches = dataPriv.access( doc, fix ) - 1;
  20998. if ( !attaches ) {
  20999. doc.removeEventListener( orig, handler, true );
  21000. dataPriv.remove( doc, fix );
  21001. } else {
  21002. dataPriv.access( doc, fix, attaches );
  21003. }
  21004. }
  21005. };
  21006. } );
  21007. }
  21008. var location = window.location;
  21009. var nonce = { guid: Date.now() };
  21010. var rquery = ( /\?/ );
  21011. // Cross-browser xml parsing
  21012. jQuery.parseXML = function( data ) {
  21013. var xml;
  21014. if ( !data || typeof data !== "string" ) {
  21015. return null;
  21016. }
  21017. // Support: IE 9 - 11 only
  21018. // IE throws on parseFromString with invalid input.
  21019. try {
  21020. xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
  21021. } catch ( e ) {
  21022. xml = undefined;
  21023. }
  21024. if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
  21025. jQuery.error( "Invalid XML: " + data );
  21026. }
  21027. return xml;
  21028. };
  21029. var
  21030. rbracket = /\[\]$/,
  21031. rCRLF = /\r?\n/g,
  21032. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  21033. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  21034. function buildParams( prefix, obj, traditional, add ) {
  21035. var name;
  21036. if ( Array.isArray( obj ) ) {
  21037. // Serialize array item.
  21038. jQuery.each( obj, function( i, v ) {
  21039. if ( traditional || rbracket.test( prefix ) ) {
  21040. // Treat each array item as a scalar.
  21041. add( prefix, v );
  21042. } else {
  21043. // Item is non-scalar (array or object), encode its numeric index.
  21044. buildParams(
  21045. prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
  21046. v,
  21047. traditional,
  21048. add
  21049. );
  21050. }
  21051. } );
  21052. } else if ( !traditional && toType( obj ) === "object" ) {
  21053. // Serialize object item.
  21054. for ( name in obj ) {
  21055. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  21056. }
  21057. } else {
  21058. // Serialize scalar item.
  21059. add( prefix, obj );
  21060. }
  21061. }
  21062. // Serialize an array of form elements or a set of
  21063. // key/values into a query string
  21064. jQuery.param = function( a, traditional ) {
  21065. var prefix,
  21066. s = [],
  21067. add = function( key, valueOrFunction ) {
  21068. // If value is a function, invoke it and use its return value
  21069. var value = isFunction( valueOrFunction ) ?
  21070. valueOrFunction() :
  21071. valueOrFunction;
  21072. s[ s.length ] = encodeURIComponent( key ) + "=" +
  21073. encodeURIComponent( value == null ? "" : value );
  21074. };
  21075. if ( a == null ) {
  21076. return "";
  21077. }
  21078. // If an array was passed in, assume that it is an array of form elements.
  21079. if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  21080. // Serialize the form elements
  21081. jQuery.each( a, function() {
  21082. add( this.name, this.value );
  21083. } );
  21084. } else {
  21085. // If traditional, encode the "old" way (the way 1.3.2 or older
  21086. // did it), otherwise encode params recursively.
  21087. for ( prefix in a ) {
  21088. buildParams( prefix, a[ prefix ], traditional, add );
  21089. }
  21090. }
  21091. // Return the resulting serialization
  21092. return s.join( "&" );
  21093. };
  21094. jQuery.fn.extend( {
  21095. serialize: function() {
  21096. return jQuery.param( this.serializeArray() );
  21097. },
  21098. serializeArray: function() {
  21099. return this.map( function() {
  21100. // Can add propHook for "elements" to filter or add form elements
  21101. var elements = jQuery.prop( this, "elements" );
  21102. return elements ? jQuery.makeArray( elements ) : this;
  21103. } )
  21104. .filter( function() {
  21105. var type = this.type;
  21106. // Use .is( ":disabled" ) so that fieldset[disabled] works
  21107. return this.name && !jQuery( this ).is( ":disabled" ) &&
  21108. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  21109. ( this.checked || !rcheckableType.test( type ) );
  21110. } )
  21111. .map( function( _i, elem ) {
  21112. var val = jQuery( this ).val();
  21113. if ( val == null ) {
  21114. return null;
  21115. }
  21116. if ( Array.isArray( val ) ) {
  21117. return jQuery.map( val, function( val ) {
  21118. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  21119. } );
  21120. }
  21121. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  21122. } ).get();
  21123. }
  21124. } );
  21125. var
  21126. r20 = /%20/g,
  21127. rhash = /#.*$/,
  21128. rantiCache = /([?&])_=[^&]*/,
  21129. rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
  21130. // #7653, #8125, #8152: local protocol detection
  21131. rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  21132. rnoContent = /^(?:GET|HEAD)$/,
  21133. rprotocol = /^\/\//,
  21134. /* Prefilters
  21135. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  21136. * 2) These are called:
  21137. * - BEFORE asking for a transport
  21138. * - AFTER param serialization (s.data is a string if s.processData is true)
  21139. * 3) key is the dataType
  21140. * 4) the catchall symbol "*" can be used
  21141. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  21142. */
  21143. prefilters = {},
  21144. /* Transports bindings
  21145. * 1) key is the dataType
  21146. * 2) the catchall symbol "*" can be used
  21147. * 3) selection will start with transport dataType and THEN go to "*" if needed
  21148. */
  21149. transports = {},
  21150. // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
  21151. allTypes = "*/".concat( "*" ),
  21152. // Anchor tag for parsing the document origin
  21153. originAnchor = document.createElement( "a" );
  21154. originAnchor.href = location.href;
  21155. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  21156. function addToPrefiltersOrTransports( structure ) {
  21157. // dataTypeExpression is optional and defaults to "*"
  21158. return function( dataTypeExpression, func ) {
  21159. if ( typeof dataTypeExpression !== "string" ) {
  21160. func = dataTypeExpression;
  21161. dataTypeExpression = "*";
  21162. }
  21163. var dataType,
  21164. i = 0,
  21165. dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || [];
  21166. if ( isFunction( func ) ) {
  21167. // For each dataType in the dataTypeExpression
  21168. while ( ( dataType = dataTypes[ i++ ] ) ) {
  21169. // Prepend if requested
  21170. if ( dataType[ 0 ] === "+" ) {
  21171. dataType = dataType.slice( 1 ) || "*";
  21172. ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
  21173. // Otherwise append
  21174. } else {
  21175. ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
  21176. }
  21177. }
  21178. }
  21179. };
  21180. }
  21181. // Base inspection function for prefilters and transports
  21182. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
  21183. var inspected = {},
  21184. seekingTransport = ( structure === transports );
  21185. function inspect( dataType ) {
  21186. var selected;
  21187. inspected[ dataType ] = true;
  21188. jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
  21189. var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
  21190. if ( typeof dataTypeOrTransport === "string" &&
  21191. !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
  21192. options.dataTypes.unshift( dataTypeOrTransport );
  21193. inspect( dataTypeOrTransport );
  21194. return false;
  21195. } else if ( seekingTransport ) {
  21196. return !( selected = dataTypeOrTransport );
  21197. }
  21198. } );
  21199. return selected;
  21200. }
  21201. return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
  21202. }
  21203. // A special extend for ajax options
  21204. // that takes "flat" options (not to be deep extended)
  21205. // Fixes #9887
  21206. function ajaxExtend( target, src ) {
  21207. var key, deep,
  21208. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  21209. for ( key in src ) {
  21210. if ( src[ key ] !== undefined ) {
  21211. ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
  21212. }
  21213. }
  21214. if ( deep ) {
  21215. jQuery.extend( true, target, deep );
  21216. }
  21217. return target;
  21218. }
  21219. /* Handles responses to an ajax request:
  21220. * - finds the right dataType (mediates between content-type and expected dataType)
  21221. * - returns the corresponding response
  21222. */
  21223. function ajaxHandleResponses( s, jqXHR, responses ) {
  21224. var ct, type, finalDataType, firstDataType,
  21225. contents = s.contents,
  21226. dataTypes = s.dataTypes;
  21227. // Remove auto dataType and get content-type in the process
  21228. while ( dataTypes[ 0 ] === "*" ) {
  21229. dataTypes.shift();
  21230. if ( ct === undefined ) {
  21231. ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
  21232. }
  21233. }
  21234. // Check if we're dealing with a known content-type
  21235. if ( ct ) {
  21236. for ( type in contents ) {
  21237. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  21238. dataTypes.unshift( type );
  21239. break;
  21240. }
  21241. }
  21242. }
  21243. // Check to see if we have a response for the expected dataType
  21244. if ( dataTypes[ 0 ] in responses ) {
  21245. finalDataType = dataTypes[ 0 ];
  21246. } else {
  21247. // Try convertible dataTypes
  21248. for ( type in responses ) {
  21249. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
  21250. finalDataType = type;
  21251. break;
  21252. }
  21253. if ( !firstDataType ) {
  21254. firstDataType = type;
  21255. }
  21256. }
  21257. // Or just use first one
  21258. finalDataType = finalDataType || firstDataType;
  21259. }
  21260. // If we found a dataType
  21261. // We add the dataType to the list if needed
  21262. // and return the corresponding response
  21263. if ( finalDataType ) {
  21264. if ( finalDataType !== dataTypes[ 0 ] ) {
  21265. dataTypes.unshift( finalDataType );
  21266. }
  21267. return responses[ finalDataType ];
  21268. }
  21269. }
  21270. /* Chain conversions given the request and the original response
  21271. * Also sets the responseXXX fields on the jqXHR instance
  21272. */
  21273. function ajaxConvert( s, response, jqXHR, isSuccess ) {
  21274. var conv2, current, conv, tmp, prev,
  21275. converters = {},
  21276. // Work with a copy of dataTypes in case we need to modify it for conversion
  21277. dataTypes = s.dataTypes.slice();
  21278. // Create converters map with lowercased keys
  21279. if ( dataTypes[ 1 ] ) {
  21280. for ( conv in s.converters ) {
  21281. converters[ conv.toLowerCase() ] = s.converters[ conv ];
  21282. }
  21283. }
  21284. current = dataTypes.shift();
  21285. // Convert to each sequential dataType
  21286. while ( current ) {
  21287. if ( s.responseFields[ current ] ) {
  21288. jqXHR[ s.responseFields[ current ] ] = response;
  21289. }
  21290. // Apply the dataFilter if provided
  21291. if ( !prev && isSuccess && s.dataFilter ) {
  21292. response = s.dataFilter( response, s.dataType );
  21293. }
  21294. prev = current;
  21295. current = dataTypes.shift();
  21296. if ( current ) {
  21297. // There's only work to do if current dataType is non-auto
  21298. if ( current === "*" ) {
  21299. current = prev;
  21300. // Convert response if prev dataType is non-auto and differs from current
  21301. } else if ( prev !== "*" && prev !== current ) {
  21302. // Seek a direct converter
  21303. conv = converters[ prev + " " + current ] || converters[ "* " + current ];
  21304. // If none found, seek a pair
  21305. if ( !conv ) {
  21306. for ( conv2 in converters ) {
  21307. // If conv2 outputs current
  21308. tmp = conv2.split( " " );
  21309. if ( tmp[ 1 ] === current ) {
  21310. // If prev can be converted to accepted input
  21311. conv = converters[ prev + " " + tmp[ 0 ] ] ||
  21312. converters[ "* " + tmp[ 0 ] ];
  21313. if ( conv ) {
  21314. // Condense equivalence converters
  21315. if ( conv === true ) {
  21316. conv = converters[ conv2 ];
  21317. // Otherwise, insert the intermediate dataType
  21318. } else if ( converters[ conv2 ] !== true ) {
  21319. current = tmp[ 0 ];
  21320. dataTypes.unshift( tmp[ 1 ] );
  21321. }
  21322. break;
  21323. }
  21324. }
  21325. }
  21326. }
  21327. // Apply converter (if not an equivalence)
  21328. if ( conv !== true ) {
  21329. // Unless errors are allowed to bubble, catch and return them
  21330. if ( conv && s.throws ) {
  21331. response = conv( response );
  21332. } else {
  21333. try {
  21334. response = conv( response );
  21335. } catch ( e ) {
  21336. return {
  21337. state: "parsererror",
  21338. error: conv ? e : "No conversion from " + prev + " to " + current
  21339. };
  21340. }
  21341. }
  21342. }
  21343. }
  21344. }
  21345. }
  21346. return { state: "success", data: response };
  21347. }
  21348. jQuery.extend( {
  21349. // Counter for holding the number of active queries
  21350. active: 0,
  21351. // Last-Modified header cache for next request
  21352. lastModified: {},
  21353. etag: {},
  21354. ajaxSettings: {
  21355. url: location.href,
  21356. type: "GET",
  21357. isLocal: rlocalProtocol.test( location.protocol ),
  21358. global: true,
  21359. processData: true,
  21360. async: true,
  21361. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  21362. /*
  21363. timeout: 0,
  21364. data: null,
  21365. dataType: null,
  21366. username: null,
  21367. password: null,
  21368. cache: null,
  21369. throws: false,
  21370. traditional: false,
  21371. headers: {},
  21372. */
  21373. accepts: {
  21374. "*": allTypes,
  21375. text: "text/plain",
  21376. html: "text/html",
  21377. xml: "application/xml, text/xml",
  21378. json: "application/json, text/javascript"
  21379. },
  21380. contents: {
  21381. xml: /\bxml\b/,
  21382. html: /\bhtml/,
  21383. json: /\bjson\b/
  21384. },
  21385. responseFields: {
  21386. xml: "responseXML",
  21387. text: "responseText",
  21388. json: "responseJSON"
  21389. },
  21390. // Data converters
  21391. // Keys separate source (or catchall "*") and destination types with a single space
  21392. converters: {
  21393. // Convert anything to text
  21394. "* text": String,
  21395. // Text to html (true = no transformation)
  21396. "text html": true,
  21397. // Evaluate text as a json expression
  21398. "text json": JSON.parse,
  21399. // Parse text as xml
  21400. "text xml": jQuery.parseXML
  21401. },
  21402. // For options that shouldn't be deep extended:
  21403. // you can add your own custom options here if
  21404. // and when you create one that shouldn't be
  21405. // deep extended (see ajaxExtend)
  21406. flatOptions: {
  21407. url: true,
  21408. context: true
  21409. }
  21410. },
  21411. // Creates a full fledged settings object into target
  21412. // with both ajaxSettings and settings fields.
  21413. // If target is omitted, writes into ajaxSettings.
  21414. ajaxSetup: function( target, settings ) {
  21415. return settings ?
  21416. // Building a settings object
  21417. ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
  21418. // Extending ajaxSettings
  21419. ajaxExtend( jQuery.ajaxSettings, target );
  21420. },
  21421. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  21422. ajaxTransport: addToPrefiltersOrTransports( transports ),
  21423. // Main method
  21424. ajax: function( url, options ) {
  21425. // If url is an object, simulate pre-1.5 signature
  21426. if ( typeof url === "object" ) {
  21427. options = url;
  21428. url = undefined;
  21429. }
  21430. // Force options to be an object
  21431. options = options || {};
  21432. var transport,
  21433. // URL without anti-cache param
  21434. cacheURL,
  21435. // Response headers
  21436. responseHeadersString,
  21437. responseHeaders,
  21438. // timeout handle
  21439. timeoutTimer,
  21440. // Url cleanup var
  21441. urlAnchor,
  21442. // Request state (becomes false upon send and true upon completion)
  21443. completed,
  21444. // To know if global events are to be dispatched
  21445. fireGlobals,
  21446. // Loop variable
  21447. i,
  21448. // uncached part of the url
  21449. uncached,
  21450. // Create the final options object
  21451. s = jQuery.ajaxSetup( {}, options ),
  21452. // Callbacks context
  21453. callbackContext = s.context || s,
  21454. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  21455. globalEventContext = s.context &&
  21456. ( callbackContext.nodeType || callbackContext.jquery ) ?
  21457. jQuery( callbackContext ) :
  21458. jQuery.event,
  21459. // Deferreds
  21460. deferred = jQuery.Deferred(),
  21461. completeDeferred = jQuery.Callbacks( "once memory" ),
  21462. // Status-dependent callbacks
  21463. statusCode = s.statusCode || {},
  21464. // Headers (they are sent all at once)
  21465. requestHeaders = {},
  21466. requestHeadersNames = {},
  21467. // Default abort message
  21468. strAbort = "canceled",
  21469. // Fake xhr
  21470. jqXHR = {
  21471. readyState: 0,
  21472. // Builds headers hashtable if needed
  21473. getResponseHeader: function( key ) {
  21474. var match;
  21475. if ( completed ) {
  21476. if ( !responseHeaders ) {
  21477. responseHeaders = {};
  21478. while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
  21479. responseHeaders[ match[ 1 ].toLowerCase() + " " ] =
  21480. ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )
  21481. .concat( match[ 2 ] );
  21482. }
  21483. }
  21484. match = responseHeaders[ key.toLowerCase() + " " ];
  21485. }
  21486. return match == null ? null : match.join( ", " );
  21487. },
  21488. // Raw string
  21489. getAllResponseHeaders: function() {
  21490. return completed ? responseHeadersString : null;
  21491. },
  21492. // Caches the header
  21493. setRequestHeader: function( name, value ) {
  21494. if ( completed == null ) {
  21495. name = requestHeadersNames[ name.toLowerCase() ] =
  21496. requestHeadersNames[ name.toLowerCase() ] || name;
  21497. requestHeaders[ name ] = value;
  21498. }
  21499. return this;
  21500. },
  21501. // Overrides response content-type header
  21502. overrideMimeType: function( type ) {
  21503. if ( completed == null ) {
  21504. s.mimeType = type;
  21505. }
  21506. return this;
  21507. },
  21508. // Status-dependent callbacks
  21509. statusCode: function( map ) {
  21510. var code;
  21511. if ( map ) {
  21512. if ( completed ) {
  21513. // Execute the appropriate callbacks
  21514. jqXHR.always( map[ jqXHR.status ] );
  21515. } else {
  21516. // Lazy-add the new callbacks in a way that preserves old ones
  21517. for ( code in map ) {
  21518. statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
  21519. }
  21520. }
  21521. }
  21522. return this;
  21523. },
  21524. // Cancel the request
  21525. abort: function( statusText ) {
  21526. var finalText = statusText || strAbort;
  21527. if ( transport ) {
  21528. transport.abort( finalText );
  21529. }
  21530. done( 0, finalText );
  21531. return this;
  21532. }
  21533. };
  21534. // Attach deferreds
  21535. deferred.promise( jqXHR );
  21536. // Add protocol if not provided (prefilters might expect it)
  21537. // Handle falsy url in the settings object (#10093: consistency with old signature)
  21538. // We also use the url parameter if available
  21539. s.url = ( ( url || s.url || location.href ) + "" )
  21540. .replace( rprotocol, location.protocol + "//" );
  21541. // Alias method option to type as per ticket #12004
  21542. s.type = options.method || options.type || s.method || s.type;
  21543. // Extract dataTypes list
  21544. s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ];
  21545. // A cross-domain request is in order when the origin doesn't match the current origin.
  21546. if ( s.crossDomain == null ) {
  21547. urlAnchor = document.createElement( "a" );
  21548. // Support: IE <=8 - 11, Edge 12 - 15
  21549. // IE throws exception on accessing the href property if url is malformed,
  21550. // e.g. http://example.com:80x/
  21551. try {
  21552. urlAnchor.href = s.url;
  21553. // Support: IE <=8 - 11 only
  21554. // Anchor's host property isn't correctly set when s.url is relative
  21555. urlAnchor.href = urlAnchor.href;
  21556. s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
  21557. urlAnchor.protocol + "//" + urlAnchor.host;
  21558. } catch ( e ) {
  21559. // If there is an error parsing the URL, assume it is crossDomain,
  21560. // it can be rejected by the transport if it is invalid
  21561. s.crossDomain = true;
  21562. }
  21563. }
  21564. // Convert data if not already a string
  21565. if ( s.data && s.processData && typeof s.data !== "string" ) {
  21566. s.data = jQuery.param( s.data, s.traditional );
  21567. }
  21568. // Apply prefilters
  21569. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  21570. // If request was aborted inside a prefilter, stop there
  21571. if ( completed ) {
  21572. return jqXHR;
  21573. }
  21574. // We can fire global events as of now if asked to
  21575. // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
  21576. fireGlobals = jQuery.event && s.global;
  21577. // Watch for a new set of requests
  21578. if ( fireGlobals && jQuery.active++ === 0 ) {
  21579. jQuery.event.trigger( "ajaxStart" );
  21580. }
  21581. // Uppercase the type
  21582. s.type = s.type.toUpperCase();
  21583. // Determine if request has content
  21584. s.hasContent = !rnoContent.test( s.type );
  21585. // Save the URL in case we're toying with the If-Modified-Since
  21586. // and/or If-None-Match header later on
  21587. // Remove hash to simplify url manipulation
  21588. cacheURL = s.url.replace( rhash, "" );
  21589. // More options handling for requests with no content
  21590. if ( !s.hasContent ) {
  21591. // Remember the hash so we can put it back
  21592. uncached = s.url.slice( cacheURL.length );
  21593. // If data is available and should be processed, append data to url
  21594. if ( s.data && ( s.processData || typeof s.data === "string" ) ) {
  21595. cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data;
  21596. // #9682: remove data so that it's not used in an eventual retry
  21597. delete s.data;
  21598. }
  21599. // Add or update anti-cache param if needed
  21600. if ( s.cache === false ) {
  21601. cacheURL = cacheURL.replace( rantiCache, "$1" );
  21602. uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) +
  21603. uncached;
  21604. }
  21605. // Put hash and anti-cache on the URL that will be requested (gh-1732)
  21606. s.url = cacheURL + uncached;
  21607. // Change '%20' to '+' if this is encoded form body content (gh-2658)
  21608. } else if ( s.data && s.processData &&
  21609. ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) {
  21610. s.data = s.data.replace( r20, "+" );
  21611. }
  21612. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  21613. if ( s.ifModified ) {
  21614. if ( jQuery.lastModified[ cacheURL ] ) {
  21615. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
  21616. }
  21617. if ( jQuery.etag[ cacheURL ] ) {
  21618. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
  21619. }
  21620. }
  21621. // Set the correct header, if data is being sent
  21622. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  21623. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  21624. }
  21625. // Set the Accepts header for the server, depending on the dataType
  21626. jqXHR.setRequestHeader(
  21627. "Accept",
  21628. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
  21629. s.accepts[ s.dataTypes[ 0 ] ] +
  21630. ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  21631. s.accepts[ "*" ]
  21632. );
  21633. // Check for headers option
  21634. for ( i in s.headers ) {
  21635. jqXHR.setRequestHeader( i, s.headers[ i ] );
  21636. }
  21637. // Allow custom headers/mimetypes and early abort
  21638. if ( s.beforeSend &&
  21639. ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) {
  21640. // Abort if not done already and return
  21641. return jqXHR.abort();
  21642. }
  21643. // Aborting is no longer a cancellation
  21644. strAbort = "abort";
  21645. // Install callbacks on deferreds
  21646. completeDeferred.add( s.complete );
  21647. jqXHR.done( s.success );
  21648. jqXHR.fail( s.error );
  21649. // Get transport
  21650. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  21651. // If no transport, we auto-abort
  21652. if ( !transport ) {
  21653. done( -1, "No Transport" );
  21654. } else {
  21655. jqXHR.readyState = 1;
  21656. // Send global event
  21657. if ( fireGlobals ) {
  21658. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  21659. }
  21660. // If request was aborted inside ajaxSend, stop there
  21661. if ( completed ) {
  21662. return jqXHR;
  21663. }
  21664. // Timeout
  21665. if ( s.async && s.timeout > 0 ) {
  21666. timeoutTimer = window.setTimeout( function() {
  21667. jqXHR.abort( "timeout" );
  21668. }, s.timeout );
  21669. }
  21670. try {
  21671. completed = false;
  21672. transport.send( requestHeaders, done );
  21673. } catch ( e ) {
  21674. // Rethrow post-completion exceptions
  21675. if ( completed ) {
  21676. throw e;
  21677. }
  21678. // Propagate others as results
  21679. done( -1, e );
  21680. }
  21681. }
  21682. // Callback for when everything is done
  21683. function done( status, nativeStatusText, responses, headers ) {
  21684. var isSuccess, success, error, response, modified,
  21685. statusText = nativeStatusText;
  21686. // Ignore repeat invocations
  21687. if ( completed ) {
  21688. return;
  21689. }
  21690. completed = true;
  21691. // Clear timeout if it exists
  21692. if ( timeoutTimer ) {
  21693. window.clearTimeout( timeoutTimer );
  21694. }
  21695. // Dereference transport for early garbage collection
  21696. // (no matter how long the jqXHR object will be used)
  21697. transport = undefined;
  21698. // Cache response headers
  21699. responseHeadersString = headers || "";
  21700. // Set readyState
  21701. jqXHR.readyState = status > 0 ? 4 : 0;
  21702. // Determine if successful
  21703. isSuccess = status >= 200 && status < 300 || status === 304;
  21704. // Get response data
  21705. if ( responses ) {
  21706. response = ajaxHandleResponses( s, jqXHR, responses );
  21707. }
  21708. // Use a noop converter for missing script
  21709. if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) {
  21710. s.converters[ "text script" ] = function() {};
  21711. }
  21712. // Convert no matter what (that way responseXXX fields are always set)
  21713. response = ajaxConvert( s, response, jqXHR, isSuccess );
  21714. // If successful, handle type chaining
  21715. if ( isSuccess ) {
  21716. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  21717. if ( s.ifModified ) {
  21718. modified = jqXHR.getResponseHeader( "Last-Modified" );
  21719. if ( modified ) {
  21720. jQuery.lastModified[ cacheURL ] = modified;
  21721. }
  21722. modified = jqXHR.getResponseHeader( "etag" );
  21723. if ( modified ) {
  21724. jQuery.etag[ cacheURL ] = modified;
  21725. }
  21726. }
  21727. // if no content
  21728. if ( status === 204 || s.type === "HEAD" ) {
  21729. statusText = "nocontent";
  21730. // if not modified
  21731. } else if ( status === 304 ) {
  21732. statusText = "notmodified";
  21733. // If we have data, let's convert it
  21734. } else {
  21735. statusText = response.state;
  21736. success = response.data;
  21737. error = response.error;
  21738. isSuccess = !error;
  21739. }
  21740. } else {
  21741. // Extract error from statusText and normalize for non-aborts
  21742. error = statusText;
  21743. if ( status || !statusText ) {
  21744. statusText = "error";
  21745. if ( status < 0 ) {
  21746. status = 0;
  21747. }
  21748. }
  21749. }
  21750. // Set data for the fake xhr object
  21751. jqXHR.status = status;
  21752. jqXHR.statusText = ( nativeStatusText || statusText ) + "";
  21753. // Success/Error
  21754. if ( isSuccess ) {
  21755. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  21756. } else {
  21757. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  21758. }
  21759. // Status-dependent callbacks
  21760. jqXHR.statusCode( statusCode );
  21761. statusCode = undefined;
  21762. if ( fireGlobals ) {
  21763. globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
  21764. [ jqXHR, s, isSuccess ? success : error ] );
  21765. }
  21766. // Complete
  21767. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  21768. if ( fireGlobals ) {
  21769. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  21770. // Handle the global AJAX counter
  21771. if ( !( --jQuery.active ) ) {
  21772. jQuery.event.trigger( "ajaxStop" );
  21773. }
  21774. }
  21775. }
  21776. return jqXHR;
  21777. },
  21778. getJSON: function( url, data, callback ) {
  21779. return jQuery.get( url, data, callback, "json" );
  21780. },
  21781. getScript: function( url, callback ) {
  21782. return jQuery.get( url, undefined, callback, "script" );
  21783. }
  21784. } );
  21785. jQuery.each( [ "get", "post" ], function( _i, method ) {
  21786. jQuery[ method ] = function( url, data, callback, type ) {
  21787. // Shift arguments if data argument was omitted
  21788. if ( isFunction( data ) ) {
  21789. type = type || callback;
  21790. callback = data;
  21791. data = undefined;
  21792. }
  21793. // The url can be an options object (which then must have .url)
  21794. return jQuery.ajax( jQuery.extend( {
  21795. url: url,
  21796. type: method,
  21797. dataType: type,
  21798. data: data,
  21799. success: callback
  21800. }, jQuery.isPlainObject( url ) && url ) );
  21801. };
  21802. } );
  21803. jQuery.ajaxPrefilter( function( s ) {
  21804. var i;
  21805. for ( i in s.headers ) {
  21806. if ( i.toLowerCase() === "content-type" ) {
  21807. s.contentType = s.headers[ i ] || "";
  21808. }
  21809. }
  21810. } );
  21811. jQuery._evalUrl = function( url, options, doc ) {
  21812. return jQuery.ajax( {
  21813. url: url,
  21814. // Make this explicit, since user can override this through ajaxSetup (#11264)
  21815. type: "GET",
  21816. dataType: "script",
  21817. cache: true,
  21818. async: false,
  21819. global: false,
  21820. // Only evaluate the response if it is successful (gh-4126)
  21821. // dataFilter is not invoked for failure responses, so using it instead
  21822. // of the default converter is kludgy but it works.
  21823. converters: {
  21824. "text script": function() {}
  21825. },
  21826. dataFilter: function( response ) {
  21827. jQuery.globalEval( response, options, doc );
  21828. }
  21829. } );
  21830. };
  21831. jQuery.fn.extend( {
  21832. wrapAll: function( html ) {
  21833. var wrap;
  21834. if ( this[ 0 ] ) {
  21835. if ( isFunction( html ) ) {
  21836. html = html.call( this[ 0 ] );
  21837. }
  21838. // The elements to wrap the target around
  21839. wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
  21840. if ( this[ 0 ].parentNode ) {
  21841. wrap.insertBefore( this[ 0 ] );
  21842. }
  21843. wrap.map( function() {
  21844. var elem = this;
  21845. while ( elem.firstElementChild ) {
  21846. elem = elem.firstElementChild;
  21847. }
  21848. return elem;
  21849. } ).append( this );
  21850. }
  21851. return this;
  21852. },
  21853. wrapInner: function( html ) {
  21854. if ( isFunction( html ) ) {
  21855. return this.each( function( i ) {
  21856. jQuery( this ).wrapInner( html.call( this, i ) );
  21857. } );
  21858. }
  21859. return this.each( function() {
  21860. var self = jQuery( this ),
  21861. contents = self.contents();
  21862. if ( contents.length ) {
  21863. contents.wrapAll( html );
  21864. } else {
  21865. self.append( html );
  21866. }
  21867. } );
  21868. },
  21869. wrap: function( html ) {
  21870. var htmlIsFunction = isFunction( html );
  21871. return this.each( function( i ) {
  21872. jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html );
  21873. } );
  21874. },
  21875. unwrap: function( selector ) {
  21876. this.parent( selector ).not( "body" ).each( function() {
  21877. jQuery( this ).replaceWith( this.childNodes );
  21878. } );
  21879. return this;
  21880. }
  21881. } );
  21882. jQuery.expr.pseudos.hidden = function( elem ) {
  21883. return !jQuery.expr.pseudos.visible( elem );
  21884. };
  21885. jQuery.expr.pseudos.visible = function( elem ) {
  21886. return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length );
  21887. };
  21888. jQuery.ajaxSettings.xhr = function() {
  21889. try {
  21890. return new window.XMLHttpRequest();
  21891. } catch ( e ) {}
  21892. };
  21893. var xhrSuccessStatus = {
  21894. // File protocol always yields status code 0, assume 200
  21895. 0: 200,
  21896. // Support: IE <=9 only
  21897. // #1450: sometimes IE returns 1223 when it should be 204
  21898. 1223: 204
  21899. },
  21900. xhrSupported = jQuery.ajaxSettings.xhr();
  21901. support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
  21902. support.ajax = xhrSupported = !!xhrSupported;
  21903. jQuery.ajaxTransport( function( options ) {
  21904. var callback, errorCallback;
  21905. // Cross domain only allowed if supported through XMLHttpRequest
  21906. if ( support.cors || xhrSupported && !options.crossDomain ) {
  21907. return {
  21908. send: function( headers, complete ) {
  21909. var i,
  21910. xhr = options.xhr();
  21911. xhr.open(
  21912. options.type,
  21913. options.url,
  21914. options.async,
  21915. options.username,
  21916. options.password
  21917. );
  21918. // Apply custom fields if provided
  21919. if ( options.xhrFields ) {
  21920. for ( i in options.xhrFields ) {
  21921. xhr[ i ] = options.xhrFields[ i ];
  21922. }
  21923. }
  21924. // Override mime type if needed
  21925. if ( options.mimeType && xhr.overrideMimeType ) {
  21926. xhr.overrideMimeType( options.mimeType );
  21927. }
  21928. // X-Requested-With header
  21929. // For cross-domain requests, seeing as conditions for a preflight are
  21930. // akin to a jigsaw puzzle, we simply never set it to be sure.
  21931. // (it can always be set on a per-request basis or even using ajaxSetup)
  21932. // For same-domain requests, won't change header if already provided.
  21933. if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
  21934. headers[ "X-Requested-With" ] = "XMLHttpRequest";
  21935. }
  21936. // Set headers
  21937. for ( i in headers ) {
  21938. xhr.setRequestHeader( i, headers[ i ] );
  21939. }
  21940. // Callback
  21941. callback = function( type ) {
  21942. return function() {
  21943. if ( callback ) {
  21944. callback = errorCallback = xhr.onload =
  21945. xhr.onerror = xhr.onabort = xhr.ontimeout =
  21946. xhr.onreadystatechange = null;
  21947. if ( type === "abort" ) {
  21948. xhr.abort();
  21949. } else if ( type === "error" ) {
  21950. // Support: IE <=9 only
  21951. // On a manual native abort, IE9 throws
  21952. // errors on any property access that is not readyState
  21953. if ( typeof xhr.status !== "number" ) {
  21954. complete( 0, "error" );
  21955. } else {
  21956. complete(
  21957. // File: protocol always yields status 0; see #8605, #14207
  21958. xhr.status,
  21959. xhr.statusText
  21960. );
  21961. }
  21962. } else {
  21963. complete(
  21964. xhrSuccessStatus[ xhr.status ] || xhr.status,
  21965. xhr.statusText,
  21966. // Support: IE <=9 only
  21967. // IE9 has no XHR2 but throws on binary (trac-11426)
  21968. // For XHR2 non-text, let the caller handle it (gh-2498)
  21969. ( xhr.responseType || "text" ) !== "text" ||
  21970. typeof xhr.responseText !== "string" ?
  21971. { binary: xhr.response } :
  21972. { text: xhr.responseText },
  21973. xhr.getAllResponseHeaders()
  21974. );
  21975. }
  21976. }
  21977. };
  21978. };
  21979. // Listen to events
  21980. xhr.onload = callback();
  21981. errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" );
  21982. // Support: IE 9 only
  21983. // Use onreadystatechange to replace onabort
  21984. // to handle uncaught aborts
  21985. if ( xhr.onabort !== undefined ) {
  21986. xhr.onabort = errorCallback;
  21987. } else {
  21988. xhr.onreadystatechange = function() {
  21989. // Check readyState before timeout as it changes
  21990. if ( xhr.readyState === 4 ) {
  21991. // Allow onerror to be called first,
  21992. // but that will not handle a native abort
  21993. // Also, save errorCallback to a variable
  21994. // as xhr.onerror cannot be accessed
  21995. window.setTimeout( function() {
  21996. if ( callback ) {
  21997. errorCallback();
  21998. }
  21999. } );
  22000. }
  22001. };
  22002. }
  22003. // Create the abort callback
  22004. callback = callback( "abort" );
  22005. try {
  22006. // Do send the request (this may raise an exception)
  22007. xhr.send( options.hasContent && options.data || null );
  22008. } catch ( e ) {
  22009. // #14683: Only rethrow if this hasn't been notified as an error yet
  22010. if ( callback ) {
  22011. throw e;
  22012. }
  22013. }
  22014. },
  22015. abort: function() {
  22016. if ( callback ) {
  22017. callback();
  22018. }
  22019. }
  22020. };
  22021. }
  22022. } );
  22023. // Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
  22024. jQuery.ajaxPrefilter( function( s ) {
  22025. if ( s.crossDomain ) {
  22026. s.contents.script = false;
  22027. }
  22028. } );
  22029. // Install script dataType
  22030. jQuery.ajaxSetup( {
  22031. accepts: {
  22032. script: "text/javascript, application/javascript, " +
  22033. "application/ecmascript, application/x-ecmascript"
  22034. },
  22035. contents: {
  22036. script: /\b(?:java|ecma)script\b/
  22037. },
  22038. converters: {
  22039. "text script": function( text ) {
  22040. jQuery.globalEval( text );
  22041. return text;
  22042. }
  22043. }
  22044. } );
  22045. // Handle cache's special case and crossDomain
  22046. jQuery.ajaxPrefilter( "script", function( s ) {
  22047. if ( s.cache === undefined ) {
  22048. s.cache = false;
  22049. }
  22050. if ( s.crossDomain ) {
  22051. s.type = "GET";
  22052. }
  22053. } );
  22054. // Bind script tag hack transport
  22055. jQuery.ajaxTransport( "script", function( s ) {
  22056. // This transport only deals with cross domain or forced-by-attrs requests
  22057. if ( s.crossDomain || s.scriptAttrs ) {
  22058. var script, callback;
  22059. return {
  22060. send: function( _, complete ) {
  22061. script = jQuery( "<script>" )
  22062. .attr( s.scriptAttrs || {} )
  22063. .prop( { charset: s.scriptCharset, src: s.url } )
  22064. .on( "load error", callback = function( evt ) {
  22065. script.remove();
  22066. callback = null;
  22067. if ( evt ) {
  22068. complete( evt.type === "error" ? 404 : 200, evt.type );
  22069. }
  22070. } );
  22071. // Use native DOM manipulation to avoid our domManip AJAX trickery
  22072. document.head.appendChild( script[ 0 ] );
  22073. },
  22074. abort: function() {
  22075. if ( callback ) {
  22076. callback();
  22077. }
  22078. }
  22079. };
  22080. }
  22081. } );
  22082. var oldCallbacks = [],
  22083. rjsonp = /(=)\?(?=&|$)|\?\?/;
  22084. // Default jsonp settings
  22085. jQuery.ajaxSetup( {
  22086. jsonp: "callback",
  22087. jsonpCallback: function() {
  22088. var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) );
  22089. this[ callback ] = true;
  22090. return callback;
  22091. }
  22092. } );
  22093. // Detect, normalize options and install callbacks for jsonp requests
  22094. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  22095. var callbackName, overwritten, responseContainer,
  22096. jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
  22097. "url" :
  22098. typeof s.data === "string" &&
  22099. ( s.contentType || "" )
  22100. .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
  22101. rjsonp.test( s.data ) && "data"
  22102. );
  22103. // Handle iff the expected data type is "jsonp" or we have a parameter to set
  22104. if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
  22105. // Get callback name, remembering preexisting value associated with it
  22106. callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ?
  22107. s.jsonpCallback() :
  22108. s.jsonpCallback;
  22109. // Insert callback into url or form data
  22110. if ( jsonProp ) {
  22111. s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
  22112. } else if ( s.jsonp !== false ) {
  22113. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
  22114. }
  22115. // Use data converter to retrieve json after script execution
  22116. s.converters[ "script json" ] = function() {
  22117. if ( !responseContainer ) {
  22118. jQuery.error( callbackName + " was not called" );
  22119. }
  22120. return responseContainer[ 0 ];
  22121. };
  22122. // Force json dataType
  22123. s.dataTypes[ 0 ] = "json";
  22124. // Install callback
  22125. overwritten = window[ callbackName ];
  22126. window[ callbackName ] = function() {
  22127. responseContainer = arguments;
  22128. };
  22129. // Clean-up function (fires after converters)
  22130. jqXHR.always( function() {
  22131. // If previous value didn't exist - remove it
  22132. if ( overwritten === undefined ) {
  22133. jQuery( window ).removeProp( callbackName );
  22134. // Otherwise restore preexisting value
  22135. } else {
  22136. window[ callbackName ] = overwritten;
  22137. }
  22138. // Save back as free
  22139. if ( s[ callbackName ] ) {
  22140. // Make sure that re-using the options doesn't screw things around
  22141. s.jsonpCallback = originalSettings.jsonpCallback;
  22142. // Save the callback name for future use
  22143. oldCallbacks.push( callbackName );
  22144. }
  22145. // Call if it was a function and we have a response
  22146. if ( responseContainer && isFunction( overwritten ) ) {
  22147. overwritten( responseContainer[ 0 ] );
  22148. }
  22149. responseContainer = overwritten = undefined;
  22150. } );
  22151. // Delegate to script
  22152. return "script";
  22153. }
  22154. } );
  22155. // Support: Safari 8 only
  22156. // In Safari 8 documents created via document.implementation.createHTMLDocument
  22157. // collapse sibling forms: the second one becomes a child of the first one.
  22158. // Because of that, this security measure has to be disabled in Safari 8.
  22159. // https://bugs.webkit.org/show_bug.cgi?id=137337
  22160. support.createHTMLDocument = ( function() {
  22161. var body = document.implementation.createHTMLDocument( "" ).body;
  22162. body.innerHTML = "<form></form><form></form>";
  22163. return body.childNodes.length === 2;
  22164. } )();
  22165. // Argument "data" should be string of html
  22166. // context (optional): If specified, the fragment will be created in this context,
  22167. // defaults to document
  22168. // keepScripts (optional): If true, will include scripts passed in the html string
  22169. jQuery.parseHTML = function( data, context, keepScripts ) {
  22170. if ( typeof data !== "string" ) {
  22171. return [];
  22172. }
  22173. if ( typeof context === "boolean" ) {
  22174. keepScripts = context;
  22175. context = false;
  22176. }
  22177. var base, parsed, scripts;
  22178. if ( !context ) {
  22179. // Stop scripts or inline event handlers from being executed immediately
  22180. // by using document.implementation
  22181. if ( support.createHTMLDocument ) {
  22182. context = document.implementation.createHTMLDocument( "" );
  22183. // Set the base href for the created document
  22184. // so any parsed elements with URLs
  22185. // are based on the document's URL (gh-2965)
  22186. base = context.createElement( "base" );
  22187. base.href = document.location.href;
  22188. context.head.appendChild( base );
  22189. } else {
  22190. context = document;
  22191. }
  22192. }
  22193. parsed = rsingleTag.exec( data );
  22194. scripts = !keepScripts && [];
  22195. // Single tag
  22196. if ( parsed ) {
  22197. return [ context.createElement( parsed[ 1 ] ) ];
  22198. }
  22199. parsed = buildFragment( [ data ], context, scripts );
  22200. if ( scripts && scripts.length ) {
  22201. jQuery( scripts ).remove();
  22202. }
  22203. return jQuery.merge( [], parsed.childNodes );
  22204. };
  22205. /**
  22206. * Load a url into a page
  22207. */
  22208. jQuery.fn.load = function( url, params, callback ) {
  22209. var selector, type, response,
  22210. self = this,
  22211. off = url.indexOf( " " );
  22212. if ( off > -1 ) {
  22213. selector = stripAndCollapse( url.slice( off ) );
  22214. url = url.slice( 0, off );
  22215. }
  22216. // If it's a function
  22217. if ( isFunction( params ) ) {
  22218. // We assume that it's the callback
  22219. callback = params;
  22220. params = undefined;
  22221. // Otherwise, build a param string
  22222. } else if ( params && typeof params === "object" ) {
  22223. type = "POST";
  22224. }
  22225. // If we have elements to modify, make the request
  22226. if ( self.length > 0 ) {
  22227. jQuery.ajax( {
  22228. url: url,
  22229. // If "type" variable is undefined, then "GET" method will be used.
  22230. // Make value of this field explicit since
  22231. // user can override it through ajaxSetup method
  22232. type: type || "GET",
  22233. dataType: "html",
  22234. data: params
  22235. } ).done( function( responseText ) {
  22236. // Save response for use in complete callback
  22237. response = arguments;
  22238. self.html( selector ?
  22239. // If a selector was specified, locate the right elements in a dummy div
  22240. // Exclude scripts to avoid IE 'Permission Denied' errors
  22241. jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
  22242. // Otherwise use the full result
  22243. responseText );
  22244. // If the request succeeds, this function gets "data", "status", "jqXHR"
  22245. // but they are ignored because response was set above.
  22246. // If it fails, this function gets "jqXHR", "status", "error"
  22247. } ).always( callback && function( jqXHR, status ) {
  22248. self.each( function() {
  22249. callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
  22250. } );
  22251. } );
  22252. }
  22253. return this;
  22254. };
  22255. jQuery.expr.pseudos.animated = function( elem ) {
  22256. return jQuery.grep( jQuery.timers, function( fn ) {
  22257. return elem === fn.elem;
  22258. } ).length;
  22259. };
  22260. jQuery.offset = {
  22261. setOffset: function( elem, options, i ) {
  22262. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  22263. position = jQuery.css( elem, "position" ),
  22264. curElem = jQuery( elem ),
  22265. props = {};
  22266. // Set position first, in-case top/left are set even on static elem
  22267. if ( position === "static" ) {
  22268. elem.style.position = "relative";
  22269. }
  22270. curOffset = curElem.offset();
  22271. curCSSTop = jQuery.css( elem, "top" );
  22272. curCSSLeft = jQuery.css( elem, "left" );
  22273. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  22274. ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
  22275. // Need to be able to calculate position if either
  22276. // top or left is auto and position is either absolute or fixed
  22277. if ( calculatePosition ) {
  22278. curPosition = curElem.position();
  22279. curTop = curPosition.top;
  22280. curLeft = curPosition.left;
  22281. } else {
  22282. curTop = parseFloat( curCSSTop ) || 0;
  22283. curLeft = parseFloat( curCSSLeft ) || 0;
  22284. }
  22285. if ( isFunction( options ) ) {
  22286. // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
  22287. options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
  22288. }
  22289. if ( options.top != null ) {
  22290. props.top = ( options.top - curOffset.top ) + curTop;
  22291. }
  22292. if ( options.left != null ) {
  22293. props.left = ( options.left - curOffset.left ) + curLeft;
  22294. }
  22295. if ( "using" in options ) {
  22296. options.using.call( elem, props );
  22297. } else {
  22298. if ( typeof props.top === "number" ) {
  22299. props.top += "px";
  22300. }
  22301. if ( typeof props.left === "number" ) {
  22302. props.left += "px";
  22303. }
  22304. curElem.css( props );
  22305. }
  22306. }
  22307. };
  22308. jQuery.fn.extend( {
  22309. // offset() relates an element's border box to the document origin
  22310. offset: function( options ) {
  22311. // Preserve chaining for setter
  22312. if ( arguments.length ) {
  22313. return options === undefined ?
  22314. this :
  22315. this.each( function( i ) {
  22316. jQuery.offset.setOffset( this, options, i );
  22317. } );
  22318. }
  22319. var rect, win,
  22320. elem = this[ 0 ];
  22321. if ( !elem ) {
  22322. return;
  22323. }
  22324. // Return zeros for disconnected and hidden (display: none) elements (gh-2310)
  22325. // Support: IE <=11 only
  22326. // Running getBoundingClientRect on a
  22327. // disconnected node in IE throws an error
  22328. if ( !elem.getClientRects().length ) {
  22329. return { top: 0, left: 0 };
  22330. }
  22331. // Get document-relative position by adding viewport scroll to viewport-relative gBCR
  22332. rect = elem.getBoundingClientRect();
  22333. win = elem.ownerDocument.defaultView;
  22334. return {
  22335. top: rect.top + win.pageYOffset,
  22336. left: rect.left + win.pageXOffset
  22337. };
  22338. },
  22339. // position() relates an element's margin box to its offset parent's padding box
  22340. // This corresponds to the behavior of CSS absolute positioning
  22341. position: function() {
  22342. if ( !this[ 0 ] ) {
  22343. return;
  22344. }
  22345. var offsetParent, offset, doc,
  22346. elem = this[ 0 ],
  22347. parentOffset = { top: 0, left: 0 };
  22348. // position:fixed elements are offset from the viewport, which itself always has zero offset
  22349. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  22350. // Assume position:fixed implies availability of getBoundingClientRect
  22351. offset = elem.getBoundingClientRect();
  22352. } else {
  22353. offset = this.offset();
  22354. // Account for the *real* offset parent, which can be the document or its root element
  22355. // when a statically positioned element is identified
  22356. doc = elem.ownerDocument;
  22357. offsetParent = elem.offsetParent || doc.documentElement;
  22358. while ( offsetParent &&
  22359. ( offsetParent === doc.body || offsetParent === doc.documentElement ) &&
  22360. jQuery.css( offsetParent, "position" ) === "static" ) {
  22361. offsetParent = offsetParent.parentNode;
  22362. }
  22363. if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) {
  22364. // Incorporate borders into its offset, since they are outside its content origin
  22365. parentOffset = jQuery( offsetParent ).offset();
  22366. parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true );
  22367. parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true );
  22368. }
  22369. }
  22370. // Subtract parent offsets and element margins
  22371. return {
  22372. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  22373. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
  22374. };
  22375. },
  22376. // This method will return documentElement in the following cases:
  22377. // 1) For the element inside the iframe without offsetParent, this method will return
  22378. // documentElement of the parent window
  22379. // 2) For the hidden or detached element
  22380. // 3) For body or html element, i.e. in case of the html node - it will return itself
  22381. //
  22382. // but those exceptions were never presented as a real life use-cases
  22383. // and might be considered as more preferable results.
  22384. //
  22385. // This logic, however, is not guaranteed and can change at any point in the future
  22386. offsetParent: function() {
  22387. return this.map( function() {
  22388. var offsetParent = this.offsetParent;
  22389. while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
  22390. offsetParent = offsetParent.offsetParent;
  22391. }
  22392. return offsetParent || documentElement;
  22393. } );
  22394. }
  22395. } );
  22396. // Create scrollLeft and scrollTop methods
  22397. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  22398. var top = "pageYOffset" === prop;
  22399. jQuery.fn[ method ] = function( val ) {
  22400. return access( this, function( elem, method, val ) {
  22401. // Coalesce documents and windows
  22402. var win;
  22403. if ( isWindow( elem ) ) {
  22404. win = elem;
  22405. } else if ( elem.nodeType === 9 ) {
  22406. win = elem.defaultView;
  22407. }
  22408. if ( val === undefined ) {
  22409. return win ? win[ prop ] : elem[ method ];
  22410. }
  22411. if ( win ) {
  22412. win.scrollTo(
  22413. !top ? val : win.pageXOffset,
  22414. top ? val : win.pageYOffset
  22415. );
  22416. } else {
  22417. elem[ method ] = val;
  22418. }
  22419. }, method, val, arguments.length );
  22420. };
  22421. } );
  22422. // Support: Safari <=7 - 9.1, Chrome <=37 - 49
  22423. // Add the top/left cssHooks using jQuery.fn.position
  22424. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  22425. // Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
  22426. // getComputedStyle returns percent when specified for top/left/bottom/right;
  22427. // rather than make the css module depend on the offset module, just check for it here
  22428. jQuery.each( [ "top", "left" ], function( _i, prop ) {
  22429. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  22430. function( elem, computed ) {
  22431. if ( computed ) {
  22432. computed = curCSS( elem, prop );
  22433. // If curCSS returns percentage, fallback to offset
  22434. return rnumnonpx.test( computed ) ?
  22435. jQuery( elem ).position()[ prop ] + "px" :
  22436. computed;
  22437. }
  22438. }
  22439. );
  22440. } );
  22441. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  22442. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  22443. jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
  22444. function( defaultExtra, funcName ) {
  22445. // Margin is only for outerHeight, outerWidth
  22446. jQuery.fn[ funcName ] = function( margin, value ) {
  22447. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  22448. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  22449. return access( this, function( elem, type, value ) {
  22450. var doc;
  22451. if ( isWindow( elem ) ) {
  22452. // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729)
  22453. return funcName.indexOf( "outer" ) === 0 ?
  22454. elem[ "inner" + name ] :
  22455. elem.document.documentElement[ "client" + name ];
  22456. }
  22457. // Get document width or height
  22458. if ( elem.nodeType === 9 ) {
  22459. doc = elem.documentElement;
  22460. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
  22461. // whichever is greatest
  22462. return Math.max(
  22463. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  22464. elem.body[ "offset" + name ], doc[ "offset" + name ],
  22465. doc[ "client" + name ]
  22466. );
  22467. }
  22468. return value === undefined ?
  22469. // Get width or height on the element, requesting but not forcing parseFloat
  22470. jQuery.css( elem, type, extra ) :
  22471. // Set width or height on the element
  22472. jQuery.style( elem, type, value, extra );
  22473. }, type, chainable ? margin : undefined, chainable );
  22474. };
  22475. } );
  22476. } );
  22477. jQuery.each( [
  22478. "ajaxStart",
  22479. "ajaxStop",
  22480. "ajaxComplete",
  22481. "ajaxError",
  22482. "ajaxSuccess",
  22483. "ajaxSend"
  22484. ], function( _i, type ) {
  22485. jQuery.fn[ type ] = function( fn ) {
  22486. return this.on( type, fn );
  22487. };
  22488. } );
  22489. jQuery.fn.extend( {
  22490. bind: function( types, data, fn ) {
  22491. return this.on( types, null, data, fn );
  22492. },
  22493. unbind: function( types, fn ) {
  22494. return this.off( types, null, fn );
  22495. },
  22496. delegate: function( selector, types, data, fn ) {
  22497. return this.on( types, selector, data, fn );
  22498. },
  22499. undelegate: function( selector, types, fn ) {
  22500. // ( namespace ) or ( selector, types [, fn] )
  22501. return arguments.length === 1 ?
  22502. this.off( selector, "**" ) :
  22503. this.off( types, selector || "**", fn );
  22504. },
  22505. hover: function( fnOver, fnOut ) {
  22506. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  22507. }
  22508. } );
  22509. jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
  22510. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  22511. "change select submit keydown keypress keyup contextmenu" ).split( " " ),
  22512. function( _i, name ) {
  22513. // Handle event binding
  22514. jQuery.fn[ name ] = function( data, fn ) {
  22515. return arguments.length > 0 ?
  22516. this.on( name, null, data, fn ) :
  22517. this.trigger( name );
  22518. };
  22519. } );
  22520. // Support: Android <=4.0 only
  22521. // Make sure we trim BOM and NBSP
  22522. var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
  22523. // Bind a function to a context, optionally partially applying any
  22524. // arguments.
  22525. // jQuery.proxy is deprecated to promote standards (specifically Function#bind)
  22526. // However, it is not slated for removal any time soon
  22527. jQuery.proxy = function( fn, context ) {
  22528. var tmp, args, proxy;
  22529. if ( typeof context === "string" ) {
  22530. tmp = fn[ context ];
  22531. context = fn;
  22532. fn = tmp;
  22533. }
  22534. // Quick check to determine if target is callable, in the spec
  22535. // this throws a TypeError, but we will just return undefined.
  22536. if ( !isFunction( fn ) ) {
  22537. return undefined;
  22538. }
  22539. // Simulated bind
  22540. args = slice.call( arguments, 2 );
  22541. proxy = function() {
  22542. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  22543. };
  22544. // Set the guid of unique handler to the same of original handler, so it can be removed
  22545. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  22546. return proxy;
  22547. };
  22548. jQuery.holdReady = function( hold ) {
  22549. if ( hold ) {
  22550. jQuery.readyWait++;
  22551. } else {
  22552. jQuery.ready( true );
  22553. }
  22554. };
  22555. jQuery.isArray = Array.isArray;
  22556. jQuery.parseJSON = JSON.parse;
  22557. jQuery.nodeName = nodeName;
  22558. jQuery.isFunction = isFunction;
  22559. jQuery.isWindow = isWindow;
  22560. jQuery.camelCase = camelCase;
  22561. jQuery.type = toType;
  22562. jQuery.now = Date.now;
  22563. jQuery.isNumeric = function( obj ) {
  22564. // As of jQuery 3.0, isNumeric is limited to
  22565. // strings and numbers (primitives or objects)
  22566. // that can be coerced to finite numbers (gh-2662)
  22567. var type = jQuery.type( obj );
  22568. return ( type === "number" || type === "string" ) &&
  22569. // parseFloat NaNs numeric-cast false positives ("")
  22570. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  22571. // subtraction forces infinities to NaN
  22572. !isNaN( obj - parseFloat( obj ) );
  22573. };
  22574. jQuery.trim = function( text ) {
  22575. return text == null ?
  22576. "" :
  22577. ( text + "" ).replace( rtrim, "" );
  22578. };
  22579. // Register as a named AMD module, since jQuery can be concatenated with other
  22580. // files that may use define, but not via a proper concatenation script that
  22581. // understands anonymous AMD modules. A named AMD is safest and most robust
  22582. // way to register. Lowercase jquery is used because AMD module names are
  22583. // derived from file names, and jQuery is normally delivered in a lowercase
  22584. // file name. Do this after creating the global so that if an AMD module wants
  22585. // to call noConflict to hide this version of jQuery, it will work.
  22586. // Note that for maximum portability, libraries that are not jQuery should
  22587. // declare themselves as anonymous modules, and avoid setting a global if an
  22588. // AMD loader is present. jQuery is a special case. For more information, see
  22589. // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
  22590. if ( true ) {
  22591. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  22592. return jQuery;
  22593. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  22594. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  22595. }
  22596. var
  22597. // Map over jQuery in case of overwrite
  22598. _jQuery = window.jQuery,
  22599. // Map over the $ in case of overwrite
  22600. _$ = window.$;
  22601. jQuery.noConflict = function( deep ) {
  22602. if ( window.$ === jQuery ) {
  22603. window.$ = _$;
  22604. }
  22605. if ( deep && window.jQuery === jQuery ) {
  22606. window.jQuery = _jQuery;
  22607. }
  22608. return jQuery;
  22609. };
  22610. // Expose jQuery and $ identifiers, even in AMD
  22611. // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
  22612. // and CommonJS for browser emulators (#13566)
  22613. if ( typeof noGlobal === "undefined" ) {
  22614. window.jQuery = window.$ = jQuery;
  22615. }
  22616. return jQuery;
  22617. } );
  22618. /***/ }),
  22619. /***/ "./node_modules/js-cookie/src/js.cookie.js":
  22620. /*!*************************************************!*\
  22621. !*** ./node_modules/js-cookie/src/js.cookie.js ***!
  22622. \*************************************************/
  22623. /*! no static exports found */
  22624. /***/ (function(module, exports, __webpack_require__) {
  22625. var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  22626. * JavaScript Cookie v2.2.1
  22627. * https://github.com/js-cookie/js-cookie
  22628. *
  22629. * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
  22630. * Released under the MIT license
  22631. */
  22632. ;(function (factory) {
  22633. var registeredInModuleLoader;
  22634. if (true) {
  22635. !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
  22636. __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  22637. (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :
  22638. __WEBPACK_AMD_DEFINE_FACTORY__),
  22639. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  22640. registeredInModuleLoader = true;
  22641. }
  22642. if (true) {
  22643. module.exports = factory();
  22644. registeredInModuleLoader = true;
  22645. }
  22646. if (!registeredInModuleLoader) {
  22647. var OldCookies = window.Cookies;
  22648. var api = window.Cookies = factory();
  22649. api.noConflict = function () {
  22650. window.Cookies = OldCookies;
  22651. return api;
  22652. };
  22653. }
  22654. }(function () {
  22655. function extend () {
  22656. var i = 0;
  22657. var result = {};
  22658. for (; i < arguments.length; i++) {
  22659. var attributes = arguments[ i ];
  22660. for (var key in attributes) {
  22661. result[key] = attributes[key];
  22662. }
  22663. }
  22664. return result;
  22665. }
  22666. function decode (s) {
  22667. return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
  22668. }
  22669. function init (converter) {
  22670. function api() {}
  22671. function set (key, value, attributes) {
  22672. if (typeof document === 'undefined') {
  22673. return;
  22674. }
  22675. attributes = extend({
  22676. path: '/'
  22677. }, api.defaults, attributes);
  22678. if (typeof attributes.expires === 'number') {
  22679. attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);
  22680. }
  22681. // We're using "expires" because "max-age" is not supported by IE
  22682. attributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';
  22683. try {
  22684. var result = JSON.stringify(value);
  22685. if (/^[\{\[]/.test(result)) {
  22686. value = result;
  22687. }
  22688. } catch (e) {}
  22689. value = converter.write ?
  22690. converter.write(value, key) :
  22691. encodeURIComponent(String(value))
  22692. .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
  22693. key = encodeURIComponent(String(key))
  22694. .replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)
  22695. .replace(/[\(\)]/g, escape);
  22696. var stringifiedAttributes = '';
  22697. for (var attributeName in attributes) {
  22698. if (!attributes[attributeName]) {
  22699. continue;
  22700. }
  22701. stringifiedAttributes += '; ' + attributeName;
  22702. if (attributes[attributeName] === true) {
  22703. continue;
  22704. }
  22705. // Considers RFC 6265 section 5.2:
  22706. // ...
  22707. // 3. If the remaining unparsed-attributes contains a %x3B (";")
  22708. // character:
  22709. // Consume the characters of the unparsed-attributes up to,
  22710. // not including, the first %x3B (";") character.
  22711. // ...
  22712. stringifiedAttributes += '=' + attributes[attributeName].split(';')[0];
  22713. }
  22714. return (document.cookie = key + '=' + value + stringifiedAttributes);
  22715. }
  22716. function get (key, json) {
  22717. if (typeof document === 'undefined') {
  22718. return;
  22719. }
  22720. var jar = {};
  22721. // To prevent the for loop in the first place assign an empty array
  22722. // in case there are no cookies at all.
  22723. var cookies = document.cookie ? document.cookie.split('; ') : [];
  22724. var i = 0;
  22725. for (; i < cookies.length; i++) {
  22726. var parts = cookies[i].split('=');
  22727. var cookie = parts.slice(1).join('=');
  22728. if (!json && cookie.charAt(0) === '"') {
  22729. cookie = cookie.slice(1, -1);
  22730. }
  22731. try {
  22732. var name = decode(parts[0]);
  22733. cookie = (converter.read || converter)(cookie, name) ||
  22734. decode(cookie);
  22735. if (json) {
  22736. try {
  22737. cookie = JSON.parse(cookie);
  22738. } catch (e) {}
  22739. }
  22740. jar[name] = cookie;
  22741. if (key === name) {
  22742. break;
  22743. }
  22744. } catch (e) {}
  22745. }
  22746. return key ? jar[key] : jar;
  22747. }
  22748. api.set = set;
  22749. api.get = function (key) {
  22750. return get(key, false /* read as raw */);
  22751. };
  22752. api.getJSON = function (key) {
  22753. return get(key, true /* read as json */);
  22754. };
  22755. api.remove = function (key, attributes) {
  22756. set(key, '', extend(attributes, {
  22757. expires: -1
  22758. }));
  22759. };
  22760. api.defaults = {};
  22761. api.withConverter = init;
  22762. return api;
  22763. }
  22764. return init(function () {});
  22765. }));
  22766. /***/ }),
  22767. /***/ "./node_modules/laravel-echo/dist/echo.js":
  22768. /*!************************************************!*\
  22769. !*** ./node_modules/laravel-echo/dist/echo.js ***!
  22770. \************************************************/
  22771. /*! exports provided: default */
  22772. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  22773. "use strict";
  22774. __webpack_require__.r(__webpack_exports__);
  22775. function _classCallCheck(instance, Constructor) {
  22776. if (!(instance instanceof Constructor)) {
  22777. throw new TypeError("Cannot call a class as a function");
  22778. }
  22779. }
  22780. function _defineProperties(target, props) {
  22781. for (var i = 0; i < props.length; i++) {
  22782. var descriptor = props[i];
  22783. descriptor.enumerable = descriptor.enumerable || false;
  22784. descriptor.configurable = true;
  22785. if ("value" in descriptor) descriptor.writable = true;
  22786. Object.defineProperty(target, descriptor.key, descriptor);
  22787. }
  22788. }
  22789. function _createClass(Constructor, protoProps, staticProps) {
  22790. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  22791. if (staticProps) _defineProperties(Constructor, staticProps);
  22792. return Constructor;
  22793. }
  22794. function _extends() {
  22795. _extends = Object.assign || function (target) {
  22796. for (var i = 1; i < arguments.length; i++) {
  22797. var source = arguments[i];
  22798. for (var key in source) {
  22799. if (Object.prototype.hasOwnProperty.call(source, key)) {
  22800. target[key] = source[key];
  22801. }
  22802. }
  22803. }
  22804. return target;
  22805. };
  22806. return _extends.apply(this, arguments);
  22807. }
  22808. function _inherits(subClass, superClass) {
  22809. if (typeof superClass !== "function" && superClass !== null) {
  22810. throw new TypeError("Super expression must either be null or a function");
  22811. }
  22812. subClass.prototype = Object.create(superClass && superClass.prototype, {
  22813. constructor: {
  22814. value: subClass,
  22815. writable: true,
  22816. configurable: true
  22817. }
  22818. });
  22819. if (superClass) _setPrototypeOf(subClass, superClass);
  22820. }
  22821. function _getPrototypeOf(o) {
  22822. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  22823. return o.__proto__ || Object.getPrototypeOf(o);
  22824. };
  22825. return _getPrototypeOf(o);
  22826. }
  22827. function _setPrototypeOf(o, p) {
  22828. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  22829. o.__proto__ = p;
  22830. return o;
  22831. };
  22832. return _setPrototypeOf(o, p);
  22833. }
  22834. function _isNativeReflectConstruct() {
  22835. if (typeof Reflect === "undefined" || !Reflect.construct) return false;
  22836. if (Reflect.construct.sham) return false;
  22837. if (typeof Proxy === "function") return true;
  22838. try {
  22839. Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
  22840. return true;
  22841. } catch (e) {
  22842. return false;
  22843. }
  22844. }
  22845. function _assertThisInitialized(self) {
  22846. if (self === void 0) {
  22847. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  22848. }
  22849. return self;
  22850. }
  22851. function _possibleConstructorReturn(self, call) {
  22852. if (call && (typeof call === "object" || typeof call === "function")) {
  22853. return call;
  22854. }
  22855. return _assertThisInitialized(self);
  22856. }
  22857. function _createSuper(Derived) {
  22858. var hasNativeReflectConstruct = _isNativeReflectConstruct();
  22859. return function () {
  22860. var Super = _getPrototypeOf(Derived),
  22861. result;
  22862. if (hasNativeReflectConstruct) {
  22863. var NewTarget = _getPrototypeOf(this).constructor;
  22864. result = Reflect.construct(Super, arguments, NewTarget);
  22865. } else {
  22866. result = Super.apply(this, arguments);
  22867. }
  22868. return _possibleConstructorReturn(this, result);
  22869. };
  22870. }
  22871. var Connector = /*#__PURE__*/function () {
  22872. /**
  22873. * Create a new class instance.
  22874. */
  22875. function Connector(options) {
  22876. _classCallCheck(this, Connector);
  22877. /**
  22878. * Default connector options.
  22879. */
  22880. this._defaultOptions = {
  22881. auth: {
  22882. headers: {}
  22883. },
  22884. authEndpoint: '/broadcasting/auth',
  22885. broadcaster: 'pusher',
  22886. csrfToken: null,
  22887. host: null,
  22888. key: null,
  22889. namespace: 'App.Events'
  22890. };
  22891. this.setOptions(options);
  22892. this.connect();
  22893. }
  22894. /**
  22895. * Merge the custom options with the defaults.
  22896. */
  22897. _createClass(Connector, [{
  22898. key: "setOptions",
  22899. value: function setOptions(options) {
  22900. this.options = _extends(this._defaultOptions, options);
  22901. if (this.csrfToken()) {
  22902. this.options.auth.headers['X-CSRF-TOKEN'] = this.csrfToken();
  22903. }
  22904. return options;
  22905. }
  22906. /**
  22907. * Extract the CSRF token from the page.
  22908. */
  22909. }, {
  22910. key: "csrfToken",
  22911. value: function csrfToken() {
  22912. var selector;
  22913. if (typeof window !== 'undefined' && window['Laravel'] && window['Laravel'].csrfToken) {
  22914. return window['Laravel'].csrfToken;
  22915. } else if (this.options.csrfToken) {
  22916. return this.options.csrfToken;
  22917. } else if (typeof document !== 'undefined' && typeof document.querySelector === 'function' && (selector = document.querySelector('meta[name="csrf-token"]'))) {
  22918. return selector.getAttribute('content');
  22919. }
  22920. return null;
  22921. }
  22922. }]);
  22923. return Connector;
  22924. }();
  22925. /**
  22926. * This class represents a basic channel.
  22927. */
  22928. var Channel = /*#__PURE__*/function () {
  22929. function Channel() {
  22930. _classCallCheck(this, Channel);
  22931. }
  22932. _createClass(Channel, [{
  22933. key: "listenForWhisper",
  22934. /**
  22935. * Listen for a whisper event on the channel instance.
  22936. */
  22937. value: function listenForWhisper(event, callback) {
  22938. return this.listen('.client-' + event, callback);
  22939. }
  22940. /**
  22941. * Listen for an event on the channel instance.
  22942. */
  22943. }, {
  22944. key: "notification",
  22945. value: function notification(callback) {
  22946. return this.listen('.Illuminate\\Notifications\\Events\\BroadcastNotificationCreated', callback);
  22947. }
  22948. /**
  22949. * Stop listening for a whispser event on the channel instance.
  22950. */
  22951. }, {
  22952. key: "stopListeningForWhisper",
  22953. value: function stopListeningForWhisper(event) {
  22954. return this.stopListening('.client-' + event);
  22955. }
  22956. }]);
  22957. return Channel;
  22958. }();
  22959. /**
  22960. * Event name formatter
  22961. */
  22962. var EventFormatter = /*#__PURE__*/function () {
  22963. /**
  22964. * Create a new class instance.
  22965. */
  22966. function EventFormatter(namespace) {
  22967. _classCallCheck(this, EventFormatter);
  22968. this.setNamespace(namespace);
  22969. }
  22970. /**
  22971. * Format the given event name.
  22972. */
  22973. _createClass(EventFormatter, [{
  22974. key: "format",
  22975. value: function format(event) {
  22976. if (event.charAt(0) === '.' || event.charAt(0) === '\\') {
  22977. return event.substr(1);
  22978. } else if (this.namespace) {
  22979. event = this.namespace + '.' + event;
  22980. }
  22981. return event.replace(/\./g, '\\');
  22982. }
  22983. /**
  22984. * Set the event namespace.
  22985. */
  22986. }, {
  22987. key: "setNamespace",
  22988. value: function setNamespace(value) {
  22989. this.namespace = value;
  22990. }
  22991. }]);
  22992. return EventFormatter;
  22993. }();
  22994. /**
  22995. * This class represents a Pusher channel.
  22996. */
  22997. var PusherChannel = /*#__PURE__*/function (_Channel) {
  22998. _inherits(PusherChannel, _Channel);
  22999. var _super = _createSuper(PusherChannel);
  23000. /**
  23001. * Create a new class instance.
  23002. */
  23003. function PusherChannel(pusher, name, options) {
  23004. var _this;
  23005. _classCallCheck(this, PusherChannel);
  23006. _this = _super.call(this);
  23007. _this.name = name;
  23008. _this.pusher = pusher;
  23009. _this.options = options;
  23010. _this.eventFormatter = new EventFormatter(_this.options.namespace);
  23011. _this.subscribe();
  23012. return _this;
  23013. }
  23014. /**
  23015. * Subscribe to a Pusher channel.
  23016. */
  23017. _createClass(PusherChannel, [{
  23018. key: "subscribe",
  23019. value: function subscribe() {
  23020. this.subscription = this.pusher.subscribe(this.name);
  23021. }
  23022. /**
  23023. * Unsubscribe from a Pusher channel.
  23024. */
  23025. }, {
  23026. key: "unsubscribe",
  23027. value: function unsubscribe() {
  23028. this.pusher.unsubscribe(this.name);
  23029. }
  23030. /**
  23031. * Listen for an event on the channel instance.
  23032. */
  23033. }, {
  23034. key: "listen",
  23035. value: function listen(event, callback) {
  23036. this.on(this.eventFormatter.format(event), callback);
  23037. return this;
  23038. }
  23039. /**
  23040. * Stop listening for an event on the channel instance.
  23041. */
  23042. }, {
  23043. key: "stopListening",
  23044. value: function stopListening(event) {
  23045. this.subscription.unbind(this.eventFormatter.format(event));
  23046. return this;
  23047. }
  23048. /**
  23049. * Bind a channel to an event.
  23050. */
  23051. }, {
  23052. key: "on",
  23053. value: function on(event, callback) {
  23054. this.subscription.bind(event, callback);
  23055. return this;
  23056. }
  23057. }]);
  23058. return PusherChannel;
  23059. }(Channel);
  23060. /**
  23061. * This class represents a Pusher private channel.
  23062. */
  23063. var PusherPrivateChannel = /*#__PURE__*/function (_PusherChannel) {
  23064. _inherits(PusherPrivateChannel, _PusherChannel);
  23065. var _super = _createSuper(PusherPrivateChannel);
  23066. function PusherPrivateChannel() {
  23067. _classCallCheck(this, PusherPrivateChannel);
  23068. return _super.apply(this, arguments);
  23069. }
  23070. _createClass(PusherPrivateChannel, [{
  23071. key: "whisper",
  23072. /**
  23073. * Trigger client event on the channel.
  23074. */
  23075. value: function whisper(eventName, data) {
  23076. this.pusher.channels.channels[this.name].trigger("client-".concat(eventName), data);
  23077. return this;
  23078. }
  23079. }]);
  23080. return PusherPrivateChannel;
  23081. }(PusherChannel);
  23082. /**
  23083. * This class represents a Pusher private channel.
  23084. */
  23085. var PusherEncryptedPrivateChannel = /*#__PURE__*/function (_PusherChannel) {
  23086. _inherits(PusherEncryptedPrivateChannel, _PusherChannel);
  23087. var _super = _createSuper(PusherEncryptedPrivateChannel);
  23088. function PusherEncryptedPrivateChannel() {
  23089. _classCallCheck(this, PusherEncryptedPrivateChannel);
  23090. return _super.apply(this, arguments);
  23091. }
  23092. _createClass(PusherEncryptedPrivateChannel, [{
  23093. key: "whisper",
  23094. /**
  23095. * Trigger client event on the channel.
  23096. */
  23097. value: function whisper(eventName, data) {
  23098. this.pusher.channels.channels[this.name].trigger("client-".concat(eventName), data);
  23099. return this;
  23100. }
  23101. }]);
  23102. return PusherEncryptedPrivateChannel;
  23103. }(PusherChannel);
  23104. /**
  23105. * This class represents a Pusher presence channel.
  23106. */
  23107. var PusherPresenceChannel = /*#__PURE__*/function (_PusherChannel) {
  23108. _inherits(PusherPresenceChannel, _PusherChannel);
  23109. var _super = _createSuper(PusherPresenceChannel);
  23110. function PusherPresenceChannel() {
  23111. _classCallCheck(this, PusherPresenceChannel);
  23112. return _super.apply(this, arguments);
  23113. }
  23114. _createClass(PusherPresenceChannel, [{
  23115. key: "here",
  23116. /**
  23117. * Register a callback to be called anytime the member list changes.
  23118. */
  23119. value: function here(callback) {
  23120. this.on('pusher:subscription_succeeded', function (data) {
  23121. callback(Object.keys(data.members).map(function (k) {
  23122. return data.members[k];
  23123. }));
  23124. });
  23125. return this;
  23126. }
  23127. /**
  23128. * Listen for someone joining the channel.
  23129. */
  23130. }, {
  23131. key: "joining",
  23132. value: function joining(callback) {
  23133. this.on('pusher:member_added', function (member) {
  23134. callback(member.info);
  23135. });
  23136. return this;
  23137. }
  23138. /**
  23139. * Listen for someone leaving the channel.
  23140. */
  23141. }, {
  23142. key: "leaving",
  23143. value: function leaving(callback) {
  23144. this.on('pusher:member_removed', function (member) {
  23145. callback(member.info);
  23146. });
  23147. return this;
  23148. }
  23149. /**
  23150. * Trigger client event on the channel.
  23151. */
  23152. }, {
  23153. key: "whisper",
  23154. value: function whisper(eventName, data) {
  23155. this.pusher.channels.channels[this.name].trigger("client-".concat(eventName), data);
  23156. return this;
  23157. }
  23158. }]);
  23159. return PusherPresenceChannel;
  23160. }(PusherChannel);
  23161. /**
  23162. * This class represents a Socket.io channel.
  23163. */
  23164. var SocketIoChannel = /*#__PURE__*/function (_Channel) {
  23165. _inherits(SocketIoChannel, _Channel);
  23166. var _super = _createSuper(SocketIoChannel);
  23167. /**
  23168. * Create a new class instance.
  23169. */
  23170. function SocketIoChannel(socket, name, options) {
  23171. var _this;
  23172. _classCallCheck(this, SocketIoChannel);
  23173. _this = _super.call(this);
  23174. /**
  23175. * The event callbacks applied to the channel.
  23176. */
  23177. _this.events = {};
  23178. _this.name = name;
  23179. _this.socket = socket;
  23180. _this.options = options;
  23181. _this.eventFormatter = new EventFormatter(_this.options.namespace);
  23182. _this.subscribe();
  23183. _this.configureReconnector();
  23184. return _this;
  23185. }
  23186. /**
  23187. * Subscribe to a Socket.io channel.
  23188. */
  23189. _createClass(SocketIoChannel, [{
  23190. key: "subscribe",
  23191. value: function subscribe() {
  23192. this.socket.emit('subscribe', {
  23193. channel: this.name,
  23194. auth: this.options.auth || {}
  23195. });
  23196. }
  23197. /**
  23198. * Unsubscribe from channel and ubind event callbacks.
  23199. */
  23200. }, {
  23201. key: "unsubscribe",
  23202. value: function unsubscribe() {
  23203. this.unbind();
  23204. this.socket.emit('unsubscribe', {
  23205. channel: this.name,
  23206. auth: this.options.auth || {}
  23207. });
  23208. }
  23209. /**
  23210. * Listen for an event on the channel instance.
  23211. */
  23212. }, {
  23213. key: "listen",
  23214. value: function listen(event, callback) {
  23215. this.on(this.eventFormatter.format(event), callback);
  23216. return this;
  23217. }
  23218. /**
  23219. * Stop listening for an event on the channel instance.
  23220. */
  23221. }, {
  23222. key: "stopListening",
  23223. value: function stopListening(event) {
  23224. var name = this.eventFormatter.format(event);
  23225. this.socket.removeListener(name);
  23226. delete this.events[name];
  23227. return this;
  23228. }
  23229. /**
  23230. * Bind the channel's socket to an event and store the callback.
  23231. */
  23232. }, {
  23233. key: "on",
  23234. value: function on(event, callback) {
  23235. var _this2 = this;
  23236. var listener = function listener(channel, data) {
  23237. if (_this2.name == channel) {
  23238. callback(data);
  23239. }
  23240. };
  23241. this.socket.on(event, listener);
  23242. this.bind(event, listener);
  23243. }
  23244. /**
  23245. * Attach a 'reconnect' listener and bind the event.
  23246. */
  23247. }, {
  23248. key: "configureReconnector",
  23249. value: function configureReconnector() {
  23250. var _this3 = this;
  23251. var listener = function listener() {
  23252. _this3.subscribe();
  23253. };
  23254. this.socket.on('reconnect', listener);
  23255. this.bind('reconnect', listener);
  23256. }
  23257. /**
  23258. * Bind the channel's socket to an event and store the callback.
  23259. */
  23260. }, {
  23261. key: "bind",
  23262. value: function bind(event, callback) {
  23263. this.events[event] = this.events[event] || [];
  23264. this.events[event].push(callback);
  23265. }
  23266. /**
  23267. * Unbind the channel's socket from all stored event callbacks.
  23268. */
  23269. }, {
  23270. key: "unbind",
  23271. value: function unbind() {
  23272. var _this4 = this;
  23273. Object.keys(this.events).forEach(function (event) {
  23274. _this4.events[event].forEach(function (callback) {
  23275. _this4.socket.removeListener(event, callback);
  23276. });
  23277. delete _this4.events[event];
  23278. });
  23279. }
  23280. }]);
  23281. return SocketIoChannel;
  23282. }(Channel);
  23283. /**
  23284. * This class represents a Socket.io presence channel.
  23285. */
  23286. var SocketIoPrivateChannel = /*#__PURE__*/function (_SocketIoChannel) {
  23287. _inherits(SocketIoPrivateChannel, _SocketIoChannel);
  23288. var _super = _createSuper(SocketIoPrivateChannel);
  23289. function SocketIoPrivateChannel() {
  23290. _classCallCheck(this, SocketIoPrivateChannel);
  23291. return _super.apply(this, arguments);
  23292. }
  23293. _createClass(SocketIoPrivateChannel, [{
  23294. key: "whisper",
  23295. /**
  23296. * Trigger client event on the channel.
  23297. */
  23298. value: function whisper(eventName, data) {
  23299. this.socket.emit('client event', {
  23300. channel: this.name,
  23301. event: "client-".concat(eventName),
  23302. data: data
  23303. });
  23304. return this;
  23305. }
  23306. }]);
  23307. return SocketIoPrivateChannel;
  23308. }(SocketIoChannel);
  23309. /**
  23310. * This class represents a Socket.io presence channel.
  23311. */
  23312. var SocketIoPresenceChannel = /*#__PURE__*/function (_SocketIoPrivateChann) {
  23313. _inherits(SocketIoPresenceChannel, _SocketIoPrivateChann);
  23314. var _super = _createSuper(SocketIoPresenceChannel);
  23315. function SocketIoPresenceChannel() {
  23316. _classCallCheck(this, SocketIoPresenceChannel);
  23317. return _super.apply(this, arguments);
  23318. }
  23319. _createClass(SocketIoPresenceChannel, [{
  23320. key: "here",
  23321. /**
  23322. * Register a callback to be called anytime the member list changes.
  23323. */
  23324. value: function here(callback) {
  23325. this.on('presence:subscribed', function (members) {
  23326. callback(members.map(function (m) {
  23327. return m.user_info;
  23328. }));
  23329. });
  23330. return this;
  23331. }
  23332. /**
  23333. * Listen for someone joining the channel.
  23334. */
  23335. }, {
  23336. key: "joining",
  23337. value: function joining(callback) {
  23338. this.on('presence:joining', function (member) {
  23339. return callback(member.user_info);
  23340. });
  23341. return this;
  23342. }
  23343. /**
  23344. * Listen for someone leaving the channel.
  23345. */
  23346. }, {
  23347. key: "leaving",
  23348. value: function leaving(callback) {
  23349. this.on('presence:leaving', function (member) {
  23350. return callback(member.user_info);
  23351. });
  23352. return this;
  23353. }
  23354. }]);
  23355. return SocketIoPresenceChannel;
  23356. }(SocketIoPrivateChannel);
  23357. /**
  23358. * This class represents a null channel.
  23359. */
  23360. var NullChannel = /*#__PURE__*/function (_Channel) {
  23361. _inherits(NullChannel, _Channel);
  23362. var _super = _createSuper(NullChannel);
  23363. function NullChannel() {
  23364. _classCallCheck(this, NullChannel);
  23365. return _super.apply(this, arguments);
  23366. }
  23367. _createClass(NullChannel, [{
  23368. key: "subscribe",
  23369. /**
  23370. * Subscribe to a channel.
  23371. */
  23372. value: function subscribe() {} //
  23373. /**
  23374. * Unsubscribe from a channel.
  23375. */
  23376. }, {
  23377. key: "unsubscribe",
  23378. value: function unsubscribe() {} //
  23379. /**
  23380. * Listen for an event on the channel instance.
  23381. */
  23382. }, {
  23383. key: "listen",
  23384. value: function listen(event, callback) {
  23385. return this;
  23386. }
  23387. /**
  23388. * Stop listening for an event on the channel instance.
  23389. */
  23390. }, {
  23391. key: "stopListening",
  23392. value: function stopListening(event) {
  23393. return this;
  23394. }
  23395. /**
  23396. * Bind a channel to an event.
  23397. */
  23398. }, {
  23399. key: "on",
  23400. value: function on(event, callback) {
  23401. return this;
  23402. }
  23403. }]);
  23404. return NullChannel;
  23405. }(Channel);
  23406. /**
  23407. * This class represents a null private channel.
  23408. */
  23409. var NullPrivateChannel = /*#__PURE__*/function (_NullChannel) {
  23410. _inherits(NullPrivateChannel, _NullChannel);
  23411. var _super = _createSuper(NullPrivateChannel);
  23412. function NullPrivateChannel() {
  23413. _classCallCheck(this, NullPrivateChannel);
  23414. return _super.apply(this, arguments);
  23415. }
  23416. _createClass(NullPrivateChannel, [{
  23417. key: "whisper",
  23418. /**
  23419. * Trigger client event on the channel.
  23420. */
  23421. value: function whisper(eventName, data) {
  23422. return this;
  23423. }
  23424. }]);
  23425. return NullPrivateChannel;
  23426. }(NullChannel);
  23427. /**
  23428. * This class represents a null presence channel.
  23429. */
  23430. var NullPresenceChannel = /*#__PURE__*/function (_NullChannel) {
  23431. _inherits(NullPresenceChannel, _NullChannel);
  23432. var _super = _createSuper(NullPresenceChannel);
  23433. function NullPresenceChannel() {
  23434. _classCallCheck(this, NullPresenceChannel);
  23435. return _super.apply(this, arguments);
  23436. }
  23437. _createClass(NullPresenceChannel, [{
  23438. key: "here",
  23439. /**
  23440. * Register a callback to be called anytime the member list changes.
  23441. */
  23442. value: function here(callback) {
  23443. return this;
  23444. }
  23445. /**
  23446. * Listen for someone joining the channel.
  23447. */
  23448. }, {
  23449. key: "joining",
  23450. value: function joining(callback) {
  23451. return this;
  23452. }
  23453. /**
  23454. * Listen for someone leaving the channel.
  23455. */
  23456. }, {
  23457. key: "leaving",
  23458. value: function leaving(callback) {
  23459. return this;
  23460. }
  23461. /**
  23462. * Trigger client event on the channel.
  23463. */
  23464. }, {
  23465. key: "whisper",
  23466. value: function whisper(eventName, data) {
  23467. return this;
  23468. }
  23469. }]);
  23470. return NullPresenceChannel;
  23471. }(NullChannel);
  23472. /**
  23473. * This class creates a connector to Pusher.
  23474. */
  23475. var PusherConnector = /*#__PURE__*/function (_Connector) {
  23476. _inherits(PusherConnector, _Connector);
  23477. var _super = _createSuper(PusherConnector);
  23478. function PusherConnector() {
  23479. var _this;
  23480. _classCallCheck(this, PusherConnector);
  23481. _this = _super.apply(this, arguments);
  23482. /**
  23483. * All of the subscribed channel names.
  23484. */
  23485. _this.channels = {};
  23486. return _this;
  23487. }
  23488. /**
  23489. * Create a fresh Pusher connection.
  23490. */
  23491. _createClass(PusherConnector, [{
  23492. key: "connect",
  23493. value: function connect() {
  23494. if (typeof this.options.client !== 'undefined') {
  23495. this.pusher = this.options.client;
  23496. } else {
  23497. this.pusher = new Pusher(this.options.key, this.options);
  23498. }
  23499. }
  23500. /**
  23501. * Listen for an event on a channel instance.
  23502. */
  23503. }, {
  23504. key: "listen",
  23505. value: function listen(name, event, callback) {
  23506. return this.channel(name).listen(event, callback);
  23507. }
  23508. /**
  23509. * Get a channel instance by name.
  23510. */
  23511. }, {
  23512. key: "channel",
  23513. value: function channel(name) {
  23514. if (!this.channels[name]) {
  23515. this.channels[name] = new PusherChannel(this.pusher, name, this.options);
  23516. }
  23517. return this.channels[name];
  23518. }
  23519. /**
  23520. * Get a private channel instance by name.
  23521. */
  23522. }, {
  23523. key: "privateChannel",
  23524. value: function privateChannel(name) {
  23525. if (!this.channels['private-' + name]) {
  23526. this.channels['private-' + name] = new PusherPrivateChannel(this.pusher, 'private-' + name, this.options);
  23527. }
  23528. return this.channels['private-' + name];
  23529. }
  23530. /**
  23531. * Get a private encrypted channel instance by name.
  23532. */
  23533. }, {
  23534. key: "encryptedPrivateChannel",
  23535. value: function encryptedPrivateChannel(name) {
  23536. if (!this.channels['private-encrypted-' + name]) {
  23537. this.channels['private-encrypted-' + name] = new PusherEncryptedPrivateChannel(this.pusher, 'private-encrypted-' + name, this.options);
  23538. }
  23539. return this.channels['private-encrypted-' + name];
  23540. }
  23541. /**
  23542. * Get a presence channel instance by name.
  23543. */
  23544. }, {
  23545. key: "presenceChannel",
  23546. value: function presenceChannel(name) {
  23547. if (!this.channels['presence-' + name]) {
  23548. this.channels['presence-' + name] = new PusherPresenceChannel(this.pusher, 'presence-' + name, this.options);
  23549. }
  23550. return this.channels['presence-' + name];
  23551. }
  23552. /**
  23553. * Leave the given channel, as well as its private and presence variants.
  23554. */
  23555. }, {
  23556. key: "leave",
  23557. value: function leave(name) {
  23558. var _this2 = this;
  23559. var channels = [name, 'private-' + name, 'presence-' + name];
  23560. channels.forEach(function (name, index) {
  23561. _this2.leaveChannel(name);
  23562. });
  23563. }
  23564. /**
  23565. * Leave the given channel.
  23566. */
  23567. }, {
  23568. key: "leaveChannel",
  23569. value: function leaveChannel(name) {
  23570. if (this.channels[name]) {
  23571. this.channels[name].unsubscribe();
  23572. delete this.channels[name];
  23573. }
  23574. }
  23575. /**
  23576. * Get the socket ID for the connection.
  23577. */
  23578. }, {
  23579. key: "socketId",
  23580. value: function socketId() {
  23581. return this.pusher.connection.socket_id;
  23582. }
  23583. /**
  23584. * Disconnect Pusher connection.
  23585. */
  23586. }, {
  23587. key: "disconnect",
  23588. value: function disconnect() {
  23589. this.pusher.disconnect();
  23590. }
  23591. }]);
  23592. return PusherConnector;
  23593. }(Connector);
  23594. /**
  23595. * This class creates a connnector to a Socket.io server.
  23596. */
  23597. var SocketIoConnector = /*#__PURE__*/function (_Connector) {
  23598. _inherits(SocketIoConnector, _Connector);
  23599. var _super = _createSuper(SocketIoConnector);
  23600. function SocketIoConnector() {
  23601. var _this;
  23602. _classCallCheck(this, SocketIoConnector);
  23603. _this = _super.apply(this, arguments);
  23604. /**
  23605. * All of the subscribed channel names.
  23606. */
  23607. _this.channels = {};
  23608. return _this;
  23609. }
  23610. /**
  23611. * Create a fresh Socket.io connection.
  23612. */
  23613. _createClass(SocketIoConnector, [{
  23614. key: "connect",
  23615. value: function connect() {
  23616. var io = this.getSocketIO();
  23617. this.socket = io(this.options.host, this.options);
  23618. return this.socket;
  23619. }
  23620. /**
  23621. * Get socket.io module from global scope or options.
  23622. */
  23623. }, {
  23624. key: "getSocketIO",
  23625. value: function getSocketIO() {
  23626. if (typeof this.options.client !== 'undefined') {
  23627. return this.options.client;
  23628. }
  23629. if (typeof io !== 'undefined') {
  23630. return io;
  23631. }
  23632. throw new Error('Socket.io client not found. Should be globally available or passed via options.client');
  23633. }
  23634. /**
  23635. * Listen for an event on a channel instance.
  23636. */
  23637. }, {
  23638. key: "listen",
  23639. value: function listen(name, event, callback) {
  23640. return this.channel(name).listen(event, callback);
  23641. }
  23642. /**
  23643. * Get a channel instance by name.
  23644. */
  23645. }, {
  23646. key: "channel",
  23647. value: function channel(name) {
  23648. if (!this.channels[name]) {
  23649. this.channels[name] = new SocketIoChannel(this.socket, name, this.options);
  23650. }
  23651. return this.channels[name];
  23652. }
  23653. /**
  23654. * Get a private channel instance by name.
  23655. */
  23656. }, {
  23657. key: "privateChannel",
  23658. value: function privateChannel(name) {
  23659. if (!this.channels['private-' + name]) {
  23660. this.channels['private-' + name] = new SocketIoPrivateChannel(this.socket, 'private-' + name, this.options);
  23661. }
  23662. return this.channels['private-' + name];
  23663. }
  23664. /**
  23665. * Get a presence channel instance by name.
  23666. */
  23667. }, {
  23668. key: "presenceChannel",
  23669. value: function presenceChannel(name) {
  23670. if (!this.channels['presence-' + name]) {
  23671. this.channels['presence-' + name] = new SocketIoPresenceChannel(this.socket, 'presence-' + name, this.options);
  23672. }
  23673. return this.channels['presence-' + name];
  23674. }
  23675. /**
  23676. * Leave the given channel, as well as its private and presence variants.
  23677. */
  23678. }, {
  23679. key: "leave",
  23680. value: function leave(name) {
  23681. var _this2 = this;
  23682. var channels = [name, 'private-' + name, 'presence-' + name];
  23683. channels.forEach(function (name) {
  23684. _this2.leaveChannel(name);
  23685. });
  23686. }
  23687. /**
  23688. * Leave the given channel.
  23689. */
  23690. }, {
  23691. key: "leaveChannel",
  23692. value: function leaveChannel(name) {
  23693. if (this.channels[name]) {
  23694. this.channels[name].unsubscribe();
  23695. delete this.channels[name];
  23696. }
  23697. }
  23698. /**
  23699. * Get the socket ID for the connection.
  23700. */
  23701. }, {
  23702. key: "socketId",
  23703. value: function socketId() {
  23704. return this.socket.id;
  23705. }
  23706. /**
  23707. * Disconnect Socketio connection.
  23708. */
  23709. }, {
  23710. key: "disconnect",
  23711. value: function disconnect() {
  23712. this.socket.disconnect();
  23713. }
  23714. }]);
  23715. return SocketIoConnector;
  23716. }(Connector);
  23717. /**
  23718. * This class creates a null connector.
  23719. */
  23720. var NullConnector = /*#__PURE__*/function (_Connector) {
  23721. _inherits(NullConnector, _Connector);
  23722. var _super = _createSuper(NullConnector);
  23723. function NullConnector() {
  23724. var _this;
  23725. _classCallCheck(this, NullConnector);
  23726. _this = _super.apply(this, arguments);
  23727. /**
  23728. * All of the subscribed channel names.
  23729. */
  23730. _this.channels = {};
  23731. return _this;
  23732. }
  23733. /**
  23734. * Create a fresh connection.
  23735. */
  23736. _createClass(NullConnector, [{
  23737. key: "connect",
  23738. value: function connect() {} //
  23739. /**
  23740. * Listen for an event on a channel instance.
  23741. */
  23742. }, {
  23743. key: "listen",
  23744. value: function listen(name, event, callback) {
  23745. return new NullChannel();
  23746. }
  23747. /**
  23748. * Get a channel instance by name.
  23749. */
  23750. }, {
  23751. key: "channel",
  23752. value: function channel(name) {
  23753. return new NullChannel();
  23754. }
  23755. /**
  23756. * Get a private channel instance by name.
  23757. */
  23758. }, {
  23759. key: "privateChannel",
  23760. value: function privateChannel(name) {
  23761. return new NullPrivateChannel();
  23762. }
  23763. /**
  23764. * Get a presence channel instance by name.
  23765. */
  23766. }, {
  23767. key: "presenceChannel",
  23768. value: function presenceChannel(name) {
  23769. return new NullPresenceChannel();
  23770. }
  23771. /**
  23772. * Leave the given channel, as well as its private and presence variants.
  23773. */
  23774. }, {
  23775. key: "leave",
  23776. value: function leave(name) {} //
  23777. /**
  23778. * Leave the given channel.
  23779. */
  23780. }, {
  23781. key: "leaveChannel",
  23782. value: function leaveChannel(name) {} //
  23783. /**
  23784. * Get the socket ID for the connection.
  23785. */
  23786. }, {
  23787. key: "socketId",
  23788. value: function socketId() {
  23789. return 'fake-socket-id';
  23790. }
  23791. /**
  23792. * Disconnect the connection.
  23793. */
  23794. }, {
  23795. key: "disconnect",
  23796. value: function disconnect() {//
  23797. }
  23798. }]);
  23799. return NullConnector;
  23800. }(Connector);
  23801. /**
  23802. * This class is the primary API for interacting with broadcasting.
  23803. */
  23804. var Echo = /*#__PURE__*/function () {
  23805. /**
  23806. * Create a new class instance.
  23807. */
  23808. function Echo(options) {
  23809. _classCallCheck(this, Echo);
  23810. this.options = options;
  23811. this.connect();
  23812. if (!this.options.withoutInterceptors) {
  23813. this.registerInterceptors();
  23814. }
  23815. }
  23816. /**
  23817. * Get a channel instance by name.
  23818. */
  23819. _createClass(Echo, [{
  23820. key: "channel",
  23821. value: function channel(_channel) {
  23822. return this.connector.channel(_channel);
  23823. }
  23824. /**
  23825. * Create a new connection.
  23826. */
  23827. }, {
  23828. key: "connect",
  23829. value: function connect() {
  23830. if (this.options.broadcaster == 'pusher') {
  23831. this.connector = new PusherConnector(this.options);
  23832. } else if (this.options.broadcaster == 'socket.io') {
  23833. this.connector = new SocketIoConnector(this.options);
  23834. } else if (this.options.broadcaster == 'null') {
  23835. this.connector = new NullConnector(this.options);
  23836. } else if (typeof this.options.broadcaster == 'function') {
  23837. this.connector = new this.options.broadcaster(this.options);
  23838. }
  23839. }
  23840. /**
  23841. * Disconnect from the Echo server.
  23842. */
  23843. }, {
  23844. key: "disconnect",
  23845. value: function disconnect() {
  23846. this.connector.disconnect();
  23847. }
  23848. /**
  23849. * Get a presence channel instance by name.
  23850. */
  23851. }, {
  23852. key: "join",
  23853. value: function join(channel) {
  23854. return this.connector.presenceChannel(channel);
  23855. }
  23856. /**
  23857. * Leave the given channel, as well as its private and presence variants.
  23858. */
  23859. }, {
  23860. key: "leave",
  23861. value: function leave(channel) {
  23862. this.connector.leave(channel);
  23863. }
  23864. /**
  23865. * Leave the given channel.
  23866. */
  23867. }, {
  23868. key: "leaveChannel",
  23869. value: function leaveChannel(channel) {
  23870. this.connector.leaveChannel(channel);
  23871. }
  23872. /**
  23873. * Listen for an event on a channel instance.
  23874. */
  23875. }, {
  23876. key: "listen",
  23877. value: function listen(channel, event, callback) {
  23878. return this.connector.listen(channel, event, callback);
  23879. }
  23880. /**
  23881. * Get a private channel instance by name.
  23882. */
  23883. }, {
  23884. key: "private",
  23885. value: function _private(channel) {
  23886. return this.connector.privateChannel(channel);
  23887. }
  23888. /**
  23889. * Get a private encrypted channel instance by name.
  23890. */
  23891. }, {
  23892. key: "encryptedPrivate",
  23893. value: function encryptedPrivate(channel) {
  23894. return this.connector.encryptedPrivateChannel(channel);
  23895. }
  23896. /**
  23897. * Get the Socket ID for the connection.
  23898. */
  23899. }, {
  23900. key: "socketId",
  23901. value: function socketId() {
  23902. return this.connector.socketId();
  23903. }
  23904. /**
  23905. * Register 3rd party request interceptiors. These are used to automatically
  23906. * send a connections socket id to a Laravel app with a X-Socket-Id header.
  23907. */
  23908. }, {
  23909. key: "registerInterceptors",
  23910. value: function registerInterceptors() {
  23911. if (typeof Vue === 'function' && Vue.http) {
  23912. this.registerVueRequestInterceptor();
  23913. }
  23914. if (typeof axios === 'function') {
  23915. this.registerAxiosRequestInterceptor();
  23916. }
  23917. if (typeof jQuery === 'function') {
  23918. this.registerjQueryAjaxSetup();
  23919. }
  23920. }
  23921. /**
  23922. * Register a Vue HTTP interceptor to add the X-Socket-ID header.
  23923. */
  23924. }, {
  23925. key: "registerVueRequestInterceptor",
  23926. value: function registerVueRequestInterceptor() {
  23927. var _this = this;
  23928. Vue.http.interceptors.push(function (request, next) {
  23929. if (_this.socketId()) {
  23930. request.headers.set('X-Socket-ID', _this.socketId());
  23931. }
  23932. next();
  23933. });
  23934. }
  23935. /**
  23936. * Register an Axios HTTP interceptor to add the X-Socket-ID header.
  23937. */
  23938. }, {
  23939. key: "registerAxiosRequestInterceptor",
  23940. value: function registerAxiosRequestInterceptor() {
  23941. var _this2 = this;
  23942. axios.interceptors.request.use(function (config) {
  23943. if (_this2.socketId()) {
  23944. config.headers['X-Socket-Id'] = _this2.socketId();
  23945. }
  23946. return config;
  23947. });
  23948. }
  23949. /**
  23950. * Register jQuery AjaxPrefilter to add the X-Socket-ID header.
  23951. */
  23952. }, {
  23953. key: "registerjQueryAjaxSetup",
  23954. value: function registerjQueryAjaxSetup() {
  23955. var _this3 = this;
  23956. if (typeof jQuery.ajax != 'undefined') {
  23957. jQuery.ajaxPrefilter(function (options, originalOptions, xhr) {
  23958. if (_this3.socketId()) {
  23959. xhr.setRequestHeader('X-Socket-Id', _this3.socketId());
  23960. }
  23961. });
  23962. }
  23963. }
  23964. }]);
  23965. return Echo;
  23966. }();
  23967. /* harmony default export */ __webpack_exports__["default"] = (Echo);
  23968. /***/ }),
  23969. /***/ "./node_modules/lodash/lodash.js":
  23970. /*!***************************************!*\
  23971. !*** ./node_modules/lodash/lodash.js ***!
  23972. \***************************************/
  23973. /*! no static exports found */
  23974. /***/ (function(module, exports, __webpack_require__) {
  23975. /* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/**
  23976. * @license
  23977. * Lodash <https://lodash.com/>
  23978. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  23979. * Released under MIT license <https://lodash.com/license>
  23980. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  23981. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  23982. */
  23983. ;(function() {
  23984. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  23985. var undefined;
  23986. /** Used as the semantic version number. */
  23987. var VERSION = '4.17.20';
  23988. /** Used as the size to enable large array optimizations. */
  23989. var LARGE_ARRAY_SIZE = 200;
  23990. /** Error message constants. */
  23991. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  23992. FUNC_ERROR_TEXT = 'Expected a function';
  23993. /** Used to stand-in for `undefined` hash values. */
  23994. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  23995. /** Used as the maximum memoize cache size. */
  23996. var MAX_MEMOIZE_SIZE = 500;
  23997. /** Used as the internal argument placeholder. */
  23998. var PLACEHOLDER = '__lodash_placeholder__';
  23999. /** Used to compose bitmasks for cloning. */
  24000. var CLONE_DEEP_FLAG = 1,
  24001. CLONE_FLAT_FLAG = 2,
  24002. CLONE_SYMBOLS_FLAG = 4;
  24003. /** Used to compose bitmasks for value comparisons. */
  24004. var COMPARE_PARTIAL_FLAG = 1,
  24005. COMPARE_UNORDERED_FLAG = 2;
  24006. /** Used to compose bitmasks for function metadata. */
  24007. var WRAP_BIND_FLAG = 1,
  24008. WRAP_BIND_KEY_FLAG = 2,
  24009. WRAP_CURRY_BOUND_FLAG = 4,
  24010. WRAP_CURRY_FLAG = 8,
  24011. WRAP_CURRY_RIGHT_FLAG = 16,
  24012. WRAP_PARTIAL_FLAG = 32,
  24013. WRAP_PARTIAL_RIGHT_FLAG = 64,
  24014. WRAP_ARY_FLAG = 128,
  24015. WRAP_REARG_FLAG = 256,
  24016. WRAP_FLIP_FLAG = 512;
  24017. /** Used as default options for `_.truncate`. */
  24018. var DEFAULT_TRUNC_LENGTH = 30,
  24019. DEFAULT_TRUNC_OMISSION = '...';
  24020. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  24021. var HOT_COUNT = 800,
  24022. HOT_SPAN = 16;
  24023. /** Used to indicate the type of lazy iteratees. */
  24024. var LAZY_FILTER_FLAG = 1,
  24025. LAZY_MAP_FLAG = 2,
  24026. LAZY_WHILE_FLAG = 3;
  24027. /** Used as references for various `Number` constants. */
  24028. var INFINITY = 1 / 0,
  24029. MAX_SAFE_INTEGER = 9007199254740991,
  24030. MAX_INTEGER = 1.7976931348623157e+308,
  24031. NAN = 0 / 0;
  24032. /** Used as references for the maximum length and index of an array. */
  24033. var MAX_ARRAY_LENGTH = 4294967295,
  24034. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  24035. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  24036. /** Used to associate wrap methods with their bit flags. */
  24037. var wrapFlags = [
  24038. ['ary', WRAP_ARY_FLAG],
  24039. ['bind', WRAP_BIND_FLAG],
  24040. ['bindKey', WRAP_BIND_KEY_FLAG],
  24041. ['curry', WRAP_CURRY_FLAG],
  24042. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  24043. ['flip', WRAP_FLIP_FLAG],
  24044. ['partial', WRAP_PARTIAL_FLAG],
  24045. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  24046. ['rearg', WRAP_REARG_FLAG]
  24047. ];
  24048. /** `Object#toString` result references. */
  24049. var argsTag = '[object Arguments]',
  24050. arrayTag = '[object Array]',
  24051. asyncTag = '[object AsyncFunction]',
  24052. boolTag = '[object Boolean]',
  24053. dateTag = '[object Date]',
  24054. domExcTag = '[object DOMException]',
  24055. errorTag = '[object Error]',
  24056. funcTag = '[object Function]',
  24057. genTag = '[object GeneratorFunction]',
  24058. mapTag = '[object Map]',
  24059. numberTag = '[object Number]',
  24060. nullTag = '[object Null]',
  24061. objectTag = '[object Object]',
  24062. promiseTag = '[object Promise]',
  24063. proxyTag = '[object Proxy]',
  24064. regexpTag = '[object RegExp]',
  24065. setTag = '[object Set]',
  24066. stringTag = '[object String]',
  24067. symbolTag = '[object Symbol]',
  24068. undefinedTag = '[object Undefined]',
  24069. weakMapTag = '[object WeakMap]',
  24070. weakSetTag = '[object WeakSet]';
  24071. var arrayBufferTag = '[object ArrayBuffer]',
  24072. dataViewTag = '[object DataView]',
  24073. float32Tag = '[object Float32Array]',
  24074. float64Tag = '[object Float64Array]',
  24075. int8Tag = '[object Int8Array]',
  24076. int16Tag = '[object Int16Array]',
  24077. int32Tag = '[object Int32Array]',
  24078. uint8Tag = '[object Uint8Array]',
  24079. uint8ClampedTag = '[object Uint8ClampedArray]',
  24080. uint16Tag = '[object Uint16Array]',
  24081. uint32Tag = '[object Uint32Array]';
  24082. /** Used to match empty string literals in compiled template source. */
  24083. var reEmptyStringLeading = /\b__p \+= '';/g,
  24084. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  24085. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  24086. /** Used to match HTML entities and HTML characters. */
  24087. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  24088. reUnescapedHtml = /[&<>"']/g,
  24089. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  24090. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  24091. /** Used to match template delimiters. */
  24092. var reEscape = /<%-([\s\S]+?)%>/g,
  24093. reEvaluate = /<%([\s\S]+?)%>/g,
  24094. reInterpolate = /<%=([\s\S]+?)%>/g;
  24095. /** Used to match property names within property paths. */
  24096. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  24097. reIsPlainProp = /^\w*$/,
  24098. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  24099. /**
  24100. * Used to match `RegExp`
  24101. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  24102. */
  24103. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  24104. reHasRegExpChar = RegExp(reRegExpChar.source);
  24105. /** Used to match leading and trailing whitespace. */
  24106. var reTrim = /^\s+|\s+$/g,
  24107. reTrimStart = /^\s+/,
  24108. reTrimEnd = /\s+$/;
  24109. /** Used to match wrap detail comments. */
  24110. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  24111. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  24112. reSplitDetails = /,? & /;
  24113. /** Used to match words composed of alphanumeric characters. */
  24114. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  24115. /** Used to match backslashes in property paths. */
  24116. var reEscapeChar = /\\(\\)?/g;
  24117. /**
  24118. * Used to match
  24119. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  24120. */
  24121. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  24122. /** Used to match `RegExp` flags from their coerced string values. */
  24123. var reFlags = /\w*$/;
  24124. /** Used to detect bad signed hexadecimal string values. */
  24125. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  24126. /** Used to detect binary string values. */
  24127. var reIsBinary = /^0b[01]+$/i;
  24128. /** Used to detect host constructors (Safari). */
  24129. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  24130. /** Used to detect octal string values. */
  24131. var reIsOctal = /^0o[0-7]+$/i;
  24132. /** Used to detect unsigned integer values. */
  24133. var reIsUint = /^(?:0|[1-9]\d*)$/;
  24134. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  24135. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  24136. /** Used to ensure capturing order of template delimiters. */
  24137. var reNoMatch = /($^)/;
  24138. /** Used to match unescaped characters in compiled string literals. */
  24139. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  24140. /** Used to compose unicode character classes. */
  24141. var rsAstralRange = '\\ud800-\\udfff',
  24142. rsComboMarksRange = '\\u0300-\\u036f',
  24143. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  24144. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  24145. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  24146. rsDingbatRange = '\\u2700-\\u27bf',
  24147. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  24148. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  24149. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  24150. rsPunctuationRange = '\\u2000-\\u206f',
  24151. 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',
  24152. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  24153. rsVarRange = '\\ufe0e\\ufe0f',
  24154. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  24155. /** Used to compose unicode capture groups. */
  24156. var rsApos = "['\u2019]",
  24157. rsAstral = '[' + rsAstralRange + ']',
  24158. rsBreak = '[' + rsBreakRange + ']',
  24159. rsCombo = '[' + rsComboRange + ']',
  24160. rsDigits = '\\d+',
  24161. rsDingbat = '[' + rsDingbatRange + ']',
  24162. rsLower = '[' + rsLowerRange + ']',
  24163. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  24164. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  24165. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  24166. rsNonAstral = '[^' + rsAstralRange + ']',
  24167. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  24168. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  24169. rsUpper = '[' + rsUpperRange + ']',
  24170. rsZWJ = '\\u200d';
  24171. /** Used to compose unicode regexes. */
  24172. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  24173. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  24174. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  24175. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  24176. reOptMod = rsModifier + '?',
  24177. rsOptVar = '[' + rsVarRange + ']?',
  24178. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  24179. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  24180. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  24181. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  24182. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  24183. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  24184. /** Used to match apostrophes. */
  24185. var reApos = RegExp(rsApos, 'g');
  24186. /**
  24187. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  24188. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  24189. */
  24190. var reComboMark = RegExp(rsCombo, 'g');
  24191. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  24192. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  24193. /** Used to match complex or compound words. */
  24194. var reUnicodeWord = RegExp([
  24195. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  24196. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  24197. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  24198. rsUpper + '+' + rsOptContrUpper,
  24199. rsOrdUpper,
  24200. rsOrdLower,
  24201. rsDigits,
  24202. rsEmoji
  24203. ].join('|'), 'g');
  24204. /** 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/). */
  24205. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  24206. /** Used to detect strings that need a more robust regexp to match words. */
  24207. 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 ]/;
  24208. /** Used to assign default `context` object properties. */
  24209. var contextProps = [
  24210. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  24211. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  24212. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  24213. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  24214. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  24215. ];
  24216. /** Used to make template sourceURLs easier to identify. */
  24217. var templateCounter = -1;
  24218. /** Used to identify `toStringTag` values of typed arrays. */
  24219. var typedArrayTags = {};
  24220. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  24221. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  24222. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  24223. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  24224. typedArrayTags[uint32Tag] = true;
  24225. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  24226. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  24227. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  24228. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  24229. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  24230. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  24231. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  24232. typedArrayTags[weakMapTag] = false;
  24233. /** Used to identify `toStringTag` values supported by `_.clone`. */
  24234. var cloneableTags = {};
  24235. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  24236. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  24237. cloneableTags[boolTag] = cloneableTags[dateTag] =
  24238. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  24239. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  24240. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  24241. cloneableTags[numberTag] = cloneableTags[objectTag] =
  24242. cloneableTags[regexpTag] = cloneableTags[setTag] =
  24243. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  24244. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  24245. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  24246. cloneableTags[errorTag] = cloneableTags[funcTag] =
  24247. cloneableTags[weakMapTag] = false;
  24248. /** Used to map Latin Unicode letters to basic Latin letters. */
  24249. var deburredLetters = {
  24250. // Latin-1 Supplement block.
  24251. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  24252. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  24253. '\xc7': 'C', '\xe7': 'c',
  24254. '\xd0': 'D', '\xf0': 'd',
  24255. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  24256. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  24257. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  24258. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  24259. '\xd1': 'N', '\xf1': 'n',
  24260. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  24261. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  24262. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  24263. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  24264. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  24265. '\xc6': 'Ae', '\xe6': 'ae',
  24266. '\xde': 'Th', '\xfe': 'th',
  24267. '\xdf': 'ss',
  24268. // Latin Extended-A block.
  24269. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  24270. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  24271. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  24272. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  24273. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  24274. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  24275. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  24276. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  24277. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  24278. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  24279. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  24280. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  24281. '\u0134': 'J', '\u0135': 'j',
  24282. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  24283. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  24284. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  24285. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  24286. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  24287. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  24288. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  24289. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  24290. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  24291. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  24292. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  24293. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  24294. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  24295. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  24296. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  24297. '\u0174': 'W', '\u0175': 'w',
  24298. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  24299. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  24300. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  24301. '\u0132': 'IJ', '\u0133': 'ij',
  24302. '\u0152': 'Oe', '\u0153': 'oe',
  24303. '\u0149': "'n", '\u017f': 's'
  24304. };
  24305. /** Used to map characters to HTML entities. */
  24306. var htmlEscapes = {
  24307. '&': '&amp;',
  24308. '<': '&lt;',
  24309. '>': '&gt;',
  24310. '"': '&quot;',
  24311. "'": '&#39;'
  24312. };
  24313. /** Used to map HTML entities to characters. */
  24314. var htmlUnescapes = {
  24315. '&amp;': '&',
  24316. '&lt;': '<',
  24317. '&gt;': '>',
  24318. '&quot;': '"',
  24319. '&#39;': "'"
  24320. };
  24321. /** Used to escape characters for inclusion in compiled string literals. */
  24322. var stringEscapes = {
  24323. '\\': '\\',
  24324. "'": "'",
  24325. '\n': 'n',
  24326. '\r': 'r',
  24327. '\u2028': 'u2028',
  24328. '\u2029': 'u2029'
  24329. };
  24330. /** Built-in method references without a dependency on `root`. */
  24331. var freeParseFloat = parseFloat,
  24332. freeParseInt = parseInt;
  24333. /** Detect free variable `global` from Node.js. */
  24334. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  24335. /** Detect free variable `self`. */
  24336. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  24337. /** Used as a reference to the global object. */
  24338. var root = freeGlobal || freeSelf || Function('return this')();
  24339. /** Detect free variable `exports`. */
  24340. var freeExports = true && exports && !exports.nodeType && exports;
  24341. /** Detect free variable `module`. */
  24342. var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
  24343. /** Detect the popular CommonJS extension `module.exports`. */
  24344. var moduleExports = freeModule && freeModule.exports === freeExports;
  24345. /** Detect free variable `process` from Node.js. */
  24346. var freeProcess = moduleExports && freeGlobal.process;
  24347. /** Used to access faster Node.js helpers. */
  24348. var nodeUtil = (function() {
  24349. try {
  24350. // Use `util.types` for Node.js 10+.
  24351. var types = freeModule && freeModule.require && freeModule.require('util').types;
  24352. if (types) {
  24353. return types;
  24354. }
  24355. // Legacy `process.binding('util')` for Node.js < 10.
  24356. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  24357. } catch (e) {}
  24358. }());
  24359. /* Node.js helper references. */
  24360. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  24361. nodeIsDate = nodeUtil && nodeUtil.isDate,
  24362. nodeIsMap = nodeUtil && nodeUtil.isMap,
  24363. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  24364. nodeIsSet = nodeUtil && nodeUtil.isSet,
  24365. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  24366. /*--------------------------------------------------------------------------*/
  24367. /**
  24368. * A faster alternative to `Function#apply`, this function invokes `func`
  24369. * with the `this` binding of `thisArg` and the arguments of `args`.
  24370. *
  24371. * @private
  24372. * @param {Function} func The function to invoke.
  24373. * @param {*} thisArg The `this` binding of `func`.
  24374. * @param {Array} args The arguments to invoke `func` with.
  24375. * @returns {*} Returns the result of `func`.
  24376. */
  24377. function apply(func, thisArg, args) {
  24378. switch (args.length) {
  24379. case 0: return func.call(thisArg);
  24380. case 1: return func.call(thisArg, args[0]);
  24381. case 2: return func.call(thisArg, args[0], args[1]);
  24382. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  24383. }
  24384. return func.apply(thisArg, args);
  24385. }
  24386. /**
  24387. * A specialized version of `baseAggregator` for arrays.
  24388. *
  24389. * @private
  24390. * @param {Array} [array] The array to iterate over.
  24391. * @param {Function} setter The function to set `accumulator` values.
  24392. * @param {Function} iteratee The iteratee to transform keys.
  24393. * @param {Object} accumulator The initial aggregated object.
  24394. * @returns {Function} Returns `accumulator`.
  24395. */
  24396. function arrayAggregator(array, setter, iteratee, accumulator) {
  24397. var index = -1,
  24398. length = array == null ? 0 : array.length;
  24399. while (++index < length) {
  24400. var value = array[index];
  24401. setter(accumulator, value, iteratee(value), array);
  24402. }
  24403. return accumulator;
  24404. }
  24405. /**
  24406. * A specialized version of `_.forEach` for arrays without support for
  24407. * iteratee shorthands.
  24408. *
  24409. * @private
  24410. * @param {Array} [array] The array to iterate over.
  24411. * @param {Function} iteratee The function invoked per iteration.
  24412. * @returns {Array} Returns `array`.
  24413. */
  24414. function arrayEach(array, iteratee) {
  24415. var index = -1,
  24416. length = array == null ? 0 : array.length;
  24417. while (++index < length) {
  24418. if (iteratee(array[index], index, array) === false) {
  24419. break;
  24420. }
  24421. }
  24422. return array;
  24423. }
  24424. /**
  24425. * A specialized version of `_.forEachRight` for arrays without support for
  24426. * iteratee shorthands.
  24427. *
  24428. * @private
  24429. * @param {Array} [array] The array to iterate over.
  24430. * @param {Function} iteratee The function invoked per iteration.
  24431. * @returns {Array} Returns `array`.
  24432. */
  24433. function arrayEachRight(array, iteratee) {
  24434. var length = array == null ? 0 : array.length;
  24435. while (length--) {
  24436. if (iteratee(array[length], length, array) === false) {
  24437. break;
  24438. }
  24439. }
  24440. return array;
  24441. }
  24442. /**
  24443. * A specialized version of `_.every` for arrays without support for
  24444. * iteratee shorthands.
  24445. *
  24446. * @private
  24447. * @param {Array} [array] The array to iterate over.
  24448. * @param {Function} predicate The function invoked per iteration.
  24449. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  24450. * else `false`.
  24451. */
  24452. function arrayEvery(array, predicate) {
  24453. var index = -1,
  24454. length = array == null ? 0 : array.length;
  24455. while (++index < length) {
  24456. if (!predicate(array[index], index, array)) {
  24457. return false;
  24458. }
  24459. }
  24460. return true;
  24461. }
  24462. /**
  24463. * A specialized version of `_.filter` for arrays without support for
  24464. * iteratee shorthands.
  24465. *
  24466. * @private
  24467. * @param {Array} [array] The array to iterate over.
  24468. * @param {Function} predicate The function invoked per iteration.
  24469. * @returns {Array} Returns the new filtered array.
  24470. */
  24471. function arrayFilter(array, predicate) {
  24472. var index = -1,
  24473. length = array == null ? 0 : array.length,
  24474. resIndex = 0,
  24475. result = [];
  24476. while (++index < length) {
  24477. var value = array[index];
  24478. if (predicate(value, index, array)) {
  24479. result[resIndex++] = value;
  24480. }
  24481. }
  24482. return result;
  24483. }
  24484. /**
  24485. * A specialized version of `_.includes` for arrays without support for
  24486. * specifying an index to search from.
  24487. *
  24488. * @private
  24489. * @param {Array} [array] The array to inspect.
  24490. * @param {*} target The value to search for.
  24491. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  24492. */
  24493. function arrayIncludes(array, value) {
  24494. var length = array == null ? 0 : array.length;
  24495. return !!length && baseIndexOf(array, value, 0) > -1;
  24496. }
  24497. /**
  24498. * This function is like `arrayIncludes` except that it accepts a comparator.
  24499. *
  24500. * @private
  24501. * @param {Array} [array] The array to inspect.
  24502. * @param {*} target The value to search for.
  24503. * @param {Function} comparator The comparator invoked per element.
  24504. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  24505. */
  24506. function arrayIncludesWith(array, value, comparator) {
  24507. var index = -1,
  24508. length = array == null ? 0 : array.length;
  24509. while (++index < length) {
  24510. if (comparator(value, array[index])) {
  24511. return true;
  24512. }
  24513. }
  24514. return false;
  24515. }
  24516. /**
  24517. * A specialized version of `_.map` for arrays without support for iteratee
  24518. * shorthands.
  24519. *
  24520. * @private
  24521. * @param {Array} [array] The array to iterate over.
  24522. * @param {Function} iteratee The function invoked per iteration.
  24523. * @returns {Array} Returns the new mapped array.
  24524. */
  24525. function arrayMap(array, iteratee) {
  24526. var index = -1,
  24527. length = array == null ? 0 : array.length,
  24528. result = Array(length);
  24529. while (++index < length) {
  24530. result[index] = iteratee(array[index], index, array);
  24531. }
  24532. return result;
  24533. }
  24534. /**
  24535. * Appends the elements of `values` to `array`.
  24536. *
  24537. * @private
  24538. * @param {Array} array The array to modify.
  24539. * @param {Array} values The values to append.
  24540. * @returns {Array} Returns `array`.
  24541. */
  24542. function arrayPush(array, values) {
  24543. var index = -1,
  24544. length = values.length,
  24545. offset = array.length;
  24546. while (++index < length) {
  24547. array[offset + index] = values[index];
  24548. }
  24549. return array;
  24550. }
  24551. /**
  24552. * A specialized version of `_.reduce` for arrays without support for
  24553. * iteratee shorthands.
  24554. *
  24555. * @private
  24556. * @param {Array} [array] The array to iterate over.
  24557. * @param {Function} iteratee The function invoked per iteration.
  24558. * @param {*} [accumulator] The initial value.
  24559. * @param {boolean} [initAccum] Specify using the first element of `array` as
  24560. * the initial value.
  24561. * @returns {*} Returns the accumulated value.
  24562. */
  24563. function arrayReduce(array, iteratee, accumulator, initAccum) {
  24564. var index = -1,
  24565. length = array == null ? 0 : array.length;
  24566. if (initAccum && length) {
  24567. accumulator = array[++index];
  24568. }
  24569. while (++index < length) {
  24570. accumulator = iteratee(accumulator, array[index], index, array);
  24571. }
  24572. return accumulator;
  24573. }
  24574. /**
  24575. * A specialized version of `_.reduceRight` for arrays without support for
  24576. * iteratee shorthands.
  24577. *
  24578. * @private
  24579. * @param {Array} [array] The array to iterate over.
  24580. * @param {Function} iteratee The function invoked per iteration.
  24581. * @param {*} [accumulator] The initial value.
  24582. * @param {boolean} [initAccum] Specify using the last element of `array` as
  24583. * the initial value.
  24584. * @returns {*} Returns the accumulated value.
  24585. */
  24586. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  24587. var length = array == null ? 0 : array.length;
  24588. if (initAccum && length) {
  24589. accumulator = array[--length];
  24590. }
  24591. while (length--) {
  24592. accumulator = iteratee(accumulator, array[length], length, array);
  24593. }
  24594. return accumulator;
  24595. }
  24596. /**
  24597. * A specialized version of `_.some` for arrays without support for iteratee
  24598. * shorthands.
  24599. *
  24600. * @private
  24601. * @param {Array} [array] The array to iterate over.
  24602. * @param {Function} predicate The function invoked per iteration.
  24603. * @returns {boolean} Returns `true` if any element passes the predicate check,
  24604. * else `false`.
  24605. */
  24606. function arraySome(array, predicate) {
  24607. var index = -1,
  24608. length = array == null ? 0 : array.length;
  24609. while (++index < length) {
  24610. if (predicate(array[index], index, array)) {
  24611. return true;
  24612. }
  24613. }
  24614. return false;
  24615. }
  24616. /**
  24617. * Gets the size of an ASCII `string`.
  24618. *
  24619. * @private
  24620. * @param {string} string The string inspect.
  24621. * @returns {number} Returns the string size.
  24622. */
  24623. var asciiSize = baseProperty('length');
  24624. /**
  24625. * Converts an ASCII `string` to an array.
  24626. *
  24627. * @private
  24628. * @param {string} string The string to convert.
  24629. * @returns {Array} Returns the converted array.
  24630. */
  24631. function asciiToArray(string) {
  24632. return string.split('');
  24633. }
  24634. /**
  24635. * Splits an ASCII `string` into an array of its words.
  24636. *
  24637. * @private
  24638. * @param {string} The string to inspect.
  24639. * @returns {Array} Returns the words of `string`.
  24640. */
  24641. function asciiWords(string) {
  24642. return string.match(reAsciiWord) || [];
  24643. }
  24644. /**
  24645. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  24646. * without support for iteratee shorthands, which iterates over `collection`
  24647. * using `eachFunc`.
  24648. *
  24649. * @private
  24650. * @param {Array|Object} collection The collection to inspect.
  24651. * @param {Function} predicate The function invoked per iteration.
  24652. * @param {Function} eachFunc The function to iterate over `collection`.
  24653. * @returns {*} Returns the found element or its key, else `undefined`.
  24654. */
  24655. function baseFindKey(collection, predicate, eachFunc) {
  24656. var result;
  24657. eachFunc(collection, function(value, key, collection) {
  24658. if (predicate(value, key, collection)) {
  24659. result = key;
  24660. return false;
  24661. }
  24662. });
  24663. return result;
  24664. }
  24665. /**
  24666. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  24667. * support for iteratee shorthands.
  24668. *
  24669. * @private
  24670. * @param {Array} array The array to inspect.
  24671. * @param {Function} predicate The function invoked per iteration.
  24672. * @param {number} fromIndex The index to search from.
  24673. * @param {boolean} [fromRight] Specify iterating from right to left.
  24674. * @returns {number} Returns the index of the matched value, else `-1`.
  24675. */
  24676. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  24677. var length = array.length,
  24678. index = fromIndex + (fromRight ? 1 : -1);
  24679. while ((fromRight ? index-- : ++index < length)) {
  24680. if (predicate(array[index], index, array)) {
  24681. return index;
  24682. }
  24683. }
  24684. return -1;
  24685. }
  24686. /**
  24687. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  24688. *
  24689. * @private
  24690. * @param {Array} array The array to inspect.
  24691. * @param {*} value The value to search for.
  24692. * @param {number} fromIndex The index to search from.
  24693. * @returns {number} Returns the index of the matched value, else `-1`.
  24694. */
  24695. function baseIndexOf(array, value, fromIndex) {
  24696. return value === value
  24697. ? strictIndexOf(array, value, fromIndex)
  24698. : baseFindIndex(array, baseIsNaN, fromIndex);
  24699. }
  24700. /**
  24701. * This function is like `baseIndexOf` except that it accepts a comparator.
  24702. *
  24703. * @private
  24704. * @param {Array} array The array to inspect.
  24705. * @param {*} value The value to search for.
  24706. * @param {number} fromIndex The index to search from.
  24707. * @param {Function} comparator The comparator invoked per element.
  24708. * @returns {number} Returns the index of the matched value, else `-1`.
  24709. */
  24710. function baseIndexOfWith(array, value, fromIndex, comparator) {
  24711. var index = fromIndex - 1,
  24712. length = array.length;
  24713. while (++index < length) {
  24714. if (comparator(array[index], value)) {
  24715. return index;
  24716. }
  24717. }
  24718. return -1;
  24719. }
  24720. /**
  24721. * The base implementation of `_.isNaN` without support for number objects.
  24722. *
  24723. * @private
  24724. * @param {*} value The value to check.
  24725. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  24726. */
  24727. function baseIsNaN(value) {
  24728. return value !== value;
  24729. }
  24730. /**
  24731. * The base implementation of `_.mean` and `_.meanBy` without support for
  24732. * iteratee shorthands.
  24733. *
  24734. * @private
  24735. * @param {Array} array The array to iterate over.
  24736. * @param {Function} iteratee The function invoked per iteration.
  24737. * @returns {number} Returns the mean.
  24738. */
  24739. function baseMean(array, iteratee) {
  24740. var length = array == null ? 0 : array.length;
  24741. return length ? (baseSum(array, iteratee) / length) : NAN;
  24742. }
  24743. /**
  24744. * The base implementation of `_.property` without support for deep paths.
  24745. *
  24746. * @private
  24747. * @param {string} key The key of the property to get.
  24748. * @returns {Function} Returns the new accessor function.
  24749. */
  24750. function baseProperty(key) {
  24751. return function(object) {
  24752. return object == null ? undefined : object[key];
  24753. };
  24754. }
  24755. /**
  24756. * The base implementation of `_.propertyOf` without support for deep paths.
  24757. *
  24758. * @private
  24759. * @param {Object} object The object to query.
  24760. * @returns {Function} Returns the new accessor function.
  24761. */
  24762. function basePropertyOf(object) {
  24763. return function(key) {
  24764. return object == null ? undefined : object[key];
  24765. };
  24766. }
  24767. /**
  24768. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  24769. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  24770. *
  24771. * @private
  24772. * @param {Array|Object} collection The collection to iterate over.
  24773. * @param {Function} iteratee The function invoked per iteration.
  24774. * @param {*} accumulator The initial value.
  24775. * @param {boolean} initAccum Specify using the first or last element of
  24776. * `collection` as the initial value.
  24777. * @param {Function} eachFunc The function to iterate over `collection`.
  24778. * @returns {*} Returns the accumulated value.
  24779. */
  24780. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  24781. eachFunc(collection, function(value, index, collection) {
  24782. accumulator = initAccum
  24783. ? (initAccum = false, value)
  24784. : iteratee(accumulator, value, index, collection);
  24785. });
  24786. return accumulator;
  24787. }
  24788. /**
  24789. * The base implementation of `_.sortBy` which uses `comparer` to define the
  24790. * sort order of `array` and replaces criteria objects with their corresponding
  24791. * values.
  24792. *
  24793. * @private
  24794. * @param {Array} array The array to sort.
  24795. * @param {Function} comparer The function to define sort order.
  24796. * @returns {Array} Returns `array`.
  24797. */
  24798. function baseSortBy(array, comparer) {
  24799. var length = array.length;
  24800. array.sort(comparer);
  24801. while (length--) {
  24802. array[length] = array[length].value;
  24803. }
  24804. return array;
  24805. }
  24806. /**
  24807. * The base implementation of `_.sum` and `_.sumBy` without support for
  24808. * iteratee shorthands.
  24809. *
  24810. * @private
  24811. * @param {Array} array The array to iterate over.
  24812. * @param {Function} iteratee The function invoked per iteration.
  24813. * @returns {number} Returns the sum.
  24814. */
  24815. function baseSum(array, iteratee) {
  24816. var result,
  24817. index = -1,
  24818. length = array.length;
  24819. while (++index < length) {
  24820. var current = iteratee(array[index]);
  24821. if (current !== undefined) {
  24822. result = result === undefined ? current : (result + current);
  24823. }
  24824. }
  24825. return result;
  24826. }
  24827. /**
  24828. * The base implementation of `_.times` without support for iteratee shorthands
  24829. * or max array length checks.
  24830. *
  24831. * @private
  24832. * @param {number} n The number of times to invoke `iteratee`.
  24833. * @param {Function} iteratee The function invoked per iteration.
  24834. * @returns {Array} Returns the array of results.
  24835. */
  24836. function baseTimes(n, iteratee) {
  24837. var index = -1,
  24838. result = Array(n);
  24839. while (++index < n) {
  24840. result[index] = iteratee(index);
  24841. }
  24842. return result;
  24843. }
  24844. /**
  24845. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  24846. * of key-value pairs for `object` corresponding to the property names of `props`.
  24847. *
  24848. * @private
  24849. * @param {Object} object The object to query.
  24850. * @param {Array} props The property names to get values for.
  24851. * @returns {Object} Returns the key-value pairs.
  24852. */
  24853. function baseToPairs(object, props) {
  24854. return arrayMap(props, function(key) {
  24855. return [key, object[key]];
  24856. });
  24857. }
  24858. /**
  24859. * The base implementation of `_.unary` without support for storing metadata.
  24860. *
  24861. * @private
  24862. * @param {Function} func The function to cap arguments for.
  24863. * @returns {Function} Returns the new capped function.
  24864. */
  24865. function baseUnary(func) {
  24866. return function(value) {
  24867. return func(value);
  24868. };
  24869. }
  24870. /**
  24871. * The base implementation of `_.values` and `_.valuesIn` which creates an
  24872. * array of `object` property values corresponding to the property names
  24873. * of `props`.
  24874. *
  24875. * @private
  24876. * @param {Object} object The object to query.
  24877. * @param {Array} props The property names to get values for.
  24878. * @returns {Object} Returns the array of property values.
  24879. */
  24880. function baseValues(object, props) {
  24881. return arrayMap(props, function(key) {
  24882. return object[key];
  24883. });
  24884. }
  24885. /**
  24886. * Checks if a `cache` value for `key` exists.
  24887. *
  24888. * @private
  24889. * @param {Object} cache The cache to query.
  24890. * @param {string} key The key of the entry to check.
  24891. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  24892. */
  24893. function cacheHas(cache, key) {
  24894. return cache.has(key);
  24895. }
  24896. /**
  24897. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  24898. * that is not found in the character symbols.
  24899. *
  24900. * @private
  24901. * @param {Array} strSymbols The string symbols to inspect.
  24902. * @param {Array} chrSymbols The character symbols to find.
  24903. * @returns {number} Returns the index of the first unmatched string symbol.
  24904. */
  24905. function charsStartIndex(strSymbols, chrSymbols) {
  24906. var index = -1,
  24907. length = strSymbols.length;
  24908. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  24909. return index;
  24910. }
  24911. /**
  24912. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  24913. * that is not found in the character symbols.
  24914. *
  24915. * @private
  24916. * @param {Array} strSymbols The string symbols to inspect.
  24917. * @param {Array} chrSymbols The character symbols to find.
  24918. * @returns {number} Returns the index of the last unmatched string symbol.
  24919. */
  24920. function charsEndIndex(strSymbols, chrSymbols) {
  24921. var index = strSymbols.length;
  24922. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  24923. return index;
  24924. }
  24925. /**
  24926. * Gets the number of `placeholder` occurrences in `array`.
  24927. *
  24928. * @private
  24929. * @param {Array} array The array to inspect.
  24930. * @param {*} placeholder The placeholder to search for.
  24931. * @returns {number} Returns the placeholder count.
  24932. */
  24933. function countHolders(array, placeholder) {
  24934. var length = array.length,
  24935. result = 0;
  24936. while (length--) {
  24937. if (array[length] === placeholder) {
  24938. ++result;
  24939. }
  24940. }
  24941. return result;
  24942. }
  24943. /**
  24944. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  24945. * letters to basic Latin letters.
  24946. *
  24947. * @private
  24948. * @param {string} letter The matched letter to deburr.
  24949. * @returns {string} Returns the deburred letter.
  24950. */
  24951. var deburrLetter = basePropertyOf(deburredLetters);
  24952. /**
  24953. * Used by `_.escape` to convert characters to HTML entities.
  24954. *
  24955. * @private
  24956. * @param {string} chr The matched character to escape.
  24957. * @returns {string} Returns the escaped character.
  24958. */
  24959. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  24960. /**
  24961. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  24962. *
  24963. * @private
  24964. * @param {string} chr The matched character to escape.
  24965. * @returns {string} Returns the escaped character.
  24966. */
  24967. function escapeStringChar(chr) {
  24968. return '\\' + stringEscapes[chr];
  24969. }
  24970. /**
  24971. * Gets the value at `key` of `object`.
  24972. *
  24973. * @private
  24974. * @param {Object} [object] The object to query.
  24975. * @param {string} key The key of the property to get.
  24976. * @returns {*} Returns the property value.
  24977. */
  24978. function getValue(object, key) {
  24979. return object == null ? undefined : object[key];
  24980. }
  24981. /**
  24982. * Checks if `string` contains Unicode symbols.
  24983. *
  24984. * @private
  24985. * @param {string} string The string to inspect.
  24986. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  24987. */
  24988. function hasUnicode(string) {
  24989. return reHasUnicode.test(string);
  24990. }
  24991. /**
  24992. * Checks if `string` contains a word composed of Unicode symbols.
  24993. *
  24994. * @private
  24995. * @param {string} string The string to inspect.
  24996. * @returns {boolean} Returns `true` if a word is found, else `false`.
  24997. */
  24998. function hasUnicodeWord(string) {
  24999. return reHasUnicodeWord.test(string);
  25000. }
  25001. /**
  25002. * Converts `iterator` to an array.
  25003. *
  25004. * @private
  25005. * @param {Object} iterator The iterator to convert.
  25006. * @returns {Array} Returns the converted array.
  25007. */
  25008. function iteratorToArray(iterator) {
  25009. var data,
  25010. result = [];
  25011. while (!(data = iterator.next()).done) {
  25012. result.push(data.value);
  25013. }
  25014. return result;
  25015. }
  25016. /**
  25017. * Converts `map` to its key-value pairs.
  25018. *
  25019. * @private
  25020. * @param {Object} map The map to convert.
  25021. * @returns {Array} Returns the key-value pairs.
  25022. */
  25023. function mapToArray(map) {
  25024. var index = -1,
  25025. result = Array(map.size);
  25026. map.forEach(function(value, key) {
  25027. result[++index] = [key, value];
  25028. });
  25029. return result;
  25030. }
  25031. /**
  25032. * Creates a unary function that invokes `func` with its argument transformed.
  25033. *
  25034. * @private
  25035. * @param {Function} func The function to wrap.
  25036. * @param {Function} transform The argument transform.
  25037. * @returns {Function} Returns the new function.
  25038. */
  25039. function overArg(func, transform) {
  25040. return function(arg) {
  25041. return func(transform(arg));
  25042. };
  25043. }
  25044. /**
  25045. * Replaces all `placeholder` elements in `array` with an internal placeholder
  25046. * and returns an array of their indexes.
  25047. *
  25048. * @private
  25049. * @param {Array} array The array to modify.
  25050. * @param {*} placeholder The placeholder to replace.
  25051. * @returns {Array} Returns the new array of placeholder indexes.
  25052. */
  25053. function replaceHolders(array, placeholder) {
  25054. var index = -1,
  25055. length = array.length,
  25056. resIndex = 0,
  25057. result = [];
  25058. while (++index < length) {
  25059. var value = array[index];
  25060. if (value === placeholder || value === PLACEHOLDER) {
  25061. array[index] = PLACEHOLDER;
  25062. result[resIndex++] = index;
  25063. }
  25064. }
  25065. return result;
  25066. }
  25067. /**
  25068. * Converts `set` to an array of its values.
  25069. *
  25070. * @private
  25071. * @param {Object} set The set to convert.
  25072. * @returns {Array} Returns the values.
  25073. */
  25074. function setToArray(set) {
  25075. var index = -1,
  25076. result = Array(set.size);
  25077. set.forEach(function(value) {
  25078. result[++index] = value;
  25079. });
  25080. return result;
  25081. }
  25082. /**
  25083. * Converts `set` to its value-value pairs.
  25084. *
  25085. * @private
  25086. * @param {Object} set The set to convert.
  25087. * @returns {Array} Returns the value-value pairs.
  25088. */
  25089. function setToPairs(set) {
  25090. var index = -1,
  25091. result = Array(set.size);
  25092. set.forEach(function(value) {
  25093. result[++index] = [value, value];
  25094. });
  25095. return result;
  25096. }
  25097. /**
  25098. * A specialized version of `_.indexOf` which performs strict equality
  25099. * comparisons of values, i.e. `===`.
  25100. *
  25101. * @private
  25102. * @param {Array} array The array to inspect.
  25103. * @param {*} value The value to search for.
  25104. * @param {number} fromIndex The index to search from.
  25105. * @returns {number} Returns the index of the matched value, else `-1`.
  25106. */
  25107. function strictIndexOf(array, value, fromIndex) {
  25108. var index = fromIndex - 1,
  25109. length = array.length;
  25110. while (++index < length) {
  25111. if (array[index] === value) {
  25112. return index;
  25113. }
  25114. }
  25115. return -1;
  25116. }
  25117. /**
  25118. * A specialized version of `_.lastIndexOf` which performs strict equality
  25119. * comparisons of values, i.e. `===`.
  25120. *
  25121. * @private
  25122. * @param {Array} array The array to inspect.
  25123. * @param {*} value The value to search for.
  25124. * @param {number} fromIndex The index to search from.
  25125. * @returns {number} Returns the index of the matched value, else `-1`.
  25126. */
  25127. function strictLastIndexOf(array, value, fromIndex) {
  25128. var index = fromIndex + 1;
  25129. while (index--) {
  25130. if (array[index] === value) {
  25131. return index;
  25132. }
  25133. }
  25134. return index;
  25135. }
  25136. /**
  25137. * Gets the number of symbols in `string`.
  25138. *
  25139. * @private
  25140. * @param {string} string The string to inspect.
  25141. * @returns {number} Returns the string size.
  25142. */
  25143. function stringSize(string) {
  25144. return hasUnicode(string)
  25145. ? unicodeSize(string)
  25146. : asciiSize(string);
  25147. }
  25148. /**
  25149. * Converts `string` to an array.
  25150. *
  25151. * @private
  25152. * @param {string} string The string to convert.
  25153. * @returns {Array} Returns the converted array.
  25154. */
  25155. function stringToArray(string) {
  25156. return hasUnicode(string)
  25157. ? unicodeToArray(string)
  25158. : asciiToArray(string);
  25159. }
  25160. /**
  25161. * Used by `_.unescape` to convert HTML entities to characters.
  25162. *
  25163. * @private
  25164. * @param {string} chr The matched character to unescape.
  25165. * @returns {string} Returns the unescaped character.
  25166. */
  25167. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  25168. /**
  25169. * Gets the size of a Unicode `string`.
  25170. *
  25171. * @private
  25172. * @param {string} string The string inspect.
  25173. * @returns {number} Returns the string size.
  25174. */
  25175. function unicodeSize(string) {
  25176. var result = reUnicode.lastIndex = 0;
  25177. while (reUnicode.test(string)) {
  25178. ++result;
  25179. }
  25180. return result;
  25181. }
  25182. /**
  25183. * Converts a Unicode `string` to an array.
  25184. *
  25185. * @private
  25186. * @param {string} string The string to convert.
  25187. * @returns {Array} Returns the converted array.
  25188. */
  25189. function unicodeToArray(string) {
  25190. return string.match(reUnicode) || [];
  25191. }
  25192. /**
  25193. * Splits a Unicode `string` into an array of its words.
  25194. *
  25195. * @private
  25196. * @param {string} The string to inspect.
  25197. * @returns {Array} Returns the words of `string`.
  25198. */
  25199. function unicodeWords(string) {
  25200. return string.match(reUnicodeWord) || [];
  25201. }
  25202. /*--------------------------------------------------------------------------*/
  25203. /**
  25204. * Create a new pristine `lodash` function using the `context` object.
  25205. *
  25206. * @static
  25207. * @memberOf _
  25208. * @since 1.1.0
  25209. * @category Util
  25210. * @param {Object} [context=root] The context object.
  25211. * @returns {Function} Returns a new `lodash` function.
  25212. * @example
  25213. *
  25214. * _.mixin({ 'foo': _.constant('foo') });
  25215. *
  25216. * var lodash = _.runInContext();
  25217. * lodash.mixin({ 'bar': lodash.constant('bar') });
  25218. *
  25219. * _.isFunction(_.foo);
  25220. * // => true
  25221. * _.isFunction(_.bar);
  25222. * // => false
  25223. *
  25224. * lodash.isFunction(lodash.foo);
  25225. * // => false
  25226. * lodash.isFunction(lodash.bar);
  25227. * // => true
  25228. *
  25229. * // Create a suped-up `defer` in Node.js.
  25230. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  25231. */
  25232. var runInContext = (function runInContext(context) {
  25233. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  25234. /** Built-in constructor references. */
  25235. var Array = context.Array,
  25236. Date = context.Date,
  25237. Error = context.Error,
  25238. Function = context.Function,
  25239. Math = context.Math,
  25240. Object = context.Object,
  25241. RegExp = context.RegExp,
  25242. String = context.String,
  25243. TypeError = context.TypeError;
  25244. /** Used for built-in method references. */
  25245. var arrayProto = Array.prototype,
  25246. funcProto = Function.prototype,
  25247. objectProto = Object.prototype;
  25248. /** Used to detect overreaching core-js shims. */
  25249. var coreJsData = context['__core-js_shared__'];
  25250. /** Used to resolve the decompiled source of functions. */
  25251. var funcToString = funcProto.toString;
  25252. /** Used to check objects for own properties. */
  25253. var hasOwnProperty = objectProto.hasOwnProperty;
  25254. /** Used to generate unique IDs. */
  25255. var idCounter = 0;
  25256. /** Used to detect methods masquerading as native. */
  25257. var maskSrcKey = (function() {
  25258. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  25259. return uid ? ('Symbol(src)_1.' + uid) : '';
  25260. }());
  25261. /**
  25262. * Used to resolve the
  25263. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  25264. * of values.
  25265. */
  25266. var nativeObjectToString = objectProto.toString;
  25267. /** Used to infer the `Object` constructor. */
  25268. var objectCtorString = funcToString.call(Object);
  25269. /** Used to restore the original `_` reference in `_.noConflict`. */
  25270. var oldDash = root._;
  25271. /** Used to detect if a method is native. */
  25272. var reIsNative = RegExp('^' +
  25273. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  25274. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  25275. );
  25276. /** Built-in value references. */
  25277. var Buffer = moduleExports ? context.Buffer : undefined,
  25278. Symbol = context.Symbol,
  25279. Uint8Array = context.Uint8Array,
  25280. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  25281. getPrototype = overArg(Object.getPrototypeOf, Object),
  25282. objectCreate = Object.create,
  25283. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  25284. splice = arrayProto.splice,
  25285. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  25286. symIterator = Symbol ? Symbol.iterator : undefined,
  25287. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  25288. var defineProperty = (function() {
  25289. try {
  25290. var func = getNative(Object, 'defineProperty');
  25291. func({}, '', {});
  25292. return func;
  25293. } catch (e) {}
  25294. }());
  25295. /** Mocked built-ins. */
  25296. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  25297. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  25298. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  25299. /* Built-in method references for those with the same name as other `lodash` methods. */
  25300. var nativeCeil = Math.ceil,
  25301. nativeFloor = Math.floor,
  25302. nativeGetSymbols = Object.getOwnPropertySymbols,
  25303. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  25304. nativeIsFinite = context.isFinite,
  25305. nativeJoin = arrayProto.join,
  25306. nativeKeys = overArg(Object.keys, Object),
  25307. nativeMax = Math.max,
  25308. nativeMin = Math.min,
  25309. nativeNow = Date.now,
  25310. nativeParseInt = context.parseInt,
  25311. nativeRandom = Math.random,
  25312. nativeReverse = arrayProto.reverse;
  25313. /* Built-in method references that are verified to be native. */
  25314. var DataView = getNative(context, 'DataView'),
  25315. Map = getNative(context, 'Map'),
  25316. Promise = getNative(context, 'Promise'),
  25317. Set = getNative(context, 'Set'),
  25318. WeakMap = getNative(context, 'WeakMap'),
  25319. nativeCreate = getNative(Object, 'create');
  25320. /** Used to store function metadata. */
  25321. var metaMap = WeakMap && new WeakMap;
  25322. /** Used to lookup unminified function names. */
  25323. var realNames = {};
  25324. /** Used to detect maps, sets, and weakmaps. */
  25325. var dataViewCtorString = toSource(DataView),
  25326. mapCtorString = toSource(Map),
  25327. promiseCtorString = toSource(Promise),
  25328. setCtorString = toSource(Set),
  25329. weakMapCtorString = toSource(WeakMap);
  25330. /** Used to convert symbols to primitives and strings. */
  25331. var symbolProto = Symbol ? Symbol.prototype : undefined,
  25332. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  25333. symbolToString = symbolProto ? symbolProto.toString : undefined;
  25334. /*------------------------------------------------------------------------*/
  25335. /**
  25336. * Creates a `lodash` object which wraps `value` to enable implicit method
  25337. * chain sequences. Methods that operate on and return arrays, collections,
  25338. * and functions can be chained together. Methods that retrieve a single value
  25339. * or may return a primitive value will automatically end the chain sequence
  25340. * and return the unwrapped value. Otherwise, the value must be unwrapped
  25341. * with `_#value`.
  25342. *
  25343. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  25344. * enabled using `_.chain`.
  25345. *
  25346. * The execution of chained methods is lazy, that is, it's deferred until
  25347. * `_#value` is implicitly or explicitly called.
  25348. *
  25349. * Lazy evaluation allows several methods to support shortcut fusion.
  25350. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  25351. * the creation of intermediate arrays and can greatly reduce the number of
  25352. * iteratee executions. Sections of a chain sequence qualify for shortcut
  25353. * fusion if the section is applied to an array and iteratees accept only
  25354. * one argument. The heuristic for whether a section qualifies for shortcut
  25355. * fusion is subject to change.
  25356. *
  25357. * Chaining is supported in custom builds as long as the `_#value` method is
  25358. * directly or indirectly included in the build.
  25359. *
  25360. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  25361. *
  25362. * The wrapper `Array` methods are:
  25363. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  25364. *
  25365. * The wrapper `String` methods are:
  25366. * `replace` and `split`
  25367. *
  25368. * The wrapper methods that support shortcut fusion are:
  25369. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  25370. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  25371. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  25372. *
  25373. * The chainable wrapper methods are:
  25374. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  25375. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  25376. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  25377. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  25378. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  25379. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  25380. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  25381. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  25382. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  25383. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  25384. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  25385. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  25386. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  25387. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  25388. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  25389. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  25390. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  25391. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  25392. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  25393. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  25394. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  25395. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  25396. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  25397. * `zipObject`, `zipObjectDeep`, and `zipWith`
  25398. *
  25399. * The wrapper methods that are **not** chainable by default are:
  25400. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  25401. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  25402. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  25403. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  25404. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  25405. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  25406. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  25407. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  25408. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  25409. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  25410. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  25411. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  25412. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  25413. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  25414. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  25415. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  25416. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  25417. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  25418. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  25419. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  25420. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  25421. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  25422. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  25423. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  25424. * `upperFirst`, `value`, and `words`
  25425. *
  25426. * @name _
  25427. * @constructor
  25428. * @category Seq
  25429. * @param {*} value The value to wrap in a `lodash` instance.
  25430. * @returns {Object} Returns the new `lodash` wrapper instance.
  25431. * @example
  25432. *
  25433. * function square(n) {
  25434. * return n * n;
  25435. * }
  25436. *
  25437. * var wrapped = _([1, 2, 3]);
  25438. *
  25439. * // Returns an unwrapped value.
  25440. * wrapped.reduce(_.add);
  25441. * // => 6
  25442. *
  25443. * // Returns a wrapped value.
  25444. * var squares = wrapped.map(square);
  25445. *
  25446. * _.isArray(squares);
  25447. * // => false
  25448. *
  25449. * _.isArray(squares.value());
  25450. * // => true
  25451. */
  25452. function lodash(value) {
  25453. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  25454. if (value instanceof LodashWrapper) {
  25455. return value;
  25456. }
  25457. if (hasOwnProperty.call(value, '__wrapped__')) {
  25458. return wrapperClone(value);
  25459. }
  25460. }
  25461. return new LodashWrapper(value);
  25462. }
  25463. /**
  25464. * The base implementation of `_.create` without support for assigning
  25465. * properties to the created object.
  25466. *
  25467. * @private
  25468. * @param {Object} proto The object to inherit from.
  25469. * @returns {Object} Returns the new object.
  25470. */
  25471. var baseCreate = (function() {
  25472. function object() {}
  25473. return function(proto) {
  25474. if (!isObject(proto)) {
  25475. return {};
  25476. }
  25477. if (objectCreate) {
  25478. return objectCreate(proto);
  25479. }
  25480. object.prototype = proto;
  25481. var result = new object;
  25482. object.prototype = undefined;
  25483. return result;
  25484. };
  25485. }());
  25486. /**
  25487. * The function whose prototype chain sequence wrappers inherit from.
  25488. *
  25489. * @private
  25490. */
  25491. function baseLodash() {
  25492. // No operation performed.
  25493. }
  25494. /**
  25495. * The base constructor for creating `lodash` wrapper objects.
  25496. *
  25497. * @private
  25498. * @param {*} value The value to wrap.
  25499. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  25500. */
  25501. function LodashWrapper(value, chainAll) {
  25502. this.__wrapped__ = value;
  25503. this.__actions__ = [];
  25504. this.__chain__ = !!chainAll;
  25505. this.__index__ = 0;
  25506. this.__values__ = undefined;
  25507. }
  25508. /**
  25509. * By default, the template delimiters used by lodash are like those in
  25510. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  25511. * following template settings to use alternative delimiters.
  25512. *
  25513. * @static
  25514. * @memberOf _
  25515. * @type {Object}
  25516. */
  25517. lodash.templateSettings = {
  25518. /**
  25519. * Used to detect `data` property values to be HTML-escaped.
  25520. *
  25521. * @memberOf _.templateSettings
  25522. * @type {RegExp}
  25523. */
  25524. 'escape': reEscape,
  25525. /**
  25526. * Used to detect code to be evaluated.
  25527. *
  25528. * @memberOf _.templateSettings
  25529. * @type {RegExp}
  25530. */
  25531. 'evaluate': reEvaluate,
  25532. /**
  25533. * Used to detect `data` property values to inject.
  25534. *
  25535. * @memberOf _.templateSettings
  25536. * @type {RegExp}
  25537. */
  25538. 'interpolate': reInterpolate,
  25539. /**
  25540. * Used to reference the data object in the template text.
  25541. *
  25542. * @memberOf _.templateSettings
  25543. * @type {string}
  25544. */
  25545. 'variable': '',
  25546. /**
  25547. * Used to import variables into the compiled template.
  25548. *
  25549. * @memberOf _.templateSettings
  25550. * @type {Object}
  25551. */
  25552. 'imports': {
  25553. /**
  25554. * A reference to the `lodash` function.
  25555. *
  25556. * @memberOf _.templateSettings.imports
  25557. * @type {Function}
  25558. */
  25559. '_': lodash
  25560. }
  25561. };
  25562. // Ensure wrappers are instances of `baseLodash`.
  25563. lodash.prototype = baseLodash.prototype;
  25564. lodash.prototype.constructor = lodash;
  25565. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  25566. LodashWrapper.prototype.constructor = LodashWrapper;
  25567. /*------------------------------------------------------------------------*/
  25568. /**
  25569. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  25570. *
  25571. * @private
  25572. * @constructor
  25573. * @param {*} value The value to wrap.
  25574. */
  25575. function LazyWrapper(value) {
  25576. this.__wrapped__ = value;
  25577. this.__actions__ = [];
  25578. this.__dir__ = 1;
  25579. this.__filtered__ = false;
  25580. this.__iteratees__ = [];
  25581. this.__takeCount__ = MAX_ARRAY_LENGTH;
  25582. this.__views__ = [];
  25583. }
  25584. /**
  25585. * Creates a clone of the lazy wrapper object.
  25586. *
  25587. * @private
  25588. * @name clone
  25589. * @memberOf LazyWrapper
  25590. * @returns {Object} Returns the cloned `LazyWrapper` object.
  25591. */
  25592. function lazyClone() {
  25593. var result = new LazyWrapper(this.__wrapped__);
  25594. result.__actions__ = copyArray(this.__actions__);
  25595. result.__dir__ = this.__dir__;
  25596. result.__filtered__ = this.__filtered__;
  25597. result.__iteratees__ = copyArray(this.__iteratees__);
  25598. result.__takeCount__ = this.__takeCount__;
  25599. result.__views__ = copyArray(this.__views__);
  25600. return result;
  25601. }
  25602. /**
  25603. * Reverses the direction of lazy iteration.
  25604. *
  25605. * @private
  25606. * @name reverse
  25607. * @memberOf LazyWrapper
  25608. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  25609. */
  25610. function lazyReverse() {
  25611. if (this.__filtered__) {
  25612. var result = new LazyWrapper(this);
  25613. result.__dir__ = -1;
  25614. result.__filtered__ = true;
  25615. } else {
  25616. result = this.clone();
  25617. result.__dir__ *= -1;
  25618. }
  25619. return result;
  25620. }
  25621. /**
  25622. * Extracts the unwrapped value from its lazy wrapper.
  25623. *
  25624. * @private
  25625. * @name value
  25626. * @memberOf LazyWrapper
  25627. * @returns {*} Returns the unwrapped value.
  25628. */
  25629. function lazyValue() {
  25630. var array = this.__wrapped__.value(),
  25631. dir = this.__dir__,
  25632. isArr = isArray(array),
  25633. isRight = dir < 0,
  25634. arrLength = isArr ? array.length : 0,
  25635. view = getView(0, arrLength, this.__views__),
  25636. start = view.start,
  25637. end = view.end,
  25638. length = end - start,
  25639. index = isRight ? end : (start - 1),
  25640. iteratees = this.__iteratees__,
  25641. iterLength = iteratees.length,
  25642. resIndex = 0,
  25643. takeCount = nativeMin(length, this.__takeCount__);
  25644. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  25645. return baseWrapperValue(array, this.__actions__);
  25646. }
  25647. var result = [];
  25648. outer:
  25649. while (length-- && resIndex < takeCount) {
  25650. index += dir;
  25651. var iterIndex = -1,
  25652. value = array[index];
  25653. while (++iterIndex < iterLength) {
  25654. var data = iteratees[iterIndex],
  25655. iteratee = data.iteratee,
  25656. type = data.type,
  25657. computed = iteratee(value);
  25658. if (type == LAZY_MAP_FLAG) {
  25659. value = computed;
  25660. } else if (!computed) {
  25661. if (type == LAZY_FILTER_FLAG) {
  25662. continue outer;
  25663. } else {
  25664. break outer;
  25665. }
  25666. }
  25667. }
  25668. result[resIndex++] = value;
  25669. }
  25670. return result;
  25671. }
  25672. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  25673. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  25674. LazyWrapper.prototype.constructor = LazyWrapper;
  25675. /*------------------------------------------------------------------------*/
  25676. /**
  25677. * Creates a hash object.
  25678. *
  25679. * @private
  25680. * @constructor
  25681. * @param {Array} [entries] The key-value pairs to cache.
  25682. */
  25683. function Hash(entries) {
  25684. var index = -1,
  25685. length = entries == null ? 0 : entries.length;
  25686. this.clear();
  25687. while (++index < length) {
  25688. var entry = entries[index];
  25689. this.set(entry[0], entry[1]);
  25690. }
  25691. }
  25692. /**
  25693. * Removes all key-value entries from the hash.
  25694. *
  25695. * @private
  25696. * @name clear
  25697. * @memberOf Hash
  25698. */
  25699. function hashClear() {
  25700. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  25701. this.size = 0;
  25702. }
  25703. /**
  25704. * Removes `key` and its value from the hash.
  25705. *
  25706. * @private
  25707. * @name delete
  25708. * @memberOf Hash
  25709. * @param {Object} hash The hash to modify.
  25710. * @param {string} key The key of the value to remove.
  25711. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  25712. */
  25713. function hashDelete(key) {
  25714. var result = this.has(key) && delete this.__data__[key];
  25715. this.size -= result ? 1 : 0;
  25716. return result;
  25717. }
  25718. /**
  25719. * Gets the hash value for `key`.
  25720. *
  25721. * @private
  25722. * @name get
  25723. * @memberOf Hash
  25724. * @param {string} key The key of the value to get.
  25725. * @returns {*} Returns the entry value.
  25726. */
  25727. function hashGet(key) {
  25728. var data = this.__data__;
  25729. if (nativeCreate) {
  25730. var result = data[key];
  25731. return result === HASH_UNDEFINED ? undefined : result;
  25732. }
  25733. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  25734. }
  25735. /**
  25736. * Checks if a hash value for `key` exists.
  25737. *
  25738. * @private
  25739. * @name has
  25740. * @memberOf Hash
  25741. * @param {string} key The key of the entry to check.
  25742. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  25743. */
  25744. function hashHas(key) {
  25745. var data = this.__data__;
  25746. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  25747. }
  25748. /**
  25749. * Sets the hash `key` to `value`.
  25750. *
  25751. * @private
  25752. * @name set
  25753. * @memberOf Hash
  25754. * @param {string} key The key of the value to set.
  25755. * @param {*} value The value to set.
  25756. * @returns {Object} Returns the hash instance.
  25757. */
  25758. function hashSet(key, value) {
  25759. var data = this.__data__;
  25760. this.size += this.has(key) ? 0 : 1;
  25761. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  25762. return this;
  25763. }
  25764. // Add methods to `Hash`.
  25765. Hash.prototype.clear = hashClear;
  25766. Hash.prototype['delete'] = hashDelete;
  25767. Hash.prototype.get = hashGet;
  25768. Hash.prototype.has = hashHas;
  25769. Hash.prototype.set = hashSet;
  25770. /*------------------------------------------------------------------------*/
  25771. /**
  25772. * Creates an list cache object.
  25773. *
  25774. * @private
  25775. * @constructor
  25776. * @param {Array} [entries] The key-value pairs to cache.
  25777. */
  25778. function ListCache(entries) {
  25779. var index = -1,
  25780. length = entries == null ? 0 : entries.length;
  25781. this.clear();
  25782. while (++index < length) {
  25783. var entry = entries[index];
  25784. this.set(entry[0], entry[1]);
  25785. }
  25786. }
  25787. /**
  25788. * Removes all key-value entries from the list cache.
  25789. *
  25790. * @private
  25791. * @name clear
  25792. * @memberOf ListCache
  25793. */
  25794. function listCacheClear() {
  25795. this.__data__ = [];
  25796. this.size = 0;
  25797. }
  25798. /**
  25799. * Removes `key` and its value from the list cache.
  25800. *
  25801. * @private
  25802. * @name delete
  25803. * @memberOf ListCache
  25804. * @param {string} key The key of the value to remove.
  25805. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  25806. */
  25807. function listCacheDelete(key) {
  25808. var data = this.__data__,
  25809. index = assocIndexOf(data, key);
  25810. if (index < 0) {
  25811. return false;
  25812. }
  25813. var lastIndex = data.length - 1;
  25814. if (index == lastIndex) {
  25815. data.pop();
  25816. } else {
  25817. splice.call(data, index, 1);
  25818. }
  25819. --this.size;
  25820. return true;
  25821. }
  25822. /**
  25823. * Gets the list cache value for `key`.
  25824. *
  25825. * @private
  25826. * @name get
  25827. * @memberOf ListCache
  25828. * @param {string} key The key of the value to get.
  25829. * @returns {*} Returns the entry value.
  25830. */
  25831. function listCacheGet(key) {
  25832. var data = this.__data__,
  25833. index = assocIndexOf(data, key);
  25834. return index < 0 ? undefined : data[index][1];
  25835. }
  25836. /**
  25837. * Checks if a list cache value for `key` exists.
  25838. *
  25839. * @private
  25840. * @name has
  25841. * @memberOf ListCache
  25842. * @param {string} key The key of the entry to check.
  25843. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  25844. */
  25845. function listCacheHas(key) {
  25846. return assocIndexOf(this.__data__, key) > -1;
  25847. }
  25848. /**
  25849. * Sets the list cache `key` to `value`.
  25850. *
  25851. * @private
  25852. * @name set
  25853. * @memberOf ListCache
  25854. * @param {string} key The key of the value to set.
  25855. * @param {*} value The value to set.
  25856. * @returns {Object} Returns the list cache instance.
  25857. */
  25858. function listCacheSet(key, value) {
  25859. var data = this.__data__,
  25860. index = assocIndexOf(data, key);
  25861. if (index < 0) {
  25862. ++this.size;
  25863. data.push([key, value]);
  25864. } else {
  25865. data[index][1] = value;
  25866. }
  25867. return this;
  25868. }
  25869. // Add methods to `ListCache`.
  25870. ListCache.prototype.clear = listCacheClear;
  25871. ListCache.prototype['delete'] = listCacheDelete;
  25872. ListCache.prototype.get = listCacheGet;
  25873. ListCache.prototype.has = listCacheHas;
  25874. ListCache.prototype.set = listCacheSet;
  25875. /*------------------------------------------------------------------------*/
  25876. /**
  25877. * Creates a map cache object to store key-value pairs.
  25878. *
  25879. * @private
  25880. * @constructor
  25881. * @param {Array} [entries] The key-value pairs to cache.
  25882. */
  25883. function MapCache(entries) {
  25884. var index = -1,
  25885. length = entries == null ? 0 : entries.length;
  25886. this.clear();
  25887. while (++index < length) {
  25888. var entry = entries[index];
  25889. this.set(entry[0], entry[1]);
  25890. }
  25891. }
  25892. /**
  25893. * Removes all key-value entries from the map.
  25894. *
  25895. * @private
  25896. * @name clear
  25897. * @memberOf MapCache
  25898. */
  25899. function mapCacheClear() {
  25900. this.size = 0;
  25901. this.__data__ = {
  25902. 'hash': new Hash,
  25903. 'map': new (Map || ListCache),
  25904. 'string': new Hash
  25905. };
  25906. }
  25907. /**
  25908. * Removes `key` and its value from the map.
  25909. *
  25910. * @private
  25911. * @name delete
  25912. * @memberOf MapCache
  25913. * @param {string} key The key of the value to remove.
  25914. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  25915. */
  25916. function mapCacheDelete(key) {
  25917. var result = getMapData(this, key)['delete'](key);
  25918. this.size -= result ? 1 : 0;
  25919. return result;
  25920. }
  25921. /**
  25922. * Gets the map value for `key`.
  25923. *
  25924. * @private
  25925. * @name get
  25926. * @memberOf MapCache
  25927. * @param {string} key The key of the value to get.
  25928. * @returns {*} Returns the entry value.
  25929. */
  25930. function mapCacheGet(key) {
  25931. return getMapData(this, key).get(key);
  25932. }
  25933. /**
  25934. * Checks if a map value for `key` exists.
  25935. *
  25936. * @private
  25937. * @name has
  25938. * @memberOf MapCache
  25939. * @param {string} key The key of the entry to check.
  25940. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  25941. */
  25942. function mapCacheHas(key) {
  25943. return getMapData(this, key).has(key);
  25944. }
  25945. /**
  25946. * Sets the map `key` to `value`.
  25947. *
  25948. * @private
  25949. * @name set
  25950. * @memberOf MapCache
  25951. * @param {string} key The key of the value to set.
  25952. * @param {*} value The value to set.
  25953. * @returns {Object} Returns the map cache instance.
  25954. */
  25955. function mapCacheSet(key, value) {
  25956. var data = getMapData(this, key),
  25957. size = data.size;
  25958. data.set(key, value);
  25959. this.size += data.size == size ? 0 : 1;
  25960. return this;
  25961. }
  25962. // Add methods to `MapCache`.
  25963. MapCache.prototype.clear = mapCacheClear;
  25964. MapCache.prototype['delete'] = mapCacheDelete;
  25965. MapCache.prototype.get = mapCacheGet;
  25966. MapCache.prototype.has = mapCacheHas;
  25967. MapCache.prototype.set = mapCacheSet;
  25968. /*------------------------------------------------------------------------*/
  25969. /**
  25970. *
  25971. * Creates an array cache object to store unique values.
  25972. *
  25973. * @private
  25974. * @constructor
  25975. * @param {Array} [values] The values to cache.
  25976. */
  25977. function SetCache(values) {
  25978. var index = -1,
  25979. length = values == null ? 0 : values.length;
  25980. this.__data__ = new MapCache;
  25981. while (++index < length) {
  25982. this.add(values[index]);
  25983. }
  25984. }
  25985. /**
  25986. * Adds `value` to the array cache.
  25987. *
  25988. * @private
  25989. * @name add
  25990. * @memberOf SetCache
  25991. * @alias push
  25992. * @param {*} value The value to cache.
  25993. * @returns {Object} Returns the cache instance.
  25994. */
  25995. function setCacheAdd(value) {
  25996. this.__data__.set(value, HASH_UNDEFINED);
  25997. return this;
  25998. }
  25999. /**
  26000. * Checks if `value` is in the array cache.
  26001. *
  26002. * @private
  26003. * @name has
  26004. * @memberOf SetCache
  26005. * @param {*} value The value to search for.
  26006. * @returns {number} Returns `true` if `value` is found, else `false`.
  26007. */
  26008. function setCacheHas(value) {
  26009. return this.__data__.has(value);
  26010. }
  26011. // Add methods to `SetCache`.
  26012. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  26013. SetCache.prototype.has = setCacheHas;
  26014. /*------------------------------------------------------------------------*/
  26015. /**
  26016. * Creates a stack cache object to store key-value pairs.
  26017. *
  26018. * @private
  26019. * @constructor
  26020. * @param {Array} [entries] The key-value pairs to cache.
  26021. */
  26022. function Stack(entries) {
  26023. var data = this.__data__ = new ListCache(entries);
  26024. this.size = data.size;
  26025. }
  26026. /**
  26027. * Removes all key-value entries from the stack.
  26028. *
  26029. * @private
  26030. * @name clear
  26031. * @memberOf Stack
  26032. */
  26033. function stackClear() {
  26034. this.__data__ = new ListCache;
  26035. this.size = 0;
  26036. }
  26037. /**
  26038. * Removes `key` and its value from the stack.
  26039. *
  26040. * @private
  26041. * @name delete
  26042. * @memberOf Stack
  26043. * @param {string} key The key of the value to remove.
  26044. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  26045. */
  26046. function stackDelete(key) {
  26047. var data = this.__data__,
  26048. result = data['delete'](key);
  26049. this.size = data.size;
  26050. return result;
  26051. }
  26052. /**
  26053. * Gets the stack value for `key`.
  26054. *
  26055. * @private
  26056. * @name get
  26057. * @memberOf Stack
  26058. * @param {string} key The key of the value to get.
  26059. * @returns {*} Returns the entry value.
  26060. */
  26061. function stackGet(key) {
  26062. return this.__data__.get(key);
  26063. }
  26064. /**
  26065. * Checks if a stack value for `key` exists.
  26066. *
  26067. * @private
  26068. * @name has
  26069. * @memberOf Stack
  26070. * @param {string} key The key of the entry to check.
  26071. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  26072. */
  26073. function stackHas(key) {
  26074. return this.__data__.has(key);
  26075. }
  26076. /**
  26077. * Sets the stack `key` to `value`.
  26078. *
  26079. * @private
  26080. * @name set
  26081. * @memberOf Stack
  26082. * @param {string} key The key of the value to set.
  26083. * @param {*} value The value to set.
  26084. * @returns {Object} Returns the stack cache instance.
  26085. */
  26086. function stackSet(key, value) {
  26087. var data = this.__data__;
  26088. if (data instanceof ListCache) {
  26089. var pairs = data.__data__;
  26090. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  26091. pairs.push([key, value]);
  26092. this.size = ++data.size;
  26093. return this;
  26094. }
  26095. data = this.__data__ = new MapCache(pairs);
  26096. }
  26097. data.set(key, value);
  26098. this.size = data.size;
  26099. return this;
  26100. }
  26101. // Add methods to `Stack`.
  26102. Stack.prototype.clear = stackClear;
  26103. Stack.prototype['delete'] = stackDelete;
  26104. Stack.prototype.get = stackGet;
  26105. Stack.prototype.has = stackHas;
  26106. Stack.prototype.set = stackSet;
  26107. /*------------------------------------------------------------------------*/
  26108. /**
  26109. * Creates an array of the enumerable property names of the array-like `value`.
  26110. *
  26111. * @private
  26112. * @param {*} value The value to query.
  26113. * @param {boolean} inherited Specify returning inherited property names.
  26114. * @returns {Array} Returns the array of property names.
  26115. */
  26116. function arrayLikeKeys(value, inherited) {
  26117. var isArr = isArray(value),
  26118. isArg = !isArr && isArguments(value),
  26119. isBuff = !isArr && !isArg && isBuffer(value),
  26120. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  26121. skipIndexes = isArr || isArg || isBuff || isType,
  26122. result = skipIndexes ? baseTimes(value.length, String) : [],
  26123. length = result.length;
  26124. for (var key in value) {
  26125. if ((inherited || hasOwnProperty.call(value, key)) &&
  26126. !(skipIndexes && (
  26127. // Safari 9 has enumerable `arguments.length` in strict mode.
  26128. key == 'length' ||
  26129. // Node.js 0.10 has enumerable non-index properties on buffers.
  26130. (isBuff && (key == 'offset' || key == 'parent')) ||
  26131. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  26132. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  26133. // Skip index properties.
  26134. isIndex(key, length)
  26135. ))) {
  26136. result.push(key);
  26137. }
  26138. }
  26139. return result;
  26140. }
  26141. /**
  26142. * A specialized version of `_.sample` for arrays.
  26143. *
  26144. * @private
  26145. * @param {Array} array The array to sample.
  26146. * @returns {*} Returns the random element.
  26147. */
  26148. function arraySample(array) {
  26149. var length = array.length;
  26150. return length ? array[baseRandom(0, length - 1)] : undefined;
  26151. }
  26152. /**
  26153. * A specialized version of `_.sampleSize` for arrays.
  26154. *
  26155. * @private
  26156. * @param {Array} array The array to sample.
  26157. * @param {number} n The number of elements to sample.
  26158. * @returns {Array} Returns the random elements.
  26159. */
  26160. function arraySampleSize(array, n) {
  26161. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  26162. }
  26163. /**
  26164. * A specialized version of `_.shuffle` for arrays.
  26165. *
  26166. * @private
  26167. * @param {Array} array The array to shuffle.
  26168. * @returns {Array} Returns the new shuffled array.
  26169. */
  26170. function arrayShuffle(array) {
  26171. return shuffleSelf(copyArray(array));
  26172. }
  26173. /**
  26174. * This function is like `assignValue` except that it doesn't assign
  26175. * `undefined` values.
  26176. *
  26177. * @private
  26178. * @param {Object} object The object to modify.
  26179. * @param {string} key The key of the property to assign.
  26180. * @param {*} value The value to assign.
  26181. */
  26182. function assignMergeValue(object, key, value) {
  26183. if ((value !== undefined && !eq(object[key], value)) ||
  26184. (value === undefined && !(key in object))) {
  26185. baseAssignValue(object, key, value);
  26186. }
  26187. }
  26188. /**
  26189. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  26190. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  26191. * for equality comparisons.
  26192. *
  26193. * @private
  26194. * @param {Object} object The object to modify.
  26195. * @param {string} key The key of the property to assign.
  26196. * @param {*} value The value to assign.
  26197. */
  26198. function assignValue(object, key, value) {
  26199. var objValue = object[key];
  26200. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  26201. (value === undefined && !(key in object))) {
  26202. baseAssignValue(object, key, value);
  26203. }
  26204. }
  26205. /**
  26206. * Gets the index at which the `key` is found in `array` of key-value pairs.
  26207. *
  26208. * @private
  26209. * @param {Array} array The array to inspect.
  26210. * @param {*} key The key to search for.
  26211. * @returns {number} Returns the index of the matched value, else `-1`.
  26212. */
  26213. function assocIndexOf(array, key) {
  26214. var length = array.length;
  26215. while (length--) {
  26216. if (eq(array[length][0], key)) {
  26217. return length;
  26218. }
  26219. }
  26220. return -1;
  26221. }
  26222. /**
  26223. * Aggregates elements of `collection` on `accumulator` with keys transformed
  26224. * by `iteratee` and values set by `setter`.
  26225. *
  26226. * @private
  26227. * @param {Array|Object} collection The collection to iterate over.
  26228. * @param {Function} setter The function to set `accumulator` values.
  26229. * @param {Function} iteratee The iteratee to transform keys.
  26230. * @param {Object} accumulator The initial aggregated object.
  26231. * @returns {Function} Returns `accumulator`.
  26232. */
  26233. function baseAggregator(collection, setter, iteratee, accumulator) {
  26234. baseEach(collection, function(value, key, collection) {
  26235. setter(accumulator, value, iteratee(value), collection);
  26236. });
  26237. return accumulator;
  26238. }
  26239. /**
  26240. * The base implementation of `_.assign` without support for multiple sources
  26241. * or `customizer` functions.
  26242. *
  26243. * @private
  26244. * @param {Object} object The destination object.
  26245. * @param {Object} source The source object.
  26246. * @returns {Object} Returns `object`.
  26247. */
  26248. function baseAssign(object, source) {
  26249. return object && copyObject(source, keys(source), object);
  26250. }
  26251. /**
  26252. * The base implementation of `_.assignIn` without support for multiple sources
  26253. * or `customizer` functions.
  26254. *
  26255. * @private
  26256. * @param {Object} object The destination object.
  26257. * @param {Object} source The source object.
  26258. * @returns {Object} Returns `object`.
  26259. */
  26260. function baseAssignIn(object, source) {
  26261. return object && copyObject(source, keysIn(source), object);
  26262. }
  26263. /**
  26264. * The base implementation of `assignValue` and `assignMergeValue` without
  26265. * value checks.
  26266. *
  26267. * @private
  26268. * @param {Object} object The object to modify.
  26269. * @param {string} key The key of the property to assign.
  26270. * @param {*} value The value to assign.
  26271. */
  26272. function baseAssignValue(object, key, value) {
  26273. if (key == '__proto__' && defineProperty) {
  26274. defineProperty(object, key, {
  26275. 'configurable': true,
  26276. 'enumerable': true,
  26277. 'value': value,
  26278. 'writable': true
  26279. });
  26280. } else {
  26281. object[key] = value;
  26282. }
  26283. }
  26284. /**
  26285. * The base implementation of `_.at` without support for individual paths.
  26286. *
  26287. * @private
  26288. * @param {Object} object The object to iterate over.
  26289. * @param {string[]} paths The property paths to pick.
  26290. * @returns {Array} Returns the picked elements.
  26291. */
  26292. function baseAt(object, paths) {
  26293. var index = -1,
  26294. length = paths.length,
  26295. result = Array(length),
  26296. skip = object == null;
  26297. while (++index < length) {
  26298. result[index] = skip ? undefined : get(object, paths[index]);
  26299. }
  26300. return result;
  26301. }
  26302. /**
  26303. * The base implementation of `_.clamp` which doesn't coerce arguments.
  26304. *
  26305. * @private
  26306. * @param {number} number The number to clamp.
  26307. * @param {number} [lower] The lower bound.
  26308. * @param {number} upper The upper bound.
  26309. * @returns {number} Returns the clamped number.
  26310. */
  26311. function baseClamp(number, lower, upper) {
  26312. if (number === number) {
  26313. if (upper !== undefined) {
  26314. number = number <= upper ? number : upper;
  26315. }
  26316. if (lower !== undefined) {
  26317. number = number >= lower ? number : lower;
  26318. }
  26319. }
  26320. return number;
  26321. }
  26322. /**
  26323. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  26324. * traversed objects.
  26325. *
  26326. * @private
  26327. * @param {*} value The value to clone.
  26328. * @param {boolean} bitmask The bitmask flags.
  26329. * 1 - Deep clone
  26330. * 2 - Flatten inherited properties
  26331. * 4 - Clone symbols
  26332. * @param {Function} [customizer] The function to customize cloning.
  26333. * @param {string} [key] The key of `value`.
  26334. * @param {Object} [object] The parent object of `value`.
  26335. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  26336. * @returns {*} Returns the cloned value.
  26337. */
  26338. function baseClone(value, bitmask, customizer, key, object, stack) {
  26339. var result,
  26340. isDeep = bitmask & CLONE_DEEP_FLAG,
  26341. isFlat = bitmask & CLONE_FLAT_FLAG,
  26342. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  26343. if (customizer) {
  26344. result = object ? customizer(value, key, object, stack) : customizer(value);
  26345. }
  26346. if (result !== undefined) {
  26347. return result;
  26348. }
  26349. if (!isObject(value)) {
  26350. return value;
  26351. }
  26352. var isArr = isArray(value);
  26353. if (isArr) {
  26354. result = initCloneArray(value);
  26355. if (!isDeep) {
  26356. return copyArray(value, result);
  26357. }
  26358. } else {
  26359. var tag = getTag(value),
  26360. isFunc = tag == funcTag || tag == genTag;
  26361. if (isBuffer(value)) {
  26362. return cloneBuffer(value, isDeep);
  26363. }
  26364. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  26365. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  26366. if (!isDeep) {
  26367. return isFlat
  26368. ? copySymbolsIn(value, baseAssignIn(result, value))
  26369. : copySymbols(value, baseAssign(result, value));
  26370. }
  26371. } else {
  26372. if (!cloneableTags[tag]) {
  26373. return object ? value : {};
  26374. }
  26375. result = initCloneByTag(value, tag, isDeep);
  26376. }
  26377. }
  26378. // Check for circular references and return its corresponding clone.
  26379. stack || (stack = new Stack);
  26380. var stacked = stack.get(value);
  26381. if (stacked) {
  26382. return stacked;
  26383. }
  26384. stack.set(value, result);
  26385. if (isSet(value)) {
  26386. value.forEach(function(subValue) {
  26387. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  26388. });
  26389. } else if (isMap(value)) {
  26390. value.forEach(function(subValue, key) {
  26391. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  26392. });
  26393. }
  26394. var keysFunc = isFull
  26395. ? (isFlat ? getAllKeysIn : getAllKeys)
  26396. : (isFlat ? keysIn : keys);
  26397. var props = isArr ? undefined : keysFunc(value);
  26398. arrayEach(props || value, function(subValue, key) {
  26399. if (props) {
  26400. key = subValue;
  26401. subValue = value[key];
  26402. }
  26403. // Recursively populate clone (susceptible to call stack limits).
  26404. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  26405. });
  26406. return result;
  26407. }
  26408. /**
  26409. * The base implementation of `_.conforms` which doesn't clone `source`.
  26410. *
  26411. * @private
  26412. * @param {Object} source The object of property predicates to conform to.
  26413. * @returns {Function} Returns the new spec function.
  26414. */
  26415. function baseConforms(source) {
  26416. var props = keys(source);
  26417. return function(object) {
  26418. return baseConformsTo(object, source, props);
  26419. };
  26420. }
  26421. /**
  26422. * The base implementation of `_.conformsTo` which accepts `props` to check.
  26423. *
  26424. * @private
  26425. * @param {Object} object The object to inspect.
  26426. * @param {Object} source The object of property predicates to conform to.
  26427. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  26428. */
  26429. function baseConformsTo(object, source, props) {
  26430. var length = props.length;
  26431. if (object == null) {
  26432. return !length;
  26433. }
  26434. object = Object(object);
  26435. while (length--) {
  26436. var key = props[length],
  26437. predicate = source[key],
  26438. value = object[key];
  26439. if ((value === undefined && !(key in object)) || !predicate(value)) {
  26440. return false;
  26441. }
  26442. }
  26443. return true;
  26444. }
  26445. /**
  26446. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  26447. * to provide to `func`.
  26448. *
  26449. * @private
  26450. * @param {Function} func The function to delay.
  26451. * @param {number} wait The number of milliseconds to delay invocation.
  26452. * @param {Array} args The arguments to provide to `func`.
  26453. * @returns {number|Object} Returns the timer id or timeout object.
  26454. */
  26455. function baseDelay(func, wait, args) {
  26456. if (typeof func != 'function') {
  26457. throw new TypeError(FUNC_ERROR_TEXT);
  26458. }
  26459. return setTimeout(function() { func.apply(undefined, args); }, wait);
  26460. }
  26461. /**
  26462. * The base implementation of methods like `_.difference` without support
  26463. * for excluding multiple arrays or iteratee shorthands.
  26464. *
  26465. * @private
  26466. * @param {Array} array The array to inspect.
  26467. * @param {Array} values The values to exclude.
  26468. * @param {Function} [iteratee] The iteratee invoked per element.
  26469. * @param {Function} [comparator] The comparator invoked per element.
  26470. * @returns {Array} Returns the new array of filtered values.
  26471. */
  26472. function baseDifference(array, values, iteratee, comparator) {
  26473. var index = -1,
  26474. includes = arrayIncludes,
  26475. isCommon = true,
  26476. length = array.length,
  26477. result = [],
  26478. valuesLength = values.length;
  26479. if (!length) {
  26480. return result;
  26481. }
  26482. if (iteratee) {
  26483. values = arrayMap(values, baseUnary(iteratee));
  26484. }
  26485. if (comparator) {
  26486. includes = arrayIncludesWith;
  26487. isCommon = false;
  26488. }
  26489. else if (values.length >= LARGE_ARRAY_SIZE) {
  26490. includes = cacheHas;
  26491. isCommon = false;
  26492. values = new SetCache(values);
  26493. }
  26494. outer:
  26495. while (++index < length) {
  26496. var value = array[index],
  26497. computed = iteratee == null ? value : iteratee(value);
  26498. value = (comparator || value !== 0) ? value : 0;
  26499. if (isCommon && computed === computed) {
  26500. var valuesIndex = valuesLength;
  26501. while (valuesIndex--) {
  26502. if (values[valuesIndex] === computed) {
  26503. continue outer;
  26504. }
  26505. }
  26506. result.push(value);
  26507. }
  26508. else if (!includes(values, computed, comparator)) {
  26509. result.push(value);
  26510. }
  26511. }
  26512. return result;
  26513. }
  26514. /**
  26515. * The base implementation of `_.forEach` without support for iteratee shorthands.
  26516. *
  26517. * @private
  26518. * @param {Array|Object} collection The collection to iterate over.
  26519. * @param {Function} iteratee The function invoked per iteration.
  26520. * @returns {Array|Object} Returns `collection`.
  26521. */
  26522. var baseEach = createBaseEach(baseForOwn);
  26523. /**
  26524. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  26525. *
  26526. * @private
  26527. * @param {Array|Object} collection The collection to iterate over.
  26528. * @param {Function} iteratee The function invoked per iteration.
  26529. * @returns {Array|Object} Returns `collection`.
  26530. */
  26531. var baseEachRight = createBaseEach(baseForOwnRight, true);
  26532. /**
  26533. * The base implementation of `_.every` without support for iteratee shorthands.
  26534. *
  26535. * @private
  26536. * @param {Array|Object} collection The collection to iterate over.
  26537. * @param {Function} predicate The function invoked per iteration.
  26538. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  26539. * else `false`
  26540. */
  26541. function baseEvery(collection, predicate) {
  26542. var result = true;
  26543. baseEach(collection, function(value, index, collection) {
  26544. result = !!predicate(value, index, collection);
  26545. return result;
  26546. });
  26547. return result;
  26548. }
  26549. /**
  26550. * The base implementation of methods like `_.max` and `_.min` which accepts a
  26551. * `comparator` to determine the extremum value.
  26552. *
  26553. * @private
  26554. * @param {Array} array The array to iterate over.
  26555. * @param {Function} iteratee The iteratee invoked per iteration.
  26556. * @param {Function} comparator The comparator used to compare values.
  26557. * @returns {*} Returns the extremum value.
  26558. */
  26559. function baseExtremum(array, iteratee, comparator) {
  26560. var index = -1,
  26561. length = array.length;
  26562. while (++index < length) {
  26563. var value = array[index],
  26564. current = iteratee(value);
  26565. if (current != null && (computed === undefined
  26566. ? (current === current && !isSymbol(current))
  26567. : comparator(current, computed)
  26568. )) {
  26569. var computed = current,
  26570. result = value;
  26571. }
  26572. }
  26573. return result;
  26574. }
  26575. /**
  26576. * The base implementation of `_.fill` without an iteratee call guard.
  26577. *
  26578. * @private
  26579. * @param {Array} array The array to fill.
  26580. * @param {*} value The value to fill `array` with.
  26581. * @param {number} [start=0] The start position.
  26582. * @param {number} [end=array.length] The end position.
  26583. * @returns {Array} Returns `array`.
  26584. */
  26585. function baseFill(array, value, start, end) {
  26586. var length = array.length;
  26587. start = toInteger(start);
  26588. if (start < 0) {
  26589. start = -start > length ? 0 : (length + start);
  26590. }
  26591. end = (end === undefined || end > length) ? length : toInteger(end);
  26592. if (end < 0) {
  26593. end += length;
  26594. }
  26595. end = start > end ? 0 : toLength(end);
  26596. while (start < end) {
  26597. array[start++] = value;
  26598. }
  26599. return array;
  26600. }
  26601. /**
  26602. * The base implementation of `_.filter` without support for iteratee shorthands.
  26603. *
  26604. * @private
  26605. * @param {Array|Object} collection The collection to iterate over.
  26606. * @param {Function} predicate The function invoked per iteration.
  26607. * @returns {Array} Returns the new filtered array.
  26608. */
  26609. function baseFilter(collection, predicate) {
  26610. var result = [];
  26611. baseEach(collection, function(value, index, collection) {
  26612. if (predicate(value, index, collection)) {
  26613. result.push(value);
  26614. }
  26615. });
  26616. return result;
  26617. }
  26618. /**
  26619. * The base implementation of `_.flatten` with support for restricting flattening.
  26620. *
  26621. * @private
  26622. * @param {Array} array The array to flatten.
  26623. * @param {number} depth The maximum recursion depth.
  26624. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  26625. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  26626. * @param {Array} [result=[]] The initial result value.
  26627. * @returns {Array} Returns the new flattened array.
  26628. */
  26629. function baseFlatten(array, depth, predicate, isStrict, result) {
  26630. var index = -1,
  26631. length = array.length;
  26632. predicate || (predicate = isFlattenable);
  26633. result || (result = []);
  26634. while (++index < length) {
  26635. var value = array[index];
  26636. if (depth > 0 && predicate(value)) {
  26637. if (depth > 1) {
  26638. // Recursively flatten arrays (susceptible to call stack limits).
  26639. baseFlatten(value, depth - 1, predicate, isStrict, result);
  26640. } else {
  26641. arrayPush(result, value);
  26642. }
  26643. } else if (!isStrict) {
  26644. result[result.length] = value;
  26645. }
  26646. }
  26647. return result;
  26648. }
  26649. /**
  26650. * The base implementation of `baseForOwn` which iterates over `object`
  26651. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  26652. * Iteratee functions may exit iteration early by explicitly returning `false`.
  26653. *
  26654. * @private
  26655. * @param {Object} object The object to iterate over.
  26656. * @param {Function} iteratee The function invoked per iteration.
  26657. * @param {Function} keysFunc The function to get the keys of `object`.
  26658. * @returns {Object} Returns `object`.
  26659. */
  26660. var baseFor = createBaseFor();
  26661. /**
  26662. * This function is like `baseFor` except that it iterates over properties
  26663. * in the opposite order.
  26664. *
  26665. * @private
  26666. * @param {Object} object The object to iterate over.
  26667. * @param {Function} iteratee The function invoked per iteration.
  26668. * @param {Function} keysFunc The function to get the keys of `object`.
  26669. * @returns {Object} Returns `object`.
  26670. */
  26671. var baseForRight = createBaseFor(true);
  26672. /**
  26673. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  26674. *
  26675. * @private
  26676. * @param {Object} object The object to iterate over.
  26677. * @param {Function} iteratee The function invoked per iteration.
  26678. * @returns {Object} Returns `object`.
  26679. */
  26680. function baseForOwn(object, iteratee) {
  26681. return object && baseFor(object, iteratee, keys);
  26682. }
  26683. /**
  26684. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  26685. *
  26686. * @private
  26687. * @param {Object} object The object to iterate over.
  26688. * @param {Function} iteratee The function invoked per iteration.
  26689. * @returns {Object} Returns `object`.
  26690. */
  26691. function baseForOwnRight(object, iteratee) {
  26692. return object && baseForRight(object, iteratee, keys);
  26693. }
  26694. /**
  26695. * The base implementation of `_.functions` which creates an array of
  26696. * `object` function property names filtered from `props`.
  26697. *
  26698. * @private
  26699. * @param {Object} object The object to inspect.
  26700. * @param {Array} props The property names to filter.
  26701. * @returns {Array} Returns the function names.
  26702. */
  26703. function baseFunctions(object, props) {
  26704. return arrayFilter(props, function(key) {
  26705. return isFunction(object[key]);
  26706. });
  26707. }
  26708. /**
  26709. * The base implementation of `_.get` without support for default values.
  26710. *
  26711. * @private
  26712. * @param {Object} object The object to query.
  26713. * @param {Array|string} path The path of the property to get.
  26714. * @returns {*} Returns the resolved value.
  26715. */
  26716. function baseGet(object, path) {
  26717. path = castPath(path, object);
  26718. var index = 0,
  26719. length = path.length;
  26720. while (object != null && index < length) {
  26721. object = object[toKey(path[index++])];
  26722. }
  26723. return (index && index == length) ? object : undefined;
  26724. }
  26725. /**
  26726. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  26727. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  26728. * symbols of `object`.
  26729. *
  26730. * @private
  26731. * @param {Object} object The object to query.
  26732. * @param {Function} keysFunc The function to get the keys of `object`.
  26733. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  26734. * @returns {Array} Returns the array of property names and symbols.
  26735. */
  26736. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  26737. var result = keysFunc(object);
  26738. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  26739. }
  26740. /**
  26741. * The base implementation of `getTag` without fallbacks for buggy environments.
  26742. *
  26743. * @private
  26744. * @param {*} value The value to query.
  26745. * @returns {string} Returns the `toStringTag`.
  26746. */
  26747. function baseGetTag(value) {
  26748. if (value == null) {
  26749. return value === undefined ? undefinedTag : nullTag;
  26750. }
  26751. return (symToStringTag && symToStringTag in Object(value))
  26752. ? getRawTag(value)
  26753. : objectToString(value);
  26754. }
  26755. /**
  26756. * The base implementation of `_.gt` which doesn't coerce arguments.
  26757. *
  26758. * @private
  26759. * @param {*} value The value to compare.
  26760. * @param {*} other The other value to compare.
  26761. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  26762. * else `false`.
  26763. */
  26764. function baseGt(value, other) {
  26765. return value > other;
  26766. }
  26767. /**
  26768. * The base implementation of `_.has` without support for deep paths.
  26769. *
  26770. * @private
  26771. * @param {Object} [object] The object to query.
  26772. * @param {Array|string} key The key to check.
  26773. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  26774. */
  26775. function baseHas(object, key) {
  26776. return object != null && hasOwnProperty.call(object, key);
  26777. }
  26778. /**
  26779. * The base implementation of `_.hasIn` without support for deep paths.
  26780. *
  26781. * @private
  26782. * @param {Object} [object] The object to query.
  26783. * @param {Array|string} key The key to check.
  26784. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  26785. */
  26786. function baseHasIn(object, key) {
  26787. return object != null && key in Object(object);
  26788. }
  26789. /**
  26790. * The base implementation of `_.inRange` which doesn't coerce arguments.
  26791. *
  26792. * @private
  26793. * @param {number} number The number to check.
  26794. * @param {number} start The start of the range.
  26795. * @param {number} end The end of the range.
  26796. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  26797. */
  26798. function baseInRange(number, start, end) {
  26799. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  26800. }
  26801. /**
  26802. * The base implementation of methods like `_.intersection`, without support
  26803. * for iteratee shorthands, that accepts an array of arrays to inspect.
  26804. *
  26805. * @private
  26806. * @param {Array} arrays The arrays to inspect.
  26807. * @param {Function} [iteratee] The iteratee invoked per element.
  26808. * @param {Function} [comparator] The comparator invoked per element.
  26809. * @returns {Array} Returns the new array of shared values.
  26810. */
  26811. function baseIntersection(arrays, iteratee, comparator) {
  26812. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  26813. length = arrays[0].length,
  26814. othLength = arrays.length,
  26815. othIndex = othLength,
  26816. caches = Array(othLength),
  26817. maxLength = Infinity,
  26818. result = [];
  26819. while (othIndex--) {
  26820. var array = arrays[othIndex];
  26821. if (othIndex && iteratee) {
  26822. array = arrayMap(array, baseUnary(iteratee));
  26823. }
  26824. maxLength = nativeMin(array.length, maxLength);
  26825. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  26826. ? new SetCache(othIndex && array)
  26827. : undefined;
  26828. }
  26829. array = arrays[0];
  26830. var index = -1,
  26831. seen = caches[0];
  26832. outer:
  26833. while (++index < length && result.length < maxLength) {
  26834. var value = array[index],
  26835. computed = iteratee ? iteratee(value) : value;
  26836. value = (comparator || value !== 0) ? value : 0;
  26837. if (!(seen
  26838. ? cacheHas(seen, computed)
  26839. : includes(result, computed, comparator)
  26840. )) {
  26841. othIndex = othLength;
  26842. while (--othIndex) {
  26843. var cache = caches[othIndex];
  26844. if (!(cache
  26845. ? cacheHas(cache, computed)
  26846. : includes(arrays[othIndex], computed, comparator))
  26847. ) {
  26848. continue outer;
  26849. }
  26850. }
  26851. if (seen) {
  26852. seen.push(computed);
  26853. }
  26854. result.push(value);
  26855. }
  26856. }
  26857. return result;
  26858. }
  26859. /**
  26860. * The base implementation of `_.invert` and `_.invertBy` which inverts
  26861. * `object` with values transformed by `iteratee` and set by `setter`.
  26862. *
  26863. * @private
  26864. * @param {Object} object The object to iterate over.
  26865. * @param {Function} setter The function to set `accumulator` values.
  26866. * @param {Function} iteratee The iteratee to transform values.
  26867. * @param {Object} accumulator The initial inverted object.
  26868. * @returns {Function} Returns `accumulator`.
  26869. */
  26870. function baseInverter(object, setter, iteratee, accumulator) {
  26871. baseForOwn(object, function(value, key, object) {
  26872. setter(accumulator, iteratee(value), key, object);
  26873. });
  26874. return accumulator;
  26875. }
  26876. /**
  26877. * The base implementation of `_.invoke` without support for individual
  26878. * method arguments.
  26879. *
  26880. * @private
  26881. * @param {Object} object The object to query.
  26882. * @param {Array|string} path The path of the method to invoke.
  26883. * @param {Array} args The arguments to invoke the method with.
  26884. * @returns {*} Returns the result of the invoked method.
  26885. */
  26886. function baseInvoke(object, path, args) {
  26887. path = castPath(path, object);
  26888. object = parent(object, path);
  26889. var func = object == null ? object : object[toKey(last(path))];
  26890. return func == null ? undefined : apply(func, object, args);
  26891. }
  26892. /**
  26893. * The base implementation of `_.isArguments`.
  26894. *
  26895. * @private
  26896. * @param {*} value The value to check.
  26897. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  26898. */
  26899. function baseIsArguments(value) {
  26900. return isObjectLike(value) && baseGetTag(value) == argsTag;
  26901. }
  26902. /**
  26903. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  26904. *
  26905. * @private
  26906. * @param {*} value The value to check.
  26907. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  26908. */
  26909. function baseIsArrayBuffer(value) {
  26910. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  26911. }
  26912. /**
  26913. * The base implementation of `_.isDate` without Node.js optimizations.
  26914. *
  26915. * @private
  26916. * @param {*} value The value to check.
  26917. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  26918. */
  26919. function baseIsDate(value) {
  26920. return isObjectLike(value) && baseGetTag(value) == dateTag;
  26921. }
  26922. /**
  26923. * The base implementation of `_.isEqual` which supports partial comparisons
  26924. * and tracks traversed objects.
  26925. *
  26926. * @private
  26927. * @param {*} value The value to compare.
  26928. * @param {*} other The other value to compare.
  26929. * @param {boolean} bitmask The bitmask flags.
  26930. * 1 - Unordered comparison
  26931. * 2 - Partial comparison
  26932. * @param {Function} [customizer] The function to customize comparisons.
  26933. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  26934. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  26935. */
  26936. function baseIsEqual(value, other, bitmask, customizer, stack) {
  26937. if (value === other) {
  26938. return true;
  26939. }
  26940. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  26941. return value !== value && other !== other;
  26942. }
  26943. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  26944. }
  26945. /**
  26946. * A specialized version of `baseIsEqual` for arrays and objects which performs
  26947. * deep comparisons and tracks traversed objects enabling objects with circular
  26948. * references to be compared.
  26949. *
  26950. * @private
  26951. * @param {Object} object The object to compare.
  26952. * @param {Object} other The other object to compare.
  26953. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  26954. * @param {Function} customizer The function to customize comparisons.
  26955. * @param {Function} equalFunc The function to determine equivalents of values.
  26956. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  26957. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  26958. */
  26959. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  26960. var objIsArr = isArray(object),
  26961. othIsArr = isArray(other),
  26962. objTag = objIsArr ? arrayTag : getTag(object),
  26963. othTag = othIsArr ? arrayTag : getTag(other);
  26964. objTag = objTag == argsTag ? objectTag : objTag;
  26965. othTag = othTag == argsTag ? objectTag : othTag;
  26966. var objIsObj = objTag == objectTag,
  26967. othIsObj = othTag == objectTag,
  26968. isSameTag = objTag == othTag;
  26969. if (isSameTag && isBuffer(object)) {
  26970. if (!isBuffer(other)) {
  26971. return false;
  26972. }
  26973. objIsArr = true;
  26974. objIsObj = false;
  26975. }
  26976. if (isSameTag && !objIsObj) {
  26977. stack || (stack = new Stack);
  26978. return (objIsArr || isTypedArray(object))
  26979. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  26980. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  26981. }
  26982. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  26983. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  26984. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  26985. if (objIsWrapped || othIsWrapped) {
  26986. var objUnwrapped = objIsWrapped ? object.value() : object,
  26987. othUnwrapped = othIsWrapped ? other.value() : other;
  26988. stack || (stack = new Stack);
  26989. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  26990. }
  26991. }
  26992. if (!isSameTag) {
  26993. return false;
  26994. }
  26995. stack || (stack = new Stack);
  26996. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  26997. }
  26998. /**
  26999. * The base implementation of `_.isMap` without Node.js optimizations.
  27000. *
  27001. * @private
  27002. * @param {*} value The value to check.
  27003. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  27004. */
  27005. function baseIsMap(value) {
  27006. return isObjectLike(value) && getTag(value) == mapTag;
  27007. }
  27008. /**
  27009. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  27010. *
  27011. * @private
  27012. * @param {Object} object The object to inspect.
  27013. * @param {Object} source The object of property values to match.
  27014. * @param {Array} matchData The property names, values, and compare flags to match.
  27015. * @param {Function} [customizer] The function to customize comparisons.
  27016. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  27017. */
  27018. function baseIsMatch(object, source, matchData, customizer) {
  27019. var index = matchData.length,
  27020. length = index,
  27021. noCustomizer = !customizer;
  27022. if (object == null) {
  27023. return !length;
  27024. }
  27025. object = Object(object);
  27026. while (index--) {
  27027. var data = matchData[index];
  27028. if ((noCustomizer && data[2])
  27029. ? data[1] !== object[data[0]]
  27030. : !(data[0] in object)
  27031. ) {
  27032. return false;
  27033. }
  27034. }
  27035. while (++index < length) {
  27036. data = matchData[index];
  27037. var key = data[0],
  27038. objValue = object[key],
  27039. srcValue = data[1];
  27040. if (noCustomizer && data[2]) {
  27041. if (objValue === undefined && !(key in object)) {
  27042. return false;
  27043. }
  27044. } else {
  27045. var stack = new Stack;
  27046. if (customizer) {
  27047. var result = customizer(objValue, srcValue, key, object, source, stack);
  27048. }
  27049. if (!(result === undefined
  27050. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  27051. : result
  27052. )) {
  27053. return false;
  27054. }
  27055. }
  27056. }
  27057. return true;
  27058. }
  27059. /**
  27060. * The base implementation of `_.isNative` without bad shim checks.
  27061. *
  27062. * @private
  27063. * @param {*} value The value to check.
  27064. * @returns {boolean} Returns `true` if `value` is a native function,
  27065. * else `false`.
  27066. */
  27067. function baseIsNative(value) {
  27068. if (!isObject(value) || isMasked(value)) {
  27069. return false;
  27070. }
  27071. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  27072. return pattern.test(toSource(value));
  27073. }
  27074. /**
  27075. * The base implementation of `_.isRegExp` without Node.js optimizations.
  27076. *
  27077. * @private
  27078. * @param {*} value The value to check.
  27079. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  27080. */
  27081. function baseIsRegExp(value) {
  27082. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  27083. }
  27084. /**
  27085. * The base implementation of `_.isSet` without Node.js optimizations.
  27086. *
  27087. * @private
  27088. * @param {*} value The value to check.
  27089. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  27090. */
  27091. function baseIsSet(value) {
  27092. return isObjectLike(value) && getTag(value) == setTag;
  27093. }
  27094. /**
  27095. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  27096. *
  27097. * @private
  27098. * @param {*} value The value to check.
  27099. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  27100. */
  27101. function baseIsTypedArray(value) {
  27102. return isObjectLike(value) &&
  27103. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  27104. }
  27105. /**
  27106. * The base implementation of `_.iteratee`.
  27107. *
  27108. * @private
  27109. * @param {*} [value=_.identity] The value to convert to an iteratee.
  27110. * @returns {Function} Returns the iteratee.
  27111. */
  27112. function baseIteratee(value) {
  27113. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  27114. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  27115. if (typeof value == 'function') {
  27116. return value;
  27117. }
  27118. if (value == null) {
  27119. return identity;
  27120. }
  27121. if (typeof value == 'object') {
  27122. return isArray(value)
  27123. ? baseMatchesProperty(value[0], value[1])
  27124. : baseMatches(value);
  27125. }
  27126. return property(value);
  27127. }
  27128. /**
  27129. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  27130. *
  27131. * @private
  27132. * @param {Object} object The object to query.
  27133. * @returns {Array} Returns the array of property names.
  27134. */
  27135. function baseKeys(object) {
  27136. if (!isPrototype(object)) {
  27137. return nativeKeys(object);
  27138. }
  27139. var result = [];
  27140. for (var key in Object(object)) {
  27141. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  27142. result.push(key);
  27143. }
  27144. }
  27145. return result;
  27146. }
  27147. /**
  27148. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  27149. *
  27150. * @private
  27151. * @param {Object} object The object to query.
  27152. * @returns {Array} Returns the array of property names.
  27153. */
  27154. function baseKeysIn(object) {
  27155. if (!isObject(object)) {
  27156. return nativeKeysIn(object);
  27157. }
  27158. var isProto = isPrototype(object),
  27159. result = [];
  27160. for (var key in object) {
  27161. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  27162. result.push(key);
  27163. }
  27164. }
  27165. return result;
  27166. }
  27167. /**
  27168. * The base implementation of `_.lt` which doesn't coerce arguments.
  27169. *
  27170. * @private
  27171. * @param {*} value The value to compare.
  27172. * @param {*} other The other value to compare.
  27173. * @returns {boolean} Returns `true` if `value` is less than `other`,
  27174. * else `false`.
  27175. */
  27176. function baseLt(value, other) {
  27177. return value < other;
  27178. }
  27179. /**
  27180. * The base implementation of `_.map` without support for iteratee shorthands.
  27181. *
  27182. * @private
  27183. * @param {Array|Object} collection The collection to iterate over.
  27184. * @param {Function} iteratee The function invoked per iteration.
  27185. * @returns {Array} Returns the new mapped array.
  27186. */
  27187. function baseMap(collection, iteratee) {
  27188. var index = -1,
  27189. result = isArrayLike(collection) ? Array(collection.length) : [];
  27190. baseEach(collection, function(value, key, collection) {
  27191. result[++index] = iteratee(value, key, collection);
  27192. });
  27193. return result;
  27194. }
  27195. /**
  27196. * The base implementation of `_.matches` which doesn't clone `source`.
  27197. *
  27198. * @private
  27199. * @param {Object} source The object of property values to match.
  27200. * @returns {Function} Returns the new spec function.
  27201. */
  27202. function baseMatches(source) {
  27203. var matchData = getMatchData(source);
  27204. if (matchData.length == 1 && matchData[0][2]) {
  27205. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  27206. }
  27207. return function(object) {
  27208. return object === source || baseIsMatch(object, source, matchData);
  27209. };
  27210. }
  27211. /**
  27212. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  27213. *
  27214. * @private
  27215. * @param {string} path The path of the property to get.
  27216. * @param {*} srcValue The value to match.
  27217. * @returns {Function} Returns the new spec function.
  27218. */
  27219. function baseMatchesProperty(path, srcValue) {
  27220. if (isKey(path) && isStrictComparable(srcValue)) {
  27221. return matchesStrictComparable(toKey(path), srcValue);
  27222. }
  27223. return function(object) {
  27224. var objValue = get(object, path);
  27225. return (objValue === undefined && objValue === srcValue)
  27226. ? hasIn(object, path)
  27227. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  27228. };
  27229. }
  27230. /**
  27231. * The base implementation of `_.merge` without support for multiple sources.
  27232. *
  27233. * @private
  27234. * @param {Object} object The destination object.
  27235. * @param {Object} source The source object.
  27236. * @param {number} srcIndex The index of `source`.
  27237. * @param {Function} [customizer] The function to customize merged values.
  27238. * @param {Object} [stack] Tracks traversed source values and their merged
  27239. * counterparts.
  27240. */
  27241. function baseMerge(object, source, srcIndex, customizer, stack) {
  27242. if (object === source) {
  27243. return;
  27244. }
  27245. baseFor(source, function(srcValue, key) {
  27246. stack || (stack = new Stack);
  27247. if (isObject(srcValue)) {
  27248. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  27249. }
  27250. else {
  27251. var newValue = customizer
  27252. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  27253. : undefined;
  27254. if (newValue === undefined) {
  27255. newValue = srcValue;
  27256. }
  27257. assignMergeValue(object, key, newValue);
  27258. }
  27259. }, keysIn);
  27260. }
  27261. /**
  27262. * A specialized version of `baseMerge` for arrays and objects which performs
  27263. * deep merges and tracks traversed objects enabling objects with circular
  27264. * references to be merged.
  27265. *
  27266. * @private
  27267. * @param {Object} object The destination object.
  27268. * @param {Object} source The source object.
  27269. * @param {string} key The key of the value to merge.
  27270. * @param {number} srcIndex The index of `source`.
  27271. * @param {Function} mergeFunc The function to merge values.
  27272. * @param {Function} [customizer] The function to customize assigned values.
  27273. * @param {Object} [stack] Tracks traversed source values and their merged
  27274. * counterparts.
  27275. */
  27276. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  27277. var objValue = safeGet(object, key),
  27278. srcValue = safeGet(source, key),
  27279. stacked = stack.get(srcValue);
  27280. if (stacked) {
  27281. assignMergeValue(object, key, stacked);
  27282. return;
  27283. }
  27284. var newValue = customizer
  27285. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  27286. : undefined;
  27287. var isCommon = newValue === undefined;
  27288. if (isCommon) {
  27289. var isArr = isArray(srcValue),
  27290. isBuff = !isArr && isBuffer(srcValue),
  27291. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  27292. newValue = srcValue;
  27293. if (isArr || isBuff || isTyped) {
  27294. if (isArray(objValue)) {
  27295. newValue = objValue;
  27296. }
  27297. else if (isArrayLikeObject(objValue)) {
  27298. newValue = copyArray(objValue);
  27299. }
  27300. else if (isBuff) {
  27301. isCommon = false;
  27302. newValue = cloneBuffer(srcValue, true);
  27303. }
  27304. else if (isTyped) {
  27305. isCommon = false;
  27306. newValue = cloneTypedArray(srcValue, true);
  27307. }
  27308. else {
  27309. newValue = [];
  27310. }
  27311. }
  27312. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  27313. newValue = objValue;
  27314. if (isArguments(objValue)) {
  27315. newValue = toPlainObject(objValue);
  27316. }
  27317. else if (!isObject(objValue) || isFunction(objValue)) {
  27318. newValue = initCloneObject(srcValue);
  27319. }
  27320. }
  27321. else {
  27322. isCommon = false;
  27323. }
  27324. }
  27325. if (isCommon) {
  27326. // Recursively merge objects and arrays (susceptible to call stack limits).
  27327. stack.set(srcValue, newValue);
  27328. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  27329. stack['delete'](srcValue);
  27330. }
  27331. assignMergeValue(object, key, newValue);
  27332. }
  27333. /**
  27334. * The base implementation of `_.nth` which doesn't coerce arguments.
  27335. *
  27336. * @private
  27337. * @param {Array} array The array to query.
  27338. * @param {number} n The index of the element to return.
  27339. * @returns {*} Returns the nth element of `array`.
  27340. */
  27341. function baseNth(array, n) {
  27342. var length = array.length;
  27343. if (!length) {
  27344. return;
  27345. }
  27346. n += n < 0 ? length : 0;
  27347. return isIndex(n, length) ? array[n] : undefined;
  27348. }
  27349. /**
  27350. * The base implementation of `_.orderBy` without param guards.
  27351. *
  27352. * @private
  27353. * @param {Array|Object} collection The collection to iterate over.
  27354. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  27355. * @param {string[]} orders The sort orders of `iteratees`.
  27356. * @returns {Array} Returns the new sorted array.
  27357. */
  27358. function baseOrderBy(collection, iteratees, orders) {
  27359. if (iteratees.length) {
  27360. iteratees = arrayMap(iteratees, function(iteratee) {
  27361. if (isArray(iteratee)) {
  27362. return function(value) {
  27363. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  27364. }
  27365. }
  27366. return iteratee;
  27367. });
  27368. } else {
  27369. iteratees = [identity];
  27370. }
  27371. var index = -1;
  27372. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  27373. var result = baseMap(collection, function(value, key, collection) {
  27374. var criteria = arrayMap(iteratees, function(iteratee) {
  27375. return iteratee(value);
  27376. });
  27377. return { 'criteria': criteria, 'index': ++index, 'value': value };
  27378. });
  27379. return baseSortBy(result, function(object, other) {
  27380. return compareMultiple(object, other, orders);
  27381. });
  27382. }
  27383. /**
  27384. * The base implementation of `_.pick` without support for individual
  27385. * property identifiers.
  27386. *
  27387. * @private
  27388. * @param {Object} object The source object.
  27389. * @param {string[]} paths The property paths to pick.
  27390. * @returns {Object} Returns the new object.
  27391. */
  27392. function basePick(object, paths) {
  27393. return basePickBy(object, paths, function(value, path) {
  27394. return hasIn(object, path);
  27395. });
  27396. }
  27397. /**
  27398. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  27399. *
  27400. * @private
  27401. * @param {Object} object The source object.
  27402. * @param {string[]} paths The property paths to pick.
  27403. * @param {Function} predicate The function invoked per property.
  27404. * @returns {Object} Returns the new object.
  27405. */
  27406. function basePickBy(object, paths, predicate) {
  27407. var index = -1,
  27408. length = paths.length,
  27409. result = {};
  27410. while (++index < length) {
  27411. var path = paths[index],
  27412. value = baseGet(object, path);
  27413. if (predicate(value, path)) {
  27414. baseSet(result, castPath(path, object), value);
  27415. }
  27416. }
  27417. return result;
  27418. }
  27419. /**
  27420. * A specialized version of `baseProperty` which supports deep paths.
  27421. *
  27422. * @private
  27423. * @param {Array|string} path The path of the property to get.
  27424. * @returns {Function} Returns the new accessor function.
  27425. */
  27426. function basePropertyDeep(path) {
  27427. return function(object) {
  27428. return baseGet(object, path);
  27429. };
  27430. }
  27431. /**
  27432. * The base implementation of `_.pullAllBy` without support for iteratee
  27433. * shorthands.
  27434. *
  27435. * @private
  27436. * @param {Array} array The array to modify.
  27437. * @param {Array} values The values to remove.
  27438. * @param {Function} [iteratee] The iteratee invoked per element.
  27439. * @param {Function} [comparator] The comparator invoked per element.
  27440. * @returns {Array} Returns `array`.
  27441. */
  27442. function basePullAll(array, values, iteratee, comparator) {
  27443. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  27444. index = -1,
  27445. length = values.length,
  27446. seen = array;
  27447. if (array === values) {
  27448. values = copyArray(values);
  27449. }
  27450. if (iteratee) {
  27451. seen = arrayMap(array, baseUnary(iteratee));
  27452. }
  27453. while (++index < length) {
  27454. var fromIndex = 0,
  27455. value = values[index],
  27456. computed = iteratee ? iteratee(value) : value;
  27457. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  27458. if (seen !== array) {
  27459. splice.call(seen, fromIndex, 1);
  27460. }
  27461. splice.call(array, fromIndex, 1);
  27462. }
  27463. }
  27464. return array;
  27465. }
  27466. /**
  27467. * The base implementation of `_.pullAt` without support for individual
  27468. * indexes or capturing the removed elements.
  27469. *
  27470. * @private
  27471. * @param {Array} array The array to modify.
  27472. * @param {number[]} indexes The indexes of elements to remove.
  27473. * @returns {Array} Returns `array`.
  27474. */
  27475. function basePullAt(array, indexes) {
  27476. var length = array ? indexes.length : 0,
  27477. lastIndex = length - 1;
  27478. while (length--) {
  27479. var index = indexes[length];
  27480. if (length == lastIndex || index !== previous) {
  27481. var previous = index;
  27482. if (isIndex(index)) {
  27483. splice.call(array, index, 1);
  27484. } else {
  27485. baseUnset(array, index);
  27486. }
  27487. }
  27488. }
  27489. return array;
  27490. }
  27491. /**
  27492. * The base implementation of `_.random` without support for returning
  27493. * floating-point numbers.
  27494. *
  27495. * @private
  27496. * @param {number} lower The lower bound.
  27497. * @param {number} upper The upper bound.
  27498. * @returns {number} Returns the random number.
  27499. */
  27500. function baseRandom(lower, upper) {
  27501. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  27502. }
  27503. /**
  27504. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  27505. * coerce arguments.
  27506. *
  27507. * @private
  27508. * @param {number} start The start of the range.
  27509. * @param {number} end The end of the range.
  27510. * @param {number} step The value to increment or decrement by.
  27511. * @param {boolean} [fromRight] Specify iterating from right to left.
  27512. * @returns {Array} Returns the range of numbers.
  27513. */
  27514. function baseRange(start, end, step, fromRight) {
  27515. var index = -1,
  27516. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  27517. result = Array(length);
  27518. while (length--) {
  27519. result[fromRight ? length : ++index] = start;
  27520. start += step;
  27521. }
  27522. return result;
  27523. }
  27524. /**
  27525. * The base implementation of `_.repeat` which doesn't coerce arguments.
  27526. *
  27527. * @private
  27528. * @param {string} string The string to repeat.
  27529. * @param {number} n The number of times to repeat the string.
  27530. * @returns {string} Returns the repeated string.
  27531. */
  27532. function baseRepeat(string, n) {
  27533. var result = '';
  27534. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  27535. return result;
  27536. }
  27537. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  27538. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  27539. do {
  27540. if (n % 2) {
  27541. result += string;
  27542. }
  27543. n = nativeFloor(n / 2);
  27544. if (n) {
  27545. string += string;
  27546. }
  27547. } while (n);
  27548. return result;
  27549. }
  27550. /**
  27551. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  27552. *
  27553. * @private
  27554. * @param {Function} func The function to apply a rest parameter to.
  27555. * @param {number} [start=func.length-1] The start position of the rest parameter.
  27556. * @returns {Function} Returns the new function.
  27557. */
  27558. function baseRest(func, start) {
  27559. return setToString(overRest(func, start, identity), func + '');
  27560. }
  27561. /**
  27562. * The base implementation of `_.sample`.
  27563. *
  27564. * @private
  27565. * @param {Array|Object} collection The collection to sample.
  27566. * @returns {*} Returns the random element.
  27567. */
  27568. function baseSample(collection) {
  27569. return arraySample(values(collection));
  27570. }
  27571. /**
  27572. * The base implementation of `_.sampleSize` without param guards.
  27573. *
  27574. * @private
  27575. * @param {Array|Object} collection The collection to sample.
  27576. * @param {number} n The number of elements to sample.
  27577. * @returns {Array} Returns the random elements.
  27578. */
  27579. function baseSampleSize(collection, n) {
  27580. var array = values(collection);
  27581. return shuffleSelf(array, baseClamp(n, 0, array.length));
  27582. }
  27583. /**
  27584. * The base implementation of `_.set`.
  27585. *
  27586. * @private
  27587. * @param {Object} object The object to modify.
  27588. * @param {Array|string} path The path of the property to set.
  27589. * @param {*} value The value to set.
  27590. * @param {Function} [customizer] The function to customize path creation.
  27591. * @returns {Object} Returns `object`.
  27592. */
  27593. function baseSet(object, path, value, customizer) {
  27594. if (!isObject(object)) {
  27595. return object;
  27596. }
  27597. path = castPath(path, object);
  27598. var index = -1,
  27599. length = path.length,
  27600. lastIndex = length - 1,
  27601. nested = object;
  27602. while (nested != null && ++index < length) {
  27603. var key = toKey(path[index]),
  27604. newValue = value;
  27605. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  27606. return object;
  27607. }
  27608. if (index != lastIndex) {
  27609. var objValue = nested[key];
  27610. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  27611. if (newValue === undefined) {
  27612. newValue = isObject(objValue)
  27613. ? objValue
  27614. : (isIndex(path[index + 1]) ? [] : {});
  27615. }
  27616. }
  27617. assignValue(nested, key, newValue);
  27618. nested = nested[key];
  27619. }
  27620. return object;
  27621. }
  27622. /**
  27623. * The base implementation of `setData` without support for hot loop shorting.
  27624. *
  27625. * @private
  27626. * @param {Function} func The function to associate metadata with.
  27627. * @param {*} data The metadata.
  27628. * @returns {Function} Returns `func`.
  27629. */
  27630. var baseSetData = !metaMap ? identity : function(func, data) {
  27631. metaMap.set(func, data);
  27632. return func;
  27633. };
  27634. /**
  27635. * The base implementation of `setToString` without support for hot loop shorting.
  27636. *
  27637. * @private
  27638. * @param {Function} func The function to modify.
  27639. * @param {Function} string The `toString` result.
  27640. * @returns {Function} Returns `func`.
  27641. */
  27642. var baseSetToString = !defineProperty ? identity : function(func, string) {
  27643. return defineProperty(func, 'toString', {
  27644. 'configurable': true,
  27645. 'enumerable': false,
  27646. 'value': constant(string),
  27647. 'writable': true
  27648. });
  27649. };
  27650. /**
  27651. * The base implementation of `_.shuffle`.
  27652. *
  27653. * @private
  27654. * @param {Array|Object} collection The collection to shuffle.
  27655. * @returns {Array} Returns the new shuffled array.
  27656. */
  27657. function baseShuffle(collection) {
  27658. return shuffleSelf(values(collection));
  27659. }
  27660. /**
  27661. * The base implementation of `_.slice` without an iteratee call guard.
  27662. *
  27663. * @private
  27664. * @param {Array} array The array to slice.
  27665. * @param {number} [start=0] The start position.
  27666. * @param {number} [end=array.length] The end position.
  27667. * @returns {Array} Returns the slice of `array`.
  27668. */
  27669. function baseSlice(array, start, end) {
  27670. var index = -1,
  27671. length = array.length;
  27672. if (start < 0) {
  27673. start = -start > length ? 0 : (length + start);
  27674. }
  27675. end = end > length ? length : end;
  27676. if (end < 0) {
  27677. end += length;
  27678. }
  27679. length = start > end ? 0 : ((end - start) >>> 0);
  27680. start >>>= 0;
  27681. var result = Array(length);
  27682. while (++index < length) {
  27683. result[index] = array[index + start];
  27684. }
  27685. return result;
  27686. }
  27687. /**
  27688. * The base implementation of `_.some` without support for iteratee shorthands.
  27689. *
  27690. * @private
  27691. * @param {Array|Object} collection The collection to iterate over.
  27692. * @param {Function} predicate The function invoked per iteration.
  27693. * @returns {boolean} Returns `true` if any element passes the predicate check,
  27694. * else `false`.
  27695. */
  27696. function baseSome(collection, predicate) {
  27697. var result;
  27698. baseEach(collection, function(value, index, collection) {
  27699. result = predicate(value, index, collection);
  27700. return !result;
  27701. });
  27702. return !!result;
  27703. }
  27704. /**
  27705. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  27706. * performs a binary search of `array` to determine the index at which `value`
  27707. * should be inserted into `array` in order to maintain its sort order.
  27708. *
  27709. * @private
  27710. * @param {Array} array The sorted array to inspect.
  27711. * @param {*} value The value to evaluate.
  27712. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  27713. * @returns {number} Returns the index at which `value` should be inserted
  27714. * into `array`.
  27715. */
  27716. function baseSortedIndex(array, value, retHighest) {
  27717. var low = 0,
  27718. high = array == null ? low : array.length;
  27719. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  27720. while (low < high) {
  27721. var mid = (low + high) >>> 1,
  27722. computed = array[mid];
  27723. if (computed !== null && !isSymbol(computed) &&
  27724. (retHighest ? (computed <= value) : (computed < value))) {
  27725. low = mid + 1;
  27726. } else {
  27727. high = mid;
  27728. }
  27729. }
  27730. return high;
  27731. }
  27732. return baseSortedIndexBy(array, value, identity, retHighest);
  27733. }
  27734. /**
  27735. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  27736. * which invokes `iteratee` for `value` and each element of `array` to compute
  27737. * their sort ranking. The iteratee is invoked with one argument; (value).
  27738. *
  27739. * @private
  27740. * @param {Array} array The sorted array to inspect.
  27741. * @param {*} value The value to evaluate.
  27742. * @param {Function} iteratee The iteratee invoked per element.
  27743. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  27744. * @returns {number} Returns the index at which `value` should be inserted
  27745. * into `array`.
  27746. */
  27747. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  27748. var low = 0,
  27749. high = array == null ? 0 : array.length;
  27750. if (high === 0) {
  27751. return 0;
  27752. }
  27753. value = iteratee(value);
  27754. var valIsNaN = value !== value,
  27755. valIsNull = value === null,
  27756. valIsSymbol = isSymbol(value),
  27757. valIsUndefined = value === undefined;
  27758. while (low < high) {
  27759. var mid = nativeFloor((low + high) / 2),
  27760. computed = iteratee(array[mid]),
  27761. othIsDefined = computed !== undefined,
  27762. othIsNull = computed === null,
  27763. othIsReflexive = computed === computed,
  27764. othIsSymbol = isSymbol(computed);
  27765. if (valIsNaN) {
  27766. var setLow = retHighest || othIsReflexive;
  27767. } else if (valIsUndefined) {
  27768. setLow = othIsReflexive && (retHighest || othIsDefined);
  27769. } else if (valIsNull) {
  27770. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  27771. } else if (valIsSymbol) {
  27772. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  27773. } else if (othIsNull || othIsSymbol) {
  27774. setLow = false;
  27775. } else {
  27776. setLow = retHighest ? (computed <= value) : (computed < value);
  27777. }
  27778. if (setLow) {
  27779. low = mid + 1;
  27780. } else {
  27781. high = mid;
  27782. }
  27783. }
  27784. return nativeMin(high, MAX_ARRAY_INDEX);
  27785. }
  27786. /**
  27787. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  27788. * support for iteratee shorthands.
  27789. *
  27790. * @private
  27791. * @param {Array} array The array to inspect.
  27792. * @param {Function} [iteratee] The iteratee invoked per element.
  27793. * @returns {Array} Returns the new duplicate free array.
  27794. */
  27795. function baseSortedUniq(array, iteratee) {
  27796. var index = -1,
  27797. length = array.length,
  27798. resIndex = 0,
  27799. result = [];
  27800. while (++index < length) {
  27801. var value = array[index],
  27802. computed = iteratee ? iteratee(value) : value;
  27803. if (!index || !eq(computed, seen)) {
  27804. var seen = computed;
  27805. result[resIndex++] = value === 0 ? 0 : value;
  27806. }
  27807. }
  27808. return result;
  27809. }
  27810. /**
  27811. * The base implementation of `_.toNumber` which doesn't ensure correct
  27812. * conversions of binary, hexadecimal, or octal string values.
  27813. *
  27814. * @private
  27815. * @param {*} value The value to process.
  27816. * @returns {number} Returns the number.
  27817. */
  27818. function baseToNumber(value) {
  27819. if (typeof value == 'number') {
  27820. return value;
  27821. }
  27822. if (isSymbol(value)) {
  27823. return NAN;
  27824. }
  27825. return +value;
  27826. }
  27827. /**
  27828. * The base implementation of `_.toString` which doesn't convert nullish
  27829. * values to empty strings.
  27830. *
  27831. * @private
  27832. * @param {*} value The value to process.
  27833. * @returns {string} Returns the string.
  27834. */
  27835. function baseToString(value) {
  27836. // Exit early for strings to avoid a performance hit in some environments.
  27837. if (typeof value == 'string') {
  27838. return value;
  27839. }
  27840. if (isArray(value)) {
  27841. // Recursively convert values (susceptible to call stack limits).
  27842. return arrayMap(value, baseToString) + '';
  27843. }
  27844. if (isSymbol(value)) {
  27845. return symbolToString ? symbolToString.call(value) : '';
  27846. }
  27847. var result = (value + '');
  27848. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  27849. }
  27850. /**
  27851. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  27852. *
  27853. * @private
  27854. * @param {Array} array The array to inspect.
  27855. * @param {Function} [iteratee] The iteratee invoked per element.
  27856. * @param {Function} [comparator] The comparator invoked per element.
  27857. * @returns {Array} Returns the new duplicate free array.
  27858. */
  27859. function baseUniq(array, iteratee, comparator) {
  27860. var index = -1,
  27861. includes = arrayIncludes,
  27862. length = array.length,
  27863. isCommon = true,
  27864. result = [],
  27865. seen = result;
  27866. if (comparator) {
  27867. isCommon = false;
  27868. includes = arrayIncludesWith;
  27869. }
  27870. else if (length >= LARGE_ARRAY_SIZE) {
  27871. var set = iteratee ? null : createSet(array);
  27872. if (set) {
  27873. return setToArray(set);
  27874. }
  27875. isCommon = false;
  27876. includes = cacheHas;
  27877. seen = new SetCache;
  27878. }
  27879. else {
  27880. seen = iteratee ? [] : result;
  27881. }
  27882. outer:
  27883. while (++index < length) {
  27884. var value = array[index],
  27885. computed = iteratee ? iteratee(value) : value;
  27886. value = (comparator || value !== 0) ? value : 0;
  27887. if (isCommon && computed === computed) {
  27888. var seenIndex = seen.length;
  27889. while (seenIndex--) {
  27890. if (seen[seenIndex] === computed) {
  27891. continue outer;
  27892. }
  27893. }
  27894. if (iteratee) {
  27895. seen.push(computed);
  27896. }
  27897. result.push(value);
  27898. }
  27899. else if (!includes(seen, computed, comparator)) {
  27900. if (seen !== result) {
  27901. seen.push(computed);
  27902. }
  27903. result.push(value);
  27904. }
  27905. }
  27906. return result;
  27907. }
  27908. /**
  27909. * The base implementation of `_.unset`.
  27910. *
  27911. * @private
  27912. * @param {Object} object The object to modify.
  27913. * @param {Array|string} path The property path to unset.
  27914. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  27915. */
  27916. function baseUnset(object, path) {
  27917. path = castPath(path, object);
  27918. object = parent(object, path);
  27919. return object == null || delete object[toKey(last(path))];
  27920. }
  27921. /**
  27922. * The base implementation of `_.update`.
  27923. *
  27924. * @private
  27925. * @param {Object} object The object to modify.
  27926. * @param {Array|string} path The path of the property to update.
  27927. * @param {Function} updater The function to produce the updated value.
  27928. * @param {Function} [customizer] The function to customize path creation.
  27929. * @returns {Object} Returns `object`.
  27930. */
  27931. function baseUpdate(object, path, updater, customizer) {
  27932. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  27933. }
  27934. /**
  27935. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  27936. * without support for iteratee shorthands.
  27937. *
  27938. * @private
  27939. * @param {Array} array The array to query.
  27940. * @param {Function} predicate The function invoked per iteration.
  27941. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  27942. * @param {boolean} [fromRight] Specify iterating from right to left.
  27943. * @returns {Array} Returns the slice of `array`.
  27944. */
  27945. function baseWhile(array, predicate, isDrop, fromRight) {
  27946. var length = array.length,
  27947. index = fromRight ? length : -1;
  27948. while ((fromRight ? index-- : ++index < length) &&
  27949. predicate(array[index], index, array)) {}
  27950. return isDrop
  27951. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  27952. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  27953. }
  27954. /**
  27955. * The base implementation of `wrapperValue` which returns the result of
  27956. * performing a sequence of actions on the unwrapped `value`, where each
  27957. * successive action is supplied the return value of the previous.
  27958. *
  27959. * @private
  27960. * @param {*} value The unwrapped value.
  27961. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  27962. * @returns {*} Returns the resolved value.
  27963. */
  27964. function baseWrapperValue(value, actions) {
  27965. var result = value;
  27966. if (result instanceof LazyWrapper) {
  27967. result = result.value();
  27968. }
  27969. return arrayReduce(actions, function(result, action) {
  27970. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  27971. }, result);
  27972. }
  27973. /**
  27974. * The base implementation of methods like `_.xor`, without support for
  27975. * iteratee shorthands, that accepts an array of arrays to inspect.
  27976. *
  27977. * @private
  27978. * @param {Array} arrays The arrays to inspect.
  27979. * @param {Function} [iteratee] The iteratee invoked per element.
  27980. * @param {Function} [comparator] The comparator invoked per element.
  27981. * @returns {Array} Returns the new array of values.
  27982. */
  27983. function baseXor(arrays, iteratee, comparator) {
  27984. var length = arrays.length;
  27985. if (length < 2) {
  27986. return length ? baseUniq(arrays[0]) : [];
  27987. }
  27988. var index = -1,
  27989. result = Array(length);
  27990. while (++index < length) {
  27991. var array = arrays[index],
  27992. othIndex = -1;
  27993. while (++othIndex < length) {
  27994. if (othIndex != index) {
  27995. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  27996. }
  27997. }
  27998. }
  27999. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  28000. }
  28001. /**
  28002. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  28003. *
  28004. * @private
  28005. * @param {Array} props The property identifiers.
  28006. * @param {Array} values The property values.
  28007. * @param {Function} assignFunc The function to assign values.
  28008. * @returns {Object} Returns the new object.
  28009. */
  28010. function baseZipObject(props, values, assignFunc) {
  28011. var index = -1,
  28012. length = props.length,
  28013. valsLength = values.length,
  28014. result = {};
  28015. while (++index < length) {
  28016. var value = index < valsLength ? values[index] : undefined;
  28017. assignFunc(result, props[index], value);
  28018. }
  28019. return result;
  28020. }
  28021. /**
  28022. * Casts `value` to an empty array if it's not an array like object.
  28023. *
  28024. * @private
  28025. * @param {*} value The value to inspect.
  28026. * @returns {Array|Object} Returns the cast array-like object.
  28027. */
  28028. function castArrayLikeObject(value) {
  28029. return isArrayLikeObject(value) ? value : [];
  28030. }
  28031. /**
  28032. * Casts `value` to `identity` if it's not a function.
  28033. *
  28034. * @private
  28035. * @param {*} value The value to inspect.
  28036. * @returns {Function} Returns cast function.
  28037. */
  28038. function castFunction(value) {
  28039. return typeof value == 'function' ? value : identity;
  28040. }
  28041. /**
  28042. * Casts `value` to a path array if it's not one.
  28043. *
  28044. * @private
  28045. * @param {*} value The value to inspect.
  28046. * @param {Object} [object] The object to query keys on.
  28047. * @returns {Array} Returns the cast property path array.
  28048. */
  28049. function castPath(value, object) {
  28050. if (isArray(value)) {
  28051. return value;
  28052. }
  28053. return isKey(value, object) ? [value] : stringToPath(toString(value));
  28054. }
  28055. /**
  28056. * A `baseRest` alias which can be replaced with `identity` by module
  28057. * replacement plugins.
  28058. *
  28059. * @private
  28060. * @type {Function}
  28061. * @param {Function} func The function to apply a rest parameter to.
  28062. * @returns {Function} Returns the new function.
  28063. */
  28064. var castRest = baseRest;
  28065. /**
  28066. * Casts `array` to a slice if it's needed.
  28067. *
  28068. * @private
  28069. * @param {Array} array The array to inspect.
  28070. * @param {number} start The start position.
  28071. * @param {number} [end=array.length] The end position.
  28072. * @returns {Array} Returns the cast slice.
  28073. */
  28074. function castSlice(array, start, end) {
  28075. var length = array.length;
  28076. end = end === undefined ? length : end;
  28077. return (!start && end >= length) ? array : baseSlice(array, start, end);
  28078. }
  28079. /**
  28080. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  28081. *
  28082. * @private
  28083. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  28084. */
  28085. var clearTimeout = ctxClearTimeout || function(id) {
  28086. return root.clearTimeout(id);
  28087. };
  28088. /**
  28089. * Creates a clone of `buffer`.
  28090. *
  28091. * @private
  28092. * @param {Buffer} buffer The buffer to clone.
  28093. * @param {boolean} [isDeep] Specify a deep clone.
  28094. * @returns {Buffer} Returns the cloned buffer.
  28095. */
  28096. function cloneBuffer(buffer, isDeep) {
  28097. if (isDeep) {
  28098. return buffer.slice();
  28099. }
  28100. var length = buffer.length,
  28101. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  28102. buffer.copy(result);
  28103. return result;
  28104. }
  28105. /**
  28106. * Creates a clone of `arrayBuffer`.
  28107. *
  28108. * @private
  28109. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  28110. * @returns {ArrayBuffer} Returns the cloned array buffer.
  28111. */
  28112. function cloneArrayBuffer(arrayBuffer) {
  28113. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  28114. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  28115. return result;
  28116. }
  28117. /**
  28118. * Creates a clone of `dataView`.
  28119. *
  28120. * @private
  28121. * @param {Object} dataView The data view to clone.
  28122. * @param {boolean} [isDeep] Specify a deep clone.
  28123. * @returns {Object} Returns the cloned data view.
  28124. */
  28125. function cloneDataView(dataView, isDeep) {
  28126. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  28127. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  28128. }
  28129. /**
  28130. * Creates a clone of `regexp`.
  28131. *
  28132. * @private
  28133. * @param {Object} regexp The regexp to clone.
  28134. * @returns {Object} Returns the cloned regexp.
  28135. */
  28136. function cloneRegExp(regexp) {
  28137. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  28138. result.lastIndex = regexp.lastIndex;
  28139. return result;
  28140. }
  28141. /**
  28142. * Creates a clone of the `symbol` object.
  28143. *
  28144. * @private
  28145. * @param {Object} symbol The symbol object to clone.
  28146. * @returns {Object} Returns the cloned symbol object.
  28147. */
  28148. function cloneSymbol(symbol) {
  28149. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  28150. }
  28151. /**
  28152. * Creates a clone of `typedArray`.
  28153. *
  28154. * @private
  28155. * @param {Object} typedArray The typed array to clone.
  28156. * @param {boolean} [isDeep] Specify a deep clone.
  28157. * @returns {Object} Returns the cloned typed array.
  28158. */
  28159. function cloneTypedArray(typedArray, isDeep) {
  28160. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  28161. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  28162. }
  28163. /**
  28164. * Compares values to sort them in ascending order.
  28165. *
  28166. * @private
  28167. * @param {*} value The value to compare.
  28168. * @param {*} other The other value to compare.
  28169. * @returns {number} Returns the sort order indicator for `value`.
  28170. */
  28171. function compareAscending(value, other) {
  28172. if (value !== other) {
  28173. var valIsDefined = value !== undefined,
  28174. valIsNull = value === null,
  28175. valIsReflexive = value === value,
  28176. valIsSymbol = isSymbol(value);
  28177. var othIsDefined = other !== undefined,
  28178. othIsNull = other === null,
  28179. othIsReflexive = other === other,
  28180. othIsSymbol = isSymbol(other);
  28181. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  28182. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  28183. (valIsNull && othIsDefined && othIsReflexive) ||
  28184. (!valIsDefined && othIsReflexive) ||
  28185. !valIsReflexive) {
  28186. return 1;
  28187. }
  28188. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  28189. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  28190. (othIsNull && valIsDefined && valIsReflexive) ||
  28191. (!othIsDefined && valIsReflexive) ||
  28192. !othIsReflexive) {
  28193. return -1;
  28194. }
  28195. }
  28196. return 0;
  28197. }
  28198. /**
  28199. * Used by `_.orderBy` to compare multiple properties of a value to another
  28200. * and stable sort them.
  28201. *
  28202. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  28203. * specify an order of "desc" for descending or "asc" for ascending sort order
  28204. * of corresponding values.
  28205. *
  28206. * @private
  28207. * @param {Object} object The object to compare.
  28208. * @param {Object} other The other object to compare.
  28209. * @param {boolean[]|string[]} orders The order to sort by for each property.
  28210. * @returns {number} Returns the sort order indicator for `object`.
  28211. */
  28212. function compareMultiple(object, other, orders) {
  28213. var index = -1,
  28214. objCriteria = object.criteria,
  28215. othCriteria = other.criteria,
  28216. length = objCriteria.length,
  28217. ordersLength = orders.length;
  28218. while (++index < length) {
  28219. var result = compareAscending(objCriteria[index], othCriteria[index]);
  28220. if (result) {
  28221. if (index >= ordersLength) {
  28222. return result;
  28223. }
  28224. var order = orders[index];
  28225. return result * (order == 'desc' ? -1 : 1);
  28226. }
  28227. }
  28228. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  28229. // that causes it, under certain circumstances, to provide the same value for
  28230. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  28231. // for more details.
  28232. //
  28233. // This also ensures a stable sort in V8 and other engines.
  28234. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  28235. return object.index - other.index;
  28236. }
  28237. /**
  28238. * Creates an array that is the composition of partially applied arguments,
  28239. * placeholders, and provided arguments into a single array of arguments.
  28240. *
  28241. * @private
  28242. * @param {Array} args The provided arguments.
  28243. * @param {Array} partials The arguments to prepend to those provided.
  28244. * @param {Array} holders The `partials` placeholder indexes.
  28245. * @params {boolean} [isCurried] Specify composing for a curried function.
  28246. * @returns {Array} Returns the new array of composed arguments.
  28247. */
  28248. function composeArgs(args, partials, holders, isCurried) {
  28249. var argsIndex = -1,
  28250. argsLength = args.length,
  28251. holdersLength = holders.length,
  28252. leftIndex = -1,
  28253. leftLength = partials.length,
  28254. rangeLength = nativeMax(argsLength - holdersLength, 0),
  28255. result = Array(leftLength + rangeLength),
  28256. isUncurried = !isCurried;
  28257. while (++leftIndex < leftLength) {
  28258. result[leftIndex] = partials[leftIndex];
  28259. }
  28260. while (++argsIndex < holdersLength) {
  28261. if (isUncurried || argsIndex < argsLength) {
  28262. result[holders[argsIndex]] = args[argsIndex];
  28263. }
  28264. }
  28265. while (rangeLength--) {
  28266. result[leftIndex++] = args[argsIndex++];
  28267. }
  28268. return result;
  28269. }
  28270. /**
  28271. * This function is like `composeArgs` except that the arguments composition
  28272. * is tailored for `_.partialRight`.
  28273. *
  28274. * @private
  28275. * @param {Array} args The provided arguments.
  28276. * @param {Array} partials The arguments to append to those provided.
  28277. * @param {Array} holders The `partials` placeholder indexes.
  28278. * @params {boolean} [isCurried] Specify composing for a curried function.
  28279. * @returns {Array} Returns the new array of composed arguments.
  28280. */
  28281. function composeArgsRight(args, partials, holders, isCurried) {
  28282. var argsIndex = -1,
  28283. argsLength = args.length,
  28284. holdersIndex = -1,
  28285. holdersLength = holders.length,
  28286. rightIndex = -1,
  28287. rightLength = partials.length,
  28288. rangeLength = nativeMax(argsLength - holdersLength, 0),
  28289. result = Array(rangeLength + rightLength),
  28290. isUncurried = !isCurried;
  28291. while (++argsIndex < rangeLength) {
  28292. result[argsIndex] = args[argsIndex];
  28293. }
  28294. var offset = argsIndex;
  28295. while (++rightIndex < rightLength) {
  28296. result[offset + rightIndex] = partials[rightIndex];
  28297. }
  28298. while (++holdersIndex < holdersLength) {
  28299. if (isUncurried || argsIndex < argsLength) {
  28300. result[offset + holders[holdersIndex]] = args[argsIndex++];
  28301. }
  28302. }
  28303. return result;
  28304. }
  28305. /**
  28306. * Copies the values of `source` to `array`.
  28307. *
  28308. * @private
  28309. * @param {Array} source The array to copy values from.
  28310. * @param {Array} [array=[]] The array to copy values to.
  28311. * @returns {Array} Returns `array`.
  28312. */
  28313. function copyArray(source, array) {
  28314. var index = -1,
  28315. length = source.length;
  28316. array || (array = Array(length));
  28317. while (++index < length) {
  28318. array[index] = source[index];
  28319. }
  28320. return array;
  28321. }
  28322. /**
  28323. * Copies properties of `source` to `object`.
  28324. *
  28325. * @private
  28326. * @param {Object} source The object to copy properties from.
  28327. * @param {Array} props The property identifiers to copy.
  28328. * @param {Object} [object={}] The object to copy properties to.
  28329. * @param {Function} [customizer] The function to customize copied values.
  28330. * @returns {Object} Returns `object`.
  28331. */
  28332. function copyObject(source, props, object, customizer) {
  28333. var isNew = !object;
  28334. object || (object = {});
  28335. var index = -1,
  28336. length = props.length;
  28337. while (++index < length) {
  28338. var key = props[index];
  28339. var newValue = customizer
  28340. ? customizer(object[key], source[key], key, object, source)
  28341. : undefined;
  28342. if (newValue === undefined) {
  28343. newValue = source[key];
  28344. }
  28345. if (isNew) {
  28346. baseAssignValue(object, key, newValue);
  28347. } else {
  28348. assignValue(object, key, newValue);
  28349. }
  28350. }
  28351. return object;
  28352. }
  28353. /**
  28354. * Copies own symbols of `source` to `object`.
  28355. *
  28356. * @private
  28357. * @param {Object} source The object to copy symbols from.
  28358. * @param {Object} [object={}] The object to copy symbols to.
  28359. * @returns {Object} Returns `object`.
  28360. */
  28361. function copySymbols(source, object) {
  28362. return copyObject(source, getSymbols(source), object);
  28363. }
  28364. /**
  28365. * Copies own and inherited symbols of `source` to `object`.
  28366. *
  28367. * @private
  28368. * @param {Object} source The object to copy symbols from.
  28369. * @param {Object} [object={}] The object to copy symbols to.
  28370. * @returns {Object} Returns `object`.
  28371. */
  28372. function copySymbolsIn(source, object) {
  28373. return copyObject(source, getSymbolsIn(source), object);
  28374. }
  28375. /**
  28376. * Creates a function like `_.groupBy`.
  28377. *
  28378. * @private
  28379. * @param {Function} setter The function to set accumulator values.
  28380. * @param {Function} [initializer] The accumulator object initializer.
  28381. * @returns {Function} Returns the new aggregator function.
  28382. */
  28383. function createAggregator(setter, initializer) {
  28384. return function(collection, iteratee) {
  28385. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  28386. accumulator = initializer ? initializer() : {};
  28387. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  28388. };
  28389. }
  28390. /**
  28391. * Creates a function like `_.assign`.
  28392. *
  28393. * @private
  28394. * @param {Function} assigner The function to assign values.
  28395. * @returns {Function} Returns the new assigner function.
  28396. */
  28397. function createAssigner(assigner) {
  28398. return baseRest(function(object, sources) {
  28399. var index = -1,
  28400. length = sources.length,
  28401. customizer = length > 1 ? sources[length - 1] : undefined,
  28402. guard = length > 2 ? sources[2] : undefined;
  28403. customizer = (assigner.length > 3 && typeof customizer == 'function')
  28404. ? (length--, customizer)
  28405. : undefined;
  28406. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  28407. customizer = length < 3 ? undefined : customizer;
  28408. length = 1;
  28409. }
  28410. object = Object(object);
  28411. while (++index < length) {
  28412. var source = sources[index];
  28413. if (source) {
  28414. assigner(object, source, index, customizer);
  28415. }
  28416. }
  28417. return object;
  28418. });
  28419. }
  28420. /**
  28421. * Creates a `baseEach` or `baseEachRight` function.
  28422. *
  28423. * @private
  28424. * @param {Function} eachFunc The function to iterate over a collection.
  28425. * @param {boolean} [fromRight] Specify iterating from right to left.
  28426. * @returns {Function} Returns the new base function.
  28427. */
  28428. function createBaseEach(eachFunc, fromRight) {
  28429. return function(collection, iteratee) {
  28430. if (collection == null) {
  28431. return collection;
  28432. }
  28433. if (!isArrayLike(collection)) {
  28434. return eachFunc(collection, iteratee);
  28435. }
  28436. var length = collection.length,
  28437. index = fromRight ? length : -1,
  28438. iterable = Object(collection);
  28439. while ((fromRight ? index-- : ++index < length)) {
  28440. if (iteratee(iterable[index], index, iterable) === false) {
  28441. break;
  28442. }
  28443. }
  28444. return collection;
  28445. };
  28446. }
  28447. /**
  28448. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  28449. *
  28450. * @private
  28451. * @param {boolean} [fromRight] Specify iterating from right to left.
  28452. * @returns {Function} Returns the new base function.
  28453. */
  28454. function createBaseFor(fromRight) {
  28455. return function(object, iteratee, keysFunc) {
  28456. var index = -1,
  28457. iterable = Object(object),
  28458. props = keysFunc(object),
  28459. length = props.length;
  28460. while (length--) {
  28461. var key = props[fromRight ? length : ++index];
  28462. if (iteratee(iterable[key], key, iterable) === false) {
  28463. break;
  28464. }
  28465. }
  28466. return object;
  28467. };
  28468. }
  28469. /**
  28470. * Creates a function that wraps `func` to invoke it with the optional `this`
  28471. * binding of `thisArg`.
  28472. *
  28473. * @private
  28474. * @param {Function} func The function to wrap.
  28475. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  28476. * @param {*} [thisArg] The `this` binding of `func`.
  28477. * @returns {Function} Returns the new wrapped function.
  28478. */
  28479. function createBind(func, bitmask, thisArg) {
  28480. var isBind = bitmask & WRAP_BIND_FLAG,
  28481. Ctor = createCtor(func);
  28482. function wrapper() {
  28483. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  28484. return fn.apply(isBind ? thisArg : this, arguments);
  28485. }
  28486. return wrapper;
  28487. }
  28488. /**
  28489. * Creates a function like `_.lowerFirst`.
  28490. *
  28491. * @private
  28492. * @param {string} methodName The name of the `String` case method to use.
  28493. * @returns {Function} Returns the new case function.
  28494. */
  28495. function createCaseFirst(methodName) {
  28496. return function(string) {
  28497. string = toString(string);
  28498. var strSymbols = hasUnicode(string)
  28499. ? stringToArray(string)
  28500. : undefined;
  28501. var chr = strSymbols
  28502. ? strSymbols[0]
  28503. : string.charAt(0);
  28504. var trailing = strSymbols
  28505. ? castSlice(strSymbols, 1).join('')
  28506. : string.slice(1);
  28507. return chr[methodName]() + trailing;
  28508. };
  28509. }
  28510. /**
  28511. * Creates a function like `_.camelCase`.
  28512. *
  28513. * @private
  28514. * @param {Function} callback The function to combine each word.
  28515. * @returns {Function} Returns the new compounder function.
  28516. */
  28517. function createCompounder(callback) {
  28518. return function(string) {
  28519. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  28520. };
  28521. }
  28522. /**
  28523. * Creates a function that produces an instance of `Ctor` regardless of
  28524. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  28525. *
  28526. * @private
  28527. * @param {Function} Ctor The constructor to wrap.
  28528. * @returns {Function} Returns the new wrapped function.
  28529. */
  28530. function createCtor(Ctor) {
  28531. return function() {
  28532. // Use a `switch` statement to work with class constructors. See
  28533. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  28534. // for more details.
  28535. var args = arguments;
  28536. switch (args.length) {
  28537. case 0: return new Ctor;
  28538. case 1: return new Ctor(args[0]);
  28539. case 2: return new Ctor(args[0], args[1]);
  28540. case 3: return new Ctor(args[0], args[1], args[2]);
  28541. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  28542. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  28543. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  28544. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  28545. }
  28546. var thisBinding = baseCreate(Ctor.prototype),
  28547. result = Ctor.apply(thisBinding, args);
  28548. // Mimic the constructor's `return` behavior.
  28549. // See https://es5.github.io/#x13.2.2 for more details.
  28550. return isObject(result) ? result : thisBinding;
  28551. };
  28552. }
  28553. /**
  28554. * Creates a function that wraps `func` to enable currying.
  28555. *
  28556. * @private
  28557. * @param {Function} func The function to wrap.
  28558. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  28559. * @param {number} arity The arity of `func`.
  28560. * @returns {Function} Returns the new wrapped function.
  28561. */
  28562. function createCurry(func, bitmask, arity) {
  28563. var Ctor = createCtor(func);
  28564. function wrapper() {
  28565. var length = arguments.length,
  28566. args = Array(length),
  28567. index = length,
  28568. placeholder = getHolder(wrapper);
  28569. while (index--) {
  28570. args[index] = arguments[index];
  28571. }
  28572. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  28573. ? []
  28574. : replaceHolders(args, placeholder);
  28575. length -= holders.length;
  28576. if (length < arity) {
  28577. return createRecurry(
  28578. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  28579. args, holders, undefined, undefined, arity - length);
  28580. }
  28581. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  28582. return apply(fn, this, args);
  28583. }
  28584. return wrapper;
  28585. }
  28586. /**
  28587. * Creates a `_.find` or `_.findLast` function.
  28588. *
  28589. * @private
  28590. * @param {Function} findIndexFunc The function to find the collection index.
  28591. * @returns {Function} Returns the new find function.
  28592. */
  28593. function createFind(findIndexFunc) {
  28594. return function(collection, predicate, fromIndex) {
  28595. var iterable = Object(collection);
  28596. if (!isArrayLike(collection)) {
  28597. var iteratee = getIteratee(predicate, 3);
  28598. collection = keys(collection);
  28599. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  28600. }
  28601. var index = findIndexFunc(collection, predicate, fromIndex);
  28602. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  28603. };
  28604. }
  28605. /**
  28606. * Creates a `_.flow` or `_.flowRight` function.
  28607. *
  28608. * @private
  28609. * @param {boolean} [fromRight] Specify iterating from right to left.
  28610. * @returns {Function} Returns the new flow function.
  28611. */
  28612. function createFlow(fromRight) {
  28613. return flatRest(function(funcs) {
  28614. var length = funcs.length,
  28615. index = length,
  28616. prereq = LodashWrapper.prototype.thru;
  28617. if (fromRight) {
  28618. funcs.reverse();
  28619. }
  28620. while (index--) {
  28621. var func = funcs[index];
  28622. if (typeof func != 'function') {
  28623. throw new TypeError(FUNC_ERROR_TEXT);
  28624. }
  28625. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  28626. var wrapper = new LodashWrapper([], true);
  28627. }
  28628. }
  28629. index = wrapper ? index : length;
  28630. while (++index < length) {
  28631. func = funcs[index];
  28632. var funcName = getFuncName(func),
  28633. data = funcName == 'wrapper' ? getData(func) : undefined;
  28634. if (data && isLaziable(data[0]) &&
  28635. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  28636. !data[4].length && data[9] == 1
  28637. ) {
  28638. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  28639. } else {
  28640. wrapper = (func.length == 1 && isLaziable(func))
  28641. ? wrapper[funcName]()
  28642. : wrapper.thru(func);
  28643. }
  28644. }
  28645. return function() {
  28646. var args = arguments,
  28647. value = args[0];
  28648. if (wrapper && args.length == 1 && isArray(value)) {
  28649. return wrapper.plant(value).value();
  28650. }
  28651. var index = 0,
  28652. result = length ? funcs[index].apply(this, args) : value;
  28653. while (++index < length) {
  28654. result = funcs[index].call(this, result);
  28655. }
  28656. return result;
  28657. };
  28658. });
  28659. }
  28660. /**
  28661. * Creates a function that wraps `func` to invoke it with optional `this`
  28662. * binding of `thisArg`, partial application, and currying.
  28663. *
  28664. * @private
  28665. * @param {Function|string} func The function or method name to wrap.
  28666. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  28667. * @param {*} [thisArg] The `this` binding of `func`.
  28668. * @param {Array} [partials] The arguments to prepend to those provided to
  28669. * the new function.
  28670. * @param {Array} [holders] The `partials` placeholder indexes.
  28671. * @param {Array} [partialsRight] The arguments to append to those provided
  28672. * to the new function.
  28673. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  28674. * @param {Array} [argPos] The argument positions of the new function.
  28675. * @param {number} [ary] The arity cap of `func`.
  28676. * @param {number} [arity] The arity of `func`.
  28677. * @returns {Function} Returns the new wrapped function.
  28678. */
  28679. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  28680. var isAry = bitmask & WRAP_ARY_FLAG,
  28681. isBind = bitmask & WRAP_BIND_FLAG,
  28682. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  28683. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  28684. isFlip = bitmask & WRAP_FLIP_FLAG,
  28685. Ctor = isBindKey ? undefined : createCtor(func);
  28686. function wrapper() {
  28687. var length = arguments.length,
  28688. args = Array(length),
  28689. index = length;
  28690. while (index--) {
  28691. args[index] = arguments[index];
  28692. }
  28693. if (isCurried) {
  28694. var placeholder = getHolder(wrapper),
  28695. holdersCount = countHolders(args, placeholder);
  28696. }
  28697. if (partials) {
  28698. args = composeArgs(args, partials, holders, isCurried);
  28699. }
  28700. if (partialsRight) {
  28701. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  28702. }
  28703. length -= holdersCount;
  28704. if (isCurried && length < arity) {
  28705. var newHolders = replaceHolders(args, placeholder);
  28706. return createRecurry(
  28707. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  28708. args, newHolders, argPos, ary, arity - length
  28709. );
  28710. }
  28711. var thisBinding = isBind ? thisArg : this,
  28712. fn = isBindKey ? thisBinding[func] : func;
  28713. length = args.length;
  28714. if (argPos) {
  28715. args = reorder(args, argPos);
  28716. } else if (isFlip && length > 1) {
  28717. args.reverse();
  28718. }
  28719. if (isAry && ary < length) {
  28720. args.length = ary;
  28721. }
  28722. if (this && this !== root && this instanceof wrapper) {
  28723. fn = Ctor || createCtor(fn);
  28724. }
  28725. return fn.apply(thisBinding, args);
  28726. }
  28727. return wrapper;
  28728. }
  28729. /**
  28730. * Creates a function like `_.invertBy`.
  28731. *
  28732. * @private
  28733. * @param {Function} setter The function to set accumulator values.
  28734. * @param {Function} toIteratee The function to resolve iteratees.
  28735. * @returns {Function} Returns the new inverter function.
  28736. */
  28737. function createInverter(setter, toIteratee) {
  28738. return function(object, iteratee) {
  28739. return baseInverter(object, setter, toIteratee(iteratee), {});
  28740. };
  28741. }
  28742. /**
  28743. * Creates a function that performs a mathematical operation on two values.
  28744. *
  28745. * @private
  28746. * @param {Function} operator The function to perform the operation.
  28747. * @param {number} [defaultValue] The value used for `undefined` arguments.
  28748. * @returns {Function} Returns the new mathematical operation function.
  28749. */
  28750. function createMathOperation(operator, defaultValue) {
  28751. return function(value, other) {
  28752. var result;
  28753. if (value === undefined && other === undefined) {
  28754. return defaultValue;
  28755. }
  28756. if (value !== undefined) {
  28757. result = value;
  28758. }
  28759. if (other !== undefined) {
  28760. if (result === undefined) {
  28761. return other;
  28762. }
  28763. if (typeof value == 'string' || typeof other == 'string') {
  28764. value = baseToString(value);
  28765. other = baseToString(other);
  28766. } else {
  28767. value = baseToNumber(value);
  28768. other = baseToNumber(other);
  28769. }
  28770. result = operator(value, other);
  28771. }
  28772. return result;
  28773. };
  28774. }
  28775. /**
  28776. * Creates a function like `_.over`.
  28777. *
  28778. * @private
  28779. * @param {Function} arrayFunc The function to iterate over iteratees.
  28780. * @returns {Function} Returns the new over function.
  28781. */
  28782. function createOver(arrayFunc) {
  28783. return flatRest(function(iteratees) {
  28784. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  28785. return baseRest(function(args) {
  28786. var thisArg = this;
  28787. return arrayFunc(iteratees, function(iteratee) {
  28788. return apply(iteratee, thisArg, args);
  28789. });
  28790. });
  28791. });
  28792. }
  28793. /**
  28794. * Creates the padding for `string` based on `length`. The `chars` string
  28795. * is truncated if the number of characters exceeds `length`.
  28796. *
  28797. * @private
  28798. * @param {number} length The padding length.
  28799. * @param {string} [chars=' '] The string used as padding.
  28800. * @returns {string} Returns the padding for `string`.
  28801. */
  28802. function createPadding(length, chars) {
  28803. chars = chars === undefined ? ' ' : baseToString(chars);
  28804. var charsLength = chars.length;
  28805. if (charsLength < 2) {
  28806. return charsLength ? baseRepeat(chars, length) : chars;
  28807. }
  28808. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  28809. return hasUnicode(chars)
  28810. ? castSlice(stringToArray(result), 0, length).join('')
  28811. : result.slice(0, length);
  28812. }
  28813. /**
  28814. * Creates a function that wraps `func` to invoke it with the `this` binding
  28815. * of `thisArg` and `partials` prepended to the arguments it receives.
  28816. *
  28817. * @private
  28818. * @param {Function} func The function to wrap.
  28819. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  28820. * @param {*} thisArg The `this` binding of `func`.
  28821. * @param {Array} partials The arguments to prepend to those provided to
  28822. * the new function.
  28823. * @returns {Function} Returns the new wrapped function.
  28824. */
  28825. function createPartial(func, bitmask, thisArg, partials) {
  28826. var isBind = bitmask & WRAP_BIND_FLAG,
  28827. Ctor = createCtor(func);
  28828. function wrapper() {
  28829. var argsIndex = -1,
  28830. argsLength = arguments.length,
  28831. leftIndex = -1,
  28832. leftLength = partials.length,
  28833. args = Array(leftLength + argsLength),
  28834. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  28835. while (++leftIndex < leftLength) {
  28836. args[leftIndex] = partials[leftIndex];
  28837. }
  28838. while (argsLength--) {
  28839. args[leftIndex++] = arguments[++argsIndex];
  28840. }
  28841. return apply(fn, isBind ? thisArg : this, args);
  28842. }
  28843. return wrapper;
  28844. }
  28845. /**
  28846. * Creates a `_.range` or `_.rangeRight` function.
  28847. *
  28848. * @private
  28849. * @param {boolean} [fromRight] Specify iterating from right to left.
  28850. * @returns {Function} Returns the new range function.
  28851. */
  28852. function createRange(fromRight) {
  28853. return function(start, end, step) {
  28854. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  28855. end = step = undefined;
  28856. }
  28857. // Ensure the sign of `-0` is preserved.
  28858. start = toFinite(start);
  28859. if (end === undefined) {
  28860. end = start;
  28861. start = 0;
  28862. } else {
  28863. end = toFinite(end);
  28864. }
  28865. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  28866. return baseRange(start, end, step, fromRight);
  28867. };
  28868. }
  28869. /**
  28870. * Creates a function that performs a relational operation on two values.
  28871. *
  28872. * @private
  28873. * @param {Function} operator The function to perform the operation.
  28874. * @returns {Function} Returns the new relational operation function.
  28875. */
  28876. function createRelationalOperation(operator) {
  28877. return function(value, other) {
  28878. if (!(typeof value == 'string' && typeof other == 'string')) {
  28879. value = toNumber(value);
  28880. other = toNumber(other);
  28881. }
  28882. return operator(value, other);
  28883. };
  28884. }
  28885. /**
  28886. * Creates a function that wraps `func` to continue currying.
  28887. *
  28888. * @private
  28889. * @param {Function} func The function to wrap.
  28890. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  28891. * @param {Function} wrapFunc The function to create the `func` wrapper.
  28892. * @param {*} placeholder The placeholder value.
  28893. * @param {*} [thisArg] The `this` binding of `func`.
  28894. * @param {Array} [partials] The arguments to prepend to those provided to
  28895. * the new function.
  28896. * @param {Array} [holders] The `partials` placeholder indexes.
  28897. * @param {Array} [argPos] The argument positions of the new function.
  28898. * @param {number} [ary] The arity cap of `func`.
  28899. * @param {number} [arity] The arity of `func`.
  28900. * @returns {Function} Returns the new wrapped function.
  28901. */
  28902. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  28903. var isCurry = bitmask & WRAP_CURRY_FLAG,
  28904. newHolders = isCurry ? holders : undefined,
  28905. newHoldersRight = isCurry ? undefined : holders,
  28906. newPartials = isCurry ? partials : undefined,
  28907. newPartialsRight = isCurry ? undefined : partials;
  28908. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  28909. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  28910. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  28911. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  28912. }
  28913. var newData = [
  28914. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  28915. newHoldersRight, argPos, ary, arity
  28916. ];
  28917. var result = wrapFunc.apply(undefined, newData);
  28918. if (isLaziable(func)) {
  28919. setData(result, newData);
  28920. }
  28921. result.placeholder = placeholder;
  28922. return setWrapToString(result, func, bitmask);
  28923. }
  28924. /**
  28925. * Creates a function like `_.round`.
  28926. *
  28927. * @private
  28928. * @param {string} methodName The name of the `Math` method to use when rounding.
  28929. * @returns {Function} Returns the new round function.
  28930. */
  28931. function createRound(methodName) {
  28932. var func = Math[methodName];
  28933. return function(number, precision) {
  28934. number = toNumber(number);
  28935. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  28936. if (precision && nativeIsFinite(number)) {
  28937. // Shift with exponential notation to avoid floating-point issues.
  28938. // See [MDN](https://mdn.io/round#Examples) for more details.
  28939. var pair = (toString(number) + 'e').split('e'),
  28940. value = func(pair[0] + 'e' + (+pair[1] + precision));
  28941. pair = (toString(value) + 'e').split('e');
  28942. return +(pair[0] + 'e' + (+pair[1] - precision));
  28943. }
  28944. return func(number);
  28945. };
  28946. }
  28947. /**
  28948. * Creates a set object of `values`.
  28949. *
  28950. * @private
  28951. * @param {Array} values The values to add to the set.
  28952. * @returns {Object} Returns the new set.
  28953. */
  28954. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  28955. return new Set(values);
  28956. };
  28957. /**
  28958. * Creates a `_.toPairs` or `_.toPairsIn` function.
  28959. *
  28960. * @private
  28961. * @param {Function} keysFunc The function to get the keys of a given object.
  28962. * @returns {Function} Returns the new pairs function.
  28963. */
  28964. function createToPairs(keysFunc) {
  28965. return function(object) {
  28966. var tag = getTag(object);
  28967. if (tag == mapTag) {
  28968. return mapToArray(object);
  28969. }
  28970. if (tag == setTag) {
  28971. return setToPairs(object);
  28972. }
  28973. return baseToPairs(object, keysFunc(object));
  28974. };
  28975. }
  28976. /**
  28977. * Creates a function that either curries or invokes `func` with optional
  28978. * `this` binding and partially applied arguments.
  28979. *
  28980. * @private
  28981. * @param {Function|string} func The function or method name to wrap.
  28982. * @param {number} bitmask The bitmask flags.
  28983. * 1 - `_.bind`
  28984. * 2 - `_.bindKey`
  28985. * 4 - `_.curry` or `_.curryRight` of a bound function
  28986. * 8 - `_.curry`
  28987. * 16 - `_.curryRight`
  28988. * 32 - `_.partial`
  28989. * 64 - `_.partialRight`
  28990. * 128 - `_.rearg`
  28991. * 256 - `_.ary`
  28992. * 512 - `_.flip`
  28993. * @param {*} [thisArg] The `this` binding of `func`.
  28994. * @param {Array} [partials] The arguments to be partially applied.
  28995. * @param {Array} [holders] The `partials` placeholder indexes.
  28996. * @param {Array} [argPos] The argument positions of the new function.
  28997. * @param {number} [ary] The arity cap of `func`.
  28998. * @param {number} [arity] The arity of `func`.
  28999. * @returns {Function} Returns the new wrapped function.
  29000. */
  29001. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  29002. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  29003. if (!isBindKey && typeof func != 'function') {
  29004. throw new TypeError(FUNC_ERROR_TEXT);
  29005. }
  29006. var length = partials ? partials.length : 0;
  29007. if (!length) {
  29008. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  29009. partials = holders = undefined;
  29010. }
  29011. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  29012. arity = arity === undefined ? arity : toInteger(arity);
  29013. length -= holders ? holders.length : 0;
  29014. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  29015. var partialsRight = partials,
  29016. holdersRight = holders;
  29017. partials = holders = undefined;
  29018. }
  29019. var data = isBindKey ? undefined : getData(func);
  29020. var newData = [
  29021. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  29022. argPos, ary, arity
  29023. ];
  29024. if (data) {
  29025. mergeData(newData, data);
  29026. }
  29027. func = newData[0];
  29028. bitmask = newData[1];
  29029. thisArg = newData[2];
  29030. partials = newData[3];
  29031. holders = newData[4];
  29032. arity = newData[9] = newData[9] === undefined
  29033. ? (isBindKey ? 0 : func.length)
  29034. : nativeMax(newData[9] - length, 0);
  29035. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  29036. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  29037. }
  29038. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  29039. var result = createBind(func, bitmask, thisArg);
  29040. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  29041. result = createCurry(func, bitmask, arity);
  29042. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  29043. result = createPartial(func, bitmask, thisArg, partials);
  29044. } else {
  29045. result = createHybrid.apply(undefined, newData);
  29046. }
  29047. var setter = data ? baseSetData : setData;
  29048. return setWrapToString(setter(result, newData), func, bitmask);
  29049. }
  29050. /**
  29051. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  29052. * of source objects to the destination object for all destination properties
  29053. * that resolve to `undefined`.
  29054. *
  29055. * @private
  29056. * @param {*} objValue The destination value.
  29057. * @param {*} srcValue The source value.
  29058. * @param {string} key The key of the property to assign.
  29059. * @param {Object} object The parent object of `objValue`.
  29060. * @returns {*} Returns the value to assign.
  29061. */
  29062. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  29063. if (objValue === undefined ||
  29064. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  29065. return srcValue;
  29066. }
  29067. return objValue;
  29068. }
  29069. /**
  29070. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  29071. * objects into destination objects that are passed thru.
  29072. *
  29073. * @private
  29074. * @param {*} objValue The destination value.
  29075. * @param {*} srcValue The source value.
  29076. * @param {string} key The key of the property to merge.
  29077. * @param {Object} object The parent object of `objValue`.
  29078. * @param {Object} source The parent object of `srcValue`.
  29079. * @param {Object} [stack] Tracks traversed source values and their merged
  29080. * counterparts.
  29081. * @returns {*} Returns the value to assign.
  29082. */
  29083. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  29084. if (isObject(objValue) && isObject(srcValue)) {
  29085. // Recursively merge objects and arrays (susceptible to call stack limits).
  29086. stack.set(srcValue, objValue);
  29087. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  29088. stack['delete'](srcValue);
  29089. }
  29090. return objValue;
  29091. }
  29092. /**
  29093. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  29094. * objects.
  29095. *
  29096. * @private
  29097. * @param {*} value The value to inspect.
  29098. * @param {string} key The key of the property to inspect.
  29099. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  29100. */
  29101. function customOmitClone(value) {
  29102. return isPlainObject(value) ? undefined : value;
  29103. }
  29104. /**
  29105. * A specialized version of `baseIsEqualDeep` for arrays with support for
  29106. * partial deep comparisons.
  29107. *
  29108. * @private
  29109. * @param {Array} array The array to compare.
  29110. * @param {Array} other The other array to compare.
  29111. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  29112. * @param {Function} customizer The function to customize comparisons.
  29113. * @param {Function} equalFunc The function to determine equivalents of values.
  29114. * @param {Object} stack Tracks traversed `array` and `other` objects.
  29115. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  29116. */
  29117. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  29118. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  29119. arrLength = array.length,
  29120. othLength = other.length;
  29121. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  29122. return false;
  29123. }
  29124. // Check that cyclic values are equal.
  29125. var arrStacked = stack.get(array);
  29126. var othStacked = stack.get(other);
  29127. if (arrStacked && othStacked) {
  29128. return arrStacked == other && othStacked == array;
  29129. }
  29130. var index = -1,
  29131. result = true,
  29132. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  29133. stack.set(array, other);
  29134. stack.set(other, array);
  29135. // Ignore non-index properties.
  29136. while (++index < arrLength) {
  29137. var arrValue = array[index],
  29138. othValue = other[index];
  29139. if (customizer) {
  29140. var compared = isPartial
  29141. ? customizer(othValue, arrValue, index, other, array, stack)
  29142. : customizer(arrValue, othValue, index, array, other, stack);
  29143. }
  29144. if (compared !== undefined) {
  29145. if (compared) {
  29146. continue;
  29147. }
  29148. result = false;
  29149. break;
  29150. }
  29151. // Recursively compare arrays (susceptible to call stack limits).
  29152. if (seen) {
  29153. if (!arraySome(other, function(othValue, othIndex) {
  29154. if (!cacheHas(seen, othIndex) &&
  29155. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  29156. return seen.push(othIndex);
  29157. }
  29158. })) {
  29159. result = false;
  29160. break;
  29161. }
  29162. } else if (!(
  29163. arrValue === othValue ||
  29164. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  29165. )) {
  29166. result = false;
  29167. break;
  29168. }
  29169. }
  29170. stack['delete'](array);
  29171. stack['delete'](other);
  29172. return result;
  29173. }
  29174. /**
  29175. * A specialized version of `baseIsEqualDeep` for comparing objects of
  29176. * the same `toStringTag`.
  29177. *
  29178. * **Note:** This function only supports comparing values with tags of
  29179. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  29180. *
  29181. * @private
  29182. * @param {Object} object The object to compare.
  29183. * @param {Object} other The other object to compare.
  29184. * @param {string} tag The `toStringTag` of the objects to compare.
  29185. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  29186. * @param {Function} customizer The function to customize comparisons.
  29187. * @param {Function} equalFunc The function to determine equivalents of values.
  29188. * @param {Object} stack Tracks traversed `object` and `other` objects.
  29189. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  29190. */
  29191. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  29192. switch (tag) {
  29193. case dataViewTag:
  29194. if ((object.byteLength != other.byteLength) ||
  29195. (object.byteOffset != other.byteOffset)) {
  29196. return false;
  29197. }
  29198. object = object.buffer;
  29199. other = other.buffer;
  29200. case arrayBufferTag:
  29201. if ((object.byteLength != other.byteLength) ||
  29202. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  29203. return false;
  29204. }
  29205. return true;
  29206. case boolTag:
  29207. case dateTag:
  29208. case numberTag:
  29209. // Coerce booleans to `1` or `0` and dates to milliseconds.
  29210. // Invalid dates are coerced to `NaN`.
  29211. return eq(+object, +other);
  29212. case errorTag:
  29213. return object.name == other.name && object.message == other.message;
  29214. case regexpTag:
  29215. case stringTag:
  29216. // Coerce regexes to strings and treat strings, primitives and objects,
  29217. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  29218. // for more details.
  29219. return object == (other + '');
  29220. case mapTag:
  29221. var convert = mapToArray;
  29222. case setTag:
  29223. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  29224. convert || (convert = setToArray);
  29225. if (object.size != other.size && !isPartial) {
  29226. return false;
  29227. }
  29228. // Assume cyclic values are equal.
  29229. var stacked = stack.get(object);
  29230. if (stacked) {
  29231. return stacked == other;
  29232. }
  29233. bitmask |= COMPARE_UNORDERED_FLAG;
  29234. // Recursively compare objects (susceptible to call stack limits).
  29235. stack.set(object, other);
  29236. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  29237. stack['delete'](object);
  29238. return result;
  29239. case symbolTag:
  29240. if (symbolValueOf) {
  29241. return symbolValueOf.call(object) == symbolValueOf.call(other);
  29242. }
  29243. }
  29244. return false;
  29245. }
  29246. /**
  29247. * A specialized version of `baseIsEqualDeep` for objects with support for
  29248. * partial deep comparisons.
  29249. *
  29250. * @private
  29251. * @param {Object} object The object to compare.
  29252. * @param {Object} other The other object to compare.
  29253. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  29254. * @param {Function} customizer The function to customize comparisons.
  29255. * @param {Function} equalFunc The function to determine equivalents of values.
  29256. * @param {Object} stack Tracks traversed `object` and `other` objects.
  29257. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  29258. */
  29259. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  29260. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  29261. objProps = getAllKeys(object),
  29262. objLength = objProps.length,
  29263. othProps = getAllKeys(other),
  29264. othLength = othProps.length;
  29265. if (objLength != othLength && !isPartial) {
  29266. return false;
  29267. }
  29268. var index = objLength;
  29269. while (index--) {
  29270. var key = objProps[index];
  29271. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  29272. return false;
  29273. }
  29274. }
  29275. // Check that cyclic values are equal.
  29276. var objStacked = stack.get(object);
  29277. var othStacked = stack.get(other);
  29278. if (objStacked && othStacked) {
  29279. return objStacked == other && othStacked == object;
  29280. }
  29281. var result = true;
  29282. stack.set(object, other);
  29283. stack.set(other, object);
  29284. var skipCtor = isPartial;
  29285. while (++index < objLength) {
  29286. key = objProps[index];
  29287. var objValue = object[key],
  29288. othValue = other[key];
  29289. if (customizer) {
  29290. var compared = isPartial
  29291. ? customizer(othValue, objValue, key, other, object, stack)
  29292. : customizer(objValue, othValue, key, object, other, stack);
  29293. }
  29294. // Recursively compare objects (susceptible to call stack limits).
  29295. if (!(compared === undefined
  29296. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  29297. : compared
  29298. )) {
  29299. result = false;
  29300. break;
  29301. }
  29302. skipCtor || (skipCtor = key == 'constructor');
  29303. }
  29304. if (result && !skipCtor) {
  29305. var objCtor = object.constructor,
  29306. othCtor = other.constructor;
  29307. // Non `Object` object instances with different constructors are not equal.
  29308. if (objCtor != othCtor &&
  29309. ('constructor' in object && 'constructor' in other) &&
  29310. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  29311. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  29312. result = false;
  29313. }
  29314. }
  29315. stack['delete'](object);
  29316. stack['delete'](other);
  29317. return result;
  29318. }
  29319. /**
  29320. * A specialized version of `baseRest` which flattens the rest array.
  29321. *
  29322. * @private
  29323. * @param {Function} func The function to apply a rest parameter to.
  29324. * @returns {Function} Returns the new function.
  29325. */
  29326. function flatRest(func) {
  29327. return setToString(overRest(func, undefined, flatten), func + '');
  29328. }
  29329. /**
  29330. * Creates an array of own enumerable property names and symbols of `object`.
  29331. *
  29332. * @private
  29333. * @param {Object} object The object to query.
  29334. * @returns {Array} Returns the array of property names and symbols.
  29335. */
  29336. function getAllKeys(object) {
  29337. return baseGetAllKeys(object, keys, getSymbols);
  29338. }
  29339. /**
  29340. * Creates an array of own and inherited enumerable property names and
  29341. * symbols of `object`.
  29342. *
  29343. * @private
  29344. * @param {Object} object The object to query.
  29345. * @returns {Array} Returns the array of property names and symbols.
  29346. */
  29347. function getAllKeysIn(object) {
  29348. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  29349. }
  29350. /**
  29351. * Gets metadata for `func`.
  29352. *
  29353. * @private
  29354. * @param {Function} func The function to query.
  29355. * @returns {*} Returns the metadata for `func`.
  29356. */
  29357. var getData = !metaMap ? noop : function(func) {
  29358. return metaMap.get(func);
  29359. };
  29360. /**
  29361. * Gets the name of `func`.
  29362. *
  29363. * @private
  29364. * @param {Function} func The function to query.
  29365. * @returns {string} Returns the function name.
  29366. */
  29367. function getFuncName(func) {
  29368. var result = (func.name + ''),
  29369. array = realNames[result],
  29370. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  29371. while (length--) {
  29372. var data = array[length],
  29373. otherFunc = data.func;
  29374. if (otherFunc == null || otherFunc == func) {
  29375. return data.name;
  29376. }
  29377. }
  29378. return result;
  29379. }
  29380. /**
  29381. * Gets the argument placeholder value for `func`.
  29382. *
  29383. * @private
  29384. * @param {Function} func The function to inspect.
  29385. * @returns {*} Returns the placeholder value.
  29386. */
  29387. function getHolder(func) {
  29388. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  29389. return object.placeholder;
  29390. }
  29391. /**
  29392. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  29393. * this function returns the custom method, otherwise it returns `baseIteratee`.
  29394. * If arguments are provided, the chosen function is invoked with them and
  29395. * its result is returned.
  29396. *
  29397. * @private
  29398. * @param {*} [value] The value to convert to an iteratee.
  29399. * @param {number} [arity] The arity of the created iteratee.
  29400. * @returns {Function} Returns the chosen function or its result.
  29401. */
  29402. function getIteratee() {
  29403. var result = lodash.iteratee || iteratee;
  29404. result = result === iteratee ? baseIteratee : result;
  29405. return arguments.length ? result(arguments[0], arguments[1]) : result;
  29406. }
  29407. /**
  29408. * Gets the data for `map`.
  29409. *
  29410. * @private
  29411. * @param {Object} map The map to query.
  29412. * @param {string} key The reference key.
  29413. * @returns {*} Returns the map data.
  29414. */
  29415. function getMapData(map, key) {
  29416. var data = map.__data__;
  29417. return isKeyable(key)
  29418. ? data[typeof key == 'string' ? 'string' : 'hash']
  29419. : data.map;
  29420. }
  29421. /**
  29422. * Gets the property names, values, and compare flags of `object`.
  29423. *
  29424. * @private
  29425. * @param {Object} object The object to query.
  29426. * @returns {Array} Returns the match data of `object`.
  29427. */
  29428. function getMatchData(object) {
  29429. var result = keys(object),
  29430. length = result.length;
  29431. while (length--) {
  29432. var key = result[length],
  29433. value = object[key];
  29434. result[length] = [key, value, isStrictComparable(value)];
  29435. }
  29436. return result;
  29437. }
  29438. /**
  29439. * Gets the native function at `key` of `object`.
  29440. *
  29441. * @private
  29442. * @param {Object} object The object to query.
  29443. * @param {string} key The key of the method to get.
  29444. * @returns {*} Returns the function if it's native, else `undefined`.
  29445. */
  29446. function getNative(object, key) {
  29447. var value = getValue(object, key);
  29448. return baseIsNative(value) ? value : undefined;
  29449. }
  29450. /**
  29451. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  29452. *
  29453. * @private
  29454. * @param {*} value The value to query.
  29455. * @returns {string} Returns the raw `toStringTag`.
  29456. */
  29457. function getRawTag(value) {
  29458. var isOwn = hasOwnProperty.call(value, symToStringTag),
  29459. tag = value[symToStringTag];
  29460. try {
  29461. value[symToStringTag] = undefined;
  29462. var unmasked = true;
  29463. } catch (e) {}
  29464. var result = nativeObjectToString.call(value);
  29465. if (unmasked) {
  29466. if (isOwn) {
  29467. value[symToStringTag] = tag;
  29468. } else {
  29469. delete value[symToStringTag];
  29470. }
  29471. }
  29472. return result;
  29473. }
  29474. /**
  29475. * Creates an array of the own enumerable symbols of `object`.
  29476. *
  29477. * @private
  29478. * @param {Object} object The object to query.
  29479. * @returns {Array} Returns the array of symbols.
  29480. */
  29481. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  29482. if (object == null) {
  29483. return [];
  29484. }
  29485. object = Object(object);
  29486. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  29487. return propertyIsEnumerable.call(object, symbol);
  29488. });
  29489. };
  29490. /**
  29491. * Creates an array of the own and inherited enumerable symbols of `object`.
  29492. *
  29493. * @private
  29494. * @param {Object} object The object to query.
  29495. * @returns {Array} Returns the array of symbols.
  29496. */
  29497. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  29498. var result = [];
  29499. while (object) {
  29500. arrayPush(result, getSymbols(object));
  29501. object = getPrototype(object);
  29502. }
  29503. return result;
  29504. };
  29505. /**
  29506. * Gets the `toStringTag` of `value`.
  29507. *
  29508. * @private
  29509. * @param {*} value The value to query.
  29510. * @returns {string} Returns the `toStringTag`.
  29511. */
  29512. var getTag = baseGetTag;
  29513. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  29514. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  29515. (Map && getTag(new Map) != mapTag) ||
  29516. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  29517. (Set && getTag(new Set) != setTag) ||
  29518. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  29519. getTag = function(value) {
  29520. var result = baseGetTag(value),
  29521. Ctor = result == objectTag ? value.constructor : undefined,
  29522. ctorString = Ctor ? toSource(Ctor) : '';
  29523. if (ctorString) {
  29524. switch (ctorString) {
  29525. case dataViewCtorString: return dataViewTag;
  29526. case mapCtorString: return mapTag;
  29527. case promiseCtorString: return promiseTag;
  29528. case setCtorString: return setTag;
  29529. case weakMapCtorString: return weakMapTag;
  29530. }
  29531. }
  29532. return result;
  29533. };
  29534. }
  29535. /**
  29536. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  29537. *
  29538. * @private
  29539. * @param {number} start The start of the view.
  29540. * @param {number} end The end of the view.
  29541. * @param {Array} transforms The transformations to apply to the view.
  29542. * @returns {Object} Returns an object containing the `start` and `end`
  29543. * positions of the view.
  29544. */
  29545. function getView(start, end, transforms) {
  29546. var index = -1,
  29547. length = transforms.length;
  29548. while (++index < length) {
  29549. var data = transforms[index],
  29550. size = data.size;
  29551. switch (data.type) {
  29552. case 'drop': start += size; break;
  29553. case 'dropRight': end -= size; break;
  29554. case 'take': end = nativeMin(end, start + size); break;
  29555. case 'takeRight': start = nativeMax(start, end - size); break;
  29556. }
  29557. }
  29558. return { 'start': start, 'end': end };
  29559. }
  29560. /**
  29561. * Extracts wrapper details from the `source` body comment.
  29562. *
  29563. * @private
  29564. * @param {string} source The source to inspect.
  29565. * @returns {Array} Returns the wrapper details.
  29566. */
  29567. function getWrapDetails(source) {
  29568. var match = source.match(reWrapDetails);
  29569. return match ? match[1].split(reSplitDetails) : [];
  29570. }
  29571. /**
  29572. * Checks if `path` exists on `object`.
  29573. *
  29574. * @private
  29575. * @param {Object} object The object to query.
  29576. * @param {Array|string} path The path to check.
  29577. * @param {Function} hasFunc The function to check properties.
  29578. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  29579. */
  29580. function hasPath(object, path, hasFunc) {
  29581. path = castPath(path, object);
  29582. var index = -1,
  29583. length = path.length,
  29584. result = false;
  29585. while (++index < length) {
  29586. var key = toKey(path[index]);
  29587. if (!(result = object != null && hasFunc(object, key))) {
  29588. break;
  29589. }
  29590. object = object[key];
  29591. }
  29592. if (result || ++index != length) {
  29593. return result;
  29594. }
  29595. length = object == null ? 0 : object.length;
  29596. return !!length && isLength(length) && isIndex(key, length) &&
  29597. (isArray(object) || isArguments(object));
  29598. }
  29599. /**
  29600. * Initializes an array clone.
  29601. *
  29602. * @private
  29603. * @param {Array} array The array to clone.
  29604. * @returns {Array} Returns the initialized clone.
  29605. */
  29606. function initCloneArray(array) {
  29607. var length = array.length,
  29608. result = new array.constructor(length);
  29609. // Add properties assigned by `RegExp#exec`.
  29610. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  29611. result.index = array.index;
  29612. result.input = array.input;
  29613. }
  29614. return result;
  29615. }
  29616. /**
  29617. * Initializes an object clone.
  29618. *
  29619. * @private
  29620. * @param {Object} object The object to clone.
  29621. * @returns {Object} Returns the initialized clone.
  29622. */
  29623. function initCloneObject(object) {
  29624. return (typeof object.constructor == 'function' && !isPrototype(object))
  29625. ? baseCreate(getPrototype(object))
  29626. : {};
  29627. }
  29628. /**
  29629. * Initializes an object clone based on its `toStringTag`.
  29630. *
  29631. * **Note:** This function only supports cloning values with tags of
  29632. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  29633. *
  29634. * @private
  29635. * @param {Object} object The object to clone.
  29636. * @param {string} tag The `toStringTag` of the object to clone.
  29637. * @param {boolean} [isDeep] Specify a deep clone.
  29638. * @returns {Object} Returns the initialized clone.
  29639. */
  29640. function initCloneByTag(object, tag, isDeep) {
  29641. var Ctor = object.constructor;
  29642. switch (tag) {
  29643. case arrayBufferTag:
  29644. return cloneArrayBuffer(object);
  29645. case boolTag:
  29646. case dateTag:
  29647. return new Ctor(+object);
  29648. case dataViewTag:
  29649. return cloneDataView(object, isDeep);
  29650. case float32Tag: case float64Tag:
  29651. case int8Tag: case int16Tag: case int32Tag:
  29652. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  29653. return cloneTypedArray(object, isDeep);
  29654. case mapTag:
  29655. return new Ctor;
  29656. case numberTag:
  29657. case stringTag:
  29658. return new Ctor(object);
  29659. case regexpTag:
  29660. return cloneRegExp(object);
  29661. case setTag:
  29662. return new Ctor;
  29663. case symbolTag:
  29664. return cloneSymbol(object);
  29665. }
  29666. }
  29667. /**
  29668. * Inserts wrapper `details` in a comment at the top of the `source` body.
  29669. *
  29670. * @private
  29671. * @param {string} source The source to modify.
  29672. * @returns {Array} details The details to insert.
  29673. * @returns {string} Returns the modified source.
  29674. */
  29675. function insertWrapDetails(source, details) {
  29676. var length = details.length;
  29677. if (!length) {
  29678. return source;
  29679. }
  29680. var lastIndex = length - 1;
  29681. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  29682. details = details.join(length > 2 ? ', ' : ' ');
  29683. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  29684. }
  29685. /**
  29686. * Checks if `value` is a flattenable `arguments` object or array.
  29687. *
  29688. * @private
  29689. * @param {*} value The value to check.
  29690. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  29691. */
  29692. function isFlattenable(value) {
  29693. return isArray(value) || isArguments(value) ||
  29694. !!(spreadableSymbol && value && value[spreadableSymbol]);
  29695. }
  29696. /**
  29697. * Checks if `value` is a valid array-like index.
  29698. *
  29699. * @private
  29700. * @param {*} value The value to check.
  29701. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  29702. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  29703. */
  29704. function isIndex(value, length) {
  29705. var type = typeof value;
  29706. length = length == null ? MAX_SAFE_INTEGER : length;
  29707. return !!length &&
  29708. (type == 'number' ||
  29709. (type != 'symbol' && reIsUint.test(value))) &&
  29710. (value > -1 && value % 1 == 0 && value < length);
  29711. }
  29712. /**
  29713. * Checks if the given arguments are from an iteratee call.
  29714. *
  29715. * @private
  29716. * @param {*} value The potential iteratee value argument.
  29717. * @param {*} index The potential iteratee index or key argument.
  29718. * @param {*} object The potential iteratee object argument.
  29719. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  29720. * else `false`.
  29721. */
  29722. function isIterateeCall(value, index, object) {
  29723. if (!isObject(object)) {
  29724. return false;
  29725. }
  29726. var type = typeof index;
  29727. if (type == 'number'
  29728. ? (isArrayLike(object) && isIndex(index, object.length))
  29729. : (type == 'string' && index in object)
  29730. ) {
  29731. return eq(object[index], value);
  29732. }
  29733. return false;
  29734. }
  29735. /**
  29736. * Checks if `value` is a property name and not a property path.
  29737. *
  29738. * @private
  29739. * @param {*} value The value to check.
  29740. * @param {Object} [object] The object to query keys on.
  29741. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  29742. */
  29743. function isKey(value, object) {
  29744. if (isArray(value)) {
  29745. return false;
  29746. }
  29747. var type = typeof value;
  29748. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  29749. value == null || isSymbol(value)) {
  29750. return true;
  29751. }
  29752. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  29753. (object != null && value in Object(object));
  29754. }
  29755. /**
  29756. * Checks if `value` is suitable for use as unique object key.
  29757. *
  29758. * @private
  29759. * @param {*} value The value to check.
  29760. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  29761. */
  29762. function isKeyable(value) {
  29763. var type = typeof value;
  29764. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  29765. ? (value !== '__proto__')
  29766. : (value === null);
  29767. }
  29768. /**
  29769. * Checks if `func` has a lazy counterpart.
  29770. *
  29771. * @private
  29772. * @param {Function} func The function to check.
  29773. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  29774. * else `false`.
  29775. */
  29776. function isLaziable(func) {
  29777. var funcName = getFuncName(func),
  29778. other = lodash[funcName];
  29779. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  29780. return false;
  29781. }
  29782. if (func === other) {
  29783. return true;
  29784. }
  29785. var data = getData(other);
  29786. return !!data && func === data[0];
  29787. }
  29788. /**
  29789. * Checks if `func` has its source masked.
  29790. *
  29791. * @private
  29792. * @param {Function} func The function to check.
  29793. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  29794. */
  29795. function isMasked(func) {
  29796. return !!maskSrcKey && (maskSrcKey in func);
  29797. }
  29798. /**
  29799. * Checks if `func` is capable of being masked.
  29800. *
  29801. * @private
  29802. * @param {*} value The value to check.
  29803. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  29804. */
  29805. var isMaskable = coreJsData ? isFunction : stubFalse;
  29806. /**
  29807. * Checks if `value` is likely a prototype object.
  29808. *
  29809. * @private
  29810. * @param {*} value The value to check.
  29811. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  29812. */
  29813. function isPrototype(value) {
  29814. var Ctor = value && value.constructor,
  29815. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  29816. return value === proto;
  29817. }
  29818. /**
  29819. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  29820. *
  29821. * @private
  29822. * @param {*} value The value to check.
  29823. * @returns {boolean} Returns `true` if `value` if suitable for strict
  29824. * equality comparisons, else `false`.
  29825. */
  29826. function isStrictComparable(value) {
  29827. return value === value && !isObject(value);
  29828. }
  29829. /**
  29830. * A specialized version of `matchesProperty` for source values suitable
  29831. * for strict equality comparisons, i.e. `===`.
  29832. *
  29833. * @private
  29834. * @param {string} key The key of the property to get.
  29835. * @param {*} srcValue The value to match.
  29836. * @returns {Function} Returns the new spec function.
  29837. */
  29838. function matchesStrictComparable(key, srcValue) {
  29839. return function(object) {
  29840. if (object == null) {
  29841. return false;
  29842. }
  29843. return object[key] === srcValue &&
  29844. (srcValue !== undefined || (key in Object(object)));
  29845. };
  29846. }
  29847. /**
  29848. * A specialized version of `_.memoize` which clears the memoized function's
  29849. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  29850. *
  29851. * @private
  29852. * @param {Function} func The function to have its output memoized.
  29853. * @returns {Function} Returns the new memoized function.
  29854. */
  29855. function memoizeCapped(func) {
  29856. var result = memoize(func, function(key) {
  29857. if (cache.size === MAX_MEMOIZE_SIZE) {
  29858. cache.clear();
  29859. }
  29860. return key;
  29861. });
  29862. var cache = result.cache;
  29863. return result;
  29864. }
  29865. /**
  29866. * Merges the function metadata of `source` into `data`.
  29867. *
  29868. * Merging metadata reduces the number of wrappers used to invoke a function.
  29869. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  29870. * may be applied regardless of execution order. Methods like `_.ary` and
  29871. * `_.rearg` modify function arguments, making the order in which they are
  29872. * executed important, preventing the merging of metadata. However, we make
  29873. * an exception for a safe combined case where curried functions have `_.ary`
  29874. * and or `_.rearg` applied.
  29875. *
  29876. * @private
  29877. * @param {Array} data The destination metadata.
  29878. * @param {Array} source The source metadata.
  29879. * @returns {Array} Returns `data`.
  29880. */
  29881. function mergeData(data, source) {
  29882. var bitmask = data[1],
  29883. srcBitmask = source[1],
  29884. newBitmask = bitmask | srcBitmask,
  29885. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  29886. var isCombo =
  29887. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  29888. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  29889. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  29890. // Exit early if metadata can't be merged.
  29891. if (!(isCommon || isCombo)) {
  29892. return data;
  29893. }
  29894. // Use source `thisArg` if available.
  29895. if (srcBitmask & WRAP_BIND_FLAG) {
  29896. data[2] = source[2];
  29897. // Set when currying a bound function.
  29898. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  29899. }
  29900. // Compose partial arguments.
  29901. var value = source[3];
  29902. if (value) {
  29903. var partials = data[3];
  29904. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  29905. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  29906. }
  29907. // Compose partial right arguments.
  29908. value = source[5];
  29909. if (value) {
  29910. partials = data[5];
  29911. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  29912. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  29913. }
  29914. // Use source `argPos` if available.
  29915. value = source[7];
  29916. if (value) {
  29917. data[7] = value;
  29918. }
  29919. // Use source `ary` if it's smaller.
  29920. if (srcBitmask & WRAP_ARY_FLAG) {
  29921. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  29922. }
  29923. // Use source `arity` if one is not provided.
  29924. if (data[9] == null) {
  29925. data[9] = source[9];
  29926. }
  29927. // Use source `func` and merge bitmasks.
  29928. data[0] = source[0];
  29929. data[1] = newBitmask;
  29930. return data;
  29931. }
  29932. /**
  29933. * This function is like
  29934. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  29935. * except that it includes inherited enumerable properties.
  29936. *
  29937. * @private
  29938. * @param {Object} object The object to query.
  29939. * @returns {Array} Returns the array of property names.
  29940. */
  29941. function nativeKeysIn(object) {
  29942. var result = [];
  29943. if (object != null) {
  29944. for (var key in Object(object)) {
  29945. result.push(key);
  29946. }
  29947. }
  29948. return result;
  29949. }
  29950. /**
  29951. * Converts `value` to a string using `Object.prototype.toString`.
  29952. *
  29953. * @private
  29954. * @param {*} value The value to convert.
  29955. * @returns {string} Returns the converted string.
  29956. */
  29957. function objectToString(value) {
  29958. return nativeObjectToString.call(value);
  29959. }
  29960. /**
  29961. * A specialized version of `baseRest` which transforms the rest array.
  29962. *
  29963. * @private
  29964. * @param {Function} func The function to apply a rest parameter to.
  29965. * @param {number} [start=func.length-1] The start position of the rest parameter.
  29966. * @param {Function} transform The rest array transform.
  29967. * @returns {Function} Returns the new function.
  29968. */
  29969. function overRest(func, start, transform) {
  29970. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  29971. return function() {
  29972. var args = arguments,
  29973. index = -1,
  29974. length = nativeMax(args.length - start, 0),
  29975. array = Array(length);
  29976. while (++index < length) {
  29977. array[index] = args[start + index];
  29978. }
  29979. index = -1;
  29980. var otherArgs = Array(start + 1);
  29981. while (++index < start) {
  29982. otherArgs[index] = args[index];
  29983. }
  29984. otherArgs[start] = transform(array);
  29985. return apply(func, this, otherArgs);
  29986. };
  29987. }
  29988. /**
  29989. * Gets the parent value at `path` of `object`.
  29990. *
  29991. * @private
  29992. * @param {Object} object The object to query.
  29993. * @param {Array} path The path to get the parent value of.
  29994. * @returns {*} Returns the parent value.
  29995. */
  29996. function parent(object, path) {
  29997. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  29998. }
  29999. /**
  30000. * Reorder `array` according to the specified indexes where the element at
  30001. * the first index is assigned as the first element, the element at
  30002. * the second index is assigned as the second element, and so on.
  30003. *
  30004. * @private
  30005. * @param {Array} array The array to reorder.
  30006. * @param {Array} indexes The arranged array indexes.
  30007. * @returns {Array} Returns `array`.
  30008. */
  30009. function reorder(array, indexes) {
  30010. var arrLength = array.length,
  30011. length = nativeMin(indexes.length, arrLength),
  30012. oldArray = copyArray(array);
  30013. while (length--) {
  30014. var index = indexes[length];
  30015. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  30016. }
  30017. return array;
  30018. }
  30019. /**
  30020. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  30021. *
  30022. * @private
  30023. * @param {Object} object The object to query.
  30024. * @param {string} key The key of the property to get.
  30025. * @returns {*} Returns the property value.
  30026. */
  30027. function safeGet(object, key) {
  30028. if (key === 'constructor' && typeof object[key] === 'function') {
  30029. return;
  30030. }
  30031. if (key == '__proto__') {
  30032. return;
  30033. }
  30034. return object[key];
  30035. }
  30036. /**
  30037. * Sets metadata for `func`.
  30038. *
  30039. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  30040. * period of time, it will trip its breaker and transition to an identity
  30041. * function to avoid garbage collection pauses in V8. See
  30042. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  30043. * for more details.
  30044. *
  30045. * @private
  30046. * @param {Function} func The function to associate metadata with.
  30047. * @param {*} data The metadata.
  30048. * @returns {Function} Returns `func`.
  30049. */
  30050. var setData = shortOut(baseSetData);
  30051. /**
  30052. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  30053. *
  30054. * @private
  30055. * @param {Function} func The function to delay.
  30056. * @param {number} wait The number of milliseconds to delay invocation.
  30057. * @returns {number|Object} Returns the timer id or timeout object.
  30058. */
  30059. var setTimeout = ctxSetTimeout || function(func, wait) {
  30060. return root.setTimeout(func, wait);
  30061. };
  30062. /**
  30063. * Sets the `toString` method of `func` to return `string`.
  30064. *
  30065. * @private
  30066. * @param {Function} func The function to modify.
  30067. * @param {Function} string The `toString` result.
  30068. * @returns {Function} Returns `func`.
  30069. */
  30070. var setToString = shortOut(baseSetToString);
  30071. /**
  30072. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  30073. * with wrapper details in a comment at the top of the source body.
  30074. *
  30075. * @private
  30076. * @param {Function} wrapper The function to modify.
  30077. * @param {Function} reference The reference function.
  30078. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  30079. * @returns {Function} Returns `wrapper`.
  30080. */
  30081. function setWrapToString(wrapper, reference, bitmask) {
  30082. var source = (reference + '');
  30083. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  30084. }
  30085. /**
  30086. * Creates a function that'll short out and invoke `identity` instead
  30087. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  30088. * milliseconds.
  30089. *
  30090. * @private
  30091. * @param {Function} func The function to restrict.
  30092. * @returns {Function} Returns the new shortable function.
  30093. */
  30094. function shortOut(func) {
  30095. var count = 0,
  30096. lastCalled = 0;
  30097. return function() {
  30098. var stamp = nativeNow(),
  30099. remaining = HOT_SPAN - (stamp - lastCalled);
  30100. lastCalled = stamp;
  30101. if (remaining > 0) {
  30102. if (++count >= HOT_COUNT) {
  30103. return arguments[0];
  30104. }
  30105. } else {
  30106. count = 0;
  30107. }
  30108. return func.apply(undefined, arguments);
  30109. };
  30110. }
  30111. /**
  30112. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  30113. *
  30114. * @private
  30115. * @param {Array} array The array to shuffle.
  30116. * @param {number} [size=array.length] The size of `array`.
  30117. * @returns {Array} Returns `array`.
  30118. */
  30119. function shuffleSelf(array, size) {
  30120. var index = -1,
  30121. length = array.length,
  30122. lastIndex = length - 1;
  30123. size = size === undefined ? length : size;
  30124. while (++index < size) {
  30125. var rand = baseRandom(index, lastIndex),
  30126. value = array[rand];
  30127. array[rand] = array[index];
  30128. array[index] = value;
  30129. }
  30130. array.length = size;
  30131. return array;
  30132. }
  30133. /**
  30134. * Converts `string` to a property path array.
  30135. *
  30136. * @private
  30137. * @param {string} string The string to convert.
  30138. * @returns {Array} Returns the property path array.
  30139. */
  30140. var stringToPath = memoizeCapped(function(string) {
  30141. var result = [];
  30142. if (string.charCodeAt(0) === 46 /* . */) {
  30143. result.push('');
  30144. }
  30145. string.replace(rePropName, function(match, number, quote, subString) {
  30146. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  30147. });
  30148. return result;
  30149. });
  30150. /**
  30151. * Converts `value` to a string key if it's not a string or symbol.
  30152. *
  30153. * @private
  30154. * @param {*} value The value to inspect.
  30155. * @returns {string|symbol} Returns the key.
  30156. */
  30157. function toKey(value) {
  30158. if (typeof value == 'string' || isSymbol(value)) {
  30159. return value;
  30160. }
  30161. var result = (value + '');
  30162. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  30163. }
  30164. /**
  30165. * Converts `func` to its source code.
  30166. *
  30167. * @private
  30168. * @param {Function} func The function to convert.
  30169. * @returns {string} Returns the source code.
  30170. */
  30171. function toSource(func) {
  30172. if (func != null) {
  30173. try {
  30174. return funcToString.call(func);
  30175. } catch (e) {}
  30176. try {
  30177. return (func + '');
  30178. } catch (e) {}
  30179. }
  30180. return '';
  30181. }
  30182. /**
  30183. * Updates wrapper `details` based on `bitmask` flags.
  30184. *
  30185. * @private
  30186. * @returns {Array} details The details to modify.
  30187. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  30188. * @returns {Array} Returns `details`.
  30189. */
  30190. function updateWrapDetails(details, bitmask) {
  30191. arrayEach(wrapFlags, function(pair) {
  30192. var value = '_.' + pair[0];
  30193. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  30194. details.push(value);
  30195. }
  30196. });
  30197. return details.sort();
  30198. }
  30199. /**
  30200. * Creates a clone of `wrapper`.
  30201. *
  30202. * @private
  30203. * @param {Object} wrapper The wrapper to clone.
  30204. * @returns {Object} Returns the cloned wrapper.
  30205. */
  30206. function wrapperClone(wrapper) {
  30207. if (wrapper instanceof LazyWrapper) {
  30208. return wrapper.clone();
  30209. }
  30210. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  30211. result.__actions__ = copyArray(wrapper.__actions__);
  30212. result.__index__ = wrapper.__index__;
  30213. result.__values__ = wrapper.__values__;
  30214. return result;
  30215. }
  30216. /*------------------------------------------------------------------------*/
  30217. /**
  30218. * Creates an array of elements split into groups the length of `size`.
  30219. * If `array` can't be split evenly, the final chunk will be the remaining
  30220. * elements.
  30221. *
  30222. * @static
  30223. * @memberOf _
  30224. * @since 3.0.0
  30225. * @category Array
  30226. * @param {Array} array The array to process.
  30227. * @param {number} [size=1] The length of each chunk
  30228. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  30229. * @returns {Array} Returns the new array of chunks.
  30230. * @example
  30231. *
  30232. * _.chunk(['a', 'b', 'c', 'd'], 2);
  30233. * // => [['a', 'b'], ['c', 'd']]
  30234. *
  30235. * _.chunk(['a', 'b', 'c', 'd'], 3);
  30236. * // => [['a', 'b', 'c'], ['d']]
  30237. */
  30238. function chunk(array, size, guard) {
  30239. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  30240. size = 1;
  30241. } else {
  30242. size = nativeMax(toInteger(size), 0);
  30243. }
  30244. var length = array == null ? 0 : array.length;
  30245. if (!length || size < 1) {
  30246. return [];
  30247. }
  30248. var index = 0,
  30249. resIndex = 0,
  30250. result = Array(nativeCeil(length / size));
  30251. while (index < length) {
  30252. result[resIndex++] = baseSlice(array, index, (index += size));
  30253. }
  30254. return result;
  30255. }
  30256. /**
  30257. * Creates an array with all falsey values removed. The values `false`, `null`,
  30258. * `0`, `""`, `undefined`, and `NaN` are falsey.
  30259. *
  30260. * @static
  30261. * @memberOf _
  30262. * @since 0.1.0
  30263. * @category Array
  30264. * @param {Array} array The array to compact.
  30265. * @returns {Array} Returns the new array of filtered values.
  30266. * @example
  30267. *
  30268. * _.compact([0, 1, false, 2, '', 3]);
  30269. * // => [1, 2, 3]
  30270. */
  30271. function compact(array) {
  30272. var index = -1,
  30273. length = array == null ? 0 : array.length,
  30274. resIndex = 0,
  30275. result = [];
  30276. while (++index < length) {
  30277. var value = array[index];
  30278. if (value) {
  30279. result[resIndex++] = value;
  30280. }
  30281. }
  30282. return result;
  30283. }
  30284. /**
  30285. * Creates a new array concatenating `array` with any additional arrays
  30286. * and/or values.
  30287. *
  30288. * @static
  30289. * @memberOf _
  30290. * @since 4.0.0
  30291. * @category Array
  30292. * @param {Array} array The array to concatenate.
  30293. * @param {...*} [values] The values to concatenate.
  30294. * @returns {Array} Returns the new concatenated array.
  30295. * @example
  30296. *
  30297. * var array = [1];
  30298. * var other = _.concat(array, 2, [3], [[4]]);
  30299. *
  30300. * console.log(other);
  30301. * // => [1, 2, 3, [4]]
  30302. *
  30303. * console.log(array);
  30304. * // => [1]
  30305. */
  30306. function concat() {
  30307. var length = arguments.length;
  30308. if (!length) {
  30309. return [];
  30310. }
  30311. var args = Array(length - 1),
  30312. array = arguments[0],
  30313. index = length;
  30314. while (index--) {
  30315. args[index - 1] = arguments[index];
  30316. }
  30317. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  30318. }
  30319. /**
  30320. * Creates an array of `array` values not included in the other given arrays
  30321. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  30322. * for equality comparisons. The order and references of result values are
  30323. * determined by the first array.
  30324. *
  30325. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  30326. *
  30327. * @static
  30328. * @memberOf _
  30329. * @since 0.1.0
  30330. * @category Array
  30331. * @param {Array} array The array to inspect.
  30332. * @param {...Array} [values] The values to exclude.
  30333. * @returns {Array} Returns the new array of filtered values.
  30334. * @see _.without, _.xor
  30335. * @example
  30336. *
  30337. * _.difference([2, 1], [2, 3]);
  30338. * // => [1]
  30339. */
  30340. var difference = baseRest(function(array, values) {
  30341. return isArrayLikeObject(array)
  30342. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  30343. : [];
  30344. });
  30345. /**
  30346. * This method is like `_.difference` except that it accepts `iteratee` which
  30347. * is invoked for each element of `array` and `values` to generate the criterion
  30348. * by which they're compared. The order and references of result values are
  30349. * determined by the first array. The iteratee is invoked with one argument:
  30350. * (value).
  30351. *
  30352. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  30353. *
  30354. * @static
  30355. * @memberOf _
  30356. * @since 4.0.0
  30357. * @category Array
  30358. * @param {Array} array The array to inspect.
  30359. * @param {...Array} [values] The values to exclude.
  30360. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  30361. * @returns {Array} Returns the new array of filtered values.
  30362. * @example
  30363. *
  30364. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  30365. * // => [1.2]
  30366. *
  30367. * // The `_.property` iteratee shorthand.
  30368. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  30369. * // => [{ 'x': 2 }]
  30370. */
  30371. var differenceBy = baseRest(function(array, values) {
  30372. var iteratee = last(values);
  30373. if (isArrayLikeObject(iteratee)) {
  30374. iteratee = undefined;
  30375. }
  30376. return isArrayLikeObject(array)
  30377. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  30378. : [];
  30379. });
  30380. /**
  30381. * This method is like `_.difference` except that it accepts `comparator`
  30382. * which is invoked to compare elements of `array` to `values`. The order and
  30383. * references of result values are determined by the first array. The comparator
  30384. * is invoked with two arguments: (arrVal, othVal).
  30385. *
  30386. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  30387. *
  30388. * @static
  30389. * @memberOf _
  30390. * @since 4.0.0
  30391. * @category Array
  30392. * @param {Array} array The array to inspect.
  30393. * @param {...Array} [values] The values to exclude.
  30394. * @param {Function} [comparator] The comparator invoked per element.
  30395. * @returns {Array} Returns the new array of filtered values.
  30396. * @example
  30397. *
  30398. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  30399. *
  30400. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  30401. * // => [{ 'x': 2, 'y': 1 }]
  30402. */
  30403. var differenceWith = baseRest(function(array, values) {
  30404. var comparator = last(values);
  30405. if (isArrayLikeObject(comparator)) {
  30406. comparator = undefined;
  30407. }
  30408. return isArrayLikeObject(array)
  30409. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  30410. : [];
  30411. });
  30412. /**
  30413. * Creates a slice of `array` with `n` elements dropped from the beginning.
  30414. *
  30415. * @static
  30416. * @memberOf _
  30417. * @since 0.5.0
  30418. * @category Array
  30419. * @param {Array} array The array to query.
  30420. * @param {number} [n=1] The number of elements to drop.
  30421. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  30422. * @returns {Array} Returns the slice of `array`.
  30423. * @example
  30424. *
  30425. * _.drop([1, 2, 3]);
  30426. * // => [2, 3]
  30427. *
  30428. * _.drop([1, 2, 3], 2);
  30429. * // => [3]
  30430. *
  30431. * _.drop([1, 2, 3], 5);
  30432. * // => []
  30433. *
  30434. * _.drop([1, 2, 3], 0);
  30435. * // => [1, 2, 3]
  30436. */
  30437. function drop(array, n, guard) {
  30438. var length = array == null ? 0 : array.length;
  30439. if (!length) {
  30440. return [];
  30441. }
  30442. n = (guard || n === undefined) ? 1 : toInteger(n);
  30443. return baseSlice(array, n < 0 ? 0 : n, length);
  30444. }
  30445. /**
  30446. * Creates a slice of `array` with `n` elements dropped from the end.
  30447. *
  30448. * @static
  30449. * @memberOf _
  30450. * @since 3.0.0
  30451. * @category Array
  30452. * @param {Array} array The array to query.
  30453. * @param {number} [n=1] The number of elements to drop.
  30454. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  30455. * @returns {Array} Returns the slice of `array`.
  30456. * @example
  30457. *
  30458. * _.dropRight([1, 2, 3]);
  30459. * // => [1, 2]
  30460. *
  30461. * _.dropRight([1, 2, 3], 2);
  30462. * // => [1]
  30463. *
  30464. * _.dropRight([1, 2, 3], 5);
  30465. * // => []
  30466. *
  30467. * _.dropRight([1, 2, 3], 0);
  30468. * // => [1, 2, 3]
  30469. */
  30470. function dropRight(array, n, guard) {
  30471. var length = array == null ? 0 : array.length;
  30472. if (!length) {
  30473. return [];
  30474. }
  30475. n = (guard || n === undefined) ? 1 : toInteger(n);
  30476. n = length - n;
  30477. return baseSlice(array, 0, n < 0 ? 0 : n);
  30478. }
  30479. /**
  30480. * Creates a slice of `array` excluding elements dropped from the end.
  30481. * Elements are dropped until `predicate` returns falsey. The predicate is
  30482. * invoked with three arguments: (value, index, array).
  30483. *
  30484. * @static
  30485. * @memberOf _
  30486. * @since 3.0.0
  30487. * @category Array
  30488. * @param {Array} array The array to query.
  30489. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  30490. * @returns {Array} Returns the slice of `array`.
  30491. * @example
  30492. *
  30493. * var users = [
  30494. * { 'user': 'barney', 'active': true },
  30495. * { 'user': 'fred', 'active': false },
  30496. * { 'user': 'pebbles', 'active': false }
  30497. * ];
  30498. *
  30499. * _.dropRightWhile(users, function(o) { return !o.active; });
  30500. * // => objects for ['barney']
  30501. *
  30502. * // The `_.matches` iteratee shorthand.
  30503. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  30504. * // => objects for ['barney', 'fred']
  30505. *
  30506. * // The `_.matchesProperty` iteratee shorthand.
  30507. * _.dropRightWhile(users, ['active', false]);
  30508. * // => objects for ['barney']
  30509. *
  30510. * // The `_.property` iteratee shorthand.
  30511. * _.dropRightWhile(users, 'active');
  30512. * // => objects for ['barney', 'fred', 'pebbles']
  30513. */
  30514. function dropRightWhile(array, predicate) {
  30515. return (array && array.length)
  30516. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  30517. : [];
  30518. }
  30519. /**
  30520. * Creates a slice of `array` excluding elements dropped from the beginning.
  30521. * Elements are dropped until `predicate` returns falsey. The predicate is
  30522. * invoked with three arguments: (value, index, array).
  30523. *
  30524. * @static
  30525. * @memberOf _
  30526. * @since 3.0.0
  30527. * @category Array
  30528. * @param {Array} array The array to query.
  30529. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  30530. * @returns {Array} Returns the slice of `array`.
  30531. * @example
  30532. *
  30533. * var users = [
  30534. * { 'user': 'barney', 'active': false },
  30535. * { 'user': 'fred', 'active': false },
  30536. * { 'user': 'pebbles', 'active': true }
  30537. * ];
  30538. *
  30539. * _.dropWhile(users, function(o) { return !o.active; });
  30540. * // => objects for ['pebbles']
  30541. *
  30542. * // The `_.matches` iteratee shorthand.
  30543. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  30544. * // => objects for ['fred', 'pebbles']
  30545. *
  30546. * // The `_.matchesProperty` iteratee shorthand.
  30547. * _.dropWhile(users, ['active', false]);
  30548. * // => objects for ['pebbles']
  30549. *
  30550. * // The `_.property` iteratee shorthand.
  30551. * _.dropWhile(users, 'active');
  30552. * // => objects for ['barney', 'fred', 'pebbles']
  30553. */
  30554. function dropWhile(array, predicate) {
  30555. return (array && array.length)
  30556. ? baseWhile(array, getIteratee(predicate, 3), true)
  30557. : [];
  30558. }
  30559. /**
  30560. * Fills elements of `array` with `value` from `start` up to, but not
  30561. * including, `end`.
  30562. *
  30563. * **Note:** This method mutates `array`.
  30564. *
  30565. * @static
  30566. * @memberOf _
  30567. * @since 3.2.0
  30568. * @category Array
  30569. * @param {Array} array The array to fill.
  30570. * @param {*} value The value to fill `array` with.
  30571. * @param {number} [start=0] The start position.
  30572. * @param {number} [end=array.length] The end position.
  30573. * @returns {Array} Returns `array`.
  30574. * @example
  30575. *
  30576. * var array = [1, 2, 3];
  30577. *
  30578. * _.fill(array, 'a');
  30579. * console.log(array);
  30580. * // => ['a', 'a', 'a']
  30581. *
  30582. * _.fill(Array(3), 2);
  30583. * // => [2, 2, 2]
  30584. *
  30585. * _.fill([4, 6, 8, 10], '*', 1, 3);
  30586. * // => [4, '*', '*', 10]
  30587. */
  30588. function fill(array, value, start, end) {
  30589. var length = array == null ? 0 : array.length;
  30590. if (!length) {
  30591. return [];
  30592. }
  30593. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  30594. start = 0;
  30595. end = length;
  30596. }
  30597. return baseFill(array, value, start, end);
  30598. }
  30599. /**
  30600. * This method is like `_.find` except that it returns the index of the first
  30601. * element `predicate` returns truthy for instead of the element itself.
  30602. *
  30603. * @static
  30604. * @memberOf _
  30605. * @since 1.1.0
  30606. * @category Array
  30607. * @param {Array} array The array to inspect.
  30608. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  30609. * @param {number} [fromIndex=0] The index to search from.
  30610. * @returns {number} Returns the index of the found element, else `-1`.
  30611. * @example
  30612. *
  30613. * var users = [
  30614. * { 'user': 'barney', 'active': false },
  30615. * { 'user': 'fred', 'active': false },
  30616. * { 'user': 'pebbles', 'active': true }
  30617. * ];
  30618. *
  30619. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  30620. * // => 0
  30621. *
  30622. * // The `_.matches` iteratee shorthand.
  30623. * _.findIndex(users, { 'user': 'fred', 'active': false });
  30624. * // => 1
  30625. *
  30626. * // The `_.matchesProperty` iteratee shorthand.
  30627. * _.findIndex(users, ['active', false]);
  30628. * // => 0
  30629. *
  30630. * // The `_.property` iteratee shorthand.
  30631. * _.findIndex(users, 'active');
  30632. * // => 2
  30633. */
  30634. function findIndex(array, predicate, fromIndex) {
  30635. var length = array == null ? 0 : array.length;
  30636. if (!length) {
  30637. return -1;
  30638. }
  30639. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  30640. if (index < 0) {
  30641. index = nativeMax(length + index, 0);
  30642. }
  30643. return baseFindIndex(array, getIteratee(predicate, 3), index);
  30644. }
  30645. /**
  30646. * This method is like `_.findIndex` except that it iterates over elements
  30647. * of `collection` from right to left.
  30648. *
  30649. * @static
  30650. * @memberOf _
  30651. * @since 2.0.0
  30652. * @category Array
  30653. * @param {Array} array The array to inspect.
  30654. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  30655. * @param {number} [fromIndex=array.length-1] The index to search from.
  30656. * @returns {number} Returns the index of the found element, else `-1`.
  30657. * @example
  30658. *
  30659. * var users = [
  30660. * { 'user': 'barney', 'active': true },
  30661. * { 'user': 'fred', 'active': false },
  30662. * { 'user': 'pebbles', 'active': false }
  30663. * ];
  30664. *
  30665. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  30666. * // => 2
  30667. *
  30668. * // The `_.matches` iteratee shorthand.
  30669. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  30670. * // => 0
  30671. *
  30672. * // The `_.matchesProperty` iteratee shorthand.
  30673. * _.findLastIndex(users, ['active', false]);
  30674. * // => 2
  30675. *
  30676. * // The `_.property` iteratee shorthand.
  30677. * _.findLastIndex(users, 'active');
  30678. * // => 0
  30679. */
  30680. function findLastIndex(array, predicate, fromIndex) {
  30681. var length = array == null ? 0 : array.length;
  30682. if (!length) {
  30683. return -1;
  30684. }
  30685. var index = length - 1;
  30686. if (fromIndex !== undefined) {
  30687. index = toInteger(fromIndex);
  30688. index = fromIndex < 0
  30689. ? nativeMax(length + index, 0)
  30690. : nativeMin(index, length - 1);
  30691. }
  30692. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  30693. }
  30694. /**
  30695. * Flattens `array` a single level deep.
  30696. *
  30697. * @static
  30698. * @memberOf _
  30699. * @since 0.1.0
  30700. * @category Array
  30701. * @param {Array} array The array to flatten.
  30702. * @returns {Array} Returns the new flattened array.
  30703. * @example
  30704. *
  30705. * _.flatten([1, [2, [3, [4]], 5]]);
  30706. * // => [1, 2, [3, [4]], 5]
  30707. */
  30708. function flatten(array) {
  30709. var length = array == null ? 0 : array.length;
  30710. return length ? baseFlatten(array, 1) : [];
  30711. }
  30712. /**
  30713. * Recursively flattens `array`.
  30714. *
  30715. * @static
  30716. * @memberOf _
  30717. * @since 3.0.0
  30718. * @category Array
  30719. * @param {Array} array The array to flatten.
  30720. * @returns {Array} Returns the new flattened array.
  30721. * @example
  30722. *
  30723. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  30724. * // => [1, 2, 3, 4, 5]
  30725. */
  30726. function flattenDeep(array) {
  30727. var length = array == null ? 0 : array.length;
  30728. return length ? baseFlatten(array, INFINITY) : [];
  30729. }
  30730. /**
  30731. * Recursively flatten `array` up to `depth` times.
  30732. *
  30733. * @static
  30734. * @memberOf _
  30735. * @since 4.4.0
  30736. * @category Array
  30737. * @param {Array} array The array to flatten.
  30738. * @param {number} [depth=1] The maximum recursion depth.
  30739. * @returns {Array} Returns the new flattened array.
  30740. * @example
  30741. *
  30742. * var array = [1, [2, [3, [4]], 5]];
  30743. *
  30744. * _.flattenDepth(array, 1);
  30745. * // => [1, 2, [3, [4]], 5]
  30746. *
  30747. * _.flattenDepth(array, 2);
  30748. * // => [1, 2, 3, [4], 5]
  30749. */
  30750. function flattenDepth(array, depth) {
  30751. var length = array == null ? 0 : array.length;
  30752. if (!length) {
  30753. return [];
  30754. }
  30755. depth = depth === undefined ? 1 : toInteger(depth);
  30756. return baseFlatten(array, depth);
  30757. }
  30758. /**
  30759. * The inverse of `_.toPairs`; this method returns an object composed
  30760. * from key-value `pairs`.
  30761. *
  30762. * @static
  30763. * @memberOf _
  30764. * @since 4.0.0
  30765. * @category Array
  30766. * @param {Array} pairs The key-value pairs.
  30767. * @returns {Object} Returns the new object.
  30768. * @example
  30769. *
  30770. * _.fromPairs([['a', 1], ['b', 2]]);
  30771. * // => { 'a': 1, 'b': 2 }
  30772. */
  30773. function fromPairs(pairs) {
  30774. var index = -1,
  30775. length = pairs == null ? 0 : pairs.length,
  30776. result = {};
  30777. while (++index < length) {
  30778. var pair = pairs[index];
  30779. result[pair[0]] = pair[1];
  30780. }
  30781. return result;
  30782. }
  30783. /**
  30784. * Gets the first element of `array`.
  30785. *
  30786. * @static
  30787. * @memberOf _
  30788. * @since 0.1.0
  30789. * @alias first
  30790. * @category Array
  30791. * @param {Array} array The array to query.
  30792. * @returns {*} Returns the first element of `array`.
  30793. * @example
  30794. *
  30795. * _.head([1, 2, 3]);
  30796. * // => 1
  30797. *
  30798. * _.head([]);
  30799. * // => undefined
  30800. */
  30801. function head(array) {
  30802. return (array && array.length) ? array[0] : undefined;
  30803. }
  30804. /**
  30805. * Gets the index at which the first occurrence of `value` is found in `array`
  30806. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  30807. * for equality comparisons. If `fromIndex` is negative, it's used as the
  30808. * offset from the end of `array`.
  30809. *
  30810. * @static
  30811. * @memberOf _
  30812. * @since 0.1.0
  30813. * @category Array
  30814. * @param {Array} array The array to inspect.
  30815. * @param {*} value The value to search for.
  30816. * @param {number} [fromIndex=0] The index to search from.
  30817. * @returns {number} Returns the index of the matched value, else `-1`.
  30818. * @example
  30819. *
  30820. * _.indexOf([1, 2, 1, 2], 2);
  30821. * // => 1
  30822. *
  30823. * // Search from the `fromIndex`.
  30824. * _.indexOf([1, 2, 1, 2], 2, 2);
  30825. * // => 3
  30826. */
  30827. function indexOf(array, value, fromIndex) {
  30828. var length = array == null ? 0 : array.length;
  30829. if (!length) {
  30830. return -1;
  30831. }
  30832. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  30833. if (index < 0) {
  30834. index = nativeMax(length + index, 0);
  30835. }
  30836. return baseIndexOf(array, value, index);
  30837. }
  30838. /**
  30839. * Gets all but the last element of `array`.
  30840. *
  30841. * @static
  30842. * @memberOf _
  30843. * @since 0.1.0
  30844. * @category Array
  30845. * @param {Array} array The array to query.
  30846. * @returns {Array} Returns the slice of `array`.
  30847. * @example
  30848. *
  30849. * _.initial([1, 2, 3]);
  30850. * // => [1, 2]
  30851. */
  30852. function initial(array) {
  30853. var length = array == null ? 0 : array.length;
  30854. return length ? baseSlice(array, 0, -1) : [];
  30855. }
  30856. /**
  30857. * Creates an array of unique values that are included in all given arrays
  30858. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  30859. * for equality comparisons. The order and references of result values are
  30860. * determined by the first array.
  30861. *
  30862. * @static
  30863. * @memberOf _
  30864. * @since 0.1.0
  30865. * @category Array
  30866. * @param {...Array} [arrays] The arrays to inspect.
  30867. * @returns {Array} Returns the new array of intersecting values.
  30868. * @example
  30869. *
  30870. * _.intersection([2, 1], [2, 3]);
  30871. * // => [2]
  30872. */
  30873. var intersection = baseRest(function(arrays) {
  30874. var mapped = arrayMap(arrays, castArrayLikeObject);
  30875. return (mapped.length && mapped[0] === arrays[0])
  30876. ? baseIntersection(mapped)
  30877. : [];
  30878. });
  30879. /**
  30880. * This method is like `_.intersection` except that it accepts `iteratee`
  30881. * which is invoked for each element of each `arrays` to generate the criterion
  30882. * by which they're compared. The order and references of result values are
  30883. * determined by the first array. The iteratee is invoked with one argument:
  30884. * (value).
  30885. *
  30886. * @static
  30887. * @memberOf _
  30888. * @since 4.0.0
  30889. * @category Array
  30890. * @param {...Array} [arrays] The arrays to inspect.
  30891. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  30892. * @returns {Array} Returns the new array of intersecting values.
  30893. * @example
  30894. *
  30895. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  30896. * // => [2.1]
  30897. *
  30898. * // The `_.property` iteratee shorthand.
  30899. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  30900. * // => [{ 'x': 1 }]
  30901. */
  30902. var intersectionBy = baseRest(function(arrays) {
  30903. var iteratee = last(arrays),
  30904. mapped = arrayMap(arrays, castArrayLikeObject);
  30905. if (iteratee === last(mapped)) {
  30906. iteratee = undefined;
  30907. } else {
  30908. mapped.pop();
  30909. }
  30910. return (mapped.length && mapped[0] === arrays[0])
  30911. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  30912. : [];
  30913. });
  30914. /**
  30915. * This method is like `_.intersection` except that it accepts `comparator`
  30916. * which is invoked to compare elements of `arrays`. The order and references
  30917. * of result values are determined by the first array. The comparator is
  30918. * invoked with two arguments: (arrVal, othVal).
  30919. *
  30920. * @static
  30921. * @memberOf _
  30922. * @since 4.0.0
  30923. * @category Array
  30924. * @param {...Array} [arrays] The arrays to inspect.
  30925. * @param {Function} [comparator] The comparator invoked per element.
  30926. * @returns {Array} Returns the new array of intersecting values.
  30927. * @example
  30928. *
  30929. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  30930. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  30931. *
  30932. * _.intersectionWith(objects, others, _.isEqual);
  30933. * // => [{ 'x': 1, 'y': 2 }]
  30934. */
  30935. var intersectionWith = baseRest(function(arrays) {
  30936. var comparator = last(arrays),
  30937. mapped = arrayMap(arrays, castArrayLikeObject);
  30938. comparator = typeof comparator == 'function' ? comparator : undefined;
  30939. if (comparator) {
  30940. mapped.pop();
  30941. }
  30942. return (mapped.length && mapped[0] === arrays[0])
  30943. ? baseIntersection(mapped, undefined, comparator)
  30944. : [];
  30945. });
  30946. /**
  30947. * Converts all elements in `array` into a string separated by `separator`.
  30948. *
  30949. * @static
  30950. * @memberOf _
  30951. * @since 4.0.0
  30952. * @category Array
  30953. * @param {Array} array The array to convert.
  30954. * @param {string} [separator=','] The element separator.
  30955. * @returns {string} Returns the joined string.
  30956. * @example
  30957. *
  30958. * _.join(['a', 'b', 'c'], '~');
  30959. * // => 'a~b~c'
  30960. */
  30961. function join(array, separator) {
  30962. return array == null ? '' : nativeJoin.call(array, separator);
  30963. }
  30964. /**
  30965. * Gets the last element of `array`.
  30966. *
  30967. * @static
  30968. * @memberOf _
  30969. * @since 0.1.0
  30970. * @category Array
  30971. * @param {Array} array The array to query.
  30972. * @returns {*} Returns the last element of `array`.
  30973. * @example
  30974. *
  30975. * _.last([1, 2, 3]);
  30976. * // => 3
  30977. */
  30978. function last(array) {
  30979. var length = array == null ? 0 : array.length;
  30980. return length ? array[length - 1] : undefined;
  30981. }
  30982. /**
  30983. * This method is like `_.indexOf` except that it iterates over elements of
  30984. * `array` from right to left.
  30985. *
  30986. * @static
  30987. * @memberOf _
  30988. * @since 0.1.0
  30989. * @category Array
  30990. * @param {Array} array The array to inspect.
  30991. * @param {*} value The value to search for.
  30992. * @param {number} [fromIndex=array.length-1] The index to search from.
  30993. * @returns {number} Returns the index of the matched value, else `-1`.
  30994. * @example
  30995. *
  30996. * _.lastIndexOf([1, 2, 1, 2], 2);
  30997. * // => 3
  30998. *
  30999. * // Search from the `fromIndex`.
  31000. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  31001. * // => 1
  31002. */
  31003. function lastIndexOf(array, value, fromIndex) {
  31004. var length = array == null ? 0 : array.length;
  31005. if (!length) {
  31006. return -1;
  31007. }
  31008. var index = length;
  31009. if (fromIndex !== undefined) {
  31010. index = toInteger(fromIndex);
  31011. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  31012. }
  31013. return value === value
  31014. ? strictLastIndexOf(array, value, index)
  31015. : baseFindIndex(array, baseIsNaN, index, true);
  31016. }
  31017. /**
  31018. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  31019. * element from the end is returned.
  31020. *
  31021. * @static
  31022. * @memberOf _
  31023. * @since 4.11.0
  31024. * @category Array
  31025. * @param {Array} array The array to query.
  31026. * @param {number} [n=0] The index of the element to return.
  31027. * @returns {*} Returns the nth element of `array`.
  31028. * @example
  31029. *
  31030. * var array = ['a', 'b', 'c', 'd'];
  31031. *
  31032. * _.nth(array, 1);
  31033. * // => 'b'
  31034. *
  31035. * _.nth(array, -2);
  31036. * // => 'c';
  31037. */
  31038. function nth(array, n) {
  31039. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  31040. }
  31041. /**
  31042. * Removes all given values from `array` using
  31043. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  31044. * for equality comparisons.
  31045. *
  31046. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  31047. * to remove elements from an array by predicate.
  31048. *
  31049. * @static
  31050. * @memberOf _
  31051. * @since 2.0.0
  31052. * @category Array
  31053. * @param {Array} array The array to modify.
  31054. * @param {...*} [values] The values to remove.
  31055. * @returns {Array} Returns `array`.
  31056. * @example
  31057. *
  31058. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  31059. *
  31060. * _.pull(array, 'a', 'c');
  31061. * console.log(array);
  31062. * // => ['b', 'b']
  31063. */
  31064. var pull = baseRest(pullAll);
  31065. /**
  31066. * This method is like `_.pull` except that it accepts an array of values to remove.
  31067. *
  31068. * **Note:** Unlike `_.difference`, this method mutates `array`.
  31069. *
  31070. * @static
  31071. * @memberOf _
  31072. * @since 4.0.0
  31073. * @category Array
  31074. * @param {Array} array The array to modify.
  31075. * @param {Array} values The values to remove.
  31076. * @returns {Array} Returns `array`.
  31077. * @example
  31078. *
  31079. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  31080. *
  31081. * _.pullAll(array, ['a', 'c']);
  31082. * console.log(array);
  31083. * // => ['b', 'b']
  31084. */
  31085. function pullAll(array, values) {
  31086. return (array && array.length && values && values.length)
  31087. ? basePullAll(array, values)
  31088. : array;
  31089. }
  31090. /**
  31091. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  31092. * invoked for each element of `array` and `values` to generate the criterion
  31093. * by which they're compared. The iteratee is invoked with one argument: (value).
  31094. *
  31095. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  31096. *
  31097. * @static
  31098. * @memberOf _
  31099. * @since 4.0.0
  31100. * @category Array
  31101. * @param {Array} array The array to modify.
  31102. * @param {Array} values The values to remove.
  31103. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  31104. * @returns {Array} Returns `array`.
  31105. * @example
  31106. *
  31107. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  31108. *
  31109. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  31110. * console.log(array);
  31111. * // => [{ 'x': 2 }]
  31112. */
  31113. function pullAllBy(array, values, iteratee) {
  31114. return (array && array.length && values && values.length)
  31115. ? basePullAll(array, values, getIteratee(iteratee, 2))
  31116. : array;
  31117. }
  31118. /**
  31119. * This method is like `_.pullAll` except that it accepts `comparator` which
  31120. * is invoked to compare elements of `array` to `values`. The comparator is
  31121. * invoked with two arguments: (arrVal, othVal).
  31122. *
  31123. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  31124. *
  31125. * @static
  31126. * @memberOf _
  31127. * @since 4.6.0
  31128. * @category Array
  31129. * @param {Array} array The array to modify.
  31130. * @param {Array} values The values to remove.
  31131. * @param {Function} [comparator] The comparator invoked per element.
  31132. * @returns {Array} Returns `array`.
  31133. * @example
  31134. *
  31135. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  31136. *
  31137. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  31138. * console.log(array);
  31139. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  31140. */
  31141. function pullAllWith(array, values, comparator) {
  31142. return (array && array.length && values && values.length)
  31143. ? basePullAll(array, values, undefined, comparator)
  31144. : array;
  31145. }
  31146. /**
  31147. * Removes elements from `array` corresponding to `indexes` and returns an
  31148. * array of removed elements.
  31149. *
  31150. * **Note:** Unlike `_.at`, this method mutates `array`.
  31151. *
  31152. * @static
  31153. * @memberOf _
  31154. * @since 3.0.0
  31155. * @category Array
  31156. * @param {Array} array The array to modify.
  31157. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  31158. * @returns {Array} Returns the new array of removed elements.
  31159. * @example
  31160. *
  31161. * var array = ['a', 'b', 'c', 'd'];
  31162. * var pulled = _.pullAt(array, [1, 3]);
  31163. *
  31164. * console.log(array);
  31165. * // => ['a', 'c']
  31166. *
  31167. * console.log(pulled);
  31168. * // => ['b', 'd']
  31169. */
  31170. var pullAt = flatRest(function(array, indexes) {
  31171. var length = array == null ? 0 : array.length,
  31172. result = baseAt(array, indexes);
  31173. basePullAt(array, arrayMap(indexes, function(index) {
  31174. return isIndex(index, length) ? +index : index;
  31175. }).sort(compareAscending));
  31176. return result;
  31177. });
  31178. /**
  31179. * Removes all elements from `array` that `predicate` returns truthy for
  31180. * and returns an array of the removed elements. The predicate is invoked
  31181. * with three arguments: (value, index, array).
  31182. *
  31183. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  31184. * to pull elements from an array by value.
  31185. *
  31186. * @static
  31187. * @memberOf _
  31188. * @since 2.0.0
  31189. * @category Array
  31190. * @param {Array} array The array to modify.
  31191. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  31192. * @returns {Array} Returns the new array of removed elements.
  31193. * @example
  31194. *
  31195. * var array = [1, 2, 3, 4];
  31196. * var evens = _.remove(array, function(n) {
  31197. * return n % 2 == 0;
  31198. * });
  31199. *
  31200. * console.log(array);
  31201. * // => [1, 3]
  31202. *
  31203. * console.log(evens);
  31204. * // => [2, 4]
  31205. */
  31206. function remove(array, predicate) {
  31207. var result = [];
  31208. if (!(array && array.length)) {
  31209. return result;
  31210. }
  31211. var index = -1,
  31212. indexes = [],
  31213. length = array.length;
  31214. predicate = getIteratee(predicate, 3);
  31215. while (++index < length) {
  31216. var value = array[index];
  31217. if (predicate(value, index, array)) {
  31218. result.push(value);
  31219. indexes.push(index);
  31220. }
  31221. }
  31222. basePullAt(array, indexes);
  31223. return result;
  31224. }
  31225. /**
  31226. * Reverses `array` so that the first element becomes the last, the second
  31227. * element becomes the second to last, and so on.
  31228. *
  31229. * **Note:** This method mutates `array` and is based on
  31230. * [`Array#reverse`](https://mdn.io/Array/reverse).
  31231. *
  31232. * @static
  31233. * @memberOf _
  31234. * @since 4.0.0
  31235. * @category Array
  31236. * @param {Array} array The array to modify.
  31237. * @returns {Array} Returns `array`.
  31238. * @example
  31239. *
  31240. * var array = [1, 2, 3];
  31241. *
  31242. * _.reverse(array);
  31243. * // => [3, 2, 1]
  31244. *
  31245. * console.log(array);
  31246. * // => [3, 2, 1]
  31247. */
  31248. function reverse(array) {
  31249. return array == null ? array : nativeReverse.call(array);
  31250. }
  31251. /**
  31252. * Creates a slice of `array` from `start` up to, but not including, `end`.
  31253. *
  31254. * **Note:** This method is used instead of
  31255. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  31256. * returned.
  31257. *
  31258. * @static
  31259. * @memberOf _
  31260. * @since 3.0.0
  31261. * @category Array
  31262. * @param {Array} array The array to slice.
  31263. * @param {number} [start=0] The start position.
  31264. * @param {number} [end=array.length] The end position.
  31265. * @returns {Array} Returns the slice of `array`.
  31266. */
  31267. function slice(array, start, end) {
  31268. var length = array == null ? 0 : array.length;
  31269. if (!length) {
  31270. return [];
  31271. }
  31272. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  31273. start = 0;
  31274. end = length;
  31275. }
  31276. else {
  31277. start = start == null ? 0 : toInteger(start);
  31278. end = end === undefined ? length : toInteger(end);
  31279. }
  31280. return baseSlice(array, start, end);
  31281. }
  31282. /**
  31283. * Uses a binary search to determine the lowest index at which `value`
  31284. * should be inserted into `array` in order to maintain its sort order.
  31285. *
  31286. * @static
  31287. * @memberOf _
  31288. * @since 0.1.0
  31289. * @category Array
  31290. * @param {Array} array The sorted array to inspect.
  31291. * @param {*} value The value to evaluate.
  31292. * @returns {number} Returns the index at which `value` should be inserted
  31293. * into `array`.
  31294. * @example
  31295. *
  31296. * _.sortedIndex([30, 50], 40);
  31297. * // => 1
  31298. */
  31299. function sortedIndex(array, value) {
  31300. return baseSortedIndex(array, value);
  31301. }
  31302. /**
  31303. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  31304. * which is invoked for `value` and each element of `array` to compute their
  31305. * sort ranking. The iteratee is invoked with one argument: (value).
  31306. *
  31307. * @static
  31308. * @memberOf _
  31309. * @since 4.0.0
  31310. * @category Array
  31311. * @param {Array} array The sorted array to inspect.
  31312. * @param {*} value The value to evaluate.
  31313. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  31314. * @returns {number} Returns the index at which `value` should be inserted
  31315. * into `array`.
  31316. * @example
  31317. *
  31318. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  31319. *
  31320. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  31321. * // => 0
  31322. *
  31323. * // The `_.property` iteratee shorthand.
  31324. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  31325. * // => 0
  31326. */
  31327. function sortedIndexBy(array, value, iteratee) {
  31328. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  31329. }
  31330. /**
  31331. * This method is like `_.indexOf` except that it performs a binary
  31332. * search on a sorted `array`.
  31333. *
  31334. * @static
  31335. * @memberOf _
  31336. * @since 4.0.0
  31337. * @category Array
  31338. * @param {Array} array The array to inspect.
  31339. * @param {*} value The value to search for.
  31340. * @returns {number} Returns the index of the matched value, else `-1`.
  31341. * @example
  31342. *
  31343. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  31344. * // => 1
  31345. */
  31346. function sortedIndexOf(array, value) {
  31347. var length = array == null ? 0 : array.length;
  31348. if (length) {
  31349. var index = baseSortedIndex(array, value);
  31350. if (index < length && eq(array[index], value)) {
  31351. return index;
  31352. }
  31353. }
  31354. return -1;
  31355. }
  31356. /**
  31357. * This method is like `_.sortedIndex` except that it returns the highest
  31358. * index at which `value` should be inserted into `array` in order to
  31359. * maintain its sort order.
  31360. *
  31361. * @static
  31362. * @memberOf _
  31363. * @since 3.0.0
  31364. * @category Array
  31365. * @param {Array} array The sorted array to inspect.
  31366. * @param {*} value The value to evaluate.
  31367. * @returns {number} Returns the index at which `value` should be inserted
  31368. * into `array`.
  31369. * @example
  31370. *
  31371. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  31372. * // => 4
  31373. */
  31374. function sortedLastIndex(array, value) {
  31375. return baseSortedIndex(array, value, true);
  31376. }
  31377. /**
  31378. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  31379. * which is invoked for `value` and each element of `array` to compute their
  31380. * sort ranking. The iteratee is invoked with one argument: (value).
  31381. *
  31382. * @static
  31383. * @memberOf _
  31384. * @since 4.0.0
  31385. * @category Array
  31386. * @param {Array} array The sorted array to inspect.
  31387. * @param {*} value The value to evaluate.
  31388. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  31389. * @returns {number} Returns the index at which `value` should be inserted
  31390. * into `array`.
  31391. * @example
  31392. *
  31393. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  31394. *
  31395. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  31396. * // => 1
  31397. *
  31398. * // The `_.property` iteratee shorthand.
  31399. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  31400. * // => 1
  31401. */
  31402. function sortedLastIndexBy(array, value, iteratee) {
  31403. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  31404. }
  31405. /**
  31406. * This method is like `_.lastIndexOf` except that it performs a binary
  31407. * search on a sorted `array`.
  31408. *
  31409. * @static
  31410. * @memberOf _
  31411. * @since 4.0.0
  31412. * @category Array
  31413. * @param {Array} array The array to inspect.
  31414. * @param {*} value The value to search for.
  31415. * @returns {number} Returns the index of the matched value, else `-1`.
  31416. * @example
  31417. *
  31418. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  31419. * // => 3
  31420. */
  31421. function sortedLastIndexOf(array, value) {
  31422. var length = array == null ? 0 : array.length;
  31423. if (length) {
  31424. var index = baseSortedIndex(array, value, true) - 1;
  31425. if (eq(array[index], value)) {
  31426. return index;
  31427. }
  31428. }
  31429. return -1;
  31430. }
  31431. /**
  31432. * This method is like `_.uniq` except that it's designed and optimized
  31433. * for sorted arrays.
  31434. *
  31435. * @static
  31436. * @memberOf _
  31437. * @since 4.0.0
  31438. * @category Array
  31439. * @param {Array} array The array to inspect.
  31440. * @returns {Array} Returns the new duplicate free array.
  31441. * @example
  31442. *
  31443. * _.sortedUniq([1, 1, 2]);
  31444. * // => [1, 2]
  31445. */
  31446. function sortedUniq(array) {
  31447. return (array && array.length)
  31448. ? baseSortedUniq(array)
  31449. : [];
  31450. }
  31451. /**
  31452. * This method is like `_.uniqBy` except that it's designed and optimized
  31453. * for sorted arrays.
  31454. *
  31455. * @static
  31456. * @memberOf _
  31457. * @since 4.0.0
  31458. * @category Array
  31459. * @param {Array} array The array to inspect.
  31460. * @param {Function} [iteratee] The iteratee invoked per element.
  31461. * @returns {Array} Returns the new duplicate free array.
  31462. * @example
  31463. *
  31464. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  31465. * // => [1.1, 2.3]
  31466. */
  31467. function sortedUniqBy(array, iteratee) {
  31468. return (array && array.length)
  31469. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  31470. : [];
  31471. }
  31472. /**
  31473. * Gets all but the first element of `array`.
  31474. *
  31475. * @static
  31476. * @memberOf _
  31477. * @since 4.0.0
  31478. * @category Array
  31479. * @param {Array} array The array to query.
  31480. * @returns {Array} Returns the slice of `array`.
  31481. * @example
  31482. *
  31483. * _.tail([1, 2, 3]);
  31484. * // => [2, 3]
  31485. */
  31486. function tail(array) {
  31487. var length = array == null ? 0 : array.length;
  31488. return length ? baseSlice(array, 1, length) : [];
  31489. }
  31490. /**
  31491. * Creates a slice of `array` with `n` elements taken from the beginning.
  31492. *
  31493. * @static
  31494. * @memberOf _
  31495. * @since 0.1.0
  31496. * @category Array
  31497. * @param {Array} array The array to query.
  31498. * @param {number} [n=1] The number of elements to take.
  31499. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  31500. * @returns {Array} Returns the slice of `array`.
  31501. * @example
  31502. *
  31503. * _.take([1, 2, 3]);
  31504. * // => [1]
  31505. *
  31506. * _.take([1, 2, 3], 2);
  31507. * // => [1, 2]
  31508. *
  31509. * _.take([1, 2, 3], 5);
  31510. * // => [1, 2, 3]
  31511. *
  31512. * _.take([1, 2, 3], 0);
  31513. * // => []
  31514. */
  31515. function take(array, n, guard) {
  31516. if (!(array && array.length)) {
  31517. return [];
  31518. }
  31519. n = (guard || n === undefined) ? 1 : toInteger(n);
  31520. return baseSlice(array, 0, n < 0 ? 0 : n);
  31521. }
  31522. /**
  31523. * Creates a slice of `array` with `n` elements taken from the end.
  31524. *
  31525. * @static
  31526. * @memberOf _
  31527. * @since 3.0.0
  31528. * @category Array
  31529. * @param {Array} array The array to query.
  31530. * @param {number} [n=1] The number of elements to take.
  31531. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  31532. * @returns {Array} Returns the slice of `array`.
  31533. * @example
  31534. *
  31535. * _.takeRight([1, 2, 3]);
  31536. * // => [3]
  31537. *
  31538. * _.takeRight([1, 2, 3], 2);
  31539. * // => [2, 3]
  31540. *
  31541. * _.takeRight([1, 2, 3], 5);
  31542. * // => [1, 2, 3]
  31543. *
  31544. * _.takeRight([1, 2, 3], 0);
  31545. * // => []
  31546. */
  31547. function takeRight(array, n, guard) {
  31548. var length = array == null ? 0 : array.length;
  31549. if (!length) {
  31550. return [];
  31551. }
  31552. n = (guard || n === undefined) ? 1 : toInteger(n);
  31553. n = length - n;
  31554. return baseSlice(array, n < 0 ? 0 : n, length);
  31555. }
  31556. /**
  31557. * Creates a slice of `array` with elements taken from the end. Elements are
  31558. * taken until `predicate` returns falsey. The predicate is invoked with
  31559. * three arguments: (value, index, array).
  31560. *
  31561. * @static
  31562. * @memberOf _
  31563. * @since 3.0.0
  31564. * @category Array
  31565. * @param {Array} array The array to query.
  31566. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  31567. * @returns {Array} Returns the slice of `array`.
  31568. * @example
  31569. *
  31570. * var users = [
  31571. * { 'user': 'barney', 'active': true },
  31572. * { 'user': 'fred', 'active': false },
  31573. * { 'user': 'pebbles', 'active': false }
  31574. * ];
  31575. *
  31576. * _.takeRightWhile(users, function(o) { return !o.active; });
  31577. * // => objects for ['fred', 'pebbles']
  31578. *
  31579. * // The `_.matches` iteratee shorthand.
  31580. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  31581. * // => objects for ['pebbles']
  31582. *
  31583. * // The `_.matchesProperty` iteratee shorthand.
  31584. * _.takeRightWhile(users, ['active', false]);
  31585. * // => objects for ['fred', 'pebbles']
  31586. *
  31587. * // The `_.property` iteratee shorthand.
  31588. * _.takeRightWhile(users, 'active');
  31589. * // => []
  31590. */
  31591. function takeRightWhile(array, predicate) {
  31592. return (array && array.length)
  31593. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  31594. : [];
  31595. }
  31596. /**
  31597. * Creates a slice of `array` with elements taken from the beginning. Elements
  31598. * are taken until `predicate` returns falsey. The predicate is invoked with
  31599. * three arguments: (value, index, array).
  31600. *
  31601. * @static
  31602. * @memberOf _
  31603. * @since 3.0.0
  31604. * @category Array
  31605. * @param {Array} array The array to query.
  31606. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  31607. * @returns {Array} Returns the slice of `array`.
  31608. * @example
  31609. *
  31610. * var users = [
  31611. * { 'user': 'barney', 'active': false },
  31612. * { 'user': 'fred', 'active': false },
  31613. * { 'user': 'pebbles', 'active': true }
  31614. * ];
  31615. *
  31616. * _.takeWhile(users, function(o) { return !o.active; });
  31617. * // => objects for ['barney', 'fred']
  31618. *
  31619. * // The `_.matches` iteratee shorthand.
  31620. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  31621. * // => objects for ['barney']
  31622. *
  31623. * // The `_.matchesProperty` iteratee shorthand.
  31624. * _.takeWhile(users, ['active', false]);
  31625. * // => objects for ['barney', 'fred']
  31626. *
  31627. * // The `_.property` iteratee shorthand.
  31628. * _.takeWhile(users, 'active');
  31629. * // => []
  31630. */
  31631. function takeWhile(array, predicate) {
  31632. return (array && array.length)
  31633. ? baseWhile(array, getIteratee(predicate, 3))
  31634. : [];
  31635. }
  31636. /**
  31637. * Creates an array of unique values, in order, from all given arrays using
  31638. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  31639. * for equality comparisons.
  31640. *
  31641. * @static
  31642. * @memberOf _
  31643. * @since 0.1.0
  31644. * @category Array
  31645. * @param {...Array} [arrays] The arrays to inspect.
  31646. * @returns {Array} Returns the new array of combined values.
  31647. * @example
  31648. *
  31649. * _.union([2], [1, 2]);
  31650. * // => [2, 1]
  31651. */
  31652. var union = baseRest(function(arrays) {
  31653. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  31654. });
  31655. /**
  31656. * This method is like `_.union` except that it accepts `iteratee` which is
  31657. * invoked for each element of each `arrays` to generate the criterion by
  31658. * which uniqueness is computed. Result values are chosen from the first
  31659. * array in which the value occurs. The iteratee is invoked with one argument:
  31660. * (value).
  31661. *
  31662. * @static
  31663. * @memberOf _
  31664. * @since 4.0.0
  31665. * @category Array
  31666. * @param {...Array} [arrays] The arrays to inspect.
  31667. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  31668. * @returns {Array} Returns the new array of combined values.
  31669. * @example
  31670. *
  31671. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  31672. * // => [2.1, 1.2]
  31673. *
  31674. * // The `_.property` iteratee shorthand.
  31675. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  31676. * // => [{ 'x': 1 }, { 'x': 2 }]
  31677. */
  31678. var unionBy = baseRest(function(arrays) {
  31679. var iteratee = last(arrays);
  31680. if (isArrayLikeObject(iteratee)) {
  31681. iteratee = undefined;
  31682. }
  31683. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  31684. });
  31685. /**
  31686. * This method is like `_.union` except that it accepts `comparator` which
  31687. * is invoked to compare elements of `arrays`. Result values are chosen from
  31688. * the first array in which the value occurs. The comparator is invoked
  31689. * with two arguments: (arrVal, othVal).
  31690. *
  31691. * @static
  31692. * @memberOf _
  31693. * @since 4.0.0
  31694. * @category Array
  31695. * @param {...Array} [arrays] The arrays to inspect.
  31696. * @param {Function} [comparator] The comparator invoked per element.
  31697. * @returns {Array} Returns the new array of combined values.
  31698. * @example
  31699. *
  31700. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  31701. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  31702. *
  31703. * _.unionWith(objects, others, _.isEqual);
  31704. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  31705. */
  31706. var unionWith = baseRest(function(arrays) {
  31707. var comparator = last(arrays);
  31708. comparator = typeof comparator == 'function' ? comparator : undefined;
  31709. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  31710. });
  31711. /**
  31712. * Creates a duplicate-free version of an array, using
  31713. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  31714. * for equality comparisons, in which only the first occurrence of each element
  31715. * is kept. The order of result values is determined by the order they occur
  31716. * in the array.
  31717. *
  31718. * @static
  31719. * @memberOf _
  31720. * @since 0.1.0
  31721. * @category Array
  31722. * @param {Array} array The array to inspect.
  31723. * @returns {Array} Returns the new duplicate free array.
  31724. * @example
  31725. *
  31726. * _.uniq([2, 1, 2]);
  31727. * // => [2, 1]
  31728. */
  31729. function uniq(array) {
  31730. return (array && array.length) ? baseUniq(array) : [];
  31731. }
  31732. /**
  31733. * This method is like `_.uniq` except that it accepts `iteratee` which is
  31734. * invoked for each element in `array` to generate the criterion by which
  31735. * uniqueness is computed. The order of result values is determined by the
  31736. * order they occur in the array. The iteratee is invoked with one argument:
  31737. * (value).
  31738. *
  31739. * @static
  31740. * @memberOf _
  31741. * @since 4.0.0
  31742. * @category Array
  31743. * @param {Array} array The array to inspect.
  31744. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  31745. * @returns {Array} Returns the new duplicate free array.
  31746. * @example
  31747. *
  31748. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  31749. * // => [2.1, 1.2]
  31750. *
  31751. * // The `_.property` iteratee shorthand.
  31752. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  31753. * // => [{ 'x': 1 }, { 'x': 2 }]
  31754. */
  31755. function uniqBy(array, iteratee) {
  31756. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  31757. }
  31758. /**
  31759. * This method is like `_.uniq` except that it accepts `comparator` which
  31760. * is invoked to compare elements of `array`. The order of result values is
  31761. * determined by the order they occur in the array.The comparator is invoked
  31762. * with two arguments: (arrVal, othVal).
  31763. *
  31764. * @static
  31765. * @memberOf _
  31766. * @since 4.0.0
  31767. * @category Array
  31768. * @param {Array} array The array to inspect.
  31769. * @param {Function} [comparator] The comparator invoked per element.
  31770. * @returns {Array} Returns the new duplicate free array.
  31771. * @example
  31772. *
  31773. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  31774. *
  31775. * _.uniqWith(objects, _.isEqual);
  31776. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  31777. */
  31778. function uniqWith(array, comparator) {
  31779. comparator = typeof comparator == 'function' ? comparator : undefined;
  31780. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  31781. }
  31782. /**
  31783. * This method is like `_.zip` except that it accepts an array of grouped
  31784. * elements and creates an array regrouping the elements to their pre-zip
  31785. * configuration.
  31786. *
  31787. * @static
  31788. * @memberOf _
  31789. * @since 1.2.0
  31790. * @category Array
  31791. * @param {Array} array The array of grouped elements to process.
  31792. * @returns {Array} Returns the new array of regrouped elements.
  31793. * @example
  31794. *
  31795. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  31796. * // => [['a', 1, true], ['b', 2, false]]
  31797. *
  31798. * _.unzip(zipped);
  31799. * // => [['a', 'b'], [1, 2], [true, false]]
  31800. */
  31801. function unzip(array) {
  31802. if (!(array && array.length)) {
  31803. return [];
  31804. }
  31805. var length = 0;
  31806. array = arrayFilter(array, function(group) {
  31807. if (isArrayLikeObject(group)) {
  31808. length = nativeMax(group.length, length);
  31809. return true;
  31810. }
  31811. });
  31812. return baseTimes(length, function(index) {
  31813. return arrayMap(array, baseProperty(index));
  31814. });
  31815. }
  31816. /**
  31817. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  31818. * how regrouped values should be combined. The iteratee is invoked with the
  31819. * elements of each group: (...group).
  31820. *
  31821. * @static
  31822. * @memberOf _
  31823. * @since 3.8.0
  31824. * @category Array
  31825. * @param {Array} array The array of grouped elements to process.
  31826. * @param {Function} [iteratee=_.identity] The function to combine
  31827. * regrouped values.
  31828. * @returns {Array} Returns the new array of regrouped elements.
  31829. * @example
  31830. *
  31831. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  31832. * // => [[1, 10, 100], [2, 20, 200]]
  31833. *
  31834. * _.unzipWith(zipped, _.add);
  31835. * // => [3, 30, 300]
  31836. */
  31837. function unzipWith(array, iteratee) {
  31838. if (!(array && array.length)) {
  31839. return [];
  31840. }
  31841. var result = unzip(array);
  31842. if (iteratee == null) {
  31843. return result;
  31844. }
  31845. return arrayMap(result, function(group) {
  31846. return apply(iteratee, undefined, group);
  31847. });
  31848. }
  31849. /**
  31850. * Creates an array excluding all given values using
  31851. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  31852. * for equality comparisons.
  31853. *
  31854. * **Note:** Unlike `_.pull`, this method returns a new array.
  31855. *
  31856. * @static
  31857. * @memberOf _
  31858. * @since 0.1.0
  31859. * @category Array
  31860. * @param {Array} array The array to inspect.
  31861. * @param {...*} [values] The values to exclude.
  31862. * @returns {Array} Returns the new array of filtered values.
  31863. * @see _.difference, _.xor
  31864. * @example
  31865. *
  31866. * _.without([2, 1, 2, 3], 1, 2);
  31867. * // => [3]
  31868. */
  31869. var without = baseRest(function(array, values) {
  31870. return isArrayLikeObject(array)
  31871. ? baseDifference(array, values)
  31872. : [];
  31873. });
  31874. /**
  31875. * Creates an array of unique values that is the
  31876. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  31877. * of the given arrays. The order of result values is determined by the order
  31878. * they occur in the arrays.
  31879. *
  31880. * @static
  31881. * @memberOf _
  31882. * @since 2.4.0
  31883. * @category Array
  31884. * @param {...Array} [arrays] The arrays to inspect.
  31885. * @returns {Array} Returns the new array of filtered values.
  31886. * @see _.difference, _.without
  31887. * @example
  31888. *
  31889. * _.xor([2, 1], [2, 3]);
  31890. * // => [1, 3]
  31891. */
  31892. var xor = baseRest(function(arrays) {
  31893. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  31894. });
  31895. /**
  31896. * This method is like `_.xor` except that it accepts `iteratee` which is
  31897. * invoked for each element of each `arrays` to generate the criterion by
  31898. * which by which they're compared. The order of result values is determined
  31899. * by the order they occur in the arrays. The iteratee is invoked with one
  31900. * argument: (value).
  31901. *
  31902. * @static
  31903. * @memberOf _
  31904. * @since 4.0.0
  31905. * @category Array
  31906. * @param {...Array} [arrays] The arrays to inspect.
  31907. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  31908. * @returns {Array} Returns the new array of filtered values.
  31909. * @example
  31910. *
  31911. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  31912. * // => [1.2, 3.4]
  31913. *
  31914. * // The `_.property` iteratee shorthand.
  31915. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  31916. * // => [{ 'x': 2 }]
  31917. */
  31918. var xorBy = baseRest(function(arrays) {
  31919. var iteratee = last(arrays);
  31920. if (isArrayLikeObject(iteratee)) {
  31921. iteratee = undefined;
  31922. }
  31923. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  31924. });
  31925. /**
  31926. * This method is like `_.xor` except that it accepts `comparator` which is
  31927. * invoked to compare elements of `arrays`. The order of result values is
  31928. * determined by the order they occur in the arrays. The comparator is invoked
  31929. * with two arguments: (arrVal, othVal).
  31930. *
  31931. * @static
  31932. * @memberOf _
  31933. * @since 4.0.0
  31934. * @category Array
  31935. * @param {...Array} [arrays] The arrays to inspect.
  31936. * @param {Function} [comparator] The comparator invoked per element.
  31937. * @returns {Array} Returns the new array of filtered values.
  31938. * @example
  31939. *
  31940. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  31941. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  31942. *
  31943. * _.xorWith(objects, others, _.isEqual);
  31944. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  31945. */
  31946. var xorWith = baseRest(function(arrays) {
  31947. var comparator = last(arrays);
  31948. comparator = typeof comparator == 'function' ? comparator : undefined;
  31949. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  31950. });
  31951. /**
  31952. * Creates an array of grouped elements, the first of which contains the
  31953. * first elements of the given arrays, the second of which contains the
  31954. * second elements of the given arrays, and so on.
  31955. *
  31956. * @static
  31957. * @memberOf _
  31958. * @since 0.1.0
  31959. * @category Array
  31960. * @param {...Array} [arrays] The arrays to process.
  31961. * @returns {Array} Returns the new array of grouped elements.
  31962. * @example
  31963. *
  31964. * _.zip(['a', 'b'], [1, 2], [true, false]);
  31965. * // => [['a', 1, true], ['b', 2, false]]
  31966. */
  31967. var zip = baseRest(unzip);
  31968. /**
  31969. * This method is like `_.fromPairs` except that it accepts two arrays,
  31970. * one of property identifiers and one of corresponding values.
  31971. *
  31972. * @static
  31973. * @memberOf _
  31974. * @since 0.4.0
  31975. * @category Array
  31976. * @param {Array} [props=[]] The property identifiers.
  31977. * @param {Array} [values=[]] The property values.
  31978. * @returns {Object} Returns the new object.
  31979. * @example
  31980. *
  31981. * _.zipObject(['a', 'b'], [1, 2]);
  31982. * // => { 'a': 1, 'b': 2 }
  31983. */
  31984. function zipObject(props, values) {
  31985. return baseZipObject(props || [], values || [], assignValue);
  31986. }
  31987. /**
  31988. * This method is like `_.zipObject` except that it supports property paths.
  31989. *
  31990. * @static
  31991. * @memberOf _
  31992. * @since 4.1.0
  31993. * @category Array
  31994. * @param {Array} [props=[]] The property identifiers.
  31995. * @param {Array} [values=[]] The property values.
  31996. * @returns {Object} Returns the new object.
  31997. * @example
  31998. *
  31999. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  32000. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  32001. */
  32002. function zipObjectDeep(props, values) {
  32003. return baseZipObject(props || [], values || [], baseSet);
  32004. }
  32005. /**
  32006. * This method is like `_.zip` except that it accepts `iteratee` to specify
  32007. * how grouped values should be combined. The iteratee is invoked with the
  32008. * elements of each group: (...group).
  32009. *
  32010. * @static
  32011. * @memberOf _
  32012. * @since 3.8.0
  32013. * @category Array
  32014. * @param {...Array} [arrays] The arrays to process.
  32015. * @param {Function} [iteratee=_.identity] The function to combine
  32016. * grouped values.
  32017. * @returns {Array} Returns the new array of grouped elements.
  32018. * @example
  32019. *
  32020. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  32021. * return a + b + c;
  32022. * });
  32023. * // => [111, 222]
  32024. */
  32025. var zipWith = baseRest(function(arrays) {
  32026. var length = arrays.length,
  32027. iteratee = length > 1 ? arrays[length - 1] : undefined;
  32028. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  32029. return unzipWith(arrays, iteratee);
  32030. });
  32031. /*------------------------------------------------------------------------*/
  32032. /**
  32033. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  32034. * chain sequences enabled. The result of such sequences must be unwrapped
  32035. * with `_#value`.
  32036. *
  32037. * @static
  32038. * @memberOf _
  32039. * @since 1.3.0
  32040. * @category Seq
  32041. * @param {*} value The value to wrap.
  32042. * @returns {Object} Returns the new `lodash` wrapper instance.
  32043. * @example
  32044. *
  32045. * var users = [
  32046. * { 'user': 'barney', 'age': 36 },
  32047. * { 'user': 'fred', 'age': 40 },
  32048. * { 'user': 'pebbles', 'age': 1 }
  32049. * ];
  32050. *
  32051. * var youngest = _
  32052. * .chain(users)
  32053. * .sortBy('age')
  32054. * .map(function(o) {
  32055. * return o.user + ' is ' + o.age;
  32056. * })
  32057. * .head()
  32058. * .value();
  32059. * // => 'pebbles is 1'
  32060. */
  32061. function chain(value) {
  32062. var result = lodash(value);
  32063. result.__chain__ = true;
  32064. return result;
  32065. }
  32066. /**
  32067. * This method invokes `interceptor` and returns `value`. The interceptor
  32068. * is invoked with one argument; (value). The purpose of this method is to
  32069. * "tap into" a method chain sequence in order to modify intermediate results.
  32070. *
  32071. * @static
  32072. * @memberOf _
  32073. * @since 0.1.0
  32074. * @category Seq
  32075. * @param {*} value The value to provide to `interceptor`.
  32076. * @param {Function} interceptor The function to invoke.
  32077. * @returns {*} Returns `value`.
  32078. * @example
  32079. *
  32080. * _([1, 2, 3])
  32081. * .tap(function(array) {
  32082. * // Mutate input array.
  32083. * array.pop();
  32084. * })
  32085. * .reverse()
  32086. * .value();
  32087. * // => [2, 1]
  32088. */
  32089. function tap(value, interceptor) {
  32090. interceptor(value);
  32091. return value;
  32092. }
  32093. /**
  32094. * This method is like `_.tap` except that it returns the result of `interceptor`.
  32095. * The purpose of this method is to "pass thru" values replacing intermediate
  32096. * results in a method chain sequence.
  32097. *
  32098. * @static
  32099. * @memberOf _
  32100. * @since 3.0.0
  32101. * @category Seq
  32102. * @param {*} value The value to provide to `interceptor`.
  32103. * @param {Function} interceptor The function to invoke.
  32104. * @returns {*} Returns the result of `interceptor`.
  32105. * @example
  32106. *
  32107. * _(' abc ')
  32108. * .chain()
  32109. * .trim()
  32110. * .thru(function(value) {
  32111. * return [value];
  32112. * })
  32113. * .value();
  32114. * // => ['abc']
  32115. */
  32116. function thru(value, interceptor) {
  32117. return interceptor(value);
  32118. }
  32119. /**
  32120. * This method is the wrapper version of `_.at`.
  32121. *
  32122. * @name at
  32123. * @memberOf _
  32124. * @since 1.0.0
  32125. * @category Seq
  32126. * @param {...(string|string[])} [paths] The property paths to pick.
  32127. * @returns {Object} Returns the new `lodash` wrapper instance.
  32128. * @example
  32129. *
  32130. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  32131. *
  32132. * _(object).at(['a[0].b.c', 'a[1]']).value();
  32133. * // => [3, 4]
  32134. */
  32135. var wrapperAt = flatRest(function(paths) {
  32136. var length = paths.length,
  32137. start = length ? paths[0] : 0,
  32138. value = this.__wrapped__,
  32139. interceptor = function(object) { return baseAt(object, paths); };
  32140. if (length > 1 || this.__actions__.length ||
  32141. !(value instanceof LazyWrapper) || !isIndex(start)) {
  32142. return this.thru(interceptor);
  32143. }
  32144. value = value.slice(start, +start + (length ? 1 : 0));
  32145. value.__actions__.push({
  32146. 'func': thru,
  32147. 'args': [interceptor],
  32148. 'thisArg': undefined
  32149. });
  32150. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  32151. if (length && !array.length) {
  32152. array.push(undefined);
  32153. }
  32154. return array;
  32155. });
  32156. });
  32157. /**
  32158. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  32159. *
  32160. * @name chain
  32161. * @memberOf _
  32162. * @since 0.1.0
  32163. * @category Seq
  32164. * @returns {Object} Returns the new `lodash` wrapper instance.
  32165. * @example
  32166. *
  32167. * var users = [
  32168. * { 'user': 'barney', 'age': 36 },
  32169. * { 'user': 'fred', 'age': 40 }
  32170. * ];
  32171. *
  32172. * // A sequence without explicit chaining.
  32173. * _(users).head();
  32174. * // => { 'user': 'barney', 'age': 36 }
  32175. *
  32176. * // A sequence with explicit chaining.
  32177. * _(users)
  32178. * .chain()
  32179. * .head()
  32180. * .pick('user')
  32181. * .value();
  32182. * // => { 'user': 'barney' }
  32183. */
  32184. function wrapperChain() {
  32185. return chain(this);
  32186. }
  32187. /**
  32188. * Executes the chain sequence and returns the wrapped result.
  32189. *
  32190. * @name commit
  32191. * @memberOf _
  32192. * @since 3.2.0
  32193. * @category Seq
  32194. * @returns {Object} Returns the new `lodash` wrapper instance.
  32195. * @example
  32196. *
  32197. * var array = [1, 2];
  32198. * var wrapped = _(array).push(3);
  32199. *
  32200. * console.log(array);
  32201. * // => [1, 2]
  32202. *
  32203. * wrapped = wrapped.commit();
  32204. * console.log(array);
  32205. * // => [1, 2, 3]
  32206. *
  32207. * wrapped.last();
  32208. * // => 3
  32209. *
  32210. * console.log(array);
  32211. * // => [1, 2, 3]
  32212. */
  32213. function wrapperCommit() {
  32214. return new LodashWrapper(this.value(), this.__chain__);
  32215. }
  32216. /**
  32217. * Gets the next value on a wrapped object following the
  32218. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  32219. *
  32220. * @name next
  32221. * @memberOf _
  32222. * @since 4.0.0
  32223. * @category Seq
  32224. * @returns {Object} Returns the next iterator value.
  32225. * @example
  32226. *
  32227. * var wrapped = _([1, 2]);
  32228. *
  32229. * wrapped.next();
  32230. * // => { 'done': false, 'value': 1 }
  32231. *
  32232. * wrapped.next();
  32233. * // => { 'done': false, 'value': 2 }
  32234. *
  32235. * wrapped.next();
  32236. * // => { 'done': true, 'value': undefined }
  32237. */
  32238. function wrapperNext() {
  32239. if (this.__values__ === undefined) {
  32240. this.__values__ = toArray(this.value());
  32241. }
  32242. var done = this.__index__ >= this.__values__.length,
  32243. value = done ? undefined : this.__values__[this.__index__++];
  32244. return { 'done': done, 'value': value };
  32245. }
  32246. /**
  32247. * Enables the wrapper to be iterable.
  32248. *
  32249. * @name Symbol.iterator
  32250. * @memberOf _
  32251. * @since 4.0.0
  32252. * @category Seq
  32253. * @returns {Object} Returns the wrapper object.
  32254. * @example
  32255. *
  32256. * var wrapped = _([1, 2]);
  32257. *
  32258. * wrapped[Symbol.iterator]() === wrapped;
  32259. * // => true
  32260. *
  32261. * Array.from(wrapped);
  32262. * // => [1, 2]
  32263. */
  32264. function wrapperToIterator() {
  32265. return this;
  32266. }
  32267. /**
  32268. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  32269. *
  32270. * @name plant
  32271. * @memberOf _
  32272. * @since 3.2.0
  32273. * @category Seq
  32274. * @param {*} value The value to plant.
  32275. * @returns {Object} Returns the new `lodash` wrapper instance.
  32276. * @example
  32277. *
  32278. * function square(n) {
  32279. * return n * n;
  32280. * }
  32281. *
  32282. * var wrapped = _([1, 2]).map(square);
  32283. * var other = wrapped.plant([3, 4]);
  32284. *
  32285. * other.value();
  32286. * // => [9, 16]
  32287. *
  32288. * wrapped.value();
  32289. * // => [1, 4]
  32290. */
  32291. function wrapperPlant(value) {
  32292. var result,
  32293. parent = this;
  32294. while (parent instanceof baseLodash) {
  32295. var clone = wrapperClone(parent);
  32296. clone.__index__ = 0;
  32297. clone.__values__ = undefined;
  32298. if (result) {
  32299. previous.__wrapped__ = clone;
  32300. } else {
  32301. result = clone;
  32302. }
  32303. var previous = clone;
  32304. parent = parent.__wrapped__;
  32305. }
  32306. previous.__wrapped__ = value;
  32307. return result;
  32308. }
  32309. /**
  32310. * This method is the wrapper version of `_.reverse`.
  32311. *
  32312. * **Note:** This method mutates the wrapped array.
  32313. *
  32314. * @name reverse
  32315. * @memberOf _
  32316. * @since 0.1.0
  32317. * @category Seq
  32318. * @returns {Object} Returns the new `lodash` wrapper instance.
  32319. * @example
  32320. *
  32321. * var array = [1, 2, 3];
  32322. *
  32323. * _(array).reverse().value()
  32324. * // => [3, 2, 1]
  32325. *
  32326. * console.log(array);
  32327. * // => [3, 2, 1]
  32328. */
  32329. function wrapperReverse() {
  32330. var value = this.__wrapped__;
  32331. if (value instanceof LazyWrapper) {
  32332. var wrapped = value;
  32333. if (this.__actions__.length) {
  32334. wrapped = new LazyWrapper(this);
  32335. }
  32336. wrapped = wrapped.reverse();
  32337. wrapped.__actions__.push({
  32338. 'func': thru,
  32339. 'args': [reverse],
  32340. 'thisArg': undefined
  32341. });
  32342. return new LodashWrapper(wrapped, this.__chain__);
  32343. }
  32344. return this.thru(reverse);
  32345. }
  32346. /**
  32347. * Executes the chain sequence to resolve the unwrapped value.
  32348. *
  32349. * @name value
  32350. * @memberOf _
  32351. * @since 0.1.0
  32352. * @alias toJSON, valueOf
  32353. * @category Seq
  32354. * @returns {*} Returns the resolved unwrapped value.
  32355. * @example
  32356. *
  32357. * _([1, 2, 3]).value();
  32358. * // => [1, 2, 3]
  32359. */
  32360. function wrapperValue() {
  32361. return baseWrapperValue(this.__wrapped__, this.__actions__);
  32362. }
  32363. /*------------------------------------------------------------------------*/
  32364. /**
  32365. * Creates an object composed of keys generated from the results of running
  32366. * each element of `collection` thru `iteratee`. The corresponding value of
  32367. * each key is the number of times the key was returned by `iteratee`. The
  32368. * iteratee is invoked with one argument: (value).
  32369. *
  32370. * @static
  32371. * @memberOf _
  32372. * @since 0.5.0
  32373. * @category Collection
  32374. * @param {Array|Object} collection The collection to iterate over.
  32375. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  32376. * @returns {Object} Returns the composed aggregate object.
  32377. * @example
  32378. *
  32379. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  32380. * // => { '4': 1, '6': 2 }
  32381. *
  32382. * // The `_.property` iteratee shorthand.
  32383. * _.countBy(['one', 'two', 'three'], 'length');
  32384. * // => { '3': 2, '5': 1 }
  32385. */
  32386. var countBy = createAggregator(function(result, value, key) {
  32387. if (hasOwnProperty.call(result, key)) {
  32388. ++result[key];
  32389. } else {
  32390. baseAssignValue(result, key, 1);
  32391. }
  32392. });
  32393. /**
  32394. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  32395. * Iteration is stopped once `predicate` returns falsey. The predicate is
  32396. * invoked with three arguments: (value, index|key, collection).
  32397. *
  32398. * **Note:** This method returns `true` for
  32399. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  32400. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  32401. * elements of empty collections.
  32402. *
  32403. * @static
  32404. * @memberOf _
  32405. * @since 0.1.0
  32406. * @category Collection
  32407. * @param {Array|Object} collection The collection to iterate over.
  32408. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  32409. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  32410. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  32411. * else `false`.
  32412. * @example
  32413. *
  32414. * _.every([true, 1, null, 'yes'], Boolean);
  32415. * // => false
  32416. *
  32417. * var users = [
  32418. * { 'user': 'barney', 'age': 36, 'active': false },
  32419. * { 'user': 'fred', 'age': 40, 'active': false }
  32420. * ];
  32421. *
  32422. * // The `_.matches` iteratee shorthand.
  32423. * _.every(users, { 'user': 'barney', 'active': false });
  32424. * // => false
  32425. *
  32426. * // The `_.matchesProperty` iteratee shorthand.
  32427. * _.every(users, ['active', false]);
  32428. * // => true
  32429. *
  32430. * // The `_.property` iteratee shorthand.
  32431. * _.every(users, 'active');
  32432. * // => false
  32433. */
  32434. function every(collection, predicate, guard) {
  32435. var func = isArray(collection) ? arrayEvery : baseEvery;
  32436. if (guard && isIterateeCall(collection, predicate, guard)) {
  32437. predicate = undefined;
  32438. }
  32439. return func(collection, getIteratee(predicate, 3));
  32440. }
  32441. /**
  32442. * Iterates over elements of `collection`, returning an array of all elements
  32443. * `predicate` returns truthy for. The predicate is invoked with three
  32444. * arguments: (value, index|key, collection).
  32445. *
  32446. * **Note:** Unlike `_.remove`, this method returns a new array.
  32447. *
  32448. * @static
  32449. * @memberOf _
  32450. * @since 0.1.0
  32451. * @category Collection
  32452. * @param {Array|Object} collection The collection to iterate over.
  32453. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  32454. * @returns {Array} Returns the new filtered array.
  32455. * @see _.reject
  32456. * @example
  32457. *
  32458. * var users = [
  32459. * { 'user': 'barney', 'age': 36, 'active': true },
  32460. * { 'user': 'fred', 'age': 40, 'active': false }
  32461. * ];
  32462. *
  32463. * _.filter(users, function(o) { return !o.active; });
  32464. * // => objects for ['fred']
  32465. *
  32466. * // The `_.matches` iteratee shorthand.
  32467. * _.filter(users, { 'age': 36, 'active': true });
  32468. * // => objects for ['barney']
  32469. *
  32470. * // The `_.matchesProperty` iteratee shorthand.
  32471. * _.filter(users, ['active', false]);
  32472. * // => objects for ['fred']
  32473. *
  32474. * // The `_.property` iteratee shorthand.
  32475. * _.filter(users, 'active');
  32476. * // => objects for ['barney']
  32477. *
  32478. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  32479. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  32480. * // => objects for ['fred', 'barney']
  32481. */
  32482. function filter(collection, predicate) {
  32483. var func = isArray(collection) ? arrayFilter : baseFilter;
  32484. return func(collection, getIteratee(predicate, 3));
  32485. }
  32486. /**
  32487. * Iterates over elements of `collection`, returning the first element
  32488. * `predicate` returns truthy for. The predicate is invoked with three
  32489. * arguments: (value, index|key, collection).
  32490. *
  32491. * @static
  32492. * @memberOf _
  32493. * @since 0.1.0
  32494. * @category Collection
  32495. * @param {Array|Object} collection The collection to inspect.
  32496. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  32497. * @param {number} [fromIndex=0] The index to search from.
  32498. * @returns {*} Returns the matched element, else `undefined`.
  32499. * @example
  32500. *
  32501. * var users = [
  32502. * { 'user': 'barney', 'age': 36, 'active': true },
  32503. * { 'user': 'fred', 'age': 40, 'active': false },
  32504. * { 'user': 'pebbles', 'age': 1, 'active': true }
  32505. * ];
  32506. *
  32507. * _.find(users, function(o) { return o.age < 40; });
  32508. * // => object for 'barney'
  32509. *
  32510. * // The `_.matches` iteratee shorthand.
  32511. * _.find(users, { 'age': 1, 'active': true });
  32512. * // => object for 'pebbles'
  32513. *
  32514. * // The `_.matchesProperty` iteratee shorthand.
  32515. * _.find(users, ['active', false]);
  32516. * // => object for 'fred'
  32517. *
  32518. * // The `_.property` iteratee shorthand.
  32519. * _.find(users, 'active');
  32520. * // => object for 'barney'
  32521. */
  32522. var find = createFind(findIndex);
  32523. /**
  32524. * This method is like `_.find` except that it iterates over elements of
  32525. * `collection` from right to left.
  32526. *
  32527. * @static
  32528. * @memberOf _
  32529. * @since 2.0.0
  32530. * @category Collection
  32531. * @param {Array|Object} collection The collection to inspect.
  32532. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  32533. * @param {number} [fromIndex=collection.length-1] The index to search from.
  32534. * @returns {*} Returns the matched element, else `undefined`.
  32535. * @example
  32536. *
  32537. * _.findLast([1, 2, 3, 4], function(n) {
  32538. * return n % 2 == 1;
  32539. * });
  32540. * // => 3
  32541. */
  32542. var findLast = createFind(findLastIndex);
  32543. /**
  32544. * Creates a flattened array of values by running each element in `collection`
  32545. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  32546. * with three arguments: (value, index|key, collection).
  32547. *
  32548. * @static
  32549. * @memberOf _
  32550. * @since 4.0.0
  32551. * @category Collection
  32552. * @param {Array|Object} collection The collection to iterate over.
  32553. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  32554. * @returns {Array} Returns the new flattened array.
  32555. * @example
  32556. *
  32557. * function duplicate(n) {
  32558. * return [n, n];
  32559. * }
  32560. *
  32561. * _.flatMap([1, 2], duplicate);
  32562. * // => [1, 1, 2, 2]
  32563. */
  32564. function flatMap(collection, iteratee) {
  32565. return baseFlatten(map(collection, iteratee), 1);
  32566. }
  32567. /**
  32568. * This method is like `_.flatMap` except that it recursively flattens the
  32569. * mapped results.
  32570. *
  32571. * @static
  32572. * @memberOf _
  32573. * @since 4.7.0
  32574. * @category Collection
  32575. * @param {Array|Object} collection The collection to iterate over.
  32576. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  32577. * @returns {Array} Returns the new flattened array.
  32578. * @example
  32579. *
  32580. * function duplicate(n) {
  32581. * return [[[n, n]]];
  32582. * }
  32583. *
  32584. * _.flatMapDeep([1, 2], duplicate);
  32585. * // => [1, 1, 2, 2]
  32586. */
  32587. function flatMapDeep(collection, iteratee) {
  32588. return baseFlatten(map(collection, iteratee), INFINITY);
  32589. }
  32590. /**
  32591. * This method is like `_.flatMap` except that it recursively flattens the
  32592. * mapped results up to `depth` times.
  32593. *
  32594. * @static
  32595. * @memberOf _
  32596. * @since 4.7.0
  32597. * @category Collection
  32598. * @param {Array|Object} collection The collection to iterate over.
  32599. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  32600. * @param {number} [depth=1] The maximum recursion depth.
  32601. * @returns {Array} Returns the new flattened array.
  32602. * @example
  32603. *
  32604. * function duplicate(n) {
  32605. * return [[[n, n]]];
  32606. * }
  32607. *
  32608. * _.flatMapDepth([1, 2], duplicate, 2);
  32609. * // => [[1, 1], [2, 2]]
  32610. */
  32611. function flatMapDepth(collection, iteratee, depth) {
  32612. depth = depth === undefined ? 1 : toInteger(depth);
  32613. return baseFlatten(map(collection, iteratee), depth);
  32614. }
  32615. /**
  32616. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  32617. * The iteratee is invoked with three arguments: (value, index|key, collection).
  32618. * Iteratee functions may exit iteration early by explicitly returning `false`.
  32619. *
  32620. * **Note:** As with other "Collections" methods, objects with a "length"
  32621. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  32622. * or `_.forOwn` for object iteration.
  32623. *
  32624. * @static
  32625. * @memberOf _
  32626. * @since 0.1.0
  32627. * @alias each
  32628. * @category Collection
  32629. * @param {Array|Object} collection The collection to iterate over.
  32630. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  32631. * @returns {Array|Object} Returns `collection`.
  32632. * @see _.forEachRight
  32633. * @example
  32634. *
  32635. * _.forEach([1, 2], function(value) {
  32636. * console.log(value);
  32637. * });
  32638. * // => Logs `1` then `2`.
  32639. *
  32640. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  32641. * console.log(key);
  32642. * });
  32643. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  32644. */
  32645. function forEach(collection, iteratee) {
  32646. var func = isArray(collection) ? arrayEach : baseEach;
  32647. return func(collection, getIteratee(iteratee, 3));
  32648. }
  32649. /**
  32650. * This method is like `_.forEach` except that it iterates over elements of
  32651. * `collection` from right to left.
  32652. *
  32653. * @static
  32654. * @memberOf _
  32655. * @since 2.0.0
  32656. * @alias eachRight
  32657. * @category Collection
  32658. * @param {Array|Object} collection The collection to iterate over.
  32659. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  32660. * @returns {Array|Object} Returns `collection`.
  32661. * @see _.forEach
  32662. * @example
  32663. *
  32664. * _.forEachRight([1, 2], function(value) {
  32665. * console.log(value);
  32666. * });
  32667. * // => Logs `2` then `1`.
  32668. */
  32669. function forEachRight(collection, iteratee) {
  32670. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  32671. return func(collection, getIteratee(iteratee, 3));
  32672. }
  32673. /**
  32674. * Creates an object composed of keys generated from the results of running
  32675. * each element of `collection` thru `iteratee`. The order of grouped values
  32676. * is determined by the order they occur in `collection`. The corresponding
  32677. * value of each key is an array of elements responsible for generating the
  32678. * key. The iteratee is invoked with one argument: (value).
  32679. *
  32680. * @static
  32681. * @memberOf _
  32682. * @since 0.1.0
  32683. * @category Collection
  32684. * @param {Array|Object} collection The collection to iterate over.
  32685. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  32686. * @returns {Object} Returns the composed aggregate object.
  32687. * @example
  32688. *
  32689. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  32690. * // => { '4': [4.2], '6': [6.1, 6.3] }
  32691. *
  32692. * // The `_.property` iteratee shorthand.
  32693. * _.groupBy(['one', 'two', 'three'], 'length');
  32694. * // => { '3': ['one', 'two'], '5': ['three'] }
  32695. */
  32696. var groupBy = createAggregator(function(result, value, key) {
  32697. if (hasOwnProperty.call(result, key)) {
  32698. result[key].push(value);
  32699. } else {
  32700. baseAssignValue(result, key, [value]);
  32701. }
  32702. });
  32703. /**
  32704. * Checks if `value` is in `collection`. If `collection` is a string, it's
  32705. * checked for a substring of `value`, otherwise
  32706. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  32707. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  32708. * the offset from the end of `collection`.
  32709. *
  32710. * @static
  32711. * @memberOf _
  32712. * @since 0.1.0
  32713. * @category Collection
  32714. * @param {Array|Object|string} collection The collection to inspect.
  32715. * @param {*} value The value to search for.
  32716. * @param {number} [fromIndex=0] The index to search from.
  32717. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  32718. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  32719. * @example
  32720. *
  32721. * _.includes([1, 2, 3], 1);
  32722. * // => true
  32723. *
  32724. * _.includes([1, 2, 3], 1, 2);
  32725. * // => false
  32726. *
  32727. * _.includes({ 'a': 1, 'b': 2 }, 1);
  32728. * // => true
  32729. *
  32730. * _.includes('abcd', 'bc');
  32731. * // => true
  32732. */
  32733. function includes(collection, value, fromIndex, guard) {
  32734. collection = isArrayLike(collection) ? collection : values(collection);
  32735. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  32736. var length = collection.length;
  32737. if (fromIndex < 0) {
  32738. fromIndex = nativeMax(length + fromIndex, 0);
  32739. }
  32740. return isString(collection)
  32741. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  32742. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  32743. }
  32744. /**
  32745. * Invokes the method at `path` of each element in `collection`, returning
  32746. * an array of the results of each invoked method. Any additional arguments
  32747. * are provided to each invoked method. If `path` is a function, it's invoked
  32748. * for, and `this` bound to, each element in `collection`.
  32749. *
  32750. * @static
  32751. * @memberOf _
  32752. * @since 4.0.0
  32753. * @category Collection
  32754. * @param {Array|Object} collection The collection to iterate over.
  32755. * @param {Array|Function|string} path The path of the method to invoke or
  32756. * the function invoked per iteration.
  32757. * @param {...*} [args] The arguments to invoke each method with.
  32758. * @returns {Array} Returns the array of results.
  32759. * @example
  32760. *
  32761. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  32762. * // => [[1, 5, 7], [1, 2, 3]]
  32763. *
  32764. * _.invokeMap([123, 456], String.prototype.split, '');
  32765. * // => [['1', '2', '3'], ['4', '5', '6']]
  32766. */
  32767. var invokeMap = baseRest(function(collection, path, args) {
  32768. var index = -1,
  32769. isFunc = typeof path == 'function',
  32770. result = isArrayLike(collection) ? Array(collection.length) : [];
  32771. baseEach(collection, function(value) {
  32772. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  32773. });
  32774. return result;
  32775. });
  32776. /**
  32777. * Creates an object composed of keys generated from the results of running
  32778. * each element of `collection` thru `iteratee`. The corresponding value of
  32779. * each key is the last element responsible for generating the key. The
  32780. * iteratee is invoked with one argument: (value).
  32781. *
  32782. * @static
  32783. * @memberOf _
  32784. * @since 4.0.0
  32785. * @category Collection
  32786. * @param {Array|Object} collection The collection to iterate over.
  32787. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  32788. * @returns {Object} Returns the composed aggregate object.
  32789. * @example
  32790. *
  32791. * var array = [
  32792. * { 'dir': 'left', 'code': 97 },
  32793. * { 'dir': 'right', 'code': 100 }
  32794. * ];
  32795. *
  32796. * _.keyBy(array, function(o) {
  32797. * return String.fromCharCode(o.code);
  32798. * });
  32799. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  32800. *
  32801. * _.keyBy(array, 'dir');
  32802. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  32803. */
  32804. var keyBy = createAggregator(function(result, value, key) {
  32805. baseAssignValue(result, key, value);
  32806. });
  32807. /**
  32808. * Creates an array of values by running each element in `collection` thru
  32809. * `iteratee`. The iteratee is invoked with three arguments:
  32810. * (value, index|key, collection).
  32811. *
  32812. * Many lodash methods are guarded to work as iteratees for methods like
  32813. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  32814. *
  32815. * The guarded methods are:
  32816. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  32817. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  32818. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  32819. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  32820. *
  32821. * @static
  32822. * @memberOf _
  32823. * @since 0.1.0
  32824. * @category Collection
  32825. * @param {Array|Object} collection The collection to iterate over.
  32826. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  32827. * @returns {Array} Returns the new mapped array.
  32828. * @example
  32829. *
  32830. * function square(n) {
  32831. * return n * n;
  32832. * }
  32833. *
  32834. * _.map([4, 8], square);
  32835. * // => [16, 64]
  32836. *
  32837. * _.map({ 'a': 4, 'b': 8 }, square);
  32838. * // => [16, 64] (iteration order is not guaranteed)
  32839. *
  32840. * var users = [
  32841. * { 'user': 'barney' },
  32842. * { 'user': 'fred' }
  32843. * ];
  32844. *
  32845. * // The `_.property` iteratee shorthand.
  32846. * _.map(users, 'user');
  32847. * // => ['barney', 'fred']
  32848. */
  32849. function map(collection, iteratee) {
  32850. var func = isArray(collection) ? arrayMap : baseMap;
  32851. return func(collection, getIteratee(iteratee, 3));
  32852. }
  32853. /**
  32854. * This method is like `_.sortBy` except that it allows specifying the sort
  32855. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  32856. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  32857. * descending or "asc" for ascending sort order of corresponding values.
  32858. *
  32859. * @static
  32860. * @memberOf _
  32861. * @since 4.0.0
  32862. * @category Collection
  32863. * @param {Array|Object} collection The collection to iterate over.
  32864. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  32865. * The iteratees to sort by.
  32866. * @param {string[]} [orders] The sort orders of `iteratees`.
  32867. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  32868. * @returns {Array} Returns the new sorted array.
  32869. * @example
  32870. *
  32871. * var users = [
  32872. * { 'user': 'fred', 'age': 48 },
  32873. * { 'user': 'barney', 'age': 34 },
  32874. * { 'user': 'fred', 'age': 40 },
  32875. * { 'user': 'barney', 'age': 36 }
  32876. * ];
  32877. *
  32878. * // Sort by `user` in ascending order and by `age` in descending order.
  32879. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  32880. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  32881. */
  32882. function orderBy(collection, iteratees, orders, guard) {
  32883. if (collection == null) {
  32884. return [];
  32885. }
  32886. if (!isArray(iteratees)) {
  32887. iteratees = iteratees == null ? [] : [iteratees];
  32888. }
  32889. orders = guard ? undefined : orders;
  32890. if (!isArray(orders)) {
  32891. orders = orders == null ? [] : [orders];
  32892. }
  32893. return baseOrderBy(collection, iteratees, orders);
  32894. }
  32895. /**
  32896. * Creates an array of elements split into two groups, the first of which
  32897. * contains elements `predicate` returns truthy for, the second of which
  32898. * contains elements `predicate` returns falsey for. The predicate is
  32899. * invoked with one argument: (value).
  32900. *
  32901. * @static
  32902. * @memberOf _
  32903. * @since 3.0.0
  32904. * @category Collection
  32905. * @param {Array|Object} collection The collection to iterate over.
  32906. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  32907. * @returns {Array} Returns the array of grouped elements.
  32908. * @example
  32909. *
  32910. * var users = [
  32911. * { 'user': 'barney', 'age': 36, 'active': false },
  32912. * { 'user': 'fred', 'age': 40, 'active': true },
  32913. * { 'user': 'pebbles', 'age': 1, 'active': false }
  32914. * ];
  32915. *
  32916. * _.partition(users, function(o) { return o.active; });
  32917. * // => objects for [['fred'], ['barney', 'pebbles']]
  32918. *
  32919. * // The `_.matches` iteratee shorthand.
  32920. * _.partition(users, { 'age': 1, 'active': false });
  32921. * // => objects for [['pebbles'], ['barney', 'fred']]
  32922. *
  32923. * // The `_.matchesProperty` iteratee shorthand.
  32924. * _.partition(users, ['active', false]);
  32925. * // => objects for [['barney', 'pebbles'], ['fred']]
  32926. *
  32927. * // The `_.property` iteratee shorthand.
  32928. * _.partition(users, 'active');
  32929. * // => objects for [['fred'], ['barney', 'pebbles']]
  32930. */
  32931. var partition = createAggregator(function(result, value, key) {
  32932. result[key ? 0 : 1].push(value);
  32933. }, function() { return [[], []]; });
  32934. /**
  32935. * Reduces `collection` to a value which is the accumulated result of running
  32936. * each element in `collection` thru `iteratee`, where each successive
  32937. * invocation is supplied the return value of the previous. If `accumulator`
  32938. * is not given, the first element of `collection` is used as the initial
  32939. * value. The iteratee is invoked with four arguments:
  32940. * (accumulator, value, index|key, collection).
  32941. *
  32942. * Many lodash methods are guarded to work as iteratees for methods like
  32943. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  32944. *
  32945. * The guarded methods are:
  32946. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  32947. * and `sortBy`
  32948. *
  32949. * @static
  32950. * @memberOf _
  32951. * @since 0.1.0
  32952. * @category Collection
  32953. * @param {Array|Object} collection The collection to iterate over.
  32954. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  32955. * @param {*} [accumulator] The initial value.
  32956. * @returns {*} Returns the accumulated value.
  32957. * @see _.reduceRight
  32958. * @example
  32959. *
  32960. * _.reduce([1, 2], function(sum, n) {
  32961. * return sum + n;
  32962. * }, 0);
  32963. * // => 3
  32964. *
  32965. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  32966. * (result[value] || (result[value] = [])).push(key);
  32967. * return result;
  32968. * }, {});
  32969. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  32970. */
  32971. function reduce(collection, iteratee, accumulator) {
  32972. var func = isArray(collection) ? arrayReduce : baseReduce,
  32973. initAccum = arguments.length < 3;
  32974. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  32975. }
  32976. /**
  32977. * This method is like `_.reduce` except that it iterates over elements of
  32978. * `collection` from right to left.
  32979. *
  32980. * @static
  32981. * @memberOf _
  32982. * @since 0.1.0
  32983. * @category Collection
  32984. * @param {Array|Object} collection The collection to iterate over.
  32985. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  32986. * @param {*} [accumulator] The initial value.
  32987. * @returns {*} Returns the accumulated value.
  32988. * @see _.reduce
  32989. * @example
  32990. *
  32991. * var array = [[0, 1], [2, 3], [4, 5]];
  32992. *
  32993. * _.reduceRight(array, function(flattened, other) {
  32994. * return flattened.concat(other);
  32995. * }, []);
  32996. * // => [4, 5, 2, 3, 0, 1]
  32997. */
  32998. function reduceRight(collection, iteratee, accumulator) {
  32999. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  33000. initAccum = arguments.length < 3;
  33001. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  33002. }
  33003. /**
  33004. * The opposite of `_.filter`; this method returns the elements of `collection`
  33005. * that `predicate` does **not** return truthy for.
  33006. *
  33007. * @static
  33008. * @memberOf _
  33009. * @since 0.1.0
  33010. * @category Collection
  33011. * @param {Array|Object} collection The collection to iterate over.
  33012. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  33013. * @returns {Array} Returns the new filtered array.
  33014. * @see _.filter
  33015. * @example
  33016. *
  33017. * var users = [
  33018. * { 'user': 'barney', 'age': 36, 'active': false },
  33019. * { 'user': 'fred', 'age': 40, 'active': true }
  33020. * ];
  33021. *
  33022. * _.reject(users, function(o) { return !o.active; });
  33023. * // => objects for ['fred']
  33024. *
  33025. * // The `_.matches` iteratee shorthand.
  33026. * _.reject(users, { 'age': 40, 'active': true });
  33027. * // => objects for ['barney']
  33028. *
  33029. * // The `_.matchesProperty` iteratee shorthand.
  33030. * _.reject(users, ['active', false]);
  33031. * // => objects for ['fred']
  33032. *
  33033. * // The `_.property` iteratee shorthand.
  33034. * _.reject(users, 'active');
  33035. * // => objects for ['barney']
  33036. */
  33037. function reject(collection, predicate) {
  33038. var func = isArray(collection) ? arrayFilter : baseFilter;
  33039. return func(collection, negate(getIteratee(predicate, 3)));
  33040. }
  33041. /**
  33042. * Gets a random element from `collection`.
  33043. *
  33044. * @static
  33045. * @memberOf _
  33046. * @since 2.0.0
  33047. * @category Collection
  33048. * @param {Array|Object} collection The collection to sample.
  33049. * @returns {*} Returns the random element.
  33050. * @example
  33051. *
  33052. * _.sample([1, 2, 3, 4]);
  33053. * // => 2
  33054. */
  33055. function sample(collection) {
  33056. var func = isArray(collection) ? arraySample : baseSample;
  33057. return func(collection);
  33058. }
  33059. /**
  33060. * Gets `n` random elements at unique keys from `collection` up to the
  33061. * size of `collection`.
  33062. *
  33063. * @static
  33064. * @memberOf _
  33065. * @since 4.0.0
  33066. * @category Collection
  33067. * @param {Array|Object} collection The collection to sample.
  33068. * @param {number} [n=1] The number of elements to sample.
  33069. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  33070. * @returns {Array} Returns the random elements.
  33071. * @example
  33072. *
  33073. * _.sampleSize([1, 2, 3], 2);
  33074. * // => [3, 1]
  33075. *
  33076. * _.sampleSize([1, 2, 3], 4);
  33077. * // => [2, 3, 1]
  33078. */
  33079. function sampleSize(collection, n, guard) {
  33080. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  33081. n = 1;
  33082. } else {
  33083. n = toInteger(n);
  33084. }
  33085. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  33086. return func(collection, n);
  33087. }
  33088. /**
  33089. * Creates an array of shuffled values, using a version of the
  33090. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  33091. *
  33092. * @static
  33093. * @memberOf _
  33094. * @since 0.1.0
  33095. * @category Collection
  33096. * @param {Array|Object} collection The collection to shuffle.
  33097. * @returns {Array} Returns the new shuffled array.
  33098. * @example
  33099. *
  33100. * _.shuffle([1, 2, 3, 4]);
  33101. * // => [4, 1, 3, 2]
  33102. */
  33103. function shuffle(collection) {
  33104. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  33105. return func(collection);
  33106. }
  33107. /**
  33108. * Gets the size of `collection` by returning its length for array-like
  33109. * values or the number of own enumerable string keyed properties for objects.
  33110. *
  33111. * @static
  33112. * @memberOf _
  33113. * @since 0.1.0
  33114. * @category Collection
  33115. * @param {Array|Object|string} collection The collection to inspect.
  33116. * @returns {number} Returns the collection size.
  33117. * @example
  33118. *
  33119. * _.size([1, 2, 3]);
  33120. * // => 3
  33121. *
  33122. * _.size({ 'a': 1, 'b': 2 });
  33123. * // => 2
  33124. *
  33125. * _.size('pebbles');
  33126. * // => 7
  33127. */
  33128. function size(collection) {
  33129. if (collection == null) {
  33130. return 0;
  33131. }
  33132. if (isArrayLike(collection)) {
  33133. return isString(collection) ? stringSize(collection) : collection.length;
  33134. }
  33135. var tag = getTag(collection);
  33136. if (tag == mapTag || tag == setTag) {
  33137. return collection.size;
  33138. }
  33139. return baseKeys(collection).length;
  33140. }
  33141. /**
  33142. * Checks if `predicate` returns truthy for **any** element of `collection`.
  33143. * Iteration is stopped once `predicate` returns truthy. The predicate is
  33144. * invoked with three arguments: (value, index|key, collection).
  33145. *
  33146. * @static
  33147. * @memberOf _
  33148. * @since 0.1.0
  33149. * @category Collection
  33150. * @param {Array|Object} collection The collection to iterate over.
  33151. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  33152. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  33153. * @returns {boolean} Returns `true` if any element passes the predicate check,
  33154. * else `false`.
  33155. * @example
  33156. *
  33157. * _.some([null, 0, 'yes', false], Boolean);
  33158. * // => true
  33159. *
  33160. * var users = [
  33161. * { 'user': 'barney', 'active': true },
  33162. * { 'user': 'fred', 'active': false }
  33163. * ];
  33164. *
  33165. * // The `_.matches` iteratee shorthand.
  33166. * _.some(users, { 'user': 'barney', 'active': false });
  33167. * // => false
  33168. *
  33169. * // The `_.matchesProperty` iteratee shorthand.
  33170. * _.some(users, ['active', false]);
  33171. * // => true
  33172. *
  33173. * // The `_.property` iteratee shorthand.
  33174. * _.some(users, 'active');
  33175. * // => true
  33176. */
  33177. function some(collection, predicate, guard) {
  33178. var func = isArray(collection) ? arraySome : baseSome;
  33179. if (guard && isIterateeCall(collection, predicate, guard)) {
  33180. predicate = undefined;
  33181. }
  33182. return func(collection, getIteratee(predicate, 3));
  33183. }
  33184. /**
  33185. * Creates an array of elements, sorted in ascending order by the results of
  33186. * running each element in a collection thru each iteratee. This method
  33187. * performs a stable sort, that is, it preserves the original sort order of
  33188. * equal elements. The iteratees are invoked with one argument: (value).
  33189. *
  33190. * @static
  33191. * @memberOf _
  33192. * @since 0.1.0
  33193. * @category Collection
  33194. * @param {Array|Object} collection The collection to iterate over.
  33195. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  33196. * The iteratees to sort by.
  33197. * @returns {Array} Returns the new sorted array.
  33198. * @example
  33199. *
  33200. * var users = [
  33201. * { 'user': 'fred', 'age': 48 },
  33202. * { 'user': 'barney', 'age': 36 },
  33203. * { 'user': 'fred', 'age': 30 },
  33204. * { 'user': 'barney', 'age': 34 }
  33205. * ];
  33206. *
  33207. * _.sortBy(users, [function(o) { return o.user; }]);
  33208. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  33209. *
  33210. * _.sortBy(users, ['user', 'age']);
  33211. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  33212. */
  33213. var sortBy = baseRest(function(collection, iteratees) {
  33214. if (collection == null) {
  33215. return [];
  33216. }
  33217. var length = iteratees.length;
  33218. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  33219. iteratees = [];
  33220. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  33221. iteratees = [iteratees[0]];
  33222. }
  33223. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  33224. });
  33225. /*------------------------------------------------------------------------*/
  33226. /**
  33227. * Gets the timestamp of the number of milliseconds that have elapsed since
  33228. * the Unix epoch (1 January 1970 00:00:00 UTC).
  33229. *
  33230. * @static
  33231. * @memberOf _
  33232. * @since 2.4.0
  33233. * @category Date
  33234. * @returns {number} Returns the timestamp.
  33235. * @example
  33236. *
  33237. * _.defer(function(stamp) {
  33238. * console.log(_.now() - stamp);
  33239. * }, _.now());
  33240. * // => Logs the number of milliseconds it took for the deferred invocation.
  33241. */
  33242. var now = ctxNow || function() {
  33243. return root.Date.now();
  33244. };
  33245. /*------------------------------------------------------------------------*/
  33246. /**
  33247. * The opposite of `_.before`; this method creates a function that invokes
  33248. * `func` once it's called `n` or more times.
  33249. *
  33250. * @static
  33251. * @memberOf _
  33252. * @since 0.1.0
  33253. * @category Function
  33254. * @param {number} n The number of calls before `func` is invoked.
  33255. * @param {Function} func The function to restrict.
  33256. * @returns {Function} Returns the new restricted function.
  33257. * @example
  33258. *
  33259. * var saves = ['profile', 'settings'];
  33260. *
  33261. * var done = _.after(saves.length, function() {
  33262. * console.log('done saving!');
  33263. * });
  33264. *
  33265. * _.forEach(saves, function(type) {
  33266. * asyncSave({ 'type': type, 'complete': done });
  33267. * });
  33268. * // => Logs 'done saving!' after the two async saves have completed.
  33269. */
  33270. function after(n, func) {
  33271. if (typeof func != 'function') {
  33272. throw new TypeError(FUNC_ERROR_TEXT);
  33273. }
  33274. n = toInteger(n);
  33275. return function() {
  33276. if (--n < 1) {
  33277. return func.apply(this, arguments);
  33278. }
  33279. };
  33280. }
  33281. /**
  33282. * Creates a function that invokes `func`, with up to `n` arguments,
  33283. * ignoring any additional arguments.
  33284. *
  33285. * @static
  33286. * @memberOf _
  33287. * @since 3.0.0
  33288. * @category Function
  33289. * @param {Function} func The function to cap arguments for.
  33290. * @param {number} [n=func.length] The arity cap.
  33291. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  33292. * @returns {Function} Returns the new capped function.
  33293. * @example
  33294. *
  33295. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  33296. * // => [6, 8, 10]
  33297. */
  33298. function ary(func, n, guard) {
  33299. n = guard ? undefined : n;
  33300. n = (func && n == null) ? func.length : n;
  33301. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  33302. }
  33303. /**
  33304. * Creates a function that invokes `func`, with the `this` binding and arguments
  33305. * of the created function, while it's called less than `n` times. Subsequent
  33306. * calls to the created function return the result of the last `func` invocation.
  33307. *
  33308. * @static
  33309. * @memberOf _
  33310. * @since 3.0.0
  33311. * @category Function
  33312. * @param {number} n The number of calls at which `func` is no longer invoked.
  33313. * @param {Function} func The function to restrict.
  33314. * @returns {Function} Returns the new restricted function.
  33315. * @example
  33316. *
  33317. * jQuery(element).on('click', _.before(5, addContactToList));
  33318. * // => Allows adding up to 4 contacts to the list.
  33319. */
  33320. function before(n, func) {
  33321. var result;
  33322. if (typeof func != 'function') {
  33323. throw new TypeError(FUNC_ERROR_TEXT);
  33324. }
  33325. n = toInteger(n);
  33326. return function() {
  33327. if (--n > 0) {
  33328. result = func.apply(this, arguments);
  33329. }
  33330. if (n <= 1) {
  33331. func = undefined;
  33332. }
  33333. return result;
  33334. };
  33335. }
  33336. /**
  33337. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  33338. * and `partials` prepended to the arguments it receives.
  33339. *
  33340. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  33341. * may be used as a placeholder for partially applied arguments.
  33342. *
  33343. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  33344. * property of bound functions.
  33345. *
  33346. * @static
  33347. * @memberOf _
  33348. * @since 0.1.0
  33349. * @category Function
  33350. * @param {Function} func The function to bind.
  33351. * @param {*} thisArg The `this` binding of `func`.
  33352. * @param {...*} [partials] The arguments to be partially applied.
  33353. * @returns {Function} Returns the new bound function.
  33354. * @example
  33355. *
  33356. * function greet(greeting, punctuation) {
  33357. * return greeting + ' ' + this.user + punctuation;
  33358. * }
  33359. *
  33360. * var object = { 'user': 'fred' };
  33361. *
  33362. * var bound = _.bind(greet, object, 'hi');
  33363. * bound('!');
  33364. * // => 'hi fred!'
  33365. *
  33366. * // Bound with placeholders.
  33367. * var bound = _.bind(greet, object, _, '!');
  33368. * bound('hi');
  33369. * // => 'hi fred!'
  33370. */
  33371. var bind = baseRest(function(func, thisArg, partials) {
  33372. var bitmask = WRAP_BIND_FLAG;
  33373. if (partials.length) {
  33374. var holders = replaceHolders(partials, getHolder(bind));
  33375. bitmask |= WRAP_PARTIAL_FLAG;
  33376. }
  33377. return createWrap(func, bitmask, thisArg, partials, holders);
  33378. });
  33379. /**
  33380. * Creates a function that invokes the method at `object[key]` with `partials`
  33381. * prepended to the arguments it receives.
  33382. *
  33383. * This method differs from `_.bind` by allowing bound functions to reference
  33384. * methods that may be redefined or don't yet exist. See
  33385. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  33386. * for more details.
  33387. *
  33388. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  33389. * builds, may be used as a placeholder for partially applied arguments.
  33390. *
  33391. * @static
  33392. * @memberOf _
  33393. * @since 0.10.0
  33394. * @category Function
  33395. * @param {Object} object The object to invoke the method on.
  33396. * @param {string} key The key of the method.
  33397. * @param {...*} [partials] The arguments to be partially applied.
  33398. * @returns {Function} Returns the new bound function.
  33399. * @example
  33400. *
  33401. * var object = {
  33402. * 'user': 'fred',
  33403. * 'greet': function(greeting, punctuation) {
  33404. * return greeting + ' ' + this.user + punctuation;
  33405. * }
  33406. * };
  33407. *
  33408. * var bound = _.bindKey(object, 'greet', 'hi');
  33409. * bound('!');
  33410. * // => 'hi fred!'
  33411. *
  33412. * object.greet = function(greeting, punctuation) {
  33413. * return greeting + 'ya ' + this.user + punctuation;
  33414. * };
  33415. *
  33416. * bound('!');
  33417. * // => 'hiya fred!'
  33418. *
  33419. * // Bound with placeholders.
  33420. * var bound = _.bindKey(object, 'greet', _, '!');
  33421. * bound('hi');
  33422. * // => 'hiya fred!'
  33423. */
  33424. var bindKey = baseRest(function(object, key, partials) {
  33425. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  33426. if (partials.length) {
  33427. var holders = replaceHolders(partials, getHolder(bindKey));
  33428. bitmask |= WRAP_PARTIAL_FLAG;
  33429. }
  33430. return createWrap(key, bitmask, object, partials, holders);
  33431. });
  33432. /**
  33433. * Creates a function that accepts arguments of `func` and either invokes
  33434. * `func` returning its result, if at least `arity` number of arguments have
  33435. * been provided, or returns a function that accepts the remaining `func`
  33436. * arguments, and so on. The arity of `func` may be specified if `func.length`
  33437. * is not sufficient.
  33438. *
  33439. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  33440. * may be used as a placeholder for provided arguments.
  33441. *
  33442. * **Note:** This method doesn't set the "length" property of curried functions.
  33443. *
  33444. * @static
  33445. * @memberOf _
  33446. * @since 2.0.0
  33447. * @category Function
  33448. * @param {Function} func The function to curry.
  33449. * @param {number} [arity=func.length] The arity of `func`.
  33450. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  33451. * @returns {Function} Returns the new curried function.
  33452. * @example
  33453. *
  33454. * var abc = function(a, b, c) {
  33455. * return [a, b, c];
  33456. * };
  33457. *
  33458. * var curried = _.curry(abc);
  33459. *
  33460. * curried(1)(2)(3);
  33461. * // => [1, 2, 3]
  33462. *
  33463. * curried(1, 2)(3);
  33464. * // => [1, 2, 3]
  33465. *
  33466. * curried(1, 2, 3);
  33467. * // => [1, 2, 3]
  33468. *
  33469. * // Curried with placeholders.
  33470. * curried(1)(_, 3)(2);
  33471. * // => [1, 2, 3]
  33472. */
  33473. function curry(func, arity, guard) {
  33474. arity = guard ? undefined : arity;
  33475. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  33476. result.placeholder = curry.placeholder;
  33477. return result;
  33478. }
  33479. /**
  33480. * This method is like `_.curry` except that arguments are applied to `func`
  33481. * in the manner of `_.partialRight` instead of `_.partial`.
  33482. *
  33483. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  33484. * builds, may be used as a placeholder for provided arguments.
  33485. *
  33486. * **Note:** This method doesn't set the "length" property of curried functions.
  33487. *
  33488. * @static
  33489. * @memberOf _
  33490. * @since 3.0.0
  33491. * @category Function
  33492. * @param {Function} func The function to curry.
  33493. * @param {number} [arity=func.length] The arity of `func`.
  33494. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  33495. * @returns {Function} Returns the new curried function.
  33496. * @example
  33497. *
  33498. * var abc = function(a, b, c) {
  33499. * return [a, b, c];
  33500. * };
  33501. *
  33502. * var curried = _.curryRight(abc);
  33503. *
  33504. * curried(3)(2)(1);
  33505. * // => [1, 2, 3]
  33506. *
  33507. * curried(2, 3)(1);
  33508. * // => [1, 2, 3]
  33509. *
  33510. * curried(1, 2, 3);
  33511. * // => [1, 2, 3]
  33512. *
  33513. * // Curried with placeholders.
  33514. * curried(3)(1, _)(2);
  33515. * // => [1, 2, 3]
  33516. */
  33517. function curryRight(func, arity, guard) {
  33518. arity = guard ? undefined : arity;
  33519. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  33520. result.placeholder = curryRight.placeholder;
  33521. return result;
  33522. }
  33523. /**
  33524. * Creates a debounced function that delays invoking `func` until after `wait`
  33525. * milliseconds have elapsed since the last time the debounced function was
  33526. * invoked. The debounced function comes with a `cancel` method to cancel
  33527. * delayed `func` invocations and a `flush` method to immediately invoke them.
  33528. * Provide `options` to indicate whether `func` should be invoked on the
  33529. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  33530. * with the last arguments provided to the debounced function. Subsequent
  33531. * calls to the debounced function return the result of the last `func`
  33532. * invocation.
  33533. *
  33534. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  33535. * invoked on the trailing edge of the timeout only if the debounced function
  33536. * is invoked more than once during the `wait` timeout.
  33537. *
  33538. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  33539. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  33540. *
  33541. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  33542. * for details over the differences between `_.debounce` and `_.throttle`.
  33543. *
  33544. * @static
  33545. * @memberOf _
  33546. * @since 0.1.0
  33547. * @category Function
  33548. * @param {Function} func The function to debounce.
  33549. * @param {number} [wait=0] The number of milliseconds to delay.
  33550. * @param {Object} [options={}] The options object.
  33551. * @param {boolean} [options.leading=false]
  33552. * Specify invoking on the leading edge of the timeout.
  33553. * @param {number} [options.maxWait]
  33554. * The maximum time `func` is allowed to be delayed before it's invoked.
  33555. * @param {boolean} [options.trailing=true]
  33556. * Specify invoking on the trailing edge of the timeout.
  33557. * @returns {Function} Returns the new debounced function.
  33558. * @example
  33559. *
  33560. * // Avoid costly calculations while the window size is in flux.
  33561. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  33562. *
  33563. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  33564. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  33565. * 'leading': true,
  33566. * 'trailing': false
  33567. * }));
  33568. *
  33569. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  33570. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  33571. * var source = new EventSource('/stream');
  33572. * jQuery(source).on('message', debounced);
  33573. *
  33574. * // Cancel the trailing debounced invocation.
  33575. * jQuery(window).on('popstate', debounced.cancel);
  33576. */
  33577. function debounce(func, wait, options) {
  33578. var lastArgs,
  33579. lastThis,
  33580. maxWait,
  33581. result,
  33582. timerId,
  33583. lastCallTime,
  33584. lastInvokeTime = 0,
  33585. leading = false,
  33586. maxing = false,
  33587. trailing = true;
  33588. if (typeof func != 'function') {
  33589. throw new TypeError(FUNC_ERROR_TEXT);
  33590. }
  33591. wait = toNumber(wait) || 0;
  33592. if (isObject(options)) {
  33593. leading = !!options.leading;
  33594. maxing = 'maxWait' in options;
  33595. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  33596. trailing = 'trailing' in options ? !!options.trailing : trailing;
  33597. }
  33598. function invokeFunc(time) {
  33599. var args = lastArgs,
  33600. thisArg = lastThis;
  33601. lastArgs = lastThis = undefined;
  33602. lastInvokeTime = time;
  33603. result = func.apply(thisArg, args);
  33604. return result;
  33605. }
  33606. function leadingEdge(time) {
  33607. // Reset any `maxWait` timer.
  33608. lastInvokeTime = time;
  33609. // Start the timer for the trailing edge.
  33610. timerId = setTimeout(timerExpired, wait);
  33611. // Invoke the leading edge.
  33612. return leading ? invokeFunc(time) : result;
  33613. }
  33614. function remainingWait(time) {
  33615. var timeSinceLastCall = time - lastCallTime,
  33616. timeSinceLastInvoke = time - lastInvokeTime,
  33617. timeWaiting = wait - timeSinceLastCall;
  33618. return maxing
  33619. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  33620. : timeWaiting;
  33621. }
  33622. function shouldInvoke(time) {
  33623. var timeSinceLastCall = time - lastCallTime,
  33624. timeSinceLastInvoke = time - lastInvokeTime;
  33625. // Either this is the first call, activity has stopped and we're at the
  33626. // trailing edge, the system time has gone backwards and we're treating
  33627. // it as the trailing edge, or we've hit the `maxWait` limit.
  33628. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  33629. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  33630. }
  33631. function timerExpired() {
  33632. var time = now();
  33633. if (shouldInvoke(time)) {
  33634. return trailingEdge(time);
  33635. }
  33636. // Restart the timer.
  33637. timerId = setTimeout(timerExpired, remainingWait(time));
  33638. }
  33639. function trailingEdge(time) {
  33640. timerId = undefined;
  33641. // Only invoke if we have `lastArgs` which means `func` has been
  33642. // debounced at least once.
  33643. if (trailing && lastArgs) {
  33644. return invokeFunc(time);
  33645. }
  33646. lastArgs = lastThis = undefined;
  33647. return result;
  33648. }
  33649. function cancel() {
  33650. if (timerId !== undefined) {
  33651. clearTimeout(timerId);
  33652. }
  33653. lastInvokeTime = 0;
  33654. lastArgs = lastCallTime = lastThis = timerId = undefined;
  33655. }
  33656. function flush() {
  33657. return timerId === undefined ? result : trailingEdge(now());
  33658. }
  33659. function debounced() {
  33660. var time = now(),
  33661. isInvoking = shouldInvoke(time);
  33662. lastArgs = arguments;
  33663. lastThis = this;
  33664. lastCallTime = time;
  33665. if (isInvoking) {
  33666. if (timerId === undefined) {
  33667. return leadingEdge(lastCallTime);
  33668. }
  33669. if (maxing) {
  33670. // Handle invocations in a tight loop.
  33671. clearTimeout(timerId);
  33672. timerId = setTimeout(timerExpired, wait);
  33673. return invokeFunc(lastCallTime);
  33674. }
  33675. }
  33676. if (timerId === undefined) {
  33677. timerId = setTimeout(timerExpired, wait);
  33678. }
  33679. return result;
  33680. }
  33681. debounced.cancel = cancel;
  33682. debounced.flush = flush;
  33683. return debounced;
  33684. }
  33685. /**
  33686. * Defers invoking the `func` until the current call stack has cleared. Any
  33687. * additional arguments are provided to `func` when it's invoked.
  33688. *
  33689. * @static
  33690. * @memberOf _
  33691. * @since 0.1.0
  33692. * @category Function
  33693. * @param {Function} func The function to defer.
  33694. * @param {...*} [args] The arguments to invoke `func` with.
  33695. * @returns {number} Returns the timer id.
  33696. * @example
  33697. *
  33698. * _.defer(function(text) {
  33699. * console.log(text);
  33700. * }, 'deferred');
  33701. * // => Logs 'deferred' after one millisecond.
  33702. */
  33703. var defer = baseRest(function(func, args) {
  33704. return baseDelay(func, 1, args);
  33705. });
  33706. /**
  33707. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  33708. * provided to `func` when it's invoked.
  33709. *
  33710. * @static
  33711. * @memberOf _
  33712. * @since 0.1.0
  33713. * @category Function
  33714. * @param {Function} func The function to delay.
  33715. * @param {number} wait The number of milliseconds to delay invocation.
  33716. * @param {...*} [args] The arguments to invoke `func` with.
  33717. * @returns {number} Returns the timer id.
  33718. * @example
  33719. *
  33720. * _.delay(function(text) {
  33721. * console.log(text);
  33722. * }, 1000, 'later');
  33723. * // => Logs 'later' after one second.
  33724. */
  33725. var delay = baseRest(function(func, wait, args) {
  33726. return baseDelay(func, toNumber(wait) || 0, args);
  33727. });
  33728. /**
  33729. * Creates a function that invokes `func` with arguments reversed.
  33730. *
  33731. * @static
  33732. * @memberOf _
  33733. * @since 4.0.0
  33734. * @category Function
  33735. * @param {Function} func The function to flip arguments for.
  33736. * @returns {Function} Returns the new flipped function.
  33737. * @example
  33738. *
  33739. * var flipped = _.flip(function() {
  33740. * return _.toArray(arguments);
  33741. * });
  33742. *
  33743. * flipped('a', 'b', 'c', 'd');
  33744. * // => ['d', 'c', 'b', 'a']
  33745. */
  33746. function flip(func) {
  33747. return createWrap(func, WRAP_FLIP_FLAG);
  33748. }
  33749. /**
  33750. * Creates a function that memoizes the result of `func`. If `resolver` is
  33751. * provided, it determines the cache key for storing the result based on the
  33752. * arguments provided to the memoized function. By default, the first argument
  33753. * provided to the memoized function is used as the map cache key. The `func`
  33754. * is invoked with the `this` binding of the memoized function.
  33755. *
  33756. * **Note:** The cache is exposed as the `cache` property on the memoized
  33757. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  33758. * constructor with one whose instances implement the
  33759. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  33760. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  33761. *
  33762. * @static
  33763. * @memberOf _
  33764. * @since 0.1.0
  33765. * @category Function
  33766. * @param {Function} func The function to have its output memoized.
  33767. * @param {Function} [resolver] The function to resolve the cache key.
  33768. * @returns {Function} Returns the new memoized function.
  33769. * @example
  33770. *
  33771. * var object = { 'a': 1, 'b': 2 };
  33772. * var other = { 'c': 3, 'd': 4 };
  33773. *
  33774. * var values = _.memoize(_.values);
  33775. * values(object);
  33776. * // => [1, 2]
  33777. *
  33778. * values(other);
  33779. * // => [3, 4]
  33780. *
  33781. * object.a = 2;
  33782. * values(object);
  33783. * // => [1, 2]
  33784. *
  33785. * // Modify the result cache.
  33786. * values.cache.set(object, ['a', 'b']);
  33787. * values(object);
  33788. * // => ['a', 'b']
  33789. *
  33790. * // Replace `_.memoize.Cache`.
  33791. * _.memoize.Cache = WeakMap;
  33792. */
  33793. function memoize(func, resolver) {
  33794. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  33795. throw new TypeError(FUNC_ERROR_TEXT);
  33796. }
  33797. var memoized = function() {
  33798. var args = arguments,
  33799. key = resolver ? resolver.apply(this, args) : args[0],
  33800. cache = memoized.cache;
  33801. if (cache.has(key)) {
  33802. return cache.get(key);
  33803. }
  33804. var result = func.apply(this, args);
  33805. memoized.cache = cache.set(key, result) || cache;
  33806. return result;
  33807. };
  33808. memoized.cache = new (memoize.Cache || MapCache);
  33809. return memoized;
  33810. }
  33811. // Expose `MapCache`.
  33812. memoize.Cache = MapCache;
  33813. /**
  33814. * Creates a function that negates the result of the predicate `func`. The
  33815. * `func` predicate is invoked with the `this` binding and arguments of the
  33816. * created function.
  33817. *
  33818. * @static
  33819. * @memberOf _
  33820. * @since 3.0.0
  33821. * @category Function
  33822. * @param {Function} predicate The predicate to negate.
  33823. * @returns {Function} Returns the new negated function.
  33824. * @example
  33825. *
  33826. * function isEven(n) {
  33827. * return n % 2 == 0;
  33828. * }
  33829. *
  33830. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  33831. * // => [1, 3, 5]
  33832. */
  33833. function negate(predicate) {
  33834. if (typeof predicate != 'function') {
  33835. throw new TypeError(FUNC_ERROR_TEXT);
  33836. }
  33837. return function() {
  33838. var args = arguments;
  33839. switch (args.length) {
  33840. case 0: return !predicate.call(this);
  33841. case 1: return !predicate.call(this, args[0]);
  33842. case 2: return !predicate.call(this, args[0], args[1]);
  33843. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  33844. }
  33845. return !predicate.apply(this, args);
  33846. };
  33847. }
  33848. /**
  33849. * Creates a function that is restricted to invoking `func` once. Repeat calls
  33850. * to the function return the value of the first invocation. The `func` is
  33851. * invoked with the `this` binding and arguments of the created function.
  33852. *
  33853. * @static
  33854. * @memberOf _
  33855. * @since 0.1.0
  33856. * @category Function
  33857. * @param {Function} func The function to restrict.
  33858. * @returns {Function} Returns the new restricted function.
  33859. * @example
  33860. *
  33861. * var initialize = _.once(createApplication);
  33862. * initialize();
  33863. * initialize();
  33864. * // => `createApplication` is invoked once
  33865. */
  33866. function once(func) {
  33867. return before(2, func);
  33868. }
  33869. /**
  33870. * Creates a function that invokes `func` with its arguments transformed.
  33871. *
  33872. * @static
  33873. * @since 4.0.0
  33874. * @memberOf _
  33875. * @category Function
  33876. * @param {Function} func The function to wrap.
  33877. * @param {...(Function|Function[])} [transforms=[_.identity]]
  33878. * The argument transforms.
  33879. * @returns {Function} Returns the new function.
  33880. * @example
  33881. *
  33882. * function doubled(n) {
  33883. * return n * 2;
  33884. * }
  33885. *
  33886. * function square(n) {
  33887. * return n * n;
  33888. * }
  33889. *
  33890. * var func = _.overArgs(function(x, y) {
  33891. * return [x, y];
  33892. * }, [square, doubled]);
  33893. *
  33894. * func(9, 3);
  33895. * // => [81, 6]
  33896. *
  33897. * func(10, 5);
  33898. * // => [100, 10]
  33899. */
  33900. var overArgs = castRest(function(func, transforms) {
  33901. transforms = (transforms.length == 1 && isArray(transforms[0]))
  33902. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  33903. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  33904. var funcsLength = transforms.length;
  33905. return baseRest(function(args) {
  33906. var index = -1,
  33907. length = nativeMin(args.length, funcsLength);
  33908. while (++index < length) {
  33909. args[index] = transforms[index].call(this, args[index]);
  33910. }
  33911. return apply(func, this, args);
  33912. });
  33913. });
  33914. /**
  33915. * Creates a function that invokes `func` with `partials` prepended to the
  33916. * arguments it receives. This method is like `_.bind` except it does **not**
  33917. * alter the `this` binding.
  33918. *
  33919. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  33920. * builds, may be used as a placeholder for partially applied arguments.
  33921. *
  33922. * **Note:** This method doesn't set the "length" property of partially
  33923. * applied functions.
  33924. *
  33925. * @static
  33926. * @memberOf _
  33927. * @since 0.2.0
  33928. * @category Function
  33929. * @param {Function} func The function to partially apply arguments to.
  33930. * @param {...*} [partials] The arguments to be partially applied.
  33931. * @returns {Function} Returns the new partially applied function.
  33932. * @example
  33933. *
  33934. * function greet(greeting, name) {
  33935. * return greeting + ' ' + name;
  33936. * }
  33937. *
  33938. * var sayHelloTo = _.partial(greet, 'hello');
  33939. * sayHelloTo('fred');
  33940. * // => 'hello fred'
  33941. *
  33942. * // Partially applied with placeholders.
  33943. * var greetFred = _.partial(greet, _, 'fred');
  33944. * greetFred('hi');
  33945. * // => 'hi fred'
  33946. */
  33947. var partial = baseRest(function(func, partials) {
  33948. var holders = replaceHolders(partials, getHolder(partial));
  33949. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  33950. });
  33951. /**
  33952. * This method is like `_.partial` except that partially applied arguments
  33953. * are appended to the arguments it receives.
  33954. *
  33955. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  33956. * builds, may be used as a placeholder for partially applied arguments.
  33957. *
  33958. * **Note:** This method doesn't set the "length" property of partially
  33959. * applied functions.
  33960. *
  33961. * @static
  33962. * @memberOf _
  33963. * @since 1.0.0
  33964. * @category Function
  33965. * @param {Function} func The function to partially apply arguments to.
  33966. * @param {...*} [partials] The arguments to be partially applied.
  33967. * @returns {Function} Returns the new partially applied function.
  33968. * @example
  33969. *
  33970. * function greet(greeting, name) {
  33971. * return greeting + ' ' + name;
  33972. * }
  33973. *
  33974. * var greetFred = _.partialRight(greet, 'fred');
  33975. * greetFred('hi');
  33976. * // => 'hi fred'
  33977. *
  33978. * // Partially applied with placeholders.
  33979. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  33980. * sayHelloTo('fred');
  33981. * // => 'hello fred'
  33982. */
  33983. var partialRight = baseRest(function(func, partials) {
  33984. var holders = replaceHolders(partials, getHolder(partialRight));
  33985. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  33986. });
  33987. /**
  33988. * Creates a function that invokes `func` with arguments arranged according
  33989. * to the specified `indexes` where the argument value at the first index is
  33990. * provided as the first argument, the argument value at the second index is
  33991. * provided as the second argument, and so on.
  33992. *
  33993. * @static
  33994. * @memberOf _
  33995. * @since 3.0.0
  33996. * @category Function
  33997. * @param {Function} func The function to rearrange arguments for.
  33998. * @param {...(number|number[])} indexes The arranged argument indexes.
  33999. * @returns {Function} Returns the new function.
  34000. * @example
  34001. *
  34002. * var rearged = _.rearg(function(a, b, c) {
  34003. * return [a, b, c];
  34004. * }, [2, 0, 1]);
  34005. *
  34006. * rearged('b', 'c', 'a')
  34007. * // => ['a', 'b', 'c']
  34008. */
  34009. var rearg = flatRest(function(func, indexes) {
  34010. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  34011. });
  34012. /**
  34013. * Creates a function that invokes `func` with the `this` binding of the
  34014. * created function and arguments from `start` and beyond provided as
  34015. * an array.
  34016. *
  34017. * **Note:** This method is based on the
  34018. * [rest parameter](https://mdn.io/rest_parameters).
  34019. *
  34020. * @static
  34021. * @memberOf _
  34022. * @since 4.0.0
  34023. * @category Function
  34024. * @param {Function} func The function to apply a rest parameter to.
  34025. * @param {number} [start=func.length-1] The start position of the rest parameter.
  34026. * @returns {Function} Returns the new function.
  34027. * @example
  34028. *
  34029. * var say = _.rest(function(what, names) {
  34030. * return what + ' ' + _.initial(names).join(', ') +
  34031. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  34032. * });
  34033. *
  34034. * say('hello', 'fred', 'barney', 'pebbles');
  34035. * // => 'hello fred, barney, & pebbles'
  34036. */
  34037. function rest(func, start) {
  34038. if (typeof func != 'function') {
  34039. throw new TypeError(FUNC_ERROR_TEXT);
  34040. }
  34041. start = start === undefined ? start : toInteger(start);
  34042. return baseRest(func, start);
  34043. }
  34044. /**
  34045. * Creates a function that invokes `func` with the `this` binding of the
  34046. * create function and an array of arguments much like
  34047. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  34048. *
  34049. * **Note:** This method is based on the
  34050. * [spread operator](https://mdn.io/spread_operator).
  34051. *
  34052. * @static
  34053. * @memberOf _
  34054. * @since 3.2.0
  34055. * @category Function
  34056. * @param {Function} func The function to spread arguments over.
  34057. * @param {number} [start=0] The start position of the spread.
  34058. * @returns {Function} Returns the new function.
  34059. * @example
  34060. *
  34061. * var say = _.spread(function(who, what) {
  34062. * return who + ' says ' + what;
  34063. * });
  34064. *
  34065. * say(['fred', 'hello']);
  34066. * // => 'fred says hello'
  34067. *
  34068. * var numbers = Promise.all([
  34069. * Promise.resolve(40),
  34070. * Promise.resolve(36)
  34071. * ]);
  34072. *
  34073. * numbers.then(_.spread(function(x, y) {
  34074. * return x + y;
  34075. * }));
  34076. * // => a Promise of 76
  34077. */
  34078. function spread(func, start) {
  34079. if (typeof func != 'function') {
  34080. throw new TypeError(FUNC_ERROR_TEXT);
  34081. }
  34082. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  34083. return baseRest(function(args) {
  34084. var array = args[start],
  34085. otherArgs = castSlice(args, 0, start);
  34086. if (array) {
  34087. arrayPush(otherArgs, array);
  34088. }
  34089. return apply(func, this, otherArgs);
  34090. });
  34091. }
  34092. /**
  34093. * Creates a throttled function that only invokes `func` at most once per
  34094. * every `wait` milliseconds. The throttled function comes with a `cancel`
  34095. * method to cancel delayed `func` invocations and a `flush` method to
  34096. * immediately invoke them. Provide `options` to indicate whether `func`
  34097. * should be invoked on the leading and/or trailing edge of the `wait`
  34098. * timeout. The `func` is invoked with the last arguments provided to the
  34099. * throttled function. Subsequent calls to the throttled function return the
  34100. * result of the last `func` invocation.
  34101. *
  34102. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  34103. * invoked on the trailing edge of the timeout only if the throttled function
  34104. * is invoked more than once during the `wait` timeout.
  34105. *
  34106. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  34107. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  34108. *
  34109. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  34110. * for details over the differences between `_.throttle` and `_.debounce`.
  34111. *
  34112. * @static
  34113. * @memberOf _
  34114. * @since 0.1.0
  34115. * @category Function
  34116. * @param {Function} func The function to throttle.
  34117. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  34118. * @param {Object} [options={}] The options object.
  34119. * @param {boolean} [options.leading=true]
  34120. * Specify invoking on the leading edge of the timeout.
  34121. * @param {boolean} [options.trailing=true]
  34122. * Specify invoking on the trailing edge of the timeout.
  34123. * @returns {Function} Returns the new throttled function.
  34124. * @example
  34125. *
  34126. * // Avoid excessively updating the position while scrolling.
  34127. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  34128. *
  34129. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  34130. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  34131. * jQuery(element).on('click', throttled);
  34132. *
  34133. * // Cancel the trailing throttled invocation.
  34134. * jQuery(window).on('popstate', throttled.cancel);
  34135. */
  34136. function throttle(func, wait, options) {
  34137. var leading = true,
  34138. trailing = true;
  34139. if (typeof func != 'function') {
  34140. throw new TypeError(FUNC_ERROR_TEXT);
  34141. }
  34142. if (isObject(options)) {
  34143. leading = 'leading' in options ? !!options.leading : leading;
  34144. trailing = 'trailing' in options ? !!options.trailing : trailing;
  34145. }
  34146. return debounce(func, wait, {
  34147. 'leading': leading,
  34148. 'maxWait': wait,
  34149. 'trailing': trailing
  34150. });
  34151. }
  34152. /**
  34153. * Creates a function that accepts up to one argument, ignoring any
  34154. * additional arguments.
  34155. *
  34156. * @static
  34157. * @memberOf _
  34158. * @since 4.0.0
  34159. * @category Function
  34160. * @param {Function} func The function to cap arguments for.
  34161. * @returns {Function} Returns the new capped function.
  34162. * @example
  34163. *
  34164. * _.map(['6', '8', '10'], _.unary(parseInt));
  34165. * // => [6, 8, 10]
  34166. */
  34167. function unary(func) {
  34168. return ary(func, 1);
  34169. }
  34170. /**
  34171. * Creates a function that provides `value` to `wrapper` as its first
  34172. * argument. Any additional arguments provided to the function are appended
  34173. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  34174. * binding of the created function.
  34175. *
  34176. * @static
  34177. * @memberOf _
  34178. * @since 0.1.0
  34179. * @category Function
  34180. * @param {*} value The value to wrap.
  34181. * @param {Function} [wrapper=identity] The wrapper function.
  34182. * @returns {Function} Returns the new function.
  34183. * @example
  34184. *
  34185. * var p = _.wrap(_.escape, function(func, text) {
  34186. * return '<p>' + func(text) + '</p>';
  34187. * });
  34188. *
  34189. * p('fred, barney, & pebbles');
  34190. * // => '<p>fred, barney, &amp; pebbles</p>'
  34191. */
  34192. function wrap(value, wrapper) {
  34193. return partial(castFunction(wrapper), value);
  34194. }
  34195. /*------------------------------------------------------------------------*/
  34196. /**
  34197. * Casts `value` as an array if it's not one.
  34198. *
  34199. * @static
  34200. * @memberOf _
  34201. * @since 4.4.0
  34202. * @category Lang
  34203. * @param {*} value The value to inspect.
  34204. * @returns {Array} Returns the cast array.
  34205. * @example
  34206. *
  34207. * _.castArray(1);
  34208. * // => [1]
  34209. *
  34210. * _.castArray({ 'a': 1 });
  34211. * // => [{ 'a': 1 }]
  34212. *
  34213. * _.castArray('abc');
  34214. * // => ['abc']
  34215. *
  34216. * _.castArray(null);
  34217. * // => [null]
  34218. *
  34219. * _.castArray(undefined);
  34220. * // => [undefined]
  34221. *
  34222. * _.castArray();
  34223. * // => []
  34224. *
  34225. * var array = [1, 2, 3];
  34226. * console.log(_.castArray(array) === array);
  34227. * // => true
  34228. */
  34229. function castArray() {
  34230. if (!arguments.length) {
  34231. return [];
  34232. }
  34233. var value = arguments[0];
  34234. return isArray(value) ? value : [value];
  34235. }
  34236. /**
  34237. * Creates a shallow clone of `value`.
  34238. *
  34239. * **Note:** This method is loosely based on the
  34240. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  34241. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  34242. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  34243. * arrays. The own enumerable properties of `arguments` objects are cloned
  34244. * as plain objects. An empty object is returned for uncloneable values such
  34245. * as error objects, functions, DOM nodes, and WeakMaps.
  34246. *
  34247. * @static
  34248. * @memberOf _
  34249. * @since 0.1.0
  34250. * @category Lang
  34251. * @param {*} value The value to clone.
  34252. * @returns {*} Returns the cloned value.
  34253. * @see _.cloneDeep
  34254. * @example
  34255. *
  34256. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  34257. *
  34258. * var shallow = _.clone(objects);
  34259. * console.log(shallow[0] === objects[0]);
  34260. * // => true
  34261. */
  34262. function clone(value) {
  34263. return baseClone(value, CLONE_SYMBOLS_FLAG);
  34264. }
  34265. /**
  34266. * This method is like `_.clone` except that it accepts `customizer` which
  34267. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  34268. * cloning is handled by the method instead. The `customizer` is invoked with
  34269. * up to four arguments; (value [, index|key, object, stack]).
  34270. *
  34271. * @static
  34272. * @memberOf _
  34273. * @since 4.0.0
  34274. * @category Lang
  34275. * @param {*} value The value to clone.
  34276. * @param {Function} [customizer] The function to customize cloning.
  34277. * @returns {*} Returns the cloned value.
  34278. * @see _.cloneDeepWith
  34279. * @example
  34280. *
  34281. * function customizer(value) {
  34282. * if (_.isElement(value)) {
  34283. * return value.cloneNode(false);
  34284. * }
  34285. * }
  34286. *
  34287. * var el = _.cloneWith(document.body, customizer);
  34288. *
  34289. * console.log(el === document.body);
  34290. * // => false
  34291. * console.log(el.nodeName);
  34292. * // => 'BODY'
  34293. * console.log(el.childNodes.length);
  34294. * // => 0
  34295. */
  34296. function cloneWith(value, customizer) {
  34297. customizer = typeof customizer == 'function' ? customizer : undefined;
  34298. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  34299. }
  34300. /**
  34301. * This method is like `_.clone` except that it recursively clones `value`.
  34302. *
  34303. * @static
  34304. * @memberOf _
  34305. * @since 1.0.0
  34306. * @category Lang
  34307. * @param {*} value The value to recursively clone.
  34308. * @returns {*} Returns the deep cloned value.
  34309. * @see _.clone
  34310. * @example
  34311. *
  34312. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  34313. *
  34314. * var deep = _.cloneDeep(objects);
  34315. * console.log(deep[0] === objects[0]);
  34316. * // => false
  34317. */
  34318. function cloneDeep(value) {
  34319. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  34320. }
  34321. /**
  34322. * This method is like `_.cloneWith` except that it recursively clones `value`.
  34323. *
  34324. * @static
  34325. * @memberOf _
  34326. * @since 4.0.0
  34327. * @category Lang
  34328. * @param {*} value The value to recursively clone.
  34329. * @param {Function} [customizer] The function to customize cloning.
  34330. * @returns {*} Returns the deep cloned value.
  34331. * @see _.cloneWith
  34332. * @example
  34333. *
  34334. * function customizer(value) {
  34335. * if (_.isElement(value)) {
  34336. * return value.cloneNode(true);
  34337. * }
  34338. * }
  34339. *
  34340. * var el = _.cloneDeepWith(document.body, customizer);
  34341. *
  34342. * console.log(el === document.body);
  34343. * // => false
  34344. * console.log(el.nodeName);
  34345. * // => 'BODY'
  34346. * console.log(el.childNodes.length);
  34347. * // => 20
  34348. */
  34349. function cloneDeepWith(value, customizer) {
  34350. customizer = typeof customizer == 'function' ? customizer : undefined;
  34351. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  34352. }
  34353. /**
  34354. * Checks if `object` conforms to `source` by invoking the predicate
  34355. * properties of `source` with the corresponding property values of `object`.
  34356. *
  34357. * **Note:** This method is equivalent to `_.conforms` when `source` is
  34358. * partially applied.
  34359. *
  34360. * @static
  34361. * @memberOf _
  34362. * @since 4.14.0
  34363. * @category Lang
  34364. * @param {Object} object The object to inspect.
  34365. * @param {Object} source The object of property predicates to conform to.
  34366. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  34367. * @example
  34368. *
  34369. * var object = { 'a': 1, 'b': 2 };
  34370. *
  34371. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  34372. * // => true
  34373. *
  34374. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  34375. * // => false
  34376. */
  34377. function conformsTo(object, source) {
  34378. return source == null || baseConformsTo(object, source, keys(source));
  34379. }
  34380. /**
  34381. * Performs a
  34382. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  34383. * comparison between two values to determine if they are equivalent.
  34384. *
  34385. * @static
  34386. * @memberOf _
  34387. * @since 4.0.0
  34388. * @category Lang
  34389. * @param {*} value The value to compare.
  34390. * @param {*} other The other value to compare.
  34391. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  34392. * @example
  34393. *
  34394. * var object = { 'a': 1 };
  34395. * var other = { 'a': 1 };
  34396. *
  34397. * _.eq(object, object);
  34398. * // => true
  34399. *
  34400. * _.eq(object, other);
  34401. * // => false
  34402. *
  34403. * _.eq('a', 'a');
  34404. * // => true
  34405. *
  34406. * _.eq('a', Object('a'));
  34407. * // => false
  34408. *
  34409. * _.eq(NaN, NaN);
  34410. * // => true
  34411. */
  34412. function eq(value, other) {
  34413. return value === other || (value !== value && other !== other);
  34414. }
  34415. /**
  34416. * Checks if `value` is greater than `other`.
  34417. *
  34418. * @static
  34419. * @memberOf _
  34420. * @since 3.9.0
  34421. * @category Lang
  34422. * @param {*} value The value to compare.
  34423. * @param {*} other The other value to compare.
  34424. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  34425. * else `false`.
  34426. * @see _.lt
  34427. * @example
  34428. *
  34429. * _.gt(3, 1);
  34430. * // => true
  34431. *
  34432. * _.gt(3, 3);
  34433. * // => false
  34434. *
  34435. * _.gt(1, 3);
  34436. * // => false
  34437. */
  34438. var gt = createRelationalOperation(baseGt);
  34439. /**
  34440. * Checks if `value` is greater than or equal to `other`.
  34441. *
  34442. * @static
  34443. * @memberOf _
  34444. * @since 3.9.0
  34445. * @category Lang
  34446. * @param {*} value The value to compare.
  34447. * @param {*} other The other value to compare.
  34448. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  34449. * `other`, else `false`.
  34450. * @see _.lte
  34451. * @example
  34452. *
  34453. * _.gte(3, 1);
  34454. * // => true
  34455. *
  34456. * _.gte(3, 3);
  34457. * // => true
  34458. *
  34459. * _.gte(1, 3);
  34460. * // => false
  34461. */
  34462. var gte = createRelationalOperation(function(value, other) {
  34463. return value >= other;
  34464. });
  34465. /**
  34466. * Checks if `value` is likely an `arguments` object.
  34467. *
  34468. * @static
  34469. * @memberOf _
  34470. * @since 0.1.0
  34471. * @category Lang
  34472. * @param {*} value The value to check.
  34473. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  34474. * else `false`.
  34475. * @example
  34476. *
  34477. * _.isArguments(function() { return arguments; }());
  34478. * // => true
  34479. *
  34480. * _.isArguments([1, 2, 3]);
  34481. * // => false
  34482. */
  34483. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  34484. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  34485. !propertyIsEnumerable.call(value, 'callee');
  34486. };
  34487. /**
  34488. * Checks if `value` is classified as an `Array` object.
  34489. *
  34490. * @static
  34491. * @memberOf _
  34492. * @since 0.1.0
  34493. * @category Lang
  34494. * @param {*} value The value to check.
  34495. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  34496. * @example
  34497. *
  34498. * _.isArray([1, 2, 3]);
  34499. * // => true
  34500. *
  34501. * _.isArray(document.body.children);
  34502. * // => false
  34503. *
  34504. * _.isArray('abc');
  34505. * // => false
  34506. *
  34507. * _.isArray(_.noop);
  34508. * // => false
  34509. */
  34510. var isArray = Array.isArray;
  34511. /**
  34512. * Checks if `value` is classified as an `ArrayBuffer` object.
  34513. *
  34514. * @static
  34515. * @memberOf _
  34516. * @since 4.3.0
  34517. * @category Lang
  34518. * @param {*} value The value to check.
  34519. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  34520. * @example
  34521. *
  34522. * _.isArrayBuffer(new ArrayBuffer(2));
  34523. * // => true
  34524. *
  34525. * _.isArrayBuffer(new Array(2));
  34526. * // => false
  34527. */
  34528. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  34529. /**
  34530. * Checks if `value` is array-like. A value is considered array-like if it's
  34531. * not a function and has a `value.length` that's an integer greater than or
  34532. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  34533. *
  34534. * @static
  34535. * @memberOf _
  34536. * @since 4.0.0
  34537. * @category Lang
  34538. * @param {*} value The value to check.
  34539. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  34540. * @example
  34541. *
  34542. * _.isArrayLike([1, 2, 3]);
  34543. * // => true
  34544. *
  34545. * _.isArrayLike(document.body.children);
  34546. * // => true
  34547. *
  34548. * _.isArrayLike('abc');
  34549. * // => true
  34550. *
  34551. * _.isArrayLike(_.noop);
  34552. * // => false
  34553. */
  34554. function isArrayLike(value) {
  34555. return value != null && isLength(value.length) && !isFunction(value);
  34556. }
  34557. /**
  34558. * This method is like `_.isArrayLike` except that it also checks if `value`
  34559. * is an object.
  34560. *
  34561. * @static
  34562. * @memberOf _
  34563. * @since 4.0.0
  34564. * @category Lang
  34565. * @param {*} value The value to check.
  34566. * @returns {boolean} Returns `true` if `value` is an array-like object,
  34567. * else `false`.
  34568. * @example
  34569. *
  34570. * _.isArrayLikeObject([1, 2, 3]);
  34571. * // => true
  34572. *
  34573. * _.isArrayLikeObject(document.body.children);
  34574. * // => true
  34575. *
  34576. * _.isArrayLikeObject('abc');
  34577. * // => false
  34578. *
  34579. * _.isArrayLikeObject(_.noop);
  34580. * // => false
  34581. */
  34582. function isArrayLikeObject(value) {
  34583. return isObjectLike(value) && isArrayLike(value);
  34584. }
  34585. /**
  34586. * Checks if `value` is classified as a boolean primitive or object.
  34587. *
  34588. * @static
  34589. * @memberOf _
  34590. * @since 0.1.0
  34591. * @category Lang
  34592. * @param {*} value The value to check.
  34593. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  34594. * @example
  34595. *
  34596. * _.isBoolean(false);
  34597. * // => true
  34598. *
  34599. * _.isBoolean(null);
  34600. * // => false
  34601. */
  34602. function isBoolean(value) {
  34603. return value === true || value === false ||
  34604. (isObjectLike(value) && baseGetTag(value) == boolTag);
  34605. }
  34606. /**
  34607. * Checks if `value` is a buffer.
  34608. *
  34609. * @static
  34610. * @memberOf _
  34611. * @since 4.3.0
  34612. * @category Lang
  34613. * @param {*} value The value to check.
  34614. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  34615. * @example
  34616. *
  34617. * _.isBuffer(new Buffer(2));
  34618. * // => true
  34619. *
  34620. * _.isBuffer(new Uint8Array(2));
  34621. * // => false
  34622. */
  34623. var isBuffer = nativeIsBuffer || stubFalse;
  34624. /**
  34625. * Checks if `value` is classified as a `Date` object.
  34626. *
  34627. * @static
  34628. * @memberOf _
  34629. * @since 0.1.0
  34630. * @category Lang
  34631. * @param {*} value The value to check.
  34632. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  34633. * @example
  34634. *
  34635. * _.isDate(new Date);
  34636. * // => true
  34637. *
  34638. * _.isDate('Mon April 23 2012');
  34639. * // => false
  34640. */
  34641. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  34642. /**
  34643. * Checks if `value` is likely a DOM element.
  34644. *
  34645. * @static
  34646. * @memberOf _
  34647. * @since 0.1.0
  34648. * @category Lang
  34649. * @param {*} value The value to check.
  34650. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  34651. * @example
  34652. *
  34653. * _.isElement(document.body);
  34654. * // => true
  34655. *
  34656. * _.isElement('<body>');
  34657. * // => false
  34658. */
  34659. function isElement(value) {
  34660. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  34661. }
  34662. /**
  34663. * Checks if `value` is an empty object, collection, map, or set.
  34664. *
  34665. * Objects are considered empty if they have no own enumerable string keyed
  34666. * properties.
  34667. *
  34668. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  34669. * jQuery-like collections are considered empty if they have a `length` of `0`.
  34670. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  34671. *
  34672. * @static
  34673. * @memberOf _
  34674. * @since 0.1.0
  34675. * @category Lang
  34676. * @param {*} value The value to check.
  34677. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  34678. * @example
  34679. *
  34680. * _.isEmpty(null);
  34681. * // => true
  34682. *
  34683. * _.isEmpty(true);
  34684. * // => true
  34685. *
  34686. * _.isEmpty(1);
  34687. * // => true
  34688. *
  34689. * _.isEmpty([1, 2, 3]);
  34690. * // => false
  34691. *
  34692. * _.isEmpty({ 'a': 1 });
  34693. * // => false
  34694. */
  34695. function isEmpty(value) {
  34696. if (value == null) {
  34697. return true;
  34698. }
  34699. if (isArrayLike(value) &&
  34700. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  34701. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  34702. return !value.length;
  34703. }
  34704. var tag = getTag(value);
  34705. if (tag == mapTag || tag == setTag) {
  34706. return !value.size;
  34707. }
  34708. if (isPrototype(value)) {
  34709. return !baseKeys(value).length;
  34710. }
  34711. for (var key in value) {
  34712. if (hasOwnProperty.call(value, key)) {
  34713. return false;
  34714. }
  34715. }
  34716. return true;
  34717. }
  34718. /**
  34719. * Performs a deep comparison between two values to determine if they are
  34720. * equivalent.
  34721. *
  34722. * **Note:** This method supports comparing arrays, array buffers, booleans,
  34723. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  34724. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  34725. * by their own, not inherited, enumerable properties. Functions and DOM
  34726. * nodes are compared by strict equality, i.e. `===`.
  34727. *
  34728. * @static
  34729. * @memberOf _
  34730. * @since 0.1.0
  34731. * @category Lang
  34732. * @param {*} value The value to compare.
  34733. * @param {*} other The other value to compare.
  34734. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  34735. * @example
  34736. *
  34737. * var object = { 'a': 1 };
  34738. * var other = { 'a': 1 };
  34739. *
  34740. * _.isEqual(object, other);
  34741. * // => true
  34742. *
  34743. * object === other;
  34744. * // => false
  34745. */
  34746. function isEqual(value, other) {
  34747. return baseIsEqual(value, other);
  34748. }
  34749. /**
  34750. * This method is like `_.isEqual` except that it accepts `customizer` which
  34751. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  34752. * are handled by the method instead. The `customizer` is invoked with up to
  34753. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  34754. *
  34755. * @static
  34756. * @memberOf _
  34757. * @since 4.0.0
  34758. * @category Lang
  34759. * @param {*} value The value to compare.
  34760. * @param {*} other The other value to compare.
  34761. * @param {Function} [customizer] The function to customize comparisons.
  34762. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  34763. * @example
  34764. *
  34765. * function isGreeting(value) {
  34766. * return /^h(?:i|ello)$/.test(value);
  34767. * }
  34768. *
  34769. * function customizer(objValue, othValue) {
  34770. * if (isGreeting(objValue) && isGreeting(othValue)) {
  34771. * return true;
  34772. * }
  34773. * }
  34774. *
  34775. * var array = ['hello', 'goodbye'];
  34776. * var other = ['hi', 'goodbye'];
  34777. *
  34778. * _.isEqualWith(array, other, customizer);
  34779. * // => true
  34780. */
  34781. function isEqualWith(value, other, customizer) {
  34782. customizer = typeof customizer == 'function' ? customizer : undefined;
  34783. var result = customizer ? customizer(value, other) : undefined;
  34784. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  34785. }
  34786. /**
  34787. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  34788. * `SyntaxError`, `TypeError`, or `URIError` object.
  34789. *
  34790. * @static
  34791. * @memberOf _
  34792. * @since 3.0.0
  34793. * @category Lang
  34794. * @param {*} value The value to check.
  34795. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  34796. * @example
  34797. *
  34798. * _.isError(new Error);
  34799. * // => true
  34800. *
  34801. * _.isError(Error);
  34802. * // => false
  34803. */
  34804. function isError(value) {
  34805. if (!isObjectLike(value)) {
  34806. return false;
  34807. }
  34808. var tag = baseGetTag(value);
  34809. return tag == errorTag || tag == domExcTag ||
  34810. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  34811. }
  34812. /**
  34813. * Checks if `value` is a finite primitive number.
  34814. *
  34815. * **Note:** This method is based on
  34816. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  34817. *
  34818. * @static
  34819. * @memberOf _
  34820. * @since 0.1.0
  34821. * @category Lang
  34822. * @param {*} value The value to check.
  34823. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  34824. * @example
  34825. *
  34826. * _.isFinite(3);
  34827. * // => true
  34828. *
  34829. * _.isFinite(Number.MIN_VALUE);
  34830. * // => true
  34831. *
  34832. * _.isFinite(Infinity);
  34833. * // => false
  34834. *
  34835. * _.isFinite('3');
  34836. * // => false
  34837. */
  34838. function isFinite(value) {
  34839. return typeof value == 'number' && nativeIsFinite(value);
  34840. }
  34841. /**
  34842. * Checks if `value` is classified as a `Function` object.
  34843. *
  34844. * @static
  34845. * @memberOf _
  34846. * @since 0.1.0
  34847. * @category Lang
  34848. * @param {*} value The value to check.
  34849. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  34850. * @example
  34851. *
  34852. * _.isFunction(_);
  34853. * // => true
  34854. *
  34855. * _.isFunction(/abc/);
  34856. * // => false
  34857. */
  34858. function isFunction(value) {
  34859. if (!isObject(value)) {
  34860. return false;
  34861. }
  34862. // The use of `Object#toString` avoids issues with the `typeof` operator
  34863. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  34864. var tag = baseGetTag(value);
  34865. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  34866. }
  34867. /**
  34868. * Checks if `value` is an integer.
  34869. *
  34870. * **Note:** This method is based on
  34871. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  34872. *
  34873. * @static
  34874. * @memberOf _
  34875. * @since 4.0.0
  34876. * @category Lang
  34877. * @param {*} value The value to check.
  34878. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  34879. * @example
  34880. *
  34881. * _.isInteger(3);
  34882. * // => true
  34883. *
  34884. * _.isInteger(Number.MIN_VALUE);
  34885. * // => false
  34886. *
  34887. * _.isInteger(Infinity);
  34888. * // => false
  34889. *
  34890. * _.isInteger('3');
  34891. * // => false
  34892. */
  34893. function isInteger(value) {
  34894. return typeof value == 'number' && value == toInteger(value);
  34895. }
  34896. /**
  34897. * Checks if `value` is a valid array-like length.
  34898. *
  34899. * **Note:** This method is loosely based on
  34900. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  34901. *
  34902. * @static
  34903. * @memberOf _
  34904. * @since 4.0.0
  34905. * @category Lang
  34906. * @param {*} value The value to check.
  34907. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  34908. * @example
  34909. *
  34910. * _.isLength(3);
  34911. * // => true
  34912. *
  34913. * _.isLength(Number.MIN_VALUE);
  34914. * // => false
  34915. *
  34916. * _.isLength(Infinity);
  34917. * // => false
  34918. *
  34919. * _.isLength('3');
  34920. * // => false
  34921. */
  34922. function isLength(value) {
  34923. return typeof value == 'number' &&
  34924. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  34925. }
  34926. /**
  34927. * Checks if `value` is the
  34928. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  34929. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  34930. *
  34931. * @static
  34932. * @memberOf _
  34933. * @since 0.1.0
  34934. * @category Lang
  34935. * @param {*} value The value to check.
  34936. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  34937. * @example
  34938. *
  34939. * _.isObject({});
  34940. * // => true
  34941. *
  34942. * _.isObject([1, 2, 3]);
  34943. * // => true
  34944. *
  34945. * _.isObject(_.noop);
  34946. * // => true
  34947. *
  34948. * _.isObject(null);
  34949. * // => false
  34950. */
  34951. function isObject(value) {
  34952. var type = typeof value;
  34953. return value != null && (type == 'object' || type == 'function');
  34954. }
  34955. /**
  34956. * Checks if `value` is object-like. A value is object-like if it's not `null`
  34957. * and has a `typeof` result of "object".
  34958. *
  34959. * @static
  34960. * @memberOf _
  34961. * @since 4.0.0
  34962. * @category Lang
  34963. * @param {*} value The value to check.
  34964. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  34965. * @example
  34966. *
  34967. * _.isObjectLike({});
  34968. * // => true
  34969. *
  34970. * _.isObjectLike([1, 2, 3]);
  34971. * // => true
  34972. *
  34973. * _.isObjectLike(_.noop);
  34974. * // => false
  34975. *
  34976. * _.isObjectLike(null);
  34977. * // => false
  34978. */
  34979. function isObjectLike(value) {
  34980. return value != null && typeof value == 'object';
  34981. }
  34982. /**
  34983. * Checks if `value` is classified as a `Map` object.
  34984. *
  34985. * @static
  34986. * @memberOf _
  34987. * @since 4.3.0
  34988. * @category Lang
  34989. * @param {*} value The value to check.
  34990. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  34991. * @example
  34992. *
  34993. * _.isMap(new Map);
  34994. * // => true
  34995. *
  34996. * _.isMap(new WeakMap);
  34997. * // => false
  34998. */
  34999. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  35000. /**
  35001. * Performs a partial deep comparison between `object` and `source` to
  35002. * determine if `object` contains equivalent property values.
  35003. *
  35004. * **Note:** This method is equivalent to `_.matches` when `source` is
  35005. * partially applied.
  35006. *
  35007. * Partial comparisons will match empty array and empty object `source`
  35008. * values against any array or object value, respectively. See `_.isEqual`
  35009. * for a list of supported value comparisons.
  35010. *
  35011. * @static
  35012. * @memberOf _
  35013. * @since 3.0.0
  35014. * @category Lang
  35015. * @param {Object} object The object to inspect.
  35016. * @param {Object} source The object of property values to match.
  35017. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  35018. * @example
  35019. *
  35020. * var object = { 'a': 1, 'b': 2 };
  35021. *
  35022. * _.isMatch(object, { 'b': 2 });
  35023. * // => true
  35024. *
  35025. * _.isMatch(object, { 'b': 1 });
  35026. * // => false
  35027. */
  35028. function isMatch(object, source) {
  35029. return object === source || baseIsMatch(object, source, getMatchData(source));
  35030. }
  35031. /**
  35032. * This method is like `_.isMatch` except that it accepts `customizer` which
  35033. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  35034. * are handled by the method instead. The `customizer` is invoked with five
  35035. * arguments: (objValue, srcValue, index|key, object, source).
  35036. *
  35037. * @static
  35038. * @memberOf _
  35039. * @since 4.0.0
  35040. * @category Lang
  35041. * @param {Object} object The object to inspect.
  35042. * @param {Object} source The object of property values to match.
  35043. * @param {Function} [customizer] The function to customize comparisons.
  35044. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  35045. * @example
  35046. *
  35047. * function isGreeting(value) {
  35048. * return /^h(?:i|ello)$/.test(value);
  35049. * }
  35050. *
  35051. * function customizer(objValue, srcValue) {
  35052. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  35053. * return true;
  35054. * }
  35055. * }
  35056. *
  35057. * var object = { 'greeting': 'hello' };
  35058. * var source = { 'greeting': 'hi' };
  35059. *
  35060. * _.isMatchWith(object, source, customizer);
  35061. * // => true
  35062. */
  35063. function isMatchWith(object, source, customizer) {
  35064. customizer = typeof customizer == 'function' ? customizer : undefined;
  35065. return baseIsMatch(object, source, getMatchData(source), customizer);
  35066. }
  35067. /**
  35068. * Checks if `value` is `NaN`.
  35069. *
  35070. * **Note:** This method is based on
  35071. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  35072. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  35073. * `undefined` and other non-number values.
  35074. *
  35075. * @static
  35076. * @memberOf _
  35077. * @since 0.1.0
  35078. * @category Lang
  35079. * @param {*} value The value to check.
  35080. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  35081. * @example
  35082. *
  35083. * _.isNaN(NaN);
  35084. * // => true
  35085. *
  35086. * _.isNaN(new Number(NaN));
  35087. * // => true
  35088. *
  35089. * isNaN(undefined);
  35090. * // => true
  35091. *
  35092. * _.isNaN(undefined);
  35093. * // => false
  35094. */
  35095. function isNaN(value) {
  35096. // An `NaN` primitive is the only value that is not equal to itself.
  35097. // Perform the `toStringTag` check first to avoid errors with some
  35098. // ActiveX objects in IE.
  35099. return isNumber(value) && value != +value;
  35100. }
  35101. /**
  35102. * Checks if `value` is a pristine native function.
  35103. *
  35104. * **Note:** This method can't reliably detect native functions in the presence
  35105. * of the core-js package because core-js circumvents this kind of detection.
  35106. * Despite multiple requests, the core-js maintainer has made it clear: any
  35107. * attempt to fix the detection will be obstructed. As a result, we're left
  35108. * with little choice but to throw an error. Unfortunately, this also affects
  35109. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  35110. * which rely on core-js.
  35111. *
  35112. * @static
  35113. * @memberOf _
  35114. * @since 3.0.0
  35115. * @category Lang
  35116. * @param {*} value The value to check.
  35117. * @returns {boolean} Returns `true` if `value` is a native function,
  35118. * else `false`.
  35119. * @example
  35120. *
  35121. * _.isNative(Array.prototype.push);
  35122. * // => true
  35123. *
  35124. * _.isNative(_);
  35125. * // => false
  35126. */
  35127. function isNative(value) {
  35128. if (isMaskable(value)) {
  35129. throw new Error(CORE_ERROR_TEXT);
  35130. }
  35131. return baseIsNative(value);
  35132. }
  35133. /**
  35134. * Checks if `value` is `null`.
  35135. *
  35136. * @static
  35137. * @memberOf _
  35138. * @since 0.1.0
  35139. * @category Lang
  35140. * @param {*} value The value to check.
  35141. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  35142. * @example
  35143. *
  35144. * _.isNull(null);
  35145. * // => true
  35146. *
  35147. * _.isNull(void 0);
  35148. * // => false
  35149. */
  35150. function isNull(value) {
  35151. return value === null;
  35152. }
  35153. /**
  35154. * Checks if `value` is `null` or `undefined`.
  35155. *
  35156. * @static
  35157. * @memberOf _
  35158. * @since 4.0.0
  35159. * @category Lang
  35160. * @param {*} value The value to check.
  35161. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  35162. * @example
  35163. *
  35164. * _.isNil(null);
  35165. * // => true
  35166. *
  35167. * _.isNil(void 0);
  35168. * // => true
  35169. *
  35170. * _.isNil(NaN);
  35171. * // => false
  35172. */
  35173. function isNil(value) {
  35174. return value == null;
  35175. }
  35176. /**
  35177. * Checks if `value` is classified as a `Number` primitive or object.
  35178. *
  35179. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  35180. * classified as numbers, use the `_.isFinite` method.
  35181. *
  35182. * @static
  35183. * @memberOf _
  35184. * @since 0.1.0
  35185. * @category Lang
  35186. * @param {*} value The value to check.
  35187. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  35188. * @example
  35189. *
  35190. * _.isNumber(3);
  35191. * // => true
  35192. *
  35193. * _.isNumber(Number.MIN_VALUE);
  35194. * // => true
  35195. *
  35196. * _.isNumber(Infinity);
  35197. * // => true
  35198. *
  35199. * _.isNumber('3');
  35200. * // => false
  35201. */
  35202. function isNumber(value) {
  35203. return typeof value == 'number' ||
  35204. (isObjectLike(value) && baseGetTag(value) == numberTag);
  35205. }
  35206. /**
  35207. * Checks if `value` is a plain object, that is, an object created by the
  35208. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  35209. *
  35210. * @static
  35211. * @memberOf _
  35212. * @since 0.8.0
  35213. * @category Lang
  35214. * @param {*} value The value to check.
  35215. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  35216. * @example
  35217. *
  35218. * function Foo() {
  35219. * this.a = 1;
  35220. * }
  35221. *
  35222. * _.isPlainObject(new Foo);
  35223. * // => false
  35224. *
  35225. * _.isPlainObject([1, 2, 3]);
  35226. * // => false
  35227. *
  35228. * _.isPlainObject({ 'x': 0, 'y': 0 });
  35229. * // => true
  35230. *
  35231. * _.isPlainObject(Object.create(null));
  35232. * // => true
  35233. */
  35234. function isPlainObject(value) {
  35235. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  35236. return false;
  35237. }
  35238. var proto = getPrototype(value);
  35239. if (proto === null) {
  35240. return true;
  35241. }
  35242. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  35243. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  35244. funcToString.call(Ctor) == objectCtorString;
  35245. }
  35246. /**
  35247. * Checks if `value` is classified as a `RegExp` object.
  35248. *
  35249. * @static
  35250. * @memberOf _
  35251. * @since 0.1.0
  35252. * @category Lang
  35253. * @param {*} value The value to check.
  35254. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  35255. * @example
  35256. *
  35257. * _.isRegExp(/abc/);
  35258. * // => true
  35259. *
  35260. * _.isRegExp('/abc/');
  35261. * // => false
  35262. */
  35263. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  35264. /**
  35265. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  35266. * double precision number which isn't the result of a rounded unsafe integer.
  35267. *
  35268. * **Note:** This method is based on
  35269. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  35270. *
  35271. * @static
  35272. * @memberOf _
  35273. * @since 4.0.0
  35274. * @category Lang
  35275. * @param {*} value The value to check.
  35276. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  35277. * @example
  35278. *
  35279. * _.isSafeInteger(3);
  35280. * // => true
  35281. *
  35282. * _.isSafeInteger(Number.MIN_VALUE);
  35283. * // => false
  35284. *
  35285. * _.isSafeInteger(Infinity);
  35286. * // => false
  35287. *
  35288. * _.isSafeInteger('3');
  35289. * // => false
  35290. */
  35291. function isSafeInteger(value) {
  35292. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  35293. }
  35294. /**
  35295. * Checks if `value` is classified as a `Set` object.
  35296. *
  35297. * @static
  35298. * @memberOf _
  35299. * @since 4.3.0
  35300. * @category Lang
  35301. * @param {*} value The value to check.
  35302. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  35303. * @example
  35304. *
  35305. * _.isSet(new Set);
  35306. * // => true
  35307. *
  35308. * _.isSet(new WeakSet);
  35309. * // => false
  35310. */
  35311. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  35312. /**
  35313. * Checks if `value` is classified as a `String` primitive or object.
  35314. *
  35315. * @static
  35316. * @since 0.1.0
  35317. * @memberOf _
  35318. * @category Lang
  35319. * @param {*} value The value to check.
  35320. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  35321. * @example
  35322. *
  35323. * _.isString('abc');
  35324. * // => true
  35325. *
  35326. * _.isString(1);
  35327. * // => false
  35328. */
  35329. function isString(value) {
  35330. return typeof value == 'string' ||
  35331. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  35332. }
  35333. /**
  35334. * Checks if `value` is classified as a `Symbol` primitive or object.
  35335. *
  35336. * @static
  35337. * @memberOf _
  35338. * @since 4.0.0
  35339. * @category Lang
  35340. * @param {*} value The value to check.
  35341. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  35342. * @example
  35343. *
  35344. * _.isSymbol(Symbol.iterator);
  35345. * // => true
  35346. *
  35347. * _.isSymbol('abc');
  35348. * // => false
  35349. */
  35350. function isSymbol(value) {
  35351. return typeof value == 'symbol' ||
  35352. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  35353. }
  35354. /**
  35355. * Checks if `value` is classified as a typed array.
  35356. *
  35357. * @static
  35358. * @memberOf _
  35359. * @since 3.0.0
  35360. * @category Lang
  35361. * @param {*} value The value to check.
  35362. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  35363. * @example
  35364. *
  35365. * _.isTypedArray(new Uint8Array);
  35366. * // => true
  35367. *
  35368. * _.isTypedArray([]);
  35369. * // => false
  35370. */
  35371. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  35372. /**
  35373. * Checks if `value` is `undefined`.
  35374. *
  35375. * @static
  35376. * @since 0.1.0
  35377. * @memberOf _
  35378. * @category Lang
  35379. * @param {*} value The value to check.
  35380. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  35381. * @example
  35382. *
  35383. * _.isUndefined(void 0);
  35384. * // => true
  35385. *
  35386. * _.isUndefined(null);
  35387. * // => false
  35388. */
  35389. function isUndefined(value) {
  35390. return value === undefined;
  35391. }
  35392. /**
  35393. * Checks if `value` is classified as a `WeakMap` object.
  35394. *
  35395. * @static
  35396. * @memberOf _
  35397. * @since 4.3.0
  35398. * @category Lang
  35399. * @param {*} value The value to check.
  35400. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  35401. * @example
  35402. *
  35403. * _.isWeakMap(new WeakMap);
  35404. * // => true
  35405. *
  35406. * _.isWeakMap(new Map);
  35407. * // => false
  35408. */
  35409. function isWeakMap(value) {
  35410. return isObjectLike(value) && getTag(value) == weakMapTag;
  35411. }
  35412. /**
  35413. * Checks if `value` is classified as a `WeakSet` object.
  35414. *
  35415. * @static
  35416. * @memberOf _
  35417. * @since 4.3.0
  35418. * @category Lang
  35419. * @param {*} value The value to check.
  35420. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  35421. * @example
  35422. *
  35423. * _.isWeakSet(new WeakSet);
  35424. * // => true
  35425. *
  35426. * _.isWeakSet(new Set);
  35427. * // => false
  35428. */
  35429. function isWeakSet(value) {
  35430. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  35431. }
  35432. /**
  35433. * Checks if `value` is less than `other`.
  35434. *
  35435. * @static
  35436. * @memberOf _
  35437. * @since 3.9.0
  35438. * @category Lang
  35439. * @param {*} value The value to compare.
  35440. * @param {*} other The other value to compare.
  35441. * @returns {boolean} Returns `true` if `value` is less than `other`,
  35442. * else `false`.
  35443. * @see _.gt
  35444. * @example
  35445. *
  35446. * _.lt(1, 3);
  35447. * // => true
  35448. *
  35449. * _.lt(3, 3);
  35450. * // => false
  35451. *
  35452. * _.lt(3, 1);
  35453. * // => false
  35454. */
  35455. var lt = createRelationalOperation(baseLt);
  35456. /**
  35457. * Checks if `value` is less than or equal to `other`.
  35458. *
  35459. * @static
  35460. * @memberOf _
  35461. * @since 3.9.0
  35462. * @category Lang
  35463. * @param {*} value The value to compare.
  35464. * @param {*} other The other value to compare.
  35465. * @returns {boolean} Returns `true` if `value` is less than or equal to
  35466. * `other`, else `false`.
  35467. * @see _.gte
  35468. * @example
  35469. *
  35470. * _.lte(1, 3);
  35471. * // => true
  35472. *
  35473. * _.lte(3, 3);
  35474. * // => true
  35475. *
  35476. * _.lte(3, 1);
  35477. * // => false
  35478. */
  35479. var lte = createRelationalOperation(function(value, other) {
  35480. return value <= other;
  35481. });
  35482. /**
  35483. * Converts `value` to an array.
  35484. *
  35485. * @static
  35486. * @since 0.1.0
  35487. * @memberOf _
  35488. * @category Lang
  35489. * @param {*} value The value to convert.
  35490. * @returns {Array} Returns the converted array.
  35491. * @example
  35492. *
  35493. * _.toArray({ 'a': 1, 'b': 2 });
  35494. * // => [1, 2]
  35495. *
  35496. * _.toArray('abc');
  35497. * // => ['a', 'b', 'c']
  35498. *
  35499. * _.toArray(1);
  35500. * // => []
  35501. *
  35502. * _.toArray(null);
  35503. * // => []
  35504. */
  35505. function toArray(value) {
  35506. if (!value) {
  35507. return [];
  35508. }
  35509. if (isArrayLike(value)) {
  35510. return isString(value) ? stringToArray(value) : copyArray(value);
  35511. }
  35512. if (symIterator && value[symIterator]) {
  35513. return iteratorToArray(value[symIterator]());
  35514. }
  35515. var tag = getTag(value),
  35516. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  35517. return func(value);
  35518. }
  35519. /**
  35520. * Converts `value` to a finite number.
  35521. *
  35522. * @static
  35523. * @memberOf _
  35524. * @since 4.12.0
  35525. * @category Lang
  35526. * @param {*} value The value to convert.
  35527. * @returns {number} Returns the converted number.
  35528. * @example
  35529. *
  35530. * _.toFinite(3.2);
  35531. * // => 3.2
  35532. *
  35533. * _.toFinite(Number.MIN_VALUE);
  35534. * // => 5e-324
  35535. *
  35536. * _.toFinite(Infinity);
  35537. * // => 1.7976931348623157e+308
  35538. *
  35539. * _.toFinite('3.2');
  35540. * // => 3.2
  35541. */
  35542. function toFinite(value) {
  35543. if (!value) {
  35544. return value === 0 ? value : 0;
  35545. }
  35546. value = toNumber(value);
  35547. if (value === INFINITY || value === -INFINITY) {
  35548. var sign = (value < 0 ? -1 : 1);
  35549. return sign * MAX_INTEGER;
  35550. }
  35551. return value === value ? value : 0;
  35552. }
  35553. /**
  35554. * Converts `value` to an integer.
  35555. *
  35556. * **Note:** This method is loosely based on
  35557. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  35558. *
  35559. * @static
  35560. * @memberOf _
  35561. * @since 4.0.0
  35562. * @category Lang
  35563. * @param {*} value The value to convert.
  35564. * @returns {number} Returns the converted integer.
  35565. * @example
  35566. *
  35567. * _.toInteger(3.2);
  35568. * // => 3
  35569. *
  35570. * _.toInteger(Number.MIN_VALUE);
  35571. * // => 0
  35572. *
  35573. * _.toInteger(Infinity);
  35574. * // => 1.7976931348623157e+308
  35575. *
  35576. * _.toInteger('3.2');
  35577. * // => 3
  35578. */
  35579. function toInteger(value) {
  35580. var result = toFinite(value),
  35581. remainder = result % 1;
  35582. return result === result ? (remainder ? result - remainder : result) : 0;
  35583. }
  35584. /**
  35585. * Converts `value` to an integer suitable for use as the length of an
  35586. * array-like object.
  35587. *
  35588. * **Note:** This method is based on
  35589. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  35590. *
  35591. * @static
  35592. * @memberOf _
  35593. * @since 4.0.0
  35594. * @category Lang
  35595. * @param {*} value The value to convert.
  35596. * @returns {number} Returns the converted integer.
  35597. * @example
  35598. *
  35599. * _.toLength(3.2);
  35600. * // => 3
  35601. *
  35602. * _.toLength(Number.MIN_VALUE);
  35603. * // => 0
  35604. *
  35605. * _.toLength(Infinity);
  35606. * // => 4294967295
  35607. *
  35608. * _.toLength('3.2');
  35609. * // => 3
  35610. */
  35611. function toLength(value) {
  35612. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  35613. }
  35614. /**
  35615. * Converts `value` to a number.
  35616. *
  35617. * @static
  35618. * @memberOf _
  35619. * @since 4.0.0
  35620. * @category Lang
  35621. * @param {*} value The value to process.
  35622. * @returns {number} Returns the number.
  35623. * @example
  35624. *
  35625. * _.toNumber(3.2);
  35626. * // => 3.2
  35627. *
  35628. * _.toNumber(Number.MIN_VALUE);
  35629. * // => 5e-324
  35630. *
  35631. * _.toNumber(Infinity);
  35632. * // => Infinity
  35633. *
  35634. * _.toNumber('3.2');
  35635. * // => 3.2
  35636. */
  35637. function toNumber(value) {
  35638. if (typeof value == 'number') {
  35639. return value;
  35640. }
  35641. if (isSymbol(value)) {
  35642. return NAN;
  35643. }
  35644. if (isObject(value)) {
  35645. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  35646. value = isObject(other) ? (other + '') : other;
  35647. }
  35648. if (typeof value != 'string') {
  35649. return value === 0 ? value : +value;
  35650. }
  35651. value = value.replace(reTrim, '');
  35652. var isBinary = reIsBinary.test(value);
  35653. return (isBinary || reIsOctal.test(value))
  35654. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  35655. : (reIsBadHex.test(value) ? NAN : +value);
  35656. }
  35657. /**
  35658. * Converts `value` to a plain object flattening inherited enumerable string
  35659. * keyed properties of `value` to own properties of the plain object.
  35660. *
  35661. * @static
  35662. * @memberOf _
  35663. * @since 3.0.0
  35664. * @category Lang
  35665. * @param {*} value The value to convert.
  35666. * @returns {Object} Returns the converted plain object.
  35667. * @example
  35668. *
  35669. * function Foo() {
  35670. * this.b = 2;
  35671. * }
  35672. *
  35673. * Foo.prototype.c = 3;
  35674. *
  35675. * _.assign({ 'a': 1 }, new Foo);
  35676. * // => { 'a': 1, 'b': 2 }
  35677. *
  35678. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  35679. * // => { 'a': 1, 'b': 2, 'c': 3 }
  35680. */
  35681. function toPlainObject(value) {
  35682. return copyObject(value, keysIn(value));
  35683. }
  35684. /**
  35685. * Converts `value` to a safe integer. A safe integer can be compared and
  35686. * represented correctly.
  35687. *
  35688. * @static
  35689. * @memberOf _
  35690. * @since 4.0.0
  35691. * @category Lang
  35692. * @param {*} value The value to convert.
  35693. * @returns {number} Returns the converted integer.
  35694. * @example
  35695. *
  35696. * _.toSafeInteger(3.2);
  35697. * // => 3
  35698. *
  35699. * _.toSafeInteger(Number.MIN_VALUE);
  35700. * // => 0
  35701. *
  35702. * _.toSafeInteger(Infinity);
  35703. * // => 9007199254740991
  35704. *
  35705. * _.toSafeInteger('3.2');
  35706. * // => 3
  35707. */
  35708. function toSafeInteger(value) {
  35709. return value
  35710. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  35711. : (value === 0 ? value : 0);
  35712. }
  35713. /**
  35714. * Converts `value` to a string. An empty string is returned for `null`
  35715. * and `undefined` values. The sign of `-0` is preserved.
  35716. *
  35717. * @static
  35718. * @memberOf _
  35719. * @since 4.0.0
  35720. * @category Lang
  35721. * @param {*} value The value to convert.
  35722. * @returns {string} Returns the converted string.
  35723. * @example
  35724. *
  35725. * _.toString(null);
  35726. * // => ''
  35727. *
  35728. * _.toString(-0);
  35729. * // => '-0'
  35730. *
  35731. * _.toString([1, 2, 3]);
  35732. * // => '1,2,3'
  35733. */
  35734. function toString(value) {
  35735. return value == null ? '' : baseToString(value);
  35736. }
  35737. /*------------------------------------------------------------------------*/
  35738. /**
  35739. * Assigns own enumerable string keyed properties of source objects to the
  35740. * destination object. Source objects are applied from left to right.
  35741. * Subsequent sources overwrite property assignments of previous sources.
  35742. *
  35743. * **Note:** This method mutates `object` and is loosely based on
  35744. * [`Object.assign`](https://mdn.io/Object/assign).
  35745. *
  35746. * @static
  35747. * @memberOf _
  35748. * @since 0.10.0
  35749. * @category Object
  35750. * @param {Object} object The destination object.
  35751. * @param {...Object} [sources] The source objects.
  35752. * @returns {Object} Returns `object`.
  35753. * @see _.assignIn
  35754. * @example
  35755. *
  35756. * function Foo() {
  35757. * this.a = 1;
  35758. * }
  35759. *
  35760. * function Bar() {
  35761. * this.c = 3;
  35762. * }
  35763. *
  35764. * Foo.prototype.b = 2;
  35765. * Bar.prototype.d = 4;
  35766. *
  35767. * _.assign({ 'a': 0 }, new Foo, new Bar);
  35768. * // => { 'a': 1, 'c': 3 }
  35769. */
  35770. var assign = createAssigner(function(object, source) {
  35771. if (isPrototype(source) || isArrayLike(source)) {
  35772. copyObject(source, keys(source), object);
  35773. return;
  35774. }
  35775. for (var key in source) {
  35776. if (hasOwnProperty.call(source, key)) {
  35777. assignValue(object, key, source[key]);
  35778. }
  35779. }
  35780. });
  35781. /**
  35782. * This method is like `_.assign` except that it iterates over own and
  35783. * inherited source properties.
  35784. *
  35785. * **Note:** This method mutates `object`.
  35786. *
  35787. * @static
  35788. * @memberOf _
  35789. * @since 4.0.0
  35790. * @alias extend
  35791. * @category Object
  35792. * @param {Object} object The destination object.
  35793. * @param {...Object} [sources] The source objects.
  35794. * @returns {Object} Returns `object`.
  35795. * @see _.assign
  35796. * @example
  35797. *
  35798. * function Foo() {
  35799. * this.a = 1;
  35800. * }
  35801. *
  35802. * function Bar() {
  35803. * this.c = 3;
  35804. * }
  35805. *
  35806. * Foo.prototype.b = 2;
  35807. * Bar.prototype.d = 4;
  35808. *
  35809. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  35810. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  35811. */
  35812. var assignIn = createAssigner(function(object, source) {
  35813. copyObject(source, keysIn(source), object);
  35814. });
  35815. /**
  35816. * This method is like `_.assignIn` except that it accepts `customizer`
  35817. * which is invoked to produce the assigned values. If `customizer` returns
  35818. * `undefined`, assignment is handled by the method instead. The `customizer`
  35819. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  35820. *
  35821. * **Note:** This method mutates `object`.
  35822. *
  35823. * @static
  35824. * @memberOf _
  35825. * @since 4.0.0
  35826. * @alias extendWith
  35827. * @category Object
  35828. * @param {Object} object The destination object.
  35829. * @param {...Object} sources The source objects.
  35830. * @param {Function} [customizer] The function to customize assigned values.
  35831. * @returns {Object} Returns `object`.
  35832. * @see _.assignWith
  35833. * @example
  35834. *
  35835. * function customizer(objValue, srcValue) {
  35836. * return _.isUndefined(objValue) ? srcValue : objValue;
  35837. * }
  35838. *
  35839. * var defaults = _.partialRight(_.assignInWith, customizer);
  35840. *
  35841. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  35842. * // => { 'a': 1, 'b': 2 }
  35843. */
  35844. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  35845. copyObject(source, keysIn(source), object, customizer);
  35846. });
  35847. /**
  35848. * This method is like `_.assign` except that it accepts `customizer`
  35849. * which is invoked to produce the assigned values. If `customizer` returns
  35850. * `undefined`, assignment is handled by the method instead. The `customizer`
  35851. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  35852. *
  35853. * **Note:** This method mutates `object`.
  35854. *
  35855. * @static
  35856. * @memberOf _
  35857. * @since 4.0.0
  35858. * @category Object
  35859. * @param {Object} object The destination object.
  35860. * @param {...Object} sources The source objects.
  35861. * @param {Function} [customizer] The function to customize assigned values.
  35862. * @returns {Object} Returns `object`.
  35863. * @see _.assignInWith
  35864. * @example
  35865. *
  35866. * function customizer(objValue, srcValue) {
  35867. * return _.isUndefined(objValue) ? srcValue : objValue;
  35868. * }
  35869. *
  35870. * var defaults = _.partialRight(_.assignWith, customizer);
  35871. *
  35872. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  35873. * // => { 'a': 1, 'b': 2 }
  35874. */
  35875. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  35876. copyObject(source, keys(source), object, customizer);
  35877. });
  35878. /**
  35879. * Creates an array of values corresponding to `paths` of `object`.
  35880. *
  35881. * @static
  35882. * @memberOf _
  35883. * @since 1.0.0
  35884. * @category Object
  35885. * @param {Object} object The object to iterate over.
  35886. * @param {...(string|string[])} [paths] The property paths to pick.
  35887. * @returns {Array} Returns the picked values.
  35888. * @example
  35889. *
  35890. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  35891. *
  35892. * _.at(object, ['a[0].b.c', 'a[1]']);
  35893. * // => [3, 4]
  35894. */
  35895. var at = flatRest(baseAt);
  35896. /**
  35897. * Creates an object that inherits from the `prototype` object. If a
  35898. * `properties` object is given, its own enumerable string keyed properties
  35899. * are assigned to the created object.
  35900. *
  35901. * @static
  35902. * @memberOf _
  35903. * @since 2.3.0
  35904. * @category Object
  35905. * @param {Object} prototype The object to inherit from.
  35906. * @param {Object} [properties] The properties to assign to the object.
  35907. * @returns {Object} Returns the new object.
  35908. * @example
  35909. *
  35910. * function Shape() {
  35911. * this.x = 0;
  35912. * this.y = 0;
  35913. * }
  35914. *
  35915. * function Circle() {
  35916. * Shape.call(this);
  35917. * }
  35918. *
  35919. * Circle.prototype = _.create(Shape.prototype, {
  35920. * 'constructor': Circle
  35921. * });
  35922. *
  35923. * var circle = new Circle;
  35924. * circle instanceof Circle;
  35925. * // => true
  35926. *
  35927. * circle instanceof Shape;
  35928. * // => true
  35929. */
  35930. function create(prototype, properties) {
  35931. var result = baseCreate(prototype);
  35932. return properties == null ? result : baseAssign(result, properties);
  35933. }
  35934. /**
  35935. * Assigns own and inherited enumerable string keyed properties of source
  35936. * objects to the destination object for all destination properties that
  35937. * resolve to `undefined`. Source objects are applied from left to right.
  35938. * Once a property is set, additional values of the same property are ignored.
  35939. *
  35940. * **Note:** This method mutates `object`.
  35941. *
  35942. * @static
  35943. * @since 0.1.0
  35944. * @memberOf _
  35945. * @category Object
  35946. * @param {Object} object The destination object.
  35947. * @param {...Object} [sources] The source objects.
  35948. * @returns {Object} Returns `object`.
  35949. * @see _.defaultsDeep
  35950. * @example
  35951. *
  35952. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  35953. * // => { 'a': 1, 'b': 2 }
  35954. */
  35955. var defaults = baseRest(function(object, sources) {
  35956. object = Object(object);
  35957. var index = -1;
  35958. var length = sources.length;
  35959. var guard = length > 2 ? sources[2] : undefined;
  35960. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  35961. length = 1;
  35962. }
  35963. while (++index < length) {
  35964. var source = sources[index];
  35965. var props = keysIn(source);
  35966. var propsIndex = -1;
  35967. var propsLength = props.length;
  35968. while (++propsIndex < propsLength) {
  35969. var key = props[propsIndex];
  35970. var value = object[key];
  35971. if (value === undefined ||
  35972. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  35973. object[key] = source[key];
  35974. }
  35975. }
  35976. }
  35977. return object;
  35978. });
  35979. /**
  35980. * This method is like `_.defaults` except that it recursively assigns
  35981. * default properties.
  35982. *
  35983. * **Note:** This method mutates `object`.
  35984. *
  35985. * @static
  35986. * @memberOf _
  35987. * @since 3.10.0
  35988. * @category Object
  35989. * @param {Object} object The destination object.
  35990. * @param {...Object} [sources] The source objects.
  35991. * @returns {Object} Returns `object`.
  35992. * @see _.defaults
  35993. * @example
  35994. *
  35995. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  35996. * // => { 'a': { 'b': 2, 'c': 3 } }
  35997. */
  35998. var defaultsDeep = baseRest(function(args) {
  35999. args.push(undefined, customDefaultsMerge);
  36000. return apply(mergeWith, undefined, args);
  36001. });
  36002. /**
  36003. * This method is like `_.find` except that it returns the key of the first
  36004. * element `predicate` returns truthy for instead of the element itself.
  36005. *
  36006. * @static
  36007. * @memberOf _
  36008. * @since 1.1.0
  36009. * @category Object
  36010. * @param {Object} object The object to inspect.
  36011. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  36012. * @returns {string|undefined} Returns the key of the matched element,
  36013. * else `undefined`.
  36014. * @example
  36015. *
  36016. * var users = {
  36017. * 'barney': { 'age': 36, 'active': true },
  36018. * 'fred': { 'age': 40, 'active': false },
  36019. * 'pebbles': { 'age': 1, 'active': true }
  36020. * };
  36021. *
  36022. * _.findKey(users, function(o) { return o.age < 40; });
  36023. * // => 'barney' (iteration order is not guaranteed)
  36024. *
  36025. * // The `_.matches` iteratee shorthand.
  36026. * _.findKey(users, { 'age': 1, 'active': true });
  36027. * // => 'pebbles'
  36028. *
  36029. * // The `_.matchesProperty` iteratee shorthand.
  36030. * _.findKey(users, ['active', false]);
  36031. * // => 'fred'
  36032. *
  36033. * // The `_.property` iteratee shorthand.
  36034. * _.findKey(users, 'active');
  36035. * // => 'barney'
  36036. */
  36037. function findKey(object, predicate) {
  36038. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  36039. }
  36040. /**
  36041. * This method is like `_.findKey` except that it iterates over elements of
  36042. * a collection in the opposite order.
  36043. *
  36044. * @static
  36045. * @memberOf _
  36046. * @since 2.0.0
  36047. * @category Object
  36048. * @param {Object} object The object to inspect.
  36049. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  36050. * @returns {string|undefined} Returns the key of the matched element,
  36051. * else `undefined`.
  36052. * @example
  36053. *
  36054. * var users = {
  36055. * 'barney': { 'age': 36, 'active': true },
  36056. * 'fred': { 'age': 40, 'active': false },
  36057. * 'pebbles': { 'age': 1, 'active': true }
  36058. * };
  36059. *
  36060. * _.findLastKey(users, function(o) { return o.age < 40; });
  36061. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  36062. *
  36063. * // The `_.matches` iteratee shorthand.
  36064. * _.findLastKey(users, { 'age': 36, 'active': true });
  36065. * // => 'barney'
  36066. *
  36067. * // The `_.matchesProperty` iteratee shorthand.
  36068. * _.findLastKey(users, ['active', false]);
  36069. * // => 'fred'
  36070. *
  36071. * // The `_.property` iteratee shorthand.
  36072. * _.findLastKey(users, 'active');
  36073. * // => 'pebbles'
  36074. */
  36075. function findLastKey(object, predicate) {
  36076. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  36077. }
  36078. /**
  36079. * Iterates over own and inherited enumerable string keyed properties of an
  36080. * object and invokes `iteratee` for each property. The iteratee is invoked
  36081. * with three arguments: (value, key, object). Iteratee functions may exit
  36082. * iteration early by explicitly returning `false`.
  36083. *
  36084. * @static
  36085. * @memberOf _
  36086. * @since 0.3.0
  36087. * @category Object
  36088. * @param {Object} object The object to iterate over.
  36089. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  36090. * @returns {Object} Returns `object`.
  36091. * @see _.forInRight
  36092. * @example
  36093. *
  36094. * function Foo() {
  36095. * this.a = 1;
  36096. * this.b = 2;
  36097. * }
  36098. *
  36099. * Foo.prototype.c = 3;
  36100. *
  36101. * _.forIn(new Foo, function(value, key) {
  36102. * console.log(key);
  36103. * });
  36104. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  36105. */
  36106. function forIn(object, iteratee) {
  36107. return object == null
  36108. ? object
  36109. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  36110. }
  36111. /**
  36112. * This method is like `_.forIn` except that it iterates over properties of
  36113. * `object` in the opposite order.
  36114. *
  36115. * @static
  36116. * @memberOf _
  36117. * @since 2.0.0
  36118. * @category Object
  36119. * @param {Object} object The object to iterate over.
  36120. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  36121. * @returns {Object} Returns `object`.
  36122. * @see _.forIn
  36123. * @example
  36124. *
  36125. * function Foo() {
  36126. * this.a = 1;
  36127. * this.b = 2;
  36128. * }
  36129. *
  36130. * Foo.prototype.c = 3;
  36131. *
  36132. * _.forInRight(new Foo, function(value, key) {
  36133. * console.log(key);
  36134. * });
  36135. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  36136. */
  36137. function forInRight(object, iteratee) {
  36138. return object == null
  36139. ? object
  36140. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  36141. }
  36142. /**
  36143. * Iterates over own enumerable string keyed properties of an object and
  36144. * invokes `iteratee` for each property. The iteratee is invoked with three
  36145. * arguments: (value, key, object). Iteratee functions may exit iteration
  36146. * early by explicitly returning `false`.
  36147. *
  36148. * @static
  36149. * @memberOf _
  36150. * @since 0.3.0
  36151. * @category Object
  36152. * @param {Object} object The object to iterate over.
  36153. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  36154. * @returns {Object} Returns `object`.
  36155. * @see _.forOwnRight
  36156. * @example
  36157. *
  36158. * function Foo() {
  36159. * this.a = 1;
  36160. * this.b = 2;
  36161. * }
  36162. *
  36163. * Foo.prototype.c = 3;
  36164. *
  36165. * _.forOwn(new Foo, function(value, key) {
  36166. * console.log(key);
  36167. * });
  36168. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  36169. */
  36170. function forOwn(object, iteratee) {
  36171. return object && baseForOwn(object, getIteratee(iteratee, 3));
  36172. }
  36173. /**
  36174. * This method is like `_.forOwn` except that it iterates over properties of
  36175. * `object` in the opposite order.
  36176. *
  36177. * @static
  36178. * @memberOf _
  36179. * @since 2.0.0
  36180. * @category Object
  36181. * @param {Object} object The object to iterate over.
  36182. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  36183. * @returns {Object} Returns `object`.
  36184. * @see _.forOwn
  36185. * @example
  36186. *
  36187. * function Foo() {
  36188. * this.a = 1;
  36189. * this.b = 2;
  36190. * }
  36191. *
  36192. * Foo.prototype.c = 3;
  36193. *
  36194. * _.forOwnRight(new Foo, function(value, key) {
  36195. * console.log(key);
  36196. * });
  36197. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  36198. */
  36199. function forOwnRight(object, iteratee) {
  36200. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  36201. }
  36202. /**
  36203. * Creates an array of function property names from own enumerable properties
  36204. * of `object`.
  36205. *
  36206. * @static
  36207. * @since 0.1.0
  36208. * @memberOf _
  36209. * @category Object
  36210. * @param {Object} object The object to inspect.
  36211. * @returns {Array} Returns the function names.
  36212. * @see _.functionsIn
  36213. * @example
  36214. *
  36215. * function Foo() {
  36216. * this.a = _.constant('a');
  36217. * this.b = _.constant('b');
  36218. * }
  36219. *
  36220. * Foo.prototype.c = _.constant('c');
  36221. *
  36222. * _.functions(new Foo);
  36223. * // => ['a', 'b']
  36224. */
  36225. function functions(object) {
  36226. return object == null ? [] : baseFunctions(object, keys(object));
  36227. }
  36228. /**
  36229. * Creates an array of function property names from own and inherited
  36230. * enumerable properties of `object`.
  36231. *
  36232. * @static
  36233. * @memberOf _
  36234. * @since 4.0.0
  36235. * @category Object
  36236. * @param {Object} object The object to inspect.
  36237. * @returns {Array} Returns the function names.
  36238. * @see _.functions
  36239. * @example
  36240. *
  36241. * function Foo() {
  36242. * this.a = _.constant('a');
  36243. * this.b = _.constant('b');
  36244. * }
  36245. *
  36246. * Foo.prototype.c = _.constant('c');
  36247. *
  36248. * _.functionsIn(new Foo);
  36249. * // => ['a', 'b', 'c']
  36250. */
  36251. function functionsIn(object) {
  36252. return object == null ? [] : baseFunctions(object, keysIn(object));
  36253. }
  36254. /**
  36255. * Gets the value at `path` of `object`. If the resolved value is
  36256. * `undefined`, the `defaultValue` is returned in its place.
  36257. *
  36258. * @static
  36259. * @memberOf _
  36260. * @since 3.7.0
  36261. * @category Object
  36262. * @param {Object} object The object to query.
  36263. * @param {Array|string} path The path of the property to get.
  36264. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  36265. * @returns {*} Returns the resolved value.
  36266. * @example
  36267. *
  36268. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  36269. *
  36270. * _.get(object, 'a[0].b.c');
  36271. * // => 3
  36272. *
  36273. * _.get(object, ['a', '0', 'b', 'c']);
  36274. * // => 3
  36275. *
  36276. * _.get(object, 'a.b.c', 'default');
  36277. * // => 'default'
  36278. */
  36279. function get(object, path, defaultValue) {
  36280. var result = object == null ? undefined : baseGet(object, path);
  36281. return result === undefined ? defaultValue : result;
  36282. }
  36283. /**
  36284. * Checks if `path` is a direct property of `object`.
  36285. *
  36286. * @static
  36287. * @since 0.1.0
  36288. * @memberOf _
  36289. * @category Object
  36290. * @param {Object} object The object to query.
  36291. * @param {Array|string} path The path to check.
  36292. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  36293. * @example
  36294. *
  36295. * var object = { 'a': { 'b': 2 } };
  36296. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  36297. *
  36298. * _.has(object, 'a');
  36299. * // => true
  36300. *
  36301. * _.has(object, 'a.b');
  36302. * // => true
  36303. *
  36304. * _.has(object, ['a', 'b']);
  36305. * // => true
  36306. *
  36307. * _.has(other, 'a');
  36308. * // => false
  36309. */
  36310. function has(object, path) {
  36311. return object != null && hasPath(object, path, baseHas);
  36312. }
  36313. /**
  36314. * Checks if `path` is a direct or inherited property of `object`.
  36315. *
  36316. * @static
  36317. * @memberOf _
  36318. * @since 4.0.0
  36319. * @category Object
  36320. * @param {Object} object The object to query.
  36321. * @param {Array|string} path The path to check.
  36322. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  36323. * @example
  36324. *
  36325. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  36326. *
  36327. * _.hasIn(object, 'a');
  36328. * // => true
  36329. *
  36330. * _.hasIn(object, 'a.b');
  36331. * // => true
  36332. *
  36333. * _.hasIn(object, ['a', 'b']);
  36334. * // => true
  36335. *
  36336. * _.hasIn(object, 'b');
  36337. * // => false
  36338. */
  36339. function hasIn(object, path) {
  36340. return object != null && hasPath(object, path, baseHasIn);
  36341. }
  36342. /**
  36343. * Creates an object composed of the inverted keys and values of `object`.
  36344. * If `object` contains duplicate values, subsequent values overwrite
  36345. * property assignments of previous values.
  36346. *
  36347. * @static
  36348. * @memberOf _
  36349. * @since 0.7.0
  36350. * @category Object
  36351. * @param {Object} object The object to invert.
  36352. * @returns {Object} Returns the new inverted object.
  36353. * @example
  36354. *
  36355. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  36356. *
  36357. * _.invert(object);
  36358. * // => { '1': 'c', '2': 'b' }
  36359. */
  36360. var invert = createInverter(function(result, value, key) {
  36361. if (value != null &&
  36362. typeof value.toString != 'function') {
  36363. value = nativeObjectToString.call(value);
  36364. }
  36365. result[value] = key;
  36366. }, constant(identity));
  36367. /**
  36368. * This method is like `_.invert` except that the inverted object is generated
  36369. * from the results of running each element of `object` thru `iteratee`. The
  36370. * corresponding inverted value of each inverted key is an array of keys
  36371. * responsible for generating the inverted value. The iteratee is invoked
  36372. * with one argument: (value).
  36373. *
  36374. * @static
  36375. * @memberOf _
  36376. * @since 4.1.0
  36377. * @category Object
  36378. * @param {Object} object The object to invert.
  36379. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  36380. * @returns {Object} Returns the new inverted object.
  36381. * @example
  36382. *
  36383. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  36384. *
  36385. * _.invertBy(object);
  36386. * // => { '1': ['a', 'c'], '2': ['b'] }
  36387. *
  36388. * _.invertBy(object, function(value) {
  36389. * return 'group' + value;
  36390. * });
  36391. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  36392. */
  36393. var invertBy = createInverter(function(result, value, key) {
  36394. if (value != null &&
  36395. typeof value.toString != 'function') {
  36396. value = nativeObjectToString.call(value);
  36397. }
  36398. if (hasOwnProperty.call(result, value)) {
  36399. result[value].push(key);
  36400. } else {
  36401. result[value] = [key];
  36402. }
  36403. }, getIteratee);
  36404. /**
  36405. * Invokes the method at `path` of `object`.
  36406. *
  36407. * @static
  36408. * @memberOf _
  36409. * @since 4.0.0
  36410. * @category Object
  36411. * @param {Object} object The object to query.
  36412. * @param {Array|string} path The path of the method to invoke.
  36413. * @param {...*} [args] The arguments to invoke the method with.
  36414. * @returns {*} Returns the result of the invoked method.
  36415. * @example
  36416. *
  36417. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  36418. *
  36419. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  36420. * // => [2, 3]
  36421. */
  36422. var invoke = baseRest(baseInvoke);
  36423. /**
  36424. * Creates an array of the own enumerable property names of `object`.
  36425. *
  36426. * **Note:** Non-object values are coerced to objects. See the
  36427. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  36428. * for more details.
  36429. *
  36430. * @static
  36431. * @since 0.1.0
  36432. * @memberOf _
  36433. * @category Object
  36434. * @param {Object} object The object to query.
  36435. * @returns {Array} Returns the array of property names.
  36436. * @example
  36437. *
  36438. * function Foo() {
  36439. * this.a = 1;
  36440. * this.b = 2;
  36441. * }
  36442. *
  36443. * Foo.prototype.c = 3;
  36444. *
  36445. * _.keys(new Foo);
  36446. * // => ['a', 'b'] (iteration order is not guaranteed)
  36447. *
  36448. * _.keys('hi');
  36449. * // => ['0', '1']
  36450. */
  36451. function keys(object) {
  36452. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  36453. }
  36454. /**
  36455. * Creates an array of the own and inherited enumerable property names of `object`.
  36456. *
  36457. * **Note:** Non-object values are coerced to objects.
  36458. *
  36459. * @static
  36460. * @memberOf _
  36461. * @since 3.0.0
  36462. * @category Object
  36463. * @param {Object} object The object to query.
  36464. * @returns {Array} Returns the array of property names.
  36465. * @example
  36466. *
  36467. * function Foo() {
  36468. * this.a = 1;
  36469. * this.b = 2;
  36470. * }
  36471. *
  36472. * Foo.prototype.c = 3;
  36473. *
  36474. * _.keysIn(new Foo);
  36475. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  36476. */
  36477. function keysIn(object) {
  36478. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  36479. }
  36480. /**
  36481. * The opposite of `_.mapValues`; this method creates an object with the
  36482. * same values as `object` and keys generated by running each own enumerable
  36483. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  36484. * with three arguments: (value, key, object).
  36485. *
  36486. * @static
  36487. * @memberOf _
  36488. * @since 3.8.0
  36489. * @category Object
  36490. * @param {Object} object The object to iterate over.
  36491. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  36492. * @returns {Object} Returns the new mapped object.
  36493. * @see _.mapValues
  36494. * @example
  36495. *
  36496. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  36497. * return key + value;
  36498. * });
  36499. * // => { 'a1': 1, 'b2': 2 }
  36500. */
  36501. function mapKeys(object, iteratee) {
  36502. var result = {};
  36503. iteratee = getIteratee(iteratee, 3);
  36504. baseForOwn(object, function(value, key, object) {
  36505. baseAssignValue(result, iteratee(value, key, object), value);
  36506. });
  36507. return result;
  36508. }
  36509. /**
  36510. * Creates an object with the same keys as `object` and values generated
  36511. * by running each own enumerable string keyed property of `object` thru
  36512. * `iteratee`. The iteratee is invoked with three arguments:
  36513. * (value, key, object).
  36514. *
  36515. * @static
  36516. * @memberOf _
  36517. * @since 2.4.0
  36518. * @category Object
  36519. * @param {Object} object The object to iterate over.
  36520. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  36521. * @returns {Object} Returns the new mapped object.
  36522. * @see _.mapKeys
  36523. * @example
  36524. *
  36525. * var users = {
  36526. * 'fred': { 'user': 'fred', 'age': 40 },
  36527. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  36528. * };
  36529. *
  36530. * _.mapValues(users, function(o) { return o.age; });
  36531. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  36532. *
  36533. * // The `_.property` iteratee shorthand.
  36534. * _.mapValues(users, 'age');
  36535. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  36536. */
  36537. function mapValues(object, iteratee) {
  36538. var result = {};
  36539. iteratee = getIteratee(iteratee, 3);
  36540. baseForOwn(object, function(value, key, object) {
  36541. baseAssignValue(result, key, iteratee(value, key, object));
  36542. });
  36543. return result;
  36544. }
  36545. /**
  36546. * This method is like `_.assign` except that it recursively merges own and
  36547. * inherited enumerable string keyed properties of source objects into the
  36548. * destination object. Source properties that resolve to `undefined` are
  36549. * skipped if a destination value exists. Array and plain object properties
  36550. * are merged recursively. Other objects and value types are overridden by
  36551. * assignment. Source objects are applied from left to right. Subsequent
  36552. * sources overwrite property assignments of previous sources.
  36553. *
  36554. * **Note:** This method mutates `object`.
  36555. *
  36556. * @static
  36557. * @memberOf _
  36558. * @since 0.5.0
  36559. * @category Object
  36560. * @param {Object} object The destination object.
  36561. * @param {...Object} [sources] The source objects.
  36562. * @returns {Object} Returns `object`.
  36563. * @example
  36564. *
  36565. * var object = {
  36566. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  36567. * };
  36568. *
  36569. * var other = {
  36570. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  36571. * };
  36572. *
  36573. * _.merge(object, other);
  36574. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  36575. */
  36576. var merge = createAssigner(function(object, source, srcIndex) {
  36577. baseMerge(object, source, srcIndex);
  36578. });
  36579. /**
  36580. * This method is like `_.merge` except that it accepts `customizer` which
  36581. * is invoked to produce the merged values of the destination and source
  36582. * properties. If `customizer` returns `undefined`, merging is handled by the
  36583. * method instead. The `customizer` is invoked with six arguments:
  36584. * (objValue, srcValue, key, object, source, stack).
  36585. *
  36586. * **Note:** This method mutates `object`.
  36587. *
  36588. * @static
  36589. * @memberOf _
  36590. * @since 4.0.0
  36591. * @category Object
  36592. * @param {Object} object The destination object.
  36593. * @param {...Object} sources The source objects.
  36594. * @param {Function} customizer The function to customize assigned values.
  36595. * @returns {Object} Returns `object`.
  36596. * @example
  36597. *
  36598. * function customizer(objValue, srcValue) {
  36599. * if (_.isArray(objValue)) {
  36600. * return objValue.concat(srcValue);
  36601. * }
  36602. * }
  36603. *
  36604. * var object = { 'a': [1], 'b': [2] };
  36605. * var other = { 'a': [3], 'b': [4] };
  36606. *
  36607. * _.mergeWith(object, other, customizer);
  36608. * // => { 'a': [1, 3], 'b': [2, 4] }
  36609. */
  36610. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  36611. baseMerge(object, source, srcIndex, customizer);
  36612. });
  36613. /**
  36614. * The opposite of `_.pick`; this method creates an object composed of the
  36615. * own and inherited enumerable property paths of `object` that are not omitted.
  36616. *
  36617. * **Note:** This method is considerably slower than `_.pick`.
  36618. *
  36619. * @static
  36620. * @since 0.1.0
  36621. * @memberOf _
  36622. * @category Object
  36623. * @param {Object} object The source object.
  36624. * @param {...(string|string[])} [paths] The property paths to omit.
  36625. * @returns {Object} Returns the new object.
  36626. * @example
  36627. *
  36628. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  36629. *
  36630. * _.omit(object, ['a', 'c']);
  36631. * // => { 'b': '2' }
  36632. */
  36633. var omit = flatRest(function(object, paths) {
  36634. var result = {};
  36635. if (object == null) {
  36636. return result;
  36637. }
  36638. var isDeep = false;
  36639. paths = arrayMap(paths, function(path) {
  36640. path = castPath(path, object);
  36641. isDeep || (isDeep = path.length > 1);
  36642. return path;
  36643. });
  36644. copyObject(object, getAllKeysIn(object), result);
  36645. if (isDeep) {
  36646. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  36647. }
  36648. var length = paths.length;
  36649. while (length--) {
  36650. baseUnset(result, paths[length]);
  36651. }
  36652. return result;
  36653. });
  36654. /**
  36655. * The opposite of `_.pickBy`; this method creates an object composed of
  36656. * the own and inherited enumerable string keyed properties of `object` that
  36657. * `predicate` doesn't return truthy for. The predicate is invoked with two
  36658. * arguments: (value, key).
  36659. *
  36660. * @static
  36661. * @memberOf _
  36662. * @since 4.0.0
  36663. * @category Object
  36664. * @param {Object} object The source object.
  36665. * @param {Function} [predicate=_.identity] The function invoked per property.
  36666. * @returns {Object} Returns the new object.
  36667. * @example
  36668. *
  36669. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  36670. *
  36671. * _.omitBy(object, _.isNumber);
  36672. * // => { 'b': '2' }
  36673. */
  36674. function omitBy(object, predicate) {
  36675. return pickBy(object, negate(getIteratee(predicate)));
  36676. }
  36677. /**
  36678. * Creates an object composed of the picked `object` properties.
  36679. *
  36680. * @static
  36681. * @since 0.1.0
  36682. * @memberOf _
  36683. * @category Object
  36684. * @param {Object} object The source object.
  36685. * @param {...(string|string[])} [paths] The property paths to pick.
  36686. * @returns {Object} Returns the new object.
  36687. * @example
  36688. *
  36689. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  36690. *
  36691. * _.pick(object, ['a', 'c']);
  36692. * // => { 'a': 1, 'c': 3 }
  36693. */
  36694. var pick = flatRest(function(object, paths) {
  36695. return object == null ? {} : basePick(object, paths);
  36696. });
  36697. /**
  36698. * Creates an object composed of the `object` properties `predicate` returns
  36699. * truthy for. The predicate is invoked with two arguments: (value, key).
  36700. *
  36701. * @static
  36702. * @memberOf _
  36703. * @since 4.0.0
  36704. * @category Object
  36705. * @param {Object} object The source object.
  36706. * @param {Function} [predicate=_.identity] The function invoked per property.
  36707. * @returns {Object} Returns the new object.
  36708. * @example
  36709. *
  36710. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  36711. *
  36712. * _.pickBy(object, _.isNumber);
  36713. * // => { 'a': 1, 'c': 3 }
  36714. */
  36715. function pickBy(object, predicate) {
  36716. if (object == null) {
  36717. return {};
  36718. }
  36719. var props = arrayMap(getAllKeysIn(object), function(prop) {
  36720. return [prop];
  36721. });
  36722. predicate = getIteratee(predicate);
  36723. return basePickBy(object, props, function(value, path) {
  36724. return predicate(value, path[0]);
  36725. });
  36726. }
  36727. /**
  36728. * This method is like `_.get` except that if the resolved value is a
  36729. * function it's invoked with the `this` binding of its parent object and
  36730. * its result is returned.
  36731. *
  36732. * @static
  36733. * @since 0.1.0
  36734. * @memberOf _
  36735. * @category Object
  36736. * @param {Object} object The object to query.
  36737. * @param {Array|string} path The path of the property to resolve.
  36738. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  36739. * @returns {*} Returns the resolved value.
  36740. * @example
  36741. *
  36742. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  36743. *
  36744. * _.result(object, 'a[0].b.c1');
  36745. * // => 3
  36746. *
  36747. * _.result(object, 'a[0].b.c2');
  36748. * // => 4
  36749. *
  36750. * _.result(object, 'a[0].b.c3', 'default');
  36751. * // => 'default'
  36752. *
  36753. * _.result(object, 'a[0].b.c3', _.constant('default'));
  36754. * // => 'default'
  36755. */
  36756. function result(object, path, defaultValue) {
  36757. path = castPath(path, object);
  36758. var index = -1,
  36759. length = path.length;
  36760. // Ensure the loop is entered when path is empty.
  36761. if (!length) {
  36762. length = 1;
  36763. object = undefined;
  36764. }
  36765. while (++index < length) {
  36766. var value = object == null ? undefined : object[toKey(path[index])];
  36767. if (value === undefined) {
  36768. index = length;
  36769. value = defaultValue;
  36770. }
  36771. object = isFunction(value) ? value.call(object) : value;
  36772. }
  36773. return object;
  36774. }
  36775. /**
  36776. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  36777. * it's created. Arrays are created for missing index properties while objects
  36778. * are created for all other missing properties. Use `_.setWith` to customize
  36779. * `path` creation.
  36780. *
  36781. * **Note:** This method mutates `object`.
  36782. *
  36783. * @static
  36784. * @memberOf _
  36785. * @since 3.7.0
  36786. * @category Object
  36787. * @param {Object} object The object to modify.
  36788. * @param {Array|string} path The path of the property to set.
  36789. * @param {*} value The value to set.
  36790. * @returns {Object} Returns `object`.
  36791. * @example
  36792. *
  36793. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  36794. *
  36795. * _.set(object, 'a[0].b.c', 4);
  36796. * console.log(object.a[0].b.c);
  36797. * // => 4
  36798. *
  36799. * _.set(object, ['x', '0', 'y', 'z'], 5);
  36800. * console.log(object.x[0].y.z);
  36801. * // => 5
  36802. */
  36803. function set(object, path, value) {
  36804. return object == null ? object : baseSet(object, path, value);
  36805. }
  36806. /**
  36807. * This method is like `_.set` except that it accepts `customizer` which is
  36808. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  36809. * path creation is handled by the method instead. The `customizer` is invoked
  36810. * with three arguments: (nsValue, key, nsObject).
  36811. *
  36812. * **Note:** This method mutates `object`.
  36813. *
  36814. * @static
  36815. * @memberOf _
  36816. * @since 4.0.0
  36817. * @category Object
  36818. * @param {Object} object The object to modify.
  36819. * @param {Array|string} path The path of the property to set.
  36820. * @param {*} value The value to set.
  36821. * @param {Function} [customizer] The function to customize assigned values.
  36822. * @returns {Object} Returns `object`.
  36823. * @example
  36824. *
  36825. * var object = {};
  36826. *
  36827. * _.setWith(object, '[0][1]', 'a', Object);
  36828. * // => { '0': { '1': 'a' } }
  36829. */
  36830. function setWith(object, path, value, customizer) {
  36831. customizer = typeof customizer == 'function' ? customizer : undefined;
  36832. return object == null ? object : baseSet(object, path, value, customizer);
  36833. }
  36834. /**
  36835. * Creates an array of own enumerable string keyed-value pairs for `object`
  36836. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  36837. * entries are returned.
  36838. *
  36839. * @static
  36840. * @memberOf _
  36841. * @since 4.0.0
  36842. * @alias entries
  36843. * @category Object
  36844. * @param {Object} object The object to query.
  36845. * @returns {Array} Returns the key-value pairs.
  36846. * @example
  36847. *
  36848. * function Foo() {
  36849. * this.a = 1;
  36850. * this.b = 2;
  36851. * }
  36852. *
  36853. * Foo.prototype.c = 3;
  36854. *
  36855. * _.toPairs(new Foo);
  36856. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  36857. */
  36858. var toPairs = createToPairs(keys);
  36859. /**
  36860. * Creates an array of own and inherited enumerable string keyed-value pairs
  36861. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  36862. * or set, its entries are returned.
  36863. *
  36864. * @static
  36865. * @memberOf _
  36866. * @since 4.0.0
  36867. * @alias entriesIn
  36868. * @category Object
  36869. * @param {Object} object The object to query.
  36870. * @returns {Array} Returns the key-value pairs.
  36871. * @example
  36872. *
  36873. * function Foo() {
  36874. * this.a = 1;
  36875. * this.b = 2;
  36876. * }
  36877. *
  36878. * Foo.prototype.c = 3;
  36879. *
  36880. * _.toPairsIn(new Foo);
  36881. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  36882. */
  36883. var toPairsIn = createToPairs(keysIn);
  36884. /**
  36885. * An alternative to `_.reduce`; this method transforms `object` to a new
  36886. * `accumulator` object which is the result of running each of its own
  36887. * enumerable string keyed properties thru `iteratee`, with each invocation
  36888. * potentially mutating the `accumulator` object. If `accumulator` is not
  36889. * provided, a new object with the same `[[Prototype]]` will be used. The
  36890. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  36891. * Iteratee functions may exit iteration early by explicitly returning `false`.
  36892. *
  36893. * @static
  36894. * @memberOf _
  36895. * @since 1.3.0
  36896. * @category Object
  36897. * @param {Object} object The object to iterate over.
  36898. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  36899. * @param {*} [accumulator] The custom accumulator value.
  36900. * @returns {*} Returns the accumulated value.
  36901. * @example
  36902. *
  36903. * _.transform([2, 3, 4], function(result, n) {
  36904. * result.push(n *= n);
  36905. * return n % 2 == 0;
  36906. * }, []);
  36907. * // => [4, 9]
  36908. *
  36909. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  36910. * (result[value] || (result[value] = [])).push(key);
  36911. * }, {});
  36912. * // => { '1': ['a', 'c'], '2': ['b'] }
  36913. */
  36914. function transform(object, iteratee, accumulator) {
  36915. var isArr = isArray(object),
  36916. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  36917. iteratee = getIteratee(iteratee, 4);
  36918. if (accumulator == null) {
  36919. var Ctor = object && object.constructor;
  36920. if (isArrLike) {
  36921. accumulator = isArr ? new Ctor : [];
  36922. }
  36923. else if (isObject(object)) {
  36924. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  36925. }
  36926. else {
  36927. accumulator = {};
  36928. }
  36929. }
  36930. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  36931. return iteratee(accumulator, value, index, object);
  36932. });
  36933. return accumulator;
  36934. }
  36935. /**
  36936. * Removes the property at `path` of `object`.
  36937. *
  36938. * **Note:** This method mutates `object`.
  36939. *
  36940. * @static
  36941. * @memberOf _
  36942. * @since 4.0.0
  36943. * @category Object
  36944. * @param {Object} object The object to modify.
  36945. * @param {Array|string} path The path of the property to unset.
  36946. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  36947. * @example
  36948. *
  36949. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  36950. * _.unset(object, 'a[0].b.c');
  36951. * // => true
  36952. *
  36953. * console.log(object);
  36954. * // => { 'a': [{ 'b': {} }] };
  36955. *
  36956. * _.unset(object, ['a', '0', 'b', 'c']);
  36957. * // => true
  36958. *
  36959. * console.log(object);
  36960. * // => { 'a': [{ 'b': {} }] };
  36961. */
  36962. function unset(object, path) {
  36963. return object == null ? true : baseUnset(object, path);
  36964. }
  36965. /**
  36966. * This method is like `_.set` except that accepts `updater` to produce the
  36967. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  36968. * is invoked with one argument: (value).
  36969. *
  36970. * **Note:** This method mutates `object`.
  36971. *
  36972. * @static
  36973. * @memberOf _
  36974. * @since 4.6.0
  36975. * @category Object
  36976. * @param {Object} object The object to modify.
  36977. * @param {Array|string} path The path of the property to set.
  36978. * @param {Function} updater The function to produce the updated value.
  36979. * @returns {Object} Returns `object`.
  36980. * @example
  36981. *
  36982. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  36983. *
  36984. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  36985. * console.log(object.a[0].b.c);
  36986. * // => 9
  36987. *
  36988. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  36989. * console.log(object.x[0].y.z);
  36990. * // => 0
  36991. */
  36992. function update(object, path, updater) {
  36993. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  36994. }
  36995. /**
  36996. * This method is like `_.update` except that it accepts `customizer` which is
  36997. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  36998. * path creation is handled by the method instead. The `customizer` is invoked
  36999. * with three arguments: (nsValue, key, nsObject).
  37000. *
  37001. * **Note:** This method mutates `object`.
  37002. *
  37003. * @static
  37004. * @memberOf _
  37005. * @since 4.6.0
  37006. * @category Object
  37007. * @param {Object} object The object to modify.
  37008. * @param {Array|string} path The path of the property to set.
  37009. * @param {Function} updater The function to produce the updated value.
  37010. * @param {Function} [customizer] The function to customize assigned values.
  37011. * @returns {Object} Returns `object`.
  37012. * @example
  37013. *
  37014. * var object = {};
  37015. *
  37016. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  37017. * // => { '0': { '1': 'a' } }
  37018. */
  37019. function updateWith(object, path, updater, customizer) {
  37020. customizer = typeof customizer == 'function' ? customizer : undefined;
  37021. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  37022. }
  37023. /**
  37024. * Creates an array of the own enumerable string keyed property values of `object`.
  37025. *
  37026. * **Note:** Non-object values are coerced to objects.
  37027. *
  37028. * @static
  37029. * @since 0.1.0
  37030. * @memberOf _
  37031. * @category Object
  37032. * @param {Object} object The object to query.
  37033. * @returns {Array} Returns the array of property values.
  37034. * @example
  37035. *
  37036. * function Foo() {
  37037. * this.a = 1;
  37038. * this.b = 2;
  37039. * }
  37040. *
  37041. * Foo.prototype.c = 3;
  37042. *
  37043. * _.values(new Foo);
  37044. * // => [1, 2] (iteration order is not guaranteed)
  37045. *
  37046. * _.values('hi');
  37047. * // => ['h', 'i']
  37048. */
  37049. function values(object) {
  37050. return object == null ? [] : baseValues(object, keys(object));
  37051. }
  37052. /**
  37053. * Creates an array of the own and inherited enumerable string keyed property
  37054. * values of `object`.
  37055. *
  37056. * **Note:** Non-object values are coerced to objects.
  37057. *
  37058. * @static
  37059. * @memberOf _
  37060. * @since 3.0.0
  37061. * @category Object
  37062. * @param {Object} object The object to query.
  37063. * @returns {Array} Returns the array of property values.
  37064. * @example
  37065. *
  37066. * function Foo() {
  37067. * this.a = 1;
  37068. * this.b = 2;
  37069. * }
  37070. *
  37071. * Foo.prototype.c = 3;
  37072. *
  37073. * _.valuesIn(new Foo);
  37074. * // => [1, 2, 3] (iteration order is not guaranteed)
  37075. */
  37076. function valuesIn(object) {
  37077. return object == null ? [] : baseValues(object, keysIn(object));
  37078. }
  37079. /*------------------------------------------------------------------------*/
  37080. /**
  37081. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  37082. *
  37083. * @static
  37084. * @memberOf _
  37085. * @since 4.0.0
  37086. * @category Number
  37087. * @param {number} number The number to clamp.
  37088. * @param {number} [lower] The lower bound.
  37089. * @param {number} upper The upper bound.
  37090. * @returns {number} Returns the clamped number.
  37091. * @example
  37092. *
  37093. * _.clamp(-10, -5, 5);
  37094. * // => -5
  37095. *
  37096. * _.clamp(10, -5, 5);
  37097. * // => 5
  37098. */
  37099. function clamp(number, lower, upper) {
  37100. if (upper === undefined) {
  37101. upper = lower;
  37102. lower = undefined;
  37103. }
  37104. if (upper !== undefined) {
  37105. upper = toNumber(upper);
  37106. upper = upper === upper ? upper : 0;
  37107. }
  37108. if (lower !== undefined) {
  37109. lower = toNumber(lower);
  37110. lower = lower === lower ? lower : 0;
  37111. }
  37112. return baseClamp(toNumber(number), lower, upper);
  37113. }
  37114. /**
  37115. * Checks if `n` is between `start` and up to, but not including, `end`. If
  37116. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  37117. * If `start` is greater than `end` the params are swapped to support
  37118. * negative ranges.
  37119. *
  37120. * @static
  37121. * @memberOf _
  37122. * @since 3.3.0
  37123. * @category Number
  37124. * @param {number} number The number to check.
  37125. * @param {number} [start=0] The start of the range.
  37126. * @param {number} end The end of the range.
  37127. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  37128. * @see _.range, _.rangeRight
  37129. * @example
  37130. *
  37131. * _.inRange(3, 2, 4);
  37132. * // => true
  37133. *
  37134. * _.inRange(4, 8);
  37135. * // => true
  37136. *
  37137. * _.inRange(4, 2);
  37138. * // => false
  37139. *
  37140. * _.inRange(2, 2);
  37141. * // => false
  37142. *
  37143. * _.inRange(1.2, 2);
  37144. * // => true
  37145. *
  37146. * _.inRange(5.2, 4);
  37147. * // => false
  37148. *
  37149. * _.inRange(-3, -2, -6);
  37150. * // => true
  37151. */
  37152. function inRange(number, start, end) {
  37153. start = toFinite(start);
  37154. if (end === undefined) {
  37155. end = start;
  37156. start = 0;
  37157. } else {
  37158. end = toFinite(end);
  37159. }
  37160. number = toNumber(number);
  37161. return baseInRange(number, start, end);
  37162. }
  37163. /**
  37164. * Produces a random number between the inclusive `lower` and `upper` bounds.
  37165. * If only one argument is provided a number between `0` and the given number
  37166. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  37167. * floats, a floating-point number is returned instead of an integer.
  37168. *
  37169. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  37170. * floating-point values which can produce unexpected results.
  37171. *
  37172. * @static
  37173. * @memberOf _
  37174. * @since 0.7.0
  37175. * @category Number
  37176. * @param {number} [lower=0] The lower bound.
  37177. * @param {number} [upper=1] The upper bound.
  37178. * @param {boolean} [floating] Specify returning a floating-point number.
  37179. * @returns {number} Returns the random number.
  37180. * @example
  37181. *
  37182. * _.random(0, 5);
  37183. * // => an integer between 0 and 5
  37184. *
  37185. * _.random(5);
  37186. * // => also an integer between 0 and 5
  37187. *
  37188. * _.random(5, true);
  37189. * // => a floating-point number between 0 and 5
  37190. *
  37191. * _.random(1.2, 5.2);
  37192. * // => a floating-point number between 1.2 and 5.2
  37193. */
  37194. function random(lower, upper, floating) {
  37195. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  37196. upper = floating = undefined;
  37197. }
  37198. if (floating === undefined) {
  37199. if (typeof upper == 'boolean') {
  37200. floating = upper;
  37201. upper = undefined;
  37202. }
  37203. else if (typeof lower == 'boolean') {
  37204. floating = lower;
  37205. lower = undefined;
  37206. }
  37207. }
  37208. if (lower === undefined && upper === undefined) {
  37209. lower = 0;
  37210. upper = 1;
  37211. }
  37212. else {
  37213. lower = toFinite(lower);
  37214. if (upper === undefined) {
  37215. upper = lower;
  37216. lower = 0;
  37217. } else {
  37218. upper = toFinite(upper);
  37219. }
  37220. }
  37221. if (lower > upper) {
  37222. var temp = lower;
  37223. lower = upper;
  37224. upper = temp;
  37225. }
  37226. if (floating || lower % 1 || upper % 1) {
  37227. var rand = nativeRandom();
  37228. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  37229. }
  37230. return baseRandom(lower, upper);
  37231. }
  37232. /*------------------------------------------------------------------------*/
  37233. /**
  37234. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  37235. *
  37236. * @static
  37237. * @memberOf _
  37238. * @since 3.0.0
  37239. * @category String
  37240. * @param {string} [string=''] The string to convert.
  37241. * @returns {string} Returns the camel cased string.
  37242. * @example
  37243. *
  37244. * _.camelCase('Foo Bar');
  37245. * // => 'fooBar'
  37246. *
  37247. * _.camelCase('--foo-bar--');
  37248. * // => 'fooBar'
  37249. *
  37250. * _.camelCase('__FOO_BAR__');
  37251. * // => 'fooBar'
  37252. */
  37253. var camelCase = createCompounder(function(result, word, index) {
  37254. word = word.toLowerCase();
  37255. return result + (index ? capitalize(word) : word);
  37256. });
  37257. /**
  37258. * Converts the first character of `string` to upper case and the remaining
  37259. * to lower case.
  37260. *
  37261. * @static
  37262. * @memberOf _
  37263. * @since 3.0.0
  37264. * @category String
  37265. * @param {string} [string=''] The string to capitalize.
  37266. * @returns {string} Returns the capitalized string.
  37267. * @example
  37268. *
  37269. * _.capitalize('FRED');
  37270. * // => 'Fred'
  37271. */
  37272. function capitalize(string) {
  37273. return upperFirst(toString(string).toLowerCase());
  37274. }
  37275. /**
  37276. * Deburrs `string` by converting
  37277. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  37278. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  37279. * letters to basic Latin letters and removing
  37280. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  37281. *
  37282. * @static
  37283. * @memberOf _
  37284. * @since 3.0.0
  37285. * @category String
  37286. * @param {string} [string=''] The string to deburr.
  37287. * @returns {string} Returns the deburred string.
  37288. * @example
  37289. *
  37290. * _.deburr('déjà vu');
  37291. * // => 'deja vu'
  37292. */
  37293. function deburr(string) {
  37294. string = toString(string);
  37295. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  37296. }
  37297. /**
  37298. * Checks if `string` ends with the given target string.
  37299. *
  37300. * @static
  37301. * @memberOf _
  37302. * @since 3.0.0
  37303. * @category String
  37304. * @param {string} [string=''] The string to inspect.
  37305. * @param {string} [target] The string to search for.
  37306. * @param {number} [position=string.length] The position to search up to.
  37307. * @returns {boolean} Returns `true` if `string` ends with `target`,
  37308. * else `false`.
  37309. * @example
  37310. *
  37311. * _.endsWith('abc', 'c');
  37312. * // => true
  37313. *
  37314. * _.endsWith('abc', 'b');
  37315. * // => false
  37316. *
  37317. * _.endsWith('abc', 'b', 2);
  37318. * // => true
  37319. */
  37320. function endsWith(string, target, position) {
  37321. string = toString(string);
  37322. target = baseToString(target);
  37323. var length = string.length;
  37324. position = position === undefined
  37325. ? length
  37326. : baseClamp(toInteger(position), 0, length);
  37327. var end = position;
  37328. position -= target.length;
  37329. return position >= 0 && string.slice(position, end) == target;
  37330. }
  37331. /**
  37332. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  37333. * corresponding HTML entities.
  37334. *
  37335. * **Note:** No other characters are escaped. To escape additional
  37336. * characters use a third-party library like [_he_](https://mths.be/he).
  37337. *
  37338. * Though the ">" character is escaped for symmetry, characters like
  37339. * ">" and "/" don't need escaping in HTML and have no special meaning
  37340. * unless they're part of a tag or unquoted attribute value. See
  37341. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  37342. * (under "semi-related fun fact") for more details.
  37343. *
  37344. * When working with HTML you should always
  37345. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  37346. * XSS vectors.
  37347. *
  37348. * @static
  37349. * @since 0.1.0
  37350. * @memberOf _
  37351. * @category String
  37352. * @param {string} [string=''] The string to escape.
  37353. * @returns {string} Returns the escaped string.
  37354. * @example
  37355. *
  37356. * _.escape('fred, barney, & pebbles');
  37357. * // => 'fred, barney, &amp; pebbles'
  37358. */
  37359. function escape(string) {
  37360. string = toString(string);
  37361. return (string && reHasUnescapedHtml.test(string))
  37362. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  37363. : string;
  37364. }
  37365. /**
  37366. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  37367. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  37368. *
  37369. * @static
  37370. * @memberOf _
  37371. * @since 3.0.0
  37372. * @category String
  37373. * @param {string} [string=''] The string to escape.
  37374. * @returns {string} Returns the escaped string.
  37375. * @example
  37376. *
  37377. * _.escapeRegExp('[lodash](https://lodash.com/)');
  37378. * // => '\[lodash\]\(https://lodash\.com/\)'
  37379. */
  37380. function escapeRegExp(string) {
  37381. string = toString(string);
  37382. return (string && reHasRegExpChar.test(string))
  37383. ? string.replace(reRegExpChar, '\\$&')
  37384. : string;
  37385. }
  37386. /**
  37387. * Converts `string` to
  37388. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  37389. *
  37390. * @static
  37391. * @memberOf _
  37392. * @since 3.0.0
  37393. * @category String
  37394. * @param {string} [string=''] The string to convert.
  37395. * @returns {string} Returns the kebab cased string.
  37396. * @example
  37397. *
  37398. * _.kebabCase('Foo Bar');
  37399. * // => 'foo-bar'
  37400. *
  37401. * _.kebabCase('fooBar');
  37402. * // => 'foo-bar'
  37403. *
  37404. * _.kebabCase('__FOO_BAR__');
  37405. * // => 'foo-bar'
  37406. */
  37407. var kebabCase = createCompounder(function(result, word, index) {
  37408. return result + (index ? '-' : '') + word.toLowerCase();
  37409. });
  37410. /**
  37411. * Converts `string`, as space separated words, to lower case.
  37412. *
  37413. * @static
  37414. * @memberOf _
  37415. * @since 4.0.0
  37416. * @category String
  37417. * @param {string} [string=''] The string to convert.
  37418. * @returns {string} Returns the lower cased string.
  37419. * @example
  37420. *
  37421. * _.lowerCase('--Foo-Bar--');
  37422. * // => 'foo bar'
  37423. *
  37424. * _.lowerCase('fooBar');
  37425. * // => 'foo bar'
  37426. *
  37427. * _.lowerCase('__FOO_BAR__');
  37428. * // => 'foo bar'
  37429. */
  37430. var lowerCase = createCompounder(function(result, word, index) {
  37431. return result + (index ? ' ' : '') + word.toLowerCase();
  37432. });
  37433. /**
  37434. * Converts the first character of `string` to lower case.
  37435. *
  37436. * @static
  37437. * @memberOf _
  37438. * @since 4.0.0
  37439. * @category String
  37440. * @param {string} [string=''] The string to convert.
  37441. * @returns {string} Returns the converted string.
  37442. * @example
  37443. *
  37444. * _.lowerFirst('Fred');
  37445. * // => 'fred'
  37446. *
  37447. * _.lowerFirst('FRED');
  37448. * // => 'fRED'
  37449. */
  37450. var lowerFirst = createCaseFirst('toLowerCase');
  37451. /**
  37452. * Pads `string` on the left and right sides if it's shorter than `length`.
  37453. * Padding characters are truncated if they can't be evenly divided by `length`.
  37454. *
  37455. * @static
  37456. * @memberOf _
  37457. * @since 3.0.0
  37458. * @category String
  37459. * @param {string} [string=''] The string to pad.
  37460. * @param {number} [length=0] The padding length.
  37461. * @param {string} [chars=' '] The string used as padding.
  37462. * @returns {string} Returns the padded string.
  37463. * @example
  37464. *
  37465. * _.pad('abc', 8);
  37466. * // => ' abc '
  37467. *
  37468. * _.pad('abc', 8, '_-');
  37469. * // => '_-abc_-_'
  37470. *
  37471. * _.pad('abc', 3);
  37472. * // => 'abc'
  37473. */
  37474. function pad(string, length, chars) {
  37475. string = toString(string);
  37476. length = toInteger(length);
  37477. var strLength = length ? stringSize(string) : 0;
  37478. if (!length || strLength >= length) {
  37479. return string;
  37480. }
  37481. var mid = (length - strLength) / 2;
  37482. return (
  37483. createPadding(nativeFloor(mid), chars) +
  37484. string +
  37485. createPadding(nativeCeil(mid), chars)
  37486. );
  37487. }
  37488. /**
  37489. * Pads `string` on the right side if it's shorter than `length`. Padding
  37490. * characters are truncated if they exceed `length`.
  37491. *
  37492. * @static
  37493. * @memberOf _
  37494. * @since 4.0.0
  37495. * @category String
  37496. * @param {string} [string=''] The string to pad.
  37497. * @param {number} [length=0] The padding length.
  37498. * @param {string} [chars=' '] The string used as padding.
  37499. * @returns {string} Returns the padded string.
  37500. * @example
  37501. *
  37502. * _.padEnd('abc', 6);
  37503. * // => 'abc '
  37504. *
  37505. * _.padEnd('abc', 6, '_-');
  37506. * // => 'abc_-_'
  37507. *
  37508. * _.padEnd('abc', 3);
  37509. * // => 'abc'
  37510. */
  37511. function padEnd(string, length, chars) {
  37512. string = toString(string);
  37513. length = toInteger(length);
  37514. var strLength = length ? stringSize(string) : 0;
  37515. return (length && strLength < length)
  37516. ? (string + createPadding(length - strLength, chars))
  37517. : string;
  37518. }
  37519. /**
  37520. * Pads `string` on the left side if it's shorter than `length`. Padding
  37521. * characters are truncated if they exceed `length`.
  37522. *
  37523. * @static
  37524. * @memberOf _
  37525. * @since 4.0.0
  37526. * @category String
  37527. * @param {string} [string=''] The string to pad.
  37528. * @param {number} [length=0] The padding length.
  37529. * @param {string} [chars=' '] The string used as padding.
  37530. * @returns {string} Returns the padded string.
  37531. * @example
  37532. *
  37533. * _.padStart('abc', 6);
  37534. * // => ' abc'
  37535. *
  37536. * _.padStart('abc', 6, '_-');
  37537. * // => '_-_abc'
  37538. *
  37539. * _.padStart('abc', 3);
  37540. * // => 'abc'
  37541. */
  37542. function padStart(string, length, chars) {
  37543. string = toString(string);
  37544. length = toInteger(length);
  37545. var strLength = length ? stringSize(string) : 0;
  37546. return (length && strLength < length)
  37547. ? (createPadding(length - strLength, chars) + string)
  37548. : string;
  37549. }
  37550. /**
  37551. * Converts `string` to an integer of the specified radix. If `radix` is
  37552. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  37553. * hexadecimal, in which case a `radix` of `16` is used.
  37554. *
  37555. * **Note:** This method aligns with the
  37556. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  37557. *
  37558. * @static
  37559. * @memberOf _
  37560. * @since 1.1.0
  37561. * @category String
  37562. * @param {string} string The string to convert.
  37563. * @param {number} [radix=10] The radix to interpret `value` by.
  37564. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  37565. * @returns {number} Returns the converted integer.
  37566. * @example
  37567. *
  37568. * _.parseInt('08');
  37569. * // => 8
  37570. *
  37571. * _.map(['6', '08', '10'], _.parseInt);
  37572. * // => [6, 8, 10]
  37573. */
  37574. function parseInt(string, radix, guard) {
  37575. if (guard || radix == null) {
  37576. radix = 0;
  37577. } else if (radix) {
  37578. radix = +radix;
  37579. }
  37580. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  37581. }
  37582. /**
  37583. * Repeats the given string `n` times.
  37584. *
  37585. * @static
  37586. * @memberOf _
  37587. * @since 3.0.0
  37588. * @category String
  37589. * @param {string} [string=''] The string to repeat.
  37590. * @param {number} [n=1] The number of times to repeat the string.
  37591. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  37592. * @returns {string} Returns the repeated string.
  37593. * @example
  37594. *
  37595. * _.repeat('*', 3);
  37596. * // => '***'
  37597. *
  37598. * _.repeat('abc', 2);
  37599. * // => 'abcabc'
  37600. *
  37601. * _.repeat('abc', 0);
  37602. * // => ''
  37603. */
  37604. function repeat(string, n, guard) {
  37605. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  37606. n = 1;
  37607. } else {
  37608. n = toInteger(n);
  37609. }
  37610. return baseRepeat(toString(string), n);
  37611. }
  37612. /**
  37613. * Replaces matches for `pattern` in `string` with `replacement`.
  37614. *
  37615. * **Note:** This method is based on
  37616. * [`String#replace`](https://mdn.io/String/replace).
  37617. *
  37618. * @static
  37619. * @memberOf _
  37620. * @since 4.0.0
  37621. * @category String
  37622. * @param {string} [string=''] The string to modify.
  37623. * @param {RegExp|string} pattern The pattern to replace.
  37624. * @param {Function|string} replacement The match replacement.
  37625. * @returns {string} Returns the modified string.
  37626. * @example
  37627. *
  37628. * _.replace('Hi Fred', 'Fred', 'Barney');
  37629. * // => 'Hi Barney'
  37630. */
  37631. function replace() {
  37632. var args = arguments,
  37633. string = toString(args[0]);
  37634. return args.length < 3 ? string : string.replace(args[1], args[2]);
  37635. }
  37636. /**
  37637. * Converts `string` to
  37638. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  37639. *
  37640. * @static
  37641. * @memberOf _
  37642. * @since 3.0.0
  37643. * @category String
  37644. * @param {string} [string=''] The string to convert.
  37645. * @returns {string} Returns the snake cased string.
  37646. * @example
  37647. *
  37648. * _.snakeCase('Foo Bar');
  37649. * // => 'foo_bar'
  37650. *
  37651. * _.snakeCase('fooBar');
  37652. * // => 'foo_bar'
  37653. *
  37654. * _.snakeCase('--FOO-BAR--');
  37655. * // => 'foo_bar'
  37656. */
  37657. var snakeCase = createCompounder(function(result, word, index) {
  37658. return result + (index ? '_' : '') + word.toLowerCase();
  37659. });
  37660. /**
  37661. * Splits `string` by `separator`.
  37662. *
  37663. * **Note:** This method is based on
  37664. * [`String#split`](https://mdn.io/String/split).
  37665. *
  37666. * @static
  37667. * @memberOf _
  37668. * @since 4.0.0
  37669. * @category String
  37670. * @param {string} [string=''] The string to split.
  37671. * @param {RegExp|string} separator The separator pattern to split by.
  37672. * @param {number} [limit] The length to truncate results to.
  37673. * @returns {Array} Returns the string segments.
  37674. * @example
  37675. *
  37676. * _.split('a-b-c', '-', 2);
  37677. * // => ['a', 'b']
  37678. */
  37679. function split(string, separator, limit) {
  37680. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  37681. separator = limit = undefined;
  37682. }
  37683. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  37684. if (!limit) {
  37685. return [];
  37686. }
  37687. string = toString(string);
  37688. if (string && (
  37689. typeof separator == 'string' ||
  37690. (separator != null && !isRegExp(separator))
  37691. )) {
  37692. separator = baseToString(separator);
  37693. if (!separator && hasUnicode(string)) {
  37694. return castSlice(stringToArray(string), 0, limit);
  37695. }
  37696. }
  37697. return string.split(separator, limit);
  37698. }
  37699. /**
  37700. * Converts `string` to
  37701. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  37702. *
  37703. * @static
  37704. * @memberOf _
  37705. * @since 3.1.0
  37706. * @category String
  37707. * @param {string} [string=''] The string to convert.
  37708. * @returns {string} Returns the start cased string.
  37709. * @example
  37710. *
  37711. * _.startCase('--foo-bar--');
  37712. * // => 'Foo Bar'
  37713. *
  37714. * _.startCase('fooBar');
  37715. * // => 'Foo Bar'
  37716. *
  37717. * _.startCase('__FOO_BAR__');
  37718. * // => 'FOO BAR'
  37719. */
  37720. var startCase = createCompounder(function(result, word, index) {
  37721. return result + (index ? ' ' : '') + upperFirst(word);
  37722. });
  37723. /**
  37724. * Checks if `string` starts with the given target string.
  37725. *
  37726. * @static
  37727. * @memberOf _
  37728. * @since 3.0.0
  37729. * @category String
  37730. * @param {string} [string=''] The string to inspect.
  37731. * @param {string} [target] The string to search for.
  37732. * @param {number} [position=0] The position to search from.
  37733. * @returns {boolean} Returns `true` if `string` starts with `target`,
  37734. * else `false`.
  37735. * @example
  37736. *
  37737. * _.startsWith('abc', 'a');
  37738. * // => true
  37739. *
  37740. * _.startsWith('abc', 'b');
  37741. * // => false
  37742. *
  37743. * _.startsWith('abc', 'b', 1);
  37744. * // => true
  37745. */
  37746. function startsWith(string, target, position) {
  37747. string = toString(string);
  37748. position = position == null
  37749. ? 0
  37750. : baseClamp(toInteger(position), 0, string.length);
  37751. target = baseToString(target);
  37752. return string.slice(position, position + target.length) == target;
  37753. }
  37754. /**
  37755. * Creates a compiled template function that can interpolate data properties
  37756. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  37757. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  37758. * properties may be accessed as free variables in the template. If a setting
  37759. * object is given, it takes precedence over `_.templateSettings` values.
  37760. *
  37761. * **Note:** In the development build `_.template` utilizes
  37762. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  37763. * for easier debugging.
  37764. *
  37765. * For more information on precompiling templates see
  37766. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  37767. *
  37768. * For more information on Chrome extension sandboxes see
  37769. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  37770. *
  37771. * @static
  37772. * @since 0.1.0
  37773. * @memberOf _
  37774. * @category String
  37775. * @param {string} [string=''] The template string.
  37776. * @param {Object} [options={}] The options object.
  37777. * @param {RegExp} [options.escape=_.templateSettings.escape]
  37778. * The HTML "escape" delimiter.
  37779. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  37780. * The "evaluate" delimiter.
  37781. * @param {Object} [options.imports=_.templateSettings.imports]
  37782. * An object to import into the template as free variables.
  37783. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  37784. * The "interpolate" delimiter.
  37785. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  37786. * The sourceURL of the compiled template.
  37787. * @param {string} [options.variable='obj']
  37788. * The data object variable name.
  37789. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  37790. * @returns {Function} Returns the compiled template function.
  37791. * @example
  37792. *
  37793. * // Use the "interpolate" delimiter to create a compiled template.
  37794. * var compiled = _.template('hello <%= user %>!');
  37795. * compiled({ 'user': 'fred' });
  37796. * // => 'hello fred!'
  37797. *
  37798. * // Use the HTML "escape" delimiter to escape data property values.
  37799. * var compiled = _.template('<b><%- value %></b>');
  37800. * compiled({ 'value': '<script>' });
  37801. * // => '<b>&lt;script&gt;</b>'
  37802. *
  37803. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  37804. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  37805. * compiled({ 'users': ['fred', 'barney'] });
  37806. * // => '<li>fred</li><li>barney</li>'
  37807. *
  37808. * // Use the internal `print` function in "evaluate" delimiters.
  37809. * var compiled = _.template('<% print("hello " + user); %>!');
  37810. * compiled({ 'user': 'barney' });
  37811. * // => 'hello barney!'
  37812. *
  37813. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  37814. * // Disable support by replacing the "interpolate" delimiter.
  37815. * var compiled = _.template('hello ${ user }!');
  37816. * compiled({ 'user': 'pebbles' });
  37817. * // => 'hello pebbles!'
  37818. *
  37819. * // Use backslashes to treat delimiters as plain text.
  37820. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  37821. * compiled({ 'value': 'ignored' });
  37822. * // => '<%- value %>'
  37823. *
  37824. * // Use the `imports` option to import `jQuery` as `jq`.
  37825. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  37826. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  37827. * compiled({ 'users': ['fred', 'barney'] });
  37828. * // => '<li>fred</li><li>barney</li>'
  37829. *
  37830. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  37831. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  37832. * compiled(data);
  37833. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  37834. *
  37835. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  37836. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  37837. * compiled.source;
  37838. * // => function(data) {
  37839. * // var __t, __p = '';
  37840. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  37841. * // return __p;
  37842. * // }
  37843. *
  37844. * // Use custom template delimiters.
  37845. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  37846. * var compiled = _.template('hello {{ user }}!');
  37847. * compiled({ 'user': 'mustache' });
  37848. * // => 'hello mustache!'
  37849. *
  37850. * // Use the `source` property to inline compiled templates for meaningful
  37851. * // line numbers in error messages and stack traces.
  37852. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  37853. * var JST = {\
  37854. * "main": ' + _.template(mainText).source + '\
  37855. * };\
  37856. * ');
  37857. */
  37858. function template(string, options, guard) {
  37859. // Based on John Resig's `tmpl` implementation
  37860. // (http://ejohn.org/blog/javascript-micro-templating/)
  37861. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  37862. var settings = lodash.templateSettings;
  37863. if (guard && isIterateeCall(string, options, guard)) {
  37864. options = undefined;
  37865. }
  37866. string = toString(string);
  37867. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  37868. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  37869. importsKeys = keys(imports),
  37870. importsValues = baseValues(imports, importsKeys);
  37871. var isEscaping,
  37872. isEvaluating,
  37873. index = 0,
  37874. interpolate = options.interpolate || reNoMatch,
  37875. source = "__p += '";
  37876. // Compile the regexp to match each delimiter.
  37877. var reDelimiters = RegExp(
  37878. (options.escape || reNoMatch).source + '|' +
  37879. interpolate.source + '|' +
  37880. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  37881. (options.evaluate || reNoMatch).source + '|$'
  37882. , 'g');
  37883. // Use a sourceURL for easier debugging.
  37884. // The sourceURL gets injected into the source that's eval-ed, so be careful
  37885. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  37886. // and escape the comment, thus injecting code that gets evaled.
  37887. var sourceURL = '//# sourceURL=' +
  37888. (hasOwnProperty.call(options, 'sourceURL')
  37889. ? (options.sourceURL + '').replace(/\s/g, ' ')
  37890. : ('lodash.templateSources[' + (++templateCounter) + ']')
  37891. ) + '\n';
  37892. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  37893. interpolateValue || (interpolateValue = esTemplateValue);
  37894. // Escape characters that can't be included in string literals.
  37895. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  37896. // Replace delimiters with snippets.
  37897. if (escapeValue) {
  37898. isEscaping = true;
  37899. source += "' +\n__e(" + escapeValue + ") +\n'";
  37900. }
  37901. if (evaluateValue) {
  37902. isEvaluating = true;
  37903. source += "';\n" + evaluateValue + ";\n__p += '";
  37904. }
  37905. if (interpolateValue) {
  37906. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  37907. }
  37908. index = offset + match.length;
  37909. // The JS engine embedded in Adobe products needs `match` returned in
  37910. // order to produce the correct `offset` value.
  37911. return match;
  37912. });
  37913. source += "';\n";
  37914. // If `variable` is not specified wrap a with-statement around the generated
  37915. // code to add the data object to the top of the scope chain.
  37916. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  37917. if (!variable) {
  37918. source = 'with (obj) {\n' + source + '\n}\n';
  37919. }
  37920. // Cleanup code by stripping empty strings.
  37921. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  37922. .replace(reEmptyStringMiddle, '$1')
  37923. .replace(reEmptyStringTrailing, '$1;');
  37924. // Frame code as the function body.
  37925. source = 'function(' + (variable || 'obj') + ') {\n' +
  37926. (variable
  37927. ? ''
  37928. : 'obj || (obj = {});\n'
  37929. ) +
  37930. "var __t, __p = ''" +
  37931. (isEscaping
  37932. ? ', __e = _.escape'
  37933. : ''
  37934. ) +
  37935. (isEvaluating
  37936. ? ', __j = Array.prototype.join;\n' +
  37937. "function print() { __p += __j.call(arguments, '') }\n"
  37938. : ';\n'
  37939. ) +
  37940. source +
  37941. 'return __p\n}';
  37942. var result = attempt(function() {
  37943. return Function(importsKeys, sourceURL + 'return ' + source)
  37944. .apply(undefined, importsValues);
  37945. });
  37946. // Provide the compiled function's source by its `toString` method or
  37947. // the `source` property as a convenience for inlining compiled templates.
  37948. result.source = source;
  37949. if (isError(result)) {
  37950. throw result;
  37951. }
  37952. return result;
  37953. }
  37954. /**
  37955. * Converts `string`, as a whole, to lower case just like
  37956. * [String#toLowerCase](https://mdn.io/toLowerCase).
  37957. *
  37958. * @static
  37959. * @memberOf _
  37960. * @since 4.0.0
  37961. * @category String
  37962. * @param {string} [string=''] The string to convert.
  37963. * @returns {string} Returns the lower cased string.
  37964. * @example
  37965. *
  37966. * _.toLower('--Foo-Bar--');
  37967. * // => '--foo-bar--'
  37968. *
  37969. * _.toLower('fooBar');
  37970. * // => 'foobar'
  37971. *
  37972. * _.toLower('__FOO_BAR__');
  37973. * // => '__foo_bar__'
  37974. */
  37975. function toLower(value) {
  37976. return toString(value).toLowerCase();
  37977. }
  37978. /**
  37979. * Converts `string`, as a whole, to upper case just like
  37980. * [String#toUpperCase](https://mdn.io/toUpperCase).
  37981. *
  37982. * @static
  37983. * @memberOf _
  37984. * @since 4.0.0
  37985. * @category String
  37986. * @param {string} [string=''] The string to convert.
  37987. * @returns {string} Returns the upper cased string.
  37988. * @example
  37989. *
  37990. * _.toUpper('--foo-bar--');
  37991. * // => '--FOO-BAR--'
  37992. *
  37993. * _.toUpper('fooBar');
  37994. * // => 'FOOBAR'
  37995. *
  37996. * _.toUpper('__foo_bar__');
  37997. * // => '__FOO_BAR__'
  37998. */
  37999. function toUpper(value) {
  38000. return toString(value).toUpperCase();
  38001. }
  38002. /**
  38003. * Removes leading and trailing whitespace or specified characters from `string`.
  38004. *
  38005. * @static
  38006. * @memberOf _
  38007. * @since 3.0.0
  38008. * @category String
  38009. * @param {string} [string=''] The string to trim.
  38010. * @param {string} [chars=whitespace] The characters to trim.
  38011. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  38012. * @returns {string} Returns the trimmed string.
  38013. * @example
  38014. *
  38015. * _.trim(' abc ');
  38016. * // => 'abc'
  38017. *
  38018. * _.trim('-_-abc-_-', '_-');
  38019. * // => 'abc'
  38020. *
  38021. * _.map([' foo ', ' bar '], _.trim);
  38022. * // => ['foo', 'bar']
  38023. */
  38024. function trim(string, chars, guard) {
  38025. string = toString(string);
  38026. if (string && (guard || chars === undefined)) {
  38027. return string.replace(reTrim, '');
  38028. }
  38029. if (!string || !(chars = baseToString(chars))) {
  38030. return string;
  38031. }
  38032. var strSymbols = stringToArray(string),
  38033. chrSymbols = stringToArray(chars),
  38034. start = charsStartIndex(strSymbols, chrSymbols),
  38035. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  38036. return castSlice(strSymbols, start, end).join('');
  38037. }
  38038. /**
  38039. * Removes trailing whitespace or specified characters from `string`.
  38040. *
  38041. * @static
  38042. * @memberOf _
  38043. * @since 4.0.0
  38044. * @category String
  38045. * @param {string} [string=''] The string to trim.
  38046. * @param {string} [chars=whitespace] The characters to trim.
  38047. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  38048. * @returns {string} Returns the trimmed string.
  38049. * @example
  38050. *
  38051. * _.trimEnd(' abc ');
  38052. * // => ' abc'
  38053. *
  38054. * _.trimEnd('-_-abc-_-', '_-');
  38055. * // => '-_-abc'
  38056. */
  38057. function trimEnd(string, chars, guard) {
  38058. string = toString(string);
  38059. if (string && (guard || chars === undefined)) {
  38060. return string.replace(reTrimEnd, '');
  38061. }
  38062. if (!string || !(chars = baseToString(chars))) {
  38063. return string;
  38064. }
  38065. var strSymbols = stringToArray(string),
  38066. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  38067. return castSlice(strSymbols, 0, end).join('');
  38068. }
  38069. /**
  38070. * Removes leading whitespace or specified characters from `string`.
  38071. *
  38072. * @static
  38073. * @memberOf _
  38074. * @since 4.0.0
  38075. * @category String
  38076. * @param {string} [string=''] The string to trim.
  38077. * @param {string} [chars=whitespace] The characters to trim.
  38078. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  38079. * @returns {string} Returns the trimmed string.
  38080. * @example
  38081. *
  38082. * _.trimStart(' abc ');
  38083. * // => 'abc '
  38084. *
  38085. * _.trimStart('-_-abc-_-', '_-');
  38086. * // => 'abc-_-'
  38087. */
  38088. function trimStart(string, chars, guard) {
  38089. string = toString(string);
  38090. if (string && (guard || chars === undefined)) {
  38091. return string.replace(reTrimStart, '');
  38092. }
  38093. if (!string || !(chars = baseToString(chars))) {
  38094. return string;
  38095. }
  38096. var strSymbols = stringToArray(string),
  38097. start = charsStartIndex(strSymbols, stringToArray(chars));
  38098. return castSlice(strSymbols, start).join('');
  38099. }
  38100. /**
  38101. * Truncates `string` if it's longer than the given maximum string length.
  38102. * The last characters of the truncated string are replaced with the omission
  38103. * string which defaults to "...".
  38104. *
  38105. * @static
  38106. * @memberOf _
  38107. * @since 4.0.0
  38108. * @category String
  38109. * @param {string} [string=''] The string to truncate.
  38110. * @param {Object} [options={}] The options object.
  38111. * @param {number} [options.length=30] The maximum string length.
  38112. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  38113. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  38114. * @returns {string} Returns the truncated string.
  38115. * @example
  38116. *
  38117. * _.truncate('hi-diddly-ho there, neighborino');
  38118. * // => 'hi-diddly-ho there, neighbo...'
  38119. *
  38120. * _.truncate('hi-diddly-ho there, neighborino', {
  38121. * 'length': 24,
  38122. * 'separator': ' '
  38123. * });
  38124. * // => 'hi-diddly-ho there,...'
  38125. *
  38126. * _.truncate('hi-diddly-ho there, neighborino', {
  38127. * 'length': 24,
  38128. * 'separator': /,? +/
  38129. * });
  38130. * // => 'hi-diddly-ho there...'
  38131. *
  38132. * _.truncate('hi-diddly-ho there, neighborino', {
  38133. * 'omission': ' [...]'
  38134. * });
  38135. * // => 'hi-diddly-ho there, neig [...]'
  38136. */
  38137. function truncate(string, options) {
  38138. var length = DEFAULT_TRUNC_LENGTH,
  38139. omission = DEFAULT_TRUNC_OMISSION;
  38140. if (isObject(options)) {
  38141. var separator = 'separator' in options ? options.separator : separator;
  38142. length = 'length' in options ? toInteger(options.length) : length;
  38143. omission = 'omission' in options ? baseToString(options.omission) : omission;
  38144. }
  38145. string = toString(string);
  38146. var strLength = string.length;
  38147. if (hasUnicode(string)) {
  38148. var strSymbols = stringToArray(string);
  38149. strLength = strSymbols.length;
  38150. }
  38151. if (length >= strLength) {
  38152. return string;
  38153. }
  38154. var end = length - stringSize(omission);
  38155. if (end < 1) {
  38156. return omission;
  38157. }
  38158. var result = strSymbols
  38159. ? castSlice(strSymbols, 0, end).join('')
  38160. : string.slice(0, end);
  38161. if (separator === undefined) {
  38162. return result + omission;
  38163. }
  38164. if (strSymbols) {
  38165. end += (result.length - end);
  38166. }
  38167. if (isRegExp(separator)) {
  38168. if (string.slice(end).search(separator)) {
  38169. var match,
  38170. substring = result;
  38171. if (!separator.global) {
  38172. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  38173. }
  38174. separator.lastIndex = 0;
  38175. while ((match = separator.exec(substring))) {
  38176. var newEnd = match.index;
  38177. }
  38178. result = result.slice(0, newEnd === undefined ? end : newEnd);
  38179. }
  38180. } else if (string.indexOf(baseToString(separator), end) != end) {
  38181. var index = result.lastIndexOf(separator);
  38182. if (index > -1) {
  38183. result = result.slice(0, index);
  38184. }
  38185. }
  38186. return result + omission;
  38187. }
  38188. /**
  38189. * The inverse of `_.escape`; this method converts the HTML entities
  38190. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  38191. * their corresponding characters.
  38192. *
  38193. * **Note:** No other HTML entities are unescaped. To unescape additional
  38194. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  38195. *
  38196. * @static
  38197. * @memberOf _
  38198. * @since 0.6.0
  38199. * @category String
  38200. * @param {string} [string=''] The string to unescape.
  38201. * @returns {string} Returns the unescaped string.
  38202. * @example
  38203. *
  38204. * _.unescape('fred, barney, &amp; pebbles');
  38205. * // => 'fred, barney, & pebbles'
  38206. */
  38207. function unescape(string) {
  38208. string = toString(string);
  38209. return (string && reHasEscapedHtml.test(string))
  38210. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  38211. : string;
  38212. }
  38213. /**
  38214. * Converts `string`, as space separated words, to upper case.
  38215. *
  38216. * @static
  38217. * @memberOf _
  38218. * @since 4.0.0
  38219. * @category String
  38220. * @param {string} [string=''] The string to convert.
  38221. * @returns {string} Returns the upper cased string.
  38222. * @example
  38223. *
  38224. * _.upperCase('--foo-bar');
  38225. * // => 'FOO BAR'
  38226. *
  38227. * _.upperCase('fooBar');
  38228. * // => 'FOO BAR'
  38229. *
  38230. * _.upperCase('__foo_bar__');
  38231. * // => 'FOO BAR'
  38232. */
  38233. var upperCase = createCompounder(function(result, word, index) {
  38234. return result + (index ? ' ' : '') + word.toUpperCase();
  38235. });
  38236. /**
  38237. * Converts the first character of `string` to upper case.
  38238. *
  38239. * @static
  38240. * @memberOf _
  38241. * @since 4.0.0
  38242. * @category String
  38243. * @param {string} [string=''] The string to convert.
  38244. * @returns {string} Returns the converted string.
  38245. * @example
  38246. *
  38247. * _.upperFirst('fred');
  38248. * // => 'Fred'
  38249. *
  38250. * _.upperFirst('FRED');
  38251. * // => 'FRED'
  38252. */
  38253. var upperFirst = createCaseFirst('toUpperCase');
  38254. /**
  38255. * Splits `string` into an array of its words.
  38256. *
  38257. * @static
  38258. * @memberOf _
  38259. * @since 3.0.0
  38260. * @category String
  38261. * @param {string} [string=''] The string to inspect.
  38262. * @param {RegExp|string} [pattern] The pattern to match words.
  38263. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  38264. * @returns {Array} Returns the words of `string`.
  38265. * @example
  38266. *
  38267. * _.words('fred, barney, & pebbles');
  38268. * // => ['fred', 'barney', 'pebbles']
  38269. *
  38270. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  38271. * // => ['fred', 'barney', '&', 'pebbles']
  38272. */
  38273. function words(string, pattern, guard) {
  38274. string = toString(string);
  38275. pattern = guard ? undefined : pattern;
  38276. if (pattern === undefined) {
  38277. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  38278. }
  38279. return string.match(pattern) || [];
  38280. }
  38281. /*------------------------------------------------------------------------*/
  38282. /**
  38283. * Attempts to invoke `func`, returning either the result or the caught error
  38284. * object. Any additional arguments are provided to `func` when it's invoked.
  38285. *
  38286. * @static
  38287. * @memberOf _
  38288. * @since 3.0.0
  38289. * @category Util
  38290. * @param {Function} func The function to attempt.
  38291. * @param {...*} [args] The arguments to invoke `func` with.
  38292. * @returns {*} Returns the `func` result or error object.
  38293. * @example
  38294. *
  38295. * // Avoid throwing errors for invalid selectors.
  38296. * var elements = _.attempt(function(selector) {
  38297. * return document.querySelectorAll(selector);
  38298. * }, '>_>');
  38299. *
  38300. * if (_.isError(elements)) {
  38301. * elements = [];
  38302. * }
  38303. */
  38304. var attempt = baseRest(function(func, args) {
  38305. try {
  38306. return apply(func, undefined, args);
  38307. } catch (e) {
  38308. return isError(e) ? e : new Error(e);
  38309. }
  38310. });
  38311. /**
  38312. * Binds methods of an object to the object itself, overwriting the existing
  38313. * method.
  38314. *
  38315. * **Note:** This method doesn't set the "length" property of bound functions.
  38316. *
  38317. * @static
  38318. * @since 0.1.0
  38319. * @memberOf _
  38320. * @category Util
  38321. * @param {Object} object The object to bind and assign the bound methods to.
  38322. * @param {...(string|string[])} methodNames The object method names to bind.
  38323. * @returns {Object} Returns `object`.
  38324. * @example
  38325. *
  38326. * var view = {
  38327. * 'label': 'docs',
  38328. * 'click': function() {
  38329. * console.log('clicked ' + this.label);
  38330. * }
  38331. * };
  38332. *
  38333. * _.bindAll(view, ['click']);
  38334. * jQuery(element).on('click', view.click);
  38335. * // => Logs 'clicked docs' when clicked.
  38336. */
  38337. var bindAll = flatRest(function(object, methodNames) {
  38338. arrayEach(methodNames, function(key) {
  38339. key = toKey(key);
  38340. baseAssignValue(object, key, bind(object[key], object));
  38341. });
  38342. return object;
  38343. });
  38344. /**
  38345. * Creates a function that iterates over `pairs` and invokes the corresponding
  38346. * function of the first predicate to return truthy. The predicate-function
  38347. * pairs are invoked with the `this` binding and arguments of the created
  38348. * function.
  38349. *
  38350. * @static
  38351. * @memberOf _
  38352. * @since 4.0.0
  38353. * @category Util
  38354. * @param {Array} pairs The predicate-function pairs.
  38355. * @returns {Function} Returns the new composite function.
  38356. * @example
  38357. *
  38358. * var func = _.cond([
  38359. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  38360. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  38361. * [_.stubTrue, _.constant('no match')]
  38362. * ]);
  38363. *
  38364. * func({ 'a': 1, 'b': 2 });
  38365. * // => 'matches A'
  38366. *
  38367. * func({ 'a': 0, 'b': 1 });
  38368. * // => 'matches B'
  38369. *
  38370. * func({ 'a': '1', 'b': '2' });
  38371. * // => 'no match'
  38372. */
  38373. function cond(pairs) {
  38374. var length = pairs == null ? 0 : pairs.length,
  38375. toIteratee = getIteratee();
  38376. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  38377. if (typeof pair[1] != 'function') {
  38378. throw new TypeError(FUNC_ERROR_TEXT);
  38379. }
  38380. return [toIteratee(pair[0]), pair[1]];
  38381. });
  38382. return baseRest(function(args) {
  38383. var index = -1;
  38384. while (++index < length) {
  38385. var pair = pairs[index];
  38386. if (apply(pair[0], this, args)) {
  38387. return apply(pair[1], this, args);
  38388. }
  38389. }
  38390. });
  38391. }
  38392. /**
  38393. * Creates a function that invokes the predicate properties of `source` with
  38394. * the corresponding property values of a given object, returning `true` if
  38395. * all predicates return truthy, else `false`.
  38396. *
  38397. * **Note:** The created function is equivalent to `_.conformsTo` with
  38398. * `source` partially applied.
  38399. *
  38400. * @static
  38401. * @memberOf _
  38402. * @since 4.0.0
  38403. * @category Util
  38404. * @param {Object} source The object of property predicates to conform to.
  38405. * @returns {Function} Returns the new spec function.
  38406. * @example
  38407. *
  38408. * var objects = [
  38409. * { 'a': 2, 'b': 1 },
  38410. * { 'a': 1, 'b': 2 }
  38411. * ];
  38412. *
  38413. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  38414. * // => [{ 'a': 1, 'b': 2 }]
  38415. */
  38416. function conforms(source) {
  38417. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  38418. }
  38419. /**
  38420. * Creates a function that returns `value`.
  38421. *
  38422. * @static
  38423. * @memberOf _
  38424. * @since 2.4.0
  38425. * @category Util
  38426. * @param {*} value The value to return from the new function.
  38427. * @returns {Function} Returns the new constant function.
  38428. * @example
  38429. *
  38430. * var objects = _.times(2, _.constant({ 'a': 1 }));
  38431. *
  38432. * console.log(objects);
  38433. * // => [{ 'a': 1 }, { 'a': 1 }]
  38434. *
  38435. * console.log(objects[0] === objects[1]);
  38436. * // => true
  38437. */
  38438. function constant(value) {
  38439. return function() {
  38440. return value;
  38441. };
  38442. }
  38443. /**
  38444. * Checks `value` to determine whether a default value should be returned in
  38445. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  38446. * or `undefined`.
  38447. *
  38448. * @static
  38449. * @memberOf _
  38450. * @since 4.14.0
  38451. * @category Util
  38452. * @param {*} value The value to check.
  38453. * @param {*} defaultValue The default value.
  38454. * @returns {*} Returns the resolved value.
  38455. * @example
  38456. *
  38457. * _.defaultTo(1, 10);
  38458. * // => 1
  38459. *
  38460. * _.defaultTo(undefined, 10);
  38461. * // => 10
  38462. */
  38463. function defaultTo(value, defaultValue) {
  38464. return (value == null || value !== value) ? defaultValue : value;
  38465. }
  38466. /**
  38467. * Creates a function that returns the result of invoking the given functions
  38468. * with the `this` binding of the created function, where each successive
  38469. * invocation is supplied the return value of the previous.
  38470. *
  38471. * @static
  38472. * @memberOf _
  38473. * @since 3.0.0
  38474. * @category Util
  38475. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  38476. * @returns {Function} Returns the new composite function.
  38477. * @see _.flowRight
  38478. * @example
  38479. *
  38480. * function square(n) {
  38481. * return n * n;
  38482. * }
  38483. *
  38484. * var addSquare = _.flow([_.add, square]);
  38485. * addSquare(1, 2);
  38486. * // => 9
  38487. */
  38488. var flow = createFlow();
  38489. /**
  38490. * This method is like `_.flow` except that it creates a function that
  38491. * invokes the given functions from right to left.
  38492. *
  38493. * @static
  38494. * @since 3.0.0
  38495. * @memberOf _
  38496. * @category Util
  38497. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  38498. * @returns {Function} Returns the new composite function.
  38499. * @see _.flow
  38500. * @example
  38501. *
  38502. * function square(n) {
  38503. * return n * n;
  38504. * }
  38505. *
  38506. * var addSquare = _.flowRight([square, _.add]);
  38507. * addSquare(1, 2);
  38508. * // => 9
  38509. */
  38510. var flowRight = createFlow(true);
  38511. /**
  38512. * This method returns the first argument it receives.
  38513. *
  38514. * @static
  38515. * @since 0.1.0
  38516. * @memberOf _
  38517. * @category Util
  38518. * @param {*} value Any value.
  38519. * @returns {*} Returns `value`.
  38520. * @example
  38521. *
  38522. * var object = { 'a': 1 };
  38523. *
  38524. * console.log(_.identity(object) === object);
  38525. * // => true
  38526. */
  38527. function identity(value) {
  38528. return value;
  38529. }
  38530. /**
  38531. * Creates a function that invokes `func` with the arguments of the created
  38532. * function. If `func` is a property name, the created function returns the
  38533. * property value for a given element. If `func` is an array or object, the
  38534. * created function returns `true` for elements that contain the equivalent
  38535. * source properties, otherwise it returns `false`.
  38536. *
  38537. * @static
  38538. * @since 4.0.0
  38539. * @memberOf _
  38540. * @category Util
  38541. * @param {*} [func=_.identity] The value to convert to a callback.
  38542. * @returns {Function} Returns the callback.
  38543. * @example
  38544. *
  38545. * var users = [
  38546. * { 'user': 'barney', 'age': 36, 'active': true },
  38547. * { 'user': 'fred', 'age': 40, 'active': false }
  38548. * ];
  38549. *
  38550. * // The `_.matches` iteratee shorthand.
  38551. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  38552. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  38553. *
  38554. * // The `_.matchesProperty` iteratee shorthand.
  38555. * _.filter(users, _.iteratee(['user', 'fred']));
  38556. * // => [{ 'user': 'fred', 'age': 40 }]
  38557. *
  38558. * // The `_.property` iteratee shorthand.
  38559. * _.map(users, _.iteratee('user'));
  38560. * // => ['barney', 'fred']
  38561. *
  38562. * // Create custom iteratee shorthands.
  38563. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  38564. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  38565. * return func.test(string);
  38566. * };
  38567. * });
  38568. *
  38569. * _.filter(['abc', 'def'], /ef/);
  38570. * // => ['def']
  38571. */
  38572. function iteratee(func) {
  38573. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  38574. }
  38575. /**
  38576. * Creates a function that performs a partial deep comparison between a given
  38577. * object and `source`, returning `true` if the given object has equivalent
  38578. * property values, else `false`.
  38579. *
  38580. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  38581. * partially applied.
  38582. *
  38583. * Partial comparisons will match empty array and empty object `source`
  38584. * values against any array or object value, respectively. See `_.isEqual`
  38585. * for a list of supported value comparisons.
  38586. *
  38587. * **Note:** Multiple values can be checked by combining several matchers
  38588. * using `_.overSome`
  38589. *
  38590. * @static
  38591. * @memberOf _
  38592. * @since 3.0.0
  38593. * @category Util
  38594. * @param {Object} source The object of property values to match.
  38595. * @returns {Function} Returns the new spec function.
  38596. * @example
  38597. *
  38598. * var objects = [
  38599. * { 'a': 1, 'b': 2, 'c': 3 },
  38600. * { 'a': 4, 'b': 5, 'c': 6 }
  38601. * ];
  38602. *
  38603. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  38604. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  38605. *
  38606. * // Checking for several possible values
  38607. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  38608. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  38609. */
  38610. function matches(source) {
  38611. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  38612. }
  38613. /**
  38614. * Creates a function that performs a partial deep comparison between the
  38615. * value at `path` of a given object to `srcValue`, returning `true` if the
  38616. * object value is equivalent, else `false`.
  38617. *
  38618. * **Note:** Partial comparisons will match empty array and empty object
  38619. * `srcValue` values against any array or object value, respectively. See
  38620. * `_.isEqual` for a list of supported value comparisons.
  38621. *
  38622. * **Note:** Multiple values can be checked by combining several matchers
  38623. * using `_.overSome`
  38624. *
  38625. * @static
  38626. * @memberOf _
  38627. * @since 3.2.0
  38628. * @category Util
  38629. * @param {Array|string} path The path of the property to get.
  38630. * @param {*} srcValue The value to match.
  38631. * @returns {Function} Returns the new spec function.
  38632. * @example
  38633. *
  38634. * var objects = [
  38635. * { 'a': 1, 'b': 2, 'c': 3 },
  38636. * { 'a': 4, 'b': 5, 'c': 6 }
  38637. * ];
  38638. *
  38639. * _.find(objects, _.matchesProperty('a', 4));
  38640. * // => { 'a': 4, 'b': 5, 'c': 6 }
  38641. *
  38642. * // Checking for several possible values
  38643. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  38644. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  38645. */
  38646. function matchesProperty(path, srcValue) {
  38647. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  38648. }
  38649. /**
  38650. * Creates a function that invokes the method at `path` of a given object.
  38651. * Any additional arguments are provided to the invoked method.
  38652. *
  38653. * @static
  38654. * @memberOf _
  38655. * @since 3.7.0
  38656. * @category Util
  38657. * @param {Array|string} path The path of the method to invoke.
  38658. * @param {...*} [args] The arguments to invoke the method with.
  38659. * @returns {Function} Returns the new invoker function.
  38660. * @example
  38661. *
  38662. * var objects = [
  38663. * { 'a': { 'b': _.constant(2) } },
  38664. * { 'a': { 'b': _.constant(1) } }
  38665. * ];
  38666. *
  38667. * _.map(objects, _.method('a.b'));
  38668. * // => [2, 1]
  38669. *
  38670. * _.map(objects, _.method(['a', 'b']));
  38671. * // => [2, 1]
  38672. */
  38673. var method = baseRest(function(path, args) {
  38674. return function(object) {
  38675. return baseInvoke(object, path, args);
  38676. };
  38677. });
  38678. /**
  38679. * The opposite of `_.method`; this method creates a function that invokes
  38680. * the method at a given path of `object`. Any additional arguments are
  38681. * provided to the invoked method.
  38682. *
  38683. * @static
  38684. * @memberOf _
  38685. * @since 3.7.0
  38686. * @category Util
  38687. * @param {Object} object The object to query.
  38688. * @param {...*} [args] The arguments to invoke the method with.
  38689. * @returns {Function} Returns the new invoker function.
  38690. * @example
  38691. *
  38692. * var array = _.times(3, _.constant),
  38693. * object = { 'a': array, 'b': array, 'c': array };
  38694. *
  38695. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  38696. * // => [2, 0]
  38697. *
  38698. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  38699. * // => [2, 0]
  38700. */
  38701. var methodOf = baseRest(function(object, args) {
  38702. return function(path) {
  38703. return baseInvoke(object, path, args);
  38704. };
  38705. });
  38706. /**
  38707. * Adds all own enumerable string keyed function properties of a source
  38708. * object to the destination object. If `object` is a function, then methods
  38709. * are added to its prototype as well.
  38710. *
  38711. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  38712. * avoid conflicts caused by modifying the original.
  38713. *
  38714. * @static
  38715. * @since 0.1.0
  38716. * @memberOf _
  38717. * @category Util
  38718. * @param {Function|Object} [object=lodash] The destination object.
  38719. * @param {Object} source The object of functions to add.
  38720. * @param {Object} [options={}] The options object.
  38721. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  38722. * @returns {Function|Object} Returns `object`.
  38723. * @example
  38724. *
  38725. * function vowels(string) {
  38726. * return _.filter(string, function(v) {
  38727. * return /[aeiou]/i.test(v);
  38728. * });
  38729. * }
  38730. *
  38731. * _.mixin({ 'vowels': vowels });
  38732. * _.vowels('fred');
  38733. * // => ['e']
  38734. *
  38735. * _('fred').vowels().value();
  38736. * // => ['e']
  38737. *
  38738. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  38739. * _('fred').vowels();
  38740. * // => ['e']
  38741. */
  38742. function mixin(object, source, options) {
  38743. var props = keys(source),
  38744. methodNames = baseFunctions(source, props);
  38745. if (options == null &&
  38746. !(isObject(source) && (methodNames.length || !props.length))) {
  38747. options = source;
  38748. source = object;
  38749. object = this;
  38750. methodNames = baseFunctions(source, keys(source));
  38751. }
  38752. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  38753. isFunc = isFunction(object);
  38754. arrayEach(methodNames, function(methodName) {
  38755. var func = source[methodName];
  38756. object[methodName] = func;
  38757. if (isFunc) {
  38758. object.prototype[methodName] = function() {
  38759. var chainAll = this.__chain__;
  38760. if (chain || chainAll) {
  38761. var result = object(this.__wrapped__),
  38762. actions = result.__actions__ = copyArray(this.__actions__);
  38763. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  38764. result.__chain__ = chainAll;
  38765. return result;
  38766. }
  38767. return func.apply(object, arrayPush([this.value()], arguments));
  38768. };
  38769. }
  38770. });
  38771. return object;
  38772. }
  38773. /**
  38774. * Reverts the `_` variable to its previous value and returns a reference to
  38775. * the `lodash` function.
  38776. *
  38777. * @static
  38778. * @since 0.1.0
  38779. * @memberOf _
  38780. * @category Util
  38781. * @returns {Function} Returns the `lodash` function.
  38782. * @example
  38783. *
  38784. * var lodash = _.noConflict();
  38785. */
  38786. function noConflict() {
  38787. if (root._ === this) {
  38788. root._ = oldDash;
  38789. }
  38790. return this;
  38791. }
  38792. /**
  38793. * This method returns `undefined`.
  38794. *
  38795. * @static
  38796. * @memberOf _
  38797. * @since 2.3.0
  38798. * @category Util
  38799. * @example
  38800. *
  38801. * _.times(2, _.noop);
  38802. * // => [undefined, undefined]
  38803. */
  38804. function noop() {
  38805. // No operation performed.
  38806. }
  38807. /**
  38808. * Creates a function that gets the argument at index `n`. If `n` is negative,
  38809. * the nth argument from the end is returned.
  38810. *
  38811. * @static
  38812. * @memberOf _
  38813. * @since 4.0.0
  38814. * @category Util
  38815. * @param {number} [n=0] The index of the argument to return.
  38816. * @returns {Function} Returns the new pass-thru function.
  38817. * @example
  38818. *
  38819. * var func = _.nthArg(1);
  38820. * func('a', 'b', 'c', 'd');
  38821. * // => 'b'
  38822. *
  38823. * var func = _.nthArg(-2);
  38824. * func('a', 'b', 'c', 'd');
  38825. * // => 'c'
  38826. */
  38827. function nthArg(n) {
  38828. n = toInteger(n);
  38829. return baseRest(function(args) {
  38830. return baseNth(args, n);
  38831. });
  38832. }
  38833. /**
  38834. * Creates a function that invokes `iteratees` with the arguments it receives
  38835. * and returns their results.
  38836. *
  38837. * @static
  38838. * @memberOf _
  38839. * @since 4.0.0
  38840. * @category Util
  38841. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  38842. * The iteratees to invoke.
  38843. * @returns {Function} Returns the new function.
  38844. * @example
  38845. *
  38846. * var func = _.over([Math.max, Math.min]);
  38847. *
  38848. * func(1, 2, 3, 4);
  38849. * // => [4, 1]
  38850. */
  38851. var over = createOver(arrayMap);
  38852. /**
  38853. * Creates a function that checks if **all** of the `predicates` return
  38854. * truthy when invoked with the arguments it receives.
  38855. *
  38856. * Following shorthands are possible for providing predicates.
  38857. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  38858. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  38859. *
  38860. * @static
  38861. * @memberOf _
  38862. * @since 4.0.0
  38863. * @category Util
  38864. * @param {...(Function|Function[])} [predicates=[_.identity]]
  38865. * The predicates to check.
  38866. * @returns {Function} Returns the new function.
  38867. * @example
  38868. *
  38869. * var func = _.overEvery([Boolean, isFinite]);
  38870. *
  38871. * func('1');
  38872. * // => true
  38873. *
  38874. * func(null);
  38875. * // => false
  38876. *
  38877. * func(NaN);
  38878. * // => false
  38879. */
  38880. var overEvery = createOver(arrayEvery);
  38881. /**
  38882. * Creates a function that checks if **any** of the `predicates` return
  38883. * truthy when invoked with the arguments it receives.
  38884. *
  38885. * Following shorthands are possible for providing predicates.
  38886. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  38887. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  38888. *
  38889. * @static
  38890. * @memberOf _
  38891. * @since 4.0.0
  38892. * @category Util
  38893. * @param {...(Function|Function[])} [predicates=[_.identity]]
  38894. * The predicates to check.
  38895. * @returns {Function} Returns the new function.
  38896. * @example
  38897. *
  38898. * var func = _.overSome([Boolean, isFinite]);
  38899. *
  38900. * func('1');
  38901. * // => true
  38902. *
  38903. * func(null);
  38904. * // => true
  38905. *
  38906. * func(NaN);
  38907. * // => false
  38908. *
  38909. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  38910. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  38911. */
  38912. var overSome = createOver(arraySome);
  38913. /**
  38914. * Creates a function that returns the value at `path` of a given object.
  38915. *
  38916. * @static
  38917. * @memberOf _
  38918. * @since 2.4.0
  38919. * @category Util
  38920. * @param {Array|string} path The path of the property to get.
  38921. * @returns {Function} Returns the new accessor function.
  38922. * @example
  38923. *
  38924. * var objects = [
  38925. * { 'a': { 'b': 2 } },
  38926. * { 'a': { 'b': 1 } }
  38927. * ];
  38928. *
  38929. * _.map(objects, _.property('a.b'));
  38930. * // => [2, 1]
  38931. *
  38932. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  38933. * // => [1, 2]
  38934. */
  38935. function property(path) {
  38936. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  38937. }
  38938. /**
  38939. * The opposite of `_.property`; this method creates a function that returns
  38940. * the value at a given path of `object`.
  38941. *
  38942. * @static
  38943. * @memberOf _
  38944. * @since 3.0.0
  38945. * @category Util
  38946. * @param {Object} object The object to query.
  38947. * @returns {Function} Returns the new accessor function.
  38948. * @example
  38949. *
  38950. * var array = [0, 1, 2],
  38951. * object = { 'a': array, 'b': array, 'c': array };
  38952. *
  38953. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  38954. * // => [2, 0]
  38955. *
  38956. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  38957. * // => [2, 0]
  38958. */
  38959. function propertyOf(object) {
  38960. return function(path) {
  38961. return object == null ? undefined : baseGet(object, path);
  38962. };
  38963. }
  38964. /**
  38965. * Creates an array of numbers (positive and/or negative) progressing from
  38966. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  38967. * `start` is specified without an `end` or `step`. If `end` is not specified,
  38968. * it's set to `start` with `start` then set to `0`.
  38969. *
  38970. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  38971. * floating-point values which can produce unexpected results.
  38972. *
  38973. * @static
  38974. * @since 0.1.0
  38975. * @memberOf _
  38976. * @category Util
  38977. * @param {number} [start=0] The start of the range.
  38978. * @param {number} end The end of the range.
  38979. * @param {number} [step=1] The value to increment or decrement by.
  38980. * @returns {Array} Returns the range of numbers.
  38981. * @see _.inRange, _.rangeRight
  38982. * @example
  38983. *
  38984. * _.range(4);
  38985. * // => [0, 1, 2, 3]
  38986. *
  38987. * _.range(-4);
  38988. * // => [0, -1, -2, -3]
  38989. *
  38990. * _.range(1, 5);
  38991. * // => [1, 2, 3, 4]
  38992. *
  38993. * _.range(0, 20, 5);
  38994. * // => [0, 5, 10, 15]
  38995. *
  38996. * _.range(0, -4, -1);
  38997. * // => [0, -1, -2, -3]
  38998. *
  38999. * _.range(1, 4, 0);
  39000. * // => [1, 1, 1]
  39001. *
  39002. * _.range(0);
  39003. * // => []
  39004. */
  39005. var range = createRange();
  39006. /**
  39007. * This method is like `_.range` except that it populates values in
  39008. * descending order.
  39009. *
  39010. * @static
  39011. * @memberOf _
  39012. * @since 4.0.0
  39013. * @category Util
  39014. * @param {number} [start=0] The start of the range.
  39015. * @param {number} end The end of the range.
  39016. * @param {number} [step=1] The value to increment or decrement by.
  39017. * @returns {Array} Returns the range of numbers.
  39018. * @see _.inRange, _.range
  39019. * @example
  39020. *
  39021. * _.rangeRight(4);
  39022. * // => [3, 2, 1, 0]
  39023. *
  39024. * _.rangeRight(-4);
  39025. * // => [-3, -2, -1, 0]
  39026. *
  39027. * _.rangeRight(1, 5);
  39028. * // => [4, 3, 2, 1]
  39029. *
  39030. * _.rangeRight(0, 20, 5);
  39031. * // => [15, 10, 5, 0]
  39032. *
  39033. * _.rangeRight(0, -4, -1);
  39034. * // => [-3, -2, -1, 0]
  39035. *
  39036. * _.rangeRight(1, 4, 0);
  39037. * // => [1, 1, 1]
  39038. *
  39039. * _.rangeRight(0);
  39040. * // => []
  39041. */
  39042. var rangeRight = createRange(true);
  39043. /**
  39044. * This method returns a new empty array.
  39045. *
  39046. * @static
  39047. * @memberOf _
  39048. * @since 4.13.0
  39049. * @category Util
  39050. * @returns {Array} Returns the new empty array.
  39051. * @example
  39052. *
  39053. * var arrays = _.times(2, _.stubArray);
  39054. *
  39055. * console.log(arrays);
  39056. * // => [[], []]
  39057. *
  39058. * console.log(arrays[0] === arrays[1]);
  39059. * // => false
  39060. */
  39061. function stubArray() {
  39062. return [];
  39063. }
  39064. /**
  39065. * This method returns `false`.
  39066. *
  39067. * @static
  39068. * @memberOf _
  39069. * @since 4.13.0
  39070. * @category Util
  39071. * @returns {boolean} Returns `false`.
  39072. * @example
  39073. *
  39074. * _.times(2, _.stubFalse);
  39075. * // => [false, false]
  39076. */
  39077. function stubFalse() {
  39078. return false;
  39079. }
  39080. /**
  39081. * This method returns a new empty object.
  39082. *
  39083. * @static
  39084. * @memberOf _
  39085. * @since 4.13.0
  39086. * @category Util
  39087. * @returns {Object} Returns the new empty object.
  39088. * @example
  39089. *
  39090. * var objects = _.times(2, _.stubObject);
  39091. *
  39092. * console.log(objects);
  39093. * // => [{}, {}]
  39094. *
  39095. * console.log(objects[0] === objects[1]);
  39096. * // => false
  39097. */
  39098. function stubObject() {
  39099. return {};
  39100. }
  39101. /**
  39102. * This method returns an empty string.
  39103. *
  39104. * @static
  39105. * @memberOf _
  39106. * @since 4.13.0
  39107. * @category Util
  39108. * @returns {string} Returns the empty string.
  39109. * @example
  39110. *
  39111. * _.times(2, _.stubString);
  39112. * // => ['', '']
  39113. */
  39114. function stubString() {
  39115. return '';
  39116. }
  39117. /**
  39118. * This method returns `true`.
  39119. *
  39120. * @static
  39121. * @memberOf _
  39122. * @since 4.13.0
  39123. * @category Util
  39124. * @returns {boolean} Returns `true`.
  39125. * @example
  39126. *
  39127. * _.times(2, _.stubTrue);
  39128. * // => [true, true]
  39129. */
  39130. function stubTrue() {
  39131. return true;
  39132. }
  39133. /**
  39134. * Invokes the iteratee `n` times, returning an array of the results of
  39135. * each invocation. The iteratee is invoked with one argument; (index).
  39136. *
  39137. * @static
  39138. * @since 0.1.0
  39139. * @memberOf _
  39140. * @category Util
  39141. * @param {number} n The number of times to invoke `iteratee`.
  39142. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  39143. * @returns {Array} Returns the array of results.
  39144. * @example
  39145. *
  39146. * _.times(3, String);
  39147. * // => ['0', '1', '2']
  39148. *
  39149. * _.times(4, _.constant(0));
  39150. * // => [0, 0, 0, 0]
  39151. */
  39152. function times(n, iteratee) {
  39153. n = toInteger(n);
  39154. if (n < 1 || n > MAX_SAFE_INTEGER) {
  39155. return [];
  39156. }
  39157. var index = MAX_ARRAY_LENGTH,
  39158. length = nativeMin(n, MAX_ARRAY_LENGTH);
  39159. iteratee = getIteratee(iteratee);
  39160. n -= MAX_ARRAY_LENGTH;
  39161. var result = baseTimes(length, iteratee);
  39162. while (++index < n) {
  39163. iteratee(index);
  39164. }
  39165. return result;
  39166. }
  39167. /**
  39168. * Converts `value` to a property path array.
  39169. *
  39170. * @static
  39171. * @memberOf _
  39172. * @since 4.0.0
  39173. * @category Util
  39174. * @param {*} value The value to convert.
  39175. * @returns {Array} Returns the new property path array.
  39176. * @example
  39177. *
  39178. * _.toPath('a.b.c');
  39179. * // => ['a', 'b', 'c']
  39180. *
  39181. * _.toPath('a[0].b.c');
  39182. * // => ['a', '0', 'b', 'c']
  39183. */
  39184. function toPath(value) {
  39185. if (isArray(value)) {
  39186. return arrayMap(value, toKey);
  39187. }
  39188. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  39189. }
  39190. /**
  39191. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  39192. *
  39193. * @static
  39194. * @since 0.1.0
  39195. * @memberOf _
  39196. * @category Util
  39197. * @param {string} [prefix=''] The value to prefix the ID with.
  39198. * @returns {string} Returns the unique ID.
  39199. * @example
  39200. *
  39201. * _.uniqueId('contact_');
  39202. * // => 'contact_104'
  39203. *
  39204. * _.uniqueId();
  39205. * // => '105'
  39206. */
  39207. function uniqueId(prefix) {
  39208. var id = ++idCounter;
  39209. return toString(prefix) + id;
  39210. }
  39211. /*------------------------------------------------------------------------*/
  39212. /**
  39213. * Adds two numbers.
  39214. *
  39215. * @static
  39216. * @memberOf _
  39217. * @since 3.4.0
  39218. * @category Math
  39219. * @param {number} augend The first number in an addition.
  39220. * @param {number} addend The second number in an addition.
  39221. * @returns {number} Returns the total.
  39222. * @example
  39223. *
  39224. * _.add(6, 4);
  39225. * // => 10
  39226. */
  39227. var add = createMathOperation(function(augend, addend) {
  39228. return augend + addend;
  39229. }, 0);
  39230. /**
  39231. * Computes `number` rounded up to `precision`.
  39232. *
  39233. * @static
  39234. * @memberOf _
  39235. * @since 3.10.0
  39236. * @category Math
  39237. * @param {number} number The number to round up.
  39238. * @param {number} [precision=0] The precision to round up to.
  39239. * @returns {number} Returns the rounded up number.
  39240. * @example
  39241. *
  39242. * _.ceil(4.006);
  39243. * // => 5
  39244. *
  39245. * _.ceil(6.004, 2);
  39246. * // => 6.01
  39247. *
  39248. * _.ceil(6040, -2);
  39249. * // => 6100
  39250. */
  39251. var ceil = createRound('ceil');
  39252. /**
  39253. * Divide two numbers.
  39254. *
  39255. * @static
  39256. * @memberOf _
  39257. * @since 4.7.0
  39258. * @category Math
  39259. * @param {number} dividend The first number in a division.
  39260. * @param {number} divisor The second number in a division.
  39261. * @returns {number} Returns the quotient.
  39262. * @example
  39263. *
  39264. * _.divide(6, 4);
  39265. * // => 1.5
  39266. */
  39267. var divide = createMathOperation(function(dividend, divisor) {
  39268. return dividend / divisor;
  39269. }, 1);
  39270. /**
  39271. * Computes `number` rounded down to `precision`.
  39272. *
  39273. * @static
  39274. * @memberOf _
  39275. * @since 3.10.0
  39276. * @category Math
  39277. * @param {number} number The number to round down.
  39278. * @param {number} [precision=0] The precision to round down to.
  39279. * @returns {number} Returns the rounded down number.
  39280. * @example
  39281. *
  39282. * _.floor(4.006);
  39283. * // => 4
  39284. *
  39285. * _.floor(0.046, 2);
  39286. * // => 0.04
  39287. *
  39288. * _.floor(4060, -2);
  39289. * // => 4000
  39290. */
  39291. var floor = createRound('floor');
  39292. /**
  39293. * Computes the maximum value of `array`. If `array` is empty or falsey,
  39294. * `undefined` is returned.
  39295. *
  39296. * @static
  39297. * @since 0.1.0
  39298. * @memberOf _
  39299. * @category Math
  39300. * @param {Array} array The array to iterate over.
  39301. * @returns {*} Returns the maximum value.
  39302. * @example
  39303. *
  39304. * _.max([4, 2, 8, 6]);
  39305. * // => 8
  39306. *
  39307. * _.max([]);
  39308. * // => undefined
  39309. */
  39310. function max(array) {
  39311. return (array && array.length)
  39312. ? baseExtremum(array, identity, baseGt)
  39313. : undefined;
  39314. }
  39315. /**
  39316. * This method is like `_.max` except that it accepts `iteratee` which is
  39317. * invoked for each element in `array` to generate the criterion by which
  39318. * the value is ranked. The iteratee is invoked with one argument: (value).
  39319. *
  39320. * @static
  39321. * @memberOf _
  39322. * @since 4.0.0
  39323. * @category Math
  39324. * @param {Array} array The array to iterate over.
  39325. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  39326. * @returns {*} Returns the maximum value.
  39327. * @example
  39328. *
  39329. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  39330. *
  39331. * _.maxBy(objects, function(o) { return o.n; });
  39332. * // => { 'n': 2 }
  39333. *
  39334. * // The `_.property` iteratee shorthand.
  39335. * _.maxBy(objects, 'n');
  39336. * // => { 'n': 2 }
  39337. */
  39338. function maxBy(array, iteratee) {
  39339. return (array && array.length)
  39340. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  39341. : undefined;
  39342. }
  39343. /**
  39344. * Computes the mean of the values in `array`.
  39345. *
  39346. * @static
  39347. * @memberOf _
  39348. * @since 4.0.0
  39349. * @category Math
  39350. * @param {Array} array The array to iterate over.
  39351. * @returns {number} Returns the mean.
  39352. * @example
  39353. *
  39354. * _.mean([4, 2, 8, 6]);
  39355. * // => 5
  39356. */
  39357. function mean(array) {
  39358. return baseMean(array, identity);
  39359. }
  39360. /**
  39361. * This method is like `_.mean` except that it accepts `iteratee` which is
  39362. * invoked for each element in `array` to generate the value to be averaged.
  39363. * The iteratee is invoked with one argument: (value).
  39364. *
  39365. * @static
  39366. * @memberOf _
  39367. * @since 4.7.0
  39368. * @category Math
  39369. * @param {Array} array The array to iterate over.
  39370. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  39371. * @returns {number} Returns the mean.
  39372. * @example
  39373. *
  39374. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  39375. *
  39376. * _.meanBy(objects, function(o) { return o.n; });
  39377. * // => 5
  39378. *
  39379. * // The `_.property` iteratee shorthand.
  39380. * _.meanBy(objects, 'n');
  39381. * // => 5
  39382. */
  39383. function meanBy(array, iteratee) {
  39384. return baseMean(array, getIteratee(iteratee, 2));
  39385. }
  39386. /**
  39387. * Computes the minimum value of `array`. If `array` is empty or falsey,
  39388. * `undefined` is returned.
  39389. *
  39390. * @static
  39391. * @since 0.1.0
  39392. * @memberOf _
  39393. * @category Math
  39394. * @param {Array} array The array to iterate over.
  39395. * @returns {*} Returns the minimum value.
  39396. * @example
  39397. *
  39398. * _.min([4, 2, 8, 6]);
  39399. * // => 2
  39400. *
  39401. * _.min([]);
  39402. * // => undefined
  39403. */
  39404. function min(array) {
  39405. return (array && array.length)
  39406. ? baseExtremum(array, identity, baseLt)
  39407. : undefined;
  39408. }
  39409. /**
  39410. * This method is like `_.min` except that it accepts `iteratee` which is
  39411. * invoked for each element in `array` to generate the criterion by which
  39412. * the value is ranked. The iteratee is invoked with one argument: (value).
  39413. *
  39414. * @static
  39415. * @memberOf _
  39416. * @since 4.0.0
  39417. * @category Math
  39418. * @param {Array} array The array to iterate over.
  39419. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  39420. * @returns {*} Returns the minimum value.
  39421. * @example
  39422. *
  39423. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  39424. *
  39425. * _.minBy(objects, function(o) { return o.n; });
  39426. * // => { 'n': 1 }
  39427. *
  39428. * // The `_.property` iteratee shorthand.
  39429. * _.minBy(objects, 'n');
  39430. * // => { 'n': 1 }
  39431. */
  39432. function minBy(array, iteratee) {
  39433. return (array && array.length)
  39434. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  39435. : undefined;
  39436. }
  39437. /**
  39438. * Multiply two numbers.
  39439. *
  39440. * @static
  39441. * @memberOf _
  39442. * @since 4.7.0
  39443. * @category Math
  39444. * @param {number} multiplier The first number in a multiplication.
  39445. * @param {number} multiplicand The second number in a multiplication.
  39446. * @returns {number} Returns the product.
  39447. * @example
  39448. *
  39449. * _.multiply(6, 4);
  39450. * // => 24
  39451. */
  39452. var multiply = createMathOperation(function(multiplier, multiplicand) {
  39453. return multiplier * multiplicand;
  39454. }, 1);
  39455. /**
  39456. * Computes `number` rounded to `precision`.
  39457. *
  39458. * @static
  39459. * @memberOf _
  39460. * @since 3.10.0
  39461. * @category Math
  39462. * @param {number} number The number to round.
  39463. * @param {number} [precision=0] The precision to round to.
  39464. * @returns {number} Returns the rounded number.
  39465. * @example
  39466. *
  39467. * _.round(4.006);
  39468. * // => 4
  39469. *
  39470. * _.round(4.006, 2);
  39471. * // => 4.01
  39472. *
  39473. * _.round(4060, -2);
  39474. * // => 4100
  39475. */
  39476. var round = createRound('round');
  39477. /**
  39478. * Subtract two numbers.
  39479. *
  39480. * @static
  39481. * @memberOf _
  39482. * @since 4.0.0
  39483. * @category Math
  39484. * @param {number} minuend The first number in a subtraction.
  39485. * @param {number} subtrahend The second number in a subtraction.
  39486. * @returns {number} Returns the difference.
  39487. * @example
  39488. *
  39489. * _.subtract(6, 4);
  39490. * // => 2
  39491. */
  39492. var subtract = createMathOperation(function(minuend, subtrahend) {
  39493. return minuend - subtrahend;
  39494. }, 0);
  39495. /**
  39496. * Computes the sum of the values in `array`.
  39497. *
  39498. * @static
  39499. * @memberOf _
  39500. * @since 3.4.0
  39501. * @category Math
  39502. * @param {Array} array The array to iterate over.
  39503. * @returns {number} Returns the sum.
  39504. * @example
  39505. *
  39506. * _.sum([4, 2, 8, 6]);
  39507. * // => 20
  39508. */
  39509. function sum(array) {
  39510. return (array && array.length)
  39511. ? baseSum(array, identity)
  39512. : 0;
  39513. }
  39514. /**
  39515. * This method is like `_.sum` except that it accepts `iteratee` which is
  39516. * invoked for each element in `array` to generate the value to be summed.
  39517. * The iteratee is invoked with one argument: (value).
  39518. *
  39519. * @static
  39520. * @memberOf _
  39521. * @since 4.0.0
  39522. * @category Math
  39523. * @param {Array} array The array to iterate over.
  39524. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  39525. * @returns {number} Returns the sum.
  39526. * @example
  39527. *
  39528. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  39529. *
  39530. * _.sumBy(objects, function(o) { return o.n; });
  39531. * // => 20
  39532. *
  39533. * // The `_.property` iteratee shorthand.
  39534. * _.sumBy(objects, 'n');
  39535. * // => 20
  39536. */
  39537. function sumBy(array, iteratee) {
  39538. return (array && array.length)
  39539. ? baseSum(array, getIteratee(iteratee, 2))
  39540. : 0;
  39541. }
  39542. /*------------------------------------------------------------------------*/
  39543. // Add methods that return wrapped values in chain sequences.
  39544. lodash.after = after;
  39545. lodash.ary = ary;
  39546. lodash.assign = assign;
  39547. lodash.assignIn = assignIn;
  39548. lodash.assignInWith = assignInWith;
  39549. lodash.assignWith = assignWith;
  39550. lodash.at = at;
  39551. lodash.before = before;
  39552. lodash.bind = bind;
  39553. lodash.bindAll = bindAll;
  39554. lodash.bindKey = bindKey;
  39555. lodash.castArray = castArray;
  39556. lodash.chain = chain;
  39557. lodash.chunk = chunk;
  39558. lodash.compact = compact;
  39559. lodash.concat = concat;
  39560. lodash.cond = cond;
  39561. lodash.conforms = conforms;
  39562. lodash.constant = constant;
  39563. lodash.countBy = countBy;
  39564. lodash.create = create;
  39565. lodash.curry = curry;
  39566. lodash.curryRight = curryRight;
  39567. lodash.debounce = debounce;
  39568. lodash.defaults = defaults;
  39569. lodash.defaultsDeep = defaultsDeep;
  39570. lodash.defer = defer;
  39571. lodash.delay = delay;
  39572. lodash.difference = difference;
  39573. lodash.differenceBy = differenceBy;
  39574. lodash.differenceWith = differenceWith;
  39575. lodash.drop = drop;
  39576. lodash.dropRight = dropRight;
  39577. lodash.dropRightWhile = dropRightWhile;
  39578. lodash.dropWhile = dropWhile;
  39579. lodash.fill = fill;
  39580. lodash.filter = filter;
  39581. lodash.flatMap = flatMap;
  39582. lodash.flatMapDeep = flatMapDeep;
  39583. lodash.flatMapDepth = flatMapDepth;
  39584. lodash.flatten = flatten;
  39585. lodash.flattenDeep = flattenDeep;
  39586. lodash.flattenDepth = flattenDepth;
  39587. lodash.flip = flip;
  39588. lodash.flow = flow;
  39589. lodash.flowRight = flowRight;
  39590. lodash.fromPairs = fromPairs;
  39591. lodash.functions = functions;
  39592. lodash.functionsIn = functionsIn;
  39593. lodash.groupBy = groupBy;
  39594. lodash.initial = initial;
  39595. lodash.intersection = intersection;
  39596. lodash.intersectionBy = intersectionBy;
  39597. lodash.intersectionWith = intersectionWith;
  39598. lodash.invert = invert;
  39599. lodash.invertBy = invertBy;
  39600. lodash.invokeMap = invokeMap;
  39601. lodash.iteratee = iteratee;
  39602. lodash.keyBy = keyBy;
  39603. lodash.keys = keys;
  39604. lodash.keysIn = keysIn;
  39605. lodash.map = map;
  39606. lodash.mapKeys = mapKeys;
  39607. lodash.mapValues = mapValues;
  39608. lodash.matches = matches;
  39609. lodash.matchesProperty = matchesProperty;
  39610. lodash.memoize = memoize;
  39611. lodash.merge = merge;
  39612. lodash.mergeWith = mergeWith;
  39613. lodash.method = method;
  39614. lodash.methodOf = methodOf;
  39615. lodash.mixin = mixin;
  39616. lodash.negate = negate;
  39617. lodash.nthArg = nthArg;
  39618. lodash.omit = omit;
  39619. lodash.omitBy = omitBy;
  39620. lodash.once = once;
  39621. lodash.orderBy = orderBy;
  39622. lodash.over = over;
  39623. lodash.overArgs = overArgs;
  39624. lodash.overEvery = overEvery;
  39625. lodash.overSome = overSome;
  39626. lodash.partial = partial;
  39627. lodash.partialRight = partialRight;
  39628. lodash.partition = partition;
  39629. lodash.pick = pick;
  39630. lodash.pickBy = pickBy;
  39631. lodash.property = property;
  39632. lodash.propertyOf = propertyOf;
  39633. lodash.pull = pull;
  39634. lodash.pullAll = pullAll;
  39635. lodash.pullAllBy = pullAllBy;
  39636. lodash.pullAllWith = pullAllWith;
  39637. lodash.pullAt = pullAt;
  39638. lodash.range = range;
  39639. lodash.rangeRight = rangeRight;
  39640. lodash.rearg = rearg;
  39641. lodash.reject = reject;
  39642. lodash.remove = remove;
  39643. lodash.rest = rest;
  39644. lodash.reverse = reverse;
  39645. lodash.sampleSize = sampleSize;
  39646. lodash.set = set;
  39647. lodash.setWith = setWith;
  39648. lodash.shuffle = shuffle;
  39649. lodash.slice = slice;
  39650. lodash.sortBy = sortBy;
  39651. lodash.sortedUniq = sortedUniq;
  39652. lodash.sortedUniqBy = sortedUniqBy;
  39653. lodash.split = split;
  39654. lodash.spread = spread;
  39655. lodash.tail = tail;
  39656. lodash.take = take;
  39657. lodash.takeRight = takeRight;
  39658. lodash.takeRightWhile = takeRightWhile;
  39659. lodash.takeWhile = takeWhile;
  39660. lodash.tap = tap;
  39661. lodash.throttle = throttle;
  39662. lodash.thru = thru;
  39663. lodash.toArray = toArray;
  39664. lodash.toPairs = toPairs;
  39665. lodash.toPairsIn = toPairsIn;
  39666. lodash.toPath = toPath;
  39667. lodash.toPlainObject = toPlainObject;
  39668. lodash.transform = transform;
  39669. lodash.unary = unary;
  39670. lodash.union = union;
  39671. lodash.unionBy = unionBy;
  39672. lodash.unionWith = unionWith;
  39673. lodash.uniq = uniq;
  39674. lodash.uniqBy = uniqBy;
  39675. lodash.uniqWith = uniqWith;
  39676. lodash.unset = unset;
  39677. lodash.unzip = unzip;
  39678. lodash.unzipWith = unzipWith;
  39679. lodash.update = update;
  39680. lodash.updateWith = updateWith;
  39681. lodash.values = values;
  39682. lodash.valuesIn = valuesIn;
  39683. lodash.without = without;
  39684. lodash.words = words;
  39685. lodash.wrap = wrap;
  39686. lodash.xor = xor;
  39687. lodash.xorBy = xorBy;
  39688. lodash.xorWith = xorWith;
  39689. lodash.zip = zip;
  39690. lodash.zipObject = zipObject;
  39691. lodash.zipObjectDeep = zipObjectDeep;
  39692. lodash.zipWith = zipWith;
  39693. // Add aliases.
  39694. lodash.entries = toPairs;
  39695. lodash.entriesIn = toPairsIn;
  39696. lodash.extend = assignIn;
  39697. lodash.extendWith = assignInWith;
  39698. // Add methods to `lodash.prototype`.
  39699. mixin(lodash, lodash);
  39700. /*------------------------------------------------------------------------*/
  39701. // Add methods that return unwrapped values in chain sequences.
  39702. lodash.add = add;
  39703. lodash.attempt = attempt;
  39704. lodash.camelCase = camelCase;
  39705. lodash.capitalize = capitalize;
  39706. lodash.ceil = ceil;
  39707. lodash.clamp = clamp;
  39708. lodash.clone = clone;
  39709. lodash.cloneDeep = cloneDeep;
  39710. lodash.cloneDeepWith = cloneDeepWith;
  39711. lodash.cloneWith = cloneWith;
  39712. lodash.conformsTo = conformsTo;
  39713. lodash.deburr = deburr;
  39714. lodash.defaultTo = defaultTo;
  39715. lodash.divide = divide;
  39716. lodash.endsWith = endsWith;
  39717. lodash.eq = eq;
  39718. lodash.escape = escape;
  39719. lodash.escapeRegExp = escapeRegExp;
  39720. lodash.every = every;
  39721. lodash.find = find;
  39722. lodash.findIndex = findIndex;
  39723. lodash.findKey = findKey;
  39724. lodash.findLast = findLast;
  39725. lodash.findLastIndex = findLastIndex;
  39726. lodash.findLastKey = findLastKey;
  39727. lodash.floor = floor;
  39728. lodash.forEach = forEach;
  39729. lodash.forEachRight = forEachRight;
  39730. lodash.forIn = forIn;
  39731. lodash.forInRight = forInRight;
  39732. lodash.forOwn = forOwn;
  39733. lodash.forOwnRight = forOwnRight;
  39734. lodash.get = get;
  39735. lodash.gt = gt;
  39736. lodash.gte = gte;
  39737. lodash.has = has;
  39738. lodash.hasIn = hasIn;
  39739. lodash.head = head;
  39740. lodash.identity = identity;
  39741. lodash.includes = includes;
  39742. lodash.indexOf = indexOf;
  39743. lodash.inRange = inRange;
  39744. lodash.invoke = invoke;
  39745. lodash.isArguments = isArguments;
  39746. lodash.isArray = isArray;
  39747. lodash.isArrayBuffer = isArrayBuffer;
  39748. lodash.isArrayLike = isArrayLike;
  39749. lodash.isArrayLikeObject = isArrayLikeObject;
  39750. lodash.isBoolean = isBoolean;
  39751. lodash.isBuffer = isBuffer;
  39752. lodash.isDate = isDate;
  39753. lodash.isElement = isElement;
  39754. lodash.isEmpty = isEmpty;
  39755. lodash.isEqual = isEqual;
  39756. lodash.isEqualWith = isEqualWith;
  39757. lodash.isError = isError;
  39758. lodash.isFinite = isFinite;
  39759. lodash.isFunction = isFunction;
  39760. lodash.isInteger = isInteger;
  39761. lodash.isLength = isLength;
  39762. lodash.isMap = isMap;
  39763. lodash.isMatch = isMatch;
  39764. lodash.isMatchWith = isMatchWith;
  39765. lodash.isNaN = isNaN;
  39766. lodash.isNative = isNative;
  39767. lodash.isNil = isNil;
  39768. lodash.isNull = isNull;
  39769. lodash.isNumber = isNumber;
  39770. lodash.isObject = isObject;
  39771. lodash.isObjectLike = isObjectLike;
  39772. lodash.isPlainObject = isPlainObject;
  39773. lodash.isRegExp = isRegExp;
  39774. lodash.isSafeInteger = isSafeInteger;
  39775. lodash.isSet = isSet;
  39776. lodash.isString = isString;
  39777. lodash.isSymbol = isSymbol;
  39778. lodash.isTypedArray = isTypedArray;
  39779. lodash.isUndefined = isUndefined;
  39780. lodash.isWeakMap = isWeakMap;
  39781. lodash.isWeakSet = isWeakSet;
  39782. lodash.join = join;
  39783. lodash.kebabCase = kebabCase;
  39784. lodash.last = last;
  39785. lodash.lastIndexOf = lastIndexOf;
  39786. lodash.lowerCase = lowerCase;
  39787. lodash.lowerFirst = lowerFirst;
  39788. lodash.lt = lt;
  39789. lodash.lte = lte;
  39790. lodash.max = max;
  39791. lodash.maxBy = maxBy;
  39792. lodash.mean = mean;
  39793. lodash.meanBy = meanBy;
  39794. lodash.min = min;
  39795. lodash.minBy = minBy;
  39796. lodash.stubArray = stubArray;
  39797. lodash.stubFalse = stubFalse;
  39798. lodash.stubObject = stubObject;
  39799. lodash.stubString = stubString;
  39800. lodash.stubTrue = stubTrue;
  39801. lodash.multiply = multiply;
  39802. lodash.nth = nth;
  39803. lodash.noConflict = noConflict;
  39804. lodash.noop = noop;
  39805. lodash.now = now;
  39806. lodash.pad = pad;
  39807. lodash.padEnd = padEnd;
  39808. lodash.padStart = padStart;
  39809. lodash.parseInt = parseInt;
  39810. lodash.random = random;
  39811. lodash.reduce = reduce;
  39812. lodash.reduceRight = reduceRight;
  39813. lodash.repeat = repeat;
  39814. lodash.replace = replace;
  39815. lodash.result = result;
  39816. lodash.round = round;
  39817. lodash.runInContext = runInContext;
  39818. lodash.sample = sample;
  39819. lodash.size = size;
  39820. lodash.snakeCase = snakeCase;
  39821. lodash.some = some;
  39822. lodash.sortedIndex = sortedIndex;
  39823. lodash.sortedIndexBy = sortedIndexBy;
  39824. lodash.sortedIndexOf = sortedIndexOf;
  39825. lodash.sortedLastIndex = sortedLastIndex;
  39826. lodash.sortedLastIndexBy = sortedLastIndexBy;
  39827. lodash.sortedLastIndexOf = sortedLastIndexOf;
  39828. lodash.startCase = startCase;
  39829. lodash.startsWith = startsWith;
  39830. lodash.subtract = subtract;
  39831. lodash.sum = sum;
  39832. lodash.sumBy = sumBy;
  39833. lodash.template = template;
  39834. lodash.times = times;
  39835. lodash.toFinite = toFinite;
  39836. lodash.toInteger = toInteger;
  39837. lodash.toLength = toLength;
  39838. lodash.toLower = toLower;
  39839. lodash.toNumber = toNumber;
  39840. lodash.toSafeInteger = toSafeInteger;
  39841. lodash.toString = toString;
  39842. lodash.toUpper = toUpper;
  39843. lodash.trim = trim;
  39844. lodash.trimEnd = trimEnd;
  39845. lodash.trimStart = trimStart;
  39846. lodash.truncate = truncate;
  39847. lodash.unescape = unescape;
  39848. lodash.uniqueId = uniqueId;
  39849. lodash.upperCase = upperCase;
  39850. lodash.upperFirst = upperFirst;
  39851. // Add aliases.
  39852. lodash.each = forEach;
  39853. lodash.eachRight = forEachRight;
  39854. lodash.first = head;
  39855. mixin(lodash, (function() {
  39856. var source = {};
  39857. baseForOwn(lodash, function(func, methodName) {
  39858. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  39859. source[methodName] = func;
  39860. }
  39861. });
  39862. return source;
  39863. }()), { 'chain': false });
  39864. /*------------------------------------------------------------------------*/
  39865. /**
  39866. * The semantic version number.
  39867. *
  39868. * @static
  39869. * @memberOf _
  39870. * @type {string}
  39871. */
  39872. lodash.VERSION = VERSION;
  39873. // Assign default placeholders.
  39874. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  39875. lodash[methodName].placeholder = lodash;
  39876. });
  39877. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  39878. arrayEach(['drop', 'take'], function(methodName, index) {
  39879. LazyWrapper.prototype[methodName] = function(n) {
  39880. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  39881. var result = (this.__filtered__ && !index)
  39882. ? new LazyWrapper(this)
  39883. : this.clone();
  39884. if (result.__filtered__) {
  39885. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  39886. } else {
  39887. result.__views__.push({
  39888. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  39889. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  39890. });
  39891. }
  39892. return result;
  39893. };
  39894. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  39895. return this.reverse()[methodName](n).reverse();
  39896. };
  39897. });
  39898. // Add `LazyWrapper` methods that accept an `iteratee` value.
  39899. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  39900. var type = index + 1,
  39901. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  39902. LazyWrapper.prototype[methodName] = function(iteratee) {
  39903. var result = this.clone();
  39904. result.__iteratees__.push({
  39905. 'iteratee': getIteratee(iteratee, 3),
  39906. 'type': type
  39907. });
  39908. result.__filtered__ = result.__filtered__ || isFilter;
  39909. return result;
  39910. };
  39911. });
  39912. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  39913. arrayEach(['head', 'last'], function(methodName, index) {
  39914. var takeName = 'take' + (index ? 'Right' : '');
  39915. LazyWrapper.prototype[methodName] = function() {
  39916. return this[takeName](1).value()[0];
  39917. };
  39918. });
  39919. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  39920. arrayEach(['initial', 'tail'], function(methodName, index) {
  39921. var dropName = 'drop' + (index ? '' : 'Right');
  39922. LazyWrapper.prototype[methodName] = function() {
  39923. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  39924. };
  39925. });
  39926. LazyWrapper.prototype.compact = function() {
  39927. return this.filter(identity);
  39928. };
  39929. LazyWrapper.prototype.find = function(predicate) {
  39930. return this.filter(predicate).head();
  39931. };
  39932. LazyWrapper.prototype.findLast = function(predicate) {
  39933. return this.reverse().find(predicate);
  39934. };
  39935. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  39936. if (typeof path == 'function') {
  39937. return new LazyWrapper(this);
  39938. }
  39939. return this.map(function(value) {
  39940. return baseInvoke(value, path, args);
  39941. });
  39942. });
  39943. LazyWrapper.prototype.reject = function(predicate) {
  39944. return this.filter(negate(getIteratee(predicate)));
  39945. };
  39946. LazyWrapper.prototype.slice = function(start, end) {
  39947. start = toInteger(start);
  39948. var result = this;
  39949. if (result.__filtered__ && (start > 0 || end < 0)) {
  39950. return new LazyWrapper(result);
  39951. }
  39952. if (start < 0) {
  39953. result = result.takeRight(-start);
  39954. } else if (start) {
  39955. result = result.drop(start);
  39956. }
  39957. if (end !== undefined) {
  39958. end = toInteger(end);
  39959. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  39960. }
  39961. return result;
  39962. };
  39963. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  39964. return this.reverse().takeWhile(predicate).reverse();
  39965. };
  39966. LazyWrapper.prototype.toArray = function() {
  39967. return this.take(MAX_ARRAY_LENGTH);
  39968. };
  39969. // Add `LazyWrapper` methods to `lodash.prototype`.
  39970. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  39971. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  39972. isTaker = /^(?:head|last)$/.test(methodName),
  39973. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  39974. retUnwrapped = isTaker || /^find/.test(methodName);
  39975. if (!lodashFunc) {
  39976. return;
  39977. }
  39978. lodash.prototype[methodName] = function() {
  39979. var value = this.__wrapped__,
  39980. args = isTaker ? [1] : arguments,
  39981. isLazy = value instanceof LazyWrapper,
  39982. iteratee = args[0],
  39983. useLazy = isLazy || isArray(value);
  39984. var interceptor = function(value) {
  39985. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  39986. return (isTaker && chainAll) ? result[0] : result;
  39987. };
  39988. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  39989. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  39990. isLazy = useLazy = false;
  39991. }
  39992. var chainAll = this.__chain__,
  39993. isHybrid = !!this.__actions__.length,
  39994. isUnwrapped = retUnwrapped && !chainAll,
  39995. onlyLazy = isLazy && !isHybrid;
  39996. if (!retUnwrapped && useLazy) {
  39997. value = onlyLazy ? value : new LazyWrapper(this);
  39998. var result = func.apply(value, args);
  39999. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  40000. return new LodashWrapper(result, chainAll);
  40001. }
  40002. if (isUnwrapped && onlyLazy) {
  40003. return func.apply(this, args);
  40004. }
  40005. result = this.thru(interceptor);
  40006. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  40007. };
  40008. });
  40009. // Add `Array` methods to `lodash.prototype`.
  40010. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  40011. var func = arrayProto[methodName],
  40012. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  40013. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  40014. lodash.prototype[methodName] = function() {
  40015. var args = arguments;
  40016. if (retUnwrapped && !this.__chain__) {
  40017. var value = this.value();
  40018. return func.apply(isArray(value) ? value : [], args);
  40019. }
  40020. return this[chainName](function(value) {
  40021. return func.apply(isArray(value) ? value : [], args);
  40022. });
  40023. };
  40024. });
  40025. // Map minified method names to their real names.
  40026. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  40027. var lodashFunc = lodash[methodName];
  40028. if (lodashFunc) {
  40029. var key = lodashFunc.name + '';
  40030. if (!hasOwnProperty.call(realNames, key)) {
  40031. realNames[key] = [];
  40032. }
  40033. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  40034. }
  40035. });
  40036. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  40037. 'name': 'wrapper',
  40038. 'func': undefined
  40039. }];
  40040. // Add methods to `LazyWrapper`.
  40041. LazyWrapper.prototype.clone = lazyClone;
  40042. LazyWrapper.prototype.reverse = lazyReverse;
  40043. LazyWrapper.prototype.value = lazyValue;
  40044. // Add chain sequence methods to the `lodash` wrapper.
  40045. lodash.prototype.at = wrapperAt;
  40046. lodash.prototype.chain = wrapperChain;
  40047. lodash.prototype.commit = wrapperCommit;
  40048. lodash.prototype.next = wrapperNext;
  40049. lodash.prototype.plant = wrapperPlant;
  40050. lodash.prototype.reverse = wrapperReverse;
  40051. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  40052. // Add lazy aliases.
  40053. lodash.prototype.first = lodash.prototype.head;
  40054. if (symIterator) {
  40055. lodash.prototype[symIterator] = wrapperToIterator;
  40056. }
  40057. return lodash;
  40058. });
  40059. /*--------------------------------------------------------------------------*/
  40060. // Export lodash.
  40061. var _ = runInContext();
  40062. // Some AMD build optimizers, like r.js, check for condition patterns like:
  40063. if (true) {
  40064. // Expose Lodash on the global object to prevent errors when Lodash is
  40065. // loaded by a script tag in the presence of an AMD loader.
  40066. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  40067. // Use `_.noConflict` to remove Lodash from the global object.
  40068. root._ = _;
  40069. // Define as an anonymous module so, through path mapping, it can be
  40070. // referenced as the "underscore" module.
  40071. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  40072. return _;
  40073. }).call(exports, __webpack_require__, exports, module),
  40074. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  40075. }
  40076. // Check for `exports` after `define` in case a build optimizer adds it.
  40077. else {}
  40078. }.call(this));
  40079. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
  40080. /***/ }),
  40081. /***/ "./node_modules/moment/locale sync recursive ^\\.\\/.*$":
  40082. /*!**************************************************!*\
  40083. !*** ./node_modules/moment/locale sync ^\.\/.*$ ***!
  40084. \**************************************************/
  40085. /*! no static exports found */
  40086. /***/ (function(module, exports, __webpack_require__) {
  40087. var map = {
  40088. "./af": "./node_modules/moment/locale/af.js",
  40089. "./af.js": "./node_modules/moment/locale/af.js",
  40090. "./ar": "./node_modules/moment/locale/ar.js",
  40091. "./ar-dz": "./node_modules/moment/locale/ar-dz.js",
  40092. "./ar-dz.js": "./node_modules/moment/locale/ar-dz.js",
  40093. "./ar-kw": "./node_modules/moment/locale/ar-kw.js",
  40094. "./ar-kw.js": "./node_modules/moment/locale/ar-kw.js",
  40095. "./ar-ly": "./node_modules/moment/locale/ar-ly.js",
  40096. "./ar-ly.js": "./node_modules/moment/locale/ar-ly.js",
  40097. "./ar-ma": "./node_modules/moment/locale/ar-ma.js",
  40098. "./ar-ma.js": "./node_modules/moment/locale/ar-ma.js",
  40099. "./ar-sa": "./node_modules/moment/locale/ar-sa.js",
  40100. "./ar-sa.js": "./node_modules/moment/locale/ar-sa.js",
  40101. "./ar-tn": "./node_modules/moment/locale/ar-tn.js",
  40102. "./ar-tn.js": "./node_modules/moment/locale/ar-tn.js",
  40103. "./ar.js": "./node_modules/moment/locale/ar.js",
  40104. "./az": "./node_modules/moment/locale/az.js",
  40105. "./az.js": "./node_modules/moment/locale/az.js",
  40106. "./be": "./node_modules/moment/locale/be.js",
  40107. "./be.js": "./node_modules/moment/locale/be.js",
  40108. "./bg": "./node_modules/moment/locale/bg.js",
  40109. "./bg.js": "./node_modules/moment/locale/bg.js",
  40110. "./bm": "./node_modules/moment/locale/bm.js",
  40111. "./bm.js": "./node_modules/moment/locale/bm.js",
  40112. "./bn": "./node_modules/moment/locale/bn.js",
  40113. "./bn.js": "./node_modules/moment/locale/bn.js",
  40114. "./bo": "./node_modules/moment/locale/bo.js",
  40115. "./bo.js": "./node_modules/moment/locale/bo.js",
  40116. "./br": "./node_modules/moment/locale/br.js",
  40117. "./br.js": "./node_modules/moment/locale/br.js",
  40118. "./bs": "./node_modules/moment/locale/bs.js",
  40119. "./bs.js": "./node_modules/moment/locale/bs.js",
  40120. "./ca": "./node_modules/moment/locale/ca.js",
  40121. "./ca.js": "./node_modules/moment/locale/ca.js",
  40122. "./cs": "./node_modules/moment/locale/cs.js",
  40123. "./cs.js": "./node_modules/moment/locale/cs.js",
  40124. "./cv": "./node_modules/moment/locale/cv.js",
  40125. "./cv.js": "./node_modules/moment/locale/cv.js",
  40126. "./cy": "./node_modules/moment/locale/cy.js",
  40127. "./cy.js": "./node_modules/moment/locale/cy.js",
  40128. "./da": "./node_modules/moment/locale/da.js",
  40129. "./da.js": "./node_modules/moment/locale/da.js",
  40130. "./de": "./node_modules/moment/locale/de.js",
  40131. "./de-at": "./node_modules/moment/locale/de-at.js",
  40132. "./de-at.js": "./node_modules/moment/locale/de-at.js",
  40133. "./de-ch": "./node_modules/moment/locale/de-ch.js",
  40134. "./de-ch.js": "./node_modules/moment/locale/de-ch.js",
  40135. "./de.js": "./node_modules/moment/locale/de.js",
  40136. "./dv": "./node_modules/moment/locale/dv.js",
  40137. "./dv.js": "./node_modules/moment/locale/dv.js",
  40138. "./el": "./node_modules/moment/locale/el.js",
  40139. "./el.js": "./node_modules/moment/locale/el.js",
  40140. "./en-au": "./node_modules/moment/locale/en-au.js",
  40141. "./en-au.js": "./node_modules/moment/locale/en-au.js",
  40142. "./en-ca": "./node_modules/moment/locale/en-ca.js",
  40143. "./en-ca.js": "./node_modules/moment/locale/en-ca.js",
  40144. "./en-gb": "./node_modules/moment/locale/en-gb.js",
  40145. "./en-gb.js": "./node_modules/moment/locale/en-gb.js",
  40146. "./en-ie": "./node_modules/moment/locale/en-ie.js",
  40147. "./en-ie.js": "./node_modules/moment/locale/en-ie.js",
  40148. "./en-il": "./node_modules/moment/locale/en-il.js",
  40149. "./en-il.js": "./node_modules/moment/locale/en-il.js",
  40150. "./en-in": "./node_modules/moment/locale/en-in.js",
  40151. "./en-in.js": "./node_modules/moment/locale/en-in.js",
  40152. "./en-nz": "./node_modules/moment/locale/en-nz.js",
  40153. "./en-nz.js": "./node_modules/moment/locale/en-nz.js",
  40154. "./en-sg": "./node_modules/moment/locale/en-sg.js",
  40155. "./en-sg.js": "./node_modules/moment/locale/en-sg.js",
  40156. "./eo": "./node_modules/moment/locale/eo.js",
  40157. "./eo.js": "./node_modules/moment/locale/eo.js",
  40158. "./es": "./node_modules/moment/locale/es.js",
  40159. "./es-do": "./node_modules/moment/locale/es-do.js",
  40160. "./es-do.js": "./node_modules/moment/locale/es-do.js",
  40161. "./es-us": "./node_modules/moment/locale/es-us.js",
  40162. "./es-us.js": "./node_modules/moment/locale/es-us.js",
  40163. "./es.js": "./node_modules/moment/locale/es.js",
  40164. "./et": "./node_modules/moment/locale/et.js",
  40165. "./et.js": "./node_modules/moment/locale/et.js",
  40166. "./eu": "./node_modules/moment/locale/eu.js",
  40167. "./eu.js": "./node_modules/moment/locale/eu.js",
  40168. "./fa": "./node_modules/moment/locale/fa.js",
  40169. "./fa.js": "./node_modules/moment/locale/fa.js",
  40170. "./fi": "./node_modules/moment/locale/fi.js",
  40171. "./fi.js": "./node_modules/moment/locale/fi.js",
  40172. "./fil": "./node_modules/moment/locale/fil.js",
  40173. "./fil.js": "./node_modules/moment/locale/fil.js",
  40174. "./fo": "./node_modules/moment/locale/fo.js",
  40175. "./fo.js": "./node_modules/moment/locale/fo.js",
  40176. "./fr": "./node_modules/moment/locale/fr.js",
  40177. "./fr-ca": "./node_modules/moment/locale/fr-ca.js",
  40178. "./fr-ca.js": "./node_modules/moment/locale/fr-ca.js",
  40179. "./fr-ch": "./node_modules/moment/locale/fr-ch.js",
  40180. "./fr-ch.js": "./node_modules/moment/locale/fr-ch.js",
  40181. "./fr.js": "./node_modules/moment/locale/fr.js",
  40182. "./fy": "./node_modules/moment/locale/fy.js",
  40183. "./fy.js": "./node_modules/moment/locale/fy.js",
  40184. "./ga": "./node_modules/moment/locale/ga.js",
  40185. "./ga.js": "./node_modules/moment/locale/ga.js",
  40186. "./gd": "./node_modules/moment/locale/gd.js",
  40187. "./gd.js": "./node_modules/moment/locale/gd.js",
  40188. "./gl": "./node_modules/moment/locale/gl.js",
  40189. "./gl.js": "./node_modules/moment/locale/gl.js",
  40190. "./gom-deva": "./node_modules/moment/locale/gom-deva.js",
  40191. "./gom-deva.js": "./node_modules/moment/locale/gom-deva.js",
  40192. "./gom-latn": "./node_modules/moment/locale/gom-latn.js",
  40193. "./gom-latn.js": "./node_modules/moment/locale/gom-latn.js",
  40194. "./gu": "./node_modules/moment/locale/gu.js",
  40195. "./gu.js": "./node_modules/moment/locale/gu.js",
  40196. "./he": "./node_modules/moment/locale/he.js",
  40197. "./he.js": "./node_modules/moment/locale/he.js",
  40198. "./hi": "./node_modules/moment/locale/hi.js",
  40199. "./hi.js": "./node_modules/moment/locale/hi.js",
  40200. "./hr": "./node_modules/moment/locale/hr.js",
  40201. "./hr.js": "./node_modules/moment/locale/hr.js",
  40202. "./hu": "./node_modules/moment/locale/hu.js",
  40203. "./hu.js": "./node_modules/moment/locale/hu.js",
  40204. "./hy-am": "./node_modules/moment/locale/hy-am.js",
  40205. "./hy-am.js": "./node_modules/moment/locale/hy-am.js",
  40206. "./id": "./node_modules/moment/locale/id.js",
  40207. "./id.js": "./node_modules/moment/locale/id.js",
  40208. "./is": "./node_modules/moment/locale/is.js",
  40209. "./is.js": "./node_modules/moment/locale/is.js",
  40210. "./it": "./node_modules/moment/locale/it.js",
  40211. "./it-ch": "./node_modules/moment/locale/it-ch.js",
  40212. "./it-ch.js": "./node_modules/moment/locale/it-ch.js",
  40213. "./it.js": "./node_modules/moment/locale/it.js",
  40214. "./ja": "./node_modules/moment/locale/ja.js",
  40215. "./ja.js": "./node_modules/moment/locale/ja.js",
  40216. "./jv": "./node_modules/moment/locale/jv.js",
  40217. "./jv.js": "./node_modules/moment/locale/jv.js",
  40218. "./ka": "./node_modules/moment/locale/ka.js",
  40219. "./ka.js": "./node_modules/moment/locale/ka.js",
  40220. "./kk": "./node_modules/moment/locale/kk.js",
  40221. "./kk.js": "./node_modules/moment/locale/kk.js",
  40222. "./km": "./node_modules/moment/locale/km.js",
  40223. "./km.js": "./node_modules/moment/locale/km.js",
  40224. "./kn": "./node_modules/moment/locale/kn.js",
  40225. "./kn.js": "./node_modules/moment/locale/kn.js",
  40226. "./ko": "./node_modules/moment/locale/ko.js",
  40227. "./ko.js": "./node_modules/moment/locale/ko.js",
  40228. "./ku": "./node_modules/moment/locale/ku.js",
  40229. "./ku.js": "./node_modules/moment/locale/ku.js",
  40230. "./ky": "./node_modules/moment/locale/ky.js",
  40231. "./ky.js": "./node_modules/moment/locale/ky.js",
  40232. "./lb": "./node_modules/moment/locale/lb.js",
  40233. "./lb.js": "./node_modules/moment/locale/lb.js",
  40234. "./lo": "./node_modules/moment/locale/lo.js",
  40235. "./lo.js": "./node_modules/moment/locale/lo.js",
  40236. "./lt": "./node_modules/moment/locale/lt.js",
  40237. "./lt.js": "./node_modules/moment/locale/lt.js",
  40238. "./lv": "./node_modules/moment/locale/lv.js",
  40239. "./lv.js": "./node_modules/moment/locale/lv.js",
  40240. "./me": "./node_modules/moment/locale/me.js",
  40241. "./me.js": "./node_modules/moment/locale/me.js",
  40242. "./mi": "./node_modules/moment/locale/mi.js",
  40243. "./mi.js": "./node_modules/moment/locale/mi.js",
  40244. "./mk": "./node_modules/moment/locale/mk.js",
  40245. "./mk.js": "./node_modules/moment/locale/mk.js",
  40246. "./ml": "./node_modules/moment/locale/ml.js",
  40247. "./ml.js": "./node_modules/moment/locale/ml.js",
  40248. "./mn": "./node_modules/moment/locale/mn.js",
  40249. "./mn.js": "./node_modules/moment/locale/mn.js",
  40250. "./mr": "./node_modules/moment/locale/mr.js",
  40251. "./mr.js": "./node_modules/moment/locale/mr.js",
  40252. "./ms": "./node_modules/moment/locale/ms.js",
  40253. "./ms-my": "./node_modules/moment/locale/ms-my.js",
  40254. "./ms-my.js": "./node_modules/moment/locale/ms-my.js",
  40255. "./ms.js": "./node_modules/moment/locale/ms.js",
  40256. "./mt": "./node_modules/moment/locale/mt.js",
  40257. "./mt.js": "./node_modules/moment/locale/mt.js",
  40258. "./my": "./node_modules/moment/locale/my.js",
  40259. "./my.js": "./node_modules/moment/locale/my.js",
  40260. "./nb": "./node_modules/moment/locale/nb.js",
  40261. "./nb.js": "./node_modules/moment/locale/nb.js",
  40262. "./ne": "./node_modules/moment/locale/ne.js",
  40263. "./ne.js": "./node_modules/moment/locale/ne.js",
  40264. "./nl": "./node_modules/moment/locale/nl.js",
  40265. "./nl-be": "./node_modules/moment/locale/nl-be.js",
  40266. "./nl-be.js": "./node_modules/moment/locale/nl-be.js",
  40267. "./nl.js": "./node_modules/moment/locale/nl.js",
  40268. "./nn": "./node_modules/moment/locale/nn.js",
  40269. "./nn.js": "./node_modules/moment/locale/nn.js",
  40270. "./oc-lnc": "./node_modules/moment/locale/oc-lnc.js",
  40271. "./oc-lnc.js": "./node_modules/moment/locale/oc-lnc.js",
  40272. "./pa-in": "./node_modules/moment/locale/pa-in.js",
  40273. "./pa-in.js": "./node_modules/moment/locale/pa-in.js",
  40274. "./pl": "./node_modules/moment/locale/pl.js",
  40275. "./pl.js": "./node_modules/moment/locale/pl.js",
  40276. "./pt": "./node_modules/moment/locale/pt.js",
  40277. "./pt-br": "./node_modules/moment/locale/pt-br.js",
  40278. "./pt-br.js": "./node_modules/moment/locale/pt-br.js",
  40279. "./pt.js": "./node_modules/moment/locale/pt.js",
  40280. "./ro": "./node_modules/moment/locale/ro.js",
  40281. "./ro.js": "./node_modules/moment/locale/ro.js",
  40282. "./ru": "./node_modules/moment/locale/ru.js",
  40283. "./ru.js": "./node_modules/moment/locale/ru.js",
  40284. "./sd": "./node_modules/moment/locale/sd.js",
  40285. "./sd.js": "./node_modules/moment/locale/sd.js",
  40286. "./se": "./node_modules/moment/locale/se.js",
  40287. "./se.js": "./node_modules/moment/locale/se.js",
  40288. "./si": "./node_modules/moment/locale/si.js",
  40289. "./si.js": "./node_modules/moment/locale/si.js",
  40290. "./sk": "./node_modules/moment/locale/sk.js",
  40291. "./sk.js": "./node_modules/moment/locale/sk.js",
  40292. "./sl": "./node_modules/moment/locale/sl.js",
  40293. "./sl.js": "./node_modules/moment/locale/sl.js",
  40294. "./sq": "./node_modules/moment/locale/sq.js",
  40295. "./sq.js": "./node_modules/moment/locale/sq.js",
  40296. "./sr": "./node_modules/moment/locale/sr.js",
  40297. "./sr-cyrl": "./node_modules/moment/locale/sr-cyrl.js",
  40298. "./sr-cyrl.js": "./node_modules/moment/locale/sr-cyrl.js",
  40299. "./sr.js": "./node_modules/moment/locale/sr.js",
  40300. "./ss": "./node_modules/moment/locale/ss.js",
  40301. "./ss.js": "./node_modules/moment/locale/ss.js",
  40302. "./sv": "./node_modules/moment/locale/sv.js",
  40303. "./sv.js": "./node_modules/moment/locale/sv.js",
  40304. "./sw": "./node_modules/moment/locale/sw.js",
  40305. "./sw.js": "./node_modules/moment/locale/sw.js",
  40306. "./ta": "./node_modules/moment/locale/ta.js",
  40307. "./ta.js": "./node_modules/moment/locale/ta.js",
  40308. "./te": "./node_modules/moment/locale/te.js",
  40309. "./te.js": "./node_modules/moment/locale/te.js",
  40310. "./tet": "./node_modules/moment/locale/tet.js",
  40311. "./tet.js": "./node_modules/moment/locale/tet.js",
  40312. "./tg": "./node_modules/moment/locale/tg.js",
  40313. "./tg.js": "./node_modules/moment/locale/tg.js",
  40314. "./th": "./node_modules/moment/locale/th.js",
  40315. "./th.js": "./node_modules/moment/locale/th.js",
  40316. "./tk": "./node_modules/moment/locale/tk.js",
  40317. "./tk.js": "./node_modules/moment/locale/tk.js",
  40318. "./tl-ph": "./node_modules/moment/locale/tl-ph.js",
  40319. "./tl-ph.js": "./node_modules/moment/locale/tl-ph.js",
  40320. "./tlh": "./node_modules/moment/locale/tlh.js",
  40321. "./tlh.js": "./node_modules/moment/locale/tlh.js",
  40322. "./tr": "./node_modules/moment/locale/tr.js",
  40323. "./tr.js": "./node_modules/moment/locale/tr.js",
  40324. "./tzl": "./node_modules/moment/locale/tzl.js",
  40325. "./tzl.js": "./node_modules/moment/locale/tzl.js",
  40326. "./tzm": "./node_modules/moment/locale/tzm.js",
  40327. "./tzm-latn": "./node_modules/moment/locale/tzm-latn.js",
  40328. "./tzm-latn.js": "./node_modules/moment/locale/tzm-latn.js",
  40329. "./tzm.js": "./node_modules/moment/locale/tzm.js",
  40330. "./ug-cn": "./node_modules/moment/locale/ug-cn.js",
  40331. "./ug-cn.js": "./node_modules/moment/locale/ug-cn.js",
  40332. "./uk": "./node_modules/moment/locale/uk.js",
  40333. "./uk.js": "./node_modules/moment/locale/uk.js",
  40334. "./ur": "./node_modules/moment/locale/ur.js",
  40335. "./ur.js": "./node_modules/moment/locale/ur.js",
  40336. "./uz": "./node_modules/moment/locale/uz.js",
  40337. "./uz-latn": "./node_modules/moment/locale/uz-latn.js",
  40338. "./uz-latn.js": "./node_modules/moment/locale/uz-latn.js",
  40339. "./uz.js": "./node_modules/moment/locale/uz.js",
  40340. "./vi": "./node_modules/moment/locale/vi.js",
  40341. "./vi.js": "./node_modules/moment/locale/vi.js",
  40342. "./x-pseudo": "./node_modules/moment/locale/x-pseudo.js",
  40343. "./x-pseudo.js": "./node_modules/moment/locale/x-pseudo.js",
  40344. "./yo": "./node_modules/moment/locale/yo.js",
  40345. "./yo.js": "./node_modules/moment/locale/yo.js",
  40346. "./zh-cn": "./node_modules/moment/locale/zh-cn.js",
  40347. "./zh-cn.js": "./node_modules/moment/locale/zh-cn.js",
  40348. "./zh-hk": "./node_modules/moment/locale/zh-hk.js",
  40349. "./zh-hk.js": "./node_modules/moment/locale/zh-hk.js",
  40350. "./zh-mo": "./node_modules/moment/locale/zh-mo.js",
  40351. "./zh-mo.js": "./node_modules/moment/locale/zh-mo.js",
  40352. "./zh-tw": "./node_modules/moment/locale/zh-tw.js",
  40353. "./zh-tw.js": "./node_modules/moment/locale/zh-tw.js"
  40354. };
  40355. function webpackContext(req) {
  40356. var id = webpackContextResolve(req);
  40357. return __webpack_require__(id);
  40358. }
  40359. function webpackContextResolve(req) {
  40360. if(!__webpack_require__.o(map, req)) {
  40361. var e = new Error("Cannot find module '" + req + "'");
  40362. e.code = 'MODULE_NOT_FOUND';
  40363. throw e;
  40364. }
  40365. return map[req];
  40366. }
  40367. webpackContext.keys = function webpackContextKeys() {
  40368. return Object.keys(map);
  40369. };
  40370. webpackContext.resolve = webpackContextResolve;
  40371. module.exports = webpackContext;
  40372. webpackContext.id = "./node_modules/moment/locale sync recursive ^\\.\\/.*$";
  40373. /***/ }),
  40374. /***/ "./node_modules/moment/locale/af.js":
  40375. /*!******************************************!*\
  40376. !*** ./node_modules/moment/locale/af.js ***!
  40377. \******************************************/
  40378. /*! no static exports found */
  40379. /***/ (function(module, exports, __webpack_require__) {
  40380. //! moment.js locale configuration
  40381. //! locale : Afrikaans [af]
  40382. //! author : Werner Mollentze : https://github.com/wernerm
  40383. ;(function (global, factory) {
  40384. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  40385. undefined
  40386. }(this, (function (moment) { 'use strict';
  40387. //! moment.js locale configuration
  40388. var af = moment.defineLocale('af', {
  40389. months: 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split(
  40390. '_'
  40391. ),
  40392. monthsShort: 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),
  40393. weekdays: 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split(
  40394. '_'
  40395. ),
  40396. weekdaysShort: 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
  40397. weekdaysMin: 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
  40398. meridiemParse: /vm|nm/i,
  40399. isPM: function (input) {
  40400. return /^nm$/i.test(input);
  40401. },
  40402. meridiem: function (hours, minutes, isLower) {
  40403. if (hours < 12) {
  40404. return isLower ? 'vm' : 'VM';
  40405. } else {
  40406. return isLower ? 'nm' : 'NM';
  40407. }
  40408. },
  40409. longDateFormat: {
  40410. LT: 'HH:mm',
  40411. LTS: 'HH:mm:ss',
  40412. L: 'DD/MM/YYYY',
  40413. LL: 'D MMMM YYYY',
  40414. LLL: 'D MMMM YYYY HH:mm',
  40415. LLLL: 'dddd, D MMMM YYYY HH:mm',
  40416. },
  40417. calendar: {
  40418. sameDay: '[Vandag om] LT',
  40419. nextDay: '[Môre om] LT',
  40420. nextWeek: 'dddd [om] LT',
  40421. lastDay: '[Gister om] LT',
  40422. lastWeek: '[Laas] dddd [om] LT',
  40423. sameElse: 'L',
  40424. },
  40425. relativeTime: {
  40426. future: 'oor %s',
  40427. past: '%s gelede',
  40428. s: "'n paar sekondes",
  40429. ss: '%d sekondes',
  40430. m: "'n minuut",
  40431. mm: '%d minute',
  40432. h: "'n uur",
  40433. hh: '%d ure',
  40434. d: "'n dag",
  40435. dd: '%d dae',
  40436. M: "'n maand",
  40437. MM: '%d maande',
  40438. y: "'n jaar",
  40439. yy: '%d jaar',
  40440. },
  40441. dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
  40442. ordinal: function (number) {
  40443. return (
  40444. number +
  40445. (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')
  40446. ); // Thanks to Joris Röling : https://github.com/jjupiter
  40447. },
  40448. week: {
  40449. dow: 1, // Maandag is die eerste dag van die week.
  40450. doy: 4, // Die week wat die 4de Januarie bevat is die eerste week van die jaar.
  40451. },
  40452. });
  40453. return af;
  40454. })));
  40455. /***/ }),
  40456. /***/ "./node_modules/moment/locale/ar-dz.js":
  40457. /*!*********************************************!*\
  40458. !*** ./node_modules/moment/locale/ar-dz.js ***!
  40459. \*********************************************/
  40460. /*! no static exports found */
  40461. /***/ (function(module, exports, __webpack_require__) {
  40462. //! moment.js locale configuration
  40463. //! locale : Arabic (Algeria) [ar-dz]
  40464. //! author : Amine Roukh: https://github.com/Amine27
  40465. //! author : Abdel Said: https://github.com/abdelsaid
  40466. //! author : Ahmed Elkhatib
  40467. //! author : forabi https://github.com/forabi
  40468. //! author : Noureddine LOUAHEDJ : https://github.com/noureddinem
  40469. ;(function (global, factory) {
  40470. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  40471. undefined
  40472. }(this, (function (moment) { 'use strict';
  40473. //! moment.js locale configuration
  40474. var pluralForm = function (n) {
  40475. return n === 0
  40476. ? 0
  40477. : n === 1
  40478. ? 1
  40479. : n === 2
  40480. ? 2
  40481. : n % 100 >= 3 && n % 100 <= 10
  40482. ? 3
  40483. : n % 100 >= 11
  40484. ? 4
  40485. : 5;
  40486. },
  40487. plurals = {
  40488. s: [
  40489. 'أقل من ثانية',
  40490. 'ثانية واحدة',
  40491. ['ثانيتان', 'ثانيتين'],
  40492. '%d ثوان',
  40493. '%d ثانية',
  40494. '%d ثانية',
  40495. ],
  40496. m: [
  40497. 'أقل من دقيقة',
  40498. 'دقيقة واحدة',
  40499. ['دقيقتان', 'دقيقتين'],
  40500. '%d دقائق',
  40501. '%d دقيقة',
  40502. '%d دقيقة',
  40503. ],
  40504. h: [
  40505. 'أقل من ساعة',
  40506. 'ساعة واحدة',
  40507. ['ساعتان', 'ساعتين'],
  40508. '%d ساعات',
  40509. '%d ساعة',
  40510. '%d ساعة',
  40511. ],
  40512. d: [
  40513. 'أقل من يوم',
  40514. 'يوم واحد',
  40515. ['يومان', 'يومين'],
  40516. '%d أيام',
  40517. '%d يومًا',
  40518. '%d يوم',
  40519. ],
  40520. M: [
  40521. 'أقل من شهر',
  40522. 'شهر واحد',
  40523. ['شهران', 'شهرين'],
  40524. '%d أشهر',
  40525. '%d شهرا',
  40526. '%d شهر',
  40527. ],
  40528. y: [
  40529. 'أقل من عام',
  40530. 'عام واحد',
  40531. ['عامان', 'عامين'],
  40532. '%d أعوام',
  40533. '%d عامًا',
  40534. '%d عام',
  40535. ],
  40536. },
  40537. pluralize = function (u) {
  40538. return function (number, withoutSuffix, string, isFuture) {
  40539. var f = pluralForm(number),
  40540. str = plurals[u][pluralForm(number)];
  40541. if (f === 2) {
  40542. str = str[withoutSuffix ? 0 : 1];
  40543. }
  40544. return str.replace(/%d/i, number);
  40545. };
  40546. },
  40547. months = [
  40548. 'جانفي',
  40549. 'فيفري',
  40550. 'مارس',
  40551. 'أفريل',
  40552. 'ماي',
  40553. 'جوان',
  40554. 'جويلية',
  40555. 'أوت',
  40556. 'سبتمبر',
  40557. 'أكتوبر',
  40558. 'نوفمبر',
  40559. 'ديسمبر',
  40560. ];
  40561. var arDz = moment.defineLocale('ar-dz', {
  40562. months: months,
  40563. monthsShort: months,
  40564. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  40565. weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  40566. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  40567. weekdaysParseExact: true,
  40568. longDateFormat: {
  40569. LT: 'HH:mm',
  40570. LTS: 'HH:mm:ss',
  40571. L: 'D/\u200FM/\u200FYYYY',
  40572. LL: 'D MMMM YYYY',
  40573. LLL: 'D MMMM YYYY HH:mm',
  40574. LLLL: 'dddd D MMMM YYYY HH:mm',
  40575. },
  40576. meridiemParse: /ص|م/,
  40577. isPM: function (input) {
  40578. return 'م' === input;
  40579. },
  40580. meridiem: function (hour, minute, isLower) {
  40581. if (hour < 12) {
  40582. return 'ص';
  40583. } else {
  40584. return 'م';
  40585. }
  40586. },
  40587. calendar: {
  40588. sameDay: '[اليوم عند الساعة] LT',
  40589. nextDay: '[غدًا عند الساعة] LT',
  40590. nextWeek: 'dddd [عند الساعة] LT',
  40591. lastDay: '[أمس عند الساعة] LT',
  40592. lastWeek: 'dddd [عند الساعة] LT',
  40593. sameElse: 'L',
  40594. },
  40595. relativeTime: {
  40596. future: 'بعد %s',
  40597. past: 'منذ %s',
  40598. s: pluralize('s'),
  40599. ss: pluralize('s'),
  40600. m: pluralize('m'),
  40601. mm: pluralize('m'),
  40602. h: pluralize('h'),
  40603. hh: pluralize('h'),
  40604. d: pluralize('d'),
  40605. dd: pluralize('d'),
  40606. M: pluralize('M'),
  40607. MM: pluralize('M'),
  40608. y: pluralize('y'),
  40609. yy: pluralize('y'),
  40610. },
  40611. postformat: function (string) {
  40612. return string.replace(/,/g, '،');
  40613. },
  40614. week: {
  40615. dow: 0, // Sunday is the first day of the week.
  40616. doy: 4, // The week that contains Jan 4th is the first week of the year.
  40617. },
  40618. });
  40619. return arDz;
  40620. })));
  40621. /***/ }),
  40622. /***/ "./node_modules/moment/locale/ar-kw.js":
  40623. /*!*********************************************!*\
  40624. !*** ./node_modules/moment/locale/ar-kw.js ***!
  40625. \*********************************************/
  40626. /*! no static exports found */
  40627. /***/ (function(module, exports, __webpack_require__) {
  40628. //! moment.js locale configuration
  40629. //! locale : Arabic (Kuwait) [ar-kw]
  40630. //! author : Nusret Parlak: https://github.com/nusretparlak
  40631. ;(function (global, factory) {
  40632. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  40633. undefined
  40634. }(this, (function (moment) { 'use strict';
  40635. //! moment.js locale configuration
  40636. var arKw = moment.defineLocale('ar-kw', {
  40637. months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
  40638. '_'
  40639. ),
  40640. monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
  40641. '_'
  40642. ),
  40643. weekdays: 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  40644. weekdaysShort: 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
  40645. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  40646. weekdaysParseExact: true,
  40647. longDateFormat: {
  40648. LT: 'HH:mm',
  40649. LTS: 'HH:mm:ss',
  40650. L: 'DD/MM/YYYY',
  40651. LL: 'D MMMM YYYY',
  40652. LLL: 'D MMMM YYYY HH:mm',
  40653. LLLL: 'dddd D MMMM YYYY HH:mm',
  40654. },
  40655. calendar: {
  40656. sameDay: '[اليوم على الساعة] LT',
  40657. nextDay: '[غدا على الساعة] LT',
  40658. nextWeek: 'dddd [على الساعة] LT',
  40659. lastDay: '[أمس على الساعة] LT',
  40660. lastWeek: 'dddd [على الساعة] LT',
  40661. sameElse: 'L',
  40662. },
  40663. relativeTime: {
  40664. future: 'في %s',
  40665. past: 'منذ %s',
  40666. s: 'ثوان',
  40667. ss: '%d ثانية',
  40668. m: 'دقيقة',
  40669. mm: '%d دقائق',
  40670. h: 'ساعة',
  40671. hh: '%d ساعات',
  40672. d: 'يوم',
  40673. dd: '%d أيام',
  40674. M: 'شهر',
  40675. MM: '%d أشهر',
  40676. y: 'سنة',
  40677. yy: '%d سنوات',
  40678. },
  40679. week: {
  40680. dow: 0, // Sunday is the first day of the week.
  40681. doy: 12, // The week that contains Jan 12th is the first week of the year.
  40682. },
  40683. });
  40684. return arKw;
  40685. })));
  40686. /***/ }),
  40687. /***/ "./node_modules/moment/locale/ar-ly.js":
  40688. /*!*********************************************!*\
  40689. !*** ./node_modules/moment/locale/ar-ly.js ***!
  40690. \*********************************************/
  40691. /*! no static exports found */
  40692. /***/ (function(module, exports, __webpack_require__) {
  40693. //! moment.js locale configuration
  40694. //! locale : Arabic (Lybia) [ar-ly]
  40695. //! author : Ali Hmer: https://github.com/kikoanis
  40696. ;(function (global, factory) {
  40697. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  40698. undefined
  40699. }(this, (function (moment) { 'use strict';
  40700. //! moment.js locale configuration
  40701. var symbolMap = {
  40702. '1': '1',
  40703. '2': '2',
  40704. '3': '3',
  40705. '4': '4',
  40706. '5': '5',
  40707. '6': '6',
  40708. '7': '7',
  40709. '8': '8',
  40710. '9': '9',
  40711. '0': '0',
  40712. },
  40713. pluralForm = function (n) {
  40714. return n === 0
  40715. ? 0
  40716. : n === 1
  40717. ? 1
  40718. : n === 2
  40719. ? 2
  40720. : n % 100 >= 3 && n % 100 <= 10
  40721. ? 3
  40722. : n % 100 >= 11
  40723. ? 4
  40724. : 5;
  40725. },
  40726. plurals = {
  40727. s: [
  40728. 'أقل من ثانية',
  40729. 'ثانية واحدة',
  40730. ['ثانيتان', 'ثانيتين'],
  40731. '%d ثوان',
  40732. '%d ثانية',
  40733. '%d ثانية',
  40734. ],
  40735. m: [
  40736. 'أقل من دقيقة',
  40737. 'دقيقة واحدة',
  40738. ['دقيقتان', 'دقيقتين'],
  40739. '%d دقائق',
  40740. '%d دقيقة',
  40741. '%d دقيقة',
  40742. ],
  40743. h: [
  40744. 'أقل من ساعة',
  40745. 'ساعة واحدة',
  40746. ['ساعتان', 'ساعتين'],
  40747. '%d ساعات',
  40748. '%d ساعة',
  40749. '%d ساعة',
  40750. ],
  40751. d: [
  40752. 'أقل من يوم',
  40753. 'يوم واحد',
  40754. ['يومان', 'يومين'],
  40755. '%d أيام',
  40756. '%d يومًا',
  40757. '%d يوم',
  40758. ],
  40759. M: [
  40760. 'أقل من شهر',
  40761. 'شهر واحد',
  40762. ['شهران', 'شهرين'],
  40763. '%d أشهر',
  40764. '%d شهرا',
  40765. '%d شهر',
  40766. ],
  40767. y: [
  40768. 'أقل من عام',
  40769. 'عام واحد',
  40770. ['عامان', 'عامين'],
  40771. '%d أعوام',
  40772. '%d عامًا',
  40773. '%d عام',
  40774. ],
  40775. },
  40776. pluralize = function (u) {
  40777. return function (number, withoutSuffix, string, isFuture) {
  40778. var f = pluralForm(number),
  40779. str = plurals[u][pluralForm(number)];
  40780. if (f === 2) {
  40781. str = str[withoutSuffix ? 0 : 1];
  40782. }
  40783. return str.replace(/%d/i, number);
  40784. };
  40785. },
  40786. months = [
  40787. 'يناير',
  40788. 'فبراير',
  40789. 'مارس',
  40790. 'أبريل',
  40791. 'مايو',
  40792. 'يونيو',
  40793. 'يوليو',
  40794. 'أغسطس',
  40795. 'سبتمبر',
  40796. 'أكتوبر',
  40797. 'نوفمبر',
  40798. 'ديسمبر',
  40799. ];
  40800. var arLy = moment.defineLocale('ar-ly', {
  40801. months: months,
  40802. monthsShort: months,
  40803. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  40804. weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  40805. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  40806. weekdaysParseExact: true,
  40807. longDateFormat: {
  40808. LT: 'HH:mm',
  40809. LTS: 'HH:mm:ss',
  40810. L: 'D/\u200FM/\u200FYYYY',
  40811. LL: 'D MMMM YYYY',
  40812. LLL: 'D MMMM YYYY HH:mm',
  40813. LLLL: 'dddd D MMMM YYYY HH:mm',
  40814. },
  40815. meridiemParse: /ص|م/,
  40816. isPM: function (input) {
  40817. return 'م' === input;
  40818. },
  40819. meridiem: function (hour, minute, isLower) {
  40820. if (hour < 12) {
  40821. return 'ص';
  40822. } else {
  40823. return 'م';
  40824. }
  40825. },
  40826. calendar: {
  40827. sameDay: '[اليوم عند الساعة] LT',
  40828. nextDay: '[غدًا عند الساعة] LT',
  40829. nextWeek: 'dddd [عند الساعة] LT',
  40830. lastDay: '[أمس عند الساعة] LT',
  40831. lastWeek: 'dddd [عند الساعة] LT',
  40832. sameElse: 'L',
  40833. },
  40834. relativeTime: {
  40835. future: 'بعد %s',
  40836. past: 'منذ %s',
  40837. s: pluralize('s'),
  40838. ss: pluralize('s'),
  40839. m: pluralize('m'),
  40840. mm: pluralize('m'),
  40841. h: pluralize('h'),
  40842. hh: pluralize('h'),
  40843. d: pluralize('d'),
  40844. dd: pluralize('d'),
  40845. M: pluralize('M'),
  40846. MM: pluralize('M'),
  40847. y: pluralize('y'),
  40848. yy: pluralize('y'),
  40849. },
  40850. preparse: function (string) {
  40851. return string.replace(/،/g, ',');
  40852. },
  40853. postformat: function (string) {
  40854. return string
  40855. .replace(/\d/g, function (match) {
  40856. return symbolMap[match];
  40857. })
  40858. .replace(/,/g, '،');
  40859. },
  40860. week: {
  40861. dow: 6, // Saturday is the first day of the week.
  40862. doy: 12, // The week that contains Jan 12th is the first week of the year.
  40863. },
  40864. });
  40865. return arLy;
  40866. })));
  40867. /***/ }),
  40868. /***/ "./node_modules/moment/locale/ar-ma.js":
  40869. /*!*********************************************!*\
  40870. !*** ./node_modules/moment/locale/ar-ma.js ***!
  40871. \*********************************************/
  40872. /*! no static exports found */
  40873. /***/ (function(module, exports, __webpack_require__) {
  40874. //! moment.js locale configuration
  40875. //! locale : Arabic (Morocco) [ar-ma]
  40876. //! author : ElFadili Yassine : https://github.com/ElFadiliY
  40877. //! author : Abdel Said : https://github.com/abdelsaid
  40878. ;(function (global, factory) {
  40879. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  40880. undefined
  40881. }(this, (function (moment) { 'use strict';
  40882. //! moment.js locale configuration
  40883. var arMa = moment.defineLocale('ar-ma', {
  40884. months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
  40885. '_'
  40886. ),
  40887. monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
  40888. '_'
  40889. ),
  40890. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  40891. weekdaysShort: 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
  40892. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  40893. weekdaysParseExact: true,
  40894. longDateFormat: {
  40895. LT: 'HH:mm',
  40896. LTS: 'HH:mm:ss',
  40897. L: 'DD/MM/YYYY',
  40898. LL: 'D MMMM YYYY',
  40899. LLL: 'D MMMM YYYY HH:mm',
  40900. LLLL: 'dddd D MMMM YYYY HH:mm',
  40901. },
  40902. calendar: {
  40903. sameDay: '[اليوم على الساعة] LT',
  40904. nextDay: '[غدا على الساعة] LT',
  40905. nextWeek: 'dddd [على الساعة] LT',
  40906. lastDay: '[أمس على الساعة] LT',
  40907. lastWeek: 'dddd [على الساعة] LT',
  40908. sameElse: 'L',
  40909. },
  40910. relativeTime: {
  40911. future: 'في %s',
  40912. past: 'منذ %s',
  40913. s: 'ثوان',
  40914. ss: '%d ثانية',
  40915. m: 'دقيقة',
  40916. mm: '%d دقائق',
  40917. h: 'ساعة',
  40918. hh: '%d ساعات',
  40919. d: 'يوم',
  40920. dd: '%d أيام',
  40921. M: 'شهر',
  40922. MM: '%d أشهر',
  40923. y: 'سنة',
  40924. yy: '%d سنوات',
  40925. },
  40926. week: {
  40927. dow: 6, // Saturday is the first day of the week.
  40928. doy: 12, // The week that contains Jan 12th is the first week of the year.
  40929. },
  40930. });
  40931. return arMa;
  40932. })));
  40933. /***/ }),
  40934. /***/ "./node_modules/moment/locale/ar-sa.js":
  40935. /*!*********************************************!*\
  40936. !*** ./node_modules/moment/locale/ar-sa.js ***!
  40937. \*********************************************/
  40938. /*! no static exports found */
  40939. /***/ (function(module, exports, __webpack_require__) {
  40940. //! moment.js locale configuration
  40941. //! locale : Arabic (Saudi Arabia) [ar-sa]
  40942. //! author : Suhail Alkowaileet : https://github.com/xsoh
  40943. ;(function (global, factory) {
  40944. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  40945. undefined
  40946. }(this, (function (moment) { 'use strict';
  40947. //! moment.js locale configuration
  40948. var symbolMap = {
  40949. '1': '١',
  40950. '2': '٢',
  40951. '3': '٣',
  40952. '4': '٤',
  40953. '5': '٥',
  40954. '6': '٦',
  40955. '7': '٧',
  40956. '8': '٨',
  40957. '9': '٩',
  40958. '0': '٠',
  40959. },
  40960. numberMap = {
  40961. '١': '1',
  40962. '٢': '2',
  40963. '٣': '3',
  40964. '٤': '4',
  40965. '٥': '5',
  40966. '٦': '6',
  40967. '٧': '7',
  40968. '٨': '8',
  40969. '٩': '9',
  40970. '٠': '0',
  40971. };
  40972. var arSa = moment.defineLocale('ar-sa', {
  40973. months: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
  40974. '_'
  40975. ),
  40976. monthsShort: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
  40977. '_'
  40978. ),
  40979. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  40980. weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  40981. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  40982. weekdaysParseExact: true,
  40983. longDateFormat: {
  40984. LT: 'HH:mm',
  40985. LTS: 'HH:mm:ss',
  40986. L: 'DD/MM/YYYY',
  40987. LL: 'D MMMM YYYY',
  40988. LLL: 'D MMMM YYYY HH:mm',
  40989. LLLL: 'dddd D MMMM YYYY HH:mm',
  40990. },
  40991. meridiemParse: /ص|م/,
  40992. isPM: function (input) {
  40993. return 'م' === input;
  40994. },
  40995. meridiem: function (hour, minute, isLower) {
  40996. if (hour < 12) {
  40997. return 'ص';
  40998. } else {
  40999. return 'م';
  41000. }
  41001. },
  41002. calendar: {
  41003. sameDay: '[اليوم على الساعة] LT',
  41004. nextDay: '[غدا على الساعة] LT',
  41005. nextWeek: 'dddd [على الساعة] LT',
  41006. lastDay: '[أمس على الساعة] LT',
  41007. lastWeek: 'dddd [على الساعة] LT',
  41008. sameElse: 'L',
  41009. },
  41010. relativeTime: {
  41011. future: 'في %s',
  41012. past: 'منذ %s',
  41013. s: 'ثوان',
  41014. ss: '%d ثانية',
  41015. m: 'دقيقة',
  41016. mm: '%d دقائق',
  41017. h: 'ساعة',
  41018. hh: '%d ساعات',
  41019. d: 'يوم',
  41020. dd: '%d أيام',
  41021. M: 'شهر',
  41022. MM: '%d أشهر',
  41023. y: 'سنة',
  41024. yy: '%d سنوات',
  41025. },
  41026. preparse: function (string) {
  41027. return string
  41028. .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
  41029. return numberMap[match];
  41030. })
  41031. .replace(/،/g, ',');
  41032. },
  41033. postformat: function (string) {
  41034. return string
  41035. .replace(/\d/g, function (match) {
  41036. return symbolMap[match];
  41037. })
  41038. .replace(/,/g, '،');
  41039. },
  41040. week: {
  41041. dow: 0, // Sunday is the first day of the week.
  41042. doy: 6, // The week that contains Jan 6th is the first week of the year.
  41043. },
  41044. });
  41045. return arSa;
  41046. })));
  41047. /***/ }),
  41048. /***/ "./node_modules/moment/locale/ar-tn.js":
  41049. /*!*********************************************!*\
  41050. !*** ./node_modules/moment/locale/ar-tn.js ***!
  41051. \*********************************************/
  41052. /*! no static exports found */
  41053. /***/ (function(module, exports, __webpack_require__) {
  41054. //! moment.js locale configuration
  41055. //! locale : Arabic (Tunisia) [ar-tn]
  41056. //! author : Nader Toukabri : https://github.com/naderio
  41057. ;(function (global, factory) {
  41058. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  41059. undefined
  41060. }(this, (function (moment) { 'use strict';
  41061. //! moment.js locale configuration
  41062. var arTn = moment.defineLocale('ar-tn', {
  41063. months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
  41064. '_'
  41065. ),
  41066. monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
  41067. '_'
  41068. ),
  41069. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  41070. weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  41071. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  41072. weekdaysParseExact: true,
  41073. longDateFormat: {
  41074. LT: 'HH:mm',
  41075. LTS: 'HH:mm:ss',
  41076. L: 'DD/MM/YYYY',
  41077. LL: 'D MMMM YYYY',
  41078. LLL: 'D MMMM YYYY HH:mm',
  41079. LLLL: 'dddd D MMMM YYYY HH:mm',
  41080. },
  41081. calendar: {
  41082. sameDay: '[اليوم على الساعة] LT',
  41083. nextDay: '[غدا على الساعة] LT',
  41084. nextWeek: 'dddd [على الساعة] LT',
  41085. lastDay: '[أمس على الساعة] LT',
  41086. lastWeek: 'dddd [على الساعة] LT',
  41087. sameElse: 'L',
  41088. },
  41089. relativeTime: {
  41090. future: 'في %s',
  41091. past: 'منذ %s',
  41092. s: 'ثوان',
  41093. ss: '%d ثانية',
  41094. m: 'دقيقة',
  41095. mm: '%d دقائق',
  41096. h: 'ساعة',
  41097. hh: '%d ساعات',
  41098. d: 'يوم',
  41099. dd: '%d أيام',
  41100. M: 'شهر',
  41101. MM: '%d أشهر',
  41102. y: 'سنة',
  41103. yy: '%d سنوات',
  41104. },
  41105. week: {
  41106. dow: 1, // Monday is the first day of the week.
  41107. doy: 4, // The week that contains Jan 4th is the first week of the year.
  41108. },
  41109. });
  41110. return arTn;
  41111. })));
  41112. /***/ }),
  41113. /***/ "./node_modules/moment/locale/ar.js":
  41114. /*!******************************************!*\
  41115. !*** ./node_modules/moment/locale/ar.js ***!
  41116. \******************************************/
  41117. /*! no static exports found */
  41118. /***/ (function(module, exports, __webpack_require__) {
  41119. //! moment.js locale configuration
  41120. //! locale : Arabic [ar]
  41121. //! author : Abdel Said: https://github.com/abdelsaid
  41122. //! author : Ahmed Elkhatib
  41123. //! author : forabi https://github.com/forabi
  41124. ;(function (global, factory) {
  41125. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  41126. undefined
  41127. }(this, (function (moment) { 'use strict';
  41128. //! moment.js locale configuration
  41129. var symbolMap = {
  41130. '1': '١',
  41131. '2': '٢',
  41132. '3': '٣',
  41133. '4': '٤',
  41134. '5': '٥',
  41135. '6': '٦',
  41136. '7': '٧',
  41137. '8': '٨',
  41138. '9': '٩',
  41139. '0': '٠',
  41140. },
  41141. numberMap = {
  41142. '١': '1',
  41143. '٢': '2',
  41144. '٣': '3',
  41145. '٤': '4',
  41146. '٥': '5',
  41147. '٦': '6',
  41148. '٧': '7',
  41149. '٨': '8',
  41150. '٩': '9',
  41151. '٠': '0',
  41152. },
  41153. pluralForm = function (n) {
  41154. return n === 0
  41155. ? 0
  41156. : n === 1
  41157. ? 1
  41158. : n === 2
  41159. ? 2
  41160. : n % 100 >= 3 && n % 100 <= 10
  41161. ? 3
  41162. : n % 100 >= 11
  41163. ? 4
  41164. : 5;
  41165. },
  41166. plurals = {
  41167. s: [
  41168. 'أقل من ثانية',
  41169. 'ثانية واحدة',
  41170. ['ثانيتان', 'ثانيتين'],
  41171. '%d ثوان',
  41172. '%d ثانية',
  41173. '%d ثانية',
  41174. ],
  41175. m: [
  41176. 'أقل من دقيقة',
  41177. 'دقيقة واحدة',
  41178. ['دقيقتان', 'دقيقتين'],
  41179. '%d دقائق',
  41180. '%d دقيقة',
  41181. '%d دقيقة',
  41182. ],
  41183. h: [
  41184. 'أقل من ساعة',
  41185. 'ساعة واحدة',
  41186. ['ساعتان', 'ساعتين'],
  41187. '%d ساعات',
  41188. '%d ساعة',
  41189. '%d ساعة',
  41190. ],
  41191. d: [
  41192. 'أقل من يوم',
  41193. 'يوم واحد',
  41194. ['يومان', 'يومين'],
  41195. '%d أيام',
  41196. '%d يومًا',
  41197. '%d يوم',
  41198. ],
  41199. M: [
  41200. 'أقل من شهر',
  41201. 'شهر واحد',
  41202. ['شهران', 'شهرين'],
  41203. '%d أشهر',
  41204. '%d شهرا',
  41205. '%d شهر',
  41206. ],
  41207. y: [
  41208. 'أقل من عام',
  41209. 'عام واحد',
  41210. ['عامان', 'عامين'],
  41211. '%d أعوام',
  41212. '%d عامًا',
  41213. '%d عام',
  41214. ],
  41215. },
  41216. pluralize = function (u) {
  41217. return function (number, withoutSuffix, string, isFuture) {
  41218. var f = pluralForm(number),
  41219. str = plurals[u][pluralForm(number)];
  41220. if (f === 2) {
  41221. str = str[withoutSuffix ? 0 : 1];
  41222. }
  41223. return str.replace(/%d/i, number);
  41224. };
  41225. },
  41226. months = [
  41227. 'يناير',
  41228. 'فبراير',
  41229. 'مارس',
  41230. 'أبريل',
  41231. 'مايو',
  41232. 'يونيو',
  41233. 'يوليو',
  41234. 'أغسطس',
  41235. 'سبتمبر',
  41236. 'أكتوبر',
  41237. 'نوفمبر',
  41238. 'ديسمبر',
  41239. ];
  41240. var ar = moment.defineLocale('ar', {
  41241. months: months,
  41242. monthsShort: months,
  41243. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  41244. weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  41245. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  41246. weekdaysParseExact: true,
  41247. longDateFormat: {
  41248. LT: 'HH:mm',
  41249. LTS: 'HH:mm:ss',
  41250. L: 'D/\u200FM/\u200FYYYY',
  41251. LL: 'D MMMM YYYY',
  41252. LLL: 'D MMMM YYYY HH:mm',
  41253. LLLL: 'dddd D MMMM YYYY HH:mm',
  41254. },
  41255. meridiemParse: /ص|م/,
  41256. isPM: function (input) {
  41257. return 'م' === input;
  41258. },
  41259. meridiem: function (hour, minute, isLower) {
  41260. if (hour < 12) {
  41261. return 'ص';
  41262. } else {
  41263. return 'م';
  41264. }
  41265. },
  41266. calendar: {
  41267. sameDay: '[اليوم عند الساعة] LT',
  41268. nextDay: '[غدًا عند الساعة] LT',
  41269. nextWeek: 'dddd [عند الساعة] LT',
  41270. lastDay: '[أمس عند الساعة] LT',
  41271. lastWeek: 'dddd [عند الساعة] LT',
  41272. sameElse: 'L',
  41273. },
  41274. relativeTime: {
  41275. future: 'بعد %s',
  41276. past: 'منذ %s',
  41277. s: pluralize('s'),
  41278. ss: pluralize('s'),
  41279. m: pluralize('m'),
  41280. mm: pluralize('m'),
  41281. h: pluralize('h'),
  41282. hh: pluralize('h'),
  41283. d: pluralize('d'),
  41284. dd: pluralize('d'),
  41285. M: pluralize('M'),
  41286. MM: pluralize('M'),
  41287. y: pluralize('y'),
  41288. yy: pluralize('y'),
  41289. },
  41290. preparse: function (string) {
  41291. return string
  41292. .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
  41293. return numberMap[match];
  41294. })
  41295. .replace(/،/g, ',');
  41296. },
  41297. postformat: function (string) {
  41298. return string
  41299. .replace(/\d/g, function (match) {
  41300. return symbolMap[match];
  41301. })
  41302. .replace(/,/g, '،');
  41303. },
  41304. week: {
  41305. dow: 6, // Saturday is the first day of the week.
  41306. doy: 12, // The week that contains Jan 12th is the first week of the year.
  41307. },
  41308. });
  41309. return ar;
  41310. })));
  41311. /***/ }),
  41312. /***/ "./node_modules/moment/locale/az.js":
  41313. /*!******************************************!*\
  41314. !*** ./node_modules/moment/locale/az.js ***!
  41315. \******************************************/
  41316. /*! no static exports found */
  41317. /***/ (function(module, exports, __webpack_require__) {
  41318. //! moment.js locale configuration
  41319. //! locale : Azerbaijani [az]
  41320. //! author : topchiyev : https://github.com/topchiyev
  41321. ;(function (global, factory) {
  41322. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  41323. undefined
  41324. }(this, (function (moment) { 'use strict';
  41325. //! moment.js locale configuration
  41326. var suffixes = {
  41327. 1: '-inci',
  41328. 5: '-inci',
  41329. 8: '-inci',
  41330. 70: '-inci',
  41331. 80: '-inci',
  41332. 2: '-nci',
  41333. 7: '-nci',
  41334. 20: '-nci',
  41335. 50: '-nci',
  41336. 3: '-üncü',
  41337. 4: '-üncü',
  41338. 100: '-üncü',
  41339. 6: '-ncı',
  41340. 9: '-uncu',
  41341. 10: '-uncu',
  41342. 30: '-uncu',
  41343. 60: '-ıncı',
  41344. 90: '-ıncı',
  41345. };
  41346. var az = moment.defineLocale('az', {
  41347. months: 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split(
  41348. '_'
  41349. ),
  41350. monthsShort: 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),
  41351. weekdays: 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split(
  41352. '_'
  41353. ),
  41354. weekdaysShort: 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),
  41355. weekdaysMin: 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),
  41356. weekdaysParseExact: true,
  41357. longDateFormat: {
  41358. LT: 'HH:mm',
  41359. LTS: 'HH:mm:ss',
  41360. L: 'DD.MM.YYYY',
  41361. LL: 'D MMMM YYYY',
  41362. LLL: 'D MMMM YYYY HH:mm',
  41363. LLLL: 'dddd, D MMMM YYYY HH:mm',
  41364. },
  41365. calendar: {
  41366. sameDay: '[bugün saat] LT',
  41367. nextDay: '[sabah saat] LT',
  41368. nextWeek: '[gələn həftə] dddd [saat] LT',
  41369. lastDay: '[dünən] LT',
  41370. lastWeek: '[keçən həftə] dddd [saat] LT',
  41371. sameElse: 'L',
  41372. },
  41373. relativeTime: {
  41374. future: '%s sonra',
  41375. past: '%s əvvəl',
  41376. s: 'bir neçə saniyə',
  41377. ss: '%d saniyə',
  41378. m: 'bir dəqiqə',
  41379. mm: '%d dəqiqə',
  41380. h: 'bir saat',
  41381. hh: '%d saat',
  41382. d: 'bir gün',
  41383. dd: '%d gün',
  41384. M: 'bir ay',
  41385. MM: '%d ay',
  41386. y: 'bir il',
  41387. yy: '%d il',
  41388. },
  41389. meridiemParse: /gecə|səhər|gündüz|axşam/,
  41390. isPM: function (input) {
  41391. return /^(gündüz|axşam)$/.test(input);
  41392. },
  41393. meridiem: function (hour, minute, isLower) {
  41394. if (hour < 4) {
  41395. return 'gecə';
  41396. } else if (hour < 12) {
  41397. return 'səhər';
  41398. } else if (hour < 17) {
  41399. return 'gündüz';
  41400. } else {
  41401. return 'axşam';
  41402. }
  41403. },
  41404. dayOfMonthOrdinalParse: /\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,
  41405. ordinal: function (number) {
  41406. if (number === 0) {
  41407. // special case for zero
  41408. return number + '-ıncı';
  41409. }
  41410. var a = number % 10,
  41411. b = (number % 100) - a,
  41412. c = number >= 100 ? 100 : null;
  41413. return number + (suffixes[a] || suffixes[b] || suffixes[c]);
  41414. },
  41415. week: {
  41416. dow: 1, // Monday is the first day of the week.
  41417. doy: 7, // The week that contains Jan 7th is the first week of the year.
  41418. },
  41419. });
  41420. return az;
  41421. })));
  41422. /***/ }),
  41423. /***/ "./node_modules/moment/locale/be.js":
  41424. /*!******************************************!*\
  41425. !*** ./node_modules/moment/locale/be.js ***!
  41426. \******************************************/
  41427. /*! no static exports found */
  41428. /***/ (function(module, exports, __webpack_require__) {
  41429. //! moment.js locale configuration
  41430. //! locale : Belarusian [be]
  41431. //! author : Dmitry Demidov : https://github.com/demidov91
  41432. //! author: Praleska: http://praleska.pro/
  41433. //! Author : Menelion Elensúle : https://github.com/Oire
  41434. ;(function (global, factory) {
  41435. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  41436. undefined
  41437. }(this, (function (moment) { 'use strict';
  41438. //! moment.js locale configuration
  41439. function plural(word, num) {
  41440. var forms = word.split('_');
  41441. return num % 10 === 1 && num % 100 !== 11
  41442. ? forms[0]
  41443. : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)
  41444. ? forms[1]
  41445. : forms[2];
  41446. }
  41447. function relativeTimeWithPlural(number, withoutSuffix, key) {
  41448. var format = {
  41449. ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',
  41450. mm: withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',
  41451. hh: withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',
  41452. dd: 'дзень_дні_дзён',
  41453. MM: 'месяц_месяцы_месяцаў',
  41454. yy: 'год_гады_гадоў',
  41455. };
  41456. if (key === 'm') {
  41457. return withoutSuffix ? 'хвіліна' : 'хвіліну';
  41458. } else if (key === 'h') {
  41459. return withoutSuffix ? 'гадзіна' : 'гадзіну';
  41460. } else {
  41461. return number + ' ' + plural(format[key], +number);
  41462. }
  41463. }
  41464. var be = moment.defineLocale('be', {
  41465. months: {
  41466. format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split(
  41467. '_'
  41468. ),
  41469. standalone: 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split(
  41470. '_'
  41471. ),
  41472. },
  41473. monthsShort: 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split(
  41474. '_'
  41475. ),
  41476. weekdays: {
  41477. format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split(
  41478. '_'
  41479. ),
  41480. standalone: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split(
  41481. '_'
  41482. ),
  41483. isFormat: /\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/,
  41484. },
  41485. weekdaysShort: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
  41486. weekdaysMin: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
  41487. longDateFormat: {
  41488. LT: 'HH:mm',
  41489. LTS: 'HH:mm:ss',
  41490. L: 'DD.MM.YYYY',
  41491. LL: 'D MMMM YYYY г.',
  41492. LLL: 'D MMMM YYYY г., HH:mm',
  41493. LLLL: 'dddd, D MMMM YYYY г., HH:mm',
  41494. },
  41495. calendar: {
  41496. sameDay: '[Сёння ў] LT',
  41497. nextDay: '[Заўтра ў] LT',
  41498. lastDay: '[Учора ў] LT',
  41499. nextWeek: function () {
  41500. return '[У] dddd [ў] LT';
  41501. },
  41502. lastWeek: function () {
  41503. switch (this.day()) {
  41504. case 0:
  41505. case 3:
  41506. case 5:
  41507. case 6:
  41508. return '[У мінулую] dddd [ў] LT';
  41509. case 1:
  41510. case 2:
  41511. case 4:
  41512. return '[У мінулы] dddd [ў] LT';
  41513. }
  41514. },
  41515. sameElse: 'L',
  41516. },
  41517. relativeTime: {
  41518. future: 'праз %s',
  41519. past: '%s таму',
  41520. s: 'некалькі секунд',
  41521. m: relativeTimeWithPlural,
  41522. mm: relativeTimeWithPlural,
  41523. h: relativeTimeWithPlural,
  41524. hh: relativeTimeWithPlural,
  41525. d: 'дзень',
  41526. dd: relativeTimeWithPlural,
  41527. M: 'месяц',
  41528. MM: relativeTimeWithPlural,
  41529. y: 'год',
  41530. yy: relativeTimeWithPlural,
  41531. },
  41532. meridiemParse: /ночы|раніцы|дня|вечара/,
  41533. isPM: function (input) {
  41534. return /^(дня|вечара)$/.test(input);
  41535. },
  41536. meridiem: function (hour, minute, isLower) {
  41537. if (hour < 4) {
  41538. return 'ночы';
  41539. } else if (hour < 12) {
  41540. return 'раніцы';
  41541. } else if (hour < 17) {
  41542. return 'дня';
  41543. } else {
  41544. return 'вечара';
  41545. }
  41546. },
  41547. dayOfMonthOrdinalParse: /\d{1,2}-(і|ы|га)/,
  41548. ordinal: function (number, period) {
  41549. switch (period) {
  41550. case 'M':
  41551. case 'd':
  41552. case 'DDD':
  41553. case 'w':
  41554. case 'W':
  41555. return (number % 10 === 2 || number % 10 === 3) &&
  41556. number % 100 !== 12 &&
  41557. number % 100 !== 13
  41558. ? number + '-і'
  41559. : number + '-ы';
  41560. case 'D':
  41561. return number + '-га';
  41562. default:
  41563. return number;
  41564. }
  41565. },
  41566. week: {
  41567. dow: 1, // Monday is the first day of the week.
  41568. doy: 7, // The week that contains Jan 7th is the first week of the year.
  41569. },
  41570. });
  41571. return be;
  41572. })));
  41573. /***/ }),
  41574. /***/ "./node_modules/moment/locale/bg.js":
  41575. /*!******************************************!*\
  41576. !*** ./node_modules/moment/locale/bg.js ***!
  41577. \******************************************/
  41578. /*! no static exports found */
  41579. /***/ (function(module, exports, __webpack_require__) {
  41580. //! moment.js locale configuration
  41581. //! locale : Bulgarian [bg]
  41582. //! author : Krasen Borisov : https://github.com/kraz
  41583. ;(function (global, factory) {
  41584. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  41585. undefined
  41586. }(this, (function (moment) { 'use strict';
  41587. //! moment.js locale configuration
  41588. var bg = moment.defineLocale('bg', {
  41589. months: 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split(
  41590. '_'
  41591. ),
  41592. monthsShort: 'яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),
  41593. weekdays: 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split(
  41594. '_'
  41595. ),
  41596. weekdaysShort: 'нед_пон_вто_сря_чет_пет_съб'.split('_'),
  41597. weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  41598. longDateFormat: {
  41599. LT: 'H:mm',
  41600. LTS: 'H:mm:ss',
  41601. L: 'D.MM.YYYY',
  41602. LL: 'D MMMM YYYY',
  41603. LLL: 'D MMMM YYYY H:mm',
  41604. LLLL: 'dddd, D MMMM YYYY H:mm',
  41605. },
  41606. calendar: {
  41607. sameDay: '[Днес в] LT',
  41608. nextDay: '[Утре в] LT',
  41609. nextWeek: 'dddd [в] LT',
  41610. lastDay: '[Вчера в] LT',
  41611. lastWeek: function () {
  41612. switch (this.day()) {
  41613. case 0:
  41614. case 3:
  41615. case 6:
  41616. return '[Миналата] dddd [в] LT';
  41617. case 1:
  41618. case 2:
  41619. case 4:
  41620. case 5:
  41621. return '[Миналия] dddd [в] LT';
  41622. }
  41623. },
  41624. sameElse: 'L',
  41625. },
  41626. relativeTime: {
  41627. future: 'след %s',
  41628. past: 'преди %s',
  41629. s: 'няколко секунди',
  41630. ss: '%d секунди',
  41631. m: 'минута',
  41632. mm: '%d минути',
  41633. h: 'час',
  41634. hh: '%d часа',
  41635. d: 'ден',
  41636. dd: '%d дена',
  41637. M: 'месец',
  41638. MM: '%d месеца',
  41639. y: 'година',
  41640. yy: '%d години',
  41641. },
  41642. dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
  41643. ordinal: function (number) {
  41644. var lastDigit = number % 10,
  41645. last2Digits = number % 100;
  41646. if (number === 0) {
  41647. return number + '-ев';
  41648. } else if (last2Digits === 0) {
  41649. return number + '-ен';
  41650. } else if (last2Digits > 10 && last2Digits < 20) {
  41651. return number + '-ти';
  41652. } else if (lastDigit === 1) {
  41653. return number + '-ви';
  41654. } else if (lastDigit === 2) {
  41655. return number + '-ри';
  41656. } else if (lastDigit === 7 || lastDigit === 8) {
  41657. return number + '-ми';
  41658. } else {
  41659. return number + '-ти';
  41660. }
  41661. },
  41662. week: {
  41663. dow: 1, // Monday is the first day of the week.
  41664. doy: 7, // The week that contains Jan 7th is the first week of the year.
  41665. },
  41666. });
  41667. return bg;
  41668. })));
  41669. /***/ }),
  41670. /***/ "./node_modules/moment/locale/bm.js":
  41671. /*!******************************************!*\
  41672. !*** ./node_modules/moment/locale/bm.js ***!
  41673. \******************************************/
  41674. /*! no static exports found */
  41675. /***/ (function(module, exports, __webpack_require__) {
  41676. //! moment.js locale configuration
  41677. //! locale : Bambara [bm]
  41678. //! author : Estelle Comment : https://github.com/estellecomment
  41679. ;(function (global, factory) {
  41680. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  41681. undefined
  41682. }(this, (function (moment) { 'use strict';
  41683. //! moment.js locale configuration
  41684. var bm = moment.defineLocale('bm', {
  41685. months: 'Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo'.split(
  41686. '_'
  41687. ),
  41688. monthsShort: 'Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des'.split('_'),
  41689. weekdays: 'Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri'.split('_'),
  41690. weekdaysShort: 'Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib'.split('_'),
  41691. weekdaysMin: 'Ka_Nt_Ta_Ar_Al_Ju_Si'.split('_'),
  41692. longDateFormat: {
  41693. LT: 'HH:mm',
  41694. LTS: 'HH:mm:ss',
  41695. L: 'DD/MM/YYYY',
  41696. LL: 'MMMM [tile] D [san] YYYY',
  41697. LLL: 'MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',
  41698. LLLL: 'dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',
  41699. },
  41700. calendar: {
  41701. sameDay: '[Bi lɛrɛ] LT',
  41702. nextDay: '[Sini lɛrɛ] LT',
  41703. nextWeek: 'dddd [don lɛrɛ] LT',
  41704. lastDay: '[Kunu lɛrɛ] LT',
  41705. lastWeek: 'dddd [tɛmɛnen lɛrɛ] LT',
  41706. sameElse: 'L',
  41707. },
  41708. relativeTime: {
  41709. future: '%s kɔnɔ',
  41710. past: 'a bɛ %s bɔ',
  41711. s: 'sanga dama dama',
  41712. ss: 'sekondi %d',
  41713. m: 'miniti kelen',
  41714. mm: 'miniti %d',
  41715. h: 'lɛrɛ kelen',
  41716. hh: 'lɛrɛ %d',
  41717. d: 'tile kelen',
  41718. dd: 'tile %d',
  41719. M: 'kalo kelen',
  41720. MM: 'kalo %d',
  41721. y: 'san kelen',
  41722. yy: 'san %d',
  41723. },
  41724. week: {
  41725. dow: 1, // Monday is the first day of the week.
  41726. doy: 4, // The week that contains Jan 4th is the first week of the year.
  41727. },
  41728. });
  41729. return bm;
  41730. })));
  41731. /***/ }),
  41732. /***/ "./node_modules/moment/locale/bn.js":
  41733. /*!******************************************!*\
  41734. !*** ./node_modules/moment/locale/bn.js ***!
  41735. \******************************************/
  41736. /*! no static exports found */
  41737. /***/ (function(module, exports, __webpack_require__) {
  41738. //! moment.js locale configuration
  41739. //! locale : Bengali [bn]
  41740. //! author : Kaushik Gandhi : https://github.com/kaushikgandhi
  41741. ;(function (global, factory) {
  41742. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  41743. undefined
  41744. }(this, (function (moment) { 'use strict';
  41745. //! moment.js locale configuration
  41746. var symbolMap = {
  41747. '1': '১',
  41748. '2': '২',
  41749. '3': '৩',
  41750. '4': '৪',
  41751. '5': '৫',
  41752. '6': '৬',
  41753. '7': '৭',
  41754. '8': '৮',
  41755. '9': '৯',
  41756. '0': '০',
  41757. },
  41758. numberMap = {
  41759. '১': '1',
  41760. '২': '2',
  41761. '৩': '3',
  41762. '৪': '4',
  41763. '৫': '5',
  41764. '৬': '6',
  41765. '৭': '7',
  41766. '৮': '8',
  41767. '৯': '9',
  41768. '০': '0',
  41769. };
  41770. var bn = moment.defineLocale('bn', {
  41771. months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split(
  41772. '_'
  41773. ),
  41774. monthsShort: 'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split(
  41775. '_'
  41776. ),
  41777. weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split(
  41778. '_'
  41779. ),
  41780. weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'),
  41781. weekdaysMin: 'রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি'.split('_'),
  41782. longDateFormat: {
  41783. LT: 'A h:mm সময়',
  41784. LTS: 'A h:mm:ss সময়',
  41785. L: 'DD/MM/YYYY',
  41786. LL: 'D MMMM YYYY',
  41787. LLL: 'D MMMM YYYY, A h:mm সময়',
  41788. LLLL: 'dddd, D MMMM YYYY, A h:mm সময়',
  41789. },
  41790. calendar: {
  41791. sameDay: '[আজ] LT',
  41792. nextDay: '[আগামীকাল] LT',
  41793. nextWeek: 'dddd, LT',
  41794. lastDay: '[গতকাল] LT',
  41795. lastWeek: '[গত] dddd, LT',
  41796. sameElse: 'L',
  41797. },
  41798. relativeTime: {
  41799. future: '%s পরে',
  41800. past: '%s আগে',
  41801. s: 'কয়েক সেকেন্ড',
  41802. ss: '%d সেকেন্ড',
  41803. m: 'এক মিনিট',
  41804. mm: '%d মিনিট',
  41805. h: 'এক ঘন্টা',
  41806. hh: '%d ঘন্টা',
  41807. d: 'এক দিন',
  41808. dd: '%d দিন',
  41809. M: 'এক মাস',
  41810. MM: '%d মাস',
  41811. y: 'এক বছর',
  41812. yy: '%d বছর',
  41813. },
  41814. preparse: function (string) {
  41815. return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {
  41816. return numberMap[match];
  41817. });
  41818. },
  41819. postformat: function (string) {
  41820. return string.replace(/\d/g, function (match) {
  41821. return symbolMap[match];
  41822. });
  41823. },
  41824. meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/,
  41825. meridiemHour: function (hour, meridiem) {
  41826. if (hour === 12) {
  41827. hour = 0;
  41828. }
  41829. if (
  41830. (meridiem === 'রাত' && hour >= 4) ||
  41831. (meridiem === 'দুপুর' && hour < 5) ||
  41832. meridiem === 'বিকাল'
  41833. ) {
  41834. return hour + 12;
  41835. } else {
  41836. return hour;
  41837. }
  41838. },
  41839. meridiem: function (hour, minute, isLower) {
  41840. if (hour < 4) {
  41841. return 'রাত';
  41842. } else if (hour < 10) {
  41843. return 'সকাল';
  41844. } else if (hour < 17) {
  41845. return 'দুপুর';
  41846. } else if (hour < 20) {
  41847. return 'বিকাল';
  41848. } else {
  41849. return 'রাত';
  41850. }
  41851. },
  41852. week: {
  41853. dow: 0, // Sunday is the first day of the week.
  41854. doy: 6, // The week that contains Jan 6th is the first week of the year.
  41855. },
  41856. });
  41857. return bn;
  41858. })));
  41859. /***/ }),
  41860. /***/ "./node_modules/moment/locale/bo.js":
  41861. /*!******************************************!*\
  41862. !*** ./node_modules/moment/locale/bo.js ***!
  41863. \******************************************/
  41864. /*! no static exports found */
  41865. /***/ (function(module, exports, __webpack_require__) {
  41866. //! moment.js locale configuration
  41867. //! locale : Tibetan [bo]
  41868. //! author : Thupten N. Chakrishar : https://github.com/vajradog
  41869. ;(function (global, factory) {
  41870. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  41871. undefined
  41872. }(this, (function (moment) { 'use strict';
  41873. //! moment.js locale configuration
  41874. var symbolMap = {
  41875. '1': '༡',
  41876. '2': '༢',
  41877. '3': '༣',
  41878. '4': '༤',
  41879. '5': '༥',
  41880. '6': '༦',
  41881. '7': '༧',
  41882. '8': '༨',
  41883. '9': '༩',
  41884. '0': '༠',
  41885. },
  41886. numberMap = {
  41887. '༡': '1',
  41888. '༢': '2',
  41889. '༣': '3',
  41890. '༤': '4',
  41891. '༥': '5',
  41892. '༦': '6',
  41893. '༧': '7',
  41894. '༨': '8',
  41895. '༩': '9',
  41896. '༠': '0',
  41897. };
  41898. var bo = moment.defineLocale('bo', {
  41899. months: 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split(
  41900. '_'
  41901. ),
  41902. monthsShort: 'ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12'.split(
  41903. '_'
  41904. ),
  41905. monthsShortRegex: /^(ཟླ་\d{1,2})/,
  41906. monthsParseExact: true,
  41907. weekdays: 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split(
  41908. '_'
  41909. ),
  41910. weekdaysShort: 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split(
  41911. '_'
  41912. ),
  41913. weekdaysMin: 'ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན'.split('_'),
  41914. longDateFormat: {
  41915. LT: 'A h:mm',
  41916. LTS: 'A h:mm:ss',
  41917. L: 'DD/MM/YYYY',
  41918. LL: 'D MMMM YYYY',
  41919. LLL: 'D MMMM YYYY, A h:mm',
  41920. LLLL: 'dddd, D MMMM YYYY, A h:mm',
  41921. },
  41922. calendar: {
  41923. sameDay: '[དི་རིང] LT',
  41924. nextDay: '[སང་ཉིན] LT',
  41925. nextWeek: '[བདུན་ཕྲག་རྗེས་མ], LT',
  41926. lastDay: '[ཁ་སང] LT',
  41927. lastWeek: '[བདུན་ཕྲག་མཐའ་མ] dddd, LT',
  41928. sameElse: 'L',
  41929. },
  41930. relativeTime: {
  41931. future: '%s ལ་',
  41932. past: '%s སྔན་ལ',
  41933. s: 'ལམ་སང',
  41934. ss: '%d སྐར་ཆ།',
  41935. m: 'སྐར་མ་གཅིག',
  41936. mm: '%d སྐར་མ',
  41937. h: 'ཆུ་ཚོད་གཅིག',
  41938. hh: '%d ཆུ་ཚོད',
  41939. d: 'ཉིན་གཅིག',
  41940. dd: '%d ཉིན་',
  41941. M: 'ཟླ་བ་གཅིག',
  41942. MM: '%d ཟླ་བ',
  41943. y: 'ལོ་གཅིག',
  41944. yy: '%d ལོ',
  41945. },
  41946. preparse: function (string) {
  41947. return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) {
  41948. return numberMap[match];
  41949. });
  41950. },
  41951. postformat: function (string) {
  41952. return string.replace(/\d/g, function (match) {
  41953. return symbolMap[match];
  41954. });
  41955. },
  41956. meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,
  41957. meridiemHour: function (hour, meridiem) {
  41958. if (hour === 12) {
  41959. hour = 0;
  41960. }
  41961. if (
  41962. (meridiem === 'མཚན་མོ' && hour >= 4) ||
  41963. (meridiem === 'ཉིན་གུང' && hour < 5) ||
  41964. meridiem === 'དགོང་དག'
  41965. ) {
  41966. return hour + 12;
  41967. } else {
  41968. return hour;
  41969. }
  41970. },
  41971. meridiem: function (hour, minute, isLower) {
  41972. if (hour < 4) {
  41973. return 'མཚན་མོ';
  41974. } else if (hour < 10) {
  41975. return 'ཞོགས་ཀས';
  41976. } else if (hour < 17) {
  41977. return 'ཉིན་གུང';
  41978. } else if (hour < 20) {
  41979. return 'དགོང་དག';
  41980. } else {
  41981. return 'མཚན་མོ';
  41982. }
  41983. },
  41984. week: {
  41985. dow: 0, // Sunday is the first day of the week.
  41986. doy: 6, // The week that contains Jan 6th is the first week of the year.
  41987. },
  41988. });
  41989. return bo;
  41990. })));
  41991. /***/ }),
  41992. /***/ "./node_modules/moment/locale/br.js":
  41993. /*!******************************************!*\
  41994. !*** ./node_modules/moment/locale/br.js ***!
  41995. \******************************************/
  41996. /*! no static exports found */
  41997. /***/ (function(module, exports, __webpack_require__) {
  41998. //! moment.js locale configuration
  41999. //! locale : Breton [br]
  42000. //! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou
  42001. ;(function (global, factory) {
  42002. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  42003. undefined
  42004. }(this, (function (moment) { 'use strict';
  42005. //! moment.js locale configuration
  42006. function relativeTimeWithMutation(number, withoutSuffix, key) {
  42007. var format = {
  42008. mm: 'munutenn',
  42009. MM: 'miz',
  42010. dd: 'devezh',
  42011. };
  42012. return number + ' ' + mutation(format[key], number);
  42013. }
  42014. function specialMutationForYears(number) {
  42015. switch (lastNumber(number)) {
  42016. case 1:
  42017. case 3:
  42018. case 4:
  42019. case 5:
  42020. case 9:
  42021. return number + ' bloaz';
  42022. default:
  42023. return number + ' vloaz';
  42024. }
  42025. }
  42026. function lastNumber(number) {
  42027. if (number > 9) {
  42028. return lastNumber(number % 10);
  42029. }
  42030. return number;
  42031. }
  42032. function mutation(text, number) {
  42033. if (number === 2) {
  42034. return softMutation(text);
  42035. }
  42036. return text;
  42037. }
  42038. function softMutation(text) {
  42039. var mutationTable = {
  42040. m: 'v',
  42041. b: 'v',
  42042. d: 'z',
  42043. };
  42044. if (mutationTable[text.charAt(0)] === undefined) {
  42045. return text;
  42046. }
  42047. return mutationTable[text.charAt(0)] + text.substring(1);
  42048. }
  42049. var monthsParse = [
  42050. /^gen/i,
  42051. /^c[ʼ\']hwe/i,
  42052. /^meu/i,
  42053. /^ebr/i,
  42054. /^mae/i,
  42055. /^(mez|eve)/i,
  42056. /^gou/i,
  42057. /^eos/i,
  42058. /^gwe/i,
  42059. /^her/i,
  42060. /^du/i,
  42061. /^ker/i,
  42062. ],
  42063. monthsRegex = /^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu|gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,
  42064. monthsStrictRegex = /^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,
  42065. monthsShortStrictRegex = /^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,
  42066. fullWeekdaysParse = [
  42067. /^sul/i,
  42068. /^lun/i,
  42069. /^meurzh/i,
  42070. /^merc[ʼ\']her/i,
  42071. /^yaou/i,
  42072. /^gwener/i,
  42073. /^sadorn/i,
  42074. ],
  42075. shortWeekdaysParse = [
  42076. /^Sul/i,
  42077. /^Lun/i,
  42078. /^Meu/i,
  42079. /^Mer/i,
  42080. /^Yao/i,
  42081. /^Gwe/i,
  42082. /^Sad/i,
  42083. ],
  42084. minWeekdaysParse = [
  42085. /^Su/i,
  42086. /^Lu/i,
  42087. /^Me([^r]|$)/i,
  42088. /^Mer/i,
  42089. /^Ya/i,
  42090. /^Gw/i,
  42091. /^Sa/i,
  42092. ];
  42093. var br = moment.defineLocale('br', {
  42094. months: 'Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split(
  42095. '_'
  42096. ),
  42097. monthsShort: 'Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),
  42098. weekdays: 'Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn'.split('_'),
  42099. weekdaysShort: 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),
  42100. weekdaysMin: 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),
  42101. weekdaysParse: minWeekdaysParse,
  42102. fullWeekdaysParse: fullWeekdaysParse,
  42103. shortWeekdaysParse: shortWeekdaysParse,
  42104. minWeekdaysParse: minWeekdaysParse,
  42105. monthsRegex: monthsRegex,
  42106. monthsShortRegex: monthsRegex,
  42107. monthsStrictRegex: monthsStrictRegex,
  42108. monthsShortStrictRegex: monthsShortStrictRegex,
  42109. monthsParse: monthsParse,
  42110. longMonthsParse: monthsParse,
  42111. shortMonthsParse: monthsParse,
  42112. longDateFormat: {
  42113. LT: 'HH:mm',
  42114. LTS: 'HH:mm:ss',
  42115. L: 'DD/MM/YYYY',
  42116. LL: 'D [a viz] MMMM YYYY',
  42117. LLL: 'D [a viz] MMMM YYYY HH:mm',
  42118. LLLL: 'dddd, D [a viz] MMMM YYYY HH:mm',
  42119. },
  42120. calendar: {
  42121. sameDay: '[Hiziv da] LT',
  42122. nextDay: '[Warcʼhoazh da] LT',
  42123. nextWeek: 'dddd [da] LT',
  42124. lastDay: '[Decʼh da] LT',
  42125. lastWeek: 'dddd [paset da] LT',
  42126. sameElse: 'L',
  42127. },
  42128. relativeTime: {
  42129. future: 'a-benn %s',
  42130. past: '%s ʼzo',
  42131. s: 'un nebeud segondennoù',
  42132. ss: '%d eilenn',
  42133. m: 'ur vunutenn',
  42134. mm: relativeTimeWithMutation,
  42135. h: 'un eur',
  42136. hh: '%d eur',
  42137. d: 'un devezh',
  42138. dd: relativeTimeWithMutation,
  42139. M: 'ur miz',
  42140. MM: relativeTimeWithMutation,
  42141. y: 'ur bloaz',
  42142. yy: specialMutationForYears,
  42143. },
  42144. dayOfMonthOrdinalParse: /\d{1,2}(añ|vet)/,
  42145. ordinal: function (number) {
  42146. var output = number === 1 ? 'añ' : 'vet';
  42147. return number + output;
  42148. },
  42149. week: {
  42150. dow: 1, // Monday is the first day of the week.
  42151. doy: 4, // The week that contains Jan 4th is the first week of the year.
  42152. },
  42153. meridiemParse: /a.m.|g.m./, // goude merenn | a-raok merenn
  42154. isPM: function (token) {
  42155. return token === 'g.m.';
  42156. },
  42157. meridiem: function (hour, minute, isLower) {
  42158. return hour < 12 ? 'a.m.' : 'g.m.';
  42159. },
  42160. });
  42161. return br;
  42162. })));
  42163. /***/ }),
  42164. /***/ "./node_modules/moment/locale/bs.js":
  42165. /*!******************************************!*\
  42166. !*** ./node_modules/moment/locale/bs.js ***!
  42167. \******************************************/
  42168. /*! no static exports found */
  42169. /***/ (function(module, exports, __webpack_require__) {
  42170. //! moment.js locale configuration
  42171. //! locale : Bosnian [bs]
  42172. //! author : Nedim Cholich : https://github.com/frontyard
  42173. //! based on (hr) translation by Bojan Marković
  42174. ;(function (global, factory) {
  42175. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  42176. undefined
  42177. }(this, (function (moment) { 'use strict';
  42178. //! moment.js locale configuration
  42179. function translate(number, withoutSuffix, key) {
  42180. var result = number + ' ';
  42181. switch (key) {
  42182. case 'ss':
  42183. if (number === 1) {
  42184. result += 'sekunda';
  42185. } else if (number === 2 || number === 3 || number === 4) {
  42186. result += 'sekunde';
  42187. } else {
  42188. result += 'sekundi';
  42189. }
  42190. return result;
  42191. case 'm':
  42192. return withoutSuffix ? 'jedna minuta' : 'jedne minute';
  42193. case 'mm':
  42194. if (number === 1) {
  42195. result += 'minuta';
  42196. } else if (number === 2 || number === 3 || number === 4) {
  42197. result += 'minute';
  42198. } else {
  42199. result += 'minuta';
  42200. }
  42201. return result;
  42202. case 'h':
  42203. return withoutSuffix ? 'jedan sat' : 'jednog sata';
  42204. case 'hh':
  42205. if (number === 1) {
  42206. result += 'sat';
  42207. } else if (number === 2 || number === 3 || number === 4) {
  42208. result += 'sata';
  42209. } else {
  42210. result += 'sati';
  42211. }
  42212. return result;
  42213. case 'dd':
  42214. if (number === 1) {
  42215. result += 'dan';
  42216. } else {
  42217. result += 'dana';
  42218. }
  42219. return result;
  42220. case 'MM':
  42221. if (number === 1) {
  42222. result += 'mjesec';
  42223. } else if (number === 2 || number === 3 || number === 4) {
  42224. result += 'mjeseca';
  42225. } else {
  42226. result += 'mjeseci';
  42227. }
  42228. return result;
  42229. case 'yy':
  42230. if (number === 1) {
  42231. result += 'godina';
  42232. } else if (number === 2 || number === 3 || number === 4) {
  42233. result += 'godine';
  42234. } else {
  42235. result += 'godina';
  42236. }
  42237. return result;
  42238. }
  42239. }
  42240. var bs = moment.defineLocale('bs', {
  42241. months: 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split(
  42242. '_'
  42243. ),
  42244. monthsShort: 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split(
  42245. '_'
  42246. ),
  42247. monthsParseExact: true,
  42248. weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(
  42249. '_'
  42250. ),
  42251. weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  42252. weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
  42253. weekdaysParseExact: true,
  42254. longDateFormat: {
  42255. LT: 'H:mm',
  42256. LTS: 'H:mm:ss',
  42257. L: 'DD.MM.YYYY',
  42258. LL: 'D. MMMM YYYY',
  42259. LLL: 'D. MMMM YYYY H:mm',
  42260. LLLL: 'dddd, D. MMMM YYYY H:mm',
  42261. },
  42262. calendar: {
  42263. sameDay: '[danas u] LT',
  42264. nextDay: '[sutra u] LT',
  42265. nextWeek: function () {
  42266. switch (this.day()) {
  42267. case 0:
  42268. return '[u] [nedjelju] [u] LT';
  42269. case 3:
  42270. return '[u] [srijedu] [u] LT';
  42271. case 6:
  42272. return '[u] [subotu] [u] LT';
  42273. case 1:
  42274. case 2:
  42275. case 4:
  42276. case 5:
  42277. return '[u] dddd [u] LT';
  42278. }
  42279. },
  42280. lastDay: '[jučer u] LT',
  42281. lastWeek: function () {
  42282. switch (this.day()) {
  42283. case 0:
  42284. case 3:
  42285. return '[prošlu] dddd [u] LT';
  42286. case 6:
  42287. return '[prošle] [subote] [u] LT';
  42288. case 1:
  42289. case 2:
  42290. case 4:
  42291. case 5:
  42292. return '[prošli] dddd [u] LT';
  42293. }
  42294. },
  42295. sameElse: 'L',
  42296. },
  42297. relativeTime: {
  42298. future: 'za %s',
  42299. past: 'prije %s',
  42300. s: 'par sekundi',
  42301. ss: translate,
  42302. m: translate,
  42303. mm: translate,
  42304. h: translate,
  42305. hh: translate,
  42306. d: 'dan',
  42307. dd: translate,
  42308. M: 'mjesec',
  42309. MM: translate,
  42310. y: 'godinu',
  42311. yy: translate,
  42312. },
  42313. dayOfMonthOrdinalParse: /\d{1,2}\./,
  42314. ordinal: '%d.',
  42315. week: {
  42316. dow: 1, // Monday is the first day of the week.
  42317. doy: 7, // The week that contains Jan 7th is the first week of the year.
  42318. },
  42319. });
  42320. return bs;
  42321. })));
  42322. /***/ }),
  42323. /***/ "./node_modules/moment/locale/ca.js":
  42324. /*!******************************************!*\
  42325. !*** ./node_modules/moment/locale/ca.js ***!
  42326. \******************************************/
  42327. /*! no static exports found */
  42328. /***/ (function(module, exports, __webpack_require__) {
  42329. //! moment.js locale configuration
  42330. //! locale : Catalan [ca]
  42331. //! author : Juan G. Hurtado : https://github.com/juanghurtado
  42332. ;(function (global, factory) {
  42333. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  42334. undefined
  42335. }(this, (function (moment) { 'use strict';
  42336. //! moment.js locale configuration
  42337. var ca = moment.defineLocale('ca', {
  42338. months: {
  42339. standalone: 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split(
  42340. '_'
  42341. ),
  42342. format: "de gener_de febrer_de març_d'abril_de maig_de juny_de juliol_d'agost_de setembre_d'octubre_de novembre_de desembre".split(
  42343. '_'
  42344. ),
  42345. isFormat: /D[oD]?(\s)+MMMM/,
  42346. },
  42347. monthsShort: 'gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.'.split(
  42348. '_'
  42349. ),
  42350. monthsParseExact: true,
  42351. weekdays: 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split(
  42352. '_'
  42353. ),
  42354. weekdaysShort: 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),
  42355. weekdaysMin: 'dg_dl_dt_dc_dj_dv_ds'.split('_'),
  42356. weekdaysParseExact: true,
  42357. longDateFormat: {
  42358. LT: 'H:mm',
  42359. LTS: 'H:mm:ss',
  42360. L: 'DD/MM/YYYY',
  42361. LL: 'D MMMM [de] YYYY',
  42362. ll: 'D MMM YYYY',
  42363. LLL: 'D MMMM [de] YYYY [a les] H:mm',
  42364. lll: 'D MMM YYYY, H:mm',
  42365. LLLL: 'dddd D MMMM [de] YYYY [a les] H:mm',
  42366. llll: 'ddd D MMM YYYY, H:mm',
  42367. },
  42368. calendar: {
  42369. sameDay: function () {
  42370. return '[avui a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
  42371. },
  42372. nextDay: function () {
  42373. return '[demà a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
  42374. },
  42375. nextWeek: function () {
  42376. return 'dddd [a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
  42377. },
  42378. lastDay: function () {
  42379. return '[ahir a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
  42380. },
  42381. lastWeek: function () {
  42382. return (
  42383. '[el] dddd [passat a ' +
  42384. (this.hours() !== 1 ? 'les' : 'la') +
  42385. '] LT'
  42386. );
  42387. },
  42388. sameElse: 'L',
  42389. },
  42390. relativeTime: {
  42391. future: "d'aquí %s",
  42392. past: 'fa %s',
  42393. s: 'uns segons',
  42394. ss: '%d segons',
  42395. m: 'un minut',
  42396. mm: '%d minuts',
  42397. h: 'una hora',
  42398. hh: '%d hores',
  42399. d: 'un dia',
  42400. dd: '%d dies',
  42401. M: 'un mes',
  42402. MM: '%d mesos',
  42403. y: 'un any',
  42404. yy: '%d anys',
  42405. },
  42406. dayOfMonthOrdinalParse: /\d{1,2}(r|n|t|è|a)/,
  42407. ordinal: function (number, period) {
  42408. var output =
  42409. number === 1
  42410. ? 'r'
  42411. : number === 2
  42412. ? 'n'
  42413. : number === 3
  42414. ? 'r'
  42415. : number === 4
  42416. ? 't'
  42417. : 'è';
  42418. if (period === 'w' || period === 'W') {
  42419. output = 'a';
  42420. }
  42421. return number + output;
  42422. },
  42423. week: {
  42424. dow: 1, // Monday is the first day of the week.
  42425. doy: 4, // The week that contains Jan 4th is the first week of the year.
  42426. },
  42427. });
  42428. return ca;
  42429. })));
  42430. /***/ }),
  42431. /***/ "./node_modules/moment/locale/cs.js":
  42432. /*!******************************************!*\
  42433. !*** ./node_modules/moment/locale/cs.js ***!
  42434. \******************************************/
  42435. /*! no static exports found */
  42436. /***/ (function(module, exports, __webpack_require__) {
  42437. //! moment.js locale configuration
  42438. //! locale : Czech [cs]
  42439. //! author : petrbela : https://github.com/petrbela
  42440. ;(function (global, factory) {
  42441. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  42442. undefined
  42443. }(this, (function (moment) { 'use strict';
  42444. //! moment.js locale configuration
  42445. var months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split(
  42446. '_'
  42447. ),
  42448. monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_'),
  42449. monthsParse = [
  42450. /^led/i,
  42451. /^úno/i,
  42452. /^bře/i,
  42453. /^dub/i,
  42454. /^kvě/i,
  42455. /^(čvn|červen$|června)/i,
  42456. /^(čvc|červenec|července)/i,
  42457. /^srp/i,
  42458. /^zář/i,
  42459. /^říj/i,
  42460. /^lis/i,
  42461. /^pro/i,
  42462. ],
  42463. // NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched.
  42464. // Otherwise parser matches '1. červenec' as '1. červen' + 'ec'.
  42465. monthsRegex = /^(leden|únor|březen|duben|květen|červenec|července|červen|června|srpen|září|říjen|listopad|prosinec|led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i;
  42466. function plural(n) {
  42467. return n > 1 && n < 5 && ~~(n / 10) !== 1;
  42468. }
  42469. function translate(number, withoutSuffix, key, isFuture) {
  42470. var result = number + ' ';
  42471. switch (key) {
  42472. case 's': // a few seconds / in a few seconds / a few seconds ago
  42473. return withoutSuffix || isFuture ? 'pár sekund' : 'pár sekundami';
  42474. case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago
  42475. if (withoutSuffix || isFuture) {
  42476. return result + (plural(number) ? 'sekundy' : 'sekund');
  42477. } else {
  42478. return result + 'sekundami';
  42479. }
  42480. case 'm': // a minute / in a minute / a minute ago
  42481. return withoutSuffix ? 'minuta' : isFuture ? 'minutu' : 'minutou';
  42482. case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
  42483. if (withoutSuffix || isFuture) {
  42484. return result + (plural(number) ? 'minuty' : 'minut');
  42485. } else {
  42486. return result + 'minutami';
  42487. }
  42488. case 'h': // an hour / in an hour / an hour ago
  42489. return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';
  42490. case 'hh': // 9 hours / in 9 hours / 9 hours ago
  42491. if (withoutSuffix || isFuture) {
  42492. return result + (plural(number) ? 'hodiny' : 'hodin');
  42493. } else {
  42494. return result + 'hodinami';
  42495. }
  42496. case 'd': // a day / in a day / a day ago
  42497. return withoutSuffix || isFuture ? 'den' : 'dnem';
  42498. case 'dd': // 9 days / in 9 days / 9 days ago
  42499. if (withoutSuffix || isFuture) {
  42500. return result + (plural(number) ? 'dny' : 'dní');
  42501. } else {
  42502. return result + 'dny';
  42503. }
  42504. case 'M': // a month / in a month / a month ago
  42505. return withoutSuffix || isFuture ? 'měsíc' : 'měsícem';
  42506. case 'MM': // 9 months / in 9 months / 9 months ago
  42507. if (withoutSuffix || isFuture) {
  42508. return result + (plural(number) ? 'měsíce' : 'měsíců');
  42509. } else {
  42510. return result + 'měsíci';
  42511. }
  42512. case 'y': // a year / in a year / a year ago
  42513. return withoutSuffix || isFuture ? 'rok' : 'rokem';
  42514. case 'yy': // 9 years / in 9 years / 9 years ago
  42515. if (withoutSuffix || isFuture) {
  42516. return result + (plural(number) ? 'roky' : 'let');
  42517. } else {
  42518. return result + 'lety';
  42519. }
  42520. }
  42521. }
  42522. var cs = moment.defineLocale('cs', {
  42523. months: months,
  42524. monthsShort: monthsShort,
  42525. monthsRegex: monthsRegex,
  42526. monthsShortRegex: monthsRegex,
  42527. // NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched.
  42528. // Otherwise parser matches '1. červenec' as '1. červen' + 'ec'.
  42529. monthsStrictRegex: /^(leden|ledna|února|únor|březen|března|duben|dubna|květen|května|červenec|července|červen|června|srpen|srpna|září|říjen|října|listopadu|listopad|prosinec|prosince)/i,
  42530. monthsShortStrictRegex: /^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,
  42531. monthsParse: monthsParse,
  42532. longMonthsParse: monthsParse,
  42533. shortMonthsParse: monthsParse,
  42534. weekdays: 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),
  42535. weekdaysShort: 'ne_po_út_st_čt_pá_so'.split('_'),
  42536. weekdaysMin: 'ne_po_út_st_čt_pá_so'.split('_'),
  42537. longDateFormat: {
  42538. LT: 'H:mm',
  42539. LTS: 'H:mm:ss',
  42540. L: 'DD.MM.YYYY',
  42541. LL: 'D. MMMM YYYY',
  42542. LLL: 'D. MMMM YYYY H:mm',
  42543. LLLL: 'dddd D. MMMM YYYY H:mm',
  42544. l: 'D. M. YYYY',
  42545. },
  42546. calendar: {
  42547. sameDay: '[dnes v] LT',
  42548. nextDay: '[zítra v] LT',
  42549. nextWeek: function () {
  42550. switch (this.day()) {
  42551. case 0:
  42552. return '[v neděli v] LT';
  42553. case 1:
  42554. case 2:
  42555. return '[v] dddd [v] LT';
  42556. case 3:
  42557. return '[ve středu v] LT';
  42558. case 4:
  42559. return '[ve čtvrtek v] LT';
  42560. case 5:
  42561. return '[v pátek v] LT';
  42562. case 6:
  42563. return '[v sobotu v] LT';
  42564. }
  42565. },
  42566. lastDay: '[včera v] LT',
  42567. lastWeek: function () {
  42568. switch (this.day()) {
  42569. case 0:
  42570. return '[minulou neděli v] LT';
  42571. case 1:
  42572. case 2:
  42573. return '[minulé] dddd [v] LT';
  42574. case 3:
  42575. return '[minulou středu v] LT';
  42576. case 4:
  42577. case 5:
  42578. return '[minulý] dddd [v] LT';
  42579. case 6:
  42580. return '[minulou sobotu v] LT';
  42581. }
  42582. },
  42583. sameElse: 'L',
  42584. },
  42585. relativeTime: {
  42586. future: 'za %s',
  42587. past: 'před %s',
  42588. s: translate,
  42589. ss: translate,
  42590. m: translate,
  42591. mm: translate,
  42592. h: translate,
  42593. hh: translate,
  42594. d: translate,
  42595. dd: translate,
  42596. M: translate,
  42597. MM: translate,
  42598. y: translate,
  42599. yy: translate,
  42600. },
  42601. dayOfMonthOrdinalParse: /\d{1,2}\./,
  42602. ordinal: '%d.',
  42603. week: {
  42604. dow: 1, // Monday is the first day of the week.
  42605. doy: 4, // The week that contains Jan 4th is the first week of the year.
  42606. },
  42607. });
  42608. return cs;
  42609. })));
  42610. /***/ }),
  42611. /***/ "./node_modules/moment/locale/cv.js":
  42612. /*!******************************************!*\
  42613. !*** ./node_modules/moment/locale/cv.js ***!
  42614. \******************************************/
  42615. /*! no static exports found */
  42616. /***/ (function(module, exports, __webpack_require__) {
  42617. //! moment.js locale configuration
  42618. //! locale : Chuvash [cv]
  42619. //! author : Anatoly Mironov : https://github.com/mirontoli
  42620. ;(function (global, factory) {
  42621. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  42622. undefined
  42623. }(this, (function (moment) { 'use strict';
  42624. //! moment.js locale configuration
  42625. var cv = moment.defineLocale('cv', {
  42626. months: 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split(
  42627. '_'
  42628. ),
  42629. monthsShort: 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'),
  42630. weekdays: 'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split(
  42631. '_'
  42632. ),
  42633. weekdaysShort: 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'),
  42634. weekdaysMin: 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'),
  42635. longDateFormat: {
  42636. LT: 'HH:mm',
  42637. LTS: 'HH:mm:ss',
  42638. L: 'DD-MM-YYYY',
  42639. LL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]',
  42640. LLL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
  42641. LLLL: 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
  42642. },
  42643. calendar: {
  42644. sameDay: '[Паян] LT [сехетре]',
  42645. nextDay: '[Ыран] LT [сехетре]',
  42646. lastDay: '[Ӗнер] LT [сехетре]',
  42647. nextWeek: '[Ҫитес] dddd LT [сехетре]',
  42648. lastWeek: '[Иртнӗ] dddd LT [сехетре]',
  42649. sameElse: 'L',
  42650. },
  42651. relativeTime: {
  42652. future: function (output) {
  42653. var affix = /сехет$/i.exec(output)
  42654. ? 'рен'
  42655. : /ҫул$/i.exec(output)
  42656. ? 'тан'
  42657. : 'ран';
  42658. return output + affix;
  42659. },
  42660. past: '%s каялла',
  42661. s: 'пӗр-ик ҫеккунт',
  42662. ss: '%d ҫеккунт',
  42663. m: 'пӗр минут',
  42664. mm: '%d минут',
  42665. h: 'пӗр сехет',
  42666. hh: '%d сехет',
  42667. d: 'пӗр кун',
  42668. dd: '%d кун',
  42669. M: 'пӗр уйӑх',
  42670. MM: '%d уйӑх',
  42671. y: 'пӗр ҫул',
  42672. yy: '%d ҫул',
  42673. },
  42674. dayOfMonthOrdinalParse: /\d{1,2}-мӗш/,
  42675. ordinal: '%d-мӗш',
  42676. week: {
  42677. dow: 1, // Monday is the first day of the week.
  42678. doy: 7, // The week that contains Jan 7th is the first week of the year.
  42679. },
  42680. });
  42681. return cv;
  42682. })));
  42683. /***/ }),
  42684. /***/ "./node_modules/moment/locale/cy.js":
  42685. /*!******************************************!*\
  42686. !*** ./node_modules/moment/locale/cy.js ***!
  42687. \******************************************/
  42688. /*! no static exports found */
  42689. /***/ (function(module, exports, __webpack_require__) {
  42690. //! moment.js locale configuration
  42691. //! locale : Welsh [cy]
  42692. //! author : Robert Allen : https://github.com/robgallen
  42693. //! author : https://github.com/ryangreaves
  42694. ;(function (global, factory) {
  42695. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  42696. undefined
  42697. }(this, (function (moment) { 'use strict';
  42698. //! moment.js locale configuration
  42699. var cy = moment.defineLocale('cy', {
  42700. months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split(
  42701. '_'
  42702. ),
  42703. monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split(
  42704. '_'
  42705. ),
  42706. weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split(
  42707. '_'
  42708. ),
  42709. weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),
  42710. weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),
  42711. weekdaysParseExact: true,
  42712. // time formats are the same as en-gb
  42713. longDateFormat: {
  42714. LT: 'HH:mm',
  42715. LTS: 'HH:mm:ss',
  42716. L: 'DD/MM/YYYY',
  42717. LL: 'D MMMM YYYY',
  42718. LLL: 'D MMMM YYYY HH:mm',
  42719. LLLL: 'dddd, D MMMM YYYY HH:mm',
  42720. },
  42721. calendar: {
  42722. sameDay: '[Heddiw am] LT',
  42723. nextDay: '[Yfory am] LT',
  42724. nextWeek: 'dddd [am] LT',
  42725. lastDay: '[Ddoe am] LT',
  42726. lastWeek: 'dddd [diwethaf am] LT',
  42727. sameElse: 'L',
  42728. },
  42729. relativeTime: {
  42730. future: 'mewn %s',
  42731. past: '%s yn ôl',
  42732. s: 'ychydig eiliadau',
  42733. ss: '%d eiliad',
  42734. m: 'munud',
  42735. mm: '%d munud',
  42736. h: 'awr',
  42737. hh: '%d awr',
  42738. d: 'diwrnod',
  42739. dd: '%d diwrnod',
  42740. M: 'mis',
  42741. MM: '%d mis',
  42742. y: 'blwyddyn',
  42743. yy: '%d flynedd',
  42744. },
  42745. dayOfMonthOrdinalParse: /\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,
  42746. // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh
  42747. ordinal: function (number) {
  42748. var b = number,
  42749. output = '',
  42750. lookup = [
  42751. '',
  42752. 'af',
  42753. 'il',
  42754. 'ydd',
  42755. 'ydd',
  42756. 'ed',
  42757. 'ed',
  42758. 'ed',
  42759. 'fed',
  42760. 'fed',
  42761. 'fed', // 1af to 10fed
  42762. 'eg',
  42763. 'fed',
  42764. 'eg',
  42765. 'eg',
  42766. 'fed',
  42767. 'eg',
  42768. 'eg',
  42769. 'fed',
  42770. 'eg',
  42771. 'fed', // 11eg to 20fed
  42772. ];
  42773. if (b > 20) {
  42774. if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {
  42775. output = 'fed'; // not 30ain, 70ain or 90ain
  42776. } else {
  42777. output = 'ain';
  42778. }
  42779. } else if (b > 0) {
  42780. output = lookup[b];
  42781. }
  42782. return number + output;
  42783. },
  42784. week: {
  42785. dow: 1, // Monday is the first day of the week.
  42786. doy: 4, // The week that contains Jan 4th is the first week of the year.
  42787. },
  42788. });
  42789. return cy;
  42790. })));
  42791. /***/ }),
  42792. /***/ "./node_modules/moment/locale/da.js":
  42793. /*!******************************************!*\
  42794. !*** ./node_modules/moment/locale/da.js ***!
  42795. \******************************************/
  42796. /*! no static exports found */
  42797. /***/ (function(module, exports, __webpack_require__) {
  42798. //! moment.js locale configuration
  42799. //! locale : Danish [da]
  42800. //! author : Ulrik Nielsen : https://github.com/mrbase
  42801. ;(function (global, factory) {
  42802. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  42803. undefined
  42804. }(this, (function (moment) { 'use strict';
  42805. //! moment.js locale configuration
  42806. var da = moment.defineLocale('da', {
  42807. months: 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split(
  42808. '_'
  42809. ),
  42810. monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
  42811. weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
  42812. weekdaysShort: 'søn_man_tir_ons_tor_fre_lør'.split('_'),
  42813. weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'),
  42814. longDateFormat: {
  42815. LT: 'HH:mm',
  42816. LTS: 'HH:mm:ss',
  42817. L: 'DD.MM.YYYY',
  42818. LL: 'D. MMMM YYYY',
  42819. LLL: 'D. MMMM YYYY HH:mm',
  42820. LLLL: 'dddd [d.] D. MMMM YYYY [kl.] HH:mm',
  42821. },
  42822. calendar: {
  42823. sameDay: '[i dag kl.] LT',
  42824. nextDay: '[i morgen kl.] LT',
  42825. nextWeek: 'på dddd [kl.] LT',
  42826. lastDay: '[i går kl.] LT',
  42827. lastWeek: '[i] dddd[s kl.] LT',
  42828. sameElse: 'L',
  42829. },
  42830. relativeTime: {
  42831. future: 'om %s',
  42832. past: '%s siden',
  42833. s: 'få sekunder',
  42834. ss: '%d sekunder',
  42835. m: 'et minut',
  42836. mm: '%d minutter',
  42837. h: 'en time',
  42838. hh: '%d timer',
  42839. d: 'en dag',
  42840. dd: '%d dage',
  42841. M: 'en måned',
  42842. MM: '%d måneder',
  42843. y: 'et år',
  42844. yy: '%d år',
  42845. },
  42846. dayOfMonthOrdinalParse: /\d{1,2}\./,
  42847. ordinal: '%d.',
  42848. week: {
  42849. dow: 1, // Monday is the first day of the week.
  42850. doy: 4, // The week that contains Jan 4th is the first week of the year.
  42851. },
  42852. });
  42853. return da;
  42854. })));
  42855. /***/ }),
  42856. /***/ "./node_modules/moment/locale/de-at.js":
  42857. /*!*********************************************!*\
  42858. !*** ./node_modules/moment/locale/de-at.js ***!
  42859. \*********************************************/
  42860. /*! no static exports found */
  42861. /***/ (function(module, exports, __webpack_require__) {
  42862. //! moment.js locale configuration
  42863. //! locale : German (Austria) [de-at]
  42864. //! author : lluchs : https://github.com/lluchs
  42865. //! author: Menelion Elensúle: https://github.com/Oire
  42866. //! author : Martin Groller : https://github.com/MadMG
  42867. //! author : Mikolaj Dadela : https://github.com/mik01aj
  42868. ;(function (global, factory) {
  42869. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  42870. undefined
  42871. }(this, (function (moment) { 'use strict';
  42872. //! moment.js locale configuration
  42873. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  42874. var format = {
  42875. m: ['eine Minute', 'einer Minute'],
  42876. h: ['eine Stunde', 'einer Stunde'],
  42877. d: ['ein Tag', 'einem Tag'],
  42878. dd: [number + ' Tage', number + ' Tagen'],
  42879. w: ['eine Woche', 'einer Woche'],
  42880. M: ['ein Monat', 'einem Monat'],
  42881. MM: [number + ' Monate', number + ' Monaten'],
  42882. y: ['ein Jahr', 'einem Jahr'],
  42883. yy: [number + ' Jahre', number + ' Jahren'],
  42884. };
  42885. return withoutSuffix ? format[key][0] : format[key][1];
  42886. }
  42887. var deAt = moment.defineLocale('de-at', {
  42888. months: 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(
  42889. '_'
  42890. ),
  42891. monthsShort: 'Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split(
  42892. '_'
  42893. ),
  42894. monthsParseExact: true,
  42895. weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(
  42896. '_'
  42897. ),
  42898. weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
  42899. weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  42900. weekdaysParseExact: true,
  42901. longDateFormat: {
  42902. LT: 'HH:mm',
  42903. LTS: 'HH:mm:ss',
  42904. L: 'DD.MM.YYYY',
  42905. LL: 'D. MMMM YYYY',
  42906. LLL: 'D. MMMM YYYY HH:mm',
  42907. LLLL: 'dddd, D. MMMM YYYY HH:mm',
  42908. },
  42909. calendar: {
  42910. sameDay: '[heute um] LT [Uhr]',
  42911. sameElse: 'L',
  42912. nextDay: '[morgen um] LT [Uhr]',
  42913. nextWeek: 'dddd [um] LT [Uhr]',
  42914. lastDay: '[gestern um] LT [Uhr]',
  42915. lastWeek: '[letzten] dddd [um] LT [Uhr]',
  42916. },
  42917. relativeTime: {
  42918. future: 'in %s',
  42919. past: 'vor %s',
  42920. s: 'ein paar Sekunden',
  42921. ss: '%d Sekunden',
  42922. m: processRelativeTime,
  42923. mm: '%d Minuten',
  42924. h: processRelativeTime,
  42925. hh: '%d Stunden',
  42926. d: processRelativeTime,
  42927. dd: processRelativeTime,
  42928. w: processRelativeTime,
  42929. ww: '%d Wochen',
  42930. M: processRelativeTime,
  42931. MM: processRelativeTime,
  42932. y: processRelativeTime,
  42933. yy: processRelativeTime,
  42934. },
  42935. dayOfMonthOrdinalParse: /\d{1,2}\./,
  42936. ordinal: '%d.',
  42937. week: {
  42938. dow: 1, // Monday is the first day of the week.
  42939. doy: 4, // The week that contains Jan 4th is the first week of the year.
  42940. },
  42941. });
  42942. return deAt;
  42943. })));
  42944. /***/ }),
  42945. /***/ "./node_modules/moment/locale/de-ch.js":
  42946. /*!*********************************************!*\
  42947. !*** ./node_modules/moment/locale/de-ch.js ***!
  42948. \*********************************************/
  42949. /*! no static exports found */
  42950. /***/ (function(module, exports, __webpack_require__) {
  42951. //! moment.js locale configuration
  42952. //! locale : German (Switzerland) [de-ch]
  42953. //! author : sschueller : https://github.com/sschueller
  42954. ;(function (global, factory) {
  42955. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  42956. undefined
  42957. }(this, (function (moment) { 'use strict';
  42958. //! moment.js locale configuration
  42959. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  42960. var format = {
  42961. m: ['eine Minute', 'einer Minute'],
  42962. h: ['eine Stunde', 'einer Stunde'],
  42963. d: ['ein Tag', 'einem Tag'],
  42964. dd: [number + ' Tage', number + ' Tagen'],
  42965. w: ['eine Woche', 'einer Woche'],
  42966. M: ['ein Monat', 'einem Monat'],
  42967. MM: [number + ' Monate', number + ' Monaten'],
  42968. y: ['ein Jahr', 'einem Jahr'],
  42969. yy: [number + ' Jahre', number + ' Jahren'],
  42970. };
  42971. return withoutSuffix ? format[key][0] : format[key][1];
  42972. }
  42973. var deCh = moment.defineLocale('de-ch', {
  42974. months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(
  42975. '_'
  42976. ),
  42977. monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split(
  42978. '_'
  42979. ),
  42980. monthsParseExact: true,
  42981. weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(
  42982. '_'
  42983. ),
  42984. weekdaysShort: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  42985. weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  42986. weekdaysParseExact: true,
  42987. longDateFormat: {
  42988. LT: 'HH:mm',
  42989. LTS: 'HH:mm:ss',
  42990. L: 'DD.MM.YYYY',
  42991. LL: 'D. MMMM YYYY',
  42992. LLL: 'D. MMMM YYYY HH:mm',
  42993. LLLL: 'dddd, D. MMMM YYYY HH:mm',
  42994. },
  42995. calendar: {
  42996. sameDay: '[heute um] LT [Uhr]',
  42997. sameElse: 'L',
  42998. nextDay: '[morgen um] LT [Uhr]',
  42999. nextWeek: 'dddd [um] LT [Uhr]',
  43000. lastDay: '[gestern um] LT [Uhr]',
  43001. lastWeek: '[letzten] dddd [um] LT [Uhr]',
  43002. },
  43003. relativeTime: {
  43004. future: 'in %s',
  43005. past: 'vor %s',
  43006. s: 'ein paar Sekunden',
  43007. ss: '%d Sekunden',
  43008. m: processRelativeTime,
  43009. mm: '%d Minuten',
  43010. h: processRelativeTime,
  43011. hh: '%d Stunden',
  43012. d: processRelativeTime,
  43013. dd: processRelativeTime,
  43014. w: processRelativeTime,
  43015. ww: '%d Wochen',
  43016. M: processRelativeTime,
  43017. MM: processRelativeTime,
  43018. y: processRelativeTime,
  43019. yy: processRelativeTime,
  43020. },
  43021. dayOfMonthOrdinalParse: /\d{1,2}\./,
  43022. ordinal: '%d.',
  43023. week: {
  43024. dow: 1, // Monday is the first day of the week.
  43025. doy: 4, // The week that contains Jan 4th is the first week of the year.
  43026. },
  43027. });
  43028. return deCh;
  43029. })));
  43030. /***/ }),
  43031. /***/ "./node_modules/moment/locale/de.js":
  43032. /*!******************************************!*\
  43033. !*** ./node_modules/moment/locale/de.js ***!
  43034. \******************************************/
  43035. /*! no static exports found */
  43036. /***/ (function(module, exports, __webpack_require__) {
  43037. //! moment.js locale configuration
  43038. //! locale : German [de]
  43039. //! author : lluchs : https://github.com/lluchs
  43040. //! author: Menelion Elensúle: https://github.com/Oire
  43041. //! author : Mikolaj Dadela : https://github.com/mik01aj
  43042. ;(function (global, factory) {
  43043. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  43044. undefined
  43045. }(this, (function (moment) { 'use strict';
  43046. //! moment.js locale configuration
  43047. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  43048. var format = {
  43049. m: ['eine Minute', 'einer Minute'],
  43050. h: ['eine Stunde', 'einer Stunde'],
  43051. d: ['ein Tag', 'einem Tag'],
  43052. dd: [number + ' Tage', number + ' Tagen'],
  43053. w: ['eine Woche', 'einer Woche'],
  43054. M: ['ein Monat', 'einem Monat'],
  43055. MM: [number + ' Monate', number + ' Monaten'],
  43056. y: ['ein Jahr', 'einem Jahr'],
  43057. yy: [number + ' Jahre', number + ' Jahren'],
  43058. };
  43059. return withoutSuffix ? format[key][0] : format[key][1];
  43060. }
  43061. var de = moment.defineLocale('de', {
  43062. months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(
  43063. '_'
  43064. ),
  43065. monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split(
  43066. '_'
  43067. ),
  43068. monthsParseExact: true,
  43069. weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(
  43070. '_'
  43071. ),
  43072. weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
  43073. weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  43074. weekdaysParseExact: true,
  43075. longDateFormat: {
  43076. LT: 'HH:mm',
  43077. LTS: 'HH:mm:ss',
  43078. L: 'DD.MM.YYYY',
  43079. LL: 'D. MMMM YYYY',
  43080. LLL: 'D. MMMM YYYY HH:mm',
  43081. LLLL: 'dddd, D. MMMM YYYY HH:mm',
  43082. },
  43083. calendar: {
  43084. sameDay: '[heute um] LT [Uhr]',
  43085. sameElse: 'L',
  43086. nextDay: '[morgen um] LT [Uhr]',
  43087. nextWeek: 'dddd [um] LT [Uhr]',
  43088. lastDay: '[gestern um] LT [Uhr]',
  43089. lastWeek: '[letzten] dddd [um] LT [Uhr]',
  43090. },
  43091. relativeTime: {
  43092. future: 'in %s',
  43093. past: 'vor %s',
  43094. s: 'ein paar Sekunden',
  43095. ss: '%d Sekunden',
  43096. m: processRelativeTime,
  43097. mm: '%d Minuten',
  43098. h: processRelativeTime,
  43099. hh: '%d Stunden',
  43100. d: processRelativeTime,
  43101. dd: processRelativeTime,
  43102. w: processRelativeTime,
  43103. ww: '%d Wochen',
  43104. M: processRelativeTime,
  43105. MM: processRelativeTime,
  43106. y: processRelativeTime,
  43107. yy: processRelativeTime,
  43108. },
  43109. dayOfMonthOrdinalParse: /\d{1,2}\./,
  43110. ordinal: '%d.',
  43111. week: {
  43112. dow: 1, // Monday is the first day of the week.
  43113. doy: 4, // The week that contains Jan 4th is the first week of the year.
  43114. },
  43115. });
  43116. return de;
  43117. })));
  43118. /***/ }),
  43119. /***/ "./node_modules/moment/locale/dv.js":
  43120. /*!******************************************!*\
  43121. !*** ./node_modules/moment/locale/dv.js ***!
  43122. \******************************************/
  43123. /*! no static exports found */
  43124. /***/ (function(module, exports, __webpack_require__) {
  43125. //! moment.js locale configuration
  43126. //! locale : Maldivian [dv]
  43127. //! author : Jawish Hameed : https://github.com/jawish
  43128. ;(function (global, factory) {
  43129. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  43130. undefined
  43131. }(this, (function (moment) { 'use strict';
  43132. //! moment.js locale configuration
  43133. var months = [
  43134. 'ޖެނުއަރީ',
  43135. 'ފެބްރުއަރީ',
  43136. 'މާރިޗު',
  43137. 'އޭޕްރީލު',
  43138. 'މޭ',
  43139. 'ޖޫން',
  43140. 'ޖުލައި',
  43141. 'އޯގަސްޓު',
  43142. 'ސެޕްޓެމްބަރު',
  43143. 'އޮކްޓޯބަރު',
  43144. 'ނޮވެމްބަރު',
  43145. 'ޑިސެމްބަރު',
  43146. ],
  43147. weekdays = [
  43148. 'އާދިއްތަ',
  43149. 'ހޯމަ',
  43150. 'އަންގާރަ',
  43151. 'ބުދަ',
  43152. 'ބުރާސްފަތި',
  43153. 'ހުކުރު',
  43154. 'ހޮނިހިރު',
  43155. ];
  43156. var dv = moment.defineLocale('dv', {
  43157. months: months,
  43158. monthsShort: months,
  43159. weekdays: weekdays,
  43160. weekdaysShort: weekdays,
  43161. weekdaysMin: 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'),
  43162. longDateFormat: {
  43163. LT: 'HH:mm',
  43164. LTS: 'HH:mm:ss',
  43165. L: 'D/M/YYYY',
  43166. LL: 'D MMMM YYYY',
  43167. LLL: 'D MMMM YYYY HH:mm',
  43168. LLLL: 'dddd D MMMM YYYY HH:mm',
  43169. },
  43170. meridiemParse: /މކ|މފ/,
  43171. isPM: function (input) {
  43172. return 'މފ' === input;
  43173. },
  43174. meridiem: function (hour, minute, isLower) {
  43175. if (hour < 12) {
  43176. return 'މކ';
  43177. } else {
  43178. return 'މފ';
  43179. }
  43180. },
  43181. calendar: {
  43182. sameDay: '[މިއަދު] LT',
  43183. nextDay: '[މާދަމާ] LT',
  43184. nextWeek: 'dddd LT',
  43185. lastDay: '[އިއްޔެ] LT',
  43186. lastWeek: '[ފާއިތުވި] dddd LT',
  43187. sameElse: 'L',
  43188. },
  43189. relativeTime: {
  43190. future: 'ތެރޭގައި %s',
  43191. past: 'ކުރިން %s',
  43192. s: 'ސިކުންތުކޮޅެއް',
  43193. ss: 'd% ސިކުންތު',
  43194. m: 'މިނިޓެއް',
  43195. mm: 'މިނިޓު %d',
  43196. h: 'ގަޑިއިރެއް',
  43197. hh: 'ގަޑިއިރު %d',
  43198. d: 'ދުވަހެއް',
  43199. dd: 'ދުވަސް %d',
  43200. M: 'މަހެއް',
  43201. MM: 'މަސް %d',
  43202. y: 'އަހަރެއް',
  43203. yy: 'އަހަރު %d',
  43204. },
  43205. preparse: function (string) {
  43206. return string.replace(/،/g, ',');
  43207. },
  43208. postformat: function (string) {
  43209. return string.replace(/,/g, '،');
  43210. },
  43211. week: {
  43212. dow: 7, // Sunday is the first day of the week.
  43213. doy: 12, // The week that contains Jan 12th is the first week of the year.
  43214. },
  43215. });
  43216. return dv;
  43217. })));
  43218. /***/ }),
  43219. /***/ "./node_modules/moment/locale/el.js":
  43220. /*!******************************************!*\
  43221. !*** ./node_modules/moment/locale/el.js ***!
  43222. \******************************************/
  43223. /*! no static exports found */
  43224. /***/ (function(module, exports, __webpack_require__) {
  43225. //! moment.js locale configuration
  43226. //! locale : Greek [el]
  43227. //! author : Aggelos Karalias : https://github.com/mehiel
  43228. ;(function (global, factory) {
  43229. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  43230. undefined
  43231. }(this, (function (moment) { 'use strict';
  43232. //! moment.js locale configuration
  43233. function isFunction(input) {
  43234. return (
  43235. (typeof Function !== 'undefined' && input instanceof Function) ||
  43236. Object.prototype.toString.call(input) === '[object Function]'
  43237. );
  43238. }
  43239. var el = moment.defineLocale('el', {
  43240. monthsNominativeEl: 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split(
  43241. '_'
  43242. ),
  43243. monthsGenitiveEl: 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split(
  43244. '_'
  43245. ),
  43246. months: function (momentToFormat, format) {
  43247. if (!momentToFormat) {
  43248. return this._monthsNominativeEl;
  43249. } else if (
  43250. typeof format === 'string' &&
  43251. /D/.test(format.substring(0, format.indexOf('MMMM')))
  43252. ) {
  43253. // if there is a day number before 'MMMM'
  43254. return this._monthsGenitiveEl[momentToFormat.month()];
  43255. } else {
  43256. return this._monthsNominativeEl[momentToFormat.month()];
  43257. }
  43258. },
  43259. monthsShort: 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),
  43260. weekdays: 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split(
  43261. '_'
  43262. ),
  43263. weekdaysShort: 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),
  43264. weekdaysMin: 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),
  43265. meridiem: function (hours, minutes, isLower) {
  43266. if (hours > 11) {
  43267. return isLower ? 'μμ' : 'ΜΜ';
  43268. } else {
  43269. return isLower ? 'πμ' : 'ΠΜ';
  43270. }
  43271. },
  43272. isPM: function (input) {
  43273. return (input + '').toLowerCase()[0] === 'μ';
  43274. },
  43275. meridiemParse: /[ΠΜ]\.?Μ?\.?/i,
  43276. longDateFormat: {
  43277. LT: 'h:mm A',
  43278. LTS: 'h:mm:ss A',
  43279. L: 'DD/MM/YYYY',
  43280. LL: 'D MMMM YYYY',
  43281. LLL: 'D MMMM YYYY h:mm A',
  43282. LLLL: 'dddd, D MMMM YYYY h:mm A',
  43283. },
  43284. calendarEl: {
  43285. sameDay: '[Σήμερα {}] LT',
  43286. nextDay: '[Αύριο {}] LT',
  43287. nextWeek: 'dddd [{}] LT',
  43288. lastDay: '[Χθες {}] LT',
  43289. lastWeek: function () {
  43290. switch (this.day()) {
  43291. case 6:
  43292. return '[το προηγούμενο] dddd [{}] LT';
  43293. default:
  43294. return '[την προηγούμενη] dddd [{}] LT';
  43295. }
  43296. },
  43297. sameElse: 'L',
  43298. },
  43299. calendar: function (key, mom) {
  43300. var output = this._calendarEl[key],
  43301. hours = mom && mom.hours();
  43302. if (isFunction(output)) {
  43303. output = output.apply(mom);
  43304. }
  43305. return output.replace('{}', hours % 12 === 1 ? 'στη' : 'στις');
  43306. },
  43307. relativeTime: {
  43308. future: 'σε %s',
  43309. past: '%s πριν',
  43310. s: 'λίγα δευτερόλεπτα',
  43311. ss: '%d δευτερόλεπτα',
  43312. m: 'ένα λεπτό',
  43313. mm: '%d λεπτά',
  43314. h: 'μία ώρα',
  43315. hh: '%d ώρες',
  43316. d: 'μία μέρα',
  43317. dd: '%d μέρες',
  43318. M: 'ένας μήνας',
  43319. MM: '%d μήνες',
  43320. y: 'ένας χρόνος',
  43321. yy: '%d χρόνια',
  43322. },
  43323. dayOfMonthOrdinalParse: /\d{1,2}η/,
  43324. ordinal: '%dη',
  43325. week: {
  43326. dow: 1, // Monday is the first day of the week.
  43327. doy: 4, // The week that contains Jan 4st is the first week of the year.
  43328. },
  43329. });
  43330. return el;
  43331. })));
  43332. /***/ }),
  43333. /***/ "./node_modules/moment/locale/en-au.js":
  43334. /*!*********************************************!*\
  43335. !*** ./node_modules/moment/locale/en-au.js ***!
  43336. \*********************************************/
  43337. /*! no static exports found */
  43338. /***/ (function(module, exports, __webpack_require__) {
  43339. //! moment.js locale configuration
  43340. //! locale : English (Australia) [en-au]
  43341. //! author : Jared Morse : https://github.com/jarcoal
  43342. ;(function (global, factory) {
  43343. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  43344. undefined
  43345. }(this, (function (moment) { 'use strict';
  43346. //! moment.js locale configuration
  43347. var enAu = moment.defineLocale('en-au', {
  43348. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  43349. '_'
  43350. ),
  43351. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  43352. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  43353. '_'
  43354. ),
  43355. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  43356. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  43357. longDateFormat: {
  43358. LT: 'h:mm A',
  43359. LTS: 'h:mm:ss A',
  43360. L: 'DD/MM/YYYY',
  43361. LL: 'D MMMM YYYY',
  43362. LLL: 'D MMMM YYYY h:mm A',
  43363. LLLL: 'dddd, D MMMM YYYY h:mm A',
  43364. },
  43365. calendar: {
  43366. sameDay: '[Today at] LT',
  43367. nextDay: '[Tomorrow at] LT',
  43368. nextWeek: 'dddd [at] LT',
  43369. lastDay: '[Yesterday at] LT',
  43370. lastWeek: '[Last] dddd [at] LT',
  43371. sameElse: 'L',
  43372. },
  43373. relativeTime: {
  43374. future: 'in %s',
  43375. past: '%s ago',
  43376. s: 'a few seconds',
  43377. ss: '%d seconds',
  43378. m: 'a minute',
  43379. mm: '%d minutes',
  43380. h: 'an hour',
  43381. hh: '%d hours',
  43382. d: 'a day',
  43383. dd: '%d days',
  43384. M: 'a month',
  43385. MM: '%d months',
  43386. y: 'a year',
  43387. yy: '%d years',
  43388. },
  43389. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  43390. ordinal: function (number) {
  43391. var b = number % 10,
  43392. output =
  43393. ~~((number % 100) / 10) === 1
  43394. ? 'th'
  43395. : b === 1
  43396. ? 'st'
  43397. : b === 2
  43398. ? 'nd'
  43399. : b === 3
  43400. ? 'rd'
  43401. : 'th';
  43402. return number + output;
  43403. },
  43404. week: {
  43405. dow: 0, // Sunday is the first day of the week.
  43406. doy: 4, // The week that contains Jan 4th is the first week of the year.
  43407. },
  43408. });
  43409. return enAu;
  43410. })));
  43411. /***/ }),
  43412. /***/ "./node_modules/moment/locale/en-ca.js":
  43413. /*!*********************************************!*\
  43414. !*** ./node_modules/moment/locale/en-ca.js ***!
  43415. \*********************************************/
  43416. /*! no static exports found */
  43417. /***/ (function(module, exports, __webpack_require__) {
  43418. //! moment.js locale configuration
  43419. //! locale : English (Canada) [en-ca]
  43420. //! author : Jonathan Abourbih : https://github.com/jonbca
  43421. ;(function (global, factory) {
  43422. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  43423. undefined
  43424. }(this, (function (moment) { 'use strict';
  43425. //! moment.js locale configuration
  43426. var enCa = moment.defineLocale('en-ca', {
  43427. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  43428. '_'
  43429. ),
  43430. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  43431. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  43432. '_'
  43433. ),
  43434. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  43435. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  43436. longDateFormat: {
  43437. LT: 'h:mm A',
  43438. LTS: 'h:mm:ss A',
  43439. L: 'YYYY-MM-DD',
  43440. LL: 'MMMM D, YYYY',
  43441. LLL: 'MMMM D, YYYY h:mm A',
  43442. LLLL: 'dddd, MMMM D, YYYY h:mm A',
  43443. },
  43444. calendar: {
  43445. sameDay: '[Today at] LT',
  43446. nextDay: '[Tomorrow at] LT',
  43447. nextWeek: 'dddd [at] LT',
  43448. lastDay: '[Yesterday at] LT',
  43449. lastWeek: '[Last] dddd [at] LT',
  43450. sameElse: 'L',
  43451. },
  43452. relativeTime: {
  43453. future: 'in %s',
  43454. past: '%s ago',
  43455. s: 'a few seconds',
  43456. ss: '%d seconds',
  43457. m: 'a minute',
  43458. mm: '%d minutes',
  43459. h: 'an hour',
  43460. hh: '%d hours',
  43461. d: 'a day',
  43462. dd: '%d days',
  43463. M: 'a month',
  43464. MM: '%d months',
  43465. y: 'a year',
  43466. yy: '%d years',
  43467. },
  43468. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  43469. ordinal: function (number) {
  43470. var b = number % 10,
  43471. output =
  43472. ~~((number % 100) / 10) === 1
  43473. ? 'th'
  43474. : b === 1
  43475. ? 'st'
  43476. : b === 2
  43477. ? 'nd'
  43478. : b === 3
  43479. ? 'rd'
  43480. : 'th';
  43481. return number + output;
  43482. },
  43483. });
  43484. return enCa;
  43485. })));
  43486. /***/ }),
  43487. /***/ "./node_modules/moment/locale/en-gb.js":
  43488. /*!*********************************************!*\
  43489. !*** ./node_modules/moment/locale/en-gb.js ***!
  43490. \*********************************************/
  43491. /*! no static exports found */
  43492. /***/ (function(module, exports, __webpack_require__) {
  43493. //! moment.js locale configuration
  43494. //! locale : English (United Kingdom) [en-gb]
  43495. //! author : Chris Gedrim : https://github.com/chrisgedrim
  43496. ;(function (global, factory) {
  43497. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  43498. undefined
  43499. }(this, (function (moment) { 'use strict';
  43500. //! moment.js locale configuration
  43501. var enGb = moment.defineLocale('en-gb', {
  43502. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  43503. '_'
  43504. ),
  43505. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  43506. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  43507. '_'
  43508. ),
  43509. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  43510. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  43511. longDateFormat: {
  43512. LT: 'HH:mm',
  43513. LTS: 'HH:mm:ss',
  43514. L: 'DD/MM/YYYY',
  43515. LL: 'D MMMM YYYY',
  43516. LLL: 'D MMMM YYYY HH:mm',
  43517. LLLL: 'dddd, D MMMM YYYY HH:mm',
  43518. },
  43519. calendar: {
  43520. sameDay: '[Today at] LT',
  43521. nextDay: '[Tomorrow at] LT',
  43522. nextWeek: 'dddd [at] LT',
  43523. lastDay: '[Yesterday at] LT',
  43524. lastWeek: '[Last] dddd [at] LT',
  43525. sameElse: 'L',
  43526. },
  43527. relativeTime: {
  43528. future: 'in %s',
  43529. past: '%s ago',
  43530. s: 'a few seconds',
  43531. ss: '%d seconds',
  43532. m: 'a minute',
  43533. mm: '%d minutes',
  43534. h: 'an hour',
  43535. hh: '%d hours',
  43536. d: 'a day',
  43537. dd: '%d days',
  43538. M: 'a month',
  43539. MM: '%d months',
  43540. y: 'a year',
  43541. yy: '%d years',
  43542. },
  43543. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  43544. ordinal: function (number) {
  43545. var b = number % 10,
  43546. output =
  43547. ~~((number % 100) / 10) === 1
  43548. ? 'th'
  43549. : b === 1
  43550. ? 'st'
  43551. : b === 2
  43552. ? 'nd'
  43553. : b === 3
  43554. ? 'rd'
  43555. : 'th';
  43556. return number + output;
  43557. },
  43558. week: {
  43559. dow: 1, // Monday is the first day of the week.
  43560. doy: 4, // The week that contains Jan 4th is the first week of the year.
  43561. },
  43562. });
  43563. return enGb;
  43564. })));
  43565. /***/ }),
  43566. /***/ "./node_modules/moment/locale/en-ie.js":
  43567. /*!*********************************************!*\
  43568. !*** ./node_modules/moment/locale/en-ie.js ***!
  43569. \*********************************************/
  43570. /*! no static exports found */
  43571. /***/ (function(module, exports, __webpack_require__) {
  43572. //! moment.js locale configuration
  43573. //! locale : English (Ireland) [en-ie]
  43574. //! author : Chris Cartlidge : https://github.com/chriscartlidge
  43575. ;(function (global, factory) {
  43576. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  43577. undefined
  43578. }(this, (function (moment) { 'use strict';
  43579. //! moment.js locale configuration
  43580. var enIe = moment.defineLocale('en-ie', {
  43581. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  43582. '_'
  43583. ),
  43584. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  43585. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  43586. '_'
  43587. ),
  43588. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  43589. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  43590. longDateFormat: {
  43591. LT: 'HH:mm',
  43592. LTS: 'HH:mm:ss',
  43593. L: 'DD/MM/YYYY',
  43594. LL: 'D MMMM YYYY',
  43595. LLL: 'D MMMM YYYY HH:mm',
  43596. LLLL: 'dddd D MMMM YYYY HH:mm',
  43597. },
  43598. calendar: {
  43599. sameDay: '[Today at] LT',
  43600. nextDay: '[Tomorrow at] LT',
  43601. nextWeek: 'dddd [at] LT',
  43602. lastDay: '[Yesterday at] LT',
  43603. lastWeek: '[Last] dddd [at] LT',
  43604. sameElse: 'L',
  43605. },
  43606. relativeTime: {
  43607. future: 'in %s',
  43608. past: '%s ago',
  43609. s: 'a few seconds',
  43610. ss: '%d seconds',
  43611. m: 'a minute',
  43612. mm: '%d minutes',
  43613. h: 'an hour',
  43614. hh: '%d hours',
  43615. d: 'a day',
  43616. dd: '%d days',
  43617. M: 'a month',
  43618. MM: '%d months',
  43619. y: 'a year',
  43620. yy: '%d years',
  43621. },
  43622. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  43623. ordinal: function (number) {
  43624. var b = number % 10,
  43625. output =
  43626. ~~((number % 100) / 10) === 1
  43627. ? 'th'
  43628. : b === 1
  43629. ? 'st'
  43630. : b === 2
  43631. ? 'nd'
  43632. : b === 3
  43633. ? 'rd'
  43634. : 'th';
  43635. return number + output;
  43636. },
  43637. week: {
  43638. dow: 1, // Monday is the first day of the week.
  43639. doy: 4, // The week that contains Jan 4th is the first week of the year.
  43640. },
  43641. });
  43642. return enIe;
  43643. })));
  43644. /***/ }),
  43645. /***/ "./node_modules/moment/locale/en-il.js":
  43646. /*!*********************************************!*\
  43647. !*** ./node_modules/moment/locale/en-il.js ***!
  43648. \*********************************************/
  43649. /*! no static exports found */
  43650. /***/ (function(module, exports, __webpack_require__) {
  43651. //! moment.js locale configuration
  43652. //! locale : English (Israel) [en-il]
  43653. //! author : Chris Gedrim : https://github.com/chrisgedrim
  43654. ;(function (global, factory) {
  43655. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  43656. undefined
  43657. }(this, (function (moment) { 'use strict';
  43658. //! moment.js locale configuration
  43659. var enIl = moment.defineLocale('en-il', {
  43660. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  43661. '_'
  43662. ),
  43663. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  43664. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  43665. '_'
  43666. ),
  43667. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  43668. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  43669. longDateFormat: {
  43670. LT: 'HH:mm',
  43671. LTS: 'HH:mm:ss',
  43672. L: 'DD/MM/YYYY',
  43673. LL: 'D MMMM YYYY',
  43674. LLL: 'D MMMM YYYY HH:mm',
  43675. LLLL: 'dddd, D MMMM YYYY HH:mm',
  43676. },
  43677. calendar: {
  43678. sameDay: '[Today at] LT',
  43679. nextDay: '[Tomorrow at] LT',
  43680. nextWeek: 'dddd [at] LT',
  43681. lastDay: '[Yesterday at] LT',
  43682. lastWeek: '[Last] dddd [at] LT',
  43683. sameElse: 'L',
  43684. },
  43685. relativeTime: {
  43686. future: 'in %s',
  43687. past: '%s ago',
  43688. s: 'a few seconds',
  43689. ss: '%d seconds',
  43690. m: 'a minute',
  43691. mm: '%d minutes',
  43692. h: 'an hour',
  43693. hh: '%d hours',
  43694. d: 'a day',
  43695. dd: '%d days',
  43696. M: 'a month',
  43697. MM: '%d months',
  43698. y: 'a year',
  43699. yy: '%d years',
  43700. },
  43701. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  43702. ordinal: function (number) {
  43703. var b = number % 10,
  43704. output =
  43705. ~~((number % 100) / 10) === 1
  43706. ? 'th'
  43707. : b === 1
  43708. ? 'st'
  43709. : b === 2
  43710. ? 'nd'
  43711. : b === 3
  43712. ? 'rd'
  43713. : 'th';
  43714. return number + output;
  43715. },
  43716. });
  43717. return enIl;
  43718. })));
  43719. /***/ }),
  43720. /***/ "./node_modules/moment/locale/en-in.js":
  43721. /*!*********************************************!*\
  43722. !*** ./node_modules/moment/locale/en-in.js ***!
  43723. \*********************************************/
  43724. /*! no static exports found */
  43725. /***/ (function(module, exports, __webpack_require__) {
  43726. //! moment.js locale configuration
  43727. //! locale : English (India) [en-in]
  43728. //! author : Jatin Agrawal : https://github.com/jatinag22
  43729. ;(function (global, factory) {
  43730. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  43731. undefined
  43732. }(this, (function (moment) { 'use strict';
  43733. //! moment.js locale configuration
  43734. var enIn = moment.defineLocale('en-in', {
  43735. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  43736. '_'
  43737. ),
  43738. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  43739. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  43740. '_'
  43741. ),
  43742. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  43743. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  43744. longDateFormat: {
  43745. LT: 'h:mm A',
  43746. LTS: 'h:mm:ss A',
  43747. L: 'DD/MM/YYYY',
  43748. LL: 'D MMMM YYYY',
  43749. LLL: 'D MMMM YYYY h:mm A',
  43750. LLLL: 'dddd, D MMMM YYYY h:mm A',
  43751. },
  43752. calendar: {
  43753. sameDay: '[Today at] LT',
  43754. nextDay: '[Tomorrow at] LT',
  43755. nextWeek: 'dddd [at] LT',
  43756. lastDay: '[Yesterday at] LT',
  43757. lastWeek: '[Last] dddd [at] LT',
  43758. sameElse: 'L',
  43759. },
  43760. relativeTime: {
  43761. future: 'in %s',
  43762. past: '%s ago',
  43763. s: 'a few seconds',
  43764. ss: '%d seconds',
  43765. m: 'a minute',
  43766. mm: '%d minutes',
  43767. h: 'an hour',
  43768. hh: '%d hours',
  43769. d: 'a day',
  43770. dd: '%d days',
  43771. M: 'a month',
  43772. MM: '%d months',
  43773. y: 'a year',
  43774. yy: '%d years',
  43775. },
  43776. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  43777. ordinal: function (number) {
  43778. var b = number % 10,
  43779. output =
  43780. ~~((number % 100) / 10) === 1
  43781. ? 'th'
  43782. : b === 1
  43783. ? 'st'
  43784. : b === 2
  43785. ? 'nd'
  43786. : b === 3
  43787. ? 'rd'
  43788. : 'th';
  43789. return number + output;
  43790. },
  43791. week: {
  43792. dow: 0, // Sunday is the first day of the week.
  43793. doy: 6, // The week that contains Jan 1st is the first week of the year.
  43794. },
  43795. });
  43796. return enIn;
  43797. })));
  43798. /***/ }),
  43799. /***/ "./node_modules/moment/locale/en-nz.js":
  43800. /*!*********************************************!*\
  43801. !*** ./node_modules/moment/locale/en-nz.js ***!
  43802. \*********************************************/
  43803. /*! no static exports found */
  43804. /***/ (function(module, exports, __webpack_require__) {
  43805. //! moment.js locale configuration
  43806. //! locale : English (New Zealand) [en-nz]
  43807. //! author : Luke McGregor : https://github.com/lukemcgregor
  43808. ;(function (global, factory) {
  43809. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  43810. undefined
  43811. }(this, (function (moment) { 'use strict';
  43812. //! moment.js locale configuration
  43813. var enNz = moment.defineLocale('en-nz', {
  43814. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  43815. '_'
  43816. ),
  43817. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  43818. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  43819. '_'
  43820. ),
  43821. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  43822. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  43823. longDateFormat: {
  43824. LT: 'h:mm A',
  43825. LTS: 'h:mm:ss A',
  43826. L: 'DD/MM/YYYY',
  43827. LL: 'D MMMM YYYY',
  43828. LLL: 'D MMMM YYYY h:mm A',
  43829. LLLL: 'dddd, D MMMM YYYY h:mm A',
  43830. },
  43831. calendar: {
  43832. sameDay: '[Today at] LT',
  43833. nextDay: '[Tomorrow at] LT',
  43834. nextWeek: 'dddd [at] LT',
  43835. lastDay: '[Yesterday at] LT',
  43836. lastWeek: '[Last] dddd [at] LT',
  43837. sameElse: 'L',
  43838. },
  43839. relativeTime: {
  43840. future: 'in %s',
  43841. past: '%s ago',
  43842. s: 'a few seconds',
  43843. ss: '%d seconds',
  43844. m: 'a minute',
  43845. mm: '%d minutes',
  43846. h: 'an hour',
  43847. hh: '%d hours',
  43848. d: 'a day',
  43849. dd: '%d days',
  43850. M: 'a month',
  43851. MM: '%d months',
  43852. y: 'a year',
  43853. yy: '%d years',
  43854. },
  43855. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  43856. ordinal: function (number) {
  43857. var b = number % 10,
  43858. output =
  43859. ~~((number % 100) / 10) === 1
  43860. ? 'th'
  43861. : b === 1
  43862. ? 'st'
  43863. : b === 2
  43864. ? 'nd'
  43865. : b === 3
  43866. ? 'rd'
  43867. : 'th';
  43868. return number + output;
  43869. },
  43870. week: {
  43871. dow: 1, // Monday is the first day of the week.
  43872. doy: 4, // The week that contains Jan 4th is the first week of the year.
  43873. },
  43874. });
  43875. return enNz;
  43876. })));
  43877. /***/ }),
  43878. /***/ "./node_modules/moment/locale/en-sg.js":
  43879. /*!*********************************************!*\
  43880. !*** ./node_modules/moment/locale/en-sg.js ***!
  43881. \*********************************************/
  43882. /*! no static exports found */
  43883. /***/ (function(module, exports, __webpack_require__) {
  43884. //! moment.js locale configuration
  43885. //! locale : English (Singapore) [en-sg]
  43886. //! author : Matthew Castrillon-Madrigal : https://github.com/techdimension
  43887. ;(function (global, factory) {
  43888. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  43889. undefined
  43890. }(this, (function (moment) { 'use strict';
  43891. //! moment.js locale configuration
  43892. var enSg = moment.defineLocale('en-sg', {
  43893. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  43894. '_'
  43895. ),
  43896. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  43897. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  43898. '_'
  43899. ),
  43900. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  43901. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  43902. longDateFormat: {
  43903. LT: 'HH:mm',
  43904. LTS: 'HH:mm:ss',
  43905. L: 'DD/MM/YYYY',
  43906. LL: 'D MMMM YYYY',
  43907. LLL: 'D MMMM YYYY HH:mm',
  43908. LLLL: 'dddd, D MMMM YYYY HH:mm',
  43909. },
  43910. calendar: {
  43911. sameDay: '[Today at] LT',
  43912. nextDay: '[Tomorrow at] LT',
  43913. nextWeek: 'dddd [at] LT',
  43914. lastDay: '[Yesterday at] LT',
  43915. lastWeek: '[Last] dddd [at] LT',
  43916. sameElse: 'L',
  43917. },
  43918. relativeTime: {
  43919. future: 'in %s',
  43920. past: '%s ago',
  43921. s: 'a few seconds',
  43922. ss: '%d seconds',
  43923. m: 'a minute',
  43924. mm: '%d minutes',
  43925. h: 'an hour',
  43926. hh: '%d hours',
  43927. d: 'a day',
  43928. dd: '%d days',
  43929. M: 'a month',
  43930. MM: '%d months',
  43931. y: 'a year',
  43932. yy: '%d years',
  43933. },
  43934. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  43935. ordinal: function (number) {
  43936. var b = number % 10,
  43937. output =
  43938. ~~((number % 100) / 10) === 1
  43939. ? 'th'
  43940. : b === 1
  43941. ? 'st'
  43942. : b === 2
  43943. ? 'nd'
  43944. : b === 3
  43945. ? 'rd'
  43946. : 'th';
  43947. return number + output;
  43948. },
  43949. week: {
  43950. dow: 1, // Monday is the first day of the week.
  43951. doy: 4, // The week that contains Jan 4th is the first week of the year.
  43952. },
  43953. });
  43954. return enSg;
  43955. })));
  43956. /***/ }),
  43957. /***/ "./node_modules/moment/locale/eo.js":
  43958. /*!******************************************!*\
  43959. !*** ./node_modules/moment/locale/eo.js ***!
  43960. \******************************************/
  43961. /*! no static exports found */
  43962. /***/ (function(module, exports, __webpack_require__) {
  43963. //! moment.js locale configuration
  43964. //! locale : Esperanto [eo]
  43965. //! author : Colin Dean : https://github.com/colindean
  43966. //! author : Mia Nordentoft Imperatori : https://github.com/miestasmia
  43967. //! comment : miestasmia corrected the translation by colindean
  43968. //! comment : Vivakvo corrected the translation by colindean and miestasmia
  43969. ;(function (global, factory) {
  43970. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  43971. undefined
  43972. }(this, (function (moment) { 'use strict';
  43973. //! moment.js locale configuration
  43974. var eo = moment.defineLocale('eo', {
  43975. months: 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split(
  43976. '_'
  43977. ),
  43978. monthsShort: 'jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec'.split('_'),
  43979. weekdays: 'dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato'.split('_'),
  43980. weekdaysShort: 'dim_lun_mard_merk_ĵaŭ_ven_sab'.split('_'),
  43981. weekdaysMin: 'di_lu_ma_me_ĵa_ve_sa'.split('_'),
  43982. longDateFormat: {
  43983. LT: 'HH:mm',
  43984. LTS: 'HH:mm:ss',
  43985. L: 'YYYY-MM-DD',
  43986. LL: '[la] D[-an de] MMMM, YYYY',
  43987. LLL: '[la] D[-an de] MMMM, YYYY HH:mm',
  43988. LLLL: 'dddd[n], [la] D[-an de] MMMM, YYYY HH:mm',
  43989. llll: 'ddd, [la] D[-an de] MMM, YYYY HH:mm',
  43990. },
  43991. meridiemParse: /[ap]\.t\.m/i,
  43992. isPM: function (input) {
  43993. return input.charAt(0).toLowerCase() === 'p';
  43994. },
  43995. meridiem: function (hours, minutes, isLower) {
  43996. if (hours > 11) {
  43997. return isLower ? 'p.t.m.' : 'P.T.M.';
  43998. } else {
  43999. return isLower ? 'a.t.m.' : 'A.T.M.';
  44000. }
  44001. },
  44002. calendar: {
  44003. sameDay: '[Hodiaŭ je] LT',
  44004. nextDay: '[Morgaŭ je] LT',
  44005. nextWeek: 'dddd[n je] LT',
  44006. lastDay: '[Hieraŭ je] LT',
  44007. lastWeek: '[pasintan] dddd[n je] LT',
  44008. sameElse: 'L',
  44009. },
  44010. relativeTime: {
  44011. future: 'post %s',
  44012. past: 'antaŭ %s',
  44013. s: 'kelkaj sekundoj',
  44014. ss: '%d sekundoj',
  44015. m: 'unu minuto',
  44016. mm: '%d minutoj',
  44017. h: 'unu horo',
  44018. hh: '%d horoj',
  44019. d: 'unu tago', //ne 'diurno', ĉar estas uzita por proksimumo
  44020. dd: '%d tagoj',
  44021. M: 'unu monato',
  44022. MM: '%d monatoj',
  44023. y: 'unu jaro',
  44024. yy: '%d jaroj',
  44025. },
  44026. dayOfMonthOrdinalParse: /\d{1,2}a/,
  44027. ordinal: '%da',
  44028. week: {
  44029. dow: 1, // Monday is the first day of the week.
  44030. doy: 7, // The week that contains Jan 7th is the first week of the year.
  44031. },
  44032. });
  44033. return eo;
  44034. })));
  44035. /***/ }),
  44036. /***/ "./node_modules/moment/locale/es-do.js":
  44037. /*!*********************************************!*\
  44038. !*** ./node_modules/moment/locale/es-do.js ***!
  44039. \*********************************************/
  44040. /*! no static exports found */
  44041. /***/ (function(module, exports, __webpack_require__) {
  44042. //! moment.js locale configuration
  44043. //! locale : Spanish (Dominican Republic) [es-do]
  44044. ;(function (global, factory) {
  44045. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  44046. undefined
  44047. }(this, (function (moment) { 'use strict';
  44048. //! moment.js locale configuration
  44049. var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(
  44050. '_'
  44051. ),
  44052. monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
  44053. monthsParse = [
  44054. /^ene/i,
  44055. /^feb/i,
  44056. /^mar/i,
  44057. /^abr/i,
  44058. /^may/i,
  44059. /^jun/i,
  44060. /^jul/i,
  44061. /^ago/i,
  44062. /^sep/i,
  44063. /^oct/i,
  44064. /^nov/i,
  44065. /^dic/i,
  44066. ],
  44067. monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
  44068. var esDo = moment.defineLocale('es-do', {
  44069. months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(
  44070. '_'
  44071. ),
  44072. monthsShort: function (m, format) {
  44073. if (!m) {
  44074. return monthsShortDot;
  44075. } else if (/-MMM-/.test(format)) {
  44076. return monthsShort[m.month()];
  44077. } else {
  44078. return monthsShortDot[m.month()];
  44079. }
  44080. },
  44081. monthsRegex: monthsRegex,
  44082. monthsShortRegex: monthsRegex,
  44083. monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
  44084. monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
  44085. monthsParse: monthsParse,
  44086. longMonthsParse: monthsParse,
  44087. shortMonthsParse: monthsParse,
  44088. weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  44089. weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  44090. weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  44091. weekdaysParseExact: true,
  44092. longDateFormat: {
  44093. LT: 'h:mm A',
  44094. LTS: 'h:mm:ss A',
  44095. L: 'DD/MM/YYYY',
  44096. LL: 'D [de] MMMM [de] YYYY',
  44097. LLL: 'D [de] MMMM [de] YYYY h:mm A',
  44098. LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A',
  44099. },
  44100. calendar: {
  44101. sameDay: function () {
  44102. return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  44103. },
  44104. nextDay: function () {
  44105. return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  44106. },
  44107. nextWeek: function () {
  44108. return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  44109. },
  44110. lastDay: function () {
  44111. return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  44112. },
  44113. lastWeek: function () {
  44114. return (
  44115. '[el] dddd [pasado a la' +
  44116. (this.hours() !== 1 ? 's' : '') +
  44117. '] LT'
  44118. );
  44119. },
  44120. sameElse: 'L',
  44121. },
  44122. relativeTime: {
  44123. future: 'en %s',
  44124. past: 'hace %s',
  44125. s: 'unos segundos',
  44126. ss: '%d segundos',
  44127. m: 'un minuto',
  44128. mm: '%d minutos',
  44129. h: 'una hora',
  44130. hh: '%d horas',
  44131. d: 'un día',
  44132. dd: '%d días',
  44133. M: 'un mes',
  44134. MM: '%d meses',
  44135. y: 'un año',
  44136. yy: '%d años',
  44137. },
  44138. dayOfMonthOrdinalParse: /\d{1,2}º/,
  44139. ordinal: '%dº',
  44140. week: {
  44141. dow: 1, // Monday is the first day of the week.
  44142. doy: 4, // The week that contains Jan 4th is the first week of the year.
  44143. },
  44144. });
  44145. return esDo;
  44146. })));
  44147. /***/ }),
  44148. /***/ "./node_modules/moment/locale/es-us.js":
  44149. /*!*********************************************!*\
  44150. !*** ./node_modules/moment/locale/es-us.js ***!
  44151. \*********************************************/
  44152. /*! no static exports found */
  44153. /***/ (function(module, exports, __webpack_require__) {
  44154. //! moment.js locale configuration
  44155. //! locale : Spanish (United States) [es-us]
  44156. //! author : bustta : https://github.com/bustta
  44157. //! author : chrisrodz : https://github.com/chrisrodz
  44158. ;(function (global, factory) {
  44159. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  44160. undefined
  44161. }(this, (function (moment) { 'use strict';
  44162. //! moment.js locale configuration
  44163. var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(
  44164. '_'
  44165. ),
  44166. monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
  44167. monthsParse = [
  44168. /^ene/i,
  44169. /^feb/i,
  44170. /^mar/i,
  44171. /^abr/i,
  44172. /^may/i,
  44173. /^jun/i,
  44174. /^jul/i,
  44175. /^ago/i,
  44176. /^sep/i,
  44177. /^oct/i,
  44178. /^nov/i,
  44179. /^dic/i,
  44180. ],
  44181. monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
  44182. var esUs = moment.defineLocale('es-us', {
  44183. months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(
  44184. '_'
  44185. ),
  44186. monthsShort: function (m, format) {
  44187. if (!m) {
  44188. return monthsShortDot;
  44189. } else if (/-MMM-/.test(format)) {
  44190. return monthsShort[m.month()];
  44191. } else {
  44192. return monthsShortDot[m.month()];
  44193. }
  44194. },
  44195. monthsRegex: monthsRegex,
  44196. monthsShortRegex: monthsRegex,
  44197. monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
  44198. monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
  44199. monthsParse: monthsParse,
  44200. longMonthsParse: monthsParse,
  44201. shortMonthsParse: monthsParse,
  44202. weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  44203. weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  44204. weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  44205. weekdaysParseExact: true,
  44206. longDateFormat: {
  44207. LT: 'h:mm A',
  44208. LTS: 'h:mm:ss A',
  44209. L: 'MM/DD/YYYY',
  44210. LL: 'D [de] MMMM [de] YYYY',
  44211. LLL: 'D [de] MMMM [de] YYYY h:mm A',
  44212. LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A',
  44213. },
  44214. calendar: {
  44215. sameDay: function () {
  44216. return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  44217. },
  44218. nextDay: function () {
  44219. return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  44220. },
  44221. nextWeek: function () {
  44222. return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  44223. },
  44224. lastDay: function () {
  44225. return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  44226. },
  44227. lastWeek: function () {
  44228. return (
  44229. '[el] dddd [pasado a la' +
  44230. (this.hours() !== 1 ? 's' : '') +
  44231. '] LT'
  44232. );
  44233. },
  44234. sameElse: 'L',
  44235. },
  44236. relativeTime: {
  44237. future: 'en %s',
  44238. past: 'hace %s',
  44239. s: 'unos segundos',
  44240. ss: '%d segundos',
  44241. m: 'un minuto',
  44242. mm: '%d minutos',
  44243. h: 'una hora',
  44244. hh: '%d horas',
  44245. d: 'un día',
  44246. dd: '%d días',
  44247. M: 'un mes',
  44248. MM: '%d meses',
  44249. y: 'un año',
  44250. yy: '%d años',
  44251. },
  44252. dayOfMonthOrdinalParse: /\d{1,2}º/,
  44253. ordinal: '%dº',
  44254. week: {
  44255. dow: 0, // Sunday is the first day of the week.
  44256. doy: 6, // The week that contains Jan 6th is the first week of the year.
  44257. },
  44258. });
  44259. return esUs;
  44260. })));
  44261. /***/ }),
  44262. /***/ "./node_modules/moment/locale/es.js":
  44263. /*!******************************************!*\
  44264. !*** ./node_modules/moment/locale/es.js ***!
  44265. \******************************************/
  44266. /*! no static exports found */
  44267. /***/ (function(module, exports, __webpack_require__) {
  44268. //! moment.js locale configuration
  44269. //! locale : Spanish [es]
  44270. //! author : Julio Napurí : https://github.com/julionc
  44271. ;(function (global, factory) {
  44272. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  44273. undefined
  44274. }(this, (function (moment) { 'use strict';
  44275. //! moment.js locale configuration
  44276. var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(
  44277. '_'
  44278. ),
  44279. monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
  44280. monthsParse = [
  44281. /^ene/i,
  44282. /^feb/i,
  44283. /^mar/i,
  44284. /^abr/i,
  44285. /^may/i,
  44286. /^jun/i,
  44287. /^jul/i,
  44288. /^ago/i,
  44289. /^sep/i,
  44290. /^oct/i,
  44291. /^nov/i,
  44292. /^dic/i,
  44293. ],
  44294. monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;
  44295. var es = moment.defineLocale('es', {
  44296. months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(
  44297. '_'
  44298. ),
  44299. monthsShort: function (m, format) {
  44300. if (!m) {
  44301. return monthsShortDot;
  44302. } else if (/-MMM-/.test(format)) {
  44303. return monthsShort[m.month()];
  44304. } else {
  44305. return monthsShortDot[m.month()];
  44306. }
  44307. },
  44308. monthsRegex: monthsRegex,
  44309. monthsShortRegex: monthsRegex,
  44310. monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
  44311. monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
  44312. monthsParse: monthsParse,
  44313. longMonthsParse: monthsParse,
  44314. shortMonthsParse: monthsParse,
  44315. weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  44316. weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  44317. weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  44318. weekdaysParseExact: true,
  44319. longDateFormat: {
  44320. LT: 'H:mm',
  44321. LTS: 'H:mm:ss',
  44322. L: 'DD/MM/YYYY',
  44323. LL: 'D [de] MMMM [de] YYYY',
  44324. LLL: 'D [de] MMMM [de] YYYY H:mm',
  44325. LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',
  44326. },
  44327. calendar: {
  44328. sameDay: function () {
  44329. return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  44330. },
  44331. nextDay: function () {
  44332. return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  44333. },
  44334. nextWeek: function () {
  44335. return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  44336. },
  44337. lastDay: function () {
  44338. return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  44339. },
  44340. lastWeek: function () {
  44341. return (
  44342. '[el] dddd [pasado a la' +
  44343. (this.hours() !== 1 ? 's' : '') +
  44344. '] LT'
  44345. );
  44346. },
  44347. sameElse: 'L',
  44348. },
  44349. relativeTime: {
  44350. future: 'en %s',
  44351. past: 'hace %s',
  44352. s: 'unos segundos',
  44353. ss: '%d segundos',
  44354. m: 'un minuto',
  44355. mm: '%d minutos',
  44356. h: 'una hora',
  44357. hh: '%d horas',
  44358. d: 'un día',
  44359. dd: '%d días',
  44360. M: 'un mes',
  44361. MM: '%d meses',
  44362. y: 'un año',
  44363. yy: '%d años',
  44364. },
  44365. dayOfMonthOrdinalParse: /\d{1,2}º/,
  44366. ordinal: '%dº',
  44367. week: {
  44368. dow: 1, // Monday is the first day of the week.
  44369. doy: 4, // The week that contains Jan 4th is the first week of the year.
  44370. },
  44371. invalidDate: 'Fecha inválida',
  44372. });
  44373. return es;
  44374. })));
  44375. /***/ }),
  44376. /***/ "./node_modules/moment/locale/et.js":
  44377. /*!******************************************!*\
  44378. !*** ./node_modules/moment/locale/et.js ***!
  44379. \******************************************/
  44380. /*! no static exports found */
  44381. /***/ (function(module, exports, __webpack_require__) {
  44382. //! moment.js locale configuration
  44383. //! locale : Estonian [et]
  44384. //! author : Henry Kehlmann : https://github.com/madhenry
  44385. //! improvements : Illimar Tambek : https://github.com/ragulka
  44386. ;(function (global, factory) {
  44387. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  44388. undefined
  44389. }(this, (function (moment) { 'use strict';
  44390. //! moment.js locale configuration
  44391. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  44392. var format = {
  44393. s: ['mõne sekundi', 'mõni sekund', 'paar sekundit'],
  44394. ss: [number + 'sekundi', number + 'sekundit'],
  44395. m: ['ühe minuti', 'üks minut'],
  44396. mm: [number + ' minuti', number + ' minutit'],
  44397. h: ['ühe tunni', 'tund aega', 'üks tund'],
  44398. hh: [number + ' tunni', number + ' tundi'],
  44399. d: ['ühe päeva', 'üks päev'],
  44400. M: ['kuu aja', 'kuu aega', 'üks kuu'],
  44401. MM: [number + ' kuu', number + ' kuud'],
  44402. y: ['ühe aasta', 'aasta', 'üks aasta'],
  44403. yy: [number + ' aasta', number + ' aastat'],
  44404. };
  44405. if (withoutSuffix) {
  44406. return format[key][2] ? format[key][2] : format[key][1];
  44407. }
  44408. return isFuture ? format[key][0] : format[key][1];
  44409. }
  44410. var et = moment.defineLocale('et', {
  44411. months: 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split(
  44412. '_'
  44413. ),
  44414. monthsShort: 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split(
  44415. '_'
  44416. ),
  44417. weekdays: 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split(
  44418. '_'
  44419. ),
  44420. weekdaysShort: 'P_E_T_K_N_R_L'.split('_'),
  44421. weekdaysMin: 'P_E_T_K_N_R_L'.split('_'),
  44422. longDateFormat: {
  44423. LT: 'H:mm',
  44424. LTS: 'H:mm:ss',
  44425. L: 'DD.MM.YYYY',
  44426. LL: 'D. MMMM YYYY',
  44427. LLL: 'D. MMMM YYYY H:mm',
  44428. LLLL: 'dddd, D. MMMM YYYY H:mm',
  44429. },
  44430. calendar: {
  44431. sameDay: '[Täna,] LT',
  44432. nextDay: '[Homme,] LT',
  44433. nextWeek: '[Järgmine] dddd LT',
  44434. lastDay: '[Eile,] LT',
  44435. lastWeek: '[Eelmine] dddd LT',
  44436. sameElse: 'L',
  44437. },
  44438. relativeTime: {
  44439. future: '%s pärast',
  44440. past: '%s tagasi',
  44441. s: processRelativeTime,
  44442. ss: processRelativeTime,
  44443. m: processRelativeTime,
  44444. mm: processRelativeTime,
  44445. h: processRelativeTime,
  44446. hh: processRelativeTime,
  44447. d: processRelativeTime,
  44448. dd: '%d päeva',
  44449. M: processRelativeTime,
  44450. MM: processRelativeTime,
  44451. y: processRelativeTime,
  44452. yy: processRelativeTime,
  44453. },
  44454. dayOfMonthOrdinalParse: /\d{1,2}\./,
  44455. ordinal: '%d.',
  44456. week: {
  44457. dow: 1, // Monday is the first day of the week.
  44458. doy: 4, // The week that contains Jan 4th is the first week of the year.
  44459. },
  44460. });
  44461. return et;
  44462. })));
  44463. /***/ }),
  44464. /***/ "./node_modules/moment/locale/eu.js":
  44465. /*!******************************************!*\
  44466. !*** ./node_modules/moment/locale/eu.js ***!
  44467. \******************************************/
  44468. /*! no static exports found */
  44469. /***/ (function(module, exports, __webpack_require__) {
  44470. //! moment.js locale configuration
  44471. //! locale : Basque [eu]
  44472. //! author : Eneko Illarramendi : https://github.com/eillarra
  44473. ;(function (global, factory) {
  44474. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  44475. undefined
  44476. }(this, (function (moment) { 'use strict';
  44477. //! moment.js locale configuration
  44478. var eu = moment.defineLocale('eu', {
  44479. months: 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split(
  44480. '_'
  44481. ),
  44482. monthsShort: 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split(
  44483. '_'
  44484. ),
  44485. monthsParseExact: true,
  44486. weekdays: 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split(
  44487. '_'
  44488. ),
  44489. weekdaysShort: 'ig._al._ar._az._og._ol._lr.'.split('_'),
  44490. weekdaysMin: 'ig_al_ar_az_og_ol_lr'.split('_'),
  44491. weekdaysParseExact: true,
  44492. longDateFormat: {
  44493. LT: 'HH:mm',
  44494. LTS: 'HH:mm:ss',
  44495. L: 'YYYY-MM-DD',
  44496. LL: 'YYYY[ko] MMMM[ren] D[a]',
  44497. LLL: 'YYYY[ko] MMMM[ren] D[a] HH:mm',
  44498. LLLL: 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm',
  44499. l: 'YYYY-M-D',
  44500. ll: 'YYYY[ko] MMM D[a]',
  44501. lll: 'YYYY[ko] MMM D[a] HH:mm',
  44502. llll: 'ddd, YYYY[ko] MMM D[a] HH:mm',
  44503. },
  44504. calendar: {
  44505. sameDay: '[gaur] LT[etan]',
  44506. nextDay: '[bihar] LT[etan]',
  44507. nextWeek: 'dddd LT[etan]',
  44508. lastDay: '[atzo] LT[etan]',
  44509. lastWeek: '[aurreko] dddd LT[etan]',
  44510. sameElse: 'L',
  44511. },
  44512. relativeTime: {
  44513. future: '%s barru',
  44514. past: 'duela %s',
  44515. s: 'segundo batzuk',
  44516. ss: '%d segundo',
  44517. m: 'minutu bat',
  44518. mm: '%d minutu',
  44519. h: 'ordu bat',
  44520. hh: '%d ordu',
  44521. d: 'egun bat',
  44522. dd: '%d egun',
  44523. M: 'hilabete bat',
  44524. MM: '%d hilabete',
  44525. y: 'urte bat',
  44526. yy: '%d urte',
  44527. },
  44528. dayOfMonthOrdinalParse: /\d{1,2}\./,
  44529. ordinal: '%d.',
  44530. week: {
  44531. dow: 1, // Monday is the first day of the week.
  44532. doy: 7, // The week that contains Jan 7th is the first week of the year.
  44533. },
  44534. });
  44535. return eu;
  44536. })));
  44537. /***/ }),
  44538. /***/ "./node_modules/moment/locale/fa.js":
  44539. /*!******************************************!*\
  44540. !*** ./node_modules/moment/locale/fa.js ***!
  44541. \******************************************/
  44542. /*! no static exports found */
  44543. /***/ (function(module, exports, __webpack_require__) {
  44544. //! moment.js locale configuration
  44545. //! locale : Persian [fa]
  44546. //! author : Ebrahim Byagowi : https://github.com/ebraminio
  44547. ;(function (global, factory) {
  44548. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  44549. undefined
  44550. }(this, (function (moment) { 'use strict';
  44551. //! moment.js locale configuration
  44552. var symbolMap = {
  44553. '1': '۱',
  44554. '2': '۲',
  44555. '3': '۳',
  44556. '4': '۴',
  44557. '5': '۵',
  44558. '6': '۶',
  44559. '7': '۷',
  44560. '8': '۸',
  44561. '9': '۹',
  44562. '0': '۰',
  44563. },
  44564. numberMap = {
  44565. '۱': '1',
  44566. '۲': '2',
  44567. '۳': '3',
  44568. '۴': '4',
  44569. '۵': '5',
  44570. '۶': '6',
  44571. '۷': '7',
  44572. '۸': '8',
  44573. '۹': '9',
  44574. '۰': '0',
  44575. };
  44576. var fa = moment.defineLocale('fa', {
  44577. months: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split(
  44578. '_'
  44579. ),
  44580. monthsShort: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split(
  44581. '_'
  44582. ),
  44583. weekdays: 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split(
  44584. '_'
  44585. ),
  44586. weekdaysShort: 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split(
  44587. '_'
  44588. ),
  44589. weekdaysMin: 'ی_د_س_چ_پ_ج_ش'.split('_'),
  44590. weekdaysParseExact: true,
  44591. longDateFormat: {
  44592. LT: 'HH:mm',
  44593. LTS: 'HH:mm:ss',
  44594. L: 'DD/MM/YYYY',
  44595. LL: 'D MMMM YYYY',
  44596. LLL: 'D MMMM YYYY HH:mm',
  44597. LLLL: 'dddd, D MMMM YYYY HH:mm',
  44598. },
  44599. meridiemParse: /قبل از ظهر|بعد از ظهر/,
  44600. isPM: function (input) {
  44601. return /بعد از ظهر/.test(input);
  44602. },
  44603. meridiem: function (hour, minute, isLower) {
  44604. if (hour < 12) {
  44605. return 'قبل از ظهر';
  44606. } else {
  44607. return 'بعد از ظهر';
  44608. }
  44609. },
  44610. calendar: {
  44611. sameDay: '[امروز ساعت] LT',
  44612. nextDay: '[فردا ساعت] LT',
  44613. nextWeek: 'dddd [ساعت] LT',
  44614. lastDay: '[دیروز ساعت] LT',
  44615. lastWeek: 'dddd [پیش] [ساعت] LT',
  44616. sameElse: 'L',
  44617. },
  44618. relativeTime: {
  44619. future: 'در %s',
  44620. past: '%s پیش',
  44621. s: 'چند ثانیه',
  44622. ss: '%d ثانیه',
  44623. m: 'یک دقیقه',
  44624. mm: '%d دقیقه',
  44625. h: 'یک ساعت',
  44626. hh: '%d ساعت',
  44627. d: 'یک روز',
  44628. dd: '%d روز',
  44629. M: 'یک ماه',
  44630. MM: '%d ماه',
  44631. y: 'یک سال',
  44632. yy: '%d سال',
  44633. },
  44634. preparse: function (string) {
  44635. return string
  44636. .replace(/[۰-۹]/g, function (match) {
  44637. return numberMap[match];
  44638. })
  44639. .replace(/،/g, ',');
  44640. },
  44641. postformat: function (string) {
  44642. return string
  44643. .replace(/\d/g, function (match) {
  44644. return symbolMap[match];
  44645. })
  44646. .replace(/,/g, '،');
  44647. },
  44648. dayOfMonthOrdinalParse: /\d{1,2}م/,
  44649. ordinal: '%dم',
  44650. week: {
  44651. dow: 6, // Saturday is the first day of the week.
  44652. doy: 12, // The week that contains Jan 12th is the first week of the year.
  44653. },
  44654. });
  44655. return fa;
  44656. })));
  44657. /***/ }),
  44658. /***/ "./node_modules/moment/locale/fi.js":
  44659. /*!******************************************!*\
  44660. !*** ./node_modules/moment/locale/fi.js ***!
  44661. \******************************************/
  44662. /*! no static exports found */
  44663. /***/ (function(module, exports, __webpack_require__) {
  44664. //! moment.js locale configuration
  44665. //! locale : Finnish [fi]
  44666. //! author : Tarmo Aidantausta : https://github.com/bleadof
  44667. ;(function (global, factory) {
  44668. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  44669. undefined
  44670. }(this, (function (moment) { 'use strict';
  44671. //! moment.js locale configuration
  44672. var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(
  44673. ' '
  44674. ),
  44675. numbersFuture = [
  44676. 'nolla',
  44677. 'yhden',
  44678. 'kahden',
  44679. 'kolmen',
  44680. 'neljän',
  44681. 'viiden',
  44682. 'kuuden',
  44683. numbersPast[7],
  44684. numbersPast[8],
  44685. numbersPast[9],
  44686. ];
  44687. function translate(number, withoutSuffix, key, isFuture) {
  44688. var result = '';
  44689. switch (key) {
  44690. case 's':
  44691. return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';
  44692. case 'ss':
  44693. result = isFuture ? 'sekunnin' : 'sekuntia';
  44694. break;
  44695. case 'm':
  44696. return isFuture ? 'minuutin' : 'minuutti';
  44697. case 'mm':
  44698. result = isFuture ? 'minuutin' : 'minuuttia';
  44699. break;
  44700. case 'h':
  44701. return isFuture ? 'tunnin' : 'tunti';
  44702. case 'hh':
  44703. result = isFuture ? 'tunnin' : 'tuntia';
  44704. break;
  44705. case 'd':
  44706. return isFuture ? 'päivän' : 'päivä';
  44707. case 'dd':
  44708. result = isFuture ? 'päivän' : 'päivää';
  44709. break;
  44710. case 'M':
  44711. return isFuture ? 'kuukauden' : 'kuukausi';
  44712. case 'MM':
  44713. result = isFuture ? 'kuukauden' : 'kuukautta';
  44714. break;
  44715. case 'y':
  44716. return isFuture ? 'vuoden' : 'vuosi';
  44717. case 'yy':
  44718. result = isFuture ? 'vuoden' : 'vuotta';
  44719. break;
  44720. }
  44721. result = verbalNumber(number, isFuture) + ' ' + result;
  44722. return result;
  44723. }
  44724. function verbalNumber(number, isFuture) {
  44725. return number < 10
  44726. ? isFuture
  44727. ? numbersFuture[number]
  44728. : numbersPast[number]
  44729. : number;
  44730. }
  44731. var fi = moment.defineLocale('fi', {
  44732. months: 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split(
  44733. '_'
  44734. ),
  44735. monthsShort: 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split(
  44736. '_'
  44737. ),
  44738. weekdays: 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split(
  44739. '_'
  44740. ),
  44741. weekdaysShort: 'su_ma_ti_ke_to_pe_la'.split('_'),
  44742. weekdaysMin: 'su_ma_ti_ke_to_pe_la'.split('_'),
  44743. longDateFormat: {
  44744. LT: 'HH.mm',
  44745. LTS: 'HH.mm.ss',
  44746. L: 'DD.MM.YYYY',
  44747. LL: 'Do MMMM[ta] YYYY',
  44748. LLL: 'Do MMMM[ta] YYYY, [klo] HH.mm',
  44749. LLLL: 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm',
  44750. l: 'D.M.YYYY',
  44751. ll: 'Do MMM YYYY',
  44752. lll: 'Do MMM YYYY, [klo] HH.mm',
  44753. llll: 'ddd, Do MMM YYYY, [klo] HH.mm',
  44754. },
  44755. calendar: {
  44756. sameDay: '[tänään] [klo] LT',
  44757. nextDay: '[huomenna] [klo] LT',
  44758. nextWeek: 'dddd [klo] LT',
  44759. lastDay: '[eilen] [klo] LT',
  44760. lastWeek: '[viime] dddd[na] [klo] LT',
  44761. sameElse: 'L',
  44762. },
  44763. relativeTime: {
  44764. future: '%s päästä',
  44765. past: '%s sitten',
  44766. s: translate,
  44767. ss: translate,
  44768. m: translate,
  44769. mm: translate,
  44770. h: translate,
  44771. hh: translate,
  44772. d: translate,
  44773. dd: translate,
  44774. M: translate,
  44775. MM: translate,
  44776. y: translate,
  44777. yy: translate,
  44778. },
  44779. dayOfMonthOrdinalParse: /\d{1,2}\./,
  44780. ordinal: '%d.',
  44781. week: {
  44782. dow: 1, // Monday is the first day of the week.
  44783. doy: 4, // The week that contains Jan 4th is the first week of the year.
  44784. },
  44785. });
  44786. return fi;
  44787. })));
  44788. /***/ }),
  44789. /***/ "./node_modules/moment/locale/fil.js":
  44790. /*!*******************************************!*\
  44791. !*** ./node_modules/moment/locale/fil.js ***!
  44792. \*******************************************/
  44793. /*! no static exports found */
  44794. /***/ (function(module, exports, __webpack_require__) {
  44795. //! moment.js locale configuration
  44796. //! locale : Filipino [fil]
  44797. //! author : Dan Hagman : https://github.com/hagmandan
  44798. //! author : Matthew Co : https://github.com/matthewdeeco
  44799. ;(function (global, factory) {
  44800. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  44801. undefined
  44802. }(this, (function (moment) { 'use strict';
  44803. //! moment.js locale configuration
  44804. var fil = moment.defineLocale('fil', {
  44805. months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split(
  44806. '_'
  44807. ),
  44808. monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),
  44809. weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split(
  44810. '_'
  44811. ),
  44812. weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),
  44813. weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),
  44814. longDateFormat: {
  44815. LT: 'HH:mm',
  44816. LTS: 'HH:mm:ss',
  44817. L: 'MM/D/YYYY',
  44818. LL: 'MMMM D, YYYY',
  44819. LLL: 'MMMM D, YYYY HH:mm',
  44820. LLLL: 'dddd, MMMM DD, YYYY HH:mm',
  44821. },
  44822. calendar: {
  44823. sameDay: 'LT [ngayong araw]',
  44824. nextDay: '[Bukas ng] LT',
  44825. nextWeek: 'LT [sa susunod na] dddd',
  44826. lastDay: 'LT [kahapon]',
  44827. lastWeek: 'LT [noong nakaraang] dddd',
  44828. sameElse: 'L',
  44829. },
  44830. relativeTime: {
  44831. future: 'sa loob ng %s',
  44832. past: '%s ang nakalipas',
  44833. s: 'ilang segundo',
  44834. ss: '%d segundo',
  44835. m: 'isang minuto',
  44836. mm: '%d minuto',
  44837. h: 'isang oras',
  44838. hh: '%d oras',
  44839. d: 'isang araw',
  44840. dd: '%d araw',
  44841. M: 'isang buwan',
  44842. MM: '%d buwan',
  44843. y: 'isang taon',
  44844. yy: '%d taon',
  44845. },
  44846. dayOfMonthOrdinalParse: /\d{1,2}/,
  44847. ordinal: function (number) {
  44848. return number;
  44849. },
  44850. week: {
  44851. dow: 1, // Monday is the first day of the week.
  44852. doy: 4, // The week that contains Jan 4th is the first week of the year.
  44853. },
  44854. });
  44855. return fil;
  44856. })));
  44857. /***/ }),
  44858. /***/ "./node_modules/moment/locale/fo.js":
  44859. /*!******************************************!*\
  44860. !*** ./node_modules/moment/locale/fo.js ***!
  44861. \******************************************/
  44862. /*! no static exports found */
  44863. /***/ (function(module, exports, __webpack_require__) {
  44864. //! moment.js locale configuration
  44865. //! locale : Faroese [fo]
  44866. //! author : Ragnar Johannesen : https://github.com/ragnar123
  44867. //! author : Kristian Sakarisson : https://github.com/sakarisson
  44868. ;(function (global, factory) {
  44869. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  44870. undefined
  44871. }(this, (function (moment) { 'use strict';
  44872. //! moment.js locale configuration
  44873. var fo = moment.defineLocale('fo', {
  44874. months: 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split(
  44875. '_'
  44876. ),
  44877. monthsShort: 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
  44878. weekdays: 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split(
  44879. '_'
  44880. ),
  44881. weekdaysShort: 'sun_mán_týs_mik_hós_frí_ley'.split('_'),
  44882. weekdaysMin: 'su_má_tý_mi_hó_fr_le'.split('_'),
  44883. longDateFormat: {
  44884. LT: 'HH:mm',
  44885. LTS: 'HH:mm:ss',
  44886. L: 'DD/MM/YYYY',
  44887. LL: 'D MMMM YYYY',
  44888. LLL: 'D MMMM YYYY HH:mm',
  44889. LLLL: 'dddd D. MMMM, YYYY HH:mm',
  44890. },
  44891. calendar: {
  44892. sameDay: '[Í dag kl.] LT',
  44893. nextDay: '[Í morgin kl.] LT',
  44894. nextWeek: 'dddd [kl.] LT',
  44895. lastDay: '[Í gjár kl.] LT',
  44896. lastWeek: '[síðstu] dddd [kl] LT',
  44897. sameElse: 'L',
  44898. },
  44899. relativeTime: {
  44900. future: 'um %s',
  44901. past: '%s síðani',
  44902. s: 'fá sekund',
  44903. ss: '%d sekundir',
  44904. m: 'ein minuttur',
  44905. mm: '%d minuttir',
  44906. h: 'ein tími',
  44907. hh: '%d tímar',
  44908. d: 'ein dagur',
  44909. dd: '%d dagar',
  44910. M: 'ein mánaður',
  44911. MM: '%d mánaðir',
  44912. y: 'eitt ár',
  44913. yy: '%d ár',
  44914. },
  44915. dayOfMonthOrdinalParse: /\d{1,2}\./,
  44916. ordinal: '%d.',
  44917. week: {
  44918. dow: 1, // Monday is the first day of the week.
  44919. doy: 4, // The week that contains Jan 4th is the first week of the year.
  44920. },
  44921. });
  44922. return fo;
  44923. })));
  44924. /***/ }),
  44925. /***/ "./node_modules/moment/locale/fr-ca.js":
  44926. /*!*********************************************!*\
  44927. !*** ./node_modules/moment/locale/fr-ca.js ***!
  44928. \*********************************************/
  44929. /*! no static exports found */
  44930. /***/ (function(module, exports, __webpack_require__) {
  44931. //! moment.js locale configuration
  44932. //! locale : French (Canada) [fr-ca]
  44933. //! author : Jonathan Abourbih : https://github.com/jonbca
  44934. ;(function (global, factory) {
  44935. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  44936. undefined
  44937. }(this, (function (moment) { 'use strict';
  44938. //! moment.js locale configuration
  44939. var frCa = moment.defineLocale('fr-ca', {
  44940. months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(
  44941. '_'
  44942. ),
  44943. monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(
  44944. '_'
  44945. ),
  44946. monthsParseExact: true,
  44947. weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  44948. weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
  44949. weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
  44950. weekdaysParseExact: true,
  44951. longDateFormat: {
  44952. LT: 'HH:mm',
  44953. LTS: 'HH:mm:ss',
  44954. L: 'YYYY-MM-DD',
  44955. LL: 'D MMMM YYYY',
  44956. LLL: 'D MMMM YYYY HH:mm',
  44957. LLLL: 'dddd D MMMM YYYY HH:mm',
  44958. },
  44959. calendar: {
  44960. sameDay: '[Aujourd’hui à] LT',
  44961. nextDay: '[Demain à] LT',
  44962. nextWeek: 'dddd [à] LT',
  44963. lastDay: '[Hier à] LT',
  44964. lastWeek: 'dddd [dernier à] LT',
  44965. sameElse: 'L',
  44966. },
  44967. relativeTime: {
  44968. future: 'dans %s',
  44969. past: 'il y a %s',
  44970. s: 'quelques secondes',
  44971. ss: '%d secondes',
  44972. m: 'une minute',
  44973. mm: '%d minutes',
  44974. h: 'une heure',
  44975. hh: '%d heures',
  44976. d: 'un jour',
  44977. dd: '%d jours',
  44978. M: 'un mois',
  44979. MM: '%d mois',
  44980. y: 'un an',
  44981. yy: '%d ans',
  44982. },
  44983. dayOfMonthOrdinalParse: /\d{1,2}(er|e)/,
  44984. ordinal: function (number, period) {
  44985. switch (period) {
  44986. // Words with masculine grammatical gender: mois, trimestre, jour
  44987. default:
  44988. case 'M':
  44989. case 'Q':
  44990. case 'D':
  44991. case 'DDD':
  44992. case 'd':
  44993. return number + (number === 1 ? 'er' : 'e');
  44994. // Words with feminine grammatical gender: semaine
  44995. case 'w':
  44996. case 'W':
  44997. return number + (number === 1 ? 're' : 'e');
  44998. }
  44999. },
  45000. });
  45001. return frCa;
  45002. })));
  45003. /***/ }),
  45004. /***/ "./node_modules/moment/locale/fr-ch.js":
  45005. /*!*********************************************!*\
  45006. !*** ./node_modules/moment/locale/fr-ch.js ***!
  45007. \*********************************************/
  45008. /*! no static exports found */
  45009. /***/ (function(module, exports, __webpack_require__) {
  45010. //! moment.js locale configuration
  45011. //! locale : French (Switzerland) [fr-ch]
  45012. //! author : Gaspard Bucher : https://github.com/gaspard
  45013. ;(function (global, factory) {
  45014. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  45015. undefined
  45016. }(this, (function (moment) { 'use strict';
  45017. //! moment.js locale configuration
  45018. var frCh = moment.defineLocale('fr-ch', {
  45019. months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(
  45020. '_'
  45021. ),
  45022. monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(
  45023. '_'
  45024. ),
  45025. monthsParseExact: true,
  45026. weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  45027. weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
  45028. weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
  45029. weekdaysParseExact: true,
  45030. longDateFormat: {
  45031. LT: 'HH:mm',
  45032. LTS: 'HH:mm:ss',
  45033. L: 'DD.MM.YYYY',
  45034. LL: 'D MMMM YYYY',
  45035. LLL: 'D MMMM YYYY HH:mm',
  45036. LLLL: 'dddd D MMMM YYYY HH:mm',
  45037. },
  45038. calendar: {
  45039. sameDay: '[Aujourd’hui à] LT',
  45040. nextDay: '[Demain à] LT',
  45041. nextWeek: 'dddd [à] LT',
  45042. lastDay: '[Hier à] LT',
  45043. lastWeek: 'dddd [dernier à] LT',
  45044. sameElse: 'L',
  45045. },
  45046. relativeTime: {
  45047. future: 'dans %s',
  45048. past: 'il y a %s',
  45049. s: 'quelques secondes',
  45050. ss: '%d secondes',
  45051. m: 'une minute',
  45052. mm: '%d minutes',
  45053. h: 'une heure',
  45054. hh: '%d heures',
  45055. d: 'un jour',
  45056. dd: '%d jours',
  45057. M: 'un mois',
  45058. MM: '%d mois',
  45059. y: 'un an',
  45060. yy: '%d ans',
  45061. },
  45062. dayOfMonthOrdinalParse: /\d{1,2}(er|e)/,
  45063. ordinal: function (number, period) {
  45064. switch (period) {
  45065. // Words with masculine grammatical gender: mois, trimestre, jour
  45066. default:
  45067. case 'M':
  45068. case 'Q':
  45069. case 'D':
  45070. case 'DDD':
  45071. case 'd':
  45072. return number + (number === 1 ? 'er' : 'e');
  45073. // Words with feminine grammatical gender: semaine
  45074. case 'w':
  45075. case 'W':
  45076. return number + (number === 1 ? 're' : 'e');
  45077. }
  45078. },
  45079. week: {
  45080. dow: 1, // Monday is the first day of the week.
  45081. doy: 4, // The week that contains Jan 4th is the first week of the year.
  45082. },
  45083. });
  45084. return frCh;
  45085. })));
  45086. /***/ }),
  45087. /***/ "./node_modules/moment/locale/fr.js":
  45088. /*!******************************************!*\
  45089. !*** ./node_modules/moment/locale/fr.js ***!
  45090. \******************************************/
  45091. /*! no static exports found */
  45092. /***/ (function(module, exports, __webpack_require__) {
  45093. //! moment.js locale configuration
  45094. //! locale : French [fr]
  45095. //! author : John Fischer : https://github.com/jfroffice
  45096. ;(function (global, factory) {
  45097. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  45098. undefined
  45099. }(this, (function (moment) { 'use strict';
  45100. //! moment.js locale configuration
  45101. var monthsStrictRegex = /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,
  45102. monthsShortStrictRegex = /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,
  45103. monthsRegex = /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,
  45104. monthsParse = [
  45105. /^janv/i,
  45106. /^févr/i,
  45107. /^mars/i,
  45108. /^avr/i,
  45109. /^mai/i,
  45110. /^juin/i,
  45111. /^juil/i,
  45112. /^août/i,
  45113. /^sept/i,
  45114. /^oct/i,
  45115. /^nov/i,
  45116. /^déc/i,
  45117. ];
  45118. var fr = moment.defineLocale('fr', {
  45119. months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(
  45120. '_'
  45121. ),
  45122. monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(
  45123. '_'
  45124. ),
  45125. monthsRegex: monthsRegex,
  45126. monthsShortRegex: monthsRegex,
  45127. monthsStrictRegex: monthsStrictRegex,
  45128. monthsShortStrictRegex: monthsShortStrictRegex,
  45129. monthsParse: monthsParse,
  45130. longMonthsParse: monthsParse,
  45131. shortMonthsParse: monthsParse,
  45132. weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  45133. weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
  45134. weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
  45135. weekdaysParseExact: true,
  45136. longDateFormat: {
  45137. LT: 'HH:mm',
  45138. LTS: 'HH:mm:ss',
  45139. L: 'DD/MM/YYYY',
  45140. LL: 'D MMMM YYYY',
  45141. LLL: 'D MMMM YYYY HH:mm',
  45142. LLLL: 'dddd D MMMM YYYY HH:mm',
  45143. },
  45144. calendar: {
  45145. sameDay: '[Aujourd’hui à] LT',
  45146. nextDay: '[Demain à] LT',
  45147. nextWeek: 'dddd [à] LT',
  45148. lastDay: '[Hier à] LT',
  45149. lastWeek: 'dddd [dernier à] LT',
  45150. sameElse: 'L',
  45151. },
  45152. relativeTime: {
  45153. future: 'dans %s',
  45154. past: 'il y a %s',
  45155. s: 'quelques secondes',
  45156. ss: '%d secondes',
  45157. m: 'une minute',
  45158. mm: '%d minutes',
  45159. h: 'une heure',
  45160. hh: '%d heures',
  45161. d: 'un jour',
  45162. dd: '%d jours',
  45163. M: 'un mois',
  45164. MM: '%d mois',
  45165. y: 'un an',
  45166. yy: '%d ans',
  45167. },
  45168. dayOfMonthOrdinalParse: /\d{1,2}(er|)/,
  45169. ordinal: function (number, period) {
  45170. switch (period) {
  45171. // TODO: Return 'e' when day of month > 1. Move this case inside
  45172. // block for masculine words below.
  45173. // See https://github.com/moment/moment/issues/3375
  45174. case 'D':
  45175. return number + (number === 1 ? 'er' : '');
  45176. // Words with masculine grammatical gender: mois, trimestre, jour
  45177. default:
  45178. case 'M':
  45179. case 'Q':
  45180. case 'DDD':
  45181. case 'd':
  45182. return number + (number === 1 ? 'er' : 'e');
  45183. // Words with feminine grammatical gender: semaine
  45184. case 'w':
  45185. case 'W':
  45186. return number + (number === 1 ? 're' : 'e');
  45187. }
  45188. },
  45189. week: {
  45190. dow: 1, // Monday is the first day of the week.
  45191. doy: 4, // The week that contains Jan 4th is the first week of the year.
  45192. },
  45193. });
  45194. return fr;
  45195. })));
  45196. /***/ }),
  45197. /***/ "./node_modules/moment/locale/fy.js":
  45198. /*!******************************************!*\
  45199. !*** ./node_modules/moment/locale/fy.js ***!
  45200. \******************************************/
  45201. /*! no static exports found */
  45202. /***/ (function(module, exports, __webpack_require__) {
  45203. //! moment.js locale configuration
  45204. //! locale : Frisian [fy]
  45205. //! author : Robin van der Vliet : https://github.com/robin0van0der0v
  45206. ;(function (global, factory) {
  45207. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  45208. undefined
  45209. }(this, (function (moment) { 'use strict';
  45210. //! moment.js locale configuration
  45211. var monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split(
  45212. '_'
  45213. ),
  45214. monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split(
  45215. '_'
  45216. );
  45217. var fy = moment.defineLocale('fy', {
  45218. months: 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split(
  45219. '_'
  45220. ),
  45221. monthsShort: function (m, format) {
  45222. if (!m) {
  45223. return monthsShortWithDots;
  45224. } else if (/-MMM-/.test(format)) {
  45225. return monthsShortWithoutDots[m.month()];
  45226. } else {
  45227. return monthsShortWithDots[m.month()];
  45228. }
  45229. },
  45230. monthsParseExact: true,
  45231. weekdays: 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split(
  45232. '_'
  45233. ),
  45234. weekdaysShort: 'si._mo._ti._wo._to._fr._so.'.split('_'),
  45235. weekdaysMin: 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),
  45236. weekdaysParseExact: true,
  45237. longDateFormat: {
  45238. LT: 'HH:mm',
  45239. LTS: 'HH:mm:ss',
  45240. L: 'DD-MM-YYYY',
  45241. LL: 'D MMMM YYYY',
  45242. LLL: 'D MMMM YYYY HH:mm',
  45243. LLLL: 'dddd D MMMM YYYY HH:mm',
  45244. },
  45245. calendar: {
  45246. sameDay: '[hjoed om] LT',
  45247. nextDay: '[moarn om] LT',
  45248. nextWeek: 'dddd [om] LT',
  45249. lastDay: '[juster om] LT',
  45250. lastWeek: '[ôfrûne] dddd [om] LT',
  45251. sameElse: 'L',
  45252. },
  45253. relativeTime: {
  45254. future: 'oer %s',
  45255. past: '%s lyn',
  45256. s: 'in pear sekonden',
  45257. ss: '%d sekonden',
  45258. m: 'ien minút',
  45259. mm: '%d minuten',
  45260. h: 'ien oere',
  45261. hh: '%d oeren',
  45262. d: 'ien dei',
  45263. dd: '%d dagen',
  45264. M: 'ien moanne',
  45265. MM: '%d moannen',
  45266. y: 'ien jier',
  45267. yy: '%d jierren',
  45268. },
  45269. dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
  45270. ordinal: function (number) {
  45271. return (
  45272. number +
  45273. (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')
  45274. );
  45275. },
  45276. week: {
  45277. dow: 1, // Monday is the first day of the week.
  45278. doy: 4, // The week that contains Jan 4th is the first week of the year.
  45279. },
  45280. });
  45281. return fy;
  45282. })));
  45283. /***/ }),
  45284. /***/ "./node_modules/moment/locale/ga.js":
  45285. /*!******************************************!*\
  45286. !*** ./node_modules/moment/locale/ga.js ***!
  45287. \******************************************/
  45288. /*! no static exports found */
  45289. /***/ (function(module, exports, __webpack_require__) {
  45290. //! moment.js locale configuration
  45291. //! locale : Irish or Irish Gaelic [ga]
  45292. //! author : André Silva : https://github.com/askpt
  45293. ;(function (global, factory) {
  45294. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  45295. undefined
  45296. }(this, (function (moment) { 'use strict';
  45297. //! moment.js locale configuration
  45298. var months = [
  45299. 'Eanáir',
  45300. 'Feabhra',
  45301. 'Márta',
  45302. 'Aibreán',
  45303. 'Bealtaine',
  45304. 'Meitheamh',
  45305. 'Iúil',
  45306. 'Lúnasa',
  45307. 'Meán Fómhair',
  45308. 'Deireadh Fómhair',
  45309. 'Samhain',
  45310. 'Nollaig',
  45311. ],
  45312. monthsShort = [
  45313. 'Ean',
  45314. 'Feabh',
  45315. 'Márt',
  45316. 'Aib',
  45317. 'Beal',
  45318. 'Meith',
  45319. 'Iúil',
  45320. 'Lún',
  45321. 'M.F.',
  45322. 'D.F.',
  45323. 'Samh',
  45324. 'Noll',
  45325. ],
  45326. weekdays = [
  45327. 'Dé Domhnaigh',
  45328. 'Dé Luain',
  45329. 'Dé Máirt',
  45330. 'Dé Céadaoin',
  45331. 'Déardaoin',
  45332. 'Dé hAoine',
  45333. 'Dé Sathairn',
  45334. ],
  45335. weekdaysShort = ['Domh', 'Luan', 'Máirt', 'Céad', 'Déar', 'Aoine', 'Sath'],
  45336. weekdaysMin = ['Do', 'Lu', 'Má', 'Cé', 'Dé', 'A', 'Sa'];
  45337. var ga = moment.defineLocale('ga', {
  45338. months: months,
  45339. monthsShort: monthsShort,
  45340. monthsParseExact: true,
  45341. weekdays: weekdays,
  45342. weekdaysShort: weekdaysShort,
  45343. weekdaysMin: weekdaysMin,
  45344. longDateFormat: {
  45345. LT: 'HH:mm',
  45346. LTS: 'HH:mm:ss',
  45347. L: 'DD/MM/YYYY',
  45348. LL: 'D MMMM YYYY',
  45349. LLL: 'D MMMM YYYY HH:mm',
  45350. LLLL: 'dddd, D MMMM YYYY HH:mm',
  45351. },
  45352. calendar: {
  45353. sameDay: '[Inniu ag] LT',
  45354. nextDay: '[Amárach ag] LT',
  45355. nextWeek: 'dddd [ag] LT',
  45356. lastDay: '[Inné ag] LT',
  45357. lastWeek: 'dddd [seo caite] [ag] LT',
  45358. sameElse: 'L',
  45359. },
  45360. relativeTime: {
  45361. future: 'i %s',
  45362. past: '%s ó shin',
  45363. s: 'cúpla soicind',
  45364. ss: '%d soicind',
  45365. m: 'nóiméad',
  45366. mm: '%d nóiméad',
  45367. h: 'uair an chloig',
  45368. hh: '%d uair an chloig',
  45369. d: 'lá',
  45370. dd: '%d lá',
  45371. M: 'mí',
  45372. MM: '%d míonna',
  45373. y: 'bliain',
  45374. yy: '%d bliain',
  45375. },
  45376. dayOfMonthOrdinalParse: /\d{1,2}(d|na|mh)/,
  45377. ordinal: function (number) {
  45378. var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';
  45379. return number + output;
  45380. },
  45381. week: {
  45382. dow: 1, // Monday is the first day of the week.
  45383. doy: 4, // The week that contains Jan 4th is the first week of the year.
  45384. },
  45385. });
  45386. return ga;
  45387. })));
  45388. /***/ }),
  45389. /***/ "./node_modules/moment/locale/gd.js":
  45390. /*!******************************************!*\
  45391. !*** ./node_modules/moment/locale/gd.js ***!
  45392. \******************************************/
  45393. /*! no static exports found */
  45394. /***/ (function(module, exports, __webpack_require__) {
  45395. //! moment.js locale configuration
  45396. //! locale : Scottish Gaelic [gd]
  45397. //! author : Jon Ashdown : https://github.com/jonashdown
  45398. ;(function (global, factory) {
  45399. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  45400. undefined
  45401. }(this, (function (moment) { 'use strict';
  45402. //! moment.js locale configuration
  45403. var months = [
  45404. 'Am Faoilleach',
  45405. 'An Gearran',
  45406. 'Am Màrt',
  45407. 'An Giblean',
  45408. 'An Cèitean',
  45409. 'An t-Ògmhios',
  45410. 'An t-Iuchar',
  45411. 'An Lùnastal',
  45412. 'An t-Sultain',
  45413. 'An Dàmhair',
  45414. 'An t-Samhain',
  45415. 'An Dùbhlachd',
  45416. ],
  45417. monthsShort = [
  45418. 'Faoi',
  45419. 'Gear',
  45420. 'Màrt',
  45421. 'Gibl',
  45422. 'Cèit',
  45423. 'Ògmh',
  45424. 'Iuch',
  45425. 'Lùn',
  45426. 'Sult',
  45427. 'Dàmh',
  45428. 'Samh',
  45429. 'Dùbh',
  45430. ],
  45431. weekdays = [
  45432. 'Didòmhnaich',
  45433. 'Diluain',
  45434. 'Dimàirt',
  45435. 'Diciadain',
  45436. 'Diardaoin',
  45437. 'Dihaoine',
  45438. 'Disathairne',
  45439. ],
  45440. weekdaysShort = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis'],
  45441. weekdaysMin = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa'];
  45442. var gd = moment.defineLocale('gd', {
  45443. months: months,
  45444. monthsShort: monthsShort,
  45445. monthsParseExact: true,
  45446. weekdays: weekdays,
  45447. weekdaysShort: weekdaysShort,
  45448. weekdaysMin: weekdaysMin,
  45449. longDateFormat: {
  45450. LT: 'HH:mm',
  45451. LTS: 'HH:mm:ss',
  45452. L: 'DD/MM/YYYY',
  45453. LL: 'D MMMM YYYY',
  45454. LLL: 'D MMMM YYYY HH:mm',
  45455. LLLL: 'dddd, D MMMM YYYY HH:mm',
  45456. },
  45457. calendar: {
  45458. sameDay: '[An-diugh aig] LT',
  45459. nextDay: '[A-màireach aig] LT',
  45460. nextWeek: 'dddd [aig] LT',
  45461. lastDay: '[An-dè aig] LT',
  45462. lastWeek: 'dddd [seo chaidh] [aig] LT',
  45463. sameElse: 'L',
  45464. },
  45465. relativeTime: {
  45466. future: 'ann an %s',
  45467. past: 'bho chionn %s',
  45468. s: 'beagan diogan',
  45469. ss: '%d diogan',
  45470. m: 'mionaid',
  45471. mm: '%d mionaidean',
  45472. h: 'uair',
  45473. hh: '%d uairean',
  45474. d: 'latha',
  45475. dd: '%d latha',
  45476. M: 'mìos',
  45477. MM: '%d mìosan',
  45478. y: 'bliadhna',
  45479. yy: '%d bliadhna',
  45480. },
  45481. dayOfMonthOrdinalParse: /\d{1,2}(d|na|mh)/,
  45482. ordinal: function (number) {
  45483. var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';
  45484. return number + output;
  45485. },
  45486. week: {
  45487. dow: 1, // Monday is the first day of the week.
  45488. doy: 4, // The week that contains Jan 4th is the first week of the year.
  45489. },
  45490. });
  45491. return gd;
  45492. })));
  45493. /***/ }),
  45494. /***/ "./node_modules/moment/locale/gl.js":
  45495. /*!******************************************!*\
  45496. !*** ./node_modules/moment/locale/gl.js ***!
  45497. \******************************************/
  45498. /*! no static exports found */
  45499. /***/ (function(module, exports, __webpack_require__) {
  45500. //! moment.js locale configuration
  45501. //! locale : Galician [gl]
  45502. //! author : Juan G. Hurtado : https://github.com/juanghurtado
  45503. ;(function (global, factory) {
  45504. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  45505. undefined
  45506. }(this, (function (moment) { 'use strict';
  45507. //! moment.js locale configuration
  45508. var gl = moment.defineLocale('gl', {
  45509. months: 'xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro'.split(
  45510. '_'
  45511. ),
  45512. monthsShort: 'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split(
  45513. '_'
  45514. ),
  45515. monthsParseExact: true,
  45516. weekdays: 'domingo_luns_martes_mércores_xoves_venres_sábado'.split('_'),
  45517. weekdaysShort: 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'),
  45518. weekdaysMin: 'do_lu_ma_mé_xo_ve_sá'.split('_'),
  45519. weekdaysParseExact: true,
  45520. longDateFormat: {
  45521. LT: 'H:mm',
  45522. LTS: 'H:mm:ss',
  45523. L: 'DD/MM/YYYY',
  45524. LL: 'D [de] MMMM [de] YYYY',
  45525. LLL: 'D [de] MMMM [de] YYYY H:mm',
  45526. LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',
  45527. },
  45528. calendar: {
  45529. sameDay: function () {
  45530. return '[hoxe ' + (this.hours() !== 1 ? 'ás' : 'á') + '] LT';
  45531. },
  45532. nextDay: function () {
  45533. return '[mañá ' + (this.hours() !== 1 ? 'ás' : 'á') + '] LT';
  45534. },
  45535. nextWeek: function () {
  45536. return 'dddd [' + (this.hours() !== 1 ? 'ás' : 'a') + '] LT';
  45537. },
  45538. lastDay: function () {
  45539. return '[onte ' + (this.hours() !== 1 ? 'á' : 'a') + '] LT';
  45540. },
  45541. lastWeek: function () {
  45542. return (
  45543. '[o] dddd [pasado ' + (this.hours() !== 1 ? 'ás' : 'a') + '] LT'
  45544. );
  45545. },
  45546. sameElse: 'L',
  45547. },
  45548. relativeTime: {
  45549. future: function (str) {
  45550. if (str.indexOf('un') === 0) {
  45551. return 'n' + str;
  45552. }
  45553. return 'en ' + str;
  45554. },
  45555. past: 'hai %s',
  45556. s: 'uns segundos',
  45557. ss: '%d segundos',
  45558. m: 'un minuto',
  45559. mm: '%d minutos',
  45560. h: 'unha hora',
  45561. hh: '%d horas',
  45562. d: 'un día',
  45563. dd: '%d días',
  45564. M: 'un mes',
  45565. MM: '%d meses',
  45566. y: 'un ano',
  45567. yy: '%d anos',
  45568. },
  45569. dayOfMonthOrdinalParse: /\d{1,2}º/,
  45570. ordinal: '%dº',
  45571. week: {
  45572. dow: 1, // Monday is the first day of the week.
  45573. doy: 4, // The week that contains Jan 4th is the first week of the year.
  45574. },
  45575. });
  45576. return gl;
  45577. })));
  45578. /***/ }),
  45579. /***/ "./node_modules/moment/locale/gom-deva.js":
  45580. /*!************************************************!*\
  45581. !*** ./node_modules/moment/locale/gom-deva.js ***!
  45582. \************************************************/
  45583. /*! no static exports found */
  45584. /***/ (function(module, exports, __webpack_require__) {
  45585. //! moment.js locale configuration
  45586. //! locale : Konkani Devanagari script [gom-deva]
  45587. //! author : The Discoverer : https://github.com/WikiDiscoverer
  45588. ;(function (global, factory) {
  45589. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  45590. undefined
  45591. }(this, (function (moment) { 'use strict';
  45592. //! moment.js locale configuration
  45593. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  45594. var format = {
  45595. s: ['थोडया सॅकंडांनी', 'थोडे सॅकंड'],
  45596. ss: [number + ' सॅकंडांनी', number + ' सॅकंड'],
  45597. m: ['एका मिणटान', 'एक मिनूट'],
  45598. mm: [number + ' मिणटांनी', number + ' मिणटां'],
  45599. h: ['एका वरान', 'एक वर'],
  45600. hh: [number + ' वरांनी', number + ' वरां'],
  45601. d: ['एका दिसान', 'एक दीस'],
  45602. dd: [number + ' दिसांनी', number + ' दीस'],
  45603. M: ['एका म्हयन्यान', 'एक म्हयनो'],
  45604. MM: [number + ' म्हयन्यानी', number + ' म्हयने'],
  45605. y: ['एका वर्सान', 'एक वर्स'],
  45606. yy: [number + ' वर्सांनी', number + ' वर्सां'],
  45607. };
  45608. return isFuture ? format[key][0] : format[key][1];
  45609. }
  45610. var gomDeva = moment.defineLocale('gom-deva', {
  45611. months: {
  45612. standalone: 'जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split(
  45613. '_'
  45614. ),
  45615. format: 'जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या'.split(
  45616. '_'
  45617. ),
  45618. isFormat: /MMMM(\s)+D[oD]?/,
  45619. },
  45620. monthsShort: 'जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split(
  45621. '_'
  45622. ),
  45623. monthsParseExact: true,
  45624. weekdays: 'आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार'.split('_'),
  45625. weekdaysShort: 'आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.'.split('_'),
  45626. weekdaysMin: 'आ_सो_मं_बु_ब्रे_सु_शे'.split('_'),
  45627. weekdaysParseExact: true,
  45628. longDateFormat: {
  45629. LT: 'A h:mm [वाजतां]',
  45630. LTS: 'A h:mm:ss [वाजतां]',
  45631. L: 'DD-MM-YYYY',
  45632. LL: 'D MMMM YYYY',
  45633. LLL: 'D MMMM YYYY A h:mm [वाजतां]',
  45634. LLLL: 'dddd, MMMM Do, YYYY, A h:mm [वाजतां]',
  45635. llll: 'ddd, D MMM YYYY, A h:mm [वाजतां]',
  45636. },
  45637. calendar: {
  45638. sameDay: '[आयज] LT',
  45639. nextDay: '[फाल्यां] LT',
  45640. nextWeek: '[फुडलो] dddd[,] LT',
  45641. lastDay: '[काल] LT',
  45642. lastWeek: '[फाटलो] dddd[,] LT',
  45643. sameElse: 'L',
  45644. },
  45645. relativeTime: {
  45646. future: '%s',
  45647. past: '%s आदीं',
  45648. s: processRelativeTime,
  45649. ss: processRelativeTime,
  45650. m: processRelativeTime,
  45651. mm: processRelativeTime,
  45652. h: processRelativeTime,
  45653. hh: processRelativeTime,
  45654. d: processRelativeTime,
  45655. dd: processRelativeTime,
  45656. M: processRelativeTime,
  45657. MM: processRelativeTime,
  45658. y: processRelativeTime,
  45659. yy: processRelativeTime,
  45660. },
  45661. dayOfMonthOrdinalParse: /\d{1,2}(वेर)/,
  45662. ordinal: function (number, period) {
  45663. switch (period) {
  45664. // the ordinal 'वेर' only applies to day of the month
  45665. case 'D':
  45666. return number + 'वेर';
  45667. default:
  45668. case 'M':
  45669. case 'Q':
  45670. case 'DDD':
  45671. case 'd':
  45672. case 'w':
  45673. case 'W':
  45674. return number;
  45675. }
  45676. },
  45677. week: {
  45678. dow: 0, // Sunday is the first day of the week
  45679. doy: 3, // The week that contains Jan 4th is the first week of the year (7 + 0 - 4)
  45680. },
  45681. meridiemParse: /राती|सकाळीं|दनपारां|सांजे/,
  45682. meridiemHour: function (hour, meridiem) {
  45683. if (hour === 12) {
  45684. hour = 0;
  45685. }
  45686. if (meridiem === 'राती') {
  45687. return hour < 4 ? hour : hour + 12;
  45688. } else if (meridiem === 'सकाळीं') {
  45689. return hour;
  45690. } else if (meridiem === 'दनपारां') {
  45691. return hour > 12 ? hour : hour + 12;
  45692. } else if (meridiem === 'सांजे') {
  45693. return hour + 12;
  45694. }
  45695. },
  45696. meridiem: function (hour, minute, isLower) {
  45697. if (hour < 4) {
  45698. return 'राती';
  45699. } else if (hour < 12) {
  45700. return 'सकाळीं';
  45701. } else if (hour < 16) {
  45702. return 'दनपारां';
  45703. } else if (hour < 20) {
  45704. return 'सांजे';
  45705. } else {
  45706. return 'राती';
  45707. }
  45708. },
  45709. });
  45710. return gomDeva;
  45711. })));
  45712. /***/ }),
  45713. /***/ "./node_modules/moment/locale/gom-latn.js":
  45714. /*!************************************************!*\
  45715. !*** ./node_modules/moment/locale/gom-latn.js ***!
  45716. \************************************************/
  45717. /*! no static exports found */
  45718. /***/ (function(module, exports, __webpack_require__) {
  45719. //! moment.js locale configuration
  45720. //! locale : Konkani Latin script [gom-latn]
  45721. //! author : The Discoverer : https://github.com/WikiDiscoverer
  45722. ;(function (global, factory) {
  45723. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  45724. undefined
  45725. }(this, (function (moment) { 'use strict';
  45726. //! moment.js locale configuration
  45727. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  45728. var format = {
  45729. s: ['thoddea sekondamni', 'thodde sekond'],
  45730. ss: [number + ' sekondamni', number + ' sekond'],
  45731. m: ['eka mintan', 'ek minut'],
  45732. mm: [number + ' mintamni', number + ' mintam'],
  45733. h: ['eka voran', 'ek vor'],
  45734. hh: [number + ' voramni', number + ' voram'],
  45735. d: ['eka disan', 'ek dis'],
  45736. dd: [number + ' disamni', number + ' dis'],
  45737. M: ['eka mhoinean', 'ek mhoino'],
  45738. MM: [number + ' mhoineamni', number + ' mhoine'],
  45739. y: ['eka vorsan', 'ek voros'],
  45740. yy: [number + ' vorsamni', number + ' vorsam'],
  45741. };
  45742. return isFuture ? format[key][0] : format[key][1];
  45743. }
  45744. var gomLatn = moment.defineLocale('gom-latn', {
  45745. months: {
  45746. standalone: 'Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr'.split(
  45747. '_'
  45748. ),
  45749. format: 'Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea'.split(
  45750. '_'
  45751. ),
  45752. isFormat: /MMMM(\s)+D[oD]?/,
  45753. },
  45754. monthsShort: 'Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.'.split(
  45755. '_'
  45756. ),
  45757. monthsParseExact: true,
  45758. weekdays: "Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split('_'),
  45759. weekdaysShort: 'Ait._Som._Mon._Bud._Bre._Suk._Son.'.split('_'),
  45760. weekdaysMin: 'Ai_Sm_Mo_Bu_Br_Su_Sn'.split('_'),
  45761. weekdaysParseExact: true,
  45762. longDateFormat: {
  45763. LT: 'A h:mm [vazta]',
  45764. LTS: 'A h:mm:ss [vazta]',
  45765. L: 'DD-MM-YYYY',
  45766. LL: 'D MMMM YYYY',
  45767. LLL: 'D MMMM YYYY A h:mm [vazta]',
  45768. LLLL: 'dddd, MMMM Do, YYYY, A h:mm [vazta]',
  45769. llll: 'ddd, D MMM YYYY, A h:mm [vazta]',
  45770. },
  45771. calendar: {
  45772. sameDay: '[Aiz] LT',
  45773. nextDay: '[Faleam] LT',
  45774. nextWeek: '[Fuddlo] dddd[,] LT',
  45775. lastDay: '[Kal] LT',
  45776. lastWeek: '[Fattlo] dddd[,] LT',
  45777. sameElse: 'L',
  45778. },
  45779. relativeTime: {
  45780. future: '%s',
  45781. past: '%s adim',
  45782. s: processRelativeTime,
  45783. ss: processRelativeTime,
  45784. m: processRelativeTime,
  45785. mm: processRelativeTime,
  45786. h: processRelativeTime,
  45787. hh: processRelativeTime,
  45788. d: processRelativeTime,
  45789. dd: processRelativeTime,
  45790. M: processRelativeTime,
  45791. MM: processRelativeTime,
  45792. y: processRelativeTime,
  45793. yy: processRelativeTime,
  45794. },
  45795. dayOfMonthOrdinalParse: /\d{1,2}(er)/,
  45796. ordinal: function (number, period) {
  45797. switch (period) {
  45798. // the ordinal 'er' only applies to day of the month
  45799. case 'D':
  45800. return number + 'er';
  45801. default:
  45802. case 'M':
  45803. case 'Q':
  45804. case 'DDD':
  45805. case 'd':
  45806. case 'w':
  45807. case 'W':
  45808. return number;
  45809. }
  45810. },
  45811. week: {
  45812. dow: 0, // Sunday is the first day of the week
  45813. doy: 3, // The week that contains Jan 4th is the first week of the year (7 + 0 - 4)
  45814. },
  45815. meridiemParse: /rati|sokallim|donparam|sanje/,
  45816. meridiemHour: function (hour, meridiem) {
  45817. if (hour === 12) {
  45818. hour = 0;
  45819. }
  45820. if (meridiem === 'rati') {
  45821. return hour < 4 ? hour : hour + 12;
  45822. } else if (meridiem === 'sokallim') {
  45823. return hour;
  45824. } else if (meridiem === 'donparam') {
  45825. return hour > 12 ? hour : hour + 12;
  45826. } else if (meridiem === 'sanje') {
  45827. return hour + 12;
  45828. }
  45829. },
  45830. meridiem: function (hour, minute, isLower) {
  45831. if (hour < 4) {
  45832. return 'rati';
  45833. } else if (hour < 12) {
  45834. return 'sokallim';
  45835. } else if (hour < 16) {
  45836. return 'donparam';
  45837. } else if (hour < 20) {
  45838. return 'sanje';
  45839. } else {
  45840. return 'rati';
  45841. }
  45842. },
  45843. });
  45844. return gomLatn;
  45845. })));
  45846. /***/ }),
  45847. /***/ "./node_modules/moment/locale/gu.js":
  45848. /*!******************************************!*\
  45849. !*** ./node_modules/moment/locale/gu.js ***!
  45850. \******************************************/
  45851. /*! no static exports found */
  45852. /***/ (function(module, exports, __webpack_require__) {
  45853. //! moment.js locale configuration
  45854. //! locale : Gujarati [gu]
  45855. //! author : Kaushik Thanki : https://github.com/Kaushik1987
  45856. ;(function (global, factory) {
  45857. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  45858. undefined
  45859. }(this, (function (moment) { 'use strict';
  45860. //! moment.js locale configuration
  45861. var symbolMap = {
  45862. '1': '૧',
  45863. '2': '૨',
  45864. '3': '૩',
  45865. '4': '૪',
  45866. '5': '૫',
  45867. '6': '૬',
  45868. '7': '૭',
  45869. '8': '૮',
  45870. '9': '૯',
  45871. '0': '૦',
  45872. },
  45873. numberMap = {
  45874. '૧': '1',
  45875. '૨': '2',
  45876. '૩': '3',
  45877. '૪': '4',
  45878. '૫': '5',
  45879. '૬': '6',
  45880. '૭': '7',
  45881. '૮': '8',
  45882. '૯': '9',
  45883. '૦': '0',
  45884. };
  45885. var gu = moment.defineLocale('gu', {
  45886. months: 'જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર'.split(
  45887. '_'
  45888. ),
  45889. monthsShort: 'જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.'.split(
  45890. '_'
  45891. ),
  45892. monthsParseExact: true,
  45893. weekdays: 'રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર'.split(
  45894. '_'
  45895. ),
  45896. weekdaysShort: 'રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ'.split('_'),
  45897. weekdaysMin: 'ર_સો_મં_બુ_ગુ_શુ_શ'.split('_'),
  45898. longDateFormat: {
  45899. LT: 'A h:mm વાગ્યે',
  45900. LTS: 'A h:mm:ss વાગ્યે',
  45901. L: 'DD/MM/YYYY',
  45902. LL: 'D MMMM YYYY',
  45903. LLL: 'D MMMM YYYY, A h:mm વાગ્યે',
  45904. LLLL: 'dddd, D MMMM YYYY, A h:mm વાગ્યે',
  45905. },
  45906. calendar: {
  45907. sameDay: '[આજ] LT',
  45908. nextDay: '[કાલે] LT',
  45909. nextWeek: 'dddd, LT',
  45910. lastDay: '[ગઇકાલે] LT',
  45911. lastWeek: '[પાછલા] dddd, LT',
  45912. sameElse: 'L',
  45913. },
  45914. relativeTime: {
  45915. future: '%s મા',
  45916. past: '%s પહેલા',
  45917. s: 'અમુક પળો',
  45918. ss: '%d સેકંડ',
  45919. m: 'એક મિનિટ',
  45920. mm: '%d મિનિટ',
  45921. h: 'એક કલાક',
  45922. hh: '%d કલાક',
  45923. d: 'એક દિવસ',
  45924. dd: '%d દિવસ',
  45925. M: 'એક મહિનો',
  45926. MM: '%d મહિનો',
  45927. y: 'એક વર્ષ',
  45928. yy: '%d વર્ષ',
  45929. },
  45930. preparse: function (string) {
  45931. return string.replace(/[૧૨૩૪૫૬૭૮૯૦]/g, function (match) {
  45932. return numberMap[match];
  45933. });
  45934. },
  45935. postformat: function (string) {
  45936. return string.replace(/\d/g, function (match) {
  45937. return symbolMap[match];
  45938. });
  45939. },
  45940. // Gujarati notation for meridiems are quite fuzzy in practice. While there exists
  45941. // a rigid notion of a 'Pahar' it is not used as rigidly in modern Gujarati.
  45942. meridiemParse: /રાત|બપોર|સવાર|સાંજ/,
  45943. meridiemHour: function (hour, meridiem) {
  45944. if (hour === 12) {
  45945. hour = 0;
  45946. }
  45947. if (meridiem === 'રાત') {
  45948. return hour < 4 ? hour : hour + 12;
  45949. } else if (meridiem === 'સવાર') {
  45950. return hour;
  45951. } else if (meridiem === 'બપોર') {
  45952. return hour >= 10 ? hour : hour + 12;
  45953. } else if (meridiem === 'સાંજ') {
  45954. return hour + 12;
  45955. }
  45956. },
  45957. meridiem: function (hour, minute, isLower) {
  45958. if (hour < 4) {
  45959. return 'રાત';
  45960. } else if (hour < 10) {
  45961. return 'સવાર';
  45962. } else if (hour < 17) {
  45963. return 'બપોર';
  45964. } else if (hour < 20) {
  45965. return 'સાંજ';
  45966. } else {
  45967. return 'રાત';
  45968. }
  45969. },
  45970. week: {
  45971. dow: 0, // Sunday is the first day of the week.
  45972. doy: 6, // The week that contains Jan 6th is the first week of the year.
  45973. },
  45974. });
  45975. return gu;
  45976. })));
  45977. /***/ }),
  45978. /***/ "./node_modules/moment/locale/he.js":
  45979. /*!******************************************!*\
  45980. !*** ./node_modules/moment/locale/he.js ***!
  45981. \******************************************/
  45982. /*! no static exports found */
  45983. /***/ (function(module, exports, __webpack_require__) {
  45984. //! moment.js locale configuration
  45985. //! locale : Hebrew [he]
  45986. //! author : Tomer Cohen : https://github.com/tomer
  45987. //! author : Moshe Simantov : https://github.com/DevelopmentIL
  45988. //! author : Tal Ater : https://github.com/TalAter
  45989. ;(function (global, factory) {
  45990. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  45991. undefined
  45992. }(this, (function (moment) { 'use strict';
  45993. //! moment.js locale configuration
  45994. var he = moment.defineLocale('he', {
  45995. months: 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split(
  45996. '_'
  45997. ),
  45998. monthsShort: 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split(
  45999. '_'
  46000. ),
  46001. weekdays: 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),
  46002. weekdaysShort: 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),
  46003. weekdaysMin: 'א_ב_ג_ד_ה_ו_ש'.split('_'),
  46004. longDateFormat: {
  46005. LT: 'HH:mm',
  46006. LTS: 'HH:mm:ss',
  46007. L: 'DD/MM/YYYY',
  46008. LL: 'D [ב]MMMM YYYY',
  46009. LLL: 'D [ב]MMMM YYYY HH:mm',
  46010. LLLL: 'dddd, D [ב]MMMM YYYY HH:mm',
  46011. l: 'D/M/YYYY',
  46012. ll: 'D MMM YYYY',
  46013. lll: 'D MMM YYYY HH:mm',
  46014. llll: 'ddd, D MMM YYYY HH:mm',
  46015. },
  46016. calendar: {
  46017. sameDay: '[היום ב־]LT',
  46018. nextDay: '[מחר ב־]LT',
  46019. nextWeek: 'dddd [בשעה] LT',
  46020. lastDay: '[אתמול ב־]LT',
  46021. lastWeek: '[ביום] dddd [האחרון בשעה] LT',
  46022. sameElse: 'L',
  46023. },
  46024. relativeTime: {
  46025. future: 'בעוד %s',
  46026. past: 'לפני %s',
  46027. s: 'מספר שניות',
  46028. ss: '%d שניות',
  46029. m: 'דקה',
  46030. mm: '%d דקות',
  46031. h: 'שעה',
  46032. hh: function (number) {
  46033. if (number === 2) {
  46034. return 'שעתיים';
  46035. }
  46036. return number + ' שעות';
  46037. },
  46038. d: 'יום',
  46039. dd: function (number) {
  46040. if (number === 2) {
  46041. return 'יומיים';
  46042. }
  46043. return number + ' ימים';
  46044. },
  46045. M: 'חודש',
  46046. MM: function (number) {
  46047. if (number === 2) {
  46048. return 'חודשיים';
  46049. }
  46050. return number + ' חודשים';
  46051. },
  46052. y: 'שנה',
  46053. yy: function (number) {
  46054. if (number === 2) {
  46055. return 'שנתיים';
  46056. } else if (number % 10 === 0 && number !== 10) {
  46057. return number + ' שנה';
  46058. }
  46059. return number + ' שנים';
  46060. },
  46061. },
  46062. meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,
  46063. isPM: function (input) {
  46064. return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input);
  46065. },
  46066. meridiem: function (hour, minute, isLower) {
  46067. if (hour < 5) {
  46068. return 'לפנות בוקר';
  46069. } else if (hour < 10) {
  46070. return 'בבוקר';
  46071. } else if (hour < 12) {
  46072. return isLower ? 'לפנה"צ' : 'לפני הצהריים';
  46073. } else if (hour < 18) {
  46074. return isLower ? 'אחה"צ' : 'אחרי הצהריים';
  46075. } else {
  46076. return 'בערב';
  46077. }
  46078. },
  46079. });
  46080. return he;
  46081. })));
  46082. /***/ }),
  46083. /***/ "./node_modules/moment/locale/hi.js":
  46084. /*!******************************************!*\
  46085. !*** ./node_modules/moment/locale/hi.js ***!
  46086. \******************************************/
  46087. /*! no static exports found */
  46088. /***/ (function(module, exports, __webpack_require__) {
  46089. //! moment.js locale configuration
  46090. //! locale : Hindi [hi]
  46091. //! author : Mayank Singhal : https://github.com/mayanksinghal
  46092. ;(function (global, factory) {
  46093. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  46094. undefined
  46095. }(this, (function (moment) { 'use strict';
  46096. //! moment.js locale configuration
  46097. var symbolMap = {
  46098. '1': '१',
  46099. '2': '२',
  46100. '3': '३',
  46101. '4': '४',
  46102. '5': '५',
  46103. '6': '६',
  46104. '7': '७',
  46105. '8': '८',
  46106. '9': '९',
  46107. '0': '०',
  46108. },
  46109. numberMap = {
  46110. '१': '1',
  46111. '२': '2',
  46112. '३': '3',
  46113. '४': '4',
  46114. '५': '5',
  46115. '६': '6',
  46116. '७': '7',
  46117. '८': '8',
  46118. '९': '9',
  46119. '०': '0',
  46120. };
  46121. var hi = moment.defineLocale('hi', {
  46122. months: 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split(
  46123. '_'
  46124. ),
  46125. monthsShort: 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split(
  46126. '_'
  46127. ),
  46128. monthsParseExact: true,
  46129. weekdays: 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
  46130. weekdaysShort: 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),
  46131. weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),
  46132. longDateFormat: {
  46133. LT: 'A h:mm बजे',
  46134. LTS: 'A h:mm:ss बजे',
  46135. L: 'DD/MM/YYYY',
  46136. LL: 'D MMMM YYYY',
  46137. LLL: 'D MMMM YYYY, A h:mm बजे',
  46138. LLLL: 'dddd, D MMMM YYYY, A h:mm बजे',
  46139. },
  46140. calendar: {
  46141. sameDay: '[आज] LT',
  46142. nextDay: '[कल] LT',
  46143. nextWeek: 'dddd, LT',
  46144. lastDay: '[कल] LT',
  46145. lastWeek: '[पिछले] dddd, LT',
  46146. sameElse: 'L',
  46147. },
  46148. relativeTime: {
  46149. future: '%s में',
  46150. past: '%s पहले',
  46151. s: 'कुछ ही क्षण',
  46152. ss: '%d सेकंड',
  46153. m: 'एक मिनट',
  46154. mm: '%d मिनट',
  46155. h: 'एक घंटा',
  46156. hh: '%d घंटे',
  46157. d: 'एक दिन',
  46158. dd: '%d दिन',
  46159. M: 'एक महीने',
  46160. MM: '%d महीने',
  46161. y: 'एक वर्ष',
  46162. yy: '%d वर्ष',
  46163. },
  46164. preparse: function (string) {
  46165. return string.replace(/[१२३४५६७८९०]/g, function (match) {
  46166. return numberMap[match];
  46167. });
  46168. },
  46169. postformat: function (string) {
  46170. return string.replace(/\d/g, function (match) {
  46171. return symbolMap[match];
  46172. });
  46173. },
  46174. // Hindi notation for meridiems are quite fuzzy in practice. While there exists
  46175. // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.
  46176. meridiemParse: /रात|सुबह|दोपहर|शाम/,
  46177. meridiemHour: function (hour, meridiem) {
  46178. if (hour === 12) {
  46179. hour = 0;
  46180. }
  46181. if (meridiem === 'रात') {
  46182. return hour < 4 ? hour : hour + 12;
  46183. } else if (meridiem === 'सुबह') {
  46184. return hour;
  46185. } else if (meridiem === 'दोपहर') {
  46186. return hour >= 10 ? hour : hour + 12;
  46187. } else if (meridiem === 'शाम') {
  46188. return hour + 12;
  46189. }
  46190. },
  46191. meridiem: function (hour, minute, isLower) {
  46192. if (hour < 4) {
  46193. return 'रात';
  46194. } else if (hour < 10) {
  46195. return 'सुबह';
  46196. } else if (hour < 17) {
  46197. return 'दोपहर';
  46198. } else if (hour < 20) {
  46199. return 'शाम';
  46200. } else {
  46201. return 'रात';
  46202. }
  46203. },
  46204. week: {
  46205. dow: 0, // Sunday is the first day of the week.
  46206. doy: 6, // The week that contains Jan 6th is the first week of the year.
  46207. },
  46208. });
  46209. return hi;
  46210. })));
  46211. /***/ }),
  46212. /***/ "./node_modules/moment/locale/hr.js":
  46213. /*!******************************************!*\
  46214. !*** ./node_modules/moment/locale/hr.js ***!
  46215. \******************************************/
  46216. /*! no static exports found */
  46217. /***/ (function(module, exports, __webpack_require__) {
  46218. //! moment.js locale configuration
  46219. //! locale : Croatian [hr]
  46220. //! author : Bojan Marković : https://github.com/bmarkovic
  46221. ;(function (global, factory) {
  46222. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  46223. undefined
  46224. }(this, (function (moment) { 'use strict';
  46225. //! moment.js locale configuration
  46226. function translate(number, withoutSuffix, key) {
  46227. var result = number + ' ';
  46228. switch (key) {
  46229. case 'ss':
  46230. if (number === 1) {
  46231. result += 'sekunda';
  46232. } else if (number === 2 || number === 3 || number === 4) {
  46233. result += 'sekunde';
  46234. } else {
  46235. result += 'sekundi';
  46236. }
  46237. return result;
  46238. case 'm':
  46239. return withoutSuffix ? 'jedna minuta' : 'jedne minute';
  46240. case 'mm':
  46241. if (number === 1) {
  46242. result += 'minuta';
  46243. } else if (number === 2 || number === 3 || number === 4) {
  46244. result += 'minute';
  46245. } else {
  46246. result += 'minuta';
  46247. }
  46248. return result;
  46249. case 'h':
  46250. return withoutSuffix ? 'jedan sat' : 'jednog sata';
  46251. case 'hh':
  46252. if (number === 1) {
  46253. result += 'sat';
  46254. } else if (number === 2 || number === 3 || number === 4) {
  46255. result += 'sata';
  46256. } else {
  46257. result += 'sati';
  46258. }
  46259. return result;
  46260. case 'dd':
  46261. if (number === 1) {
  46262. result += 'dan';
  46263. } else {
  46264. result += 'dana';
  46265. }
  46266. return result;
  46267. case 'MM':
  46268. if (number === 1) {
  46269. result += 'mjesec';
  46270. } else if (number === 2 || number === 3 || number === 4) {
  46271. result += 'mjeseca';
  46272. } else {
  46273. result += 'mjeseci';
  46274. }
  46275. return result;
  46276. case 'yy':
  46277. if (number === 1) {
  46278. result += 'godina';
  46279. } else if (number === 2 || number === 3 || number === 4) {
  46280. result += 'godine';
  46281. } else {
  46282. result += 'godina';
  46283. }
  46284. return result;
  46285. }
  46286. }
  46287. var hr = moment.defineLocale('hr', {
  46288. months: {
  46289. format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split(
  46290. '_'
  46291. ),
  46292. standalone: 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split(
  46293. '_'
  46294. ),
  46295. },
  46296. monthsShort: 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split(
  46297. '_'
  46298. ),
  46299. monthsParseExact: true,
  46300. weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(
  46301. '_'
  46302. ),
  46303. weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  46304. weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
  46305. weekdaysParseExact: true,
  46306. longDateFormat: {
  46307. LT: 'H:mm',
  46308. LTS: 'H:mm:ss',
  46309. L: 'DD.MM.YYYY',
  46310. LL: 'Do MMMM YYYY',
  46311. LLL: 'Do MMMM YYYY H:mm',
  46312. LLLL: 'dddd, Do MMMM YYYY H:mm',
  46313. },
  46314. calendar: {
  46315. sameDay: '[danas u] LT',
  46316. nextDay: '[sutra u] LT',
  46317. nextWeek: function () {
  46318. switch (this.day()) {
  46319. case 0:
  46320. return '[u] [nedjelju] [u] LT';
  46321. case 3:
  46322. return '[u] [srijedu] [u] LT';
  46323. case 6:
  46324. return '[u] [subotu] [u] LT';
  46325. case 1:
  46326. case 2:
  46327. case 4:
  46328. case 5:
  46329. return '[u] dddd [u] LT';
  46330. }
  46331. },
  46332. lastDay: '[jučer u] LT',
  46333. lastWeek: function () {
  46334. switch (this.day()) {
  46335. case 0:
  46336. return '[prošlu] [nedjelju] [u] LT';
  46337. case 3:
  46338. return '[prošlu] [srijedu] [u] LT';
  46339. case 6:
  46340. return '[prošle] [subote] [u] LT';
  46341. case 1:
  46342. case 2:
  46343. case 4:
  46344. case 5:
  46345. return '[prošli] dddd [u] LT';
  46346. }
  46347. },
  46348. sameElse: 'L',
  46349. },
  46350. relativeTime: {
  46351. future: 'za %s',
  46352. past: 'prije %s',
  46353. s: 'par sekundi',
  46354. ss: translate,
  46355. m: translate,
  46356. mm: translate,
  46357. h: translate,
  46358. hh: translate,
  46359. d: 'dan',
  46360. dd: translate,
  46361. M: 'mjesec',
  46362. MM: translate,
  46363. y: 'godinu',
  46364. yy: translate,
  46365. },
  46366. dayOfMonthOrdinalParse: /\d{1,2}\./,
  46367. ordinal: '%d.',
  46368. week: {
  46369. dow: 1, // Monday is the first day of the week.
  46370. doy: 7, // The week that contains Jan 7th is the first week of the year.
  46371. },
  46372. });
  46373. return hr;
  46374. })));
  46375. /***/ }),
  46376. /***/ "./node_modules/moment/locale/hu.js":
  46377. /*!******************************************!*\
  46378. !*** ./node_modules/moment/locale/hu.js ***!
  46379. \******************************************/
  46380. /*! no static exports found */
  46381. /***/ (function(module, exports, __webpack_require__) {
  46382. //! moment.js locale configuration
  46383. //! locale : Hungarian [hu]
  46384. //! author : Adam Brunner : https://github.com/adambrunner
  46385. ;(function (global, factory) {
  46386. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  46387. undefined
  46388. }(this, (function (moment) { 'use strict';
  46389. //! moment.js locale configuration
  46390. var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(
  46391. ' '
  46392. );
  46393. function translate(number, withoutSuffix, key, isFuture) {
  46394. var num = number;
  46395. switch (key) {
  46396. case 's':
  46397. return isFuture || withoutSuffix
  46398. ? 'néhány másodperc'
  46399. : 'néhány másodperce';
  46400. case 'ss':
  46401. return num + (isFuture || withoutSuffix)
  46402. ? ' másodperc'
  46403. : ' másodperce';
  46404. case 'm':
  46405. return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');
  46406. case 'mm':
  46407. return num + (isFuture || withoutSuffix ? ' perc' : ' perce');
  46408. case 'h':
  46409. return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');
  46410. case 'hh':
  46411. return num + (isFuture || withoutSuffix ? ' óra' : ' órája');
  46412. case 'd':
  46413. return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');
  46414. case 'dd':
  46415. return num + (isFuture || withoutSuffix ? ' nap' : ' napja');
  46416. case 'M':
  46417. return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
  46418. case 'MM':
  46419. return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
  46420. case 'y':
  46421. return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');
  46422. case 'yy':
  46423. return num + (isFuture || withoutSuffix ? ' év' : ' éve');
  46424. }
  46425. return '';
  46426. }
  46427. function week(isFuture) {
  46428. return (
  46429. (isFuture ? '' : '[múlt] ') +
  46430. '[' +
  46431. weekEndings[this.day()] +
  46432. '] LT[-kor]'
  46433. );
  46434. }
  46435. var hu = moment.defineLocale('hu', {
  46436. months: 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split(
  46437. '_'
  46438. ),
  46439. monthsShort: 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split(
  46440. '_'
  46441. ),
  46442. weekdays: 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),
  46443. weekdaysShort: 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),
  46444. weekdaysMin: 'v_h_k_sze_cs_p_szo'.split('_'),
  46445. longDateFormat: {
  46446. LT: 'H:mm',
  46447. LTS: 'H:mm:ss',
  46448. L: 'YYYY.MM.DD.',
  46449. LL: 'YYYY. MMMM D.',
  46450. LLL: 'YYYY. MMMM D. H:mm',
  46451. LLLL: 'YYYY. MMMM D., dddd H:mm',
  46452. },
  46453. meridiemParse: /de|du/i,
  46454. isPM: function (input) {
  46455. return input.charAt(1).toLowerCase() === 'u';
  46456. },
  46457. meridiem: function (hours, minutes, isLower) {
  46458. if (hours < 12) {
  46459. return isLower === true ? 'de' : 'DE';
  46460. } else {
  46461. return isLower === true ? 'du' : 'DU';
  46462. }
  46463. },
  46464. calendar: {
  46465. sameDay: '[ma] LT[-kor]',
  46466. nextDay: '[holnap] LT[-kor]',
  46467. nextWeek: function () {
  46468. return week.call(this, true);
  46469. },
  46470. lastDay: '[tegnap] LT[-kor]',
  46471. lastWeek: function () {
  46472. return week.call(this, false);
  46473. },
  46474. sameElse: 'L',
  46475. },
  46476. relativeTime: {
  46477. future: '%s múlva',
  46478. past: '%s',
  46479. s: translate,
  46480. ss: translate,
  46481. m: translate,
  46482. mm: translate,
  46483. h: translate,
  46484. hh: translate,
  46485. d: translate,
  46486. dd: translate,
  46487. M: translate,
  46488. MM: translate,
  46489. y: translate,
  46490. yy: translate,
  46491. },
  46492. dayOfMonthOrdinalParse: /\d{1,2}\./,
  46493. ordinal: '%d.',
  46494. week: {
  46495. dow: 1, // Monday is the first day of the week.
  46496. doy: 4, // The week that contains Jan 4th is the first week of the year.
  46497. },
  46498. });
  46499. return hu;
  46500. })));
  46501. /***/ }),
  46502. /***/ "./node_modules/moment/locale/hy-am.js":
  46503. /*!*********************************************!*\
  46504. !*** ./node_modules/moment/locale/hy-am.js ***!
  46505. \*********************************************/
  46506. /*! no static exports found */
  46507. /***/ (function(module, exports, __webpack_require__) {
  46508. //! moment.js locale configuration
  46509. //! locale : Armenian [hy-am]
  46510. //! author : Armendarabyan : https://github.com/armendarabyan
  46511. ;(function (global, factory) {
  46512. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  46513. undefined
  46514. }(this, (function (moment) { 'use strict';
  46515. //! moment.js locale configuration
  46516. var hyAm = moment.defineLocale('hy-am', {
  46517. months: {
  46518. format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split(
  46519. '_'
  46520. ),
  46521. standalone: 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split(
  46522. '_'
  46523. ),
  46524. },
  46525. monthsShort: 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'),
  46526. weekdays: 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split(
  46527. '_'
  46528. ),
  46529. weekdaysShort: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
  46530. weekdaysMin: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
  46531. longDateFormat: {
  46532. LT: 'HH:mm',
  46533. LTS: 'HH:mm:ss',
  46534. L: 'DD.MM.YYYY',
  46535. LL: 'D MMMM YYYY թ.',
  46536. LLL: 'D MMMM YYYY թ., HH:mm',
  46537. LLLL: 'dddd, D MMMM YYYY թ., HH:mm',
  46538. },
  46539. calendar: {
  46540. sameDay: '[այսօր] LT',
  46541. nextDay: '[վաղը] LT',
  46542. lastDay: '[երեկ] LT',
  46543. nextWeek: function () {
  46544. return 'dddd [օրը ժամը] LT';
  46545. },
  46546. lastWeek: function () {
  46547. return '[անցած] dddd [օրը ժամը] LT';
  46548. },
  46549. sameElse: 'L',
  46550. },
  46551. relativeTime: {
  46552. future: '%s հետո',
  46553. past: '%s առաջ',
  46554. s: 'մի քանի վայրկյան',
  46555. ss: '%d վայրկյան',
  46556. m: 'րոպե',
  46557. mm: '%d րոպե',
  46558. h: 'ժամ',
  46559. hh: '%d ժամ',
  46560. d: 'օր',
  46561. dd: '%d օր',
  46562. M: 'ամիս',
  46563. MM: '%d ամիս',
  46564. y: 'տարի',
  46565. yy: '%d տարի',
  46566. },
  46567. meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,
  46568. isPM: function (input) {
  46569. return /^(ցերեկվա|երեկոյան)$/.test(input);
  46570. },
  46571. meridiem: function (hour) {
  46572. if (hour < 4) {
  46573. return 'գիշերվա';
  46574. } else if (hour < 12) {
  46575. return 'առավոտվա';
  46576. } else if (hour < 17) {
  46577. return 'ցերեկվա';
  46578. } else {
  46579. return 'երեկոյան';
  46580. }
  46581. },
  46582. dayOfMonthOrdinalParse: /\d{1,2}|\d{1,2}-(ին|րդ)/,
  46583. ordinal: function (number, period) {
  46584. switch (period) {
  46585. case 'DDD':
  46586. case 'w':
  46587. case 'W':
  46588. case 'DDDo':
  46589. if (number === 1) {
  46590. return number + '-ին';
  46591. }
  46592. return number + '-րդ';
  46593. default:
  46594. return number;
  46595. }
  46596. },
  46597. week: {
  46598. dow: 1, // Monday is the first day of the week.
  46599. doy: 7, // The week that contains Jan 7th is the first week of the year.
  46600. },
  46601. });
  46602. return hyAm;
  46603. })));
  46604. /***/ }),
  46605. /***/ "./node_modules/moment/locale/id.js":
  46606. /*!******************************************!*\
  46607. !*** ./node_modules/moment/locale/id.js ***!
  46608. \******************************************/
  46609. /*! no static exports found */
  46610. /***/ (function(module, exports, __webpack_require__) {
  46611. //! moment.js locale configuration
  46612. //! locale : Indonesian [id]
  46613. //! author : Mohammad Satrio Utomo : https://github.com/tyok
  46614. //! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan
  46615. ;(function (global, factory) {
  46616. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  46617. undefined
  46618. }(this, (function (moment) { 'use strict';
  46619. //! moment.js locale configuration
  46620. var id = moment.defineLocale('id', {
  46621. months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split(
  46622. '_'
  46623. ),
  46624. monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des'.split('_'),
  46625. weekdays: 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),
  46626. weekdaysShort: 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),
  46627. weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),
  46628. longDateFormat: {
  46629. LT: 'HH.mm',
  46630. LTS: 'HH.mm.ss',
  46631. L: 'DD/MM/YYYY',
  46632. LL: 'D MMMM YYYY',
  46633. LLL: 'D MMMM YYYY [pukul] HH.mm',
  46634. LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',
  46635. },
  46636. meridiemParse: /pagi|siang|sore|malam/,
  46637. meridiemHour: function (hour, meridiem) {
  46638. if (hour === 12) {
  46639. hour = 0;
  46640. }
  46641. if (meridiem === 'pagi') {
  46642. return hour;
  46643. } else if (meridiem === 'siang') {
  46644. return hour >= 11 ? hour : hour + 12;
  46645. } else if (meridiem === 'sore' || meridiem === 'malam') {
  46646. return hour + 12;
  46647. }
  46648. },
  46649. meridiem: function (hours, minutes, isLower) {
  46650. if (hours < 11) {
  46651. return 'pagi';
  46652. } else if (hours < 15) {
  46653. return 'siang';
  46654. } else if (hours < 19) {
  46655. return 'sore';
  46656. } else {
  46657. return 'malam';
  46658. }
  46659. },
  46660. calendar: {
  46661. sameDay: '[Hari ini pukul] LT',
  46662. nextDay: '[Besok pukul] LT',
  46663. nextWeek: 'dddd [pukul] LT',
  46664. lastDay: '[Kemarin pukul] LT',
  46665. lastWeek: 'dddd [lalu pukul] LT',
  46666. sameElse: 'L',
  46667. },
  46668. relativeTime: {
  46669. future: 'dalam %s',
  46670. past: '%s yang lalu',
  46671. s: 'beberapa detik',
  46672. ss: '%d detik',
  46673. m: 'semenit',
  46674. mm: '%d menit',
  46675. h: 'sejam',
  46676. hh: '%d jam',
  46677. d: 'sehari',
  46678. dd: '%d hari',
  46679. M: 'sebulan',
  46680. MM: '%d bulan',
  46681. y: 'setahun',
  46682. yy: '%d tahun',
  46683. },
  46684. week: {
  46685. dow: 0, // Sunday is the first day of the week.
  46686. doy: 6, // The week that contains Jan 6th is the first week of the year.
  46687. },
  46688. });
  46689. return id;
  46690. })));
  46691. /***/ }),
  46692. /***/ "./node_modules/moment/locale/is.js":
  46693. /*!******************************************!*\
  46694. !*** ./node_modules/moment/locale/is.js ***!
  46695. \******************************************/
  46696. /*! no static exports found */
  46697. /***/ (function(module, exports, __webpack_require__) {
  46698. //! moment.js locale configuration
  46699. //! locale : Icelandic [is]
  46700. //! author : Hinrik Örn Sigurðsson : https://github.com/hinrik
  46701. ;(function (global, factory) {
  46702. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  46703. undefined
  46704. }(this, (function (moment) { 'use strict';
  46705. //! moment.js locale configuration
  46706. function plural(n) {
  46707. if (n % 100 === 11) {
  46708. return true;
  46709. } else if (n % 10 === 1) {
  46710. return false;
  46711. }
  46712. return true;
  46713. }
  46714. function translate(number, withoutSuffix, key, isFuture) {
  46715. var result = number + ' ';
  46716. switch (key) {
  46717. case 's':
  46718. return withoutSuffix || isFuture
  46719. ? 'nokkrar sekúndur'
  46720. : 'nokkrum sekúndum';
  46721. case 'ss':
  46722. if (plural(number)) {
  46723. return (
  46724. result +
  46725. (withoutSuffix || isFuture ? 'sekúndur' : 'sekúndum')
  46726. );
  46727. }
  46728. return result + 'sekúnda';
  46729. case 'm':
  46730. return withoutSuffix ? 'mínúta' : 'mínútu';
  46731. case 'mm':
  46732. if (plural(number)) {
  46733. return (
  46734. result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum')
  46735. );
  46736. } else if (withoutSuffix) {
  46737. return result + 'mínúta';
  46738. }
  46739. return result + 'mínútu';
  46740. case 'hh':
  46741. if (plural(number)) {
  46742. return (
  46743. result +
  46744. (withoutSuffix || isFuture
  46745. ? 'klukkustundir'
  46746. : 'klukkustundum')
  46747. );
  46748. }
  46749. return result + 'klukkustund';
  46750. case 'd':
  46751. if (withoutSuffix) {
  46752. return 'dagur';
  46753. }
  46754. return isFuture ? 'dag' : 'degi';
  46755. case 'dd':
  46756. if (plural(number)) {
  46757. if (withoutSuffix) {
  46758. return result + 'dagar';
  46759. }
  46760. return result + (isFuture ? 'daga' : 'dögum');
  46761. } else if (withoutSuffix) {
  46762. return result + 'dagur';
  46763. }
  46764. return result + (isFuture ? 'dag' : 'degi');
  46765. case 'M':
  46766. if (withoutSuffix) {
  46767. return 'mánuður';
  46768. }
  46769. return isFuture ? 'mánuð' : 'mánuði';
  46770. case 'MM':
  46771. if (plural(number)) {
  46772. if (withoutSuffix) {
  46773. return result + 'mánuðir';
  46774. }
  46775. return result + (isFuture ? 'mánuði' : 'mánuðum');
  46776. } else if (withoutSuffix) {
  46777. return result + 'mánuður';
  46778. }
  46779. return result + (isFuture ? 'mánuð' : 'mánuði');
  46780. case 'y':
  46781. return withoutSuffix || isFuture ? 'ár' : 'ári';
  46782. case 'yy':
  46783. if (plural(number)) {
  46784. return result + (withoutSuffix || isFuture ? 'ár' : 'árum');
  46785. }
  46786. return result + (withoutSuffix || isFuture ? 'ár' : 'ári');
  46787. }
  46788. }
  46789. var is = moment.defineLocale('is', {
  46790. months: 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split(
  46791. '_'
  46792. ),
  46793. monthsShort: 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),
  46794. weekdays: 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split(
  46795. '_'
  46796. ),
  46797. weekdaysShort: 'sun_mán_þri_mið_fim_fös_lau'.split('_'),
  46798. weekdaysMin: 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),
  46799. longDateFormat: {
  46800. LT: 'H:mm',
  46801. LTS: 'H:mm:ss',
  46802. L: 'DD.MM.YYYY',
  46803. LL: 'D. MMMM YYYY',
  46804. LLL: 'D. MMMM YYYY [kl.] H:mm',
  46805. LLLL: 'dddd, D. MMMM YYYY [kl.] H:mm',
  46806. },
  46807. calendar: {
  46808. sameDay: '[í dag kl.] LT',
  46809. nextDay: '[á morgun kl.] LT',
  46810. nextWeek: 'dddd [kl.] LT',
  46811. lastDay: '[í gær kl.] LT',
  46812. lastWeek: '[síðasta] dddd [kl.] LT',
  46813. sameElse: 'L',
  46814. },
  46815. relativeTime: {
  46816. future: 'eftir %s',
  46817. past: 'fyrir %s síðan',
  46818. s: translate,
  46819. ss: translate,
  46820. m: translate,
  46821. mm: translate,
  46822. h: 'klukkustund',
  46823. hh: translate,
  46824. d: translate,
  46825. dd: translate,
  46826. M: translate,
  46827. MM: translate,
  46828. y: translate,
  46829. yy: translate,
  46830. },
  46831. dayOfMonthOrdinalParse: /\d{1,2}\./,
  46832. ordinal: '%d.',
  46833. week: {
  46834. dow: 1, // Monday is the first day of the week.
  46835. doy: 4, // The week that contains Jan 4th is the first week of the year.
  46836. },
  46837. });
  46838. return is;
  46839. })));
  46840. /***/ }),
  46841. /***/ "./node_modules/moment/locale/it-ch.js":
  46842. /*!*********************************************!*\
  46843. !*** ./node_modules/moment/locale/it-ch.js ***!
  46844. \*********************************************/
  46845. /*! no static exports found */
  46846. /***/ (function(module, exports, __webpack_require__) {
  46847. //! moment.js locale configuration
  46848. //! locale : Italian (Switzerland) [it-ch]
  46849. //! author : xfh : https://github.com/xfh
  46850. ;(function (global, factory) {
  46851. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  46852. undefined
  46853. }(this, (function (moment) { 'use strict';
  46854. //! moment.js locale configuration
  46855. var itCh = moment.defineLocale('it-ch', {
  46856. months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split(
  46857. '_'
  46858. ),
  46859. monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
  46860. weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split(
  46861. '_'
  46862. ),
  46863. weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
  46864. weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),
  46865. longDateFormat: {
  46866. LT: 'HH:mm',
  46867. LTS: 'HH:mm:ss',
  46868. L: 'DD.MM.YYYY',
  46869. LL: 'D MMMM YYYY',
  46870. LLL: 'D MMMM YYYY HH:mm',
  46871. LLLL: 'dddd D MMMM YYYY HH:mm',
  46872. },
  46873. calendar: {
  46874. sameDay: '[Oggi alle] LT',
  46875. nextDay: '[Domani alle] LT',
  46876. nextWeek: 'dddd [alle] LT',
  46877. lastDay: '[Ieri alle] LT',
  46878. lastWeek: function () {
  46879. switch (this.day()) {
  46880. case 0:
  46881. return '[la scorsa] dddd [alle] LT';
  46882. default:
  46883. return '[lo scorso] dddd [alle] LT';
  46884. }
  46885. },
  46886. sameElse: 'L',
  46887. },
  46888. relativeTime: {
  46889. future: function (s) {
  46890. return (/^[0-9].+$/.test(s) ? 'tra' : 'in') + ' ' + s;
  46891. },
  46892. past: '%s fa',
  46893. s: 'alcuni secondi',
  46894. ss: '%d secondi',
  46895. m: 'un minuto',
  46896. mm: '%d minuti',
  46897. h: "un'ora",
  46898. hh: '%d ore',
  46899. d: 'un giorno',
  46900. dd: '%d giorni',
  46901. M: 'un mese',
  46902. MM: '%d mesi',
  46903. y: 'un anno',
  46904. yy: '%d anni',
  46905. },
  46906. dayOfMonthOrdinalParse: /\d{1,2}º/,
  46907. ordinal: '%dº',
  46908. week: {
  46909. dow: 1, // Monday is the first day of the week.
  46910. doy: 4, // The week that contains Jan 4th is the first week of the year.
  46911. },
  46912. });
  46913. return itCh;
  46914. })));
  46915. /***/ }),
  46916. /***/ "./node_modules/moment/locale/it.js":
  46917. /*!******************************************!*\
  46918. !*** ./node_modules/moment/locale/it.js ***!
  46919. \******************************************/
  46920. /*! no static exports found */
  46921. /***/ (function(module, exports, __webpack_require__) {
  46922. //! moment.js locale configuration
  46923. //! locale : Italian [it]
  46924. //! author : Lorenzo : https://github.com/aliem
  46925. //! author: Mattia Larentis: https://github.com/nostalgiaz
  46926. //! author: Marco : https://github.com/Manfre98
  46927. ;(function (global, factory) {
  46928. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  46929. undefined
  46930. }(this, (function (moment) { 'use strict';
  46931. //! moment.js locale configuration
  46932. var it = moment.defineLocale('it', {
  46933. months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split(
  46934. '_'
  46935. ),
  46936. monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
  46937. weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split(
  46938. '_'
  46939. ),
  46940. weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
  46941. weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),
  46942. longDateFormat: {
  46943. LT: 'HH:mm',
  46944. LTS: 'HH:mm:ss',
  46945. L: 'DD/MM/YYYY',
  46946. LL: 'D MMMM YYYY',
  46947. LLL: 'D MMMM YYYY HH:mm',
  46948. LLLL: 'dddd D MMMM YYYY HH:mm',
  46949. },
  46950. calendar: {
  46951. sameDay: function () {
  46952. return (
  46953. '[Oggi a' +
  46954. (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") +
  46955. ']LT'
  46956. );
  46957. },
  46958. nextDay: function () {
  46959. return (
  46960. '[Domani a' +
  46961. (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") +
  46962. ']LT'
  46963. );
  46964. },
  46965. nextWeek: function () {
  46966. return (
  46967. 'dddd [a' +
  46968. (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") +
  46969. ']LT'
  46970. );
  46971. },
  46972. lastDay: function () {
  46973. return (
  46974. '[Ieri a' +
  46975. (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") +
  46976. ']LT'
  46977. );
  46978. },
  46979. lastWeek: function () {
  46980. switch (this.day()) {
  46981. case 0:
  46982. return (
  46983. '[La scorsa] dddd [a' +
  46984. (this.hours() > 1
  46985. ? 'lle '
  46986. : this.hours() === 0
  46987. ? ' '
  46988. : "ll'") +
  46989. ']LT'
  46990. );
  46991. default:
  46992. return (
  46993. '[Lo scorso] dddd [a' +
  46994. (this.hours() > 1
  46995. ? 'lle '
  46996. : this.hours() === 0
  46997. ? ' '
  46998. : "ll'") +
  46999. ']LT'
  47000. );
  47001. }
  47002. },
  47003. sameElse: 'L',
  47004. },
  47005. relativeTime: {
  47006. future: 'tra %s',
  47007. past: '%s fa',
  47008. s: 'alcuni secondi',
  47009. ss: '%d secondi',
  47010. m: 'un minuto',
  47011. mm: '%d minuti',
  47012. h: "un'ora",
  47013. hh: '%d ore',
  47014. d: 'un giorno',
  47015. dd: '%d giorni',
  47016. M: 'un mese',
  47017. MM: '%d mesi',
  47018. y: 'un anno',
  47019. yy: '%d anni',
  47020. },
  47021. dayOfMonthOrdinalParse: /\d{1,2}º/,
  47022. ordinal: '%dº',
  47023. week: {
  47024. dow: 1, // Monday is the first day of the week.
  47025. doy: 4, // The week that contains Jan 4th is the first week of the year.
  47026. },
  47027. });
  47028. return it;
  47029. })));
  47030. /***/ }),
  47031. /***/ "./node_modules/moment/locale/ja.js":
  47032. /*!******************************************!*\
  47033. !*** ./node_modules/moment/locale/ja.js ***!
  47034. \******************************************/
  47035. /*! no static exports found */
  47036. /***/ (function(module, exports, __webpack_require__) {
  47037. //! moment.js locale configuration
  47038. //! locale : Japanese [ja]
  47039. //! author : LI Long : https://github.com/baryon
  47040. ;(function (global, factory) {
  47041. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  47042. undefined
  47043. }(this, (function (moment) { 'use strict';
  47044. //! moment.js locale configuration
  47045. var ja = moment.defineLocale('ja', {
  47046. eras: [
  47047. {
  47048. since: '2019-05-01',
  47049. offset: 1,
  47050. name: '令和',
  47051. narrow: '㋿',
  47052. abbr: 'R',
  47053. },
  47054. {
  47055. since: '1989-01-08',
  47056. until: '2019-04-30',
  47057. offset: 1,
  47058. name: '平成',
  47059. narrow: '㍻',
  47060. abbr: 'H',
  47061. },
  47062. {
  47063. since: '1926-12-25',
  47064. until: '1989-01-07',
  47065. offset: 1,
  47066. name: '昭和',
  47067. narrow: '㍼',
  47068. abbr: 'S',
  47069. },
  47070. {
  47071. since: '1912-07-30',
  47072. until: '1926-12-24',
  47073. offset: 1,
  47074. name: '大正',
  47075. narrow: '㍽',
  47076. abbr: 'T',
  47077. },
  47078. {
  47079. since: '1873-01-01',
  47080. until: '1912-07-29',
  47081. offset: 6,
  47082. name: '明治',
  47083. narrow: '㍾',
  47084. abbr: 'M',
  47085. },
  47086. {
  47087. since: '0001-01-01',
  47088. until: '1873-12-31',
  47089. offset: 1,
  47090. name: '西暦',
  47091. narrow: 'AD',
  47092. abbr: 'AD',
  47093. },
  47094. {
  47095. since: '0000-12-31',
  47096. until: -Infinity,
  47097. offset: 1,
  47098. name: '紀元前',
  47099. narrow: 'BC',
  47100. abbr: 'BC',
  47101. },
  47102. ],
  47103. eraYearOrdinalRegex: /(元|\d+)年/,
  47104. eraYearOrdinalParse: function (input, match) {
  47105. return match[1] === '元' ? 1 : parseInt(match[1] || input, 10);
  47106. },
  47107. months: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  47108. monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
  47109. '_'
  47110. ),
  47111. weekdays: '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),
  47112. weekdaysShort: '日_月_火_水_木_金_土'.split('_'),
  47113. weekdaysMin: '日_月_火_水_木_金_土'.split('_'),
  47114. longDateFormat: {
  47115. LT: 'HH:mm',
  47116. LTS: 'HH:mm:ss',
  47117. L: 'YYYY/MM/DD',
  47118. LL: 'YYYY年M月D日',
  47119. LLL: 'YYYY年M月D日 HH:mm',
  47120. LLLL: 'YYYY年M月D日 dddd HH:mm',
  47121. l: 'YYYY/MM/DD',
  47122. ll: 'YYYY年M月D日',
  47123. lll: 'YYYY年M月D日 HH:mm',
  47124. llll: 'YYYY年M月D日(ddd) HH:mm',
  47125. },
  47126. meridiemParse: /午前|午後/i,
  47127. isPM: function (input) {
  47128. return input === '午後';
  47129. },
  47130. meridiem: function (hour, minute, isLower) {
  47131. if (hour < 12) {
  47132. return '午前';
  47133. } else {
  47134. return '午後';
  47135. }
  47136. },
  47137. calendar: {
  47138. sameDay: '[今日] LT',
  47139. nextDay: '[明日] LT',
  47140. nextWeek: function (now) {
  47141. if (now.week() !== this.week()) {
  47142. return '[来週]dddd LT';
  47143. } else {
  47144. return 'dddd LT';
  47145. }
  47146. },
  47147. lastDay: '[昨日] LT',
  47148. lastWeek: function (now) {
  47149. if (this.week() !== now.week()) {
  47150. return '[先週]dddd LT';
  47151. } else {
  47152. return 'dddd LT';
  47153. }
  47154. },
  47155. sameElse: 'L',
  47156. },
  47157. dayOfMonthOrdinalParse: /\d{1,2}日/,
  47158. ordinal: function (number, period) {
  47159. switch (period) {
  47160. case 'y':
  47161. return number === 1 ? '元年' : number + '年';
  47162. case 'd':
  47163. case 'D':
  47164. case 'DDD':
  47165. return number + '日';
  47166. default:
  47167. return number;
  47168. }
  47169. },
  47170. relativeTime: {
  47171. future: '%s後',
  47172. past: '%s前',
  47173. s: '数秒',
  47174. ss: '%d秒',
  47175. m: '1分',
  47176. mm: '%d分',
  47177. h: '1時間',
  47178. hh: '%d時間',
  47179. d: '1日',
  47180. dd: '%d日',
  47181. M: '1ヶ月',
  47182. MM: '%dヶ月',
  47183. y: '1年',
  47184. yy: '%d年',
  47185. },
  47186. });
  47187. return ja;
  47188. })));
  47189. /***/ }),
  47190. /***/ "./node_modules/moment/locale/jv.js":
  47191. /*!******************************************!*\
  47192. !*** ./node_modules/moment/locale/jv.js ***!
  47193. \******************************************/
  47194. /*! no static exports found */
  47195. /***/ (function(module, exports, __webpack_require__) {
  47196. //! moment.js locale configuration
  47197. //! locale : Javanese [jv]
  47198. //! author : Rony Lantip : https://github.com/lantip
  47199. //! reference: http://jv.wikipedia.org/wiki/Basa_Jawa
  47200. ;(function (global, factory) {
  47201. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  47202. undefined
  47203. }(this, (function (moment) { 'use strict';
  47204. //! moment.js locale configuration
  47205. var jv = moment.defineLocale('jv', {
  47206. months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split(
  47207. '_'
  47208. ),
  47209. monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'),
  47210. weekdays: 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'),
  47211. weekdaysShort: 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'),
  47212. weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'),
  47213. longDateFormat: {
  47214. LT: 'HH.mm',
  47215. LTS: 'HH.mm.ss',
  47216. L: 'DD/MM/YYYY',
  47217. LL: 'D MMMM YYYY',
  47218. LLL: 'D MMMM YYYY [pukul] HH.mm',
  47219. LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',
  47220. },
  47221. meridiemParse: /enjing|siyang|sonten|ndalu/,
  47222. meridiemHour: function (hour, meridiem) {
  47223. if (hour === 12) {
  47224. hour = 0;
  47225. }
  47226. if (meridiem === 'enjing') {
  47227. return hour;
  47228. } else if (meridiem === 'siyang') {
  47229. return hour >= 11 ? hour : hour + 12;
  47230. } else if (meridiem === 'sonten' || meridiem === 'ndalu') {
  47231. return hour + 12;
  47232. }
  47233. },
  47234. meridiem: function (hours, minutes, isLower) {
  47235. if (hours < 11) {
  47236. return 'enjing';
  47237. } else if (hours < 15) {
  47238. return 'siyang';
  47239. } else if (hours < 19) {
  47240. return 'sonten';
  47241. } else {
  47242. return 'ndalu';
  47243. }
  47244. },
  47245. calendar: {
  47246. sameDay: '[Dinten puniko pukul] LT',
  47247. nextDay: '[Mbenjang pukul] LT',
  47248. nextWeek: 'dddd [pukul] LT',
  47249. lastDay: '[Kala wingi pukul] LT',
  47250. lastWeek: 'dddd [kepengker pukul] LT',
  47251. sameElse: 'L',
  47252. },
  47253. relativeTime: {
  47254. future: 'wonten ing %s',
  47255. past: '%s ingkang kepengker',
  47256. s: 'sawetawis detik',
  47257. ss: '%d detik',
  47258. m: 'setunggal menit',
  47259. mm: '%d menit',
  47260. h: 'setunggal jam',
  47261. hh: '%d jam',
  47262. d: 'sedinten',
  47263. dd: '%d dinten',
  47264. M: 'sewulan',
  47265. MM: '%d wulan',
  47266. y: 'setaun',
  47267. yy: '%d taun',
  47268. },
  47269. week: {
  47270. dow: 1, // Monday is the first day of the week.
  47271. doy: 7, // The week that contains Jan 7th is the first week of the year.
  47272. },
  47273. });
  47274. return jv;
  47275. })));
  47276. /***/ }),
  47277. /***/ "./node_modules/moment/locale/ka.js":
  47278. /*!******************************************!*\
  47279. !*** ./node_modules/moment/locale/ka.js ***!
  47280. \******************************************/
  47281. /*! no static exports found */
  47282. /***/ (function(module, exports, __webpack_require__) {
  47283. //! moment.js locale configuration
  47284. //! locale : Georgian [ka]
  47285. //! author : Irakli Janiashvili : https://github.com/IrakliJani
  47286. ;(function (global, factory) {
  47287. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  47288. undefined
  47289. }(this, (function (moment) { 'use strict';
  47290. //! moment.js locale configuration
  47291. var ka = moment.defineLocale('ka', {
  47292. months: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split(
  47293. '_'
  47294. ),
  47295. monthsShort: 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),
  47296. weekdays: {
  47297. standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split(
  47298. '_'
  47299. ),
  47300. format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split(
  47301. '_'
  47302. ),
  47303. isFormat: /(წინა|შემდეგ)/,
  47304. },
  47305. weekdaysShort: 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),
  47306. weekdaysMin: 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),
  47307. longDateFormat: {
  47308. LT: 'HH:mm',
  47309. LTS: 'HH:mm:ss',
  47310. L: 'DD/MM/YYYY',
  47311. LL: 'D MMMM YYYY',
  47312. LLL: 'D MMMM YYYY HH:mm',
  47313. LLLL: 'dddd, D MMMM YYYY HH:mm',
  47314. },
  47315. calendar: {
  47316. sameDay: '[დღეს] LT[-ზე]',
  47317. nextDay: '[ხვალ] LT[-ზე]',
  47318. lastDay: '[გუშინ] LT[-ზე]',
  47319. nextWeek: '[შემდეგ] dddd LT[-ზე]',
  47320. lastWeek: '[წინა] dddd LT-ზე',
  47321. sameElse: 'L',
  47322. },
  47323. relativeTime: {
  47324. future: function (s) {
  47325. return s.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/, function (
  47326. $0,
  47327. $1,
  47328. $2
  47329. ) {
  47330. return $2 === 'ი' ? $1 + 'ში' : $1 + $2 + 'ში';
  47331. });
  47332. },
  47333. past: function (s) {
  47334. if (/(წამი|წუთი|საათი|დღე|თვე)/.test(s)) {
  47335. return s.replace(/(ი|ე)$/, 'ის წინ');
  47336. }
  47337. if (/წელი/.test(s)) {
  47338. return s.replace(/წელი$/, 'წლის წინ');
  47339. }
  47340. return s;
  47341. },
  47342. s: 'რამდენიმე წამი',
  47343. ss: '%d წამი',
  47344. m: 'წუთი',
  47345. mm: '%d წუთი',
  47346. h: 'საათი',
  47347. hh: '%d საათი',
  47348. d: 'დღე',
  47349. dd: '%d დღე',
  47350. M: 'თვე',
  47351. MM: '%d თვე',
  47352. y: 'წელი',
  47353. yy: '%d წელი',
  47354. },
  47355. dayOfMonthOrdinalParse: /0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,
  47356. ordinal: function (number) {
  47357. if (number === 0) {
  47358. return number;
  47359. }
  47360. if (number === 1) {
  47361. return number + '-ლი';
  47362. }
  47363. if (
  47364. number < 20 ||
  47365. (number <= 100 && number % 20 === 0) ||
  47366. number % 100 === 0
  47367. ) {
  47368. return 'მე-' + number;
  47369. }
  47370. return number + '-ე';
  47371. },
  47372. week: {
  47373. dow: 1,
  47374. doy: 7,
  47375. },
  47376. });
  47377. return ka;
  47378. })));
  47379. /***/ }),
  47380. /***/ "./node_modules/moment/locale/kk.js":
  47381. /*!******************************************!*\
  47382. !*** ./node_modules/moment/locale/kk.js ***!
  47383. \******************************************/
  47384. /*! no static exports found */
  47385. /***/ (function(module, exports, __webpack_require__) {
  47386. //! moment.js locale configuration
  47387. //! locale : Kazakh [kk]
  47388. //! authors : Nurlan Rakhimzhanov : https://github.com/nurlan
  47389. ;(function (global, factory) {
  47390. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  47391. undefined
  47392. }(this, (function (moment) { 'use strict';
  47393. //! moment.js locale configuration
  47394. var suffixes = {
  47395. 0: '-ші',
  47396. 1: '-ші',
  47397. 2: '-ші',
  47398. 3: '-ші',
  47399. 4: '-ші',
  47400. 5: '-ші',
  47401. 6: '-шы',
  47402. 7: '-ші',
  47403. 8: '-ші',
  47404. 9: '-шы',
  47405. 10: '-шы',
  47406. 20: '-шы',
  47407. 30: '-шы',
  47408. 40: '-шы',
  47409. 50: '-ші',
  47410. 60: '-шы',
  47411. 70: '-ші',
  47412. 80: '-ші',
  47413. 90: '-шы',
  47414. 100: '-ші',
  47415. };
  47416. var kk = moment.defineLocale('kk', {
  47417. months: 'қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан'.split(
  47418. '_'
  47419. ),
  47420. monthsShort: 'қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'),
  47421. weekdays: 'жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі'.split(
  47422. '_'
  47423. ),
  47424. weekdaysShort: 'жек_дүй_сей_сәр_бей_жұм_сен'.split('_'),
  47425. weekdaysMin: 'жк_дй_сй_ср_бй_жм_сн'.split('_'),
  47426. longDateFormat: {
  47427. LT: 'HH:mm',
  47428. LTS: 'HH:mm:ss',
  47429. L: 'DD.MM.YYYY',
  47430. LL: 'D MMMM YYYY',
  47431. LLL: 'D MMMM YYYY HH:mm',
  47432. LLLL: 'dddd, D MMMM YYYY HH:mm',
  47433. },
  47434. calendar: {
  47435. sameDay: '[Бүгін сағат] LT',
  47436. nextDay: '[Ертең сағат] LT',
  47437. nextWeek: 'dddd [сағат] LT',
  47438. lastDay: '[Кеше сағат] LT',
  47439. lastWeek: '[Өткен аптаның] dddd [сағат] LT',
  47440. sameElse: 'L',
  47441. },
  47442. relativeTime: {
  47443. future: '%s ішінде',
  47444. past: '%s бұрын',
  47445. s: 'бірнеше секунд',
  47446. ss: '%d секунд',
  47447. m: 'бір минут',
  47448. mm: '%d минут',
  47449. h: 'бір сағат',
  47450. hh: '%d сағат',
  47451. d: 'бір күн',
  47452. dd: '%d күн',
  47453. M: 'бір ай',
  47454. MM: '%d ай',
  47455. y: 'бір жыл',
  47456. yy: '%d жыл',
  47457. },
  47458. dayOfMonthOrdinalParse: /\d{1,2}-(ші|шы)/,
  47459. ordinal: function (number) {
  47460. var a = number % 10,
  47461. b = number >= 100 ? 100 : null;
  47462. return number + (suffixes[number] || suffixes[a] || suffixes[b]);
  47463. },
  47464. week: {
  47465. dow: 1, // Monday is the first day of the week.
  47466. doy: 7, // The week that contains Jan 7th is the first week of the year.
  47467. },
  47468. });
  47469. return kk;
  47470. })));
  47471. /***/ }),
  47472. /***/ "./node_modules/moment/locale/km.js":
  47473. /*!******************************************!*\
  47474. !*** ./node_modules/moment/locale/km.js ***!
  47475. \******************************************/
  47476. /*! no static exports found */
  47477. /***/ (function(module, exports, __webpack_require__) {
  47478. //! moment.js locale configuration
  47479. //! locale : Cambodian [km]
  47480. //! author : Kruy Vanna : https://github.com/kruyvanna
  47481. ;(function (global, factory) {
  47482. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  47483. undefined
  47484. }(this, (function (moment) { 'use strict';
  47485. //! moment.js locale configuration
  47486. var symbolMap = {
  47487. '1': '១',
  47488. '2': '២',
  47489. '3': '៣',
  47490. '4': '៤',
  47491. '5': '៥',
  47492. '6': '៦',
  47493. '7': '៧',
  47494. '8': '៨',
  47495. '9': '៩',
  47496. '0': '០',
  47497. },
  47498. numberMap = {
  47499. '១': '1',
  47500. '២': '2',
  47501. '៣': '3',
  47502. '៤': '4',
  47503. '៥': '5',
  47504. '៦': '6',
  47505. '៧': '7',
  47506. '៨': '8',
  47507. '៩': '9',
  47508. '០': '0',
  47509. };
  47510. var km = moment.defineLocale('km', {
  47511. months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split(
  47512. '_'
  47513. ),
  47514. monthsShort: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split(
  47515. '_'
  47516. ),
  47517. weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
  47518. weekdaysShort: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
  47519. weekdaysMin: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
  47520. weekdaysParseExact: true,
  47521. longDateFormat: {
  47522. LT: 'HH:mm',
  47523. LTS: 'HH:mm:ss',
  47524. L: 'DD/MM/YYYY',
  47525. LL: 'D MMMM YYYY',
  47526. LLL: 'D MMMM YYYY HH:mm',
  47527. LLLL: 'dddd, D MMMM YYYY HH:mm',
  47528. },
  47529. meridiemParse: /ព្រឹក|ល្ងាច/,
  47530. isPM: function (input) {
  47531. return input === 'ល្ងាច';
  47532. },
  47533. meridiem: function (hour, minute, isLower) {
  47534. if (hour < 12) {
  47535. return 'ព្រឹក';
  47536. } else {
  47537. return 'ល្ងាច';
  47538. }
  47539. },
  47540. calendar: {
  47541. sameDay: '[ថ្ងៃនេះ ម៉ោង] LT',
  47542. nextDay: '[ស្អែក ម៉ោង] LT',
  47543. nextWeek: 'dddd [ម៉ោង] LT',
  47544. lastDay: '[ម្សិលមិញ ម៉ោង] LT',
  47545. lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',
  47546. sameElse: 'L',
  47547. },
  47548. relativeTime: {
  47549. future: '%sទៀត',
  47550. past: '%sមុន',
  47551. s: 'ប៉ុន្មានវិនាទី',
  47552. ss: '%d វិនាទី',
  47553. m: 'មួយនាទី',
  47554. mm: '%d នាទី',
  47555. h: 'មួយម៉ោង',
  47556. hh: '%d ម៉ោង',
  47557. d: 'មួយថ្ងៃ',
  47558. dd: '%d ថ្ងៃ',
  47559. M: 'មួយខែ',
  47560. MM: '%d ខែ',
  47561. y: 'មួយឆ្នាំ',
  47562. yy: '%d ឆ្នាំ',
  47563. },
  47564. dayOfMonthOrdinalParse: /ទី\d{1,2}/,
  47565. ordinal: 'ទី%d',
  47566. preparse: function (string) {
  47567. return string.replace(/[១២៣៤៥៦៧៨៩០]/g, function (match) {
  47568. return numberMap[match];
  47569. });
  47570. },
  47571. postformat: function (string) {
  47572. return string.replace(/\d/g, function (match) {
  47573. return symbolMap[match];
  47574. });
  47575. },
  47576. week: {
  47577. dow: 1, // Monday is the first day of the week.
  47578. doy: 4, // The week that contains Jan 4th is the first week of the year.
  47579. },
  47580. });
  47581. return km;
  47582. })));
  47583. /***/ }),
  47584. /***/ "./node_modules/moment/locale/kn.js":
  47585. /*!******************************************!*\
  47586. !*** ./node_modules/moment/locale/kn.js ***!
  47587. \******************************************/
  47588. /*! no static exports found */
  47589. /***/ (function(module, exports, __webpack_require__) {
  47590. //! moment.js locale configuration
  47591. //! locale : Kannada [kn]
  47592. //! author : Rajeev Naik : https://github.com/rajeevnaikte
  47593. ;(function (global, factory) {
  47594. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  47595. undefined
  47596. }(this, (function (moment) { 'use strict';
  47597. //! moment.js locale configuration
  47598. var symbolMap = {
  47599. '1': '೧',
  47600. '2': '೨',
  47601. '3': '೩',
  47602. '4': '೪',
  47603. '5': '೫',
  47604. '6': '೬',
  47605. '7': '೭',
  47606. '8': '೮',
  47607. '9': '೯',
  47608. '0': '೦',
  47609. },
  47610. numberMap = {
  47611. '೧': '1',
  47612. '೨': '2',
  47613. '೩': '3',
  47614. '೪': '4',
  47615. '೫': '5',
  47616. '೬': '6',
  47617. '೭': '7',
  47618. '೮': '8',
  47619. '೯': '9',
  47620. '೦': '0',
  47621. };
  47622. var kn = moment.defineLocale('kn', {
  47623. months: 'ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್'.split(
  47624. '_'
  47625. ),
  47626. monthsShort: 'ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ'.split(
  47627. '_'
  47628. ),
  47629. monthsParseExact: true,
  47630. weekdays: 'ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ'.split(
  47631. '_'
  47632. ),
  47633. weekdaysShort: 'ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ'.split('_'),
  47634. weekdaysMin: 'ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ'.split('_'),
  47635. longDateFormat: {
  47636. LT: 'A h:mm',
  47637. LTS: 'A h:mm:ss',
  47638. L: 'DD/MM/YYYY',
  47639. LL: 'D MMMM YYYY',
  47640. LLL: 'D MMMM YYYY, A h:mm',
  47641. LLLL: 'dddd, D MMMM YYYY, A h:mm',
  47642. },
  47643. calendar: {
  47644. sameDay: '[ಇಂದು] LT',
  47645. nextDay: '[ನಾಳೆ] LT',
  47646. nextWeek: 'dddd, LT',
  47647. lastDay: '[ನಿನ್ನೆ] LT',
  47648. lastWeek: '[ಕೊನೆಯ] dddd, LT',
  47649. sameElse: 'L',
  47650. },
  47651. relativeTime: {
  47652. future: '%s ನಂತರ',
  47653. past: '%s ಹಿಂದೆ',
  47654. s: 'ಕೆಲವು ಕ್ಷಣಗಳು',
  47655. ss: '%d ಸೆಕೆಂಡುಗಳು',
  47656. m: 'ಒಂದು ನಿಮಿಷ',
  47657. mm: '%d ನಿಮಿಷ',
  47658. h: 'ಒಂದು ಗಂಟೆ',
  47659. hh: '%d ಗಂಟೆ',
  47660. d: 'ಒಂದು ದಿನ',
  47661. dd: '%d ದಿನ',
  47662. M: 'ಒಂದು ತಿಂಗಳು',
  47663. MM: '%d ತಿಂಗಳು',
  47664. y: 'ಒಂದು ವರ್ಷ',
  47665. yy: '%d ವರ್ಷ',
  47666. },
  47667. preparse: function (string) {
  47668. return string.replace(/[೧೨೩೪೫೬೭೮೯೦]/g, function (match) {
  47669. return numberMap[match];
  47670. });
  47671. },
  47672. postformat: function (string) {
  47673. return string.replace(/\d/g, function (match) {
  47674. return symbolMap[match];
  47675. });
  47676. },
  47677. meridiemParse: /ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,
  47678. meridiemHour: function (hour, meridiem) {
  47679. if (hour === 12) {
  47680. hour = 0;
  47681. }
  47682. if (meridiem === 'ರಾತ್ರಿ') {
  47683. return hour < 4 ? hour : hour + 12;
  47684. } else if (meridiem === 'ಬೆಳಿಗ್ಗೆ') {
  47685. return hour;
  47686. } else if (meridiem === 'ಮಧ್ಯಾಹ್ನ') {
  47687. return hour >= 10 ? hour : hour + 12;
  47688. } else if (meridiem === 'ಸಂಜೆ') {
  47689. return hour + 12;
  47690. }
  47691. },
  47692. meridiem: function (hour, minute, isLower) {
  47693. if (hour < 4) {
  47694. return 'ರಾತ್ರಿ';
  47695. } else if (hour < 10) {
  47696. return 'ಬೆಳಿಗ್ಗೆ';
  47697. } else if (hour < 17) {
  47698. return 'ಮಧ್ಯಾಹ್ನ';
  47699. } else if (hour < 20) {
  47700. return 'ಸಂಜೆ';
  47701. } else {
  47702. return 'ರಾತ್ರಿ';
  47703. }
  47704. },
  47705. dayOfMonthOrdinalParse: /\d{1,2}(ನೇ)/,
  47706. ordinal: function (number) {
  47707. return number + 'ನೇ';
  47708. },
  47709. week: {
  47710. dow: 0, // Sunday is the first day of the week.
  47711. doy: 6, // The week that contains Jan 6th is the first week of the year.
  47712. },
  47713. });
  47714. return kn;
  47715. })));
  47716. /***/ }),
  47717. /***/ "./node_modules/moment/locale/ko.js":
  47718. /*!******************************************!*\
  47719. !*** ./node_modules/moment/locale/ko.js ***!
  47720. \******************************************/
  47721. /*! no static exports found */
  47722. /***/ (function(module, exports, __webpack_require__) {
  47723. //! moment.js locale configuration
  47724. //! locale : Korean [ko]
  47725. //! author : Kyungwook, Park : https://github.com/kyungw00k
  47726. //! author : Jeeeyul Lee <jeeeyul@gmail.com>
  47727. ;(function (global, factory) {
  47728. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  47729. undefined
  47730. }(this, (function (moment) { 'use strict';
  47731. //! moment.js locale configuration
  47732. var ko = moment.defineLocale('ko', {
  47733. months: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
  47734. monthsShort: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split(
  47735. '_'
  47736. ),
  47737. weekdays: '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),
  47738. weekdaysShort: '일_월_화_수_목_금_토'.split('_'),
  47739. weekdaysMin: '일_월_화_수_목_금_토'.split('_'),
  47740. longDateFormat: {
  47741. LT: 'A h:mm',
  47742. LTS: 'A h:mm:ss',
  47743. L: 'YYYY.MM.DD.',
  47744. LL: 'YYYY년 MMMM D일',
  47745. LLL: 'YYYY년 MMMM D일 A h:mm',
  47746. LLLL: 'YYYY년 MMMM D일 dddd A h:mm',
  47747. l: 'YYYY.MM.DD.',
  47748. ll: 'YYYY년 MMMM D일',
  47749. lll: 'YYYY년 MMMM D일 A h:mm',
  47750. llll: 'YYYY년 MMMM D일 dddd A h:mm',
  47751. },
  47752. calendar: {
  47753. sameDay: '오늘 LT',
  47754. nextDay: '내일 LT',
  47755. nextWeek: 'dddd LT',
  47756. lastDay: '어제 LT',
  47757. lastWeek: '지난주 dddd LT',
  47758. sameElse: 'L',
  47759. },
  47760. relativeTime: {
  47761. future: '%s 후',
  47762. past: '%s 전',
  47763. s: '몇 초',
  47764. ss: '%d초',
  47765. m: '1분',
  47766. mm: '%d분',
  47767. h: '한 시간',
  47768. hh: '%d시간',
  47769. d: '하루',
  47770. dd: '%d일',
  47771. M: '한 달',
  47772. MM: '%d달',
  47773. y: '일 년',
  47774. yy: '%d년',
  47775. },
  47776. dayOfMonthOrdinalParse: /\d{1,2}(일|월|주)/,
  47777. ordinal: function (number, period) {
  47778. switch (period) {
  47779. case 'd':
  47780. case 'D':
  47781. case 'DDD':
  47782. return number + '일';
  47783. case 'M':
  47784. return number + '월';
  47785. case 'w':
  47786. case 'W':
  47787. return number + '주';
  47788. default:
  47789. return number;
  47790. }
  47791. },
  47792. meridiemParse: /오전|오후/,
  47793. isPM: function (token) {
  47794. return token === '오후';
  47795. },
  47796. meridiem: function (hour, minute, isUpper) {
  47797. return hour < 12 ? '오전' : '오후';
  47798. },
  47799. });
  47800. return ko;
  47801. })));
  47802. /***/ }),
  47803. /***/ "./node_modules/moment/locale/ku.js":
  47804. /*!******************************************!*\
  47805. !*** ./node_modules/moment/locale/ku.js ***!
  47806. \******************************************/
  47807. /*! no static exports found */
  47808. /***/ (function(module, exports, __webpack_require__) {
  47809. //! moment.js locale configuration
  47810. //! locale : Kurdish [ku]
  47811. //! author : Shahram Mebashar : https://github.com/ShahramMebashar
  47812. ;(function (global, factory) {
  47813. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  47814. undefined
  47815. }(this, (function (moment) { 'use strict';
  47816. //! moment.js locale configuration
  47817. var symbolMap = {
  47818. '1': '١',
  47819. '2': '٢',
  47820. '3': '٣',
  47821. '4': '٤',
  47822. '5': '٥',
  47823. '6': '٦',
  47824. '7': '٧',
  47825. '8': '٨',
  47826. '9': '٩',
  47827. '0': '٠',
  47828. },
  47829. numberMap = {
  47830. '١': '1',
  47831. '٢': '2',
  47832. '٣': '3',
  47833. '٤': '4',
  47834. '٥': '5',
  47835. '٦': '6',
  47836. '٧': '7',
  47837. '٨': '8',
  47838. '٩': '9',
  47839. '٠': '0',
  47840. },
  47841. months = [
  47842. 'کانونی دووەم',
  47843. 'شوبات',
  47844. 'ئازار',
  47845. 'نیسان',
  47846. 'ئایار',
  47847. 'حوزەیران',
  47848. 'تەمموز',
  47849. 'ئاب',
  47850. 'ئەیلوول',
  47851. 'تشرینی یەكەم',
  47852. 'تشرینی دووەم',
  47853. 'كانونی یەکەم',
  47854. ];
  47855. var ku = moment.defineLocale('ku', {
  47856. months: months,
  47857. monthsShort: months,
  47858. weekdays: 'یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌'.split(
  47859. '_'
  47860. ),
  47861. weekdaysShort: 'یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌'.split(
  47862. '_'
  47863. ),
  47864. weekdaysMin: 'ی_د_س_چ_پ_ه_ش'.split('_'),
  47865. weekdaysParseExact: true,
  47866. longDateFormat: {
  47867. LT: 'HH:mm',
  47868. LTS: 'HH:mm:ss',
  47869. L: 'DD/MM/YYYY',
  47870. LL: 'D MMMM YYYY',
  47871. LLL: 'D MMMM YYYY HH:mm',
  47872. LLLL: 'dddd, D MMMM YYYY HH:mm',
  47873. },
  47874. meridiemParse: /ئێواره‌|به‌یانی/,
  47875. isPM: function (input) {
  47876. return /ئێواره‌/.test(input);
  47877. },
  47878. meridiem: function (hour, minute, isLower) {
  47879. if (hour < 12) {
  47880. return 'به‌یانی';
  47881. } else {
  47882. return 'ئێواره‌';
  47883. }
  47884. },
  47885. calendar: {
  47886. sameDay: '[ئه‌مرۆ كاتژمێر] LT',
  47887. nextDay: '[به‌یانی كاتژمێر] LT',
  47888. nextWeek: 'dddd [كاتژمێر] LT',
  47889. lastDay: '[دوێنێ كاتژمێر] LT',
  47890. lastWeek: 'dddd [كاتژمێر] LT',
  47891. sameElse: 'L',
  47892. },
  47893. relativeTime: {
  47894. future: 'له‌ %s',
  47895. past: '%s',
  47896. s: 'چه‌ند چركه‌یه‌ك',
  47897. ss: 'چركه‌ %d',
  47898. m: 'یه‌ك خوله‌ك',
  47899. mm: '%d خوله‌ك',
  47900. h: 'یه‌ك كاتژمێر',
  47901. hh: '%d كاتژمێر',
  47902. d: 'یه‌ك ڕۆژ',
  47903. dd: '%d ڕۆژ',
  47904. M: 'یه‌ك مانگ',
  47905. MM: '%d مانگ',
  47906. y: 'یه‌ك ساڵ',
  47907. yy: '%d ساڵ',
  47908. },
  47909. preparse: function (string) {
  47910. return string
  47911. .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
  47912. return numberMap[match];
  47913. })
  47914. .replace(/،/g, ',');
  47915. },
  47916. postformat: function (string) {
  47917. return string
  47918. .replace(/\d/g, function (match) {
  47919. return symbolMap[match];
  47920. })
  47921. .replace(/,/g, '،');
  47922. },
  47923. week: {
  47924. dow: 6, // Saturday is the first day of the week.
  47925. doy: 12, // The week that contains Jan 12th is the first week of the year.
  47926. },
  47927. });
  47928. return ku;
  47929. })));
  47930. /***/ }),
  47931. /***/ "./node_modules/moment/locale/ky.js":
  47932. /*!******************************************!*\
  47933. !*** ./node_modules/moment/locale/ky.js ***!
  47934. \******************************************/
  47935. /*! no static exports found */
  47936. /***/ (function(module, exports, __webpack_require__) {
  47937. //! moment.js locale configuration
  47938. //! locale : Kyrgyz [ky]
  47939. //! author : Chyngyz Arystan uulu : https://github.com/chyngyz
  47940. ;(function (global, factory) {
  47941. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  47942. undefined
  47943. }(this, (function (moment) { 'use strict';
  47944. //! moment.js locale configuration
  47945. var suffixes = {
  47946. 0: '-чү',
  47947. 1: '-чи',
  47948. 2: '-чи',
  47949. 3: '-чү',
  47950. 4: '-чү',
  47951. 5: '-чи',
  47952. 6: '-чы',
  47953. 7: '-чи',
  47954. 8: '-чи',
  47955. 9: '-чу',
  47956. 10: '-чу',
  47957. 20: '-чы',
  47958. 30: '-чу',
  47959. 40: '-чы',
  47960. 50: '-чү',
  47961. 60: '-чы',
  47962. 70: '-чи',
  47963. 80: '-чи',
  47964. 90: '-чу',
  47965. 100: '-чү',
  47966. };
  47967. var ky = moment.defineLocale('ky', {
  47968. months: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split(
  47969. '_'
  47970. ),
  47971. monthsShort: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split(
  47972. '_'
  47973. ),
  47974. weekdays: 'Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби'.split(
  47975. '_'
  47976. ),
  47977. weekdaysShort: 'Жек_Дүй_Шей_Шар_Бей_Жум_Ише'.split('_'),
  47978. weekdaysMin: 'Жк_Дй_Шй_Шр_Бй_Жм_Иш'.split('_'),
  47979. longDateFormat: {
  47980. LT: 'HH:mm',
  47981. LTS: 'HH:mm:ss',
  47982. L: 'DD.MM.YYYY',
  47983. LL: 'D MMMM YYYY',
  47984. LLL: 'D MMMM YYYY HH:mm',
  47985. LLLL: 'dddd, D MMMM YYYY HH:mm',
  47986. },
  47987. calendar: {
  47988. sameDay: '[Бүгүн саат] LT',
  47989. nextDay: '[Эртең саат] LT',
  47990. nextWeek: 'dddd [саат] LT',
  47991. lastDay: '[Кечээ саат] LT',
  47992. lastWeek: '[Өткөн аптанын] dddd [күнү] [саат] LT',
  47993. sameElse: 'L',
  47994. },
  47995. relativeTime: {
  47996. future: '%s ичинде',
  47997. past: '%s мурун',
  47998. s: 'бирнече секунд',
  47999. ss: '%d секунд',
  48000. m: 'бир мүнөт',
  48001. mm: '%d мүнөт',
  48002. h: 'бир саат',
  48003. hh: '%d саат',
  48004. d: 'бир күн',
  48005. dd: '%d күн',
  48006. M: 'бир ай',
  48007. MM: '%d ай',
  48008. y: 'бир жыл',
  48009. yy: '%d жыл',
  48010. },
  48011. dayOfMonthOrdinalParse: /\d{1,2}-(чи|чы|чү|чу)/,
  48012. ordinal: function (number) {
  48013. var a = number % 10,
  48014. b = number >= 100 ? 100 : null;
  48015. return number + (suffixes[number] || suffixes[a] || suffixes[b]);
  48016. },
  48017. week: {
  48018. dow: 1, // Monday is the first day of the week.
  48019. doy: 7, // The week that contains Jan 7th is the first week of the year.
  48020. },
  48021. });
  48022. return ky;
  48023. })));
  48024. /***/ }),
  48025. /***/ "./node_modules/moment/locale/lb.js":
  48026. /*!******************************************!*\
  48027. !*** ./node_modules/moment/locale/lb.js ***!
  48028. \******************************************/
  48029. /*! no static exports found */
  48030. /***/ (function(module, exports, __webpack_require__) {
  48031. //! moment.js locale configuration
  48032. //! locale : Luxembourgish [lb]
  48033. //! author : mweimerskirch : https://github.com/mweimerskirch
  48034. //! author : David Raison : https://github.com/kwisatz
  48035. ;(function (global, factory) {
  48036. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  48037. undefined
  48038. }(this, (function (moment) { 'use strict';
  48039. //! moment.js locale configuration
  48040. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  48041. var format = {
  48042. m: ['eng Minutt', 'enger Minutt'],
  48043. h: ['eng Stonn', 'enger Stonn'],
  48044. d: ['een Dag', 'engem Dag'],
  48045. M: ['ee Mount', 'engem Mount'],
  48046. y: ['ee Joer', 'engem Joer'],
  48047. };
  48048. return withoutSuffix ? format[key][0] : format[key][1];
  48049. }
  48050. function processFutureTime(string) {
  48051. var number = string.substr(0, string.indexOf(' '));
  48052. if (eifelerRegelAppliesToNumber(number)) {
  48053. return 'a ' + string;
  48054. }
  48055. return 'an ' + string;
  48056. }
  48057. function processPastTime(string) {
  48058. var number = string.substr(0, string.indexOf(' '));
  48059. if (eifelerRegelAppliesToNumber(number)) {
  48060. return 'viru ' + string;
  48061. }
  48062. return 'virun ' + string;
  48063. }
  48064. /**
  48065. * Returns true if the word before the given number loses the '-n' ending.
  48066. * e.g. 'an 10 Deeg' but 'a 5 Deeg'
  48067. *
  48068. * @param number {integer}
  48069. * @returns {boolean}
  48070. */
  48071. function eifelerRegelAppliesToNumber(number) {
  48072. number = parseInt(number, 10);
  48073. if (isNaN(number)) {
  48074. return false;
  48075. }
  48076. if (number < 0) {
  48077. // Negative Number --> always true
  48078. return true;
  48079. } else if (number < 10) {
  48080. // Only 1 digit
  48081. if (4 <= number && number <= 7) {
  48082. return true;
  48083. }
  48084. return false;
  48085. } else if (number < 100) {
  48086. // 2 digits
  48087. var lastDigit = number % 10,
  48088. firstDigit = number / 10;
  48089. if (lastDigit === 0) {
  48090. return eifelerRegelAppliesToNumber(firstDigit);
  48091. }
  48092. return eifelerRegelAppliesToNumber(lastDigit);
  48093. } else if (number < 10000) {
  48094. // 3 or 4 digits --> recursively check first digit
  48095. while (number >= 10) {
  48096. number = number / 10;
  48097. }
  48098. return eifelerRegelAppliesToNumber(number);
  48099. } else {
  48100. // Anything larger than 4 digits: recursively check first n-3 digits
  48101. number = number / 1000;
  48102. return eifelerRegelAppliesToNumber(number);
  48103. }
  48104. }
  48105. var lb = moment.defineLocale('lb', {
  48106. months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split(
  48107. '_'
  48108. ),
  48109. monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split(
  48110. '_'
  48111. ),
  48112. monthsParseExact: true,
  48113. weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split(
  48114. '_'
  48115. ),
  48116. weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),
  48117. weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),
  48118. weekdaysParseExact: true,
  48119. longDateFormat: {
  48120. LT: 'H:mm [Auer]',
  48121. LTS: 'H:mm:ss [Auer]',
  48122. L: 'DD.MM.YYYY',
  48123. LL: 'D. MMMM YYYY',
  48124. LLL: 'D. MMMM YYYY H:mm [Auer]',
  48125. LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]',
  48126. },
  48127. calendar: {
  48128. sameDay: '[Haut um] LT',
  48129. sameElse: 'L',
  48130. nextDay: '[Muer um] LT',
  48131. nextWeek: 'dddd [um] LT',
  48132. lastDay: '[Gëschter um] LT',
  48133. lastWeek: function () {
  48134. // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule
  48135. switch (this.day()) {
  48136. case 2:
  48137. case 4:
  48138. return '[Leschten] dddd [um] LT';
  48139. default:
  48140. return '[Leschte] dddd [um] LT';
  48141. }
  48142. },
  48143. },
  48144. relativeTime: {
  48145. future: processFutureTime,
  48146. past: processPastTime,
  48147. s: 'e puer Sekonnen',
  48148. ss: '%d Sekonnen',
  48149. m: processRelativeTime,
  48150. mm: '%d Minutten',
  48151. h: processRelativeTime,
  48152. hh: '%d Stonnen',
  48153. d: processRelativeTime,
  48154. dd: '%d Deeg',
  48155. M: processRelativeTime,
  48156. MM: '%d Méint',
  48157. y: processRelativeTime,
  48158. yy: '%d Joer',
  48159. },
  48160. dayOfMonthOrdinalParse: /\d{1,2}\./,
  48161. ordinal: '%d.',
  48162. week: {
  48163. dow: 1, // Monday is the first day of the week.
  48164. doy: 4, // The week that contains Jan 4th is the first week of the year.
  48165. },
  48166. });
  48167. return lb;
  48168. })));
  48169. /***/ }),
  48170. /***/ "./node_modules/moment/locale/lo.js":
  48171. /*!******************************************!*\
  48172. !*** ./node_modules/moment/locale/lo.js ***!
  48173. \******************************************/
  48174. /*! no static exports found */
  48175. /***/ (function(module, exports, __webpack_require__) {
  48176. //! moment.js locale configuration
  48177. //! locale : Lao [lo]
  48178. //! author : Ryan Hart : https://github.com/ryanhart2
  48179. ;(function (global, factory) {
  48180. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  48181. undefined
  48182. }(this, (function (moment) { 'use strict';
  48183. //! moment.js locale configuration
  48184. var lo = moment.defineLocale('lo', {
  48185. months: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split(
  48186. '_'
  48187. ),
  48188. monthsShort: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split(
  48189. '_'
  48190. ),
  48191. weekdays: 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
  48192. weekdaysShort: 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
  48193. weekdaysMin: 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'),
  48194. weekdaysParseExact: true,
  48195. longDateFormat: {
  48196. LT: 'HH:mm',
  48197. LTS: 'HH:mm:ss',
  48198. L: 'DD/MM/YYYY',
  48199. LL: 'D MMMM YYYY',
  48200. LLL: 'D MMMM YYYY HH:mm',
  48201. LLLL: 'ວັນdddd D MMMM YYYY HH:mm',
  48202. },
  48203. meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/,
  48204. isPM: function (input) {
  48205. return input === 'ຕອນແລງ';
  48206. },
  48207. meridiem: function (hour, minute, isLower) {
  48208. if (hour < 12) {
  48209. return 'ຕອນເຊົ້າ';
  48210. } else {
  48211. return 'ຕອນແລງ';
  48212. }
  48213. },
  48214. calendar: {
  48215. sameDay: '[ມື້ນີ້ເວລາ] LT',
  48216. nextDay: '[ມື້ອື່ນເວລາ] LT',
  48217. nextWeek: '[ວັນ]dddd[ໜ້າເວລາ] LT',
  48218. lastDay: '[ມື້ວານນີ້ເວລາ] LT',
  48219. lastWeek: '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT',
  48220. sameElse: 'L',
  48221. },
  48222. relativeTime: {
  48223. future: 'ອີກ %s',
  48224. past: '%sຜ່ານມາ',
  48225. s: 'ບໍ່ເທົ່າໃດວິນາທີ',
  48226. ss: '%d ວິນາທີ',
  48227. m: '1 ນາທີ',
  48228. mm: '%d ນາທີ',
  48229. h: '1 ຊົ່ວໂມງ',
  48230. hh: '%d ຊົ່ວໂມງ',
  48231. d: '1 ມື້',
  48232. dd: '%d ມື້',
  48233. M: '1 ເດືອນ',
  48234. MM: '%d ເດືອນ',
  48235. y: '1 ປີ',
  48236. yy: '%d ປີ',
  48237. },
  48238. dayOfMonthOrdinalParse: /(ທີ່)\d{1,2}/,
  48239. ordinal: function (number) {
  48240. return 'ທີ່' + number;
  48241. },
  48242. });
  48243. return lo;
  48244. })));
  48245. /***/ }),
  48246. /***/ "./node_modules/moment/locale/lt.js":
  48247. /*!******************************************!*\
  48248. !*** ./node_modules/moment/locale/lt.js ***!
  48249. \******************************************/
  48250. /*! no static exports found */
  48251. /***/ (function(module, exports, __webpack_require__) {
  48252. //! moment.js locale configuration
  48253. //! locale : Lithuanian [lt]
  48254. //! author : Mindaugas Mozūras : https://github.com/mmozuras
  48255. ;(function (global, factory) {
  48256. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  48257. undefined
  48258. }(this, (function (moment) { 'use strict';
  48259. //! moment.js locale configuration
  48260. var units = {
  48261. ss: 'sekundė_sekundžių_sekundes',
  48262. m: 'minutė_minutės_minutę',
  48263. mm: 'minutės_minučių_minutes',
  48264. h: 'valanda_valandos_valandą',
  48265. hh: 'valandos_valandų_valandas',
  48266. d: 'diena_dienos_dieną',
  48267. dd: 'dienos_dienų_dienas',
  48268. M: 'mėnuo_mėnesio_mėnesį',
  48269. MM: 'mėnesiai_mėnesių_mėnesius',
  48270. y: 'metai_metų_metus',
  48271. yy: 'metai_metų_metus',
  48272. };
  48273. function translateSeconds(number, withoutSuffix, key, isFuture) {
  48274. if (withoutSuffix) {
  48275. return 'kelios sekundės';
  48276. } else {
  48277. return isFuture ? 'kelių sekundžių' : 'kelias sekundes';
  48278. }
  48279. }
  48280. function translateSingular(number, withoutSuffix, key, isFuture) {
  48281. return withoutSuffix
  48282. ? forms(key)[0]
  48283. : isFuture
  48284. ? forms(key)[1]
  48285. : forms(key)[2];
  48286. }
  48287. function special(number) {
  48288. return number % 10 === 0 || (number > 10 && number < 20);
  48289. }
  48290. function forms(key) {
  48291. return units[key].split('_');
  48292. }
  48293. function translate(number, withoutSuffix, key, isFuture) {
  48294. var result = number + ' ';
  48295. if (number === 1) {
  48296. return (
  48297. result + translateSingular(number, withoutSuffix, key[0], isFuture)
  48298. );
  48299. } else if (withoutSuffix) {
  48300. return result + (special(number) ? forms(key)[1] : forms(key)[0]);
  48301. } else {
  48302. if (isFuture) {
  48303. return result + forms(key)[1];
  48304. } else {
  48305. return result + (special(number) ? forms(key)[1] : forms(key)[2]);
  48306. }
  48307. }
  48308. }
  48309. var lt = moment.defineLocale('lt', {
  48310. months: {
  48311. format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split(
  48312. '_'
  48313. ),
  48314. standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split(
  48315. '_'
  48316. ),
  48317. isFormat: /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/,
  48318. },
  48319. monthsShort: 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),
  48320. weekdays: {
  48321. format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split(
  48322. '_'
  48323. ),
  48324. standalone: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split(
  48325. '_'
  48326. ),
  48327. isFormat: /dddd HH:mm/,
  48328. },
  48329. weekdaysShort: 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),
  48330. weekdaysMin: 'S_P_A_T_K_Pn_Š'.split('_'),
  48331. weekdaysParseExact: true,
  48332. longDateFormat: {
  48333. LT: 'HH:mm',
  48334. LTS: 'HH:mm:ss',
  48335. L: 'YYYY-MM-DD',
  48336. LL: 'YYYY [m.] MMMM D [d.]',
  48337. LLL: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
  48338. LLLL: 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',
  48339. l: 'YYYY-MM-DD',
  48340. ll: 'YYYY [m.] MMMM D [d.]',
  48341. lll: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
  48342. llll: 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]',
  48343. },
  48344. calendar: {
  48345. sameDay: '[Šiandien] LT',
  48346. nextDay: '[Rytoj] LT',
  48347. nextWeek: 'dddd LT',
  48348. lastDay: '[Vakar] LT',
  48349. lastWeek: '[Praėjusį] dddd LT',
  48350. sameElse: 'L',
  48351. },
  48352. relativeTime: {
  48353. future: 'po %s',
  48354. past: 'prieš %s',
  48355. s: translateSeconds,
  48356. ss: translate,
  48357. m: translateSingular,
  48358. mm: translate,
  48359. h: translateSingular,
  48360. hh: translate,
  48361. d: translateSingular,
  48362. dd: translate,
  48363. M: translateSingular,
  48364. MM: translate,
  48365. y: translateSingular,
  48366. yy: translate,
  48367. },
  48368. dayOfMonthOrdinalParse: /\d{1,2}-oji/,
  48369. ordinal: function (number) {
  48370. return number + '-oji';
  48371. },
  48372. week: {
  48373. dow: 1, // Monday is the first day of the week.
  48374. doy: 4, // The week that contains Jan 4th is the first week of the year.
  48375. },
  48376. });
  48377. return lt;
  48378. })));
  48379. /***/ }),
  48380. /***/ "./node_modules/moment/locale/lv.js":
  48381. /*!******************************************!*\
  48382. !*** ./node_modules/moment/locale/lv.js ***!
  48383. \******************************************/
  48384. /*! no static exports found */
  48385. /***/ (function(module, exports, __webpack_require__) {
  48386. //! moment.js locale configuration
  48387. //! locale : Latvian [lv]
  48388. //! author : Kristaps Karlsons : https://github.com/skakri
  48389. //! author : Jānis Elmeris : https://github.com/JanisE
  48390. ;(function (global, factory) {
  48391. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  48392. undefined
  48393. }(this, (function (moment) { 'use strict';
  48394. //! moment.js locale configuration
  48395. var units = {
  48396. ss: 'sekundes_sekundēm_sekunde_sekundes'.split('_'),
  48397. m: 'minūtes_minūtēm_minūte_minūtes'.split('_'),
  48398. mm: 'minūtes_minūtēm_minūte_minūtes'.split('_'),
  48399. h: 'stundas_stundām_stunda_stundas'.split('_'),
  48400. hh: 'stundas_stundām_stunda_stundas'.split('_'),
  48401. d: 'dienas_dienām_diena_dienas'.split('_'),
  48402. dd: 'dienas_dienām_diena_dienas'.split('_'),
  48403. M: 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
  48404. MM: 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
  48405. y: 'gada_gadiem_gads_gadi'.split('_'),
  48406. yy: 'gada_gadiem_gads_gadi'.split('_'),
  48407. };
  48408. /**
  48409. * @param withoutSuffix boolean true = a length of time; false = before/after a period of time.
  48410. */
  48411. function format(forms, number, withoutSuffix) {
  48412. if (withoutSuffix) {
  48413. // E.g. "21 minūte", "3 minūtes".
  48414. return number % 10 === 1 && number % 100 !== 11 ? forms[2] : forms[3];
  48415. } else {
  48416. // E.g. "21 minūtes" as in "pēc 21 minūtes".
  48417. // E.g. "3 minūtēm" as in "pēc 3 minūtēm".
  48418. return number % 10 === 1 && number % 100 !== 11 ? forms[0] : forms[1];
  48419. }
  48420. }
  48421. function relativeTimeWithPlural(number, withoutSuffix, key) {
  48422. return number + ' ' + format(units[key], number, withoutSuffix);
  48423. }
  48424. function relativeTimeWithSingular(number, withoutSuffix, key) {
  48425. return format(units[key], number, withoutSuffix);
  48426. }
  48427. function relativeSeconds(number, withoutSuffix) {
  48428. return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm';
  48429. }
  48430. var lv = moment.defineLocale('lv', {
  48431. months: 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split(
  48432. '_'
  48433. ),
  48434. monthsShort: 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),
  48435. weekdays: 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split(
  48436. '_'
  48437. ),
  48438. weekdaysShort: 'Sv_P_O_T_C_Pk_S'.split('_'),
  48439. weekdaysMin: 'Sv_P_O_T_C_Pk_S'.split('_'),
  48440. weekdaysParseExact: true,
  48441. longDateFormat: {
  48442. LT: 'HH:mm',
  48443. LTS: 'HH:mm:ss',
  48444. L: 'DD.MM.YYYY.',
  48445. LL: 'YYYY. [gada] D. MMMM',
  48446. LLL: 'YYYY. [gada] D. MMMM, HH:mm',
  48447. LLLL: 'YYYY. [gada] D. MMMM, dddd, HH:mm',
  48448. },
  48449. calendar: {
  48450. sameDay: '[Šodien pulksten] LT',
  48451. nextDay: '[Rīt pulksten] LT',
  48452. nextWeek: 'dddd [pulksten] LT',
  48453. lastDay: '[Vakar pulksten] LT',
  48454. lastWeek: '[Pagājušā] dddd [pulksten] LT',
  48455. sameElse: 'L',
  48456. },
  48457. relativeTime: {
  48458. future: 'pēc %s',
  48459. past: 'pirms %s',
  48460. s: relativeSeconds,
  48461. ss: relativeTimeWithPlural,
  48462. m: relativeTimeWithSingular,
  48463. mm: relativeTimeWithPlural,
  48464. h: relativeTimeWithSingular,
  48465. hh: relativeTimeWithPlural,
  48466. d: relativeTimeWithSingular,
  48467. dd: relativeTimeWithPlural,
  48468. M: relativeTimeWithSingular,
  48469. MM: relativeTimeWithPlural,
  48470. y: relativeTimeWithSingular,
  48471. yy: relativeTimeWithPlural,
  48472. },
  48473. dayOfMonthOrdinalParse: /\d{1,2}\./,
  48474. ordinal: '%d.',
  48475. week: {
  48476. dow: 1, // Monday is the first day of the week.
  48477. doy: 4, // The week that contains Jan 4th is the first week of the year.
  48478. },
  48479. });
  48480. return lv;
  48481. })));
  48482. /***/ }),
  48483. /***/ "./node_modules/moment/locale/me.js":
  48484. /*!******************************************!*\
  48485. !*** ./node_modules/moment/locale/me.js ***!
  48486. \******************************************/
  48487. /*! no static exports found */
  48488. /***/ (function(module, exports, __webpack_require__) {
  48489. //! moment.js locale configuration
  48490. //! locale : Montenegrin [me]
  48491. //! author : Miodrag Nikač <miodrag@restartit.me> : https://github.com/miodragnikac
  48492. ;(function (global, factory) {
  48493. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  48494. undefined
  48495. }(this, (function (moment) { 'use strict';
  48496. //! moment.js locale configuration
  48497. var translator = {
  48498. words: {
  48499. //Different grammatical cases
  48500. ss: ['sekund', 'sekunda', 'sekundi'],
  48501. m: ['jedan minut', 'jednog minuta'],
  48502. mm: ['minut', 'minuta', 'minuta'],
  48503. h: ['jedan sat', 'jednog sata'],
  48504. hh: ['sat', 'sata', 'sati'],
  48505. dd: ['dan', 'dana', 'dana'],
  48506. MM: ['mjesec', 'mjeseca', 'mjeseci'],
  48507. yy: ['godina', 'godine', 'godina'],
  48508. },
  48509. correctGrammaticalCase: function (number, wordKey) {
  48510. return number === 1
  48511. ? wordKey[0]
  48512. : number >= 2 && number <= 4
  48513. ? wordKey[1]
  48514. : wordKey[2];
  48515. },
  48516. translate: function (number, withoutSuffix, key) {
  48517. var wordKey = translator.words[key];
  48518. if (key.length === 1) {
  48519. return withoutSuffix ? wordKey[0] : wordKey[1];
  48520. } else {
  48521. return (
  48522. number +
  48523. ' ' +
  48524. translator.correctGrammaticalCase(number, wordKey)
  48525. );
  48526. }
  48527. },
  48528. };
  48529. var me = moment.defineLocale('me', {
  48530. months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(
  48531. '_'
  48532. ),
  48533. monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split(
  48534. '_'
  48535. ),
  48536. monthsParseExact: true,
  48537. weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(
  48538. '_'
  48539. ),
  48540. weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  48541. weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
  48542. weekdaysParseExact: true,
  48543. longDateFormat: {
  48544. LT: 'H:mm',
  48545. LTS: 'H:mm:ss',
  48546. L: 'DD.MM.YYYY',
  48547. LL: 'D. MMMM YYYY',
  48548. LLL: 'D. MMMM YYYY H:mm',
  48549. LLLL: 'dddd, D. MMMM YYYY H:mm',
  48550. },
  48551. calendar: {
  48552. sameDay: '[danas u] LT',
  48553. nextDay: '[sjutra u] LT',
  48554. nextWeek: function () {
  48555. switch (this.day()) {
  48556. case 0:
  48557. return '[u] [nedjelju] [u] LT';
  48558. case 3:
  48559. return '[u] [srijedu] [u] LT';
  48560. case 6:
  48561. return '[u] [subotu] [u] LT';
  48562. case 1:
  48563. case 2:
  48564. case 4:
  48565. case 5:
  48566. return '[u] dddd [u] LT';
  48567. }
  48568. },
  48569. lastDay: '[juče u] LT',
  48570. lastWeek: function () {
  48571. var lastWeekDays = [
  48572. '[prošle] [nedjelje] [u] LT',
  48573. '[prošlog] [ponedjeljka] [u] LT',
  48574. '[prošlog] [utorka] [u] LT',
  48575. '[prošle] [srijede] [u] LT',
  48576. '[prošlog] [četvrtka] [u] LT',
  48577. '[prošlog] [petka] [u] LT',
  48578. '[prošle] [subote] [u] LT',
  48579. ];
  48580. return lastWeekDays[this.day()];
  48581. },
  48582. sameElse: 'L',
  48583. },
  48584. relativeTime: {
  48585. future: 'za %s',
  48586. past: 'prije %s',
  48587. s: 'nekoliko sekundi',
  48588. ss: translator.translate,
  48589. m: translator.translate,
  48590. mm: translator.translate,
  48591. h: translator.translate,
  48592. hh: translator.translate,
  48593. d: 'dan',
  48594. dd: translator.translate,
  48595. M: 'mjesec',
  48596. MM: translator.translate,
  48597. y: 'godinu',
  48598. yy: translator.translate,
  48599. },
  48600. dayOfMonthOrdinalParse: /\d{1,2}\./,
  48601. ordinal: '%d.',
  48602. week: {
  48603. dow: 1, // Monday is the first day of the week.
  48604. doy: 7, // The week that contains Jan 7th is the first week of the year.
  48605. },
  48606. });
  48607. return me;
  48608. })));
  48609. /***/ }),
  48610. /***/ "./node_modules/moment/locale/mi.js":
  48611. /*!******************************************!*\
  48612. !*** ./node_modules/moment/locale/mi.js ***!
  48613. \******************************************/
  48614. /*! no static exports found */
  48615. /***/ (function(module, exports, __webpack_require__) {
  48616. //! moment.js locale configuration
  48617. //! locale : Maori [mi]
  48618. //! author : John Corrigan <robbiecloset@gmail.com> : https://github.com/johnideal
  48619. ;(function (global, factory) {
  48620. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  48621. undefined
  48622. }(this, (function (moment) { 'use strict';
  48623. //! moment.js locale configuration
  48624. var mi = moment.defineLocale('mi', {
  48625. months: 'Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea'.split(
  48626. '_'
  48627. ),
  48628. monthsShort: 'Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki'.split(
  48629. '_'
  48630. ),
  48631. monthsRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
  48632. monthsStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
  48633. monthsShortRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
  48634. monthsShortStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,
  48635. weekdays: 'Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei'.split('_'),
  48636. weekdaysShort: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
  48637. weekdaysMin: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
  48638. longDateFormat: {
  48639. LT: 'HH:mm',
  48640. LTS: 'HH:mm:ss',
  48641. L: 'DD/MM/YYYY',
  48642. LL: 'D MMMM YYYY',
  48643. LLL: 'D MMMM YYYY [i] HH:mm',
  48644. LLLL: 'dddd, D MMMM YYYY [i] HH:mm',
  48645. },
  48646. calendar: {
  48647. sameDay: '[i teie mahana, i] LT',
  48648. nextDay: '[apopo i] LT',
  48649. nextWeek: 'dddd [i] LT',
  48650. lastDay: '[inanahi i] LT',
  48651. lastWeek: 'dddd [whakamutunga i] LT',
  48652. sameElse: 'L',
  48653. },
  48654. relativeTime: {
  48655. future: 'i roto i %s',
  48656. past: '%s i mua',
  48657. s: 'te hēkona ruarua',
  48658. ss: '%d hēkona',
  48659. m: 'he meneti',
  48660. mm: '%d meneti',
  48661. h: 'te haora',
  48662. hh: '%d haora',
  48663. d: 'he ra',
  48664. dd: '%d ra',
  48665. M: 'he marama',
  48666. MM: '%d marama',
  48667. y: 'he tau',
  48668. yy: '%d tau',
  48669. },
  48670. dayOfMonthOrdinalParse: /\d{1,2}º/,
  48671. ordinal: '%dº',
  48672. week: {
  48673. dow: 1, // Monday is the first day of the week.
  48674. doy: 4, // The week that contains Jan 4th is the first week of the year.
  48675. },
  48676. });
  48677. return mi;
  48678. })));
  48679. /***/ }),
  48680. /***/ "./node_modules/moment/locale/mk.js":
  48681. /*!******************************************!*\
  48682. !*** ./node_modules/moment/locale/mk.js ***!
  48683. \******************************************/
  48684. /*! no static exports found */
  48685. /***/ (function(module, exports, __webpack_require__) {
  48686. //! moment.js locale configuration
  48687. //! locale : Macedonian [mk]
  48688. //! author : Borislav Mickov : https://github.com/B0k0
  48689. //! author : Sashko Todorov : https://github.com/bkyceh
  48690. ;(function (global, factory) {
  48691. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  48692. undefined
  48693. }(this, (function (moment) { 'use strict';
  48694. //! moment.js locale configuration
  48695. var mk = moment.defineLocale('mk', {
  48696. months: 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split(
  48697. '_'
  48698. ),
  48699. monthsShort: 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),
  48700. weekdays: 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split(
  48701. '_'
  48702. ),
  48703. weekdaysShort: 'нед_пон_вто_сре_чет_пет_саб'.split('_'),
  48704. weekdaysMin: 'нe_пo_вт_ср_че_пе_сa'.split('_'),
  48705. longDateFormat: {
  48706. LT: 'H:mm',
  48707. LTS: 'H:mm:ss',
  48708. L: 'D.MM.YYYY',
  48709. LL: 'D MMMM YYYY',
  48710. LLL: 'D MMMM YYYY H:mm',
  48711. LLLL: 'dddd, D MMMM YYYY H:mm',
  48712. },
  48713. calendar: {
  48714. sameDay: '[Денес во] LT',
  48715. nextDay: '[Утре во] LT',
  48716. nextWeek: '[Во] dddd [во] LT',
  48717. lastDay: '[Вчера во] LT',
  48718. lastWeek: function () {
  48719. switch (this.day()) {
  48720. case 0:
  48721. case 3:
  48722. case 6:
  48723. return '[Изминатата] dddd [во] LT';
  48724. case 1:
  48725. case 2:
  48726. case 4:
  48727. case 5:
  48728. return '[Изминатиот] dddd [во] LT';
  48729. }
  48730. },
  48731. sameElse: 'L',
  48732. },
  48733. relativeTime: {
  48734. future: 'за %s',
  48735. past: 'пред %s',
  48736. s: 'неколку секунди',
  48737. ss: '%d секунди',
  48738. m: 'една минута',
  48739. mm: '%d минути',
  48740. h: 'еден час',
  48741. hh: '%d часа',
  48742. d: 'еден ден',
  48743. dd: '%d дена',
  48744. M: 'еден месец',
  48745. MM: '%d месеци',
  48746. y: 'една година',
  48747. yy: '%d години',
  48748. },
  48749. dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
  48750. ordinal: function (number) {
  48751. var lastDigit = number % 10,
  48752. last2Digits = number % 100;
  48753. if (number === 0) {
  48754. return number + '-ев';
  48755. } else if (last2Digits === 0) {
  48756. return number + '-ен';
  48757. } else if (last2Digits > 10 && last2Digits < 20) {
  48758. return number + '-ти';
  48759. } else if (lastDigit === 1) {
  48760. return number + '-ви';
  48761. } else if (lastDigit === 2) {
  48762. return number + '-ри';
  48763. } else if (lastDigit === 7 || lastDigit === 8) {
  48764. return number + '-ми';
  48765. } else {
  48766. return number + '-ти';
  48767. }
  48768. },
  48769. week: {
  48770. dow: 1, // Monday is the first day of the week.
  48771. doy: 7, // The week that contains Jan 7th is the first week of the year.
  48772. },
  48773. });
  48774. return mk;
  48775. })));
  48776. /***/ }),
  48777. /***/ "./node_modules/moment/locale/ml.js":
  48778. /*!******************************************!*\
  48779. !*** ./node_modules/moment/locale/ml.js ***!
  48780. \******************************************/
  48781. /*! no static exports found */
  48782. /***/ (function(module, exports, __webpack_require__) {
  48783. //! moment.js locale configuration
  48784. //! locale : Malayalam [ml]
  48785. //! author : Floyd Pink : https://github.com/floydpink
  48786. ;(function (global, factory) {
  48787. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  48788. undefined
  48789. }(this, (function (moment) { 'use strict';
  48790. //! moment.js locale configuration
  48791. var ml = moment.defineLocale('ml', {
  48792. months: 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split(
  48793. '_'
  48794. ),
  48795. monthsShort: 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split(
  48796. '_'
  48797. ),
  48798. monthsParseExact: true,
  48799. weekdays: 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split(
  48800. '_'
  48801. ),
  48802. weekdaysShort: 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'),
  48803. weekdaysMin: 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'),
  48804. longDateFormat: {
  48805. LT: 'A h:mm -നു',
  48806. LTS: 'A h:mm:ss -നു',
  48807. L: 'DD/MM/YYYY',
  48808. LL: 'D MMMM YYYY',
  48809. LLL: 'D MMMM YYYY, A h:mm -നു',
  48810. LLLL: 'dddd, D MMMM YYYY, A h:mm -നു',
  48811. },
  48812. calendar: {
  48813. sameDay: '[ഇന്ന്] LT',
  48814. nextDay: '[നാളെ] LT',
  48815. nextWeek: 'dddd, LT',
  48816. lastDay: '[ഇന്നലെ] LT',
  48817. lastWeek: '[കഴിഞ്ഞ] dddd, LT',
  48818. sameElse: 'L',
  48819. },
  48820. relativeTime: {
  48821. future: '%s കഴിഞ്ഞ്',
  48822. past: '%s മുൻപ്',
  48823. s: 'അൽപ നിമിഷങ്ങൾ',
  48824. ss: '%d സെക്കൻഡ്',
  48825. m: 'ഒരു മിനിറ്റ്',
  48826. mm: '%d മിനിറ്റ്',
  48827. h: 'ഒരു മണിക്കൂർ',
  48828. hh: '%d മണിക്കൂർ',
  48829. d: 'ഒരു ദിവസം',
  48830. dd: '%d ദിവസം',
  48831. M: 'ഒരു മാസം',
  48832. MM: '%d മാസം',
  48833. y: 'ഒരു വർഷം',
  48834. yy: '%d വർഷം',
  48835. },
  48836. meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,
  48837. meridiemHour: function (hour, meridiem) {
  48838. if (hour === 12) {
  48839. hour = 0;
  48840. }
  48841. if (
  48842. (meridiem === 'രാത്രി' && hour >= 4) ||
  48843. meridiem === 'ഉച്ച കഴിഞ്ഞ്' ||
  48844. meridiem === 'വൈകുന്നേരം'
  48845. ) {
  48846. return hour + 12;
  48847. } else {
  48848. return hour;
  48849. }
  48850. },
  48851. meridiem: function (hour, minute, isLower) {
  48852. if (hour < 4) {
  48853. return 'രാത്രി';
  48854. } else if (hour < 12) {
  48855. return 'രാവിലെ';
  48856. } else if (hour < 17) {
  48857. return 'ഉച്ച കഴിഞ്ഞ്';
  48858. } else if (hour < 20) {
  48859. return 'വൈകുന്നേരം';
  48860. } else {
  48861. return 'രാത്രി';
  48862. }
  48863. },
  48864. });
  48865. return ml;
  48866. })));
  48867. /***/ }),
  48868. /***/ "./node_modules/moment/locale/mn.js":
  48869. /*!******************************************!*\
  48870. !*** ./node_modules/moment/locale/mn.js ***!
  48871. \******************************************/
  48872. /*! no static exports found */
  48873. /***/ (function(module, exports, __webpack_require__) {
  48874. //! moment.js locale configuration
  48875. //! locale : Mongolian [mn]
  48876. //! author : Javkhlantugs Nyamdorj : https://github.com/javkhaanj7
  48877. ;(function (global, factory) {
  48878. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  48879. undefined
  48880. }(this, (function (moment) { 'use strict';
  48881. //! moment.js locale configuration
  48882. function translate(number, withoutSuffix, key, isFuture) {
  48883. switch (key) {
  48884. case 's':
  48885. return withoutSuffix ? 'хэдхэн секунд' : 'хэдхэн секундын';
  48886. case 'ss':
  48887. return number + (withoutSuffix ? ' секунд' : ' секундын');
  48888. case 'm':
  48889. case 'mm':
  48890. return number + (withoutSuffix ? ' минут' : ' минутын');
  48891. case 'h':
  48892. case 'hh':
  48893. return number + (withoutSuffix ? ' цаг' : ' цагийн');
  48894. case 'd':
  48895. case 'dd':
  48896. return number + (withoutSuffix ? ' өдөр' : ' өдрийн');
  48897. case 'M':
  48898. case 'MM':
  48899. return number + (withoutSuffix ? ' сар' : ' сарын');
  48900. case 'y':
  48901. case 'yy':
  48902. return number + (withoutSuffix ? ' жил' : ' жилийн');
  48903. default:
  48904. return number;
  48905. }
  48906. }
  48907. var mn = moment.defineLocale('mn', {
  48908. months: 'Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар'.split(
  48909. '_'
  48910. ),
  48911. monthsShort: '1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар'.split(
  48912. '_'
  48913. ),
  48914. monthsParseExact: true,
  48915. weekdays: 'Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба'.split('_'),
  48916. weekdaysShort: 'Ням_Дав_Мяг_Лха_Пүр_Баа_Бям'.split('_'),
  48917. weekdaysMin: 'Ня_Да_Мя_Лх_Пү_Ба_Бя'.split('_'),
  48918. weekdaysParseExact: true,
  48919. longDateFormat: {
  48920. LT: 'HH:mm',
  48921. LTS: 'HH:mm:ss',
  48922. L: 'YYYY-MM-DD',
  48923. LL: 'YYYY оны MMMMын D',
  48924. LLL: 'YYYY оны MMMMын D HH:mm',
  48925. LLLL: 'dddd, YYYY оны MMMMын D HH:mm',
  48926. },
  48927. meridiemParse: /ҮӨ|ҮХ/i,
  48928. isPM: function (input) {
  48929. return input === 'ҮХ';
  48930. },
  48931. meridiem: function (hour, minute, isLower) {
  48932. if (hour < 12) {
  48933. return 'ҮӨ';
  48934. } else {
  48935. return 'ҮХ';
  48936. }
  48937. },
  48938. calendar: {
  48939. sameDay: '[Өнөөдөр] LT',
  48940. nextDay: '[Маргааш] LT',
  48941. nextWeek: '[Ирэх] dddd LT',
  48942. lastDay: '[Өчигдөр] LT',
  48943. lastWeek: '[Өнгөрсөн] dddd LT',
  48944. sameElse: 'L',
  48945. },
  48946. relativeTime: {
  48947. future: '%s дараа',
  48948. past: '%s өмнө',
  48949. s: translate,
  48950. ss: translate,
  48951. m: translate,
  48952. mm: translate,
  48953. h: translate,
  48954. hh: translate,
  48955. d: translate,
  48956. dd: translate,
  48957. M: translate,
  48958. MM: translate,
  48959. y: translate,
  48960. yy: translate,
  48961. },
  48962. dayOfMonthOrdinalParse: /\d{1,2} өдөр/,
  48963. ordinal: function (number, period) {
  48964. switch (period) {
  48965. case 'd':
  48966. case 'D':
  48967. case 'DDD':
  48968. return number + ' өдөр';
  48969. default:
  48970. return number;
  48971. }
  48972. },
  48973. });
  48974. return mn;
  48975. })));
  48976. /***/ }),
  48977. /***/ "./node_modules/moment/locale/mr.js":
  48978. /*!******************************************!*\
  48979. !*** ./node_modules/moment/locale/mr.js ***!
  48980. \******************************************/
  48981. /*! no static exports found */
  48982. /***/ (function(module, exports, __webpack_require__) {
  48983. //! moment.js locale configuration
  48984. //! locale : Marathi [mr]
  48985. //! author : Harshad Kale : https://github.com/kalehv
  48986. //! author : Vivek Athalye : https://github.com/vnathalye
  48987. ;(function (global, factory) {
  48988. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  48989. undefined
  48990. }(this, (function (moment) { 'use strict';
  48991. //! moment.js locale configuration
  48992. var symbolMap = {
  48993. '1': '१',
  48994. '2': '२',
  48995. '3': '३',
  48996. '4': '४',
  48997. '5': '५',
  48998. '6': '६',
  48999. '7': '७',
  49000. '8': '८',
  49001. '9': '९',
  49002. '0': '०',
  49003. },
  49004. numberMap = {
  49005. '१': '1',
  49006. '२': '2',
  49007. '३': '3',
  49008. '४': '4',
  49009. '५': '5',
  49010. '६': '6',
  49011. '७': '7',
  49012. '८': '8',
  49013. '९': '9',
  49014. '०': '0',
  49015. };
  49016. function relativeTimeMr(number, withoutSuffix, string, isFuture) {
  49017. var output = '';
  49018. if (withoutSuffix) {
  49019. switch (string) {
  49020. case 's':
  49021. output = 'काही सेकंद';
  49022. break;
  49023. case 'ss':
  49024. output = '%d सेकंद';
  49025. break;
  49026. case 'm':
  49027. output = 'एक मिनिट';
  49028. break;
  49029. case 'mm':
  49030. output = '%d मिनिटे';
  49031. break;
  49032. case 'h':
  49033. output = 'एक तास';
  49034. break;
  49035. case 'hh':
  49036. output = '%d तास';
  49037. break;
  49038. case 'd':
  49039. output = 'एक दिवस';
  49040. break;
  49041. case 'dd':
  49042. output = '%d दिवस';
  49043. break;
  49044. case 'M':
  49045. output = 'एक महिना';
  49046. break;
  49047. case 'MM':
  49048. output = '%d महिने';
  49049. break;
  49050. case 'y':
  49051. output = 'एक वर्ष';
  49052. break;
  49053. case 'yy':
  49054. output = '%d वर्षे';
  49055. break;
  49056. }
  49057. } else {
  49058. switch (string) {
  49059. case 's':
  49060. output = 'काही सेकंदां';
  49061. break;
  49062. case 'ss':
  49063. output = '%d सेकंदां';
  49064. break;
  49065. case 'm':
  49066. output = 'एका मिनिटा';
  49067. break;
  49068. case 'mm':
  49069. output = '%d मिनिटां';
  49070. break;
  49071. case 'h':
  49072. output = 'एका तासा';
  49073. break;
  49074. case 'hh':
  49075. output = '%d तासां';
  49076. break;
  49077. case 'd':
  49078. output = 'एका दिवसा';
  49079. break;
  49080. case 'dd':
  49081. output = '%d दिवसां';
  49082. break;
  49083. case 'M':
  49084. output = 'एका महिन्या';
  49085. break;
  49086. case 'MM':
  49087. output = '%d महिन्यां';
  49088. break;
  49089. case 'y':
  49090. output = 'एका वर्षा';
  49091. break;
  49092. case 'yy':
  49093. output = '%d वर्षां';
  49094. break;
  49095. }
  49096. }
  49097. return output.replace(/%d/i, number);
  49098. }
  49099. var mr = moment.defineLocale('mr', {
  49100. months: 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split(
  49101. '_'
  49102. ),
  49103. monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split(
  49104. '_'
  49105. ),
  49106. monthsParseExact: true,
  49107. weekdays: 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
  49108. weekdaysShort: 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),
  49109. weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),
  49110. longDateFormat: {
  49111. LT: 'A h:mm वाजता',
  49112. LTS: 'A h:mm:ss वाजता',
  49113. L: 'DD/MM/YYYY',
  49114. LL: 'D MMMM YYYY',
  49115. LLL: 'D MMMM YYYY, A h:mm वाजता',
  49116. LLLL: 'dddd, D MMMM YYYY, A h:mm वाजता',
  49117. },
  49118. calendar: {
  49119. sameDay: '[आज] LT',
  49120. nextDay: '[उद्या] LT',
  49121. nextWeek: 'dddd, LT',
  49122. lastDay: '[काल] LT',
  49123. lastWeek: '[मागील] dddd, LT',
  49124. sameElse: 'L',
  49125. },
  49126. relativeTime: {
  49127. future: '%sमध्ये',
  49128. past: '%sपूर्वी',
  49129. s: relativeTimeMr,
  49130. ss: relativeTimeMr,
  49131. m: relativeTimeMr,
  49132. mm: relativeTimeMr,
  49133. h: relativeTimeMr,
  49134. hh: relativeTimeMr,
  49135. d: relativeTimeMr,
  49136. dd: relativeTimeMr,
  49137. M: relativeTimeMr,
  49138. MM: relativeTimeMr,
  49139. y: relativeTimeMr,
  49140. yy: relativeTimeMr,
  49141. },
  49142. preparse: function (string) {
  49143. return string.replace(/[१२३४५६७८९०]/g, function (match) {
  49144. return numberMap[match];
  49145. });
  49146. },
  49147. postformat: function (string) {
  49148. return string.replace(/\d/g, function (match) {
  49149. return symbolMap[match];
  49150. });
  49151. },
  49152. meridiemParse: /पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,
  49153. meridiemHour: function (hour, meridiem) {
  49154. if (hour === 12) {
  49155. hour = 0;
  49156. }
  49157. if (meridiem === 'पहाटे' || meridiem === 'सकाळी') {
  49158. return hour;
  49159. } else if (
  49160. meridiem === 'दुपारी' ||
  49161. meridiem === 'सायंकाळी' ||
  49162. meridiem === 'रात्री'
  49163. ) {
  49164. return hour >= 12 ? hour : hour + 12;
  49165. }
  49166. },
  49167. meridiem: function (hour, minute, isLower) {
  49168. if (hour >= 0 && hour < 6) {
  49169. return 'पहाटे';
  49170. } else if (hour < 12) {
  49171. return 'सकाळी';
  49172. } else if (hour < 17) {
  49173. return 'दुपारी';
  49174. } else if (hour < 20) {
  49175. return 'सायंकाळी';
  49176. } else {
  49177. return 'रात्री';
  49178. }
  49179. },
  49180. week: {
  49181. dow: 0, // Sunday is the first day of the week.
  49182. doy: 6, // The week that contains Jan 6th is the first week of the year.
  49183. },
  49184. });
  49185. return mr;
  49186. })));
  49187. /***/ }),
  49188. /***/ "./node_modules/moment/locale/ms-my.js":
  49189. /*!*********************************************!*\
  49190. !*** ./node_modules/moment/locale/ms-my.js ***!
  49191. \*********************************************/
  49192. /*! no static exports found */
  49193. /***/ (function(module, exports, __webpack_require__) {
  49194. //! moment.js locale configuration
  49195. //! locale : Malay [ms-my]
  49196. //! note : DEPRECATED, the correct one is [ms]
  49197. //! author : Weldan Jamili : https://github.com/weldan
  49198. ;(function (global, factory) {
  49199. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  49200. undefined
  49201. }(this, (function (moment) { 'use strict';
  49202. //! moment.js locale configuration
  49203. var msMy = moment.defineLocale('ms-my', {
  49204. months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split(
  49205. '_'
  49206. ),
  49207. monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
  49208. weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
  49209. weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
  49210. weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
  49211. longDateFormat: {
  49212. LT: 'HH.mm',
  49213. LTS: 'HH.mm.ss',
  49214. L: 'DD/MM/YYYY',
  49215. LL: 'D MMMM YYYY',
  49216. LLL: 'D MMMM YYYY [pukul] HH.mm',
  49217. LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',
  49218. },
  49219. meridiemParse: /pagi|tengahari|petang|malam/,
  49220. meridiemHour: function (hour, meridiem) {
  49221. if (hour === 12) {
  49222. hour = 0;
  49223. }
  49224. if (meridiem === 'pagi') {
  49225. return hour;
  49226. } else if (meridiem === 'tengahari') {
  49227. return hour >= 11 ? hour : hour + 12;
  49228. } else if (meridiem === 'petang' || meridiem === 'malam') {
  49229. return hour + 12;
  49230. }
  49231. },
  49232. meridiem: function (hours, minutes, isLower) {
  49233. if (hours < 11) {
  49234. return 'pagi';
  49235. } else if (hours < 15) {
  49236. return 'tengahari';
  49237. } else if (hours < 19) {
  49238. return 'petang';
  49239. } else {
  49240. return 'malam';
  49241. }
  49242. },
  49243. calendar: {
  49244. sameDay: '[Hari ini pukul] LT',
  49245. nextDay: '[Esok pukul] LT',
  49246. nextWeek: 'dddd [pukul] LT',
  49247. lastDay: '[Kelmarin pukul] LT',
  49248. lastWeek: 'dddd [lepas pukul] LT',
  49249. sameElse: 'L',
  49250. },
  49251. relativeTime: {
  49252. future: 'dalam %s',
  49253. past: '%s yang lepas',
  49254. s: 'beberapa saat',
  49255. ss: '%d saat',
  49256. m: 'seminit',
  49257. mm: '%d minit',
  49258. h: 'sejam',
  49259. hh: '%d jam',
  49260. d: 'sehari',
  49261. dd: '%d hari',
  49262. M: 'sebulan',
  49263. MM: '%d bulan',
  49264. y: 'setahun',
  49265. yy: '%d tahun',
  49266. },
  49267. week: {
  49268. dow: 1, // Monday is the first day of the week.
  49269. doy: 7, // The week that contains Jan 7th is the first week of the year.
  49270. },
  49271. });
  49272. return msMy;
  49273. })));
  49274. /***/ }),
  49275. /***/ "./node_modules/moment/locale/ms.js":
  49276. /*!******************************************!*\
  49277. !*** ./node_modules/moment/locale/ms.js ***!
  49278. \******************************************/
  49279. /*! no static exports found */
  49280. /***/ (function(module, exports, __webpack_require__) {
  49281. //! moment.js locale configuration
  49282. //! locale : Malay [ms]
  49283. //! author : Weldan Jamili : https://github.com/weldan
  49284. ;(function (global, factory) {
  49285. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  49286. undefined
  49287. }(this, (function (moment) { 'use strict';
  49288. //! moment.js locale configuration
  49289. var ms = moment.defineLocale('ms', {
  49290. months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split(
  49291. '_'
  49292. ),
  49293. monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
  49294. weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
  49295. weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
  49296. weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
  49297. longDateFormat: {
  49298. LT: 'HH.mm',
  49299. LTS: 'HH.mm.ss',
  49300. L: 'DD/MM/YYYY',
  49301. LL: 'D MMMM YYYY',
  49302. LLL: 'D MMMM YYYY [pukul] HH.mm',
  49303. LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',
  49304. },
  49305. meridiemParse: /pagi|tengahari|petang|malam/,
  49306. meridiemHour: function (hour, meridiem) {
  49307. if (hour === 12) {
  49308. hour = 0;
  49309. }
  49310. if (meridiem === 'pagi') {
  49311. return hour;
  49312. } else if (meridiem === 'tengahari') {
  49313. return hour >= 11 ? hour : hour + 12;
  49314. } else if (meridiem === 'petang' || meridiem === 'malam') {
  49315. return hour + 12;
  49316. }
  49317. },
  49318. meridiem: function (hours, minutes, isLower) {
  49319. if (hours < 11) {
  49320. return 'pagi';
  49321. } else if (hours < 15) {
  49322. return 'tengahari';
  49323. } else if (hours < 19) {
  49324. return 'petang';
  49325. } else {
  49326. return 'malam';
  49327. }
  49328. },
  49329. calendar: {
  49330. sameDay: '[Hari ini pukul] LT',
  49331. nextDay: '[Esok pukul] LT',
  49332. nextWeek: 'dddd [pukul] LT',
  49333. lastDay: '[Kelmarin pukul] LT',
  49334. lastWeek: 'dddd [lepas pukul] LT',
  49335. sameElse: 'L',
  49336. },
  49337. relativeTime: {
  49338. future: 'dalam %s',
  49339. past: '%s yang lepas',
  49340. s: 'beberapa saat',
  49341. ss: '%d saat',
  49342. m: 'seminit',
  49343. mm: '%d minit',
  49344. h: 'sejam',
  49345. hh: '%d jam',
  49346. d: 'sehari',
  49347. dd: '%d hari',
  49348. M: 'sebulan',
  49349. MM: '%d bulan',
  49350. y: 'setahun',
  49351. yy: '%d tahun',
  49352. },
  49353. week: {
  49354. dow: 1, // Monday is the first day of the week.
  49355. doy: 7, // The week that contains Jan 7th is the first week of the year.
  49356. },
  49357. });
  49358. return ms;
  49359. })));
  49360. /***/ }),
  49361. /***/ "./node_modules/moment/locale/mt.js":
  49362. /*!******************************************!*\
  49363. !*** ./node_modules/moment/locale/mt.js ***!
  49364. \******************************************/
  49365. /*! no static exports found */
  49366. /***/ (function(module, exports, __webpack_require__) {
  49367. //! moment.js locale configuration
  49368. //! locale : Maltese (Malta) [mt]
  49369. //! author : Alessandro Maruccia : https://github.com/alesma
  49370. ;(function (global, factory) {
  49371. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  49372. undefined
  49373. }(this, (function (moment) { 'use strict';
  49374. //! moment.js locale configuration
  49375. var mt = moment.defineLocale('mt', {
  49376. months: 'Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru'.split(
  49377. '_'
  49378. ),
  49379. monthsShort: 'Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ'.split('_'),
  49380. weekdays: 'Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt'.split(
  49381. '_'
  49382. ),
  49383. weekdaysShort: 'Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib'.split('_'),
  49384. weekdaysMin: 'Ħa_Tn_Tl_Er_Ħa_Ġi_Si'.split('_'),
  49385. longDateFormat: {
  49386. LT: 'HH:mm',
  49387. LTS: 'HH:mm:ss',
  49388. L: 'DD/MM/YYYY',
  49389. LL: 'D MMMM YYYY',
  49390. LLL: 'D MMMM YYYY HH:mm',
  49391. LLLL: 'dddd, D MMMM YYYY HH:mm',
  49392. },
  49393. calendar: {
  49394. sameDay: '[Illum fil-]LT',
  49395. nextDay: '[Għada fil-]LT',
  49396. nextWeek: 'dddd [fil-]LT',
  49397. lastDay: '[Il-bieraħ fil-]LT',
  49398. lastWeek: 'dddd [li għadda] [fil-]LT',
  49399. sameElse: 'L',
  49400. },
  49401. relativeTime: {
  49402. future: 'f’ %s',
  49403. past: '%s ilu',
  49404. s: 'ftit sekondi',
  49405. ss: '%d sekondi',
  49406. m: 'minuta',
  49407. mm: '%d minuti',
  49408. h: 'siegħa',
  49409. hh: '%d siegħat',
  49410. d: 'ġurnata',
  49411. dd: '%d ġranet',
  49412. M: 'xahar',
  49413. MM: '%d xhur',
  49414. y: 'sena',
  49415. yy: '%d sni',
  49416. },
  49417. dayOfMonthOrdinalParse: /\d{1,2}º/,
  49418. ordinal: '%dº',
  49419. week: {
  49420. dow: 1, // Monday is the first day of the week.
  49421. doy: 4, // The week that contains Jan 4th is the first week of the year.
  49422. },
  49423. });
  49424. return mt;
  49425. })));
  49426. /***/ }),
  49427. /***/ "./node_modules/moment/locale/my.js":
  49428. /*!******************************************!*\
  49429. !*** ./node_modules/moment/locale/my.js ***!
  49430. \******************************************/
  49431. /*! no static exports found */
  49432. /***/ (function(module, exports, __webpack_require__) {
  49433. //! moment.js locale configuration
  49434. //! locale : Burmese [my]
  49435. //! author : Squar team, mysquar.com
  49436. //! author : David Rossellat : https://github.com/gholadr
  49437. //! author : Tin Aung Lin : https://github.com/thanyawzinmin
  49438. ;(function (global, factory) {
  49439. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  49440. undefined
  49441. }(this, (function (moment) { 'use strict';
  49442. //! moment.js locale configuration
  49443. var symbolMap = {
  49444. '1': '၁',
  49445. '2': '၂',
  49446. '3': '၃',
  49447. '4': '၄',
  49448. '5': '၅',
  49449. '6': '၆',
  49450. '7': '၇',
  49451. '8': '၈',
  49452. '9': '၉',
  49453. '0': '၀',
  49454. },
  49455. numberMap = {
  49456. '၁': '1',
  49457. '၂': '2',
  49458. '၃': '3',
  49459. '၄': '4',
  49460. '၅': '5',
  49461. '၆': '6',
  49462. '၇': '7',
  49463. '၈': '8',
  49464. '၉': '9',
  49465. '၀': '0',
  49466. };
  49467. var my = moment.defineLocale('my', {
  49468. months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split(
  49469. '_'
  49470. ),
  49471. monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),
  49472. weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split(
  49473. '_'
  49474. ),
  49475. weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
  49476. weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
  49477. longDateFormat: {
  49478. LT: 'HH:mm',
  49479. LTS: 'HH:mm:ss',
  49480. L: 'DD/MM/YYYY',
  49481. LL: 'D MMMM YYYY',
  49482. LLL: 'D MMMM YYYY HH:mm',
  49483. LLLL: 'dddd D MMMM YYYY HH:mm',
  49484. },
  49485. calendar: {
  49486. sameDay: '[ယနေ.] LT [မှာ]',
  49487. nextDay: '[မနက်ဖြန်] LT [မှာ]',
  49488. nextWeek: 'dddd LT [မှာ]',
  49489. lastDay: '[မနေ.က] LT [မှာ]',
  49490. lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]',
  49491. sameElse: 'L',
  49492. },
  49493. relativeTime: {
  49494. future: 'လာမည့် %s မှာ',
  49495. past: 'လွန်ခဲ့သော %s က',
  49496. s: 'စက္ကန်.အနည်းငယ်',
  49497. ss: '%d စက္ကန့်',
  49498. m: 'တစ်မိနစ်',
  49499. mm: '%d မိနစ်',
  49500. h: 'တစ်နာရီ',
  49501. hh: '%d နာရီ',
  49502. d: 'တစ်ရက်',
  49503. dd: '%d ရက်',
  49504. M: 'တစ်လ',
  49505. MM: '%d လ',
  49506. y: 'တစ်နှစ်',
  49507. yy: '%d နှစ်',
  49508. },
  49509. preparse: function (string) {
  49510. return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) {
  49511. return numberMap[match];
  49512. });
  49513. },
  49514. postformat: function (string) {
  49515. return string.replace(/\d/g, function (match) {
  49516. return symbolMap[match];
  49517. });
  49518. },
  49519. week: {
  49520. dow: 1, // Monday is the first day of the week.
  49521. doy: 4, // The week that contains Jan 4th is the first week of the year.
  49522. },
  49523. });
  49524. return my;
  49525. })));
  49526. /***/ }),
  49527. /***/ "./node_modules/moment/locale/nb.js":
  49528. /*!******************************************!*\
  49529. !*** ./node_modules/moment/locale/nb.js ***!
  49530. \******************************************/
  49531. /*! no static exports found */
  49532. /***/ (function(module, exports, __webpack_require__) {
  49533. //! moment.js locale configuration
  49534. //! locale : Norwegian Bokmål [nb]
  49535. //! authors : Espen Hovlandsdal : https://github.com/rexxars
  49536. //! Sigurd Gartmann : https://github.com/sigurdga
  49537. //! Stephen Ramthun : https://github.com/stephenramthun
  49538. ;(function (global, factory) {
  49539. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  49540. undefined
  49541. }(this, (function (moment) { 'use strict';
  49542. //! moment.js locale configuration
  49543. var nb = moment.defineLocale('nb', {
  49544. months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split(
  49545. '_'
  49546. ),
  49547. monthsShort: 'jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.'.split(
  49548. '_'
  49549. ),
  49550. monthsParseExact: true,
  49551. weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
  49552. weekdaysShort: 'sø._ma._ti._on._to._fr._lø.'.split('_'),
  49553. weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'),
  49554. weekdaysParseExact: true,
  49555. longDateFormat: {
  49556. LT: 'HH:mm',
  49557. LTS: 'HH:mm:ss',
  49558. L: 'DD.MM.YYYY',
  49559. LL: 'D. MMMM YYYY',
  49560. LLL: 'D. MMMM YYYY [kl.] HH:mm',
  49561. LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm',
  49562. },
  49563. calendar: {
  49564. sameDay: '[i dag kl.] LT',
  49565. nextDay: '[i morgen kl.] LT',
  49566. nextWeek: 'dddd [kl.] LT',
  49567. lastDay: '[i går kl.] LT',
  49568. lastWeek: '[forrige] dddd [kl.] LT',
  49569. sameElse: 'L',
  49570. },
  49571. relativeTime: {
  49572. future: 'om %s',
  49573. past: '%s siden',
  49574. s: 'noen sekunder',
  49575. ss: '%d sekunder',
  49576. m: 'ett minutt',
  49577. mm: '%d minutter',
  49578. h: 'en time',
  49579. hh: '%d timer',
  49580. d: 'en dag',
  49581. dd: '%d dager',
  49582. M: 'en måned',
  49583. MM: '%d måneder',
  49584. y: 'ett år',
  49585. yy: '%d år',
  49586. },
  49587. dayOfMonthOrdinalParse: /\d{1,2}\./,
  49588. ordinal: '%d.',
  49589. week: {
  49590. dow: 1, // Monday is the first day of the week.
  49591. doy: 4, // The week that contains Jan 4th is the first week of the year.
  49592. },
  49593. });
  49594. return nb;
  49595. })));
  49596. /***/ }),
  49597. /***/ "./node_modules/moment/locale/ne.js":
  49598. /*!******************************************!*\
  49599. !*** ./node_modules/moment/locale/ne.js ***!
  49600. \******************************************/
  49601. /*! no static exports found */
  49602. /***/ (function(module, exports, __webpack_require__) {
  49603. //! moment.js locale configuration
  49604. //! locale : Nepalese [ne]
  49605. //! author : suvash : https://github.com/suvash
  49606. ;(function (global, factory) {
  49607. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  49608. undefined
  49609. }(this, (function (moment) { 'use strict';
  49610. //! moment.js locale configuration
  49611. var symbolMap = {
  49612. '1': '१',
  49613. '2': '२',
  49614. '3': '३',
  49615. '4': '४',
  49616. '5': '५',
  49617. '6': '६',
  49618. '7': '७',
  49619. '8': '८',
  49620. '9': '९',
  49621. '0': '०',
  49622. },
  49623. numberMap = {
  49624. '१': '1',
  49625. '२': '2',
  49626. '३': '3',
  49627. '४': '4',
  49628. '५': '5',
  49629. '६': '6',
  49630. '७': '7',
  49631. '८': '8',
  49632. '९': '9',
  49633. '०': '0',
  49634. };
  49635. var ne = moment.defineLocale('ne', {
  49636. months: 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split(
  49637. '_'
  49638. ),
  49639. monthsShort: 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split(
  49640. '_'
  49641. ),
  49642. monthsParseExact: true,
  49643. weekdays: 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split(
  49644. '_'
  49645. ),
  49646. weekdaysShort: 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'),
  49647. weekdaysMin: 'आ._सो._मं._बु._बि._शु._श.'.split('_'),
  49648. weekdaysParseExact: true,
  49649. longDateFormat: {
  49650. LT: 'Aको h:mm बजे',
  49651. LTS: 'Aको h:mm:ss बजे',
  49652. L: 'DD/MM/YYYY',
  49653. LL: 'D MMMM YYYY',
  49654. LLL: 'D MMMM YYYY, Aको h:mm बजे',
  49655. LLLL: 'dddd, D MMMM YYYY, Aको h:mm बजे',
  49656. },
  49657. preparse: function (string) {
  49658. return string.replace(/[१२३४५६७८९०]/g, function (match) {
  49659. return numberMap[match];
  49660. });
  49661. },
  49662. postformat: function (string) {
  49663. return string.replace(/\d/g, function (match) {
  49664. return symbolMap[match];
  49665. });
  49666. },
  49667. meridiemParse: /राति|बिहान|दिउँसो|साँझ/,
  49668. meridiemHour: function (hour, meridiem) {
  49669. if (hour === 12) {
  49670. hour = 0;
  49671. }
  49672. if (meridiem === 'राति') {
  49673. return hour < 4 ? hour : hour + 12;
  49674. } else if (meridiem === 'बिहान') {
  49675. return hour;
  49676. } else if (meridiem === 'दिउँसो') {
  49677. return hour >= 10 ? hour : hour + 12;
  49678. } else if (meridiem === 'साँझ') {
  49679. return hour + 12;
  49680. }
  49681. },
  49682. meridiem: function (hour, minute, isLower) {
  49683. if (hour < 3) {
  49684. return 'राति';
  49685. } else if (hour < 12) {
  49686. return 'बिहान';
  49687. } else if (hour < 16) {
  49688. return 'दिउँसो';
  49689. } else if (hour < 20) {
  49690. return 'साँझ';
  49691. } else {
  49692. return 'राति';
  49693. }
  49694. },
  49695. calendar: {
  49696. sameDay: '[आज] LT',
  49697. nextDay: '[भोलि] LT',
  49698. nextWeek: '[आउँदो] dddd[,] LT',
  49699. lastDay: '[हिजो] LT',
  49700. lastWeek: '[गएको] dddd[,] LT',
  49701. sameElse: 'L',
  49702. },
  49703. relativeTime: {
  49704. future: '%sमा',
  49705. past: '%s अगाडि',
  49706. s: 'केही क्षण',
  49707. ss: '%d सेकेण्ड',
  49708. m: 'एक मिनेट',
  49709. mm: '%d मिनेट',
  49710. h: 'एक घण्टा',
  49711. hh: '%d घण्टा',
  49712. d: 'एक दिन',
  49713. dd: '%d दिन',
  49714. M: 'एक महिना',
  49715. MM: '%d महिना',
  49716. y: 'एक बर्ष',
  49717. yy: '%d बर्ष',
  49718. },
  49719. week: {
  49720. dow: 0, // Sunday is the first day of the week.
  49721. doy: 6, // The week that contains Jan 6th is the first week of the year.
  49722. },
  49723. });
  49724. return ne;
  49725. })));
  49726. /***/ }),
  49727. /***/ "./node_modules/moment/locale/nl-be.js":
  49728. /*!*********************************************!*\
  49729. !*** ./node_modules/moment/locale/nl-be.js ***!
  49730. \*********************************************/
  49731. /*! no static exports found */
  49732. /***/ (function(module, exports, __webpack_require__) {
  49733. //! moment.js locale configuration
  49734. //! locale : Dutch (Belgium) [nl-be]
  49735. //! author : Joris Röling : https://github.com/jorisroling
  49736. //! author : Jacob Middag : https://github.com/middagj
  49737. ;(function (global, factory) {
  49738. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  49739. undefined
  49740. }(this, (function (moment) { 'use strict';
  49741. //! moment.js locale configuration
  49742. var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split(
  49743. '_'
  49744. ),
  49745. monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split(
  49746. '_'
  49747. ),
  49748. monthsParse = [
  49749. /^jan/i,
  49750. /^feb/i,
  49751. /^maart|mrt.?$/i,
  49752. /^apr/i,
  49753. /^mei$/i,
  49754. /^jun[i.]?$/i,
  49755. /^jul[i.]?$/i,
  49756. /^aug/i,
  49757. /^sep/i,
  49758. /^okt/i,
  49759. /^nov/i,
  49760. /^dec/i,
  49761. ],
  49762. monthsRegex = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;
  49763. var nlBe = moment.defineLocale('nl-be', {
  49764. months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split(
  49765. '_'
  49766. ),
  49767. monthsShort: function (m, format) {
  49768. if (!m) {
  49769. return monthsShortWithDots;
  49770. } else if (/-MMM-/.test(format)) {
  49771. return monthsShortWithoutDots[m.month()];
  49772. } else {
  49773. return monthsShortWithDots[m.month()];
  49774. }
  49775. },
  49776. monthsRegex: monthsRegex,
  49777. monthsShortRegex: monthsRegex,
  49778. monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,
  49779. monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
  49780. monthsParse: monthsParse,
  49781. longMonthsParse: monthsParse,
  49782. shortMonthsParse: monthsParse,
  49783. weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split(
  49784. '_'
  49785. ),
  49786. weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),
  49787. weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),
  49788. weekdaysParseExact: true,
  49789. longDateFormat: {
  49790. LT: 'HH:mm',
  49791. LTS: 'HH:mm:ss',
  49792. L: 'DD/MM/YYYY',
  49793. LL: 'D MMMM YYYY',
  49794. LLL: 'D MMMM YYYY HH:mm',
  49795. LLLL: 'dddd D MMMM YYYY HH:mm',
  49796. },
  49797. calendar: {
  49798. sameDay: '[vandaag om] LT',
  49799. nextDay: '[morgen om] LT',
  49800. nextWeek: 'dddd [om] LT',
  49801. lastDay: '[gisteren om] LT',
  49802. lastWeek: '[afgelopen] dddd [om] LT',
  49803. sameElse: 'L',
  49804. },
  49805. relativeTime: {
  49806. future: 'over %s',
  49807. past: '%s geleden',
  49808. s: 'een paar seconden',
  49809. ss: '%d seconden',
  49810. m: 'één minuut',
  49811. mm: '%d minuten',
  49812. h: 'één uur',
  49813. hh: '%d uur',
  49814. d: 'één dag',
  49815. dd: '%d dagen',
  49816. M: 'één maand',
  49817. MM: '%d maanden',
  49818. y: 'één jaar',
  49819. yy: '%d jaar',
  49820. },
  49821. dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
  49822. ordinal: function (number) {
  49823. return (
  49824. number +
  49825. (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')
  49826. );
  49827. },
  49828. week: {
  49829. dow: 1, // Monday is the first day of the week.
  49830. doy: 4, // The week that contains Jan 4th is the first week of the year.
  49831. },
  49832. });
  49833. return nlBe;
  49834. })));
  49835. /***/ }),
  49836. /***/ "./node_modules/moment/locale/nl.js":
  49837. /*!******************************************!*\
  49838. !*** ./node_modules/moment/locale/nl.js ***!
  49839. \******************************************/
  49840. /*! no static exports found */
  49841. /***/ (function(module, exports, __webpack_require__) {
  49842. //! moment.js locale configuration
  49843. //! locale : Dutch [nl]
  49844. //! author : Joris Röling : https://github.com/jorisroling
  49845. //! author : Jacob Middag : https://github.com/middagj
  49846. ;(function (global, factory) {
  49847. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  49848. undefined
  49849. }(this, (function (moment) { 'use strict';
  49850. //! moment.js locale configuration
  49851. var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split(
  49852. '_'
  49853. ),
  49854. monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split(
  49855. '_'
  49856. ),
  49857. monthsParse = [
  49858. /^jan/i,
  49859. /^feb/i,
  49860. /^maart|mrt.?$/i,
  49861. /^apr/i,
  49862. /^mei$/i,
  49863. /^jun[i.]?$/i,
  49864. /^jul[i.]?$/i,
  49865. /^aug/i,
  49866. /^sep/i,
  49867. /^okt/i,
  49868. /^nov/i,
  49869. /^dec/i,
  49870. ],
  49871. monthsRegex = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;
  49872. var nl = moment.defineLocale('nl', {
  49873. months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split(
  49874. '_'
  49875. ),
  49876. monthsShort: function (m, format) {
  49877. if (!m) {
  49878. return monthsShortWithDots;
  49879. } else if (/-MMM-/.test(format)) {
  49880. return monthsShortWithoutDots[m.month()];
  49881. } else {
  49882. return monthsShortWithDots[m.month()];
  49883. }
  49884. },
  49885. monthsRegex: monthsRegex,
  49886. monthsShortRegex: monthsRegex,
  49887. monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,
  49888. monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
  49889. monthsParse: monthsParse,
  49890. longMonthsParse: monthsParse,
  49891. shortMonthsParse: monthsParse,
  49892. weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split(
  49893. '_'
  49894. ),
  49895. weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),
  49896. weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),
  49897. weekdaysParseExact: true,
  49898. longDateFormat: {
  49899. LT: 'HH:mm',
  49900. LTS: 'HH:mm:ss',
  49901. L: 'DD-MM-YYYY',
  49902. LL: 'D MMMM YYYY',
  49903. LLL: 'D MMMM YYYY HH:mm',
  49904. LLLL: 'dddd D MMMM YYYY HH:mm',
  49905. },
  49906. calendar: {
  49907. sameDay: '[vandaag om] LT',
  49908. nextDay: '[morgen om] LT',
  49909. nextWeek: 'dddd [om] LT',
  49910. lastDay: '[gisteren om] LT',
  49911. lastWeek: '[afgelopen] dddd [om] LT',
  49912. sameElse: 'L',
  49913. },
  49914. relativeTime: {
  49915. future: 'over %s',
  49916. past: '%s geleden',
  49917. s: 'een paar seconden',
  49918. ss: '%d seconden',
  49919. m: 'één minuut',
  49920. mm: '%d minuten',
  49921. h: 'één uur',
  49922. hh: '%d uur',
  49923. d: 'één dag',
  49924. dd: '%d dagen',
  49925. M: 'één maand',
  49926. MM: '%d maanden',
  49927. y: 'één jaar',
  49928. yy: '%d jaar',
  49929. },
  49930. dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
  49931. ordinal: function (number) {
  49932. return (
  49933. number +
  49934. (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')
  49935. );
  49936. },
  49937. week: {
  49938. dow: 1, // Monday is the first day of the week.
  49939. doy: 4, // The week that contains Jan 4th is the first week of the year.
  49940. },
  49941. });
  49942. return nl;
  49943. })));
  49944. /***/ }),
  49945. /***/ "./node_modules/moment/locale/nn.js":
  49946. /*!******************************************!*\
  49947. !*** ./node_modules/moment/locale/nn.js ***!
  49948. \******************************************/
  49949. /*! no static exports found */
  49950. /***/ (function(module, exports, __webpack_require__) {
  49951. //! moment.js locale configuration
  49952. //! locale : Nynorsk [nn]
  49953. //! authors : https://github.com/mechuwind
  49954. //! Stephen Ramthun : https://github.com/stephenramthun
  49955. ;(function (global, factory) {
  49956. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  49957. undefined
  49958. }(this, (function (moment) { 'use strict';
  49959. //! moment.js locale configuration
  49960. var nn = moment.defineLocale('nn', {
  49961. months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split(
  49962. '_'
  49963. ),
  49964. monthsShort: 'jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.'.split(
  49965. '_'
  49966. ),
  49967. monthsParseExact: true,
  49968. weekdays: 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'),
  49969. weekdaysShort: 'su._må._ty._on._to._fr._lau.'.split('_'),
  49970. weekdaysMin: 'su_må_ty_on_to_fr_la'.split('_'),
  49971. weekdaysParseExact: true,
  49972. longDateFormat: {
  49973. LT: 'HH:mm',
  49974. LTS: 'HH:mm:ss',
  49975. L: 'DD.MM.YYYY',
  49976. LL: 'D. MMMM YYYY',
  49977. LLL: 'D. MMMM YYYY [kl.] H:mm',
  49978. LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm',
  49979. },
  49980. calendar: {
  49981. sameDay: '[I dag klokka] LT',
  49982. nextDay: '[I morgon klokka] LT',
  49983. nextWeek: 'dddd [klokka] LT',
  49984. lastDay: '[I går klokka] LT',
  49985. lastWeek: '[Føregåande] dddd [klokka] LT',
  49986. sameElse: 'L',
  49987. },
  49988. relativeTime: {
  49989. future: 'om %s',
  49990. past: '%s sidan',
  49991. s: 'nokre sekund',
  49992. ss: '%d sekund',
  49993. m: 'eit minutt',
  49994. mm: '%d minutt',
  49995. h: 'ein time',
  49996. hh: '%d timar',
  49997. d: 'ein dag',
  49998. dd: '%d dagar',
  49999. M: 'ein månad',
  50000. MM: '%d månader',
  50001. y: 'eit år',
  50002. yy: '%d år',
  50003. },
  50004. dayOfMonthOrdinalParse: /\d{1,2}\./,
  50005. ordinal: '%d.',
  50006. week: {
  50007. dow: 1, // Monday is the first day of the week.
  50008. doy: 4, // The week that contains Jan 4th is the first week of the year.
  50009. },
  50010. });
  50011. return nn;
  50012. })));
  50013. /***/ }),
  50014. /***/ "./node_modules/moment/locale/oc-lnc.js":
  50015. /*!**********************************************!*\
  50016. !*** ./node_modules/moment/locale/oc-lnc.js ***!
  50017. \**********************************************/
  50018. /*! no static exports found */
  50019. /***/ (function(module, exports, __webpack_require__) {
  50020. //! moment.js locale configuration
  50021. //! locale : Occitan, lengadocian dialecte [oc-lnc]
  50022. //! author : Quentin PAGÈS : https://github.com/Quenty31
  50023. ;(function (global, factory) {
  50024. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  50025. undefined
  50026. }(this, (function (moment) { 'use strict';
  50027. //! moment.js locale configuration
  50028. var ocLnc = moment.defineLocale('oc-lnc', {
  50029. months: {
  50030. standalone: 'genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre'.split(
  50031. '_'
  50032. ),
  50033. format: "de genièr_de febrièr_de març_d'abril_de mai_de junh_de julhet_d'agost_de setembre_d'octòbre_de novembre_de decembre".split(
  50034. '_'
  50035. ),
  50036. isFormat: /D[oD]?(\s)+MMMM/,
  50037. },
  50038. monthsShort: 'gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.'.split(
  50039. '_'
  50040. ),
  50041. monthsParseExact: true,
  50042. weekdays: 'dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte'.split(
  50043. '_'
  50044. ),
  50045. weekdaysShort: 'dg._dl._dm._dc._dj._dv._ds.'.split('_'),
  50046. weekdaysMin: 'dg_dl_dm_dc_dj_dv_ds'.split('_'),
  50047. weekdaysParseExact: true,
  50048. longDateFormat: {
  50049. LT: 'H:mm',
  50050. LTS: 'H:mm:ss',
  50051. L: 'DD/MM/YYYY',
  50052. LL: 'D MMMM [de] YYYY',
  50053. ll: 'D MMM YYYY',
  50054. LLL: 'D MMMM [de] YYYY [a] H:mm',
  50055. lll: 'D MMM YYYY, H:mm',
  50056. LLLL: 'dddd D MMMM [de] YYYY [a] H:mm',
  50057. llll: 'ddd D MMM YYYY, H:mm',
  50058. },
  50059. calendar: {
  50060. sameDay: '[uèi a] LT',
  50061. nextDay: '[deman a] LT',
  50062. nextWeek: 'dddd [a] LT',
  50063. lastDay: '[ièr a] LT',
  50064. lastWeek: 'dddd [passat a] LT',
  50065. sameElse: 'L',
  50066. },
  50067. relativeTime: {
  50068. future: "d'aquí %s",
  50069. past: 'fa %s',
  50070. s: 'unas segondas',
  50071. ss: '%d segondas',
  50072. m: 'una minuta',
  50073. mm: '%d minutas',
  50074. h: 'una ora',
  50075. hh: '%d oras',
  50076. d: 'un jorn',
  50077. dd: '%d jorns',
  50078. M: 'un mes',
  50079. MM: '%d meses',
  50080. y: 'un an',
  50081. yy: '%d ans',
  50082. },
  50083. dayOfMonthOrdinalParse: /\d{1,2}(r|n|t|è|a)/,
  50084. ordinal: function (number, period) {
  50085. var output =
  50086. number === 1
  50087. ? 'r'
  50088. : number === 2
  50089. ? 'n'
  50090. : number === 3
  50091. ? 'r'
  50092. : number === 4
  50093. ? 't'
  50094. : 'è';
  50095. if (period === 'w' || period === 'W') {
  50096. output = 'a';
  50097. }
  50098. return number + output;
  50099. },
  50100. week: {
  50101. dow: 1, // Monday is the first day of the week.
  50102. doy: 4,
  50103. },
  50104. });
  50105. return ocLnc;
  50106. })));
  50107. /***/ }),
  50108. /***/ "./node_modules/moment/locale/pa-in.js":
  50109. /*!*********************************************!*\
  50110. !*** ./node_modules/moment/locale/pa-in.js ***!
  50111. \*********************************************/
  50112. /*! no static exports found */
  50113. /***/ (function(module, exports, __webpack_require__) {
  50114. //! moment.js locale configuration
  50115. //! locale : Punjabi (India) [pa-in]
  50116. //! author : Harpreet Singh : https://github.com/harpreetkhalsagtbit
  50117. ;(function (global, factory) {
  50118. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  50119. undefined
  50120. }(this, (function (moment) { 'use strict';
  50121. //! moment.js locale configuration
  50122. var symbolMap = {
  50123. '1': '੧',
  50124. '2': '੨',
  50125. '3': '੩',
  50126. '4': '੪',
  50127. '5': '੫',
  50128. '6': '੬',
  50129. '7': '੭',
  50130. '8': '੮',
  50131. '9': '੯',
  50132. '0': '੦',
  50133. },
  50134. numberMap = {
  50135. '੧': '1',
  50136. '੨': '2',
  50137. '੩': '3',
  50138. '੪': '4',
  50139. '੫': '5',
  50140. '੬': '6',
  50141. '੭': '7',
  50142. '੮': '8',
  50143. '੯': '9',
  50144. '੦': '0',
  50145. };
  50146. var paIn = moment.defineLocale('pa-in', {
  50147. // There are months name as per Nanakshahi Calendar but they are not used as rigidly in modern Punjabi.
  50148. months: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split(
  50149. '_'
  50150. ),
  50151. monthsShort: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split(
  50152. '_'
  50153. ),
  50154. weekdays: 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split(
  50155. '_'
  50156. ),
  50157. weekdaysShort: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
  50158. weekdaysMin: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
  50159. longDateFormat: {
  50160. LT: 'A h:mm ਵਜੇ',
  50161. LTS: 'A h:mm:ss ਵਜੇ',
  50162. L: 'DD/MM/YYYY',
  50163. LL: 'D MMMM YYYY',
  50164. LLL: 'D MMMM YYYY, A h:mm ਵਜੇ',
  50165. LLLL: 'dddd, D MMMM YYYY, A h:mm ਵਜੇ',
  50166. },
  50167. calendar: {
  50168. sameDay: '[ਅਜ] LT',
  50169. nextDay: '[ਕਲ] LT',
  50170. nextWeek: '[ਅਗਲਾ] dddd, LT',
  50171. lastDay: '[ਕਲ] LT',
  50172. lastWeek: '[ਪਿਛਲੇ] dddd, LT',
  50173. sameElse: 'L',
  50174. },
  50175. relativeTime: {
  50176. future: '%s ਵਿੱਚ',
  50177. past: '%s ਪਿਛਲੇ',
  50178. s: 'ਕੁਝ ਸਕਿੰਟ',
  50179. ss: '%d ਸਕਿੰਟ',
  50180. m: 'ਇਕ ਮਿੰਟ',
  50181. mm: '%d ਮਿੰਟ',
  50182. h: 'ਇੱਕ ਘੰਟਾ',
  50183. hh: '%d ਘੰਟੇ',
  50184. d: 'ਇੱਕ ਦਿਨ',
  50185. dd: '%d ਦਿਨ',
  50186. M: 'ਇੱਕ ਮਹੀਨਾ',
  50187. MM: '%d ਮਹੀਨੇ',
  50188. y: 'ਇੱਕ ਸਾਲ',
  50189. yy: '%d ਸਾਲ',
  50190. },
  50191. preparse: function (string) {
  50192. return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) {
  50193. return numberMap[match];
  50194. });
  50195. },
  50196. postformat: function (string) {
  50197. return string.replace(/\d/g, function (match) {
  50198. return symbolMap[match];
  50199. });
  50200. },
  50201. // Punjabi notation for meridiems are quite fuzzy in practice. While there exists
  50202. // a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi.
  50203. meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,
  50204. meridiemHour: function (hour, meridiem) {
  50205. if (hour === 12) {
  50206. hour = 0;
  50207. }
  50208. if (meridiem === 'ਰਾਤ') {
  50209. return hour < 4 ? hour : hour + 12;
  50210. } else if (meridiem === 'ਸਵੇਰ') {
  50211. return hour;
  50212. } else if (meridiem === 'ਦੁਪਹਿਰ') {
  50213. return hour >= 10 ? hour : hour + 12;
  50214. } else if (meridiem === 'ਸ਼ਾਮ') {
  50215. return hour + 12;
  50216. }
  50217. },
  50218. meridiem: function (hour, minute, isLower) {
  50219. if (hour < 4) {
  50220. return 'ਰਾਤ';
  50221. } else if (hour < 10) {
  50222. return 'ਸਵੇਰ';
  50223. } else if (hour < 17) {
  50224. return 'ਦੁਪਹਿਰ';
  50225. } else if (hour < 20) {
  50226. return 'ਸ਼ਾਮ';
  50227. } else {
  50228. return 'ਰਾਤ';
  50229. }
  50230. },
  50231. week: {
  50232. dow: 0, // Sunday is the first day of the week.
  50233. doy: 6, // The week that contains Jan 6th is the first week of the year.
  50234. },
  50235. });
  50236. return paIn;
  50237. })));
  50238. /***/ }),
  50239. /***/ "./node_modules/moment/locale/pl.js":
  50240. /*!******************************************!*\
  50241. !*** ./node_modules/moment/locale/pl.js ***!
  50242. \******************************************/
  50243. /*! no static exports found */
  50244. /***/ (function(module, exports, __webpack_require__) {
  50245. //! moment.js locale configuration
  50246. //! locale : Polish [pl]
  50247. //! author : Rafal Hirsz : https://github.com/evoL
  50248. ;(function (global, factory) {
  50249. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  50250. undefined
  50251. }(this, (function (moment) { 'use strict';
  50252. //! moment.js locale configuration
  50253. var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split(
  50254. '_'
  50255. ),
  50256. monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split(
  50257. '_'
  50258. );
  50259. function plural(n) {
  50260. return n % 10 < 5 && n % 10 > 1 && ~~(n / 10) % 10 !== 1;
  50261. }
  50262. function translate(number, withoutSuffix, key) {
  50263. var result = number + ' ';
  50264. switch (key) {
  50265. case 'ss':
  50266. return result + (plural(number) ? 'sekundy' : 'sekund');
  50267. case 'm':
  50268. return withoutSuffix ? 'minuta' : 'minutę';
  50269. case 'mm':
  50270. return result + (plural(number) ? 'minuty' : 'minut');
  50271. case 'h':
  50272. return withoutSuffix ? 'godzina' : 'godzinę';
  50273. case 'hh':
  50274. return result + (plural(number) ? 'godziny' : 'godzin');
  50275. case 'MM':
  50276. return result + (plural(number) ? 'miesiące' : 'miesięcy');
  50277. case 'yy':
  50278. return result + (plural(number) ? 'lata' : 'lat');
  50279. }
  50280. }
  50281. var pl = moment.defineLocale('pl', {
  50282. months: function (momentToFormat, format) {
  50283. if (!momentToFormat) {
  50284. return monthsNominative;
  50285. } else if (format === '') {
  50286. // Hack: if format empty we know this is used to generate
  50287. // RegExp by moment. Give then back both valid forms of months
  50288. // in RegExp ready format.
  50289. return (
  50290. '(' +
  50291. monthsSubjective[momentToFormat.month()] +
  50292. '|' +
  50293. monthsNominative[momentToFormat.month()] +
  50294. ')'
  50295. );
  50296. } else if (/D MMMM/.test(format)) {
  50297. return monthsSubjective[momentToFormat.month()];
  50298. } else {
  50299. return monthsNominative[momentToFormat.month()];
  50300. }
  50301. },
  50302. monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),
  50303. weekdays: 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split(
  50304. '_'
  50305. ),
  50306. weekdaysShort: 'ndz_pon_wt_śr_czw_pt_sob'.split('_'),
  50307. weekdaysMin: 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),
  50308. longDateFormat: {
  50309. LT: 'HH:mm',
  50310. LTS: 'HH:mm:ss',
  50311. L: 'DD.MM.YYYY',
  50312. LL: 'D MMMM YYYY',
  50313. LLL: 'D MMMM YYYY HH:mm',
  50314. LLLL: 'dddd, D MMMM YYYY HH:mm',
  50315. },
  50316. calendar: {
  50317. sameDay: '[Dziś o] LT',
  50318. nextDay: '[Jutro o] LT',
  50319. nextWeek: function () {
  50320. switch (this.day()) {
  50321. case 0:
  50322. return '[W niedzielę o] LT';
  50323. case 2:
  50324. return '[We wtorek o] LT';
  50325. case 3:
  50326. return '[W środę o] LT';
  50327. case 6:
  50328. return '[W sobotę o] LT';
  50329. default:
  50330. return '[W] dddd [o] LT';
  50331. }
  50332. },
  50333. lastDay: '[Wczoraj o] LT',
  50334. lastWeek: function () {
  50335. switch (this.day()) {
  50336. case 0:
  50337. return '[W zeszłą niedzielę o] LT';
  50338. case 3:
  50339. return '[W zeszłą środę o] LT';
  50340. case 6:
  50341. return '[W zeszłą sobotę o] LT';
  50342. default:
  50343. return '[W zeszły] dddd [o] LT';
  50344. }
  50345. },
  50346. sameElse: 'L',
  50347. },
  50348. relativeTime: {
  50349. future: 'za %s',
  50350. past: '%s temu',
  50351. s: 'kilka sekund',
  50352. ss: translate,
  50353. m: translate,
  50354. mm: translate,
  50355. h: translate,
  50356. hh: translate,
  50357. d: '1 dzień',
  50358. dd: '%d dni',
  50359. M: 'miesiąc',
  50360. MM: translate,
  50361. y: 'rok',
  50362. yy: translate,
  50363. },
  50364. dayOfMonthOrdinalParse: /\d{1,2}\./,
  50365. ordinal: '%d.',
  50366. week: {
  50367. dow: 1, // Monday is the first day of the week.
  50368. doy: 4, // The week that contains Jan 4th is the first week of the year.
  50369. },
  50370. });
  50371. return pl;
  50372. })));
  50373. /***/ }),
  50374. /***/ "./node_modules/moment/locale/pt-br.js":
  50375. /*!*********************************************!*\
  50376. !*** ./node_modules/moment/locale/pt-br.js ***!
  50377. \*********************************************/
  50378. /*! no static exports found */
  50379. /***/ (function(module, exports, __webpack_require__) {
  50380. //! moment.js locale configuration
  50381. //! locale : Portuguese (Brazil) [pt-br]
  50382. //! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira
  50383. ;(function (global, factory) {
  50384. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  50385. undefined
  50386. }(this, (function (moment) { 'use strict';
  50387. //! moment.js locale configuration
  50388. var ptBr = moment.defineLocale('pt-br', {
  50389. months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split(
  50390. '_'
  50391. ),
  50392. monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),
  50393. weekdays: 'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split(
  50394. '_'
  50395. ),
  50396. weekdaysShort: 'dom_seg_ter_qua_qui_sex_sáb'.split('_'),
  50397. weekdaysMin: 'do_2ª_3ª_4ª_5ª_6ª_sá'.split('_'),
  50398. weekdaysParseExact: true,
  50399. longDateFormat: {
  50400. LT: 'HH:mm',
  50401. LTS: 'HH:mm:ss',
  50402. L: 'DD/MM/YYYY',
  50403. LL: 'D [de] MMMM [de] YYYY',
  50404. LLL: 'D [de] MMMM [de] YYYY [às] HH:mm',
  50405. LLLL: 'dddd, D [de] MMMM [de] YYYY [às] HH:mm',
  50406. },
  50407. calendar: {
  50408. sameDay: '[Hoje às] LT',
  50409. nextDay: '[Amanhã às] LT',
  50410. nextWeek: 'dddd [às] LT',
  50411. lastDay: '[Ontem às] LT',
  50412. lastWeek: function () {
  50413. return this.day() === 0 || this.day() === 6
  50414. ? '[Último] dddd [às] LT' // Saturday + Sunday
  50415. : '[Última] dddd [às] LT'; // Monday - Friday
  50416. },
  50417. sameElse: 'L',
  50418. },
  50419. relativeTime: {
  50420. future: 'em %s',
  50421. past: 'há %s',
  50422. s: 'poucos segundos',
  50423. ss: '%d segundos',
  50424. m: 'um minuto',
  50425. mm: '%d minutos',
  50426. h: 'uma hora',
  50427. hh: '%d horas',
  50428. d: 'um dia',
  50429. dd: '%d dias',
  50430. M: 'um mês',
  50431. MM: '%d meses',
  50432. y: 'um ano',
  50433. yy: '%d anos',
  50434. },
  50435. dayOfMonthOrdinalParse: /\d{1,2}º/,
  50436. ordinal: '%dº',
  50437. });
  50438. return ptBr;
  50439. })));
  50440. /***/ }),
  50441. /***/ "./node_modules/moment/locale/pt.js":
  50442. /*!******************************************!*\
  50443. !*** ./node_modules/moment/locale/pt.js ***!
  50444. \******************************************/
  50445. /*! no static exports found */
  50446. /***/ (function(module, exports, __webpack_require__) {
  50447. //! moment.js locale configuration
  50448. //! locale : Portuguese [pt]
  50449. //! author : Jefferson : https://github.com/jalex79
  50450. ;(function (global, factory) {
  50451. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  50452. undefined
  50453. }(this, (function (moment) { 'use strict';
  50454. //! moment.js locale configuration
  50455. var pt = moment.defineLocale('pt', {
  50456. months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split(
  50457. '_'
  50458. ),
  50459. monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),
  50460. weekdays: 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split(
  50461. '_'
  50462. ),
  50463. weekdaysShort: 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
  50464. weekdaysMin: 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'),
  50465. weekdaysParseExact: true,
  50466. longDateFormat: {
  50467. LT: 'HH:mm',
  50468. LTS: 'HH:mm:ss',
  50469. L: 'DD/MM/YYYY',
  50470. LL: 'D [de] MMMM [de] YYYY',
  50471. LLL: 'D [de] MMMM [de] YYYY HH:mm',
  50472. LLLL: 'dddd, D [de] MMMM [de] YYYY HH:mm',
  50473. },
  50474. calendar: {
  50475. sameDay: '[Hoje às] LT',
  50476. nextDay: '[Amanhã às] LT',
  50477. nextWeek: 'dddd [às] LT',
  50478. lastDay: '[Ontem às] LT',
  50479. lastWeek: function () {
  50480. return this.day() === 0 || this.day() === 6
  50481. ? '[Último] dddd [às] LT' // Saturday + Sunday
  50482. : '[Última] dddd [às] LT'; // Monday - Friday
  50483. },
  50484. sameElse: 'L',
  50485. },
  50486. relativeTime: {
  50487. future: 'em %s',
  50488. past: 'há %s',
  50489. s: 'segundos',
  50490. ss: '%d segundos',
  50491. m: 'um minuto',
  50492. mm: '%d minutos',
  50493. h: 'uma hora',
  50494. hh: '%d horas',
  50495. d: 'um dia',
  50496. dd: '%d dias',
  50497. M: 'um mês',
  50498. MM: '%d meses',
  50499. y: 'um ano',
  50500. yy: '%d anos',
  50501. },
  50502. dayOfMonthOrdinalParse: /\d{1,2}º/,
  50503. ordinal: '%dº',
  50504. week: {
  50505. dow: 1, // Monday is the first day of the week.
  50506. doy: 4, // The week that contains Jan 4th is the first week of the year.
  50507. },
  50508. });
  50509. return pt;
  50510. })));
  50511. /***/ }),
  50512. /***/ "./node_modules/moment/locale/ro.js":
  50513. /*!******************************************!*\
  50514. !*** ./node_modules/moment/locale/ro.js ***!
  50515. \******************************************/
  50516. /*! no static exports found */
  50517. /***/ (function(module, exports, __webpack_require__) {
  50518. //! moment.js locale configuration
  50519. //! locale : Romanian [ro]
  50520. //! author : Vlad Gurdiga : https://github.com/gurdiga
  50521. //! author : Valentin Agachi : https://github.com/avaly
  50522. //! author : Emanuel Cepoi : https://github.com/cepem
  50523. ;(function (global, factory) {
  50524. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  50525. undefined
  50526. }(this, (function (moment) { 'use strict';
  50527. //! moment.js locale configuration
  50528. function relativeTimeWithPlural(number, withoutSuffix, key) {
  50529. var format = {
  50530. ss: 'secunde',
  50531. mm: 'minute',
  50532. hh: 'ore',
  50533. dd: 'zile',
  50534. MM: 'luni',
  50535. yy: 'ani',
  50536. },
  50537. separator = ' ';
  50538. if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {
  50539. separator = ' de ';
  50540. }
  50541. return number + separator + format[key];
  50542. }
  50543. var ro = moment.defineLocale('ro', {
  50544. months: 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split(
  50545. '_'
  50546. ),
  50547. monthsShort: 'ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split(
  50548. '_'
  50549. ),
  50550. monthsParseExact: true,
  50551. weekdays: 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),
  50552. weekdaysShort: 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),
  50553. weekdaysMin: 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),
  50554. longDateFormat: {
  50555. LT: 'H:mm',
  50556. LTS: 'H:mm:ss',
  50557. L: 'DD.MM.YYYY',
  50558. LL: 'D MMMM YYYY',
  50559. LLL: 'D MMMM YYYY H:mm',
  50560. LLLL: 'dddd, D MMMM YYYY H:mm',
  50561. },
  50562. calendar: {
  50563. sameDay: '[azi la] LT',
  50564. nextDay: '[mâine la] LT',
  50565. nextWeek: 'dddd [la] LT',
  50566. lastDay: '[ieri la] LT',
  50567. lastWeek: '[fosta] dddd [la] LT',
  50568. sameElse: 'L',
  50569. },
  50570. relativeTime: {
  50571. future: 'peste %s',
  50572. past: '%s în urmă',
  50573. s: 'câteva secunde',
  50574. ss: relativeTimeWithPlural,
  50575. m: 'un minut',
  50576. mm: relativeTimeWithPlural,
  50577. h: 'o oră',
  50578. hh: relativeTimeWithPlural,
  50579. d: 'o zi',
  50580. dd: relativeTimeWithPlural,
  50581. M: 'o lună',
  50582. MM: relativeTimeWithPlural,
  50583. y: 'un an',
  50584. yy: relativeTimeWithPlural,
  50585. },
  50586. week: {
  50587. dow: 1, // Monday is the first day of the week.
  50588. doy: 7, // The week that contains Jan 7th is the first week of the year.
  50589. },
  50590. });
  50591. return ro;
  50592. })));
  50593. /***/ }),
  50594. /***/ "./node_modules/moment/locale/ru.js":
  50595. /*!******************************************!*\
  50596. !*** ./node_modules/moment/locale/ru.js ***!
  50597. \******************************************/
  50598. /*! no static exports found */
  50599. /***/ (function(module, exports, __webpack_require__) {
  50600. //! moment.js locale configuration
  50601. //! locale : Russian [ru]
  50602. //! author : Viktorminator : https://github.com/Viktorminator
  50603. //! author : Menelion Elensúle : https://github.com/Oire
  50604. //! author : Коренберг Марк : https://github.com/socketpair
  50605. ;(function (global, factory) {
  50606. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  50607. undefined
  50608. }(this, (function (moment) { 'use strict';
  50609. //! moment.js locale configuration
  50610. function plural(word, num) {
  50611. var forms = word.split('_');
  50612. return num % 10 === 1 && num % 100 !== 11
  50613. ? forms[0]
  50614. : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)
  50615. ? forms[1]
  50616. : forms[2];
  50617. }
  50618. function relativeTimeWithPlural(number, withoutSuffix, key) {
  50619. var format = {
  50620. ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',
  50621. mm: withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',
  50622. hh: 'час_часа_часов',
  50623. dd: 'день_дня_дней',
  50624. MM: 'месяц_месяца_месяцев',
  50625. yy: 'год_года_лет',
  50626. };
  50627. if (key === 'm') {
  50628. return withoutSuffix ? 'минута' : 'минуту';
  50629. } else {
  50630. return number + ' ' + plural(format[key], +number);
  50631. }
  50632. }
  50633. var monthsParse = [
  50634. /^янв/i,
  50635. /^фев/i,
  50636. /^мар/i,
  50637. /^апр/i,
  50638. /^ма[йя]/i,
  50639. /^июн/i,
  50640. /^июл/i,
  50641. /^авг/i,
  50642. /^сен/i,
  50643. /^окт/i,
  50644. /^ноя/i,
  50645. /^дек/i,
  50646. ];
  50647. // http://new.gramota.ru/spravka/rules/139-prop : § 103
  50648. // Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637
  50649. // CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753
  50650. var ru = moment.defineLocale('ru', {
  50651. months: {
  50652. format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split(
  50653. '_'
  50654. ),
  50655. standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split(
  50656. '_'
  50657. ),
  50658. },
  50659. monthsShort: {
  50660. // по CLDR именно "июл." и "июн.", но какой смысл менять букву на точку?
  50661. format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split(
  50662. '_'
  50663. ),
  50664. standalone: 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split(
  50665. '_'
  50666. ),
  50667. },
  50668. weekdays: {
  50669. standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split(
  50670. '_'
  50671. ),
  50672. format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split(
  50673. '_'
  50674. ),
  50675. isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/,
  50676. },
  50677. weekdaysShort: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
  50678. weekdaysMin: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
  50679. monthsParse: monthsParse,
  50680. longMonthsParse: monthsParse,
  50681. shortMonthsParse: monthsParse,
  50682. // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки
  50683. monthsRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
  50684. // копия предыдущего
  50685. monthsShortRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
  50686. // полные названия с падежами
  50687. monthsStrictRegex: /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,
  50688. // Выражение, которое соответствует только сокращённым формам
  50689. monthsShortStrictRegex: /^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,
  50690. longDateFormat: {
  50691. LT: 'H:mm',
  50692. LTS: 'H:mm:ss',
  50693. L: 'DD.MM.YYYY',
  50694. LL: 'D MMMM YYYY г.',
  50695. LLL: 'D MMMM YYYY г., H:mm',
  50696. LLLL: 'dddd, D MMMM YYYY г., H:mm',
  50697. },
  50698. calendar: {
  50699. sameDay: '[Сегодня, в] LT',
  50700. nextDay: '[Завтра, в] LT',
  50701. lastDay: '[Вчера, в] LT',
  50702. nextWeek: function (now) {
  50703. if (now.week() !== this.week()) {
  50704. switch (this.day()) {
  50705. case 0:
  50706. return '[В следующее] dddd, [в] LT';
  50707. case 1:
  50708. case 2:
  50709. case 4:
  50710. return '[В следующий] dddd, [в] LT';
  50711. case 3:
  50712. case 5:
  50713. case 6:
  50714. return '[В следующую] dddd, [в] LT';
  50715. }
  50716. } else {
  50717. if (this.day() === 2) {
  50718. return '[Во] dddd, [в] LT';
  50719. } else {
  50720. return '[В] dddd, [в] LT';
  50721. }
  50722. }
  50723. },
  50724. lastWeek: function (now) {
  50725. if (now.week() !== this.week()) {
  50726. switch (this.day()) {
  50727. case 0:
  50728. return '[В прошлое] dddd, [в] LT';
  50729. case 1:
  50730. case 2:
  50731. case 4:
  50732. return '[В прошлый] dddd, [в] LT';
  50733. case 3:
  50734. case 5:
  50735. case 6:
  50736. return '[В прошлую] dddd, [в] LT';
  50737. }
  50738. } else {
  50739. if (this.day() === 2) {
  50740. return '[Во] dddd, [в] LT';
  50741. } else {
  50742. return '[В] dddd, [в] LT';
  50743. }
  50744. }
  50745. },
  50746. sameElse: 'L',
  50747. },
  50748. relativeTime: {
  50749. future: 'через %s',
  50750. past: '%s назад',
  50751. s: 'несколько секунд',
  50752. ss: relativeTimeWithPlural,
  50753. m: relativeTimeWithPlural,
  50754. mm: relativeTimeWithPlural,
  50755. h: 'час',
  50756. hh: relativeTimeWithPlural,
  50757. d: 'день',
  50758. dd: relativeTimeWithPlural,
  50759. M: 'месяц',
  50760. MM: relativeTimeWithPlural,
  50761. y: 'год',
  50762. yy: relativeTimeWithPlural,
  50763. },
  50764. meridiemParse: /ночи|утра|дня|вечера/i,
  50765. isPM: function (input) {
  50766. return /^(дня|вечера)$/.test(input);
  50767. },
  50768. meridiem: function (hour, minute, isLower) {
  50769. if (hour < 4) {
  50770. return 'ночи';
  50771. } else if (hour < 12) {
  50772. return 'утра';
  50773. } else if (hour < 17) {
  50774. return 'дня';
  50775. } else {
  50776. return 'вечера';
  50777. }
  50778. },
  50779. dayOfMonthOrdinalParse: /\d{1,2}-(й|го|я)/,
  50780. ordinal: function (number, period) {
  50781. switch (period) {
  50782. case 'M':
  50783. case 'd':
  50784. case 'DDD':
  50785. return number + '-й';
  50786. case 'D':
  50787. return number + '-го';
  50788. case 'w':
  50789. case 'W':
  50790. return number + '-я';
  50791. default:
  50792. return number;
  50793. }
  50794. },
  50795. week: {
  50796. dow: 1, // Monday is the first day of the week.
  50797. doy: 4, // The week that contains Jan 4th is the first week of the year.
  50798. },
  50799. });
  50800. return ru;
  50801. })));
  50802. /***/ }),
  50803. /***/ "./node_modules/moment/locale/sd.js":
  50804. /*!******************************************!*\
  50805. !*** ./node_modules/moment/locale/sd.js ***!
  50806. \******************************************/
  50807. /*! no static exports found */
  50808. /***/ (function(module, exports, __webpack_require__) {
  50809. //! moment.js locale configuration
  50810. //! locale : Sindhi [sd]
  50811. //! author : Narain Sagar : https://github.com/narainsagar
  50812. ;(function (global, factory) {
  50813. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  50814. undefined
  50815. }(this, (function (moment) { 'use strict';
  50816. //! moment.js locale configuration
  50817. var months = [
  50818. 'جنوري',
  50819. 'فيبروري',
  50820. 'مارچ',
  50821. 'اپريل',
  50822. 'مئي',
  50823. 'جون',
  50824. 'جولاءِ',
  50825. 'آگسٽ',
  50826. 'سيپٽمبر',
  50827. 'آڪٽوبر',
  50828. 'نومبر',
  50829. 'ڊسمبر',
  50830. ],
  50831. days = ['آچر', 'سومر', 'اڱارو', 'اربع', 'خميس', 'جمع', 'ڇنڇر'];
  50832. var sd = moment.defineLocale('sd', {
  50833. months: months,
  50834. monthsShort: months,
  50835. weekdays: days,
  50836. weekdaysShort: days,
  50837. weekdaysMin: days,
  50838. longDateFormat: {
  50839. LT: 'HH:mm',
  50840. LTS: 'HH:mm:ss',
  50841. L: 'DD/MM/YYYY',
  50842. LL: 'D MMMM YYYY',
  50843. LLL: 'D MMMM YYYY HH:mm',
  50844. LLLL: 'dddd، D MMMM YYYY HH:mm',
  50845. },
  50846. meridiemParse: /صبح|شام/,
  50847. isPM: function (input) {
  50848. return 'شام' === input;
  50849. },
  50850. meridiem: function (hour, minute, isLower) {
  50851. if (hour < 12) {
  50852. return 'صبح';
  50853. }
  50854. return 'شام';
  50855. },
  50856. calendar: {
  50857. sameDay: '[اڄ] LT',
  50858. nextDay: '[سڀاڻي] LT',
  50859. nextWeek: 'dddd [اڳين هفتي تي] LT',
  50860. lastDay: '[ڪالهه] LT',
  50861. lastWeek: '[گزريل هفتي] dddd [تي] LT',
  50862. sameElse: 'L',
  50863. },
  50864. relativeTime: {
  50865. future: '%s پوء',
  50866. past: '%s اڳ',
  50867. s: 'چند سيڪنڊ',
  50868. ss: '%d سيڪنڊ',
  50869. m: 'هڪ منٽ',
  50870. mm: '%d منٽ',
  50871. h: 'هڪ ڪلاڪ',
  50872. hh: '%d ڪلاڪ',
  50873. d: 'هڪ ڏينهن',
  50874. dd: '%d ڏينهن',
  50875. M: 'هڪ مهينو',
  50876. MM: '%d مهينا',
  50877. y: 'هڪ سال',
  50878. yy: '%d سال',
  50879. },
  50880. preparse: function (string) {
  50881. return string.replace(/،/g, ',');
  50882. },
  50883. postformat: function (string) {
  50884. return string.replace(/,/g, '،');
  50885. },
  50886. week: {
  50887. dow: 1, // Monday is the first day of the week.
  50888. doy: 4, // The week that contains Jan 4th is the first week of the year.
  50889. },
  50890. });
  50891. return sd;
  50892. })));
  50893. /***/ }),
  50894. /***/ "./node_modules/moment/locale/se.js":
  50895. /*!******************************************!*\
  50896. !*** ./node_modules/moment/locale/se.js ***!
  50897. \******************************************/
  50898. /*! no static exports found */
  50899. /***/ (function(module, exports, __webpack_require__) {
  50900. //! moment.js locale configuration
  50901. //! locale : Northern Sami [se]
  50902. //! authors : Bård Rolstad Henriksen : https://github.com/karamell
  50903. ;(function (global, factory) {
  50904. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  50905. undefined
  50906. }(this, (function (moment) { 'use strict';
  50907. //! moment.js locale configuration
  50908. var se = moment.defineLocale('se', {
  50909. months: 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split(
  50910. '_'
  50911. ),
  50912. monthsShort: 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split(
  50913. '_'
  50914. ),
  50915. weekdays: 'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split(
  50916. '_'
  50917. ),
  50918. weekdaysShort: 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'),
  50919. weekdaysMin: 's_v_m_g_d_b_L'.split('_'),
  50920. longDateFormat: {
  50921. LT: 'HH:mm',
  50922. LTS: 'HH:mm:ss',
  50923. L: 'DD.MM.YYYY',
  50924. LL: 'MMMM D. [b.] YYYY',
  50925. LLL: 'MMMM D. [b.] YYYY [ti.] HH:mm',
  50926. LLLL: 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm',
  50927. },
  50928. calendar: {
  50929. sameDay: '[otne ti] LT',
  50930. nextDay: '[ihttin ti] LT',
  50931. nextWeek: 'dddd [ti] LT',
  50932. lastDay: '[ikte ti] LT',
  50933. lastWeek: '[ovddit] dddd [ti] LT',
  50934. sameElse: 'L',
  50935. },
  50936. relativeTime: {
  50937. future: '%s geažes',
  50938. past: 'maŋit %s',
  50939. s: 'moadde sekunddat',
  50940. ss: '%d sekunddat',
  50941. m: 'okta minuhta',
  50942. mm: '%d minuhtat',
  50943. h: 'okta diimmu',
  50944. hh: '%d diimmut',
  50945. d: 'okta beaivi',
  50946. dd: '%d beaivvit',
  50947. M: 'okta mánnu',
  50948. MM: '%d mánut',
  50949. y: 'okta jahki',
  50950. yy: '%d jagit',
  50951. },
  50952. dayOfMonthOrdinalParse: /\d{1,2}\./,
  50953. ordinal: '%d.',
  50954. week: {
  50955. dow: 1, // Monday is the first day of the week.
  50956. doy: 4, // The week that contains Jan 4th is the first week of the year.
  50957. },
  50958. });
  50959. return se;
  50960. })));
  50961. /***/ }),
  50962. /***/ "./node_modules/moment/locale/si.js":
  50963. /*!******************************************!*\
  50964. !*** ./node_modules/moment/locale/si.js ***!
  50965. \******************************************/
  50966. /*! no static exports found */
  50967. /***/ (function(module, exports, __webpack_require__) {
  50968. //! moment.js locale configuration
  50969. //! locale : Sinhalese [si]
  50970. //! author : Sampath Sitinamaluwa : https://github.com/sampathsris
  50971. ;(function (global, factory) {
  50972. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  50973. undefined
  50974. }(this, (function (moment) { 'use strict';
  50975. //! moment.js locale configuration
  50976. /*jshint -W100*/
  50977. var si = moment.defineLocale('si', {
  50978. months: 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split(
  50979. '_'
  50980. ),
  50981. monthsShort: 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split(
  50982. '_'
  50983. ),
  50984. weekdays: 'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split(
  50985. '_'
  50986. ),
  50987. weekdaysShort: 'ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන'.split('_'),
  50988. weekdaysMin: 'ඉ_ස_අ_බ_බ්‍ර_සි_සෙ'.split('_'),
  50989. weekdaysParseExact: true,
  50990. longDateFormat: {
  50991. LT: 'a h:mm',
  50992. LTS: 'a h:mm:ss',
  50993. L: 'YYYY/MM/DD',
  50994. LL: 'YYYY MMMM D',
  50995. LLL: 'YYYY MMMM D, a h:mm',
  50996. LLLL: 'YYYY MMMM D [වැනි] dddd, a h:mm:ss',
  50997. },
  50998. calendar: {
  50999. sameDay: '[අද] LT[ට]',
  51000. nextDay: '[හෙට] LT[ට]',
  51001. nextWeek: 'dddd LT[ට]',
  51002. lastDay: '[ඊයේ] LT[ට]',
  51003. lastWeek: '[පසුගිය] dddd LT[ට]',
  51004. sameElse: 'L',
  51005. },
  51006. relativeTime: {
  51007. future: '%sකින්',
  51008. past: '%sකට පෙර',
  51009. s: 'තත්පර කිහිපය',
  51010. ss: 'තත්පර %d',
  51011. m: 'මිනිත්තුව',
  51012. mm: 'මිනිත්තු %d',
  51013. h: 'පැය',
  51014. hh: 'පැය %d',
  51015. d: 'දිනය',
  51016. dd: 'දින %d',
  51017. M: 'මාසය',
  51018. MM: 'මාස %d',
  51019. y: 'වසර',
  51020. yy: 'වසර %d',
  51021. },
  51022. dayOfMonthOrdinalParse: /\d{1,2} වැනි/,
  51023. ordinal: function (number) {
  51024. return number + ' වැනි';
  51025. },
  51026. meridiemParse: /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,
  51027. isPM: function (input) {
  51028. return input === 'ප.ව.' || input === 'පස් වරු';
  51029. },
  51030. meridiem: function (hours, minutes, isLower) {
  51031. if (hours > 11) {
  51032. return isLower ? 'ප.ව.' : 'පස් වරු';
  51033. } else {
  51034. return isLower ? 'පෙ.ව.' : 'පෙර වරු';
  51035. }
  51036. },
  51037. });
  51038. return si;
  51039. })));
  51040. /***/ }),
  51041. /***/ "./node_modules/moment/locale/sk.js":
  51042. /*!******************************************!*\
  51043. !*** ./node_modules/moment/locale/sk.js ***!
  51044. \******************************************/
  51045. /*! no static exports found */
  51046. /***/ (function(module, exports, __webpack_require__) {
  51047. //! moment.js locale configuration
  51048. //! locale : Slovak [sk]
  51049. //! author : Martin Minka : https://github.com/k2s
  51050. //! based on work of petrbela : https://github.com/petrbela
  51051. ;(function (global, factory) {
  51052. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  51053. undefined
  51054. }(this, (function (moment) { 'use strict';
  51055. //! moment.js locale configuration
  51056. var months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split(
  51057. '_'
  51058. ),
  51059. monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');
  51060. function plural(n) {
  51061. return n > 1 && n < 5;
  51062. }
  51063. function translate(number, withoutSuffix, key, isFuture) {
  51064. var result = number + ' ';
  51065. switch (key) {
  51066. case 's': // a few seconds / in a few seconds / a few seconds ago
  51067. return withoutSuffix || isFuture ? 'pár sekúnd' : 'pár sekundami';
  51068. case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago
  51069. if (withoutSuffix || isFuture) {
  51070. return result + (plural(number) ? 'sekundy' : 'sekúnd');
  51071. } else {
  51072. return result + 'sekundami';
  51073. }
  51074. case 'm': // a minute / in a minute / a minute ago
  51075. return withoutSuffix ? 'minúta' : isFuture ? 'minútu' : 'minútou';
  51076. case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
  51077. if (withoutSuffix || isFuture) {
  51078. return result + (plural(number) ? 'minúty' : 'minút');
  51079. } else {
  51080. return result + 'minútami';
  51081. }
  51082. case 'h': // an hour / in an hour / an hour ago
  51083. return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';
  51084. case 'hh': // 9 hours / in 9 hours / 9 hours ago
  51085. if (withoutSuffix || isFuture) {
  51086. return result + (plural(number) ? 'hodiny' : 'hodín');
  51087. } else {
  51088. return result + 'hodinami';
  51089. }
  51090. case 'd': // a day / in a day / a day ago
  51091. return withoutSuffix || isFuture ? 'deň' : 'dňom';
  51092. case 'dd': // 9 days / in 9 days / 9 days ago
  51093. if (withoutSuffix || isFuture) {
  51094. return result + (plural(number) ? 'dni' : 'dní');
  51095. } else {
  51096. return result + 'dňami';
  51097. }
  51098. case 'M': // a month / in a month / a month ago
  51099. return withoutSuffix || isFuture ? 'mesiac' : 'mesiacom';
  51100. case 'MM': // 9 months / in 9 months / 9 months ago
  51101. if (withoutSuffix || isFuture) {
  51102. return result + (plural(number) ? 'mesiace' : 'mesiacov');
  51103. } else {
  51104. return result + 'mesiacmi';
  51105. }
  51106. case 'y': // a year / in a year / a year ago
  51107. return withoutSuffix || isFuture ? 'rok' : 'rokom';
  51108. case 'yy': // 9 years / in 9 years / 9 years ago
  51109. if (withoutSuffix || isFuture) {
  51110. return result + (plural(number) ? 'roky' : 'rokov');
  51111. } else {
  51112. return result + 'rokmi';
  51113. }
  51114. }
  51115. }
  51116. var sk = moment.defineLocale('sk', {
  51117. months: months,
  51118. monthsShort: monthsShort,
  51119. weekdays: 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),
  51120. weekdaysShort: 'ne_po_ut_st_št_pi_so'.split('_'),
  51121. weekdaysMin: 'ne_po_ut_st_št_pi_so'.split('_'),
  51122. longDateFormat: {
  51123. LT: 'H:mm',
  51124. LTS: 'H:mm:ss',
  51125. L: 'DD.MM.YYYY',
  51126. LL: 'D. MMMM YYYY',
  51127. LLL: 'D. MMMM YYYY H:mm',
  51128. LLLL: 'dddd D. MMMM YYYY H:mm',
  51129. },
  51130. calendar: {
  51131. sameDay: '[dnes o] LT',
  51132. nextDay: '[zajtra o] LT',
  51133. nextWeek: function () {
  51134. switch (this.day()) {
  51135. case 0:
  51136. return '[v nedeľu o] LT';
  51137. case 1:
  51138. case 2:
  51139. return '[v] dddd [o] LT';
  51140. case 3:
  51141. return '[v stredu o] LT';
  51142. case 4:
  51143. return '[vo štvrtok o] LT';
  51144. case 5:
  51145. return '[v piatok o] LT';
  51146. case 6:
  51147. return '[v sobotu o] LT';
  51148. }
  51149. },
  51150. lastDay: '[včera o] LT',
  51151. lastWeek: function () {
  51152. switch (this.day()) {
  51153. case 0:
  51154. return '[minulú nedeľu o] LT';
  51155. case 1:
  51156. case 2:
  51157. return '[minulý] dddd [o] LT';
  51158. case 3:
  51159. return '[minulú stredu o] LT';
  51160. case 4:
  51161. case 5:
  51162. return '[minulý] dddd [o] LT';
  51163. case 6:
  51164. return '[minulú sobotu o] LT';
  51165. }
  51166. },
  51167. sameElse: 'L',
  51168. },
  51169. relativeTime: {
  51170. future: 'za %s',
  51171. past: 'pred %s',
  51172. s: translate,
  51173. ss: translate,
  51174. m: translate,
  51175. mm: translate,
  51176. h: translate,
  51177. hh: translate,
  51178. d: translate,
  51179. dd: translate,
  51180. M: translate,
  51181. MM: translate,
  51182. y: translate,
  51183. yy: translate,
  51184. },
  51185. dayOfMonthOrdinalParse: /\d{1,2}\./,
  51186. ordinal: '%d.',
  51187. week: {
  51188. dow: 1, // Monday is the first day of the week.
  51189. doy: 4, // The week that contains Jan 4th is the first week of the year.
  51190. },
  51191. });
  51192. return sk;
  51193. })));
  51194. /***/ }),
  51195. /***/ "./node_modules/moment/locale/sl.js":
  51196. /*!******************************************!*\
  51197. !*** ./node_modules/moment/locale/sl.js ***!
  51198. \******************************************/
  51199. /*! no static exports found */
  51200. /***/ (function(module, exports, __webpack_require__) {
  51201. //! moment.js locale configuration
  51202. //! locale : Slovenian [sl]
  51203. //! author : Robert Sedovšek : https://github.com/sedovsek
  51204. ;(function (global, factory) {
  51205. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  51206. undefined
  51207. }(this, (function (moment) { 'use strict';
  51208. //! moment.js locale configuration
  51209. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  51210. var result = number + ' ';
  51211. switch (key) {
  51212. case 's':
  51213. return withoutSuffix || isFuture
  51214. ? 'nekaj sekund'
  51215. : 'nekaj sekundami';
  51216. case 'ss':
  51217. if (number === 1) {
  51218. result += withoutSuffix ? 'sekundo' : 'sekundi';
  51219. } else if (number === 2) {
  51220. result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';
  51221. } else if (number < 5) {
  51222. result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';
  51223. } else {
  51224. result += 'sekund';
  51225. }
  51226. return result;
  51227. case 'm':
  51228. return withoutSuffix ? 'ena minuta' : 'eno minuto';
  51229. case 'mm':
  51230. if (number === 1) {
  51231. result += withoutSuffix ? 'minuta' : 'minuto';
  51232. } else if (number === 2) {
  51233. result += withoutSuffix || isFuture ? 'minuti' : 'minutama';
  51234. } else if (number < 5) {
  51235. result += withoutSuffix || isFuture ? 'minute' : 'minutami';
  51236. } else {
  51237. result += withoutSuffix || isFuture ? 'minut' : 'minutami';
  51238. }
  51239. return result;
  51240. case 'h':
  51241. return withoutSuffix ? 'ena ura' : 'eno uro';
  51242. case 'hh':
  51243. if (number === 1) {
  51244. result += withoutSuffix ? 'ura' : 'uro';
  51245. } else if (number === 2) {
  51246. result += withoutSuffix || isFuture ? 'uri' : 'urama';
  51247. } else if (number < 5) {
  51248. result += withoutSuffix || isFuture ? 'ure' : 'urami';
  51249. } else {
  51250. result += withoutSuffix || isFuture ? 'ur' : 'urami';
  51251. }
  51252. return result;
  51253. case 'd':
  51254. return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';
  51255. case 'dd':
  51256. if (number === 1) {
  51257. result += withoutSuffix || isFuture ? 'dan' : 'dnem';
  51258. } else if (number === 2) {
  51259. result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';
  51260. } else {
  51261. result += withoutSuffix || isFuture ? 'dni' : 'dnevi';
  51262. }
  51263. return result;
  51264. case 'M':
  51265. return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';
  51266. case 'MM':
  51267. if (number === 1) {
  51268. result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';
  51269. } else if (number === 2) {
  51270. result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';
  51271. } else if (number < 5) {
  51272. result += withoutSuffix || isFuture ? 'mesece' : 'meseci';
  51273. } else {
  51274. result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';
  51275. }
  51276. return result;
  51277. case 'y':
  51278. return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';
  51279. case 'yy':
  51280. if (number === 1) {
  51281. result += withoutSuffix || isFuture ? 'leto' : 'letom';
  51282. } else if (number === 2) {
  51283. result += withoutSuffix || isFuture ? 'leti' : 'letoma';
  51284. } else if (number < 5) {
  51285. result += withoutSuffix || isFuture ? 'leta' : 'leti';
  51286. } else {
  51287. result += withoutSuffix || isFuture ? 'let' : 'leti';
  51288. }
  51289. return result;
  51290. }
  51291. }
  51292. var sl = moment.defineLocale('sl', {
  51293. months: 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split(
  51294. '_'
  51295. ),
  51296. monthsShort: 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split(
  51297. '_'
  51298. ),
  51299. monthsParseExact: true,
  51300. weekdays: 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),
  51301. weekdaysShort: 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),
  51302. weekdaysMin: 'ne_po_to_sr_če_pe_so'.split('_'),
  51303. weekdaysParseExact: true,
  51304. longDateFormat: {
  51305. LT: 'H:mm',
  51306. LTS: 'H:mm:ss',
  51307. L: 'DD. MM. YYYY',
  51308. LL: 'D. MMMM YYYY',
  51309. LLL: 'D. MMMM YYYY H:mm',
  51310. LLLL: 'dddd, D. MMMM YYYY H:mm',
  51311. },
  51312. calendar: {
  51313. sameDay: '[danes ob] LT',
  51314. nextDay: '[jutri ob] LT',
  51315. nextWeek: function () {
  51316. switch (this.day()) {
  51317. case 0:
  51318. return '[v] [nedeljo] [ob] LT';
  51319. case 3:
  51320. return '[v] [sredo] [ob] LT';
  51321. case 6:
  51322. return '[v] [soboto] [ob] LT';
  51323. case 1:
  51324. case 2:
  51325. case 4:
  51326. case 5:
  51327. return '[v] dddd [ob] LT';
  51328. }
  51329. },
  51330. lastDay: '[včeraj ob] LT',
  51331. lastWeek: function () {
  51332. switch (this.day()) {
  51333. case 0:
  51334. return '[prejšnjo] [nedeljo] [ob] LT';
  51335. case 3:
  51336. return '[prejšnjo] [sredo] [ob] LT';
  51337. case 6:
  51338. return '[prejšnjo] [soboto] [ob] LT';
  51339. case 1:
  51340. case 2:
  51341. case 4:
  51342. case 5:
  51343. return '[prejšnji] dddd [ob] LT';
  51344. }
  51345. },
  51346. sameElse: 'L',
  51347. },
  51348. relativeTime: {
  51349. future: 'čez %s',
  51350. past: 'pred %s',
  51351. s: processRelativeTime,
  51352. ss: processRelativeTime,
  51353. m: processRelativeTime,
  51354. mm: processRelativeTime,
  51355. h: processRelativeTime,
  51356. hh: processRelativeTime,
  51357. d: processRelativeTime,
  51358. dd: processRelativeTime,
  51359. M: processRelativeTime,
  51360. MM: processRelativeTime,
  51361. y: processRelativeTime,
  51362. yy: processRelativeTime,
  51363. },
  51364. dayOfMonthOrdinalParse: /\d{1,2}\./,
  51365. ordinal: '%d.',
  51366. week: {
  51367. dow: 1, // Monday is the first day of the week.
  51368. doy: 7, // The week that contains Jan 7th is the first week of the year.
  51369. },
  51370. });
  51371. return sl;
  51372. })));
  51373. /***/ }),
  51374. /***/ "./node_modules/moment/locale/sq.js":
  51375. /*!******************************************!*\
  51376. !*** ./node_modules/moment/locale/sq.js ***!
  51377. \******************************************/
  51378. /*! no static exports found */
  51379. /***/ (function(module, exports, __webpack_require__) {
  51380. //! moment.js locale configuration
  51381. //! locale : Albanian [sq]
  51382. //! author : Flakërim Ismani : https://github.com/flakerimi
  51383. //! author : Menelion Elensúle : https://github.com/Oire
  51384. //! author : Oerd Cukalla : https://github.com/oerd
  51385. ;(function (global, factory) {
  51386. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  51387. undefined
  51388. }(this, (function (moment) { 'use strict';
  51389. //! moment.js locale configuration
  51390. var sq = moment.defineLocale('sq', {
  51391. months: 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split(
  51392. '_'
  51393. ),
  51394. monthsShort: 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),
  51395. weekdays: 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split(
  51396. '_'
  51397. ),
  51398. weekdaysShort: 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),
  51399. weekdaysMin: 'D_H_Ma_Më_E_P_Sh'.split('_'),
  51400. weekdaysParseExact: true,
  51401. meridiemParse: /PD|MD/,
  51402. isPM: function (input) {
  51403. return input.charAt(0) === 'M';
  51404. },
  51405. meridiem: function (hours, minutes, isLower) {
  51406. return hours < 12 ? 'PD' : 'MD';
  51407. },
  51408. longDateFormat: {
  51409. LT: 'HH:mm',
  51410. LTS: 'HH:mm:ss',
  51411. L: 'DD/MM/YYYY',
  51412. LL: 'D MMMM YYYY',
  51413. LLL: 'D MMMM YYYY HH:mm',
  51414. LLLL: 'dddd, D MMMM YYYY HH:mm',
  51415. },
  51416. calendar: {
  51417. sameDay: '[Sot në] LT',
  51418. nextDay: '[Nesër në] LT',
  51419. nextWeek: 'dddd [në] LT',
  51420. lastDay: '[Dje në] LT',
  51421. lastWeek: 'dddd [e kaluar në] LT',
  51422. sameElse: 'L',
  51423. },
  51424. relativeTime: {
  51425. future: 'në %s',
  51426. past: '%s më parë',
  51427. s: 'disa sekonda',
  51428. ss: '%d sekonda',
  51429. m: 'një minutë',
  51430. mm: '%d minuta',
  51431. h: 'një orë',
  51432. hh: '%d orë',
  51433. d: 'një ditë',
  51434. dd: '%d ditë',
  51435. M: 'një muaj',
  51436. MM: '%d muaj',
  51437. y: 'një vit',
  51438. yy: '%d vite',
  51439. },
  51440. dayOfMonthOrdinalParse: /\d{1,2}\./,
  51441. ordinal: '%d.',
  51442. week: {
  51443. dow: 1, // Monday is the first day of the week.
  51444. doy: 4, // The week that contains Jan 4th is the first week of the year.
  51445. },
  51446. });
  51447. return sq;
  51448. })));
  51449. /***/ }),
  51450. /***/ "./node_modules/moment/locale/sr-cyrl.js":
  51451. /*!***********************************************!*\
  51452. !*** ./node_modules/moment/locale/sr-cyrl.js ***!
  51453. \***********************************************/
  51454. /*! no static exports found */
  51455. /***/ (function(module, exports, __webpack_require__) {
  51456. //! moment.js locale configuration
  51457. //! locale : Serbian Cyrillic [sr-cyrl]
  51458. //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
  51459. ;(function (global, factory) {
  51460. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  51461. undefined
  51462. }(this, (function (moment) { 'use strict';
  51463. //! moment.js locale configuration
  51464. var translator = {
  51465. words: {
  51466. //Different grammatical cases
  51467. ss: ['секунда', 'секунде', 'секунди'],
  51468. m: ['један минут', 'једне минуте'],
  51469. mm: ['минут', 'минуте', 'минута'],
  51470. h: ['један сат', 'једног сата'],
  51471. hh: ['сат', 'сата', 'сати'],
  51472. dd: ['дан', 'дана', 'дана'],
  51473. MM: ['месец', 'месеца', 'месеци'],
  51474. yy: ['година', 'године', 'година'],
  51475. },
  51476. correctGrammaticalCase: function (number, wordKey) {
  51477. return number === 1
  51478. ? wordKey[0]
  51479. : number >= 2 && number <= 4
  51480. ? wordKey[1]
  51481. : wordKey[2];
  51482. },
  51483. translate: function (number, withoutSuffix, key) {
  51484. var wordKey = translator.words[key];
  51485. if (key.length === 1) {
  51486. return withoutSuffix ? wordKey[0] : wordKey[1];
  51487. } else {
  51488. return (
  51489. number +
  51490. ' ' +
  51491. translator.correctGrammaticalCase(number, wordKey)
  51492. );
  51493. }
  51494. },
  51495. };
  51496. var srCyrl = moment.defineLocale('sr-cyrl', {
  51497. months: 'јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар'.split(
  51498. '_'
  51499. ),
  51500. monthsShort: 'јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.'.split(
  51501. '_'
  51502. ),
  51503. monthsParseExact: true,
  51504. weekdays: 'недеља_понедељак_уторак_среда_четвртак_петак_субота'.split('_'),
  51505. weekdaysShort: 'нед._пон._уто._сре._чет._пет._суб.'.split('_'),
  51506. weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'),
  51507. weekdaysParseExact: true,
  51508. longDateFormat: {
  51509. LT: 'H:mm',
  51510. LTS: 'H:mm:ss',
  51511. L: 'DD.MM.YYYY',
  51512. LL: 'D. MMMM YYYY',
  51513. LLL: 'D. MMMM YYYY H:mm',
  51514. LLLL: 'dddd, D. MMMM YYYY H:mm',
  51515. },
  51516. calendar: {
  51517. sameDay: '[данас у] LT',
  51518. nextDay: '[сутра у] LT',
  51519. nextWeek: function () {
  51520. switch (this.day()) {
  51521. case 0:
  51522. return '[у] [недељу] [у] LT';
  51523. case 3:
  51524. return '[у] [среду] [у] LT';
  51525. case 6:
  51526. return '[у] [суботу] [у] LT';
  51527. case 1:
  51528. case 2:
  51529. case 4:
  51530. case 5:
  51531. return '[у] dddd [у] LT';
  51532. }
  51533. },
  51534. lastDay: '[јуче у] LT',
  51535. lastWeek: function () {
  51536. var lastWeekDays = [
  51537. '[прошле] [недеље] [у] LT',
  51538. '[прошлог] [понедељка] [у] LT',
  51539. '[прошлог] [уторка] [у] LT',
  51540. '[прошле] [среде] [у] LT',
  51541. '[прошлог] [четвртка] [у] LT',
  51542. '[прошлог] [петка] [у] LT',
  51543. '[прошле] [суботе] [у] LT',
  51544. ];
  51545. return lastWeekDays[this.day()];
  51546. },
  51547. sameElse: 'L',
  51548. },
  51549. relativeTime: {
  51550. future: 'за %s',
  51551. past: 'пре %s',
  51552. s: 'неколико секунди',
  51553. ss: translator.translate,
  51554. m: translator.translate,
  51555. mm: translator.translate,
  51556. h: translator.translate,
  51557. hh: translator.translate,
  51558. d: 'дан',
  51559. dd: translator.translate,
  51560. M: 'месец',
  51561. MM: translator.translate,
  51562. y: 'годину',
  51563. yy: translator.translate,
  51564. },
  51565. dayOfMonthOrdinalParse: /\d{1,2}\./,
  51566. ordinal: '%d.',
  51567. week: {
  51568. dow: 1, // Monday is the first day of the week.
  51569. doy: 7, // The week that contains Jan 7th is the first week of the year.
  51570. },
  51571. });
  51572. return srCyrl;
  51573. })));
  51574. /***/ }),
  51575. /***/ "./node_modules/moment/locale/sr.js":
  51576. /*!******************************************!*\
  51577. !*** ./node_modules/moment/locale/sr.js ***!
  51578. \******************************************/
  51579. /*! no static exports found */
  51580. /***/ (function(module, exports, __webpack_require__) {
  51581. //! moment.js locale configuration
  51582. //! locale : Serbian [sr]
  51583. //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
  51584. ;(function (global, factory) {
  51585. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  51586. undefined
  51587. }(this, (function (moment) { 'use strict';
  51588. //! moment.js locale configuration
  51589. var translator = {
  51590. words: {
  51591. //Different grammatical cases
  51592. ss: ['sekunda', 'sekunde', 'sekundi'],
  51593. m: ['jedan minut', 'jedne minute'],
  51594. mm: ['minut', 'minute', 'minuta'],
  51595. h: ['jedan sat', 'jednog sata'],
  51596. hh: ['sat', 'sata', 'sati'],
  51597. dd: ['dan', 'dana', 'dana'],
  51598. MM: ['mesec', 'meseca', 'meseci'],
  51599. yy: ['godina', 'godine', 'godina'],
  51600. },
  51601. correctGrammaticalCase: function (number, wordKey) {
  51602. return number === 1
  51603. ? wordKey[0]
  51604. : number >= 2 && number <= 4
  51605. ? wordKey[1]
  51606. : wordKey[2];
  51607. },
  51608. translate: function (number, withoutSuffix, key) {
  51609. var wordKey = translator.words[key];
  51610. if (key.length === 1) {
  51611. return withoutSuffix ? wordKey[0] : wordKey[1];
  51612. } else {
  51613. return (
  51614. number +
  51615. ' ' +
  51616. translator.correctGrammaticalCase(number, wordKey)
  51617. );
  51618. }
  51619. },
  51620. };
  51621. var sr = moment.defineLocale('sr', {
  51622. months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(
  51623. '_'
  51624. ),
  51625. monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split(
  51626. '_'
  51627. ),
  51628. monthsParseExact: true,
  51629. weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split(
  51630. '_'
  51631. ),
  51632. weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),
  51633. weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
  51634. weekdaysParseExact: true,
  51635. longDateFormat: {
  51636. LT: 'H:mm',
  51637. LTS: 'H:mm:ss',
  51638. L: 'DD.MM.YYYY',
  51639. LL: 'D. MMMM YYYY',
  51640. LLL: 'D. MMMM YYYY H:mm',
  51641. LLLL: 'dddd, D. MMMM YYYY H:mm',
  51642. },
  51643. calendar: {
  51644. sameDay: '[danas u] LT',
  51645. nextDay: '[sutra u] LT',
  51646. nextWeek: function () {
  51647. switch (this.day()) {
  51648. case 0:
  51649. return '[u] [nedelju] [u] LT';
  51650. case 3:
  51651. return '[u] [sredu] [u] LT';
  51652. case 6:
  51653. return '[u] [subotu] [u] LT';
  51654. case 1:
  51655. case 2:
  51656. case 4:
  51657. case 5:
  51658. return '[u] dddd [u] LT';
  51659. }
  51660. },
  51661. lastDay: '[juče u] LT',
  51662. lastWeek: function () {
  51663. var lastWeekDays = [
  51664. '[prošle] [nedelje] [u] LT',
  51665. '[prošlog] [ponedeljka] [u] LT',
  51666. '[prošlog] [utorka] [u] LT',
  51667. '[prošle] [srede] [u] LT',
  51668. '[prošlog] [četvrtka] [u] LT',
  51669. '[prošlog] [petka] [u] LT',
  51670. '[prošle] [subote] [u] LT',
  51671. ];
  51672. return lastWeekDays[this.day()];
  51673. },
  51674. sameElse: 'L',
  51675. },
  51676. relativeTime: {
  51677. future: 'za %s',
  51678. past: 'pre %s',
  51679. s: 'nekoliko sekundi',
  51680. ss: translator.translate,
  51681. m: translator.translate,
  51682. mm: translator.translate,
  51683. h: translator.translate,
  51684. hh: translator.translate,
  51685. d: 'dan',
  51686. dd: translator.translate,
  51687. M: 'mesec',
  51688. MM: translator.translate,
  51689. y: 'godinu',
  51690. yy: translator.translate,
  51691. },
  51692. dayOfMonthOrdinalParse: /\d{1,2}\./,
  51693. ordinal: '%d.',
  51694. week: {
  51695. dow: 1, // Monday is the first day of the week.
  51696. doy: 7, // The week that contains Jan 7th is the first week of the year.
  51697. },
  51698. });
  51699. return sr;
  51700. })));
  51701. /***/ }),
  51702. /***/ "./node_modules/moment/locale/ss.js":
  51703. /*!******************************************!*\
  51704. !*** ./node_modules/moment/locale/ss.js ***!
  51705. \******************************************/
  51706. /*! no static exports found */
  51707. /***/ (function(module, exports, __webpack_require__) {
  51708. //! moment.js locale configuration
  51709. //! locale : siSwati [ss]
  51710. //! author : Nicolai Davies<mail@nicolai.io> : https://github.com/nicolaidavies
  51711. ;(function (global, factory) {
  51712. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  51713. undefined
  51714. }(this, (function (moment) { 'use strict';
  51715. //! moment.js locale configuration
  51716. var ss = moment.defineLocale('ss', {
  51717. months: "Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split(
  51718. '_'
  51719. ),
  51720. monthsShort: 'Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo'.split('_'),
  51721. weekdays: 'Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo'.split(
  51722. '_'
  51723. ),
  51724. weekdaysShort: 'Lis_Umb_Lsb_Les_Lsi_Lsh_Umg'.split('_'),
  51725. weekdaysMin: 'Li_Us_Lb_Lt_Ls_Lh_Ug'.split('_'),
  51726. weekdaysParseExact: true,
  51727. longDateFormat: {
  51728. LT: 'h:mm A',
  51729. LTS: 'h:mm:ss A',
  51730. L: 'DD/MM/YYYY',
  51731. LL: 'D MMMM YYYY',
  51732. LLL: 'D MMMM YYYY h:mm A',
  51733. LLLL: 'dddd, D MMMM YYYY h:mm A',
  51734. },
  51735. calendar: {
  51736. sameDay: '[Namuhla nga] LT',
  51737. nextDay: '[Kusasa nga] LT',
  51738. nextWeek: 'dddd [nga] LT',
  51739. lastDay: '[Itolo nga] LT',
  51740. lastWeek: 'dddd [leliphelile] [nga] LT',
  51741. sameElse: 'L',
  51742. },
  51743. relativeTime: {
  51744. future: 'nga %s',
  51745. past: 'wenteka nga %s',
  51746. s: 'emizuzwana lomcane',
  51747. ss: '%d mzuzwana',
  51748. m: 'umzuzu',
  51749. mm: '%d emizuzu',
  51750. h: 'lihora',
  51751. hh: '%d emahora',
  51752. d: 'lilanga',
  51753. dd: '%d emalanga',
  51754. M: 'inyanga',
  51755. MM: '%d tinyanga',
  51756. y: 'umnyaka',
  51757. yy: '%d iminyaka',
  51758. },
  51759. meridiemParse: /ekuseni|emini|entsambama|ebusuku/,
  51760. meridiem: function (hours, minutes, isLower) {
  51761. if (hours < 11) {
  51762. return 'ekuseni';
  51763. } else if (hours < 15) {
  51764. return 'emini';
  51765. } else if (hours < 19) {
  51766. return 'entsambama';
  51767. } else {
  51768. return 'ebusuku';
  51769. }
  51770. },
  51771. meridiemHour: function (hour, meridiem) {
  51772. if (hour === 12) {
  51773. hour = 0;
  51774. }
  51775. if (meridiem === 'ekuseni') {
  51776. return hour;
  51777. } else if (meridiem === 'emini') {
  51778. return hour >= 11 ? hour : hour + 12;
  51779. } else if (meridiem === 'entsambama' || meridiem === 'ebusuku') {
  51780. if (hour === 0) {
  51781. return 0;
  51782. }
  51783. return hour + 12;
  51784. }
  51785. },
  51786. dayOfMonthOrdinalParse: /\d{1,2}/,
  51787. ordinal: '%d',
  51788. week: {
  51789. dow: 1, // Monday is the first day of the week.
  51790. doy: 4, // The week that contains Jan 4th is the first week of the year.
  51791. },
  51792. });
  51793. return ss;
  51794. })));
  51795. /***/ }),
  51796. /***/ "./node_modules/moment/locale/sv.js":
  51797. /*!******************************************!*\
  51798. !*** ./node_modules/moment/locale/sv.js ***!
  51799. \******************************************/
  51800. /*! no static exports found */
  51801. /***/ (function(module, exports, __webpack_require__) {
  51802. //! moment.js locale configuration
  51803. //! locale : Swedish [sv]
  51804. //! author : Jens Alm : https://github.com/ulmus
  51805. ;(function (global, factory) {
  51806. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  51807. undefined
  51808. }(this, (function (moment) { 'use strict';
  51809. //! moment.js locale configuration
  51810. var sv = moment.defineLocale('sv', {
  51811. months: 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split(
  51812. '_'
  51813. ),
  51814. monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
  51815. weekdays: 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),
  51816. weekdaysShort: 'sön_mån_tis_ons_tor_fre_lör'.split('_'),
  51817. weekdaysMin: 'sö_må_ti_on_to_fr_lö'.split('_'),
  51818. longDateFormat: {
  51819. LT: 'HH:mm',
  51820. LTS: 'HH:mm:ss',
  51821. L: 'YYYY-MM-DD',
  51822. LL: 'D MMMM YYYY',
  51823. LLL: 'D MMMM YYYY [kl.] HH:mm',
  51824. LLLL: 'dddd D MMMM YYYY [kl.] HH:mm',
  51825. lll: 'D MMM YYYY HH:mm',
  51826. llll: 'ddd D MMM YYYY HH:mm',
  51827. },
  51828. calendar: {
  51829. sameDay: '[Idag] LT',
  51830. nextDay: '[Imorgon] LT',
  51831. lastDay: '[Igår] LT',
  51832. nextWeek: '[På] dddd LT',
  51833. lastWeek: '[I] dddd[s] LT',
  51834. sameElse: 'L',
  51835. },
  51836. relativeTime: {
  51837. future: 'om %s',
  51838. past: 'för %s sedan',
  51839. s: 'några sekunder',
  51840. ss: '%d sekunder',
  51841. m: 'en minut',
  51842. mm: '%d minuter',
  51843. h: 'en timme',
  51844. hh: '%d timmar',
  51845. d: 'en dag',
  51846. dd: '%d dagar',
  51847. M: 'en månad',
  51848. MM: '%d månader',
  51849. y: 'ett år',
  51850. yy: '%d år',
  51851. },
  51852. dayOfMonthOrdinalParse: /\d{1,2}(\:e|\:a)/,
  51853. ordinal: function (number) {
  51854. var b = number % 10,
  51855. output =
  51856. ~~((number % 100) / 10) === 1
  51857. ? ':e'
  51858. : b === 1
  51859. ? ':a'
  51860. : b === 2
  51861. ? ':a'
  51862. : b === 3
  51863. ? ':e'
  51864. : ':e';
  51865. return number + output;
  51866. },
  51867. week: {
  51868. dow: 1, // Monday is the first day of the week.
  51869. doy: 4, // The week that contains Jan 4th is the first week of the year.
  51870. },
  51871. });
  51872. return sv;
  51873. })));
  51874. /***/ }),
  51875. /***/ "./node_modules/moment/locale/sw.js":
  51876. /*!******************************************!*\
  51877. !*** ./node_modules/moment/locale/sw.js ***!
  51878. \******************************************/
  51879. /*! no static exports found */
  51880. /***/ (function(module, exports, __webpack_require__) {
  51881. //! moment.js locale configuration
  51882. //! locale : Swahili [sw]
  51883. //! author : Fahad Kassim : https://github.com/fadsel
  51884. ;(function (global, factory) {
  51885. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  51886. undefined
  51887. }(this, (function (moment) { 'use strict';
  51888. //! moment.js locale configuration
  51889. var sw = moment.defineLocale('sw', {
  51890. months: 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split(
  51891. '_'
  51892. ),
  51893. monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'),
  51894. weekdays: 'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split(
  51895. '_'
  51896. ),
  51897. weekdaysShort: 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'),
  51898. weekdaysMin: 'J2_J3_J4_J5_Al_Ij_J1'.split('_'),
  51899. weekdaysParseExact: true,
  51900. longDateFormat: {
  51901. LT: 'hh:mm A',
  51902. LTS: 'HH:mm:ss',
  51903. L: 'DD.MM.YYYY',
  51904. LL: 'D MMMM YYYY',
  51905. LLL: 'D MMMM YYYY HH:mm',
  51906. LLLL: 'dddd, D MMMM YYYY HH:mm',
  51907. },
  51908. calendar: {
  51909. sameDay: '[leo saa] LT',
  51910. nextDay: '[kesho saa] LT',
  51911. nextWeek: '[wiki ijayo] dddd [saat] LT',
  51912. lastDay: '[jana] LT',
  51913. lastWeek: '[wiki iliyopita] dddd [saat] LT',
  51914. sameElse: 'L',
  51915. },
  51916. relativeTime: {
  51917. future: '%s baadaye',
  51918. past: 'tokea %s',
  51919. s: 'hivi punde',
  51920. ss: 'sekunde %d',
  51921. m: 'dakika moja',
  51922. mm: 'dakika %d',
  51923. h: 'saa limoja',
  51924. hh: 'masaa %d',
  51925. d: 'siku moja',
  51926. dd: 'siku %d',
  51927. M: 'mwezi mmoja',
  51928. MM: 'miezi %d',
  51929. y: 'mwaka mmoja',
  51930. yy: 'miaka %d',
  51931. },
  51932. week: {
  51933. dow: 1, // Monday is the first day of the week.
  51934. doy: 7, // The week that contains Jan 7th is the first week of the year.
  51935. },
  51936. });
  51937. return sw;
  51938. })));
  51939. /***/ }),
  51940. /***/ "./node_modules/moment/locale/ta.js":
  51941. /*!******************************************!*\
  51942. !*** ./node_modules/moment/locale/ta.js ***!
  51943. \******************************************/
  51944. /*! no static exports found */
  51945. /***/ (function(module, exports, __webpack_require__) {
  51946. //! moment.js locale configuration
  51947. //! locale : Tamil [ta]
  51948. //! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404
  51949. ;(function (global, factory) {
  51950. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  51951. undefined
  51952. }(this, (function (moment) { 'use strict';
  51953. //! moment.js locale configuration
  51954. var symbolMap = {
  51955. '1': '௧',
  51956. '2': '௨',
  51957. '3': '௩',
  51958. '4': '௪',
  51959. '5': '௫',
  51960. '6': '௬',
  51961. '7': '௭',
  51962. '8': '௮',
  51963. '9': '௯',
  51964. '0': '௦',
  51965. },
  51966. numberMap = {
  51967. '௧': '1',
  51968. '௨': '2',
  51969. '௩': '3',
  51970. '௪': '4',
  51971. '௫': '5',
  51972. '௬': '6',
  51973. '௭': '7',
  51974. '௮': '8',
  51975. '௯': '9',
  51976. '௦': '0',
  51977. };
  51978. var ta = moment.defineLocale('ta', {
  51979. months: 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split(
  51980. '_'
  51981. ),
  51982. monthsShort: 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split(
  51983. '_'
  51984. ),
  51985. weekdays: 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split(
  51986. '_'
  51987. ),
  51988. weekdaysShort: 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split(
  51989. '_'
  51990. ),
  51991. weekdaysMin: 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'),
  51992. longDateFormat: {
  51993. LT: 'HH:mm',
  51994. LTS: 'HH:mm:ss',
  51995. L: 'DD/MM/YYYY',
  51996. LL: 'D MMMM YYYY',
  51997. LLL: 'D MMMM YYYY, HH:mm',
  51998. LLLL: 'dddd, D MMMM YYYY, HH:mm',
  51999. },
  52000. calendar: {
  52001. sameDay: '[இன்று] LT',
  52002. nextDay: '[நாளை] LT',
  52003. nextWeek: 'dddd, LT',
  52004. lastDay: '[நேற்று] LT',
  52005. lastWeek: '[கடந்த வாரம்] dddd, LT',
  52006. sameElse: 'L',
  52007. },
  52008. relativeTime: {
  52009. future: '%s இல்',
  52010. past: '%s முன்',
  52011. s: 'ஒரு சில விநாடிகள்',
  52012. ss: '%d விநாடிகள்',
  52013. m: 'ஒரு நிமிடம்',
  52014. mm: '%d நிமிடங்கள்',
  52015. h: 'ஒரு மணி நேரம்',
  52016. hh: '%d மணி நேரம்',
  52017. d: 'ஒரு நாள்',
  52018. dd: '%d நாட்கள்',
  52019. M: 'ஒரு மாதம்',
  52020. MM: '%d மாதங்கள்',
  52021. y: 'ஒரு வருடம்',
  52022. yy: '%d ஆண்டுகள்',
  52023. },
  52024. dayOfMonthOrdinalParse: /\d{1,2}வது/,
  52025. ordinal: function (number) {
  52026. return number + 'வது';
  52027. },
  52028. preparse: function (string) {
  52029. return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) {
  52030. return numberMap[match];
  52031. });
  52032. },
  52033. postformat: function (string) {
  52034. return string.replace(/\d/g, function (match) {
  52035. return symbolMap[match];
  52036. });
  52037. },
  52038. // refer http://ta.wikipedia.org/s/1er1
  52039. meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,
  52040. meridiem: function (hour, minute, isLower) {
  52041. if (hour < 2) {
  52042. return ' யாமம்';
  52043. } else if (hour < 6) {
  52044. return ' வைகறை'; // வைகறை
  52045. } else if (hour < 10) {
  52046. return ' காலை'; // காலை
  52047. } else if (hour < 14) {
  52048. return ' நண்பகல்'; // நண்பகல்
  52049. } else if (hour < 18) {
  52050. return ' எற்பாடு'; // எற்பாடு
  52051. } else if (hour < 22) {
  52052. return ' மாலை'; // மாலை
  52053. } else {
  52054. return ' யாமம்';
  52055. }
  52056. },
  52057. meridiemHour: function (hour, meridiem) {
  52058. if (hour === 12) {
  52059. hour = 0;
  52060. }
  52061. if (meridiem === 'யாமம்') {
  52062. return hour < 2 ? hour : hour + 12;
  52063. } else if (meridiem === 'வைகறை' || meridiem === 'காலை') {
  52064. return hour;
  52065. } else if (meridiem === 'நண்பகல்') {
  52066. return hour >= 10 ? hour : hour + 12;
  52067. } else {
  52068. return hour + 12;
  52069. }
  52070. },
  52071. week: {
  52072. dow: 0, // Sunday is the first day of the week.
  52073. doy: 6, // The week that contains Jan 6th is the first week of the year.
  52074. },
  52075. });
  52076. return ta;
  52077. })));
  52078. /***/ }),
  52079. /***/ "./node_modules/moment/locale/te.js":
  52080. /*!******************************************!*\
  52081. !*** ./node_modules/moment/locale/te.js ***!
  52082. \******************************************/
  52083. /*! no static exports found */
  52084. /***/ (function(module, exports, __webpack_require__) {
  52085. //! moment.js locale configuration
  52086. //! locale : Telugu [te]
  52087. //! author : Krishna Chaitanya Thota : https://github.com/kcthota
  52088. ;(function (global, factory) {
  52089. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  52090. undefined
  52091. }(this, (function (moment) { 'use strict';
  52092. //! moment.js locale configuration
  52093. var te = moment.defineLocale('te', {
  52094. months: 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split(
  52095. '_'
  52096. ),
  52097. monthsShort: 'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split(
  52098. '_'
  52099. ),
  52100. monthsParseExact: true,
  52101. weekdays: 'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split(
  52102. '_'
  52103. ),
  52104. weekdaysShort: 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'),
  52105. weekdaysMin: 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'),
  52106. longDateFormat: {
  52107. LT: 'A h:mm',
  52108. LTS: 'A h:mm:ss',
  52109. L: 'DD/MM/YYYY',
  52110. LL: 'D MMMM YYYY',
  52111. LLL: 'D MMMM YYYY, A h:mm',
  52112. LLLL: 'dddd, D MMMM YYYY, A h:mm',
  52113. },
  52114. calendar: {
  52115. sameDay: '[నేడు] LT',
  52116. nextDay: '[రేపు] LT',
  52117. nextWeek: 'dddd, LT',
  52118. lastDay: '[నిన్న] LT',
  52119. lastWeek: '[గత] dddd, LT',
  52120. sameElse: 'L',
  52121. },
  52122. relativeTime: {
  52123. future: '%s లో',
  52124. past: '%s క్రితం',
  52125. s: 'కొన్ని క్షణాలు',
  52126. ss: '%d సెకన్లు',
  52127. m: 'ఒక నిమిషం',
  52128. mm: '%d నిమిషాలు',
  52129. h: 'ఒక గంట',
  52130. hh: '%d గంటలు',
  52131. d: 'ఒక రోజు',
  52132. dd: '%d రోజులు',
  52133. M: 'ఒక నెల',
  52134. MM: '%d నెలలు',
  52135. y: 'ఒక సంవత్సరం',
  52136. yy: '%d సంవత్సరాలు',
  52137. },
  52138. dayOfMonthOrdinalParse: /\d{1,2}వ/,
  52139. ordinal: '%dవ',
  52140. meridiemParse: /రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,
  52141. meridiemHour: function (hour, meridiem) {
  52142. if (hour === 12) {
  52143. hour = 0;
  52144. }
  52145. if (meridiem === 'రాత్రి') {
  52146. return hour < 4 ? hour : hour + 12;
  52147. } else if (meridiem === 'ఉదయం') {
  52148. return hour;
  52149. } else if (meridiem === 'మధ్యాహ్నం') {
  52150. return hour >= 10 ? hour : hour + 12;
  52151. } else if (meridiem === 'సాయంత్రం') {
  52152. return hour + 12;
  52153. }
  52154. },
  52155. meridiem: function (hour, minute, isLower) {
  52156. if (hour < 4) {
  52157. return 'రాత్రి';
  52158. } else if (hour < 10) {
  52159. return 'ఉదయం';
  52160. } else if (hour < 17) {
  52161. return 'మధ్యాహ్నం';
  52162. } else if (hour < 20) {
  52163. return 'సాయంత్రం';
  52164. } else {
  52165. return 'రాత్రి';
  52166. }
  52167. },
  52168. week: {
  52169. dow: 0, // Sunday is the first day of the week.
  52170. doy: 6, // The week that contains Jan 6th is the first week of the year.
  52171. },
  52172. });
  52173. return te;
  52174. })));
  52175. /***/ }),
  52176. /***/ "./node_modules/moment/locale/tet.js":
  52177. /*!*******************************************!*\
  52178. !*** ./node_modules/moment/locale/tet.js ***!
  52179. \*******************************************/
  52180. /*! no static exports found */
  52181. /***/ (function(module, exports, __webpack_require__) {
  52182. //! moment.js locale configuration
  52183. //! locale : Tetun Dili (East Timor) [tet]
  52184. //! author : Joshua Brooks : https://github.com/joshbrooks
  52185. //! author : Onorio De J. Afonso : https://github.com/marobo
  52186. //! author : Sonia Simoes : https://github.com/soniasimoes
  52187. ;(function (global, factory) {
  52188. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  52189. undefined
  52190. }(this, (function (moment) { 'use strict';
  52191. //! moment.js locale configuration
  52192. var tet = moment.defineLocale('tet', {
  52193. months: 'Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru'.split(
  52194. '_'
  52195. ),
  52196. monthsShort: 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
  52197. weekdays: 'Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu'.split('_'),
  52198. weekdaysShort: 'Dom_Seg_Ters_Kua_Kint_Sest_Sab'.split('_'),
  52199. weekdaysMin: 'Do_Seg_Te_Ku_Ki_Ses_Sa'.split('_'),
  52200. longDateFormat: {
  52201. LT: 'HH:mm',
  52202. LTS: 'HH:mm:ss',
  52203. L: 'DD/MM/YYYY',
  52204. LL: 'D MMMM YYYY',
  52205. LLL: 'D MMMM YYYY HH:mm',
  52206. LLLL: 'dddd, D MMMM YYYY HH:mm',
  52207. },
  52208. calendar: {
  52209. sameDay: '[Ohin iha] LT',
  52210. nextDay: '[Aban iha] LT',
  52211. nextWeek: 'dddd [iha] LT',
  52212. lastDay: '[Horiseik iha] LT',
  52213. lastWeek: 'dddd [semana kotuk] [iha] LT',
  52214. sameElse: 'L',
  52215. },
  52216. relativeTime: {
  52217. future: 'iha %s',
  52218. past: '%s liuba',
  52219. s: 'segundu balun',
  52220. ss: 'segundu %d',
  52221. m: 'minutu ida',
  52222. mm: 'minutu %d',
  52223. h: 'oras ida',
  52224. hh: 'oras %d',
  52225. d: 'loron ida',
  52226. dd: 'loron %d',
  52227. M: 'fulan ida',
  52228. MM: 'fulan %d',
  52229. y: 'tinan ida',
  52230. yy: 'tinan %d',
  52231. },
  52232. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  52233. ordinal: function (number) {
  52234. var b = number % 10,
  52235. output =
  52236. ~~((number % 100) / 10) === 1
  52237. ? 'th'
  52238. : b === 1
  52239. ? 'st'
  52240. : b === 2
  52241. ? 'nd'
  52242. : b === 3
  52243. ? 'rd'
  52244. : 'th';
  52245. return number + output;
  52246. },
  52247. week: {
  52248. dow: 1, // Monday is the first day of the week.
  52249. doy: 4, // The week that contains Jan 4th is the first week of the year.
  52250. },
  52251. });
  52252. return tet;
  52253. })));
  52254. /***/ }),
  52255. /***/ "./node_modules/moment/locale/tg.js":
  52256. /*!******************************************!*\
  52257. !*** ./node_modules/moment/locale/tg.js ***!
  52258. \******************************************/
  52259. /*! no static exports found */
  52260. /***/ (function(module, exports, __webpack_require__) {
  52261. //! moment.js locale configuration
  52262. //! locale : Tajik [tg]
  52263. //! author : Orif N. Jr. : https://github.com/orif-jr
  52264. ;(function (global, factory) {
  52265. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  52266. undefined
  52267. }(this, (function (moment) { 'use strict';
  52268. //! moment.js locale configuration
  52269. var suffixes = {
  52270. 0: '-ум',
  52271. 1: '-ум',
  52272. 2: '-юм',
  52273. 3: '-юм',
  52274. 4: '-ум',
  52275. 5: '-ум',
  52276. 6: '-ум',
  52277. 7: '-ум',
  52278. 8: '-ум',
  52279. 9: '-ум',
  52280. 10: '-ум',
  52281. 12: '-ум',
  52282. 13: '-ум',
  52283. 20: '-ум',
  52284. 30: '-юм',
  52285. 40: '-ум',
  52286. 50: '-ум',
  52287. 60: '-ум',
  52288. 70: '-ум',
  52289. 80: '-ум',
  52290. 90: '-ум',
  52291. 100: '-ум',
  52292. };
  52293. var tg = moment.defineLocale('tg', {
  52294. months: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split(
  52295. '_'
  52296. ),
  52297. monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
  52298. weekdays: 'якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе'.split(
  52299. '_'
  52300. ),
  52301. weekdaysShort: 'яшб_дшб_сшб_чшб_пшб_ҷум_шнб'.split('_'),
  52302. weekdaysMin: 'яш_дш_сш_чш_пш_ҷм_шб'.split('_'),
  52303. longDateFormat: {
  52304. LT: 'HH:mm',
  52305. LTS: 'HH:mm:ss',
  52306. L: 'DD/MM/YYYY',
  52307. LL: 'D MMMM YYYY',
  52308. LLL: 'D MMMM YYYY HH:mm',
  52309. LLLL: 'dddd, D MMMM YYYY HH:mm',
  52310. },
  52311. calendar: {
  52312. sameDay: '[Имрӯз соати] LT',
  52313. nextDay: '[Пагоҳ соати] LT',
  52314. lastDay: '[Дирӯз соати] LT',
  52315. nextWeek: 'dddd[и] [ҳафтаи оянда соати] LT',
  52316. lastWeek: 'dddd[и] [ҳафтаи гузашта соати] LT',
  52317. sameElse: 'L',
  52318. },
  52319. relativeTime: {
  52320. future: 'баъди %s',
  52321. past: '%s пеш',
  52322. s: 'якчанд сония',
  52323. m: 'як дақиқа',
  52324. mm: '%d дақиқа',
  52325. h: 'як соат',
  52326. hh: '%d соат',
  52327. d: 'як рӯз',
  52328. dd: '%d рӯз',
  52329. M: 'як моҳ',
  52330. MM: '%d моҳ',
  52331. y: 'як сол',
  52332. yy: '%d сол',
  52333. },
  52334. meridiemParse: /шаб|субҳ|рӯз|бегоҳ/,
  52335. meridiemHour: function (hour, meridiem) {
  52336. if (hour === 12) {
  52337. hour = 0;
  52338. }
  52339. if (meridiem === 'шаб') {
  52340. return hour < 4 ? hour : hour + 12;
  52341. } else if (meridiem === 'субҳ') {
  52342. return hour;
  52343. } else if (meridiem === 'рӯз') {
  52344. return hour >= 11 ? hour : hour + 12;
  52345. } else if (meridiem === 'бегоҳ') {
  52346. return hour + 12;
  52347. }
  52348. },
  52349. meridiem: function (hour, minute, isLower) {
  52350. if (hour < 4) {
  52351. return 'шаб';
  52352. } else if (hour < 11) {
  52353. return 'субҳ';
  52354. } else if (hour < 16) {
  52355. return 'рӯз';
  52356. } else if (hour < 19) {
  52357. return 'бегоҳ';
  52358. } else {
  52359. return 'шаб';
  52360. }
  52361. },
  52362. dayOfMonthOrdinalParse: /\d{1,2}-(ум|юм)/,
  52363. ordinal: function (number) {
  52364. var a = number % 10,
  52365. b = number >= 100 ? 100 : null;
  52366. return number + (suffixes[number] || suffixes[a] || suffixes[b]);
  52367. },
  52368. week: {
  52369. dow: 1, // Monday is the first day of the week.
  52370. doy: 7, // The week that contains Jan 1th is the first week of the year.
  52371. },
  52372. });
  52373. return tg;
  52374. })));
  52375. /***/ }),
  52376. /***/ "./node_modules/moment/locale/th.js":
  52377. /*!******************************************!*\
  52378. !*** ./node_modules/moment/locale/th.js ***!
  52379. \******************************************/
  52380. /*! no static exports found */
  52381. /***/ (function(module, exports, __webpack_require__) {
  52382. //! moment.js locale configuration
  52383. //! locale : Thai [th]
  52384. //! author : Kridsada Thanabulpong : https://github.com/sirn
  52385. ;(function (global, factory) {
  52386. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  52387. undefined
  52388. }(this, (function (moment) { 'use strict';
  52389. //! moment.js locale configuration
  52390. var th = moment.defineLocale('th', {
  52391. months: 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split(
  52392. '_'
  52393. ),
  52394. monthsShort: 'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split(
  52395. '_'
  52396. ),
  52397. monthsParseExact: true,
  52398. weekdays: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),
  52399. weekdaysShort: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference
  52400. weekdaysMin: 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),
  52401. weekdaysParseExact: true,
  52402. longDateFormat: {
  52403. LT: 'H:mm',
  52404. LTS: 'H:mm:ss',
  52405. L: 'DD/MM/YYYY',
  52406. LL: 'D MMMM YYYY',
  52407. LLL: 'D MMMM YYYY เวลา H:mm',
  52408. LLLL: 'วันddddที่ D MMMM YYYY เวลา H:mm',
  52409. },
  52410. meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,
  52411. isPM: function (input) {
  52412. return input === 'หลังเที่ยง';
  52413. },
  52414. meridiem: function (hour, minute, isLower) {
  52415. if (hour < 12) {
  52416. return 'ก่อนเที่ยง';
  52417. } else {
  52418. return 'หลังเที่ยง';
  52419. }
  52420. },
  52421. calendar: {
  52422. sameDay: '[วันนี้ เวลา] LT',
  52423. nextDay: '[พรุ่งนี้ เวลา] LT',
  52424. nextWeek: 'dddd[หน้า เวลา] LT',
  52425. lastDay: '[เมื่อวานนี้ เวลา] LT',
  52426. lastWeek: '[วัน]dddd[ที่แล้ว เวลา] LT',
  52427. sameElse: 'L',
  52428. },
  52429. relativeTime: {
  52430. future: 'อีก %s',
  52431. past: '%sที่แล้ว',
  52432. s: 'ไม่กี่วินาที',
  52433. ss: '%d วินาที',
  52434. m: '1 นาที',
  52435. mm: '%d นาที',
  52436. h: '1 ชั่วโมง',
  52437. hh: '%d ชั่วโมง',
  52438. d: '1 วัน',
  52439. dd: '%d วัน',
  52440. M: '1 เดือน',
  52441. MM: '%d เดือน',
  52442. y: '1 ปี',
  52443. yy: '%d ปี',
  52444. },
  52445. });
  52446. return th;
  52447. })));
  52448. /***/ }),
  52449. /***/ "./node_modules/moment/locale/tk.js":
  52450. /*!******************************************!*\
  52451. !*** ./node_modules/moment/locale/tk.js ***!
  52452. \******************************************/
  52453. /*! no static exports found */
  52454. /***/ (function(module, exports, __webpack_require__) {
  52455. //! moment.js locale configuration
  52456. //! locale : Turkmen [tk]
  52457. //! author : Atamyrat Abdyrahmanov : https://github.com/atamyratabdy
  52458. ;(function (global, factory) {
  52459. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  52460. undefined
  52461. }(this, (function (moment) { 'use strict';
  52462. //! moment.js locale configuration
  52463. var suffixes = {
  52464. 1: "'inji",
  52465. 5: "'inji",
  52466. 8: "'inji",
  52467. 70: "'inji",
  52468. 80: "'inji",
  52469. 2: "'nji",
  52470. 7: "'nji",
  52471. 20: "'nji",
  52472. 50: "'nji",
  52473. 3: "'ünji",
  52474. 4: "'ünji",
  52475. 100: "'ünji",
  52476. 6: "'njy",
  52477. 9: "'unjy",
  52478. 10: "'unjy",
  52479. 30: "'unjy",
  52480. 60: "'ynjy",
  52481. 90: "'ynjy",
  52482. };
  52483. var tk = moment.defineLocale('tk', {
  52484. months: 'Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr'.split(
  52485. '_'
  52486. ),
  52487. monthsShort: 'Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek'.split('_'),
  52488. weekdays: 'Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe'.split(
  52489. '_'
  52490. ),
  52491. weekdaysShort: 'Ýek_Duş_Siş_Çar_Pen_Ann_Şen'.split('_'),
  52492. weekdaysMin: 'Ýk_Dş_Sş_Çr_Pn_An_Şn'.split('_'),
  52493. longDateFormat: {
  52494. LT: 'HH:mm',
  52495. LTS: 'HH:mm:ss',
  52496. L: 'DD.MM.YYYY',
  52497. LL: 'D MMMM YYYY',
  52498. LLL: 'D MMMM YYYY HH:mm',
  52499. LLLL: 'dddd, D MMMM YYYY HH:mm',
  52500. },
  52501. calendar: {
  52502. sameDay: '[bugün sagat] LT',
  52503. nextDay: '[ertir sagat] LT',
  52504. nextWeek: '[indiki] dddd [sagat] LT',
  52505. lastDay: '[düýn] LT',
  52506. lastWeek: '[geçen] dddd [sagat] LT',
  52507. sameElse: 'L',
  52508. },
  52509. relativeTime: {
  52510. future: '%s soň',
  52511. past: '%s öň',
  52512. s: 'birnäçe sekunt',
  52513. m: 'bir minut',
  52514. mm: '%d minut',
  52515. h: 'bir sagat',
  52516. hh: '%d sagat',
  52517. d: 'bir gün',
  52518. dd: '%d gün',
  52519. M: 'bir aý',
  52520. MM: '%d aý',
  52521. y: 'bir ýyl',
  52522. yy: '%d ýyl',
  52523. },
  52524. ordinal: function (number, period) {
  52525. switch (period) {
  52526. case 'd':
  52527. case 'D':
  52528. case 'Do':
  52529. case 'DD':
  52530. return number;
  52531. default:
  52532. if (number === 0) {
  52533. // special case for zero
  52534. return number + "'unjy";
  52535. }
  52536. var a = number % 10,
  52537. b = (number % 100) - a,
  52538. c = number >= 100 ? 100 : null;
  52539. return number + (suffixes[a] || suffixes[b] || suffixes[c]);
  52540. }
  52541. },
  52542. week: {
  52543. dow: 1, // Monday is the first day of the week.
  52544. doy: 7, // The week that contains Jan 7th is the first week of the year.
  52545. },
  52546. });
  52547. return tk;
  52548. })));
  52549. /***/ }),
  52550. /***/ "./node_modules/moment/locale/tl-ph.js":
  52551. /*!*********************************************!*\
  52552. !*** ./node_modules/moment/locale/tl-ph.js ***!
  52553. \*********************************************/
  52554. /*! no static exports found */
  52555. /***/ (function(module, exports, __webpack_require__) {
  52556. //! moment.js locale configuration
  52557. //! locale : Tagalog (Philippines) [tl-ph]
  52558. //! author : Dan Hagman : https://github.com/hagmandan
  52559. ;(function (global, factory) {
  52560. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  52561. undefined
  52562. }(this, (function (moment) { 'use strict';
  52563. //! moment.js locale configuration
  52564. var tlPh = moment.defineLocale('tl-ph', {
  52565. months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split(
  52566. '_'
  52567. ),
  52568. monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),
  52569. weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split(
  52570. '_'
  52571. ),
  52572. weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),
  52573. weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),
  52574. longDateFormat: {
  52575. LT: 'HH:mm',
  52576. LTS: 'HH:mm:ss',
  52577. L: 'MM/D/YYYY',
  52578. LL: 'MMMM D, YYYY',
  52579. LLL: 'MMMM D, YYYY HH:mm',
  52580. LLLL: 'dddd, MMMM DD, YYYY HH:mm',
  52581. },
  52582. calendar: {
  52583. sameDay: 'LT [ngayong araw]',
  52584. nextDay: '[Bukas ng] LT',
  52585. nextWeek: 'LT [sa susunod na] dddd',
  52586. lastDay: 'LT [kahapon]',
  52587. lastWeek: 'LT [noong nakaraang] dddd',
  52588. sameElse: 'L',
  52589. },
  52590. relativeTime: {
  52591. future: 'sa loob ng %s',
  52592. past: '%s ang nakalipas',
  52593. s: 'ilang segundo',
  52594. ss: '%d segundo',
  52595. m: 'isang minuto',
  52596. mm: '%d minuto',
  52597. h: 'isang oras',
  52598. hh: '%d oras',
  52599. d: 'isang araw',
  52600. dd: '%d araw',
  52601. M: 'isang buwan',
  52602. MM: '%d buwan',
  52603. y: 'isang taon',
  52604. yy: '%d taon',
  52605. },
  52606. dayOfMonthOrdinalParse: /\d{1,2}/,
  52607. ordinal: function (number) {
  52608. return number;
  52609. },
  52610. week: {
  52611. dow: 1, // Monday is the first day of the week.
  52612. doy: 4, // The week that contains Jan 4th is the first week of the year.
  52613. },
  52614. });
  52615. return tlPh;
  52616. })));
  52617. /***/ }),
  52618. /***/ "./node_modules/moment/locale/tlh.js":
  52619. /*!*******************************************!*\
  52620. !*** ./node_modules/moment/locale/tlh.js ***!
  52621. \*******************************************/
  52622. /*! no static exports found */
  52623. /***/ (function(module, exports, __webpack_require__) {
  52624. //! moment.js locale configuration
  52625. //! locale : Klingon [tlh]
  52626. //! author : Dominika Kruk : https://github.com/amaranthrose
  52627. ;(function (global, factory) {
  52628. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  52629. undefined
  52630. }(this, (function (moment) { 'use strict';
  52631. //! moment.js locale configuration
  52632. var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_');
  52633. function translateFuture(output) {
  52634. var time = output;
  52635. time =
  52636. output.indexOf('jaj') !== -1
  52637. ? time.slice(0, -3) + 'leS'
  52638. : output.indexOf('jar') !== -1
  52639. ? time.slice(0, -3) + 'waQ'
  52640. : output.indexOf('DIS') !== -1
  52641. ? time.slice(0, -3) + 'nem'
  52642. : time + ' pIq';
  52643. return time;
  52644. }
  52645. function translatePast(output) {
  52646. var time = output;
  52647. time =
  52648. output.indexOf('jaj') !== -1
  52649. ? time.slice(0, -3) + 'Hu’'
  52650. : output.indexOf('jar') !== -1
  52651. ? time.slice(0, -3) + 'wen'
  52652. : output.indexOf('DIS') !== -1
  52653. ? time.slice(0, -3) + 'ben'
  52654. : time + ' ret';
  52655. return time;
  52656. }
  52657. function translate(number, withoutSuffix, string, isFuture) {
  52658. var numberNoun = numberAsNoun(number);
  52659. switch (string) {
  52660. case 'ss':
  52661. return numberNoun + ' lup';
  52662. case 'mm':
  52663. return numberNoun + ' tup';
  52664. case 'hh':
  52665. return numberNoun + ' rep';
  52666. case 'dd':
  52667. return numberNoun + ' jaj';
  52668. case 'MM':
  52669. return numberNoun + ' jar';
  52670. case 'yy':
  52671. return numberNoun + ' DIS';
  52672. }
  52673. }
  52674. function numberAsNoun(number) {
  52675. var hundred = Math.floor((number % 1000) / 100),
  52676. ten = Math.floor((number % 100) / 10),
  52677. one = number % 10,
  52678. word = '';
  52679. if (hundred > 0) {
  52680. word += numbersNouns[hundred] + 'vatlh';
  52681. }
  52682. if (ten > 0) {
  52683. word += (word !== '' ? ' ' : '') + numbersNouns[ten] + 'maH';
  52684. }
  52685. if (one > 0) {
  52686. word += (word !== '' ? ' ' : '') + numbersNouns[one];
  52687. }
  52688. return word === '' ? 'pagh' : word;
  52689. }
  52690. var tlh = moment.defineLocale('tlh', {
  52691. months: 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split(
  52692. '_'
  52693. ),
  52694. monthsShort: 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split(
  52695. '_'
  52696. ),
  52697. monthsParseExact: true,
  52698. weekdays: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split(
  52699. '_'
  52700. ),
  52701. weekdaysShort: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split(
  52702. '_'
  52703. ),
  52704. weekdaysMin: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split(
  52705. '_'
  52706. ),
  52707. longDateFormat: {
  52708. LT: 'HH:mm',
  52709. LTS: 'HH:mm:ss',
  52710. L: 'DD.MM.YYYY',
  52711. LL: 'D MMMM YYYY',
  52712. LLL: 'D MMMM YYYY HH:mm',
  52713. LLLL: 'dddd, D MMMM YYYY HH:mm',
  52714. },
  52715. calendar: {
  52716. sameDay: '[DaHjaj] LT',
  52717. nextDay: '[wa’leS] LT',
  52718. nextWeek: 'LLL',
  52719. lastDay: '[wa’Hu’] LT',
  52720. lastWeek: 'LLL',
  52721. sameElse: 'L',
  52722. },
  52723. relativeTime: {
  52724. future: translateFuture,
  52725. past: translatePast,
  52726. s: 'puS lup',
  52727. ss: translate,
  52728. m: 'wa’ tup',
  52729. mm: translate,
  52730. h: 'wa’ rep',
  52731. hh: translate,
  52732. d: 'wa’ jaj',
  52733. dd: translate,
  52734. M: 'wa’ jar',
  52735. MM: translate,
  52736. y: 'wa’ DIS',
  52737. yy: translate,
  52738. },
  52739. dayOfMonthOrdinalParse: /\d{1,2}\./,
  52740. ordinal: '%d.',
  52741. week: {
  52742. dow: 1, // Monday is the first day of the week.
  52743. doy: 4, // The week that contains Jan 4th is the first week of the year.
  52744. },
  52745. });
  52746. return tlh;
  52747. })));
  52748. /***/ }),
  52749. /***/ "./node_modules/moment/locale/tr.js":
  52750. /*!******************************************!*\
  52751. !*** ./node_modules/moment/locale/tr.js ***!
  52752. \******************************************/
  52753. /*! no static exports found */
  52754. /***/ (function(module, exports, __webpack_require__) {
  52755. //! moment.js locale configuration
  52756. //! locale : Turkish [tr]
  52757. //! authors : Erhan Gundogan : https://github.com/erhangundogan,
  52758. //! Burak Yiğit Kaya: https://github.com/BYK
  52759. ;(function (global, factory) {
  52760. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  52761. undefined
  52762. }(this, (function (moment) { 'use strict';
  52763. //! moment.js locale configuration
  52764. var suffixes = {
  52765. 1: "'inci",
  52766. 5: "'inci",
  52767. 8: "'inci",
  52768. 70: "'inci",
  52769. 80: "'inci",
  52770. 2: "'nci",
  52771. 7: "'nci",
  52772. 20: "'nci",
  52773. 50: "'nci",
  52774. 3: "'üncü",
  52775. 4: "'üncü",
  52776. 100: "'üncü",
  52777. 6: "'ncı",
  52778. 9: "'uncu",
  52779. 10: "'uncu",
  52780. 30: "'uncu",
  52781. 60: "'ıncı",
  52782. 90: "'ıncı",
  52783. };
  52784. var tr = moment.defineLocale('tr', {
  52785. months: 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split(
  52786. '_'
  52787. ),
  52788. monthsShort: 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),
  52789. weekdays: 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split(
  52790. '_'
  52791. ),
  52792. weekdaysShort: 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),
  52793. weekdaysMin: 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),
  52794. meridiem: function (hours, minutes, isLower) {
  52795. if (hours < 12) {
  52796. return isLower ? 'öö' : 'ÖÖ';
  52797. } else {
  52798. return isLower ? 'ös' : 'ÖS';
  52799. }
  52800. },
  52801. meridiemParse: /öö|ÖÖ|ös|ÖS/,
  52802. isPM: function (input) {
  52803. return input === 'ös' || input === 'ÖS';
  52804. },
  52805. longDateFormat: {
  52806. LT: 'HH:mm',
  52807. LTS: 'HH:mm:ss',
  52808. L: 'DD.MM.YYYY',
  52809. LL: 'D MMMM YYYY',
  52810. LLL: 'D MMMM YYYY HH:mm',
  52811. LLLL: 'dddd, D MMMM YYYY HH:mm',
  52812. },
  52813. calendar: {
  52814. sameDay: '[bugün saat] LT',
  52815. nextDay: '[yarın saat] LT',
  52816. nextWeek: '[gelecek] dddd [saat] LT',
  52817. lastDay: '[dün] LT',
  52818. lastWeek: '[geçen] dddd [saat] LT',
  52819. sameElse: 'L',
  52820. },
  52821. relativeTime: {
  52822. future: '%s sonra',
  52823. past: '%s önce',
  52824. s: 'birkaç saniye',
  52825. ss: '%d saniye',
  52826. m: 'bir dakika',
  52827. mm: '%d dakika',
  52828. h: 'bir saat',
  52829. hh: '%d saat',
  52830. d: 'bir gün',
  52831. dd: '%d gün',
  52832. M: 'bir ay',
  52833. MM: '%d ay',
  52834. y: 'bir yıl',
  52835. yy: '%d yıl',
  52836. },
  52837. ordinal: function (number, period) {
  52838. switch (period) {
  52839. case 'd':
  52840. case 'D':
  52841. case 'Do':
  52842. case 'DD':
  52843. return number;
  52844. default:
  52845. if (number === 0) {
  52846. // special case for zero
  52847. return number + "'ıncı";
  52848. }
  52849. var a = number % 10,
  52850. b = (number % 100) - a,
  52851. c = number >= 100 ? 100 : null;
  52852. return number + (suffixes[a] || suffixes[b] || suffixes[c]);
  52853. }
  52854. },
  52855. week: {
  52856. dow: 1, // Monday is the first day of the week.
  52857. doy: 7, // The week that contains Jan 7th is the first week of the year.
  52858. },
  52859. });
  52860. return tr;
  52861. })));
  52862. /***/ }),
  52863. /***/ "./node_modules/moment/locale/tzl.js":
  52864. /*!*******************************************!*\
  52865. !*** ./node_modules/moment/locale/tzl.js ***!
  52866. \*******************************************/
  52867. /*! no static exports found */
  52868. /***/ (function(module, exports, __webpack_require__) {
  52869. //! moment.js locale configuration
  52870. //! locale : Talossan [tzl]
  52871. //! author : Robin van der Vliet : https://github.com/robin0van0der0v
  52872. //! author : Iustì Canun
  52873. ;(function (global, factory) {
  52874. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  52875. undefined
  52876. }(this, (function (moment) { 'use strict';
  52877. //! moment.js locale configuration
  52878. // After the year there should be a slash and the amount of years since December 26, 1979 in Roman numerals.
  52879. // This is currently too difficult (maybe even impossible) to add.
  52880. var tzl = moment.defineLocale('tzl', {
  52881. months: 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split(
  52882. '_'
  52883. ),
  52884. monthsShort: 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'),
  52885. weekdays: 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'),
  52886. weekdaysShort: 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'),
  52887. weekdaysMin: 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'),
  52888. longDateFormat: {
  52889. LT: 'HH.mm',
  52890. LTS: 'HH.mm.ss',
  52891. L: 'DD.MM.YYYY',
  52892. LL: 'D. MMMM [dallas] YYYY',
  52893. LLL: 'D. MMMM [dallas] YYYY HH.mm',
  52894. LLLL: 'dddd, [li] D. MMMM [dallas] YYYY HH.mm',
  52895. },
  52896. meridiemParse: /d\'o|d\'a/i,
  52897. isPM: function (input) {
  52898. return "d'o" === input.toLowerCase();
  52899. },
  52900. meridiem: function (hours, minutes, isLower) {
  52901. if (hours > 11) {
  52902. return isLower ? "d'o" : "D'O";
  52903. } else {
  52904. return isLower ? "d'a" : "D'A";
  52905. }
  52906. },
  52907. calendar: {
  52908. sameDay: '[oxhi à] LT',
  52909. nextDay: '[demà à] LT',
  52910. nextWeek: 'dddd [à] LT',
  52911. lastDay: '[ieiri à] LT',
  52912. lastWeek: '[sür el] dddd [lasteu à] LT',
  52913. sameElse: 'L',
  52914. },
  52915. relativeTime: {
  52916. future: 'osprei %s',
  52917. past: 'ja%s',
  52918. s: processRelativeTime,
  52919. ss: processRelativeTime,
  52920. m: processRelativeTime,
  52921. mm: processRelativeTime,
  52922. h: processRelativeTime,
  52923. hh: processRelativeTime,
  52924. d: processRelativeTime,
  52925. dd: processRelativeTime,
  52926. M: processRelativeTime,
  52927. MM: processRelativeTime,
  52928. y: processRelativeTime,
  52929. yy: processRelativeTime,
  52930. },
  52931. dayOfMonthOrdinalParse: /\d{1,2}\./,
  52932. ordinal: '%d.',
  52933. week: {
  52934. dow: 1, // Monday is the first day of the week.
  52935. doy: 4, // The week that contains Jan 4th is the first week of the year.
  52936. },
  52937. });
  52938. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  52939. var format = {
  52940. s: ['viensas secunds', "'iensas secunds"],
  52941. ss: [number + ' secunds', '' + number + ' secunds'],
  52942. m: ["'n míut", "'iens míut"],
  52943. mm: [number + ' míuts', '' + number + ' míuts'],
  52944. h: ["'n þora", "'iensa þora"],
  52945. hh: [number + ' þoras', '' + number + ' þoras'],
  52946. d: ["'n ziua", "'iensa ziua"],
  52947. dd: [number + ' ziuas', '' + number + ' ziuas'],
  52948. M: ["'n mes", "'iens mes"],
  52949. MM: [number + ' mesen', '' + number + ' mesen'],
  52950. y: ["'n ar", "'iens ar"],
  52951. yy: [number + ' ars', '' + number + ' ars'],
  52952. };
  52953. return isFuture
  52954. ? format[key][0]
  52955. : withoutSuffix
  52956. ? format[key][0]
  52957. : format[key][1];
  52958. }
  52959. return tzl;
  52960. })));
  52961. /***/ }),
  52962. /***/ "./node_modules/moment/locale/tzm-latn.js":
  52963. /*!************************************************!*\
  52964. !*** ./node_modules/moment/locale/tzm-latn.js ***!
  52965. \************************************************/
  52966. /*! no static exports found */
  52967. /***/ (function(module, exports, __webpack_require__) {
  52968. //! moment.js locale configuration
  52969. //! locale : Central Atlas Tamazight Latin [tzm-latn]
  52970. //! author : Abdel Said : https://github.com/abdelsaid
  52971. ;(function (global, factory) {
  52972. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  52973. undefined
  52974. }(this, (function (moment) { 'use strict';
  52975. //! moment.js locale configuration
  52976. var tzmLatn = moment.defineLocale('tzm-latn', {
  52977. months: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split(
  52978. '_'
  52979. ),
  52980. monthsShort: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split(
  52981. '_'
  52982. ),
  52983. weekdays: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
  52984. weekdaysShort: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
  52985. weekdaysMin: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
  52986. longDateFormat: {
  52987. LT: 'HH:mm',
  52988. LTS: 'HH:mm:ss',
  52989. L: 'DD/MM/YYYY',
  52990. LL: 'D MMMM YYYY',
  52991. LLL: 'D MMMM YYYY HH:mm',
  52992. LLLL: 'dddd D MMMM YYYY HH:mm',
  52993. },
  52994. calendar: {
  52995. sameDay: '[asdkh g] LT',
  52996. nextDay: '[aska g] LT',
  52997. nextWeek: 'dddd [g] LT',
  52998. lastDay: '[assant g] LT',
  52999. lastWeek: 'dddd [g] LT',
  53000. sameElse: 'L',
  53001. },
  53002. relativeTime: {
  53003. future: 'dadkh s yan %s',
  53004. past: 'yan %s',
  53005. s: 'imik',
  53006. ss: '%d imik',
  53007. m: 'minuḍ',
  53008. mm: '%d minuḍ',
  53009. h: 'saɛa',
  53010. hh: '%d tassaɛin',
  53011. d: 'ass',
  53012. dd: '%d ossan',
  53013. M: 'ayowr',
  53014. MM: '%d iyyirn',
  53015. y: 'asgas',
  53016. yy: '%d isgasn',
  53017. },
  53018. week: {
  53019. dow: 6, // Saturday is the first day of the week.
  53020. doy: 12, // The week that contains Jan 12th is the first week of the year.
  53021. },
  53022. });
  53023. return tzmLatn;
  53024. })));
  53025. /***/ }),
  53026. /***/ "./node_modules/moment/locale/tzm.js":
  53027. /*!*******************************************!*\
  53028. !*** ./node_modules/moment/locale/tzm.js ***!
  53029. \*******************************************/
  53030. /*! no static exports found */
  53031. /***/ (function(module, exports, __webpack_require__) {
  53032. //! moment.js locale configuration
  53033. //! locale : Central Atlas Tamazight [tzm]
  53034. //! author : Abdel Said : https://github.com/abdelsaid
  53035. ;(function (global, factory) {
  53036. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  53037. undefined
  53038. }(this, (function (moment) { 'use strict';
  53039. //! moment.js locale configuration
  53040. var tzm = moment.defineLocale('tzm', {
  53041. months: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split(
  53042. '_'
  53043. ),
  53044. monthsShort: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split(
  53045. '_'
  53046. ),
  53047. weekdays: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
  53048. weekdaysShort: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
  53049. weekdaysMin: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
  53050. longDateFormat: {
  53051. LT: 'HH:mm',
  53052. LTS: 'HH:mm:ss',
  53053. L: 'DD/MM/YYYY',
  53054. LL: 'D MMMM YYYY',
  53055. LLL: 'D MMMM YYYY HH:mm',
  53056. LLLL: 'dddd D MMMM YYYY HH:mm',
  53057. },
  53058. calendar: {
  53059. sameDay: '[ⴰⵙⴷⵅ ⴴ] LT',
  53060. nextDay: '[ⴰⵙⴽⴰ ⴴ] LT',
  53061. nextWeek: 'dddd [ⴴ] LT',
  53062. lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT',
  53063. lastWeek: 'dddd [ⴴ] LT',
  53064. sameElse: 'L',
  53065. },
  53066. relativeTime: {
  53067. future: 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',
  53068. past: 'ⵢⴰⵏ %s',
  53069. s: 'ⵉⵎⵉⴽ',
  53070. ss: '%d ⵉⵎⵉⴽ',
  53071. m: 'ⵎⵉⵏⵓⴺ',
  53072. mm: '%d ⵎⵉⵏⵓⴺ',
  53073. h: 'ⵙⴰⵄⴰ',
  53074. hh: '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',
  53075. d: 'ⴰⵙⵙ',
  53076. dd: '%d oⵙⵙⴰⵏ',
  53077. M: 'ⴰⵢoⵓⵔ',
  53078. MM: '%d ⵉⵢⵢⵉⵔⵏ',
  53079. y: 'ⴰⵙⴳⴰⵙ',
  53080. yy: '%d ⵉⵙⴳⴰⵙⵏ',
  53081. },
  53082. week: {
  53083. dow: 6, // Saturday is the first day of the week.
  53084. doy: 12, // The week that contains Jan 12th is the first week of the year.
  53085. },
  53086. });
  53087. return tzm;
  53088. })));
  53089. /***/ }),
  53090. /***/ "./node_modules/moment/locale/ug-cn.js":
  53091. /*!*********************************************!*\
  53092. !*** ./node_modules/moment/locale/ug-cn.js ***!
  53093. \*********************************************/
  53094. /*! no static exports found */
  53095. /***/ (function(module, exports, __webpack_require__) {
  53096. //! moment.js locale configuration
  53097. //! locale : Uyghur (China) [ug-cn]
  53098. //! author: boyaq : https://github.com/boyaq
  53099. ;(function (global, factory) {
  53100. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  53101. undefined
  53102. }(this, (function (moment) { 'use strict';
  53103. //! moment.js locale configuration
  53104. var ugCn = moment.defineLocale('ug-cn', {
  53105. months: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split(
  53106. '_'
  53107. ),
  53108. monthsShort: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split(
  53109. '_'
  53110. ),
  53111. weekdays: 'يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە'.split(
  53112. '_'
  53113. ),
  53114. weekdaysShort: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),
  53115. weekdaysMin: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),
  53116. longDateFormat: {
  53117. LT: 'HH:mm',
  53118. LTS: 'HH:mm:ss',
  53119. L: 'YYYY-MM-DD',
  53120. LL: 'YYYY-يىلىM-ئاينىڭD-كۈنى',
  53121. LLL: 'YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm',
  53122. LLLL: 'dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm',
  53123. },
  53124. meridiemParse: /يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,
  53125. meridiemHour: function (hour, meridiem) {
  53126. if (hour === 12) {
  53127. hour = 0;
  53128. }
  53129. if (
  53130. meridiem === 'يېرىم كېچە' ||
  53131. meridiem === 'سەھەر' ||
  53132. meridiem === 'چۈشتىن بۇرۇن'
  53133. ) {
  53134. return hour;
  53135. } else if (meridiem === 'چۈشتىن كېيىن' || meridiem === 'كەچ') {
  53136. return hour + 12;
  53137. } else {
  53138. return hour >= 11 ? hour : hour + 12;
  53139. }
  53140. },
  53141. meridiem: function (hour, minute, isLower) {
  53142. var hm = hour * 100 + minute;
  53143. if (hm < 600) {
  53144. return 'يېرىم كېچە';
  53145. } else if (hm < 900) {
  53146. return 'سەھەر';
  53147. } else if (hm < 1130) {
  53148. return 'چۈشتىن بۇرۇن';
  53149. } else if (hm < 1230) {
  53150. return 'چۈش';
  53151. } else if (hm < 1800) {
  53152. return 'چۈشتىن كېيىن';
  53153. } else {
  53154. return 'كەچ';
  53155. }
  53156. },
  53157. calendar: {
  53158. sameDay: '[بۈگۈن سائەت] LT',
  53159. nextDay: '[ئەتە سائەت] LT',
  53160. nextWeek: '[كېلەركى] dddd [سائەت] LT',
  53161. lastDay: '[تۆنۈگۈن] LT',
  53162. lastWeek: '[ئالدىنقى] dddd [سائەت] LT',
  53163. sameElse: 'L',
  53164. },
  53165. relativeTime: {
  53166. future: '%s كېيىن',
  53167. past: '%s بۇرۇن',
  53168. s: 'نەچچە سېكونت',
  53169. ss: '%d سېكونت',
  53170. m: 'بىر مىنۇت',
  53171. mm: '%d مىنۇت',
  53172. h: 'بىر سائەت',
  53173. hh: '%d سائەت',
  53174. d: 'بىر كۈن',
  53175. dd: '%d كۈن',
  53176. M: 'بىر ئاي',
  53177. MM: '%d ئاي',
  53178. y: 'بىر يىل',
  53179. yy: '%d يىل',
  53180. },
  53181. dayOfMonthOrdinalParse: /\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,
  53182. ordinal: function (number, period) {
  53183. switch (period) {
  53184. case 'd':
  53185. case 'D':
  53186. case 'DDD':
  53187. return number + '-كۈنى';
  53188. case 'w':
  53189. case 'W':
  53190. return number + '-ھەپتە';
  53191. default:
  53192. return number;
  53193. }
  53194. },
  53195. preparse: function (string) {
  53196. return string.replace(/،/g, ',');
  53197. },
  53198. postformat: function (string) {
  53199. return string.replace(/,/g, '،');
  53200. },
  53201. week: {
  53202. // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
  53203. dow: 1, // Monday is the first day of the week.
  53204. doy: 7, // The week that contains Jan 1st is the first week of the year.
  53205. },
  53206. });
  53207. return ugCn;
  53208. })));
  53209. /***/ }),
  53210. /***/ "./node_modules/moment/locale/uk.js":
  53211. /*!******************************************!*\
  53212. !*** ./node_modules/moment/locale/uk.js ***!
  53213. \******************************************/
  53214. /*! no static exports found */
  53215. /***/ (function(module, exports, __webpack_require__) {
  53216. //! moment.js locale configuration
  53217. //! locale : Ukrainian [uk]
  53218. //! author : zemlanin : https://github.com/zemlanin
  53219. //! Author : Menelion Elensúle : https://github.com/Oire
  53220. ;(function (global, factory) {
  53221. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  53222. undefined
  53223. }(this, (function (moment) { 'use strict';
  53224. //! moment.js locale configuration
  53225. function plural(word, num) {
  53226. var forms = word.split('_');
  53227. return num % 10 === 1 && num % 100 !== 11
  53228. ? forms[0]
  53229. : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)
  53230. ? forms[1]
  53231. : forms[2];
  53232. }
  53233. function relativeTimeWithPlural(number, withoutSuffix, key) {
  53234. var format = {
  53235. ss: withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд',
  53236. mm: withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',
  53237. hh: withoutSuffix ? 'година_години_годин' : 'годину_години_годин',
  53238. dd: 'день_дні_днів',
  53239. MM: 'місяць_місяці_місяців',
  53240. yy: 'рік_роки_років',
  53241. };
  53242. if (key === 'm') {
  53243. return withoutSuffix ? 'хвилина' : 'хвилину';
  53244. } else if (key === 'h') {
  53245. return withoutSuffix ? 'година' : 'годину';
  53246. } else {
  53247. return number + ' ' + plural(format[key], +number);
  53248. }
  53249. }
  53250. function weekdaysCaseReplace(m, format) {
  53251. var weekdays = {
  53252. nominative: 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split(
  53253. '_'
  53254. ),
  53255. accusative: 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split(
  53256. '_'
  53257. ),
  53258. genitive: 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split(
  53259. '_'
  53260. ),
  53261. },
  53262. nounCase;
  53263. if (m === true) {
  53264. return weekdays['nominative']
  53265. .slice(1, 7)
  53266. .concat(weekdays['nominative'].slice(0, 1));
  53267. }
  53268. if (!m) {
  53269. return weekdays['nominative'];
  53270. }
  53271. nounCase = /(\[[ВвУу]\]) ?dddd/.test(format)
  53272. ? 'accusative'
  53273. : /\[?(?:минулої|наступної)? ?\] ?dddd/.test(format)
  53274. ? 'genitive'
  53275. : 'nominative';
  53276. return weekdays[nounCase][m.day()];
  53277. }
  53278. function processHoursFunction(str) {
  53279. return function () {
  53280. return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';
  53281. };
  53282. }
  53283. var uk = moment.defineLocale('uk', {
  53284. months: {
  53285. format: 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split(
  53286. '_'
  53287. ),
  53288. standalone: 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split(
  53289. '_'
  53290. ),
  53291. },
  53292. monthsShort: 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split(
  53293. '_'
  53294. ),
  53295. weekdays: weekdaysCaseReplace,
  53296. weekdaysShort: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  53297. weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  53298. longDateFormat: {
  53299. LT: 'HH:mm',
  53300. LTS: 'HH:mm:ss',
  53301. L: 'DD.MM.YYYY',
  53302. LL: 'D MMMM YYYY р.',
  53303. LLL: 'D MMMM YYYY р., HH:mm',
  53304. LLLL: 'dddd, D MMMM YYYY р., HH:mm',
  53305. },
  53306. calendar: {
  53307. sameDay: processHoursFunction('[Сьогодні '),
  53308. nextDay: processHoursFunction('[Завтра '),
  53309. lastDay: processHoursFunction('[Вчора '),
  53310. nextWeek: processHoursFunction('[У] dddd ['),
  53311. lastWeek: function () {
  53312. switch (this.day()) {
  53313. case 0:
  53314. case 3:
  53315. case 5:
  53316. case 6:
  53317. return processHoursFunction('[Минулої] dddd [').call(this);
  53318. case 1:
  53319. case 2:
  53320. case 4:
  53321. return processHoursFunction('[Минулого] dddd [').call(this);
  53322. }
  53323. },
  53324. sameElse: 'L',
  53325. },
  53326. relativeTime: {
  53327. future: 'за %s',
  53328. past: '%s тому',
  53329. s: 'декілька секунд',
  53330. ss: relativeTimeWithPlural,
  53331. m: relativeTimeWithPlural,
  53332. mm: relativeTimeWithPlural,
  53333. h: 'годину',
  53334. hh: relativeTimeWithPlural,
  53335. d: 'день',
  53336. dd: relativeTimeWithPlural,
  53337. M: 'місяць',
  53338. MM: relativeTimeWithPlural,
  53339. y: 'рік',
  53340. yy: relativeTimeWithPlural,
  53341. },
  53342. // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason
  53343. meridiemParse: /ночі|ранку|дня|вечора/,
  53344. isPM: function (input) {
  53345. return /^(дня|вечора)$/.test(input);
  53346. },
  53347. meridiem: function (hour, minute, isLower) {
  53348. if (hour < 4) {
  53349. return 'ночі';
  53350. } else if (hour < 12) {
  53351. return 'ранку';
  53352. } else if (hour < 17) {
  53353. return 'дня';
  53354. } else {
  53355. return 'вечора';
  53356. }
  53357. },
  53358. dayOfMonthOrdinalParse: /\d{1,2}-(й|го)/,
  53359. ordinal: function (number, period) {
  53360. switch (period) {
  53361. case 'M':
  53362. case 'd':
  53363. case 'DDD':
  53364. case 'w':
  53365. case 'W':
  53366. return number + '-й';
  53367. case 'D':
  53368. return number + '-го';
  53369. default:
  53370. return number;
  53371. }
  53372. },
  53373. week: {
  53374. dow: 1, // Monday is the first day of the week.
  53375. doy: 7, // The week that contains Jan 7th is the first week of the year.
  53376. },
  53377. });
  53378. return uk;
  53379. })));
  53380. /***/ }),
  53381. /***/ "./node_modules/moment/locale/ur.js":
  53382. /*!******************************************!*\
  53383. !*** ./node_modules/moment/locale/ur.js ***!
  53384. \******************************************/
  53385. /*! no static exports found */
  53386. /***/ (function(module, exports, __webpack_require__) {
  53387. //! moment.js locale configuration
  53388. //! locale : Urdu [ur]
  53389. //! author : Sawood Alam : https://github.com/ibnesayeed
  53390. //! author : Zack : https://github.com/ZackVision
  53391. ;(function (global, factory) {
  53392. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  53393. undefined
  53394. }(this, (function (moment) { 'use strict';
  53395. //! moment.js locale configuration
  53396. var months = [
  53397. 'جنوری',
  53398. 'فروری',
  53399. 'مارچ',
  53400. 'اپریل',
  53401. 'مئی',
  53402. 'جون',
  53403. 'جولائی',
  53404. 'اگست',
  53405. 'ستمبر',
  53406. 'اکتوبر',
  53407. 'نومبر',
  53408. 'دسمبر',
  53409. ],
  53410. days = ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'ہفتہ'];
  53411. var ur = moment.defineLocale('ur', {
  53412. months: months,
  53413. monthsShort: months,
  53414. weekdays: days,
  53415. weekdaysShort: days,
  53416. weekdaysMin: days,
  53417. longDateFormat: {
  53418. LT: 'HH:mm',
  53419. LTS: 'HH:mm:ss',
  53420. L: 'DD/MM/YYYY',
  53421. LL: 'D MMMM YYYY',
  53422. LLL: 'D MMMM YYYY HH:mm',
  53423. LLLL: 'dddd، D MMMM YYYY HH:mm',
  53424. },
  53425. meridiemParse: /صبح|شام/,
  53426. isPM: function (input) {
  53427. return 'شام' === input;
  53428. },
  53429. meridiem: function (hour, minute, isLower) {
  53430. if (hour < 12) {
  53431. return 'صبح';
  53432. }
  53433. return 'شام';
  53434. },
  53435. calendar: {
  53436. sameDay: '[آج بوقت] LT',
  53437. nextDay: '[کل بوقت] LT',
  53438. nextWeek: 'dddd [بوقت] LT',
  53439. lastDay: '[گذشتہ روز بوقت] LT',
  53440. lastWeek: '[گذشتہ] dddd [بوقت] LT',
  53441. sameElse: 'L',
  53442. },
  53443. relativeTime: {
  53444. future: '%s بعد',
  53445. past: '%s قبل',
  53446. s: 'چند سیکنڈ',
  53447. ss: '%d سیکنڈ',
  53448. m: 'ایک منٹ',
  53449. mm: '%d منٹ',
  53450. h: 'ایک گھنٹہ',
  53451. hh: '%d گھنٹے',
  53452. d: 'ایک دن',
  53453. dd: '%d دن',
  53454. M: 'ایک ماہ',
  53455. MM: '%d ماہ',
  53456. y: 'ایک سال',
  53457. yy: '%d سال',
  53458. },
  53459. preparse: function (string) {
  53460. return string.replace(/،/g, ',');
  53461. },
  53462. postformat: function (string) {
  53463. return string.replace(/,/g, '،');
  53464. },
  53465. week: {
  53466. dow: 1, // Monday is the first day of the week.
  53467. doy: 4, // The week that contains Jan 4th is the first week of the year.
  53468. },
  53469. });
  53470. return ur;
  53471. })));
  53472. /***/ }),
  53473. /***/ "./node_modules/moment/locale/uz-latn.js":
  53474. /*!***********************************************!*\
  53475. !*** ./node_modules/moment/locale/uz-latn.js ***!
  53476. \***********************************************/
  53477. /*! no static exports found */
  53478. /***/ (function(module, exports, __webpack_require__) {
  53479. //! moment.js locale configuration
  53480. //! locale : Uzbek Latin [uz-latn]
  53481. //! author : Rasulbek Mirzayev : github.com/Rasulbeeek
  53482. ;(function (global, factory) {
  53483. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  53484. undefined
  53485. }(this, (function (moment) { 'use strict';
  53486. //! moment.js locale configuration
  53487. var uzLatn = moment.defineLocale('uz-latn', {
  53488. months: 'Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr'.split(
  53489. '_'
  53490. ),
  53491. monthsShort: 'Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek'.split('_'),
  53492. weekdays: 'Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba'.split(
  53493. '_'
  53494. ),
  53495. weekdaysShort: 'Yak_Dush_Sesh_Chor_Pay_Jum_Shan'.split('_'),
  53496. weekdaysMin: 'Ya_Du_Se_Cho_Pa_Ju_Sha'.split('_'),
  53497. longDateFormat: {
  53498. LT: 'HH:mm',
  53499. LTS: 'HH:mm:ss',
  53500. L: 'DD/MM/YYYY',
  53501. LL: 'D MMMM YYYY',
  53502. LLL: 'D MMMM YYYY HH:mm',
  53503. LLLL: 'D MMMM YYYY, dddd HH:mm',
  53504. },
  53505. calendar: {
  53506. sameDay: '[Bugun soat] LT [da]',
  53507. nextDay: '[Ertaga] LT [da]',
  53508. nextWeek: 'dddd [kuni soat] LT [da]',
  53509. lastDay: '[Kecha soat] LT [da]',
  53510. lastWeek: "[O'tgan] dddd [kuni soat] LT [da]",
  53511. sameElse: 'L',
  53512. },
  53513. relativeTime: {
  53514. future: 'Yaqin %s ichida',
  53515. past: 'Bir necha %s oldin',
  53516. s: 'soniya',
  53517. ss: '%d soniya',
  53518. m: 'bir daqiqa',
  53519. mm: '%d daqiqa',
  53520. h: 'bir soat',
  53521. hh: '%d soat',
  53522. d: 'bir kun',
  53523. dd: '%d kun',
  53524. M: 'bir oy',
  53525. MM: '%d oy',
  53526. y: 'bir yil',
  53527. yy: '%d yil',
  53528. },
  53529. week: {
  53530. dow: 1, // Monday is the first day of the week.
  53531. doy: 7, // The week that contains Jan 7th is the first week of the year.
  53532. },
  53533. });
  53534. return uzLatn;
  53535. })));
  53536. /***/ }),
  53537. /***/ "./node_modules/moment/locale/uz.js":
  53538. /*!******************************************!*\
  53539. !*** ./node_modules/moment/locale/uz.js ***!
  53540. \******************************************/
  53541. /*! no static exports found */
  53542. /***/ (function(module, exports, __webpack_require__) {
  53543. //! moment.js locale configuration
  53544. //! locale : Uzbek [uz]
  53545. //! author : Sardor Muminov : https://github.com/muminoff
  53546. ;(function (global, factory) {
  53547. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  53548. undefined
  53549. }(this, (function (moment) { 'use strict';
  53550. //! moment.js locale configuration
  53551. var uz = moment.defineLocale('uz', {
  53552. months: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split(
  53553. '_'
  53554. ),
  53555. monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
  53556. weekdays: 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),
  53557. weekdaysShort: 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),
  53558. weekdaysMin: 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),
  53559. longDateFormat: {
  53560. LT: 'HH:mm',
  53561. LTS: 'HH:mm:ss',
  53562. L: 'DD/MM/YYYY',
  53563. LL: 'D MMMM YYYY',
  53564. LLL: 'D MMMM YYYY HH:mm',
  53565. LLLL: 'D MMMM YYYY, dddd HH:mm',
  53566. },
  53567. calendar: {
  53568. sameDay: '[Бугун соат] LT [да]',
  53569. nextDay: '[Эртага] LT [да]',
  53570. nextWeek: 'dddd [куни соат] LT [да]',
  53571. lastDay: '[Кеча соат] LT [да]',
  53572. lastWeek: '[Утган] dddd [куни соат] LT [да]',
  53573. sameElse: 'L',
  53574. },
  53575. relativeTime: {
  53576. future: 'Якин %s ичида',
  53577. past: 'Бир неча %s олдин',
  53578. s: 'фурсат',
  53579. ss: '%d фурсат',
  53580. m: 'бир дакика',
  53581. mm: '%d дакика',
  53582. h: 'бир соат',
  53583. hh: '%d соат',
  53584. d: 'бир кун',
  53585. dd: '%d кун',
  53586. M: 'бир ой',
  53587. MM: '%d ой',
  53588. y: 'бир йил',
  53589. yy: '%d йил',
  53590. },
  53591. week: {
  53592. dow: 1, // Monday is the first day of the week.
  53593. doy: 7, // The week that contains Jan 4th is the first week of the year.
  53594. },
  53595. });
  53596. return uz;
  53597. })));
  53598. /***/ }),
  53599. /***/ "./node_modules/moment/locale/vi.js":
  53600. /*!******************************************!*\
  53601. !*** ./node_modules/moment/locale/vi.js ***!
  53602. \******************************************/
  53603. /*! no static exports found */
  53604. /***/ (function(module, exports, __webpack_require__) {
  53605. //! moment.js locale configuration
  53606. //! locale : Vietnamese [vi]
  53607. //! author : Bang Nguyen : https://github.com/bangnk
  53608. //! author : Chien Kira : https://github.com/chienkira
  53609. ;(function (global, factory) {
  53610. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  53611. undefined
  53612. }(this, (function (moment) { 'use strict';
  53613. //! moment.js locale configuration
  53614. var vi = moment.defineLocale('vi', {
  53615. months: 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split(
  53616. '_'
  53617. ),
  53618. monthsShort: 'Thg 01_Thg 02_Thg 03_Thg 04_Thg 05_Thg 06_Thg 07_Thg 08_Thg 09_Thg 10_Thg 11_Thg 12'.split(
  53619. '_'
  53620. ),
  53621. monthsParseExact: true,
  53622. weekdays: 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split(
  53623. '_'
  53624. ),
  53625. weekdaysShort: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
  53626. weekdaysMin: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
  53627. weekdaysParseExact: true,
  53628. meridiemParse: /sa|ch/i,
  53629. isPM: function (input) {
  53630. return /^ch$/i.test(input);
  53631. },
  53632. meridiem: function (hours, minutes, isLower) {
  53633. if (hours < 12) {
  53634. return isLower ? 'sa' : 'SA';
  53635. } else {
  53636. return isLower ? 'ch' : 'CH';
  53637. }
  53638. },
  53639. longDateFormat: {
  53640. LT: 'HH:mm',
  53641. LTS: 'HH:mm:ss',
  53642. L: 'DD/MM/YYYY',
  53643. LL: 'D MMMM [năm] YYYY',
  53644. LLL: 'D MMMM [năm] YYYY HH:mm',
  53645. LLLL: 'dddd, D MMMM [năm] YYYY HH:mm',
  53646. l: 'DD/M/YYYY',
  53647. ll: 'D MMM YYYY',
  53648. lll: 'D MMM YYYY HH:mm',
  53649. llll: 'ddd, D MMM YYYY HH:mm',
  53650. },
  53651. calendar: {
  53652. sameDay: '[Hôm nay lúc] LT',
  53653. nextDay: '[Ngày mai lúc] LT',
  53654. nextWeek: 'dddd [tuần tới lúc] LT',
  53655. lastDay: '[Hôm qua lúc] LT',
  53656. lastWeek: 'dddd [tuần trước lúc] LT',
  53657. sameElse: 'L',
  53658. },
  53659. relativeTime: {
  53660. future: '%s tới',
  53661. past: '%s trước',
  53662. s: 'vài giây',
  53663. ss: '%d giây',
  53664. m: 'một phút',
  53665. mm: '%d phút',
  53666. h: 'một giờ',
  53667. hh: '%d giờ',
  53668. d: 'một ngày',
  53669. dd: '%d ngày',
  53670. M: 'một tháng',
  53671. MM: '%d tháng',
  53672. y: 'một năm',
  53673. yy: '%d năm',
  53674. },
  53675. dayOfMonthOrdinalParse: /\d{1,2}/,
  53676. ordinal: function (number) {
  53677. return number;
  53678. },
  53679. week: {
  53680. dow: 1, // Monday is the first day of the week.
  53681. doy: 4, // The week that contains Jan 4th is the first week of the year.
  53682. },
  53683. });
  53684. return vi;
  53685. })));
  53686. /***/ }),
  53687. /***/ "./node_modules/moment/locale/x-pseudo.js":
  53688. /*!************************************************!*\
  53689. !*** ./node_modules/moment/locale/x-pseudo.js ***!
  53690. \************************************************/
  53691. /*! no static exports found */
  53692. /***/ (function(module, exports, __webpack_require__) {
  53693. //! moment.js locale configuration
  53694. //! locale : Pseudo [x-pseudo]
  53695. //! author : Andrew Hood : https://github.com/andrewhood125
  53696. ;(function (global, factory) {
  53697. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  53698. undefined
  53699. }(this, (function (moment) { 'use strict';
  53700. //! moment.js locale configuration
  53701. var xPseudo = moment.defineLocale('x-pseudo', {
  53702. months: 'J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér'.split(
  53703. '_'
  53704. ),
  53705. monthsShort: 'J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc'.split(
  53706. '_'
  53707. ),
  53708. monthsParseExact: true,
  53709. weekdays: 'S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý'.split(
  53710. '_'
  53711. ),
  53712. weekdaysShort: 'S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát'.split('_'),
  53713. weekdaysMin: 'S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá'.split('_'),
  53714. weekdaysParseExact: true,
  53715. longDateFormat: {
  53716. LT: 'HH:mm',
  53717. L: 'DD/MM/YYYY',
  53718. LL: 'D MMMM YYYY',
  53719. LLL: 'D MMMM YYYY HH:mm',
  53720. LLLL: 'dddd, D MMMM YYYY HH:mm',
  53721. },
  53722. calendar: {
  53723. sameDay: '[T~ódá~ý át] LT',
  53724. nextDay: '[T~ómó~rró~w át] LT',
  53725. nextWeek: 'dddd [át] LT',
  53726. lastDay: '[Ý~ést~érdá~ý át] LT',
  53727. lastWeek: '[L~ást] dddd [át] LT',
  53728. sameElse: 'L',
  53729. },
  53730. relativeTime: {
  53731. future: 'í~ñ %s',
  53732. past: '%s á~gó',
  53733. s: 'á ~féw ~sécó~ñds',
  53734. ss: '%d s~écóñ~ds',
  53735. m: 'á ~míñ~úté',
  53736. mm: '%d m~íñú~tés',
  53737. h: 'á~ñ hó~úr',
  53738. hh: '%d h~óúrs',
  53739. d: 'á ~dáý',
  53740. dd: '%d d~áýs',
  53741. M: 'á ~móñ~th',
  53742. MM: '%d m~óñt~hs',
  53743. y: 'á ~ýéár',
  53744. yy: '%d ý~éárs',
  53745. },
  53746. dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
  53747. ordinal: function (number) {
  53748. var b = number % 10,
  53749. output =
  53750. ~~((number % 100) / 10) === 1
  53751. ? 'th'
  53752. : b === 1
  53753. ? 'st'
  53754. : b === 2
  53755. ? 'nd'
  53756. : b === 3
  53757. ? 'rd'
  53758. : 'th';
  53759. return number + output;
  53760. },
  53761. week: {
  53762. dow: 1, // Monday is the first day of the week.
  53763. doy: 4, // The week that contains Jan 4th is the first week of the year.
  53764. },
  53765. });
  53766. return xPseudo;
  53767. })));
  53768. /***/ }),
  53769. /***/ "./node_modules/moment/locale/yo.js":
  53770. /*!******************************************!*\
  53771. !*** ./node_modules/moment/locale/yo.js ***!
  53772. \******************************************/
  53773. /*! no static exports found */
  53774. /***/ (function(module, exports, __webpack_require__) {
  53775. //! moment.js locale configuration
  53776. //! locale : Yoruba Nigeria [yo]
  53777. //! author : Atolagbe Abisoye : https://github.com/andela-batolagbe
  53778. ;(function (global, factory) {
  53779. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  53780. undefined
  53781. }(this, (function (moment) { 'use strict';
  53782. //! moment.js locale configuration
  53783. var yo = moment.defineLocale('yo', {
  53784. months: 'Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀'.split(
  53785. '_'
  53786. ),
  53787. monthsShort: 'Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀'.split('_'),
  53788. weekdays: 'Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta'.split('_'),
  53789. weekdaysShort: 'Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá'.split('_'),
  53790. weekdaysMin: 'Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb'.split('_'),
  53791. longDateFormat: {
  53792. LT: 'h:mm A',
  53793. LTS: 'h:mm:ss A',
  53794. L: 'DD/MM/YYYY',
  53795. LL: 'D MMMM YYYY',
  53796. LLL: 'D MMMM YYYY h:mm A',
  53797. LLLL: 'dddd, D MMMM YYYY h:mm A',
  53798. },
  53799. calendar: {
  53800. sameDay: '[Ònì ni] LT',
  53801. nextDay: '[Ọ̀la ni] LT',
  53802. nextWeek: "dddd [Ọsẹ̀ tón'bọ] [ni] LT",
  53803. lastDay: '[Àna ni] LT',
  53804. lastWeek: 'dddd [Ọsẹ̀ tólọ́] [ni] LT',
  53805. sameElse: 'L',
  53806. },
  53807. relativeTime: {
  53808. future: 'ní %s',
  53809. past: '%s kọjá',
  53810. s: 'ìsẹjú aayá die',
  53811. ss: 'aayá %d',
  53812. m: 'ìsẹjú kan',
  53813. mm: 'ìsẹjú %d',
  53814. h: 'wákati kan',
  53815. hh: 'wákati %d',
  53816. d: 'ọjọ́ kan',
  53817. dd: 'ọjọ́ %d',
  53818. M: 'osù kan',
  53819. MM: 'osù %d',
  53820. y: 'ọdún kan',
  53821. yy: 'ọdún %d',
  53822. },
  53823. dayOfMonthOrdinalParse: /ọjọ́\s\d{1,2}/,
  53824. ordinal: 'ọjọ́ %d',
  53825. week: {
  53826. dow: 1, // Monday is the first day of the week.
  53827. doy: 4, // The week that contains Jan 4th is the first week of the year.
  53828. },
  53829. });
  53830. return yo;
  53831. })));
  53832. /***/ }),
  53833. /***/ "./node_modules/moment/locale/zh-cn.js":
  53834. /*!*********************************************!*\
  53835. !*** ./node_modules/moment/locale/zh-cn.js ***!
  53836. \*********************************************/
  53837. /*! no static exports found */
  53838. /***/ (function(module, exports, __webpack_require__) {
  53839. //! moment.js locale configuration
  53840. //! locale : Chinese (China) [zh-cn]
  53841. //! author : suupic : https://github.com/suupic
  53842. //! author : Zeno Zeng : https://github.com/zenozeng
  53843. //! author : uu109 : https://github.com/uu109
  53844. ;(function (global, factory) {
  53845. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  53846. undefined
  53847. }(this, (function (moment) { 'use strict';
  53848. //! moment.js locale configuration
  53849. var zhCn = moment.defineLocale('zh-cn', {
  53850. months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
  53851. '_'
  53852. ),
  53853. monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
  53854. '_'
  53855. ),
  53856. weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  53857. weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'),
  53858. weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
  53859. longDateFormat: {
  53860. LT: 'HH:mm',
  53861. LTS: 'HH:mm:ss',
  53862. L: 'YYYY/MM/DD',
  53863. LL: 'YYYY年M月D日',
  53864. LLL: 'YYYY年M月D日Ah点mm分',
  53865. LLLL: 'YYYY年M月D日ddddAh点mm分',
  53866. l: 'YYYY/M/D',
  53867. ll: 'YYYY年M月D日',
  53868. lll: 'YYYY年M月D日 HH:mm',
  53869. llll: 'YYYY年M月D日dddd HH:mm',
  53870. },
  53871. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  53872. meridiemHour: function (hour, meridiem) {
  53873. if (hour === 12) {
  53874. hour = 0;
  53875. }
  53876. if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
  53877. return hour;
  53878. } else if (meridiem === '下午' || meridiem === '晚上') {
  53879. return hour + 12;
  53880. } else {
  53881. // '中午'
  53882. return hour >= 11 ? hour : hour + 12;
  53883. }
  53884. },
  53885. meridiem: function (hour, minute, isLower) {
  53886. var hm = hour * 100 + minute;
  53887. if (hm < 600) {
  53888. return '凌晨';
  53889. } else if (hm < 900) {
  53890. return '早上';
  53891. } else if (hm < 1130) {
  53892. return '上午';
  53893. } else if (hm < 1230) {
  53894. return '中午';
  53895. } else if (hm < 1800) {
  53896. return '下午';
  53897. } else {
  53898. return '晚上';
  53899. }
  53900. },
  53901. calendar: {
  53902. sameDay: '[今天]LT',
  53903. nextDay: '[明天]LT',
  53904. nextWeek: function (now) {
  53905. if (now.week() !== this.week()) {
  53906. return '[下]dddLT';
  53907. } else {
  53908. return '[本]dddLT';
  53909. }
  53910. },
  53911. lastDay: '[昨天]LT',
  53912. lastWeek: function (now) {
  53913. if (this.week() !== now.week()) {
  53914. return '[上]dddLT';
  53915. } else {
  53916. return '[本]dddLT';
  53917. }
  53918. },
  53919. sameElse: 'L',
  53920. },
  53921. dayOfMonthOrdinalParse: /\d{1,2}(日|月|周)/,
  53922. ordinal: function (number, period) {
  53923. switch (period) {
  53924. case 'd':
  53925. case 'D':
  53926. case 'DDD':
  53927. return number + '日';
  53928. case 'M':
  53929. return number + '月';
  53930. case 'w':
  53931. case 'W':
  53932. return number + '周';
  53933. default:
  53934. return number;
  53935. }
  53936. },
  53937. relativeTime: {
  53938. future: '%s后',
  53939. past: '%s前',
  53940. s: '几秒',
  53941. ss: '%d 秒',
  53942. m: '1 分钟',
  53943. mm: '%d 分钟',
  53944. h: '1 小时',
  53945. hh: '%d 小时',
  53946. d: '1 天',
  53947. dd: '%d 天',
  53948. M: '1 个月',
  53949. MM: '%d 个月',
  53950. y: '1 年',
  53951. yy: '%d 年',
  53952. },
  53953. week: {
  53954. // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
  53955. dow: 1, // Monday is the first day of the week.
  53956. doy: 4, // The week that contains Jan 4th is the first week of the year.
  53957. },
  53958. });
  53959. return zhCn;
  53960. })));
  53961. /***/ }),
  53962. /***/ "./node_modules/moment/locale/zh-hk.js":
  53963. /*!*********************************************!*\
  53964. !*** ./node_modules/moment/locale/zh-hk.js ***!
  53965. \*********************************************/
  53966. /*! no static exports found */
  53967. /***/ (function(module, exports, __webpack_require__) {
  53968. //! moment.js locale configuration
  53969. //! locale : Chinese (Hong Kong) [zh-hk]
  53970. //! author : Ben : https://github.com/ben-lin
  53971. //! author : Chris Lam : https://github.com/hehachris
  53972. //! author : Konstantin : https://github.com/skfd
  53973. //! author : Anthony : https://github.com/anthonylau
  53974. ;(function (global, factory) {
  53975. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  53976. undefined
  53977. }(this, (function (moment) { 'use strict';
  53978. //! moment.js locale configuration
  53979. var zhHk = moment.defineLocale('zh-hk', {
  53980. months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
  53981. '_'
  53982. ),
  53983. monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
  53984. '_'
  53985. ),
  53986. weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  53987. weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
  53988. weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
  53989. longDateFormat: {
  53990. LT: 'HH:mm',
  53991. LTS: 'HH:mm:ss',
  53992. L: 'YYYY/MM/DD',
  53993. LL: 'YYYY年M月D日',
  53994. LLL: 'YYYY年M月D日 HH:mm',
  53995. LLLL: 'YYYY年M月D日dddd HH:mm',
  53996. l: 'YYYY/M/D',
  53997. ll: 'YYYY年M月D日',
  53998. lll: 'YYYY年M月D日 HH:mm',
  53999. llll: 'YYYY年M月D日dddd HH:mm',
  54000. },
  54001. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  54002. meridiemHour: function (hour, meridiem) {
  54003. if (hour === 12) {
  54004. hour = 0;
  54005. }
  54006. if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
  54007. return hour;
  54008. } else if (meridiem === '中午') {
  54009. return hour >= 11 ? hour : hour + 12;
  54010. } else if (meridiem === '下午' || meridiem === '晚上') {
  54011. return hour + 12;
  54012. }
  54013. },
  54014. meridiem: function (hour, minute, isLower) {
  54015. var hm = hour * 100 + minute;
  54016. if (hm < 600) {
  54017. return '凌晨';
  54018. } else if (hm < 900) {
  54019. return '早上';
  54020. } else if (hm < 1200) {
  54021. return '上午';
  54022. } else if (hm === 1200) {
  54023. return '中午';
  54024. } else if (hm < 1800) {
  54025. return '下午';
  54026. } else {
  54027. return '晚上';
  54028. }
  54029. },
  54030. calendar: {
  54031. sameDay: '[今天]LT',
  54032. nextDay: '[明天]LT',
  54033. nextWeek: '[下]ddddLT',
  54034. lastDay: '[昨天]LT',
  54035. lastWeek: '[上]ddddLT',
  54036. sameElse: 'L',
  54037. },
  54038. dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
  54039. ordinal: function (number, period) {
  54040. switch (period) {
  54041. case 'd':
  54042. case 'D':
  54043. case 'DDD':
  54044. return number + '日';
  54045. case 'M':
  54046. return number + '月';
  54047. case 'w':
  54048. case 'W':
  54049. return number + '週';
  54050. default:
  54051. return number;
  54052. }
  54053. },
  54054. relativeTime: {
  54055. future: '%s後',
  54056. past: '%s前',
  54057. s: '幾秒',
  54058. ss: '%d 秒',
  54059. m: '1 分鐘',
  54060. mm: '%d 分鐘',
  54061. h: '1 小時',
  54062. hh: '%d 小時',
  54063. d: '1 天',
  54064. dd: '%d 天',
  54065. M: '1 個月',
  54066. MM: '%d 個月',
  54067. y: '1 年',
  54068. yy: '%d 年',
  54069. },
  54070. });
  54071. return zhHk;
  54072. })));
  54073. /***/ }),
  54074. /***/ "./node_modules/moment/locale/zh-mo.js":
  54075. /*!*********************************************!*\
  54076. !*** ./node_modules/moment/locale/zh-mo.js ***!
  54077. \*********************************************/
  54078. /*! no static exports found */
  54079. /***/ (function(module, exports, __webpack_require__) {
  54080. //! moment.js locale configuration
  54081. //! locale : Chinese (Macau) [zh-mo]
  54082. //! author : Ben : https://github.com/ben-lin
  54083. //! author : Chris Lam : https://github.com/hehachris
  54084. //! author : Tan Yuanhong : https://github.com/le0tan
  54085. ;(function (global, factory) {
  54086. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  54087. undefined
  54088. }(this, (function (moment) { 'use strict';
  54089. //! moment.js locale configuration
  54090. var zhMo = moment.defineLocale('zh-mo', {
  54091. months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
  54092. '_'
  54093. ),
  54094. monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
  54095. '_'
  54096. ),
  54097. weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  54098. weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
  54099. weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
  54100. longDateFormat: {
  54101. LT: 'HH:mm',
  54102. LTS: 'HH:mm:ss',
  54103. L: 'DD/MM/YYYY',
  54104. LL: 'YYYY年M月D日',
  54105. LLL: 'YYYY年M月D日 HH:mm',
  54106. LLLL: 'YYYY年M月D日dddd HH:mm',
  54107. l: 'D/M/YYYY',
  54108. ll: 'YYYY年M月D日',
  54109. lll: 'YYYY年M月D日 HH:mm',
  54110. llll: 'YYYY年M月D日dddd HH:mm',
  54111. },
  54112. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  54113. meridiemHour: function (hour, meridiem) {
  54114. if (hour === 12) {
  54115. hour = 0;
  54116. }
  54117. if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
  54118. return hour;
  54119. } else if (meridiem === '中午') {
  54120. return hour >= 11 ? hour : hour + 12;
  54121. } else if (meridiem === '下午' || meridiem === '晚上') {
  54122. return hour + 12;
  54123. }
  54124. },
  54125. meridiem: function (hour, minute, isLower) {
  54126. var hm = hour * 100 + minute;
  54127. if (hm < 600) {
  54128. return '凌晨';
  54129. } else if (hm < 900) {
  54130. return '早上';
  54131. } else if (hm < 1130) {
  54132. return '上午';
  54133. } else if (hm < 1230) {
  54134. return '中午';
  54135. } else if (hm < 1800) {
  54136. return '下午';
  54137. } else {
  54138. return '晚上';
  54139. }
  54140. },
  54141. calendar: {
  54142. sameDay: '[今天] LT',
  54143. nextDay: '[明天] LT',
  54144. nextWeek: '[下]dddd LT',
  54145. lastDay: '[昨天] LT',
  54146. lastWeek: '[上]dddd LT',
  54147. sameElse: 'L',
  54148. },
  54149. dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
  54150. ordinal: function (number, period) {
  54151. switch (period) {
  54152. case 'd':
  54153. case 'D':
  54154. case 'DDD':
  54155. return number + '日';
  54156. case 'M':
  54157. return number + '月';
  54158. case 'w':
  54159. case 'W':
  54160. return number + '週';
  54161. default:
  54162. return number;
  54163. }
  54164. },
  54165. relativeTime: {
  54166. future: '%s內',
  54167. past: '%s前',
  54168. s: '幾秒',
  54169. ss: '%d 秒',
  54170. m: '1 分鐘',
  54171. mm: '%d 分鐘',
  54172. h: '1 小時',
  54173. hh: '%d 小時',
  54174. d: '1 天',
  54175. dd: '%d 天',
  54176. M: '1 個月',
  54177. MM: '%d 個月',
  54178. y: '1 年',
  54179. yy: '%d 年',
  54180. },
  54181. });
  54182. return zhMo;
  54183. })));
  54184. /***/ }),
  54185. /***/ "./node_modules/moment/locale/zh-tw.js":
  54186. /*!*********************************************!*\
  54187. !*** ./node_modules/moment/locale/zh-tw.js ***!
  54188. \*********************************************/
  54189. /*! no static exports found */
  54190. /***/ (function(module, exports, __webpack_require__) {
  54191. //! moment.js locale configuration
  54192. //! locale : Chinese (Taiwan) [zh-tw]
  54193. //! author : Ben : https://github.com/ben-lin
  54194. //! author : Chris Lam : https://github.com/hehachris
  54195. ;(function (global, factory) {
  54196. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  54197. undefined
  54198. }(this, (function (moment) { 'use strict';
  54199. //! moment.js locale configuration
  54200. var zhTw = moment.defineLocale('zh-tw', {
  54201. months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
  54202. '_'
  54203. ),
  54204. monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
  54205. '_'
  54206. ),
  54207. weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  54208. weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
  54209. weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
  54210. longDateFormat: {
  54211. LT: 'HH:mm',
  54212. LTS: 'HH:mm:ss',
  54213. L: 'YYYY/MM/DD',
  54214. LL: 'YYYY年M月D日',
  54215. LLL: 'YYYY年M月D日 HH:mm',
  54216. LLLL: 'YYYY年M月D日dddd HH:mm',
  54217. l: 'YYYY/M/D',
  54218. ll: 'YYYY年M月D日',
  54219. lll: 'YYYY年M月D日 HH:mm',
  54220. llll: 'YYYY年M月D日dddd HH:mm',
  54221. },
  54222. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  54223. meridiemHour: function (hour, meridiem) {
  54224. if (hour === 12) {
  54225. hour = 0;
  54226. }
  54227. if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
  54228. return hour;
  54229. } else if (meridiem === '中午') {
  54230. return hour >= 11 ? hour : hour + 12;
  54231. } else if (meridiem === '下午' || meridiem === '晚上') {
  54232. return hour + 12;
  54233. }
  54234. },
  54235. meridiem: function (hour, minute, isLower) {
  54236. var hm = hour * 100 + minute;
  54237. if (hm < 600) {
  54238. return '凌晨';
  54239. } else if (hm < 900) {
  54240. return '早上';
  54241. } else if (hm < 1130) {
  54242. return '上午';
  54243. } else if (hm < 1230) {
  54244. return '中午';
  54245. } else if (hm < 1800) {
  54246. return '下午';
  54247. } else {
  54248. return '晚上';
  54249. }
  54250. },
  54251. calendar: {
  54252. sameDay: '[今天] LT',
  54253. nextDay: '[明天] LT',
  54254. nextWeek: '[下]dddd LT',
  54255. lastDay: '[昨天] LT',
  54256. lastWeek: '[上]dddd LT',
  54257. sameElse: 'L',
  54258. },
  54259. dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
  54260. ordinal: function (number, period) {
  54261. switch (period) {
  54262. case 'd':
  54263. case 'D':
  54264. case 'DDD':
  54265. return number + '日';
  54266. case 'M':
  54267. return number + '月';
  54268. case 'w':
  54269. case 'W':
  54270. return number + '週';
  54271. default:
  54272. return number;
  54273. }
  54274. },
  54275. relativeTime: {
  54276. future: '%s後',
  54277. past: '%s前',
  54278. s: '幾秒',
  54279. ss: '%d 秒',
  54280. m: '1 分鐘',
  54281. mm: '%d 分鐘',
  54282. h: '1 小時',
  54283. hh: '%d 小時',
  54284. d: '1 天',
  54285. dd: '%d 天',
  54286. M: '1 個月',
  54287. MM: '%d 個月',
  54288. y: '1 年',
  54289. yy: '%d 年',
  54290. },
  54291. });
  54292. return zhTw;
  54293. })));
  54294. /***/ }),
  54295. /***/ "./node_modules/moment/moment.js":
  54296. /*!***************************************!*\
  54297. !*** ./node_modules/moment/moment.js ***!
  54298. \***************************************/
  54299. /*! no static exports found */
  54300. /***/ (function(module, exports, __webpack_require__) {
  54301. /* WEBPACK VAR INJECTION */(function(module) {var require;//! moment.js
  54302. //! version : 2.28.0
  54303. //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
  54304. //! license : MIT
  54305. //! momentjs.com
  54306. ;(function (global, factory) {
  54307. true ? module.exports = factory() :
  54308. undefined
  54309. }(this, (function () { 'use strict';
  54310. var hookCallback;
  54311. function hooks() {
  54312. return hookCallback.apply(null, arguments);
  54313. }
  54314. // This is done to register the method called with moment()
  54315. // without creating circular dependencies.
  54316. function setHookCallback(callback) {
  54317. hookCallback = callback;
  54318. }
  54319. function isArray(input) {
  54320. return (
  54321. input instanceof Array ||
  54322. Object.prototype.toString.call(input) === '[object Array]'
  54323. );
  54324. }
  54325. function isObject(input) {
  54326. // IE8 will treat undefined and null as object if it wasn't for
  54327. // input != null
  54328. return (
  54329. input != null &&
  54330. Object.prototype.toString.call(input) === '[object Object]'
  54331. );
  54332. }
  54333. function hasOwnProp(a, b) {
  54334. return Object.prototype.hasOwnProperty.call(a, b);
  54335. }
  54336. function isObjectEmpty(obj) {
  54337. if (Object.getOwnPropertyNames) {
  54338. return Object.getOwnPropertyNames(obj).length === 0;
  54339. } else {
  54340. var k;
  54341. for (k in obj) {
  54342. if (hasOwnProp(obj, k)) {
  54343. return false;
  54344. }
  54345. }
  54346. return true;
  54347. }
  54348. }
  54349. function isUndefined(input) {
  54350. return input === void 0;
  54351. }
  54352. function isNumber(input) {
  54353. return (
  54354. typeof input === 'number' ||
  54355. Object.prototype.toString.call(input) === '[object Number]'
  54356. );
  54357. }
  54358. function isDate(input) {
  54359. return (
  54360. input instanceof Date ||
  54361. Object.prototype.toString.call(input) === '[object Date]'
  54362. );
  54363. }
  54364. function map(arr, fn) {
  54365. var res = [],
  54366. i;
  54367. for (i = 0; i < arr.length; ++i) {
  54368. res.push(fn(arr[i], i));
  54369. }
  54370. return res;
  54371. }
  54372. function extend(a, b) {
  54373. for (var i in b) {
  54374. if (hasOwnProp(b, i)) {
  54375. a[i] = b[i];
  54376. }
  54377. }
  54378. if (hasOwnProp(b, 'toString')) {
  54379. a.toString = b.toString;
  54380. }
  54381. if (hasOwnProp(b, 'valueOf')) {
  54382. a.valueOf = b.valueOf;
  54383. }
  54384. return a;
  54385. }
  54386. function createUTC(input, format, locale, strict) {
  54387. return createLocalOrUTC(input, format, locale, strict, true).utc();
  54388. }
  54389. function defaultParsingFlags() {
  54390. // We need to deep clone this object.
  54391. return {
  54392. empty: false,
  54393. unusedTokens: [],
  54394. unusedInput: [],
  54395. overflow: -2,
  54396. charsLeftOver: 0,
  54397. nullInput: false,
  54398. invalidEra: null,
  54399. invalidMonth: null,
  54400. invalidFormat: false,
  54401. userInvalidated: false,
  54402. iso: false,
  54403. parsedDateParts: [],
  54404. era: null,
  54405. meridiem: null,
  54406. rfc2822: false,
  54407. weekdayMismatch: false,
  54408. };
  54409. }
  54410. function getParsingFlags(m) {
  54411. if (m._pf == null) {
  54412. m._pf = defaultParsingFlags();
  54413. }
  54414. return m._pf;
  54415. }
  54416. var some;
  54417. if (Array.prototype.some) {
  54418. some = Array.prototype.some;
  54419. } else {
  54420. some = function (fun) {
  54421. var t = Object(this),
  54422. len = t.length >>> 0,
  54423. i;
  54424. for (i = 0; i < len; i++) {
  54425. if (i in t && fun.call(this, t[i], i, t)) {
  54426. return true;
  54427. }
  54428. }
  54429. return false;
  54430. };
  54431. }
  54432. function isValid(m) {
  54433. if (m._isValid == null) {
  54434. var flags = getParsingFlags(m),
  54435. parsedParts = some.call(flags.parsedDateParts, function (i) {
  54436. return i != null;
  54437. }),
  54438. isNowValid =
  54439. !isNaN(m._d.getTime()) &&
  54440. flags.overflow < 0 &&
  54441. !flags.empty &&
  54442. !flags.invalidEra &&
  54443. !flags.invalidMonth &&
  54444. !flags.invalidWeekday &&
  54445. !flags.weekdayMismatch &&
  54446. !flags.nullInput &&
  54447. !flags.invalidFormat &&
  54448. !flags.userInvalidated &&
  54449. (!flags.meridiem || (flags.meridiem && parsedParts));
  54450. if (m._strict) {
  54451. isNowValid =
  54452. isNowValid &&
  54453. flags.charsLeftOver === 0 &&
  54454. flags.unusedTokens.length === 0 &&
  54455. flags.bigHour === undefined;
  54456. }
  54457. if (Object.isFrozen == null || !Object.isFrozen(m)) {
  54458. m._isValid = isNowValid;
  54459. } else {
  54460. return isNowValid;
  54461. }
  54462. }
  54463. return m._isValid;
  54464. }
  54465. function createInvalid(flags) {
  54466. var m = createUTC(NaN);
  54467. if (flags != null) {
  54468. extend(getParsingFlags(m), flags);
  54469. } else {
  54470. getParsingFlags(m).userInvalidated = true;
  54471. }
  54472. return m;
  54473. }
  54474. // Plugins that add properties should also add the key here (null value),
  54475. // so we can properly clone ourselves.
  54476. var momentProperties = (hooks.momentProperties = []),
  54477. updateInProgress = false;
  54478. function copyConfig(to, from) {
  54479. var i, prop, val;
  54480. if (!isUndefined(from._isAMomentObject)) {
  54481. to._isAMomentObject = from._isAMomentObject;
  54482. }
  54483. if (!isUndefined(from._i)) {
  54484. to._i = from._i;
  54485. }
  54486. if (!isUndefined(from._f)) {
  54487. to._f = from._f;
  54488. }
  54489. if (!isUndefined(from._l)) {
  54490. to._l = from._l;
  54491. }
  54492. if (!isUndefined(from._strict)) {
  54493. to._strict = from._strict;
  54494. }
  54495. if (!isUndefined(from._tzm)) {
  54496. to._tzm = from._tzm;
  54497. }
  54498. if (!isUndefined(from._isUTC)) {
  54499. to._isUTC = from._isUTC;
  54500. }
  54501. if (!isUndefined(from._offset)) {
  54502. to._offset = from._offset;
  54503. }
  54504. if (!isUndefined(from._pf)) {
  54505. to._pf = getParsingFlags(from);
  54506. }
  54507. if (!isUndefined(from._locale)) {
  54508. to._locale = from._locale;
  54509. }
  54510. if (momentProperties.length > 0) {
  54511. for (i = 0; i < momentProperties.length; i++) {
  54512. prop = momentProperties[i];
  54513. val = from[prop];
  54514. if (!isUndefined(val)) {
  54515. to[prop] = val;
  54516. }
  54517. }
  54518. }
  54519. return to;
  54520. }
  54521. // Moment prototype object
  54522. function Moment(config) {
  54523. copyConfig(this, config);
  54524. this._d = new Date(config._d != null ? config._d.getTime() : NaN);
  54525. if (!this.isValid()) {
  54526. this._d = new Date(NaN);
  54527. }
  54528. // Prevent infinite loop in case updateOffset creates new moment
  54529. // objects.
  54530. if (updateInProgress === false) {
  54531. updateInProgress = true;
  54532. hooks.updateOffset(this);
  54533. updateInProgress = false;
  54534. }
  54535. }
  54536. function isMoment(obj) {
  54537. return (
  54538. obj instanceof Moment || (obj != null && obj._isAMomentObject != null)
  54539. );
  54540. }
  54541. function warn(msg) {
  54542. if (
  54543. hooks.suppressDeprecationWarnings === false &&
  54544. typeof console !== 'undefined' &&
  54545. console.warn
  54546. ) {
  54547. console.warn('Deprecation warning: ' + msg);
  54548. }
  54549. }
  54550. function deprecate(msg, fn) {
  54551. var firstTime = true;
  54552. return extend(function () {
  54553. if (hooks.deprecationHandler != null) {
  54554. hooks.deprecationHandler(null, msg);
  54555. }
  54556. if (firstTime) {
  54557. var args = [],
  54558. arg,
  54559. i,
  54560. key;
  54561. for (i = 0; i < arguments.length; i++) {
  54562. arg = '';
  54563. if (typeof arguments[i] === 'object') {
  54564. arg += '\n[' + i + '] ';
  54565. for (key in arguments[0]) {
  54566. if (hasOwnProp(arguments[0], key)) {
  54567. arg += key + ': ' + arguments[0][key] + ', ';
  54568. }
  54569. }
  54570. arg = arg.slice(0, -2); // Remove trailing comma and space
  54571. } else {
  54572. arg = arguments[i];
  54573. }
  54574. args.push(arg);
  54575. }
  54576. warn(
  54577. msg +
  54578. '\nArguments: ' +
  54579. Array.prototype.slice.call(args).join('') +
  54580. '\n' +
  54581. new Error().stack
  54582. );
  54583. firstTime = false;
  54584. }
  54585. return fn.apply(this, arguments);
  54586. }, fn);
  54587. }
  54588. var deprecations = {};
  54589. function deprecateSimple(name, msg) {
  54590. if (hooks.deprecationHandler != null) {
  54591. hooks.deprecationHandler(name, msg);
  54592. }
  54593. if (!deprecations[name]) {
  54594. warn(msg);
  54595. deprecations[name] = true;
  54596. }
  54597. }
  54598. hooks.suppressDeprecationWarnings = false;
  54599. hooks.deprecationHandler = null;
  54600. function isFunction(input) {
  54601. return (
  54602. (typeof Function !== 'undefined' && input instanceof Function) ||
  54603. Object.prototype.toString.call(input) === '[object Function]'
  54604. );
  54605. }
  54606. function set(config) {
  54607. var prop, i;
  54608. for (i in config) {
  54609. if (hasOwnProp(config, i)) {
  54610. prop = config[i];
  54611. if (isFunction(prop)) {
  54612. this[i] = prop;
  54613. } else {
  54614. this['_' + i] = prop;
  54615. }
  54616. }
  54617. }
  54618. this._config = config;
  54619. // Lenient ordinal parsing accepts just a number in addition to
  54620. // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
  54621. // TODO: Remove "ordinalParse" fallback in next major release.
  54622. this._dayOfMonthOrdinalParseLenient = new RegExp(
  54623. (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
  54624. '|' +
  54625. /\d{1,2}/.source
  54626. );
  54627. }
  54628. function mergeConfigs(parentConfig, childConfig) {
  54629. var res = extend({}, parentConfig),
  54630. prop;
  54631. for (prop in childConfig) {
  54632. if (hasOwnProp(childConfig, prop)) {
  54633. if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
  54634. res[prop] = {};
  54635. extend(res[prop], parentConfig[prop]);
  54636. extend(res[prop], childConfig[prop]);
  54637. } else if (childConfig[prop] != null) {
  54638. res[prop] = childConfig[prop];
  54639. } else {
  54640. delete res[prop];
  54641. }
  54642. }
  54643. }
  54644. for (prop in parentConfig) {
  54645. if (
  54646. hasOwnProp(parentConfig, prop) &&
  54647. !hasOwnProp(childConfig, prop) &&
  54648. isObject(parentConfig[prop])
  54649. ) {
  54650. // make sure changes to properties don't modify parent config
  54651. res[prop] = extend({}, res[prop]);
  54652. }
  54653. }
  54654. return res;
  54655. }
  54656. function Locale(config) {
  54657. if (config != null) {
  54658. this.set(config);
  54659. }
  54660. }
  54661. var keys;
  54662. if (Object.keys) {
  54663. keys = Object.keys;
  54664. } else {
  54665. keys = function (obj) {
  54666. var i,
  54667. res = [];
  54668. for (i in obj) {
  54669. if (hasOwnProp(obj, i)) {
  54670. res.push(i);
  54671. }
  54672. }
  54673. return res;
  54674. };
  54675. }
  54676. var defaultCalendar = {
  54677. sameDay: '[Today at] LT',
  54678. nextDay: '[Tomorrow at] LT',
  54679. nextWeek: 'dddd [at] LT',
  54680. lastDay: '[Yesterday at] LT',
  54681. lastWeek: '[Last] dddd [at] LT',
  54682. sameElse: 'L',
  54683. };
  54684. function calendar(key, mom, now) {
  54685. var output = this._calendar[key] || this._calendar['sameElse'];
  54686. return isFunction(output) ? output.call(mom, now) : output;
  54687. }
  54688. function zeroFill(number, targetLength, forceSign) {
  54689. var absNumber = '' + Math.abs(number),
  54690. zerosToFill = targetLength - absNumber.length,
  54691. sign = number >= 0;
  54692. return (
  54693. (sign ? (forceSign ? '+' : '') : '-') +
  54694. Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) +
  54695. absNumber
  54696. );
  54697. }
  54698. var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,
  54699. localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
  54700. formatFunctions = {},
  54701. formatTokenFunctions = {};
  54702. // token: 'M'
  54703. // padded: ['MM', 2]
  54704. // ordinal: 'Mo'
  54705. // callback: function () { this.month() + 1 }
  54706. function addFormatToken(token, padded, ordinal, callback) {
  54707. var func = callback;
  54708. if (typeof callback === 'string') {
  54709. func = function () {
  54710. return this[callback]();
  54711. };
  54712. }
  54713. if (token) {
  54714. formatTokenFunctions[token] = func;
  54715. }
  54716. if (padded) {
  54717. formatTokenFunctions[padded[0]] = function () {
  54718. return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
  54719. };
  54720. }
  54721. if (ordinal) {
  54722. formatTokenFunctions[ordinal] = function () {
  54723. return this.localeData().ordinal(
  54724. func.apply(this, arguments),
  54725. token
  54726. );
  54727. };
  54728. }
  54729. }
  54730. function removeFormattingTokens(input) {
  54731. if (input.match(/\[[\s\S]/)) {
  54732. return input.replace(/^\[|\]$/g, '');
  54733. }
  54734. return input.replace(/\\/g, '');
  54735. }
  54736. function makeFormatFunction(format) {
  54737. var array = format.match(formattingTokens),
  54738. i,
  54739. length;
  54740. for (i = 0, length = array.length; i < length; i++) {
  54741. if (formatTokenFunctions[array[i]]) {
  54742. array[i] = formatTokenFunctions[array[i]];
  54743. } else {
  54744. array[i] = removeFormattingTokens(array[i]);
  54745. }
  54746. }
  54747. return function (mom) {
  54748. var output = '',
  54749. i;
  54750. for (i = 0; i < length; i++) {
  54751. output += isFunction(array[i])
  54752. ? array[i].call(mom, format)
  54753. : array[i];
  54754. }
  54755. return output;
  54756. };
  54757. }
  54758. // format date using native date object
  54759. function formatMoment(m, format) {
  54760. if (!m.isValid()) {
  54761. return m.localeData().invalidDate();
  54762. }
  54763. format = expandFormat(format, m.localeData());
  54764. formatFunctions[format] =
  54765. formatFunctions[format] || makeFormatFunction(format);
  54766. return formatFunctions[format](m);
  54767. }
  54768. function expandFormat(format, locale) {
  54769. var i = 5;
  54770. function replaceLongDateFormatTokens(input) {
  54771. return locale.longDateFormat(input) || input;
  54772. }
  54773. localFormattingTokens.lastIndex = 0;
  54774. while (i >= 0 && localFormattingTokens.test(format)) {
  54775. format = format.replace(
  54776. localFormattingTokens,
  54777. replaceLongDateFormatTokens
  54778. );
  54779. localFormattingTokens.lastIndex = 0;
  54780. i -= 1;
  54781. }
  54782. return format;
  54783. }
  54784. var defaultLongDateFormat = {
  54785. LTS: 'h:mm:ss A',
  54786. LT: 'h:mm A',
  54787. L: 'MM/DD/YYYY',
  54788. LL: 'MMMM D, YYYY',
  54789. LLL: 'MMMM D, YYYY h:mm A',
  54790. LLLL: 'dddd, MMMM D, YYYY h:mm A',
  54791. };
  54792. function longDateFormat(key) {
  54793. var format = this._longDateFormat[key],
  54794. formatUpper = this._longDateFormat[key.toUpperCase()];
  54795. if (format || !formatUpper) {
  54796. return format;
  54797. }
  54798. this._longDateFormat[key] = formatUpper
  54799. .match(formattingTokens)
  54800. .map(function (tok) {
  54801. if (
  54802. tok === 'MMMM' ||
  54803. tok === 'MM' ||
  54804. tok === 'DD' ||
  54805. tok === 'dddd'
  54806. ) {
  54807. return tok.slice(1);
  54808. }
  54809. return tok;
  54810. })
  54811. .join('');
  54812. return this._longDateFormat[key];
  54813. }
  54814. var defaultInvalidDate = 'Invalid date';
  54815. function invalidDate() {
  54816. return this._invalidDate;
  54817. }
  54818. var defaultOrdinal = '%d',
  54819. defaultDayOfMonthOrdinalParse = /\d{1,2}/;
  54820. function ordinal(number) {
  54821. return this._ordinal.replace('%d', number);
  54822. }
  54823. var defaultRelativeTime = {
  54824. future: 'in %s',
  54825. past: '%s ago',
  54826. s: 'a few seconds',
  54827. ss: '%d seconds',
  54828. m: 'a minute',
  54829. mm: '%d minutes',
  54830. h: 'an hour',
  54831. hh: '%d hours',
  54832. d: 'a day',
  54833. dd: '%d days',
  54834. w: 'a week',
  54835. ww: '%d weeks',
  54836. M: 'a month',
  54837. MM: '%d months',
  54838. y: 'a year',
  54839. yy: '%d years',
  54840. };
  54841. function relativeTime(number, withoutSuffix, string, isFuture) {
  54842. var output = this._relativeTime[string];
  54843. return isFunction(output)
  54844. ? output(number, withoutSuffix, string, isFuture)
  54845. : output.replace(/%d/i, number);
  54846. }
  54847. function pastFuture(diff, output) {
  54848. var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
  54849. return isFunction(format) ? format(output) : format.replace(/%s/i, output);
  54850. }
  54851. var aliases = {};
  54852. function addUnitAlias(unit, shorthand) {
  54853. var lowerCase = unit.toLowerCase();
  54854. aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
  54855. }
  54856. function normalizeUnits(units) {
  54857. return typeof units === 'string'
  54858. ? aliases[units] || aliases[units.toLowerCase()]
  54859. : undefined;
  54860. }
  54861. function normalizeObjectUnits(inputObject) {
  54862. var normalizedInput = {},
  54863. normalizedProp,
  54864. prop;
  54865. for (prop in inputObject) {
  54866. if (hasOwnProp(inputObject, prop)) {
  54867. normalizedProp = normalizeUnits(prop);
  54868. if (normalizedProp) {
  54869. normalizedInput[normalizedProp] = inputObject[prop];
  54870. }
  54871. }
  54872. }
  54873. return normalizedInput;
  54874. }
  54875. var priorities = {};
  54876. function addUnitPriority(unit, priority) {
  54877. priorities[unit] = priority;
  54878. }
  54879. function getPrioritizedUnits(unitsObj) {
  54880. var units = [],
  54881. u;
  54882. for (u in unitsObj) {
  54883. if (hasOwnProp(unitsObj, u)) {
  54884. units.push({ unit: u, priority: priorities[u] });
  54885. }
  54886. }
  54887. units.sort(function (a, b) {
  54888. return a.priority - b.priority;
  54889. });
  54890. return units;
  54891. }
  54892. function isLeapYear(year) {
  54893. return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
  54894. }
  54895. function absFloor(number) {
  54896. if (number < 0) {
  54897. // -0 -> 0
  54898. return Math.ceil(number) || 0;
  54899. } else {
  54900. return Math.floor(number);
  54901. }
  54902. }
  54903. function toInt(argumentForCoercion) {
  54904. var coercedNumber = +argumentForCoercion,
  54905. value = 0;
  54906. if (coercedNumber !== 0 && isFinite(coercedNumber)) {
  54907. value = absFloor(coercedNumber);
  54908. }
  54909. return value;
  54910. }
  54911. function makeGetSet(unit, keepTime) {
  54912. return function (value) {
  54913. if (value != null) {
  54914. set$1(this, unit, value);
  54915. hooks.updateOffset(this, keepTime);
  54916. return this;
  54917. } else {
  54918. return get(this, unit);
  54919. }
  54920. };
  54921. }
  54922. function get(mom, unit) {
  54923. return mom.isValid()
  54924. ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]()
  54925. : NaN;
  54926. }
  54927. function set$1(mom, unit, value) {
  54928. if (mom.isValid() && !isNaN(value)) {
  54929. if (
  54930. unit === 'FullYear' &&
  54931. isLeapYear(mom.year()) &&
  54932. mom.month() === 1 &&
  54933. mom.date() === 29
  54934. ) {
  54935. value = toInt(value);
  54936. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](
  54937. value,
  54938. mom.month(),
  54939. daysInMonth(value, mom.month())
  54940. );
  54941. } else {
  54942. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
  54943. }
  54944. }
  54945. }
  54946. // MOMENTS
  54947. function stringGet(units) {
  54948. units = normalizeUnits(units);
  54949. if (isFunction(this[units])) {
  54950. return this[units]();
  54951. }
  54952. return this;
  54953. }
  54954. function stringSet(units, value) {
  54955. if (typeof units === 'object') {
  54956. units = normalizeObjectUnits(units);
  54957. var prioritized = getPrioritizedUnits(units),
  54958. i;
  54959. for (i = 0; i < prioritized.length; i++) {
  54960. this[prioritized[i].unit](units[prioritized[i].unit]);
  54961. }
  54962. } else {
  54963. units = normalizeUnits(units);
  54964. if (isFunction(this[units])) {
  54965. return this[units](value);
  54966. }
  54967. }
  54968. return this;
  54969. }
  54970. var match1 = /\d/, // 0 - 9
  54971. match2 = /\d\d/, // 00 - 99
  54972. match3 = /\d{3}/, // 000 - 999
  54973. match4 = /\d{4}/, // 0000 - 9999
  54974. match6 = /[+-]?\d{6}/, // -999999 - 999999
  54975. match1to2 = /\d\d?/, // 0 - 99
  54976. match3to4 = /\d\d\d\d?/, // 999 - 9999
  54977. match5to6 = /\d\d\d\d\d\d?/, // 99999 - 999999
  54978. match1to3 = /\d{1,3}/, // 0 - 999
  54979. match1to4 = /\d{1,4}/, // 0 - 9999
  54980. match1to6 = /[+-]?\d{1,6}/, // -999999 - 999999
  54981. matchUnsigned = /\d+/, // 0 - inf
  54982. matchSigned = /[+-]?\d+/, // -inf - inf
  54983. matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z
  54984. matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z
  54985. matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
  54986. // any word (or two) characters or numbers including two/three word month in arabic.
  54987. // includes scottish gaelic two word and hyphenated months
  54988. matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
  54989. regexes;
  54990. regexes = {};
  54991. function addRegexToken(token, regex, strictRegex) {
  54992. regexes[token] = isFunction(regex)
  54993. ? regex
  54994. : function (isStrict, localeData) {
  54995. return isStrict && strictRegex ? strictRegex : regex;
  54996. };
  54997. }
  54998. function getParseRegexForToken(token, config) {
  54999. if (!hasOwnProp(regexes, token)) {
  55000. return new RegExp(unescapeFormat(token));
  55001. }
  55002. return regexes[token](config._strict, config._locale);
  55003. }
  55004. // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
  55005. function unescapeFormat(s) {
  55006. return regexEscape(
  55007. s
  55008. .replace('\\', '')
  55009. .replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (
  55010. matched,
  55011. p1,
  55012. p2,
  55013. p3,
  55014. p4
  55015. ) {
  55016. return p1 || p2 || p3 || p4;
  55017. })
  55018. );
  55019. }
  55020. function regexEscape(s) {
  55021. return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
  55022. }
  55023. var tokens = {};
  55024. function addParseToken(token, callback) {
  55025. var i,
  55026. func = callback;
  55027. if (typeof token === 'string') {
  55028. token = [token];
  55029. }
  55030. if (isNumber(callback)) {
  55031. func = function (input, array) {
  55032. array[callback] = toInt(input);
  55033. };
  55034. }
  55035. for (i = 0; i < token.length; i++) {
  55036. tokens[token[i]] = func;
  55037. }
  55038. }
  55039. function addWeekParseToken(token, callback) {
  55040. addParseToken(token, function (input, array, config, token) {
  55041. config._w = config._w || {};
  55042. callback(input, config._w, config, token);
  55043. });
  55044. }
  55045. function addTimeToArrayFromToken(token, input, config) {
  55046. if (input != null && hasOwnProp(tokens, token)) {
  55047. tokens[token](input, config._a, config, token);
  55048. }
  55049. }
  55050. var YEAR = 0,
  55051. MONTH = 1,
  55052. DATE = 2,
  55053. HOUR = 3,
  55054. MINUTE = 4,
  55055. SECOND = 5,
  55056. MILLISECOND = 6,
  55057. WEEK = 7,
  55058. WEEKDAY = 8;
  55059. function mod(n, x) {
  55060. return ((n % x) + x) % x;
  55061. }
  55062. var indexOf;
  55063. if (Array.prototype.indexOf) {
  55064. indexOf = Array.prototype.indexOf;
  55065. } else {
  55066. indexOf = function (o) {
  55067. // I know
  55068. var i;
  55069. for (i = 0; i < this.length; ++i) {
  55070. if (this[i] === o) {
  55071. return i;
  55072. }
  55073. }
  55074. return -1;
  55075. };
  55076. }
  55077. function daysInMonth(year, month) {
  55078. if (isNaN(year) || isNaN(month)) {
  55079. return NaN;
  55080. }
  55081. var modMonth = mod(month, 12);
  55082. year += (month - modMonth) / 12;
  55083. return modMonth === 1
  55084. ? isLeapYear(year)
  55085. ? 29
  55086. : 28
  55087. : 31 - ((modMonth % 7) % 2);
  55088. }
  55089. // FORMATTING
  55090. addFormatToken('M', ['MM', 2], 'Mo', function () {
  55091. return this.month() + 1;
  55092. });
  55093. addFormatToken('MMM', 0, 0, function (format) {
  55094. return this.localeData().monthsShort(this, format);
  55095. });
  55096. addFormatToken('MMMM', 0, 0, function (format) {
  55097. return this.localeData().months(this, format);
  55098. });
  55099. // ALIASES
  55100. addUnitAlias('month', 'M');
  55101. // PRIORITY
  55102. addUnitPriority('month', 8);
  55103. // PARSING
  55104. addRegexToken('M', match1to2);
  55105. addRegexToken('MM', match1to2, match2);
  55106. addRegexToken('MMM', function (isStrict, locale) {
  55107. return locale.monthsShortRegex(isStrict);
  55108. });
  55109. addRegexToken('MMMM', function (isStrict, locale) {
  55110. return locale.monthsRegex(isStrict);
  55111. });
  55112. addParseToken(['M', 'MM'], function (input, array) {
  55113. array[MONTH] = toInt(input) - 1;
  55114. });
  55115. addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
  55116. var month = config._locale.monthsParse(input, token, config._strict);
  55117. // if we didn't find a month name, mark the date as invalid.
  55118. if (month != null) {
  55119. array[MONTH] = month;
  55120. } else {
  55121. getParsingFlags(config).invalidMonth = input;
  55122. }
  55123. });
  55124. // LOCALES
  55125. var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  55126. '_'
  55127. ),
  55128. defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split(
  55129. '_'
  55130. ),
  55131. MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
  55132. defaultMonthsShortRegex = matchWord,
  55133. defaultMonthsRegex = matchWord;
  55134. function localeMonths(m, format) {
  55135. if (!m) {
  55136. return isArray(this._months)
  55137. ? this._months
  55138. : this._months['standalone'];
  55139. }
  55140. return isArray(this._months)
  55141. ? this._months[m.month()]
  55142. : this._months[
  55143. (this._months.isFormat || MONTHS_IN_FORMAT).test(format)
  55144. ? 'format'
  55145. : 'standalone'
  55146. ][m.month()];
  55147. }
  55148. function localeMonthsShort(m, format) {
  55149. if (!m) {
  55150. return isArray(this._monthsShort)
  55151. ? this._monthsShort
  55152. : this._monthsShort['standalone'];
  55153. }
  55154. return isArray(this._monthsShort)
  55155. ? this._monthsShort[m.month()]
  55156. : this._monthsShort[
  55157. MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'
  55158. ][m.month()];
  55159. }
  55160. function handleStrictParse(monthName, format, strict) {
  55161. var i,
  55162. ii,
  55163. mom,
  55164. llc = monthName.toLocaleLowerCase();
  55165. if (!this._monthsParse) {
  55166. // this is not used
  55167. this._monthsParse = [];
  55168. this._longMonthsParse = [];
  55169. this._shortMonthsParse = [];
  55170. for (i = 0; i < 12; ++i) {
  55171. mom = createUTC([2000, i]);
  55172. this._shortMonthsParse[i] = this.monthsShort(
  55173. mom,
  55174. ''
  55175. ).toLocaleLowerCase();
  55176. this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
  55177. }
  55178. }
  55179. if (strict) {
  55180. if (format === 'MMM') {
  55181. ii = indexOf.call(this._shortMonthsParse, llc);
  55182. return ii !== -1 ? ii : null;
  55183. } else {
  55184. ii = indexOf.call(this._longMonthsParse, llc);
  55185. return ii !== -1 ? ii : null;
  55186. }
  55187. } else {
  55188. if (format === 'MMM') {
  55189. ii = indexOf.call(this._shortMonthsParse, llc);
  55190. if (ii !== -1) {
  55191. return ii;
  55192. }
  55193. ii = indexOf.call(this._longMonthsParse, llc);
  55194. return ii !== -1 ? ii : null;
  55195. } else {
  55196. ii = indexOf.call(this._longMonthsParse, llc);
  55197. if (ii !== -1) {
  55198. return ii;
  55199. }
  55200. ii = indexOf.call(this._shortMonthsParse, llc);
  55201. return ii !== -1 ? ii : null;
  55202. }
  55203. }
  55204. }
  55205. function localeMonthsParse(monthName, format, strict) {
  55206. var i, mom, regex;
  55207. if (this._monthsParseExact) {
  55208. return handleStrictParse.call(this, monthName, format, strict);
  55209. }
  55210. if (!this._monthsParse) {
  55211. this._monthsParse = [];
  55212. this._longMonthsParse = [];
  55213. this._shortMonthsParse = [];
  55214. }
  55215. // TODO: add sorting
  55216. // Sorting makes sure if one month (or abbr) is a prefix of another
  55217. // see sorting in computeMonthsParse
  55218. for (i = 0; i < 12; i++) {
  55219. // make the regex if we don't have it already
  55220. mom = createUTC([2000, i]);
  55221. if (strict && !this._longMonthsParse[i]) {
  55222. this._longMonthsParse[i] = new RegExp(
  55223. '^' + this.months(mom, '').replace('.', '') + '$',
  55224. 'i'
  55225. );
  55226. this._shortMonthsParse[i] = new RegExp(
  55227. '^' + this.monthsShort(mom, '').replace('.', '') + '$',
  55228. 'i'
  55229. );
  55230. }
  55231. if (!strict && !this._monthsParse[i]) {
  55232. regex =
  55233. '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
  55234. this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
  55235. }
  55236. // test the regex
  55237. if (
  55238. strict &&
  55239. format === 'MMMM' &&
  55240. this._longMonthsParse[i].test(monthName)
  55241. ) {
  55242. return i;
  55243. } else if (
  55244. strict &&
  55245. format === 'MMM' &&
  55246. this._shortMonthsParse[i].test(monthName)
  55247. ) {
  55248. return i;
  55249. } else if (!strict && this._monthsParse[i].test(monthName)) {
  55250. return i;
  55251. }
  55252. }
  55253. }
  55254. // MOMENTS
  55255. function setMonth(mom, value) {
  55256. var dayOfMonth;
  55257. if (!mom.isValid()) {
  55258. // No op
  55259. return mom;
  55260. }
  55261. if (typeof value === 'string') {
  55262. if (/^\d+$/.test(value)) {
  55263. value = toInt(value);
  55264. } else {
  55265. value = mom.localeData().monthsParse(value);
  55266. // TODO: Another silent failure?
  55267. if (!isNumber(value)) {
  55268. return mom;
  55269. }
  55270. }
  55271. }
  55272. dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
  55273. mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
  55274. return mom;
  55275. }
  55276. function getSetMonth(value) {
  55277. if (value != null) {
  55278. setMonth(this, value);
  55279. hooks.updateOffset(this, true);
  55280. return this;
  55281. } else {
  55282. return get(this, 'Month');
  55283. }
  55284. }
  55285. function getDaysInMonth() {
  55286. return daysInMonth(this.year(), this.month());
  55287. }
  55288. function monthsShortRegex(isStrict) {
  55289. if (this._monthsParseExact) {
  55290. if (!hasOwnProp(this, '_monthsRegex')) {
  55291. computeMonthsParse.call(this);
  55292. }
  55293. if (isStrict) {
  55294. return this._monthsShortStrictRegex;
  55295. } else {
  55296. return this._monthsShortRegex;
  55297. }
  55298. } else {
  55299. if (!hasOwnProp(this, '_monthsShortRegex')) {
  55300. this._monthsShortRegex = defaultMonthsShortRegex;
  55301. }
  55302. return this._monthsShortStrictRegex && isStrict
  55303. ? this._monthsShortStrictRegex
  55304. : this._monthsShortRegex;
  55305. }
  55306. }
  55307. function monthsRegex(isStrict) {
  55308. if (this._monthsParseExact) {
  55309. if (!hasOwnProp(this, '_monthsRegex')) {
  55310. computeMonthsParse.call(this);
  55311. }
  55312. if (isStrict) {
  55313. return this._monthsStrictRegex;
  55314. } else {
  55315. return this._monthsRegex;
  55316. }
  55317. } else {
  55318. if (!hasOwnProp(this, '_monthsRegex')) {
  55319. this._monthsRegex = defaultMonthsRegex;
  55320. }
  55321. return this._monthsStrictRegex && isStrict
  55322. ? this._monthsStrictRegex
  55323. : this._monthsRegex;
  55324. }
  55325. }
  55326. function computeMonthsParse() {
  55327. function cmpLenRev(a, b) {
  55328. return b.length - a.length;
  55329. }
  55330. var shortPieces = [],
  55331. longPieces = [],
  55332. mixedPieces = [],
  55333. i,
  55334. mom;
  55335. for (i = 0; i < 12; i++) {
  55336. // make the regex if we don't have it already
  55337. mom = createUTC([2000, i]);
  55338. shortPieces.push(this.monthsShort(mom, ''));
  55339. longPieces.push(this.months(mom, ''));
  55340. mixedPieces.push(this.months(mom, ''));
  55341. mixedPieces.push(this.monthsShort(mom, ''));
  55342. }
  55343. // Sorting makes sure if one month (or abbr) is a prefix of another it
  55344. // will match the longer piece.
  55345. shortPieces.sort(cmpLenRev);
  55346. longPieces.sort(cmpLenRev);
  55347. mixedPieces.sort(cmpLenRev);
  55348. for (i = 0; i < 12; i++) {
  55349. shortPieces[i] = regexEscape(shortPieces[i]);
  55350. longPieces[i] = regexEscape(longPieces[i]);
  55351. }
  55352. for (i = 0; i < 24; i++) {
  55353. mixedPieces[i] = regexEscape(mixedPieces[i]);
  55354. }
  55355. this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  55356. this._monthsShortRegex = this._monthsRegex;
  55357. this._monthsStrictRegex = new RegExp(
  55358. '^(' + longPieces.join('|') + ')',
  55359. 'i'
  55360. );
  55361. this._monthsShortStrictRegex = new RegExp(
  55362. '^(' + shortPieces.join('|') + ')',
  55363. 'i'
  55364. );
  55365. }
  55366. // FORMATTING
  55367. addFormatToken('Y', 0, 0, function () {
  55368. var y = this.year();
  55369. return y <= 9999 ? zeroFill(y, 4) : '+' + y;
  55370. });
  55371. addFormatToken(0, ['YY', 2], 0, function () {
  55372. return this.year() % 100;
  55373. });
  55374. addFormatToken(0, ['YYYY', 4], 0, 'year');
  55375. addFormatToken(0, ['YYYYY', 5], 0, 'year');
  55376. addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
  55377. // ALIASES
  55378. addUnitAlias('year', 'y');
  55379. // PRIORITIES
  55380. addUnitPriority('year', 1);
  55381. // PARSING
  55382. addRegexToken('Y', matchSigned);
  55383. addRegexToken('YY', match1to2, match2);
  55384. addRegexToken('YYYY', match1to4, match4);
  55385. addRegexToken('YYYYY', match1to6, match6);
  55386. addRegexToken('YYYYYY', match1to6, match6);
  55387. addParseToken(['YYYYY', 'YYYYYY'], YEAR);
  55388. addParseToken('YYYY', function (input, array) {
  55389. array[YEAR] =
  55390. input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
  55391. });
  55392. addParseToken('YY', function (input, array) {
  55393. array[YEAR] = hooks.parseTwoDigitYear(input);
  55394. });
  55395. addParseToken('Y', function (input, array) {
  55396. array[YEAR] = parseInt(input, 10);
  55397. });
  55398. // HELPERS
  55399. function daysInYear(year) {
  55400. return isLeapYear(year) ? 366 : 365;
  55401. }
  55402. // HOOKS
  55403. hooks.parseTwoDigitYear = function (input) {
  55404. return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
  55405. };
  55406. // MOMENTS
  55407. var getSetYear = makeGetSet('FullYear', true);
  55408. function getIsLeapYear() {
  55409. return isLeapYear(this.year());
  55410. }
  55411. function createDate(y, m, d, h, M, s, ms) {
  55412. // can't just apply() to create a date:
  55413. // https://stackoverflow.com/q/181348
  55414. var date;
  55415. // the date constructor remaps years 0-99 to 1900-1999
  55416. if (y < 100 && y >= 0) {
  55417. // preserve leap years using a full 400 year cycle, then reset
  55418. date = new Date(y + 400, m, d, h, M, s, ms);
  55419. if (isFinite(date.getFullYear())) {
  55420. date.setFullYear(y);
  55421. }
  55422. } else {
  55423. date = new Date(y, m, d, h, M, s, ms);
  55424. }
  55425. return date;
  55426. }
  55427. function createUTCDate(y) {
  55428. var date, args;
  55429. // the Date.UTC function remaps years 0-99 to 1900-1999
  55430. if (y < 100 && y >= 0) {
  55431. args = Array.prototype.slice.call(arguments);
  55432. // preserve leap years using a full 400 year cycle, then reset
  55433. args[0] = y + 400;
  55434. date = new Date(Date.UTC.apply(null, args));
  55435. if (isFinite(date.getUTCFullYear())) {
  55436. date.setUTCFullYear(y);
  55437. }
  55438. } else {
  55439. date = new Date(Date.UTC.apply(null, arguments));
  55440. }
  55441. return date;
  55442. }
  55443. // start-of-first-week - start-of-year
  55444. function firstWeekOffset(year, dow, doy) {
  55445. var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
  55446. fwd = 7 + dow - doy,
  55447. // first-week day local weekday -- which local weekday is fwd
  55448. fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
  55449. return -fwdlw + fwd - 1;
  55450. }
  55451. // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
  55452. function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
  55453. var localWeekday = (7 + weekday - dow) % 7,
  55454. weekOffset = firstWeekOffset(year, dow, doy),
  55455. dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
  55456. resYear,
  55457. resDayOfYear;
  55458. if (dayOfYear <= 0) {
  55459. resYear = year - 1;
  55460. resDayOfYear = daysInYear(resYear) + dayOfYear;
  55461. } else if (dayOfYear > daysInYear(year)) {
  55462. resYear = year + 1;
  55463. resDayOfYear = dayOfYear - daysInYear(year);
  55464. } else {
  55465. resYear = year;
  55466. resDayOfYear = dayOfYear;
  55467. }
  55468. return {
  55469. year: resYear,
  55470. dayOfYear: resDayOfYear,
  55471. };
  55472. }
  55473. function weekOfYear(mom, dow, doy) {
  55474. var weekOffset = firstWeekOffset(mom.year(), dow, doy),
  55475. week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
  55476. resWeek,
  55477. resYear;
  55478. if (week < 1) {
  55479. resYear = mom.year() - 1;
  55480. resWeek = week + weeksInYear(resYear, dow, doy);
  55481. } else if (week > weeksInYear(mom.year(), dow, doy)) {
  55482. resWeek = week - weeksInYear(mom.year(), dow, doy);
  55483. resYear = mom.year() + 1;
  55484. } else {
  55485. resYear = mom.year();
  55486. resWeek = week;
  55487. }
  55488. return {
  55489. week: resWeek,
  55490. year: resYear,
  55491. };
  55492. }
  55493. function weeksInYear(year, dow, doy) {
  55494. var weekOffset = firstWeekOffset(year, dow, doy),
  55495. weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
  55496. return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
  55497. }
  55498. // FORMATTING
  55499. addFormatToken('w', ['ww', 2], 'wo', 'week');
  55500. addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
  55501. // ALIASES
  55502. addUnitAlias('week', 'w');
  55503. addUnitAlias('isoWeek', 'W');
  55504. // PRIORITIES
  55505. addUnitPriority('week', 5);
  55506. addUnitPriority('isoWeek', 5);
  55507. // PARSING
  55508. addRegexToken('w', match1to2);
  55509. addRegexToken('ww', match1to2, match2);
  55510. addRegexToken('W', match1to2);
  55511. addRegexToken('WW', match1to2, match2);
  55512. addWeekParseToken(['w', 'ww', 'W', 'WW'], function (
  55513. input,
  55514. week,
  55515. config,
  55516. token
  55517. ) {
  55518. week[token.substr(0, 1)] = toInt(input);
  55519. });
  55520. // HELPERS
  55521. // LOCALES
  55522. function localeWeek(mom) {
  55523. return weekOfYear(mom, this._week.dow, this._week.doy).week;
  55524. }
  55525. var defaultLocaleWeek = {
  55526. dow: 0, // Sunday is the first day of the week.
  55527. doy: 6, // The week that contains Jan 6th is the first week of the year.
  55528. };
  55529. function localeFirstDayOfWeek() {
  55530. return this._week.dow;
  55531. }
  55532. function localeFirstDayOfYear() {
  55533. return this._week.doy;
  55534. }
  55535. // MOMENTS
  55536. function getSetWeek(input) {
  55537. var week = this.localeData().week(this);
  55538. return input == null ? week : this.add((input - week) * 7, 'd');
  55539. }
  55540. function getSetISOWeek(input) {
  55541. var week = weekOfYear(this, 1, 4).week;
  55542. return input == null ? week : this.add((input - week) * 7, 'd');
  55543. }
  55544. // FORMATTING
  55545. addFormatToken('d', 0, 'do', 'day');
  55546. addFormatToken('dd', 0, 0, function (format) {
  55547. return this.localeData().weekdaysMin(this, format);
  55548. });
  55549. addFormatToken('ddd', 0, 0, function (format) {
  55550. return this.localeData().weekdaysShort(this, format);
  55551. });
  55552. addFormatToken('dddd', 0, 0, function (format) {
  55553. return this.localeData().weekdays(this, format);
  55554. });
  55555. addFormatToken('e', 0, 0, 'weekday');
  55556. addFormatToken('E', 0, 0, 'isoWeekday');
  55557. // ALIASES
  55558. addUnitAlias('day', 'd');
  55559. addUnitAlias('weekday', 'e');
  55560. addUnitAlias('isoWeekday', 'E');
  55561. // PRIORITY
  55562. addUnitPriority('day', 11);
  55563. addUnitPriority('weekday', 11);
  55564. addUnitPriority('isoWeekday', 11);
  55565. // PARSING
  55566. addRegexToken('d', match1to2);
  55567. addRegexToken('e', match1to2);
  55568. addRegexToken('E', match1to2);
  55569. addRegexToken('dd', function (isStrict, locale) {
  55570. return locale.weekdaysMinRegex(isStrict);
  55571. });
  55572. addRegexToken('ddd', function (isStrict, locale) {
  55573. return locale.weekdaysShortRegex(isStrict);
  55574. });
  55575. addRegexToken('dddd', function (isStrict, locale) {
  55576. return locale.weekdaysRegex(isStrict);
  55577. });
  55578. addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
  55579. var weekday = config._locale.weekdaysParse(input, token, config._strict);
  55580. // if we didn't get a weekday name, mark the date as invalid
  55581. if (weekday != null) {
  55582. week.d = weekday;
  55583. } else {
  55584. getParsingFlags(config).invalidWeekday = input;
  55585. }
  55586. });
  55587. addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
  55588. week[token] = toInt(input);
  55589. });
  55590. // HELPERS
  55591. function parseWeekday(input, locale) {
  55592. if (typeof input !== 'string') {
  55593. return input;
  55594. }
  55595. if (!isNaN(input)) {
  55596. return parseInt(input, 10);
  55597. }
  55598. input = locale.weekdaysParse(input);
  55599. if (typeof input === 'number') {
  55600. return input;
  55601. }
  55602. return null;
  55603. }
  55604. function parseIsoWeekday(input, locale) {
  55605. if (typeof input === 'string') {
  55606. return locale.weekdaysParse(input) % 7 || 7;
  55607. }
  55608. return isNaN(input) ? null : input;
  55609. }
  55610. // LOCALES
  55611. function shiftWeekdays(ws, n) {
  55612. return ws.slice(n, 7).concat(ws.slice(0, n));
  55613. }
  55614. var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  55615. '_'
  55616. ),
  55617. defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  55618. defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  55619. defaultWeekdaysRegex = matchWord,
  55620. defaultWeekdaysShortRegex = matchWord,
  55621. defaultWeekdaysMinRegex = matchWord;
  55622. function localeWeekdays(m, format) {
  55623. var weekdays = isArray(this._weekdays)
  55624. ? this._weekdays
  55625. : this._weekdays[
  55626. m && m !== true && this._weekdays.isFormat.test(format)
  55627. ? 'format'
  55628. : 'standalone'
  55629. ];
  55630. return m === true
  55631. ? shiftWeekdays(weekdays, this._week.dow)
  55632. : m
  55633. ? weekdays[m.day()]
  55634. : weekdays;
  55635. }
  55636. function localeWeekdaysShort(m) {
  55637. return m === true
  55638. ? shiftWeekdays(this._weekdaysShort, this._week.dow)
  55639. : m
  55640. ? this._weekdaysShort[m.day()]
  55641. : this._weekdaysShort;
  55642. }
  55643. function localeWeekdaysMin(m) {
  55644. return m === true
  55645. ? shiftWeekdays(this._weekdaysMin, this._week.dow)
  55646. : m
  55647. ? this._weekdaysMin[m.day()]
  55648. : this._weekdaysMin;
  55649. }
  55650. function handleStrictParse$1(weekdayName, format, strict) {
  55651. var i,
  55652. ii,
  55653. mom,
  55654. llc = weekdayName.toLocaleLowerCase();
  55655. if (!this._weekdaysParse) {
  55656. this._weekdaysParse = [];
  55657. this._shortWeekdaysParse = [];
  55658. this._minWeekdaysParse = [];
  55659. for (i = 0; i < 7; ++i) {
  55660. mom = createUTC([2000, 1]).day(i);
  55661. this._minWeekdaysParse[i] = this.weekdaysMin(
  55662. mom,
  55663. ''
  55664. ).toLocaleLowerCase();
  55665. this._shortWeekdaysParse[i] = this.weekdaysShort(
  55666. mom,
  55667. ''
  55668. ).toLocaleLowerCase();
  55669. this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
  55670. }
  55671. }
  55672. if (strict) {
  55673. if (format === 'dddd') {
  55674. ii = indexOf.call(this._weekdaysParse, llc);
  55675. return ii !== -1 ? ii : null;
  55676. } else if (format === 'ddd') {
  55677. ii = indexOf.call(this._shortWeekdaysParse, llc);
  55678. return ii !== -1 ? ii : null;
  55679. } else {
  55680. ii = indexOf.call(this._minWeekdaysParse, llc);
  55681. return ii !== -1 ? ii : null;
  55682. }
  55683. } else {
  55684. if (format === 'dddd') {
  55685. ii = indexOf.call(this._weekdaysParse, llc);
  55686. if (ii !== -1) {
  55687. return ii;
  55688. }
  55689. ii = indexOf.call(this._shortWeekdaysParse, llc);
  55690. if (ii !== -1) {
  55691. return ii;
  55692. }
  55693. ii = indexOf.call(this._minWeekdaysParse, llc);
  55694. return ii !== -1 ? ii : null;
  55695. } else if (format === 'ddd') {
  55696. ii = indexOf.call(this._shortWeekdaysParse, llc);
  55697. if (ii !== -1) {
  55698. return ii;
  55699. }
  55700. ii = indexOf.call(this._weekdaysParse, llc);
  55701. if (ii !== -1) {
  55702. return ii;
  55703. }
  55704. ii = indexOf.call(this._minWeekdaysParse, llc);
  55705. return ii !== -1 ? ii : null;
  55706. } else {
  55707. ii = indexOf.call(this._minWeekdaysParse, llc);
  55708. if (ii !== -1) {
  55709. return ii;
  55710. }
  55711. ii = indexOf.call(this._weekdaysParse, llc);
  55712. if (ii !== -1) {
  55713. return ii;
  55714. }
  55715. ii = indexOf.call(this._shortWeekdaysParse, llc);
  55716. return ii !== -1 ? ii : null;
  55717. }
  55718. }
  55719. }
  55720. function localeWeekdaysParse(weekdayName, format, strict) {
  55721. var i, mom, regex;
  55722. if (this._weekdaysParseExact) {
  55723. return handleStrictParse$1.call(this, weekdayName, format, strict);
  55724. }
  55725. if (!this._weekdaysParse) {
  55726. this._weekdaysParse = [];
  55727. this._minWeekdaysParse = [];
  55728. this._shortWeekdaysParse = [];
  55729. this._fullWeekdaysParse = [];
  55730. }
  55731. for (i = 0; i < 7; i++) {
  55732. // make the regex if we don't have it already
  55733. mom = createUTC([2000, 1]).day(i);
  55734. if (strict && !this._fullWeekdaysParse[i]) {
  55735. this._fullWeekdaysParse[i] = new RegExp(
  55736. '^' + this.weekdays(mom, '').replace('.', '\\.?') + '$',
  55737. 'i'
  55738. );
  55739. this._shortWeekdaysParse[i] = new RegExp(
  55740. '^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$',
  55741. 'i'
  55742. );
  55743. this._minWeekdaysParse[i] = new RegExp(
  55744. '^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$',
  55745. 'i'
  55746. );
  55747. }
  55748. if (!this._weekdaysParse[i]) {
  55749. regex =
  55750. '^' +
  55751. this.weekdays(mom, '') +
  55752. '|^' +
  55753. this.weekdaysShort(mom, '') +
  55754. '|^' +
  55755. this.weekdaysMin(mom, '');
  55756. this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
  55757. }
  55758. // test the regex
  55759. if (
  55760. strict &&
  55761. format === 'dddd' &&
  55762. this._fullWeekdaysParse[i].test(weekdayName)
  55763. ) {
  55764. return i;
  55765. } else if (
  55766. strict &&
  55767. format === 'ddd' &&
  55768. this._shortWeekdaysParse[i].test(weekdayName)
  55769. ) {
  55770. return i;
  55771. } else if (
  55772. strict &&
  55773. format === 'dd' &&
  55774. this._minWeekdaysParse[i].test(weekdayName)
  55775. ) {
  55776. return i;
  55777. } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
  55778. return i;
  55779. }
  55780. }
  55781. }
  55782. // MOMENTS
  55783. function getSetDayOfWeek(input) {
  55784. if (!this.isValid()) {
  55785. return input != null ? this : NaN;
  55786. }
  55787. var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
  55788. if (input != null) {
  55789. input = parseWeekday(input, this.localeData());
  55790. return this.add(input - day, 'd');
  55791. } else {
  55792. return day;
  55793. }
  55794. }
  55795. function getSetLocaleDayOfWeek(input) {
  55796. if (!this.isValid()) {
  55797. return input != null ? this : NaN;
  55798. }
  55799. var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
  55800. return input == null ? weekday : this.add(input - weekday, 'd');
  55801. }
  55802. function getSetISODayOfWeek(input) {
  55803. if (!this.isValid()) {
  55804. return input != null ? this : NaN;
  55805. }
  55806. // behaves the same as moment#day except
  55807. // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
  55808. // as a setter, sunday should belong to the previous week.
  55809. if (input != null) {
  55810. var weekday = parseIsoWeekday(input, this.localeData());
  55811. return this.day(this.day() % 7 ? weekday : weekday - 7);
  55812. } else {
  55813. return this.day() || 7;
  55814. }
  55815. }
  55816. function weekdaysRegex(isStrict) {
  55817. if (this._weekdaysParseExact) {
  55818. if (!hasOwnProp(this, '_weekdaysRegex')) {
  55819. computeWeekdaysParse.call(this);
  55820. }
  55821. if (isStrict) {
  55822. return this._weekdaysStrictRegex;
  55823. } else {
  55824. return this._weekdaysRegex;
  55825. }
  55826. } else {
  55827. if (!hasOwnProp(this, '_weekdaysRegex')) {
  55828. this._weekdaysRegex = defaultWeekdaysRegex;
  55829. }
  55830. return this._weekdaysStrictRegex && isStrict
  55831. ? this._weekdaysStrictRegex
  55832. : this._weekdaysRegex;
  55833. }
  55834. }
  55835. function weekdaysShortRegex(isStrict) {
  55836. if (this._weekdaysParseExact) {
  55837. if (!hasOwnProp(this, '_weekdaysRegex')) {
  55838. computeWeekdaysParse.call(this);
  55839. }
  55840. if (isStrict) {
  55841. return this._weekdaysShortStrictRegex;
  55842. } else {
  55843. return this._weekdaysShortRegex;
  55844. }
  55845. } else {
  55846. if (!hasOwnProp(this, '_weekdaysShortRegex')) {
  55847. this._weekdaysShortRegex = defaultWeekdaysShortRegex;
  55848. }
  55849. return this._weekdaysShortStrictRegex && isStrict
  55850. ? this._weekdaysShortStrictRegex
  55851. : this._weekdaysShortRegex;
  55852. }
  55853. }
  55854. function weekdaysMinRegex(isStrict) {
  55855. if (this._weekdaysParseExact) {
  55856. if (!hasOwnProp(this, '_weekdaysRegex')) {
  55857. computeWeekdaysParse.call(this);
  55858. }
  55859. if (isStrict) {
  55860. return this._weekdaysMinStrictRegex;
  55861. } else {
  55862. return this._weekdaysMinRegex;
  55863. }
  55864. } else {
  55865. if (!hasOwnProp(this, '_weekdaysMinRegex')) {
  55866. this._weekdaysMinRegex = defaultWeekdaysMinRegex;
  55867. }
  55868. return this._weekdaysMinStrictRegex && isStrict
  55869. ? this._weekdaysMinStrictRegex
  55870. : this._weekdaysMinRegex;
  55871. }
  55872. }
  55873. function computeWeekdaysParse() {
  55874. function cmpLenRev(a, b) {
  55875. return b.length - a.length;
  55876. }
  55877. var minPieces = [],
  55878. shortPieces = [],
  55879. longPieces = [],
  55880. mixedPieces = [],
  55881. i,
  55882. mom,
  55883. minp,
  55884. shortp,
  55885. longp;
  55886. for (i = 0; i < 7; i++) {
  55887. // make the regex if we don't have it already
  55888. mom = createUTC([2000, 1]).day(i);
  55889. minp = regexEscape(this.weekdaysMin(mom, ''));
  55890. shortp = regexEscape(this.weekdaysShort(mom, ''));
  55891. longp = regexEscape(this.weekdays(mom, ''));
  55892. minPieces.push(minp);
  55893. shortPieces.push(shortp);
  55894. longPieces.push(longp);
  55895. mixedPieces.push(minp);
  55896. mixedPieces.push(shortp);
  55897. mixedPieces.push(longp);
  55898. }
  55899. // Sorting makes sure if one weekday (or abbr) is a prefix of another it
  55900. // will match the longer piece.
  55901. minPieces.sort(cmpLenRev);
  55902. shortPieces.sort(cmpLenRev);
  55903. longPieces.sort(cmpLenRev);
  55904. mixedPieces.sort(cmpLenRev);
  55905. this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  55906. this._weekdaysShortRegex = this._weekdaysRegex;
  55907. this._weekdaysMinRegex = this._weekdaysRegex;
  55908. this._weekdaysStrictRegex = new RegExp(
  55909. '^(' + longPieces.join('|') + ')',
  55910. 'i'
  55911. );
  55912. this._weekdaysShortStrictRegex = new RegExp(
  55913. '^(' + shortPieces.join('|') + ')',
  55914. 'i'
  55915. );
  55916. this._weekdaysMinStrictRegex = new RegExp(
  55917. '^(' + minPieces.join('|') + ')',
  55918. 'i'
  55919. );
  55920. }
  55921. // FORMATTING
  55922. function hFormat() {
  55923. return this.hours() % 12 || 12;
  55924. }
  55925. function kFormat() {
  55926. return this.hours() || 24;
  55927. }
  55928. addFormatToken('H', ['HH', 2], 0, 'hour');
  55929. addFormatToken('h', ['hh', 2], 0, hFormat);
  55930. addFormatToken('k', ['kk', 2], 0, kFormat);
  55931. addFormatToken('hmm', 0, 0, function () {
  55932. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
  55933. });
  55934. addFormatToken('hmmss', 0, 0, function () {
  55935. return (
  55936. '' +
  55937. hFormat.apply(this) +
  55938. zeroFill(this.minutes(), 2) +
  55939. zeroFill(this.seconds(), 2)
  55940. );
  55941. });
  55942. addFormatToken('Hmm', 0, 0, function () {
  55943. return '' + this.hours() + zeroFill(this.minutes(), 2);
  55944. });
  55945. addFormatToken('Hmmss', 0, 0, function () {
  55946. return (
  55947. '' +
  55948. this.hours() +
  55949. zeroFill(this.minutes(), 2) +
  55950. zeroFill(this.seconds(), 2)
  55951. );
  55952. });
  55953. function meridiem(token, lowercase) {
  55954. addFormatToken(token, 0, 0, function () {
  55955. return this.localeData().meridiem(
  55956. this.hours(),
  55957. this.minutes(),
  55958. lowercase
  55959. );
  55960. });
  55961. }
  55962. meridiem('a', true);
  55963. meridiem('A', false);
  55964. // ALIASES
  55965. addUnitAlias('hour', 'h');
  55966. // PRIORITY
  55967. addUnitPriority('hour', 13);
  55968. // PARSING
  55969. function matchMeridiem(isStrict, locale) {
  55970. return locale._meridiemParse;
  55971. }
  55972. addRegexToken('a', matchMeridiem);
  55973. addRegexToken('A', matchMeridiem);
  55974. addRegexToken('H', match1to2);
  55975. addRegexToken('h', match1to2);
  55976. addRegexToken('k', match1to2);
  55977. addRegexToken('HH', match1to2, match2);
  55978. addRegexToken('hh', match1to2, match2);
  55979. addRegexToken('kk', match1to2, match2);
  55980. addRegexToken('hmm', match3to4);
  55981. addRegexToken('hmmss', match5to6);
  55982. addRegexToken('Hmm', match3to4);
  55983. addRegexToken('Hmmss', match5to6);
  55984. addParseToken(['H', 'HH'], HOUR);
  55985. addParseToken(['k', 'kk'], function (input, array, config) {
  55986. var kInput = toInt(input);
  55987. array[HOUR] = kInput === 24 ? 0 : kInput;
  55988. });
  55989. addParseToken(['a', 'A'], function (input, array, config) {
  55990. config._isPm = config._locale.isPM(input);
  55991. config._meridiem = input;
  55992. });
  55993. addParseToken(['h', 'hh'], function (input, array, config) {
  55994. array[HOUR] = toInt(input);
  55995. getParsingFlags(config).bigHour = true;
  55996. });
  55997. addParseToken('hmm', function (input, array, config) {
  55998. var pos = input.length - 2;
  55999. array[HOUR] = toInt(input.substr(0, pos));
  56000. array[MINUTE] = toInt(input.substr(pos));
  56001. getParsingFlags(config).bigHour = true;
  56002. });
  56003. addParseToken('hmmss', function (input, array, config) {
  56004. var pos1 = input.length - 4,
  56005. pos2 = input.length - 2;
  56006. array[HOUR] = toInt(input.substr(0, pos1));
  56007. array[MINUTE] = toInt(input.substr(pos1, 2));
  56008. array[SECOND] = toInt(input.substr(pos2));
  56009. getParsingFlags(config).bigHour = true;
  56010. });
  56011. addParseToken('Hmm', function (input, array, config) {
  56012. var pos = input.length - 2;
  56013. array[HOUR] = toInt(input.substr(0, pos));
  56014. array[MINUTE] = toInt(input.substr(pos));
  56015. });
  56016. addParseToken('Hmmss', function (input, array, config) {
  56017. var pos1 = input.length - 4,
  56018. pos2 = input.length - 2;
  56019. array[HOUR] = toInt(input.substr(0, pos1));
  56020. array[MINUTE] = toInt(input.substr(pos1, 2));
  56021. array[SECOND] = toInt(input.substr(pos2));
  56022. });
  56023. // LOCALES
  56024. function localeIsPM(input) {
  56025. // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
  56026. // Using charAt should be more compatible.
  56027. return (input + '').toLowerCase().charAt(0) === 'p';
  56028. }
  56029. var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i,
  56030. // Setting the hour should keep the time, because the user explicitly
  56031. // specified which hour they want. So trying to maintain the same hour (in
  56032. // a new timezone) makes sense. Adding/subtracting hours does not follow
  56033. // this rule.
  56034. getSetHour = makeGetSet('Hours', true);
  56035. function localeMeridiem(hours, minutes, isLower) {
  56036. if (hours > 11) {
  56037. return isLower ? 'pm' : 'PM';
  56038. } else {
  56039. return isLower ? 'am' : 'AM';
  56040. }
  56041. }
  56042. var baseConfig = {
  56043. calendar: defaultCalendar,
  56044. longDateFormat: defaultLongDateFormat,
  56045. invalidDate: defaultInvalidDate,
  56046. ordinal: defaultOrdinal,
  56047. dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
  56048. relativeTime: defaultRelativeTime,
  56049. months: defaultLocaleMonths,
  56050. monthsShort: defaultLocaleMonthsShort,
  56051. week: defaultLocaleWeek,
  56052. weekdays: defaultLocaleWeekdays,
  56053. weekdaysMin: defaultLocaleWeekdaysMin,
  56054. weekdaysShort: defaultLocaleWeekdaysShort,
  56055. meridiemParse: defaultLocaleMeridiemParse,
  56056. };
  56057. // internal storage for locale config files
  56058. var locales = {},
  56059. localeFamilies = {},
  56060. globalLocale;
  56061. function commonPrefix(arr1, arr2) {
  56062. var i,
  56063. minl = Math.min(arr1.length, arr2.length);
  56064. for (i = 0; i < minl; i += 1) {
  56065. if (arr1[i] !== arr2[i]) {
  56066. return i;
  56067. }
  56068. }
  56069. return minl;
  56070. }
  56071. function normalizeLocale(key) {
  56072. return key ? key.toLowerCase().replace('_', '-') : key;
  56073. }
  56074. // pick the locale from the array
  56075. // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
  56076. // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
  56077. function chooseLocale(names) {
  56078. var i = 0,
  56079. j,
  56080. next,
  56081. locale,
  56082. split;
  56083. while (i < names.length) {
  56084. split = normalizeLocale(names[i]).split('-');
  56085. j = split.length;
  56086. next = normalizeLocale(names[i + 1]);
  56087. next = next ? next.split('-') : null;
  56088. while (j > 0) {
  56089. locale = loadLocale(split.slice(0, j).join('-'));
  56090. if (locale) {
  56091. return locale;
  56092. }
  56093. if (
  56094. next &&
  56095. next.length >= j &&
  56096. commonPrefix(split, next) >= j - 1
  56097. ) {
  56098. //the next array item is better than a shallower substring of this one
  56099. break;
  56100. }
  56101. j--;
  56102. }
  56103. i++;
  56104. }
  56105. return globalLocale;
  56106. }
  56107. function loadLocale(name) {
  56108. var oldLocale = null,
  56109. aliasedRequire;
  56110. // TODO: Find a better way to register and load all the locales in Node
  56111. if (
  56112. locales[name] === undefined &&
  56113. typeof module !== 'undefined' &&
  56114. module &&
  56115. module.exports
  56116. ) {
  56117. try {
  56118. oldLocale = globalLocale._abbr;
  56119. aliasedRequire = require;
  56120. __webpack_require__("./node_modules/moment/locale sync recursive ^\\.\\/.*$")("./" + name);
  56121. getSetGlobalLocale(oldLocale);
  56122. } catch (e) {
  56123. // mark as not found to avoid repeating expensive file require call causing high CPU
  56124. // when trying to find en-US, en_US, en-us for every format call
  56125. locales[name] = null; // null means not found
  56126. }
  56127. }
  56128. return locales[name];
  56129. }
  56130. // This function will load locale and then set the global locale. If
  56131. // no arguments are passed in, it will simply return the current global
  56132. // locale key.
  56133. function getSetGlobalLocale(key, values) {
  56134. var data;
  56135. if (key) {
  56136. if (isUndefined(values)) {
  56137. data = getLocale(key);
  56138. } else {
  56139. data = defineLocale(key, values);
  56140. }
  56141. if (data) {
  56142. // moment.duration._locale = moment._locale = data;
  56143. globalLocale = data;
  56144. } else {
  56145. if (typeof console !== 'undefined' && console.warn) {
  56146. //warn user if arguments are passed but the locale could not be set
  56147. console.warn(
  56148. 'Locale ' + key + ' not found. Did you forget to load it?'
  56149. );
  56150. }
  56151. }
  56152. }
  56153. return globalLocale._abbr;
  56154. }
  56155. function defineLocale(name, config) {
  56156. if (config !== null) {
  56157. var locale,
  56158. parentConfig = baseConfig;
  56159. config.abbr = name;
  56160. if (locales[name] != null) {
  56161. deprecateSimple(
  56162. 'defineLocaleOverride',
  56163. 'use moment.updateLocale(localeName, config) to change ' +
  56164. 'an existing locale. moment.defineLocale(localeName, ' +
  56165. 'config) should only be used for creating a new locale ' +
  56166. 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'
  56167. );
  56168. parentConfig = locales[name]._config;
  56169. } else if (config.parentLocale != null) {
  56170. if (locales[config.parentLocale] != null) {
  56171. parentConfig = locales[config.parentLocale]._config;
  56172. } else {
  56173. locale = loadLocale(config.parentLocale);
  56174. if (locale != null) {
  56175. parentConfig = locale._config;
  56176. } else {
  56177. if (!localeFamilies[config.parentLocale]) {
  56178. localeFamilies[config.parentLocale] = [];
  56179. }
  56180. localeFamilies[config.parentLocale].push({
  56181. name: name,
  56182. config: config,
  56183. });
  56184. return null;
  56185. }
  56186. }
  56187. }
  56188. locales[name] = new Locale(mergeConfigs(parentConfig, config));
  56189. if (localeFamilies[name]) {
  56190. localeFamilies[name].forEach(function (x) {
  56191. defineLocale(x.name, x.config);
  56192. });
  56193. }
  56194. // backwards compat for now: also set the locale
  56195. // make sure we set the locale AFTER all child locales have been
  56196. // created, so we won't end up with the child locale set.
  56197. getSetGlobalLocale(name);
  56198. return locales[name];
  56199. } else {
  56200. // useful for testing
  56201. delete locales[name];
  56202. return null;
  56203. }
  56204. }
  56205. function updateLocale(name, config) {
  56206. if (config != null) {
  56207. var locale,
  56208. tmpLocale,
  56209. parentConfig = baseConfig;
  56210. if (locales[name] != null && locales[name].parentLocale != null) {
  56211. // Update existing child locale in-place to avoid memory-leaks
  56212. locales[name].set(mergeConfigs(locales[name]._config, config));
  56213. } else {
  56214. // MERGE
  56215. tmpLocale = loadLocale(name);
  56216. if (tmpLocale != null) {
  56217. parentConfig = tmpLocale._config;
  56218. }
  56219. config = mergeConfigs(parentConfig, config);
  56220. if (tmpLocale == null) {
  56221. // updateLocale is called for creating a new locale
  56222. // Set abbr so it will have a name (getters return
  56223. // undefined otherwise).
  56224. config.abbr = name;
  56225. }
  56226. locale = new Locale(config);
  56227. locale.parentLocale = locales[name];
  56228. locales[name] = locale;
  56229. }
  56230. // backwards compat for now: also set the locale
  56231. getSetGlobalLocale(name);
  56232. } else {
  56233. // pass null for config to unupdate, useful for tests
  56234. if (locales[name] != null) {
  56235. if (locales[name].parentLocale != null) {
  56236. locales[name] = locales[name].parentLocale;
  56237. if (name === getSetGlobalLocale()) {
  56238. getSetGlobalLocale(name);
  56239. }
  56240. } else if (locales[name] != null) {
  56241. delete locales[name];
  56242. }
  56243. }
  56244. }
  56245. return locales[name];
  56246. }
  56247. // returns locale data
  56248. function getLocale(key) {
  56249. var locale;
  56250. if (key && key._locale && key._locale._abbr) {
  56251. key = key._locale._abbr;
  56252. }
  56253. if (!key) {
  56254. return globalLocale;
  56255. }
  56256. if (!isArray(key)) {
  56257. //short-circuit everything else
  56258. locale = loadLocale(key);
  56259. if (locale) {
  56260. return locale;
  56261. }
  56262. key = [key];
  56263. }
  56264. return chooseLocale(key);
  56265. }
  56266. function listLocales() {
  56267. return keys(locales);
  56268. }
  56269. function checkOverflow(m) {
  56270. var overflow,
  56271. a = m._a;
  56272. if (a && getParsingFlags(m).overflow === -2) {
  56273. overflow =
  56274. a[MONTH] < 0 || a[MONTH] > 11
  56275. ? MONTH
  56276. : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])
  56277. ? DATE
  56278. : a[HOUR] < 0 ||
  56279. a[HOUR] > 24 ||
  56280. (a[HOUR] === 24 &&
  56281. (a[MINUTE] !== 0 ||
  56282. a[SECOND] !== 0 ||
  56283. a[MILLISECOND] !== 0))
  56284. ? HOUR
  56285. : a[MINUTE] < 0 || a[MINUTE] > 59
  56286. ? MINUTE
  56287. : a[SECOND] < 0 || a[SECOND] > 59
  56288. ? SECOND
  56289. : a[MILLISECOND] < 0 || a[MILLISECOND] > 999
  56290. ? MILLISECOND
  56291. : -1;
  56292. if (
  56293. getParsingFlags(m)._overflowDayOfYear &&
  56294. (overflow < YEAR || overflow > DATE)
  56295. ) {
  56296. overflow = DATE;
  56297. }
  56298. if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
  56299. overflow = WEEK;
  56300. }
  56301. if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
  56302. overflow = WEEKDAY;
  56303. }
  56304. getParsingFlags(m).overflow = overflow;
  56305. }
  56306. return m;
  56307. }
  56308. // iso 8601 regex
  56309. // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
  56310. var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
  56311. basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
  56312. tzRegex = /Z|[+-]\d\d(?::?\d\d)?/,
  56313. isoDates = [
  56314. ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
  56315. ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
  56316. ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
  56317. ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
  56318. ['YYYY-DDD', /\d{4}-\d{3}/],
  56319. ['YYYY-MM', /\d{4}-\d\d/, false],
  56320. ['YYYYYYMMDD', /[+-]\d{10}/],
  56321. ['YYYYMMDD', /\d{8}/],
  56322. ['GGGG[W]WWE', /\d{4}W\d{3}/],
  56323. ['GGGG[W]WW', /\d{4}W\d{2}/, false],
  56324. ['YYYYDDD', /\d{7}/],
  56325. ['YYYYMM', /\d{6}/, false],
  56326. ['YYYY', /\d{4}/, false],
  56327. ],
  56328. // iso time formats and regexes
  56329. isoTimes = [
  56330. ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
  56331. ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
  56332. ['HH:mm:ss', /\d\d:\d\d:\d\d/],
  56333. ['HH:mm', /\d\d:\d\d/],
  56334. ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
  56335. ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
  56336. ['HHmmss', /\d\d\d\d\d\d/],
  56337. ['HHmm', /\d\d\d\d/],
  56338. ['HH', /\d\d/],
  56339. ],
  56340. aspNetJsonRegex = /^\/?Date\((-?\d+)/i,
  56341. // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
  56342. rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,
  56343. obsOffsets = {
  56344. UT: 0,
  56345. GMT: 0,
  56346. EDT: -4 * 60,
  56347. EST: -5 * 60,
  56348. CDT: -5 * 60,
  56349. CST: -6 * 60,
  56350. MDT: -6 * 60,
  56351. MST: -7 * 60,
  56352. PDT: -7 * 60,
  56353. PST: -8 * 60,
  56354. };
  56355. // date from iso format
  56356. function configFromISO(config) {
  56357. var i,
  56358. l,
  56359. string = config._i,
  56360. match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
  56361. allowTime,
  56362. dateFormat,
  56363. timeFormat,
  56364. tzFormat;
  56365. if (match) {
  56366. getParsingFlags(config).iso = true;
  56367. for (i = 0, l = isoDates.length; i < l; i++) {
  56368. if (isoDates[i][1].exec(match[1])) {
  56369. dateFormat = isoDates[i][0];
  56370. allowTime = isoDates[i][2] !== false;
  56371. break;
  56372. }
  56373. }
  56374. if (dateFormat == null) {
  56375. config._isValid = false;
  56376. return;
  56377. }
  56378. if (match[3]) {
  56379. for (i = 0, l = isoTimes.length; i < l; i++) {
  56380. if (isoTimes[i][1].exec(match[3])) {
  56381. // match[2] should be 'T' or space
  56382. timeFormat = (match[2] || ' ') + isoTimes[i][0];
  56383. break;
  56384. }
  56385. }
  56386. if (timeFormat == null) {
  56387. config._isValid = false;
  56388. return;
  56389. }
  56390. }
  56391. if (!allowTime && timeFormat != null) {
  56392. config._isValid = false;
  56393. return;
  56394. }
  56395. if (match[4]) {
  56396. if (tzRegex.exec(match[4])) {
  56397. tzFormat = 'Z';
  56398. } else {
  56399. config._isValid = false;
  56400. return;
  56401. }
  56402. }
  56403. config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
  56404. configFromStringAndFormat(config);
  56405. } else {
  56406. config._isValid = false;
  56407. }
  56408. }
  56409. function extractFromRFC2822Strings(
  56410. yearStr,
  56411. monthStr,
  56412. dayStr,
  56413. hourStr,
  56414. minuteStr,
  56415. secondStr
  56416. ) {
  56417. var result = [
  56418. untruncateYear(yearStr),
  56419. defaultLocaleMonthsShort.indexOf(monthStr),
  56420. parseInt(dayStr, 10),
  56421. parseInt(hourStr, 10),
  56422. parseInt(minuteStr, 10),
  56423. ];
  56424. if (secondStr) {
  56425. result.push(parseInt(secondStr, 10));
  56426. }
  56427. return result;
  56428. }
  56429. function untruncateYear(yearStr) {
  56430. var year = parseInt(yearStr, 10);
  56431. if (year <= 49) {
  56432. return 2000 + year;
  56433. } else if (year <= 999) {
  56434. return 1900 + year;
  56435. }
  56436. return year;
  56437. }
  56438. function preprocessRFC2822(s) {
  56439. // Remove comments and folding whitespace and replace multiple-spaces with a single space
  56440. return s
  56441. .replace(/\([^)]*\)|[\n\t]/g, ' ')
  56442. .replace(/(\s\s+)/g, ' ')
  56443. .replace(/^\s\s*/, '')
  56444. .replace(/\s\s*$/, '');
  56445. }
  56446. function checkWeekday(weekdayStr, parsedInput, config) {
  56447. if (weekdayStr) {
  56448. // TODO: Replace the vanilla JS Date object with an independent day-of-week check.
  56449. var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
  56450. weekdayActual = new Date(
  56451. parsedInput[0],
  56452. parsedInput[1],
  56453. parsedInput[2]
  56454. ).getDay();
  56455. if (weekdayProvided !== weekdayActual) {
  56456. getParsingFlags(config).weekdayMismatch = true;
  56457. config._isValid = false;
  56458. return false;
  56459. }
  56460. }
  56461. return true;
  56462. }
  56463. function calculateOffset(obsOffset, militaryOffset, numOffset) {
  56464. if (obsOffset) {
  56465. return obsOffsets[obsOffset];
  56466. } else if (militaryOffset) {
  56467. // the only allowed military tz is Z
  56468. return 0;
  56469. } else {
  56470. var hm = parseInt(numOffset, 10),
  56471. m = hm % 100,
  56472. h = (hm - m) / 100;
  56473. return h * 60 + m;
  56474. }
  56475. }
  56476. // date and time from ref 2822 format
  56477. function configFromRFC2822(config) {
  56478. var match = rfc2822.exec(preprocessRFC2822(config._i)),
  56479. parsedArray;
  56480. if (match) {
  56481. parsedArray = extractFromRFC2822Strings(
  56482. match[4],
  56483. match[3],
  56484. match[2],
  56485. match[5],
  56486. match[6],
  56487. match[7]
  56488. );
  56489. if (!checkWeekday(match[1], parsedArray, config)) {
  56490. return;
  56491. }
  56492. config._a = parsedArray;
  56493. config._tzm = calculateOffset(match[8], match[9], match[10]);
  56494. config._d = createUTCDate.apply(null, config._a);
  56495. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  56496. getParsingFlags(config).rfc2822 = true;
  56497. } else {
  56498. config._isValid = false;
  56499. }
  56500. }
  56501. // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict
  56502. function configFromString(config) {
  56503. var matched = aspNetJsonRegex.exec(config._i);
  56504. if (matched !== null) {
  56505. config._d = new Date(+matched[1]);
  56506. return;
  56507. }
  56508. configFromISO(config);
  56509. if (config._isValid === false) {
  56510. delete config._isValid;
  56511. } else {
  56512. return;
  56513. }
  56514. configFromRFC2822(config);
  56515. if (config._isValid === false) {
  56516. delete config._isValid;
  56517. } else {
  56518. return;
  56519. }
  56520. if (config._strict) {
  56521. config._isValid = false;
  56522. } else {
  56523. // Final attempt, use Input Fallback
  56524. hooks.createFromInputFallback(config);
  56525. }
  56526. }
  56527. hooks.createFromInputFallback = deprecate(
  56528. 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
  56529. 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
  56530. 'discouraged and will be removed in an upcoming major release. Please refer to ' +
  56531. 'http://momentjs.com/guides/#/warnings/js-date/ for more info.',
  56532. function (config) {
  56533. config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
  56534. }
  56535. );
  56536. // Pick the first defined of two or three arguments.
  56537. function defaults(a, b, c) {
  56538. if (a != null) {
  56539. return a;
  56540. }
  56541. if (b != null) {
  56542. return b;
  56543. }
  56544. return c;
  56545. }
  56546. function currentDateArray(config) {
  56547. // hooks is actually the exported moment object
  56548. var nowValue = new Date(hooks.now());
  56549. if (config._useUTC) {
  56550. return [
  56551. nowValue.getUTCFullYear(),
  56552. nowValue.getUTCMonth(),
  56553. nowValue.getUTCDate(),
  56554. ];
  56555. }
  56556. return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
  56557. }
  56558. // convert an array to a date.
  56559. // the array should mirror the parameters below
  56560. // note: all values past the year are optional and will default to the lowest possible value.
  56561. // [year, month, day , hour, minute, second, millisecond]
  56562. function configFromArray(config) {
  56563. var i,
  56564. date,
  56565. input = [],
  56566. currentDate,
  56567. expectedWeekday,
  56568. yearToUse;
  56569. if (config._d) {
  56570. return;
  56571. }
  56572. currentDate = currentDateArray(config);
  56573. //compute day of the year from weeks and weekdays
  56574. if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
  56575. dayOfYearFromWeekInfo(config);
  56576. }
  56577. //if the day of the year is set, figure out what it is
  56578. if (config._dayOfYear != null) {
  56579. yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
  56580. if (
  56581. config._dayOfYear > daysInYear(yearToUse) ||
  56582. config._dayOfYear === 0
  56583. ) {
  56584. getParsingFlags(config)._overflowDayOfYear = true;
  56585. }
  56586. date = createUTCDate(yearToUse, 0, config._dayOfYear);
  56587. config._a[MONTH] = date.getUTCMonth();
  56588. config._a[DATE] = date.getUTCDate();
  56589. }
  56590. // Default to current date.
  56591. // * if no year, month, day of month are given, default to today
  56592. // * if day of month is given, default month and year
  56593. // * if month is given, default only year
  56594. // * if year is given, don't default anything
  56595. for (i = 0; i < 3 && config._a[i] == null; ++i) {
  56596. config._a[i] = input[i] = currentDate[i];
  56597. }
  56598. // Zero out whatever was not defaulted, including time
  56599. for (; i < 7; i++) {
  56600. config._a[i] = input[i] =
  56601. config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i];
  56602. }
  56603. // Check for 24:00:00.000
  56604. if (
  56605. config._a[HOUR] === 24 &&
  56606. config._a[MINUTE] === 0 &&
  56607. config._a[SECOND] === 0 &&
  56608. config._a[MILLISECOND] === 0
  56609. ) {
  56610. config._nextDay = true;
  56611. config._a[HOUR] = 0;
  56612. }
  56613. config._d = (config._useUTC ? createUTCDate : createDate).apply(
  56614. null,
  56615. input
  56616. );
  56617. expectedWeekday = config._useUTC
  56618. ? config._d.getUTCDay()
  56619. : config._d.getDay();
  56620. // Apply timezone offset from input. The actual utcOffset can be changed
  56621. // with parseZone.
  56622. if (config._tzm != null) {
  56623. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  56624. }
  56625. if (config._nextDay) {
  56626. config._a[HOUR] = 24;
  56627. }
  56628. // check for mismatching day of week
  56629. if (
  56630. config._w &&
  56631. typeof config._w.d !== 'undefined' &&
  56632. config._w.d !== expectedWeekday
  56633. ) {
  56634. getParsingFlags(config).weekdayMismatch = true;
  56635. }
  56636. }
  56637. function dayOfYearFromWeekInfo(config) {
  56638. var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
  56639. w = config._w;
  56640. if (w.GG != null || w.W != null || w.E != null) {
  56641. dow = 1;
  56642. doy = 4;
  56643. // TODO: We need to take the current isoWeekYear, but that depends on
  56644. // how we interpret now (local, utc, fixed offset). So create
  56645. // a now version of current config (take local/utc/offset flags, and
  56646. // create now).
  56647. weekYear = defaults(
  56648. w.GG,
  56649. config._a[YEAR],
  56650. weekOfYear(createLocal(), 1, 4).year
  56651. );
  56652. week = defaults(w.W, 1);
  56653. weekday = defaults(w.E, 1);
  56654. if (weekday < 1 || weekday > 7) {
  56655. weekdayOverflow = true;
  56656. }
  56657. } else {
  56658. dow = config._locale._week.dow;
  56659. doy = config._locale._week.doy;
  56660. curWeek = weekOfYear(createLocal(), dow, doy);
  56661. weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
  56662. // Default to current week.
  56663. week = defaults(w.w, curWeek.week);
  56664. if (w.d != null) {
  56665. // weekday -- low day numbers are considered next week
  56666. weekday = w.d;
  56667. if (weekday < 0 || weekday > 6) {
  56668. weekdayOverflow = true;
  56669. }
  56670. } else if (w.e != null) {
  56671. // local weekday -- counting starts from beginning of week
  56672. weekday = w.e + dow;
  56673. if (w.e < 0 || w.e > 6) {
  56674. weekdayOverflow = true;
  56675. }
  56676. } else {
  56677. // default to beginning of week
  56678. weekday = dow;
  56679. }
  56680. }
  56681. if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
  56682. getParsingFlags(config)._overflowWeeks = true;
  56683. } else if (weekdayOverflow != null) {
  56684. getParsingFlags(config)._overflowWeekday = true;
  56685. } else {
  56686. temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
  56687. config._a[YEAR] = temp.year;
  56688. config._dayOfYear = temp.dayOfYear;
  56689. }
  56690. }
  56691. // constant that refers to the ISO standard
  56692. hooks.ISO_8601 = function () {};
  56693. // constant that refers to the RFC 2822 form
  56694. hooks.RFC_2822 = function () {};
  56695. // date from string and format string
  56696. function configFromStringAndFormat(config) {
  56697. // TODO: Move this to another part of the creation flow to prevent circular deps
  56698. if (config._f === hooks.ISO_8601) {
  56699. configFromISO(config);
  56700. return;
  56701. }
  56702. if (config._f === hooks.RFC_2822) {
  56703. configFromRFC2822(config);
  56704. return;
  56705. }
  56706. config._a = [];
  56707. getParsingFlags(config).empty = true;
  56708. // This array is used to make a Date, either with `new Date` or `Date.UTC`
  56709. var string = '' + config._i,
  56710. i,
  56711. parsedInput,
  56712. tokens,
  56713. token,
  56714. skipped,
  56715. stringLength = string.length,
  56716. totalParsedInputLength = 0,
  56717. era;
  56718. tokens =
  56719. expandFormat(config._f, config._locale).match(formattingTokens) || [];
  56720. for (i = 0; i < tokens.length; i++) {
  56721. token = tokens[i];
  56722. parsedInput = (string.match(getParseRegexForToken(token, config)) ||
  56723. [])[0];
  56724. if (parsedInput) {
  56725. skipped = string.substr(0, string.indexOf(parsedInput));
  56726. if (skipped.length > 0) {
  56727. getParsingFlags(config).unusedInput.push(skipped);
  56728. }
  56729. string = string.slice(
  56730. string.indexOf(parsedInput) + parsedInput.length
  56731. );
  56732. totalParsedInputLength += parsedInput.length;
  56733. }
  56734. // don't parse if it's not a known token
  56735. if (formatTokenFunctions[token]) {
  56736. if (parsedInput) {
  56737. getParsingFlags(config).empty = false;
  56738. } else {
  56739. getParsingFlags(config).unusedTokens.push(token);
  56740. }
  56741. addTimeToArrayFromToken(token, parsedInput, config);
  56742. } else if (config._strict && !parsedInput) {
  56743. getParsingFlags(config).unusedTokens.push(token);
  56744. }
  56745. }
  56746. // add remaining unparsed input length to the string
  56747. getParsingFlags(config).charsLeftOver =
  56748. stringLength - totalParsedInputLength;
  56749. if (string.length > 0) {
  56750. getParsingFlags(config).unusedInput.push(string);
  56751. }
  56752. // clear _12h flag if hour is <= 12
  56753. if (
  56754. config._a[HOUR] <= 12 &&
  56755. getParsingFlags(config).bigHour === true &&
  56756. config._a[HOUR] > 0
  56757. ) {
  56758. getParsingFlags(config).bigHour = undefined;
  56759. }
  56760. getParsingFlags(config).parsedDateParts = config._a.slice(0);
  56761. getParsingFlags(config).meridiem = config._meridiem;
  56762. // handle meridiem
  56763. config._a[HOUR] = meridiemFixWrap(
  56764. config._locale,
  56765. config._a[HOUR],
  56766. config._meridiem
  56767. );
  56768. // handle era
  56769. era = getParsingFlags(config).era;
  56770. if (era !== null) {
  56771. config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);
  56772. }
  56773. configFromArray(config);
  56774. checkOverflow(config);
  56775. }
  56776. function meridiemFixWrap(locale, hour, meridiem) {
  56777. var isPm;
  56778. if (meridiem == null) {
  56779. // nothing to do
  56780. return hour;
  56781. }
  56782. if (locale.meridiemHour != null) {
  56783. return locale.meridiemHour(hour, meridiem);
  56784. } else if (locale.isPM != null) {
  56785. // Fallback
  56786. isPm = locale.isPM(meridiem);
  56787. if (isPm && hour < 12) {
  56788. hour += 12;
  56789. }
  56790. if (!isPm && hour === 12) {
  56791. hour = 0;
  56792. }
  56793. return hour;
  56794. } else {
  56795. // this is not supposed to happen
  56796. return hour;
  56797. }
  56798. }
  56799. // date from string and array of format strings
  56800. function configFromStringAndArray(config) {
  56801. var tempConfig,
  56802. bestMoment,
  56803. scoreToBeat,
  56804. i,
  56805. currentScore,
  56806. validFormatFound,
  56807. bestFormatIsValid = false;
  56808. if (config._f.length === 0) {
  56809. getParsingFlags(config).invalidFormat = true;
  56810. config._d = new Date(NaN);
  56811. return;
  56812. }
  56813. for (i = 0; i < config._f.length; i++) {
  56814. currentScore = 0;
  56815. validFormatFound = false;
  56816. tempConfig = copyConfig({}, config);
  56817. if (config._useUTC != null) {
  56818. tempConfig._useUTC = config._useUTC;
  56819. }
  56820. tempConfig._f = config._f[i];
  56821. configFromStringAndFormat(tempConfig);
  56822. if (isValid(tempConfig)) {
  56823. validFormatFound = true;
  56824. }
  56825. // if there is any input that was not parsed add a penalty for that format
  56826. currentScore += getParsingFlags(tempConfig).charsLeftOver;
  56827. //or tokens
  56828. currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
  56829. getParsingFlags(tempConfig).score = currentScore;
  56830. if (!bestFormatIsValid) {
  56831. if (
  56832. scoreToBeat == null ||
  56833. currentScore < scoreToBeat ||
  56834. validFormatFound
  56835. ) {
  56836. scoreToBeat = currentScore;
  56837. bestMoment = tempConfig;
  56838. if (validFormatFound) {
  56839. bestFormatIsValid = true;
  56840. }
  56841. }
  56842. } else {
  56843. if (currentScore < scoreToBeat) {
  56844. scoreToBeat = currentScore;
  56845. bestMoment = tempConfig;
  56846. }
  56847. }
  56848. }
  56849. extend(config, bestMoment || tempConfig);
  56850. }
  56851. function configFromObject(config) {
  56852. if (config._d) {
  56853. return;
  56854. }
  56855. var i = normalizeObjectUnits(config._i),
  56856. dayOrDate = i.day === undefined ? i.date : i.day;
  56857. config._a = map(
  56858. [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],
  56859. function (obj) {
  56860. return obj && parseInt(obj, 10);
  56861. }
  56862. );
  56863. configFromArray(config);
  56864. }
  56865. function createFromConfig(config) {
  56866. var res = new Moment(checkOverflow(prepareConfig(config)));
  56867. if (res._nextDay) {
  56868. // Adding is smart enough around DST
  56869. res.add(1, 'd');
  56870. res._nextDay = undefined;
  56871. }
  56872. return res;
  56873. }
  56874. function prepareConfig(config) {
  56875. var input = config._i,
  56876. format = config._f;
  56877. config._locale = config._locale || getLocale(config._l);
  56878. if (input === null || (format === undefined && input === '')) {
  56879. return createInvalid({ nullInput: true });
  56880. }
  56881. if (typeof input === 'string') {
  56882. config._i = input = config._locale.preparse(input);
  56883. }
  56884. if (isMoment(input)) {
  56885. return new Moment(checkOverflow(input));
  56886. } else if (isDate(input)) {
  56887. config._d = input;
  56888. } else if (isArray(format)) {
  56889. configFromStringAndArray(config);
  56890. } else if (format) {
  56891. configFromStringAndFormat(config);
  56892. } else {
  56893. configFromInput(config);
  56894. }
  56895. if (!isValid(config)) {
  56896. config._d = null;
  56897. }
  56898. return config;
  56899. }
  56900. function configFromInput(config) {
  56901. var input = config._i;
  56902. if (isUndefined(input)) {
  56903. config._d = new Date(hooks.now());
  56904. } else if (isDate(input)) {
  56905. config._d = new Date(input.valueOf());
  56906. } else if (typeof input === 'string') {
  56907. configFromString(config);
  56908. } else if (isArray(input)) {
  56909. config._a = map(input.slice(0), function (obj) {
  56910. return parseInt(obj, 10);
  56911. });
  56912. configFromArray(config);
  56913. } else if (isObject(input)) {
  56914. configFromObject(config);
  56915. } else if (isNumber(input)) {
  56916. // from milliseconds
  56917. config._d = new Date(input);
  56918. } else {
  56919. hooks.createFromInputFallback(config);
  56920. }
  56921. }
  56922. function createLocalOrUTC(input, format, locale, strict, isUTC) {
  56923. var c = {};
  56924. if (format === true || format === false) {
  56925. strict = format;
  56926. format = undefined;
  56927. }
  56928. if (locale === true || locale === false) {
  56929. strict = locale;
  56930. locale = undefined;
  56931. }
  56932. if (
  56933. (isObject(input) && isObjectEmpty(input)) ||
  56934. (isArray(input) && input.length === 0)
  56935. ) {
  56936. input = undefined;
  56937. }
  56938. // object construction must be done this way.
  56939. // https://github.com/moment/moment/issues/1423
  56940. c._isAMomentObject = true;
  56941. c._useUTC = c._isUTC = isUTC;
  56942. c._l = locale;
  56943. c._i = input;
  56944. c._f = format;
  56945. c._strict = strict;
  56946. return createFromConfig(c);
  56947. }
  56948. function createLocal(input, format, locale, strict) {
  56949. return createLocalOrUTC(input, format, locale, strict, false);
  56950. }
  56951. var prototypeMin = deprecate(
  56952. 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
  56953. function () {
  56954. var other = createLocal.apply(null, arguments);
  56955. if (this.isValid() && other.isValid()) {
  56956. return other < this ? this : other;
  56957. } else {
  56958. return createInvalid();
  56959. }
  56960. }
  56961. ),
  56962. prototypeMax = deprecate(
  56963. 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
  56964. function () {
  56965. var other = createLocal.apply(null, arguments);
  56966. if (this.isValid() && other.isValid()) {
  56967. return other > this ? this : other;
  56968. } else {
  56969. return createInvalid();
  56970. }
  56971. }
  56972. );
  56973. // Pick a moment m from moments so that m[fn](other) is true for all
  56974. // other. This relies on the function fn to be transitive.
  56975. //
  56976. // moments should either be an array of moment objects or an array, whose
  56977. // first element is an array of moment objects.
  56978. function pickBy(fn, moments) {
  56979. var res, i;
  56980. if (moments.length === 1 && isArray(moments[0])) {
  56981. moments = moments[0];
  56982. }
  56983. if (!moments.length) {
  56984. return createLocal();
  56985. }
  56986. res = moments[0];
  56987. for (i = 1; i < moments.length; ++i) {
  56988. if (!moments[i].isValid() || moments[i][fn](res)) {
  56989. res = moments[i];
  56990. }
  56991. }
  56992. return res;
  56993. }
  56994. // TODO: Use [].sort instead?
  56995. function min() {
  56996. var args = [].slice.call(arguments, 0);
  56997. return pickBy('isBefore', args);
  56998. }
  56999. function max() {
  57000. var args = [].slice.call(arguments, 0);
  57001. return pickBy('isAfter', args);
  57002. }
  57003. var now = function () {
  57004. return Date.now ? Date.now() : +new Date();
  57005. };
  57006. var ordering = [
  57007. 'year',
  57008. 'quarter',
  57009. 'month',
  57010. 'week',
  57011. 'day',
  57012. 'hour',
  57013. 'minute',
  57014. 'second',
  57015. 'millisecond',
  57016. ];
  57017. function isDurationValid(m) {
  57018. var key,
  57019. unitHasDecimal = false,
  57020. i;
  57021. for (key in m) {
  57022. if (
  57023. hasOwnProp(m, key) &&
  57024. !(
  57025. indexOf.call(ordering, key) !== -1 &&
  57026. (m[key] == null || !isNaN(m[key]))
  57027. )
  57028. ) {
  57029. return false;
  57030. }
  57031. }
  57032. for (i = 0; i < ordering.length; ++i) {
  57033. if (m[ordering[i]]) {
  57034. if (unitHasDecimal) {
  57035. return false; // only allow non-integers for smallest unit
  57036. }
  57037. if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
  57038. unitHasDecimal = true;
  57039. }
  57040. }
  57041. }
  57042. return true;
  57043. }
  57044. function isValid$1() {
  57045. return this._isValid;
  57046. }
  57047. function createInvalid$1() {
  57048. return createDuration(NaN);
  57049. }
  57050. function Duration(duration) {
  57051. var normalizedInput = normalizeObjectUnits(duration),
  57052. years = normalizedInput.year || 0,
  57053. quarters = normalizedInput.quarter || 0,
  57054. months = normalizedInput.month || 0,
  57055. weeks = normalizedInput.week || normalizedInput.isoWeek || 0,
  57056. days = normalizedInput.day || 0,
  57057. hours = normalizedInput.hour || 0,
  57058. minutes = normalizedInput.minute || 0,
  57059. seconds = normalizedInput.second || 0,
  57060. milliseconds = normalizedInput.millisecond || 0;
  57061. this._isValid = isDurationValid(normalizedInput);
  57062. // representation for dateAddRemove
  57063. this._milliseconds =
  57064. +milliseconds +
  57065. seconds * 1e3 + // 1000
  57066. minutes * 6e4 + // 1000 * 60
  57067. hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
  57068. // Because of dateAddRemove treats 24 hours as different from a
  57069. // day when working around DST, we need to store them separately
  57070. this._days = +days + weeks * 7;
  57071. // It is impossible to translate months into days without knowing
  57072. // which months you are are talking about, so we have to store
  57073. // it separately.
  57074. this._months = +months + quarters * 3 + years * 12;
  57075. this._data = {};
  57076. this._locale = getLocale();
  57077. this._bubble();
  57078. }
  57079. function isDuration(obj) {
  57080. return obj instanceof Duration;
  57081. }
  57082. function absRound(number) {
  57083. if (number < 0) {
  57084. return Math.round(-1 * number) * -1;
  57085. } else {
  57086. return Math.round(number);
  57087. }
  57088. }
  57089. // compare two arrays, return the number of differences
  57090. function compareArrays(array1, array2, dontConvert) {
  57091. var len = Math.min(array1.length, array2.length),
  57092. lengthDiff = Math.abs(array1.length - array2.length),
  57093. diffs = 0,
  57094. i;
  57095. for (i = 0; i < len; i++) {
  57096. if (
  57097. (dontConvert && array1[i] !== array2[i]) ||
  57098. (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))
  57099. ) {
  57100. diffs++;
  57101. }
  57102. }
  57103. return diffs + lengthDiff;
  57104. }
  57105. // FORMATTING
  57106. function offset(token, separator) {
  57107. addFormatToken(token, 0, 0, function () {
  57108. var offset = this.utcOffset(),
  57109. sign = '+';
  57110. if (offset < 0) {
  57111. offset = -offset;
  57112. sign = '-';
  57113. }
  57114. return (
  57115. sign +
  57116. zeroFill(~~(offset / 60), 2) +
  57117. separator +
  57118. zeroFill(~~offset % 60, 2)
  57119. );
  57120. });
  57121. }
  57122. offset('Z', ':');
  57123. offset('ZZ', '');
  57124. // PARSING
  57125. addRegexToken('Z', matchShortOffset);
  57126. addRegexToken('ZZ', matchShortOffset);
  57127. addParseToken(['Z', 'ZZ'], function (input, array, config) {
  57128. config._useUTC = true;
  57129. config._tzm = offsetFromString(matchShortOffset, input);
  57130. });
  57131. // HELPERS
  57132. // timezone chunker
  57133. // '+10:00' > ['10', '00']
  57134. // '-1530' > ['-15', '30']
  57135. var chunkOffset = /([\+\-]|\d\d)/gi;
  57136. function offsetFromString(matcher, string) {
  57137. var matches = (string || '').match(matcher),
  57138. chunk,
  57139. parts,
  57140. minutes;
  57141. if (matches === null) {
  57142. return null;
  57143. }
  57144. chunk = matches[matches.length - 1] || [];
  57145. parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
  57146. minutes = +(parts[1] * 60) + toInt(parts[2]);
  57147. return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;
  57148. }
  57149. // Return a moment from input, that is local/utc/zone equivalent to model.
  57150. function cloneWithOffset(input, model) {
  57151. var res, diff;
  57152. if (model._isUTC) {
  57153. res = model.clone();
  57154. diff =
  57155. (isMoment(input) || isDate(input)
  57156. ? input.valueOf()
  57157. : createLocal(input).valueOf()) - res.valueOf();
  57158. // Use low-level api, because this fn is low-level api.
  57159. res._d.setTime(res._d.valueOf() + diff);
  57160. hooks.updateOffset(res, false);
  57161. return res;
  57162. } else {
  57163. return createLocal(input).local();
  57164. }
  57165. }
  57166. function getDateOffset(m) {
  57167. // On Firefox.24 Date#getTimezoneOffset returns a floating point.
  57168. // https://github.com/moment/moment/pull/1871
  57169. return -Math.round(m._d.getTimezoneOffset());
  57170. }
  57171. // HOOKS
  57172. // This function will be called whenever a moment is mutated.
  57173. // It is intended to keep the offset in sync with the timezone.
  57174. hooks.updateOffset = function () {};
  57175. // MOMENTS
  57176. // keepLocalTime = true means only change the timezone, without
  57177. // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
  57178. // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
  57179. // +0200, so we adjust the time as needed, to be valid.
  57180. //
  57181. // Keeping the time actually adds/subtracts (one hour)
  57182. // from the actual represented time. That is why we call updateOffset
  57183. // a second time. In case it wants us to change the offset again
  57184. // _changeInProgress == true case, then we have to adjust, because
  57185. // there is no such time in the given timezone.
  57186. function getSetOffset(input, keepLocalTime, keepMinutes) {
  57187. var offset = this._offset || 0,
  57188. localAdjust;
  57189. if (!this.isValid()) {
  57190. return input != null ? this : NaN;
  57191. }
  57192. if (input != null) {
  57193. if (typeof input === 'string') {
  57194. input = offsetFromString(matchShortOffset, input);
  57195. if (input === null) {
  57196. return this;
  57197. }
  57198. } else if (Math.abs(input) < 16 && !keepMinutes) {
  57199. input = input * 60;
  57200. }
  57201. if (!this._isUTC && keepLocalTime) {
  57202. localAdjust = getDateOffset(this);
  57203. }
  57204. this._offset = input;
  57205. this._isUTC = true;
  57206. if (localAdjust != null) {
  57207. this.add(localAdjust, 'm');
  57208. }
  57209. if (offset !== input) {
  57210. if (!keepLocalTime || this._changeInProgress) {
  57211. addSubtract(
  57212. this,
  57213. createDuration(input - offset, 'm'),
  57214. 1,
  57215. false
  57216. );
  57217. } else if (!this._changeInProgress) {
  57218. this._changeInProgress = true;
  57219. hooks.updateOffset(this, true);
  57220. this._changeInProgress = null;
  57221. }
  57222. }
  57223. return this;
  57224. } else {
  57225. return this._isUTC ? offset : getDateOffset(this);
  57226. }
  57227. }
  57228. function getSetZone(input, keepLocalTime) {
  57229. if (input != null) {
  57230. if (typeof input !== 'string') {
  57231. input = -input;
  57232. }
  57233. this.utcOffset(input, keepLocalTime);
  57234. return this;
  57235. } else {
  57236. return -this.utcOffset();
  57237. }
  57238. }
  57239. function setOffsetToUTC(keepLocalTime) {
  57240. return this.utcOffset(0, keepLocalTime);
  57241. }
  57242. function setOffsetToLocal(keepLocalTime) {
  57243. if (this._isUTC) {
  57244. this.utcOffset(0, keepLocalTime);
  57245. this._isUTC = false;
  57246. if (keepLocalTime) {
  57247. this.subtract(getDateOffset(this), 'm');
  57248. }
  57249. }
  57250. return this;
  57251. }
  57252. function setOffsetToParsedOffset() {
  57253. if (this._tzm != null) {
  57254. this.utcOffset(this._tzm, false, true);
  57255. } else if (typeof this._i === 'string') {
  57256. var tZone = offsetFromString(matchOffset, this._i);
  57257. if (tZone != null) {
  57258. this.utcOffset(tZone);
  57259. } else {
  57260. this.utcOffset(0, true);
  57261. }
  57262. }
  57263. return this;
  57264. }
  57265. function hasAlignedHourOffset(input) {
  57266. if (!this.isValid()) {
  57267. return false;
  57268. }
  57269. input = input ? createLocal(input).utcOffset() : 0;
  57270. return (this.utcOffset() - input) % 60 === 0;
  57271. }
  57272. function isDaylightSavingTime() {
  57273. return (
  57274. this.utcOffset() > this.clone().month(0).utcOffset() ||
  57275. this.utcOffset() > this.clone().month(5).utcOffset()
  57276. );
  57277. }
  57278. function isDaylightSavingTimeShifted() {
  57279. if (!isUndefined(this._isDSTShifted)) {
  57280. return this._isDSTShifted;
  57281. }
  57282. var c = {},
  57283. other;
  57284. copyConfig(c, this);
  57285. c = prepareConfig(c);
  57286. if (c._a) {
  57287. other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
  57288. this._isDSTShifted =
  57289. this.isValid() && compareArrays(c._a, other.toArray()) > 0;
  57290. } else {
  57291. this._isDSTShifted = false;
  57292. }
  57293. return this._isDSTShifted;
  57294. }
  57295. function isLocal() {
  57296. return this.isValid() ? !this._isUTC : false;
  57297. }
  57298. function isUtcOffset() {
  57299. return this.isValid() ? this._isUTC : false;
  57300. }
  57301. function isUtc() {
  57302. return this.isValid() ? this._isUTC && this._offset === 0 : false;
  57303. }
  57304. // ASP.NET json date format regex
  57305. var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,
  57306. // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
  57307. // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
  57308. // and further modified to allow for strings containing both week and day
  57309. isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
  57310. function createDuration(input, key) {
  57311. var duration = input,
  57312. // matching against regexp is expensive, do it on demand
  57313. match = null,
  57314. sign,
  57315. ret,
  57316. diffRes;
  57317. if (isDuration(input)) {
  57318. duration = {
  57319. ms: input._milliseconds,
  57320. d: input._days,
  57321. M: input._months,
  57322. };
  57323. } else if (isNumber(input) || !isNaN(+input)) {
  57324. duration = {};
  57325. if (key) {
  57326. duration[key] = +input;
  57327. } else {
  57328. duration.milliseconds = +input;
  57329. }
  57330. } else if ((match = aspNetRegex.exec(input))) {
  57331. sign = match[1] === '-' ? -1 : 1;
  57332. duration = {
  57333. y: 0,
  57334. d: toInt(match[DATE]) * sign,
  57335. h: toInt(match[HOUR]) * sign,
  57336. m: toInt(match[MINUTE]) * sign,
  57337. s: toInt(match[SECOND]) * sign,
  57338. ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match
  57339. };
  57340. } else if ((match = isoRegex.exec(input))) {
  57341. sign = match[1] === '-' ? -1 : 1;
  57342. duration = {
  57343. y: parseIso(match[2], sign),
  57344. M: parseIso(match[3], sign),
  57345. w: parseIso(match[4], sign),
  57346. d: parseIso(match[5], sign),
  57347. h: parseIso(match[6], sign),
  57348. m: parseIso(match[7], sign),
  57349. s: parseIso(match[8], sign),
  57350. };
  57351. } else if (duration == null) {
  57352. // checks for null or undefined
  57353. duration = {};
  57354. } else if (
  57355. typeof duration === 'object' &&
  57356. ('from' in duration || 'to' in duration)
  57357. ) {
  57358. diffRes = momentsDifference(
  57359. createLocal(duration.from),
  57360. createLocal(duration.to)
  57361. );
  57362. duration = {};
  57363. duration.ms = diffRes.milliseconds;
  57364. duration.M = diffRes.months;
  57365. }
  57366. ret = new Duration(duration);
  57367. if (isDuration(input) && hasOwnProp(input, '_locale')) {
  57368. ret._locale = input._locale;
  57369. }
  57370. if (isDuration(input) && hasOwnProp(input, '_isValid')) {
  57371. ret._isValid = input._isValid;
  57372. }
  57373. return ret;
  57374. }
  57375. createDuration.fn = Duration.prototype;
  57376. createDuration.invalid = createInvalid$1;
  57377. function parseIso(inp, sign) {
  57378. // We'd normally use ~~inp for this, but unfortunately it also
  57379. // converts floats to ints.
  57380. // inp may be undefined, so careful calling replace on it.
  57381. var res = inp && parseFloat(inp.replace(',', '.'));
  57382. // apply sign while we're at it
  57383. return (isNaN(res) ? 0 : res) * sign;
  57384. }
  57385. function positiveMomentsDifference(base, other) {
  57386. var res = {};
  57387. res.months =
  57388. other.month() - base.month() + (other.year() - base.year()) * 12;
  57389. if (base.clone().add(res.months, 'M').isAfter(other)) {
  57390. --res.months;
  57391. }
  57392. res.milliseconds = +other - +base.clone().add(res.months, 'M');
  57393. return res;
  57394. }
  57395. function momentsDifference(base, other) {
  57396. var res;
  57397. if (!(base.isValid() && other.isValid())) {
  57398. return { milliseconds: 0, months: 0 };
  57399. }
  57400. other = cloneWithOffset(other, base);
  57401. if (base.isBefore(other)) {
  57402. res = positiveMomentsDifference(base, other);
  57403. } else {
  57404. res = positiveMomentsDifference(other, base);
  57405. res.milliseconds = -res.milliseconds;
  57406. res.months = -res.months;
  57407. }
  57408. return res;
  57409. }
  57410. // TODO: remove 'name' arg after deprecation is removed
  57411. function createAdder(direction, name) {
  57412. return function (val, period) {
  57413. var dur, tmp;
  57414. //invert the arguments, but complain about it
  57415. if (period !== null && !isNaN(+period)) {
  57416. deprecateSimple(
  57417. name,
  57418. 'moment().' +
  57419. name +
  57420. '(period, number) is deprecated. Please use moment().' +
  57421. name +
  57422. '(number, period). ' +
  57423. 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'
  57424. );
  57425. tmp = val;
  57426. val = period;
  57427. period = tmp;
  57428. }
  57429. dur = createDuration(val, period);
  57430. addSubtract(this, dur, direction);
  57431. return this;
  57432. };
  57433. }
  57434. function addSubtract(mom, duration, isAdding, updateOffset) {
  57435. var milliseconds = duration._milliseconds,
  57436. days = absRound(duration._days),
  57437. months = absRound(duration._months);
  57438. if (!mom.isValid()) {
  57439. // No op
  57440. return;
  57441. }
  57442. updateOffset = updateOffset == null ? true : updateOffset;
  57443. if (months) {
  57444. setMonth(mom, get(mom, 'Month') + months * isAdding);
  57445. }
  57446. if (days) {
  57447. set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
  57448. }
  57449. if (milliseconds) {
  57450. mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
  57451. }
  57452. if (updateOffset) {
  57453. hooks.updateOffset(mom, days || months);
  57454. }
  57455. }
  57456. var add = createAdder(1, 'add'),
  57457. subtract = createAdder(-1, 'subtract');
  57458. function isString(input) {
  57459. return typeof input === 'string' || input instanceof String;
  57460. }
  57461. // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined
  57462. function isMomentInput(input) {
  57463. return (
  57464. isMoment(input) ||
  57465. isDate(input) ||
  57466. isString(input) ||
  57467. isNumber(input) ||
  57468. isNumberOrStringArray(input) ||
  57469. isMomentInputObject(input) ||
  57470. input === null ||
  57471. input === undefined
  57472. );
  57473. }
  57474. function isMomentInputObject(input) {
  57475. var objectTest = isObject(input) && !isObjectEmpty(input),
  57476. propertyTest = false,
  57477. properties = [
  57478. 'years',
  57479. 'year',
  57480. 'y',
  57481. 'months',
  57482. 'month',
  57483. 'M',
  57484. 'days',
  57485. 'day',
  57486. 'd',
  57487. 'dates',
  57488. 'date',
  57489. 'D',
  57490. 'hours',
  57491. 'hour',
  57492. 'h',
  57493. 'minutes',
  57494. 'minute',
  57495. 'm',
  57496. 'seconds',
  57497. 'second',
  57498. 's',
  57499. 'milliseconds',
  57500. 'millisecond',
  57501. 'ms',
  57502. ],
  57503. i,
  57504. property;
  57505. for (i = 0; i < properties.length; i += 1) {
  57506. property = properties[i];
  57507. propertyTest = propertyTest || hasOwnProp(input, property);
  57508. }
  57509. return objectTest && propertyTest;
  57510. }
  57511. function isNumberOrStringArray(input) {
  57512. var arrayTest = isArray(input),
  57513. dataTypeTest = false;
  57514. if (arrayTest) {
  57515. dataTypeTest =
  57516. input.filter(function (item) {
  57517. return !isNumber(item) && isString(input);
  57518. }).length === 0;
  57519. }
  57520. return arrayTest && dataTypeTest;
  57521. }
  57522. function isCalendarSpec(input) {
  57523. var objectTest = isObject(input) && !isObjectEmpty(input),
  57524. propertyTest = false,
  57525. properties = [
  57526. 'sameDay',
  57527. 'nextDay',
  57528. 'lastDay',
  57529. 'nextWeek',
  57530. 'lastWeek',
  57531. 'sameElse',
  57532. ],
  57533. i,
  57534. property;
  57535. for (i = 0; i < properties.length; i += 1) {
  57536. property = properties[i];
  57537. propertyTest = propertyTest || hasOwnProp(input, property);
  57538. }
  57539. return objectTest && propertyTest;
  57540. }
  57541. function getCalendarFormat(myMoment, now) {
  57542. var diff = myMoment.diff(now, 'days', true);
  57543. return diff < -6
  57544. ? 'sameElse'
  57545. : diff < -1
  57546. ? 'lastWeek'
  57547. : diff < 0
  57548. ? 'lastDay'
  57549. : diff < 1
  57550. ? 'sameDay'
  57551. : diff < 2
  57552. ? 'nextDay'
  57553. : diff < 7
  57554. ? 'nextWeek'
  57555. : 'sameElse';
  57556. }
  57557. function calendar$1(time, formats) {
  57558. // Support for single parameter, formats only overload to the calendar function
  57559. if (arguments.length === 1) {
  57560. if (isMomentInput(arguments[0])) {
  57561. time = arguments[0];
  57562. formats = undefined;
  57563. } else if (isCalendarSpec(arguments[0])) {
  57564. formats = arguments[0];
  57565. time = undefined;
  57566. }
  57567. }
  57568. // We want to compare the start of today, vs this.
  57569. // Getting start-of-today depends on whether we're local/utc/offset or not.
  57570. var now = time || createLocal(),
  57571. sod = cloneWithOffset(now, this).startOf('day'),
  57572. format = hooks.calendarFormat(this, sod) || 'sameElse',
  57573. output =
  57574. formats &&
  57575. (isFunction(formats[format])
  57576. ? formats[format].call(this, now)
  57577. : formats[format]);
  57578. return this.format(
  57579. output || this.localeData().calendar(format, this, createLocal(now))
  57580. );
  57581. }
  57582. function clone() {
  57583. return new Moment(this);
  57584. }
  57585. function isAfter(input, units) {
  57586. var localInput = isMoment(input) ? input : createLocal(input);
  57587. if (!(this.isValid() && localInput.isValid())) {
  57588. return false;
  57589. }
  57590. units = normalizeUnits(units) || 'millisecond';
  57591. if (units === 'millisecond') {
  57592. return this.valueOf() > localInput.valueOf();
  57593. } else {
  57594. return localInput.valueOf() < this.clone().startOf(units).valueOf();
  57595. }
  57596. }
  57597. function isBefore(input, units) {
  57598. var localInput = isMoment(input) ? input : createLocal(input);
  57599. if (!(this.isValid() && localInput.isValid())) {
  57600. return false;
  57601. }
  57602. units = normalizeUnits(units) || 'millisecond';
  57603. if (units === 'millisecond') {
  57604. return this.valueOf() < localInput.valueOf();
  57605. } else {
  57606. return this.clone().endOf(units).valueOf() < localInput.valueOf();
  57607. }
  57608. }
  57609. function isBetween(from, to, units, inclusivity) {
  57610. var localFrom = isMoment(from) ? from : createLocal(from),
  57611. localTo = isMoment(to) ? to : createLocal(to);
  57612. if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
  57613. return false;
  57614. }
  57615. inclusivity = inclusivity || '()';
  57616. return (
  57617. (inclusivity[0] === '('
  57618. ? this.isAfter(localFrom, units)
  57619. : !this.isBefore(localFrom, units)) &&
  57620. (inclusivity[1] === ')'
  57621. ? this.isBefore(localTo, units)
  57622. : !this.isAfter(localTo, units))
  57623. );
  57624. }
  57625. function isSame(input, units) {
  57626. var localInput = isMoment(input) ? input : createLocal(input),
  57627. inputMs;
  57628. if (!(this.isValid() && localInput.isValid())) {
  57629. return false;
  57630. }
  57631. units = normalizeUnits(units) || 'millisecond';
  57632. if (units === 'millisecond') {
  57633. return this.valueOf() === localInput.valueOf();
  57634. } else {
  57635. inputMs = localInput.valueOf();
  57636. return (
  57637. this.clone().startOf(units).valueOf() <= inputMs &&
  57638. inputMs <= this.clone().endOf(units).valueOf()
  57639. );
  57640. }
  57641. }
  57642. function isSameOrAfter(input, units) {
  57643. return this.isSame(input, units) || this.isAfter(input, units);
  57644. }
  57645. function isSameOrBefore(input, units) {
  57646. return this.isSame(input, units) || this.isBefore(input, units);
  57647. }
  57648. function diff(input, units, asFloat) {
  57649. var that, zoneDelta, output;
  57650. if (!this.isValid()) {
  57651. return NaN;
  57652. }
  57653. that = cloneWithOffset(input, this);
  57654. if (!that.isValid()) {
  57655. return NaN;
  57656. }
  57657. zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
  57658. units = normalizeUnits(units);
  57659. switch (units) {
  57660. case 'year':
  57661. output = monthDiff(this, that) / 12;
  57662. break;
  57663. case 'month':
  57664. output = monthDiff(this, that);
  57665. break;
  57666. case 'quarter':
  57667. output = monthDiff(this, that) / 3;
  57668. break;
  57669. case 'second':
  57670. output = (this - that) / 1e3;
  57671. break; // 1000
  57672. case 'minute':
  57673. output = (this - that) / 6e4;
  57674. break; // 1000 * 60
  57675. case 'hour':
  57676. output = (this - that) / 36e5;
  57677. break; // 1000 * 60 * 60
  57678. case 'day':
  57679. output = (this - that - zoneDelta) / 864e5;
  57680. break; // 1000 * 60 * 60 * 24, negate dst
  57681. case 'week':
  57682. output = (this - that - zoneDelta) / 6048e5;
  57683. break; // 1000 * 60 * 60 * 24 * 7, negate dst
  57684. default:
  57685. output = this - that;
  57686. }
  57687. return asFloat ? output : absFloor(output);
  57688. }
  57689. function monthDiff(a, b) {
  57690. if (a.date() < b.date()) {
  57691. // end-of-month calculations work correct when the start month has more
  57692. // days than the end month.
  57693. return -monthDiff(b, a);
  57694. }
  57695. // difference in months
  57696. var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),
  57697. // b is in (anchor - 1 month, anchor + 1 month)
  57698. anchor = a.clone().add(wholeMonthDiff, 'months'),
  57699. anchor2,
  57700. adjust;
  57701. if (b - anchor < 0) {
  57702. anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
  57703. // linear across the month
  57704. adjust = (b - anchor) / (anchor - anchor2);
  57705. } else {
  57706. anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
  57707. // linear across the month
  57708. adjust = (b - anchor) / (anchor2 - anchor);
  57709. }
  57710. //check for negative zero, return zero if negative zero
  57711. return -(wholeMonthDiff + adjust) || 0;
  57712. }
  57713. hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
  57714. hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
  57715. function toString() {
  57716. return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
  57717. }
  57718. function toISOString(keepOffset) {
  57719. if (!this.isValid()) {
  57720. return null;
  57721. }
  57722. var utc = keepOffset !== true,
  57723. m = utc ? this.clone().utc() : this;
  57724. if (m.year() < 0 || m.year() > 9999) {
  57725. return formatMoment(
  57726. m,
  57727. utc
  57728. ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'
  57729. : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'
  57730. );
  57731. }
  57732. if (isFunction(Date.prototype.toISOString)) {
  57733. // native implementation is ~50x faster, use it when we can
  57734. if (utc) {
  57735. return this.toDate().toISOString();
  57736. } else {
  57737. return new Date(this.valueOf() + this.utcOffset() * 60 * 1000)
  57738. .toISOString()
  57739. .replace('Z', formatMoment(m, 'Z'));
  57740. }
  57741. }
  57742. return formatMoment(
  57743. m,
  57744. utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'
  57745. );
  57746. }
  57747. /**
  57748. * Return a human readable representation of a moment that can
  57749. * also be evaluated to get a new moment which is the same
  57750. *
  57751. * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
  57752. */
  57753. function inspect() {
  57754. if (!this.isValid()) {
  57755. return 'moment.invalid(/* ' + this._i + ' */)';
  57756. }
  57757. var func = 'moment',
  57758. zone = '',
  57759. prefix,
  57760. year,
  57761. datetime,
  57762. suffix;
  57763. if (!this.isLocal()) {
  57764. func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
  57765. zone = 'Z';
  57766. }
  57767. prefix = '[' + func + '("]';
  57768. year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';
  57769. datetime = '-MM-DD[T]HH:mm:ss.SSS';
  57770. suffix = zone + '[")]';
  57771. return this.format(prefix + year + datetime + suffix);
  57772. }
  57773. function format(inputString) {
  57774. if (!inputString) {
  57775. inputString = this.isUtc()
  57776. ? hooks.defaultFormatUtc
  57777. : hooks.defaultFormat;
  57778. }
  57779. var output = formatMoment(this, inputString);
  57780. return this.localeData().postformat(output);
  57781. }
  57782. function from(time, withoutSuffix) {
  57783. if (
  57784. this.isValid() &&
  57785. ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
  57786. ) {
  57787. return createDuration({ to: this, from: time })
  57788. .locale(this.locale())
  57789. .humanize(!withoutSuffix);
  57790. } else {
  57791. return this.localeData().invalidDate();
  57792. }
  57793. }
  57794. function fromNow(withoutSuffix) {
  57795. return this.from(createLocal(), withoutSuffix);
  57796. }
  57797. function to(time, withoutSuffix) {
  57798. if (
  57799. this.isValid() &&
  57800. ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
  57801. ) {
  57802. return createDuration({ from: this, to: time })
  57803. .locale(this.locale())
  57804. .humanize(!withoutSuffix);
  57805. } else {
  57806. return this.localeData().invalidDate();
  57807. }
  57808. }
  57809. function toNow(withoutSuffix) {
  57810. return this.to(createLocal(), withoutSuffix);
  57811. }
  57812. // If passed a locale key, it will set the locale for this
  57813. // instance. Otherwise, it will return the locale configuration
  57814. // variables for this instance.
  57815. function locale(key) {
  57816. var newLocaleData;
  57817. if (key === undefined) {
  57818. return this._locale._abbr;
  57819. } else {
  57820. newLocaleData = getLocale(key);
  57821. if (newLocaleData != null) {
  57822. this._locale = newLocaleData;
  57823. }
  57824. return this;
  57825. }
  57826. }
  57827. var lang = deprecate(
  57828. 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
  57829. function (key) {
  57830. if (key === undefined) {
  57831. return this.localeData();
  57832. } else {
  57833. return this.locale(key);
  57834. }
  57835. }
  57836. );
  57837. function localeData() {
  57838. return this._locale;
  57839. }
  57840. var MS_PER_SECOND = 1000,
  57841. MS_PER_MINUTE = 60 * MS_PER_SECOND,
  57842. MS_PER_HOUR = 60 * MS_PER_MINUTE,
  57843. MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
  57844. // actual modulo - handles negative numbers (for dates before 1970):
  57845. function mod$1(dividend, divisor) {
  57846. return ((dividend % divisor) + divisor) % divisor;
  57847. }
  57848. function localStartOfDate(y, m, d) {
  57849. // the date constructor remaps years 0-99 to 1900-1999
  57850. if (y < 100 && y >= 0) {
  57851. // preserve leap years using a full 400 year cycle, then reset
  57852. return new Date(y + 400, m, d) - MS_PER_400_YEARS;
  57853. } else {
  57854. return new Date(y, m, d).valueOf();
  57855. }
  57856. }
  57857. function utcStartOfDate(y, m, d) {
  57858. // Date.UTC remaps years 0-99 to 1900-1999
  57859. if (y < 100 && y >= 0) {
  57860. // preserve leap years using a full 400 year cycle, then reset
  57861. return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
  57862. } else {
  57863. return Date.UTC(y, m, d);
  57864. }
  57865. }
  57866. function startOf(units) {
  57867. var time, startOfDate;
  57868. units = normalizeUnits(units);
  57869. if (units === undefined || units === 'millisecond' || !this.isValid()) {
  57870. return this;
  57871. }
  57872. startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
  57873. switch (units) {
  57874. case 'year':
  57875. time = startOfDate(this.year(), 0, 1);
  57876. break;
  57877. case 'quarter':
  57878. time = startOfDate(
  57879. this.year(),
  57880. this.month() - (this.month() % 3),
  57881. 1
  57882. );
  57883. break;
  57884. case 'month':
  57885. time = startOfDate(this.year(), this.month(), 1);
  57886. break;
  57887. case 'week':
  57888. time = startOfDate(
  57889. this.year(),
  57890. this.month(),
  57891. this.date() - this.weekday()
  57892. );
  57893. break;
  57894. case 'isoWeek':
  57895. time = startOfDate(
  57896. this.year(),
  57897. this.month(),
  57898. this.date() - (this.isoWeekday() - 1)
  57899. );
  57900. break;
  57901. case 'day':
  57902. case 'date':
  57903. time = startOfDate(this.year(), this.month(), this.date());
  57904. break;
  57905. case 'hour':
  57906. time = this._d.valueOf();
  57907. time -= mod$1(
  57908. time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
  57909. MS_PER_HOUR
  57910. );
  57911. break;
  57912. case 'minute':
  57913. time = this._d.valueOf();
  57914. time -= mod$1(time, MS_PER_MINUTE);
  57915. break;
  57916. case 'second':
  57917. time = this._d.valueOf();
  57918. time -= mod$1(time, MS_PER_SECOND);
  57919. break;
  57920. }
  57921. this._d.setTime(time);
  57922. hooks.updateOffset(this, true);
  57923. return this;
  57924. }
  57925. function endOf(units) {
  57926. var time, startOfDate;
  57927. units = normalizeUnits(units);
  57928. if (units === undefined || units === 'millisecond' || !this.isValid()) {
  57929. return this;
  57930. }
  57931. startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
  57932. switch (units) {
  57933. case 'year':
  57934. time = startOfDate(this.year() + 1, 0, 1) - 1;
  57935. break;
  57936. case 'quarter':
  57937. time =
  57938. startOfDate(
  57939. this.year(),
  57940. this.month() - (this.month() % 3) + 3,
  57941. 1
  57942. ) - 1;
  57943. break;
  57944. case 'month':
  57945. time = startOfDate(this.year(), this.month() + 1, 1) - 1;
  57946. break;
  57947. case 'week':
  57948. time =
  57949. startOfDate(
  57950. this.year(),
  57951. this.month(),
  57952. this.date() - this.weekday() + 7
  57953. ) - 1;
  57954. break;
  57955. case 'isoWeek':
  57956. time =
  57957. startOfDate(
  57958. this.year(),
  57959. this.month(),
  57960. this.date() - (this.isoWeekday() - 1) + 7
  57961. ) - 1;
  57962. break;
  57963. case 'day':
  57964. case 'date':
  57965. time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
  57966. break;
  57967. case 'hour':
  57968. time = this._d.valueOf();
  57969. time +=
  57970. MS_PER_HOUR -
  57971. mod$1(
  57972. time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
  57973. MS_PER_HOUR
  57974. ) -
  57975. 1;
  57976. break;
  57977. case 'minute':
  57978. time = this._d.valueOf();
  57979. time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
  57980. break;
  57981. case 'second':
  57982. time = this._d.valueOf();
  57983. time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
  57984. break;
  57985. }
  57986. this._d.setTime(time);
  57987. hooks.updateOffset(this, true);
  57988. return this;
  57989. }
  57990. function valueOf() {
  57991. return this._d.valueOf() - (this._offset || 0) * 60000;
  57992. }
  57993. function unix() {
  57994. return Math.floor(this.valueOf() / 1000);
  57995. }
  57996. function toDate() {
  57997. return new Date(this.valueOf());
  57998. }
  57999. function toArray() {
  58000. var m = this;
  58001. return [
  58002. m.year(),
  58003. m.month(),
  58004. m.date(),
  58005. m.hour(),
  58006. m.minute(),
  58007. m.second(),
  58008. m.millisecond(),
  58009. ];
  58010. }
  58011. function toObject() {
  58012. var m = this;
  58013. return {
  58014. years: m.year(),
  58015. months: m.month(),
  58016. date: m.date(),
  58017. hours: m.hours(),
  58018. minutes: m.minutes(),
  58019. seconds: m.seconds(),
  58020. milliseconds: m.milliseconds(),
  58021. };
  58022. }
  58023. function toJSON() {
  58024. // new Date(NaN).toJSON() === null
  58025. return this.isValid() ? this.toISOString() : null;
  58026. }
  58027. function isValid$2() {
  58028. return isValid(this);
  58029. }
  58030. function parsingFlags() {
  58031. return extend({}, getParsingFlags(this));
  58032. }
  58033. function invalidAt() {
  58034. return getParsingFlags(this).overflow;
  58035. }
  58036. function creationData() {
  58037. return {
  58038. input: this._i,
  58039. format: this._f,
  58040. locale: this._locale,
  58041. isUTC: this._isUTC,
  58042. strict: this._strict,
  58043. };
  58044. }
  58045. addFormatToken('N', 0, 0, 'eraAbbr');
  58046. addFormatToken('NN', 0, 0, 'eraAbbr');
  58047. addFormatToken('NNN', 0, 0, 'eraAbbr');
  58048. addFormatToken('NNNN', 0, 0, 'eraName');
  58049. addFormatToken('NNNNN', 0, 0, 'eraNarrow');
  58050. addFormatToken('y', ['y', 1], 'yo', 'eraYear');
  58051. addFormatToken('y', ['yy', 2], 0, 'eraYear');
  58052. addFormatToken('y', ['yyy', 3], 0, 'eraYear');
  58053. addFormatToken('y', ['yyyy', 4], 0, 'eraYear');
  58054. addRegexToken('N', matchEraAbbr);
  58055. addRegexToken('NN', matchEraAbbr);
  58056. addRegexToken('NNN', matchEraAbbr);
  58057. addRegexToken('NNNN', matchEraName);
  58058. addRegexToken('NNNNN', matchEraNarrow);
  58059. addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (
  58060. input,
  58061. array,
  58062. config,
  58063. token
  58064. ) {
  58065. var era = config._locale.erasParse(input, token, config._strict);
  58066. if (era) {
  58067. getParsingFlags(config).era = era;
  58068. } else {
  58069. getParsingFlags(config).invalidEra = input;
  58070. }
  58071. });
  58072. addRegexToken('y', matchUnsigned);
  58073. addRegexToken('yy', matchUnsigned);
  58074. addRegexToken('yyy', matchUnsigned);
  58075. addRegexToken('yyyy', matchUnsigned);
  58076. addRegexToken('yo', matchEraYearOrdinal);
  58077. addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);
  58078. addParseToken(['yo'], function (input, array, config, token) {
  58079. var match;
  58080. if (config._locale._eraYearOrdinalRegex) {
  58081. match = input.match(config._locale._eraYearOrdinalRegex);
  58082. }
  58083. if (config._locale.eraYearOrdinalParse) {
  58084. array[YEAR] = config._locale.eraYearOrdinalParse(input, match);
  58085. } else {
  58086. array[YEAR] = parseInt(input, 10);
  58087. }
  58088. });
  58089. function localeEras(m, format) {
  58090. var i,
  58091. l,
  58092. date,
  58093. eras = this._eras || getLocale('en')._eras;
  58094. for (i = 0, l = eras.length; i < l; ++i) {
  58095. switch (typeof eras[i].since) {
  58096. case 'string':
  58097. // truncate time
  58098. date = hooks(eras[i].since).startOf('day');
  58099. eras[i].since = date.valueOf();
  58100. break;
  58101. }
  58102. switch (typeof eras[i].until) {
  58103. case 'undefined':
  58104. eras[i].until = +Infinity;
  58105. break;
  58106. case 'string':
  58107. // truncate time
  58108. date = hooks(eras[i].until).startOf('day').valueOf();
  58109. eras[i].until = date.valueOf();
  58110. break;
  58111. }
  58112. }
  58113. return eras;
  58114. }
  58115. function localeErasParse(eraName, format, strict) {
  58116. var i,
  58117. l,
  58118. eras = this.eras(),
  58119. name,
  58120. abbr,
  58121. narrow;
  58122. eraName = eraName.toUpperCase();
  58123. for (i = 0, l = eras.length; i < l; ++i) {
  58124. name = eras[i].name.toUpperCase();
  58125. abbr = eras[i].abbr.toUpperCase();
  58126. narrow = eras[i].narrow.toUpperCase();
  58127. if (strict) {
  58128. switch (format) {
  58129. case 'N':
  58130. case 'NN':
  58131. case 'NNN':
  58132. if (abbr === eraName) {
  58133. return eras[i];
  58134. }
  58135. break;
  58136. case 'NNNN':
  58137. if (name === eraName) {
  58138. return eras[i];
  58139. }
  58140. break;
  58141. case 'NNNNN':
  58142. if (narrow === eraName) {
  58143. return eras[i];
  58144. }
  58145. break;
  58146. }
  58147. } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {
  58148. return eras[i];
  58149. }
  58150. }
  58151. }
  58152. function localeErasConvertYear(era, year) {
  58153. var dir = era.since <= era.until ? +1 : -1;
  58154. if (year === undefined) {
  58155. return hooks(era.since).year();
  58156. } else {
  58157. return hooks(era.since).year() + (year - era.offset) * dir;
  58158. }
  58159. }
  58160. function getEraName() {
  58161. var i,
  58162. l,
  58163. val,
  58164. eras = this.localeData().eras();
  58165. for (i = 0, l = eras.length; i < l; ++i) {
  58166. // truncate time
  58167. val = this.clone().startOf('day').valueOf();
  58168. if (eras[i].since <= val && val <= eras[i].until) {
  58169. return eras[i].name;
  58170. }
  58171. if (eras[i].until <= val && val <= eras[i].since) {
  58172. return eras[i].name;
  58173. }
  58174. }
  58175. return '';
  58176. }
  58177. function getEraNarrow() {
  58178. var i,
  58179. l,
  58180. val,
  58181. eras = this.localeData().eras();
  58182. for (i = 0, l = eras.length; i < l; ++i) {
  58183. // truncate time
  58184. val = this.clone().startOf('day').valueOf();
  58185. if (eras[i].since <= val && val <= eras[i].until) {
  58186. return eras[i].narrow;
  58187. }
  58188. if (eras[i].until <= val && val <= eras[i].since) {
  58189. return eras[i].narrow;
  58190. }
  58191. }
  58192. return '';
  58193. }
  58194. function getEraAbbr() {
  58195. var i,
  58196. l,
  58197. val,
  58198. eras = this.localeData().eras();
  58199. for (i = 0, l = eras.length; i < l; ++i) {
  58200. // truncate time
  58201. val = this.clone().startOf('day').valueOf();
  58202. if (eras[i].since <= val && val <= eras[i].until) {
  58203. return eras[i].abbr;
  58204. }
  58205. if (eras[i].until <= val && val <= eras[i].since) {
  58206. return eras[i].abbr;
  58207. }
  58208. }
  58209. return '';
  58210. }
  58211. function getEraYear() {
  58212. var i,
  58213. l,
  58214. dir,
  58215. val,
  58216. eras = this.localeData().eras();
  58217. for (i = 0, l = eras.length; i < l; ++i) {
  58218. dir = eras[i].since <= eras[i].until ? +1 : -1;
  58219. // truncate time
  58220. val = this.clone().startOf('day').valueOf();
  58221. if (
  58222. (eras[i].since <= val && val <= eras[i].until) ||
  58223. (eras[i].until <= val && val <= eras[i].since)
  58224. ) {
  58225. return (
  58226. (this.year() - hooks(eras[i].since).year()) * dir +
  58227. eras[i].offset
  58228. );
  58229. }
  58230. }
  58231. return this.year();
  58232. }
  58233. function erasNameRegex(isStrict) {
  58234. if (!hasOwnProp(this, '_erasNameRegex')) {
  58235. computeErasParse.call(this);
  58236. }
  58237. return isStrict ? this._erasNameRegex : this._erasRegex;
  58238. }
  58239. function erasAbbrRegex(isStrict) {
  58240. if (!hasOwnProp(this, '_erasAbbrRegex')) {
  58241. computeErasParse.call(this);
  58242. }
  58243. return isStrict ? this._erasAbbrRegex : this._erasRegex;
  58244. }
  58245. function erasNarrowRegex(isStrict) {
  58246. if (!hasOwnProp(this, '_erasNarrowRegex')) {
  58247. computeErasParse.call(this);
  58248. }
  58249. return isStrict ? this._erasNarrowRegex : this._erasRegex;
  58250. }
  58251. function matchEraAbbr(isStrict, locale) {
  58252. return locale.erasAbbrRegex(isStrict);
  58253. }
  58254. function matchEraName(isStrict, locale) {
  58255. return locale.erasNameRegex(isStrict);
  58256. }
  58257. function matchEraNarrow(isStrict, locale) {
  58258. return locale.erasNarrowRegex(isStrict);
  58259. }
  58260. function matchEraYearOrdinal(isStrict, locale) {
  58261. return locale._eraYearOrdinalRegex || matchUnsigned;
  58262. }
  58263. function computeErasParse() {
  58264. var abbrPieces = [],
  58265. namePieces = [],
  58266. narrowPieces = [],
  58267. mixedPieces = [],
  58268. i,
  58269. l,
  58270. eras = this.eras();
  58271. for (i = 0, l = eras.length; i < l; ++i) {
  58272. namePieces.push(regexEscape(eras[i].name));
  58273. abbrPieces.push(regexEscape(eras[i].abbr));
  58274. narrowPieces.push(regexEscape(eras[i].narrow));
  58275. mixedPieces.push(regexEscape(eras[i].name));
  58276. mixedPieces.push(regexEscape(eras[i].abbr));
  58277. mixedPieces.push(regexEscape(eras[i].narrow));
  58278. }
  58279. this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  58280. this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');
  58281. this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');
  58282. this._erasNarrowRegex = new RegExp(
  58283. '^(' + narrowPieces.join('|') + ')',
  58284. 'i'
  58285. );
  58286. }
  58287. // FORMATTING
  58288. addFormatToken(0, ['gg', 2], 0, function () {
  58289. return this.weekYear() % 100;
  58290. });
  58291. addFormatToken(0, ['GG', 2], 0, function () {
  58292. return this.isoWeekYear() % 100;
  58293. });
  58294. function addWeekYearFormatToken(token, getter) {
  58295. addFormatToken(0, [token, token.length], 0, getter);
  58296. }
  58297. addWeekYearFormatToken('gggg', 'weekYear');
  58298. addWeekYearFormatToken('ggggg', 'weekYear');
  58299. addWeekYearFormatToken('GGGG', 'isoWeekYear');
  58300. addWeekYearFormatToken('GGGGG', 'isoWeekYear');
  58301. // ALIASES
  58302. addUnitAlias('weekYear', 'gg');
  58303. addUnitAlias('isoWeekYear', 'GG');
  58304. // PRIORITY
  58305. addUnitPriority('weekYear', 1);
  58306. addUnitPriority('isoWeekYear', 1);
  58307. // PARSING
  58308. addRegexToken('G', matchSigned);
  58309. addRegexToken('g', matchSigned);
  58310. addRegexToken('GG', match1to2, match2);
  58311. addRegexToken('gg', match1to2, match2);
  58312. addRegexToken('GGGG', match1to4, match4);
  58313. addRegexToken('gggg', match1to4, match4);
  58314. addRegexToken('GGGGG', match1to6, match6);
  58315. addRegexToken('ggggg', match1to6, match6);
  58316. addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (
  58317. input,
  58318. week,
  58319. config,
  58320. token
  58321. ) {
  58322. week[token.substr(0, 2)] = toInt(input);
  58323. });
  58324. addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
  58325. week[token] = hooks.parseTwoDigitYear(input);
  58326. });
  58327. // MOMENTS
  58328. function getSetWeekYear(input) {
  58329. return getSetWeekYearHelper.call(
  58330. this,
  58331. input,
  58332. this.week(),
  58333. this.weekday(),
  58334. this.localeData()._week.dow,
  58335. this.localeData()._week.doy
  58336. );
  58337. }
  58338. function getSetISOWeekYear(input) {
  58339. return getSetWeekYearHelper.call(
  58340. this,
  58341. input,
  58342. this.isoWeek(),
  58343. this.isoWeekday(),
  58344. 1,
  58345. 4
  58346. );
  58347. }
  58348. function getISOWeeksInYear() {
  58349. return weeksInYear(this.year(), 1, 4);
  58350. }
  58351. function getISOWeeksInISOWeekYear() {
  58352. return weeksInYear(this.isoWeekYear(), 1, 4);
  58353. }
  58354. function getWeeksInYear() {
  58355. var weekInfo = this.localeData()._week;
  58356. return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
  58357. }
  58358. function getWeeksInWeekYear() {
  58359. var weekInfo = this.localeData()._week;
  58360. return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
  58361. }
  58362. function getSetWeekYearHelper(input, week, weekday, dow, doy) {
  58363. var weeksTarget;
  58364. if (input == null) {
  58365. return weekOfYear(this, dow, doy).year;
  58366. } else {
  58367. weeksTarget = weeksInYear(input, dow, doy);
  58368. if (week > weeksTarget) {
  58369. week = weeksTarget;
  58370. }
  58371. return setWeekAll.call(this, input, week, weekday, dow, doy);
  58372. }
  58373. }
  58374. function setWeekAll(weekYear, week, weekday, dow, doy) {
  58375. var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
  58376. date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
  58377. this.year(date.getUTCFullYear());
  58378. this.month(date.getUTCMonth());
  58379. this.date(date.getUTCDate());
  58380. return this;
  58381. }
  58382. // FORMATTING
  58383. addFormatToken('Q', 0, 'Qo', 'quarter');
  58384. // ALIASES
  58385. addUnitAlias('quarter', 'Q');
  58386. // PRIORITY
  58387. addUnitPriority('quarter', 7);
  58388. // PARSING
  58389. addRegexToken('Q', match1);
  58390. addParseToken('Q', function (input, array) {
  58391. array[MONTH] = (toInt(input) - 1) * 3;
  58392. });
  58393. // MOMENTS
  58394. function getSetQuarter(input) {
  58395. return input == null
  58396. ? Math.ceil((this.month() + 1) / 3)
  58397. : this.month((input - 1) * 3 + (this.month() % 3));
  58398. }
  58399. // FORMATTING
  58400. addFormatToken('D', ['DD', 2], 'Do', 'date');
  58401. // ALIASES
  58402. addUnitAlias('date', 'D');
  58403. // PRIORITY
  58404. addUnitPriority('date', 9);
  58405. // PARSING
  58406. addRegexToken('D', match1to2);
  58407. addRegexToken('DD', match1to2, match2);
  58408. addRegexToken('Do', function (isStrict, locale) {
  58409. // TODO: Remove "ordinalParse" fallback in next major release.
  58410. return isStrict
  58411. ? locale._dayOfMonthOrdinalParse || locale._ordinalParse
  58412. : locale._dayOfMonthOrdinalParseLenient;
  58413. });
  58414. addParseToken(['D', 'DD'], DATE);
  58415. addParseToken('Do', function (input, array) {
  58416. array[DATE] = toInt(input.match(match1to2)[0]);
  58417. });
  58418. // MOMENTS
  58419. var getSetDayOfMonth = makeGetSet('Date', true);
  58420. // FORMATTING
  58421. addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
  58422. // ALIASES
  58423. addUnitAlias('dayOfYear', 'DDD');
  58424. // PRIORITY
  58425. addUnitPriority('dayOfYear', 4);
  58426. // PARSING
  58427. addRegexToken('DDD', match1to3);
  58428. addRegexToken('DDDD', match3);
  58429. addParseToken(['DDD', 'DDDD'], function (input, array, config) {
  58430. config._dayOfYear = toInt(input);
  58431. });
  58432. // HELPERS
  58433. // MOMENTS
  58434. function getSetDayOfYear(input) {
  58435. var dayOfYear =
  58436. Math.round(
  58437. (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5
  58438. ) + 1;
  58439. return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');
  58440. }
  58441. // FORMATTING
  58442. addFormatToken('m', ['mm', 2], 0, 'minute');
  58443. // ALIASES
  58444. addUnitAlias('minute', 'm');
  58445. // PRIORITY
  58446. addUnitPriority('minute', 14);
  58447. // PARSING
  58448. addRegexToken('m', match1to2);
  58449. addRegexToken('mm', match1to2, match2);
  58450. addParseToken(['m', 'mm'], MINUTE);
  58451. // MOMENTS
  58452. var getSetMinute = makeGetSet('Minutes', false);
  58453. // FORMATTING
  58454. addFormatToken('s', ['ss', 2], 0, 'second');
  58455. // ALIASES
  58456. addUnitAlias('second', 's');
  58457. // PRIORITY
  58458. addUnitPriority('second', 15);
  58459. // PARSING
  58460. addRegexToken('s', match1to2);
  58461. addRegexToken('ss', match1to2, match2);
  58462. addParseToken(['s', 'ss'], SECOND);
  58463. // MOMENTS
  58464. var getSetSecond = makeGetSet('Seconds', false);
  58465. // FORMATTING
  58466. addFormatToken('S', 0, 0, function () {
  58467. return ~~(this.millisecond() / 100);
  58468. });
  58469. addFormatToken(0, ['SS', 2], 0, function () {
  58470. return ~~(this.millisecond() / 10);
  58471. });
  58472. addFormatToken(0, ['SSS', 3], 0, 'millisecond');
  58473. addFormatToken(0, ['SSSS', 4], 0, function () {
  58474. return this.millisecond() * 10;
  58475. });
  58476. addFormatToken(0, ['SSSSS', 5], 0, function () {
  58477. return this.millisecond() * 100;
  58478. });
  58479. addFormatToken(0, ['SSSSSS', 6], 0, function () {
  58480. return this.millisecond() * 1000;
  58481. });
  58482. addFormatToken(0, ['SSSSSSS', 7], 0, function () {
  58483. return this.millisecond() * 10000;
  58484. });
  58485. addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
  58486. return this.millisecond() * 100000;
  58487. });
  58488. addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
  58489. return this.millisecond() * 1000000;
  58490. });
  58491. // ALIASES
  58492. addUnitAlias('millisecond', 'ms');
  58493. // PRIORITY
  58494. addUnitPriority('millisecond', 16);
  58495. // PARSING
  58496. addRegexToken('S', match1to3, match1);
  58497. addRegexToken('SS', match1to3, match2);
  58498. addRegexToken('SSS', match1to3, match3);
  58499. var token, getSetMillisecond;
  58500. for (token = 'SSSS'; token.length <= 9; token += 'S') {
  58501. addRegexToken(token, matchUnsigned);
  58502. }
  58503. function parseMs(input, array) {
  58504. array[MILLISECOND] = toInt(('0.' + input) * 1000);
  58505. }
  58506. for (token = 'S'; token.length <= 9; token += 'S') {
  58507. addParseToken(token, parseMs);
  58508. }
  58509. getSetMillisecond = makeGetSet('Milliseconds', false);
  58510. // FORMATTING
  58511. addFormatToken('z', 0, 0, 'zoneAbbr');
  58512. addFormatToken('zz', 0, 0, 'zoneName');
  58513. // MOMENTS
  58514. function getZoneAbbr() {
  58515. return this._isUTC ? 'UTC' : '';
  58516. }
  58517. function getZoneName() {
  58518. return this._isUTC ? 'Coordinated Universal Time' : '';
  58519. }
  58520. var proto = Moment.prototype;
  58521. proto.add = add;
  58522. proto.calendar = calendar$1;
  58523. proto.clone = clone;
  58524. proto.diff = diff;
  58525. proto.endOf = endOf;
  58526. proto.format = format;
  58527. proto.from = from;
  58528. proto.fromNow = fromNow;
  58529. proto.to = to;
  58530. proto.toNow = toNow;
  58531. proto.get = stringGet;
  58532. proto.invalidAt = invalidAt;
  58533. proto.isAfter = isAfter;
  58534. proto.isBefore = isBefore;
  58535. proto.isBetween = isBetween;
  58536. proto.isSame = isSame;
  58537. proto.isSameOrAfter = isSameOrAfter;
  58538. proto.isSameOrBefore = isSameOrBefore;
  58539. proto.isValid = isValid$2;
  58540. proto.lang = lang;
  58541. proto.locale = locale;
  58542. proto.localeData = localeData;
  58543. proto.max = prototypeMax;
  58544. proto.min = prototypeMin;
  58545. proto.parsingFlags = parsingFlags;
  58546. proto.set = stringSet;
  58547. proto.startOf = startOf;
  58548. proto.subtract = subtract;
  58549. proto.toArray = toArray;
  58550. proto.toObject = toObject;
  58551. proto.toDate = toDate;
  58552. proto.toISOString = toISOString;
  58553. proto.inspect = inspect;
  58554. if (typeof Symbol !== 'undefined' && Symbol.for != null) {
  58555. proto[Symbol.for('nodejs.util.inspect.custom')] = function () {
  58556. return 'Moment<' + this.format() + '>';
  58557. };
  58558. }
  58559. proto.toJSON = toJSON;
  58560. proto.toString = toString;
  58561. proto.unix = unix;
  58562. proto.valueOf = valueOf;
  58563. proto.creationData = creationData;
  58564. proto.eraName = getEraName;
  58565. proto.eraNarrow = getEraNarrow;
  58566. proto.eraAbbr = getEraAbbr;
  58567. proto.eraYear = getEraYear;
  58568. proto.year = getSetYear;
  58569. proto.isLeapYear = getIsLeapYear;
  58570. proto.weekYear = getSetWeekYear;
  58571. proto.isoWeekYear = getSetISOWeekYear;
  58572. proto.quarter = proto.quarters = getSetQuarter;
  58573. proto.month = getSetMonth;
  58574. proto.daysInMonth = getDaysInMonth;
  58575. proto.week = proto.weeks = getSetWeek;
  58576. proto.isoWeek = proto.isoWeeks = getSetISOWeek;
  58577. proto.weeksInYear = getWeeksInYear;
  58578. proto.weeksInWeekYear = getWeeksInWeekYear;
  58579. proto.isoWeeksInYear = getISOWeeksInYear;
  58580. proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
  58581. proto.date = getSetDayOfMonth;
  58582. proto.day = proto.days = getSetDayOfWeek;
  58583. proto.weekday = getSetLocaleDayOfWeek;
  58584. proto.isoWeekday = getSetISODayOfWeek;
  58585. proto.dayOfYear = getSetDayOfYear;
  58586. proto.hour = proto.hours = getSetHour;
  58587. proto.minute = proto.minutes = getSetMinute;
  58588. proto.second = proto.seconds = getSetSecond;
  58589. proto.millisecond = proto.milliseconds = getSetMillisecond;
  58590. proto.utcOffset = getSetOffset;
  58591. proto.utc = setOffsetToUTC;
  58592. proto.local = setOffsetToLocal;
  58593. proto.parseZone = setOffsetToParsedOffset;
  58594. proto.hasAlignedHourOffset = hasAlignedHourOffset;
  58595. proto.isDST = isDaylightSavingTime;
  58596. proto.isLocal = isLocal;
  58597. proto.isUtcOffset = isUtcOffset;
  58598. proto.isUtc = isUtc;
  58599. proto.isUTC = isUtc;
  58600. proto.zoneAbbr = getZoneAbbr;
  58601. proto.zoneName = getZoneName;
  58602. proto.dates = deprecate(
  58603. 'dates accessor is deprecated. Use date instead.',
  58604. getSetDayOfMonth
  58605. );
  58606. proto.months = deprecate(
  58607. 'months accessor is deprecated. Use month instead',
  58608. getSetMonth
  58609. );
  58610. proto.years = deprecate(
  58611. 'years accessor is deprecated. Use year instead',
  58612. getSetYear
  58613. );
  58614. proto.zone = deprecate(
  58615. 'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/',
  58616. getSetZone
  58617. );
  58618. proto.isDSTShifted = deprecate(
  58619. 'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information',
  58620. isDaylightSavingTimeShifted
  58621. );
  58622. function createUnix(input) {
  58623. return createLocal(input * 1000);
  58624. }
  58625. function createInZone() {
  58626. return createLocal.apply(null, arguments).parseZone();
  58627. }
  58628. function preParsePostFormat(string) {
  58629. return string;
  58630. }
  58631. var proto$1 = Locale.prototype;
  58632. proto$1.calendar = calendar;
  58633. proto$1.longDateFormat = longDateFormat;
  58634. proto$1.invalidDate = invalidDate;
  58635. proto$1.ordinal = ordinal;
  58636. proto$1.preparse = preParsePostFormat;
  58637. proto$1.postformat = preParsePostFormat;
  58638. proto$1.relativeTime = relativeTime;
  58639. proto$1.pastFuture = pastFuture;
  58640. proto$1.set = set;
  58641. proto$1.eras = localeEras;
  58642. proto$1.erasParse = localeErasParse;
  58643. proto$1.erasConvertYear = localeErasConvertYear;
  58644. proto$1.erasAbbrRegex = erasAbbrRegex;
  58645. proto$1.erasNameRegex = erasNameRegex;
  58646. proto$1.erasNarrowRegex = erasNarrowRegex;
  58647. proto$1.months = localeMonths;
  58648. proto$1.monthsShort = localeMonthsShort;
  58649. proto$1.monthsParse = localeMonthsParse;
  58650. proto$1.monthsRegex = monthsRegex;
  58651. proto$1.monthsShortRegex = monthsShortRegex;
  58652. proto$1.week = localeWeek;
  58653. proto$1.firstDayOfYear = localeFirstDayOfYear;
  58654. proto$1.firstDayOfWeek = localeFirstDayOfWeek;
  58655. proto$1.weekdays = localeWeekdays;
  58656. proto$1.weekdaysMin = localeWeekdaysMin;
  58657. proto$1.weekdaysShort = localeWeekdaysShort;
  58658. proto$1.weekdaysParse = localeWeekdaysParse;
  58659. proto$1.weekdaysRegex = weekdaysRegex;
  58660. proto$1.weekdaysShortRegex = weekdaysShortRegex;
  58661. proto$1.weekdaysMinRegex = weekdaysMinRegex;
  58662. proto$1.isPM = localeIsPM;
  58663. proto$1.meridiem = localeMeridiem;
  58664. function get$1(format, index, field, setter) {
  58665. var locale = getLocale(),
  58666. utc = createUTC().set(setter, index);
  58667. return locale[field](utc, format);
  58668. }
  58669. function listMonthsImpl(format, index, field) {
  58670. if (isNumber(format)) {
  58671. index = format;
  58672. format = undefined;
  58673. }
  58674. format = format || '';
  58675. if (index != null) {
  58676. return get$1(format, index, field, 'month');
  58677. }
  58678. var i,
  58679. out = [];
  58680. for (i = 0; i < 12; i++) {
  58681. out[i] = get$1(format, i, field, 'month');
  58682. }
  58683. return out;
  58684. }
  58685. // ()
  58686. // (5)
  58687. // (fmt, 5)
  58688. // (fmt)
  58689. // (true)
  58690. // (true, 5)
  58691. // (true, fmt, 5)
  58692. // (true, fmt)
  58693. function listWeekdaysImpl(localeSorted, format, index, field) {
  58694. if (typeof localeSorted === 'boolean') {
  58695. if (isNumber(format)) {
  58696. index = format;
  58697. format = undefined;
  58698. }
  58699. format = format || '';
  58700. } else {
  58701. format = localeSorted;
  58702. index = format;
  58703. localeSorted = false;
  58704. if (isNumber(format)) {
  58705. index = format;
  58706. format = undefined;
  58707. }
  58708. format = format || '';
  58709. }
  58710. var locale = getLocale(),
  58711. shift = localeSorted ? locale._week.dow : 0,
  58712. i,
  58713. out = [];
  58714. if (index != null) {
  58715. return get$1(format, (index + shift) % 7, field, 'day');
  58716. }
  58717. for (i = 0; i < 7; i++) {
  58718. out[i] = get$1(format, (i + shift) % 7, field, 'day');
  58719. }
  58720. return out;
  58721. }
  58722. function listMonths(format, index) {
  58723. return listMonthsImpl(format, index, 'months');
  58724. }
  58725. function listMonthsShort(format, index) {
  58726. return listMonthsImpl(format, index, 'monthsShort');
  58727. }
  58728. function listWeekdays(localeSorted, format, index) {
  58729. return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
  58730. }
  58731. function listWeekdaysShort(localeSorted, format, index) {
  58732. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
  58733. }
  58734. function listWeekdaysMin(localeSorted, format, index) {
  58735. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
  58736. }
  58737. getSetGlobalLocale('en', {
  58738. eras: [
  58739. {
  58740. since: '0001-01-01',
  58741. until: +Infinity,
  58742. offset: 1,
  58743. name: 'Anno Domini',
  58744. narrow: 'AD',
  58745. abbr: 'AD',
  58746. },
  58747. {
  58748. since: '0000-12-31',
  58749. until: -Infinity,
  58750. offset: 1,
  58751. name: 'Before Christ',
  58752. narrow: 'BC',
  58753. abbr: 'BC',
  58754. },
  58755. ],
  58756. dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
  58757. ordinal: function (number) {
  58758. var b = number % 10,
  58759. output =
  58760. toInt((number % 100) / 10) === 1
  58761. ? 'th'
  58762. : b === 1
  58763. ? 'st'
  58764. : b === 2
  58765. ? 'nd'
  58766. : b === 3
  58767. ? 'rd'
  58768. : 'th';
  58769. return number + output;
  58770. },
  58771. });
  58772. // Side effect imports
  58773. hooks.lang = deprecate(
  58774. 'moment.lang is deprecated. Use moment.locale instead.',
  58775. getSetGlobalLocale
  58776. );
  58777. hooks.langData = deprecate(
  58778. 'moment.langData is deprecated. Use moment.localeData instead.',
  58779. getLocale
  58780. );
  58781. var mathAbs = Math.abs;
  58782. function abs() {
  58783. var data = this._data;
  58784. this._milliseconds = mathAbs(this._milliseconds);
  58785. this._days = mathAbs(this._days);
  58786. this._months = mathAbs(this._months);
  58787. data.milliseconds = mathAbs(data.milliseconds);
  58788. data.seconds = mathAbs(data.seconds);
  58789. data.minutes = mathAbs(data.minutes);
  58790. data.hours = mathAbs(data.hours);
  58791. data.months = mathAbs(data.months);
  58792. data.years = mathAbs(data.years);
  58793. return this;
  58794. }
  58795. function addSubtract$1(duration, input, value, direction) {
  58796. var other = createDuration(input, value);
  58797. duration._milliseconds += direction * other._milliseconds;
  58798. duration._days += direction * other._days;
  58799. duration._months += direction * other._months;
  58800. return duration._bubble();
  58801. }
  58802. // supports only 2.0-style add(1, 's') or add(duration)
  58803. function add$1(input, value) {
  58804. return addSubtract$1(this, input, value, 1);
  58805. }
  58806. // supports only 2.0-style subtract(1, 's') or subtract(duration)
  58807. function subtract$1(input, value) {
  58808. return addSubtract$1(this, input, value, -1);
  58809. }
  58810. function absCeil(number) {
  58811. if (number < 0) {
  58812. return Math.floor(number);
  58813. } else {
  58814. return Math.ceil(number);
  58815. }
  58816. }
  58817. function bubble() {
  58818. var milliseconds = this._milliseconds,
  58819. days = this._days,
  58820. months = this._months,
  58821. data = this._data,
  58822. seconds,
  58823. minutes,
  58824. hours,
  58825. years,
  58826. monthsFromDays;
  58827. // if we have a mix of positive and negative values, bubble down first
  58828. // check: https://github.com/moment/moment/issues/2166
  58829. if (
  58830. !(
  58831. (milliseconds >= 0 && days >= 0 && months >= 0) ||
  58832. (milliseconds <= 0 && days <= 0 && months <= 0)
  58833. )
  58834. ) {
  58835. milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
  58836. days = 0;
  58837. months = 0;
  58838. }
  58839. // The following code bubbles up values, see the tests for
  58840. // examples of what that means.
  58841. data.milliseconds = milliseconds % 1000;
  58842. seconds = absFloor(milliseconds / 1000);
  58843. data.seconds = seconds % 60;
  58844. minutes = absFloor(seconds / 60);
  58845. data.minutes = minutes % 60;
  58846. hours = absFloor(minutes / 60);
  58847. data.hours = hours % 24;
  58848. days += absFloor(hours / 24);
  58849. // convert days to months
  58850. monthsFromDays = absFloor(daysToMonths(days));
  58851. months += monthsFromDays;
  58852. days -= absCeil(monthsToDays(monthsFromDays));
  58853. // 12 months -> 1 year
  58854. years = absFloor(months / 12);
  58855. months %= 12;
  58856. data.days = days;
  58857. data.months = months;
  58858. data.years = years;
  58859. return this;
  58860. }
  58861. function daysToMonths(days) {
  58862. // 400 years have 146097 days (taking into account leap year rules)
  58863. // 400 years have 12 months === 4800
  58864. return (days * 4800) / 146097;
  58865. }
  58866. function monthsToDays(months) {
  58867. // the reverse of daysToMonths
  58868. return (months * 146097) / 4800;
  58869. }
  58870. function as(units) {
  58871. if (!this.isValid()) {
  58872. return NaN;
  58873. }
  58874. var days,
  58875. months,
  58876. milliseconds = this._milliseconds;
  58877. units = normalizeUnits(units);
  58878. if (units === 'month' || units === 'quarter' || units === 'year') {
  58879. days = this._days + milliseconds / 864e5;
  58880. months = this._months + daysToMonths(days);
  58881. switch (units) {
  58882. case 'month':
  58883. return months;
  58884. case 'quarter':
  58885. return months / 3;
  58886. case 'year':
  58887. return months / 12;
  58888. }
  58889. } else {
  58890. // handle milliseconds separately because of floating point math errors (issue #1867)
  58891. days = this._days + Math.round(monthsToDays(this._months));
  58892. switch (units) {
  58893. case 'week':
  58894. return days / 7 + milliseconds / 6048e5;
  58895. case 'day':
  58896. return days + milliseconds / 864e5;
  58897. case 'hour':
  58898. return days * 24 + milliseconds / 36e5;
  58899. case 'minute':
  58900. return days * 1440 + milliseconds / 6e4;
  58901. case 'second':
  58902. return days * 86400 + milliseconds / 1000;
  58903. // Math.floor prevents floating point math errors here
  58904. case 'millisecond':
  58905. return Math.floor(days * 864e5) + milliseconds;
  58906. default:
  58907. throw new Error('Unknown unit ' + units);
  58908. }
  58909. }
  58910. }
  58911. // TODO: Use this.as('ms')?
  58912. function valueOf$1() {
  58913. if (!this.isValid()) {
  58914. return NaN;
  58915. }
  58916. return (
  58917. this._milliseconds +
  58918. this._days * 864e5 +
  58919. (this._months % 12) * 2592e6 +
  58920. toInt(this._months / 12) * 31536e6
  58921. );
  58922. }
  58923. function makeAs(alias) {
  58924. return function () {
  58925. return this.as(alias);
  58926. };
  58927. }
  58928. var asMilliseconds = makeAs('ms'),
  58929. asSeconds = makeAs('s'),
  58930. asMinutes = makeAs('m'),
  58931. asHours = makeAs('h'),
  58932. asDays = makeAs('d'),
  58933. asWeeks = makeAs('w'),
  58934. asMonths = makeAs('M'),
  58935. asQuarters = makeAs('Q'),
  58936. asYears = makeAs('y');
  58937. function clone$1() {
  58938. return createDuration(this);
  58939. }
  58940. function get$2(units) {
  58941. units = normalizeUnits(units);
  58942. return this.isValid() ? this[units + 's']() : NaN;
  58943. }
  58944. function makeGetter(name) {
  58945. return function () {
  58946. return this.isValid() ? this._data[name] : NaN;
  58947. };
  58948. }
  58949. var milliseconds = makeGetter('milliseconds'),
  58950. seconds = makeGetter('seconds'),
  58951. minutes = makeGetter('minutes'),
  58952. hours = makeGetter('hours'),
  58953. days = makeGetter('days'),
  58954. months = makeGetter('months'),
  58955. years = makeGetter('years');
  58956. function weeks() {
  58957. return absFloor(this.days() / 7);
  58958. }
  58959. var round = Math.round,
  58960. thresholds = {
  58961. ss: 44, // a few seconds to seconds
  58962. s: 45, // seconds to minute
  58963. m: 45, // minutes to hour
  58964. h: 22, // hours to day
  58965. d: 26, // days to month/week
  58966. w: null, // weeks to month
  58967. M: 11, // months to year
  58968. };
  58969. // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
  58970. function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
  58971. return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
  58972. }
  58973. function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {
  58974. var duration = createDuration(posNegDuration).abs(),
  58975. seconds = round(duration.as('s')),
  58976. minutes = round(duration.as('m')),
  58977. hours = round(duration.as('h')),
  58978. days = round(duration.as('d')),
  58979. months = round(duration.as('M')),
  58980. weeks = round(duration.as('w')),
  58981. years = round(duration.as('y')),
  58982. a =
  58983. (seconds <= thresholds.ss && ['s', seconds]) ||
  58984. (seconds < thresholds.s && ['ss', seconds]) ||
  58985. (minutes <= 1 && ['m']) ||
  58986. (minutes < thresholds.m && ['mm', minutes]) ||
  58987. (hours <= 1 && ['h']) ||
  58988. (hours < thresholds.h && ['hh', hours]) ||
  58989. (days <= 1 && ['d']) ||
  58990. (days < thresholds.d && ['dd', days]);
  58991. if (thresholds.w != null) {
  58992. a =
  58993. a ||
  58994. (weeks <= 1 && ['w']) ||
  58995. (weeks < thresholds.w && ['ww', weeks]);
  58996. }
  58997. a = a ||
  58998. (months <= 1 && ['M']) ||
  58999. (months < thresholds.M && ['MM', months]) ||
  59000. (years <= 1 && ['y']) || ['yy', years];
  59001. a[2] = withoutSuffix;
  59002. a[3] = +posNegDuration > 0;
  59003. a[4] = locale;
  59004. return substituteTimeAgo.apply(null, a);
  59005. }
  59006. // This function allows you to set the rounding function for relative time strings
  59007. function getSetRelativeTimeRounding(roundingFunction) {
  59008. if (roundingFunction === undefined) {
  59009. return round;
  59010. }
  59011. if (typeof roundingFunction === 'function') {
  59012. round = roundingFunction;
  59013. return true;
  59014. }
  59015. return false;
  59016. }
  59017. // This function allows you to set a threshold for relative time strings
  59018. function getSetRelativeTimeThreshold(threshold, limit) {
  59019. if (thresholds[threshold] === undefined) {
  59020. return false;
  59021. }
  59022. if (limit === undefined) {
  59023. return thresholds[threshold];
  59024. }
  59025. thresholds[threshold] = limit;
  59026. if (threshold === 's') {
  59027. thresholds.ss = limit - 1;
  59028. }
  59029. return true;
  59030. }
  59031. function humanize(argWithSuffix, argThresholds) {
  59032. if (!this.isValid()) {
  59033. return this.localeData().invalidDate();
  59034. }
  59035. var withSuffix = false,
  59036. th = thresholds,
  59037. locale,
  59038. output;
  59039. if (typeof argWithSuffix === 'object') {
  59040. argThresholds = argWithSuffix;
  59041. argWithSuffix = false;
  59042. }
  59043. if (typeof argWithSuffix === 'boolean') {
  59044. withSuffix = argWithSuffix;
  59045. }
  59046. if (typeof argThresholds === 'object') {
  59047. th = Object.assign({}, thresholds, argThresholds);
  59048. if (argThresholds.s != null && argThresholds.ss == null) {
  59049. th.ss = argThresholds.s - 1;
  59050. }
  59051. }
  59052. locale = this.localeData();
  59053. output = relativeTime$1(this, !withSuffix, th, locale);
  59054. if (withSuffix) {
  59055. output = locale.pastFuture(+this, output);
  59056. }
  59057. return locale.postformat(output);
  59058. }
  59059. var abs$1 = Math.abs;
  59060. function sign(x) {
  59061. return (x > 0) - (x < 0) || +x;
  59062. }
  59063. function toISOString$1() {
  59064. // for ISO strings we do not use the normal bubbling rules:
  59065. // * milliseconds bubble up until they become hours
  59066. // * days do not bubble at all
  59067. // * months bubble up until they become years
  59068. // This is because there is no context-free conversion between hours and days
  59069. // (think of clock changes)
  59070. // and also not between days and months (28-31 days per month)
  59071. if (!this.isValid()) {
  59072. return this.localeData().invalidDate();
  59073. }
  59074. var seconds = abs$1(this._milliseconds) / 1000,
  59075. days = abs$1(this._days),
  59076. months = abs$1(this._months),
  59077. minutes,
  59078. hours,
  59079. years,
  59080. s,
  59081. total = this.asSeconds(),
  59082. totalSign,
  59083. ymSign,
  59084. daysSign,
  59085. hmsSign;
  59086. if (!total) {
  59087. // this is the same as C#'s (Noda) and python (isodate)...
  59088. // but not other JS (goog.date)
  59089. return 'P0D';
  59090. }
  59091. // 3600 seconds -> 60 minutes -> 1 hour
  59092. minutes = absFloor(seconds / 60);
  59093. hours = absFloor(minutes / 60);
  59094. seconds %= 60;
  59095. minutes %= 60;
  59096. // 12 months -> 1 year
  59097. years = absFloor(months / 12);
  59098. months %= 12;
  59099. // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
  59100. s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
  59101. totalSign = total < 0 ? '-' : '';
  59102. ymSign = sign(this._months) !== sign(total) ? '-' : '';
  59103. daysSign = sign(this._days) !== sign(total) ? '-' : '';
  59104. hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';
  59105. return (
  59106. totalSign +
  59107. 'P' +
  59108. (years ? ymSign + years + 'Y' : '') +
  59109. (months ? ymSign + months + 'M' : '') +
  59110. (days ? daysSign + days + 'D' : '') +
  59111. (hours || minutes || seconds ? 'T' : '') +
  59112. (hours ? hmsSign + hours + 'H' : '') +
  59113. (minutes ? hmsSign + minutes + 'M' : '') +
  59114. (seconds ? hmsSign + s + 'S' : '')
  59115. );
  59116. }
  59117. var proto$2 = Duration.prototype;
  59118. proto$2.isValid = isValid$1;
  59119. proto$2.abs = abs;
  59120. proto$2.add = add$1;
  59121. proto$2.subtract = subtract$1;
  59122. proto$2.as = as;
  59123. proto$2.asMilliseconds = asMilliseconds;
  59124. proto$2.asSeconds = asSeconds;
  59125. proto$2.asMinutes = asMinutes;
  59126. proto$2.asHours = asHours;
  59127. proto$2.asDays = asDays;
  59128. proto$2.asWeeks = asWeeks;
  59129. proto$2.asMonths = asMonths;
  59130. proto$2.asQuarters = asQuarters;
  59131. proto$2.asYears = asYears;
  59132. proto$2.valueOf = valueOf$1;
  59133. proto$2._bubble = bubble;
  59134. proto$2.clone = clone$1;
  59135. proto$2.get = get$2;
  59136. proto$2.milliseconds = milliseconds;
  59137. proto$2.seconds = seconds;
  59138. proto$2.minutes = minutes;
  59139. proto$2.hours = hours;
  59140. proto$2.days = days;
  59141. proto$2.weeks = weeks;
  59142. proto$2.months = months;
  59143. proto$2.years = years;
  59144. proto$2.humanize = humanize;
  59145. proto$2.toISOString = toISOString$1;
  59146. proto$2.toString = toISOString$1;
  59147. proto$2.toJSON = toISOString$1;
  59148. proto$2.locale = locale;
  59149. proto$2.localeData = localeData;
  59150. proto$2.toIsoString = deprecate(
  59151. 'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)',
  59152. toISOString$1
  59153. );
  59154. proto$2.lang = lang;
  59155. // FORMATTING
  59156. addFormatToken('X', 0, 0, 'unix');
  59157. addFormatToken('x', 0, 0, 'valueOf');
  59158. // PARSING
  59159. addRegexToken('x', matchSigned);
  59160. addRegexToken('X', matchTimestamp);
  59161. addParseToken('X', function (input, array, config) {
  59162. config._d = new Date(parseFloat(input) * 1000);
  59163. });
  59164. addParseToken('x', function (input, array, config) {
  59165. config._d = new Date(toInt(input));
  59166. });
  59167. //! moment.js
  59168. hooks.version = '2.28.0';
  59169. setHookCallback(createLocal);
  59170. hooks.fn = proto;
  59171. hooks.min = min;
  59172. hooks.max = max;
  59173. hooks.now = now;
  59174. hooks.utc = createUTC;
  59175. hooks.unix = createUnix;
  59176. hooks.months = listMonths;
  59177. hooks.isDate = isDate;
  59178. hooks.locale = getSetGlobalLocale;
  59179. hooks.invalid = createInvalid;
  59180. hooks.duration = createDuration;
  59181. hooks.isMoment = isMoment;
  59182. hooks.weekdays = listWeekdays;
  59183. hooks.parseZone = createInZone;
  59184. hooks.localeData = getLocale;
  59185. hooks.isDuration = isDuration;
  59186. hooks.monthsShort = listMonthsShort;
  59187. hooks.weekdaysMin = listWeekdaysMin;
  59188. hooks.defineLocale = defineLocale;
  59189. hooks.updateLocale = updateLocale;
  59190. hooks.locales = listLocales;
  59191. hooks.weekdaysShort = listWeekdaysShort;
  59192. hooks.normalizeUnits = normalizeUnits;
  59193. hooks.relativeTimeRounding = getSetRelativeTimeRounding;
  59194. hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
  59195. hooks.calendarFormat = getCalendarFormat;
  59196. hooks.prototype = proto;
  59197. // currently HTML5 input type only supports 24-hour formats
  59198. hooks.HTML5_FMT = {
  59199. DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" />
  59200. DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" />
  59201. DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" />
  59202. DATE: 'YYYY-MM-DD', // <input type="date" />
  59203. TIME: 'HH:mm', // <input type="time" />
  59204. TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" />
  59205. TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" />
  59206. WEEK: 'GGGG-[W]WW', // <input type="week" />
  59207. MONTH: 'YYYY-MM', // <input type="month" />
  59208. };
  59209. return hooks;
  59210. })));
  59211. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
  59212. /***/ }),
  59213. /***/ "./node_modules/ms/index.js":
  59214. /*!**********************************!*\
  59215. !*** ./node_modules/ms/index.js ***!
  59216. \**********************************/
  59217. /*! no static exports found */
  59218. /***/ (function(module, exports) {
  59219. /**
  59220. * Helpers.
  59221. */
  59222. var s = 1000;
  59223. var m = s * 60;
  59224. var h = m * 60;
  59225. var d = h * 24;
  59226. var y = d * 365.25;
  59227. /**
  59228. * Parse or format the given `val`.
  59229. *
  59230. * Options:
  59231. *
  59232. * - `long` verbose formatting [false]
  59233. *
  59234. * @param {String|Number} val
  59235. * @param {Object} [options]
  59236. * @throws {Error} throw an error if val is not a non-empty string or a number
  59237. * @return {String|Number}
  59238. * @api public
  59239. */
  59240. module.exports = function(val, options) {
  59241. options = options || {};
  59242. var type = typeof val;
  59243. if (type === 'string' && val.length > 0) {
  59244. return parse(val);
  59245. } else if (type === 'number' && isNaN(val) === false) {
  59246. return options.long ? fmtLong(val) : fmtShort(val);
  59247. }
  59248. throw new Error(
  59249. 'val is not a non-empty string or a valid number. val=' +
  59250. JSON.stringify(val)
  59251. );
  59252. };
  59253. /**
  59254. * Parse the given `str` and return milliseconds.
  59255. *
  59256. * @param {String} str
  59257. * @return {Number}
  59258. * @api private
  59259. */
  59260. function parse(str) {
  59261. str = String(str);
  59262. if (str.length > 100) {
  59263. return;
  59264. }
  59265. var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
  59266. str
  59267. );
  59268. if (!match) {
  59269. return;
  59270. }
  59271. var n = parseFloat(match[1]);
  59272. var type = (match[2] || 'ms').toLowerCase();
  59273. switch (type) {
  59274. case 'years':
  59275. case 'year':
  59276. case 'yrs':
  59277. case 'yr':
  59278. case 'y':
  59279. return n * y;
  59280. case 'days':
  59281. case 'day':
  59282. case 'd':
  59283. return n * d;
  59284. case 'hours':
  59285. case 'hour':
  59286. case 'hrs':
  59287. case 'hr':
  59288. case 'h':
  59289. return n * h;
  59290. case 'minutes':
  59291. case 'minute':
  59292. case 'mins':
  59293. case 'min':
  59294. case 'm':
  59295. return n * m;
  59296. case 'seconds':
  59297. case 'second':
  59298. case 'secs':
  59299. case 'sec':
  59300. case 's':
  59301. return n * s;
  59302. case 'milliseconds':
  59303. case 'millisecond':
  59304. case 'msecs':
  59305. case 'msec':
  59306. case 'ms':
  59307. return n;
  59308. default:
  59309. return undefined;
  59310. }
  59311. }
  59312. /**
  59313. * Short format for `ms`.
  59314. *
  59315. * @param {Number} ms
  59316. * @return {String}
  59317. * @api private
  59318. */
  59319. function fmtShort(ms) {
  59320. if (ms >= d) {
  59321. return Math.round(ms / d) + 'd';
  59322. }
  59323. if (ms >= h) {
  59324. return Math.round(ms / h) + 'h';
  59325. }
  59326. if (ms >= m) {
  59327. return Math.round(ms / m) + 'm';
  59328. }
  59329. if (ms >= s) {
  59330. return Math.round(ms / s) + 's';
  59331. }
  59332. return ms + 'ms';
  59333. }
  59334. /**
  59335. * Long format for `ms`.
  59336. *
  59337. * @param {Number} ms
  59338. * @return {String}
  59339. * @api private
  59340. */
  59341. function fmtLong(ms) {
  59342. return plural(ms, d, 'day') ||
  59343. plural(ms, h, 'hour') ||
  59344. plural(ms, m, 'minute') ||
  59345. plural(ms, s, 'second') ||
  59346. ms + ' ms';
  59347. }
  59348. /**
  59349. * Pluralization helper.
  59350. */
  59351. function plural(ms, n, name) {
  59352. if (ms < n) {
  59353. return;
  59354. }
  59355. if (ms < n * 1.5) {
  59356. return Math.floor(ms / n) + ' ' + name;
  59357. }
  59358. return Math.ceil(ms / n) + ' ' + name + 's';
  59359. }
  59360. /***/ }),
  59361. /***/ "./node_modules/parseqs/index.js":
  59362. /*!***************************************!*\
  59363. !*** ./node_modules/parseqs/index.js ***!
  59364. \***************************************/
  59365. /*! no static exports found */
  59366. /***/ (function(module, exports) {
  59367. /**
  59368. * Compiles a querystring
  59369. * Returns string representation of the object
  59370. *
  59371. * @param {Object}
  59372. * @api private
  59373. */
  59374. exports.encode = function (obj) {
  59375. var str = '';
  59376. for (var i in obj) {
  59377. if (obj.hasOwnProperty(i)) {
  59378. if (str.length) str += '&';
  59379. str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);
  59380. }
  59381. }
  59382. return str;
  59383. };
  59384. /**
  59385. * Parses a simple querystring into an object
  59386. *
  59387. * @param {String} qs
  59388. * @api private
  59389. */
  59390. exports.decode = function(qs){
  59391. var qry = {};
  59392. var pairs = qs.split('&');
  59393. for (var i = 0, l = pairs.length; i < l; i++) {
  59394. var pair = pairs[i].split('=');
  59395. qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
  59396. }
  59397. return qry;
  59398. };
  59399. /***/ }),
  59400. /***/ "./node_modules/parseuri/index.js":
  59401. /*!****************************************!*\
  59402. !*** ./node_modules/parseuri/index.js ***!
  59403. \****************************************/
  59404. /*! no static exports found */
  59405. /***/ (function(module, exports) {
  59406. /**
  59407. * Parses an URI
  59408. *
  59409. * @author Steven Levithan <stevenlevithan.com> (MIT license)
  59410. * @api private
  59411. */
  59412. var re = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;
  59413. var parts = [
  59414. 'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'
  59415. ];
  59416. module.exports = function parseuri(str) {
  59417. var src = str,
  59418. b = str.indexOf('['),
  59419. e = str.indexOf(']');
  59420. if (b != -1 && e != -1) {
  59421. str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);
  59422. }
  59423. var m = re.exec(str || ''),
  59424. uri = {},
  59425. i = 14;
  59426. while (i--) {
  59427. uri[parts[i]] = m[i] || '';
  59428. }
  59429. if (b != -1 && e != -1) {
  59430. uri.source = src;
  59431. uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');
  59432. uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');
  59433. uri.ipv6uri = true;
  59434. }
  59435. return uri;
  59436. };
  59437. /***/ }),
  59438. /***/ "./node_modules/popper.js/dist/esm/popper.js":
  59439. /*!***************************************************!*\
  59440. !*** ./node_modules/popper.js/dist/esm/popper.js ***!
  59441. \***************************************************/
  59442. /*! exports provided: default */
  59443. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  59444. "use strict";
  59445. __webpack_require__.r(__webpack_exports__);
  59446. /* WEBPACK VAR INJECTION */(function(global) {/**!
  59447. * @fileOverview Kickass library to create and place poppers near their reference elements.
  59448. * @version 1.16.1
  59449. * @license
  59450. * Copyright (c) 2016 Federico Zivolo and contributors
  59451. *
  59452. * Permission is hereby granted, free of charge, to any person obtaining a copy
  59453. * of this software and associated documentation files (the "Software"), to deal
  59454. * in the Software without restriction, including without limitation the rights
  59455. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  59456. * copies of the Software, and to permit persons to whom the Software is
  59457. * furnished to do so, subject to the following conditions:
  59458. *
  59459. * The above copyright notice and this permission notice shall be included in all
  59460. * copies or substantial portions of the Software.
  59461. *
  59462. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  59463. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  59464. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  59465. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  59466. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  59467. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  59468. * SOFTWARE.
  59469. */
  59470. var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';
  59471. var timeoutDuration = function () {
  59472. var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
  59473. for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
  59474. if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
  59475. return 1;
  59476. }
  59477. }
  59478. return 0;
  59479. }();
  59480. function microtaskDebounce(fn) {
  59481. var called = false;
  59482. return function () {
  59483. if (called) {
  59484. return;
  59485. }
  59486. called = true;
  59487. window.Promise.resolve().then(function () {
  59488. called = false;
  59489. fn();
  59490. });
  59491. };
  59492. }
  59493. function taskDebounce(fn) {
  59494. var scheduled = false;
  59495. return function () {
  59496. if (!scheduled) {
  59497. scheduled = true;
  59498. setTimeout(function () {
  59499. scheduled = false;
  59500. fn();
  59501. }, timeoutDuration);
  59502. }
  59503. };
  59504. }
  59505. var supportsMicroTasks = isBrowser && window.Promise;
  59506. /**
  59507. * Create a debounced version of a method, that's asynchronously deferred
  59508. * but called in the minimum time possible.
  59509. *
  59510. * @method
  59511. * @memberof Popper.Utils
  59512. * @argument {Function} fn
  59513. * @returns {Function}
  59514. */
  59515. var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
  59516. /**
  59517. * Check if the given variable is a function
  59518. * @method
  59519. * @memberof Popper.Utils
  59520. * @argument {Any} functionToCheck - variable to check
  59521. * @returns {Boolean} answer to: is a function?
  59522. */
  59523. function isFunction(functionToCheck) {
  59524. var getType = {};
  59525. return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
  59526. }
  59527. /**
  59528. * Get CSS computed property of the given element
  59529. * @method
  59530. * @memberof Popper.Utils
  59531. * @argument {Eement} element
  59532. * @argument {String} property
  59533. */
  59534. function getStyleComputedProperty(element, property) {
  59535. if (element.nodeType !== 1) {
  59536. return [];
  59537. }
  59538. // NOTE: 1 DOM access here
  59539. var window = element.ownerDocument.defaultView;
  59540. var css = window.getComputedStyle(element, null);
  59541. return property ? css[property] : css;
  59542. }
  59543. /**
  59544. * Returns the parentNode or the host of the element
  59545. * @method
  59546. * @memberof Popper.Utils
  59547. * @argument {Element} element
  59548. * @returns {Element} parent
  59549. */
  59550. function getParentNode(element) {
  59551. if (element.nodeName === 'HTML') {
  59552. return element;
  59553. }
  59554. return element.parentNode || element.host;
  59555. }
  59556. /**
  59557. * Returns the scrolling parent of the given element
  59558. * @method
  59559. * @memberof Popper.Utils
  59560. * @argument {Element} element
  59561. * @returns {Element} scroll parent
  59562. */
  59563. function getScrollParent(element) {
  59564. // Return body, `getScroll` will take care to get the correct `scrollTop` from it
  59565. if (!element) {
  59566. return document.body;
  59567. }
  59568. switch (element.nodeName) {
  59569. case 'HTML':
  59570. case 'BODY':
  59571. return element.ownerDocument.body;
  59572. case '#document':
  59573. return element.body;
  59574. }
  59575. // Firefox want us to check `-x` and `-y` variations as well
  59576. var _getStyleComputedProp = getStyleComputedProperty(element),
  59577. overflow = _getStyleComputedProp.overflow,
  59578. overflowX = _getStyleComputedProp.overflowX,
  59579. overflowY = _getStyleComputedProp.overflowY;
  59580. if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
  59581. return element;
  59582. }
  59583. return getScrollParent(getParentNode(element));
  59584. }
  59585. /**
  59586. * Returns the reference node of the reference object, or the reference object itself.
  59587. * @method
  59588. * @memberof Popper.Utils
  59589. * @param {Element|Object} reference - the reference element (the popper will be relative to this)
  59590. * @returns {Element} parent
  59591. */
  59592. function getReferenceNode(reference) {
  59593. return reference && reference.referenceNode ? reference.referenceNode : reference;
  59594. }
  59595. var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
  59596. var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);
  59597. /**
  59598. * Determines if the browser is Internet Explorer
  59599. * @method
  59600. * @memberof Popper.Utils
  59601. * @param {Number} version to check
  59602. * @returns {Boolean} isIE
  59603. */
  59604. function isIE(version) {
  59605. if (version === 11) {
  59606. return isIE11;
  59607. }
  59608. if (version === 10) {
  59609. return isIE10;
  59610. }
  59611. return isIE11 || isIE10;
  59612. }
  59613. /**
  59614. * Returns the offset parent of the given element
  59615. * @method
  59616. * @memberof Popper.Utils
  59617. * @argument {Element} element
  59618. * @returns {Element} offset parent
  59619. */
  59620. function getOffsetParent(element) {
  59621. if (!element) {
  59622. return document.documentElement;
  59623. }
  59624. var noOffsetParent = isIE(10) ? document.body : null;
  59625. // NOTE: 1 DOM access here
  59626. var offsetParent = element.offsetParent || null;
  59627. // Skip hidden elements which don't have an offsetParent
  59628. while (offsetParent === noOffsetParent && element.nextElementSibling) {
  59629. offsetParent = (element = element.nextElementSibling).offsetParent;
  59630. }
  59631. var nodeName = offsetParent && offsetParent.nodeName;
  59632. if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
  59633. return element ? element.ownerDocument.documentElement : document.documentElement;
  59634. }
  59635. // .offsetParent will return the closest TH, TD or TABLE in case
  59636. // no offsetParent is present, I hate this job...
  59637. if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
  59638. return getOffsetParent(offsetParent);
  59639. }
  59640. return offsetParent;
  59641. }
  59642. function isOffsetContainer(element) {
  59643. var nodeName = element.nodeName;
  59644. if (nodeName === 'BODY') {
  59645. return false;
  59646. }
  59647. return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
  59648. }
  59649. /**
  59650. * Finds the root node (document, shadowDOM root) of the given element
  59651. * @method
  59652. * @memberof Popper.Utils
  59653. * @argument {Element} node
  59654. * @returns {Element} root node
  59655. */
  59656. function getRoot(node) {
  59657. if (node.parentNode !== null) {
  59658. return getRoot(node.parentNode);
  59659. }
  59660. return node;
  59661. }
  59662. /**
  59663. * Finds the offset parent common to the two provided nodes
  59664. * @method
  59665. * @memberof Popper.Utils
  59666. * @argument {Element} element1
  59667. * @argument {Element} element2
  59668. * @returns {Element} common offset parent
  59669. */
  59670. function findCommonOffsetParent(element1, element2) {
  59671. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  59672. if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
  59673. return document.documentElement;
  59674. }
  59675. // Here we make sure to give as "start" the element that comes first in the DOM
  59676. var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
  59677. var start = order ? element1 : element2;
  59678. var end = order ? element2 : element1;
  59679. // Get common ancestor container
  59680. var range = document.createRange();
  59681. range.setStart(start, 0);
  59682. range.setEnd(end, 0);
  59683. var commonAncestorContainer = range.commonAncestorContainer;
  59684. // Both nodes are inside #document
  59685. if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
  59686. if (isOffsetContainer(commonAncestorContainer)) {
  59687. return commonAncestorContainer;
  59688. }
  59689. return getOffsetParent(commonAncestorContainer);
  59690. }
  59691. // one of the nodes is inside shadowDOM, find which one
  59692. var element1root = getRoot(element1);
  59693. if (element1root.host) {
  59694. return findCommonOffsetParent(element1root.host, element2);
  59695. } else {
  59696. return findCommonOffsetParent(element1, getRoot(element2).host);
  59697. }
  59698. }
  59699. /**
  59700. * Gets the scroll value of the given element in the given side (top and left)
  59701. * @method
  59702. * @memberof Popper.Utils
  59703. * @argument {Element} element
  59704. * @argument {String} side `top` or `left`
  59705. * @returns {number} amount of scrolled pixels
  59706. */
  59707. function getScroll(element) {
  59708. var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
  59709. var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
  59710. var nodeName = element.nodeName;
  59711. if (nodeName === 'BODY' || nodeName === 'HTML') {
  59712. var html = element.ownerDocument.documentElement;
  59713. var scrollingElement = element.ownerDocument.scrollingElement || html;
  59714. return scrollingElement[upperSide];
  59715. }
  59716. return element[upperSide];
  59717. }
  59718. /*
  59719. * Sum or subtract the element scroll values (left and top) from a given rect object
  59720. * @method
  59721. * @memberof Popper.Utils
  59722. * @param {Object} rect - Rect object you want to change
  59723. * @param {HTMLElement} element - The element from the function reads the scroll values
  59724. * @param {Boolean} subtract - set to true if you want to subtract the scroll values
  59725. * @return {Object} rect - The modifier rect object
  59726. */
  59727. function includeScroll(rect, element) {
  59728. var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  59729. var scrollTop = getScroll(element, 'top');
  59730. var scrollLeft = getScroll(element, 'left');
  59731. var modifier = subtract ? -1 : 1;
  59732. rect.top += scrollTop * modifier;
  59733. rect.bottom += scrollTop * modifier;
  59734. rect.left += scrollLeft * modifier;
  59735. rect.right += scrollLeft * modifier;
  59736. return rect;
  59737. }
  59738. /*
  59739. * Helper to detect borders of a given element
  59740. * @method
  59741. * @memberof Popper.Utils
  59742. * @param {CSSStyleDeclaration} styles
  59743. * Result of `getStyleComputedProperty` on the given element
  59744. * @param {String} axis - `x` or `y`
  59745. * @return {number} borders - The borders size of the given axis
  59746. */
  59747. function getBordersSize(styles, axis) {
  59748. var sideA = axis === 'x' ? 'Left' : 'Top';
  59749. var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
  59750. return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']);
  59751. }
  59752. function getSize(axis, body, html, computedStyle) {
  59753. return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
  59754. }
  59755. function getWindowSizes(document) {
  59756. var body = document.body;
  59757. var html = document.documentElement;
  59758. var computedStyle = isIE(10) && getComputedStyle(html);
  59759. return {
  59760. height: getSize('Height', body, html, computedStyle),
  59761. width: getSize('Width', body, html, computedStyle)
  59762. };
  59763. }
  59764. var classCallCheck = function (instance, Constructor) {
  59765. if (!(instance instanceof Constructor)) {
  59766. throw new TypeError("Cannot call a class as a function");
  59767. }
  59768. };
  59769. var createClass = function () {
  59770. function defineProperties(target, props) {
  59771. for (var i = 0; i < props.length; i++) {
  59772. var descriptor = props[i];
  59773. descriptor.enumerable = descriptor.enumerable || false;
  59774. descriptor.configurable = true;
  59775. if ("value" in descriptor) descriptor.writable = true;
  59776. Object.defineProperty(target, descriptor.key, descriptor);
  59777. }
  59778. }
  59779. return function (Constructor, protoProps, staticProps) {
  59780. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  59781. if (staticProps) defineProperties(Constructor, staticProps);
  59782. return Constructor;
  59783. };
  59784. }();
  59785. var defineProperty = function (obj, key, value) {
  59786. if (key in obj) {
  59787. Object.defineProperty(obj, key, {
  59788. value: value,
  59789. enumerable: true,
  59790. configurable: true,
  59791. writable: true
  59792. });
  59793. } else {
  59794. obj[key] = value;
  59795. }
  59796. return obj;
  59797. };
  59798. var _extends = Object.assign || function (target) {
  59799. for (var i = 1; i < arguments.length; i++) {
  59800. var source = arguments[i];
  59801. for (var key in source) {
  59802. if (Object.prototype.hasOwnProperty.call(source, key)) {
  59803. target[key] = source[key];
  59804. }
  59805. }
  59806. }
  59807. return target;
  59808. };
  59809. /**
  59810. * Given element offsets, generate an output similar to getBoundingClientRect
  59811. * @method
  59812. * @memberof Popper.Utils
  59813. * @argument {Object} offsets
  59814. * @returns {Object} ClientRect like output
  59815. */
  59816. function getClientRect(offsets) {
  59817. return _extends({}, offsets, {
  59818. right: offsets.left + offsets.width,
  59819. bottom: offsets.top + offsets.height
  59820. });
  59821. }
  59822. /**
  59823. * Get bounding client rect of given element
  59824. * @method
  59825. * @memberof Popper.Utils
  59826. * @param {HTMLElement} element
  59827. * @return {Object} client rect
  59828. */
  59829. function getBoundingClientRect(element) {
  59830. var rect = {};
  59831. // IE10 10 FIX: Please, don't ask, the element isn't
  59832. // considered in DOM in some circumstances...
  59833. // This isn't reproducible in IE10 compatibility mode of IE11
  59834. try {
  59835. if (isIE(10)) {
  59836. rect = element.getBoundingClientRect();
  59837. var scrollTop = getScroll(element, 'top');
  59838. var scrollLeft = getScroll(element, 'left');
  59839. rect.top += scrollTop;
  59840. rect.left += scrollLeft;
  59841. rect.bottom += scrollTop;
  59842. rect.right += scrollLeft;
  59843. } else {
  59844. rect = element.getBoundingClientRect();
  59845. }
  59846. } catch (e) {}
  59847. var result = {
  59848. left: rect.left,
  59849. top: rect.top,
  59850. width: rect.right - rect.left,
  59851. height: rect.bottom - rect.top
  59852. };
  59853. // subtract scrollbar size from sizes
  59854. var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
  59855. var width = sizes.width || element.clientWidth || result.width;
  59856. var height = sizes.height || element.clientHeight || result.height;
  59857. var horizScrollbar = element.offsetWidth - width;
  59858. var vertScrollbar = element.offsetHeight - height;
  59859. // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
  59860. // we make this check conditional for performance reasons
  59861. if (horizScrollbar || vertScrollbar) {
  59862. var styles = getStyleComputedProperty(element);
  59863. horizScrollbar -= getBordersSize(styles, 'x');
  59864. vertScrollbar -= getBordersSize(styles, 'y');
  59865. result.width -= horizScrollbar;
  59866. result.height -= vertScrollbar;
  59867. }
  59868. return getClientRect(result);
  59869. }
  59870. function getOffsetRectRelativeToArbitraryNode(children, parent) {
  59871. var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
  59872. var isIE10 = isIE(10);
  59873. var isHTML = parent.nodeName === 'HTML';
  59874. var childrenRect = getBoundingClientRect(children);
  59875. var parentRect = getBoundingClientRect(parent);
  59876. var scrollParent = getScrollParent(children);
  59877. var styles = getStyleComputedProperty(parent);
  59878. var borderTopWidth = parseFloat(styles.borderTopWidth);
  59879. var borderLeftWidth = parseFloat(styles.borderLeftWidth);
  59880. // In cases where the parent is fixed, we must ignore negative scroll in offset calc
  59881. if (fixedPosition && isHTML) {
  59882. parentRect.top = Math.max(parentRect.top, 0);
  59883. parentRect.left = Math.max(parentRect.left, 0);
  59884. }
  59885. var offsets = getClientRect({
  59886. top: childrenRect.top - parentRect.top - borderTopWidth,
  59887. left: childrenRect.left - parentRect.left - borderLeftWidth,
  59888. width: childrenRect.width,
  59889. height: childrenRect.height
  59890. });
  59891. offsets.marginTop = 0;
  59892. offsets.marginLeft = 0;
  59893. // Subtract margins of documentElement in case it's being used as parent
  59894. // we do this only on HTML because it's the only element that behaves
  59895. // differently when margins are applied to it. The margins are included in
  59896. // the box of the documentElement, in the other cases not.
  59897. if (!isIE10 && isHTML) {
  59898. var marginTop = parseFloat(styles.marginTop);
  59899. var marginLeft = parseFloat(styles.marginLeft);
  59900. offsets.top -= borderTopWidth - marginTop;
  59901. offsets.bottom -= borderTopWidth - marginTop;
  59902. offsets.left -= borderLeftWidth - marginLeft;
  59903. offsets.right -= borderLeftWidth - marginLeft;
  59904. // Attach marginTop and marginLeft because in some circumstances we may need them
  59905. offsets.marginTop = marginTop;
  59906. offsets.marginLeft = marginLeft;
  59907. }
  59908. if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
  59909. offsets = includeScroll(offsets, parent);
  59910. }
  59911. return offsets;
  59912. }
  59913. function getViewportOffsetRectRelativeToArtbitraryNode(element) {
  59914. var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  59915. var html = element.ownerDocument.documentElement;
  59916. var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
  59917. var width = Math.max(html.clientWidth, window.innerWidth || 0);
  59918. var height = Math.max(html.clientHeight, window.innerHeight || 0);
  59919. var scrollTop = !excludeScroll ? getScroll(html) : 0;
  59920. var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;
  59921. var offset = {
  59922. top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
  59923. left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
  59924. width: width,
  59925. height: height
  59926. };
  59927. return getClientRect(offset);
  59928. }
  59929. /**
  59930. * Check if the given element is fixed or is inside a fixed parent
  59931. * @method
  59932. * @memberof Popper.Utils
  59933. * @argument {Element} element
  59934. * @argument {Element} customContainer
  59935. * @returns {Boolean} answer to "isFixed?"
  59936. */
  59937. function isFixed(element) {
  59938. var nodeName = element.nodeName;
  59939. if (nodeName === 'BODY' || nodeName === 'HTML') {
  59940. return false;
  59941. }
  59942. if (getStyleComputedProperty(element, 'position') === 'fixed') {
  59943. return true;
  59944. }
  59945. var parentNode = getParentNode(element);
  59946. if (!parentNode) {
  59947. return false;
  59948. }
  59949. return isFixed(parentNode);
  59950. }
  59951. /**
  59952. * Finds the first parent of an element that has a transformed property defined
  59953. * @method
  59954. * @memberof Popper.Utils
  59955. * @argument {Element} element
  59956. * @returns {Element} first transformed parent or documentElement
  59957. */
  59958. function getFixedPositionOffsetParent(element) {
  59959. // This check is needed to avoid errors in case one of the elements isn't defined for any reason
  59960. if (!element || !element.parentElement || isIE()) {
  59961. return document.documentElement;
  59962. }
  59963. var el = element.parentElement;
  59964. while (el && getStyleComputedProperty(el, 'transform') === 'none') {
  59965. el = el.parentElement;
  59966. }
  59967. return el || document.documentElement;
  59968. }
  59969. /**
  59970. * Computed the boundaries limits and return them
  59971. * @method
  59972. * @memberof Popper.Utils
  59973. * @param {HTMLElement} popper
  59974. * @param {HTMLElement} reference
  59975. * @param {number} padding
  59976. * @param {HTMLElement} boundariesElement - Element used to define the boundaries
  59977. * @param {Boolean} fixedPosition - Is in fixed position mode
  59978. * @returns {Object} Coordinates of the boundaries
  59979. */
  59980. function getBoundaries(popper, reference, padding, boundariesElement) {
  59981. var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
  59982. // NOTE: 1 DOM access here
  59983. var boundaries = { top: 0, left: 0 };
  59984. var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
  59985. // Handle viewport case
  59986. if (boundariesElement === 'viewport') {
  59987. boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
  59988. } else {
  59989. // Handle other cases based on DOM element used as boundaries
  59990. var boundariesNode = void 0;
  59991. if (boundariesElement === 'scrollParent') {
  59992. boundariesNode = getScrollParent(getParentNode(reference));
  59993. if (boundariesNode.nodeName === 'BODY') {
  59994. boundariesNode = popper.ownerDocument.documentElement;
  59995. }
  59996. } else if (boundariesElement === 'window') {
  59997. boundariesNode = popper.ownerDocument.documentElement;
  59998. } else {
  59999. boundariesNode = boundariesElement;
  60000. }
  60001. var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
  60002. // In case of HTML, we need a different computation
  60003. if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
  60004. var _getWindowSizes = getWindowSizes(popper.ownerDocument),
  60005. height = _getWindowSizes.height,
  60006. width = _getWindowSizes.width;
  60007. boundaries.top += offsets.top - offsets.marginTop;
  60008. boundaries.bottom = height + offsets.top;
  60009. boundaries.left += offsets.left - offsets.marginLeft;
  60010. boundaries.right = width + offsets.left;
  60011. } else {
  60012. // for all the other DOM elements, this one is good
  60013. boundaries = offsets;
  60014. }
  60015. }
  60016. // Add paddings
  60017. padding = padding || 0;
  60018. var isPaddingNumber = typeof padding === 'number';
  60019. boundaries.left += isPaddingNumber ? padding : padding.left || 0;
  60020. boundaries.top += isPaddingNumber ? padding : padding.top || 0;
  60021. boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
  60022. boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
  60023. return boundaries;
  60024. }
  60025. function getArea(_ref) {
  60026. var width = _ref.width,
  60027. height = _ref.height;
  60028. return width * height;
  60029. }
  60030. /**
  60031. * Utility used to transform the `auto` placement to the placement with more
  60032. * available space.
  60033. * @method
  60034. * @memberof Popper.Utils
  60035. * @argument {Object} data - The data object generated by update method
  60036. * @argument {Object} options - Modifiers configuration and options
  60037. * @returns {Object} The data object, properly modified
  60038. */
  60039. function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
  60040. var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
  60041. if (placement.indexOf('auto') === -1) {
  60042. return placement;
  60043. }
  60044. var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
  60045. var rects = {
  60046. top: {
  60047. width: boundaries.width,
  60048. height: refRect.top - boundaries.top
  60049. },
  60050. right: {
  60051. width: boundaries.right - refRect.right,
  60052. height: boundaries.height
  60053. },
  60054. bottom: {
  60055. width: boundaries.width,
  60056. height: boundaries.bottom - refRect.bottom
  60057. },
  60058. left: {
  60059. width: refRect.left - boundaries.left,
  60060. height: boundaries.height
  60061. }
  60062. };
  60063. var sortedAreas = Object.keys(rects).map(function (key) {
  60064. return _extends({
  60065. key: key
  60066. }, rects[key], {
  60067. area: getArea(rects[key])
  60068. });
  60069. }).sort(function (a, b) {
  60070. return b.area - a.area;
  60071. });
  60072. var filteredAreas = sortedAreas.filter(function (_ref2) {
  60073. var width = _ref2.width,
  60074. height = _ref2.height;
  60075. return width >= popper.clientWidth && height >= popper.clientHeight;
  60076. });
  60077. var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
  60078. var variation = placement.split('-')[1];
  60079. return computedPlacement + (variation ? '-' + variation : '');
  60080. }
  60081. /**
  60082. * Get offsets to the reference element
  60083. * @method
  60084. * @memberof Popper.Utils
  60085. * @param {Object} state
  60086. * @param {Element} popper - the popper element
  60087. * @param {Element} reference - the reference element (the popper will be relative to this)
  60088. * @param {Element} fixedPosition - is in fixed position mode
  60089. * @returns {Object} An object containing the offsets which will be applied to the popper
  60090. */
  60091. function getReferenceOffsets(state, popper, reference) {
  60092. var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
  60093. var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
  60094. return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
  60095. }
  60096. /**
  60097. * Get the outer sizes of the given element (offset size + margins)
  60098. * @method
  60099. * @memberof Popper.Utils
  60100. * @argument {Element} element
  60101. * @returns {Object} object containing width and height properties
  60102. */
  60103. function getOuterSizes(element) {
  60104. var window = element.ownerDocument.defaultView;
  60105. var styles = window.getComputedStyle(element);
  60106. var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
  60107. var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
  60108. var result = {
  60109. width: element.offsetWidth + y,
  60110. height: element.offsetHeight + x
  60111. };
  60112. return result;
  60113. }
  60114. /**
  60115. * Get the opposite placement of the given one
  60116. * @method
  60117. * @memberof Popper.Utils
  60118. * @argument {String} placement
  60119. * @returns {String} flipped placement
  60120. */
  60121. function getOppositePlacement(placement) {
  60122. var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
  60123. return placement.replace(/left|right|bottom|top/g, function (matched) {
  60124. return hash[matched];
  60125. });
  60126. }
  60127. /**
  60128. * Get offsets to the popper
  60129. * @method
  60130. * @memberof Popper.Utils
  60131. * @param {Object} position - CSS position the Popper will get applied
  60132. * @param {HTMLElement} popper - the popper element
  60133. * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
  60134. * @param {String} placement - one of the valid placement options
  60135. * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
  60136. */
  60137. function getPopperOffsets(popper, referenceOffsets, placement) {
  60138. placement = placement.split('-')[0];
  60139. // Get popper node sizes
  60140. var popperRect = getOuterSizes(popper);
  60141. // Add position, width and height to our offsets object
  60142. var popperOffsets = {
  60143. width: popperRect.width,
  60144. height: popperRect.height
  60145. };
  60146. // depending by the popper placement we have to compute its offsets slightly differently
  60147. var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
  60148. var mainSide = isHoriz ? 'top' : 'left';
  60149. var secondarySide = isHoriz ? 'left' : 'top';
  60150. var measurement = isHoriz ? 'height' : 'width';
  60151. var secondaryMeasurement = !isHoriz ? 'height' : 'width';
  60152. popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
  60153. if (placement === secondarySide) {
  60154. popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
  60155. } else {
  60156. popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
  60157. }
  60158. return popperOffsets;
  60159. }
  60160. /**
  60161. * Mimics the `find` method of Array
  60162. * @method
  60163. * @memberof Popper.Utils
  60164. * @argument {Array} arr
  60165. * @argument prop
  60166. * @argument value
  60167. * @returns index or -1
  60168. */
  60169. function find(arr, check) {
  60170. // use native find if supported
  60171. if (Array.prototype.find) {
  60172. return arr.find(check);
  60173. }
  60174. // use `filter` to obtain the same behavior of `find`
  60175. return arr.filter(check)[0];
  60176. }
  60177. /**
  60178. * Return the index of the matching object
  60179. * @method
  60180. * @memberof Popper.Utils
  60181. * @argument {Array} arr
  60182. * @argument prop
  60183. * @argument value
  60184. * @returns index or -1
  60185. */
  60186. function findIndex(arr, prop, value) {
  60187. // use native findIndex if supported
  60188. if (Array.prototype.findIndex) {
  60189. return arr.findIndex(function (cur) {
  60190. return cur[prop] === value;
  60191. });
  60192. }
  60193. // use `find` + `indexOf` if `findIndex` isn't supported
  60194. var match = find(arr, function (obj) {
  60195. return obj[prop] === value;
  60196. });
  60197. return arr.indexOf(match);
  60198. }
  60199. /**
  60200. * Loop trough the list of modifiers and run them in order,
  60201. * each of them will then edit the data object.
  60202. * @method
  60203. * @memberof Popper.Utils
  60204. * @param {dataObject} data
  60205. * @param {Array} modifiers
  60206. * @param {String} ends - Optional modifier name used as stopper
  60207. * @returns {dataObject}
  60208. */
  60209. function runModifiers(modifiers, data, ends) {
  60210. var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
  60211. modifiersToRun.forEach(function (modifier) {
  60212. if (modifier['function']) {
  60213. // eslint-disable-line dot-notation
  60214. console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
  60215. }
  60216. var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
  60217. if (modifier.enabled && isFunction(fn)) {
  60218. // Add properties to offsets to make them a complete clientRect object
  60219. // we do this before each modifier to make sure the previous one doesn't
  60220. // mess with these values
  60221. data.offsets.popper = getClientRect(data.offsets.popper);
  60222. data.offsets.reference = getClientRect(data.offsets.reference);
  60223. data = fn(data, modifier);
  60224. }
  60225. });
  60226. return data;
  60227. }
  60228. /**
  60229. * Updates the position of the popper, computing the new offsets and applying
  60230. * the new style.<br />
  60231. * Prefer `scheduleUpdate` over `update` because of performance reasons.
  60232. * @method
  60233. * @memberof Popper
  60234. */
  60235. function update() {
  60236. // if popper is destroyed, don't perform any further update
  60237. if (this.state.isDestroyed) {
  60238. return;
  60239. }
  60240. var data = {
  60241. instance: this,
  60242. styles: {},
  60243. arrowStyles: {},
  60244. attributes: {},
  60245. flipped: false,
  60246. offsets: {}
  60247. };
  60248. // compute reference element offsets
  60249. data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
  60250. // compute auto placement, store placement inside the data object,
  60251. // modifiers will be able to edit `placement` if needed
  60252. // and refer to originalPlacement to know the original value
  60253. data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
  60254. // store the computed placement inside `originalPlacement`
  60255. data.originalPlacement = data.placement;
  60256. data.positionFixed = this.options.positionFixed;
  60257. // compute the popper offsets
  60258. data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
  60259. data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
  60260. // run the modifiers
  60261. data = runModifiers(this.modifiers, data);
  60262. // the first `update` will call `onCreate` callback
  60263. // the other ones will call `onUpdate` callback
  60264. if (!this.state.isCreated) {
  60265. this.state.isCreated = true;
  60266. this.options.onCreate(data);
  60267. } else {
  60268. this.options.onUpdate(data);
  60269. }
  60270. }
  60271. /**
  60272. * Helper used to know if the given modifier is enabled.
  60273. * @method
  60274. * @memberof Popper.Utils
  60275. * @returns {Boolean}
  60276. */
  60277. function isModifierEnabled(modifiers, modifierName) {
  60278. return modifiers.some(function (_ref) {
  60279. var name = _ref.name,
  60280. enabled = _ref.enabled;
  60281. return enabled && name === modifierName;
  60282. });
  60283. }
  60284. /**
  60285. * Get the prefixed supported property name
  60286. * @method
  60287. * @memberof Popper.Utils
  60288. * @argument {String} property (camelCase)
  60289. * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
  60290. */
  60291. function getSupportedPropertyName(property) {
  60292. var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
  60293. var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
  60294. for (var i = 0; i < prefixes.length; i++) {
  60295. var prefix = prefixes[i];
  60296. var toCheck = prefix ? '' + prefix + upperProp : property;
  60297. if (typeof document.body.style[toCheck] !== 'undefined') {
  60298. return toCheck;
  60299. }
  60300. }
  60301. return null;
  60302. }
  60303. /**
  60304. * Destroys the popper.
  60305. * @method
  60306. * @memberof Popper
  60307. */
  60308. function destroy() {
  60309. this.state.isDestroyed = true;
  60310. // touch DOM only if `applyStyle` modifier is enabled
  60311. if (isModifierEnabled(this.modifiers, 'applyStyle')) {
  60312. this.popper.removeAttribute('x-placement');
  60313. this.popper.style.position = '';
  60314. this.popper.style.top = '';
  60315. this.popper.style.left = '';
  60316. this.popper.style.right = '';
  60317. this.popper.style.bottom = '';
  60318. this.popper.style.willChange = '';
  60319. this.popper.style[getSupportedPropertyName('transform')] = '';
  60320. }
  60321. this.disableEventListeners();
  60322. // remove the popper if user explicitly asked for the deletion on destroy
  60323. // do not use `remove` because IE11 doesn't support it
  60324. if (this.options.removeOnDestroy) {
  60325. this.popper.parentNode.removeChild(this.popper);
  60326. }
  60327. return this;
  60328. }
  60329. /**
  60330. * Get the window associated with the element
  60331. * @argument {Element} element
  60332. * @returns {Window}
  60333. */
  60334. function getWindow(element) {
  60335. var ownerDocument = element.ownerDocument;
  60336. return ownerDocument ? ownerDocument.defaultView : window;
  60337. }
  60338. function attachToScrollParents(scrollParent, event, callback, scrollParents) {
  60339. var isBody = scrollParent.nodeName === 'BODY';
  60340. var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
  60341. target.addEventListener(event, callback, { passive: true });
  60342. if (!isBody) {
  60343. attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
  60344. }
  60345. scrollParents.push(target);
  60346. }
  60347. /**
  60348. * Setup needed event listeners used to update the popper position
  60349. * @method
  60350. * @memberof Popper.Utils
  60351. * @private
  60352. */
  60353. function setupEventListeners(reference, options, state, updateBound) {
  60354. // Resize event listener on window
  60355. state.updateBound = updateBound;
  60356. getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
  60357. // Scroll event listener on scroll parents
  60358. var scrollElement = getScrollParent(reference);
  60359. attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
  60360. state.scrollElement = scrollElement;
  60361. state.eventsEnabled = true;
  60362. return state;
  60363. }
  60364. /**
  60365. * It will add resize/scroll events and start recalculating
  60366. * position of the popper element when they are triggered.
  60367. * @method
  60368. * @memberof Popper
  60369. */
  60370. function enableEventListeners() {
  60371. if (!this.state.eventsEnabled) {
  60372. this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
  60373. }
  60374. }
  60375. /**
  60376. * Remove event listeners used to update the popper position
  60377. * @method
  60378. * @memberof Popper.Utils
  60379. * @private
  60380. */
  60381. function removeEventListeners(reference, state) {
  60382. // Remove resize event listener on window
  60383. getWindow(reference).removeEventListener('resize', state.updateBound);
  60384. // Remove scroll event listener on scroll parents
  60385. state.scrollParents.forEach(function (target) {
  60386. target.removeEventListener('scroll', state.updateBound);
  60387. });
  60388. // Reset state
  60389. state.updateBound = null;
  60390. state.scrollParents = [];
  60391. state.scrollElement = null;
  60392. state.eventsEnabled = false;
  60393. return state;
  60394. }
  60395. /**
  60396. * It will remove resize/scroll events and won't recalculate popper position
  60397. * when they are triggered. It also won't trigger `onUpdate` callback anymore,
  60398. * unless you call `update` method manually.
  60399. * @method
  60400. * @memberof Popper
  60401. */
  60402. function disableEventListeners() {
  60403. if (this.state.eventsEnabled) {
  60404. cancelAnimationFrame(this.scheduleUpdate);
  60405. this.state = removeEventListeners(this.reference, this.state);
  60406. }
  60407. }
  60408. /**
  60409. * Tells if a given input is a number
  60410. * @method
  60411. * @memberof Popper.Utils
  60412. * @param {*} input to check
  60413. * @return {Boolean}
  60414. */
  60415. function isNumeric(n) {
  60416. return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
  60417. }
  60418. /**
  60419. * Set the style to the given popper
  60420. * @method
  60421. * @memberof Popper.Utils
  60422. * @argument {Element} element - Element to apply the style to
  60423. * @argument {Object} styles
  60424. * Object with a list of properties and values which will be applied to the element
  60425. */
  60426. function setStyles(element, styles) {
  60427. Object.keys(styles).forEach(function (prop) {
  60428. var unit = '';
  60429. // add unit if the value is numeric and is one of the following
  60430. if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
  60431. unit = 'px';
  60432. }
  60433. element.style[prop] = styles[prop] + unit;
  60434. });
  60435. }
  60436. /**
  60437. * Set the attributes to the given popper
  60438. * @method
  60439. * @memberof Popper.Utils
  60440. * @argument {Element} element - Element to apply the attributes to
  60441. * @argument {Object} styles
  60442. * Object with a list of properties and values which will be applied to the element
  60443. */
  60444. function setAttributes(element, attributes) {
  60445. Object.keys(attributes).forEach(function (prop) {
  60446. var value = attributes[prop];
  60447. if (value !== false) {
  60448. element.setAttribute(prop, attributes[prop]);
  60449. } else {
  60450. element.removeAttribute(prop);
  60451. }
  60452. });
  60453. }
  60454. /**
  60455. * @function
  60456. * @memberof Modifiers
  60457. * @argument {Object} data - The data object generated by `update` method
  60458. * @argument {Object} data.styles - List of style properties - values to apply to popper element
  60459. * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
  60460. * @argument {Object} options - Modifiers configuration and options
  60461. * @returns {Object} The same data object
  60462. */
  60463. function applyStyle(data) {
  60464. // any property present in `data.styles` will be applied to the popper,
  60465. // in this way we can make the 3rd party modifiers add custom styles to it
  60466. // Be aware, modifiers could override the properties defined in the previous
  60467. // lines of this modifier!
  60468. setStyles(data.instance.popper, data.styles);
  60469. // any property present in `data.attributes` will be applied to the popper,
  60470. // they will be set as HTML attributes of the element
  60471. setAttributes(data.instance.popper, data.attributes);
  60472. // if arrowElement is defined and arrowStyles has some properties
  60473. if (data.arrowElement && Object.keys(data.arrowStyles).length) {
  60474. setStyles(data.arrowElement, data.arrowStyles);
  60475. }
  60476. return data;
  60477. }
  60478. /**
  60479. * Set the x-placement attribute before everything else because it could be used
  60480. * to add margins to the popper margins needs to be calculated to get the
  60481. * correct popper offsets.
  60482. * @method
  60483. * @memberof Popper.modifiers
  60484. * @param {HTMLElement} reference - The reference element used to position the popper
  60485. * @param {HTMLElement} popper - The HTML element used as popper
  60486. * @param {Object} options - Popper.js options
  60487. */
  60488. function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
  60489. // compute reference element offsets
  60490. var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
  60491. // compute auto placement, store placement inside the data object,
  60492. // modifiers will be able to edit `placement` if needed
  60493. // and refer to originalPlacement to know the original value
  60494. var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
  60495. popper.setAttribute('x-placement', placement);
  60496. // Apply `position` to popper before anything else because
  60497. // without the position applied we can't guarantee correct computations
  60498. setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
  60499. return options;
  60500. }
  60501. /**
  60502. * @function
  60503. * @memberof Popper.Utils
  60504. * @argument {Object} data - The data object generated by `update` method
  60505. * @argument {Boolean} shouldRound - If the offsets should be rounded at all
  60506. * @returns {Object} The popper's position offsets rounded
  60507. *
  60508. * The tale of pixel-perfect positioning. It's still not 100% perfect, but as
  60509. * good as it can be within reason.
  60510. * Discussion here: https://github.com/FezVrasta/popper.js/pull/715
  60511. *
  60512. * Low DPI screens cause a popper to be blurry if not using full pixels (Safari
  60513. * as well on High DPI screens).
  60514. *
  60515. * Firefox prefers no rounding for positioning and does not have blurriness on
  60516. * high DPI screens.
  60517. *
  60518. * Only horizontal placement and left/right values need to be considered.
  60519. */
  60520. function getRoundedOffsets(data, shouldRound) {
  60521. var _data$offsets = data.offsets,
  60522. popper = _data$offsets.popper,
  60523. reference = _data$offsets.reference;
  60524. var round = Math.round,
  60525. floor = Math.floor;
  60526. var noRound = function noRound(v) {
  60527. return v;
  60528. };
  60529. var referenceWidth = round(reference.width);
  60530. var popperWidth = round(popper.width);
  60531. var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
  60532. var isVariation = data.placement.indexOf('-') !== -1;
  60533. var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
  60534. var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
  60535. var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
  60536. var verticalToInteger = !shouldRound ? noRound : round;
  60537. return {
  60538. left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
  60539. top: verticalToInteger(popper.top),
  60540. bottom: verticalToInteger(popper.bottom),
  60541. right: horizontalToInteger(popper.right)
  60542. };
  60543. }
  60544. var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent);
  60545. /**
  60546. * @function
  60547. * @memberof Modifiers
  60548. * @argument {Object} data - The data object generated by `update` method
  60549. * @argument {Object} options - Modifiers configuration and options
  60550. * @returns {Object} The data object, properly modified
  60551. */
  60552. function computeStyle(data, options) {
  60553. var x = options.x,
  60554. y = options.y;
  60555. var popper = data.offsets.popper;
  60556. // Remove this legacy support in Popper.js v2
  60557. var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
  60558. return modifier.name === 'applyStyle';
  60559. }).gpuAcceleration;
  60560. if (legacyGpuAccelerationOption !== undefined) {
  60561. console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
  60562. }
  60563. var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
  60564. var offsetParent = getOffsetParent(data.instance.popper);
  60565. var offsetParentRect = getBoundingClientRect(offsetParent);
  60566. // Styles
  60567. var styles = {
  60568. position: popper.position
  60569. };
  60570. var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
  60571. var sideA = x === 'bottom' ? 'top' : 'bottom';
  60572. var sideB = y === 'right' ? 'left' : 'right';
  60573. // if gpuAcceleration is set to `true` and transform is supported,
  60574. // we use `translate3d` to apply the position to the popper we
  60575. // automatically use the supported prefixed version if needed
  60576. var prefixedProperty = getSupportedPropertyName('transform');
  60577. // now, let's make a step back and look at this code closely (wtf?)
  60578. // If the content of the popper grows once it's been positioned, it
  60579. // may happen that the popper gets misplaced because of the new content
  60580. // overflowing its reference element
  60581. // To avoid this problem, we provide two options (x and y), which allow
  60582. // the consumer to define the offset origin.
  60583. // If we position a popper on top of a reference element, we can set
  60584. // `x` to `top` to make the popper grow towards its top instead of
  60585. // its bottom.
  60586. var left = void 0,
  60587. top = void 0;
  60588. if (sideA === 'bottom') {
  60589. // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
  60590. // and not the bottom of the html element
  60591. if (offsetParent.nodeName === 'HTML') {
  60592. top = -offsetParent.clientHeight + offsets.bottom;
  60593. } else {
  60594. top = -offsetParentRect.height + offsets.bottom;
  60595. }
  60596. } else {
  60597. top = offsets.top;
  60598. }
  60599. if (sideB === 'right') {
  60600. if (offsetParent.nodeName === 'HTML') {
  60601. left = -offsetParent.clientWidth + offsets.right;
  60602. } else {
  60603. left = -offsetParentRect.width + offsets.right;
  60604. }
  60605. } else {
  60606. left = offsets.left;
  60607. }
  60608. if (gpuAcceleration && prefixedProperty) {
  60609. styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
  60610. styles[sideA] = 0;
  60611. styles[sideB] = 0;
  60612. styles.willChange = 'transform';
  60613. } else {
  60614. // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
  60615. var invertTop = sideA === 'bottom' ? -1 : 1;
  60616. var invertLeft = sideB === 'right' ? -1 : 1;
  60617. styles[sideA] = top * invertTop;
  60618. styles[sideB] = left * invertLeft;
  60619. styles.willChange = sideA + ', ' + sideB;
  60620. }
  60621. // Attributes
  60622. var attributes = {
  60623. 'x-placement': data.placement
  60624. };
  60625. // Update `data` attributes, styles and arrowStyles
  60626. data.attributes = _extends({}, attributes, data.attributes);
  60627. data.styles = _extends({}, styles, data.styles);
  60628. data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);
  60629. return data;
  60630. }
  60631. /**
  60632. * Helper used to know if the given modifier depends from another one.<br />
  60633. * It checks if the needed modifier is listed and enabled.
  60634. * @method
  60635. * @memberof Popper.Utils
  60636. * @param {Array} modifiers - list of modifiers
  60637. * @param {String} requestingName - name of requesting modifier
  60638. * @param {String} requestedName - name of requested modifier
  60639. * @returns {Boolean}
  60640. */
  60641. function isModifierRequired(modifiers, requestingName, requestedName) {
  60642. var requesting = find(modifiers, function (_ref) {
  60643. var name = _ref.name;
  60644. return name === requestingName;
  60645. });
  60646. var isRequired = !!requesting && modifiers.some(function (modifier) {
  60647. return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
  60648. });
  60649. if (!isRequired) {
  60650. var _requesting = '`' + requestingName + '`';
  60651. var requested = '`' + requestedName + '`';
  60652. console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
  60653. }
  60654. return isRequired;
  60655. }
  60656. /**
  60657. * @function
  60658. * @memberof Modifiers
  60659. * @argument {Object} data - The data object generated by update method
  60660. * @argument {Object} options - Modifiers configuration and options
  60661. * @returns {Object} The data object, properly modified
  60662. */
  60663. function arrow(data, options) {
  60664. var _data$offsets$arrow;
  60665. // arrow depends on keepTogether in order to work
  60666. if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
  60667. return data;
  60668. }
  60669. var arrowElement = options.element;
  60670. // if arrowElement is a string, suppose it's a CSS selector
  60671. if (typeof arrowElement === 'string') {
  60672. arrowElement = data.instance.popper.querySelector(arrowElement);
  60673. // if arrowElement is not found, don't run the modifier
  60674. if (!arrowElement) {
  60675. return data;
  60676. }
  60677. } else {
  60678. // if the arrowElement isn't a query selector we must check that the
  60679. // provided DOM node is child of its popper node
  60680. if (!data.instance.popper.contains(arrowElement)) {
  60681. console.warn('WARNING: `arrow.element` must be child of its popper element!');
  60682. return data;
  60683. }
  60684. }
  60685. var placement = data.placement.split('-')[0];
  60686. var _data$offsets = data.offsets,
  60687. popper = _data$offsets.popper,
  60688. reference = _data$offsets.reference;
  60689. var isVertical = ['left', 'right'].indexOf(placement) !== -1;
  60690. var len = isVertical ? 'height' : 'width';
  60691. var sideCapitalized = isVertical ? 'Top' : 'Left';
  60692. var side = sideCapitalized.toLowerCase();
  60693. var altSide = isVertical ? 'left' : 'top';
  60694. var opSide = isVertical ? 'bottom' : 'right';
  60695. var arrowElementSize = getOuterSizes(arrowElement)[len];
  60696. //
  60697. // extends keepTogether behavior making sure the popper and its
  60698. // reference have enough pixels in conjunction
  60699. //
  60700. // top/left side
  60701. if (reference[opSide] - arrowElementSize < popper[side]) {
  60702. data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
  60703. }
  60704. // bottom/right side
  60705. if (reference[side] + arrowElementSize > popper[opSide]) {
  60706. data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
  60707. }
  60708. data.offsets.popper = getClientRect(data.offsets.popper);
  60709. // compute center of the popper
  60710. var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
  60711. // Compute the sideValue using the updated popper offsets
  60712. // take popper margin in account because we don't have this info available
  60713. var css = getStyleComputedProperty(data.instance.popper);
  60714. var popperMarginSide = parseFloat(css['margin' + sideCapitalized]);
  60715. var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']);
  60716. var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
  60717. // prevent arrowElement from being placed not contiguously to its popper
  60718. sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
  60719. data.arrowElement = arrowElement;
  60720. data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
  60721. return data;
  60722. }
  60723. /**
  60724. * Get the opposite placement variation of the given one
  60725. * @method
  60726. * @memberof Popper.Utils
  60727. * @argument {String} placement variation
  60728. * @returns {String} flipped placement variation
  60729. */
  60730. function getOppositeVariation(variation) {
  60731. if (variation === 'end') {
  60732. return 'start';
  60733. } else if (variation === 'start') {
  60734. return 'end';
  60735. }
  60736. return variation;
  60737. }
  60738. /**
  60739. * List of accepted placements to use as values of the `placement` option.<br />
  60740. * Valid placements are:
  60741. * - `auto`
  60742. * - `top`
  60743. * - `right`
  60744. * - `bottom`
  60745. * - `left`
  60746. *
  60747. * Each placement can have a variation from this list:
  60748. * - `-start`
  60749. * - `-end`
  60750. *
  60751. * Variations are interpreted easily if you think of them as the left to right
  60752. * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
  60753. * is right.<br />
  60754. * Vertically (`left` and `right`), `start` is top and `end` is bottom.
  60755. *
  60756. * Some valid examples are:
  60757. * - `top-end` (on top of reference, right aligned)
  60758. * - `right-start` (on right of reference, top aligned)
  60759. * - `bottom` (on bottom, centered)
  60760. * - `auto-end` (on the side with more space available, alignment depends by placement)
  60761. *
  60762. * @static
  60763. * @type {Array}
  60764. * @enum {String}
  60765. * @readonly
  60766. * @method placements
  60767. * @memberof Popper
  60768. */
  60769. var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
  60770. // Get rid of `auto` `auto-start` and `auto-end`
  60771. var validPlacements = placements.slice(3);
  60772. /**
  60773. * Given an initial placement, returns all the subsequent placements
  60774. * clockwise (or counter-clockwise).
  60775. *
  60776. * @method
  60777. * @memberof Popper.Utils
  60778. * @argument {String} placement - A valid placement (it accepts variations)
  60779. * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
  60780. * @returns {Array} placements including their variations
  60781. */
  60782. function clockwise(placement) {
  60783. var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
  60784. var index = validPlacements.indexOf(placement);
  60785. var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
  60786. return counter ? arr.reverse() : arr;
  60787. }
  60788. var BEHAVIORS = {
  60789. FLIP: 'flip',
  60790. CLOCKWISE: 'clockwise',
  60791. COUNTERCLOCKWISE: 'counterclockwise'
  60792. };
  60793. /**
  60794. * @function
  60795. * @memberof Modifiers
  60796. * @argument {Object} data - The data object generated by update method
  60797. * @argument {Object} options - Modifiers configuration and options
  60798. * @returns {Object} The data object, properly modified
  60799. */
  60800. function flip(data, options) {
  60801. // if `inner` modifier is enabled, we can't use the `flip` modifier
  60802. if (isModifierEnabled(data.instance.modifiers, 'inner')) {
  60803. return data;
  60804. }
  60805. if (data.flipped && data.placement === data.originalPlacement) {
  60806. // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
  60807. return data;
  60808. }
  60809. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
  60810. var placement = data.placement.split('-')[0];
  60811. var placementOpposite = getOppositePlacement(placement);
  60812. var variation = data.placement.split('-')[1] || '';
  60813. var flipOrder = [];
  60814. switch (options.behavior) {
  60815. case BEHAVIORS.FLIP:
  60816. flipOrder = [placement, placementOpposite];
  60817. break;
  60818. case BEHAVIORS.CLOCKWISE:
  60819. flipOrder = clockwise(placement);
  60820. break;
  60821. case BEHAVIORS.COUNTERCLOCKWISE:
  60822. flipOrder = clockwise(placement, true);
  60823. break;
  60824. default:
  60825. flipOrder = options.behavior;
  60826. }
  60827. flipOrder.forEach(function (step, index) {
  60828. if (placement !== step || flipOrder.length === index + 1) {
  60829. return data;
  60830. }
  60831. placement = data.placement.split('-')[0];
  60832. placementOpposite = getOppositePlacement(placement);
  60833. var popperOffsets = data.offsets.popper;
  60834. var refOffsets = data.offsets.reference;
  60835. // using floor because the reference offsets may contain decimals we are not going to consider here
  60836. var floor = Math.floor;
  60837. var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
  60838. var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
  60839. var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
  60840. var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
  60841. var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
  60842. var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
  60843. // flip the variation if required
  60844. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  60845. // flips variation if reference element overflows boundaries
  60846. var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
  60847. // flips variation if popper content overflows boundaries
  60848. var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);
  60849. var flippedVariation = flippedVariationByRef || flippedVariationByContent;
  60850. if (overlapsRef || overflowsBoundaries || flippedVariation) {
  60851. // this boolean to detect any flip loop
  60852. data.flipped = true;
  60853. if (overlapsRef || overflowsBoundaries) {
  60854. placement = flipOrder[index + 1];
  60855. }
  60856. if (flippedVariation) {
  60857. variation = getOppositeVariation(variation);
  60858. }
  60859. data.placement = placement + (variation ? '-' + variation : '');
  60860. // this object contains `position`, we want to preserve it along with
  60861. // any additional property we may add in the future
  60862. data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
  60863. data = runModifiers(data.instance.modifiers, data, 'flip');
  60864. }
  60865. });
  60866. return data;
  60867. }
  60868. /**
  60869. * @function
  60870. * @memberof Modifiers
  60871. * @argument {Object} data - The data object generated by update method
  60872. * @argument {Object} options - Modifiers configuration and options
  60873. * @returns {Object} The data object, properly modified
  60874. */
  60875. function keepTogether(data) {
  60876. var _data$offsets = data.offsets,
  60877. popper = _data$offsets.popper,
  60878. reference = _data$offsets.reference;
  60879. var placement = data.placement.split('-')[0];
  60880. var floor = Math.floor;
  60881. var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
  60882. var side = isVertical ? 'right' : 'bottom';
  60883. var opSide = isVertical ? 'left' : 'top';
  60884. var measurement = isVertical ? 'width' : 'height';
  60885. if (popper[side] < floor(reference[opSide])) {
  60886. data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
  60887. }
  60888. if (popper[opSide] > floor(reference[side])) {
  60889. data.offsets.popper[opSide] = floor(reference[side]);
  60890. }
  60891. return data;
  60892. }
  60893. /**
  60894. * Converts a string containing value + unit into a px value number
  60895. * @function
  60896. * @memberof {modifiers~offset}
  60897. * @private
  60898. * @argument {String} str - Value + unit string
  60899. * @argument {String} measurement - `height` or `width`
  60900. * @argument {Object} popperOffsets
  60901. * @argument {Object} referenceOffsets
  60902. * @returns {Number|String}
  60903. * Value in pixels, or original string if no values were extracted
  60904. */
  60905. function toValue(str, measurement, popperOffsets, referenceOffsets) {
  60906. // separate value from unit
  60907. var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
  60908. var value = +split[1];
  60909. var unit = split[2];
  60910. // If it's not a number it's an operator, I guess
  60911. if (!value) {
  60912. return str;
  60913. }
  60914. if (unit.indexOf('%') === 0) {
  60915. var element = void 0;
  60916. switch (unit) {
  60917. case '%p':
  60918. element = popperOffsets;
  60919. break;
  60920. case '%':
  60921. case '%r':
  60922. default:
  60923. element = referenceOffsets;
  60924. }
  60925. var rect = getClientRect(element);
  60926. return rect[measurement] / 100 * value;
  60927. } else if (unit === 'vh' || unit === 'vw') {
  60928. // if is a vh or vw, we calculate the size based on the viewport
  60929. var size = void 0;
  60930. if (unit === 'vh') {
  60931. size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
  60932. } else {
  60933. size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
  60934. }
  60935. return size / 100 * value;
  60936. } else {
  60937. // if is an explicit pixel unit, we get rid of the unit and keep the value
  60938. // if is an implicit unit, it's px, and we return just the value
  60939. return value;
  60940. }
  60941. }
  60942. /**
  60943. * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
  60944. * @function
  60945. * @memberof {modifiers~offset}
  60946. * @private
  60947. * @argument {String} offset
  60948. * @argument {Object} popperOffsets
  60949. * @argument {Object} referenceOffsets
  60950. * @argument {String} basePlacement
  60951. * @returns {Array} a two cells array with x and y offsets in numbers
  60952. */
  60953. function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
  60954. var offsets = [0, 0];
  60955. // Use height if placement is left or right and index is 0 otherwise use width
  60956. // in this way the first offset will use an axis and the second one
  60957. // will use the other one
  60958. var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
  60959. // Split the offset string to obtain a list of values and operands
  60960. // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
  60961. var fragments = offset.split(/(\+|\-)/).map(function (frag) {
  60962. return frag.trim();
  60963. });
  60964. // Detect if the offset string contains a pair of values or a single one
  60965. // they could be separated by comma or space
  60966. var divider = fragments.indexOf(find(fragments, function (frag) {
  60967. return frag.search(/,|\s/) !== -1;
  60968. }));
  60969. if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
  60970. console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
  60971. }
  60972. // If divider is found, we divide the list of values and operands to divide
  60973. // them by ofset X and Y.
  60974. var splitRegex = /\s*,\s*|\s+/;
  60975. var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
  60976. // Convert the values with units to absolute pixels to allow our computations
  60977. ops = ops.map(function (op, index) {
  60978. // Most of the units rely on the orientation of the popper
  60979. var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
  60980. var mergeWithPrevious = false;
  60981. return op
  60982. // This aggregates any `+` or `-` sign that aren't considered operators
  60983. // e.g.: 10 + +5 => [10, +, +5]
  60984. .reduce(function (a, b) {
  60985. if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
  60986. a[a.length - 1] = b;
  60987. mergeWithPrevious = true;
  60988. return a;
  60989. } else if (mergeWithPrevious) {
  60990. a[a.length - 1] += b;
  60991. mergeWithPrevious = false;
  60992. return a;
  60993. } else {
  60994. return a.concat(b);
  60995. }
  60996. }, [])
  60997. // Here we convert the string values into number values (in px)
  60998. .map(function (str) {
  60999. return toValue(str, measurement, popperOffsets, referenceOffsets);
  61000. });
  61001. });
  61002. // Loop trough the offsets arrays and execute the operations
  61003. ops.forEach(function (op, index) {
  61004. op.forEach(function (frag, index2) {
  61005. if (isNumeric(frag)) {
  61006. offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
  61007. }
  61008. });
  61009. });
  61010. return offsets;
  61011. }
  61012. /**
  61013. * @function
  61014. * @memberof Modifiers
  61015. * @argument {Object} data - The data object generated by update method
  61016. * @argument {Object} options - Modifiers configuration and options
  61017. * @argument {Number|String} options.offset=0
  61018. * The offset value as described in the modifier description
  61019. * @returns {Object} The data object, properly modified
  61020. */
  61021. function offset(data, _ref) {
  61022. var offset = _ref.offset;
  61023. var placement = data.placement,
  61024. _data$offsets = data.offsets,
  61025. popper = _data$offsets.popper,
  61026. reference = _data$offsets.reference;
  61027. var basePlacement = placement.split('-')[0];
  61028. var offsets = void 0;
  61029. if (isNumeric(+offset)) {
  61030. offsets = [+offset, 0];
  61031. } else {
  61032. offsets = parseOffset(offset, popper, reference, basePlacement);
  61033. }
  61034. if (basePlacement === 'left') {
  61035. popper.top += offsets[0];
  61036. popper.left -= offsets[1];
  61037. } else if (basePlacement === 'right') {
  61038. popper.top += offsets[0];
  61039. popper.left += offsets[1];
  61040. } else if (basePlacement === 'top') {
  61041. popper.left += offsets[0];
  61042. popper.top -= offsets[1];
  61043. } else if (basePlacement === 'bottom') {
  61044. popper.left += offsets[0];
  61045. popper.top += offsets[1];
  61046. }
  61047. data.popper = popper;
  61048. return data;
  61049. }
  61050. /**
  61051. * @function
  61052. * @memberof Modifiers
  61053. * @argument {Object} data - The data object generated by `update` method
  61054. * @argument {Object} options - Modifiers configuration and options
  61055. * @returns {Object} The data object, properly modified
  61056. */
  61057. function preventOverflow(data, options) {
  61058. var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
  61059. // If offsetParent is the reference element, we really want to
  61060. // go one step up and use the next offsetParent as reference to
  61061. // avoid to make this modifier completely useless and look like broken
  61062. if (data.instance.reference === boundariesElement) {
  61063. boundariesElement = getOffsetParent(boundariesElement);
  61064. }
  61065. // NOTE: DOM access here
  61066. // resets the popper's position so that the document size can be calculated excluding
  61067. // the size of the popper element itself
  61068. var transformProp = getSupportedPropertyName('transform');
  61069. var popperStyles = data.instance.popper.style; // assignment to help minification
  61070. var top = popperStyles.top,
  61071. left = popperStyles.left,
  61072. transform = popperStyles[transformProp];
  61073. popperStyles.top = '';
  61074. popperStyles.left = '';
  61075. popperStyles[transformProp] = '';
  61076. var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
  61077. // NOTE: DOM access here
  61078. // restores the original style properties after the offsets have been computed
  61079. popperStyles.top = top;
  61080. popperStyles.left = left;
  61081. popperStyles[transformProp] = transform;
  61082. options.boundaries = boundaries;
  61083. var order = options.priority;
  61084. var popper = data.offsets.popper;
  61085. var check = {
  61086. primary: function primary(placement) {
  61087. var value = popper[placement];
  61088. if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
  61089. value = Math.max(popper[placement], boundaries[placement]);
  61090. }
  61091. return defineProperty({}, placement, value);
  61092. },
  61093. secondary: function secondary(placement) {
  61094. var mainSide = placement === 'right' ? 'left' : 'top';
  61095. var value = popper[mainSide];
  61096. if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
  61097. value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
  61098. }
  61099. return defineProperty({}, mainSide, value);
  61100. }
  61101. };
  61102. order.forEach(function (placement) {
  61103. var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
  61104. popper = _extends({}, popper, check[side](placement));
  61105. });
  61106. data.offsets.popper = popper;
  61107. return data;
  61108. }
  61109. /**
  61110. * @function
  61111. * @memberof Modifiers
  61112. * @argument {Object} data - The data object generated by `update` method
  61113. * @argument {Object} options - Modifiers configuration and options
  61114. * @returns {Object} The data object, properly modified
  61115. */
  61116. function shift(data) {
  61117. var placement = data.placement;
  61118. var basePlacement = placement.split('-')[0];
  61119. var shiftvariation = placement.split('-')[1];
  61120. // if shift shiftvariation is specified, run the modifier
  61121. if (shiftvariation) {
  61122. var _data$offsets = data.offsets,
  61123. reference = _data$offsets.reference,
  61124. popper = _data$offsets.popper;
  61125. var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
  61126. var side = isVertical ? 'left' : 'top';
  61127. var measurement = isVertical ? 'width' : 'height';
  61128. var shiftOffsets = {
  61129. start: defineProperty({}, side, reference[side]),
  61130. end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
  61131. };
  61132. data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
  61133. }
  61134. return data;
  61135. }
  61136. /**
  61137. * @function
  61138. * @memberof Modifiers
  61139. * @argument {Object} data - The data object generated by update method
  61140. * @argument {Object} options - Modifiers configuration and options
  61141. * @returns {Object} The data object, properly modified
  61142. */
  61143. function hide(data) {
  61144. if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
  61145. return data;
  61146. }
  61147. var refRect = data.offsets.reference;
  61148. var bound = find(data.instance.modifiers, function (modifier) {
  61149. return modifier.name === 'preventOverflow';
  61150. }).boundaries;
  61151. if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
  61152. // Avoid unnecessary DOM access if visibility hasn't changed
  61153. if (data.hide === true) {
  61154. return data;
  61155. }
  61156. data.hide = true;
  61157. data.attributes['x-out-of-boundaries'] = '';
  61158. } else {
  61159. // Avoid unnecessary DOM access if visibility hasn't changed
  61160. if (data.hide === false) {
  61161. return data;
  61162. }
  61163. data.hide = false;
  61164. data.attributes['x-out-of-boundaries'] = false;
  61165. }
  61166. return data;
  61167. }
  61168. /**
  61169. * @function
  61170. * @memberof Modifiers
  61171. * @argument {Object} data - The data object generated by `update` method
  61172. * @argument {Object} options - Modifiers configuration and options
  61173. * @returns {Object} The data object, properly modified
  61174. */
  61175. function inner(data) {
  61176. var placement = data.placement;
  61177. var basePlacement = placement.split('-')[0];
  61178. var _data$offsets = data.offsets,
  61179. popper = _data$offsets.popper,
  61180. reference = _data$offsets.reference;
  61181. var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
  61182. var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
  61183. popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
  61184. data.placement = getOppositePlacement(placement);
  61185. data.offsets.popper = getClientRect(popper);
  61186. return data;
  61187. }
  61188. /**
  61189. * Modifier function, each modifier can have a function of this type assigned
  61190. * to its `fn` property.<br />
  61191. * These functions will be called on each update, this means that you must
  61192. * make sure they are performant enough to avoid performance bottlenecks.
  61193. *
  61194. * @function ModifierFn
  61195. * @argument {dataObject} data - The data object generated by `update` method
  61196. * @argument {Object} options - Modifiers configuration and options
  61197. * @returns {dataObject} The data object, properly modified
  61198. */
  61199. /**
  61200. * Modifiers are plugins used to alter the behavior of your poppers.<br />
  61201. * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
  61202. * needed by the library.
  61203. *
  61204. * Usually you don't want to override the `order`, `fn` and `onLoad` props.
  61205. * All the other properties are configurations that could be tweaked.
  61206. * @namespace modifiers
  61207. */
  61208. var modifiers = {
  61209. /**
  61210. * Modifier used to shift the popper on the start or end of its reference
  61211. * element.<br />
  61212. * It will read the variation of the `placement` property.<br />
  61213. * It can be one either `-end` or `-start`.
  61214. * @memberof modifiers
  61215. * @inner
  61216. */
  61217. shift: {
  61218. /** @prop {number} order=100 - Index used to define the order of execution */
  61219. order: 100,
  61220. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  61221. enabled: true,
  61222. /** @prop {ModifierFn} */
  61223. fn: shift
  61224. },
  61225. /**
  61226. * The `offset` modifier can shift your popper on both its axis.
  61227. *
  61228. * It accepts the following units:
  61229. * - `px` or unit-less, interpreted as pixels
  61230. * - `%` or `%r`, percentage relative to the length of the reference element
  61231. * - `%p`, percentage relative to the length of the popper element
  61232. * - `vw`, CSS viewport width unit
  61233. * - `vh`, CSS viewport height unit
  61234. *
  61235. * For length is intended the main axis relative to the placement of the popper.<br />
  61236. * This means that if the placement is `top` or `bottom`, the length will be the
  61237. * `width`. In case of `left` or `right`, it will be the `height`.
  61238. *
  61239. * You can provide a single value (as `Number` or `String`), or a pair of values
  61240. * as `String` divided by a comma or one (or more) white spaces.<br />
  61241. * The latter is a deprecated method because it leads to confusion and will be
  61242. * removed in v2.<br />
  61243. * Additionally, it accepts additions and subtractions between different units.
  61244. * Note that multiplications and divisions aren't supported.
  61245. *
  61246. * Valid examples are:
  61247. * ```
  61248. * 10
  61249. * '10%'
  61250. * '10, 10'
  61251. * '10%, 10'
  61252. * '10 + 10%'
  61253. * '10 - 5vh + 3%'
  61254. * '-10px + 5vh, 5px - 6%'
  61255. * ```
  61256. * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
  61257. * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
  61258. * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
  61259. *
  61260. * @memberof modifiers
  61261. * @inner
  61262. */
  61263. offset: {
  61264. /** @prop {number} order=200 - Index used to define the order of execution */
  61265. order: 200,
  61266. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  61267. enabled: true,
  61268. /** @prop {ModifierFn} */
  61269. fn: offset,
  61270. /** @prop {Number|String} offset=0
  61271. * The offset value as described in the modifier description
  61272. */
  61273. offset: 0
  61274. },
  61275. /**
  61276. * Modifier used to prevent the popper from being positioned outside the boundary.
  61277. *
  61278. * A scenario exists where the reference itself is not within the boundaries.<br />
  61279. * We can say it has "escaped the boundaries" — or just "escaped".<br />
  61280. * In this case we need to decide whether the popper should either:
  61281. *
  61282. * - detach from the reference and remain "trapped" in the boundaries, or
  61283. * - if it should ignore the boundary and "escape with its reference"
  61284. *
  61285. * When `escapeWithReference` is set to`true` and reference is completely
  61286. * outside its boundaries, the popper will overflow (or completely leave)
  61287. * the boundaries in order to remain attached to the edge of the reference.
  61288. *
  61289. * @memberof modifiers
  61290. * @inner
  61291. */
  61292. preventOverflow: {
  61293. /** @prop {number} order=300 - Index used to define the order of execution */
  61294. order: 300,
  61295. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  61296. enabled: true,
  61297. /** @prop {ModifierFn} */
  61298. fn: preventOverflow,
  61299. /**
  61300. * @prop {Array} [priority=['left','right','top','bottom']]
  61301. * Popper will try to prevent overflow following these priorities by default,
  61302. * then, it could overflow on the left and on top of the `boundariesElement`
  61303. */
  61304. priority: ['left', 'right', 'top', 'bottom'],
  61305. /**
  61306. * @prop {number} padding=5
  61307. * Amount of pixel used to define a minimum distance between the boundaries
  61308. * and the popper. This makes sure the popper always has a little padding
  61309. * between the edges of its container
  61310. */
  61311. padding: 5,
  61312. /**
  61313. * @prop {String|HTMLElement} boundariesElement='scrollParent'
  61314. * Boundaries used by the modifier. Can be `scrollParent`, `window`,
  61315. * `viewport` or any DOM element.
  61316. */
  61317. boundariesElement: 'scrollParent'
  61318. },
  61319. /**
  61320. * Modifier used to make sure the reference and its popper stay near each other
  61321. * without leaving any gap between the two. Especially useful when the arrow is
  61322. * enabled and you want to ensure that it points to its reference element.
  61323. * It cares only about the first axis. You can still have poppers with margin
  61324. * between the popper and its reference element.
  61325. * @memberof modifiers
  61326. * @inner
  61327. */
  61328. keepTogether: {
  61329. /** @prop {number} order=400 - Index used to define the order of execution */
  61330. order: 400,
  61331. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  61332. enabled: true,
  61333. /** @prop {ModifierFn} */
  61334. fn: keepTogether
  61335. },
  61336. /**
  61337. * This modifier is used to move the `arrowElement` of the popper to make
  61338. * sure it is positioned between the reference element and its popper element.
  61339. * It will read the outer size of the `arrowElement` node to detect how many
  61340. * pixels of conjunction are needed.
  61341. *
  61342. * It has no effect if no `arrowElement` is provided.
  61343. * @memberof modifiers
  61344. * @inner
  61345. */
  61346. arrow: {
  61347. /** @prop {number} order=500 - Index used to define the order of execution */
  61348. order: 500,
  61349. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  61350. enabled: true,
  61351. /** @prop {ModifierFn} */
  61352. fn: arrow,
  61353. /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
  61354. element: '[x-arrow]'
  61355. },
  61356. /**
  61357. * Modifier used to flip the popper's placement when it starts to overlap its
  61358. * reference element.
  61359. *
  61360. * Requires the `preventOverflow` modifier before it in order to work.
  61361. *
  61362. * **NOTE:** this modifier will interrupt the current update cycle and will
  61363. * restart it if it detects the need to flip the placement.
  61364. * @memberof modifiers
  61365. * @inner
  61366. */
  61367. flip: {
  61368. /** @prop {number} order=600 - Index used to define the order of execution */
  61369. order: 600,
  61370. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  61371. enabled: true,
  61372. /** @prop {ModifierFn} */
  61373. fn: flip,
  61374. /**
  61375. * @prop {String|Array} behavior='flip'
  61376. * The behavior used to change the popper's placement. It can be one of
  61377. * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
  61378. * placements (with optional variations)
  61379. */
  61380. behavior: 'flip',
  61381. /**
  61382. * @prop {number} padding=5
  61383. * The popper will flip if it hits the edges of the `boundariesElement`
  61384. */
  61385. padding: 5,
  61386. /**
  61387. * @prop {String|HTMLElement} boundariesElement='viewport'
  61388. * The element which will define the boundaries of the popper position.
  61389. * The popper will never be placed outside of the defined boundaries
  61390. * (except if `keepTogether` is enabled)
  61391. */
  61392. boundariesElement: 'viewport',
  61393. /**
  61394. * @prop {Boolean} flipVariations=false
  61395. * The popper will switch placement variation between `-start` and `-end` when
  61396. * the reference element overlaps its boundaries.
  61397. *
  61398. * The original placement should have a set variation.
  61399. */
  61400. flipVariations: false,
  61401. /**
  61402. * @prop {Boolean} flipVariationsByContent=false
  61403. * The popper will switch placement variation between `-start` and `-end` when
  61404. * the popper element overlaps its reference boundaries.
  61405. *
  61406. * The original placement should have a set variation.
  61407. */
  61408. flipVariationsByContent: false
  61409. },
  61410. /**
  61411. * Modifier used to make the popper flow toward the inner of the reference element.
  61412. * By default, when this modifier is disabled, the popper will be placed outside
  61413. * the reference element.
  61414. * @memberof modifiers
  61415. * @inner
  61416. */
  61417. inner: {
  61418. /** @prop {number} order=700 - Index used to define the order of execution */
  61419. order: 700,
  61420. /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
  61421. enabled: false,
  61422. /** @prop {ModifierFn} */
  61423. fn: inner
  61424. },
  61425. /**
  61426. * Modifier used to hide the popper when its reference element is outside of the
  61427. * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
  61428. * be used to hide with a CSS selector the popper when its reference is
  61429. * out of boundaries.
  61430. *
  61431. * Requires the `preventOverflow` modifier before it in order to work.
  61432. * @memberof modifiers
  61433. * @inner
  61434. */
  61435. hide: {
  61436. /** @prop {number} order=800 - Index used to define the order of execution */
  61437. order: 800,
  61438. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  61439. enabled: true,
  61440. /** @prop {ModifierFn} */
  61441. fn: hide
  61442. },
  61443. /**
  61444. * Computes the style that will be applied to the popper element to gets
  61445. * properly positioned.
  61446. *
  61447. * Note that this modifier will not touch the DOM, it just prepares the styles
  61448. * so that `applyStyle` modifier can apply it. This separation is useful
  61449. * in case you need to replace `applyStyle` with a custom implementation.
  61450. *
  61451. * This modifier has `850` as `order` value to maintain backward compatibility
  61452. * with previous versions of Popper.js. Expect the modifiers ordering method
  61453. * to change in future major versions of the library.
  61454. *
  61455. * @memberof modifiers
  61456. * @inner
  61457. */
  61458. computeStyle: {
  61459. /** @prop {number} order=850 - Index used to define the order of execution */
  61460. order: 850,
  61461. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  61462. enabled: true,
  61463. /** @prop {ModifierFn} */
  61464. fn: computeStyle,
  61465. /**
  61466. * @prop {Boolean} gpuAcceleration=true
  61467. * If true, it uses the CSS 3D transformation to position the popper.
  61468. * Otherwise, it will use the `top` and `left` properties
  61469. */
  61470. gpuAcceleration: true,
  61471. /**
  61472. * @prop {string} [x='bottom']
  61473. * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
  61474. * Change this if your popper should grow in a direction different from `bottom`
  61475. */
  61476. x: 'bottom',
  61477. /**
  61478. * @prop {string} [x='left']
  61479. * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
  61480. * Change this if your popper should grow in a direction different from `right`
  61481. */
  61482. y: 'right'
  61483. },
  61484. /**
  61485. * Applies the computed styles to the popper element.
  61486. *
  61487. * All the DOM manipulations are limited to this modifier. This is useful in case
  61488. * you want to integrate Popper.js inside a framework or view library and you
  61489. * want to delegate all the DOM manipulations to it.
  61490. *
  61491. * Note that if you disable this modifier, you must make sure the popper element
  61492. * has its position set to `absolute` before Popper.js can do its work!
  61493. *
  61494. * Just disable this modifier and define your own to achieve the desired effect.
  61495. *
  61496. * @memberof modifiers
  61497. * @inner
  61498. */
  61499. applyStyle: {
  61500. /** @prop {number} order=900 - Index used to define the order of execution */
  61501. order: 900,
  61502. /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
  61503. enabled: true,
  61504. /** @prop {ModifierFn} */
  61505. fn: applyStyle,
  61506. /** @prop {Function} */
  61507. onLoad: applyStyleOnLoad,
  61508. /**
  61509. * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
  61510. * @prop {Boolean} gpuAcceleration=true
  61511. * If true, it uses the CSS 3D transformation to position the popper.
  61512. * Otherwise, it will use the `top` and `left` properties
  61513. */
  61514. gpuAcceleration: undefined
  61515. }
  61516. };
  61517. /**
  61518. * The `dataObject` is an object containing all the information used by Popper.js.
  61519. * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
  61520. * @name dataObject
  61521. * @property {Object} data.instance The Popper.js instance
  61522. * @property {String} data.placement Placement applied to popper
  61523. * @property {String} data.originalPlacement Placement originally defined on init
  61524. * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
  61525. * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
  61526. * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
  61527. * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
  61528. * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
  61529. * @property {Object} data.boundaries Offsets of the popper boundaries
  61530. * @property {Object} data.offsets The measurements of popper, reference and arrow elements
  61531. * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
  61532. * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
  61533. * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
  61534. */
  61535. /**
  61536. * Default options provided to Popper.js constructor.<br />
  61537. * These can be overridden using the `options` argument of Popper.js.<br />
  61538. * To override an option, simply pass an object with the same
  61539. * structure of the `options` object, as the 3rd argument. For example:
  61540. * ```
  61541. * new Popper(ref, pop, {
  61542. * modifiers: {
  61543. * preventOverflow: { enabled: false }
  61544. * }
  61545. * })
  61546. * ```
  61547. * @type {Object}
  61548. * @static
  61549. * @memberof Popper
  61550. */
  61551. var Defaults = {
  61552. /**
  61553. * Popper's placement.
  61554. * @prop {Popper.placements} placement='bottom'
  61555. */
  61556. placement: 'bottom',
  61557. /**
  61558. * Set this to true if you want popper to position it self in 'fixed' mode
  61559. * @prop {Boolean} positionFixed=false
  61560. */
  61561. positionFixed: false,
  61562. /**
  61563. * Whether events (resize, scroll) are initially enabled.
  61564. * @prop {Boolean} eventsEnabled=true
  61565. */
  61566. eventsEnabled: true,
  61567. /**
  61568. * Set to true if you want to automatically remove the popper when
  61569. * you call the `destroy` method.
  61570. * @prop {Boolean} removeOnDestroy=false
  61571. */
  61572. removeOnDestroy: false,
  61573. /**
  61574. * Callback called when the popper is created.<br />
  61575. * By default, it is set to no-op.<br />
  61576. * Access Popper.js instance with `data.instance`.
  61577. * @prop {onCreate}
  61578. */
  61579. onCreate: function onCreate() {},
  61580. /**
  61581. * Callback called when the popper is updated. This callback is not called
  61582. * on the initialization/creation of the popper, but only on subsequent
  61583. * updates.<br />
  61584. * By default, it is set to no-op.<br />
  61585. * Access Popper.js instance with `data.instance`.
  61586. * @prop {onUpdate}
  61587. */
  61588. onUpdate: function onUpdate() {},
  61589. /**
  61590. * List of modifiers used to modify the offsets before they are applied to the popper.
  61591. * They provide most of the functionalities of Popper.js.
  61592. * @prop {modifiers}
  61593. */
  61594. modifiers: modifiers
  61595. };
  61596. /**
  61597. * @callback onCreate
  61598. * @param {dataObject} data
  61599. */
  61600. /**
  61601. * @callback onUpdate
  61602. * @param {dataObject} data
  61603. */
  61604. // Utils
  61605. // Methods
  61606. var Popper = function () {
  61607. /**
  61608. * Creates a new Popper.js instance.
  61609. * @class Popper
  61610. * @param {Element|referenceObject} reference - The reference element used to position the popper
  61611. * @param {Element} popper - The HTML / XML element used as the popper
  61612. * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
  61613. * @return {Object} instance - The generated Popper.js instance
  61614. */
  61615. function Popper(reference, popper) {
  61616. var _this = this;
  61617. var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
  61618. classCallCheck(this, Popper);
  61619. this.scheduleUpdate = function () {
  61620. return requestAnimationFrame(_this.update);
  61621. };
  61622. // make update() debounced, so that it only runs at most once-per-tick
  61623. this.update = debounce(this.update.bind(this));
  61624. // with {} we create a new object with the options inside it
  61625. this.options = _extends({}, Popper.Defaults, options);
  61626. // init state
  61627. this.state = {
  61628. isDestroyed: false,
  61629. isCreated: false,
  61630. scrollParents: []
  61631. };
  61632. // get reference and popper elements (allow jQuery wrappers)
  61633. this.reference = reference && reference.jquery ? reference[0] : reference;
  61634. this.popper = popper && popper.jquery ? popper[0] : popper;
  61635. // Deep merge modifiers options
  61636. this.options.modifiers = {};
  61637. Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
  61638. _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
  61639. });
  61640. // Refactoring modifiers' list (Object => Array)
  61641. this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
  61642. return _extends({
  61643. name: name
  61644. }, _this.options.modifiers[name]);
  61645. })
  61646. // sort the modifiers by order
  61647. .sort(function (a, b) {
  61648. return a.order - b.order;
  61649. });
  61650. // modifiers have the ability to execute arbitrary code when Popper.js get inited
  61651. // such code is executed in the same order of its modifier
  61652. // they could add new properties to their options configuration
  61653. // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
  61654. this.modifiers.forEach(function (modifierOptions) {
  61655. if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
  61656. modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
  61657. }
  61658. });
  61659. // fire the first update to position the popper in the right place
  61660. this.update();
  61661. var eventsEnabled = this.options.eventsEnabled;
  61662. if (eventsEnabled) {
  61663. // setup event listeners, they will take care of update the position in specific situations
  61664. this.enableEventListeners();
  61665. }
  61666. this.state.eventsEnabled = eventsEnabled;
  61667. }
  61668. // We can't use class properties because they don't get listed in the
  61669. // class prototype and break stuff like Sinon stubs
  61670. createClass(Popper, [{
  61671. key: 'update',
  61672. value: function update$$1() {
  61673. return update.call(this);
  61674. }
  61675. }, {
  61676. key: 'destroy',
  61677. value: function destroy$$1() {
  61678. return destroy.call(this);
  61679. }
  61680. }, {
  61681. key: 'enableEventListeners',
  61682. value: function enableEventListeners$$1() {
  61683. return enableEventListeners.call(this);
  61684. }
  61685. }, {
  61686. key: 'disableEventListeners',
  61687. value: function disableEventListeners$$1() {
  61688. return disableEventListeners.call(this);
  61689. }
  61690. /**
  61691. * Schedules an update. It will run on the next UI update available.
  61692. * @method scheduleUpdate
  61693. * @memberof Popper
  61694. */
  61695. /**
  61696. * Collection of utilities useful when writing custom modifiers.
  61697. * Starting from version 1.7, this method is available only if you
  61698. * include `popper-utils.js` before `popper.js`.
  61699. *
  61700. * **DEPRECATION**: This way to access PopperUtils is deprecated
  61701. * and will be removed in v2! Use the PopperUtils module directly instead.
  61702. * Due to the high instability of the methods contained in Utils, we can't
  61703. * guarantee them to follow semver. Use them at your own risk!
  61704. * @static
  61705. * @private
  61706. * @type {Object}
  61707. * @deprecated since version 1.8
  61708. * @member Utils
  61709. * @memberof Popper
  61710. */
  61711. }]);
  61712. return Popper;
  61713. }();
  61714. /**
  61715. * The `referenceObject` is an object that provides an interface compatible with Popper.js
  61716. * and lets you use it as replacement of a real DOM node.<br />
  61717. * You can use this method to position a popper relatively to a set of coordinates
  61718. * in case you don't have a DOM node to use as reference.
  61719. *
  61720. * ```
  61721. * new Popper(referenceObject, popperNode);
  61722. * ```
  61723. *
  61724. * NB: This feature isn't supported in Internet Explorer 10.
  61725. * @name referenceObject
  61726. * @property {Function} data.getBoundingClientRect
  61727. * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
  61728. * @property {number} data.clientWidth
  61729. * An ES6 getter that will return the width of the virtual reference element.
  61730. * @property {number} data.clientHeight
  61731. * An ES6 getter that will return the height of the virtual reference element.
  61732. */
  61733. Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
  61734. Popper.placements = placements;
  61735. Popper.Defaults = Defaults;
  61736. /* harmony default export */ __webpack_exports__["default"] = (Popper);
  61737. //# sourceMappingURL=popper.js.map
  61738. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  61739. /***/ }),
  61740. /***/ "./node_modules/process/browser.js":
  61741. /*!*****************************************!*\
  61742. !*** ./node_modules/process/browser.js ***!
  61743. \*****************************************/
  61744. /*! no static exports found */
  61745. /***/ (function(module, exports) {
  61746. // shim for using process in browser
  61747. var process = module.exports = {};
  61748. // cached from whatever global is present so that test runners that stub it
  61749. // don't break things. But we need to wrap it in a try catch in case it is
  61750. // wrapped in strict mode code which doesn't define any globals. It's inside a
  61751. // function because try/catches deoptimize in certain engines.
  61752. var cachedSetTimeout;
  61753. var cachedClearTimeout;
  61754. function defaultSetTimout() {
  61755. throw new Error('setTimeout has not been defined');
  61756. }
  61757. function defaultClearTimeout () {
  61758. throw new Error('clearTimeout has not been defined');
  61759. }
  61760. (function () {
  61761. try {
  61762. if (typeof setTimeout === 'function') {
  61763. cachedSetTimeout = setTimeout;
  61764. } else {
  61765. cachedSetTimeout = defaultSetTimout;
  61766. }
  61767. } catch (e) {
  61768. cachedSetTimeout = defaultSetTimout;
  61769. }
  61770. try {
  61771. if (typeof clearTimeout === 'function') {
  61772. cachedClearTimeout = clearTimeout;
  61773. } else {
  61774. cachedClearTimeout = defaultClearTimeout;
  61775. }
  61776. } catch (e) {
  61777. cachedClearTimeout = defaultClearTimeout;
  61778. }
  61779. } ())
  61780. function runTimeout(fun) {
  61781. if (cachedSetTimeout === setTimeout) {
  61782. //normal enviroments in sane situations
  61783. return setTimeout(fun, 0);
  61784. }
  61785. // if setTimeout wasn't available but was latter defined
  61786. if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  61787. cachedSetTimeout = setTimeout;
  61788. return setTimeout(fun, 0);
  61789. }
  61790. try {
  61791. // when when somebody has screwed with setTimeout but no I.E. maddness
  61792. return cachedSetTimeout(fun, 0);
  61793. } catch(e){
  61794. try {
  61795. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  61796. return cachedSetTimeout.call(null, fun, 0);
  61797. } catch(e){
  61798. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
  61799. return cachedSetTimeout.call(this, fun, 0);
  61800. }
  61801. }
  61802. }
  61803. function runClearTimeout(marker) {
  61804. if (cachedClearTimeout === clearTimeout) {
  61805. //normal enviroments in sane situations
  61806. return clearTimeout(marker);
  61807. }
  61808. // if clearTimeout wasn't available but was latter defined
  61809. if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  61810. cachedClearTimeout = clearTimeout;
  61811. return clearTimeout(marker);
  61812. }
  61813. try {
  61814. // when when somebody has screwed with setTimeout but no I.E. maddness
  61815. return cachedClearTimeout(marker);
  61816. } catch (e){
  61817. try {
  61818. // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
  61819. return cachedClearTimeout.call(null, marker);
  61820. } catch (e){
  61821. // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
  61822. // Some versions of I.E. have different rules for clearTimeout vs setTimeout
  61823. return cachedClearTimeout.call(this, marker);
  61824. }
  61825. }
  61826. }
  61827. var queue = [];
  61828. var draining = false;
  61829. var currentQueue;
  61830. var queueIndex = -1;
  61831. function cleanUpNextTick() {
  61832. if (!draining || !currentQueue) {
  61833. return;
  61834. }
  61835. draining = false;
  61836. if (currentQueue.length) {
  61837. queue = currentQueue.concat(queue);
  61838. } else {
  61839. queueIndex = -1;
  61840. }
  61841. if (queue.length) {
  61842. drainQueue();
  61843. }
  61844. }
  61845. function drainQueue() {
  61846. if (draining) {
  61847. return;
  61848. }
  61849. var timeout = runTimeout(cleanUpNextTick);
  61850. draining = true;
  61851. var len = queue.length;
  61852. while(len) {
  61853. currentQueue = queue;
  61854. queue = [];
  61855. while (++queueIndex < len) {
  61856. if (currentQueue) {
  61857. currentQueue[queueIndex].run();
  61858. }
  61859. }
  61860. queueIndex = -1;
  61861. len = queue.length;
  61862. }
  61863. currentQueue = null;
  61864. draining = false;
  61865. runClearTimeout(timeout);
  61866. }
  61867. process.nextTick = function (fun) {
  61868. var args = new Array(arguments.length - 1);
  61869. if (arguments.length > 1) {
  61870. for (var i = 1; i < arguments.length; i++) {
  61871. args[i - 1] = arguments[i];
  61872. }
  61873. }
  61874. queue.push(new Item(fun, args));
  61875. if (queue.length === 1 && !draining) {
  61876. runTimeout(drainQueue);
  61877. }
  61878. };
  61879. // v8 likes predictible objects
  61880. function Item(fun, array) {
  61881. this.fun = fun;
  61882. this.array = array;
  61883. }
  61884. Item.prototype.run = function () {
  61885. this.fun.apply(null, this.array);
  61886. };
  61887. process.title = 'browser';
  61888. process.browser = true;
  61889. process.env = {};
  61890. process.argv = [];
  61891. process.version = ''; // empty string to avoid regexp issues
  61892. process.versions = {};
  61893. function noop() {}
  61894. process.on = noop;
  61895. process.addListener = noop;
  61896. process.once = noop;
  61897. process.off = noop;
  61898. process.removeListener = noop;
  61899. process.removeAllListeners = noop;
  61900. process.emit = noop;
  61901. process.prependListener = noop;
  61902. process.prependOnceListener = noop;
  61903. process.listeners = function (name) { return [] }
  61904. process.binding = function (name) {
  61905. throw new Error('process.binding is not supported');
  61906. };
  61907. process.cwd = function () { return '/' };
  61908. process.chdir = function (dir) {
  61909. throw new Error('process.chdir is not supported');
  61910. };
  61911. process.umask = function() { return 0; };
  61912. /***/ }),
  61913. /***/ "./node_modules/setimmediate/setImmediate.js":
  61914. /*!***************************************************!*\
  61915. !*** ./node_modules/setimmediate/setImmediate.js ***!
  61916. \***************************************************/
  61917. /*! no static exports found */
  61918. /***/ (function(module, exports, __webpack_require__) {
  61919. /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
  61920. "use strict";
  61921. if (global.setImmediate) {
  61922. return;
  61923. }
  61924. var nextHandle = 1; // Spec says greater than zero
  61925. var tasksByHandle = {};
  61926. var currentlyRunningATask = false;
  61927. var doc = global.document;
  61928. var registerImmediate;
  61929. function setImmediate(callback) {
  61930. // Callback can either be a function or a string
  61931. if (typeof callback !== "function") {
  61932. callback = new Function("" + callback);
  61933. }
  61934. // Copy function arguments
  61935. var args = new Array(arguments.length - 1);
  61936. for (var i = 0; i < args.length; i++) {
  61937. args[i] = arguments[i + 1];
  61938. }
  61939. // Store and register the task
  61940. var task = { callback: callback, args: args };
  61941. tasksByHandle[nextHandle] = task;
  61942. registerImmediate(nextHandle);
  61943. return nextHandle++;
  61944. }
  61945. function clearImmediate(handle) {
  61946. delete tasksByHandle[handle];
  61947. }
  61948. function run(task) {
  61949. var callback = task.callback;
  61950. var args = task.args;
  61951. switch (args.length) {
  61952. case 0:
  61953. callback();
  61954. break;
  61955. case 1:
  61956. callback(args[0]);
  61957. break;
  61958. case 2:
  61959. callback(args[0], args[1]);
  61960. break;
  61961. case 3:
  61962. callback(args[0], args[1], args[2]);
  61963. break;
  61964. default:
  61965. callback.apply(undefined, args);
  61966. break;
  61967. }
  61968. }
  61969. function runIfPresent(handle) {
  61970. // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
  61971. // So if we're currently running a task, we'll need to delay this invocation.
  61972. if (currentlyRunningATask) {
  61973. // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
  61974. // "too much recursion" error.
  61975. setTimeout(runIfPresent, 0, handle);
  61976. } else {
  61977. var task = tasksByHandle[handle];
  61978. if (task) {
  61979. currentlyRunningATask = true;
  61980. try {
  61981. run(task);
  61982. } finally {
  61983. clearImmediate(handle);
  61984. currentlyRunningATask = false;
  61985. }
  61986. }
  61987. }
  61988. }
  61989. function installNextTickImplementation() {
  61990. registerImmediate = function(handle) {
  61991. process.nextTick(function () { runIfPresent(handle); });
  61992. };
  61993. }
  61994. function canUsePostMessage() {
  61995. // The test against `importScripts` prevents this implementation from being installed inside a web worker,
  61996. // where `global.postMessage` means something completely different and can't be used for this purpose.
  61997. if (global.postMessage && !global.importScripts) {
  61998. var postMessageIsAsynchronous = true;
  61999. var oldOnMessage = global.onmessage;
  62000. global.onmessage = function() {
  62001. postMessageIsAsynchronous = false;
  62002. };
  62003. global.postMessage("", "*");
  62004. global.onmessage = oldOnMessage;
  62005. return postMessageIsAsynchronous;
  62006. }
  62007. }
  62008. function installPostMessageImplementation() {
  62009. // Installs an event handler on `global` for the `message` event: see
  62010. // * https://developer.mozilla.org/en/DOM/window.postMessage
  62011. // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
  62012. var messagePrefix = "setImmediate$" + Math.random() + "$";
  62013. var onGlobalMessage = function(event) {
  62014. if (event.source === global &&
  62015. typeof event.data === "string" &&
  62016. event.data.indexOf(messagePrefix) === 0) {
  62017. runIfPresent(+event.data.slice(messagePrefix.length));
  62018. }
  62019. };
  62020. if (global.addEventListener) {
  62021. global.addEventListener("message", onGlobalMessage, false);
  62022. } else {
  62023. global.attachEvent("onmessage", onGlobalMessage);
  62024. }
  62025. registerImmediate = function(handle) {
  62026. global.postMessage(messagePrefix + handle, "*");
  62027. };
  62028. }
  62029. function installMessageChannelImplementation() {
  62030. var channel = new MessageChannel();
  62031. channel.port1.onmessage = function(event) {
  62032. var handle = event.data;
  62033. runIfPresent(handle);
  62034. };
  62035. registerImmediate = function(handle) {
  62036. channel.port2.postMessage(handle);
  62037. };
  62038. }
  62039. function installReadyStateChangeImplementation() {
  62040. var html = doc.documentElement;
  62041. registerImmediate = function(handle) {
  62042. // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
  62043. // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
  62044. var script = doc.createElement("script");
  62045. script.onreadystatechange = function () {
  62046. runIfPresent(handle);
  62047. script.onreadystatechange = null;
  62048. html.removeChild(script);
  62049. script = null;
  62050. };
  62051. html.appendChild(script);
  62052. };
  62053. }
  62054. function installSetTimeoutImplementation() {
  62055. registerImmediate = function(handle) {
  62056. setTimeout(runIfPresent, 0, handle);
  62057. };
  62058. }
  62059. // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
  62060. var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
  62061. attachTo = attachTo && attachTo.setTimeout ? attachTo : global;
  62062. // Don't get fooled by e.g. browserify environments.
  62063. if ({}.toString.call(global.process) === "[object process]") {
  62064. // For Node.js before 0.9
  62065. installNextTickImplementation();
  62066. } else if (canUsePostMessage()) {
  62067. // For non-IE10 modern browsers
  62068. installPostMessageImplementation();
  62069. } else if (global.MessageChannel) {
  62070. // For web workers, where supported
  62071. installMessageChannelImplementation();
  62072. } else if (doc && "onreadystatechange" in doc.createElement("script")) {
  62073. // For IE 6–8
  62074. installReadyStateChangeImplementation();
  62075. } else {
  62076. // For older browsers
  62077. installSetTimeoutImplementation();
  62078. }
  62079. attachTo.setImmediate = setImmediate;
  62080. attachTo.clearImmediate = clearImmediate;
  62081. }(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self));
  62082. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js")))
  62083. /***/ }),
  62084. /***/ "./node_modules/socket.io-client/lib/index.js":
  62085. /*!****************************************************!*\
  62086. !*** ./node_modules/socket.io-client/lib/index.js ***!
  62087. \****************************************************/
  62088. /*! no static exports found */
  62089. /***/ (function(module, exports, __webpack_require__) {
  62090. /**
  62091. * Module dependencies.
  62092. */
  62093. var url = __webpack_require__(/*! ./url */ "./node_modules/socket.io-client/lib/url.js");
  62094. var parser = __webpack_require__(/*! socket.io-parser */ "./node_modules/socket.io-parser/index.js");
  62095. var Manager = __webpack_require__(/*! ./manager */ "./node_modules/socket.io-client/lib/manager.js");
  62096. var debug = __webpack_require__(/*! debug */ "./node_modules/socket.io-client/node_modules/debug/src/browser.js")('socket.io-client');
  62097. /**
  62098. * Module exports.
  62099. */
  62100. module.exports = exports = lookup;
  62101. /**
  62102. * Managers cache.
  62103. */
  62104. var cache = exports.managers = {};
  62105. /**
  62106. * Looks up an existing `Manager` for multiplexing.
  62107. * If the user summons:
  62108. *
  62109. * `io('http://localhost/a');`
  62110. * `io('http://localhost/b');`
  62111. *
  62112. * We reuse the existing instance based on same scheme/port/host,
  62113. * and we initialize sockets for each namespace.
  62114. *
  62115. * @api public
  62116. */
  62117. function lookup (uri, opts) {
  62118. if (typeof uri === 'object') {
  62119. opts = uri;
  62120. uri = undefined;
  62121. }
  62122. opts = opts || {};
  62123. var parsed = url(uri);
  62124. var source = parsed.source;
  62125. var id = parsed.id;
  62126. var path = parsed.path;
  62127. var sameNamespace = cache[id] && path in cache[id].nsps;
  62128. var newConnection = opts.forceNew || opts['force new connection'] ||
  62129. false === opts.multiplex || sameNamespace;
  62130. var io;
  62131. if (newConnection) {
  62132. debug('ignoring socket cache for %s', source);
  62133. io = Manager(source, opts);
  62134. } else {
  62135. if (!cache[id]) {
  62136. debug('new io instance for %s', source);
  62137. cache[id] = Manager(source, opts);
  62138. }
  62139. io = cache[id];
  62140. }
  62141. if (parsed.query && !opts.query) {
  62142. opts.query = parsed.query;
  62143. }
  62144. return io.socket(parsed.path, opts);
  62145. }
  62146. /**
  62147. * Protocol version.
  62148. *
  62149. * @api public
  62150. */
  62151. exports.protocol = parser.protocol;
  62152. /**
  62153. * `connect`.
  62154. *
  62155. * @param {String} uri
  62156. * @api public
  62157. */
  62158. exports.connect = lookup;
  62159. /**
  62160. * Expose constructors for standalone build.
  62161. *
  62162. * @api public
  62163. */
  62164. exports.Manager = __webpack_require__(/*! ./manager */ "./node_modules/socket.io-client/lib/manager.js");
  62165. exports.Socket = __webpack_require__(/*! ./socket */ "./node_modules/socket.io-client/lib/socket.js");
  62166. /***/ }),
  62167. /***/ "./node_modules/socket.io-client/lib/manager.js":
  62168. /*!******************************************************!*\
  62169. !*** ./node_modules/socket.io-client/lib/manager.js ***!
  62170. \******************************************************/
  62171. /*! no static exports found */
  62172. /***/ (function(module, exports, __webpack_require__) {
  62173. /**
  62174. * Module dependencies.
  62175. */
  62176. var eio = __webpack_require__(/*! engine.io-client */ "./node_modules/engine.io-client/lib/index.js");
  62177. var Socket = __webpack_require__(/*! ./socket */ "./node_modules/socket.io-client/lib/socket.js");
  62178. var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/socket.io-client/node_modules/component-emitter/index.js");
  62179. var parser = __webpack_require__(/*! socket.io-parser */ "./node_modules/socket.io-parser/index.js");
  62180. var on = __webpack_require__(/*! ./on */ "./node_modules/socket.io-client/lib/on.js");
  62181. var bind = __webpack_require__(/*! component-bind */ "./node_modules/component-bind/index.js");
  62182. var debug = __webpack_require__(/*! debug */ "./node_modules/socket.io-client/node_modules/debug/src/browser.js")('socket.io-client:manager');
  62183. var indexOf = __webpack_require__(/*! indexof */ "./node_modules/indexof/index.js");
  62184. var Backoff = __webpack_require__(/*! backo2 */ "./node_modules/backo2/index.js");
  62185. /**
  62186. * IE6+ hasOwnProperty
  62187. */
  62188. var has = Object.prototype.hasOwnProperty;
  62189. /**
  62190. * Module exports
  62191. */
  62192. module.exports = Manager;
  62193. /**
  62194. * `Manager` constructor.
  62195. *
  62196. * @param {String} engine instance or engine uri/opts
  62197. * @param {Object} options
  62198. * @api public
  62199. */
  62200. function Manager (uri, opts) {
  62201. if (!(this instanceof Manager)) return new Manager(uri, opts);
  62202. if (uri && ('object' === typeof uri)) {
  62203. opts = uri;
  62204. uri = undefined;
  62205. }
  62206. opts = opts || {};
  62207. opts.path = opts.path || '/socket.io';
  62208. this.nsps = {};
  62209. this.subs = [];
  62210. this.opts = opts;
  62211. this.reconnection(opts.reconnection !== false);
  62212. this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);
  62213. this.reconnectionDelay(opts.reconnectionDelay || 1000);
  62214. this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);
  62215. this.randomizationFactor(opts.randomizationFactor || 0.5);
  62216. this.backoff = new Backoff({
  62217. min: this.reconnectionDelay(),
  62218. max: this.reconnectionDelayMax(),
  62219. jitter: this.randomizationFactor()
  62220. });
  62221. this.timeout(null == opts.timeout ? 20000 : opts.timeout);
  62222. this.readyState = 'closed';
  62223. this.uri = uri;
  62224. this.connecting = [];
  62225. this.lastPing = null;
  62226. this.encoding = false;
  62227. this.packetBuffer = [];
  62228. var _parser = opts.parser || parser;
  62229. this.encoder = new _parser.Encoder();
  62230. this.decoder = new _parser.Decoder();
  62231. this.autoConnect = opts.autoConnect !== false;
  62232. if (this.autoConnect) this.open();
  62233. }
  62234. /**
  62235. * Propagate given event to sockets and emit on `this`
  62236. *
  62237. * @api private
  62238. */
  62239. Manager.prototype.emitAll = function () {
  62240. this.emit.apply(this, arguments);
  62241. for (var nsp in this.nsps) {
  62242. if (has.call(this.nsps, nsp)) {
  62243. this.nsps[nsp].emit.apply(this.nsps[nsp], arguments);
  62244. }
  62245. }
  62246. };
  62247. /**
  62248. * Update `socket.id` of all sockets
  62249. *
  62250. * @api private
  62251. */
  62252. Manager.prototype.updateSocketIds = function () {
  62253. for (var nsp in this.nsps) {
  62254. if (has.call(this.nsps, nsp)) {
  62255. this.nsps[nsp].id = this.generateId(nsp);
  62256. }
  62257. }
  62258. };
  62259. /**
  62260. * generate `socket.id` for the given `nsp`
  62261. *
  62262. * @param {String} nsp
  62263. * @return {String}
  62264. * @api private
  62265. */
  62266. Manager.prototype.generateId = function (nsp) {
  62267. return (nsp === '/' ? '' : (nsp + '#')) + this.engine.id;
  62268. };
  62269. /**
  62270. * Mix in `Emitter`.
  62271. */
  62272. Emitter(Manager.prototype);
  62273. /**
  62274. * Sets the `reconnection` config.
  62275. *
  62276. * @param {Boolean} true/false if it should automatically reconnect
  62277. * @return {Manager} self or value
  62278. * @api public
  62279. */
  62280. Manager.prototype.reconnection = function (v) {
  62281. if (!arguments.length) return this._reconnection;
  62282. this._reconnection = !!v;
  62283. return this;
  62284. };
  62285. /**
  62286. * Sets the reconnection attempts config.
  62287. *
  62288. * @param {Number} max reconnection attempts before giving up
  62289. * @return {Manager} self or value
  62290. * @api public
  62291. */
  62292. Manager.prototype.reconnectionAttempts = function (v) {
  62293. if (!arguments.length) return this._reconnectionAttempts;
  62294. this._reconnectionAttempts = v;
  62295. return this;
  62296. };
  62297. /**
  62298. * Sets the delay between reconnections.
  62299. *
  62300. * @param {Number} delay
  62301. * @return {Manager} self or value
  62302. * @api public
  62303. */
  62304. Manager.prototype.reconnectionDelay = function (v) {
  62305. if (!arguments.length) return this._reconnectionDelay;
  62306. this._reconnectionDelay = v;
  62307. this.backoff && this.backoff.setMin(v);
  62308. return this;
  62309. };
  62310. Manager.prototype.randomizationFactor = function (v) {
  62311. if (!arguments.length) return this._randomizationFactor;
  62312. this._randomizationFactor = v;
  62313. this.backoff && this.backoff.setJitter(v);
  62314. return this;
  62315. };
  62316. /**
  62317. * Sets the maximum delay between reconnections.
  62318. *
  62319. * @param {Number} delay
  62320. * @return {Manager} self or value
  62321. * @api public
  62322. */
  62323. Manager.prototype.reconnectionDelayMax = function (v) {
  62324. if (!arguments.length) return this._reconnectionDelayMax;
  62325. this._reconnectionDelayMax = v;
  62326. this.backoff && this.backoff.setMax(v);
  62327. return this;
  62328. };
  62329. /**
  62330. * Sets the connection timeout. `false` to disable
  62331. *
  62332. * @return {Manager} self or value
  62333. * @api public
  62334. */
  62335. Manager.prototype.timeout = function (v) {
  62336. if (!arguments.length) return this._timeout;
  62337. this._timeout = v;
  62338. return this;
  62339. };
  62340. /**
  62341. * Starts trying to reconnect if reconnection is enabled and we have not
  62342. * started reconnecting yet
  62343. *
  62344. * @api private
  62345. */
  62346. Manager.prototype.maybeReconnectOnOpen = function () {
  62347. // Only try to reconnect if it's the first time we're connecting
  62348. if (!this.reconnecting && this._reconnection && this.backoff.attempts === 0) {
  62349. // keeps reconnection from firing twice for the same reconnection loop
  62350. this.reconnect();
  62351. }
  62352. };
  62353. /**
  62354. * Sets the current transport `socket`.
  62355. *
  62356. * @param {Function} optional, callback
  62357. * @return {Manager} self
  62358. * @api public
  62359. */
  62360. Manager.prototype.open =
  62361. Manager.prototype.connect = function (fn, opts) {
  62362. debug('readyState %s', this.readyState);
  62363. if (~this.readyState.indexOf('open')) return this;
  62364. debug('opening %s', this.uri);
  62365. this.engine = eio(this.uri, this.opts);
  62366. var socket = this.engine;
  62367. var self = this;
  62368. this.readyState = 'opening';
  62369. this.skipReconnect = false;
  62370. // emit `open`
  62371. var openSub = on(socket, 'open', function () {
  62372. self.onopen();
  62373. fn && fn();
  62374. });
  62375. // emit `connect_error`
  62376. var errorSub = on(socket, 'error', function (data) {
  62377. debug('connect_error');
  62378. self.cleanup();
  62379. self.readyState = 'closed';
  62380. self.emitAll('connect_error', data);
  62381. if (fn) {
  62382. var err = new Error('Connection error');
  62383. err.data = data;
  62384. fn(err);
  62385. } else {
  62386. // Only do this if there is no fn to handle the error
  62387. self.maybeReconnectOnOpen();
  62388. }
  62389. });
  62390. // emit `connect_timeout`
  62391. if (false !== this._timeout) {
  62392. var timeout = this._timeout;
  62393. debug('connect attempt will timeout after %d', timeout);
  62394. // set timer
  62395. var timer = setTimeout(function () {
  62396. debug('connect attempt timed out after %d', timeout);
  62397. openSub.destroy();
  62398. socket.close();
  62399. socket.emit('error', 'timeout');
  62400. self.emitAll('connect_timeout', timeout);
  62401. }, timeout);
  62402. this.subs.push({
  62403. destroy: function () {
  62404. clearTimeout(timer);
  62405. }
  62406. });
  62407. }
  62408. this.subs.push(openSub);
  62409. this.subs.push(errorSub);
  62410. return this;
  62411. };
  62412. /**
  62413. * Called upon transport open.
  62414. *
  62415. * @api private
  62416. */
  62417. Manager.prototype.onopen = function () {
  62418. debug('open');
  62419. // clear old subs
  62420. this.cleanup();
  62421. // mark as open
  62422. this.readyState = 'open';
  62423. this.emit('open');
  62424. // add new subs
  62425. var socket = this.engine;
  62426. this.subs.push(on(socket, 'data', bind(this, 'ondata')));
  62427. this.subs.push(on(socket, 'ping', bind(this, 'onping')));
  62428. this.subs.push(on(socket, 'pong', bind(this, 'onpong')));
  62429. this.subs.push(on(socket, 'error', bind(this, 'onerror')));
  62430. this.subs.push(on(socket, 'close', bind(this, 'onclose')));
  62431. this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')));
  62432. };
  62433. /**
  62434. * Called upon a ping.
  62435. *
  62436. * @api private
  62437. */
  62438. Manager.prototype.onping = function () {
  62439. this.lastPing = new Date();
  62440. this.emitAll('ping');
  62441. };
  62442. /**
  62443. * Called upon a packet.
  62444. *
  62445. * @api private
  62446. */
  62447. Manager.prototype.onpong = function () {
  62448. this.emitAll('pong', new Date() - this.lastPing);
  62449. };
  62450. /**
  62451. * Called with data.
  62452. *
  62453. * @api private
  62454. */
  62455. Manager.prototype.ondata = function (data) {
  62456. this.decoder.add(data);
  62457. };
  62458. /**
  62459. * Called when parser fully decodes a packet.
  62460. *
  62461. * @api private
  62462. */
  62463. Manager.prototype.ondecoded = function (packet) {
  62464. this.emit('packet', packet);
  62465. };
  62466. /**
  62467. * Called upon socket error.
  62468. *
  62469. * @api private
  62470. */
  62471. Manager.prototype.onerror = function (err) {
  62472. debug('error', err);
  62473. this.emitAll('error', err);
  62474. };
  62475. /**
  62476. * Creates a new socket for the given `nsp`.
  62477. *
  62478. * @return {Socket}
  62479. * @api public
  62480. */
  62481. Manager.prototype.socket = function (nsp, opts) {
  62482. var socket = this.nsps[nsp];
  62483. if (!socket) {
  62484. socket = new Socket(this, nsp, opts);
  62485. this.nsps[nsp] = socket;
  62486. var self = this;
  62487. socket.on('connecting', onConnecting);
  62488. socket.on('connect', function () {
  62489. socket.id = self.generateId(nsp);
  62490. });
  62491. if (this.autoConnect) {
  62492. // manually call here since connecting event is fired before listening
  62493. onConnecting();
  62494. }
  62495. }
  62496. function onConnecting () {
  62497. if (!~indexOf(self.connecting, socket)) {
  62498. self.connecting.push(socket);
  62499. }
  62500. }
  62501. return socket;
  62502. };
  62503. /**
  62504. * Called upon a socket close.
  62505. *
  62506. * @param {Socket} socket
  62507. */
  62508. Manager.prototype.destroy = function (socket) {
  62509. var index = indexOf(this.connecting, socket);
  62510. if (~index) this.connecting.splice(index, 1);
  62511. if (this.connecting.length) return;
  62512. this.close();
  62513. };
  62514. /**
  62515. * Writes a packet.
  62516. *
  62517. * @param {Object} packet
  62518. * @api private
  62519. */
  62520. Manager.prototype.packet = function (packet) {
  62521. debug('writing packet %j', packet);
  62522. var self = this;
  62523. if (packet.query && packet.type === 0) packet.nsp += '?' + packet.query;
  62524. if (!self.encoding) {
  62525. // encode, then write to engine with result
  62526. self.encoding = true;
  62527. this.encoder.encode(packet, function (encodedPackets) {
  62528. for (var i = 0; i < encodedPackets.length; i++) {
  62529. self.engine.write(encodedPackets[i], packet.options);
  62530. }
  62531. self.encoding = false;
  62532. self.processPacketQueue();
  62533. });
  62534. } else { // add packet to the queue
  62535. self.packetBuffer.push(packet);
  62536. }
  62537. };
  62538. /**
  62539. * If packet buffer is non-empty, begins encoding the
  62540. * next packet in line.
  62541. *
  62542. * @api private
  62543. */
  62544. Manager.prototype.processPacketQueue = function () {
  62545. if (this.packetBuffer.length > 0 && !this.encoding) {
  62546. var pack = this.packetBuffer.shift();
  62547. this.packet(pack);
  62548. }
  62549. };
  62550. /**
  62551. * Clean up transport subscriptions and packet buffer.
  62552. *
  62553. * @api private
  62554. */
  62555. Manager.prototype.cleanup = function () {
  62556. debug('cleanup');
  62557. var subsLength = this.subs.length;
  62558. for (var i = 0; i < subsLength; i++) {
  62559. var sub = this.subs.shift();
  62560. sub.destroy();
  62561. }
  62562. this.packetBuffer = [];
  62563. this.encoding = false;
  62564. this.lastPing = null;
  62565. this.decoder.destroy();
  62566. };
  62567. /**
  62568. * Close the current socket.
  62569. *
  62570. * @api private
  62571. */
  62572. Manager.prototype.close =
  62573. Manager.prototype.disconnect = function () {
  62574. debug('disconnect');
  62575. this.skipReconnect = true;
  62576. this.reconnecting = false;
  62577. if ('opening' === this.readyState) {
  62578. // `onclose` will not fire because
  62579. // an open event never happened
  62580. this.cleanup();
  62581. }
  62582. this.backoff.reset();
  62583. this.readyState = 'closed';
  62584. if (this.engine) this.engine.close();
  62585. };
  62586. /**
  62587. * Called upon engine close.
  62588. *
  62589. * @api private
  62590. */
  62591. Manager.prototype.onclose = function (reason) {
  62592. debug('onclose');
  62593. this.cleanup();
  62594. this.backoff.reset();
  62595. this.readyState = 'closed';
  62596. this.emit('close', reason);
  62597. if (this._reconnection && !this.skipReconnect) {
  62598. this.reconnect();
  62599. }
  62600. };
  62601. /**
  62602. * Attempt a reconnection.
  62603. *
  62604. * @api private
  62605. */
  62606. Manager.prototype.reconnect = function () {
  62607. if (this.reconnecting || this.skipReconnect) return this;
  62608. var self = this;
  62609. if (this.backoff.attempts >= this._reconnectionAttempts) {
  62610. debug('reconnect failed');
  62611. this.backoff.reset();
  62612. this.emitAll('reconnect_failed');
  62613. this.reconnecting = false;
  62614. } else {
  62615. var delay = this.backoff.duration();
  62616. debug('will wait %dms before reconnect attempt', delay);
  62617. this.reconnecting = true;
  62618. var timer = setTimeout(function () {
  62619. if (self.skipReconnect) return;
  62620. debug('attempting reconnect');
  62621. self.emitAll('reconnect_attempt', self.backoff.attempts);
  62622. self.emitAll('reconnecting', self.backoff.attempts);
  62623. // check again for the case socket closed in above events
  62624. if (self.skipReconnect) return;
  62625. self.open(function (err) {
  62626. if (err) {
  62627. debug('reconnect attempt error');
  62628. self.reconnecting = false;
  62629. self.reconnect();
  62630. self.emitAll('reconnect_error', err.data);
  62631. } else {
  62632. debug('reconnect success');
  62633. self.onreconnect();
  62634. }
  62635. });
  62636. }, delay);
  62637. this.subs.push({
  62638. destroy: function () {
  62639. clearTimeout(timer);
  62640. }
  62641. });
  62642. }
  62643. };
  62644. /**
  62645. * Called upon successful reconnect.
  62646. *
  62647. * @api private
  62648. */
  62649. Manager.prototype.onreconnect = function () {
  62650. var attempt = this.backoff.attempts;
  62651. this.reconnecting = false;
  62652. this.backoff.reset();
  62653. this.updateSocketIds();
  62654. this.emitAll('reconnect', attempt);
  62655. };
  62656. /***/ }),
  62657. /***/ "./node_modules/socket.io-client/lib/on.js":
  62658. /*!*************************************************!*\
  62659. !*** ./node_modules/socket.io-client/lib/on.js ***!
  62660. \*************************************************/
  62661. /*! no static exports found */
  62662. /***/ (function(module, exports) {
  62663. /**
  62664. * Module exports.
  62665. */
  62666. module.exports = on;
  62667. /**
  62668. * Helper for subscriptions.
  62669. *
  62670. * @param {Object|EventEmitter} obj with `Emitter` mixin or `EventEmitter`
  62671. * @param {String} event name
  62672. * @param {Function} callback
  62673. * @api public
  62674. */
  62675. function on (obj, ev, fn) {
  62676. obj.on(ev, fn);
  62677. return {
  62678. destroy: function () {
  62679. obj.removeListener(ev, fn);
  62680. }
  62681. };
  62682. }
  62683. /***/ }),
  62684. /***/ "./node_modules/socket.io-client/lib/socket.js":
  62685. /*!*****************************************************!*\
  62686. !*** ./node_modules/socket.io-client/lib/socket.js ***!
  62687. \*****************************************************/
  62688. /*! no static exports found */
  62689. /***/ (function(module, exports, __webpack_require__) {
  62690. /**
  62691. * Module dependencies.
  62692. */
  62693. var parser = __webpack_require__(/*! socket.io-parser */ "./node_modules/socket.io-parser/index.js");
  62694. var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/socket.io-client/node_modules/component-emitter/index.js");
  62695. var toArray = __webpack_require__(/*! to-array */ "./node_modules/to-array/index.js");
  62696. var on = __webpack_require__(/*! ./on */ "./node_modules/socket.io-client/lib/on.js");
  62697. var bind = __webpack_require__(/*! component-bind */ "./node_modules/component-bind/index.js");
  62698. var debug = __webpack_require__(/*! debug */ "./node_modules/socket.io-client/node_modules/debug/src/browser.js")('socket.io-client:socket');
  62699. var parseqs = __webpack_require__(/*! parseqs */ "./node_modules/parseqs/index.js");
  62700. var hasBin = __webpack_require__(/*! has-binary2 */ "./node_modules/has-binary2/index.js");
  62701. /**
  62702. * Module exports.
  62703. */
  62704. module.exports = exports = Socket;
  62705. /**
  62706. * Internal events (blacklisted).
  62707. * These events can't be emitted by the user.
  62708. *
  62709. * @api private
  62710. */
  62711. var events = {
  62712. connect: 1,
  62713. connect_error: 1,
  62714. connect_timeout: 1,
  62715. connecting: 1,
  62716. disconnect: 1,
  62717. error: 1,
  62718. reconnect: 1,
  62719. reconnect_attempt: 1,
  62720. reconnect_failed: 1,
  62721. reconnect_error: 1,
  62722. reconnecting: 1,
  62723. ping: 1,
  62724. pong: 1
  62725. };
  62726. /**
  62727. * Shortcut to `Emitter#emit`.
  62728. */
  62729. var emit = Emitter.prototype.emit;
  62730. /**
  62731. * `Socket` constructor.
  62732. *
  62733. * @api public
  62734. */
  62735. function Socket (io, nsp, opts) {
  62736. this.io = io;
  62737. this.nsp = nsp;
  62738. this.json = this; // compat
  62739. this.ids = 0;
  62740. this.acks = {};
  62741. this.receiveBuffer = [];
  62742. this.sendBuffer = [];
  62743. this.connected = false;
  62744. this.disconnected = true;
  62745. this.flags = {};
  62746. if (opts && opts.query) {
  62747. this.query = opts.query;
  62748. }
  62749. if (this.io.autoConnect) this.open();
  62750. }
  62751. /**
  62752. * Mix in `Emitter`.
  62753. */
  62754. Emitter(Socket.prototype);
  62755. /**
  62756. * Subscribe to open, close and packet events
  62757. *
  62758. * @api private
  62759. */
  62760. Socket.prototype.subEvents = function () {
  62761. if (this.subs) return;
  62762. var io = this.io;
  62763. this.subs = [
  62764. on(io, 'open', bind(this, 'onopen')),
  62765. on(io, 'packet', bind(this, 'onpacket')),
  62766. on(io, 'close', bind(this, 'onclose'))
  62767. ];
  62768. };
  62769. /**
  62770. * "Opens" the socket.
  62771. *
  62772. * @api public
  62773. */
  62774. Socket.prototype.open =
  62775. Socket.prototype.connect = function () {
  62776. if (this.connected) return this;
  62777. this.subEvents();
  62778. this.io.open(); // ensure open
  62779. if ('open' === this.io.readyState) this.onopen();
  62780. this.emit('connecting');
  62781. return this;
  62782. };
  62783. /**
  62784. * Sends a `message` event.
  62785. *
  62786. * @return {Socket} self
  62787. * @api public
  62788. */
  62789. Socket.prototype.send = function () {
  62790. var args = toArray(arguments);
  62791. args.unshift('message');
  62792. this.emit.apply(this, args);
  62793. return this;
  62794. };
  62795. /**
  62796. * Override `emit`.
  62797. * If the event is in `events`, it's emitted normally.
  62798. *
  62799. * @param {String} event name
  62800. * @return {Socket} self
  62801. * @api public
  62802. */
  62803. Socket.prototype.emit = function (ev) {
  62804. if (events.hasOwnProperty(ev)) {
  62805. emit.apply(this, arguments);
  62806. return this;
  62807. }
  62808. var args = toArray(arguments);
  62809. var packet = {
  62810. type: (this.flags.binary !== undefined ? this.flags.binary : hasBin(args)) ? parser.BINARY_EVENT : parser.EVENT,
  62811. data: args
  62812. };
  62813. packet.options = {};
  62814. packet.options.compress = !this.flags || false !== this.flags.compress;
  62815. // event ack callback
  62816. if ('function' === typeof args[args.length - 1]) {
  62817. debug('emitting packet with ack id %d', this.ids);
  62818. this.acks[this.ids] = args.pop();
  62819. packet.id = this.ids++;
  62820. }
  62821. if (this.connected) {
  62822. this.packet(packet);
  62823. } else {
  62824. this.sendBuffer.push(packet);
  62825. }
  62826. this.flags = {};
  62827. return this;
  62828. };
  62829. /**
  62830. * Sends a packet.
  62831. *
  62832. * @param {Object} packet
  62833. * @api private
  62834. */
  62835. Socket.prototype.packet = function (packet) {
  62836. packet.nsp = this.nsp;
  62837. this.io.packet(packet);
  62838. };
  62839. /**
  62840. * Called upon engine `open`.
  62841. *
  62842. * @api private
  62843. */
  62844. Socket.prototype.onopen = function () {
  62845. debug('transport is open - connecting');
  62846. // write connect packet if necessary
  62847. if ('/' !== this.nsp) {
  62848. if (this.query) {
  62849. var query = typeof this.query === 'object' ? parseqs.encode(this.query) : this.query;
  62850. debug('sending connect packet with query %s', query);
  62851. this.packet({type: parser.CONNECT, query: query});
  62852. } else {
  62853. this.packet({type: parser.CONNECT});
  62854. }
  62855. }
  62856. };
  62857. /**
  62858. * Called upon engine `close`.
  62859. *
  62860. * @param {String} reason
  62861. * @api private
  62862. */
  62863. Socket.prototype.onclose = function (reason) {
  62864. debug('close (%s)', reason);
  62865. this.connected = false;
  62866. this.disconnected = true;
  62867. delete this.id;
  62868. this.emit('disconnect', reason);
  62869. };
  62870. /**
  62871. * Called with socket packet.
  62872. *
  62873. * @param {Object} packet
  62874. * @api private
  62875. */
  62876. Socket.prototype.onpacket = function (packet) {
  62877. var sameNamespace = packet.nsp === this.nsp;
  62878. var rootNamespaceError = packet.type === parser.ERROR && packet.nsp === '/';
  62879. if (!sameNamespace && !rootNamespaceError) return;
  62880. switch (packet.type) {
  62881. case parser.CONNECT:
  62882. this.onconnect();
  62883. break;
  62884. case parser.EVENT:
  62885. this.onevent(packet);
  62886. break;
  62887. case parser.BINARY_EVENT:
  62888. this.onevent(packet);
  62889. break;
  62890. case parser.ACK:
  62891. this.onack(packet);
  62892. break;
  62893. case parser.BINARY_ACK:
  62894. this.onack(packet);
  62895. break;
  62896. case parser.DISCONNECT:
  62897. this.ondisconnect();
  62898. break;
  62899. case parser.ERROR:
  62900. this.emit('error', packet.data);
  62901. break;
  62902. }
  62903. };
  62904. /**
  62905. * Called upon a server event.
  62906. *
  62907. * @param {Object} packet
  62908. * @api private
  62909. */
  62910. Socket.prototype.onevent = function (packet) {
  62911. var args = packet.data || [];
  62912. debug('emitting event %j', args);
  62913. if (null != packet.id) {
  62914. debug('attaching ack callback to event');
  62915. args.push(this.ack(packet.id));
  62916. }
  62917. if (this.connected) {
  62918. emit.apply(this, args);
  62919. } else {
  62920. this.receiveBuffer.push(args);
  62921. }
  62922. };
  62923. /**
  62924. * Produces an ack callback to emit with an event.
  62925. *
  62926. * @api private
  62927. */
  62928. Socket.prototype.ack = function (id) {
  62929. var self = this;
  62930. var sent = false;
  62931. return function () {
  62932. // prevent double callbacks
  62933. if (sent) return;
  62934. sent = true;
  62935. var args = toArray(arguments);
  62936. debug('sending ack %j', args);
  62937. self.packet({
  62938. type: hasBin(args) ? parser.BINARY_ACK : parser.ACK,
  62939. id: id,
  62940. data: args
  62941. });
  62942. };
  62943. };
  62944. /**
  62945. * Called upon a server acknowlegement.
  62946. *
  62947. * @param {Object} packet
  62948. * @api private
  62949. */
  62950. Socket.prototype.onack = function (packet) {
  62951. var ack = this.acks[packet.id];
  62952. if ('function' === typeof ack) {
  62953. debug('calling ack %s with %j', packet.id, packet.data);
  62954. ack.apply(this, packet.data);
  62955. delete this.acks[packet.id];
  62956. } else {
  62957. debug('bad ack %s', packet.id);
  62958. }
  62959. };
  62960. /**
  62961. * Called upon server connect.
  62962. *
  62963. * @api private
  62964. */
  62965. Socket.prototype.onconnect = function () {
  62966. this.connected = true;
  62967. this.disconnected = false;
  62968. this.emit('connect');
  62969. this.emitBuffered();
  62970. };
  62971. /**
  62972. * Emit buffered events (received and emitted).
  62973. *
  62974. * @api private
  62975. */
  62976. Socket.prototype.emitBuffered = function () {
  62977. var i;
  62978. for (i = 0; i < this.receiveBuffer.length; i++) {
  62979. emit.apply(this, this.receiveBuffer[i]);
  62980. }
  62981. this.receiveBuffer = [];
  62982. for (i = 0; i < this.sendBuffer.length; i++) {
  62983. this.packet(this.sendBuffer[i]);
  62984. }
  62985. this.sendBuffer = [];
  62986. };
  62987. /**
  62988. * Called upon server disconnect.
  62989. *
  62990. * @api private
  62991. */
  62992. Socket.prototype.ondisconnect = function () {
  62993. debug('server disconnect (%s)', this.nsp);
  62994. this.destroy();
  62995. this.onclose('io server disconnect');
  62996. };
  62997. /**
  62998. * Called upon forced client/server side disconnections,
  62999. * this method ensures the manager stops tracking us and
  63000. * that reconnections don't get triggered for this.
  63001. *
  63002. * @api private.
  63003. */
  63004. Socket.prototype.destroy = function () {
  63005. if (this.subs) {
  63006. // clean subscriptions to avoid reconnections
  63007. for (var i = 0; i < this.subs.length; i++) {
  63008. this.subs[i].destroy();
  63009. }
  63010. this.subs = null;
  63011. }
  63012. this.io.destroy(this);
  63013. };
  63014. /**
  63015. * Disconnects the socket manually.
  63016. *
  63017. * @return {Socket} self
  63018. * @api public
  63019. */
  63020. Socket.prototype.close =
  63021. Socket.prototype.disconnect = function () {
  63022. if (this.connected) {
  63023. debug('performing disconnect (%s)', this.nsp);
  63024. this.packet({ type: parser.DISCONNECT });
  63025. }
  63026. // remove socket from pool
  63027. this.destroy();
  63028. if (this.connected) {
  63029. // fire events
  63030. this.onclose('io client disconnect');
  63031. }
  63032. return this;
  63033. };
  63034. /**
  63035. * Sets the compress flag.
  63036. *
  63037. * @param {Boolean} if `true`, compresses the sending data
  63038. * @return {Socket} self
  63039. * @api public
  63040. */
  63041. Socket.prototype.compress = function (compress) {
  63042. this.flags.compress = compress;
  63043. return this;
  63044. };
  63045. /**
  63046. * Sets the binary flag
  63047. *
  63048. * @param {Boolean} whether the emitted data contains binary
  63049. * @return {Socket} self
  63050. * @api public
  63051. */
  63052. Socket.prototype.binary = function (binary) {
  63053. this.flags.binary = binary;
  63054. return this;
  63055. };
  63056. /***/ }),
  63057. /***/ "./node_modules/socket.io-client/lib/url.js":
  63058. /*!**************************************************!*\
  63059. !*** ./node_modules/socket.io-client/lib/url.js ***!
  63060. \**************************************************/
  63061. /*! no static exports found */
  63062. /***/ (function(module, exports, __webpack_require__) {
  63063. /**
  63064. * Module dependencies.
  63065. */
  63066. var parseuri = __webpack_require__(/*! parseuri */ "./node_modules/parseuri/index.js");
  63067. var debug = __webpack_require__(/*! debug */ "./node_modules/socket.io-client/node_modules/debug/src/browser.js")('socket.io-client:url');
  63068. /**
  63069. * Module exports.
  63070. */
  63071. module.exports = url;
  63072. /**
  63073. * URL parser.
  63074. *
  63075. * @param {String} url
  63076. * @param {Object} An object meant to mimic window.location.
  63077. * Defaults to window.location.
  63078. * @api public
  63079. */
  63080. function url (uri, loc) {
  63081. var obj = uri;
  63082. // default to window.location
  63083. loc = loc || (typeof location !== 'undefined' && location);
  63084. if (null == uri) uri = loc.protocol + '//' + loc.host;
  63085. // relative path support
  63086. if ('string' === typeof uri) {
  63087. if ('/' === uri.charAt(0)) {
  63088. if ('/' === uri.charAt(1)) {
  63089. uri = loc.protocol + uri;
  63090. } else {
  63091. uri = loc.host + uri;
  63092. }
  63093. }
  63094. if (!/^(https?|wss?):\/\//.test(uri)) {
  63095. debug('protocol-less url %s', uri);
  63096. if ('undefined' !== typeof loc) {
  63097. uri = loc.protocol + '//' + uri;
  63098. } else {
  63099. uri = 'https://' + uri;
  63100. }
  63101. }
  63102. // parse
  63103. debug('parse %s', uri);
  63104. obj = parseuri(uri);
  63105. }
  63106. // make sure we treat `localhost:80` and `localhost` equally
  63107. if (!obj.port) {
  63108. if (/^(http|ws)$/.test(obj.protocol)) {
  63109. obj.port = '80';
  63110. } else if (/^(http|ws)s$/.test(obj.protocol)) {
  63111. obj.port = '443';
  63112. }
  63113. }
  63114. obj.path = obj.path || '/';
  63115. var ipv6 = obj.host.indexOf(':') !== -1;
  63116. var host = ipv6 ? '[' + obj.host + ']' : obj.host;
  63117. // define unique id
  63118. obj.id = obj.protocol + '://' + host + ':' + obj.port;
  63119. // define href
  63120. obj.href = obj.protocol + '://' + host + (loc && loc.port === obj.port ? '' : (':' + obj.port));
  63121. return obj;
  63122. }
  63123. /***/ }),
  63124. /***/ "./node_modules/socket.io-client/node_modules/component-emitter/index.js":
  63125. /*!*******************************************************************************!*\
  63126. !*** ./node_modules/socket.io-client/node_modules/component-emitter/index.js ***!
  63127. \*******************************************************************************/
  63128. /*! no static exports found */
  63129. /***/ (function(module, exports, __webpack_require__) {
  63130. /**
  63131. * Expose `Emitter`.
  63132. */
  63133. if (true) {
  63134. module.exports = Emitter;
  63135. }
  63136. /**
  63137. * Initialize a new `Emitter`.
  63138. *
  63139. * @api public
  63140. */
  63141. function Emitter(obj) {
  63142. if (obj) return mixin(obj);
  63143. };
  63144. /**
  63145. * Mixin the emitter properties.
  63146. *
  63147. * @param {Object} obj
  63148. * @return {Object}
  63149. * @api private
  63150. */
  63151. function mixin(obj) {
  63152. for (var key in Emitter.prototype) {
  63153. obj[key] = Emitter.prototype[key];
  63154. }
  63155. return obj;
  63156. }
  63157. /**
  63158. * Listen on the given `event` with `fn`.
  63159. *
  63160. * @param {String} event
  63161. * @param {Function} fn
  63162. * @return {Emitter}
  63163. * @api public
  63164. */
  63165. Emitter.prototype.on =
  63166. Emitter.prototype.addEventListener = function(event, fn){
  63167. this._callbacks = this._callbacks || {};
  63168. (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
  63169. .push(fn);
  63170. return this;
  63171. };
  63172. /**
  63173. * Adds an `event` listener that will be invoked a single
  63174. * time then automatically removed.
  63175. *
  63176. * @param {String} event
  63177. * @param {Function} fn
  63178. * @return {Emitter}
  63179. * @api public
  63180. */
  63181. Emitter.prototype.once = function(event, fn){
  63182. function on() {
  63183. this.off(event, on);
  63184. fn.apply(this, arguments);
  63185. }
  63186. on.fn = fn;
  63187. this.on(event, on);
  63188. return this;
  63189. };
  63190. /**
  63191. * Remove the given callback for `event` or all
  63192. * registered callbacks.
  63193. *
  63194. * @param {String} event
  63195. * @param {Function} fn
  63196. * @return {Emitter}
  63197. * @api public
  63198. */
  63199. Emitter.prototype.off =
  63200. Emitter.prototype.removeListener =
  63201. Emitter.prototype.removeAllListeners =
  63202. Emitter.prototype.removeEventListener = function(event, fn){
  63203. this._callbacks = this._callbacks || {};
  63204. // all
  63205. if (0 == arguments.length) {
  63206. this._callbacks = {};
  63207. return this;
  63208. }
  63209. // specific event
  63210. var callbacks = this._callbacks['$' + event];
  63211. if (!callbacks) return this;
  63212. // remove all handlers
  63213. if (1 == arguments.length) {
  63214. delete this._callbacks['$' + event];
  63215. return this;
  63216. }
  63217. // remove specific handler
  63218. var cb;
  63219. for (var i = 0; i < callbacks.length; i++) {
  63220. cb = callbacks[i];
  63221. if (cb === fn || cb.fn === fn) {
  63222. callbacks.splice(i, 1);
  63223. break;
  63224. }
  63225. }
  63226. return this;
  63227. };
  63228. /**
  63229. * Emit `event` with the given args.
  63230. *
  63231. * @param {String} event
  63232. * @param {Mixed} ...
  63233. * @return {Emitter}
  63234. */
  63235. Emitter.prototype.emit = function(event){
  63236. this._callbacks = this._callbacks || {};
  63237. var args = [].slice.call(arguments, 1)
  63238. , callbacks = this._callbacks['$' + event];
  63239. if (callbacks) {
  63240. callbacks = callbacks.slice(0);
  63241. for (var i = 0, len = callbacks.length; i < len; ++i) {
  63242. callbacks[i].apply(this, args);
  63243. }
  63244. }
  63245. return this;
  63246. };
  63247. /**
  63248. * Return array of callbacks for `event`.
  63249. *
  63250. * @param {String} event
  63251. * @return {Array}
  63252. * @api public
  63253. */
  63254. Emitter.prototype.listeners = function(event){
  63255. this._callbacks = this._callbacks || {};
  63256. return this._callbacks['$' + event] || [];
  63257. };
  63258. /**
  63259. * Check if this emitter has `event` handlers.
  63260. *
  63261. * @param {String} event
  63262. * @return {Boolean}
  63263. * @api public
  63264. */
  63265. Emitter.prototype.hasListeners = function(event){
  63266. return !! this.listeners(event).length;
  63267. };
  63268. /***/ }),
  63269. /***/ "./node_modules/socket.io-client/node_modules/debug/src/browser.js":
  63270. /*!*************************************************************************!*\
  63271. !*** ./node_modules/socket.io-client/node_modules/debug/src/browser.js ***!
  63272. \*************************************************************************/
  63273. /*! no static exports found */
  63274. /***/ (function(module, exports, __webpack_require__) {
  63275. /* WEBPACK VAR INJECTION */(function(process) {/* eslint-env browser */
  63276. /**
  63277. * This is the web browser implementation of `debug()`.
  63278. */
  63279. exports.log = log;
  63280. exports.formatArgs = formatArgs;
  63281. exports.save = save;
  63282. exports.load = load;
  63283. exports.useColors = useColors;
  63284. exports.storage = localstorage();
  63285. /**
  63286. * Colors.
  63287. */
  63288. exports.colors = [
  63289. '#0000CC',
  63290. '#0000FF',
  63291. '#0033CC',
  63292. '#0033FF',
  63293. '#0066CC',
  63294. '#0066FF',
  63295. '#0099CC',
  63296. '#0099FF',
  63297. '#00CC00',
  63298. '#00CC33',
  63299. '#00CC66',
  63300. '#00CC99',
  63301. '#00CCCC',
  63302. '#00CCFF',
  63303. '#3300CC',
  63304. '#3300FF',
  63305. '#3333CC',
  63306. '#3333FF',
  63307. '#3366CC',
  63308. '#3366FF',
  63309. '#3399CC',
  63310. '#3399FF',
  63311. '#33CC00',
  63312. '#33CC33',
  63313. '#33CC66',
  63314. '#33CC99',
  63315. '#33CCCC',
  63316. '#33CCFF',
  63317. '#6600CC',
  63318. '#6600FF',
  63319. '#6633CC',
  63320. '#6633FF',
  63321. '#66CC00',
  63322. '#66CC33',
  63323. '#9900CC',
  63324. '#9900FF',
  63325. '#9933CC',
  63326. '#9933FF',
  63327. '#99CC00',
  63328. '#99CC33',
  63329. '#CC0000',
  63330. '#CC0033',
  63331. '#CC0066',
  63332. '#CC0099',
  63333. '#CC00CC',
  63334. '#CC00FF',
  63335. '#CC3300',
  63336. '#CC3333',
  63337. '#CC3366',
  63338. '#CC3399',
  63339. '#CC33CC',
  63340. '#CC33FF',
  63341. '#CC6600',
  63342. '#CC6633',
  63343. '#CC9900',
  63344. '#CC9933',
  63345. '#CCCC00',
  63346. '#CCCC33',
  63347. '#FF0000',
  63348. '#FF0033',
  63349. '#FF0066',
  63350. '#FF0099',
  63351. '#FF00CC',
  63352. '#FF00FF',
  63353. '#FF3300',
  63354. '#FF3333',
  63355. '#FF3366',
  63356. '#FF3399',
  63357. '#FF33CC',
  63358. '#FF33FF',
  63359. '#FF6600',
  63360. '#FF6633',
  63361. '#FF9900',
  63362. '#FF9933',
  63363. '#FFCC00',
  63364. '#FFCC33'
  63365. ];
  63366. /**
  63367. * Currently only WebKit-based Web Inspectors, Firefox >= v31,
  63368. * and the Firebug extension (any Firefox version) are known
  63369. * to support "%c" CSS customizations.
  63370. *
  63371. * TODO: add a `localStorage` variable to explicitly enable/disable colors
  63372. */
  63373. // eslint-disable-next-line complexity
  63374. function useColors() {
  63375. // NB: In an Electron preload script, document will be defined but not fully
  63376. // initialized. Since we know we're in Chrome, we'll just detect this case
  63377. // explicitly
  63378. if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
  63379. return true;
  63380. }
  63381. // Internet Explorer and Edge do not support colors.
  63382. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
  63383. return false;
  63384. }
  63385. // Is webkit? http://stackoverflow.com/a/16459606/376773
  63386. // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  63387. return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
  63388. // Is firebug? http://stackoverflow.com/a/398120/376773
  63389. (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
  63390. // Is firefox >= v31?
  63391. // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
  63392. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
  63393. // Double check webkit in userAgent just in case we are in a worker
  63394. (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
  63395. }
  63396. /**
  63397. * Colorize log arguments if enabled.
  63398. *
  63399. * @api public
  63400. */
  63401. function formatArgs(args) {
  63402. args[0] = (this.useColors ? '%c' : '') +
  63403. this.namespace +
  63404. (this.useColors ? ' %c' : ' ') +
  63405. args[0] +
  63406. (this.useColors ? '%c ' : ' ') +
  63407. '+' + module.exports.humanize(this.diff);
  63408. if (!this.useColors) {
  63409. return;
  63410. }
  63411. const c = 'color: ' + this.color;
  63412. args.splice(1, 0, c, 'color: inherit');
  63413. // The final "%c" is somewhat tricky, because there could be other
  63414. // arguments passed either before or after the %c, so we need to
  63415. // figure out the correct index to insert the CSS into
  63416. let index = 0;
  63417. let lastC = 0;
  63418. args[0].replace(/%[a-zA-Z%]/g, match => {
  63419. if (match === '%%') {
  63420. return;
  63421. }
  63422. index++;
  63423. if (match === '%c') {
  63424. // We only are interested in the *last* %c
  63425. // (the user may have provided their own)
  63426. lastC = index;
  63427. }
  63428. });
  63429. args.splice(lastC, 0, c);
  63430. }
  63431. /**
  63432. * Invokes `console.log()` when available.
  63433. * No-op when `console.log` is not a "function".
  63434. *
  63435. * @api public
  63436. */
  63437. function log(...args) {
  63438. // This hackery is required for IE8/9, where
  63439. // the `console.log` function doesn't have 'apply'
  63440. return typeof console === 'object' &&
  63441. console.log &&
  63442. console.log(...args);
  63443. }
  63444. /**
  63445. * Save `namespaces`.
  63446. *
  63447. * @param {String} namespaces
  63448. * @api private
  63449. */
  63450. function save(namespaces) {
  63451. try {
  63452. if (namespaces) {
  63453. exports.storage.setItem('debug', namespaces);
  63454. } else {
  63455. exports.storage.removeItem('debug');
  63456. }
  63457. } catch (error) {
  63458. // Swallow
  63459. // XXX (@Qix-) should we be logging these?
  63460. }
  63461. }
  63462. /**
  63463. * Load `namespaces`.
  63464. *
  63465. * @return {String} returns the previously persisted debug modes
  63466. * @api private
  63467. */
  63468. function load() {
  63469. let r;
  63470. try {
  63471. r = exports.storage.getItem('debug');
  63472. } catch (error) {
  63473. // Swallow
  63474. // XXX (@Qix-) should we be logging these?
  63475. }
  63476. // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  63477. if (!r && typeof process !== 'undefined' && 'env' in process) {
  63478. r = process.env.DEBUG;
  63479. }
  63480. return r;
  63481. }
  63482. /**
  63483. * Localstorage attempts to return the localstorage.
  63484. *
  63485. * This is necessary because safari throws
  63486. * when a user disables cookies/localstorage
  63487. * and you attempt to access it.
  63488. *
  63489. * @return {LocalStorage}
  63490. * @api private
  63491. */
  63492. function localstorage() {
  63493. try {
  63494. // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
  63495. // The Browser also has localStorage in the global context.
  63496. return localStorage;
  63497. } catch (error) {
  63498. // Swallow
  63499. // XXX (@Qix-) should we be logging these?
  63500. }
  63501. }
  63502. module.exports = __webpack_require__(/*! ./common */ "./node_modules/socket.io-client/node_modules/debug/src/common.js")(exports);
  63503. const {formatters} = module.exports;
  63504. /**
  63505. * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
  63506. */
  63507. formatters.j = function (v) {
  63508. try {
  63509. return JSON.stringify(v);
  63510. } catch (error) {
  63511. return '[UnexpectedJSONParseError]: ' + error.message;
  63512. }
  63513. };
  63514. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../process/browser.js */ "./node_modules/process/browser.js")))
  63515. /***/ }),
  63516. /***/ "./node_modules/socket.io-client/node_modules/debug/src/common.js":
  63517. /*!************************************************************************!*\
  63518. !*** ./node_modules/socket.io-client/node_modules/debug/src/common.js ***!
  63519. \************************************************************************/
  63520. /*! no static exports found */
  63521. /***/ (function(module, exports, __webpack_require__) {
  63522. /**
  63523. * This is the common logic for both the Node.js and web browser
  63524. * implementations of `debug()`.
  63525. */
  63526. function setup(env) {
  63527. createDebug.debug = createDebug;
  63528. createDebug.default = createDebug;
  63529. createDebug.coerce = coerce;
  63530. createDebug.disable = disable;
  63531. createDebug.enable = enable;
  63532. createDebug.enabled = enabled;
  63533. createDebug.humanize = __webpack_require__(/*! ms */ "./node_modules/socket.io-client/node_modules/ms/index.js");
  63534. Object.keys(env).forEach(key => {
  63535. createDebug[key] = env[key];
  63536. });
  63537. /**
  63538. * Active `debug` instances.
  63539. */
  63540. createDebug.instances = [];
  63541. /**
  63542. * The currently active debug mode names, and names to skip.
  63543. */
  63544. createDebug.names = [];
  63545. createDebug.skips = [];
  63546. /**
  63547. * Map of special "%n" handling functions, for the debug "format" argument.
  63548. *
  63549. * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
  63550. */
  63551. createDebug.formatters = {};
  63552. /**
  63553. * Selects a color for a debug namespace
  63554. * @param {String} namespace The namespace string for the for the debug instance to be colored
  63555. * @return {Number|String} An ANSI color code for the given namespace
  63556. * @api private
  63557. */
  63558. function selectColor(namespace) {
  63559. let hash = 0;
  63560. for (let i = 0; i < namespace.length; i++) {
  63561. hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
  63562. hash |= 0; // Convert to 32bit integer
  63563. }
  63564. return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
  63565. }
  63566. createDebug.selectColor = selectColor;
  63567. /**
  63568. * Create a debugger with the given `namespace`.
  63569. *
  63570. * @param {String} namespace
  63571. * @return {Function}
  63572. * @api public
  63573. */
  63574. function createDebug(namespace) {
  63575. let prevTime;
  63576. function debug(...args) {
  63577. // Disabled?
  63578. if (!debug.enabled) {
  63579. return;
  63580. }
  63581. const self = debug;
  63582. // Set `diff` timestamp
  63583. const curr = Number(new Date());
  63584. const ms = curr - (prevTime || curr);
  63585. self.diff = ms;
  63586. self.prev = prevTime;
  63587. self.curr = curr;
  63588. prevTime = curr;
  63589. args[0] = createDebug.coerce(args[0]);
  63590. if (typeof args[0] !== 'string') {
  63591. // Anything else let's inspect with %O
  63592. args.unshift('%O');
  63593. }
  63594. // Apply any `formatters` transformations
  63595. let index = 0;
  63596. args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
  63597. // If we encounter an escaped % then don't increase the array index
  63598. if (match === '%%') {
  63599. return match;
  63600. }
  63601. index++;
  63602. const formatter = createDebug.formatters[format];
  63603. if (typeof formatter === 'function') {
  63604. const val = args[index];
  63605. match = formatter.call(self, val);
  63606. // Now we need to remove `args[index]` since it's inlined in the `format`
  63607. args.splice(index, 1);
  63608. index--;
  63609. }
  63610. return match;
  63611. });
  63612. // Apply env-specific formatting (colors, etc.)
  63613. createDebug.formatArgs.call(self, args);
  63614. const logFn = self.log || createDebug.log;
  63615. logFn.apply(self, args);
  63616. }
  63617. debug.namespace = namespace;
  63618. debug.enabled = createDebug.enabled(namespace);
  63619. debug.useColors = createDebug.useColors();
  63620. debug.color = selectColor(namespace);
  63621. debug.destroy = destroy;
  63622. debug.extend = extend;
  63623. // Debug.formatArgs = formatArgs;
  63624. // debug.rawLog = rawLog;
  63625. // env-specific initialization logic for debug instances
  63626. if (typeof createDebug.init === 'function') {
  63627. createDebug.init(debug);
  63628. }
  63629. createDebug.instances.push(debug);
  63630. return debug;
  63631. }
  63632. function destroy() {
  63633. const index = createDebug.instances.indexOf(this);
  63634. if (index !== -1) {
  63635. createDebug.instances.splice(index, 1);
  63636. return true;
  63637. }
  63638. return false;
  63639. }
  63640. function extend(namespace, delimiter) {
  63641. const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
  63642. newDebug.log = this.log;
  63643. return newDebug;
  63644. }
  63645. /**
  63646. * Enables a debug mode by namespaces. This can include modes
  63647. * separated by a colon and wildcards.
  63648. *
  63649. * @param {String} namespaces
  63650. * @api public
  63651. */
  63652. function enable(namespaces) {
  63653. createDebug.save(namespaces);
  63654. createDebug.names = [];
  63655. createDebug.skips = [];
  63656. let i;
  63657. const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
  63658. const len = split.length;
  63659. for (i = 0; i < len; i++) {
  63660. if (!split[i]) {
  63661. // ignore empty strings
  63662. continue;
  63663. }
  63664. namespaces = split[i].replace(/\*/g, '.*?');
  63665. if (namespaces[0] === '-') {
  63666. createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
  63667. } else {
  63668. createDebug.names.push(new RegExp('^' + namespaces + '$'));
  63669. }
  63670. }
  63671. for (i = 0; i < createDebug.instances.length; i++) {
  63672. const instance = createDebug.instances[i];
  63673. instance.enabled = createDebug.enabled(instance.namespace);
  63674. }
  63675. }
  63676. /**
  63677. * Disable debug output.
  63678. *
  63679. * @return {String} namespaces
  63680. * @api public
  63681. */
  63682. function disable() {
  63683. const namespaces = [
  63684. ...createDebug.names.map(toNamespace),
  63685. ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
  63686. ].join(',');
  63687. createDebug.enable('');
  63688. return namespaces;
  63689. }
  63690. /**
  63691. * Returns true if the given mode name is enabled, false otherwise.
  63692. *
  63693. * @param {String} name
  63694. * @return {Boolean}
  63695. * @api public
  63696. */
  63697. function enabled(name) {
  63698. if (name[name.length - 1] === '*') {
  63699. return true;
  63700. }
  63701. let i;
  63702. let len;
  63703. for (i = 0, len = createDebug.skips.length; i < len; i++) {
  63704. if (createDebug.skips[i].test(name)) {
  63705. return false;
  63706. }
  63707. }
  63708. for (i = 0, len = createDebug.names.length; i < len; i++) {
  63709. if (createDebug.names[i].test(name)) {
  63710. return true;
  63711. }
  63712. }
  63713. return false;
  63714. }
  63715. /**
  63716. * Convert regexp to namespace
  63717. *
  63718. * @param {RegExp} regxep
  63719. * @return {String} namespace
  63720. * @api private
  63721. */
  63722. function toNamespace(regexp) {
  63723. return regexp.toString()
  63724. .substring(2, regexp.toString().length - 2)
  63725. .replace(/\.\*\?$/, '*');
  63726. }
  63727. /**
  63728. * Coerce `val`.
  63729. *
  63730. * @param {Mixed} val
  63731. * @return {Mixed}
  63732. * @api private
  63733. */
  63734. function coerce(val) {
  63735. if (val instanceof Error) {
  63736. return val.stack || val.message;
  63737. }
  63738. return val;
  63739. }
  63740. createDebug.enable(createDebug.load());
  63741. return createDebug;
  63742. }
  63743. module.exports = setup;
  63744. /***/ }),
  63745. /***/ "./node_modules/socket.io-client/node_modules/ms/index.js":
  63746. /*!****************************************************************!*\
  63747. !*** ./node_modules/socket.io-client/node_modules/ms/index.js ***!
  63748. \****************************************************************/
  63749. /*! no static exports found */
  63750. /***/ (function(module, exports) {
  63751. /**
  63752. * Helpers.
  63753. */
  63754. var s = 1000;
  63755. var m = s * 60;
  63756. var h = m * 60;
  63757. var d = h * 24;
  63758. var w = d * 7;
  63759. var y = d * 365.25;
  63760. /**
  63761. * Parse or format the given `val`.
  63762. *
  63763. * Options:
  63764. *
  63765. * - `long` verbose formatting [false]
  63766. *
  63767. * @param {String|Number} val
  63768. * @param {Object} [options]
  63769. * @throws {Error} throw an error if val is not a non-empty string or a number
  63770. * @return {String|Number}
  63771. * @api public
  63772. */
  63773. module.exports = function(val, options) {
  63774. options = options || {};
  63775. var type = typeof val;
  63776. if (type === 'string' && val.length > 0) {
  63777. return parse(val);
  63778. } else if (type === 'number' && isFinite(val)) {
  63779. return options.long ? fmtLong(val) : fmtShort(val);
  63780. }
  63781. throw new Error(
  63782. 'val is not a non-empty string or a valid number. val=' +
  63783. JSON.stringify(val)
  63784. );
  63785. };
  63786. /**
  63787. * Parse the given `str` and return milliseconds.
  63788. *
  63789. * @param {String} str
  63790. * @return {Number}
  63791. * @api private
  63792. */
  63793. function parse(str) {
  63794. str = String(str);
  63795. if (str.length > 100) {
  63796. return;
  63797. }
  63798. var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
  63799. str
  63800. );
  63801. if (!match) {
  63802. return;
  63803. }
  63804. var n = parseFloat(match[1]);
  63805. var type = (match[2] || 'ms').toLowerCase();
  63806. switch (type) {
  63807. case 'years':
  63808. case 'year':
  63809. case 'yrs':
  63810. case 'yr':
  63811. case 'y':
  63812. return n * y;
  63813. case 'weeks':
  63814. case 'week':
  63815. case 'w':
  63816. return n * w;
  63817. case 'days':
  63818. case 'day':
  63819. case 'd':
  63820. return n * d;
  63821. case 'hours':
  63822. case 'hour':
  63823. case 'hrs':
  63824. case 'hr':
  63825. case 'h':
  63826. return n * h;
  63827. case 'minutes':
  63828. case 'minute':
  63829. case 'mins':
  63830. case 'min':
  63831. case 'm':
  63832. return n * m;
  63833. case 'seconds':
  63834. case 'second':
  63835. case 'secs':
  63836. case 'sec':
  63837. case 's':
  63838. return n * s;
  63839. case 'milliseconds':
  63840. case 'millisecond':
  63841. case 'msecs':
  63842. case 'msec':
  63843. case 'ms':
  63844. return n;
  63845. default:
  63846. return undefined;
  63847. }
  63848. }
  63849. /**
  63850. * Short format for `ms`.
  63851. *
  63852. * @param {Number} ms
  63853. * @return {String}
  63854. * @api private
  63855. */
  63856. function fmtShort(ms) {
  63857. var msAbs = Math.abs(ms);
  63858. if (msAbs >= d) {
  63859. return Math.round(ms / d) + 'd';
  63860. }
  63861. if (msAbs >= h) {
  63862. return Math.round(ms / h) + 'h';
  63863. }
  63864. if (msAbs >= m) {
  63865. return Math.round(ms / m) + 'm';
  63866. }
  63867. if (msAbs >= s) {
  63868. return Math.round(ms / s) + 's';
  63869. }
  63870. return ms + 'ms';
  63871. }
  63872. /**
  63873. * Long format for `ms`.
  63874. *
  63875. * @param {Number} ms
  63876. * @return {String}
  63877. * @api private
  63878. */
  63879. function fmtLong(ms) {
  63880. var msAbs = Math.abs(ms);
  63881. if (msAbs >= d) {
  63882. return plural(ms, msAbs, d, 'day');
  63883. }
  63884. if (msAbs >= h) {
  63885. return plural(ms, msAbs, h, 'hour');
  63886. }
  63887. if (msAbs >= m) {
  63888. return plural(ms, msAbs, m, 'minute');
  63889. }
  63890. if (msAbs >= s) {
  63891. return plural(ms, msAbs, s, 'second');
  63892. }
  63893. return ms + ' ms';
  63894. }
  63895. /**
  63896. * Pluralization helper.
  63897. */
  63898. function plural(ms, msAbs, n, name) {
  63899. var isPlural = msAbs >= n * 1.5;
  63900. return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
  63901. }
  63902. /***/ }),
  63903. /***/ "./node_modules/socket.io-parser/binary.js":
  63904. /*!*************************************************!*\
  63905. !*** ./node_modules/socket.io-parser/binary.js ***!
  63906. \*************************************************/
  63907. /*! no static exports found */
  63908. /***/ (function(module, exports, __webpack_require__) {
  63909. /*global Blob,File*/
  63910. /**
  63911. * Module requirements
  63912. */
  63913. var isArray = __webpack_require__(/*! isarray */ "./node_modules/socket.io-parser/node_modules/isarray/index.js");
  63914. var isBuf = __webpack_require__(/*! ./is-buffer */ "./node_modules/socket.io-parser/is-buffer.js");
  63915. var toString = Object.prototype.toString;
  63916. var withNativeBlob = typeof Blob === 'function' || (typeof Blob !== 'undefined' && toString.call(Blob) === '[object BlobConstructor]');
  63917. var withNativeFile = typeof File === 'function' || (typeof File !== 'undefined' && toString.call(File) === '[object FileConstructor]');
  63918. /**
  63919. * Replaces every Buffer | ArrayBuffer in packet with a numbered placeholder.
  63920. * Anything with blobs or files should be fed through removeBlobs before coming
  63921. * here.
  63922. *
  63923. * @param {Object} packet - socket.io event packet
  63924. * @return {Object} with deconstructed packet and list of buffers
  63925. * @api public
  63926. */
  63927. exports.deconstructPacket = function(packet) {
  63928. var buffers = [];
  63929. var packetData = packet.data;
  63930. var pack = packet;
  63931. pack.data = _deconstructPacket(packetData, buffers);
  63932. pack.attachments = buffers.length; // number of binary 'attachments'
  63933. return {packet: pack, buffers: buffers};
  63934. };
  63935. function _deconstructPacket(data, buffers) {
  63936. if (!data) return data;
  63937. if (isBuf(data)) {
  63938. var placeholder = { _placeholder: true, num: buffers.length };
  63939. buffers.push(data);
  63940. return placeholder;
  63941. } else if (isArray(data)) {
  63942. var newData = new Array(data.length);
  63943. for (var i = 0; i < data.length; i++) {
  63944. newData[i] = _deconstructPacket(data[i], buffers);
  63945. }
  63946. return newData;
  63947. } else if (typeof data === 'object' && !(data instanceof Date)) {
  63948. var newData = {};
  63949. for (var key in data) {
  63950. newData[key] = _deconstructPacket(data[key], buffers);
  63951. }
  63952. return newData;
  63953. }
  63954. return data;
  63955. }
  63956. /**
  63957. * Reconstructs a binary packet from its placeholder packet and buffers
  63958. *
  63959. * @param {Object} packet - event packet with placeholders
  63960. * @param {Array} buffers - binary buffers to put in placeholder positions
  63961. * @return {Object} reconstructed packet
  63962. * @api public
  63963. */
  63964. exports.reconstructPacket = function(packet, buffers) {
  63965. packet.data = _reconstructPacket(packet.data, buffers);
  63966. packet.attachments = undefined; // no longer useful
  63967. return packet;
  63968. };
  63969. function _reconstructPacket(data, buffers) {
  63970. if (!data) return data;
  63971. if (data && data._placeholder) {
  63972. return buffers[data.num]; // appropriate buffer (should be natural order anyway)
  63973. } else if (isArray(data)) {
  63974. for (var i = 0; i < data.length; i++) {
  63975. data[i] = _reconstructPacket(data[i], buffers);
  63976. }
  63977. } else if (typeof data === 'object') {
  63978. for (var key in data) {
  63979. data[key] = _reconstructPacket(data[key], buffers);
  63980. }
  63981. }
  63982. return data;
  63983. }
  63984. /**
  63985. * Asynchronously removes Blobs or Files from data via
  63986. * FileReader's readAsArrayBuffer method. Used before encoding
  63987. * data as msgpack. Calls callback with the blobless data.
  63988. *
  63989. * @param {Object} data
  63990. * @param {Function} callback
  63991. * @api private
  63992. */
  63993. exports.removeBlobs = function(data, callback) {
  63994. function _removeBlobs(obj, curKey, containingObject) {
  63995. if (!obj) return obj;
  63996. // convert any blob
  63997. if ((withNativeBlob && obj instanceof Blob) ||
  63998. (withNativeFile && obj instanceof File)) {
  63999. pendingBlobs++;
  64000. // async filereader
  64001. var fileReader = new FileReader();
  64002. fileReader.onload = function() { // this.result == arraybuffer
  64003. if (containingObject) {
  64004. containingObject[curKey] = this.result;
  64005. }
  64006. else {
  64007. bloblessData = this.result;
  64008. }
  64009. // if nothing pending its callback time
  64010. if(! --pendingBlobs) {
  64011. callback(bloblessData);
  64012. }
  64013. };
  64014. fileReader.readAsArrayBuffer(obj); // blob -> arraybuffer
  64015. } else if (isArray(obj)) { // handle array
  64016. for (var i = 0; i < obj.length; i++) {
  64017. _removeBlobs(obj[i], i, obj);
  64018. }
  64019. } else if (typeof obj === 'object' && !isBuf(obj)) { // and object
  64020. for (var key in obj) {
  64021. _removeBlobs(obj[key], key, obj);
  64022. }
  64023. }
  64024. }
  64025. var pendingBlobs = 0;
  64026. var bloblessData = data;
  64027. _removeBlobs(bloblessData);
  64028. if (!pendingBlobs) {
  64029. callback(bloblessData);
  64030. }
  64031. };
  64032. /***/ }),
  64033. /***/ "./node_modules/socket.io-parser/index.js":
  64034. /*!************************************************!*\
  64035. !*** ./node_modules/socket.io-parser/index.js ***!
  64036. \************************************************/
  64037. /*! no static exports found */
  64038. /***/ (function(module, exports, __webpack_require__) {
  64039. /**
  64040. * Module dependencies.
  64041. */
  64042. var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")('socket.io-parser');
  64043. var Emitter = __webpack_require__(/*! component-emitter */ "./node_modules/socket.io-parser/node_modules/component-emitter/index.js");
  64044. var binary = __webpack_require__(/*! ./binary */ "./node_modules/socket.io-parser/binary.js");
  64045. var isArray = __webpack_require__(/*! isarray */ "./node_modules/socket.io-parser/node_modules/isarray/index.js");
  64046. var isBuf = __webpack_require__(/*! ./is-buffer */ "./node_modules/socket.io-parser/is-buffer.js");
  64047. /**
  64048. * Protocol version.
  64049. *
  64050. * @api public
  64051. */
  64052. exports.protocol = 4;
  64053. /**
  64054. * Packet types.
  64055. *
  64056. * @api public
  64057. */
  64058. exports.types = [
  64059. 'CONNECT',
  64060. 'DISCONNECT',
  64061. 'EVENT',
  64062. 'ACK',
  64063. 'ERROR',
  64064. 'BINARY_EVENT',
  64065. 'BINARY_ACK'
  64066. ];
  64067. /**
  64068. * Packet type `connect`.
  64069. *
  64070. * @api public
  64071. */
  64072. exports.CONNECT = 0;
  64073. /**
  64074. * Packet type `disconnect`.
  64075. *
  64076. * @api public
  64077. */
  64078. exports.DISCONNECT = 1;
  64079. /**
  64080. * Packet type `event`.
  64081. *
  64082. * @api public
  64083. */
  64084. exports.EVENT = 2;
  64085. /**
  64086. * Packet type `ack`.
  64087. *
  64088. * @api public
  64089. */
  64090. exports.ACK = 3;
  64091. /**
  64092. * Packet type `error`.
  64093. *
  64094. * @api public
  64095. */
  64096. exports.ERROR = 4;
  64097. /**
  64098. * Packet type 'binary event'
  64099. *
  64100. * @api public
  64101. */
  64102. exports.BINARY_EVENT = 5;
  64103. /**
  64104. * Packet type `binary ack`. For acks with binary arguments.
  64105. *
  64106. * @api public
  64107. */
  64108. exports.BINARY_ACK = 6;
  64109. /**
  64110. * Encoder constructor.
  64111. *
  64112. * @api public
  64113. */
  64114. exports.Encoder = Encoder;
  64115. /**
  64116. * Decoder constructor.
  64117. *
  64118. * @api public
  64119. */
  64120. exports.Decoder = Decoder;
  64121. /**
  64122. * A socket.io Encoder instance
  64123. *
  64124. * @api public
  64125. */
  64126. function Encoder() {}
  64127. var ERROR_PACKET = exports.ERROR + '"encode error"';
  64128. /**
  64129. * Encode a packet as a single string if non-binary, or as a
  64130. * buffer sequence, depending on packet type.
  64131. *
  64132. * @param {Object} obj - packet object
  64133. * @param {Function} callback - function to handle encodings (likely engine.write)
  64134. * @return Calls callback with Array of encodings
  64135. * @api public
  64136. */
  64137. Encoder.prototype.encode = function(obj, callback){
  64138. debug('encoding packet %j', obj);
  64139. if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {
  64140. encodeAsBinary(obj, callback);
  64141. } else {
  64142. var encoding = encodeAsString(obj);
  64143. callback([encoding]);
  64144. }
  64145. };
  64146. /**
  64147. * Encode packet as string.
  64148. *
  64149. * @param {Object} packet
  64150. * @return {String} encoded
  64151. * @api private
  64152. */
  64153. function encodeAsString(obj) {
  64154. // first is type
  64155. var str = '' + obj.type;
  64156. // attachments if we have them
  64157. if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {
  64158. str += obj.attachments + '-';
  64159. }
  64160. // if we have a namespace other than `/`
  64161. // we append it followed by a comma `,`
  64162. if (obj.nsp && '/' !== obj.nsp) {
  64163. str += obj.nsp + ',';
  64164. }
  64165. // immediately followed by the id
  64166. if (null != obj.id) {
  64167. str += obj.id;
  64168. }
  64169. // json data
  64170. if (null != obj.data) {
  64171. var payload = tryStringify(obj.data);
  64172. if (payload !== false) {
  64173. str += payload;
  64174. } else {
  64175. return ERROR_PACKET;
  64176. }
  64177. }
  64178. debug('encoded %j as %s', obj, str);
  64179. return str;
  64180. }
  64181. function tryStringify(str) {
  64182. try {
  64183. return JSON.stringify(str);
  64184. } catch(e){
  64185. return false;
  64186. }
  64187. }
  64188. /**
  64189. * Encode packet as 'buffer sequence' by removing blobs, and
  64190. * deconstructing packet into object with placeholders and
  64191. * a list of buffers.
  64192. *
  64193. * @param {Object} packet
  64194. * @return {Buffer} encoded
  64195. * @api private
  64196. */
  64197. function encodeAsBinary(obj, callback) {
  64198. function writeEncoding(bloblessData) {
  64199. var deconstruction = binary.deconstructPacket(bloblessData);
  64200. var pack = encodeAsString(deconstruction.packet);
  64201. var buffers = deconstruction.buffers;
  64202. buffers.unshift(pack); // add packet info to beginning of data list
  64203. callback(buffers); // write all the buffers
  64204. }
  64205. binary.removeBlobs(obj, writeEncoding);
  64206. }
  64207. /**
  64208. * A socket.io Decoder instance
  64209. *
  64210. * @return {Object} decoder
  64211. * @api public
  64212. */
  64213. function Decoder() {
  64214. this.reconstructor = null;
  64215. }
  64216. /**
  64217. * Mix in `Emitter` with Decoder.
  64218. */
  64219. Emitter(Decoder.prototype);
  64220. /**
  64221. * Decodes an encoded packet string into packet JSON.
  64222. *
  64223. * @param {String} obj - encoded packet
  64224. * @return {Object} packet
  64225. * @api public
  64226. */
  64227. Decoder.prototype.add = function(obj) {
  64228. var packet;
  64229. if (typeof obj === 'string') {
  64230. packet = decodeString(obj);
  64231. if (exports.BINARY_EVENT === packet.type || exports.BINARY_ACK === packet.type) { // binary packet's json
  64232. this.reconstructor = new BinaryReconstructor(packet);
  64233. // no attachments, labeled binary but no binary data to follow
  64234. if (this.reconstructor.reconPack.attachments === 0) {
  64235. this.emit('decoded', packet);
  64236. }
  64237. } else { // non-binary full packet
  64238. this.emit('decoded', packet);
  64239. }
  64240. } else if (isBuf(obj) || obj.base64) { // raw binary data
  64241. if (!this.reconstructor) {
  64242. throw new Error('got binary data when not reconstructing a packet');
  64243. } else {
  64244. packet = this.reconstructor.takeBinaryData(obj);
  64245. if (packet) { // received final buffer
  64246. this.reconstructor = null;
  64247. this.emit('decoded', packet);
  64248. }
  64249. }
  64250. } else {
  64251. throw new Error('Unknown type: ' + obj);
  64252. }
  64253. };
  64254. /**
  64255. * Decode a packet String (JSON data)
  64256. *
  64257. * @param {String} str
  64258. * @return {Object} packet
  64259. * @api private
  64260. */
  64261. function decodeString(str) {
  64262. var i = 0;
  64263. // look up type
  64264. var p = {
  64265. type: Number(str.charAt(0))
  64266. };
  64267. if (null == exports.types[p.type]) {
  64268. return error('unknown packet type ' + p.type);
  64269. }
  64270. // look up attachments if type binary
  64271. if (exports.BINARY_EVENT === p.type || exports.BINARY_ACK === p.type) {
  64272. var buf = '';
  64273. while (str.charAt(++i) !== '-') {
  64274. buf += str.charAt(i);
  64275. if (i == str.length) break;
  64276. }
  64277. if (buf != Number(buf) || str.charAt(i) !== '-') {
  64278. throw new Error('Illegal attachments');
  64279. }
  64280. p.attachments = Number(buf);
  64281. }
  64282. // look up namespace (if any)
  64283. if ('/' === str.charAt(i + 1)) {
  64284. p.nsp = '';
  64285. while (++i) {
  64286. var c = str.charAt(i);
  64287. if (',' === c) break;
  64288. p.nsp += c;
  64289. if (i === str.length) break;
  64290. }
  64291. } else {
  64292. p.nsp = '/';
  64293. }
  64294. // look up id
  64295. var next = str.charAt(i + 1);
  64296. if ('' !== next && Number(next) == next) {
  64297. p.id = '';
  64298. while (++i) {
  64299. var c = str.charAt(i);
  64300. if (null == c || Number(c) != c) {
  64301. --i;
  64302. break;
  64303. }
  64304. p.id += str.charAt(i);
  64305. if (i === str.length) break;
  64306. }
  64307. p.id = Number(p.id);
  64308. }
  64309. // look up json data
  64310. if (str.charAt(++i)) {
  64311. var payload = tryParse(str.substr(i));
  64312. var isPayloadValid = payload !== false && (p.type === exports.ERROR || isArray(payload));
  64313. if (isPayloadValid) {
  64314. p.data = payload;
  64315. } else {
  64316. return error('invalid payload');
  64317. }
  64318. }
  64319. debug('decoded %s as %j', str, p);
  64320. return p;
  64321. }
  64322. function tryParse(str) {
  64323. try {
  64324. return JSON.parse(str);
  64325. } catch(e){
  64326. return false;
  64327. }
  64328. }
  64329. /**
  64330. * Deallocates a parser's resources
  64331. *
  64332. * @api public
  64333. */
  64334. Decoder.prototype.destroy = function() {
  64335. if (this.reconstructor) {
  64336. this.reconstructor.finishedReconstruction();
  64337. }
  64338. };
  64339. /**
  64340. * A manager of a binary event's 'buffer sequence'. Should
  64341. * be constructed whenever a packet of type BINARY_EVENT is
  64342. * decoded.
  64343. *
  64344. * @param {Object} packet
  64345. * @return {BinaryReconstructor} initialized reconstructor
  64346. * @api private
  64347. */
  64348. function BinaryReconstructor(packet) {
  64349. this.reconPack = packet;
  64350. this.buffers = [];
  64351. }
  64352. /**
  64353. * Method to be called when binary data received from connection
  64354. * after a BINARY_EVENT packet.
  64355. *
  64356. * @param {Buffer | ArrayBuffer} binData - the raw binary data received
  64357. * @return {null | Object} returns null if more binary data is expected or
  64358. * a reconstructed packet object if all buffers have been received.
  64359. * @api private
  64360. */
  64361. BinaryReconstructor.prototype.takeBinaryData = function(binData) {
  64362. this.buffers.push(binData);
  64363. if (this.buffers.length === this.reconPack.attachments) { // done with buffer list
  64364. var packet = binary.reconstructPacket(this.reconPack, this.buffers);
  64365. this.finishedReconstruction();
  64366. return packet;
  64367. }
  64368. return null;
  64369. };
  64370. /**
  64371. * Cleans up binary packet reconstruction variables.
  64372. *
  64373. * @api private
  64374. */
  64375. BinaryReconstructor.prototype.finishedReconstruction = function() {
  64376. this.reconPack = null;
  64377. this.buffers = [];
  64378. };
  64379. function error(msg) {
  64380. return {
  64381. type: exports.ERROR,
  64382. data: 'parser error: ' + msg
  64383. };
  64384. }
  64385. /***/ }),
  64386. /***/ "./node_modules/socket.io-parser/is-buffer.js":
  64387. /*!****************************************************!*\
  64388. !*** ./node_modules/socket.io-parser/is-buffer.js ***!
  64389. \****************************************************/
  64390. /*! no static exports found */
  64391. /***/ (function(module, exports, __webpack_require__) {
  64392. /* WEBPACK VAR INJECTION */(function(Buffer) {
  64393. module.exports = isBuf;
  64394. var withNativeBuffer = typeof Buffer === 'function' && typeof Buffer.isBuffer === 'function';
  64395. var withNativeArrayBuffer = typeof ArrayBuffer === 'function';
  64396. var isView = function (obj) {
  64397. return typeof ArrayBuffer.isView === 'function' ? ArrayBuffer.isView(obj) : (obj.buffer instanceof ArrayBuffer);
  64398. };
  64399. /**
  64400. * Returns true if obj is a buffer or an arraybuffer.
  64401. *
  64402. * @api private
  64403. */
  64404. function isBuf(obj) {
  64405. return (withNativeBuffer && Buffer.isBuffer(obj)) ||
  64406. (withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)));
  64407. }
  64408. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../buffer/index.js */ "./node_modules/buffer/index.js").Buffer))
  64409. /***/ }),
  64410. /***/ "./node_modules/socket.io-parser/node_modules/component-emitter/index.js":
  64411. /*!*******************************************************************************!*\
  64412. !*** ./node_modules/socket.io-parser/node_modules/component-emitter/index.js ***!
  64413. \*******************************************************************************/
  64414. /*! no static exports found */
  64415. /***/ (function(module, exports, __webpack_require__) {
  64416. /**
  64417. * Expose `Emitter`.
  64418. */
  64419. if (true) {
  64420. module.exports = Emitter;
  64421. }
  64422. /**
  64423. * Initialize a new `Emitter`.
  64424. *
  64425. * @api public
  64426. */
  64427. function Emitter(obj) {
  64428. if (obj) return mixin(obj);
  64429. };
  64430. /**
  64431. * Mixin the emitter properties.
  64432. *
  64433. * @param {Object} obj
  64434. * @return {Object}
  64435. * @api private
  64436. */
  64437. function mixin(obj) {
  64438. for (var key in Emitter.prototype) {
  64439. obj[key] = Emitter.prototype[key];
  64440. }
  64441. return obj;
  64442. }
  64443. /**
  64444. * Listen on the given `event` with `fn`.
  64445. *
  64446. * @param {String} event
  64447. * @param {Function} fn
  64448. * @return {Emitter}
  64449. * @api public
  64450. */
  64451. Emitter.prototype.on =
  64452. Emitter.prototype.addEventListener = function(event, fn){
  64453. this._callbacks = this._callbacks || {};
  64454. (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
  64455. .push(fn);
  64456. return this;
  64457. };
  64458. /**
  64459. * Adds an `event` listener that will be invoked a single
  64460. * time then automatically removed.
  64461. *
  64462. * @param {String} event
  64463. * @param {Function} fn
  64464. * @return {Emitter}
  64465. * @api public
  64466. */
  64467. Emitter.prototype.once = function(event, fn){
  64468. function on() {
  64469. this.off(event, on);
  64470. fn.apply(this, arguments);
  64471. }
  64472. on.fn = fn;
  64473. this.on(event, on);
  64474. return this;
  64475. };
  64476. /**
  64477. * Remove the given callback for `event` or all
  64478. * registered callbacks.
  64479. *
  64480. * @param {String} event
  64481. * @param {Function} fn
  64482. * @return {Emitter}
  64483. * @api public
  64484. */
  64485. Emitter.prototype.off =
  64486. Emitter.prototype.removeListener =
  64487. Emitter.prototype.removeAllListeners =
  64488. Emitter.prototype.removeEventListener = function(event, fn){
  64489. this._callbacks = this._callbacks || {};
  64490. // all
  64491. if (0 == arguments.length) {
  64492. this._callbacks = {};
  64493. return this;
  64494. }
  64495. // specific event
  64496. var callbacks = this._callbacks['$' + event];
  64497. if (!callbacks) return this;
  64498. // remove all handlers
  64499. if (1 == arguments.length) {
  64500. delete this._callbacks['$' + event];
  64501. return this;
  64502. }
  64503. // remove specific handler
  64504. var cb;
  64505. for (var i = 0; i < callbacks.length; i++) {
  64506. cb = callbacks[i];
  64507. if (cb === fn || cb.fn === fn) {
  64508. callbacks.splice(i, 1);
  64509. break;
  64510. }
  64511. }
  64512. return this;
  64513. };
  64514. /**
  64515. * Emit `event` with the given args.
  64516. *
  64517. * @param {String} event
  64518. * @param {Mixed} ...
  64519. * @return {Emitter}
  64520. */
  64521. Emitter.prototype.emit = function(event){
  64522. this._callbacks = this._callbacks || {};
  64523. var args = [].slice.call(arguments, 1)
  64524. , callbacks = this._callbacks['$' + event];
  64525. if (callbacks) {
  64526. callbacks = callbacks.slice(0);
  64527. for (var i = 0, len = callbacks.length; i < len; ++i) {
  64528. callbacks[i].apply(this, args);
  64529. }
  64530. }
  64531. return this;
  64532. };
  64533. /**
  64534. * Return array of callbacks for `event`.
  64535. *
  64536. * @param {String} event
  64537. * @return {Array}
  64538. * @api public
  64539. */
  64540. Emitter.prototype.listeners = function(event){
  64541. this._callbacks = this._callbacks || {};
  64542. return this._callbacks['$' + event] || [];
  64543. };
  64544. /**
  64545. * Check if this emitter has `event` handlers.
  64546. *
  64547. * @param {String} event
  64548. * @return {Boolean}
  64549. * @api public
  64550. */
  64551. Emitter.prototype.hasListeners = function(event){
  64552. return !! this.listeners(event).length;
  64553. };
  64554. /***/ }),
  64555. /***/ "./node_modules/socket.io-parser/node_modules/isarray/index.js":
  64556. /*!*********************************************************************!*\
  64557. !*** ./node_modules/socket.io-parser/node_modules/isarray/index.js ***!
  64558. \*********************************************************************/
  64559. /*! no static exports found */
  64560. /***/ (function(module, exports) {
  64561. var toString = {}.toString;
  64562. module.exports = Array.isArray || function (arr) {
  64563. return toString.call(arr) == '[object Array]';
  64564. };
  64565. /***/ }),
  64566. /***/ "./node_modules/timers-browserify/main.js":
  64567. /*!************************************************!*\
  64568. !*** ./node_modules/timers-browserify/main.js ***!
  64569. \************************************************/
  64570. /*! no static exports found */
  64571. /***/ (function(module, exports, __webpack_require__) {
  64572. /* WEBPACK VAR INJECTION */(function(global) {var scope = (typeof global !== "undefined" && global) ||
  64573. (typeof self !== "undefined" && self) ||
  64574. window;
  64575. var apply = Function.prototype.apply;
  64576. // DOM APIs, for completeness
  64577. exports.setTimeout = function() {
  64578. return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);
  64579. };
  64580. exports.setInterval = function() {
  64581. return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);
  64582. };
  64583. exports.clearTimeout =
  64584. exports.clearInterval = function(timeout) {
  64585. if (timeout) {
  64586. timeout.close();
  64587. }
  64588. };
  64589. function Timeout(id, clearFn) {
  64590. this._id = id;
  64591. this._clearFn = clearFn;
  64592. }
  64593. Timeout.prototype.unref = Timeout.prototype.ref = function() {};
  64594. Timeout.prototype.close = function() {
  64595. this._clearFn.call(scope, this._id);
  64596. };
  64597. // Does not start the time, just sets up the members needed.
  64598. exports.enroll = function(item, msecs) {
  64599. clearTimeout(item._idleTimeoutId);
  64600. item._idleTimeout = msecs;
  64601. };
  64602. exports.unenroll = function(item) {
  64603. clearTimeout(item._idleTimeoutId);
  64604. item._idleTimeout = -1;
  64605. };
  64606. exports._unrefActive = exports.active = function(item) {
  64607. clearTimeout(item._idleTimeoutId);
  64608. var msecs = item._idleTimeout;
  64609. if (msecs >= 0) {
  64610. item._idleTimeoutId = setTimeout(function onTimeout() {
  64611. if (item._onTimeout)
  64612. item._onTimeout();
  64613. }, msecs);
  64614. }
  64615. };
  64616. // setimmediate attaches itself to the global object
  64617. __webpack_require__(/*! setimmediate */ "./node_modules/setimmediate/setImmediate.js");
  64618. // On some exotic environments, it's not clear which object `setimmediate` was
  64619. // able to install onto. Search each possibility in the same order as the
  64620. // `setimmediate` library.
  64621. exports.setImmediate = (typeof self !== "undefined" && self.setImmediate) ||
  64622. (typeof global !== "undefined" && global.setImmediate) ||
  64623. (this && this.setImmediate);
  64624. exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) ||
  64625. (typeof global !== "undefined" && global.clearImmediate) ||
  64626. (this && this.clearImmediate);
  64627. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js")))
  64628. /***/ }),
  64629. /***/ "./node_modules/to-array/index.js":
  64630. /*!****************************************!*\
  64631. !*** ./node_modules/to-array/index.js ***!
  64632. \****************************************/
  64633. /*! no static exports found */
  64634. /***/ (function(module, exports) {
  64635. module.exports = toArray
  64636. function toArray(list, index) {
  64637. var array = []
  64638. index = index || 0
  64639. for (var i = index || 0; i < list.length; i++) {
  64640. array[i - index] = list[i]
  64641. }
  64642. return array
  64643. }
  64644. /***/ }),
  64645. /***/ "./node_modules/vue/dist/vue.common.dev.js":
  64646. /*!*************************************************!*\
  64647. !*** ./node_modules/vue/dist/vue.common.dev.js ***!
  64648. \*************************************************/
  64649. /*! no static exports found */
  64650. /***/ (function(module, exports, __webpack_require__) {
  64651. "use strict";
  64652. /* WEBPACK VAR INJECTION */(function(global, setImmediate) {/*!
  64653. * Vue.js v2.6.11
  64654. * (c) 2014-2019 Evan You
  64655. * Released under the MIT License.
  64656. */
  64657. /* */
  64658. var emptyObject = Object.freeze({});
  64659. // These helpers produce better VM code in JS engines due to their
  64660. // explicitness and function inlining.
  64661. function isUndef (v) {
  64662. return v === undefined || v === null
  64663. }
  64664. function isDef (v) {
  64665. return v !== undefined && v !== null
  64666. }
  64667. function isTrue (v) {
  64668. return v === true
  64669. }
  64670. function isFalse (v) {
  64671. return v === false
  64672. }
  64673. /**
  64674. * Check if value is primitive.
  64675. */
  64676. function isPrimitive (value) {
  64677. return (
  64678. typeof value === 'string' ||
  64679. typeof value === 'number' ||
  64680. // $flow-disable-line
  64681. typeof value === 'symbol' ||
  64682. typeof value === 'boolean'
  64683. )
  64684. }
  64685. /**
  64686. * Quick object check - this is primarily used to tell
  64687. * Objects from primitive values when we know the value
  64688. * is a JSON-compliant type.
  64689. */
  64690. function isObject (obj) {
  64691. return obj !== null && typeof obj === 'object'
  64692. }
  64693. /**
  64694. * Get the raw type string of a value, e.g., [object Object].
  64695. */
  64696. var _toString = Object.prototype.toString;
  64697. function toRawType (value) {
  64698. return _toString.call(value).slice(8, -1)
  64699. }
  64700. /**
  64701. * Strict object type check. Only returns true
  64702. * for plain JavaScript objects.
  64703. */
  64704. function isPlainObject (obj) {
  64705. return _toString.call(obj) === '[object Object]'
  64706. }
  64707. function isRegExp (v) {
  64708. return _toString.call(v) === '[object RegExp]'
  64709. }
  64710. /**
  64711. * Check if val is a valid array index.
  64712. */
  64713. function isValidArrayIndex (val) {
  64714. var n = parseFloat(String(val));
  64715. return n >= 0 && Math.floor(n) === n && isFinite(val)
  64716. }
  64717. function isPromise (val) {
  64718. return (
  64719. isDef(val) &&
  64720. typeof val.then === 'function' &&
  64721. typeof val.catch === 'function'
  64722. )
  64723. }
  64724. /**
  64725. * Convert a value to a string that is actually rendered.
  64726. */
  64727. function toString (val) {
  64728. return val == null
  64729. ? ''
  64730. : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
  64731. ? JSON.stringify(val, null, 2)
  64732. : String(val)
  64733. }
  64734. /**
  64735. * Convert an input value to a number for persistence.
  64736. * If the conversion fails, return original string.
  64737. */
  64738. function toNumber (val) {
  64739. var n = parseFloat(val);
  64740. return isNaN(n) ? val : n
  64741. }
  64742. /**
  64743. * Make a map and return a function for checking if a key
  64744. * is in that map.
  64745. */
  64746. function makeMap (
  64747. str,
  64748. expectsLowerCase
  64749. ) {
  64750. var map = Object.create(null);
  64751. var list = str.split(',');
  64752. for (var i = 0; i < list.length; i++) {
  64753. map[list[i]] = true;
  64754. }
  64755. return expectsLowerCase
  64756. ? function (val) { return map[val.toLowerCase()]; }
  64757. : function (val) { return map[val]; }
  64758. }
  64759. /**
  64760. * Check if a tag is a built-in tag.
  64761. */
  64762. var isBuiltInTag = makeMap('slot,component', true);
  64763. /**
  64764. * Check if an attribute is a reserved attribute.
  64765. */
  64766. var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
  64767. /**
  64768. * Remove an item from an array.
  64769. */
  64770. function remove (arr, item) {
  64771. if (arr.length) {
  64772. var index = arr.indexOf(item);
  64773. if (index > -1) {
  64774. return arr.splice(index, 1)
  64775. }
  64776. }
  64777. }
  64778. /**
  64779. * Check whether an object has the property.
  64780. */
  64781. var hasOwnProperty = Object.prototype.hasOwnProperty;
  64782. function hasOwn (obj, key) {
  64783. return hasOwnProperty.call(obj, key)
  64784. }
  64785. /**
  64786. * Create a cached version of a pure function.
  64787. */
  64788. function cached (fn) {
  64789. var cache = Object.create(null);
  64790. return (function cachedFn (str) {
  64791. var hit = cache[str];
  64792. return hit || (cache[str] = fn(str))
  64793. })
  64794. }
  64795. /**
  64796. * Camelize a hyphen-delimited string.
  64797. */
  64798. var camelizeRE = /-(\w)/g;
  64799. var camelize = cached(function (str) {
  64800. return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
  64801. });
  64802. /**
  64803. * Capitalize a string.
  64804. */
  64805. var capitalize = cached(function (str) {
  64806. return str.charAt(0).toUpperCase() + str.slice(1)
  64807. });
  64808. /**
  64809. * Hyphenate a camelCase string.
  64810. */
  64811. var hyphenateRE = /\B([A-Z])/g;
  64812. var hyphenate = cached(function (str) {
  64813. return str.replace(hyphenateRE, '-$1').toLowerCase()
  64814. });
  64815. /**
  64816. * Simple bind polyfill for environments that do not support it,
  64817. * e.g., PhantomJS 1.x. Technically, we don't need this anymore
  64818. * since native bind is now performant enough in most browsers.
  64819. * But removing it would mean breaking code that was able to run in
  64820. * PhantomJS 1.x, so this must be kept for backward compatibility.
  64821. */
  64822. /* istanbul ignore next */
  64823. function polyfillBind (fn, ctx) {
  64824. function boundFn (a) {
  64825. var l = arguments.length;
  64826. return l
  64827. ? l > 1
  64828. ? fn.apply(ctx, arguments)
  64829. : fn.call(ctx, a)
  64830. : fn.call(ctx)
  64831. }
  64832. boundFn._length = fn.length;
  64833. return boundFn
  64834. }
  64835. function nativeBind (fn, ctx) {
  64836. return fn.bind(ctx)
  64837. }
  64838. var bind = Function.prototype.bind
  64839. ? nativeBind
  64840. : polyfillBind;
  64841. /**
  64842. * Convert an Array-like object to a real Array.
  64843. */
  64844. function toArray (list, start) {
  64845. start = start || 0;
  64846. var i = list.length - start;
  64847. var ret = new Array(i);
  64848. while (i--) {
  64849. ret[i] = list[i + start];
  64850. }
  64851. return ret
  64852. }
  64853. /**
  64854. * Mix properties into target object.
  64855. */
  64856. function extend (to, _from) {
  64857. for (var key in _from) {
  64858. to[key] = _from[key];
  64859. }
  64860. return to
  64861. }
  64862. /**
  64863. * Merge an Array of Objects into a single Object.
  64864. */
  64865. function toObject (arr) {
  64866. var res = {};
  64867. for (var i = 0; i < arr.length; i++) {
  64868. if (arr[i]) {
  64869. extend(res, arr[i]);
  64870. }
  64871. }
  64872. return res
  64873. }
  64874. /* eslint-disable no-unused-vars */
  64875. /**
  64876. * Perform no operation.
  64877. * Stubbing args to make Flow happy without leaving useless transpiled code
  64878. * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
  64879. */
  64880. function noop (a, b, c) {}
  64881. /**
  64882. * Always return false.
  64883. */
  64884. var no = function (a, b, c) { return false; };
  64885. /* eslint-enable no-unused-vars */
  64886. /**
  64887. * Return the same value.
  64888. */
  64889. var identity = function (_) { return _; };
  64890. /**
  64891. * Generate a string containing static keys from compiler modules.
  64892. */
  64893. function genStaticKeys (modules) {
  64894. return modules.reduce(function (keys, m) {
  64895. return keys.concat(m.staticKeys || [])
  64896. }, []).join(',')
  64897. }
  64898. /**
  64899. * Check if two values are loosely equal - that is,
  64900. * if they are plain objects, do they have the same shape?
  64901. */
  64902. function looseEqual (a, b) {
  64903. if (a === b) { return true }
  64904. var isObjectA = isObject(a);
  64905. var isObjectB = isObject(b);
  64906. if (isObjectA && isObjectB) {
  64907. try {
  64908. var isArrayA = Array.isArray(a);
  64909. var isArrayB = Array.isArray(b);
  64910. if (isArrayA && isArrayB) {
  64911. return a.length === b.length && a.every(function (e, i) {
  64912. return looseEqual(e, b[i])
  64913. })
  64914. } else if (a instanceof Date && b instanceof Date) {
  64915. return a.getTime() === b.getTime()
  64916. } else if (!isArrayA && !isArrayB) {
  64917. var keysA = Object.keys(a);
  64918. var keysB = Object.keys(b);
  64919. return keysA.length === keysB.length && keysA.every(function (key) {
  64920. return looseEqual(a[key], b[key])
  64921. })
  64922. } else {
  64923. /* istanbul ignore next */
  64924. return false
  64925. }
  64926. } catch (e) {
  64927. /* istanbul ignore next */
  64928. return false
  64929. }
  64930. } else if (!isObjectA && !isObjectB) {
  64931. return String(a) === String(b)
  64932. } else {
  64933. return false
  64934. }
  64935. }
  64936. /**
  64937. * Return the first index at which a loosely equal value can be
  64938. * found in the array (if value is a plain object, the array must
  64939. * contain an object of the same shape), or -1 if it is not present.
  64940. */
  64941. function looseIndexOf (arr, val) {
  64942. for (var i = 0; i < arr.length; i++) {
  64943. if (looseEqual(arr[i], val)) { return i }
  64944. }
  64945. return -1
  64946. }
  64947. /**
  64948. * Ensure a function is called only once.
  64949. */
  64950. function once (fn) {
  64951. var called = false;
  64952. return function () {
  64953. if (!called) {
  64954. called = true;
  64955. fn.apply(this, arguments);
  64956. }
  64957. }
  64958. }
  64959. var SSR_ATTR = 'data-server-rendered';
  64960. var ASSET_TYPES = [
  64961. 'component',
  64962. 'directive',
  64963. 'filter'
  64964. ];
  64965. var LIFECYCLE_HOOKS = [
  64966. 'beforeCreate',
  64967. 'created',
  64968. 'beforeMount',
  64969. 'mounted',
  64970. 'beforeUpdate',
  64971. 'updated',
  64972. 'beforeDestroy',
  64973. 'destroyed',
  64974. 'activated',
  64975. 'deactivated',
  64976. 'errorCaptured',
  64977. 'serverPrefetch'
  64978. ];
  64979. /* */
  64980. var config = ({
  64981. /**
  64982. * Option merge strategies (used in core/util/options)
  64983. */
  64984. // $flow-disable-line
  64985. optionMergeStrategies: Object.create(null),
  64986. /**
  64987. * Whether to suppress warnings.
  64988. */
  64989. silent: false,
  64990. /**
  64991. * Show production mode tip message on boot?
  64992. */
  64993. productionTip: "development" !== 'production',
  64994. /**
  64995. * Whether to enable devtools
  64996. */
  64997. devtools: "development" !== 'production',
  64998. /**
  64999. * Whether to record perf
  65000. */
  65001. performance: false,
  65002. /**
  65003. * Error handler for watcher errors
  65004. */
  65005. errorHandler: null,
  65006. /**
  65007. * Warn handler for watcher warns
  65008. */
  65009. warnHandler: null,
  65010. /**
  65011. * Ignore certain custom elements
  65012. */
  65013. ignoredElements: [],
  65014. /**
  65015. * Custom user key aliases for v-on
  65016. */
  65017. // $flow-disable-line
  65018. keyCodes: Object.create(null),
  65019. /**
  65020. * Check if a tag is reserved so that it cannot be registered as a
  65021. * component. This is platform-dependent and may be overwritten.
  65022. */
  65023. isReservedTag: no,
  65024. /**
  65025. * Check if an attribute is reserved so that it cannot be used as a component
  65026. * prop. This is platform-dependent and may be overwritten.
  65027. */
  65028. isReservedAttr: no,
  65029. /**
  65030. * Check if a tag is an unknown element.
  65031. * Platform-dependent.
  65032. */
  65033. isUnknownElement: no,
  65034. /**
  65035. * Get the namespace of an element
  65036. */
  65037. getTagNamespace: noop,
  65038. /**
  65039. * Parse the real tag name for the specific platform.
  65040. */
  65041. parsePlatformTagName: identity,
  65042. /**
  65043. * Check if an attribute must be bound using property, e.g. value
  65044. * Platform-dependent.
  65045. */
  65046. mustUseProp: no,
  65047. /**
  65048. * Perform updates asynchronously. Intended to be used by Vue Test Utils
  65049. * This will significantly reduce performance if set to false.
  65050. */
  65051. async: true,
  65052. /**
  65053. * Exposed for legacy reasons
  65054. */
  65055. _lifecycleHooks: LIFECYCLE_HOOKS
  65056. });
  65057. /* */
  65058. /**
  65059. * unicode letters used for parsing html tags, component names and property paths.
  65060. * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
  65061. * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
  65062. */
  65063. var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
  65064. /**
  65065. * Check if a string starts with $ or _
  65066. */
  65067. function isReserved (str) {
  65068. var c = (str + '').charCodeAt(0);
  65069. return c === 0x24 || c === 0x5F
  65070. }
  65071. /**
  65072. * Define a property.
  65073. */
  65074. function def (obj, key, val, enumerable) {
  65075. Object.defineProperty(obj, key, {
  65076. value: val,
  65077. enumerable: !!enumerable,
  65078. writable: true,
  65079. configurable: true
  65080. });
  65081. }
  65082. /**
  65083. * Parse simple path.
  65084. */
  65085. var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
  65086. function parsePath (path) {
  65087. if (bailRE.test(path)) {
  65088. return
  65089. }
  65090. var segments = path.split('.');
  65091. return function (obj) {
  65092. for (var i = 0; i < segments.length; i++) {
  65093. if (!obj) { return }
  65094. obj = obj[segments[i]];
  65095. }
  65096. return obj
  65097. }
  65098. }
  65099. /* */
  65100. // can we use __proto__?
  65101. var hasProto = '__proto__' in {};
  65102. // Browser environment sniffing
  65103. var inBrowser = typeof window !== 'undefined';
  65104. var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
  65105. var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
  65106. var UA = inBrowser && window.navigator.userAgent.toLowerCase();
  65107. var isIE = UA && /msie|trident/.test(UA);
  65108. var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
  65109. var isEdge = UA && UA.indexOf('edge/') > 0;
  65110. var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
  65111. var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
  65112. var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
  65113. var isPhantomJS = UA && /phantomjs/.test(UA);
  65114. var isFF = UA && UA.match(/firefox\/(\d+)/);
  65115. // Firefox has a "watch" function on Object.prototype...
  65116. var nativeWatch = ({}).watch;
  65117. var supportsPassive = false;
  65118. if (inBrowser) {
  65119. try {
  65120. var opts = {};
  65121. Object.defineProperty(opts, 'passive', ({
  65122. get: function get () {
  65123. /* istanbul ignore next */
  65124. supportsPassive = true;
  65125. }
  65126. })); // https://github.com/facebook/flow/issues/285
  65127. window.addEventListener('test-passive', null, opts);
  65128. } catch (e) {}
  65129. }
  65130. // this needs to be lazy-evaled because vue may be required before
  65131. // vue-server-renderer can set VUE_ENV
  65132. var _isServer;
  65133. var isServerRendering = function () {
  65134. if (_isServer === undefined) {
  65135. /* istanbul ignore if */
  65136. if (!inBrowser && !inWeex && typeof global !== 'undefined') {
  65137. // detect presence of vue-server-renderer and avoid
  65138. // Webpack shimming the process
  65139. _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
  65140. } else {
  65141. _isServer = false;
  65142. }
  65143. }
  65144. return _isServer
  65145. };
  65146. // detect devtools
  65147. var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
  65148. /* istanbul ignore next */
  65149. function isNative (Ctor) {
  65150. return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
  65151. }
  65152. var hasSymbol =
  65153. typeof Symbol !== 'undefined' && isNative(Symbol) &&
  65154. typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
  65155. var _Set;
  65156. /* istanbul ignore if */ // $flow-disable-line
  65157. if (typeof Set !== 'undefined' && isNative(Set)) {
  65158. // use native Set when available.
  65159. _Set = Set;
  65160. } else {
  65161. // a non-standard Set polyfill that only works with primitive keys.
  65162. _Set = /*@__PURE__*/(function () {
  65163. function Set () {
  65164. this.set = Object.create(null);
  65165. }
  65166. Set.prototype.has = function has (key) {
  65167. return this.set[key] === true
  65168. };
  65169. Set.prototype.add = function add (key) {
  65170. this.set[key] = true;
  65171. };
  65172. Set.prototype.clear = function clear () {
  65173. this.set = Object.create(null);
  65174. };
  65175. return Set;
  65176. }());
  65177. }
  65178. /* */
  65179. var warn = noop;
  65180. var tip = noop;
  65181. var generateComponentTrace = (noop); // work around flow check
  65182. var formatComponentName = (noop);
  65183. {
  65184. var hasConsole = typeof console !== 'undefined';
  65185. var classifyRE = /(?:^|[-_])(\w)/g;
  65186. var classify = function (str) { return str
  65187. .replace(classifyRE, function (c) { return c.toUpperCase(); })
  65188. .replace(/[-_]/g, ''); };
  65189. warn = function (msg, vm) {
  65190. var trace = vm ? generateComponentTrace(vm) : '';
  65191. if (config.warnHandler) {
  65192. config.warnHandler.call(null, msg, vm, trace);
  65193. } else if (hasConsole && (!config.silent)) {
  65194. console.error(("[Vue warn]: " + msg + trace));
  65195. }
  65196. };
  65197. tip = function (msg, vm) {
  65198. if (hasConsole && (!config.silent)) {
  65199. console.warn("[Vue tip]: " + msg + (
  65200. vm ? generateComponentTrace(vm) : ''
  65201. ));
  65202. }
  65203. };
  65204. formatComponentName = function (vm, includeFile) {
  65205. if (vm.$root === vm) {
  65206. return '<Root>'
  65207. }
  65208. var options = typeof vm === 'function' && vm.cid != null
  65209. ? vm.options
  65210. : vm._isVue
  65211. ? vm.$options || vm.constructor.options
  65212. : vm;
  65213. var name = options.name || options._componentTag;
  65214. var file = options.__file;
  65215. if (!name && file) {
  65216. var match = file.match(/([^/\\]+)\.vue$/);
  65217. name = match && match[1];
  65218. }
  65219. return (
  65220. (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
  65221. (file && includeFile !== false ? (" at " + file) : '')
  65222. )
  65223. };
  65224. var repeat = function (str, n) {
  65225. var res = '';
  65226. while (n) {
  65227. if (n % 2 === 1) { res += str; }
  65228. if (n > 1) { str += str; }
  65229. n >>= 1;
  65230. }
  65231. return res
  65232. };
  65233. generateComponentTrace = function (vm) {
  65234. if (vm._isVue && vm.$parent) {
  65235. var tree = [];
  65236. var currentRecursiveSequence = 0;
  65237. while (vm) {
  65238. if (tree.length > 0) {
  65239. var last = tree[tree.length - 1];
  65240. if (last.constructor === vm.constructor) {
  65241. currentRecursiveSequence++;
  65242. vm = vm.$parent;
  65243. continue
  65244. } else if (currentRecursiveSequence > 0) {
  65245. tree[tree.length - 1] = [last, currentRecursiveSequence];
  65246. currentRecursiveSequence = 0;
  65247. }
  65248. }
  65249. tree.push(vm);
  65250. vm = vm.$parent;
  65251. }
  65252. return '\n\nfound in\n\n' + tree
  65253. .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
  65254. ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
  65255. : formatComponentName(vm))); })
  65256. .join('\n')
  65257. } else {
  65258. return ("\n\n(found in " + (formatComponentName(vm)) + ")")
  65259. }
  65260. };
  65261. }
  65262. /* */
  65263. var uid = 0;
  65264. /**
  65265. * A dep is an observable that can have multiple
  65266. * directives subscribing to it.
  65267. */
  65268. var Dep = function Dep () {
  65269. this.id = uid++;
  65270. this.subs = [];
  65271. };
  65272. Dep.prototype.addSub = function addSub (sub) {
  65273. this.subs.push(sub);
  65274. };
  65275. Dep.prototype.removeSub = function removeSub (sub) {
  65276. remove(this.subs, sub);
  65277. };
  65278. Dep.prototype.depend = function depend () {
  65279. if (Dep.target) {
  65280. Dep.target.addDep(this);
  65281. }
  65282. };
  65283. Dep.prototype.notify = function notify () {
  65284. // stabilize the subscriber list first
  65285. var subs = this.subs.slice();
  65286. if (!config.async) {
  65287. // subs aren't sorted in scheduler if not running async
  65288. // we need to sort them now to make sure they fire in correct
  65289. // order
  65290. subs.sort(function (a, b) { return a.id - b.id; });
  65291. }
  65292. for (var i = 0, l = subs.length; i < l; i++) {
  65293. subs[i].update();
  65294. }
  65295. };
  65296. // The current target watcher being evaluated.
  65297. // This is globally unique because only one watcher
  65298. // can be evaluated at a time.
  65299. Dep.target = null;
  65300. var targetStack = [];
  65301. function pushTarget (target) {
  65302. targetStack.push(target);
  65303. Dep.target = target;
  65304. }
  65305. function popTarget () {
  65306. targetStack.pop();
  65307. Dep.target = targetStack[targetStack.length - 1];
  65308. }
  65309. /* */
  65310. var VNode = function VNode (
  65311. tag,
  65312. data,
  65313. children,
  65314. text,
  65315. elm,
  65316. context,
  65317. componentOptions,
  65318. asyncFactory
  65319. ) {
  65320. this.tag = tag;
  65321. this.data = data;
  65322. this.children = children;
  65323. this.text = text;
  65324. this.elm = elm;
  65325. this.ns = undefined;
  65326. this.context = context;
  65327. this.fnContext = undefined;
  65328. this.fnOptions = undefined;
  65329. this.fnScopeId = undefined;
  65330. this.key = data && data.key;
  65331. this.componentOptions = componentOptions;
  65332. this.componentInstance = undefined;
  65333. this.parent = undefined;
  65334. this.raw = false;
  65335. this.isStatic = false;
  65336. this.isRootInsert = true;
  65337. this.isComment = false;
  65338. this.isCloned = false;
  65339. this.isOnce = false;
  65340. this.asyncFactory = asyncFactory;
  65341. this.asyncMeta = undefined;
  65342. this.isAsyncPlaceholder = false;
  65343. };
  65344. var prototypeAccessors = { child: { configurable: true } };
  65345. // DEPRECATED: alias for componentInstance for backwards compat.
  65346. /* istanbul ignore next */
  65347. prototypeAccessors.child.get = function () {
  65348. return this.componentInstance
  65349. };
  65350. Object.defineProperties( VNode.prototype, prototypeAccessors );
  65351. var createEmptyVNode = function (text) {
  65352. if ( text === void 0 ) text = '';
  65353. var node = new VNode();
  65354. node.text = text;
  65355. node.isComment = true;
  65356. return node
  65357. };
  65358. function createTextVNode (val) {
  65359. return new VNode(undefined, undefined, undefined, String(val))
  65360. }
  65361. // optimized shallow clone
  65362. // used for static nodes and slot nodes because they may be reused across
  65363. // multiple renders, cloning them avoids errors when DOM manipulations rely
  65364. // on their elm reference.
  65365. function cloneVNode (vnode) {
  65366. var cloned = new VNode(
  65367. vnode.tag,
  65368. vnode.data,
  65369. // #7975
  65370. // clone children array to avoid mutating original in case of cloning
  65371. // a child.
  65372. vnode.children && vnode.children.slice(),
  65373. vnode.text,
  65374. vnode.elm,
  65375. vnode.context,
  65376. vnode.componentOptions,
  65377. vnode.asyncFactory
  65378. );
  65379. cloned.ns = vnode.ns;
  65380. cloned.isStatic = vnode.isStatic;
  65381. cloned.key = vnode.key;
  65382. cloned.isComment = vnode.isComment;
  65383. cloned.fnContext = vnode.fnContext;
  65384. cloned.fnOptions = vnode.fnOptions;
  65385. cloned.fnScopeId = vnode.fnScopeId;
  65386. cloned.asyncMeta = vnode.asyncMeta;
  65387. cloned.isCloned = true;
  65388. return cloned
  65389. }
  65390. /*
  65391. * not type checking this file because flow doesn't play well with
  65392. * dynamically accessing methods on Array prototype
  65393. */
  65394. var arrayProto = Array.prototype;
  65395. var arrayMethods = Object.create(arrayProto);
  65396. var methodsToPatch = [
  65397. 'push',
  65398. 'pop',
  65399. 'shift',
  65400. 'unshift',
  65401. 'splice',
  65402. 'sort',
  65403. 'reverse'
  65404. ];
  65405. /**
  65406. * Intercept mutating methods and emit events
  65407. */
  65408. methodsToPatch.forEach(function (method) {
  65409. // cache original method
  65410. var original = arrayProto[method];
  65411. def(arrayMethods, method, function mutator () {
  65412. var args = [], len = arguments.length;
  65413. while ( len-- ) args[ len ] = arguments[ len ];
  65414. var result = original.apply(this, args);
  65415. var ob = this.__ob__;
  65416. var inserted;
  65417. switch (method) {
  65418. case 'push':
  65419. case 'unshift':
  65420. inserted = args;
  65421. break
  65422. case 'splice':
  65423. inserted = args.slice(2);
  65424. break
  65425. }
  65426. if (inserted) { ob.observeArray(inserted); }
  65427. // notify change
  65428. ob.dep.notify();
  65429. return result
  65430. });
  65431. });
  65432. /* */
  65433. var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
  65434. /**
  65435. * In some cases we may want to disable observation inside a component's
  65436. * update computation.
  65437. */
  65438. var shouldObserve = true;
  65439. function toggleObserving (value) {
  65440. shouldObserve = value;
  65441. }
  65442. /**
  65443. * Observer class that is attached to each observed
  65444. * object. Once attached, the observer converts the target
  65445. * object's property keys into getter/setters that
  65446. * collect dependencies and dispatch updates.
  65447. */
  65448. var Observer = function Observer (value) {
  65449. this.value = value;
  65450. this.dep = new Dep();
  65451. this.vmCount = 0;
  65452. def(value, '__ob__', this);
  65453. if (Array.isArray(value)) {
  65454. if (hasProto) {
  65455. protoAugment(value, arrayMethods);
  65456. } else {
  65457. copyAugment(value, arrayMethods, arrayKeys);
  65458. }
  65459. this.observeArray(value);
  65460. } else {
  65461. this.walk(value);
  65462. }
  65463. };
  65464. /**
  65465. * Walk through all properties and convert them into
  65466. * getter/setters. This method should only be called when
  65467. * value type is Object.
  65468. */
  65469. Observer.prototype.walk = function walk (obj) {
  65470. var keys = Object.keys(obj);
  65471. for (var i = 0; i < keys.length; i++) {
  65472. defineReactive$$1(obj, keys[i]);
  65473. }
  65474. };
  65475. /**
  65476. * Observe a list of Array items.
  65477. */
  65478. Observer.prototype.observeArray = function observeArray (items) {
  65479. for (var i = 0, l = items.length; i < l; i++) {
  65480. observe(items[i]);
  65481. }
  65482. };
  65483. // helpers
  65484. /**
  65485. * Augment a target Object or Array by intercepting
  65486. * the prototype chain using __proto__
  65487. */
  65488. function protoAugment (target, src) {
  65489. /* eslint-disable no-proto */
  65490. target.__proto__ = src;
  65491. /* eslint-enable no-proto */
  65492. }
  65493. /**
  65494. * Augment a target Object or Array by defining
  65495. * hidden properties.
  65496. */
  65497. /* istanbul ignore next */
  65498. function copyAugment (target, src, keys) {
  65499. for (var i = 0, l = keys.length; i < l; i++) {
  65500. var key = keys[i];
  65501. def(target, key, src[key]);
  65502. }
  65503. }
  65504. /**
  65505. * Attempt to create an observer instance for a value,
  65506. * returns the new observer if successfully observed,
  65507. * or the existing observer if the value already has one.
  65508. */
  65509. function observe (value, asRootData) {
  65510. if (!isObject(value) || value instanceof VNode) {
  65511. return
  65512. }
  65513. var ob;
  65514. if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
  65515. ob = value.__ob__;
  65516. } else if (
  65517. shouldObserve &&
  65518. !isServerRendering() &&
  65519. (Array.isArray(value) || isPlainObject(value)) &&
  65520. Object.isExtensible(value) &&
  65521. !value._isVue
  65522. ) {
  65523. ob = new Observer(value);
  65524. }
  65525. if (asRootData && ob) {
  65526. ob.vmCount++;
  65527. }
  65528. return ob
  65529. }
  65530. /**
  65531. * Define a reactive property on an Object.
  65532. */
  65533. function defineReactive$$1 (
  65534. obj,
  65535. key,
  65536. val,
  65537. customSetter,
  65538. shallow
  65539. ) {
  65540. var dep = new Dep();
  65541. var property = Object.getOwnPropertyDescriptor(obj, key);
  65542. if (property && property.configurable === false) {
  65543. return
  65544. }
  65545. // cater for pre-defined getter/setters
  65546. var getter = property && property.get;
  65547. var setter = property && property.set;
  65548. if ((!getter || setter) && arguments.length === 2) {
  65549. val = obj[key];
  65550. }
  65551. var childOb = !shallow && observe(val);
  65552. Object.defineProperty(obj, key, {
  65553. enumerable: true,
  65554. configurable: true,
  65555. get: function reactiveGetter () {
  65556. var value = getter ? getter.call(obj) : val;
  65557. if (Dep.target) {
  65558. dep.depend();
  65559. if (childOb) {
  65560. childOb.dep.depend();
  65561. if (Array.isArray(value)) {
  65562. dependArray(value);
  65563. }
  65564. }
  65565. }
  65566. return value
  65567. },
  65568. set: function reactiveSetter (newVal) {
  65569. var value = getter ? getter.call(obj) : val;
  65570. /* eslint-disable no-self-compare */
  65571. if (newVal === value || (newVal !== newVal && value !== value)) {
  65572. return
  65573. }
  65574. /* eslint-enable no-self-compare */
  65575. if (customSetter) {
  65576. customSetter();
  65577. }
  65578. // #7981: for accessor properties without setter
  65579. if (getter && !setter) { return }
  65580. if (setter) {
  65581. setter.call(obj, newVal);
  65582. } else {
  65583. val = newVal;
  65584. }
  65585. childOb = !shallow && observe(newVal);
  65586. dep.notify();
  65587. }
  65588. });
  65589. }
  65590. /**
  65591. * Set a property on an object. Adds the new property and
  65592. * triggers change notification if the property doesn't
  65593. * already exist.
  65594. */
  65595. function set (target, key, val) {
  65596. if (isUndef(target) || isPrimitive(target)
  65597. ) {
  65598. warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
  65599. }
  65600. if (Array.isArray(target) && isValidArrayIndex(key)) {
  65601. target.length = Math.max(target.length, key);
  65602. target.splice(key, 1, val);
  65603. return val
  65604. }
  65605. if (key in target && !(key in Object.prototype)) {
  65606. target[key] = val;
  65607. return val
  65608. }
  65609. var ob = (target).__ob__;
  65610. if (target._isVue || (ob && ob.vmCount)) {
  65611. warn(
  65612. 'Avoid adding reactive properties to a Vue instance or its root $data ' +
  65613. 'at runtime - declare it upfront in the data option.'
  65614. );
  65615. return val
  65616. }
  65617. if (!ob) {
  65618. target[key] = val;
  65619. return val
  65620. }
  65621. defineReactive$$1(ob.value, key, val);
  65622. ob.dep.notify();
  65623. return val
  65624. }
  65625. /**
  65626. * Delete a property and trigger change if necessary.
  65627. */
  65628. function del (target, key) {
  65629. if (isUndef(target) || isPrimitive(target)
  65630. ) {
  65631. warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
  65632. }
  65633. if (Array.isArray(target) && isValidArrayIndex(key)) {
  65634. target.splice(key, 1);
  65635. return
  65636. }
  65637. var ob = (target).__ob__;
  65638. if (target._isVue || (ob && ob.vmCount)) {
  65639. warn(
  65640. 'Avoid deleting properties on a Vue instance or its root $data ' +
  65641. '- just set it to null.'
  65642. );
  65643. return
  65644. }
  65645. if (!hasOwn(target, key)) {
  65646. return
  65647. }
  65648. delete target[key];
  65649. if (!ob) {
  65650. return
  65651. }
  65652. ob.dep.notify();
  65653. }
  65654. /**
  65655. * Collect dependencies on array elements when the array is touched, since
  65656. * we cannot intercept array element access like property getters.
  65657. */
  65658. function dependArray (value) {
  65659. for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
  65660. e = value[i];
  65661. e && e.__ob__ && e.__ob__.dep.depend();
  65662. if (Array.isArray(e)) {
  65663. dependArray(e);
  65664. }
  65665. }
  65666. }
  65667. /* */
  65668. /**
  65669. * Option overwriting strategies are functions that handle
  65670. * how to merge a parent option value and a child option
  65671. * value into the final value.
  65672. */
  65673. var strats = config.optionMergeStrategies;
  65674. /**
  65675. * Options with restrictions
  65676. */
  65677. {
  65678. strats.el = strats.propsData = function (parent, child, vm, key) {
  65679. if (!vm) {
  65680. warn(
  65681. "option \"" + key + "\" can only be used during instance " +
  65682. 'creation with the `new` keyword.'
  65683. );
  65684. }
  65685. return defaultStrat(parent, child)
  65686. };
  65687. }
  65688. /**
  65689. * Helper that recursively merges two data objects together.
  65690. */
  65691. function mergeData (to, from) {
  65692. if (!from) { return to }
  65693. var key, toVal, fromVal;
  65694. var keys = hasSymbol
  65695. ? Reflect.ownKeys(from)
  65696. : Object.keys(from);
  65697. for (var i = 0; i < keys.length; i++) {
  65698. key = keys[i];
  65699. // in case the object is already observed...
  65700. if (key === '__ob__') { continue }
  65701. toVal = to[key];
  65702. fromVal = from[key];
  65703. if (!hasOwn(to, key)) {
  65704. set(to, key, fromVal);
  65705. } else if (
  65706. toVal !== fromVal &&
  65707. isPlainObject(toVal) &&
  65708. isPlainObject(fromVal)
  65709. ) {
  65710. mergeData(toVal, fromVal);
  65711. }
  65712. }
  65713. return to
  65714. }
  65715. /**
  65716. * Data
  65717. */
  65718. function mergeDataOrFn (
  65719. parentVal,
  65720. childVal,
  65721. vm
  65722. ) {
  65723. if (!vm) {
  65724. // in a Vue.extend merge, both should be functions
  65725. if (!childVal) {
  65726. return parentVal
  65727. }
  65728. if (!parentVal) {
  65729. return childVal
  65730. }
  65731. // when parentVal & childVal are both present,
  65732. // we need to return a function that returns the
  65733. // merged result of both functions... no need to
  65734. // check if parentVal is a function here because
  65735. // it has to be a function to pass previous merges.
  65736. return function mergedDataFn () {
  65737. return mergeData(
  65738. typeof childVal === 'function' ? childVal.call(this, this) : childVal,
  65739. typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
  65740. )
  65741. }
  65742. } else {
  65743. return function mergedInstanceDataFn () {
  65744. // instance merge
  65745. var instanceData = typeof childVal === 'function'
  65746. ? childVal.call(vm, vm)
  65747. : childVal;
  65748. var defaultData = typeof parentVal === 'function'
  65749. ? parentVal.call(vm, vm)
  65750. : parentVal;
  65751. if (instanceData) {
  65752. return mergeData(instanceData, defaultData)
  65753. } else {
  65754. return defaultData
  65755. }
  65756. }
  65757. }
  65758. }
  65759. strats.data = function (
  65760. parentVal,
  65761. childVal,
  65762. vm
  65763. ) {
  65764. if (!vm) {
  65765. if (childVal && typeof childVal !== 'function') {
  65766. warn(
  65767. 'The "data" option should be a function ' +
  65768. 'that returns a per-instance value in component ' +
  65769. 'definitions.',
  65770. vm
  65771. );
  65772. return parentVal
  65773. }
  65774. return mergeDataOrFn(parentVal, childVal)
  65775. }
  65776. return mergeDataOrFn(parentVal, childVal, vm)
  65777. };
  65778. /**
  65779. * Hooks and props are merged as arrays.
  65780. */
  65781. function mergeHook (
  65782. parentVal,
  65783. childVal
  65784. ) {
  65785. var res = childVal
  65786. ? parentVal
  65787. ? parentVal.concat(childVal)
  65788. : Array.isArray(childVal)
  65789. ? childVal
  65790. : [childVal]
  65791. : parentVal;
  65792. return res
  65793. ? dedupeHooks(res)
  65794. : res
  65795. }
  65796. function dedupeHooks (hooks) {
  65797. var res = [];
  65798. for (var i = 0; i < hooks.length; i++) {
  65799. if (res.indexOf(hooks[i]) === -1) {
  65800. res.push(hooks[i]);
  65801. }
  65802. }
  65803. return res
  65804. }
  65805. LIFECYCLE_HOOKS.forEach(function (hook) {
  65806. strats[hook] = mergeHook;
  65807. });
  65808. /**
  65809. * Assets
  65810. *
  65811. * When a vm is present (instance creation), we need to do
  65812. * a three-way merge between constructor options, instance
  65813. * options and parent options.
  65814. */
  65815. function mergeAssets (
  65816. parentVal,
  65817. childVal,
  65818. vm,
  65819. key
  65820. ) {
  65821. var res = Object.create(parentVal || null);
  65822. if (childVal) {
  65823. assertObjectType(key, childVal, vm);
  65824. return extend(res, childVal)
  65825. } else {
  65826. return res
  65827. }
  65828. }
  65829. ASSET_TYPES.forEach(function (type) {
  65830. strats[type + 's'] = mergeAssets;
  65831. });
  65832. /**
  65833. * Watchers.
  65834. *
  65835. * Watchers hashes should not overwrite one
  65836. * another, so we merge them as arrays.
  65837. */
  65838. strats.watch = function (
  65839. parentVal,
  65840. childVal,
  65841. vm,
  65842. key
  65843. ) {
  65844. // work around Firefox's Object.prototype.watch...
  65845. if (parentVal === nativeWatch) { parentVal = undefined; }
  65846. if (childVal === nativeWatch) { childVal = undefined; }
  65847. /* istanbul ignore if */
  65848. if (!childVal) { return Object.create(parentVal || null) }
  65849. {
  65850. assertObjectType(key, childVal, vm);
  65851. }
  65852. if (!parentVal) { return childVal }
  65853. var ret = {};
  65854. extend(ret, parentVal);
  65855. for (var key$1 in childVal) {
  65856. var parent = ret[key$1];
  65857. var child = childVal[key$1];
  65858. if (parent && !Array.isArray(parent)) {
  65859. parent = [parent];
  65860. }
  65861. ret[key$1] = parent
  65862. ? parent.concat(child)
  65863. : Array.isArray(child) ? child : [child];
  65864. }
  65865. return ret
  65866. };
  65867. /**
  65868. * Other object hashes.
  65869. */
  65870. strats.props =
  65871. strats.methods =
  65872. strats.inject =
  65873. strats.computed = function (
  65874. parentVal,
  65875. childVal,
  65876. vm,
  65877. key
  65878. ) {
  65879. if (childVal && "development" !== 'production') {
  65880. assertObjectType(key, childVal, vm);
  65881. }
  65882. if (!parentVal) { return childVal }
  65883. var ret = Object.create(null);
  65884. extend(ret, parentVal);
  65885. if (childVal) { extend(ret, childVal); }
  65886. return ret
  65887. };
  65888. strats.provide = mergeDataOrFn;
  65889. /**
  65890. * Default strategy.
  65891. */
  65892. var defaultStrat = function (parentVal, childVal) {
  65893. return childVal === undefined
  65894. ? parentVal
  65895. : childVal
  65896. };
  65897. /**
  65898. * Validate component names
  65899. */
  65900. function checkComponents (options) {
  65901. for (var key in options.components) {
  65902. validateComponentName(key);
  65903. }
  65904. }
  65905. function validateComponentName (name) {
  65906. if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
  65907. warn(
  65908. 'Invalid component name: "' + name + '". Component names ' +
  65909. 'should conform to valid custom element name in html5 specification.'
  65910. );
  65911. }
  65912. if (isBuiltInTag(name) || config.isReservedTag(name)) {
  65913. warn(
  65914. 'Do not use built-in or reserved HTML elements as component ' +
  65915. 'id: ' + name
  65916. );
  65917. }
  65918. }
  65919. /**
  65920. * Ensure all props option syntax are normalized into the
  65921. * Object-based format.
  65922. */
  65923. function normalizeProps (options, vm) {
  65924. var props = options.props;
  65925. if (!props) { return }
  65926. var res = {};
  65927. var i, val, name;
  65928. if (Array.isArray(props)) {
  65929. i = props.length;
  65930. while (i--) {
  65931. val = props[i];
  65932. if (typeof val === 'string') {
  65933. name = camelize(val);
  65934. res[name] = { type: null };
  65935. } else {
  65936. warn('props must be strings when using array syntax.');
  65937. }
  65938. }
  65939. } else if (isPlainObject(props)) {
  65940. for (var key in props) {
  65941. val = props[key];
  65942. name = camelize(key);
  65943. res[name] = isPlainObject(val)
  65944. ? val
  65945. : { type: val };
  65946. }
  65947. } else {
  65948. warn(
  65949. "Invalid value for option \"props\": expected an Array or an Object, " +
  65950. "but got " + (toRawType(props)) + ".",
  65951. vm
  65952. );
  65953. }
  65954. options.props = res;
  65955. }
  65956. /**
  65957. * Normalize all injections into Object-based format
  65958. */
  65959. function normalizeInject (options, vm) {
  65960. var inject = options.inject;
  65961. if (!inject) { return }
  65962. var normalized = options.inject = {};
  65963. if (Array.isArray(inject)) {
  65964. for (var i = 0; i < inject.length; i++) {
  65965. normalized[inject[i]] = { from: inject[i] };
  65966. }
  65967. } else if (isPlainObject(inject)) {
  65968. for (var key in inject) {
  65969. var val = inject[key];
  65970. normalized[key] = isPlainObject(val)
  65971. ? extend({ from: key }, val)
  65972. : { from: val };
  65973. }
  65974. } else {
  65975. warn(
  65976. "Invalid value for option \"inject\": expected an Array or an Object, " +
  65977. "but got " + (toRawType(inject)) + ".",
  65978. vm
  65979. );
  65980. }
  65981. }
  65982. /**
  65983. * Normalize raw function directives into object format.
  65984. */
  65985. function normalizeDirectives (options) {
  65986. var dirs = options.directives;
  65987. if (dirs) {
  65988. for (var key in dirs) {
  65989. var def$$1 = dirs[key];
  65990. if (typeof def$$1 === 'function') {
  65991. dirs[key] = { bind: def$$1, update: def$$1 };
  65992. }
  65993. }
  65994. }
  65995. }
  65996. function assertObjectType (name, value, vm) {
  65997. if (!isPlainObject(value)) {
  65998. warn(
  65999. "Invalid value for option \"" + name + "\": expected an Object, " +
  66000. "but got " + (toRawType(value)) + ".",
  66001. vm
  66002. );
  66003. }
  66004. }
  66005. /**
  66006. * Merge two option objects into a new one.
  66007. * Core utility used in both instantiation and inheritance.
  66008. */
  66009. function mergeOptions (
  66010. parent,
  66011. child,
  66012. vm
  66013. ) {
  66014. {
  66015. checkComponents(child);
  66016. }
  66017. if (typeof child === 'function') {
  66018. child = child.options;
  66019. }
  66020. normalizeProps(child, vm);
  66021. normalizeInject(child, vm);
  66022. normalizeDirectives(child);
  66023. // Apply extends and mixins on the child options,
  66024. // but only if it is a raw options object that isn't
  66025. // the result of another mergeOptions call.
  66026. // Only merged options has the _base property.
  66027. if (!child._base) {
  66028. if (child.extends) {
  66029. parent = mergeOptions(parent, child.extends, vm);
  66030. }
  66031. if (child.mixins) {
  66032. for (var i = 0, l = child.mixins.length; i < l; i++) {
  66033. parent = mergeOptions(parent, child.mixins[i], vm);
  66034. }
  66035. }
  66036. }
  66037. var options = {};
  66038. var key;
  66039. for (key in parent) {
  66040. mergeField(key);
  66041. }
  66042. for (key in child) {
  66043. if (!hasOwn(parent, key)) {
  66044. mergeField(key);
  66045. }
  66046. }
  66047. function mergeField (key) {
  66048. var strat = strats[key] || defaultStrat;
  66049. options[key] = strat(parent[key], child[key], vm, key);
  66050. }
  66051. return options
  66052. }
  66053. /**
  66054. * Resolve an asset.
  66055. * This function is used because child instances need access
  66056. * to assets defined in its ancestor chain.
  66057. */
  66058. function resolveAsset (
  66059. options,
  66060. type,
  66061. id,
  66062. warnMissing
  66063. ) {
  66064. /* istanbul ignore if */
  66065. if (typeof id !== 'string') {
  66066. return
  66067. }
  66068. var assets = options[type];
  66069. // check local registration variations first
  66070. if (hasOwn(assets, id)) { return assets[id] }
  66071. var camelizedId = camelize(id);
  66072. if (hasOwn(assets, camelizedId)) { return assets[camelizedId] }
  66073. var PascalCaseId = capitalize(camelizedId);
  66074. if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] }
  66075. // fallback to prototype chain
  66076. var res = assets[id] || assets[camelizedId] || assets[PascalCaseId];
  66077. if (warnMissing && !res) {
  66078. warn(
  66079. 'Failed to resolve ' + type.slice(0, -1) + ': ' + id,
  66080. options
  66081. );
  66082. }
  66083. return res
  66084. }
  66085. /* */
  66086. function validateProp (
  66087. key,
  66088. propOptions,
  66089. propsData,
  66090. vm
  66091. ) {
  66092. var prop = propOptions[key];
  66093. var absent = !hasOwn(propsData, key);
  66094. var value = propsData[key];
  66095. // boolean casting
  66096. var booleanIndex = getTypeIndex(Boolean, prop.type);
  66097. if (booleanIndex > -1) {
  66098. if (absent && !hasOwn(prop, 'default')) {
  66099. value = false;
  66100. } else if (value === '' || value === hyphenate(key)) {
  66101. // only cast empty string / same name to boolean if
  66102. // boolean has higher priority
  66103. var stringIndex = getTypeIndex(String, prop.type);
  66104. if (stringIndex < 0 || booleanIndex < stringIndex) {
  66105. value = true;
  66106. }
  66107. }
  66108. }
  66109. // check default value
  66110. if (value === undefined) {
  66111. value = getPropDefaultValue(vm, prop, key);
  66112. // since the default value is a fresh copy,
  66113. // make sure to observe it.
  66114. var prevShouldObserve = shouldObserve;
  66115. toggleObserving(true);
  66116. observe(value);
  66117. toggleObserving(prevShouldObserve);
  66118. }
  66119. {
  66120. assertProp(prop, key, value, vm, absent);
  66121. }
  66122. return value
  66123. }
  66124. /**
  66125. * Get the default value of a prop.
  66126. */
  66127. function getPropDefaultValue (vm, prop, key) {
  66128. // no default, return undefined
  66129. if (!hasOwn(prop, 'default')) {
  66130. return undefined
  66131. }
  66132. var def = prop.default;
  66133. // warn against non-factory defaults for Object & Array
  66134. if (isObject(def)) {
  66135. warn(
  66136. 'Invalid default value for prop "' + key + '": ' +
  66137. 'Props with type Object/Array must use a factory function ' +
  66138. 'to return the default value.',
  66139. vm
  66140. );
  66141. }
  66142. // the raw prop value was also undefined from previous render,
  66143. // return previous default value to avoid unnecessary watcher trigger
  66144. if (vm && vm.$options.propsData &&
  66145. vm.$options.propsData[key] === undefined &&
  66146. vm._props[key] !== undefined
  66147. ) {
  66148. return vm._props[key]
  66149. }
  66150. // call factory function for non-Function types
  66151. // a value is Function if its prototype is function even across different execution context
  66152. return typeof def === 'function' && getType(prop.type) !== 'Function'
  66153. ? def.call(vm)
  66154. : def
  66155. }
  66156. /**
  66157. * Assert whether a prop is valid.
  66158. */
  66159. function assertProp (
  66160. prop,
  66161. name,
  66162. value,
  66163. vm,
  66164. absent
  66165. ) {
  66166. if (prop.required && absent) {
  66167. warn(
  66168. 'Missing required prop: "' + name + '"',
  66169. vm
  66170. );
  66171. return
  66172. }
  66173. if (value == null && !prop.required) {
  66174. return
  66175. }
  66176. var type = prop.type;
  66177. var valid = !type || type === true;
  66178. var expectedTypes = [];
  66179. if (type) {
  66180. if (!Array.isArray(type)) {
  66181. type = [type];
  66182. }
  66183. for (var i = 0; i < type.length && !valid; i++) {
  66184. var assertedType = assertType(value, type[i]);
  66185. expectedTypes.push(assertedType.expectedType || '');
  66186. valid = assertedType.valid;
  66187. }
  66188. }
  66189. if (!valid) {
  66190. warn(
  66191. getInvalidTypeMessage(name, value, expectedTypes),
  66192. vm
  66193. );
  66194. return
  66195. }
  66196. var validator = prop.validator;
  66197. if (validator) {
  66198. if (!validator(value)) {
  66199. warn(
  66200. 'Invalid prop: custom validator check failed for prop "' + name + '".',
  66201. vm
  66202. );
  66203. }
  66204. }
  66205. }
  66206. var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
  66207. function assertType (value, type) {
  66208. var valid;
  66209. var expectedType = getType(type);
  66210. if (simpleCheckRE.test(expectedType)) {
  66211. var t = typeof value;
  66212. valid = t === expectedType.toLowerCase();
  66213. // for primitive wrapper objects
  66214. if (!valid && t === 'object') {
  66215. valid = value instanceof type;
  66216. }
  66217. } else if (expectedType === 'Object') {
  66218. valid = isPlainObject(value);
  66219. } else if (expectedType === 'Array') {
  66220. valid = Array.isArray(value);
  66221. } else {
  66222. valid = value instanceof type;
  66223. }
  66224. return {
  66225. valid: valid,
  66226. expectedType: expectedType
  66227. }
  66228. }
  66229. /**
  66230. * Use function string name to check built-in types,
  66231. * because a simple equality check will fail when running
  66232. * across different vms / iframes.
  66233. */
  66234. function getType (fn) {
  66235. var match = fn && fn.toString().match(/^\s*function (\w+)/);
  66236. return match ? match[1] : ''
  66237. }
  66238. function isSameType (a, b) {
  66239. return getType(a) === getType(b)
  66240. }
  66241. function getTypeIndex (type, expectedTypes) {
  66242. if (!Array.isArray(expectedTypes)) {
  66243. return isSameType(expectedTypes, type) ? 0 : -1
  66244. }
  66245. for (var i = 0, len = expectedTypes.length; i < len; i++) {
  66246. if (isSameType(expectedTypes[i], type)) {
  66247. return i
  66248. }
  66249. }
  66250. return -1
  66251. }
  66252. function getInvalidTypeMessage (name, value, expectedTypes) {
  66253. var message = "Invalid prop: type check failed for prop \"" + name + "\"." +
  66254. " Expected " + (expectedTypes.map(capitalize).join(', '));
  66255. var expectedType = expectedTypes[0];
  66256. var receivedType = toRawType(value);
  66257. var expectedValue = styleValue(value, expectedType);
  66258. var receivedValue = styleValue(value, receivedType);
  66259. // check if we need to specify expected value
  66260. if (expectedTypes.length === 1 &&
  66261. isExplicable(expectedType) &&
  66262. !isBoolean(expectedType, receivedType)) {
  66263. message += " with value " + expectedValue;
  66264. }
  66265. message += ", got " + receivedType + " ";
  66266. // check if we need to specify received value
  66267. if (isExplicable(receivedType)) {
  66268. message += "with value " + receivedValue + ".";
  66269. }
  66270. return message
  66271. }
  66272. function styleValue (value, type) {
  66273. if (type === 'String') {
  66274. return ("\"" + value + "\"")
  66275. } else if (type === 'Number') {
  66276. return ("" + (Number(value)))
  66277. } else {
  66278. return ("" + value)
  66279. }
  66280. }
  66281. function isExplicable (value) {
  66282. var explicitTypes = ['string', 'number', 'boolean'];
  66283. return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
  66284. }
  66285. function isBoolean () {
  66286. var args = [], len = arguments.length;
  66287. while ( len-- ) args[ len ] = arguments[ len ];
  66288. return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; })
  66289. }
  66290. /* */
  66291. function handleError (err, vm, info) {
  66292. // Deactivate deps tracking while processing error handler to avoid possible infinite rendering.
  66293. // See: https://github.com/vuejs/vuex/issues/1505
  66294. pushTarget();
  66295. try {
  66296. if (vm) {
  66297. var cur = vm;
  66298. while ((cur = cur.$parent)) {
  66299. var hooks = cur.$options.errorCaptured;
  66300. if (hooks) {
  66301. for (var i = 0; i < hooks.length; i++) {
  66302. try {
  66303. var capture = hooks[i].call(cur, err, vm, info) === false;
  66304. if (capture) { return }
  66305. } catch (e) {
  66306. globalHandleError(e, cur, 'errorCaptured hook');
  66307. }
  66308. }
  66309. }
  66310. }
  66311. }
  66312. globalHandleError(err, vm, info);
  66313. } finally {
  66314. popTarget();
  66315. }
  66316. }
  66317. function invokeWithErrorHandling (
  66318. handler,
  66319. context,
  66320. args,
  66321. vm,
  66322. info
  66323. ) {
  66324. var res;
  66325. try {
  66326. res = args ? handler.apply(context, args) : handler.call(context);
  66327. if (res && !res._isVue && isPromise(res) && !res._handled) {
  66328. res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); });
  66329. // issue #9511
  66330. // avoid catch triggering multiple times when nested calls
  66331. res._handled = true;
  66332. }
  66333. } catch (e) {
  66334. handleError(e, vm, info);
  66335. }
  66336. return res
  66337. }
  66338. function globalHandleError (err, vm, info) {
  66339. if (config.errorHandler) {
  66340. try {
  66341. return config.errorHandler.call(null, err, vm, info)
  66342. } catch (e) {
  66343. // if the user intentionally throws the original error in the handler,
  66344. // do not log it twice
  66345. if (e !== err) {
  66346. logError(e, null, 'config.errorHandler');
  66347. }
  66348. }
  66349. }
  66350. logError(err, vm, info);
  66351. }
  66352. function logError (err, vm, info) {
  66353. {
  66354. warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm);
  66355. }
  66356. /* istanbul ignore else */
  66357. if ((inBrowser || inWeex) && typeof console !== 'undefined') {
  66358. console.error(err);
  66359. } else {
  66360. throw err
  66361. }
  66362. }
  66363. /* */
  66364. var isUsingMicroTask = false;
  66365. var callbacks = [];
  66366. var pending = false;
  66367. function flushCallbacks () {
  66368. pending = false;
  66369. var copies = callbacks.slice(0);
  66370. callbacks.length = 0;
  66371. for (var i = 0; i < copies.length; i++) {
  66372. copies[i]();
  66373. }
  66374. }
  66375. // Here we have async deferring wrappers using microtasks.
  66376. // In 2.5 we used (macro) tasks (in combination with microtasks).
  66377. // However, it has subtle problems when state is changed right before repaint
  66378. // (e.g. #6813, out-in transitions).
  66379. // Also, using (macro) tasks in event handler would cause some weird behaviors
  66380. // that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109).
  66381. // So we now use microtasks everywhere, again.
  66382. // A major drawback of this tradeoff is that there are some scenarios
  66383. // where microtasks have too high a priority and fire in between supposedly
  66384. // sequential events (e.g. #4521, #6690, which have workarounds)
  66385. // or even between bubbling of the same event (#6566).
  66386. var timerFunc;
  66387. // The nextTick behavior leverages the microtask queue, which can be accessed
  66388. // via either native Promise.then or MutationObserver.
  66389. // MutationObserver has wider support, however it is seriously bugged in
  66390. // UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It
  66391. // completely stops working after triggering a few times... so, if native
  66392. // Promise is available, we will use it:
  66393. /* istanbul ignore next, $flow-disable-line */
  66394. if (typeof Promise !== 'undefined' && isNative(Promise)) {
  66395. var p = Promise.resolve();
  66396. timerFunc = function () {
  66397. p.then(flushCallbacks);
  66398. // In problematic UIWebViews, Promise.then doesn't completely break, but
  66399. // it can get stuck in a weird state where callbacks are pushed into the
  66400. // microtask queue but the queue isn't being flushed, until the browser
  66401. // needs to do some other work, e.g. handle a timer. Therefore we can
  66402. // "force" the microtask queue to be flushed by adding an empty timer.
  66403. if (isIOS) { setTimeout(noop); }
  66404. };
  66405. isUsingMicroTask = true;
  66406. } else if (!isIE && typeof MutationObserver !== 'undefined' && (
  66407. isNative(MutationObserver) ||
  66408. // PhantomJS and iOS 7.x
  66409. MutationObserver.toString() === '[object MutationObserverConstructor]'
  66410. )) {
  66411. // Use MutationObserver where native Promise is not available,
  66412. // e.g. PhantomJS, iOS7, Android 4.4
  66413. // (#6466 MutationObserver is unreliable in IE11)
  66414. var counter = 1;
  66415. var observer = new MutationObserver(flushCallbacks);
  66416. var textNode = document.createTextNode(String(counter));
  66417. observer.observe(textNode, {
  66418. characterData: true
  66419. });
  66420. timerFunc = function () {
  66421. counter = (counter + 1) % 2;
  66422. textNode.data = String(counter);
  66423. };
  66424. isUsingMicroTask = true;
  66425. } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
  66426. // Fallback to setImmediate.
  66427. // Technically it leverages the (macro) task queue,
  66428. // but it is still a better choice than setTimeout.
  66429. timerFunc = function () {
  66430. setImmediate(flushCallbacks);
  66431. };
  66432. } else {
  66433. // Fallback to setTimeout.
  66434. timerFunc = function () {
  66435. setTimeout(flushCallbacks, 0);
  66436. };
  66437. }
  66438. function nextTick (cb, ctx) {
  66439. var _resolve;
  66440. callbacks.push(function () {
  66441. if (cb) {
  66442. try {
  66443. cb.call(ctx);
  66444. } catch (e) {
  66445. handleError(e, ctx, 'nextTick');
  66446. }
  66447. } else if (_resolve) {
  66448. _resolve(ctx);
  66449. }
  66450. });
  66451. if (!pending) {
  66452. pending = true;
  66453. timerFunc();
  66454. }
  66455. // $flow-disable-line
  66456. if (!cb && typeof Promise !== 'undefined') {
  66457. return new Promise(function (resolve) {
  66458. _resolve = resolve;
  66459. })
  66460. }
  66461. }
  66462. /* */
  66463. var mark;
  66464. var measure;
  66465. {
  66466. var perf = inBrowser && window.performance;
  66467. /* istanbul ignore if */
  66468. if (
  66469. perf &&
  66470. perf.mark &&
  66471. perf.measure &&
  66472. perf.clearMarks &&
  66473. perf.clearMeasures
  66474. ) {
  66475. mark = function (tag) { return perf.mark(tag); };
  66476. measure = function (name, startTag, endTag) {
  66477. perf.measure(name, startTag, endTag);
  66478. perf.clearMarks(startTag);
  66479. perf.clearMarks(endTag);
  66480. // perf.clearMeasures(name)
  66481. };
  66482. }
  66483. }
  66484. /* not type checking this file because flow doesn't play well with Proxy */
  66485. var initProxy;
  66486. {
  66487. var allowedGlobals = makeMap(
  66488. 'Infinity,undefined,NaN,isFinite,isNaN,' +
  66489. 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
  66490. 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
  66491. 'require' // for Webpack/Browserify
  66492. );
  66493. var warnNonPresent = function (target, key) {
  66494. warn(
  66495. "Property or method \"" + key + "\" is not defined on the instance but " +
  66496. 'referenced during render. Make sure that this property is reactive, ' +
  66497. 'either in the data option, or for class-based components, by ' +
  66498. 'initializing the property. ' +
  66499. 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.',
  66500. target
  66501. );
  66502. };
  66503. var warnReservedPrefix = function (target, key) {
  66504. warn(
  66505. "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
  66506. 'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
  66507. 'prevent conflicts with Vue internals. ' +
  66508. 'See: https://vuejs.org/v2/api/#data',
  66509. target
  66510. );
  66511. };
  66512. var hasProxy =
  66513. typeof Proxy !== 'undefined' && isNative(Proxy);
  66514. if (hasProxy) {
  66515. var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact');
  66516. config.keyCodes = new Proxy(config.keyCodes, {
  66517. set: function set (target, key, value) {
  66518. if (isBuiltInModifier(key)) {
  66519. warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key));
  66520. return false
  66521. } else {
  66522. target[key] = value;
  66523. return true
  66524. }
  66525. }
  66526. });
  66527. }
  66528. var hasHandler = {
  66529. has: function has (target, key) {
  66530. var has = key in target;
  66531. var isAllowed = allowedGlobals(key) ||
  66532. (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data));
  66533. if (!has && !isAllowed) {
  66534. if (key in target.$data) { warnReservedPrefix(target, key); }
  66535. else { warnNonPresent(target, key); }
  66536. }
  66537. return has || !isAllowed
  66538. }
  66539. };
  66540. var getHandler = {
  66541. get: function get (target, key) {
  66542. if (typeof key === 'string' && !(key in target)) {
  66543. if (key in target.$data) { warnReservedPrefix(target, key); }
  66544. else { warnNonPresent(target, key); }
  66545. }
  66546. return target[key]
  66547. }
  66548. };
  66549. initProxy = function initProxy (vm) {
  66550. if (hasProxy) {
  66551. // determine which proxy handler to use
  66552. var options = vm.$options;
  66553. var handlers = options.render && options.render._withStripped
  66554. ? getHandler
  66555. : hasHandler;
  66556. vm._renderProxy = new Proxy(vm, handlers);
  66557. } else {
  66558. vm._renderProxy = vm;
  66559. }
  66560. };
  66561. }
  66562. /* */
  66563. var seenObjects = new _Set();
  66564. /**
  66565. * Recursively traverse an object to evoke all converted
  66566. * getters, so that every nested property inside the object
  66567. * is collected as a "deep" dependency.
  66568. */
  66569. function traverse (val) {
  66570. _traverse(val, seenObjects);
  66571. seenObjects.clear();
  66572. }
  66573. function _traverse (val, seen) {
  66574. var i, keys;
  66575. var isA = Array.isArray(val);
  66576. if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) {
  66577. return
  66578. }
  66579. if (val.__ob__) {
  66580. var depId = val.__ob__.dep.id;
  66581. if (seen.has(depId)) {
  66582. return
  66583. }
  66584. seen.add(depId);
  66585. }
  66586. if (isA) {
  66587. i = val.length;
  66588. while (i--) { _traverse(val[i], seen); }
  66589. } else {
  66590. keys = Object.keys(val);
  66591. i = keys.length;
  66592. while (i--) { _traverse(val[keys[i]], seen); }
  66593. }
  66594. }
  66595. /* */
  66596. var normalizeEvent = cached(function (name) {
  66597. var passive = name.charAt(0) === '&';
  66598. name = passive ? name.slice(1) : name;
  66599. var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first
  66600. name = once$$1 ? name.slice(1) : name;
  66601. var capture = name.charAt(0) === '!';
  66602. name = capture ? name.slice(1) : name;
  66603. return {
  66604. name: name,
  66605. once: once$$1,
  66606. capture: capture,
  66607. passive: passive
  66608. }
  66609. });
  66610. function createFnInvoker (fns, vm) {
  66611. function invoker () {
  66612. var arguments$1 = arguments;
  66613. var fns = invoker.fns;
  66614. if (Array.isArray(fns)) {
  66615. var cloned = fns.slice();
  66616. for (var i = 0; i < cloned.length; i++) {
  66617. invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler");
  66618. }
  66619. } else {
  66620. // return handler return value for single handlers
  66621. return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler")
  66622. }
  66623. }
  66624. invoker.fns = fns;
  66625. return invoker
  66626. }
  66627. function updateListeners (
  66628. on,
  66629. oldOn,
  66630. add,
  66631. remove$$1,
  66632. createOnceHandler,
  66633. vm
  66634. ) {
  66635. var name, def$$1, cur, old, event;
  66636. for (name in on) {
  66637. def$$1 = cur = on[name];
  66638. old = oldOn[name];
  66639. event = normalizeEvent(name);
  66640. if (isUndef(cur)) {
  66641. warn(
  66642. "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
  66643. vm
  66644. );
  66645. } else if (isUndef(old)) {
  66646. if (isUndef(cur.fns)) {
  66647. cur = on[name] = createFnInvoker(cur, vm);
  66648. }
  66649. if (isTrue(event.once)) {
  66650. cur = on[name] = createOnceHandler(event.name, cur, event.capture);
  66651. }
  66652. add(event.name, cur, event.capture, event.passive, event.params);
  66653. } else if (cur !== old) {
  66654. old.fns = cur;
  66655. on[name] = old;
  66656. }
  66657. }
  66658. for (name in oldOn) {
  66659. if (isUndef(on[name])) {
  66660. event = normalizeEvent(name);
  66661. remove$$1(event.name, oldOn[name], event.capture);
  66662. }
  66663. }
  66664. }
  66665. /* */
  66666. function mergeVNodeHook (def, hookKey, hook) {
  66667. if (def instanceof VNode) {
  66668. def = def.data.hook || (def.data.hook = {});
  66669. }
  66670. var invoker;
  66671. var oldHook = def[hookKey];
  66672. function wrappedHook () {
  66673. hook.apply(this, arguments);
  66674. // important: remove merged hook to ensure it's called only once
  66675. // and prevent memory leak
  66676. remove(invoker.fns, wrappedHook);
  66677. }
  66678. if (isUndef(oldHook)) {
  66679. // no existing hook
  66680. invoker = createFnInvoker([wrappedHook]);
  66681. } else {
  66682. /* istanbul ignore if */
  66683. if (isDef(oldHook.fns) && isTrue(oldHook.merged)) {
  66684. // already a merged invoker
  66685. invoker = oldHook;
  66686. invoker.fns.push(wrappedHook);
  66687. } else {
  66688. // existing plain hook
  66689. invoker = createFnInvoker([oldHook, wrappedHook]);
  66690. }
  66691. }
  66692. invoker.merged = true;
  66693. def[hookKey] = invoker;
  66694. }
  66695. /* */
  66696. function extractPropsFromVNodeData (
  66697. data,
  66698. Ctor,
  66699. tag
  66700. ) {
  66701. // we are only extracting raw values here.
  66702. // validation and default values are handled in the child
  66703. // component itself.
  66704. var propOptions = Ctor.options.props;
  66705. if (isUndef(propOptions)) {
  66706. return
  66707. }
  66708. var res = {};
  66709. var attrs = data.attrs;
  66710. var props = data.props;
  66711. if (isDef(attrs) || isDef(props)) {
  66712. for (var key in propOptions) {
  66713. var altKey = hyphenate(key);
  66714. {
  66715. var keyInLowerCase = key.toLowerCase();
  66716. if (
  66717. key !== keyInLowerCase &&
  66718. attrs && hasOwn(attrs, keyInLowerCase)
  66719. ) {
  66720. tip(
  66721. "Prop \"" + keyInLowerCase + "\" is passed to component " +
  66722. (formatComponentName(tag || Ctor)) + ", but the declared prop name is" +
  66723. " \"" + key + "\". " +
  66724. "Note that HTML attributes are case-insensitive and camelCased " +
  66725. "props need to use their kebab-case equivalents when using in-DOM " +
  66726. "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"."
  66727. );
  66728. }
  66729. }
  66730. checkProp(res, props, key, altKey, true) ||
  66731. checkProp(res, attrs, key, altKey, false);
  66732. }
  66733. }
  66734. return res
  66735. }
  66736. function checkProp (
  66737. res,
  66738. hash,
  66739. key,
  66740. altKey,
  66741. preserve
  66742. ) {
  66743. if (isDef(hash)) {
  66744. if (hasOwn(hash, key)) {
  66745. res[key] = hash[key];
  66746. if (!preserve) {
  66747. delete hash[key];
  66748. }
  66749. return true
  66750. } else if (hasOwn(hash, altKey)) {
  66751. res[key] = hash[altKey];
  66752. if (!preserve) {
  66753. delete hash[altKey];
  66754. }
  66755. return true
  66756. }
  66757. }
  66758. return false
  66759. }
  66760. /* */
  66761. // The template compiler attempts to minimize the need for normalization by
  66762. // statically analyzing the template at compile time.
  66763. //
  66764. // For plain HTML markup, normalization can be completely skipped because the
  66765. // generated render function is guaranteed to return Array<VNode>. There are
  66766. // two cases where extra normalization is needed:
  66767. // 1. When the children contains components - because a functional component
  66768. // may return an Array instead of a single root. In this case, just a simple
  66769. // normalization is needed - if any child is an Array, we flatten the whole
  66770. // thing with Array.prototype.concat. It is guaranteed to be only 1-level deep
  66771. // because functional components already normalize their own children.
  66772. function simpleNormalizeChildren (children) {
  66773. for (var i = 0; i < children.length; i++) {
  66774. if (Array.isArray(children[i])) {
  66775. return Array.prototype.concat.apply([], children)
  66776. }
  66777. }
  66778. return children
  66779. }
  66780. // 2. When the children contains constructs that always generated nested Arrays,
  66781. // e.g. <template>, <slot>, v-for, or when the children is provided by user
  66782. // with hand-written render functions / JSX. In such cases a full normalization
  66783. // is needed to cater to all possible types of children values.
  66784. function normalizeChildren (children) {
  66785. return isPrimitive(children)
  66786. ? [createTextVNode(children)]
  66787. : Array.isArray(children)
  66788. ? normalizeArrayChildren(children)
  66789. : undefined
  66790. }
  66791. function isTextNode (node) {
  66792. return isDef(node) && isDef(node.text) && isFalse(node.isComment)
  66793. }
  66794. function normalizeArrayChildren (children, nestedIndex) {
  66795. var res = [];
  66796. var i, c, lastIndex, last;
  66797. for (i = 0; i < children.length; i++) {
  66798. c = children[i];
  66799. if (isUndef(c) || typeof c === 'boolean') { continue }
  66800. lastIndex = res.length - 1;
  66801. last = res[lastIndex];
  66802. // nested
  66803. if (Array.isArray(c)) {
  66804. if (c.length > 0) {
  66805. c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i));
  66806. // merge adjacent text nodes
  66807. if (isTextNode(c[0]) && isTextNode(last)) {
  66808. res[lastIndex] = createTextVNode(last.text + (c[0]).text);
  66809. c.shift();
  66810. }
  66811. res.push.apply(res, c);
  66812. }
  66813. } else if (isPrimitive(c)) {
  66814. if (isTextNode(last)) {
  66815. // merge adjacent text nodes
  66816. // this is necessary for SSR hydration because text nodes are
  66817. // essentially merged when rendered to HTML strings
  66818. res[lastIndex] = createTextVNode(last.text + c);
  66819. } else if (c !== '') {
  66820. // convert primitive to vnode
  66821. res.push(createTextVNode(c));
  66822. }
  66823. } else {
  66824. if (isTextNode(c) && isTextNode(last)) {
  66825. // merge adjacent text nodes
  66826. res[lastIndex] = createTextVNode(last.text + c.text);
  66827. } else {
  66828. // default key for nested array children (likely generated by v-for)
  66829. if (isTrue(children._isVList) &&
  66830. isDef(c.tag) &&
  66831. isUndef(c.key) &&
  66832. isDef(nestedIndex)) {
  66833. c.key = "__vlist" + nestedIndex + "_" + i + "__";
  66834. }
  66835. res.push(c);
  66836. }
  66837. }
  66838. }
  66839. return res
  66840. }
  66841. /* */
  66842. function initProvide (vm) {
  66843. var provide = vm.$options.provide;
  66844. if (provide) {
  66845. vm._provided = typeof provide === 'function'
  66846. ? provide.call(vm)
  66847. : provide;
  66848. }
  66849. }
  66850. function initInjections (vm) {
  66851. var result = resolveInject(vm.$options.inject, vm);
  66852. if (result) {
  66853. toggleObserving(false);
  66854. Object.keys(result).forEach(function (key) {
  66855. /* istanbul ignore else */
  66856. {
  66857. defineReactive$$1(vm, key, result[key], function () {
  66858. warn(
  66859. "Avoid mutating an injected value directly since the changes will be " +
  66860. "overwritten whenever the provided component re-renders. " +
  66861. "injection being mutated: \"" + key + "\"",
  66862. vm
  66863. );
  66864. });
  66865. }
  66866. });
  66867. toggleObserving(true);
  66868. }
  66869. }
  66870. function resolveInject (inject, vm) {
  66871. if (inject) {
  66872. // inject is :any because flow is not smart enough to figure out cached
  66873. var result = Object.create(null);
  66874. var keys = hasSymbol
  66875. ? Reflect.ownKeys(inject)
  66876. : Object.keys(inject);
  66877. for (var i = 0; i < keys.length; i++) {
  66878. var key = keys[i];
  66879. // #6574 in case the inject object is observed...
  66880. if (key === '__ob__') { continue }
  66881. var provideKey = inject[key].from;
  66882. var source = vm;
  66883. while (source) {
  66884. if (source._provided && hasOwn(source._provided, provideKey)) {
  66885. result[key] = source._provided[provideKey];
  66886. break
  66887. }
  66888. source = source.$parent;
  66889. }
  66890. if (!source) {
  66891. if ('default' in inject[key]) {
  66892. var provideDefault = inject[key].default;
  66893. result[key] = typeof provideDefault === 'function'
  66894. ? provideDefault.call(vm)
  66895. : provideDefault;
  66896. } else {
  66897. warn(("Injection \"" + key + "\" not found"), vm);
  66898. }
  66899. }
  66900. }
  66901. return result
  66902. }
  66903. }
  66904. /* */
  66905. /**
  66906. * Runtime helper for resolving raw children VNodes into a slot object.
  66907. */
  66908. function resolveSlots (
  66909. children,
  66910. context
  66911. ) {
  66912. if (!children || !children.length) {
  66913. return {}
  66914. }
  66915. var slots = {};
  66916. for (var i = 0, l = children.length; i < l; i++) {
  66917. var child = children[i];
  66918. var data = child.data;
  66919. // remove slot attribute if the node is resolved as a Vue slot node
  66920. if (data && data.attrs && data.attrs.slot) {
  66921. delete data.attrs.slot;
  66922. }
  66923. // named slots should only be respected if the vnode was rendered in the
  66924. // same context.
  66925. if ((child.context === context || child.fnContext === context) &&
  66926. data && data.slot != null
  66927. ) {
  66928. var name = data.slot;
  66929. var slot = (slots[name] || (slots[name] = []));
  66930. if (child.tag === 'template') {
  66931. slot.push.apply(slot, child.children || []);
  66932. } else {
  66933. slot.push(child);
  66934. }
  66935. } else {
  66936. (slots.default || (slots.default = [])).push(child);
  66937. }
  66938. }
  66939. // ignore slots that contains only whitespace
  66940. for (var name$1 in slots) {
  66941. if (slots[name$1].every(isWhitespace)) {
  66942. delete slots[name$1];
  66943. }
  66944. }
  66945. return slots
  66946. }
  66947. function isWhitespace (node) {
  66948. return (node.isComment && !node.asyncFactory) || node.text === ' '
  66949. }
  66950. /* */
  66951. function normalizeScopedSlots (
  66952. slots,
  66953. normalSlots,
  66954. prevSlots
  66955. ) {
  66956. var res;
  66957. var hasNormalSlots = Object.keys(normalSlots).length > 0;
  66958. var isStable = slots ? !!slots.$stable : !hasNormalSlots;
  66959. var key = slots && slots.$key;
  66960. if (!slots) {
  66961. res = {};
  66962. } else if (slots._normalized) {
  66963. // fast path 1: child component re-render only, parent did not change
  66964. return slots._normalized
  66965. } else if (
  66966. isStable &&
  66967. prevSlots &&
  66968. prevSlots !== emptyObject &&
  66969. key === prevSlots.$key &&
  66970. !hasNormalSlots &&
  66971. !prevSlots.$hasNormal
  66972. ) {
  66973. // fast path 2: stable scoped slots w/ no normal slots to proxy,
  66974. // only need to normalize once
  66975. return prevSlots
  66976. } else {
  66977. res = {};
  66978. for (var key$1 in slots) {
  66979. if (slots[key$1] && key$1[0] !== '$') {
  66980. res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]);
  66981. }
  66982. }
  66983. }
  66984. // expose normal slots on scopedSlots
  66985. for (var key$2 in normalSlots) {
  66986. if (!(key$2 in res)) {
  66987. res[key$2] = proxyNormalSlot(normalSlots, key$2);
  66988. }
  66989. }
  66990. // avoriaz seems to mock a non-extensible $scopedSlots object
  66991. // and when that is passed down this would cause an error
  66992. if (slots && Object.isExtensible(slots)) {
  66993. (slots)._normalized = res;
  66994. }
  66995. def(res, '$stable', isStable);
  66996. def(res, '$key', key);
  66997. def(res, '$hasNormal', hasNormalSlots);
  66998. return res
  66999. }
  67000. function normalizeScopedSlot(normalSlots, key, fn) {
  67001. var normalized = function () {
  67002. var res = arguments.length ? fn.apply(null, arguments) : fn({});
  67003. res = res && typeof res === 'object' && !Array.isArray(res)
  67004. ? [res] // single vnode
  67005. : normalizeChildren(res);
  67006. return res && (
  67007. res.length === 0 ||
  67008. (res.length === 1 && res[0].isComment) // #9658
  67009. ) ? undefined
  67010. : res
  67011. };
  67012. // this is a slot using the new v-slot syntax without scope. although it is
  67013. // compiled as a scoped slot, render fn users would expect it to be present
  67014. // on this.$slots because the usage is semantically a normal slot.
  67015. if (fn.proxy) {
  67016. Object.defineProperty(normalSlots, key, {
  67017. get: normalized,
  67018. enumerable: true,
  67019. configurable: true
  67020. });
  67021. }
  67022. return normalized
  67023. }
  67024. function proxyNormalSlot(slots, key) {
  67025. return function () { return slots[key]; }
  67026. }
  67027. /* */
  67028. /**
  67029. * Runtime helper for rendering v-for lists.
  67030. */
  67031. function renderList (
  67032. val,
  67033. render
  67034. ) {
  67035. var ret, i, l, keys, key;
  67036. if (Array.isArray(val) || typeof val === 'string') {
  67037. ret = new Array(val.length);
  67038. for (i = 0, l = val.length; i < l; i++) {
  67039. ret[i] = render(val[i], i);
  67040. }
  67041. } else if (typeof val === 'number') {
  67042. ret = new Array(val);
  67043. for (i = 0; i < val; i++) {
  67044. ret[i] = render(i + 1, i);
  67045. }
  67046. } else if (isObject(val)) {
  67047. if (hasSymbol && val[Symbol.iterator]) {
  67048. ret = [];
  67049. var iterator = val[Symbol.iterator]();
  67050. var result = iterator.next();
  67051. while (!result.done) {
  67052. ret.push(render(result.value, ret.length));
  67053. result = iterator.next();
  67054. }
  67055. } else {
  67056. keys = Object.keys(val);
  67057. ret = new Array(keys.length);
  67058. for (i = 0, l = keys.length; i < l; i++) {
  67059. key = keys[i];
  67060. ret[i] = render(val[key], key, i);
  67061. }
  67062. }
  67063. }
  67064. if (!isDef(ret)) {
  67065. ret = [];
  67066. }
  67067. (ret)._isVList = true;
  67068. return ret
  67069. }
  67070. /* */
  67071. /**
  67072. * Runtime helper for rendering <slot>
  67073. */
  67074. function renderSlot (
  67075. name,
  67076. fallback,
  67077. props,
  67078. bindObject
  67079. ) {
  67080. var scopedSlotFn = this.$scopedSlots[name];
  67081. var nodes;
  67082. if (scopedSlotFn) { // scoped slot
  67083. props = props || {};
  67084. if (bindObject) {
  67085. if (!isObject(bindObject)) {
  67086. warn(
  67087. 'slot v-bind without argument expects an Object',
  67088. this
  67089. );
  67090. }
  67091. props = extend(extend({}, bindObject), props);
  67092. }
  67093. nodes = scopedSlotFn(props) || fallback;
  67094. } else {
  67095. nodes = this.$slots[name] || fallback;
  67096. }
  67097. var target = props && props.slot;
  67098. if (target) {
  67099. return this.$createElement('template', { slot: target }, nodes)
  67100. } else {
  67101. return nodes
  67102. }
  67103. }
  67104. /* */
  67105. /**
  67106. * Runtime helper for resolving filters
  67107. */
  67108. function resolveFilter (id) {
  67109. return resolveAsset(this.$options, 'filters', id, true) || identity
  67110. }
  67111. /* */
  67112. function isKeyNotMatch (expect, actual) {
  67113. if (Array.isArray(expect)) {
  67114. return expect.indexOf(actual) === -1
  67115. } else {
  67116. return expect !== actual
  67117. }
  67118. }
  67119. /**
  67120. * Runtime helper for checking keyCodes from config.
  67121. * exposed as Vue.prototype._k
  67122. * passing in eventKeyName as last argument separately for backwards compat
  67123. */
  67124. function checkKeyCodes (
  67125. eventKeyCode,
  67126. key,
  67127. builtInKeyCode,
  67128. eventKeyName,
  67129. builtInKeyName
  67130. ) {
  67131. var mappedKeyCode = config.keyCodes[key] || builtInKeyCode;
  67132. if (builtInKeyName && eventKeyName && !config.keyCodes[key]) {
  67133. return isKeyNotMatch(builtInKeyName, eventKeyName)
  67134. } else if (mappedKeyCode) {
  67135. return isKeyNotMatch(mappedKeyCode, eventKeyCode)
  67136. } else if (eventKeyName) {
  67137. return hyphenate(eventKeyName) !== key
  67138. }
  67139. }
  67140. /* */
  67141. /**
  67142. * Runtime helper for merging v-bind="object" into a VNode's data.
  67143. */
  67144. function bindObjectProps (
  67145. data,
  67146. tag,
  67147. value,
  67148. asProp,
  67149. isSync
  67150. ) {
  67151. if (value) {
  67152. if (!isObject(value)) {
  67153. warn(
  67154. 'v-bind without argument expects an Object or Array value',
  67155. this
  67156. );
  67157. } else {
  67158. if (Array.isArray(value)) {
  67159. value = toObject(value);
  67160. }
  67161. var hash;
  67162. var loop = function ( key ) {
  67163. if (
  67164. key === 'class' ||
  67165. key === 'style' ||
  67166. isReservedAttribute(key)
  67167. ) {
  67168. hash = data;
  67169. } else {
  67170. var type = data.attrs && data.attrs.type;
  67171. hash = asProp || config.mustUseProp(tag, type, key)
  67172. ? data.domProps || (data.domProps = {})
  67173. : data.attrs || (data.attrs = {});
  67174. }
  67175. var camelizedKey = camelize(key);
  67176. var hyphenatedKey = hyphenate(key);
  67177. if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) {
  67178. hash[key] = value[key];
  67179. if (isSync) {
  67180. var on = data.on || (data.on = {});
  67181. on[("update:" + key)] = function ($event) {
  67182. value[key] = $event;
  67183. };
  67184. }
  67185. }
  67186. };
  67187. for (var key in value) loop( key );
  67188. }
  67189. }
  67190. return data
  67191. }
  67192. /* */
  67193. /**
  67194. * Runtime helper for rendering static trees.
  67195. */
  67196. function renderStatic (
  67197. index,
  67198. isInFor
  67199. ) {
  67200. var cached = this._staticTrees || (this._staticTrees = []);
  67201. var tree = cached[index];
  67202. // if has already-rendered static tree and not inside v-for,
  67203. // we can reuse the same tree.
  67204. if (tree && !isInFor) {
  67205. return tree
  67206. }
  67207. // otherwise, render a fresh tree.
  67208. tree = cached[index] = this.$options.staticRenderFns[index].call(
  67209. this._renderProxy,
  67210. null,
  67211. this // for render fns generated for functional component templates
  67212. );
  67213. markStatic(tree, ("__static__" + index), false);
  67214. return tree
  67215. }
  67216. /**
  67217. * Runtime helper for v-once.
  67218. * Effectively it means marking the node as static with a unique key.
  67219. */
  67220. function markOnce (
  67221. tree,
  67222. index,
  67223. key
  67224. ) {
  67225. markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true);
  67226. return tree
  67227. }
  67228. function markStatic (
  67229. tree,
  67230. key,
  67231. isOnce
  67232. ) {
  67233. if (Array.isArray(tree)) {
  67234. for (var i = 0; i < tree.length; i++) {
  67235. if (tree[i] && typeof tree[i] !== 'string') {
  67236. markStaticNode(tree[i], (key + "_" + i), isOnce);
  67237. }
  67238. }
  67239. } else {
  67240. markStaticNode(tree, key, isOnce);
  67241. }
  67242. }
  67243. function markStaticNode (node, key, isOnce) {
  67244. node.isStatic = true;
  67245. node.key = key;
  67246. node.isOnce = isOnce;
  67247. }
  67248. /* */
  67249. function bindObjectListeners (data, value) {
  67250. if (value) {
  67251. if (!isPlainObject(value)) {
  67252. warn(
  67253. 'v-on without argument expects an Object value',
  67254. this
  67255. );
  67256. } else {
  67257. var on = data.on = data.on ? extend({}, data.on) : {};
  67258. for (var key in value) {
  67259. var existing = on[key];
  67260. var ours = value[key];
  67261. on[key] = existing ? [].concat(existing, ours) : ours;
  67262. }
  67263. }
  67264. }
  67265. return data
  67266. }
  67267. /* */
  67268. function resolveScopedSlots (
  67269. fns, // see flow/vnode
  67270. res,
  67271. // the following are added in 2.6
  67272. hasDynamicKeys,
  67273. contentHashKey
  67274. ) {
  67275. res = res || { $stable: !hasDynamicKeys };
  67276. for (var i = 0; i < fns.length; i++) {
  67277. var slot = fns[i];
  67278. if (Array.isArray(slot)) {
  67279. resolveScopedSlots(slot, res, hasDynamicKeys);
  67280. } else if (slot) {
  67281. // marker for reverse proxying v-slot without scope on this.$slots
  67282. if (slot.proxy) {
  67283. slot.fn.proxy = true;
  67284. }
  67285. res[slot.key] = slot.fn;
  67286. }
  67287. }
  67288. if (contentHashKey) {
  67289. (res).$key = contentHashKey;
  67290. }
  67291. return res
  67292. }
  67293. /* */
  67294. function bindDynamicKeys (baseObj, values) {
  67295. for (var i = 0; i < values.length; i += 2) {
  67296. var key = values[i];
  67297. if (typeof key === 'string' && key) {
  67298. baseObj[values[i]] = values[i + 1];
  67299. } else if (key !== '' && key !== null) {
  67300. // null is a special value for explicitly removing a binding
  67301. warn(
  67302. ("Invalid value for dynamic directive argument (expected string or null): " + key),
  67303. this
  67304. );
  67305. }
  67306. }
  67307. return baseObj
  67308. }
  67309. // helper to dynamically append modifier runtime markers to event names.
  67310. // ensure only append when value is already string, otherwise it will be cast
  67311. // to string and cause the type check to miss.
  67312. function prependModifier (value, symbol) {
  67313. return typeof value === 'string' ? symbol + value : value
  67314. }
  67315. /* */
  67316. function installRenderHelpers (target) {
  67317. target._o = markOnce;
  67318. target._n = toNumber;
  67319. target._s = toString;
  67320. target._l = renderList;
  67321. target._t = renderSlot;
  67322. target._q = looseEqual;
  67323. target._i = looseIndexOf;
  67324. target._m = renderStatic;
  67325. target._f = resolveFilter;
  67326. target._k = checkKeyCodes;
  67327. target._b = bindObjectProps;
  67328. target._v = createTextVNode;
  67329. target._e = createEmptyVNode;
  67330. target._u = resolveScopedSlots;
  67331. target._g = bindObjectListeners;
  67332. target._d = bindDynamicKeys;
  67333. target._p = prependModifier;
  67334. }
  67335. /* */
  67336. function FunctionalRenderContext (
  67337. data,
  67338. props,
  67339. children,
  67340. parent,
  67341. Ctor
  67342. ) {
  67343. var this$1 = this;
  67344. var options = Ctor.options;
  67345. // ensure the createElement function in functional components
  67346. // gets a unique context - this is necessary for correct named slot check
  67347. var contextVm;
  67348. if (hasOwn(parent, '_uid')) {
  67349. contextVm = Object.create(parent);
  67350. // $flow-disable-line
  67351. contextVm._original = parent;
  67352. } else {
  67353. // the context vm passed in is a functional context as well.
  67354. // in this case we want to make sure we are able to get a hold to the
  67355. // real context instance.
  67356. contextVm = parent;
  67357. // $flow-disable-line
  67358. parent = parent._original;
  67359. }
  67360. var isCompiled = isTrue(options._compiled);
  67361. var needNormalization = !isCompiled;
  67362. this.data = data;
  67363. this.props = props;
  67364. this.children = children;
  67365. this.parent = parent;
  67366. this.listeners = data.on || emptyObject;
  67367. this.injections = resolveInject(options.inject, parent);
  67368. this.slots = function () {
  67369. if (!this$1.$slots) {
  67370. normalizeScopedSlots(
  67371. data.scopedSlots,
  67372. this$1.$slots = resolveSlots(children, parent)
  67373. );
  67374. }
  67375. return this$1.$slots
  67376. };
  67377. Object.defineProperty(this, 'scopedSlots', ({
  67378. enumerable: true,
  67379. get: function get () {
  67380. return normalizeScopedSlots(data.scopedSlots, this.slots())
  67381. }
  67382. }));
  67383. // support for compiled functional template
  67384. if (isCompiled) {
  67385. // exposing $options for renderStatic()
  67386. this.$options = options;
  67387. // pre-resolve slots for renderSlot()
  67388. this.$slots = this.slots();
  67389. this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots);
  67390. }
  67391. if (options._scopeId) {
  67392. this._c = function (a, b, c, d) {
  67393. var vnode = createElement(contextVm, a, b, c, d, needNormalization);
  67394. if (vnode && !Array.isArray(vnode)) {
  67395. vnode.fnScopeId = options._scopeId;
  67396. vnode.fnContext = parent;
  67397. }
  67398. return vnode
  67399. };
  67400. } else {
  67401. this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); };
  67402. }
  67403. }
  67404. installRenderHelpers(FunctionalRenderContext.prototype);
  67405. function createFunctionalComponent (
  67406. Ctor,
  67407. propsData,
  67408. data,
  67409. contextVm,
  67410. children
  67411. ) {
  67412. var options = Ctor.options;
  67413. var props = {};
  67414. var propOptions = options.props;
  67415. if (isDef(propOptions)) {
  67416. for (var key in propOptions) {
  67417. props[key] = validateProp(key, propOptions, propsData || emptyObject);
  67418. }
  67419. } else {
  67420. if (isDef(data.attrs)) { mergeProps(props, data.attrs); }
  67421. if (isDef(data.props)) { mergeProps(props, data.props); }
  67422. }
  67423. var renderContext = new FunctionalRenderContext(
  67424. data,
  67425. props,
  67426. children,
  67427. contextVm,
  67428. Ctor
  67429. );
  67430. var vnode = options.render.call(null, renderContext._c, renderContext);
  67431. if (vnode instanceof VNode) {
  67432. return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext)
  67433. } else if (Array.isArray(vnode)) {
  67434. var vnodes = normalizeChildren(vnode) || [];
  67435. var res = new Array(vnodes.length);
  67436. for (var i = 0; i < vnodes.length; i++) {
  67437. res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext);
  67438. }
  67439. return res
  67440. }
  67441. }
  67442. function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) {
  67443. // #7817 clone node before setting fnContext, otherwise if the node is reused
  67444. // (e.g. it was from a cached normal slot) the fnContext causes named slots
  67445. // that should not be matched to match.
  67446. var clone = cloneVNode(vnode);
  67447. clone.fnContext = contextVm;
  67448. clone.fnOptions = options;
  67449. {
  67450. (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext;
  67451. }
  67452. if (data.slot) {
  67453. (clone.data || (clone.data = {})).slot = data.slot;
  67454. }
  67455. return clone
  67456. }
  67457. function mergeProps (to, from) {
  67458. for (var key in from) {
  67459. to[camelize(key)] = from[key];
  67460. }
  67461. }
  67462. /* */
  67463. /* */
  67464. /* */
  67465. /* */
  67466. // inline hooks to be invoked on component VNodes during patch
  67467. var componentVNodeHooks = {
  67468. init: function init (vnode, hydrating) {
  67469. if (
  67470. vnode.componentInstance &&
  67471. !vnode.componentInstance._isDestroyed &&
  67472. vnode.data.keepAlive
  67473. ) {
  67474. // kept-alive components, treat as a patch
  67475. var mountedNode = vnode; // work around flow
  67476. componentVNodeHooks.prepatch(mountedNode, mountedNode);
  67477. } else {
  67478. var child = vnode.componentInstance = createComponentInstanceForVnode(
  67479. vnode,
  67480. activeInstance
  67481. );
  67482. child.$mount(hydrating ? vnode.elm : undefined, hydrating);
  67483. }
  67484. },
  67485. prepatch: function prepatch (oldVnode, vnode) {
  67486. var options = vnode.componentOptions;
  67487. var child = vnode.componentInstance = oldVnode.componentInstance;
  67488. updateChildComponent(
  67489. child,
  67490. options.propsData, // updated props
  67491. options.listeners, // updated listeners
  67492. vnode, // new parent vnode
  67493. options.children // new children
  67494. );
  67495. },
  67496. insert: function insert (vnode) {
  67497. var context = vnode.context;
  67498. var componentInstance = vnode.componentInstance;
  67499. if (!componentInstance._isMounted) {
  67500. componentInstance._isMounted = true;
  67501. callHook(componentInstance, 'mounted');
  67502. }
  67503. if (vnode.data.keepAlive) {
  67504. if (context._isMounted) {
  67505. // vue-router#1212
  67506. // During updates, a kept-alive component's child components may
  67507. // change, so directly walking the tree here may call activated hooks
  67508. // on incorrect children. Instead we push them into a queue which will
  67509. // be processed after the whole patch process ended.
  67510. queueActivatedComponent(componentInstance);
  67511. } else {
  67512. activateChildComponent(componentInstance, true /* direct */);
  67513. }
  67514. }
  67515. },
  67516. destroy: function destroy (vnode) {
  67517. var componentInstance = vnode.componentInstance;
  67518. if (!componentInstance._isDestroyed) {
  67519. if (!vnode.data.keepAlive) {
  67520. componentInstance.$destroy();
  67521. } else {
  67522. deactivateChildComponent(componentInstance, true /* direct */);
  67523. }
  67524. }
  67525. }
  67526. };
  67527. var hooksToMerge = Object.keys(componentVNodeHooks);
  67528. function createComponent (
  67529. Ctor,
  67530. data,
  67531. context,
  67532. children,
  67533. tag
  67534. ) {
  67535. if (isUndef(Ctor)) {
  67536. return
  67537. }
  67538. var baseCtor = context.$options._base;
  67539. // plain options object: turn it into a constructor
  67540. if (isObject(Ctor)) {
  67541. Ctor = baseCtor.extend(Ctor);
  67542. }
  67543. // if at this stage it's not a constructor or an async component factory,
  67544. // reject.
  67545. if (typeof Ctor !== 'function') {
  67546. {
  67547. warn(("Invalid Component definition: " + (String(Ctor))), context);
  67548. }
  67549. return
  67550. }
  67551. // async component
  67552. var asyncFactory;
  67553. if (isUndef(Ctor.cid)) {
  67554. asyncFactory = Ctor;
  67555. Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
  67556. if (Ctor === undefined) {
  67557. // return a placeholder node for async component, which is rendered
  67558. // as a comment node but preserves all the raw information for the node.
  67559. // the information will be used for async server-rendering and hydration.
  67560. return createAsyncPlaceholder(
  67561. asyncFactory,
  67562. data,
  67563. context,
  67564. children,
  67565. tag
  67566. )
  67567. }
  67568. }
  67569. data = data || {};
  67570. // resolve constructor options in case global mixins are applied after
  67571. // component constructor creation
  67572. resolveConstructorOptions(Ctor);
  67573. // transform component v-model data into props & events
  67574. if (isDef(data.model)) {
  67575. transformModel(Ctor.options, data);
  67576. }
  67577. // extract props
  67578. var propsData = extractPropsFromVNodeData(data, Ctor, tag);
  67579. // functional component
  67580. if (isTrue(Ctor.options.functional)) {
  67581. return createFunctionalComponent(Ctor, propsData, data, context, children)
  67582. }
  67583. // extract listeners, since these needs to be treated as
  67584. // child component listeners instead of DOM listeners
  67585. var listeners = data.on;
  67586. // replace with listeners with .native modifier
  67587. // so it gets processed during parent component patch.
  67588. data.on = data.nativeOn;
  67589. if (isTrue(Ctor.options.abstract)) {
  67590. // abstract components do not keep anything
  67591. // other than props & listeners & slot
  67592. // work around flow
  67593. var slot = data.slot;
  67594. data = {};
  67595. if (slot) {
  67596. data.slot = slot;
  67597. }
  67598. }
  67599. // install component management hooks onto the placeholder node
  67600. installComponentHooks(data);
  67601. // return a placeholder vnode
  67602. var name = Ctor.options.name || tag;
  67603. var vnode = new VNode(
  67604. ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')),
  67605. data, undefined, undefined, undefined, context,
  67606. { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
  67607. asyncFactory
  67608. );
  67609. return vnode
  67610. }
  67611. function createComponentInstanceForVnode (
  67612. vnode, // we know it's MountedComponentVNode but flow doesn't
  67613. parent // activeInstance in lifecycle state
  67614. ) {
  67615. var options = {
  67616. _isComponent: true,
  67617. _parentVnode: vnode,
  67618. parent: parent
  67619. };
  67620. // check inline-template render functions
  67621. var inlineTemplate = vnode.data.inlineTemplate;
  67622. if (isDef(inlineTemplate)) {
  67623. options.render = inlineTemplate.render;
  67624. options.staticRenderFns = inlineTemplate.staticRenderFns;
  67625. }
  67626. return new vnode.componentOptions.Ctor(options)
  67627. }
  67628. function installComponentHooks (data) {
  67629. var hooks = data.hook || (data.hook = {});
  67630. for (var i = 0; i < hooksToMerge.length; i++) {
  67631. var key = hooksToMerge[i];
  67632. var existing = hooks[key];
  67633. var toMerge = componentVNodeHooks[key];
  67634. if (existing !== toMerge && !(existing && existing._merged)) {
  67635. hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge;
  67636. }
  67637. }
  67638. }
  67639. function mergeHook$1 (f1, f2) {
  67640. var merged = function (a, b) {
  67641. // flow complains about extra args which is why we use any
  67642. f1(a, b);
  67643. f2(a, b);
  67644. };
  67645. merged._merged = true;
  67646. return merged
  67647. }
  67648. // transform component v-model info (value and callback) into
  67649. // prop and event handler respectively.
  67650. function transformModel (options, data) {
  67651. var prop = (options.model && options.model.prop) || 'value';
  67652. var event = (options.model && options.model.event) || 'input'
  67653. ;(data.attrs || (data.attrs = {}))[prop] = data.model.value;
  67654. var on = data.on || (data.on = {});
  67655. var existing = on[event];
  67656. var callback = data.model.callback;
  67657. if (isDef(existing)) {
  67658. if (
  67659. Array.isArray(existing)
  67660. ? existing.indexOf(callback) === -1
  67661. : existing !== callback
  67662. ) {
  67663. on[event] = [callback].concat(existing);
  67664. }
  67665. } else {
  67666. on[event] = callback;
  67667. }
  67668. }
  67669. /* */
  67670. var SIMPLE_NORMALIZE = 1;
  67671. var ALWAYS_NORMALIZE = 2;
  67672. // wrapper function for providing a more flexible interface
  67673. // without getting yelled at by flow
  67674. function createElement (
  67675. context,
  67676. tag,
  67677. data,
  67678. children,
  67679. normalizationType,
  67680. alwaysNormalize
  67681. ) {
  67682. if (Array.isArray(data) || isPrimitive(data)) {
  67683. normalizationType = children;
  67684. children = data;
  67685. data = undefined;
  67686. }
  67687. if (isTrue(alwaysNormalize)) {
  67688. normalizationType = ALWAYS_NORMALIZE;
  67689. }
  67690. return _createElement(context, tag, data, children, normalizationType)
  67691. }
  67692. function _createElement (
  67693. context,
  67694. tag,
  67695. data,
  67696. children,
  67697. normalizationType
  67698. ) {
  67699. if (isDef(data) && isDef((data).__ob__)) {
  67700. warn(
  67701. "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" +
  67702. 'Always create fresh vnode data objects in each render!',
  67703. context
  67704. );
  67705. return createEmptyVNode()
  67706. }
  67707. // object syntax in v-bind
  67708. if (isDef(data) && isDef(data.is)) {
  67709. tag = data.is;
  67710. }
  67711. if (!tag) {
  67712. // in case of component :is set to falsy value
  67713. return createEmptyVNode()
  67714. }
  67715. // warn against non-primitive key
  67716. if (isDef(data) && isDef(data.key) && !isPrimitive(data.key)
  67717. ) {
  67718. {
  67719. warn(
  67720. 'Avoid using non-primitive value as key, ' +
  67721. 'use string/number value instead.',
  67722. context
  67723. );
  67724. }
  67725. }
  67726. // support single function children as default scoped slot
  67727. if (Array.isArray(children) &&
  67728. typeof children[0] === 'function'
  67729. ) {
  67730. data = data || {};
  67731. data.scopedSlots = { default: children[0] };
  67732. children.length = 0;
  67733. }
  67734. if (normalizationType === ALWAYS_NORMALIZE) {
  67735. children = normalizeChildren(children);
  67736. } else if (normalizationType === SIMPLE_NORMALIZE) {
  67737. children = simpleNormalizeChildren(children);
  67738. }
  67739. var vnode, ns;
  67740. if (typeof tag === 'string') {
  67741. var Ctor;
  67742. ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
  67743. if (config.isReservedTag(tag)) {
  67744. // platform built-in elements
  67745. if (isDef(data) && isDef(data.nativeOn)) {
  67746. warn(
  67747. ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
  67748. context
  67749. );
  67750. }
  67751. vnode = new VNode(
  67752. config.parsePlatformTagName(tag), data, children,
  67753. undefined, undefined, context
  67754. );
  67755. } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) {
  67756. // component
  67757. vnode = createComponent(Ctor, data, context, children, tag);
  67758. } else {
  67759. // unknown or unlisted namespaced elements
  67760. // check at runtime because it may get assigned a namespace when its
  67761. // parent normalizes children
  67762. vnode = new VNode(
  67763. tag, data, children,
  67764. undefined, undefined, context
  67765. );
  67766. }
  67767. } else {
  67768. // direct component options / constructor
  67769. vnode = createComponent(tag, data, context, children);
  67770. }
  67771. if (Array.isArray(vnode)) {
  67772. return vnode
  67773. } else if (isDef(vnode)) {
  67774. if (isDef(ns)) { applyNS(vnode, ns); }
  67775. if (isDef(data)) { registerDeepBindings(data); }
  67776. return vnode
  67777. } else {
  67778. return createEmptyVNode()
  67779. }
  67780. }
  67781. function applyNS (vnode, ns, force) {
  67782. vnode.ns = ns;
  67783. if (vnode.tag === 'foreignObject') {
  67784. // use default namespace inside foreignObject
  67785. ns = undefined;
  67786. force = true;
  67787. }
  67788. if (isDef(vnode.children)) {
  67789. for (var i = 0, l = vnode.children.length; i < l; i++) {
  67790. var child = vnode.children[i];
  67791. if (isDef(child.tag) && (
  67792. isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) {
  67793. applyNS(child, ns, force);
  67794. }
  67795. }
  67796. }
  67797. }
  67798. // ref #5318
  67799. // necessary to ensure parent re-render when deep bindings like :style and
  67800. // :class are used on slot nodes
  67801. function registerDeepBindings (data) {
  67802. if (isObject(data.style)) {
  67803. traverse(data.style);
  67804. }
  67805. if (isObject(data.class)) {
  67806. traverse(data.class);
  67807. }
  67808. }
  67809. /* */
  67810. function initRender (vm) {
  67811. vm._vnode = null; // the root of the child tree
  67812. vm._staticTrees = null; // v-once cached trees
  67813. var options = vm.$options;
  67814. var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree
  67815. var renderContext = parentVnode && parentVnode.context;
  67816. vm.$slots = resolveSlots(options._renderChildren, renderContext);
  67817. vm.$scopedSlots = emptyObject;
  67818. // bind the createElement fn to this instance
  67819. // so that we get proper render context inside it.
  67820. // args order: tag, data, children, normalizationType, alwaysNormalize
  67821. // internal version is used by render functions compiled from templates
  67822. vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); };
  67823. // normalization is always applied for the public version, used in
  67824. // user-written render functions.
  67825. vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); };
  67826. // $attrs & $listeners are exposed for easier HOC creation.
  67827. // they need to be reactive so that HOCs using them are always updated
  67828. var parentData = parentVnode && parentVnode.data;
  67829. /* istanbul ignore else */
  67830. {
  67831. defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () {
  67832. !isUpdatingChildComponent && warn("$attrs is readonly.", vm);
  67833. }, true);
  67834. defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () {
  67835. !isUpdatingChildComponent && warn("$listeners is readonly.", vm);
  67836. }, true);
  67837. }
  67838. }
  67839. var currentRenderingInstance = null;
  67840. function renderMixin (Vue) {
  67841. // install runtime convenience helpers
  67842. installRenderHelpers(Vue.prototype);
  67843. Vue.prototype.$nextTick = function (fn) {
  67844. return nextTick(fn, this)
  67845. };
  67846. Vue.prototype._render = function () {
  67847. var vm = this;
  67848. var ref = vm.$options;
  67849. var render = ref.render;
  67850. var _parentVnode = ref._parentVnode;
  67851. if (_parentVnode) {
  67852. vm.$scopedSlots = normalizeScopedSlots(
  67853. _parentVnode.data.scopedSlots,
  67854. vm.$slots,
  67855. vm.$scopedSlots
  67856. );
  67857. }
  67858. // set parent vnode. this allows render functions to have access
  67859. // to the data on the placeholder node.
  67860. vm.$vnode = _parentVnode;
  67861. // render self
  67862. var vnode;
  67863. try {
  67864. // There's no need to maintain a stack because all render fns are called
  67865. // separately from one another. Nested component's render fns are called
  67866. // when parent component is patched.
  67867. currentRenderingInstance = vm;
  67868. vnode = render.call(vm._renderProxy, vm.$createElement);
  67869. } catch (e) {
  67870. handleError(e, vm, "render");
  67871. // return error render result,
  67872. // or previous vnode to prevent render error causing blank component
  67873. /* istanbul ignore else */
  67874. if (vm.$options.renderError) {
  67875. try {
  67876. vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e);
  67877. } catch (e) {
  67878. handleError(e, vm, "renderError");
  67879. vnode = vm._vnode;
  67880. }
  67881. } else {
  67882. vnode = vm._vnode;
  67883. }
  67884. } finally {
  67885. currentRenderingInstance = null;
  67886. }
  67887. // if the returned array contains only a single node, allow it
  67888. if (Array.isArray(vnode) && vnode.length === 1) {
  67889. vnode = vnode[0];
  67890. }
  67891. // return empty vnode in case the render function errored out
  67892. if (!(vnode instanceof VNode)) {
  67893. if (Array.isArray(vnode)) {
  67894. warn(
  67895. 'Multiple root nodes returned from render function. Render function ' +
  67896. 'should return a single root node.',
  67897. vm
  67898. );
  67899. }
  67900. vnode = createEmptyVNode();
  67901. }
  67902. // set parent
  67903. vnode.parent = _parentVnode;
  67904. return vnode
  67905. };
  67906. }
  67907. /* */
  67908. function ensureCtor (comp, base) {
  67909. if (
  67910. comp.__esModule ||
  67911. (hasSymbol && comp[Symbol.toStringTag] === 'Module')
  67912. ) {
  67913. comp = comp.default;
  67914. }
  67915. return isObject(comp)
  67916. ? base.extend(comp)
  67917. : comp
  67918. }
  67919. function createAsyncPlaceholder (
  67920. factory,
  67921. data,
  67922. context,
  67923. children,
  67924. tag
  67925. ) {
  67926. var node = createEmptyVNode();
  67927. node.asyncFactory = factory;
  67928. node.asyncMeta = { data: data, context: context, children: children, tag: tag };
  67929. return node
  67930. }
  67931. function resolveAsyncComponent (
  67932. factory,
  67933. baseCtor
  67934. ) {
  67935. if (isTrue(factory.error) && isDef(factory.errorComp)) {
  67936. return factory.errorComp
  67937. }
  67938. if (isDef(factory.resolved)) {
  67939. return factory.resolved
  67940. }
  67941. var owner = currentRenderingInstance;
  67942. if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) {
  67943. // already pending
  67944. factory.owners.push(owner);
  67945. }
  67946. if (isTrue(factory.loading) && isDef(factory.loadingComp)) {
  67947. return factory.loadingComp
  67948. }
  67949. if (owner && !isDef(factory.owners)) {
  67950. var owners = factory.owners = [owner];
  67951. var sync = true;
  67952. var timerLoading = null;
  67953. var timerTimeout = null
  67954. ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
  67955. var forceRender = function (renderCompleted) {
  67956. for (var i = 0, l = owners.length; i < l; i++) {
  67957. (owners[i]).$forceUpdate();
  67958. }
  67959. if (renderCompleted) {
  67960. owners.length = 0;
  67961. if (timerLoading !== null) {
  67962. clearTimeout(timerLoading);
  67963. timerLoading = null;
  67964. }
  67965. if (timerTimeout !== null) {
  67966. clearTimeout(timerTimeout);
  67967. timerTimeout = null;
  67968. }
  67969. }
  67970. };
  67971. var resolve = once(function (res) {
  67972. // cache resolved
  67973. factory.resolved = ensureCtor(res, baseCtor);
  67974. // invoke callbacks only if this is not a synchronous resolve
  67975. // (async resolves are shimmed as synchronous during SSR)
  67976. if (!sync) {
  67977. forceRender(true);
  67978. } else {
  67979. owners.length = 0;
  67980. }
  67981. });
  67982. var reject = once(function (reason) {
  67983. warn(
  67984. "Failed to resolve async component: " + (String(factory)) +
  67985. (reason ? ("\nReason: " + reason) : '')
  67986. );
  67987. if (isDef(factory.errorComp)) {
  67988. factory.error = true;
  67989. forceRender(true);
  67990. }
  67991. });
  67992. var res = factory(resolve, reject);
  67993. if (isObject(res)) {
  67994. if (isPromise(res)) {
  67995. // () => Promise
  67996. if (isUndef(factory.resolved)) {
  67997. res.then(resolve, reject);
  67998. }
  67999. } else if (isPromise(res.component)) {
  68000. res.component.then(resolve, reject);
  68001. if (isDef(res.error)) {
  68002. factory.errorComp = ensureCtor(res.error, baseCtor);
  68003. }
  68004. if (isDef(res.loading)) {
  68005. factory.loadingComp = ensureCtor(res.loading, baseCtor);
  68006. if (res.delay === 0) {
  68007. factory.loading = true;
  68008. } else {
  68009. timerLoading = setTimeout(function () {
  68010. timerLoading = null;
  68011. if (isUndef(factory.resolved) && isUndef(factory.error)) {
  68012. factory.loading = true;
  68013. forceRender(false);
  68014. }
  68015. }, res.delay || 200);
  68016. }
  68017. }
  68018. if (isDef(res.timeout)) {
  68019. timerTimeout = setTimeout(function () {
  68020. timerTimeout = null;
  68021. if (isUndef(factory.resolved)) {
  68022. reject(
  68023. "timeout (" + (res.timeout) + "ms)"
  68024. );
  68025. }
  68026. }, res.timeout);
  68027. }
  68028. }
  68029. }
  68030. sync = false;
  68031. // return in case resolved synchronously
  68032. return factory.loading
  68033. ? factory.loadingComp
  68034. : factory.resolved
  68035. }
  68036. }
  68037. /* */
  68038. function isAsyncPlaceholder (node) {
  68039. return node.isComment && node.asyncFactory
  68040. }
  68041. /* */
  68042. function getFirstComponentChild (children) {
  68043. if (Array.isArray(children)) {
  68044. for (var i = 0; i < children.length; i++) {
  68045. var c = children[i];
  68046. if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
  68047. return c
  68048. }
  68049. }
  68050. }
  68051. }
  68052. /* */
  68053. /* */
  68054. function initEvents (vm) {
  68055. vm._events = Object.create(null);
  68056. vm._hasHookEvent = false;
  68057. // init parent attached events
  68058. var listeners = vm.$options._parentListeners;
  68059. if (listeners) {
  68060. updateComponentListeners(vm, listeners);
  68061. }
  68062. }
  68063. var target;
  68064. function add (event, fn) {
  68065. target.$on(event, fn);
  68066. }
  68067. function remove$1 (event, fn) {
  68068. target.$off(event, fn);
  68069. }
  68070. function createOnceHandler (event, fn) {
  68071. var _target = target;
  68072. return function onceHandler () {
  68073. var res = fn.apply(null, arguments);
  68074. if (res !== null) {
  68075. _target.$off(event, onceHandler);
  68076. }
  68077. }
  68078. }
  68079. function updateComponentListeners (
  68080. vm,
  68081. listeners,
  68082. oldListeners
  68083. ) {
  68084. target = vm;
  68085. updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm);
  68086. target = undefined;
  68087. }
  68088. function eventsMixin (Vue) {
  68089. var hookRE = /^hook:/;
  68090. Vue.prototype.$on = function (event, fn) {
  68091. var vm = this;
  68092. if (Array.isArray(event)) {
  68093. for (var i = 0, l = event.length; i < l; i++) {
  68094. vm.$on(event[i], fn);
  68095. }
  68096. } else {
  68097. (vm._events[event] || (vm._events[event] = [])).push(fn);
  68098. // optimize hook:event cost by using a boolean flag marked at registration
  68099. // instead of a hash lookup
  68100. if (hookRE.test(event)) {
  68101. vm._hasHookEvent = true;
  68102. }
  68103. }
  68104. return vm
  68105. };
  68106. Vue.prototype.$once = function (event, fn) {
  68107. var vm = this;
  68108. function on () {
  68109. vm.$off(event, on);
  68110. fn.apply(vm, arguments);
  68111. }
  68112. on.fn = fn;
  68113. vm.$on(event, on);
  68114. return vm
  68115. };
  68116. Vue.prototype.$off = function (event, fn) {
  68117. var vm = this;
  68118. // all
  68119. if (!arguments.length) {
  68120. vm._events = Object.create(null);
  68121. return vm
  68122. }
  68123. // array of events
  68124. if (Array.isArray(event)) {
  68125. for (var i$1 = 0, l = event.length; i$1 < l; i$1++) {
  68126. vm.$off(event[i$1], fn);
  68127. }
  68128. return vm
  68129. }
  68130. // specific event
  68131. var cbs = vm._events[event];
  68132. if (!cbs) {
  68133. return vm
  68134. }
  68135. if (!fn) {
  68136. vm._events[event] = null;
  68137. return vm
  68138. }
  68139. // specific handler
  68140. var cb;
  68141. var i = cbs.length;
  68142. while (i--) {
  68143. cb = cbs[i];
  68144. if (cb === fn || cb.fn === fn) {
  68145. cbs.splice(i, 1);
  68146. break
  68147. }
  68148. }
  68149. return vm
  68150. };
  68151. Vue.prototype.$emit = function (event) {
  68152. var vm = this;
  68153. {
  68154. var lowerCaseEvent = event.toLowerCase();
  68155. if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) {
  68156. tip(
  68157. "Event \"" + lowerCaseEvent + "\" is emitted in component " +
  68158. (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " +
  68159. "Note that HTML attributes are case-insensitive and you cannot use " +
  68160. "v-on to listen to camelCase events when using in-DOM templates. " +
  68161. "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"."
  68162. );
  68163. }
  68164. }
  68165. var cbs = vm._events[event];
  68166. if (cbs) {
  68167. cbs = cbs.length > 1 ? toArray(cbs) : cbs;
  68168. var args = toArray(arguments, 1);
  68169. var info = "event handler for \"" + event + "\"";
  68170. for (var i = 0, l = cbs.length; i < l; i++) {
  68171. invokeWithErrorHandling(cbs[i], vm, args, vm, info);
  68172. }
  68173. }
  68174. return vm
  68175. };
  68176. }
  68177. /* */
  68178. var activeInstance = null;
  68179. var isUpdatingChildComponent = false;
  68180. function setActiveInstance(vm) {
  68181. var prevActiveInstance = activeInstance;
  68182. activeInstance = vm;
  68183. return function () {
  68184. activeInstance = prevActiveInstance;
  68185. }
  68186. }
  68187. function initLifecycle (vm) {
  68188. var options = vm.$options;
  68189. // locate first non-abstract parent
  68190. var parent = options.parent;
  68191. if (parent && !options.abstract) {
  68192. while (parent.$options.abstract && parent.$parent) {
  68193. parent = parent.$parent;
  68194. }
  68195. parent.$children.push(vm);
  68196. }
  68197. vm.$parent = parent;
  68198. vm.$root = parent ? parent.$root : vm;
  68199. vm.$children = [];
  68200. vm.$refs = {};
  68201. vm._watcher = null;
  68202. vm._inactive = null;
  68203. vm._directInactive = false;
  68204. vm._isMounted = false;
  68205. vm._isDestroyed = false;
  68206. vm._isBeingDestroyed = false;
  68207. }
  68208. function lifecycleMixin (Vue) {
  68209. Vue.prototype._update = function (vnode, hydrating) {
  68210. var vm = this;
  68211. var prevEl = vm.$el;
  68212. var prevVnode = vm._vnode;
  68213. var restoreActiveInstance = setActiveInstance(vm);
  68214. vm._vnode = vnode;
  68215. // Vue.prototype.__patch__ is injected in entry points
  68216. // based on the rendering backend used.
  68217. if (!prevVnode) {
  68218. // initial render
  68219. vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */);
  68220. } else {
  68221. // updates
  68222. vm.$el = vm.__patch__(prevVnode, vnode);
  68223. }
  68224. restoreActiveInstance();
  68225. // update __vue__ reference
  68226. if (prevEl) {
  68227. prevEl.__vue__ = null;
  68228. }
  68229. if (vm.$el) {
  68230. vm.$el.__vue__ = vm;
  68231. }
  68232. // if parent is an HOC, update its $el as well
  68233. if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) {
  68234. vm.$parent.$el = vm.$el;
  68235. }
  68236. // updated hook is called by the scheduler to ensure that children are
  68237. // updated in a parent's updated hook.
  68238. };
  68239. Vue.prototype.$forceUpdate = function () {
  68240. var vm = this;
  68241. if (vm._watcher) {
  68242. vm._watcher.update();
  68243. }
  68244. };
  68245. Vue.prototype.$destroy = function () {
  68246. var vm = this;
  68247. if (vm._isBeingDestroyed) {
  68248. return
  68249. }
  68250. callHook(vm, 'beforeDestroy');
  68251. vm._isBeingDestroyed = true;
  68252. // remove self from parent
  68253. var parent = vm.$parent;
  68254. if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) {
  68255. remove(parent.$children, vm);
  68256. }
  68257. // teardown watchers
  68258. if (vm._watcher) {
  68259. vm._watcher.teardown();
  68260. }
  68261. var i = vm._watchers.length;
  68262. while (i--) {
  68263. vm._watchers[i].teardown();
  68264. }
  68265. // remove reference from data ob
  68266. // frozen object may not have observer.
  68267. if (vm._data.__ob__) {
  68268. vm._data.__ob__.vmCount--;
  68269. }
  68270. // call the last hook...
  68271. vm._isDestroyed = true;
  68272. // invoke destroy hooks on current rendered tree
  68273. vm.__patch__(vm._vnode, null);
  68274. // fire destroyed hook
  68275. callHook(vm, 'destroyed');
  68276. // turn off all instance listeners.
  68277. vm.$off();
  68278. // remove __vue__ reference
  68279. if (vm.$el) {
  68280. vm.$el.__vue__ = null;
  68281. }
  68282. // release circular reference (#6759)
  68283. if (vm.$vnode) {
  68284. vm.$vnode.parent = null;
  68285. }
  68286. };
  68287. }
  68288. function mountComponent (
  68289. vm,
  68290. el,
  68291. hydrating
  68292. ) {
  68293. vm.$el = el;
  68294. if (!vm.$options.render) {
  68295. vm.$options.render = createEmptyVNode;
  68296. {
  68297. /* istanbul ignore if */
  68298. if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||
  68299. vm.$options.el || el) {
  68300. warn(
  68301. 'You are using the runtime-only build of Vue where the template ' +
  68302. 'compiler is not available. Either pre-compile the templates into ' +
  68303. 'render functions, or use the compiler-included build.',
  68304. vm
  68305. );
  68306. } else {
  68307. warn(
  68308. 'Failed to mount component: template or render function not defined.',
  68309. vm
  68310. );
  68311. }
  68312. }
  68313. }
  68314. callHook(vm, 'beforeMount');
  68315. var updateComponent;
  68316. /* istanbul ignore if */
  68317. if (config.performance && mark) {
  68318. updateComponent = function () {
  68319. var name = vm._name;
  68320. var id = vm._uid;
  68321. var startTag = "vue-perf-start:" + id;
  68322. var endTag = "vue-perf-end:" + id;
  68323. mark(startTag);
  68324. var vnode = vm._render();
  68325. mark(endTag);
  68326. measure(("vue " + name + " render"), startTag, endTag);
  68327. mark(startTag);
  68328. vm._update(vnode, hydrating);
  68329. mark(endTag);
  68330. measure(("vue " + name + " patch"), startTag, endTag);
  68331. };
  68332. } else {
  68333. updateComponent = function () {
  68334. vm._update(vm._render(), hydrating);
  68335. };
  68336. }
  68337. // we set this to vm._watcher inside the watcher's constructor
  68338. // since the watcher's initial patch may call $forceUpdate (e.g. inside child
  68339. // component's mounted hook), which relies on vm._watcher being already defined
  68340. new Watcher(vm, updateComponent, noop, {
  68341. before: function before () {
  68342. if (vm._isMounted && !vm._isDestroyed) {
  68343. callHook(vm, 'beforeUpdate');
  68344. }
  68345. }
  68346. }, true /* isRenderWatcher */);
  68347. hydrating = false;
  68348. // manually mounted instance, call mounted on self
  68349. // mounted is called for render-created child components in its inserted hook
  68350. if (vm.$vnode == null) {
  68351. vm._isMounted = true;
  68352. callHook(vm, 'mounted');
  68353. }
  68354. return vm
  68355. }
  68356. function updateChildComponent (
  68357. vm,
  68358. propsData,
  68359. listeners,
  68360. parentVnode,
  68361. renderChildren
  68362. ) {
  68363. {
  68364. isUpdatingChildComponent = true;
  68365. }
  68366. // determine whether component has slot children
  68367. // we need to do this before overwriting $options._renderChildren.
  68368. // check if there are dynamic scopedSlots (hand-written or compiled but with
  68369. // dynamic slot names). Static scoped slots compiled from template has the
  68370. // "$stable" marker.
  68371. var newScopedSlots = parentVnode.data.scopedSlots;
  68372. var oldScopedSlots = vm.$scopedSlots;
  68373. var hasDynamicScopedSlot = !!(
  68374. (newScopedSlots && !newScopedSlots.$stable) ||
  68375. (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
  68376. (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
  68377. );
  68378. // Any static slot children from the parent may have changed during parent's
  68379. // update. Dynamic scoped slots may also have changed. In such cases, a forced
  68380. // update is necessary to ensure correctness.
  68381. var needsForceUpdate = !!(
  68382. renderChildren || // has new static slots
  68383. vm.$options._renderChildren || // has old static slots
  68384. hasDynamicScopedSlot
  68385. );
  68386. vm.$options._parentVnode = parentVnode;
  68387. vm.$vnode = parentVnode; // update vm's placeholder node without re-render
  68388. if (vm._vnode) { // update child tree's parent
  68389. vm._vnode.parent = parentVnode;
  68390. }
  68391. vm.$options._renderChildren = renderChildren;
  68392. // update $attrs and $listeners hash
  68393. // these are also reactive so they may trigger child update if the child
  68394. // used them during render
  68395. vm.$attrs = parentVnode.data.attrs || emptyObject;
  68396. vm.$listeners = listeners || emptyObject;
  68397. // update props
  68398. if (propsData && vm.$options.props) {
  68399. toggleObserving(false);
  68400. var props = vm._props;
  68401. var propKeys = vm.$options._propKeys || [];
  68402. for (var i = 0; i < propKeys.length; i++) {
  68403. var key = propKeys[i];
  68404. var propOptions = vm.$options.props; // wtf flow?
  68405. props[key] = validateProp(key, propOptions, propsData, vm);
  68406. }
  68407. toggleObserving(true);
  68408. // keep a copy of raw propsData
  68409. vm.$options.propsData = propsData;
  68410. }
  68411. // update listeners
  68412. listeners = listeners || emptyObject;
  68413. var oldListeners = vm.$options._parentListeners;
  68414. vm.$options._parentListeners = listeners;
  68415. updateComponentListeners(vm, listeners, oldListeners);
  68416. // resolve slots + force update if has children
  68417. if (needsForceUpdate) {
  68418. vm.$slots = resolveSlots(renderChildren, parentVnode.context);
  68419. vm.$forceUpdate();
  68420. }
  68421. {
  68422. isUpdatingChildComponent = false;
  68423. }
  68424. }
  68425. function isInInactiveTree (vm) {
  68426. while (vm && (vm = vm.$parent)) {
  68427. if (vm._inactive) { return true }
  68428. }
  68429. return false
  68430. }
  68431. function activateChildComponent (vm, direct) {
  68432. if (direct) {
  68433. vm._directInactive = false;
  68434. if (isInInactiveTree(vm)) {
  68435. return
  68436. }
  68437. } else if (vm._directInactive) {
  68438. return
  68439. }
  68440. if (vm._inactive || vm._inactive === null) {
  68441. vm._inactive = false;
  68442. for (var i = 0; i < vm.$children.length; i++) {
  68443. activateChildComponent(vm.$children[i]);
  68444. }
  68445. callHook(vm, 'activated');
  68446. }
  68447. }
  68448. function deactivateChildComponent (vm, direct) {
  68449. if (direct) {
  68450. vm._directInactive = true;
  68451. if (isInInactiveTree(vm)) {
  68452. return
  68453. }
  68454. }
  68455. if (!vm._inactive) {
  68456. vm._inactive = true;
  68457. for (var i = 0; i < vm.$children.length; i++) {
  68458. deactivateChildComponent(vm.$children[i]);
  68459. }
  68460. callHook(vm, 'deactivated');
  68461. }
  68462. }
  68463. function callHook (vm, hook) {
  68464. // #7573 disable dep collection when invoking lifecycle hooks
  68465. pushTarget();
  68466. var handlers = vm.$options[hook];
  68467. var info = hook + " hook";
  68468. if (handlers) {
  68469. for (var i = 0, j = handlers.length; i < j; i++) {
  68470. invokeWithErrorHandling(handlers[i], vm, null, vm, info);
  68471. }
  68472. }
  68473. if (vm._hasHookEvent) {
  68474. vm.$emit('hook:' + hook);
  68475. }
  68476. popTarget();
  68477. }
  68478. /* */
  68479. var MAX_UPDATE_COUNT = 100;
  68480. var queue = [];
  68481. var activatedChildren = [];
  68482. var has = {};
  68483. var circular = {};
  68484. var waiting = false;
  68485. var flushing = false;
  68486. var index = 0;
  68487. /**
  68488. * Reset the scheduler's state.
  68489. */
  68490. function resetSchedulerState () {
  68491. index = queue.length = activatedChildren.length = 0;
  68492. has = {};
  68493. {
  68494. circular = {};
  68495. }
  68496. waiting = flushing = false;
  68497. }
  68498. // Async edge case #6566 requires saving the timestamp when event listeners are
  68499. // attached. However, calling performance.now() has a perf overhead especially
  68500. // if the page has thousands of event listeners. Instead, we take a timestamp
  68501. // every time the scheduler flushes and use that for all event listeners
  68502. // attached during that flush.
  68503. var currentFlushTimestamp = 0;
  68504. // Async edge case fix requires storing an event listener's attach timestamp.
  68505. var getNow = Date.now;
  68506. // Determine what event timestamp the browser is using. Annoyingly, the
  68507. // timestamp can either be hi-res (relative to page load) or low-res
  68508. // (relative to UNIX epoch), so in order to compare time we have to use the
  68509. // same timestamp type when saving the flush timestamp.
  68510. // All IE versions use low-res event timestamps, and have problematic clock
  68511. // implementations (#9632)
  68512. if (inBrowser && !isIE) {
  68513. var performance = window.performance;
  68514. if (
  68515. performance &&
  68516. typeof performance.now === 'function' &&
  68517. getNow() > document.createEvent('Event').timeStamp
  68518. ) {
  68519. // if the event timestamp, although evaluated AFTER the Date.now(), is
  68520. // smaller than it, it means the event is using a hi-res timestamp,
  68521. // and we need to use the hi-res version for event listener timestamps as
  68522. // well.
  68523. getNow = function () { return performance.now(); };
  68524. }
  68525. }
  68526. /**
  68527. * Flush both queues and run the watchers.
  68528. */
  68529. function flushSchedulerQueue () {
  68530. currentFlushTimestamp = getNow();
  68531. flushing = true;
  68532. var watcher, id;
  68533. // Sort queue before flush.
  68534. // This ensures that:
  68535. // 1. Components are updated from parent to child. (because parent is always
  68536. // created before the child)
  68537. // 2. A component's user watchers are run before its render watcher (because
  68538. // user watchers are created before the render watcher)
  68539. // 3. If a component is destroyed during a parent component's watcher run,
  68540. // its watchers can be skipped.
  68541. queue.sort(function (a, b) { return a.id - b.id; });
  68542. // do not cache length because more watchers might be pushed
  68543. // as we run existing watchers
  68544. for (index = 0; index < queue.length; index++) {
  68545. watcher = queue[index];
  68546. if (watcher.before) {
  68547. watcher.before();
  68548. }
  68549. id = watcher.id;
  68550. has[id] = null;
  68551. watcher.run();
  68552. // in dev build, check and stop circular updates.
  68553. if (has[id] != null) {
  68554. circular[id] = (circular[id] || 0) + 1;
  68555. if (circular[id] > MAX_UPDATE_COUNT) {
  68556. warn(
  68557. 'You may have an infinite update loop ' + (
  68558. watcher.user
  68559. ? ("in watcher with expression \"" + (watcher.expression) + "\"")
  68560. : "in a component render function."
  68561. ),
  68562. watcher.vm
  68563. );
  68564. break
  68565. }
  68566. }
  68567. }
  68568. // keep copies of post queues before resetting state
  68569. var activatedQueue = activatedChildren.slice();
  68570. var updatedQueue = queue.slice();
  68571. resetSchedulerState();
  68572. // call component updated and activated hooks
  68573. callActivatedHooks(activatedQueue);
  68574. callUpdatedHooks(updatedQueue);
  68575. // devtool hook
  68576. /* istanbul ignore if */
  68577. if (devtools && config.devtools) {
  68578. devtools.emit('flush');
  68579. }
  68580. }
  68581. function callUpdatedHooks (queue) {
  68582. var i = queue.length;
  68583. while (i--) {
  68584. var watcher = queue[i];
  68585. var vm = watcher.vm;
  68586. if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) {
  68587. callHook(vm, 'updated');
  68588. }
  68589. }
  68590. }
  68591. /**
  68592. * Queue a kept-alive component that was activated during patch.
  68593. * The queue will be processed after the entire tree has been patched.
  68594. */
  68595. function queueActivatedComponent (vm) {
  68596. // setting _inactive to false here so that a render function can
  68597. // rely on checking whether it's in an inactive tree (e.g. router-view)
  68598. vm._inactive = false;
  68599. activatedChildren.push(vm);
  68600. }
  68601. function callActivatedHooks (queue) {
  68602. for (var i = 0; i < queue.length; i++) {
  68603. queue[i]._inactive = true;
  68604. activateChildComponent(queue[i], true /* true */);
  68605. }
  68606. }
  68607. /**
  68608. * Push a watcher into the watcher queue.
  68609. * Jobs with duplicate IDs will be skipped unless it's
  68610. * pushed when the queue is being flushed.
  68611. */
  68612. function queueWatcher (watcher) {
  68613. var id = watcher.id;
  68614. if (has[id] == null) {
  68615. has[id] = true;
  68616. if (!flushing) {
  68617. queue.push(watcher);
  68618. } else {
  68619. // if already flushing, splice the watcher based on its id
  68620. // if already past its id, it will be run next immediately.
  68621. var i = queue.length - 1;
  68622. while (i > index && queue[i].id > watcher.id) {
  68623. i--;
  68624. }
  68625. queue.splice(i + 1, 0, watcher);
  68626. }
  68627. // queue the flush
  68628. if (!waiting) {
  68629. waiting = true;
  68630. if (!config.async) {
  68631. flushSchedulerQueue();
  68632. return
  68633. }
  68634. nextTick(flushSchedulerQueue);
  68635. }
  68636. }
  68637. }
  68638. /* */
  68639. var uid$2 = 0;
  68640. /**
  68641. * A watcher parses an expression, collects dependencies,
  68642. * and fires callback when the expression value changes.
  68643. * This is used for both the $watch() api and directives.
  68644. */
  68645. var Watcher = function Watcher (
  68646. vm,
  68647. expOrFn,
  68648. cb,
  68649. options,
  68650. isRenderWatcher
  68651. ) {
  68652. this.vm = vm;
  68653. if (isRenderWatcher) {
  68654. vm._watcher = this;
  68655. }
  68656. vm._watchers.push(this);
  68657. // options
  68658. if (options) {
  68659. this.deep = !!options.deep;
  68660. this.user = !!options.user;
  68661. this.lazy = !!options.lazy;
  68662. this.sync = !!options.sync;
  68663. this.before = options.before;
  68664. } else {
  68665. this.deep = this.user = this.lazy = this.sync = false;
  68666. }
  68667. this.cb = cb;
  68668. this.id = ++uid$2; // uid for batching
  68669. this.active = true;
  68670. this.dirty = this.lazy; // for lazy watchers
  68671. this.deps = [];
  68672. this.newDeps = [];
  68673. this.depIds = new _Set();
  68674. this.newDepIds = new _Set();
  68675. this.expression = expOrFn.toString();
  68676. // parse expression for getter
  68677. if (typeof expOrFn === 'function') {
  68678. this.getter = expOrFn;
  68679. } else {
  68680. this.getter = parsePath(expOrFn);
  68681. if (!this.getter) {
  68682. this.getter = noop;
  68683. warn(
  68684. "Failed watching path: \"" + expOrFn + "\" " +
  68685. 'Watcher only accepts simple dot-delimited paths. ' +
  68686. 'For full control, use a function instead.',
  68687. vm
  68688. );
  68689. }
  68690. }
  68691. this.value = this.lazy
  68692. ? undefined
  68693. : this.get();
  68694. };
  68695. /**
  68696. * Evaluate the getter, and re-collect dependencies.
  68697. */
  68698. Watcher.prototype.get = function get () {
  68699. pushTarget(this);
  68700. var value;
  68701. var vm = this.vm;
  68702. try {
  68703. value = this.getter.call(vm, vm);
  68704. } catch (e) {
  68705. if (this.user) {
  68706. handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\""));
  68707. } else {
  68708. throw e
  68709. }
  68710. } finally {
  68711. // "touch" every property so they are all tracked as
  68712. // dependencies for deep watching
  68713. if (this.deep) {
  68714. traverse(value);
  68715. }
  68716. popTarget();
  68717. this.cleanupDeps();
  68718. }
  68719. return value
  68720. };
  68721. /**
  68722. * Add a dependency to this directive.
  68723. */
  68724. Watcher.prototype.addDep = function addDep (dep) {
  68725. var id = dep.id;
  68726. if (!this.newDepIds.has(id)) {
  68727. this.newDepIds.add(id);
  68728. this.newDeps.push(dep);
  68729. if (!this.depIds.has(id)) {
  68730. dep.addSub(this);
  68731. }
  68732. }
  68733. };
  68734. /**
  68735. * Clean up for dependency collection.
  68736. */
  68737. Watcher.prototype.cleanupDeps = function cleanupDeps () {
  68738. var i = this.deps.length;
  68739. while (i--) {
  68740. var dep = this.deps[i];
  68741. if (!this.newDepIds.has(dep.id)) {
  68742. dep.removeSub(this);
  68743. }
  68744. }
  68745. var tmp = this.depIds;
  68746. this.depIds = this.newDepIds;
  68747. this.newDepIds = tmp;
  68748. this.newDepIds.clear();
  68749. tmp = this.deps;
  68750. this.deps = this.newDeps;
  68751. this.newDeps = tmp;
  68752. this.newDeps.length = 0;
  68753. };
  68754. /**
  68755. * Subscriber interface.
  68756. * Will be called when a dependency changes.
  68757. */
  68758. Watcher.prototype.update = function update () {
  68759. /* istanbul ignore else */
  68760. if (this.lazy) {
  68761. this.dirty = true;
  68762. } else if (this.sync) {
  68763. this.run();
  68764. } else {
  68765. queueWatcher(this);
  68766. }
  68767. };
  68768. /**
  68769. * Scheduler job interface.
  68770. * Will be called by the scheduler.
  68771. */
  68772. Watcher.prototype.run = function run () {
  68773. if (this.active) {
  68774. var value = this.get();
  68775. if (
  68776. value !== this.value ||
  68777. // Deep watchers and watchers on Object/Arrays should fire even
  68778. // when the value is the same, because the value may
  68779. // have mutated.
  68780. isObject(value) ||
  68781. this.deep
  68782. ) {
  68783. // set new value
  68784. var oldValue = this.value;
  68785. this.value = value;
  68786. if (this.user) {
  68787. try {
  68788. this.cb.call(this.vm, value, oldValue);
  68789. } catch (e) {
  68790. handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
  68791. }
  68792. } else {
  68793. this.cb.call(this.vm, value, oldValue);
  68794. }
  68795. }
  68796. }
  68797. };
  68798. /**
  68799. * Evaluate the value of the watcher.
  68800. * This only gets called for lazy watchers.
  68801. */
  68802. Watcher.prototype.evaluate = function evaluate () {
  68803. this.value = this.get();
  68804. this.dirty = false;
  68805. };
  68806. /**
  68807. * Depend on all deps collected by this watcher.
  68808. */
  68809. Watcher.prototype.depend = function depend () {
  68810. var i = this.deps.length;
  68811. while (i--) {
  68812. this.deps[i].depend();
  68813. }
  68814. };
  68815. /**
  68816. * Remove self from all dependencies' subscriber list.
  68817. */
  68818. Watcher.prototype.teardown = function teardown () {
  68819. if (this.active) {
  68820. // remove self from vm's watcher list
  68821. // this is a somewhat expensive operation so we skip it
  68822. // if the vm is being destroyed.
  68823. if (!this.vm._isBeingDestroyed) {
  68824. remove(this.vm._watchers, this);
  68825. }
  68826. var i = this.deps.length;
  68827. while (i--) {
  68828. this.deps[i].removeSub(this);
  68829. }
  68830. this.active = false;
  68831. }
  68832. };
  68833. /* */
  68834. var sharedPropertyDefinition = {
  68835. enumerable: true,
  68836. configurable: true,
  68837. get: noop,
  68838. set: noop
  68839. };
  68840. function proxy (target, sourceKey, key) {
  68841. sharedPropertyDefinition.get = function proxyGetter () {
  68842. return this[sourceKey][key]
  68843. };
  68844. sharedPropertyDefinition.set = function proxySetter (val) {
  68845. this[sourceKey][key] = val;
  68846. };
  68847. Object.defineProperty(target, key, sharedPropertyDefinition);
  68848. }
  68849. function initState (vm) {
  68850. vm._watchers = [];
  68851. var opts = vm.$options;
  68852. if (opts.props) { initProps(vm, opts.props); }
  68853. if (opts.methods) { initMethods(vm, opts.methods); }
  68854. if (opts.data) {
  68855. initData(vm);
  68856. } else {
  68857. observe(vm._data = {}, true /* asRootData */);
  68858. }
  68859. if (opts.computed) { initComputed(vm, opts.computed); }
  68860. if (opts.watch && opts.watch !== nativeWatch) {
  68861. initWatch(vm, opts.watch);
  68862. }
  68863. }
  68864. function initProps (vm, propsOptions) {
  68865. var propsData = vm.$options.propsData || {};
  68866. var props = vm._props = {};
  68867. // cache prop keys so that future props updates can iterate using Array
  68868. // instead of dynamic object key enumeration.
  68869. var keys = vm.$options._propKeys = [];
  68870. var isRoot = !vm.$parent;
  68871. // root instance props should be converted
  68872. if (!isRoot) {
  68873. toggleObserving(false);
  68874. }
  68875. var loop = function ( key ) {
  68876. keys.push(key);
  68877. var value = validateProp(key, propsOptions, propsData, vm);
  68878. /* istanbul ignore else */
  68879. {
  68880. var hyphenatedKey = hyphenate(key);
  68881. if (isReservedAttribute(hyphenatedKey) ||
  68882. config.isReservedAttr(hyphenatedKey)) {
  68883. warn(
  68884. ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."),
  68885. vm
  68886. );
  68887. }
  68888. defineReactive$$1(props, key, value, function () {
  68889. if (!isRoot && !isUpdatingChildComponent) {
  68890. warn(
  68891. "Avoid mutating a prop directly since the value will be " +
  68892. "overwritten whenever the parent component re-renders. " +
  68893. "Instead, use a data or computed property based on the prop's " +
  68894. "value. Prop being mutated: \"" + key + "\"",
  68895. vm
  68896. );
  68897. }
  68898. });
  68899. }
  68900. // static props are already proxied on the component's prototype
  68901. // during Vue.extend(). We only need to proxy props defined at
  68902. // instantiation here.
  68903. if (!(key in vm)) {
  68904. proxy(vm, "_props", key);
  68905. }
  68906. };
  68907. for (var key in propsOptions) loop( key );
  68908. toggleObserving(true);
  68909. }
  68910. function initData (vm) {
  68911. var data = vm.$options.data;
  68912. data = vm._data = typeof data === 'function'
  68913. ? getData(data, vm)
  68914. : data || {};
  68915. if (!isPlainObject(data)) {
  68916. data = {};
  68917. warn(
  68918. 'data functions should return an object:\n' +
  68919. 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function',
  68920. vm
  68921. );
  68922. }
  68923. // proxy data on instance
  68924. var keys = Object.keys(data);
  68925. var props = vm.$options.props;
  68926. var methods = vm.$options.methods;
  68927. var i = keys.length;
  68928. while (i--) {
  68929. var key = keys[i];
  68930. {
  68931. if (methods && hasOwn(methods, key)) {
  68932. warn(
  68933. ("Method \"" + key + "\" has already been defined as a data property."),
  68934. vm
  68935. );
  68936. }
  68937. }
  68938. if (props && hasOwn(props, key)) {
  68939. warn(
  68940. "The data property \"" + key + "\" is already declared as a prop. " +
  68941. "Use prop default value instead.",
  68942. vm
  68943. );
  68944. } else if (!isReserved(key)) {
  68945. proxy(vm, "_data", key);
  68946. }
  68947. }
  68948. // observe data
  68949. observe(data, true /* asRootData */);
  68950. }
  68951. function getData (data, vm) {
  68952. // #7573 disable dep collection when invoking data getters
  68953. pushTarget();
  68954. try {
  68955. return data.call(vm, vm)
  68956. } catch (e) {
  68957. handleError(e, vm, "data()");
  68958. return {}
  68959. } finally {
  68960. popTarget();
  68961. }
  68962. }
  68963. var computedWatcherOptions = { lazy: true };
  68964. function initComputed (vm, computed) {
  68965. // $flow-disable-line
  68966. var watchers = vm._computedWatchers = Object.create(null);
  68967. // computed properties are just getters during SSR
  68968. var isSSR = isServerRendering();
  68969. for (var key in computed) {
  68970. var userDef = computed[key];
  68971. var getter = typeof userDef === 'function' ? userDef : userDef.get;
  68972. if (getter == null) {
  68973. warn(
  68974. ("Getter is missing for computed property \"" + key + "\"."),
  68975. vm
  68976. );
  68977. }
  68978. if (!isSSR) {
  68979. // create internal watcher for the computed property.
  68980. watchers[key] = new Watcher(
  68981. vm,
  68982. getter || noop,
  68983. noop,
  68984. computedWatcherOptions
  68985. );
  68986. }
  68987. // component-defined computed properties are already defined on the
  68988. // component prototype. We only need to define computed properties defined
  68989. // at instantiation here.
  68990. if (!(key in vm)) {
  68991. defineComputed(vm, key, userDef);
  68992. } else {
  68993. if (key in vm.$data) {
  68994. warn(("The computed property \"" + key + "\" is already defined in data."), vm);
  68995. } else if (vm.$options.props && key in vm.$options.props) {
  68996. warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
  68997. }
  68998. }
  68999. }
  69000. }
  69001. function defineComputed (
  69002. target,
  69003. key,
  69004. userDef
  69005. ) {
  69006. var shouldCache = !isServerRendering();
  69007. if (typeof userDef === 'function') {
  69008. sharedPropertyDefinition.get = shouldCache
  69009. ? createComputedGetter(key)
  69010. : createGetterInvoker(userDef);
  69011. sharedPropertyDefinition.set = noop;
  69012. } else {
  69013. sharedPropertyDefinition.get = userDef.get
  69014. ? shouldCache && userDef.cache !== false
  69015. ? createComputedGetter(key)
  69016. : createGetterInvoker(userDef.get)
  69017. : noop;
  69018. sharedPropertyDefinition.set = userDef.set || noop;
  69019. }
  69020. if (sharedPropertyDefinition.set === noop) {
  69021. sharedPropertyDefinition.set = function () {
  69022. warn(
  69023. ("Computed property \"" + key + "\" was assigned to but it has no setter."),
  69024. this
  69025. );
  69026. };
  69027. }
  69028. Object.defineProperty(target, key, sharedPropertyDefinition);
  69029. }
  69030. function createComputedGetter (key) {
  69031. return function computedGetter () {
  69032. var watcher = this._computedWatchers && this._computedWatchers[key];
  69033. if (watcher) {
  69034. if (watcher.dirty) {
  69035. watcher.evaluate();
  69036. }
  69037. if (Dep.target) {
  69038. watcher.depend();
  69039. }
  69040. return watcher.value
  69041. }
  69042. }
  69043. }
  69044. function createGetterInvoker(fn) {
  69045. return function computedGetter () {
  69046. return fn.call(this, this)
  69047. }
  69048. }
  69049. function initMethods (vm, methods) {
  69050. var props = vm.$options.props;
  69051. for (var key in methods) {
  69052. {
  69053. if (typeof methods[key] !== 'function') {
  69054. warn(
  69055. "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " +
  69056. "Did you reference the function correctly?",
  69057. vm
  69058. );
  69059. }
  69060. if (props && hasOwn(props, key)) {
  69061. warn(
  69062. ("Method \"" + key + "\" has already been defined as a prop."),
  69063. vm
  69064. );
  69065. }
  69066. if ((key in vm) && isReserved(key)) {
  69067. warn(
  69068. "Method \"" + key + "\" conflicts with an existing Vue instance method. " +
  69069. "Avoid defining component methods that start with _ or $."
  69070. );
  69071. }
  69072. }
  69073. vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm);
  69074. }
  69075. }
  69076. function initWatch (vm, watch) {
  69077. for (var key in watch) {
  69078. var handler = watch[key];
  69079. if (Array.isArray(handler)) {
  69080. for (var i = 0; i < handler.length; i++) {
  69081. createWatcher(vm, key, handler[i]);
  69082. }
  69083. } else {
  69084. createWatcher(vm, key, handler);
  69085. }
  69086. }
  69087. }
  69088. function createWatcher (
  69089. vm,
  69090. expOrFn,
  69091. handler,
  69092. options
  69093. ) {
  69094. if (isPlainObject(handler)) {
  69095. options = handler;
  69096. handler = handler.handler;
  69097. }
  69098. if (typeof handler === 'string') {
  69099. handler = vm[handler];
  69100. }
  69101. return vm.$watch(expOrFn, handler, options)
  69102. }
  69103. function stateMixin (Vue) {
  69104. // flow somehow has problems with directly declared definition object
  69105. // when using Object.defineProperty, so we have to procedurally build up
  69106. // the object here.
  69107. var dataDef = {};
  69108. dataDef.get = function () { return this._data };
  69109. var propsDef = {};
  69110. propsDef.get = function () { return this._props };
  69111. {
  69112. dataDef.set = function () {
  69113. warn(
  69114. 'Avoid replacing instance root $data. ' +
  69115. 'Use nested data properties instead.',
  69116. this
  69117. );
  69118. };
  69119. propsDef.set = function () {
  69120. warn("$props is readonly.", this);
  69121. };
  69122. }
  69123. Object.defineProperty(Vue.prototype, '$data', dataDef);
  69124. Object.defineProperty(Vue.prototype, '$props', propsDef);
  69125. Vue.prototype.$set = set;
  69126. Vue.prototype.$delete = del;
  69127. Vue.prototype.$watch = function (
  69128. expOrFn,
  69129. cb,
  69130. options
  69131. ) {
  69132. var vm = this;
  69133. if (isPlainObject(cb)) {
  69134. return createWatcher(vm, expOrFn, cb, options)
  69135. }
  69136. options = options || {};
  69137. options.user = true;
  69138. var watcher = new Watcher(vm, expOrFn, cb, options);
  69139. if (options.immediate) {
  69140. try {
  69141. cb.call(vm, watcher.value);
  69142. } catch (error) {
  69143. handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
  69144. }
  69145. }
  69146. return function unwatchFn () {
  69147. watcher.teardown();
  69148. }
  69149. };
  69150. }
  69151. /* */
  69152. var uid$3 = 0;
  69153. function initMixin (Vue) {
  69154. Vue.prototype._init = function (options) {
  69155. var vm = this;
  69156. // a uid
  69157. vm._uid = uid$3++;
  69158. var startTag, endTag;
  69159. /* istanbul ignore if */
  69160. if (config.performance && mark) {
  69161. startTag = "vue-perf-start:" + (vm._uid);
  69162. endTag = "vue-perf-end:" + (vm._uid);
  69163. mark(startTag);
  69164. }
  69165. // a flag to avoid this being observed
  69166. vm._isVue = true;
  69167. // merge options
  69168. if (options && options._isComponent) {
  69169. // optimize internal component instantiation
  69170. // since dynamic options merging is pretty slow, and none of the
  69171. // internal component options needs special treatment.
  69172. initInternalComponent(vm, options);
  69173. } else {
  69174. vm.$options = mergeOptions(
  69175. resolveConstructorOptions(vm.constructor),
  69176. options || {},
  69177. vm
  69178. );
  69179. }
  69180. /* istanbul ignore else */
  69181. {
  69182. initProxy(vm);
  69183. }
  69184. // expose real self
  69185. vm._self = vm;
  69186. initLifecycle(vm);
  69187. initEvents(vm);
  69188. initRender(vm);
  69189. callHook(vm, 'beforeCreate');
  69190. initInjections(vm); // resolve injections before data/props
  69191. initState(vm);
  69192. initProvide(vm); // resolve provide after data/props
  69193. callHook(vm, 'created');
  69194. /* istanbul ignore if */
  69195. if (config.performance && mark) {
  69196. vm._name = formatComponentName(vm, false);
  69197. mark(endTag);
  69198. measure(("vue " + (vm._name) + " init"), startTag, endTag);
  69199. }
  69200. if (vm.$options.el) {
  69201. vm.$mount(vm.$options.el);
  69202. }
  69203. };
  69204. }
  69205. function initInternalComponent (vm, options) {
  69206. var opts = vm.$options = Object.create(vm.constructor.options);
  69207. // doing this because it's faster than dynamic enumeration.
  69208. var parentVnode = options._parentVnode;
  69209. opts.parent = options.parent;
  69210. opts._parentVnode = parentVnode;
  69211. var vnodeComponentOptions = parentVnode.componentOptions;
  69212. opts.propsData = vnodeComponentOptions.propsData;
  69213. opts._parentListeners = vnodeComponentOptions.listeners;
  69214. opts._renderChildren = vnodeComponentOptions.children;
  69215. opts._componentTag = vnodeComponentOptions.tag;
  69216. if (options.render) {
  69217. opts.render = options.render;
  69218. opts.staticRenderFns = options.staticRenderFns;
  69219. }
  69220. }
  69221. function resolveConstructorOptions (Ctor) {
  69222. var options = Ctor.options;
  69223. if (Ctor.super) {
  69224. var superOptions = resolveConstructorOptions(Ctor.super);
  69225. var cachedSuperOptions = Ctor.superOptions;
  69226. if (superOptions !== cachedSuperOptions) {
  69227. // super option changed,
  69228. // need to resolve new options.
  69229. Ctor.superOptions = superOptions;
  69230. // check if there are any late-modified/attached options (#4976)
  69231. var modifiedOptions = resolveModifiedOptions(Ctor);
  69232. // update base extend options
  69233. if (modifiedOptions) {
  69234. extend(Ctor.extendOptions, modifiedOptions);
  69235. }
  69236. options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions);
  69237. if (options.name) {
  69238. options.components[options.name] = Ctor;
  69239. }
  69240. }
  69241. }
  69242. return options
  69243. }
  69244. function resolveModifiedOptions (Ctor) {
  69245. var modified;
  69246. var latest = Ctor.options;
  69247. var sealed = Ctor.sealedOptions;
  69248. for (var key in latest) {
  69249. if (latest[key] !== sealed[key]) {
  69250. if (!modified) { modified = {}; }
  69251. modified[key] = latest[key];
  69252. }
  69253. }
  69254. return modified
  69255. }
  69256. function Vue (options) {
  69257. if (!(this instanceof Vue)
  69258. ) {
  69259. warn('Vue is a constructor and should be called with the `new` keyword');
  69260. }
  69261. this._init(options);
  69262. }
  69263. initMixin(Vue);
  69264. stateMixin(Vue);
  69265. eventsMixin(Vue);
  69266. lifecycleMixin(Vue);
  69267. renderMixin(Vue);
  69268. /* */
  69269. function initUse (Vue) {
  69270. Vue.use = function (plugin) {
  69271. var installedPlugins = (this._installedPlugins || (this._installedPlugins = []));
  69272. if (installedPlugins.indexOf(plugin) > -1) {
  69273. return this
  69274. }
  69275. // additional parameters
  69276. var args = toArray(arguments, 1);
  69277. args.unshift(this);
  69278. if (typeof plugin.install === 'function') {
  69279. plugin.install.apply(plugin, args);
  69280. } else if (typeof plugin === 'function') {
  69281. plugin.apply(null, args);
  69282. }
  69283. installedPlugins.push(plugin);
  69284. return this
  69285. };
  69286. }
  69287. /* */
  69288. function initMixin$1 (Vue) {
  69289. Vue.mixin = function (mixin) {
  69290. this.options = mergeOptions(this.options, mixin);
  69291. return this
  69292. };
  69293. }
  69294. /* */
  69295. function initExtend (Vue) {
  69296. /**
  69297. * Each instance constructor, including Vue, has a unique
  69298. * cid. This enables us to create wrapped "child
  69299. * constructors" for prototypal inheritance and cache them.
  69300. */
  69301. Vue.cid = 0;
  69302. var cid = 1;
  69303. /**
  69304. * Class inheritance
  69305. */
  69306. Vue.extend = function (extendOptions) {
  69307. extendOptions = extendOptions || {};
  69308. var Super = this;
  69309. var SuperId = Super.cid;
  69310. var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {});
  69311. if (cachedCtors[SuperId]) {
  69312. return cachedCtors[SuperId]
  69313. }
  69314. var name = extendOptions.name || Super.options.name;
  69315. if (name) {
  69316. validateComponentName(name);
  69317. }
  69318. var Sub = function VueComponent (options) {
  69319. this._init(options);
  69320. };
  69321. Sub.prototype = Object.create(Super.prototype);
  69322. Sub.prototype.constructor = Sub;
  69323. Sub.cid = cid++;
  69324. Sub.options = mergeOptions(
  69325. Super.options,
  69326. extendOptions
  69327. );
  69328. Sub['super'] = Super;
  69329. // For props and computed properties, we define the proxy getters on
  69330. // the Vue instances at extension time, on the extended prototype. This
  69331. // avoids Object.defineProperty calls for each instance created.
  69332. if (Sub.options.props) {
  69333. initProps$1(Sub);
  69334. }
  69335. if (Sub.options.computed) {
  69336. initComputed$1(Sub);
  69337. }
  69338. // allow further extension/mixin/plugin usage
  69339. Sub.extend = Super.extend;
  69340. Sub.mixin = Super.mixin;
  69341. Sub.use = Super.use;
  69342. // create asset registers, so extended classes
  69343. // can have their private assets too.
  69344. ASSET_TYPES.forEach(function (type) {
  69345. Sub[type] = Super[type];
  69346. });
  69347. // enable recursive self-lookup
  69348. if (name) {
  69349. Sub.options.components[name] = Sub;
  69350. }
  69351. // keep a reference to the super options at extension time.
  69352. // later at instantiation we can check if Super's options have
  69353. // been updated.
  69354. Sub.superOptions = Super.options;
  69355. Sub.extendOptions = extendOptions;
  69356. Sub.sealedOptions = extend({}, Sub.options);
  69357. // cache constructor
  69358. cachedCtors[SuperId] = Sub;
  69359. return Sub
  69360. };
  69361. }
  69362. function initProps$1 (Comp) {
  69363. var props = Comp.options.props;
  69364. for (var key in props) {
  69365. proxy(Comp.prototype, "_props", key);
  69366. }
  69367. }
  69368. function initComputed$1 (Comp) {
  69369. var computed = Comp.options.computed;
  69370. for (var key in computed) {
  69371. defineComputed(Comp.prototype, key, computed[key]);
  69372. }
  69373. }
  69374. /* */
  69375. function initAssetRegisters (Vue) {
  69376. /**
  69377. * Create asset registration methods.
  69378. */
  69379. ASSET_TYPES.forEach(function (type) {
  69380. Vue[type] = function (
  69381. id,
  69382. definition
  69383. ) {
  69384. if (!definition) {
  69385. return this.options[type + 's'][id]
  69386. } else {
  69387. /* istanbul ignore if */
  69388. if (type === 'component') {
  69389. validateComponentName(id);
  69390. }
  69391. if (type === 'component' && isPlainObject(definition)) {
  69392. definition.name = definition.name || id;
  69393. definition = this.options._base.extend(definition);
  69394. }
  69395. if (type === 'directive' && typeof definition === 'function') {
  69396. definition = { bind: definition, update: definition };
  69397. }
  69398. this.options[type + 's'][id] = definition;
  69399. return definition
  69400. }
  69401. };
  69402. });
  69403. }
  69404. /* */
  69405. function getComponentName (opts) {
  69406. return opts && (opts.Ctor.options.name || opts.tag)
  69407. }
  69408. function matches (pattern, name) {
  69409. if (Array.isArray(pattern)) {
  69410. return pattern.indexOf(name) > -1
  69411. } else if (typeof pattern === 'string') {
  69412. return pattern.split(',').indexOf(name) > -1
  69413. } else if (isRegExp(pattern)) {
  69414. return pattern.test(name)
  69415. }
  69416. /* istanbul ignore next */
  69417. return false
  69418. }
  69419. function pruneCache (keepAliveInstance, filter) {
  69420. var cache = keepAliveInstance.cache;
  69421. var keys = keepAliveInstance.keys;
  69422. var _vnode = keepAliveInstance._vnode;
  69423. for (var key in cache) {
  69424. var cachedNode = cache[key];
  69425. if (cachedNode) {
  69426. var name = getComponentName(cachedNode.componentOptions);
  69427. if (name && !filter(name)) {
  69428. pruneCacheEntry(cache, key, keys, _vnode);
  69429. }
  69430. }
  69431. }
  69432. }
  69433. function pruneCacheEntry (
  69434. cache,
  69435. key,
  69436. keys,
  69437. current
  69438. ) {
  69439. var cached$$1 = cache[key];
  69440. if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
  69441. cached$$1.componentInstance.$destroy();
  69442. }
  69443. cache[key] = null;
  69444. remove(keys, key);
  69445. }
  69446. var patternTypes = [String, RegExp, Array];
  69447. var KeepAlive = {
  69448. name: 'keep-alive',
  69449. abstract: true,
  69450. props: {
  69451. include: patternTypes,
  69452. exclude: patternTypes,
  69453. max: [String, Number]
  69454. },
  69455. created: function created () {
  69456. this.cache = Object.create(null);
  69457. this.keys = [];
  69458. },
  69459. destroyed: function destroyed () {
  69460. for (var key in this.cache) {
  69461. pruneCacheEntry(this.cache, key, this.keys);
  69462. }
  69463. },
  69464. mounted: function mounted () {
  69465. var this$1 = this;
  69466. this.$watch('include', function (val) {
  69467. pruneCache(this$1, function (name) { return matches(val, name); });
  69468. });
  69469. this.$watch('exclude', function (val) {
  69470. pruneCache(this$1, function (name) { return !matches(val, name); });
  69471. });
  69472. },
  69473. render: function render () {
  69474. var slot = this.$slots.default;
  69475. var vnode = getFirstComponentChild(slot);
  69476. var componentOptions = vnode && vnode.componentOptions;
  69477. if (componentOptions) {
  69478. // check pattern
  69479. var name = getComponentName(componentOptions);
  69480. var ref = this;
  69481. var include = ref.include;
  69482. var exclude = ref.exclude;
  69483. if (
  69484. // not included
  69485. (include && (!name || !matches(include, name))) ||
  69486. // excluded
  69487. (exclude && name && matches(exclude, name))
  69488. ) {
  69489. return vnode
  69490. }
  69491. var ref$1 = this;
  69492. var cache = ref$1.cache;
  69493. var keys = ref$1.keys;
  69494. var key = vnode.key == null
  69495. // same constructor may get registered as different local components
  69496. // so cid alone is not enough (#3269)
  69497. ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '')
  69498. : vnode.key;
  69499. if (cache[key]) {
  69500. vnode.componentInstance = cache[key].componentInstance;
  69501. // make current key freshest
  69502. remove(keys, key);
  69503. keys.push(key);
  69504. } else {
  69505. cache[key] = vnode;
  69506. keys.push(key);
  69507. // prune oldest entry
  69508. if (this.max && keys.length > parseInt(this.max)) {
  69509. pruneCacheEntry(cache, keys[0], keys, this._vnode);
  69510. }
  69511. }
  69512. vnode.data.keepAlive = true;
  69513. }
  69514. return vnode || (slot && slot[0])
  69515. }
  69516. };
  69517. var builtInComponents = {
  69518. KeepAlive: KeepAlive
  69519. };
  69520. /* */
  69521. function initGlobalAPI (Vue) {
  69522. // config
  69523. var configDef = {};
  69524. configDef.get = function () { return config; };
  69525. {
  69526. configDef.set = function () {
  69527. warn(
  69528. 'Do not replace the Vue.config object, set individual fields instead.'
  69529. );
  69530. };
  69531. }
  69532. Object.defineProperty(Vue, 'config', configDef);
  69533. // exposed util methods.
  69534. // NOTE: these are not considered part of the public API - avoid relying on
  69535. // them unless you are aware of the risk.
  69536. Vue.util = {
  69537. warn: warn,
  69538. extend: extend,
  69539. mergeOptions: mergeOptions,
  69540. defineReactive: defineReactive$$1
  69541. };
  69542. Vue.set = set;
  69543. Vue.delete = del;
  69544. Vue.nextTick = nextTick;
  69545. // 2.6 explicit observable API
  69546. Vue.observable = function (obj) {
  69547. observe(obj);
  69548. return obj
  69549. };
  69550. Vue.options = Object.create(null);
  69551. ASSET_TYPES.forEach(function (type) {
  69552. Vue.options[type + 's'] = Object.create(null);
  69553. });
  69554. // this is used to identify the "base" constructor to extend all plain-object
  69555. // components with in Weex's multi-instance scenarios.
  69556. Vue.options._base = Vue;
  69557. extend(Vue.options.components, builtInComponents);
  69558. initUse(Vue);
  69559. initMixin$1(Vue);
  69560. initExtend(Vue);
  69561. initAssetRegisters(Vue);
  69562. }
  69563. initGlobalAPI(Vue);
  69564. Object.defineProperty(Vue.prototype, '$isServer', {
  69565. get: isServerRendering
  69566. });
  69567. Object.defineProperty(Vue.prototype, '$ssrContext', {
  69568. get: function get () {
  69569. /* istanbul ignore next */
  69570. return this.$vnode && this.$vnode.ssrContext
  69571. }
  69572. });
  69573. // expose FunctionalRenderContext for ssr runtime helper installation
  69574. Object.defineProperty(Vue, 'FunctionalRenderContext', {
  69575. value: FunctionalRenderContext
  69576. });
  69577. Vue.version = '2.6.11';
  69578. /* */
  69579. // these are reserved for web because they are directly compiled away
  69580. // during template compilation
  69581. var isReservedAttr = makeMap('style,class');
  69582. // attributes that should be using props for binding
  69583. var acceptValue = makeMap('input,textarea,option,select,progress');
  69584. var mustUseProp = function (tag, type, attr) {
  69585. return (
  69586. (attr === 'value' && acceptValue(tag)) && type !== 'button' ||
  69587. (attr === 'selected' && tag === 'option') ||
  69588. (attr === 'checked' && tag === 'input') ||
  69589. (attr === 'muted' && tag === 'video')
  69590. )
  69591. };
  69592. var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
  69593. var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');
  69594. var convertEnumeratedValue = function (key, value) {
  69595. return isFalsyAttrValue(value) || value === 'false'
  69596. ? 'false'
  69597. // allow arbitrary string value for contenteditable
  69598. : key === 'contenteditable' && isValidContentEditableValue(value)
  69599. ? value
  69600. : 'true'
  69601. };
  69602. var isBooleanAttr = makeMap(
  69603. 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
  69604. 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
  69605. 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
  69606. 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
  69607. 'required,reversed,scoped,seamless,selected,sortable,translate,' +
  69608. 'truespeed,typemustmatch,visible'
  69609. );
  69610. var xlinkNS = 'http://www.w3.org/1999/xlink';
  69611. var isXlink = function (name) {
  69612. return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink'
  69613. };
  69614. var getXlinkProp = function (name) {
  69615. return isXlink(name) ? name.slice(6, name.length) : ''
  69616. };
  69617. var isFalsyAttrValue = function (val) {
  69618. return val == null || val === false
  69619. };
  69620. /* */
  69621. function genClassForVnode (vnode) {
  69622. var data = vnode.data;
  69623. var parentNode = vnode;
  69624. var childNode = vnode;
  69625. while (isDef(childNode.componentInstance)) {
  69626. childNode = childNode.componentInstance._vnode;
  69627. if (childNode && childNode.data) {
  69628. data = mergeClassData(childNode.data, data);
  69629. }
  69630. }
  69631. while (isDef(parentNode = parentNode.parent)) {
  69632. if (parentNode && parentNode.data) {
  69633. data = mergeClassData(data, parentNode.data);
  69634. }
  69635. }
  69636. return renderClass(data.staticClass, data.class)
  69637. }
  69638. function mergeClassData (child, parent) {
  69639. return {
  69640. staticClass: concat(child.staticClass, parent.staticClass),
  69641. class: isDef(child.class)
  69642. ? [child.class, parent.class]
  69643. : parent.class
  69644. }
  69645. }
  69646. function renderClass (
  69647. staticClass,
  69648. dynamicClass
  69649. ) {
  69650. if (isDef(staticClass) || isDef(dynamicClass)) {
  69651. return concat(staticClass, stringifyClass(dynamicClass))
  69652. }
  69653. /* istanbul ignore next */
  69654. return ''
  69655. }
  69656. function concat (a, b) {
  69657. return a ? b ? (a + ' ' + b) : a : (b || '')
  69658. }
  69659. function stringifyClass (value) {
  69660. if (Array.isArray(value)) {
  69661. return stringifyArray(value)
  69662. }
  69663. if (isObject(value)) {
  69664. return stringifyObject(value)
  69665. }
  69666. if (typeof value === 'string') {
  69667. return value
  69668. }
  69669. /* istanbul ignore next */
  69670. return ''
  69671. }
  69672. function stringifyArray (value) {
  69673. var res = '';
  69674. var stringified;
  69675. for (var i = 0, l = value.length; i < l; i++) {
  69676. if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') {
  69677. if (res) { res += ' '; }
  69678. res += stringified;
  69679. }
  69680. }
  69681. return res
  69682. }
  69683. function stringifyObject (value) {
  69684. var res = '';
  69685. for (var key in value) {
  69686. if (value[key]) {
  69687. if (res) { res += ' '; }
  69688. res += key;
  69689. }
  69690. }
  69691. return res
  69692. }
  69693. /* */
  69694. var namespaceMap = {
  69695. svg: 'http://www.w3.org/2000/svg',
  69696. math: 'http://www.w3.org/1998/Math/MathML'
  69697. };
  69698. var isHTMLTag = makeMap(
  69699. 'html,body,base,head,link,meta,style,title,' +
  69700. 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' +
  69701. 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' +
  69702. 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' +
  69703. 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' +
  69704. 'embed,object,param,source,canvas,script,noscript,del,ins,' +
  69705. 'caption,col,colgroup,table,thead,tbody,td,th,tr,' +
  69706. 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' +
  69707. 'output,progress,select,textarea,' +
  69708. 'details,dialog,menu,menuitem,summary,' +
  69709. 'content,element,shadow,template,blockquote,iframe,tfoot'
  69710. );
  69711. // this map is intentionally selective, only covering SVG elements that may
  69712. // contain child elements.
  69713. var isSVG = makeMap(
  69714. 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
  69715. 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
  69716. 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
  69717. true
  69718. );
  69719. var isPreTag = function (tag) { return tag === 'pre'; };
  69720. var isReservedTag = function (tag) {
  69721. return isHTMLTag(tag) || isSVG(tag)
  69722. };
  69723. function getTagNamespace (tag) {
  69724. if (isSVG(tag)) {
  69725. return 'svg'
  69726. }
  69727. // basic support for MathML
  69728. // note it doesn't support other MathML elements being component roots
  69729. if (tag === 'math') {
  69730. return 'math'
  69731. }
  69732. }
  69733. var unknownElementCache = Object.create(null);
  69734. function isUnknownElement (tag) {
  69735. /* istanbul ignore if */
  69736. if (!inBrowser) {
  69737. return true
  69738. }
  69739. if (isReservedTag(tag)) {
  69740. return false
  69741. }
  69742. tag = tag.toLowerCase();
  69743. /* istanbul ignore if */
  69744. if (unknownElementCache[tag] != null) {
  69745. return unknownElementCache[tag]
  69746. }
  69747. var el = document.createElement(tag);
  69748. if (tag.indexOf('-') > -1) {
  69749. // http://stackoverflow.com/a/28210364/1070244
  69750. return (unknownElementCache[tag] = (
  69751. el.constructor === window.HTMLUnknownElement ||
  69752. el.constructor === window.HTMLElement
  69753. ))
  69754. } else {
  69755. return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
  69756. }
  69757. }
  69758. var isTextInputType = makeMap('text,number,password,search,email,tel,url');
  69759. /* */
  69760. /**
  69761. * Query an element selector if it's not an element already.
  69762. */
  69763. function query (el) {
  69764. if (typeof el === 'string') {
  69765. var selected = document.querySelector(el);
  69766. if (!selected) {
  69767. warn(
  69768. 'Cannot find element: ' + el
  69769. );
  69770. return document.createElement('div')
  69771. }
  69772. return selected
  69773. } else {
  69774. return el
  69775. }
  69776. }
  69777. /* */
  69778. function createElement$1 (tagName, vnode) {
  69779. var elm = document.createElement(tagName);
  69780. if (tagName !== 'select') {
  69781. return elm
  69782. }
  69783. // false or null will remove the attribute but undefined will not
  69784. if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) {
  69785. elm.setAttribute('multiple', 'multiple');
  69786. }
  69787. return elm
  69788. }
  69789. function createElementNS (namespace, tagName) {
  69790. return document.createElementNS(namespaceMap[namespace], tagName)
  69791. }
  69792. function createTextNode (text) {
  69793. return document.createTextNode(text)
  69794. }
  69795. function createComment (text) {
  69796. return document.createComment(text)
  69797. }
  69798. function insertBefore (parentNode, newNode, referenceNode) {
  69799. parentNode.insertBefore(newNode, referenceNode);
  69800. }
  69801. function removeChild (node, child) {
  69802. node.removeChild(child);
  69803. }
  69804. function appendChild (node, child) {
  69805. node.appendChild(child);
  69806. }
  69807. function parentNode (node) {
  69808. return node.parentNode
  69809. }
  69810. function nextSibling (node) {
  69811. return node.nextSibling
  69812. }
  69813. function tagName (node) {
  69814. return node.tagName
  69815. }
  69816. function setTextContent (node, text) {
  69817. node.textContent = text;
  69818. }
  69819. function setStyleScope (node, scopeId) {
  69820. node.setAttribute(scopeId, '');
  69821. }
  69822. var nodeOps = /*#__PURE__*/Object.freeze({
  69823. createElement: createElement$1,
  69824. createElementNS: createElementNS,
  69825. createTextNode: createTextNode,
  69826. createComment: createComment,
  69827. insertBefore: insertBefore,
  69828. removeChild: removeChild,
  69829. appendChild: appendChild,
  69830. parentNode: parentNode,
  69831. nextSibling: nextSibling,
  69832. tagName: tagName,
  69833. setTextContent: setTextContent,
  69834. setStyleScope: setStyleScope
  69835. });
  69836. /* */
  69837. var ref = {
  69838. create: function create (_, vnode) {
  69839. registerRef(vnode);
  69840. },
  69841. update: function update (oldVnode, vnode) {
  69842. if (oldVnode.data.ref !== vnode.data.ref) {
  69843. registerRef(oldVnode, true);
  69844. registerRef(vnode);
  69845. }
  69846. },
  69847. destroy: function destroy (vnode) {
  69848. registerRef(vnode, true);
  69849. }
  69850. };
  69851. function registerRef (vnode, isRemoval) {
  69852. var key = vnode.data.ref;
  69853. if (!isDef(key)) { return }
  69854. var vm = vnode.context;
  69855. var ref = vnode.componentInstance || vnode.elm;
  69856. var refs = vm.$refs;
  69857. if (isRemoval) {
  69858. if (Array.isArray(refs[key])) {
  69859. remove(refs[key], ref);
  69860. } else if (refs[key] === ref) {
  69861. refs[key] = undefined;
  69862. }
  69863. } else {
  69864. if (vnode.data.refInFor) {
  69865. if (!Array.isArray(refs[key])) {
  69866. refs[key] = [ref];
  69867. } else if (refs[key].indexOf(ref) < 0) {
  69868. // $flow-disable-line
  69869. refs[key].push(ref);
  69870. }
  69871. } else {
  69872. refs[key] = ref;
  69873. }
  69874. }
  69875. }
  69876. /**
  69877. * Virtual DOM patching algorithm based on Snabbdom by
  69878. * Simon Friis Vindum (@paldepind)
  69879. * Licensed under the MIT License
  69880. * https://github.com/paldepind/snabbdom/blob/master/LICENSE
  69881. *
  69882. * modified by Evan You (@yyx990803)
  69883. *
  69884. * Not type-checking this because this file is perf-critical and the cost
  69885. * of making flow understand it is not worth it.
  69886. */
  69887. var emptyNode = new VNode('', {}, []);
  69888. var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
  69889. function sameVnode (a, b) {
  69890. return (
  69891. a.key === b.key && (
  69892. (
  69893. a.tag === b.tag &&
  69894. a.isComment === b.isComment &&
  69895. isDef(a.data) === isDef(b.data) &&
  69896. sameInputType(a, b)
  69897. ) || (
  69898. isTrue(a.isAsyncPlaceholder) &&
  69899. a.asyncFactory === b.asyncFactory &&
  69900. isUndef(b.asyncFactory.error)
  69901. )
  69902. )
  69903. )
  69904. }
  69905. function sameInputType (a, b) {
  69906. if (a.tag !== 'input') { return true }
  69907. var i;
  69908. var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type;
  69909. var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;
  69910. return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB)
  69911. }
  69912. function createKeyToOldIdx (children, beginIdx, endIdx) {
  69913. var i, key;
  69914. var map = {};
  69915. for (i = beginIdx; i <= endIdx; ++i) {
  69916. key = children[i].key;
  69917. if (isDef(key)) { map[key] = i; }
  69918. }
  69919. return map
  69920. }
  69921. function createPatchFunction (backend) {
  69922. var i, j;
  69923. var cbs = {};
  69924. var modules = backend.modules;
  69925. var nodeOps = backend.nodeOps;
  69926. for (i = 0; i < hooks.length; ++i) {
  69927. cbs[hooks[i]] = [];
  69928. for (j = 0; j < modules.length; ++j) {
  69929. if (isDef(modules[j][hooks[i]])) {
  69930. cbs[hooks[i]].push(modules[j][hooks[i]]);
  69931. }
  69932. }
  69933. }
  69934. function emptyNodeAt (elm) {
  69935. return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm)
  69936. }
  69937. function createRmCb (childElm, listeners) {
  69938. function remove$$1 () {
  69939. if (--remove$$1.listeners === 0) {
  69940. removeNode(childElm);
  69941. }
  69942. }
  69943. remove$$1.listeners = listeners;
  69944. return remove$$1
  69945. }
  69946. function removeNode (el) {
  69947. var parent = nodeOps.parentNode(el);
  69948. // element may have already been removed due to v-html / v-text
  69949. if (isDef(parent)) {
  69950. nodeOps.removeChild(parent, el);
  69951. }
  69952. }
  69953. function isUnknownElement$$1 (vnode, inVPre) {
  69954. return (
  69955. !inVPre &&
  69956. !vnode.ns &&
  69957. !(
  69958. config.ignoredElements.length &&
  69959. config.ignoredElements.some(function (ignore) {
  69960. return isRegExp(ignore)
  69961. ? ignore.test(vnode.tag)
  69962. : ignore === vnode.tag
  69963. })
  69964. ) &&
  69965. config.isUnknownElement(vnode.tag)
  69966. )
  69967. }
  69968. var creatingElmInVPre = 0;
  69969. function createElm (
  69970. vnode,
  69971. insertedVnodeQueue,
  69972. parentElm,
  69973. refElm,
  69974. nested,
  69975. ownerArray,
  69976. index
  69977. ) {
  69978. if (isDef(vnode.elm) && isDef(ownerArray)) {
  69979. // This vnode was used in a previous render!
  69980. // now it's used as a new node, overwriting its elm would cause
  69981. // potential patch errors down the road when it's used as an insertion
  69982. // reference node. Instead, we clone the node on-demand before creating
  69983. // associated DOM element for it.
  69984. vnode = ownerArray[index] = cloneVNode(vnode);
  69985. }
  69986. vnode.isRootInsert = !nested; // for transition enter check
  69987. if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) {
  69988. return
  69989. }
  69990. var data = vnode.data;
  69991. var children = vnode.children;
  69992. var tag = vnode.tag;
  69993. if (isDef(tag)) {
  69994. {
  69995. if (data && data.pre) {
  69996. creatingElmInVPre++;
  69997. }
  69998. if (isUnknownElement$$1(vnode, creatingElmInVPre)) {
  69999. warn(
  70000. 'Unknown custom element: <' + tag + '> - did you ' +
  70001. 'register the component correctly? For recursive components, ' +
  70002. 'make sure to provide the "name" option.',
  70003. vnode.context
  70004. );
  70005. }
  70006. }
  70007. vnode.elm = vnode.ns
  70008. ? nodeOps.createElementNS(vnode.ns, tag)
  70009. : nodeOps.createElement(tag, vnode);
  70010. setScope(vnode);
  70011. /* istanbul ignore if */
  70012. {
  70013. createChildren(vnode, children, insertedVnodeQueue);
  70014. if (isDef(data)) {
  70015. invokeCreateHooks(vnode, insertedVnodeQueue);
  70016. }
  70017. insert(parentElm, vnode.elm, refElm);
  70018. }
  70019. if (data && data.pre) {
  70020. creatingElmInVPre--;
  70021. }
  70022. } else if (isTrue(vnode.isComment)) {
  70023. vnode.elm = nodeOps.createComment(vnode.text);
  70024. insert(parentElm, vnode.elm, refElm);
  70025. } else {
  70026. vnode.elm = nodeOps.createTextNode(vnode.text);
  70027. insert(parentElm, vnode.elm, refElm);
  70028. }
  70029. }
  70030. function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  70031. var i = vnode.data;
  70032. if (isDef(i)) {
  70033. var isReactivated = isDef(vnode.componentInstance) && i.keepAlive;
  70034. if (isDef(i = i.hook) && isDef(i = i.init)) {
  70035. i(vnode, false /* hydrating */);
  70036. }
  70037. // after calling the init hook, if the vnode is a child component
  70038. // it should've created a child instance and mounted it. the child
  70039. // component also has set the placeholder vnode's elm.
  70040. // in that case we can just return the element and be done.
  70041. if (isDef(vnode.componentInstance)) {
  70042. initComponent(vnode, insertedVnodeQueue);
  70043. insert(parentElm, vnode.elm, refElm);
  70044. if (isTrue(isReactivated)) {
  70045. reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm);
  70046. }
  70047. return true
  70048. }
  70049. }
  70050. }
  70051. function initComponent (vnode, insertedVnodeQueue) {
  70052. if (isDef(vnode.data.pendingInsert)) {
  70053. insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert);
  70054. vnode.data.pendingInsert = null;
  70055. }
  70056. vnode.elm = vnode.componentInstance.$el;
  70057. if (isPatchable(vnode)) {
  70058. invokeCreateHooks(vnode, insertedVnodeQueue);
  70059. setScope(vnode);
  70060. } else {
  70061. // empty component root.
  70062. // skip all element-related modules except for ref (#3455)
  70063. registerRef(vnode);
  70064. // make sure to invoke the insert hook
  70065. insertedVnodeQueue.push(vnode);
  70066. }
  70067. }
  70068. function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) {
  70069. var i;
  70070. // hack for #4339: a reactivated component with inner transition
  70071. // does not trigger because the inner node's created hooks are not called
  70072. // again. It's not ideal to involve module-specific logic in here but
  70073. // there doesn't seem to be a better way to do it.
  70074. var innerNode = vnode;
  70075. while (innerNode.componentInstance) {
  70076. innerNode = innerNode.componentInstance._vnode;
  70077. if (isDef(i = innerNode.data) && isDef(i = i.transition)) {
  70078. for (i = 0; i < cbs.activate.length; ++i) {
  70079. cbs.activate[i](emptyNode, innerNode);
  70080. }
  70081. insertedVnodeQueue.push(innerNode);
  70082. break
  70083. }
  70084. }
  70085. // unlike a newly created component,
  70086. // a reactivated keep-alive component doesn't insert itself
  70087. insert(parentElm, vnode.elm, refElm);
  70088. }
  70089. function insert (parent, elm, ref$$1) {
  70090. if (isDef(parent)) {
  70091. if (isDef(ref$$1)) {
  70092. if (nodeOps.parentNode(ref$$1) === parent) {
  70093. nodeOps.insertBefore(parent, elm, ref$$1);
  70094. }
  70095. } else {
  70096. nodeOps.appendChild(parent, elm);
  70097. }
  70098. }
  70099. }
  70100. function createChildren (vnode, children, insertedVnodeQueue) {
  70101. if (Array.isArray(children)) {
  70102. {
  70103. checkDuplicateKeys(children);
  70104. }
  70105. for (var i = 0; i < children.length; ++i) {
  70106. createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i);
  70107. }
  70108. } else if (isPrimitive(vnode.text)) {
  70109. nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
  70110. }
  70111. }
  70112. function isPatchable (vnode) {
  70113. while (vnode.componentInstance) {
  70114. vnode = vnode.componentInstance._vnode;
  70115. }
  70116. return isDef(vnode.tag)
  70117. }
  70118. function invokeCreateHooks (vnode, insertedVnodeQueue) {
  70119. for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
  70120. cbs.create[i$1](emptyNode, vnode);
  70121. }
  70122. i = vnode.data.hook; // Reuse variable
  70123. if (isDef(i)) {
  70124. if (isDef(i.create)) { i.create(emptyNode, vnode); }
  70125. if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); }
  70126. }
  70127. }
  70128. // set scope id attribute for scoped CSS.
  70129. // this is implemented as a special case to avoid the overhead
  70130. // of going through the normal attribute patching process.
  70131. function setScope (vnode) {
  70132. var i;
  70133. if (isDef(i = vnode.fnScopeId)) {
  70134. nodeOps.setStyleScope(vnode.elm, i);
  70135. } else {
  70136. var ancestor = vnode;
  70137. while (ancestor) {
  70138. if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) {
  70139. nodeOps.setStyleScope(vnode.elm, i);
  70140. }
  70141. ancestor = ancestor.parent;
  70142. }
  70143. }
  70144. // for slot content they should also get the scopeId from the host instance.
  70145. if (isDef(i = activeInstance) &&
  70146. i !== vnode.context &&
  70147. i !== vnode.fnContext &&
  70148. isDef(i = i.$options._scopeId)
  70149. ) {
  70150. nodeOps.setStyleScope(vnode.elm, i);
  70151. }
  70152. }
  70153. function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) {
  70154. for (; startIdx <= endIdx; ++startIdx) {
  70155. createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx);
  70156. }
  70157. }
  70158. function invokeDestroyHook (vnode) {
  70159. var i, j;
  70160. var data = vnode.data;
  70161. if (isDef(data)) {
  70162. if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); }
  70163. for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); }
  70164. }
  70165. if (isDef(i = vnode.children)) {
  70166. for (j = 0; j < vnode.children.length; ++j) {
  70167. invokeDestroyHook(vnode.children[j]);
  70168. }
  70169. }
  70170. }
  70171. function removeVnodes (vnodes, startIdx, endIdx) {
  70172. for (; startIdx <= endIdx; ++startIdx) {
  70173. var ch = vnodes[startIdx];
  70174. if (isDef(ch)) {
  70175. if (isDef(ch.tag)) {
  70176. removeAndInvokeRemoveHook(ch);
  70177. invokeDestroyHook(ch);
  70178. } else { // Text node
  70179. removeNode(ch.elm);
  70180. }
  70181. }
  70182. }
  70183. }
  70184. function removeAndInvokeRemoveHook (vnode, rm) {
  70185. if (isDef(rm) || isDef(vnode.data)) {
  70186. var i;
  70187. var listeners = cbs.remove.length + 1;
  70188. if (isDef(rm)) {
  70189. // we have a recursively passed down rm callback
  70190. // increase the listeners count
  70191. rm.listeners += listeners;
  70192. } else {
  70193. // directly removing
  70194. rm = createRmCb(vnode.elm, listeners);
  70195. }
  70196. // recursively invoke hooks on child component root node
  70197. if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) {
  70198. removeAndInvokeRemoveHook(i, rm);
  70199. }
  70200. for (i = 0; i < cbs.remove.length; ++i) {
  70201. cbs.remove[i](vnode, rm);
  70202. }
  70203. if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) {
  70204. i(vnode, rm);
  70205. } else {
  70206. rm();
  70207. }
  70208. } else {
  70209. removeNode(vnode.elm);
  70210. }
  70211. }
  70212. function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) {
  70213. var oldStartIdx = 0;
  70214. var newStartIdx = 0;
  70215. var oldEndIdx = oldCh.length - 1;
  70216. var oldStartVnode = oldCh[0];
  70217. var oldEndVnode = oldCh[oldEndIdx];
  70218. var newEndIdx = newCh.length - 1;
  70219. var newStartVnode = newCh[0];
  70220. var newEndVnode = newCh[newEndIdx];
  70221. var oldKeyToIdx, idxInOld, vnodeToMove, refElm;
  70222. // removeOnly is a special flag used only by <transition-group>
  70223. // to ensure removed elements stay in correct relative positions
  70224. // during leaving transitions
  70225. var canMove = !removeOnly;
  70226. {
  70227. checkDuplicateKeys(newCh);
  70228. }
  70229. while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
  70230. if (isUndef(oldStartVnode)) {
  70231. oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
  70232. } else if (isUndef(oldEndVnode)) {
  70233. oldEndVnode = oldCh[--oldEndIdx];
  70234. } else if (sameVnode(oldStartVnode, newStartVnode)) {
  70235. patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  70236. oldStartVnode = oldCh[++oldStartIdx];
  70237. newStartVnode = newCh[++newStartIdx];
  70238. } else if (sameVnode(oldEndVnode, newEndVnode)) {
  70239. patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  70240. oldEndVnode = oldCh[--oldEndIdx];
  70241. newEndVnode = newCh[--newEndIdx];
  70242. } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right
  70243. patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx);
  70244. canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm));
  70245. oldStartVnode = oldCh[++oldStartIdx];
  70246. newEndVnode = newCh[--newEndIdx];
  70247. } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left
  70248. patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  70249. canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm);
  70250. oldEndVnode = oldCh[--oldEndIdx];
  70251. newStartVnode = newCh[++newStartIdx];
  70252. } else {
  70253. if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); }
  70254. idxInOld = isDef(newStartVnode.key)
  70255. ? oldKeyToIdx[newStartVnode.key]
  70256. : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx);
  70257. if (isUndef(idxInOld)) { // New element
  70258. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  70259. } else {
  70260. vnodeToMove = oldCh[idxInOld];
  70261. if (sameVnode(vnodeToMove, newStartVnode)) {
  70262. patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx);
  70263. oldCh[idxInOld] = undefined;
  70264. canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm);
  70265. } else {
  70266. // same key but different element. treat as new element
  70267. createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx);
  70268. }
  70269. }
  70270. newStartVnode = newCh[++newStartIdx];
  70271. }
  70272. }
  70273. if (oldStartIdx > oldEndIdx) {
  70274. refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
  70275. addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
  70276. } else if (newStartIdx > newEndIdx) {
  70277. removeVnodes(oldCh, oldStartIdx, oldEndIdx);
  70278. }
  70279. }
  70280. function checkDuplicateKeys (children) {
  70281. var seenKeys = {};
  70282. for (var i = 0; i < children.length; i++) {
  70283. var vnode = children[i];
  70284. var key = vnode.key;
  70285. if (isDef(key)) {
  70286. if (seenKeys[key]) {
  70287. warn(
  70288. ("Duplicate keys detected: '" + key + "'. This may cause an update error."),
  70289. vnode.context
  70290. );
  70291. } else {
  70292. seenKeys[key] = true;
  70293. }
  70294. }
  70295. }
  70296. }
  70297. function findIdxInOld (node, oldCh, start, end) {
  70298. for (var i = start; i < end; i++) {
  70299. var c = oldCh[i];
  70300. if (isDef(c) && sameVnode(node, c)) { return i }
  70301. }
  70302. }
  70303. function patchVnode (
  70304. oldVnode,
  70305. vnode,
  70306. insertedVnodeQueue,
  70307. ownerArray,
  70308. index,
  70309. removeOnly
  70310. ) {
  70311. if (oldVnode === vnode) {
  70312. return
  70313. }
  70314. if (isDef(vnode.elm) && isDef(ownerArray)) {
  70315. // clone reused vnode
  70316. vnode = ownerArray[index] = cloneVNode(vnode);
  70317. }
  70318. var elm = vnode.elm = oldVnode.elm;
  70319. if (isTrue(oldVnode.isAsyncPlaceholder)) {
  70320. if (isDef(vnode.asyncFactory.resolved)) {
  70321. hydrate(oldVnode.elm, vnode, insertedVnodeQueue);
  70322. } else {
  70323. vnode.isAsyncPlaceholder = true;
  70324. }
  70325. return
  70326. }
  70327. // reuse element for static trees.
  70328. // note we only do this if the vnode is cloned -
  70329. // if the new node is not cloned it means the render functions have been
  70330. // reset by the hot-reload-api and we need to do a proper re-render.
  70331. if (isTrue(vnode.isStatic) &&
  70332. isTrue(oldVnode.isStatic) &&
  70333. vnode.key === oldVnode.key &&
  70334. (isTrue(vnode.isCloned) || isTrue(vnode.isOnce))
  70335. ) {
  70336. vnode.componentInstance = oldVnode.componentInstance;
  70337. return
  70338. }
  70339. var i;
  70340. var data = vnode.data;
  70341. if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) {
  70342. i(oldVnode, vnode);
  70343. }
  70344. var oldCh = oldVnode.children;
  70345. var ch = vnode.children;
  70346. if (isDef(data) && isPatchable(vnode)) {
  70347. for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); }
  70348. if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); }
  70349. }
  70350. if (isUndef(vnode.text)) {
  70351. if (isDef(oldCh) && isDef(ch)) {
  70352. if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); }
  70353. } else if (isDef(ch)) {
  70354. {
  70355. checkDuplicateKeys(ch);
  70356. }
  70357. if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
  70358. addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
  70359. } else if (isDef(oldCh)) {
  70360. removeVnodes(oldCh, 0, oldCh.length - 1);
  70361. } else if (isDef(oldVnode.text)) {
  70362. nodeOps.setTextContent(elm, '');
  70363. }
  70364. } else if (oldVnode.text !== vnode.text) {
  70365. nodeOps.setTextContent(elm, vnode.text);
  70366. }
  70367. if (isDef(data)) {
  70368. if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); }
  70369. }
  70370. }
  70371. function invokeInsertHook (vnode, queue, initial) {
  70372. // delay insert hooks for component root nodes, invoke them after the
  70373. // element is really inserted
  70374. if (isTrue(initial) && isDef(vnode.parent)) {
  70375. vnode.parent.data.pendingInsert = queue;
  70376. } else {
  70377. for (var i = 0; i < queue.length; ++i) {
  70378. queue[i].data.hook.insert(queue[i]);
  70379. }
  70380. }
  70381. }
  70382. var hydrationBailed = false;
  70383. // list of modules that can skip create hook during hydration because they
  70384. // are already rendered on the client or has no need for initialization
  70385. // Note: style is excluded because it relies on initial clone for future
  70386. // deep updates (#7063).
  70387. var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key');
  70388. // Note: this is a browser-only function so we can assume elms are DOM nodes.
  70389. function hydrate (elm, vnode, insertedVnodeQueue, inVPre) {
  70390. var i;
  70391. var tag = vnode.tag;
  70392. var data = vnode.data;
  70393. var children = vnode.children;
  70394. inVPre = inVPre || (data && data.pre);
  70395. vnode.elm = elm;
  70396. if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) {
  70397. vnode.isAsyncPlaceholder = true;
  70398. return true
  70399. }
  70400. // assert node match
  70401. {
  70402. if (!assertNodeMatch(elm, vnode, inVPre)) {
  70403. return false
  70404. }
  70405. }
  70406. if (isDef(data)) {
  70407. if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); }
  70408. if (isDef(i = vnode.componentInstance)) {
  70409. // child component. it should have hydrated its own tree.
  70410. initComponent(vnode, insertedVnodeQueue);
  70411. return true
  70412. }
  70413. }
  70414. if (isDef(tag)) {
  70415. if (isDef(children)) {
  70416. // empty element, allow client to pick up and populate children
  70417. if (!elm.hasChildNodes()) {
  70418. createChildren(vnode, children, insertedVnodeQueue);
  70419. } else {
  70420. // v-html and domProps: innerHTML
  70421. if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) {
  70422. if (i !== elm.innerHTML) {
  70423. /* istanbul ignore if */
  70424. if (typeof console !== 'undefined' &&
  70425. !hydrationBailed
  70426. ) {
  70427. hydrationBailed = true;
  70428. console.warn('Parent: ', elm);
  70429. console.warn('server innerHTML: ', i);
  70430. console.warn('client innerHTML: ', elm.innerHTML);
  70431. }
  70432. return false
  70433. }
  70434. } else {
  70435. // iterate and compare children lists
  70436. var childrenMatch = true;
  70437. var childNode = elm.firstChild;
  70438. for (var i$1 = 0; i$1 < children.length; i$1++) {
  70439. if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) {
  70440. childrenMatch = false;
  70441. break
  70442. }
  70443. childNode = childNode.nextSibling;
  70444. }
  70445. // if childNode is not null, it means the actual childNodes list is
  70446. // longer than the virtual children list.
  70447. if (!childrenMatch || childNode) {
  70448. /* istanbul ignore if */
  70449. if (typeof console !== 'undefined' &&
  70450. !hydrationBailed
  70451. ) {
  70452. hydrationBailed = true;
  70453. console.warn('Parent: ', elm);
  70454. console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
  70455. }
  70456. return false
  70457. }
  70458. }
  70459. }
  70460. }
  70461. if (isDef(data)) {
  70462. var fullInvoke = false;
  70463. for (var key in data) {
  70464. if (!isRenderedModule(key)) {
  70465. fullInvoke = true;
  70466. invokeCreateHooks(vnode, insertedVnodeQueue);
  70467. break
  70468. }
  70469. }
  70470. if (!fullInvoke && data['class']) {
  70471. // ensure collecting deps for deep class bindings for future updates
  70472. traverse(data['class']);
  70473. }
  70474. }
  70475. } else if (elm.data !== vnode.text) {
  70476. elm.data = vnode.text;
  70477. }
  70478. return true
  70479. }
  70480. function assertNodeMatch (node, vnode, inVPre) {
  70481. if (isDef(vnode.tag)) {
  70482. return vnode.tag.indexOf('vue-component') === 0 || (
  70483. !isUnknownElement$$1(vnode, inVPre) &&
  70484. vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
  70485. )
  70486. } else {
  70487. return node.nodeType === (vnode.isComment ? 8 : 3)
  70488. }
  70489. }
  70490. return function patch (oldVnode, vnode, hydrating, removeOnly) {
  70491. if (isUndef(vnode)) {
  70492. if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); }
  70493. return
  70494. }
  70495. var isInitialPatch = false;
  70496. var insertedVnodeQueue = [];
  70497. if (isUndef(oldVnode)) {
  70498. // empty mount (likely as component), create new root element
  70499. isInitialPatch = true;
  70500. createElm(vnode, insertedVnodeQueue);
  70501. } else {
  70502. var isRealElement = isDef(oldVnode.nodeType);
  70503. if (!isRealElement && sameVnode(oldVnode, vnode)) {
  70504. // patch existing root node
  70505. patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly);
  70506. } else {
  70507. if (isRealElement) {
  70508. // mounting to a real element
  70509. // check if this is server-rendered content and if we can perform
  70510. // a successful hydration.
  70511. if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) {
  70512. oldVnode.removeAttribute(SSR_ATTR);
  70513. hydrating = true;
  70514. }
  70515. if (isTrue(hydrating)) {
  70516. if (hydrate(oldVnode, vnode, insertedVnodeQueue)) {
  70517. invokeInsertHook(vnode, insertedVnodeQueue, true);
  70518. return oldVnode
  70519. } else {
  70520. warn(
  70521. 'The client-side rendered virtual DOM tree is not matching ' +
  70522. 'server-rendered content. This is likely caused by incorrect ' +
  70523. 'HTML markup, for example nesting block-level elements inside ' +
  70524. '<p>, or missing <tbody>. Bailing hydration and performing ' +
  70525. 'full client-side render.'
  70526. );
  70527. }
  70528. }
  70529. // either not server-rendered, or hydration failed.
  70530. // create an empty node and replace it
  70531. oldVnode = emptyNodeAt(oldVnode);
  70532. }
  70533. // replacing existing element
  70534. var oldElm = oldVnode.elm;
  70535. var parentElm = nodeOps.parentNode(oldElm);
  70536. // create new node
  70537. createElm(
  70538. vnode,
  70539. insertedVnodeQueue,
  70540. // extremely rare edge case: do not insert if old element is in a
  70541. // leaving transition. Only happens when combining transition +
  70542. // keep-alive + HOCs. (#4590)
  70543. oldElm._leaveCb ? null : parentElm,
  70544. nodeOps.nextSibling(oldElm)
  70545. );
  70546. // update parent placeholder node element, recursively
  70547. if (isDef(vnode.parent)) {
  70548. var ancestor = vnode.parent;
  70549. var patchable = isPatchable(vnode);
  70550. while (ancestor) {
  70551. for (var i = 0; i < cbs.destroy.length; ++i) {
  70552. cbs.destroy[i](ancestor);
  70553. }
  70554. ancestor.elm = vnode.elm;
  70555. if (patchable) {
  70556. for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) {
  70557. cbs.create[i$1](emptyNode, ancestor);
  70558. }
  70559. // #6513
  70560. // invoke insert hooks that may have been merged by create hooks.
  70561. // e.g. for directives that uses the "inserted" hook.
  70562. var insert = ancestor.data.hook.insert;
  70563. if (insert.merged) {
  70564. // start at index 1 to avoid re-invoking component mounted hook
  70565. for (var i$2 = 1; i$2 < insert.fns.length; i$2++) {
  70566. insert.fns[i$2]();
  70567. }
  70568. }
  70569. } else {
  70570. registerRef(ancestor);
  70571. }
  70572. ancestor = ancestor.parent;
  70573. }
  70574. }
  70575. // destroy old node
  70576. if (isDef(parentElm)) {
  70577. removeVnodes([oldVnode], 0, 0);
  70578. } else if (isDef(oldVnode.tag)) {
  70579. invokeDestroyHook(oldVnode);
  70580. }
  70581. }
  70582. }
  70583. invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch);
  70584. return vnode.elm
  70585. }
  70586. }
  70587. /* */
  70588. var directives = {
  70589. create: updateDirectives,
  70590. update: updateDirectives,
  70591. destroy: function unbindDirectives (vnode) {
  70592. updateDirectives(vnode, emptyNode);
  70593. }
  70594. };
  70595. function updateDirectives (oldVnode, vnode) {
  70596. if (oldVnode.data.directives || vnode.data.directives) {
  70597. _update(oldVnode, vnode);
  70598. }
  70599. }
  70600. function _update (oldVnode, vnode) {
  70601. var isCreate = oldVnode === emptyNode;
  70602. var isDestroy = vnode === emptyNode;
  70603. var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context);
  70604. var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context);
  70605. var dirsWithInsert = [];
  70606. var dirsWithPostpatch = [];
  70607. var key, oldDir, dir;
  70608. for (key in newDirs) {
  70609. oldDir = oldDirs[key];
  70610. dir = newDirs[key];
  70611. if (!oldDir) {
  70612. // new directive, bind
  70613. callHook$1(dir, 'bind', vnode, oldVnode);
  70614. if (dir.def && dir.def.inserted) {
  70615. dirsWithInsert.push(dir);
  70616. }
  70617. } else {
  70618. // existing directive, update
  70619. dir.oldValue = oldDir.value;
  70620. dir.oldArg = oldDir.arg;
  70621. callHook$1(dir, 'update', vnode, oldVnode);
  70622. if (dir.def && dir.def.componentUpdated) {
  70623. dirsWithPostpatch.push(dir);
  70624. }
  70625. }
  70626. }
  70627. if (dirsWithInsert.length) {
  70628. var callInsert = function () {
  70629. for (var i = 0; i < dirsWithInsert.length; i++) {
  70630. callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode);
  70631. }
  70632. };
  70633. if (isCreate) {
  70634. mergeVNodeHook(vnode, 'insert', callInsert);
  70635. } else {
  70636. callInsert();
  70637. }
  70638. }
  70639. if (dirsWithPostpatch.length) {
  70640. mergeVNodeHook(vnode, 'postpatch', function () {
  70641. for (var i = 0; i < dirsWithPostpatch.length; i++) {
  70642. callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode);
  70643. }
  70644. });
  70645. }
  70646. if (!isCreate) {
  70647. for (key in oldDirs) {
  70648. if (!newDirs[key]) {
  70649. // no longer present, unbind
  70650. callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy);
  70651. }
  70652. }
  70653. }
  70654. }
  70655. var emptyModifiers = Object.create(null);
  70656. function normalizeDirectives$1 (
  70657. dirs,
  70658. vm
  70659. ) {
  70660. var res = Object.create(null);
  70661. if (!dirs) {
  70662. // $flow-disable-line
  70663. return res
  70664. }
  70665. var i, dir;
  70666. for (i = 0; i < dirs.length; i++) {
  70667. dir = dirs[i];
  70668. if (!dir.modifiers) {
  70669. // $flow-disable-line
  70670. dir.modifiers = emptyModifiers;
  70671. }
  70672. res[getRawDirName(dir)] = dir;
  70673. dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
  70674. }
  70675. // $flow-disable-line
  70676. return res
  70677. }
  70678. function getRawDirName (dir) {
  70679. return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.')))
  70680. }
  70681. function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) {
  70682. var fn = dir.def && dir.def[hook];
  70683. if (fn) {
  70684. try {
  70685. fn(vnode.elm, dir, vnode, oldVnode, isDestroy);
  70686. } catch (e) {
  70687. handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook"));
  70688. }
  70689. }
  70690. }
  70691. var baseModules = [
  70692. ref,
  70693. directives
  70694. ];
  70695. /* */
  70696. function updateAttrs (oldVnode, vnode) {
  70697. var opts = vnode.componentOptions;
  70698. if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) {
  70699. return
  70700. }
  70701. if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) {
  70702. return
  70703. }
  70704. var key, cur, old;
  70705. var elm = vnode.elm;
  70706. var oldAttrs = oldVnode.data.attrs || {};
  70707. var attrs = vnode.data.attrs || {};
  70708. // clone observed objects, as the user probably wants to mutate it
  70709. if (isDef(attrs.__ob__)) {
  70710. attrs = vnode.data.attrs = extend({}, attrs);
  70711. }
  70712. for (key in attrs) {
  70713. cur = attrs[key];
  70714. old = oldAttrs[key];
  70715. if (old !== cur) {
  70716. setAttr(elm, key, cur);
  70717. }
  70718. }
  70719. // #4391: in IE9, setting type can reset value for input[type=radio]
  70720. // #6666: IE/Edge forces progress value down to 1 before setting a max
  70721. /* istanbul ignore if */
  70722. if ((isIE || isEdge) && attrs.value !== oldAttrs.value) {
  70723. setAttr(elm, 'value', attrs.value);
  70724. }
  70725. for (key in oldAttrs) {
  70726. if (isUndef(attrs[key])) {
  70727. if (isXlink(key)) {
  70728. elm.removeAttributeNS(xlinkNS, getXlinkProp(key));
  70729. } else if (!isEnumeratedAttr(key)) {
  70730. elm.removeAttribute(key);
  70731. }
  70732. }
  70733. }
  70734. }
  70735. function setAttr (el, key, value) {
  70736. if (el.tagName.indexOf('-') > -1) {
  70737. baseSetAttr(el, key, value);
  70738. } else if (isBooleanAttr(key)) {
  70739. // set attribute for blank value
  70740. // e.g. <option disabled>Select one</option>
  70741. if (isFalsyAttrValue(value)) {
  70742. el.removeAttribute(key);
  70743. } else {
  70744. // technically allowfullscreen is a boolean attribute for <iframe>,
  70745. // but Flash expects a value of "true" when used on <embed> tag
  70746. value = key === 'allowfullscreen' && el.tagName === 'EMBED'
  70747. ? 'true'
  70748. : key;
  70749. el.setAttribute(key, value);
  70750. }
  70751. } else if (isEnumeratedAttr(key)) {
  70752. el.setAttribute(key, convertEnumeratedValue(key, value));
  70753. } else if (isXlink(key)) {
  70754. if (isFalsyAttrValue(value)) {
  70755. el.removeAttributeNS(xlinkNS, getXlinkProp(key));
  70756. } else {
  70757. el.setAttributeNS(xlinkNS, key, value);
  70758. }
  70759. } else {
  70760. baseSetAttr(el, key, value);
  70761. }
  70762. }
  70763. function baseSetAttr (el, key, value) {
  70764. if (isFalsyAttrValue(value)) {
  70765. el.removeAttribute(key);
  70766. } else {
  70767. // #7138: IE10 & 11 fires input event when setting placeholder on
  70768. // <textarea>... block the first input event and remove the blocker
  70769. // immediately.
  70770. /* istanbul ignore if */
  70771. if (
  70772. isIE && !isIE9 &&
  70773. el.tagName === 'TEXTAREA' &&
  70774. key === 'placeholder' && value !== '' && !el.__ieph
  70775. ) {
  70776. var blocker = function (e) {
  70777. e.stopImmediatePropagation();
  70778. el.removeEventListener('input', blocker);
  70779. };
  70780. el.addEventListener('input', blocker);
  70781. // $flow-disable-line
  70782. el.__ieph = true; /* IE placeholder patched */
  70783. }
  70784. el.setAttribute(key, value);
  70785. }
  70786. }
  70787. var attrs = {
  70788. create: updateAttrs,
  70789. update: updateAttrs
  70790. };
  70791. /* */
  70792. function updateClass (oldVnode, vnode) {
  70793. var el = vnode.elm;
  70794. var data = vnode.data;
  70795. var oldData = oldVnode.data;
  70796. if (
  70797. isUndef(data.staticClass) &&
  70798. isUndef(data.class) && (
  70799. isUndef(oldData) || (
  70800. isUndef(oldData.staticClass) &&
  70801. isUndef(oldData.class)
  70802. )
  70803. )
  70804. ) {
  70805. return
  70806. }
  70807. var cls = genClassForVnode(vnode);
  70808. // handle transition classes
  70809. var transitionClass = el._transitionClasses;
  70810. if (isDef(transitionClass)) {
  70811. cls = concat(cls, stringifyClass(transitionClass));
  70812. }
  70813. // set the class
  70814. if (cls !== el._prevClass) {
  70815. el.setAttribute('class', cls);
  70816. el._prevClass = cls;
  70817. }
  70818. }
  70819. var klass = {
  70820. create: updateClass,
  70821. update: updateClass
  70822. };
  70823. /* */
  70824. var validDivisionCharRE = /[\w).+\-_$\]]/;
  70825. function parseFilters (exp) {
  70826. var inSingle = false;
  70827. var inDouble = false;
  70828. var inTemplateString = false;
  70829. var inRegex = false;
  70830. var curly = 0;
  70831. var square = 0;
  70832. var paren = 0;
  70833. var lastFilterIndex = 0;
  70834. var c, prev, i, expression, filters;
  70835. for (i = 0; i < exp.length; i++) {
  70836. prev = c;
  70837. c = exp.charCodeAt(i);
  70838. if (inSingle) {
  70839. if (c === 0x27 && prev !== 0x5C) { inSingle = false; }
  70840. } else if (inDouble) {
  70841. if (c === 0x22 && prev !== 0x5C) { inDouble = false; }
  70842. } else if (inTemplateString) {
  70843. if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; }
  70844. } else if (inRegex) {
  70845. if (c === 0x2f && prev !== 0x5C) { inRegex = false; }
  70846. } else if (
  70847. c === 0x7C && // pipe
  70848. exp.charCodeAt(i + 1) !== 0x7C &&
  70849. exp.charCodeAt(i - 1) !== 0x7C &&
  70850. !curly && !square && !paren
  70851. ) {
  70852. if (expression === undefined) {
  70853. // first filter, end of expression
  70854. lastFilterIndex = i + 1;
  70855. expression = exp.slice(0, i).trim();
  70856. } else {
  70857. pushFilter();
  70858. }
  70859. } else {
  70860. switch (c) {
  70861. case 0x22: inDouble = true; break // "
  70862. case 0x27: inSingle = true; break // '
  70863. case 0x60: inTemplateString = true; break // `
  70864. case 0x28: paren++; break // (
  70865. case 0x29: paren--; break // )
  70866. case 0x5B: square++; break // [
  70867. case 0x5D: square--; break // ]
  70868. case 0x7B: curly++; break // {
  70869. case 0x7D: curly--; break // }
  70870. }
  70871. if (c === 0x2f) { // /
  70872. var j = i - 1;
  70873. var p = (void 0);
  70874. // find first non-whitespace prev char
  70875. for (; j >= 0; j--) {
  70876. p = exp.charAt(j);
  70877. if (p !== ' ') { break }
  70878. }
  70879. if (!p || !validDivisionCharRE.test(p)) {
  70880. inRegex = true;
  70881. }
  70882. }
  70883. }
  70884. }
  70885. if (expression === undefined) {
  70886. expression = exp.slice(0, i).trim();
  70887. } else if (lastFilterIndex !== 0) {
  70888. pushFilter();
  70889. }
  70890. function pushFilter () {
  70891. (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim());
  70892. lastFilterIndex = i + 1;
  70893. }
  70894. if (filters) {
  70895. for (i = 0; i < filters.length; i++) {
  70896. expression = wrapFilter(expression, filters[i]);
  70897. }
  70898. }
  70899. return expression
  70900. }
  70901. function wrapFilter (exp, filter) {
  70902. var i = filter.indexOf('(');
  70903. if (i < 0) {
  70904. // _f: resolveFilter
  70905. return ("_f(\"" + filter + "\")(" + exp + ")")
  70906. } else {
  70907. var name = filter.slice(0, i);
  70908. var args = filter.slice(i + 1);
  70909. return ("_f(\"" + name + "\")(" + exp + (args !== ')' ? ',' + args : args))
  70910. }
  70911. }
  70912. /* */
  70913. /* eslint-disable no-unused-vars */
  70914. function baseWarn (msg, range) {
  70915. console.error(("[Vue compiler]: " + msg));
  70916. }
  70917. /* eslint-enable no-unused-vars */
  70918. function pluckModuleFunction (
  70919. modules,
  70920. key
  70921. ) {
  70922. return modules
  70923. ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; })
  70924. : []
  70925. }
  70926. function addProp (el, name, value, range, dynamic) {
  70927. (el.props || (el.props = [])).push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
  70928. el.plain = false;
  70929. }
  70930. function addAttr (el, name, value, range, dynamic) {
  70931. var attrs = dynamic
  70932. ? (el.dynamicAttrs || (el.dynamicAttrs = []))
  70933. : (el.attrs || (el.attrs = []));
  70934. attrs.push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range));
  70935. el.plain = false;
  70936. }
  70937. // add a raw attr (use this in preTransforms)
  70938. function addRawAttr (el, name, value, range) {
  70939. el.attrsMap[name] = value;
  70940. el.attrsList.push(rangeSetItem({ name: name, value: value }, range));
  70941. }
  70942. function addDirective (
  70943. el,
  70944. name,
  70945. rawName,
  70946. value,
  70947. arg,
  70948. isDynamicArg,
  70949. modifiers,
  70950. range
  70951. ) {
  70952. (el.directives || (el.directives = [])).push(rangeSetItem({
  70953. name: name,
  70954. rawName: rawName,
  70955. value: value,
  70956. arg: arg,
  70957. isDynamicArg: isDynamicArg,
  70958. modifiers: modifiers
  70959. }, range));
  70960. el.plain = false;
  70961. }
  70962. function prependModifierMarker (symbol, name, dynamic) {
  70963. return dynamic
  70964. ? ("_p(" + name + ",\"" + symbol + "\")")
  70965. : symbol + name // mark the event as captured
  70966. }
  70967. function addHandler (
  70968. el,
  70969. name,
  70970. value,
  70971. modifiers,
  70972. important,
  70973. warn,
  70974. range,
  70975. dynamic
  70976. ) {
  70977. modifiers = modifiers || emptyObject;
  70978. // warn prevent and passive modifier
  70979. /* istanbul ignore if */
  70980. if (
  70981. warn &&
  70982. modifiers.prevent && modifiers.passive
  70983. ) {
  70984. warn(
  70985. 'passive and prevent can\'t be used together. ' +
  70986. 'Passive handler can\'t prevent default event.',
  70987. range
  70988. );
  70989. }
  70990. // normalize click.right and click.middle since they don't actually fire
  70991. // this is technically browser-specific, but at least for now browsers are
  70992. // the only target envs that have right/middle clicks.
  70993. if (modifiers.right) {
  70994. if (dynamic) {
  70995. name = "(" + name + ")==='click'?'contextmenu':(" + name + ")";
  70996. } else if (name === 'click') {
  70997. name = 'contextmenu';
  70998. delete modifiers.right;
  70999. }
  71000. } else if (modifiers.middle) {
  71001. if (dynamic) {
  71002. name = "(" + name + ")==='click'?'mouseup':(" + name + ")";
  71003. } else if (name === 'click') {
  71004. name = 'mouseup';
  71005. }
  71006. }
  71007. // check capture modifier
  71008. if (modifiers.capture) {
  71009. delete modifiers.capture;
  71010. name = prependModifierMarker('!', name, dynamic);
  71011. }
  71012. if (modifiers.once) {
  71013. delete modifiers.once;
  71014. name = prependModifierMarker('~', name, dynamic);
  71015. }
  71016. /* istanbul ignore if */
  71017. if (modifiers.passive) {
  71018. delete modifiers.passive;
  71019. name = prependModifierMarker('&', name, dynamic);
  71020. }
  71021. var events;
  71022. if (modifiers.native) {
  71023. delete modifiers.native;
  71024. events = el.nativeEvents || (el.nativeEvents = {});
  71025. } else {
  71026. events = el.events || (el.events = {});
  71027. }
  71028. var newHandler = rangeSetItem({ value: value.trim(), dynamic: dynamic }, range);
  71029. if (modifiers !== emptyObject) {
  71030. newHandler.modifiers = modifiers;
  71031. }
  71032. var handlers = events[name];
  71033. /* istanbul ignore if */
  71034. if (Array.isArray(handlers)) {
  71035. important ? handlers.unshift(newHandler) : handlers.push(newHandler);
  71036. } else if (handlers) {
  71037. events[name] = important ? [newHandler, handlers] : [handlers, newHandler];
  71038. } else {
  71039. events[name] = newHandler;
  71040. }
  71041. el.plain = false;
  71042. }
  71043. function getRawBindingAttr (
  71044. el,
  71045. name
  71046. ) {
  71047. return el.rawAttrsMap[':' + name] ||
  71048. el.rawAttrsMap['v-bind:' + name] ||
  71049. el.rawAttrsMap[name]
  71050. }
  71051. function getBindingAttr (
  71052. el,
  71053. name,
  71054. getStatic
  71055. ) {
  71056. var dynamicValue =
  71057. getAndRemoveAttr(el, ':' + name) ||
  71058. getAndRemoveAttr(el, 'v-bind:' + name);
  71059. if (dynamicValue != null) {
  71060. return parseFilters(dynamicValue)
  71061. } else if (getStatic !== false) {
  71062. var staticValue = getAndRemoveAttr(el, name);
  71063. if (staticValue != null) {
  71064. return JSON.stringify(staticValue)
  71065. }
  71066. }
  71067. }
  71068. // note: this only removes the attr from the Array (attrsList) so that it
  71069. // doesn't get processed by processAttrs.
  71070. // By default it does NOT remove it from the map (attrsMap) because the map is
  71071. // needed during codegen.
  71072. function getAndRemoveAttr (
  71073. el,
  71074. name,
  71075. removeFromMap
  71076. ) {
  71077. var val;
  71078. if ((val = el.attrsMap[name]) != null) {
  71079. var list = el.attrsList;
  71080. for (var i = 0, l = list.length; i < l; i++) {
  71081. if (list[i].name === name) {
  71082. list.splice(i, 1);
  71083. break
  71084. }
  71085. }
  71086. }
  71087. if (removeFromMap) {
  71088. delete el.attrsMap[name];
  71089. }
  71090. return val
  71091. }
  71092. function getAndRemoveAttrByRegex (
  71093. el,
  71094. name
  71095. ) {
  71096. var list = el.attrsList;
  71097. for (var i = 0, l = list.length; i < l; i++) {
  71098. var attr = list[i];
  71099. if (name.test(attr.name)) {
  71100. list.splice(i, 1);
  71101. return attr
  71102. }
  71103. }
  71104. }
  71105. function rangeSetItem (
  71106. item,
  71107. range
  71108. ) {
  71109. if (range) {
  71110. if (range.start != null) {
  71111. item.start = range.start;
  71112. }
  71113. if (range.end != null) {
  71114. item.end = range.end;
  71115. }
  71116. }
  71117. return item
  71118. }
  71119. /* */
  71120. /**
  71121. * Cross-platform code generation for component v-model
  71122. */
  71123. function genComponentModel (
  71124. el,
  71125. value,
  71126. modifiers
  71127. ) {
  71128. var ref = modifiers || {};
  71129. var number = ref.number;
  71130. var trim = ref.trim;
  71131. var baseValueExpression = '$$v';
  71132. var valueExpression = baseValueExpression;
  71133. if (trim) {
  71134. valueExpression =
  71135. "(typeof " + baseValueExpression + " === 'string'" +
  71136. "? " + baseValueExpression + ".trim()" +
  71137. ": " + baseValueExpression + ")";
  71138. }
  71139. if (number) {
  71140. valueExpression = "_n(" + valueExpression + ")";
  71141. }
  71142. var assignment = genAssignmentCode(value, valueExpression);
  71143. el.model = {
  71144. value: ("(" + value + ")"),
  71145. expression: JSON.stringify(value),
  71146. callback: ("function (" + baseValueExpression + ") {" + assignment + "}")
  71147. };
  71148. }
  71149. /**
  71150. * Cross-platform codegen helper for generating v-model value assignment code.
  71151. */
  71152. function genAssignmentCode (
  71153. value,
  71154. assignment
  71155. ) {
  71156. var res = parseModel(value);
  71157. if (res.key === null) {
  71158. return (value + "=" + assignment)
  71159. } else {
  71160. return ("$set(" + (res.exp) + ", " + (res.key) + ", " + assignment + ")")
  71161. }
  71162. }
  71163. /**
  71164. * Parse a v-model expression into a base path and a final key segment.
  71165. * Handles both dot-path and possible square brackets.
  71166. *
  71167. * Possible cases:
  71168. *
  71169. * - test
  71170. * - test[key]
  71171. * - test[test1[key]]
  71172. * - test["a"][key]
  71173. * - xxx.test[a[a].test1[key]]
  71174. * - test.xxx.a["asa"][test1[key]]
  71175. *
  71176. */
  71177. var len, str, chr, index$1, expressionPos, expressionEndPos;
  71178. function parseModel (val) {
  71179. // Fix https://github.com/vuejs/vue/pull/7730
  71180. // allow v-model="obj.val " (trailing whitespace)
  71181. val = val.trim();
  71182. len = val.length;
  71183. if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) {
  71184. index$1 = val.lastIndexOf('.');
  71185. if (index$1 > -1) {
  71186. return {
  71187. exp: val.slice(0, index$1),
  71188. key: '"' + val.slice(index$1 + 1) + '"'
  71189. }
  71190. } else {
  71191. return {
  71192. exp: val,
  71193. key: null
  71194. }
  71195. }
  71196. }
  71197. str = val;
  71198. index$1 = expressionPos = expressionEndPos = 0;
  71199. while (!eof()) {
  71200. chr = next();
  71201. /* istanbul ignore if */
  71202. if (isStringStart(chr)) {
  71203. parseString(chr);
  71204. } else if (chr === 0x5B) {
  71205. parseBracket(chr);
  71206. }
  71207. }
  71208. return {
  71209. exp: val.slice(0, expressionPos),
  71210. key: val.slice(expressionPos + 1, expressionEndPos)
  71211. }
  71212. }
  71213. function next () {
  71214. return str.charCodeAt(++index$1)
  71215. }
  71216. function eof () {
  71217. return index$1 >= len
  71218. }
  71219. function isStringStart (chr) {
  71220. return chr === 0x22 || chr === 0x27
  71221. }
  71222. function parseBracket (chr) {
  71223. var inBracket = 1;
  71224. expressionPos = index$1;
  71225. while (!eof()) {
  71226. chr = next();
  71227. if (isStringStart(chr)) {
  71228. parseString(chr);
  71229. continue
  71230. }
  71231. if (chr === 0x5B) { inBracket++; }
  71232. if (chr === 0x5D) { inBracket--; }
  71233. if (inBracket === 0) {
  71234. expressionEndPos = index$1;
  71235. break
  71236. }
  71237. }
  71238. }
  71239. function parseString (chr) {
  71240. var stringQuote = chr;
  71241. while (!eof()) {
  71242. chr = next();
  71243. if (chr === stringQuote) {
  71244. break
  71245. }
  71246. }
  71247. }
  71248. /* */
  71249. var warn$1;
  71250. // in some cases, the event used has to be determined at runtime
  71251. // so we used some reserved tokens during compile.
  71252. var RANGE_TOKEN = '__r';
  71253. var CHECKBOX_RADIO_TOKEN = '__c';
  71254. function model (
  71255. el,
  71256. dir,
  71257. _warn
  71258. ) {
  71259. warn$1 = _warn;
  71260. var value = dir.value;
  71261. var modifiers = dir.modifiers;
  71262. var tag = el.tag;
  71263. var type = el.attrsMap.type;
  71264. {
  71265. // inputs with type="file" are read only and setting the input's
  71266. // value will throw an error.
  71267. if (tag === 'input' && type === 'file') {
  71268. warn$1(
  71269. "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" +
  71270. "File inputs are read only. Use a v-on:change listener instead.",
  71271. el.rawAttrsMap['v-model']
  71272. );
  71273. }
  71274. }
  71275. if (el.component) {
  71276. genComponentModel(el, value, modifiers);
  71277. // component v-model doesn't need extra runtime
  71278. return false
  71279. } else if (tag === 'select') {
  71280. genSelect(el, value, modifiers);
  71281. } else if (tag === 'input' && type === 'checkbox') {
  71282. genCheckboxModel(el, value, modifiers);
  71283. } else if (tag === 'input' && type === 'radio') {
  71284. genRadioModel(el, value, modifiers);
  71285. } else if (tag === 'input' || tag === 'textarea') {
  71286. genDefaultModel(el, value, modifiers);
  71287. } else if (!config.isReservedTag(tag)) {
  71288. genComponentModel(el, value, modifiers);
  71289. // component v-model doesn't need extra runtime
  71290. return false
  71291. } else {
  71292. warn$1(
  71293. "<" + (el.tag) + " v-model=\"" + value + "\">: " +
  71294. "v-model is not supported on this element type. " +
  71295. 'If you are working with contenteditable, it\'s recommended to ' +
  71296. 'wrap a library dedicated for that purpose inside a custom component.',
  71297. el.rawAttrsMap['v-model']
  71298. );
  71299. }
  71300. // ensure runtime directive metadata
  71301. return true
  71302. }
  71303. function genCheckboxModel (
  71304. el,
  71305. value,
  71306. modifiers
  71307. ) {
  71308. var number = modifiers && modifiers.number;
  71309. var valueBinding = getBindingAttr(el, 'value') || 'null';
  71310. var trueValueBinding = getBindingAttr(el, 'true-value') || 'true';
  71311. var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
  71312. addProp(el, 'checked',
  71313. "Array.isArray(" + value + ")" +
  71314. "?_i(" + value + "," + valueBinding + ")>-1" + (
  71315. trueValueBinding === 'true'
  71316. ? (":(" + value + ")")
  71317. : (":_q(" + value + "," + trueValueBinding + ")")
  71318. )
  71319. );
  71320. addHandler(el, 'change',
  71321. "var $$a=" + value + "," +
  71322. '$$el=$event.target,' +
  71323. "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" +
  71324. 'if(Array.isArray($$a)){' +
  71325. "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," +
  71326. '$$i=_i($$a,$$v);' +
  71327. "if($$el.checked){$$i<0&&(" + (genAssignmentCode(value, '$$a.concat([$$v])')) + ")}" +
  71328. "else{$$i>-1&&(" + (genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))')) + ")}" +
  71329. "}else{" + (genAssignmentCode(value, '$$c')) + "}",
  71330. null, true
  71331. );
  71332. }
  71333. function genRadioModel (
  71334. el,
  71335. value,
  71336. modifiers
  71337. ) {
  71338. var number = modifiers && modifiers.number;
  71339. var valueBinding = getBindingAttr(el, 'value') || 'null';
  71340. valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding;
  71341. addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")"));
  71342. addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true);
  71343. }
  71344. function genSelect (
  71345. el,
  71346. value,
  71347. modifiers
  71348. ) {
  71349. var number = modifiers && modifiers.number;
  71350. var selectedVal = "Array.prototype.filter" +
  71351. ".call($event.target.options,function(o){return o.selected})" +
  71352. ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" +
  71353. "return " + (number ? '_n(val)' : 'val') + "})";
  71354. var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]';
  71355. var code = "var $$selectedVal = " + selectedVal + ";";
  71356. code = code + " " + (genAssignmentCode(value, assignment));
  71357. addHandler(el, 'change', code, null, true);
  71358. }
  71359. function genDefaultModel (
  71360. el,
  71361. value,
  71362. modifiers
  71363. ) {
  71364. var type = el.attrsMap.type;
  71365. // warn if v-bind:value conflicts with v-model
  71366. // except for inputs with v-bind:type
  71367. {
  71368. var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value'];
  71369. var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type'];
  71370. if (value$1 && !typeBinding) {
  71371. var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value';
  71372. warn$1(
  71373. binding + "=\"" + value$1 + "\" conflicts with v-model on the same element " +
  71374. 'because the latter already expands to a value binding internally',
  71375. el.rawAttrsMap[binding]
  71376. );
  71377. }
  71378. }
  71379. var ref = modifiers || {};
  71380. var lazy = ref.lazy;
  71381. var number = ref.number;
  71382. var trim = ref.trim;
  71383. var needCompositionGuard = !lazy && type !== 'range';
  71384. var event = lazy
  71385. ? 'change'
  71386. : type === 'range'
  71387. ? RANGE_TOKEN
  71388. : 'input';
  71389. var valueExpression = '$event.target.value';
  71390. if (trim) {
  71391. valueExpression = "$event.target.value.trim()";
  71392. }
  71393. if (number) {
  71394. valueExpression = "_n(" + valueExpression + ")";
  71395. }
  71396. var code = genAssignmentCode(value, valueExpression);
  71397. if (needCompositionGuard) {
  71398. code = "if($event.target.composing)return;" + code;
  71399. }
  71400. addProp(el, 'value', ("(" + value + ")"));
  71401. addHandler(el, event, code, null, true);
  71402. if (trim || number) {
  71403. addHandler(el, 'blur', '$forceUpdate()');
  71404. }
  71405. }
  71406. /* */
  71407. // normalize v-model event tokens that can only be determined at runtime.
  71408. // it's important to place the event as the first in the array because
  71409. // the whole point is ensuring the v-model callback gets called before
  71410. // user-attached handlers.
  71411. function normalizeEvents (on) {
  71412. /* istanbul ignore if */
  71413. if (isDef(on[RANGE_TOKEN])) {
  71414. // IE input[type=range] only supports `change` event
  71415. var event = isIE ? 'change' : 'input';
  71416. on[event] = [].concat(on[RANGE_TOKEN], on[event] || []);
  71417. delete on[RANGE_TOKEN];
  71418. }
  71419. // This was originally intended to fix #4521 but no longer necessary
  71420. // after 2.5. Keeping it for backwards compat with generated code from < 2.4
  71421. /* istanbul ignore if */
  71422. if (isDef(on[CHECKBOX_RADIO_TOKEN])) {
  71423. on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []);
  71424. delete on[CHECKBOX_RADIO_TOKEN];
  71425. }
  71426. }
  71427. var target$1;
  71428. function createOnceHandler$1 (event, handler, capture) {
  71429. var _target = target$1; // save current target element in closure
  71430. return function onceHandler () {
  71431. var res = handler.apply(null, arguments);
  71432. if (res !== null) {
  71433. remove$2(event, onceHandler, capture, _target);
  71434. }
  71435. }
  71436. }
  71437. // #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp
  71438. // implementation and does not fire microtasks in between event propagation, so
  71439. // safe to exclude.
  71440. var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53);
  71441. function add$1 (
  71442. name,
  71443. handler,
  71444. capture,
  71445. passive
  71446. ) {
  71447. // async edge case #6566: inner click event triggers patch, event handler
  71448. // attached to outer element during patch, and triggered again. This
  71449. // happens because browsers fire microtask ticks between event propagation.
  71450. // the solution is simple: we save the timestamp when a handler is attached,
  71451. // and the handler would only fire if the event passed to it was fired
  71452. // AFTER it was attached.
  71453. if (useMicrotaskFix) {
  71454. var attachedTimestamp = currentFlushTimestamp;
  71455. var original = handler;
  71456. handler = original._wrapper = function (e) {
  71457. if (
  71458. // no bubbling, should always fire.
  71459. // this is just a safety net in case event.timeStamp is unreliable in
  71460. // certain weird environments...
  71461. e.target === e.currentTarget ||
  71462. // event is fired after handler attachment
  71463. e.timeStamp >= attachedTimestamp ||
  71464. // bail for environments that have buggy event.timeStamp implementations
  71465. // #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState
  71466. // #9681 QtWebEngine event.timeStamp is negative value
  71467. e.timeStamp <= 0 ||
  71468. // #9448 bail if event is fired in another document in a multi-page
  71469. // electron/nw.js app, since event.timeStamp will be using a different
  71470. // starting reference
  71471. e.target.ownerDocument !== document
  71472. ) {
  71473. return original.apply(this, arguments)
  71474. }
  71475. };
  71476. }
  71477. target$1.addEventListener(
  71478. name,
  71479. handler,
  71480. supportsPassive
  71481. ? { capture: capture, passive: passive }
  71482. : capture
  71483. );
  71484. }
  71485. function remove$2 (
  71486. name,
  71487. handler,
  71488. capture,
  71489. _target
  71490. ) {
  71491. (_target || target$1).removeEventListener(
  71492. name,
  71493. handler._wrapper || handler,
  71494. capture
  71495. );
  71496. }
  71497. function updateDOMListeners (oldVnode, vnode) {
  71498. if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) {
  71499. return
  71500. }
  71501. var on = vnode.data.on || {};
  71502. var oldOn = oldVnode.data.on || {};
  71503. target$1 = vnode.elm;
  71504. normalizeEvents(on);
  71505. updateListeners(on, oldOn, add$1, remove$2, createOnceHandler$1, vnode.context);
  71506. target$1 = undefined;
  71507. }
  71508. var events = {
  71509. create: updateDOMListeners,
  71510. update: updateDOMListeners
  71511. };
  71512. /* */
  71513. var svgContainer;
  71514. function updateDOMProps (oldVnode, vnode) {
  71515. if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) {
  71516. return
  71517. }
  71518. var key, cur;
  71519. var elm = vnode.elm;
  71520. var oldProps = oldVnode.data.domProps || {};
  71521. var props = vnode.data.domProps || {};
  71522. // clone observed objects, as the user probably wants to mutate it
  71523. if (isDef(props.__ob__)) {
  71524. props = vnode.data.domProps = extend({}, props);
  71525. }
  71526. for (key in oldProps) {
  71527. if (!(key in props)) {
  71528. elm[key] = '';
  71529. }
  71530. }
  71531. for (key in props) {
  71532. cur = props[key];
  71533. // ignore children if the node has textContent or innerHTML,
  71534. // as these will throw away existing DOM nodes and cause removal errors
  71535. // on subsequent patches (#3360)
  71536. if (key === 'textContent' || key === 'innerHTML') {
  71537. if (vnode.children) { vnode.children.length = 0; }
  71538. if (cur === oldProps[key]) { continue }
  71539. // #6601 work around Chrome version <= 55 bug where single textNode
  71540. // replaced by innerHTML/textContent retains its parentNode property
  71541. if (elm.childNodes.length === 1) {
  71542. elm.removeChild(elm.childNodes[0]);
  71543. }
  71544. }
  71545. if (key === 'value' && elm.tagName !== 'PROGRESS') {
  71546. // store value as _value as well since
  71547. // non-string values will be stringified
  71548. elm._value = cur;
  71549. // avoid resetting cursor position when value is the same
  71550. var strCur = isUndef(cur) ? '' : String(cur);
  71551. if (shouldUpdateValue(elm, strCur)) {
  71552. elm.value = strCur;
  71553. }
  71554. } else if (key === 'innerHTML' && isSVG(elm.tagName) && isUndef(elm.innerHTML)) {
  71555. // IE doesn't support innerHTML for SVG elements
  71556. svgContainer = svgContainer || document.createElement('div');
  71557. svgContainer.innerHTML = "<svg>" + cur + "</svg>";
  71558. var svg = svgContainer.firstChild;
  71559. while (elm.firstChild) {
  71560. elm.removeChild(elm.firstChild);
  71561. }
  71562. while (svg.firstChild) {
  71563. elm.appendChild(svg.firstChild);
  71564. }
  71565. } else if (
  71566. // skip the update if old and new VDOM state is the same.
  71567. // `value` is handled separately because the DOM value may be temporarily
  71568. // out of sync with VDOM state due to focus, composition and modifiers.
  71569. // This #4521 by skipping the unnecesarry `checked` update.
  71570. cur !== oldProps[key]
  71571. ) {
  71572. // some property updates can throw
  71573. // e.g. `value` on <progress> w/ non-finite value
  71574. try {
  71575. elm[key] = cur;
  71576. } catch (e) {}
  71577. }
  71578. }
  71579. }
  71580. // check platforms/web/util/attrs.js acceptValue
  71581. function shouldUpdateValue (elm, checkVal) {
  71582. return (!elm.composing && (
  71583. elm.tagName === 'OPTION' ||
  71584. isNotInFocusAndDirty(elm, checkVal) ||
  71585. isDirtyWithModifiers(elm, checkVal)
  71586. ))
  71587. }
  71588. function isNotInFocusAndDirty (elm, checkVal) {
  71589. // return true when textbox (.number and .trim) loses focus and its value is
  71590. // not equal to the updated value
  71591. var notInFocus = true;
  71592. // #6157
  71593. // work around IE bug when accessing document.activeElement in an iframe
  71594. try { notInFocus = document.activeElement !== elm; } catch (e) {}
  71595. return notInFocus && elm.value !== checkVal
  71596. }
  71597. function isDirtyWithModifiers (elm, newVal) {
  71598. var value = elm.value;
  71599. var modifiers = elm._vModifiers; // injected by v-model runtime
  71600. if (isDef(modifiers)) {
  71601. if (modifiers.number) {
  71602. return toNumber(value) !== toNumber(newVal)
  71603. }
  71604. if (modifiers.trim) {
  71605. return value.trim() !== newVal.trim()
  71606. }
  71607. }
  71608. return value !== newVal
  71609. }
  71610. var domProps = {
  71611. create: updateDOMProps,
  71612. update: updateDOMProps
  71613. };
  71614. /* */
  71615. var parseStyleText = cached(function (cssText) {
  71616. var res = {};
  71617. var listDelimiter = /;(?![^(]*\))/g;
  71618. var propertyDelimiter = /:(.+)/;
  71619. cssText.split(listDelimiter).forEach(function (item) {
  71620. if (item) {
  71621. var tmp = item.split(propertyDelimiter);
  71622. tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim());
  71623. }
  71624. });
  71625. return res
  71626. });
  71627. // merge static and dynamic style data on the same vnode
  71628. function normalizeStyleData (data) {
  71629. var style = normalizeStyleBinding(data.style);
  71630. // static style is pre-processed into an object during compilation
  71631. // and is always a fresh object, so it's safe to merge into it
  71632. return data.staticStyle
  71633. ? extend(data.staticStyle, style)
  71634. : style
  71635. }
  71636. // normalize possible array / string values into Object
  71637. function normalizeStyleBinding (bindingStyle) {
  71638. if (Array.isArray(bindingStyle)) {
  71639. return toObject(bindingStyle)
  71640. }
  71641. if (typeof bindingStyle === 'string') {
  71642. return parseStyleText(bindingStyle)
  71643. }
  71644. return bindingStyle
  71645. }
  71646. /**
  71647. * parent component style should be after child's
  71648. * so that parent component's style could override it
  71649. */
  71650. function getStyle (vnode, checkChild) {
  71651. var res = {};
  71652. var styleData;
  71653. if (checkChild) {
  71654. var childNode = vnode;
  71655. while (childNode.componentInstance) {
  71656. childNode = childNode.componentInstance._vnode;
  71657. if (
  71658. childNode && childNode.data &&
  71659. (styleData = normalizeStyleData(childNode.data))
  71660. ) {
  71661. extend(res, styleData);
  71662. }
  71663. }
  71664. }
  71665. if ((styleData = normalizeStyleData(vnode.data))) {
  71666. extend(res, styleData);
  71667. }
  71668. var parentNode = vnode;
  71669. while ((parentNode = parentNode.parent)) {
  71670. if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) {
  71671. extend(res, styleData);
  71672. }
  71673. }
  71674. return res
  71675. }
  71676. /* */
  71677. var cssVarRE = /^--/;
  71678. var importantRE = /\s*!important$/;
  71679. var setProp = function (el, name, val) {
  71680. /* istanbul ignore if */
  71681. if (cssVarRE.test(name)) {
  71682. el.style.setProperty(name, val);
  71683. } else if (importantRE.test(val)) {
  71684. el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');
  71685. } else {
  71686. var normalizedName = normalize(name);
  71687. if (Array.isArray(val)) {
  71688. // Support values array created by autoprefixer, e.g.
  71689. // {display: ["-webkit-box", "-ms-flexbox", "flex"]}
  71690. // Set them one by one, and the browser will only set those it can recognize
  71691. for (var i = 0, len = val.length; i < len; i++) {
  71692. el.style[normalizedName] = val[i];
  71693. }
  71694. } else {
  71695. el.style[normalizedName] = val;
  71696. }
  71697. }
  71698. };
  71699. var vendorNames = ['Webkit', 'Moz', 'ms'];
  71700. var emptyStyle;
  71701. var normalize = cached(function (prop) {
  71702. emptyStyle = emptyStyle || document.createElement('div').style;
  71703. prop = camelize(prop);
  71704. if (prop !== 'filter' && (prop in emptyStyle)) {
  71705. return prop
  71706. }
  71707. var capName = prop.charAt(0).toUpperCase() + prop.slice(1);
  71708. for (var i = 0; i < vendorNames.length; i++) {
  71709. var name = vendorNames[i] + capName;
  71710. if (name in emptyStyle) {
  71711. return name
  71712. }
  71713. }
  71714. });
  71715. function updateStyle (oldVnode, vnode) {
  71716. var data = vnode.data;
  71717. var oldData = oldVnode.data;
  71718. if (isUndef(data.staticStyle) && isUndef(data.style) &&
  71719. isUndef(oldData.staticStyle) && isUndef(oldData.style)
  71720. ) {
  71721. return
  71722. }
  71723. var cur, name;
  71724. var el = vnode.elm;
  71725. var oldStaticStyle = oldData.staticStyle;
  71726. var oldStyleBinding = oldData.normalizedStyle || oldData.style || {};
  71727. // if static style exists, stylebinding already merged into it when doing normalizeStyleData
  71728. var oldStyle = oldStaticStyle || oldStyleBinding;
  71729. var style = normalizeStyleBinding(vnode.data.style) || {};
  71730. // store normalized style under a different key for next diff
  71731. // make sure to clone it if it's reactive, since the user likely wants
  71732. // to mutate it.
  71733. vnode.data.normalizedStyle = isDef(style.__ob__)
  71734. ? extend({}, style)
  71735. : style;
  71736. var newStyle = getStyle(vnode, true);
  71737. for (name in oldStyle) {
  71738. if (isUndef(newStyle[name])) {
  71739. setProp(el, name, '');
  71740. }
  71741. }
  71742. for (name in newStyle) {
  71743. cur = newStyle[name];
  71744. if (cur !== oldStyle[name]) {
  71745. // ie9 setting to null has no effect, must use empty string
  71746. setProp(el, name, cur == null ? '' : cur);
  71747. }
  71748. }
  71749. }
  71750. var style = {
  71751. create: updateStyle,
  71752. update: updateStyle
  71753. };
  71754. /* */
  71755. var whitespaceRE = /\s+/;
  71756. /**
  71757. * Add class with compatibility for SVG since classList is not supported on
  71758. * SVG elements in IE
  71759. */
  71760. function addClass (el, cls) {
  71761. /* istanbul ignore if */
  71762. if (!cls || !(cls = cls.trim())) {
  71763. return
  71764. }
  71765. /* istanbul ignore else */
  71766. if (el.classList) {
  71767. if (cls.indexOf(' ') > -1) {
  71768. cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); });
  71769. } else {
  71770. el.classList.add(cls);
  71771. }
  71772. } else {
  71773. var cur = " " + (el.getAttribute('class') || '') + " ";
  71774. if (cur.indexOf(' ' + cls + ' ') < 0) {
  71775. el.setAttribute('class', (cur + cls).trim());
  71776. }
  71777. }
  71778. }
  71779. /**
  71780. * Remove class with compatibility for SVG since classList is not supported on
  71781. * SVG elements in IE
  71782. */
  71783. function removeClass (el, cls) {
  71784. /* istanbul ignore if */
  71785. if (!cls || !(cls = cls.trim())) {
  71786. return
  71787. }
  71788. /* istanbul ignore else */
  71789. if (el.classList) {
  71790. if (cls.indexOf(' ') > -1) {
  71791. cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); });
  71792. } else {
  71793. el.classList.remove(cls);
  71794. }
  71795. if (!el.classList.length) {
  71796. el.removeAttribute('class');
  71797. }
  71798. } else {
  71799. var cur = " " + (el.getAttribute('class') || '') + " ";
  71800. var tar = ' ' + cls + ' ';
  71801. while (cur.indexOf(tar) >= 0) {
  71802. cur = cur.replace(tar, ' ');
  71803. }
  71804. cur = cur.trim();
  71805. if (cur) {
  71806. el.setAttribute('class', cur);
  71807. } else {
  71808. el.removeAttribute('class');
  71809. }
  71810. }
  71811. }
  71812. /* */
  71813. function resolveTransition (def$$1) {
  71814. if (!def$$1) {
  71815. return
  71816. }
  71817. /* istanbul ignore else */
  71818. if (typeof def$$1 === 'object') {
  71819. var res = {};
  71820. if (def$$1.css !== false) {
  71821. extend(res, autoCssTransition(def$$1.name || 'v'));
  71822. }
  71823. extend(res, def$$1);
  71824. return res
  71825. } else if (typeof def$$1 === 'string') {
  71826. return autoCssTransition(def$$1)
  71827. }
  71828. }
  71829. var autoCssTransition = cached(function (name) {
  71830. return {
  71831. enterClass: (name + "-enter"),
  71832. enterToClass: (name + "-enter-to"),
  71833. enterActiveClass: (name + "-enter-active"),
  71834. leaveClass: (name + "-leave"),
  71835. leaveToClass: (name + "-leave-to"),
  71836. leaveActiveClass: (name + "-leave-active")
  71837. }
  71838. });
  71839. var hasTransition = inBrowser && !isIE9;
  71840. var TRANSITION = 'transition';
  71841. var ANIMATION = 'animation';
  71842. // Transition property/event sniffing
  71843. var transitionProp = 'transition';
  71844. var transitionEndEvent = 'transitionend';
  71845. var animationProp = 'animation';
  71846. var animationEndEvent = 'animationend';
  71847. if (hasTransition) {
  71848. /* istanbul ignore if */
  71849. if (window.ontransitionend === undefined &&
  71850. window.onwebkittransitionend !== undefined
  71851. ) {
  71852. transitionProp = 'WebkitTransition';
  71853. transitionEndEvent = 'webkitTransitionEnd';
  71854. }
  71855. if (window.onanimationend === undefined &&
  71856. window.onwebkitanimationend !== undefined
  71857. ) {
  71858. animationProp = 'WebkitAnimation';
  71859. animationEndEvent = 'webkitAnimationEnd';
  71860. }
  71861. }
  71862. // binding to window is necessary to make hot reload work in IE in strict mode
  71863. var raf = inBrowser
  71864. ? window.requestAnimationFrame
  71865. ? window.requestAnimationFrame.bind(window)
  71866. : setTimeout
  71867. : /* istanbul ignore next */ function (fn) { return fn(); };
  71868. function nextFrame (fn) {
  71869. raf(function () {
  71870. raf(fn);
  71871. });
  71872. }
  71873. function addTransitionClass (el, cls) {
  71874. var transitionClasses = el._transitionClasses || (el._transitionClasses = []);
  71875. if (transitionClasses.indexOf(cls) < 0) {
  71876. transitionClasses.push(cls);
  71877. addClass(el, cls);
  71878. }
  71879. }
  71880. function removeTransitionClass (el, cls) {
  71881. if (el._transitionClasses) {
  71882. remove(el._transitionClasses, cls);
  71883. }
  71884. removeClass(el, cls);
  71885. }
  71886. function whenTransitionEnds (
  71887. el,
  71888. expectedType,
  71889. cb
  71890. ) {
  71891. var ref = getTransitionInfo(el, expectedType);
  71892. var type = ref.type;
  71893. var timeout = ref.timeout;
  71894. var propCount = ref.propCount;
  71895. if (!type) { return cb() }
  71896. var event = type === TRANSITION ? transitionEndEvent : animationEndEvent;
  71897. var ended = 0;
  71898. var end = function () {
  71899. el.removeEventListener(event, onEnd);
  71900. cb();
  71901. };
  71902. var onEnd = function (e) {
  71903. if (e.target === el) {
  71904. if (++ended >= propCount) {
  71905. end();
  71906. }
  71907. }
  71908. };
  71909. setTimeout(function () {
  71910. if (ended < propCount) {
  71911. end();
  71912. }
  71913. }, timeout + 1);
  71914. el.addEventListener(event, onEnd);
  71915. }
  71916. var transformRE = /\b(transform|all)(,|$)/;
  71917. function getTransitionInfo (el, expectedType) {
  71918. var styles = window.getComputedStyle(el);
  71919. // JSDOM may return undefined for transition properties
  71920. var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', ');
  71921. var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', ');
  71922. var transitionTimeout = getTimeout(transitionDelays, transitionDurations);
  71923. var animationDelays = (styles[animationProp + 'Delay'] || '').split(', ');
  71924. var animationDurations = (styles[animationProp + 'Duration'] || '').split(', ');
  71925. var animationTimeout = getTimeout(animationDelays, animationDurations);
  71926. var type;
  71927. var timeout = 0;
  71928. var propCount = 0;
  71929. /* istanbul ignore if */
  71930. if (expectedType === TRANSITION) {
  71931. if (transitionTimeout > 0) {
  71932. type = TRANSITION;
  71933. timeout = transitionTimeout;
  71934. propCount = transitionDurations.length;
  71935. }
  71936. } else if (expectedType === ANIMATION) {
  71937. if (animationTimeout > 0) {
  71938. type = ANIMATION;
  71939. timeout = animationTimeout;
  71940. propCount = animationDurations.length;
  71941. }
  71942. } else {
  71943. timeout = Math.max(transitionTimeout, animationTimeout);
  71944. type = timeout > 0
  71945. ? transitionTimeout > animationTimeout
  71946. ? TRANSITION
  71947. : ANIMATION
  71948. : null;
  71949. propCount = type
  71950. ? type === TRANSITION
  71951. ? transitionDurations.length
  71952. : animationDurations.length
  71953. : 0;
  71954. }
  71955. var hasTransform =
  71956. type === TRANSITION &&
  71957. transformRE.test(styles[transitionProp + 'Property']);
  71958. return {
  71959. type: type,
  71960. timeout: timeout,
  71961. propCount: propCount,
  71962. hasTransform: hasTransform
  71963. }
  71964. }
  71965. function getTimeout (delays, durations) {
  71966. /* istanbul ignore next */
  71967. while (delays.length < durations.length) {
  71968. delays = delays.concat(delays);
  71969. }
  71970. return Math.max.apply(null, durations.map(function (d, i) {
  71971. return toMs(d) + toMs(delays[i])
  71972. }))
  71973. }
  71974. // Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers
  71975. // in a locale-dependent way, using a comma instead of a dot.
  71976. // If comma is not replaced with a dot, the input will be rounded down (i.e. acting
  71977. // as a floor function) causing unexpected behaviors
  71978. function toMs (s) {
  71979. return Number(s.slice(0, -1).replace(',', '.')) * 1000
  71980. }
  71981. /* */
  71982. function enter (vnode, toggleDisplay) {
  71983. var el = vnode.elm;
  71984. // call leave callback now
  71985. if (isDef(el._leaveCb)) {
  71986. el._leaveCb.cancelled = true;
  71987. el._leaveCb();
  71988. }
  71989. var data = resolveTransition(vnode.data.transition);
  71990. if (isUndef(data)) {
  71991. return
  71992. }
  71993. /* istanbul ignore if */
  71994. if (isDef(el._enterCb) || el.nodeType !== 1) {
  71995. return
  71996. }
  71997. var css = data.css;
  71998. var type = data.type;
  71999. var enterClass = data.enterClass;
  72000. var enterToClass = data.enterToClass;
  72001. var enterActiveClass = data.enterActiveClass;
  72002. var appearClass = data.appearClass;
  72003. var appearToClass = data.appearToClass;
  72004. var appearActiveClass = data.appearActiveClass;
  72005. var beforeEnter = data.beforeEnter;
  72006. var enter = data.enter;
  72007. var afterEnter = data.afterEnter;
  72008. var enterCancelled = data.enterCancelled;
  72009. var beforeAppear = data.beforeAppear;
  72010. var appear = data.appear;
  72011. var afterAppear = data.afterAppear;
  72012. var appearCancelled = data.appearCancelled;
  72013. var duration = data.duration;
  72014. // activeInstance will always be the <transition> component managing this
  72015. // transition. One edge case to check is when the <transition> is placed
  72016. // as the root node of a child component. In that case we need to check
  72017. // <transition>'s parent for appear check.
  72018. var context = activeInstance;
  72019. var transitionNode = activeInstance.$vnode;
  72020. while (transitionNode && transitionNode.parent) {
  72021. context = transitionNode.context;
  72022. transitionNode = transitionNode.parent;
  72023. }
  72024. var isAppear = !context._isMounted || !vnode.isRootInsert;
  72025. if (isAppear && !appear && appear !== '') {
  72026. return
  72027. }
  72028. var startClass = isAppear && appearClass
  72029. ? appearClass
  72030. : enterClass;
  72031. var activeClass = isAppear && appearActiveClass
  72032. ? appearActiveClass
  72033. : enterActiveClass;
  72034. var toClass = isAppear && appearToClass
  72035. ? appearToClass
  72036. : enterToClass;
  72037. var beforeEnterHook = isAppear
  72038. ? (beforeAppear || beforeEnter)
  72039. : beforeEnter;
  72040. var enterHook = isAppear
  72041. ? (typeof appear === 'function' ? appear : enter)
  72042. : enter;
  72043. var afterEnterHook = isAppear
  72044. ? (afterAppear || afterEnter)
  72045. : afterEnter;
  72046. var enterCancelledHook = isAppear
  72047. ? (appearCancelled || enterCancelled)
  72048. : enterCancelled;
  72049. var explicitEnterDuration = toNumber(
  72050. isObject(duration)
  72051. ? duration.enter
  72052. : duration
  72053. );
  72054. if (explicitEnterDuration != null) {
  72055. checkDuration(explicitEnterDuration, 'enter', vnode);
  72056. }
  72057. var expectsCSS = css !== false && !isIE9;
  72058. var userWantsControl = getHookArgumentsLength(enterHook);
  72059. var cb = el._enterCb = once(function () {
  72060. if (expectsCSS) {
  72061. removeTransitionClass(el, toClass);
  72062. removeTransitionClass(el, activeClass);
  72063. }
  72064. if (cb.cancelled) {
  72065. if (expectsCSS) {
  72066. removeTransitionClass(el, startClass);
  72067. }
  72068. enterCancelledHook && enterCancelledHook(el);
  72069. } else {
  72070. afterEnterHook && afterEnterHook(el);
  72071. }
  72072. el._enterCb = null;
  72073. });
  72074. if (!vnode.data.show) {
  72075. // remove pending leave element on enter by injecting an insert hook
  72076. mergeVNodeHook(vnode, 'insert', function () {
  72077. var parent = el.parentNode;
  72078. var pendingNode = parent && parent._pending && parent._pending[vnode.key];
  72079. if (pendingNode &&
  72080. pendingNode.tag === vnode.tag &&
  72081. pendingNode.elm._leaveCb
  72082. ) {
  72083. pendingNode.elm._leaveCb();
  72084. }
  72085. enterHook && enterHook(el, cb);
  72086. });
  72087. }
  72088. // start enter transition
  72089. beforeEnterHook && beforeEnterHook(el);
  72090. if (expectsCSS) {
  72091. addTransitionClass(el, startClass);
  72092. addTransitionClass(el, activeClass);
  72093. nextFrame(function () {
  72094. removeTransitionClass(el, startClass);
  72095. if (!cb.cancelled) {
  72096. addTransitionClass(el, toClass);
  72097. if (!userWantsControl) {
  72098. if (isValidDuration(explicitEnterDuration)) {
  72099. setTimeout(cb, explicitEnterDuration);
  72100. } else {
  72101. whenTransitionEnds(el, type, cb);
  72102. }
  72103. }
  72104. }
  72105. });
  72106. }
  72107. if (vnode.data.show) {
  72108. toggleDisplay && toggleDisplay();
  72109. enterHook && enterHook(el, cb);
  72110. }
  72111. if (!expectsCSS && !userWantsControl) {
  72112. cb();
  72113. }
  72114. }
  72115. function leave (vnode, rm) {
  72116. var el = vnode.elm;
  72117. // call enter callback now
  72118. if (isDef(el._enterCb)) {
  72119. el._enterCb.cancelled = true;
  72120. el._enterCb();
  72121. }
  72122. var data = resolveTransition(vnode.data.transition);
  72123. if (isUndef(data) || el.nodeType !== 1) {
  72124. return rm()
  72125. }
  72126. /* istanbul ignore if */
  72127. if (isDef(el._leaveCb)) {
  72128. return
  72129. }
  72130. var css = data.css;
  72131. var type = data.type;
  72132. var leaveClass = data.leaveClass;
  72133. var leaveToClass = data.leaveToClass;
  72134. var leaveActiveClass = data.leaveActiveClass;
  72135. var beforeLeave = data.beforeLeave;
  72136. var leave = data.leave;
  72137. var afterLeave = data.afterLeave;
  72138. var leaveCancelled = data.leaveCancelled;
  72139. var delayLeave = data.delayLeave;
  72140. var duration = data.duration;
  72141. var expectsCSS = css !== false && !isIE9;
  72142. var userWantsControl = getHookArgumentsLength(leave);
  72143. var explicitLeaveDuration = toNumber(
  72144. isObject(duration)
  72145. ? duration.leave
  72146. : duration
  72147. );
  72148. if (isDef(explicitLeaveDuration)) {
  72149. checkDuration(explicitLeaveDuration, 'leave', vnode);
  72150. }
  72151. var cb = el._leaveCb = once(function () {
  72152. if (el.parentNode && el.parentNode._pending) {
  72153. el.parentNode._pending[vnode.key] = null;
  72154. }
  72155. if (expectsCSS) {
  72156. removeTransitionClass(el, leaveToClass);
  72157. removeTransitionClass(el, leaveActiveClass);
  72158. }
  72159. if (cb.cancelled) {
  72160. if (expectsCSS) {
  72161. removeTransitionClass(el, leaveClass);
  72162. }
  72163. leaveCancelled && leaveCancelled(el);
  72164. } else {
  72165. rm();
  72166. afterLeave && afterLeave(el);
  72167. }
  72168. el._leaveCb = null;
  72169. });
  72170. if (delayLeave) {
  72171. delayLeave(performLeave);
  72172. } else {
  72173. performLeave();
  72174. }
  72175. function performLeave () {
  72176. // the delayed leave may have already been cancelled
  72177. if (cb.cancelled) {
  72178. return
  72179. }
  72180. // record leaving element
  72181. if (!vnode.data.show && el.parentNode) {
  72182. (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode;
  72183. }
  72184. beforeLeave && beforeLeave(el);
  72185. if (expectsCSS) {
  72186. addTransitionClass(el, leaveClass);
  72187. addTransitionClass(el, leaveActiveClass);
  72188. nextFrame(function () {
  72189. removeTransitionClass(el, leaveClass);
  72190. if (!cb.cancelled) {
  72191. addTransitionClass(el, leaveToClass);
  72192. if (!userWantsControl) {
  72193. if (isValidDuration(explicitLeaveDuration)) {
  72194. setTimeout(cb, explicitLeaveDuration);
  72195. } else {
  72196. whenTransitionEnds(el, type, cb);
  72197. }
  72198. }
  72199. }
  72200. });
  72201. }
  72202. leave && leave(el, cb);
  72203. if (!expectsCSS && !userWantsControl) {
  72204. cb();
  72205. }
  72206. }
  72207. }
  72208. // only used in dev mode
  72209. function checkDuration (val, name, vnode) {
  72210. if (typeof val !== 'number') {
  72211. warn(
  72212. "<transition> explicit " + name + " duration is not a valid number - " +
  72213. "got " + (JSON.stringify(val)) + ".",
  72214. vnode.context
  72215. );
  72216. } else if (isNaN(val)) {
  72217. warn(
  72218. "<transition> explicit " + name + " duration is NaN - " +
  72219. 'the duration expression might be incorrect.',
  72220. vnode.context
  72221. );
  72222. }
  72223. }
  72224. function isValidDuration (val) {
  72225. return typeof val === 'number' && !isNaN(val)
  72226. }
  72227. /**
  72228. * Normalize a transition hook's argument length. The hook may be:
  72229. * - a merged hook (invoker) with the original in .fns
  72230. * - a wrapped component method (check ._length)
  72231. * - a plain function (.length)
  72232. */
  72233. function getHookArgumentsLength (fn) {
  72234. if (isUndef(fn)) {
  72235. return false
  72236. }
  72237. var invokerFns = fn.fns;
  72238. if (isDef(invokerFns)) {
  72239. // invoker
  72240. return getHookArgumentsLength(
  72241. Array.isArray(invokerFns)
  72242. ? invokerFns[0]
  72243. : invokerFns
  72244. )
  72245. } else {
  72246. return (fn._length || fn.length) > 1
  72247. }
  72248. }
  72249. function _enter (_, vnode) {
  72250. if (vnode.data.show !== true) {
  72251. enter(vnode);
  72252. }
  72253. }
  72254. var transition = inBrowser ? {
  72255. create: _enter,
  72256. activate: _enter,
  72257. remove: function remove$$1 (vnode, rm) {
  72258. /* istanbul ignore else */
  72259. if (vnode.data.show !== true) {
  72260. leave(vnode, rm);
  72261. } else {
  72262. rm();
  72263. }
  72264. }
  72265. } : {};
  72266. var platformModules = [
  72267. attrs,
  72268. klass,
  72269. events,
  72270. domProps,
  72271. style,
  72272. transition
  72273. ];
  72274. /* */
  72275. // the directive module should be applied last, after all
  72276. // built-in modules have been applied.
  72277. var modules = platformModules.concat(baseModules);
  72278. var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules });
  72279. /**
  72280. * Not type checking this file because flow doesn't like attaching
  72281. * properties to Elements.
  72282. */
  72283. /* istanbul ignore if */
  72284. if (isIE9) {
  72285. // http://www.matts411.com/post/internet-explorer-9-oninput/
  72286. document.addEventListener('selectionchange', function () {
  72287. var el = document.activeElement;
  72288. if (el && el.vmodel) {
  72289. trigger(el, 'input');
  72290. }
  72291. });
  72292. }
  72293. var directive = {
  72294. inserted: function inserted (el, binding, vnode, oldVnode) {
  72295. if (vnode.tag === 'select') {
  72296. // #6903
  72297. if (oldVnode.elm && !oldVnode.elm._vOptions) {
  72298. mergeVNodeHook(vnode, 'postpatch', function () {
  72299. directive.componentUpdated(el, binding, vnode);
  72300. });
  72301. } else {
  72302. setSelected(el, binding, vnode.context);
  72303. }
  72304. el._vOptions = [].map.call(el.options, getValue);
  72305. } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
  72306. el._vModifiers = binding.modifiers;
  72307. if (!binding.modifiers.lazy) {
  72308. el.addEventListener('compositionstart', onCompositionStart);
  72309. el.addEventListener('compositionend', onCompositionEnd);
  72310. // Safari < 10.2 & UIWebView doesn't fire compositionend when
  72311. // switching focus before confirming composition choice
  72312. // this also fixes the issue where some browsers e.g. iOS Chrome
  72313. // fires "change" instead of "input" on autocomplete.
  72314. el.addEventListener('change', onCompositionEnd);
  72315. /* istanbul ignore if */
  72316. if (isIE9) {
  72317. el.vmodel = true;
  72318. }
  72319. }
  72320. }
  72321. },
  72322. componentUpdated: function componentUpdated (el, binding, vnode) {
  72323. if (vnode.tag === 'select') {
  72324. setSelected(el, binding, vnode.context);
  72325. // in case the options rendered by v-for have changed,
  72326. // it's possible that the value is out-of-sync with the rendered options.
  72327. // detect such cases and filter out values that no longer has a matching
  72328. // option in the DOM.
  72329. var prevOptions = el._vOptions;
  72330. var curOptions = el._vOptions = [].map.call(el.options, getValue);
  72331. if (curOptions.some(function (o, i) { return !looseEqual(o, prevOptions[i]); })) {
  72332. // trigger change event if
  72333. // no matching option found for at least one value
  72334. var needReset = el.multiple
  72335. ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions); })
  72336. : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions);
  72337. if (needReset) {
  72338. trigger(el, 'change');
  72339. }
  72340. }
  72341. }
  72342. }
  72343. };
  72344. function setSelected (el, binding, vm) {
  72345. actuallySetSelected(el, binding, vm);
  72346. /* istanbul ignore if */
  72347. if (isIE || isEdge) {
  72348. setTimeout(function () {
  72349. actuallySetSelected(el, binding, vm);
  72350. }, 0);
  72351. }
  72352. }
  72353. function actuallySetSelected (el, binding, vm) {
  72354. var value = binding.value;
  72355. var isMultiple = el.multiple;
  72356. if (isMultiple && !Array.isArray(value)) {
  72357. warn(
  72358. "<select multiple v-model=\"" + (binding.expression) + "\"> " +
  72359. "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)),
  72360. vm
  72361. );
  72362. return
  72363. }
  72364. var selected, option;
  72365. for (var i = 0, l = el.options.length; i < l; i++) {
  72366. option = el.options[i];
  72367. if (isMultiple) {
  72368. selected = looseIndexOf(value, getValue(option)) > -1;
  72369. if (option.selected !== selected) {
  72370. option.selected = selected;
  72371. }
  72372. } else {
  72373. if (looseEqual(getValue(option), value)) {
  72374. if (el.selectedIndex !== i) {
  72375. el.selectedIndex = i;
  72376. }
  72377. return
  72378. }
  72379. }
  72380. }
  72381. if (!isMultiple) {
  72382. el.selectedIndex = -1;
  72383. }
  72384. }
  72385. function hasNoMatchingOption (value, options) {
  72386. return options.every(function (o) { return !looseEqual(o, value); })
  72387. }
  72388. function getValue (option) {
  72389. return '_value' in option
  72390. ? option._value
  72391. : option.value
  72392. }
  72393. function onCompositionStart (e) {
  72394. e.target.composing = true;
  72395. }
  72396. function onCompositionEnd (e) {
  72397. // prevent triggering an input event for no reason
  72398. if (!e.target.composing) { return }
  72399. e.target.composing = false;
  72400. trigger(e.target, 'input');
  72401. }
  72402. function trigger (el, type) {
  72403. var e = document.createEvent('HTMLEvents');
  72404. e.initEvent(type, true, true);
  72405. el.dispatchEvent(e);
  72406. }
  72407. /* */
  72408. // recursively search for possible transition defined inside the component root
  72409. function locateNode (vnode) {
  72410. return vnode.componentInstance && (!vnode.data || !vnode.data.transition)
  72411. ? locateNode(vnode.componentInstance._vnode)
  72412. : vnode
  72413. }
  72414. var show = {
  72415. bind: function bind (el, ref, vnode) {
  72416. var value = ref.value;
  72417. vnode = locateNode(vnode);
  72418. var transition$$1 = vnode.data && vnode.data.transition;
  72419. var originalDisplay = el.__vOriginalDisplay =
  72420. el.style.display === 'none' ? '' : el.style.display;
  72421. if (value && transition$$1) {
  72422. vnode.data.show = true;
  72423. enter(vnode, function () {
  72424. el.style.display = originalDisplay;
  72425. });
  72426. } else {
  72427. el.style.display = value ? originalDisplay : 'none';
  72428. }
  72429. },
  72430. update: function update (el, ref, vnode) {
  72431. var value = ref.value;
  72432. var oldValue = ref.oldValue;
  72433. /* istanbul ignore if */
  72434. if (!value === !oldValue) { return }
  72435. vnode = locateNode(vnode);
  72436. var transition$$1 = vnode.data && vnode.data.transition;
  72437. if (transition$$1) {
  72438. vnode.data.show = true;
  72439. if (value) {
  72440. enter(vnode, function () {
  72441. el.style.display = el.__vOriginalDisplay;
  72442. });
  72443. } else {
  72444. leave(vnode, function () {
  72445. el.style.display = 'none';
  72446. });
  72447. }
  72448. } else {
  72449. el.style.display = value ? el.__vOriginalDisplay : 'none';
  72450. }
  72451. },
  72452. unbind: function unbind (
  72453. el,
  72454. binding,
  72455. vnode,
  72456. oldVnode,
  72457. isDestroy
  72458. ) {
  72459. if (!isDestroy) {
  72460. el.style.display = el.__vOriginalDisplay;
  72461. }
  72462. }
  72463. };
  72464. var platformDirectives = {
  72465. model: directive,
  72466. show: show
  72467. };
  72468. /* */
  72469. var transitionProps = {
  72470. name: String,
  72471. appear: Boolean,
  72472. css: Boolean,
  72473. mode: String,
  72474. type: String,
  72475. enterClass: String,
  72476. leaveClass: String,
  72477. enterToClass: String,
  72478. leaveToClass: String,
  72479. enterActiveClass: String,
  72480. leaveActiveClass: String,
  72481. appearClass: String,
  72482. appearActiveClass: String,
  72483. appearToClass: String,
  72484. duration: [Number, String, Object]
  72485. };
  72486. // in case the child is also an abstract component, e.g. <keep-alive>
  72487. // we want to recursively retrieve the real component to be rendered
  72488. function getRealChild (vnode) {
  72489. var compOptions = vnode && vnode.componentOptions;
  72490. if (compOptions && compOptions.Ctor.options.abstract) {
  72491. return getRealChild(getFirstComponentChild(compOptions.children))
  72492. } else {
  72493. return vnode
  72494. }
  72495. }
  72496. function extractTransitionData (comp) {
  72497. var data = {};
  72498. var options = comp.$options;
  72499. // props
  72500. for (var key in options.propsData) {
  72501. data[key] = comp[key];
  72502. }
  72503. // events.
  72504. // extract listeners and pass them directly to the transition methods
  72505. var listeners = options._parentListeners;
  72506. for (var key$1 in listeners) {
  72507. data[camelize(key$1)] = listeners[key$1];
  72508. }
  72509. return data
  72510. }
  72511. function placeholder (h, rawChild) {
  72512. if (/\d-keep-alive$/.test(rawChild.tag)) {
  72513. return h('keep-alive', {
  72514. props: rawChild.componentOptions.propsData
  72515. })
  72516. }
  72517. }
  72518. function hasParentTransition (vnode) {
  72519. while ((vnode = vnode.parent)) {
  72520. if (vnode.data.transition) {
  72521. return true
  72522. }
  72523. }
  72524. }
  72525. function isSameChild (child, oldChild) {
  72526. return oldChild.key === child.key && oldChild.tag === child.tag
  72527. }
  72528. var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); };
  72529. var isVShowDirective = function (d) { return d.name === 'show'; };
  72530. var Transition = {
  72531. name: 'transition',
  72532. props: transitionProps,
  72533. abstract: true,
  72534. render: function render (h) {
  72535. var this$1 = this;
  72536. var children = this.$slots.default;
  72537. if (!children) {
  72538. return
  72539. }
  72540. // filter out text nodes (possible whitespaces)
  72541. children = children.filter(isNotTextNode);
  72542. /* istanbul ignore if */
  72543. if (!children.length) {
  72544. return
  72545. }
  72546. // warn multiple elements
  72547. if (children.length > 1) {
  72548. warn(
  72549. '<transition> can only be used on a single element. Use ' +
  72550. '<transition-group> for lists.',
  72551. this.$parent
  72552. );
  72553. }
  72554. var mode = this.mode;
  72555. // warn invalid mode
  72556. if (mode && mode !== 'in-out' && mode !== 'out-in'
  72557. ) {
  72558. warn(
  72559. 'invalid <transition> mode: ' + mode,
  72560. this.$parent
  72561. );
  72562. }
  72563. var rawChild = children[0];
  72564. // if this is a component root node and the component's
  72565. // parent container node also has transition, skip.
  72566. if (hasParentTransition(this.$vnode)) {
  72567. return rawChild
  72568. }
  72569. // apply transition data to child
  72570. // use getRealChild() to ignore abstract components e.g. keep-alive
  72571. var child = getRealChild(rawChild);
  72572. /* istanbul ignore if */
  72573. if (!child) {
  72574. return rawChild
  72575. }
  72576. if (this._leaving) {
  72577. return placeholder(h, rawChild)
  72578. }
  72579. // ensure a key that is unique to the vnode type and to this transition
  72580. // component instance. This key will be used to remove pending leaving nodes
  72581. // during entering.
  72582. var id = "__transition-" + (this._uid) + "-";
  72583. child.key = child.key == null
  72584. ? child.isComment
  72585. ? id + 'comment'
  72586. : id + child.tag
  72587. : isPrimitive(child.key)
  72588. ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key)
  72589. : child.key;
  72590. var data = (child.data || (child.data = {})).transition = extractTransitionData(this);
  72591. var oldRawChild = this._vnode;
  72592. var oldChild = getRealChild(oldRawChild);
  72593. // mark v-show
  72594. // so that the transition module can hand over the control to the directive
  72595. if (child.data.directives && child.data.directives.some(isVShowDirective)) {
  72596. child.data.show = true;
  72597. }
  72598. if (
  72599. oldChild &&
  72600. oldChild.data &&
  72601. !isSameChild(child, oldChild) &&
  72602. !isAsyncPlaceholder(oldChild) &&
  72603. // #6687 component root is a comment node
  72604. !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment)
  72605. ) {
  72606. // replace old child transition data with fresh one
  72607. // important for dynamic transitions!
  72608. var oldData = oldChild.data.transition = extend({}, data);
  72609. // handle transition mode
  72610. if (mode === 'out-in') {
  72611. // return placeholder node and queue update when leave finishes
  72612. this._leaving = true;
  72613. mergeVNodeHook(oldData, 'afterLeave', function () {
  72614. this$1._leaving = false;
  72615. this$1.$forceUpdate();
  72616. });
  72617. return placeholder(h, rawChild)
  72618. } else if (mode === 'in-out') {
  72619. if (isAsyncPlaceholder(child)) {
  72620. return oldRawChild
  72621. }
  72622. var delayedLeave;
  72623. var performLeave = function () { delayedLeave(); };
  72624. mergeVNodeHook(data, 'afterEnter', performLeave);
  72625. mergeVNodeHook(data, 'enterCancelled', performLeave);
  72626. mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; });
  72627. }
  72628. }
  72629. return rawChild
  72630. }
  72631. };
  72632. /* */
  72633. var props = extend({
  72634. tag: String,
  72635. moveClass: String
  72636. }, transitionProps);
  72637. delete props.mode;
  72638. var TransitionGroup = {
  72639. props: props,
  72640. beforeMount: function beforeMount () {
  72641. var this$1 = this;
  72642. var update = this._update;
  72643. this._update = function (vnode, hydrating) {
  72644. var restoreActiveInstance = setActiveInstance(this$1);
  72645. // force removing pass
  72646. this$1.__patch__(
  72647. this$1._vnode,
  72648. this$1.kept,
  72649. false, // hydrating
  72650. true // removeOnly (!important, avoids unnecessary moves)
  72651. );
  72652. this$1._vnode = this$1.kept;
  72653. restoreActiveInstance();
  72654. update.call(this$1, vnode, hydrating);
  72655. };
  72656. },
  72657. render: function render (h) {
  72658. var tag = this.tag || this.$vnode.data.tag || 'span';
  72659. var map = Object.create(null);
  72660. var prevChildren = this.prevChildren = this.children;
  72661. var rawChildren = this.$slots.default || [];
  72662. var children = this.children = [];
  72663. var transitionData = extractTransitionData(this);
  72664. for (var i = 0; i < rawChildren.length; i++) {
  72665. var c = rawChildren[i];
  72666. if (c.tag) {
  72667. if (c.key != null && String(c.key).indexOf('__vlist') !== 0) {
  72668. children.push(c);
  72669. map[c.key] = c
  72670. ;(c.data || (c.data = {})).transition = transitionData;
  72671. } else {
  72672. var opts = c.componentOptions;
  72673. var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag;
  72674. warn(("<transition-group> children must be keyed: <" + name + ">"));
  72675. }
  72676. }
  72677. }
  72678. if (prevChildren) {
  72679. var kept = [];
  72680. var removed = [];
  72681. for (var i$1 = 0; i$1 < prevChildren.length; i$1++) {
  72682. var c$1 = prevChildren[i$1];
  72683. c$1.data.transition = transitionData;
  72684. c$1.data.pos = c$1.elm.getBoundingClientRect();
  72685. if (map[c$1.key]) {
  72686. kept.push(c$1);
  72687. } else {
  72688. removed.push(c$1);
  72689. }
  72690. }
  72691. this.kept = h(tag, null, kept);
  72692. this.removed = removed;
  72693. }
  72694. return h(tag, null, children)
  72695. },
  72696. updated: function updated () {
  72697. var children = this.prevChildren;
  72698. var moveClass = this.moveClass || ((this.name || 'v') + '-move');
  72699. if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
  72700. return
  72701. }
  72702. // we divide the work into three loops to avoid mixing DOM reads and writes
  72703. // in each iteration - which helps prevent layout thrashing.
  72704. children.forEach(callPendingCbs);
  72705. children.forEach(recordPosition);
  72706. children.forEach(applyTranslation);
  72707. // force reflow to put everything in position
  72708. // assign to this to avoid being removed in tree-shaking
  72709. // $flow-disable-line
  72710. this._reflow = document.body.offsetHeight;
  72711. children.forEach(function (c) {
  72712. if (c.data.moved) {
  72713. var el = c.elm;
  72714. var s = el.style;
  72715. addTransitionClass(el, moveClass);
  72716. s.transform = s.WebkitTransform = s.transitionDuration = '';
  72717. el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) {
  72718. if (e && e.target !== el) {
  72719. return
  72720. }
  72721. if (!e || /transform$/.test(e.propertyName)) {
  72722. el.removeEventListener(transitionEndEvent, cb);
  72723. el._moveCb = null;
  72724. removeTransitionClass(el, moveClass);
  72725. }
  72726. });
  72727. }
  72728. });
  72729. },
  72730. methods: {
  72731. hasMove: function hasMove (el, moveClass) {
  72732. /* istanbul ignore if */
  72733. if (!hasTransition) {
  72734. return false
  72735. }
  72736. /* istanbul ignore if */
  72737. if (this._hasMove) {
  72738. return this._hasMove
  72739. }
  72740. // Detect whether an element with the move class applied has
  72741. // CSS transitions. Since the element may be inside an entering
  72742. // transition at this very moment, we make a clone of it and remove
  72743. // all other transition classes applied to ensure only the move class
  72744. // is applied.
  72745. var clone = el.cloneNode();
  72746. if (el._transitionClasses) {
  72747. el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); });
  72748. }
  72749. addClass(clone, moveClass);
  72750. clone.style.display = 'none';
  72751. this.$el.appendChild(clone);
  72752. var info = getTransitionInfo(clone);
  72753. this.$el.removeChild(clone);
  72754. return (this._hasMove = info.hasTransform)
  72755. }
  72756. }
  72757. };
  72758. function callPendingCbs (c) {
  72759. /* istanbul ignore if */
  72760. if (c.elm._moveCb) {
  72761. c.elm._moveCb();
  72762. }
  72763. /* istanbul ignore if */
  72764. if (c.elm._enterCb) {
  72765. c.elm._enterCb();
  72766. }
  72767. }
  72768. function recordPosition (c) {
  72769. c.data.newPos = c.elm.getBoundingClientRect();
  72770. }
  72771. function applyTranslation (c) {
  72772. var oldPos = c.data.pos;
  72773. var newPos = c.data.newPos;
  72774. var dx = oldPos.left - newPos.left;
  72775. var dy = oldPos.top - newPos.top;
  72776. if (dx || dy) {
  72777. c.data.moved = true;
  72778. var s = c.elm.style;
  72779. s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)";
  72780. s.transitionDuration = '0s';
  72781. }
  72782. }
  72783. var platformComponents = {
  72784. Transition: Transition,
  72785. TransitionGroup: TransitionGroup
  72786. };
  72787. /* */
  72788. // install platform specific utils
  72789. Vue.config.mustUseProp = mustUseProp;
  72790. Vue.config.isReservedTag = isReservedTag;
  72791. Vue.config.isReservedAttr = isReservedAttr;
  72792. Vue.config.getTagNamespace = getTagNamespace;
  72793. Vue.config.isUnknownElement = isUnknownElement;
  72794. // install platform runtime directives & components
  72795. extend(Vue.options.directives, platformDirectives);
  72796. extend(Vue.options.components, platformComponents);
  72797. // install platform patch function
  72798. Vue.prototype.__patch__ = inBrowser ? patch : noop;
  72799. // public mount method
  72800. Vue.prototype.$mount = function (
  72801. el,
  72802. hydrating
  72803. ) {
  72804. el = el && inBrowser ? query(el) : undefined;
  72805. return mountComponent(this, el, hydrating)
  72806. };
  72807. // devtools global hook
  72808. /* istanbul ignore next */
  72809. if (inBrowser) {
  72810. setTimeout(function () {
  72811. if (config.devtools) {
  72812. if (devtools) {
  72813. devtools.emit('init', Vue);
  72814. } else {
  72815. console[console.info ? 'info' : 'log'](
  72816. 'Download the Vue Devtools extension for a better development experience:\n' +
  72817. 'https://github.com/vuejs/vue-devtools'
  72818. );
  72819. }
  72820. }
  72821. if (config.productionTip !== false &&
  72822. typeof console !== 'undefined'
  72823. ) {
  72824. console[console.info ? 'info' : 'log'](
  72825. "You are running Vue in development mode.\n" +
  72826. "Make sure to turn on production mode when deploying for production.\n" +
  72827. "See more tips at https://vuejs.org/guide/deployment.html"
  72828. );
  72829. }
  72830. }, 0);
  72831. }
  72832. /* */
  72833. var defaultTagRE = /\{\{((?:.|\r?\n)+?)\}\}/g;
  72834. var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g;
  72835. var buildRegex = cached(function (delimiters) {
  72836. var open = delimiters[0].replace(regexEscapeRE, '\\$&');
  72837. var close = delimiters[1].replace(regexEscapeRE, '\\$&');
  72838. return new RegExp(open + '((?:.|\\n)+?)' + close, 'g')
  72839. });
  72840. function parseText (
  72841. text,
  72842. delimiters
  72843. ) {
  72844. var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE;
  72845. if (!tagRE.test(text)) {
  72846. return
  72847. }
  72848. var tokens = [];
  72849. var rawTokens = [];
  72850. var lastIndex = tagRE.lastIndex = 0;
  72851. var match, index, tokenValue;
  72852. while ((match = tagRE.exec(text))) {
  72853. index = match.index;
  72854. // push text token
  72855. if (index > lastIndex) {
  72856. rawTokens.push(tokenValue = text.slice(lastIndex, index));
  72857. tokens.push(JSON.stringify(tokenValue));
  72858. }
  72859. // tag token
  72860. var exp = parseFilters(match[1].trim());
  72861. tokens.push(("_s(" + exp + ")"));
  72862. rawTokens.push({ '@binding': exp });
  72863. lastIndex = index + match[0].length;
  72864. }
  72865. if (lastIndex < text.length) {
  72866. rawTokens.push(tokenValue = text.slice(lastIndex));
  72867. tokens.push(JSON.stringify(tokenValue));
  72868. }
  72869. return {
  72870. expression: tokens.join('+'),
  72871. tokens: rawTokens
  72872. }
  72873. }
  72874. /* */
  72875. function transformNode (el, options) {
  72876. var warn = options.warn || baseWarn;
  72877. var staticClass = getAndRemoveAttr(el, 'class');
  72878. if (staticClass) {
  72879. var res = parseText(staticClass, options.delimiters);
  72880. if (res) {
  72881. warn(
  72882. "class=\"" + staticClass + "\": " +
  72883. 'Interpolation inside attributes has been removed. ' +
  72884. 'Use v-bind or the colon shorthand instead. For example, ' +
  72885. 'instead of <div class="{{ val }}">, use <div :class="val">.',
  72886. el.rawAttrsMap['class']
  72887. );
  72888. }
  72889. }
  72890. if (staticClass) {
  72891. el.staticClass = JSON.stringify(staticClass);
  72892. }
  72893. var classBinding = getBindingAttr(el, 'class', false /* getStatic */);
  72894. if (classBinding) {
  72895. el.classBinding = classBinding;
  72896. }
  72897. }
  72898. function genData (el) {
  72899. var data = '';
  72900. if (el.staticClass) {
  72901. data += "staticClass:" + (el.staticClass) + ",";
  72902. }
  72903. if (el.classBinding) {
  72904. data += "class:" + (el.classBinding) + ",";
  72905. }
  72906. return data
  72907. }
  72908. var klass$1 = {
  72909. staticKeys: ['staticClass'],
  72910. transformNode: transformNode,
  72911. genData: genData
  72912. };
  72913. /* */
  72914. function transformNode$1 (el, options) {
  72915. var warn = options.warn || baseWarn;
  72916. var staticStyle = getAndRemoveAttr(el, 'style');
  72917. if (staticStyle) {
  72918. /* istanbul ignore if */
  72919. {
  72920. var res = parseText(staticStyle, options.delimiters);
  72921. if (res) {
  72922. warn(
  72923. "style=\"" + staticStyle + "\": " +
  72924. 'Interpolation inside attributes has been removed. ' +
  72925. 'Use v-bind or the colon shorthand instead. For example, ' +
  72926. 'instead of <div style="{{ val }}">, use <div :style="val">.',
  72927. el.rawAttrsMap['style']
  72928. );
  72929. }
  72930. }
  72931. el.staticStyle = JSON.stringify(parseStyleText(staticStyle));
  72932. }
  72933. var styleBinding = getBindingAttr(el, 'style', false /* getStatic */);
  72934. if (styleBinding) {
  72935. el.styleBinding = styleBinding;
  72936. }
  72937. }
  72938. function genData$1 (el) {
  72939. var data = '';
  72940. if (el.staticStyle) {
  72941. data += "staticStyle:" + (el.staticStyle) + ",";
  72942. }
  72943. if (el.styleBinding) {
  72944. data += "style:(" + (el.styleBinding) + "),";
  72945. }
  72946. return data
  72947. }
  72948. var style$1 = {
  72949. staticKeys: ['staticStyle'],
  72950. transformNode: transformNode$1,
  72951. genData: genData$1
  72952. };
  72953. /* */
  72954. var decoder;
  72955. var he = {
  72956. decode: function decode (html) {
  72957. decoder = decoder || document.createElement('div');
  72958. decoder.innerHTML = html;
  72959. return decoder.textContent
  72960. }
  72961. };
  72962. /* */
  72963. var isUnaryTag = makeMap(
  72964. 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' +
  72965. 'link,meta,param,source,track,wbr'
  72966. );
  72967. // Elements that you can, intentionally, leave open
  72968. // (and which close themselves)
  72969. var canBeLeftOpenTag = makeMap(
  72970. 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source'
  72971. );
  72972. // HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3
  72973. // Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content
  72974. var isNonPhrasingTag = makeMap(
  72975. 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' +
  72976. 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' +
  72977. 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' +
  72978. 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' +
  72979. 'title,tr,track'
  72980. );
  72981. /**
  72982. * Not type-checking this file because it's mostly vendor code.
  72983. */
  72984. // Regular Expressions for parsing tags and attributes
  72985. var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
  72986. var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
  72987. var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" + (unicodeRegExp.source) + "]*";
  72988. var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")";
  72989. var startTagOpen = new RegExp(("^<" + qnameCapture));
  72990. var startTagClose = /^\s*(\/?)>/;
  72991. var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
  72992. var doctype = /^<!DOCTYPE [^>]+>/i;
  72993. // #7298: escape - to avoid being passed as HTML comment when inlined in page
  72994. var comment = /^<!\--/;
  72995. var conditionalComment = /^<!\[/;
  72996. // Special Elements (can contain anything)
  72997. var isPlainTextElement = makeMap('script,style,textarea', true);
  72998. var reCache = {};
  72999. var decodingMap = {
  73000. '&lt;': '<',
  73001. '&gt;': '>',
  73002. '&quot;': '"',
  73003. '&amp;': '&',
  73004. '&#10;': '\n',
  73005. '&#9;': '\t',
  73006. '&#39;': "'"
  73007. };
  73008. var encodedAttr = /&(?:lt|gt|quot|amp|#39);/g;
  73009. var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g;
  73010. // #5992
  73011. var isIgnoreNewlineTag = makeMap('pre,textarea', true);
  73012. var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\n'; };
  73013. function decodeAttr (value, shouldDecodeNewlines) {
  73014. var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr;
  73015. return value.replace(re, function (match) { return decodingMap[match]; })
  73016. }
  73017. function parseHTML (html, options) {
  73018. var stack = [];
  73019. var expectHTML = options.expectHTML;
  73020. var isUnaryTag$$1 = options.isUnaryTag || no;
  73021. var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no;
  73022. var index = 0;
  73023. var last, lastTag;
  73024. while (html) {
  73025. last = html;
  73026. // Make sure we're not in a plaintext content element like script/style
  73027. if (!lastTag || !isPlainTextElement(lastTag)) {
  73028. var textEnd = html.indexOf('<');
  73029. if (textEnd === 0) {
  73030. // Comment:
  73031. if (comment.test(html)) {
  73032. var commentEnd = html.indexOf('-->');
  73033. if (commentEnd >= 0) {
  73034. if (options.shouldKeepComment) {
  73035. options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3);
  73036. }
  73037. advance(commentEnd + 3);
  73038. continue
  73039. }
  73040. }
  73041. // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment
  73042. if (conditionalComment.test(html)) {
  73043. var conditionalEnd = html.indexOf(']>');
  73044. if (conditionalEnd >= 0) {
  73045. advance(conditionalEnd + 2);
  73046. continue
  73047. }
  73048. }
  73049. // Doctype:
  73050. var doctypeMatch = html.match(doctype);
  73051. if (doctypeMatch) {
  73052. advance(doctypeMatch[0].length);
  73053. continue
  73054. }
  73055. // End tag:
  73056. var endTagMatch = html.match(endTag);
  73057. if (endTagMatch) {
  73058. var curIndex = index;
  73059. advance(endTagMatch[0].length);
  73060. parseEndTag(endTagMatch[1], curIndex, index);
  73061. continue
  73062. }
  73063. // Start tag:
  73064. var startTagMatch = parseStartTag();
  73065. if (startTagMatch) {
  73066. handleStartTag(startTagMatch);
  73067. if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) {
  73068. advance(1);
  73069. }
  73070. continue
  73071. }
  73072. }
  73073. var text = (void 0), rest = (void 0), next = (void 0);
  73074. if (textEnd >= 0) {
  73075. rest = html.slice(textEnd);
  73076. while (
  73077. !endTag.test(rest) &&
  73078. !startTagOpen.test(rest) &&
  73079. !comment.test(rest) &&
  73080. !conditionalComment.test(rest)
  73081. ) {
  73082. // < in plain text, be forgiving and treat it as text
  73083. next = rest.indexOf('<', 1);
  73084. if (next < 0) { break }
  73085. textEnd += next;
  73086. rest = html.slice(textEnd);
  73087. }
  73088. text = html.substring(0, textEnd);
  73089. }
  73090. if (textEnd < 0) {
  73091. text = html;
  73092. }
  73093. if (text) {
  73094. advance(text.length);
  73095. }
  73096. if (options.chars && text) {
  73097. options.chars(text, index - text.length, index);
  73098. }
  73099. } else {
  73100. var endTagLength = 0;
  73101. var stackedTag = lastTag.toLowerCase();
  73102. var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i'));
  73103. var rest$1 = html.replace(reStackedTag, function (all, text, endTag) {
  73104. endTagLength = endTag.length;
  73105. if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') {
  73106. text = text
  73107. .replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298
  73108. .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1');
  73109. }
  73110. if (shouldIgnoreFirstNewline(stackedTag, text)) {
  73111. text = text.slice(1);
  73112. }
  73113. if (options.chars) {
  73114. options.chars(text);
  73115. }
  73116. return ''
  73117. });
  73118. index += html.length - rest$1.length;
  73119. html = rest$1;
  73120. parseEndTag(stackedTag, index - endTagLength, index);
  73121. }
  73122. if (html === last) {
  73123. options.chars && options.chars(html);
  73124. if (!stack.length && options.warn) {
  73125. options.warn(("Mal-formatted tag at end of template: \"" + html + "\""), { start: index + html.length });
  73126. }
  73127. break
  73128. }
  73129. }
  73130. // Clean up any remaining tags
  73131. parseEndTag();
  73132. function advance (n) {
  73133. index += n;
  73134. html = html.substring(n);
  73135. }
  73136. function parseStartTag () {
  73137. var start = html.match(startTagOpen);
  73138. if (start) {
  73139. var match = {
  73140. tagName: start[1],
  73141. attrs: [],
  73142. start: index
  73143. };
  73144. advance(start[0].length);
  73145. var end, attr;
  73146. while (!(end = html.match(startTagClose)) && (attr = html.match(dynamicArgAttribute) || html.match(attribute))) {
  73147. attr.start = index;
  73148. advance(attr[0].length);
  73149. attr.end = index;
  73150. match.attrs.push(attr);
  73151. }
  73152. if (end) {
  73153. match.unarySlash = end[1];
  73154. advance(end[0].length);
  73155. match.end = index;
  73156. return match
  73157. }
  73158. }
  73159. }
  73160. function handleStartTag (match) {
  73161. var tagName = match.tagName;
  73162. var unarySlash = match.unarySlash;
  73163. if (expectHTML) {
  73164. if (lastTag === 'p' && isNonPhrasingTag(tagName)) {
  73165. parseEndTag(lastTag);
  73166. }
  73167. if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) {
  73168. parseEndTag(tagName);
  73169. }
  73170. }
  73171. var unary = isUnaryTag$$1(tagName) || !!unarySlash;
  73172. var l = match.attrs.length;
  73173. var attrs = new Array(l);
  73174. for (var i = 0; i < l; i++) {
  73175. var args = match.attrs[i];
  73176. var value = args[3] || args[4] || args[5] || '';
  73177. var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href'
  73178. ? options.shouldDecodeNewlinesForHref
  73179. : options.shouldDecodeNewlines;
  73180. attrs[i] = {
  73181. name: args[1],
  73182. value: decodeAttr(value, shouldDecodeNewlines)
  73183. };
  73184. if (options.outputSourceRange) {
  73185. attrs[i].start = args.start + args[0].match(/^\s*/).length;
  73186. attrs[i].end = args.end;
  73187. }
  73188. }
  73189. if (!unary) {
  73190. stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs, start: match.start, end: match.end });
  73191. lastTag = tagName;
  73192. }
  73193. if (options.start) {
  73194. options.start(tagName, attrs, unary, match.start, match.end);
  73195. }
  73196. }
  73197. function parseEndTag (tagName, start, end) {
  73198. var pos, lowerCasedTagName;
  73199. if (start == null) { start = index; }
  73200. if (end == null) { end = index; }
  73201. // Find the closest opened tag of the same type
  73202. if (tagName) {
  73203. lowerCasedTagName = tagName.toLowerCase();
  73204. for (pos = stack.length - 1; pos >= 0; pos--) {
  73205. if (stack[pos].lowerCasedTag === lowerCasedTagName) {
  73206. break
  73207. }
  73208. }
  73209. } else {
  73210. // If no tag name is provided, clean shop
  73211. pos = 0;
  73212. }
  73213. if (pos >= 0) {
  73214. // Close all the open elements, up the stack
  73215. for (var i = stack.length - 1; i >= pos; i--) {
  73216. if (i > pos || !tagName &&
  73217. options.warn
  73218. ) {
  73219. options.warn(
  73220. ("tag <" + (stack[i].tag) + "> has no matching end tag."),
  73221. { start: stack[i].start, end: stack[i].end }
  73222. );
  73223. }
  73224. if (options.end) {
  73225. options.end(stack[i].tag, start, end);
  73226. }
  73227. }
  73228. // Remove the open elements from the stack
  73229. stack.length = pos;
  73230. lastTag = pos && stack[pos - 1].tag;
  73231. } else if (lowerCasedTagName === 'br') {
  73232. if (options.start) {
  73233. options.start(tagName, [], true, start, end);
  73234. }
  73235. } else if (lowerCasedTagName === 'p') {
  73236. if (options.start) {
  73237. options.start(tagName, [], false, start, end);
  73238. }
  73239. if (options.end) {
  73240. options.end(tagName, start, end);
  73241. }
  73242. }
  73243. }
  73244. }
  73245. /* */
  73246. var onRE = /^@|^v-on:/;
  73247. var dirRE = /^v-|^@|^:|^#/;
  73248. var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
  73249. var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
  73250. var stripParensRE = /^\(|\)$/g;
  73251. var dynamicArgRE = /^\[.*\]$/;
  73252. var argRE = /:(.*)$/;
  73253. var bindRE = /^:|^\.|^v-bind:/;
  73254. var modifierRE = /\.[^.\]]+(?=[^\]]*$)/g;
  73255. var slotRE = /^v-slot(:|$)|^#/;
  73256. var lineBreakRE = /[\r\n]/;
  73257. var whitespaceRE$1 = /\s+/g;
  73258. var invalidAttributeRE = /[\s"'<>\/=]/;
  73259. var decodeHTMLCached = cached(he.decode);
  73260. var emptySlotScopeToken = "_empty_";
  73261. // configurable state
  73262. var warn$2;
  73263. var delimiters;
  73264. var transforms;
  73265. var preTransforms;
  73266. var postTransforms;
  73267. var platformIsPreTag;
  73268. var platformMustUseProp;
  73269. var platformGetTagNamespace;
  73270. var maybeComponent;
  73271. function createASTElement (
  73272. tag,
  73273. attrs,
  73274. parent
  73275. ) {
  73276. return {
  73277. type: 1,
  73278. tag: tag,
  73279. attrsList: attrs,
  73280. attrsMap: makeAttrsMap(attrs),
  73281. rawAttrsMap: {},
  73282. parent: parent,
  73283. children: []
  73284. }
  73285. }
  73286. /**
  73287. * Convert HTML string to AST.
  73288. */
  73289. function parse (
  73290. template,
  73291. options
  73292. ) {
  73293. warn$2 = options.warn || baseWarn;
  73294. platformIsPreTag = options.isPreTag || no;
  73295. platformMustUseProp = options.mustUseProp || no;
  73296. platformGetTagNamespace = options.getTagNamespace || no;
  73297. var isReservedTag = options.isReservedTag || no;
  73298. maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };
  73299. transforms = pluckModuleFunction(options.modules, 'transformNode');
  73300. preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
  73301. postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
  73302. delimiters = options.delimiters;
  73303. var stack = [];
  73304. var preserveWhitespace = options.preserveWhitespace !== false;
  73305. var whitespaceOption = options.whitespace;
  73306. var root;
  73307. var currentParent;
  73308. var inVPre = false;
  73309. var inPre = false;
  73310. var warned = false;
  73311. function warnOnce (msg, range) {
  73312. if (!warned) {
  73313. warned = true;
  73314. warn$2(msg, range);
  73315. }
  73316. }
  73317. function closeElement (element) {
  73318. trimEndingWhitespace(element);
  73319. if (!inVPre && !element.processed) {
  73320. element = processElement(element, options);
  73321. }
  73322. // tree management
  73323. if (!stack.length && element !== root) {
  73324. // allow root elements with v-if, v-else-if and v-else
  73325. if (root.if && (element.elseif || element.else)) {
  73326. {
  73327. checkRootConstraints(element);
  73328. }
  73329. addIfCondition(root, {
  73330. exp: element.elseif,
  73331. block: element
  73332. });
  73333. } else {
  73334. warnOnce(
  73335. "Component template should contain exactly one root element. " +
  73336. "If you are using v-if on multiple elements, " +
  73337. "use v-else-if to chain them instead.",
  73338. { start: element.start }
  73339. );
  73340. }
  73341. }
  73342. if (currentParent && !element.forbidden) {
  73343. if (element.elseif || element.else) {
  73344. processIfConditions(element, currentParent);
  73345. } else {
  73346. if (element.slotScope) {
  73347. // scoped slot
  73348. // keep it in the children list so that v-else(-if) conditions can
  73349. // find it as the prev node.
  73350. var name = element.slotTarget || '"default"'
  73351. ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
  73352. }
  73353. currentParent.children.push(element);
  73354. element.parent = currentParent;
  73355. }
  73356. }
  73357. // final children cleanup
  73358. // filter out scoped slots
  73359. element.children = element.children.filter(function (c) { return !(c).slotScope; });
  73360. // remove trailing whitespace node again
  73361. trimEndingWhitespace(element);
  73362. // check pre state
  73363. if (element.pre) {
  73364. inVPre = false;
  73365. }
  73366. if (platformIsPreTag(element.tag)) {
  73367. inPre = false;
  73368. }
  73369. // apply post-transforms
  73370. for (var i = 0; i < postTransforms.length; i++) {
  73371. postTransforms[i](element, options);
  73372. }
  73373. }
  73374. function trimEndingWhitespace (el) {
  73375. // remove trailing whitespace node
  73376. if (!inPre) {
  73377. var lastNode;
  73378. while (
  73379. (lastNode = el.children[el.children.length - 1]) &&
  73380. lastNode.type === 3 &&
  73381. lastNode.text === ' '
  73382. ) {
  73383. el.children.pop();
  73384. }
  73385. }
  73386. }
  73387. function checkRootConstraints (el) {
  73388. if (el.tag === 'slot' || el.tag === 'template') {
  73389. warnOnce(
  73390. "Cannot use <" + (el.tag) + "> as component root element because it may " +
  73391. 'contain multiple nodes.',
  73392. { start: el.start }
  73393. );
  73394. }
  73395. if (el.attrsMap.hasOwnProperty('v-for')) {
  73396. warnOnce(
  73397. 'Cannot use v-for on stateful component root element because ' +
  73398. 'it renders multiple elements.',
  73399. el.rawAttrsMap['v-for']
  73400. );
  73401. }
  73402. }
  73403. parseHTML(template, {
  73404. warn: warn$2,
  73405. expectHTML: options.expectHTML,
  73406. isUnaryTag: options.isUnaryTag,
  73407. canBeLeftOpenTag: options.canBeLeftOpenTag,
  73408. shouldDecodeNewlines: options.shouldDecodeNewlines,
  73409. shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref,
  73410. shouldKeepComment: options.comments,
  73411. outputSourceRange: options.outputSourceRange,
  73412. start: function start (tag, attrs, unary, start$1, end) {
  73413. // check namespace.
  73414. // inherit parent ns if there is one
  73415. var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag);
  73416. // handle IE svg bug
  73417. /* istanbul ignore if */
  73418. if (isIE && ns === 'svg') {
  73419. attrs = guardIESVGBug(attrs);
  73420. }
  73421. var element = createASTElement(tag, attrs, currentParent);
  73422. if (ns) {
  73423. element.ns = ns;
  73424. }
  73425. {
  73426. if (options.outputSourceRange) {
  73427. element.start = start$1;
  73428. element.end = end;
  73429. element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) {
  73430. cumulated[attr.name] = attr;
  73431. return cumulated
  73432. }, {});
  73433. }
  73434. attrs.forEach(function (attr) {
  73435. if (invalidAttributeRE.test(attr.name)) {
  73436. warn$2(
  73437. "Invalid dynamic argument expression: attribute names cannot contain " +
  73438. "spaces, quotes, <, >, / or =.",
  73439. {
  73440. start: attr.start + attr.name.indexOf("["),
  73441. end: attr.start + attr.name.length
  73442. }
  73443. );
  73444. }
  73445. });
  73446. }
  73447. if (isForbiddenTag(element) && !isServerRendering()) {
  73448. element.forbidden = true;
  73449. warn$2(
  73450. 'Templates should only be responsible for mapping the state to the ' +
  73451. 'UI. Avoid placing tags with side-effects in your templates, such as ' +
  73452. "<" + tag + ">" + ', as they will not be parsed.',
  73453. { start: element.start }
  73454. );
  73455. }
  73456. // apply pre-transforms
  73457. for (var i = 0; i < preTransforms.length; i++) {
  73458. element = preTransforms[i](element, options) || element;
  73459. }
  73460. if (!inVPre) {
  73461. processPre(element);
  73462. if (element.pre) {
  73463. inVPre = true;
  73464. }
  73465. }
  73466. if (platformIsPreTag(element.tag)) {
  73467. inPre = true;
  73468. }
  73469. if (inVPre) {
  73470. processRawAttrs(element);
  73471. } else if (!element.processed) {
  73472. // structural directives
  73473. processFor(element);
  73474. processIf(element);
  73475. processOnce(element);
  73476. }
  73477. if (!root) {
  73478. root = element;
  73479. {
  73480. checkRootConstraints(root);
  73481. }
  73482. }
  73483. if (!unary) {
  73484. currentParent = element;
  73485. stack.push(element);
  73486. } else {
  73487. closeElement(element);
  73488. }
  73489. },
  73490. end: function end (tag, start, end$1) {
  73491. var element = stack[stack.length - 1];
  73492. // pop stack
  73493. stack.length -= 1;
  73494. currentParent = stack[stack.length - 1];
  73495. if (options.outputSourceRange) {
  73496. element.end = end$1;
  73497. }
  73498. closeElement(element);
  73499. },
  73500. chars: function chars (text, start, end) {
  73501. if (!currentParent) {
  73502. {
  73503. if (text === template) {
  73504. warnOnce(
  73505. 'Component template requires a root element, rather than just text.',
  73506. { start: start }
  73507. );
  73508. } else if ((text = text.trim())) {
  73509. warnOnce(
  73510. ("text \"" + text + "\" outside root element will be ignored."),
  73511. { start: start }
  73512. );
  73513. }
  73514. }
  73515. return
  73516. }
  73517. // IE textarea placeholder bug
  73518. /* istanbul ignore if */
  73519. if (isIE &&
  73520. currentParent.tag === 'textarea' &&
  73521. currentParent.attrsMap.placeholder === text
  73522. ) {
  73523. return
  73524. }
  73525. var children = currentParent.children;
  73526. if (inPre || text.trim()) {
  73527. text = isTextTag(currentParent) ? text : decodeHTMLCached(text);
  73528. } else if (!children.length) {
  73529. // remove the whitespace-only node right after an opening tag
  73530. text = '';
  73531. } else if (whitespaceOption) {
  73532. if (whitespaceOption === 'condense') {
  73533. // in condense mode, remove the whitespace node if it contains
  73534. // line break, otherwise condense to a single space
  73535. text = lineBreakRE.test(text) ? '' : ' ';
  73536. } else {
  73537. text = ' ';
  73538. }
  73539. } else {
  73540. text = preserveWhitespace ? ' ' : '';
  73541. }
  73542. if (text) {
  73543. if (!inPre && whitespaceOption === 'condense') {
  73544. // condense consecutive whitespaces into single space
  73545. text = text.replace(whitespaceRE$1, ' ');
  73546. }
  73547. var res;
  73548. var child;
  73549. if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) {
  73550. child = {
  73551. type: 2,
  73552. expression: res.expression,
  73553. tokens: res.tokens,
  73554. text: text
  73555. };
  73556. } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') {
  73557. child = {
  73558. type: 3,
  73559. text: text
  73560. };
  73561. }
  73562. if (child) {
  73563. if (options.outputSourceRange) {
  73564. child.start = start;
  73565. child.end = end;
  73566. }
  73567. children.push(child);
  73568. }
  73569. }
  73570. },
  73571. comment: function comment (text, start, end) {
  73572. // adding anyting as a sibling to the root node is forbidden
  73573. // comments should still be allowed, but ignored
  73574. if (currentParent) {
  73575. var child = {
  73576. type: 3,
  73577. text: text,
  73578. isComment: true
  73579. };
  73580. if (options.outputSourceRange) {
  73581. child.start = start;
  73582. child.end = end;
  73583. }
  73584. currentParent.children.push(child);
  73585. }
  73586. }
  73587. });
  73588. return root
  73589. }
  73590. function processPre (el) {
  73591. if (getAndRemoveAttr(el, 'v-pre') != null) {
  73592. el.pre = true;
  73593. }
  73594. }
  73595. function processRawAttrs (el) {
  73596. var list = el.attrsList;
  73597. var len = list.length;
  73598. if (len) {
  73599. var attrs = el.attrs = new Array(len);
  73600. for (var i = 0; i < len; i++) {
  73601. attrs[i] = {
  73602. name: list[i].name,
  73603. value: JSON.stringify(list[i].value)
  73604. };
  73605. if (list[i].start != null) {
  73606. attrs[i].start = list[i].start;
  73607. attrs[i].end = list[i].end;
  73608. }
  73609. }
  73610. } else if (!el.pre) {
  73611. // non root node in pre blocks with no attributes
  73612. el.plain = true;
  73613. }
  73614. }
  73615. function processElement (
  73616. element,
  73617. options
  73618. ) {
  73619. processKey(element);
  73620. // determine whether this is a plain element after
  73621. // removing structural attributes
  73622. element.plain = (
  73623. !element.key &&
  73624. !element.scopedSlots &&
  73625. !element.attrsList.length
  73626. );
  73627. processRef(element);
  73628. processSlotContent(element);
  73629. processSlotOutlet(element);
  73630. processComponent(element);
  73631. for (var i = 0; i < transforms.length; i++) {
  73632. element = transforms[i](element, options) || element;
  73633. }
  73634. processAttrs(element);
  73635. return element
  73636. }
  73637. function processKey (el) {
  73638. var exp = getBindingAttr(el, 'key');
  73639. if (exp) {
  73640. {
  73641. if (el.tag === 'template') {
  73642. warn$2(
  73643. "<template> cannot be keyed. Place the key on real elements instead.",
  73644. getRawBindingAttr(el, 'key')
  73645. );
  73646. }
  73647. if (el.for) {
  73648. var iterator = el.iterator2 || el.iterator1;
  73649. var parent = el.parent;
  73650. if (iterator && iterator === exp && parent && parent.tag === 'transition-group') {
  73651. warn$2(
  73652. "Do not use v-for index as key on <transition-group> children, " +
  73653. "this is the same as not using keys.",
  73654. getRawBindingAttr(el, 'key'),
  73655. true /* tip */
  73656. );
  73657. }
  73658. }
  73659. }
  73660. el.key = exp;
  73661. }
  73662. }
  73663. function processRef (el) {
  73664. var ref = getBindingAttr(el, 'ref');
  73665. if (ref) {
  73666. el.ref = ref;
  73667. el.refInFor = checkInFor(el);
  73668. }
  73669. }
  73670. function processFor (el) {
  73671. var exp;
  73672. if ((exp = getAndRemoveAttr(el, 'v-for'))) {
  73673. var res = parseFor(exp);
  73674. if (res) {
  73675. extend(el, res);
  73676. } else {
  73677. warn$2(
  73678. ("Invalid v-for expression: " + exp),
  73679. el.rawAttrsMap['v-for']
  73680. );
  73681. }
  73682. }
  73683. }
  73684. function parseFor (exp) {
  73685. var inMatch = exp.match(forAliasRE);
  73686. if (!inMatch) { return }
  73687. var res = {};
  73688. res.for = inMatch[2].trim();
  73689. var alias = inMatch[1].trim().replace(stripParensRE, '');
  73690. var iteratorMatch = alias.match(forIteratorRE);
  73691. if (iteratorMatch) {
  73692. res.alias = alias.replace(forIteratorRE, '').trim();
  73693. res.iterator1 = iteratorMatch[1].trim();
  73694. if (iteratorMatch[2]) {
  73695. res.iterator2 = iteratorMatch[2].trim();
  73696. }
  73697. } else {
  73698. res.alias = alias;
  73699. }
  73700. return res
  73701. }
  73702. function processIf (el) {
  73703. var exp = getAndRemoveAttr(el, 'v-if');
  73704. if (exp) {
  73705. el.if = exp;
  73706. addIfCondition(el, {
  73707. exp: exp,
  73708. block: el
  73709. });
  73710. } else {
  73711. if (getAndRemoveAttr(el, 'v-else') != null) {
  73712. el.else = true;
  73713. }
  73714. var elseif = getAndRemoveAttr(el, 'v-else-if');
  73715. if (elseif) {
  73716. el.elseif = elseif;
  73717. }
  73718. }
  73719. }
  73720. function processIfConditions (el, parent) {
  73721. var prev = findPrevElement(parent.children);
  73722. if (prev && prev.if) {
  73723. addIfCondition(prev, {
  73724. exp: el.elseif,
  73725. block: el
  73726. });
  73727. } else {
  73728. warn$2(
  73729. "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " +
  73730. "used on element <" + (el.tag) + "> without corresponding v-if.",
  73731. el.rawAttrsMap[el.elseif ? 'v-else-if' : 'v-else']
  73732. );
  73733. }
  73734. }
  73735. function findPrevElement (children) {
  73736. var i = children.length;
  73737. while (i--) {
  73738. if (children[i].type === 1) {
  73739. return children[i]
  73740. } else {
  73741. if (children[i].text !== ' ') {
  73742. warn$2(
  73743. "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " +
  73744. "will be ignored.",
  73745. children[i]
  73746. );
  73747. }
  73748. children.pop();
  73749. }
  73750. }
  73751. }
  73752. function addIfCondition (el, condition) {
  73753. if (!el.ifConditions) {
  73754. el.ifConditions = [];
  73755. }
  73756. el.ifConditions.push(condition);
  73757. }
  73758. function processOnce (el) {
  73759. var once$$1 = getAndRemoveAttr(el, 'v-once');
  73760. if (once$$1 != null) {
  73761. el.once = true;
  73762. }
  73763. }
  73764. // handle content being passed to a component as slot,
  73765. // e.g. <template slot="xxx">, <div slot-scope="xxx">
  73766. function processSlotContent (el) {
  73767. var slotScope;
  73768. if (el.tag === 'template') {
  73769. slotScope = getAndRemoveAttr(el, 'scope');
  73770. /* istanbul ignore if */
  73771. if (slotScope) {
  73772. warn$2(
  73773. "the \"scope\" attribute for scoped slots have been deprecated and " +
  73774. "replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " +
  73775. "can also be used on plain elements in addition to <template> to " +
  73776. "denote scoped slots.",
  73777. el.rawAttrsMap['scope'],
  73778. true
  73779. );
  73780. }
  73781. el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope');
  73782. } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) {
  73783. /* istanbul ignore if */
  73784. if (el.attrsMap['v-for']) {
  73785. warn$2(
  73786. "Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " +
  73787. "(v-for takes higher priority). Use a wrapper <template> for the " +
  73788. "scoped slot to make it clearer.",
  73789. el.rawAttrsMap['slot-scope'],
  73790. true
  73791. );
  73792. }
  73793. el.slotScope = slotScope;
  73794. }
  73795. // slot="xxx"
  73796. var slotTarget = getBindingAttr(el, 'slot');
  73797. if (slotTarget) {
  73798. el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget;
  73799. el.slotTargetDynamic = !!(el.attrsMap[':slot'] || el.attrsMap['v-bind:slot']);
  73800. // preserve slot as an attribute for native shadow DOM compat
  73801. // only for non-scoped slots.
  73802. if (el.tag !== 'template' && !el.slotScope) {
  73803. addAttr(el, 'slot', slotTarget, getRawBindingAttr(el, 'slot'));
  73804. }
  73805. }
  73806. // 2.6 v-slot syntax
  73807. {
  73808. if (el.tag === 'template') {
  73809. // v-slot on <template>
  73810. var slotBinding = getAndRemoveAttrByRegex(el, slotRE);
  73811. if (slotBinding) {
  73812. {
  73813. if (el.slotTarget || el.slotScope) {
  73814. warn$2(
  73815. "Unexpected mixed usage of different slot syntaxes.",
  73816. el
  73817. );
  73818. }
  73819. if (el.parent && !maybeComponent(el.parent)) {
  73820. warn$2(
  73821. "<template v-slot> can only appear at the root level inside " +
  73822. "the receiving component",
  73823. el
  73824. );
  73825. }
  73826. }
  73827. var ref = getSlotName(slotBinding);
  73828. var name = ref.name;
  73829. var dynamic = ref.dynamic;
  73830. el.slotTarget = name;
  73831. el.slotTargetDynamic = dynamic;
  73832. el.slotScope = slotBinding.value || emptySlotScopeToken; // force it into a scoped slot for perf
  73833. }
  73834. } else {
  73835. // v-slot on component, denotes default slot
  73836. var slotBinding$1 = getAndRemoveAttrByRegex(el, slotRE);
  73837. if (slotBinding$1) {
  73838. {
  73839. if (!maybeComponent(el)) {
  73840. warn$2(
  73841. "v-slot can only be used on components or <template>.",
  73842. slotBinding$1
  73843. );
  73844. }
  73845. if (el.slotScope || el.slotTarget) {
  73846. warn$2(
  73847. "Unexpected mixed usage of different slot syntaxes.",
  73848. el
  73849. );
  73850. }
  73851. if (el.scopedSlots) {
  73852. warn$2(
  73853. "To avoid scope ambiguity, the default slot should also use " +
  73854. "<template> syntax when there are other named slots.",
  73855. slotBinding$1
  73856. );
  73857. }
  73858. }
  73859. // add the component's children to its default slot
  73860. var slots = el.scopedSlots || (el.scopedSlots = {});
  73861. var ref$1 = getSlotName(slotBinding$1);
  73862. var name$1 = ref$1.name;
  73863. var dynamic$1 = ref$1.dynamic;
  73864. var slotContainer = slots[name$1] = createASTElement('template', [], el);
  73865. slotContainer.slotTarget = name$1;
  73866. slotContainer.slotTargetDynamic = dynamic$1;
  73867. slotContainer.children = el.children.filter(function (c) {
  73868. if (!c.slotScope) {
  73869. c.parent = slotContainer;
  73870. return true
  73871. }
  73872. });
  73873. slotContainer.slotScope = slotBinding$1.value || emptySlotScopeToken;
  73874. // remove children as they are returned from scopedSlots now
  73875. el.children = [];
  73876. // mark el non-plain so data gets generated
  73877. el.plain = false;
  73878. }
  73879. }
  73880. }
  73881. }
  73882. function getSlotName (binding) {
  73883. var name = binding.name.replace(slotRE, '');
  73884. if (!name) {
  73885. if (binding.name[0] !== '#') {
  73886. name = 'default';
  73887. } else {
  73888. warn$2(
  73889. "v-slot shorthand syntax requires a slot name.",
  73890. binding
  73891. );
  73892. }
  73893. }
  73894. return dynamicArgRE.test(name)
  73895. // dynamic [name]
  73896. ? { name: name.slice(1, -1), dynamic: true }
  73897. // static name
  73898. : { name: ("\"" + name + "\""), dynamic: false }
  73899. }
  73900. // handle <slot/> outlets
  73901. function processSlotOutlet (el) {
  73902. if (el.tag === 'slot') {
  73903. el.slotName = getBindingAttr(el, 'name');
  73904. if (el.key) {
  73905. warn$2(
  73906. "`key` does not work on <slot> because slots are abstract outlets " +
  73907. "and can possibly expand into multiple elements. " +
  73908. "Use the key on a wrapping element instead.",
  73909. getRawBindingAttr(el, 'key')
  73910. );
  73911. }
  73912. }
  73913. }
  73914. function processComponent (el) {
  73915. var binding;
  73916. if ((binding = getBindingAttr(el, 'is'))) {
  73917. el.component = binding;
  73918. }
  73919. if (getAndRemoveAttr(el, 'inline-template') != null) {
  73920. el.inlineTemplate = true;
  73921. }
  73922. }
  73923. function processAttrs (el) {
  73924. var list = el.attrsList;
  73925. var i, l, name, rawName, value, modifiers, syncGen, isDynamic;
  73926. for (i = 0, l = list.length; i < l; i++) {
  73927. name = rawName = list[i].name;
  73928. value = list[i].value;
  73929. if (dirRE.test(name)) {
  73930. // mark element as dynamic
  73931. el.hasBindings = true;
  73932. // modifiers
  73933. modifiers = parseModifiers(name.replace(dirRE, ''));
  73934. // support .foo shorthand syntax for the .prop modifier
  73935. if (modifiers) {
  73936. name = name.replace(modifierRE, '');
  73937. }
  73938. if (bindRE.test(name)) { // v-bind
  73939. name = name.replace(bindRE, '');
  73940. value = parseFilters(value);
  73941. isDynamic = dynamicArgRE.test(name);
  73942. if (isDynamic) {
  73943. name = name.slice(1, -1);
  73944. }
  73945. if (
  73946. value.trim().length === 0
  73947. ) {
  73948. warn$2(
  73949. ("The value for a v-bind expression cannot be empty. Found in \"v-bind:" + name + "\"")
  73950. );
  73951. }
  73952. if (modifiers) {
  73953. if (modifiers.prop && !isDynamic) {
  73954. name = camelize(name);
  73955. if (name === 'innerHtml') { name = 'innerHTML'; }
  73956. }
  73957. if (modifiers.camel && !isDynamic) {
  73958. name = camelize(name);
  73959. }
  73960. if (modifiers.sync) {
  73961. syncGen = genAssignmentCode(value, "$event");
  73962. if (!isDynamic) {
  73963. addHandler(
  73964. el,
  73965. ("update:" + (camelize(name))),
  73966. syncGen,
  73967. null,
  73968. false,
  73969. warn$2,
  73970. list[i]
  73971. );
  73972. if (hyphenate(name) !== camelize(name)) {
  73973. addHandler(
  73974. el,
  73975. ("update:" + (hyphenate(name))),
  73976. syncGen,
  73977. null,
  73978. false,
  73979. warn$2,
  73980. list[i]
  73981. );
  73982. }
  73983. } else {
  73984. // handler w/ dynamic event name
  73985. addHandler(
  73986. el,
  73987. ("\"update:\"+(" + name + ")"),
  73988. syncGen,
  73989. null,
  73990. false,
  73991. warn$2,
  73992. list[i],
  73993. true // dynamic
  73994. );
  73995. }
  73996. }
  73997. }
  73998. if ((modifiers && modifiers.prop) || (
  73999. !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name)
  74000. )) {
  74001. addProp(el, name, value, list[i], isDynamic);
  74002. } else {
  74003. addAttr(el, name, value, list[i], isDynamic);
  74004. }
  74005. } else if (onRE.test(name)) { // v-on
  74006. name = name.replace(onRE, '');
  74007. isDynamic = dynamicArgRE.test(name);
  74008. if (isDynamic) {
  74009. name = name.slice(1, -1);
  74010. }
  74011. addHandler(el, name, value, modifiers, false, warn$2, list[i], isDynamic);
  74012. } else { // normal directives
  74013. name = name.replace(dirRE, '');
  74014. // parse arg
  74015. var argMatch = name.match(argRE);
  74016. var arg = argMatch && argMatch[1];
  74017. isDynamic = false;
  74018. if (arg) {
  74019. name = name.slice(0, -(arg.length + 1));
  74020. if (dynamicArgRE.test(arg)) {
  74021. arg = arg.slice(1, -1);
  74022. isDynamic = true;
  74023. }
  74024. }
  74025. addDirective(el, name, rawName, value, arg, isDynamic, modifiers, list[i]);
  74026. if (name === 'model') {
  74027. checkForAliasModel(el, value);
  74028. }
  74029. }
  74030. } else {
  74031. // literal attribute
  74032. {
  74033. var res = parseText(value, delimiters);
  74034. if (res) {
  74035. warn$2(
  74036. name + "=\"" + value + "\": " +
  74037. 'Interpolation inside attributes has been removed. ' +
  74038. 'Use v-bind or the colon shorthand instead. For example, ' +
  74039. 'instead of <div id="{{ val }}">, use <div :id="val">.',
  74040. list[i]
  74041. );
  74042. }
  74043. }
  74044. addAttr(el, name, JSON.stringify(value), list[i]);
  74045. // #6887 firefox doesn't update muted state if set via attribute
  74046. // even immediately after element creation
  74047. if (!el.component &&
  74048. name === 'muted' &&
  74049. platformMustUseProp(el.tag, el.attrsMap.type, name)) {
  74050. addProp(el, name, 'true', list[i]);
  74051. }
  74052. }
  74053. }
  74054. }
  74055. function checkInFor (el) {
  74056. var parent = el;
  74057. while (parent) {
  74058. if (parent.for !== undefined) {
  74059. return true
  74060. }
  74061. parent = parent.parent;
  74062. }
  74063. return false
  74064. }
  74065. function parseModifiers (name) {
  74066. var match = name.match(modifierRE);
  74067. if (match) {
  74068. var ret = {};
  74069. match.forEach(function (m) { ret[m.slice(1)] = true; });
  74070. return ret
  74071. }
  74072. }
  74073. function makeAttrsMap (attrs) {
  74074. var map = {};
  74075. for (var i = 0, l = attrs.length; i < l; i++) {
  74076. if (
  74077. map[attrs[i].name] && !isIE && !isEdge
  74078. ) {
  74079. warn$2('duplicate attribute: ' + attrs[i].name, attrs[i]);
  74080. }
  74081. map[attrs[i].name] = attrs[i].value;
  74082. }
  74083. return map
  74084. }
  74085. // for script (e.g. type="x/template") or style, do not decode content
  74086. function isTextTag (el) {
  74087. return el.tag === 'script' || el.tag === 'style'
  74088. }
  74089. function isForbiddenTag (el) {
  74090. return (
  74091. el.tag === 'style' ||
  74092. (el.tag === 'script' && (
  74093. !el.attrsMap.type ||
  74094. el.attrsMap.type === 'text/javascript'
  74095. ))
  74096. )
  74097. }
  74098. var ieNSBug = /^xmlns:NS\d+/;
  74099. var ieNSPrefix = /^NS\d+:/;
  74100. /* istanbul ignore next */
  74101. function guardIESVGBug (attrs) {
  74102. var res = [];
  74103. for (var i = 0; i < attrs.length; i++) {
  74104. var attr = attrs[i];
  74105. if (!ieNSBug.test(attr.name)) {
  74106. attr.name = attr.name.replace(ieNSPrefix, '');
  74107. res.push(attr);
  74108. }
  74109. }
  74110. return res
  74111. }
  74112. function checkForAliasModel (el, value) {
  74113. var _el = el;
  74114. while (_el) {
  74115. if (_el.for && _el.alias === value) {
  74116. warn$2(
  74117. "<" + (el.tag) + " v-model=\"" + value + "\">: " +
  74118. "You are binding v-model directly to a v-for iteration alias. " +
  74119. "This will not be able to modify the v-for source array because " +
  74120. "writing to the alias is like modifying a function local variable. " +
  74121. "Consider using an array of objects and use v-model on an object property instead.",
  74122. el.rawAttrsMap['v-model']
  74123. );
  74124. }
  74125. _el = _el.parent;
  74126. }
  74127. }
  74128. /* */
  74129. function preTransformNode (el, options) {
  74130. if (el.tag === 'input') {
  74131. var map = el.attrsMap;
  74132. if (!map['v-model']) {
  74133. return
  74134. }
  74135. var typeBinding;
  74136. if (map[':type'] || map['v-bind:type']) {
  74137. typeBinding = getBindingAttr(el, 'type');
  74138. }
  74139. if (!map.type && !typeBinding && map['v-bind']) {
  74140. typeBinding = "(" + (map['v-bind']) + ").type";
  74141. }
  74142. if (typeBinding) {
  74143. var ifCondition = getAndRemoveAttr(el, 'v-if', true);
  74144. var ifConditionExtra = ifCondition ? ("&&(" + ifCondition + ")") : "";
  74145. var hasElse = getAndRemoveAttr(el, 'v-else', true) != null;
  74146. var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true);
  74147. // 1. checkbox
  74148. var branch0 = cloneASTElement(el);
  74149. // process for on the main node
  74150. processFor(branch0);
  74151. addRawAttr(branch0, 'type', 'checkbox');
  74152. processElement(branch0, options);
  74153. branch0.processed = true; // prevent it from double-processed
  74154. branch0.if = "(" + typeBinding + ")==='checkbox'" + ifConditionExtra;
  74155. addIfCondition(branch0, {
  74156. exp: branch0.if,
  74157. block: branch0
  74158. });
  74159. // 2. add radio else-if condition
  74160. var branch1 = cloneASTElement(el);
  74161. getAndRemoveAttr(branch1, 'v-for', true);
  74162. addRawAttr(branch1, 'type', 'radio');
  74163. processElement(branch1, options);
  74164. addIfCondition(branch0, {
  74165. exp: "(" + typeBinding + ")==='radio'" + ifConditionExtra,
  74166. block: branch1
  74167. });
  74168. // 3. other
  74169. var branch2 = cloneASTElement(el);
  74170. getAndRemoveAttr(branch2, 'v-for', true);
  74171. addRawAttr(branch2, ':type', typeBinding);
  74172. processElement(branch2, options);
  74173. addIfCondition(branch0, {
  74174. exp: ifCondition,
  74175. block: branch2
  74176. });
  74177. if (hasElse) {
  74178. branch0.else = true;
  74179. } else if (elseIfCondition) {
  74180. branch0.elseif = elseIfCondition;
  74181. }
  74182. return branch0
  74183. }
  74184. }
  74185. }
  74186. function cloneASTElement (el) {
  74187. return createASTElement(el.tag, el.attrsList.slice(), el.parent)
  74188. }
  74189. var model$1 = {
  74190. preTransformNode: preTransformNode
  74191. };
  74192. var modules$1 = [
  74193. klass$1,
  74194. style$1,
  74195. model$1
  74196. ];
  74197. /* */
  74198. function text (el, dir) {
  74199. if (dir.value) {
  74200. addProp(el, 'textContent', ("_s(" + (dir.value) + ")"), dir);
  74201. }
  74202. }
  74203. /* */
  74204. function html (el, dir) {
  74205. if (dir.value) {
  74206. addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"), dir);
  74207. }
  74208. }
  74209. var directives$1 = {
  74210. model: model,
  74211. text: text,
  74212. html: html
  74213. };
  74214. /* */
  74215. var baseOptions = {
  74216. expectHTML: true,
  74217. modules: modules$1,
  74218. directives: directives$1,
  74219. isPreTag: isPreTag,
  74220. isUnaryTag: isUnaryTag,
  74221. mustUseProp: mustUseProp,
  74222. canBeLeftOpenTag: canBeLeftOpenTag,
  74223. isReservedTag: isReservedTag,
  74224. getTagNamespace: getTagNamespace,
  74225. staticKeys: genStaticKeys(modules$1)
  74226. };
  74227. /* */
  74228. var isStaticKey;
  74229. var isPlatformReservedTag;
  74230. var genStaticKeysCached = cached(genStaticKeys$1);
  74231. /**
  74232. * Goal of the optimizer: walk the generated template AST tree
  74233. * and detect sub-trees that are purely static, i.e. parts of
  74234. * the DOM that never needs to change.
  74235. *
  74236. * Once we detect these sub-trees, we can:
  74237. *
  74238. * 1. Hoist them into constants, so that we no longer need to
  74239. * create fresh nodes for them on each re-render;
  74240. * 2. Completely skip them in the patching process.
  74241. */
  74242. function optimize (root, options) {
  74243. if (!root) { return }
  74244. isStaticKey = genStaticKeysCached(options.staticKeys || '');
  74245. isPlatformReservedTag = options.isReservedTag || no;
  74246. // first pass: mark all non-static nodes.
  74247. markStatic$1(root);
  74248. // second pass: mark static roots.
  74249. markStaticRoots(root, false);
  74250. }
  74251. function genStaticKeys$1 (keys) {
  74252. return makeMap(
  74253. 'type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap' +
  74254. (keys ? ',' + keys : '')
  74255. )
  74256. }
  74257. function markStatic$1 (node) {
  74258. node.static = isStatic(node);
  74259. if (node.type === 1) {
  74260. // do not make component slot content static. this avoids
  74261. // 1. components not able to mutate slot nodes
  74262. // 2. static slot content fails for hot-reloading
  74263. if (
  74264. !isPlatformReservedTag(node.tag) &&
  74265. node.tag !== 'slot' &&
  74266. node.attrsMap['inline-template'] == null
  74267. ) {
  74268. return
  74269. }
  74270. for (var i = 0, l = node.children.length; i < l; i++) {
  74271. var child = node.children[i];
  74272. markStatic$1(child);
  74273. if (!child.static) {
  74274. node.static = false;
  74275. }
  74276. }
  74277. if (node.ifConditions) {
  74278. for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
  74279. var block = node.ifConditions[i$1].block;
  74280. markStatic$1(block);
  74281. if (!block.static) {
  74282. node.static = false;
  74283. }
  74284. }
  74285. }
  74286. }
  74287. }
  74288. function markStaticRoots (node, isInFor) {
  74289. if (node.type === 1) {
  74290. if (node.static || node.once) {
  74291. node.staticInFor = isInFor;
  74292. }
  74293. // For a node to qualify as a static root, it should have children that
  74294. // are not just static text. Otherwise the cost of hoisting out will
  74295. // outweigh the benefits and it's better off to just always render it fresh.
  74296. if (node.static && node.children.length && !(
  74297. node.children.length === 1 &&
  74298. node.children[0].type === 3
  74299. )) {
  74300. node.staticRoot = true;
  74301. return
  74302. } else {
  74303. node.staticRoot = false;
  74304. }
  74305. if (node.children) {
  74306. for (var i = 0, l = node.children.length; i < l; i++) {
  74307. markStaticRoots(node.children[i], isInFor || !!node.for);
  74308. }
  74309. }
  74310. if (node.ifConditions) {
  74311. for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) {
  74312. markStaticRoots(node.ifConditions[i$1].block, isInFor);
  74313. }
  74314. }
  74315. }
  74316. }
  74317. function isStatic (node) {
  74318. if (node.type === 2) { // expression
  74319. return false
  74320. }
  74321. if (node.type === 3) { // text
  74322. return true
  74323. }
  74324. return !!(node.pre || (
  74325. !node.hasBindings && // no dynamic bindings
  74326. !node.if && !node.for && // not v-if or v-for or v-else
  74327. !isBuiltInTag(node.tag) && // not a built-in
  74328. isPlatformReservedTag(node.tag) && // not a component
  74329. !isDirectChildOfTemplateFor(node) &&
  74330. Object.keys(node).every(isStaticKey)
  74331. ))
  74332. }
  74333. function isDirectChildOfTemplateFor (node) {
  74334. while (node.parent) {
  74335. node = node.parent;
  74336. if (node.tag !== 'template') {
  74337. return false
  74338. }
  74339. if (node.for) {
  74340. return true
  74341. }
  74342. }
  74343. return false
  74344. }
  74345. /* */
  74346. var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
  74347. var fnInvokeRE = /\([^)]*?\);*$/;
  74348. var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
  74349. // KeyboardEvent.keyCode aliases
  74350. var keyCodes = {
  74351. esc: 27,
  74352. tab: 9,
  74353. enter: 13,
  74354. space: 32,
  74355. up: 38,
  74356. left: 37,
  74357. right: 39,
  74358. down: 40,
  74359. 'delete': [8, 46]
  74360. };
  74361. // KeyboardEvent.key aliases
  74362. var keyNames = {
  74363. // #7880: IE11 and Edge use `Esc` for Escape key name.
  74364. esc: ['Esc', 'Escape'],
  74365. tab: 'Tab',
  74366. enter: 'Enter',
  74367. // #9112: IE11 uses `Spacebar` for Space key name.
  74368. space: [' ', 'Spacebar'],
  74369. // #7806: IE11 uses key names without `Arrow` prefix for arrow keys.
  74370. up: ['Up', 'ArrowUp'],
  74371. left: ['Left', 'ArrowLeft'],
  74372. right: ['Right', 'ArrowRight'],
  74373. down: ['Down', 'ArrowDown'],
  74374. // #9112: IE11 uses `Del` for Delete key name.
  74375. 'delete': ['Backspace', 'Delete', 'Del']
  74376. };
  74377. // #4868: modifiers that prevent the execution of the listener
  74378. // need to explicitly return null so that we can determine whether to remove
  74379. // the listener for .once
  74380. var genGuard = function (condition) { return ("if(" + condition + ")return null;"); };
  74381. var modifierCode = {
  74382. stop: '$event.stopPropagation();',
  74383. prevent: '$event.preventDefault();',
  74384. self: genGuard("$event.target !== $event.currentTarget"),
  74385. ctrl: genGuard("!$event.ctrlKey"),
  74386. shift: genGuard("!$event.shiftKey"),
  74387. alt: genGuard("!$event.altKey"),
  74388. meta: genGuard("!$event.metaKey"),
  74389. left: genGuard("'button' in $event && $event.button !== 0"),
  74390. middle: genGuard("'button' in $event && $event.button !== 1"),
  74391. right: genGuard("'button' in $event && $event.button !== 2")
  74392. };
  74393. function genHandlers (
  74394. events,
  74395. isNative
  74396. ) {
  74397. var prefix = isNative ? 'nativeOn:' : 'on:';
  74398. var staticHandlers = "";
  74399. var dynamicHandlers = "";
  74400. for (var name in events) {
  74401. var handlerCode = genHandler(events[name]);
  74402. if (events[name] && events[name].dynamic) {
  74403. dynamicHandlers += name + "," + handlerCode + ",";
  74404. } else {
  74405. staticHandlers += "\"" + name + "\":" + handlerCode + ",";
  74406. }
  74407. }
  74408. staticHandlers = "{" + (staticHandlers.slice(0, -1)) + "}";
  74409. if (dynamicHandlers) {
  74410. return prefix + "_d(" + staticHandlers + ",[" + (dynamicHandlers.slice(0, -1)) + "])"
  74411. } else {
  74412. return prefix + staticHandlers
  74413. }
  74414. }
  74415. function genHandler (handler) {
  74416. if (!handler) {
  74417. return 'function(){}'
  74418. }
  74419. if (Array.isArray(handler)) {
  74420. return ("[" + (handler.map(function (handler) { return genHandler(handler); }).join(',')) + "]")
  74421. }
  74422. var isMethodPath = simplePathRE.test(handler.value);
  74423. var isFunctionExpression = fnExpRE.test(handler.value);
  74424. var isFunctionInvocation = simplePathRE.test(handler.value.replace(fnInvokeRE, ''));
  74425. if (!handler.modifiers) {
  74426. if (isMethodPath || isFunctionExpression) {
  74427. return handler.value
  74428. }
  74429. return ("function($event){" + (isFunctionInvocation ? ("return " + (handler.value)) : handler.value) + "}") // inline statement
  74430. } else {
  74431. var code = '';
  74432. var genModifierCode = '';
  74433. var keys = [];
  74434. for (var key in handler.modifiers) {
  74435. if (modifierCode[key]) {
  74436. genModifierCode += modifierCode[key];
  74437. // left/right
  74438. if (keyCodes[key]) {
  74439. keys.push(key);
  74440. }
  74441. } else if (key === 'exact') {
  74442. var modifiers = (handler.modifiers);
  74443. genModifierCode += genGuard(
  74444. ['ctrl', 'shift', 'alt', 'meta']
  74445. .filter(function (keyModifier) { return !modifiers[keyModifier]; })
  74446. .map(function (keyModifier) { return ("$event." + keyModifier + "Key"); })
  74447. .join('||')
  74448. );
  74449. } else {
  74450. keys.push(key);
  74451. }
  74452. }
  74453. if (keys.length) {
  74454. code += genKeyFilter(keys);
  74455. }
  74456. // Make sure modifiers like prevent and stop get executed after key filtering
  74457. if (genModifierCode) {
  74458. code += genModifierCode;
  74459. }
  74460. var handlerCode = isMethodPath
  74461. ? ("return " + (handler.value) + "($event)")
  74462. : isFunctionExpression
  74463. ? ("return (" + (handler.value) + ")($event)")
  74464. : isFunctionInvocation
  74465. ? ("return " + (handler.value))
  74466. : handler.value;
  74467. return ("function($event){" + code + handlerCode + "}")
  74468. }
  74469. }
  74470. function genKeyFilter (keys) {
  74471. return (
  74472. // make sure the key filters only apply to KeyboardEvents
  74473. // #9441: can't use 'keyCode' in $event because Chrome autofill fires fake
  74474. // key events that do not have keyCode property...
  74475. "if(!$event.type.indexOf('key')&&" +
  74476. (keys.map(genFilterCode).join('&&')) + ")return null;"
  74477. )
  74478. }
  74479. function genFilterCode (key) {
  74480. var keyVal = parseInt(key, 10);
  74481. if (keyVal) {
  74482. return ("$event.keyCode!==" + keyVal)
  74483. }
  74484. var keyCode = keyCodes[key];
  74485. var keyName = keyNames[key];
  74486. return (
  74487. "_k($event.keyCode," +
  74488. (JSON.stringify(key)) + "," +
  74489. (JSON.stringify(keyCode)) + "," +
  74490. "$event.key," +
  74491. "" + (JSON.stringify(keyName)) +
  74492. ")"
  74493. )
  74494. }
  74495. /* */
  74496. function on (el, dir) {
  74497. if (dir.modifiers) {
  74498. warn("v-on without argument does not support modifiers.");
  74499. }
  74500. el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); };
  74501. }
  74502. /* */
  74503. function bind$1 (el, dir) {
  74504. el.wrapData = function (code) {
  74505. return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")")
  74506. };
  74507. }
  74508. /* */
  74509. var baseDirectives = {
  74510. on: on,
  74511. bind: bind$1,
  74512. cloak: noop
  74513. };
  74514. /* */
  74515. var CodegenState = function CodegenState (options) {
  74516. this.options = options;
  74517. this.warn = options.warn || baseWarn;
  74518. this.transforms = pluckModuleFunction(options.modules, 'transformCode');
  74519. this.dataGenFns = pluckModuleFunction(options.modules, 'genData');
  74520. this.directives = extend(extend({}, baseDirectives), options.directives);
  74521. var isReservedTag = options.isReservedTag || no;
  74522. this.maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };
  74523. this.onceId = 0;
  74524. this.staticRenderFns = [];
  74525. this.pre = false;
  74526. };
  74527. function generate (
  74528. ast,
  74529. options
  74530. ) {
  74531. var state = new CodegenState(options);
  74532. var code = ast ? genElement(ast, state) : '_c("div")';
  74533. return {
  74534. render: ("with(this){return " + code + "}"),
  74535. staticRenderFns: state.staticRenderFns
  74536. }
  74537. }
  74538. function genElement (el, state) {
  74539. if (el.parent) {
  74540. el.pre = el.pre || el.parent.pre;
  74541. }
  74542. if (el.staticRoot && !el.staticProcessed) {
  74543. return genStatic(el, state)
  74544. } else if (el.once && !el.onceProcessed) {
  74545. return genOnce(el, state)
  74546. } else if (el.for && !el.forProcessed) {
  74547. return genFor(el, state)
  74548. } else if (el.if && !el.ifProcessed) {
  74549. return genIf(el, state)
  74550. } else if (el.tag === 'template' && !el.slotTarget && !state.pre) {
  74551. return genChildren(el, state) || 'void 0'
  74552. } else if (el.tag === 'slot') {
  74553. return genSlot(el, state)
  74554. } else {
  74555. // component or element
  74556. var code;
  74557. if (el.component) {
  74558. code = genComponent(el.component, el, state);
  74559. } else {
  74560. var data;
  74561. if (!el.plain || (el.pre && state.maybeComponent(el))) {
  74562. data = genData$2(el, state);
  74563. }
  74564. var children = el.inlineTemplate ? null : genChildren(el, state, true);
  74565. code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")";
  74566. }
  74567. // module transforms
  74568. for (var i = 0; i < state.transforms.length; i++) {
  74569. code = state.transforms[i](el, code);
  74570. }
  74571. return code
  74572. }
  74573. }
  74574. // hoist static sub-trees out
  74575. function genStatic (el, state) {
  74576. el.staticProcessed = true;
  74577. // Some elements (templates) need to behave differently inside of a v-pre
  74578. // node. All pre nodes are static roots, so we can use this as a location to
  74579. // wrap a state change and reset it upon exiting the pre node.
  74580. var originalPreState = state.pre;
  74581. if (el.pre) {
  74582. state.pre = el.pre;
  74583. }
  74584. state.staticRenderFns.push(("with(this){return " + (genElement(el, state)) + "}"));
  74585. state.pre = originalPreState;
  74586. return ("_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
  74587. }
  74588. // v-once
  74589. function genOnce (el, state) {
  74590. el.onceProcessed = true;
  74591. if (el.if && !el.ifProcessed) {
  74592. return genIf(el, state)
  74593. } else if (el.staticInFor) {
  74594. var key = '';
  74595. var parent = el.parent;
  74596. while (parent) {
  74597. if (parent.for) {
  74598. key = parent.key;
  74599. break
  74600. }
  74601. parent = parent.parent;
  74602. }
  74603. if (!key) {
  74604. state.warn(
  74605. "v-once can only be used inside v-for that is keyed. ",
  74606. el.rawAttrsMap['v-once']
  74607. );
  74608. return genElement(el, state)
  74609. }
  74610. return ("_o(" + (genElement(el, state)) + "," + (state.onceId++) + "," + key + ")")
  74611. } else {
  74612. return genStatic(el, state)
  74613. }
  74614. }
  74615. function genIf (
  74616. el,
  74617. state,
  74618. altGen,
  74619. altEmpty
  74620. ) {
  74621. el.ifProcessed = true; // avoid recursion
  74622. return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty)
  74623. }
  74624. function genIfConditions (
  74625. conditions,
  74626. state,
  74627. altGen,
  74628. altEmpty
  74629. ) {
  74630. if (!conditions.length) {
  74631. return altEmpty || '_e()'
  74632. }
  74633. var condition = conditions.shift();
  74634. if (condition.exp) {
  74635. return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions, state, altGen, altEmpty)))
  74636. } else {
  74637. return ("" + (genTernaryExp(condition.block)))
  74638. }
  74639. // v-if with v-once should generate code like (a)?_m(0):_m(1)
  74640. function genTernaryExp (el) {
  74641. return altGen
  74642. ? altGen(el, state)
  74643. : el.once
  74644. ? genOnce(el, state)
  74645. : genElement(el, state)
  74646. }
  74647. }
  74648. function genFor (
  74649. el,
  74650. state,
  74651. altGen,
  74652. altHelper
  74653. ) {
  74654. var exp = el.for;
  74655. var alias = el.alias;
  74656. var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
  74657. var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
  74658. if (state.maybeComponent(el) &&
  74659. el.tag !== 'slot' &&
  74660. el.tag !== 'template' &&
  74661. !el.key
  74662. ) {
  74663. state.warn(
  74664. "<" + (el.tag) + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " +
  74665. "v-for should have explicit keys. " +
  74666. "See https://vuejs.org/guide/list.html#key for more info.",
  74667. el.rawAttrsMap['v-for'],
  74668. true /* tip */
  74669. );
  74670. }
  74671. el.forProcessed = true; // avoid recursion
  74672. return (altHelper || '_l') + "((" + exp + ")," +
  74673. "function(" + alias + iterator1 + iterator2 + "){" +
  74674. "return " + ((altGen || genElement)(el, state)) +
  74675. '})'
  74676. }
  74677. function genData$2 (el, state) {
  74678. var data = '{';
  74679. // directives first.
  74680. // directives may mutate the el's other properties before they are generated.
  74681. var dirs = genDirectives(el, state);
  74682. if (dirs) { data += dirs + ','; }
  74683. // key
  74684. if (el.key) {
  74685. data += "key:" + (el.key) + ",";
  74686. }
  74687. // ref
  74688. if (el.ref) {
  74689. data += "ref:" + (el.ref) + ",";
  74690. }
  74691. if (el.refInFor) {
  74692. data += "refInFor:true,";
  74693. }
  74694. // pre
  74695. if (el.pre) {
  74696. data += "pre:true,";
  74697. }
  74698. // record original tag name for components using "is" attribute
  74699. if (el.component) {
  74700. data += "tag:\"" + (el.tag) + "\",";
  74701. }
  74702. // module data generation functions
  74703. for (var i = 0; i < state.dataGenFns.length; i++) {
  74704. data += state.dataGenFns[i](el);
  74705. }
  74706. // attributes
  74707. if (el.attrs) {
  74708. data += "attrs:" + (genProps(el.attrs)) + ",";
  74709. }
  74710. // DOM props
  74711. if (el.props) {
  74712. data += "domProps:" + (genProps(el.props)) + ",";
  74713. }
  74714. // event handlers
  74715. if (el.events) {
  74716. data += (genHandlers(el.events, false)) + ",";
  74717. }
  74718. if (el.nativeEvents) {
  74719. data += (genHandlers(el.nativeEvents, true)) + ",";
  74720. }
  74721. // slot target
  74722. // only for non-scoped slots
  74723. if (el.slotTarget && !el.slotScope) {
  74724. data += "slot:" + (el.slotTarget) + ",";
  74725. }
  74726. // scoped slots
  74727. if (el.scopedSlots) {
  74728. data += (genScopedSlots(el, el.scopedSlots, state)) + ",";
  74729. }
  74730. // component v-model
  74731. if (el.model) {
  74732. data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},";
  74733. }
  74734. // inline-template
  74735. if (el.inlineTemplate) {
  74736. var inlineTemplate = genInlineTemplate(el, state);
  74737. if (inlineTemplate) {
  74738. data += inlineTemplate + ",";
  74739. }
  74740. }
  74741. data = data.replace(/,$/, '') + '}';
  74742. // v-bind dynamic argument wrap
  74743. // v-bind with dynamic arguments must be applied using the same v-bind object
  74744. // merge helper so that class/style/mustUseProp attrs are handled correctly.
  74745. if (el.dynamicAttrs) {
  74746. data = "_b(" + data + ",\"" + (el.tag) + "\"," + (genProps(el.dynamicAttrs)) + ")";
  74747. }
  74748. // v-bind data wrap
  74749. if (el.wrapData) {
  74750. data = el.wrapData(data);
  74751. }
  74752. // v-on data wrap
  74753. if (el.wrapListeners) {
  74754. data = el.wrapListeners(data);
  74755. }
  74756. return data
  74757. }
  74758. function genDirectives (el, state) {
  74759. var dirs = el.directives;
  74760. if (!dirs) { return }
  74761. var res = 'directives:[';
  74762. var hasRuntime = false;
  74763. var i, l, dir, needRuntime;
  74764. for (i = 0, l = dirs.length; i < l; i++) {
  74765. dir = dirs[i];
  74766. needRuntime = true;
  74767. var gen = state.directives[dir.name];
  74768. if (gen) {
  74769. // compile-time directive that manipulates AST.
  74770. // returns true if it also needs a runtime counterpart.
  74771. needRuntime = !!gen(el, dir, state.warn);
  74772. }
  74773. if (needRuntime) {
  74774. hasRuntime = true;
  74775. res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:" + (dir.isDynamicArg ? dir.arg : ("\"" + (dir.arg) + "\""))) : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},";
  74776. }
  74777. }
  74778. if (hasRuntime) {
  74779. return res.slice(0, -1) + ']'
  74780. }
  74781. }
  74782. function genInlineTemplate (el, state) {
  74783. var ast = el.children[0];
  74784. if (el.children.length !== 1 || ast.type !== 1) {
  74785. state.warn(
  74786. 'Inline-template components must have exactly one child element.',
  74787. { start: el.start }
  74788. );
  74789. }
  74790. if (ast && ast.type === 1) {
  74791. var inlineRenderFns = generate(ast, state.options);
  74792. return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}")
  74793. }
  74794. }
  74795. function genScopedSlots (
  74796. el,
  74797. slots,
  74798. state
  74799. ) {
  74800. // by default scoped slots are considered "stable", this allows child
  74801. // components with only scoped slots to skip forced updates from parent.
  74802. // but in some cases we have to bail-out of this optimization
  74803. // for example if the slot contains dynamic names, has v-if or v-for on them...
  74804. var needsForceUpdate = el.for || Object.keys(slots).some(function (key) {
  74805. var slot = slots[key];
  74806. return (
  74807. slot.slotTargetDynamic ||
  74808. slot.if ||
  74809. slot.for ||
  74810. containsSlotChild(slot) // is passing down slot from parent which may be dynamic
  74811. )
  74812. });
  74813. // #9534: if a component with scoped slots is inside a conditional branch,
  74814. // it's possible for the same component to be reused but with different
  74815. // compiled slot content. To avoid that, we generate a unique key based on
  74816. // the generated code of all the slot contents.
  74817. var needsKey = !!el.if;
  74818. // OR when it is inside another scoped slot or v-for (the reactivity may be
  74819. // disconnected due to the intermediate scope variable)
  74820. // #9438, #9506
  74821. // TODO: this can be further optimized by properly analyzing in-scope bindings
  74822. // and skip force updating ones that do not actually use scope variables.
  74823. if (!needsForceUpdate) {
  74824. var parent = el.parent;
  74825. while (parent) {
  74826. if (
  74827. (parent.slotScope && parent.slotScope !== emptySlotScopeToken) ||
  74828. parent.for
  74829. ) {
  74830. needsForceUpdate = true;
  74831. break
  74832. }
  74833. if (parent.if) {
  74834. needsKey = true;
  74835. }
  74836. parent = parent.parent;
  74837. }
  74838. }
  74839. var generatedSlots = Object.keys(slots)
  74840. .map(function (key) { return genScopedSlot(slots[key], state); })
  74841. .join(',');
  74842. return ("scopedSlots:_u([" + generatedSlots + "]" + (needsForceUpdate ? ",null,true" : "") + (!needsForceUpdate && needsKey ? (",null,false," + (hash(generatedSlots))) : "") + ")")
  74843. }
  74844. function hash(str) {
  74845. var hash = 5381;
  74846. var i = str.length;
  74847. while(i) {
  74848. hash = (hash * 33) ^ str.charCodeAt(--i);
  74849. }
  74850. return hash >>> 0
  74851. }
  74852. function containsSlotChild (el) {
  74853. if (el.type === 1) {
  74854. if (el.tag === 'slot') {
  74855. return true
  74856. }
  74857. return el.children.some(containsSlotChild)
  74858. }
  74859. return false
  74860. }
  74861. function genScopedSlot (
  74862. el,
  74863. state
  74864. ) {
  74865. var isLegacySyntax = el.attrsMap['slot-scope'];
  74866. if (el.if && !el.ifProcessed && !isLegacySyntax) {
  74867. return genIf(el, state, genScopedSlot, "null")
  74868. }
  74869. if (el.for && !el.forProcessed) {
  74870. return genFor(el, state, genScopedSlot)
  74871. }
  74872. var slotScope = el.slotScope === emptySlotScopeToken
  74873. ? ""
  74874. : String(el.slotScope);
  74875. var fn = "function(" + slotScope + "){" +
  74876. "return " + (el.tag === 'template'
  74877. ? el.if && isLegacySyntax
  74878. ? ("(" + (el.if) + ")?" + (genChildren(el, state) || 'undefined') + ":undefined")
  74879. : genChildren(el, state) || 'undefined'
  74880. : genElement(el, state)) + "}";
  74881. // reverse proxy v-slot without scope on this.$slots
  74882. var reverseProxy = slotScope ? "" : ",proxy:true";
  74883. return ("{key:" + (el.slotTarget || "\"default\"") + ",fn:" + fn + reverseProxy + "}")
  74884. }
  74885. function genChildren (
  74886. el,
  74887. state,
  74888. checkSkip,
  74889. altGenElement,
  74890. altGenNode
  74891. ) {
  74892. var children = el.children;
  74893. if (children.length) {
  74894. var el$1 = children[0];
  74895. // optimize single v-for
  74896. if (children.length === 1 &&
  74897. el$1.for &&
  74898. el$1.tag !== 'template' &&
  74899. el$1.tag !== 'slot'
  74900. ) {
  74901. var normalizationType = checkSkip
  74902. ? state.maybeComponent(el$1) ? ",1" : ",0"
  74903. : "";
  74904. return ("" + ((altGenElement || genElement)(el$1, state)) + normalizationType)
  74905. }
  74906. var normalizationType$1 = checkSkip
  74907. ? getNormalizationType(children, state.maybeComponent)
  74908. : 0;
  74909. var gen = altGenNode || genNode;
  74910. return ("[" + (children.map(function (c) { return gen(c, state); }).join(',')) + "]" + (normalizationType$1 ? ("," + normalizationType$1) : ''))
  74911. }
  74912. }
  74913. // determine the normalization needed for the children array.
  74914. // 0: no normalization needed
  74915. // 1: simple normalization needed (possible 1-level deep nested array)
  74916. // 2: full normalization needed
  74917. function getNormalizationType (
  74918. children,
  74919. maybeComponent
  74920. ) {
  74921. var res = 0;
  74922. for (var i = 0; i < children.length; i++) {
  74923. var el = children[i];
  74924. if (el.type !== 1) {
  74925. continue
  74926. }
  74927. if (needsNormalization(el) ||
  74928. (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
  74929. res = 2;
  74930. break
  74931. }
  74932. if (maybeComponent(el) ||
  74933. (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
  74934. res = 1;
  74935. }
  74936. }
  74937. return res
  74938. }
  74939. function needsNormalization (el) {
  74940. return el.for !== undefined || el.tag === 'template' || el.tag === 'slot'
  74941. }
  74942. function genNode (node, state) {
  74943. if (node.type === 1) {
  74944. return genElement(node, state)
  74945. } else if (node.type === 3 && node.isComment) {
  74946. return genComment(node)
  74947. } else {
  74948. return genText(node)
  74949. }
  74950. }
  74951. function genText (text) {
  74952. return ("_v(" + (text.type === 2
  74953. ? text.expression // no need for () because already wrapped in _s()
  74954. : transformSpecialNewlines(JSON.stringify(text.text))) + ")")
  74955. }
  74956. function genComment (comment) {
  74957. return ("_e(" + (JSON.stringify(comment.text)) + ")")
  74958. }
  74959. function genSlot (el, state) {
  74960. var slotName = el.slotName || '"default"';
  74961. var children = genChildren(el, state);
  74962. var res = "_t(" + slotName + (children ? ("," + children) : '');
  74963. var attrs = el.attrs || el.dynamicAttrs
  74964. ? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({
  74965. // slot props are camelized
  74966. name: camelize(attr.name),
  74967. value: attr.value,
  74968. dynamic: attr.dynamic
  74969. }); }))
  74970. : null;
  74971. var bind$$1 = el.attrsMap['v-bind'];
  74972. if ((attrs || bind$$1) && !children) {
  74973. res += ",null";
  74974. }
  74975. if (attrs) {
  74976. res += "," + attrs;
  74977. }
  74978. if (bind$$1) {
  74979. res += (attrs ? '' : ',null') + "," + bind$$1;
  74980. }
  74981. return res + ')'
  74982. }
  74983. // componentName is el.component, take it as argument to shun flow's pessimistic refinement
  74984. function genComponent (
  74985. componentName,
  74986. el,
  74987. state
  74988. ) {
  74989. var children = el.inlineTemplate ? null : genChildren(el, state, true);
  74990. return ("_c(" + componentName + "," + (genData$2(el, state)) + (children ? ("," + children) : '') + ")")
  74991. }
  74992. function genProps (props) {
  74993. var staticProps = "";
  74994. var dynamicProps = "";
  74995. for (var i = 0; i < props.length; i++) {
  74996. var prop = props[i];
  74997. var value = transformSpecialNewlines(prop.value);
  74998. if (prop.dynamic) {
  74999. dynamicProps += (prop.name) + "," + value + ",";
  75000. } else {
  75001. staticProps += "\"" + (prop.name) + "\":" + value + ",";
  75002. }
  75003. }
  75004. staticProps = "{" + (staticProps.slice(0, -1)) + "}";
  75005. if (dynamicProps) {
  75006. return ("_d(" + staticProps + ",[" + (dynamicProps.slice(0, -1)) + "])")
  75007. } else {
  75008. return staticProps
  75009. }
  75010. }
  75011. // #3895, #4268
  75012. function transformSpecialNewlines (text) {
  75013. return text
  75014. .replace(/\u2028/g, '\\u2028')
  75015. .replace(/\u2029/g, '\\u2029')
  75016. }
  75017. /* */
  75018. // these keywords should not appear inside expressions, but operators like
  75019. // typeof, instanceof and in are allowed
  75020. var prohibitedKeywordRE = new RegExp('\\b' + (
  75021. 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' +
  75022. 'super,throw,while,yield,delete,export,import,return,switch,default,' +
  75023. 'extends,finally,continue,debugger,function,arguments'
  75024. ).split(',').join('\\b|\\b') + '\\b');
  75025. // these unary operators should not be used as property/method names
  75026. var unaryOperatorsRE = new RegExp('\\b' + (
  75027. 'delete,typeof,void'
  75028. ).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)');
  75029. // strip strings in expressions
  75030. var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
  75031. // detect problematic expressions in a template
  75032. function detectErrors (ast, warn) {
  75033. if (ast) {
  75034. checkNode(ast, warn);
  75035. }
  75036. }
  75037. function checkNode (node, warn) {
  75038. if (node.type === 1) {
  75039. for (var name in node.attrsMap) {
  75040. if (dirRE.test(name)) {
  75041. var value = node.attrsMap[name];
  75042. if (value) {
  75043. var range = node.rawAttrsMap[name];
  75044. if (name === 'v-for') {
  75045. checkFor(node, ("v-for=\"" + value + "\""), warn, range);
  75046. } else if (name === 'v-slot' || name[0] === '#') {
  75047. checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range);
  75048. } else if (onRE.test(name)) {
  75049. checkEvent(value, (name + "=\"" + value + "\""), warn, range);
  75050. } else {
  75051. checkExpression(value, (name + "=\"" + value + "\""), warn, range);
  75052. }
  75053. }
  75054. }
  75055. }
  75056. if (node.children) {
  75057. for (var i = 0; i < node.children.length; i++) {
  75058. checkNode(node.children[i], warn);
  75059. }
  75060. }
  75061. } else if (node.type === 2) {
  75062. checkExpression(node.expression, node.text, warn, node);
  75063. }
  75064. }
  75065. function checkEvent (exp, text, warn, range) {
  75066. var stripped = exp.replace(stripStringRE, '');
  75067. var keywordMatch = stripped.match(unaryOperatorsRE);
  75068. if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
  75069. warn(
  75070. "avoid using JavaScript unary operator as property name: " +
  75071. "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()),
  75072. range
  75073. );
  75074. }
  75075. checkExpression(exp, text, warn, range);
  75076. }
  75077. function checkFor (node, text, warn, range) {
  75078. checkExpression(node.for || '', text, warn, range);
  75079. checkIdentifier(node.alias, 'v-for alias', text, warn, range);
  75080. checkIdentifier(node.iterator1, 'v-for iterator', text, warn, range);
  75081. checkIdentifier(node.iterator2, 'v-for iterator', text, warn, range);
  75082. }
  75083. function checkIdentifier (
  75084. ident,
  75085. type,
  75086. text,
  75087. warn,
  75088. range
  75089. ) {
  75090. if (typeof ident === 'string') {
  75091. try {
  75092. new Function(("var " + ident + "=_"));
  75093. } catch (e) {
  75094. warn(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())), range);
  75095. }
  75096. }
  75097. }
  75098. function checkExpression (exp, text, warn, range) {
  75099. try {
  75100. new Function(("return " + exp));
  75101. } catch (e) {
  75102. var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE);
  75103. if (keywordMatch) {
  75104. warn(
  75105. "avoid using JavaScript keyword as property name: " +
  75106. "\"" + (keywordMatch[0]) + "\"\n Raw expression: " + (text.trim()),
  75107. range
  75108. );
  75109. } else {
  75110. warn(
  75111. "invalid expression: " + (e.message) + " in\n\n" +
  75112. " " + exp + "\n\n" +
  75113. " Raw expression: " + (text.trim()) + "\n",
  75114. range
  75115. );
  75116. }
  75117. }
  75118. }
  75119. function checkFunctionParameterExpression (exp, text, warn, range) {
  75120. try {
  75121. new Function(exp, '');
  75122. } catch (e) {
  75123. warn(
  75124. "invalid function parameter expression: " + (e.message) + " in\n\n" +
  75125. " " + exp + "\n\n" +
  75126. " Raw expression: " + (text.trim()) + "\n",
  75127. range
  75128. );
  75129. }
  75130. }
  75131. /* */
  75132. var range = 2;
  75133. function generateCodeFrame (
  75134. source,
  75135. start,
  75136. end
  75137. ) {
  75138. if ( start === void 0 ) start = 0;
  75139. if ( end === void 0 ) end = source.length;
  75140. var lines = source.split(/\r?\n/);
  75141. var count = 0;
  75142. var res = [];
  75143. for (var i = 0; i < lines.length; i++) {
  75144. count += lines[i].length + 1;
  75145. if (count >= start) {
  75146. for (var j = i - range; j <= i + range || end > count; j++) {
  75147. if (j < 0 || j >= lines.length) { continue }
  75148. res.push(("" + (j + 1) + (repeat$1(" ", 3 - String(j + 1).length)) + "| " + (lines[j])));
  75149. var lineLength = lines[j].length;
  75150. if (j === i) {
  75151. // push underline
  75152. var pad = start - (count - lineLength) + 1;
  75153. var length = end > count ? lineLength - pad : end - start;
  75154. res.push(" | " + repeat$1(" ", pad) + repeat$1("^", length));
  75155. } else if (j > i) {
  75156. if (end > count) {
  75157. var length$1 = Math.min(end - count, lineLength);
  75158. res.push(" | " + repeat$1("^", length$1));
  75159. }
  75160. count += lineLength + 1;
  75161. }
  75162. }
  75163. break
  75164. }
  75165. }
  75166. return res.join('\n')
  75167. }
  75168. function repeat$1 (str, n) {
  75169. var result = '';
  75170. if (n > 0) {
  75171. while (true) { // eslint-disable-line
  75172. if (n & 1) { result += str; }
  75173. n >>>= 1;
  75174. if (n <= 0) { break }
  75175. str += str;
  75176. }
  75177. }
  75178. return result
  75179. }
  75180. /* */
  75181. function createFunction (code, errors) {
  75182. try {
  75183. return new Function(code)
  75184. } catch (err) {
  75185. errors.push({ err: err, code: code });
  75186. return noop
  75187. }
  75188. }
  75189. function createCompileToFunctionFn (compile) {
  75190. var cache = Object.create(null);
  75191. return function compileToFunctions (
  75192. template,
  75193. options,
  75194. vm
  75195. ) {
  75196. options = extend({}, options);
  75197. var warn$$1 = options.warn || warn;
  75198. delete options.warn;
  75199. /* istanbul ignore if */
  75200. {
  75201. // detect possible CSP restriction
  75202. try {
  75203. new Function('return 1');
  75204. } catch (e) {
  75205. if (e.toString().match(/unsafe-eval|CSP/)) {
  75206. warn$$1(
  75207. 'It seems you are using the standalone build of Vue.js in an ' +
  75208. 'environment with Content Security Policy that prohibits unsafe-eval. ' +
  75209. 'The template compiler cannot work in this environment. Consider ' +
  75210. 'relaxing the policy to allow unsafe-eval or pre-compiling your ' +
  75211. 'templates into render functions.'
  75212. );
  75213. }
  75214. }
  75215. }
  75216. // check cache
  75217. var key = options.delimiters
  75218. ? String(options.delimiters) + template
  75219. : template;
  75220. if (cache[key]) {
  75221. return cache[key]
  75222. }
  75223. // compile
  75224. var compiled = compile(template, options);
  75225. // check compilation errors/tips
  75226. {
  75227. if (compiled.errors && compiled.errors.length) {
  75228. if (options.outputSourceRange) {
  75229. compiled.errors.forEach(function (e) {
  75230. warn$$1(
  75231. "Error compiling template:\n\n" + (e.msg) + "\n\n" +
  75232. generateCodeFrame(template, e.start, e.end),
  75233. vm
  75234. );
  75235. });
  75236. } else {
  75237. warn$$1(
  75238. "Error compiling template:\n\n" + template + "\n\n" +
  75239. compiled.errors.map(function (e) { return ("- " + e); }).join('\n') + '\n',
  75240. vm
  75241. );
  75242. }
  75243. }
  75244. if (compiled.tips && compiled.tips.length) {
  75245. if (options.outputSourceRange) {
  75246. compiled.tips.forEach(function (e) { return tip(e.msg, vm); });
  75247. } else {
  75248. compiled.tips.forEach(function (msg) { return tip(msg, vm); });
  75249. }
  75250. }
  75251. }
  75252. // turn code into functions
  75253. var res = {};
  75254. var fnGenErrors = [];
  75255. res.render = createFunction(compiled.render, fnGenErrors);
  75256. res.staticRenderFns = compiled.staticRenderFns.map(function (code) {
  75257. return createFunction(code, fnGenErrors)
  75258. });
  75259. // check function generation errors.
  75260. // this should only happen if there is a bug in the compiler itself.
  75261. // mostly for codegen development use
  75262. /* istanbul ignore if */
  75263. {
  75264. if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) {
  75265. warn$$1(
  75266. "Failed to generate render function:\n\n" +
  75267. fnGenErrors.map(function (ref) {
  75268. var err = ref.err;
  75269. var code = ref.code;
  75270. return ((err.toString()) + " in\n\n" + code + "\n");
  75271. }).join('\n'),
  75272. vm
  75273. );
  75274. }
  75275. }
  75276. return (cache[key] = res)
  75277. }
  75278. }
  75279. /* */
  75280. function createCompilerCreator (baseCompile) {
  75281. return function createCompiler (baseOptions) {
  75282. function compile (
  75283. template,
  75284. options
  75285. ) {
  75286. var finalOptions = Object.create(baseOptions);
  75287. var errors = [];
  75288. var tips = [];
  75289. var warn = function (msg, range, tip) {
  75290. (tip ? tips : errors).push(msg);
  75291. };
  75292. if (options) {
  75293. if (options.outputSourceRange) {
  75294. // $flow-disable-line
  75295. var leadingSpaceLength = template.match(/^\s*/)[0].length;
  75296. warn = function (msg, range, tip) {
  75297. var data = { msg: msg };
  75298. if (range) {
  75299. if (range.start != null) {
  75300. data.start = range.start + leadingSpaceLength;
  75301. }
  75302. if (range.end != null) {
  75303. data.end = range.end + leadingSpaceLength;
  75304. }
  75305. }
  75306. (tip ? tips : errors).push(data);
  75307. };
  75308. }
  75309. // merge custom modules
  75310. if (options.modules) {
  75311. finalOptions.modules =
  75312. (baseOptions.modules || []).concat(options.modules);
  75313. }
  75314. // merge custom directives
  75315. if (options.directives) {
  75316. finalOptions.directives = extend(
  75317. Object.create(baseOptions.directives || null),
  75318. options.directives
  75319. );
  75320. }
  75321. // copy other options
  75322. for (var key in options) {
  75323. if (key !== 'modules' && key !== 'directives') {
  75324. finalOptions[key] = options[key];
  75325. }
  75326. }
  75327. }
  75328. finalOptions.warn = warn;
  75329. var compiled = baseCompile(template.trim(), finalOptions);
  75330. {
  75331. detectErrors(compiled.ast, warn);
  75332. }
  75333. compiled.errors = errors;
  75334. compiled.tips = tips;
  75335. return compiled
  75336. }
  75337. return {
  75338. compile: compile,
  75339. compileToFunctions: createCompileToFunctionFn(compile)
  75340. }
  75341. }
  75342. }
  75343. /* */
  75344. // `createCompilerCreator` allows creating compilers that use alternative
  75345. // parser/optimizer/codegen, e.g the SSR optimizing compiler.
  75346. // Here we just export a default compiler using the default parts.
  75347. var createCompiler = createCompilerCreator(function baseCompile (
  75348. template,
  75349. options
  75350. ) {
  75351. var ast = parse(template.trim(), options);
  75352. if (options.optimize !== false) {
  75353. optimize(ast, options);
  75354. }
  75355. var code = generate(ast, options);
  75356. return {
  75357. ast: ast,
  75358. render: code.render,
  75359. staticRenderFns: code.staticRenderFns
  75360. }
  75361. });
  75362. /* */
  75363. var ref$1 = createCompiler(baseOptions);
  75364. var compile = ref$1.compile;
  75365. var compileToFunctions = ref$1.compileToFunctions;
  75366. /* */
  75367. // check whether current browser encodes a char inside attribute values
  75368. var div;
  75369. function getShouldDecode (href) {
  75370. div = div || document.createElement('div');
  75371. div.innerHTML = href ? "<a href=\"\n\"/>" : "<div a=\"\n\"/>";
  75372. return div.innerHTML.indexOf('&#10;') > 0
  75373. }
  75374. // #3663: IE encodes newlines inside attribute values while other browsers don't
  75375. var shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false;
  75376. // #6828: chrome encodes content in a[href]
  75377. var shouldDecodeNewlinesForHref = inBrowser ? getShouldDecode(true) : false;
  75378. /* */
  75379. var idToTemplate = cached(function (id) {
  75380. var el = query(id);
  75381. return el && el.innerHTML
  75382. });
  75383. var mount = Vue.prototype.$mount;
  75384. Vue.prototype.$mount = function (
  75385. el,
  75386. hydrating
  75387. ) {
  75388. el = el && query(el);
  75389. /* istanbul ignore if */
  75390. if (el === document.body || el === document.documentElement) {
  75391. warn(
  75392. "Do not mount Vue to <html> or <body> - mount to normal elements instead."
  75393. );
  75394. return this
  75395. }
  75396. var options = this.$options;
  75397. // resolve template/el and convert to render function
  75398. if (!options.render) {
  75399. var template = options.template;
  75400. if (template) {
  75401. if (typeof template === 'string') {
  75402. if (template.charAt(0) === '#') {
  75403. template = idToTemplate(template);
  75404. /* istanbul ignore if */
  75405. if (!template) {
  75406. warn(
  75407. ("Template element not found or is empty: " + (options.template)),
  75408. this
  75409. );
  75410. }
  75411. }
  75412. } else if (template.nodeType) {
  75413. template = template.innerHTML;
  75414. } else {
  75415. {
  75416. warn('invalid template option:' + template, this);
  75417. }
  75418. return this
  75419. }
  75420. } else if (el) {
  75421. template = getOuterHTML(el);
  75422. }
  75423. if (template) {
  75424. /* istanbul ignore if */
  75425. if (config.performance && mark) {
  75426. mark('compile');
  75427. }
  75428. var ref = compileToFunctions(template, {
  75429. outputSourceRange: "development" !== 'production',
  75430. shouldDecodeNewlines: shouldDecodeNewlines,
  75431. shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref,
  75432. delimiters: options.delimiters,
  75433. comments: options.comments
  75434. }, this);
  75435. var render = ref.render;
  75436. var staticRenderFns = ref.staticRenderFns;
  75437. options.render = render;
  75438. options.staticRenderFns = staticRenderFns;
  75439. /* istanbul ignore if */
  75440. if (config.performance && mark) {
  75441. mark('compile end');
  75442. measure(("vue " + (this._name) + " compile"), 'compile', 'compile end');
  75443. }
  75444. }
  75445. }
  75446. return mount.call(this, el, hydrating)
  75447. };
  75448. /**
  75449. * Get outerHTML of elements, taking care
  75450. * of SVG elements in IE as well.
  75451. */
  75452. function getOuterHTML (el) {
  75453. if (el.outerHTML) {
  75454. return el.outerHTML
  75455. } else {
  75456. var container = document.createElement('div');
  75457. container.appendChild(el.cloneNode(true));
  75458. return container.innerHTML
  75459. }
  75460. }
  75461. Vue.compile = compileToFunctions;
  75462. module.exports = Vue;
  75463. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../../timers-browserify/main.js */ "./node_modules/timers-browserify/main.js").setImmediate))
  75464. /***/ }),
  75465. /***/ "./node_modules/vue/dist/vue.common.js":
  75466. /*!*********************************************!*\
  75467. !*** ./node_modules/vue/dist/vue.common.js ***!
  75468. \*********************************************/
  75469. /*! no static exports found */
  75470. /***/ (function(module, exports, __webpack_require__) {
  75471. if (false) {} else {
  75472. module.exports = __webpack_require__(/*! ./vue.common.dev.js */ "./node_modules/vue/dist/vue.common.dev.js")
  75473. }
  75474. /***/ }),
  75475. /***/ "./node_modules/webpack/buildin/global.js":
  75476. /*!***********************************!*\
  75477. !*** (webpack)/buildin/global.js ***!
  75478. \***********************************/
  75479. /*! no static exports found */
  75480. /***/ (function(module, exports) {
  75481. var g;
  75482. // This works in non-strict mode
  75483. g = (function() {
  75484. return this;
  75485. })();
  75486. try {
  75487. // This works if eval is allowed (see CSP)
  75488. g = g || new Function("return this")();
  75489. } catch (e) {
  75490. // This works if the window reference is available
  75491. if (typeof window === "object") g = window;
  75492. }
  75493. // g can still be undefined, but nothing to do about it...
  75494. // We return undefined, instead of nothing here, so it's
  75495. // easier to handle this case. if(!global) { ...}
  75496. module.exports = g;
  75497. /***/ }),
  75498. /***/ "./node_modules/webpack/buildin/module.js":
  75499. /*!***********************************!*\
  75500. !*** (webpack)/buildin/module.js ***!
  75501. \***********************************/
  75502. /*! no static exports found */
  75503. /***/ (function(module, exports) {
  75504. module.exports = function(module) {
  75505. if (!module.webpackPolyfill) {
  75506. module.deprecate = function() {};
  75507. module.paths = [];
  75508. // module.parent = undefined by default
  75509. if (!module.children) module.children = [];
  75510. Object.defineProperty(module, "loaded", {
  75511. enumerable: true,
  75512. get: function() {
  75513. return module.l;
  75514. }
  75515. });
  75516. Object.defineProperty(module, "id", {
  75517. enumerable: true,
  75518. get: function() {
  75519. return module.i;
  75520. }
  75521. });
  75522. module.webpackPolyfill = 1;
  75523. }
  75524. return module;
  75525. };
  75526. /***/ }),
  75527. /***/ "./node_modules/yeast/index.js":
  75528. /*!*************************************!*\
  75529. !*** ./node_modules/yeast/index.js ***!
  75530. \*************************************/
  75531. /*! no static exports found */
  75532. /***/ (function(module, exports, __webpack_require__) {
  75533. "use strict";
  75534. var alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split('')
  75535. , length = 64
  75536. , map = {}
  75537. , seed = 0
  75538. , i = 0
  75539. , prev;
  75540. /**
  75541. * Return a string representing the specified number.
  75542. *
  75543. * @param {Number} num The number to convert.
  75544. * @returns {String} The string representation of the number.
  75545. * @api public
  75546. */
  75547. function encode(num) {
  75548. var encoded = '';
  75549. do {
  75550. encoded = alphabet[num % length] + encoded;
  75551. num = Math.floor(num / length);
  75552. } while (num > 0);
  75553. return encoded;
  75554. }
  75555. /**
  75556. * Return the integer value specified by the given string.
  75557. *
  75558. * @param {String} str The string to convert.
  75559. * @returns {Number} The integer value represented by the string.
  75560. * @api public
  75561. */
  75562. function decode(str) {
  75563. var decoded = 0;
  75564. for (i = 0; i < str.length; i++) {
  75565. decoded = decoded * length + map[str.charAt(i)];
  75566. }
  75567. return decoded;
  75568. }
  75569. /**
  75570. * Yeast: A tiny growing id generator.
  75571. *
  75572. * @returns {String} A unique id.
  75573. * @api public
  75574. */
  75575. function yeast() {
  75576. var now = encode(+new Date());
  75577. if (now !== prev) return seed = 0, prev = now;
  75578. return now +'.'+ encode(seed++);
  75579. }
  75580. //
  75581. // Map each character to its index.
  75582. //
  75583. for (; i < length; i++) map[alphabet[i]] = i;
  75584. //
  75585. // Expose the `yeast`, `encode` and `decode` functions.
  75586. //
  75587. yeast.encode = encode;
  75588. yeast.decode = decode;
  75589. module.exports = yeast;
  75590. /***/ }),
  75591. /***/ "./resources/js/app.js":
  75592. /*!*****************************!*\
  75593. !*** ./resources/js/app.js ***!
  75594. \*****************************/
  75595. /*! no static exports found */
  75596. /***/ (function(module, exports, __webpack_require__) {
  75597. __webpack_require__(/*! ./bootstrap */ "./resources/js/bootstrap.js");
  75598. __webpack_require__(/*! ./mounted */ "./resources/js/mounted.js");
  75599. window.Vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.common.js");
  75600. window.tempTip = __webpack_require__(/*! ./utilities/tempTip */ "./resources/js/utilities/tempTip.js");
  75601. window.getGetVal = __webpack_require__(/*! ./utilities/getGetVal */ "./resources/js/utilities/getGetVal.js");
  75602. window.scanner = __webpack_require__(/*! ./utilities/scanner */ "./resources/js/utilities/scanner.js");
  75603. window.datetimeRelating = __webpack_require__(/*! ./utilities/datetimeRelating */ "./resources/js/utilities/datetimeRelating.js");
  75604. __webpack_require__(/*! bootstrap-select */ "./node_modules/bootstrap-select/dist/js/bootstrap-select.js");
  75605. /***/ }),
  75606. /***/ "./resources/js/bootstrap.js":
  75607. /*!***********************************!*\
  75608. !*** ./resources/js/bootstrap.js ***!
  75609. \***********************************/
  75610. /*! no exports provided */
  75611. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  75612. "use strict";
  75613. __webpack_require__.r(__webpack_exports__);
  75614. /* harmony import */ var laravel_echo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! laravel-echo */ "./node_modules/laravel-echo/dist/echo.js");
  75615. window._ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  75616. /**
  75617. * We'll load jQuery and the Bootstrap jQuery plugin which provides support
  75618. * for JavaScript based Bootstrap features such as modals and tabs. This
  75619. * code may be modified to fit the specific needs of your application.
  75620. */
  75621. try {
  75622. window.Popper = __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js")["default"];
  75623. window.$ = window.jQuery = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js");
  75624. window.$.cookie = __webpack_require__(/*! js-cookie */ "./node_modules/js-cookie/src/js.cookie.js");
  75625. __webpack_require__(/*! bootstrap */ "./node_modules/bootstrap/dist/js/bootstrap.js");
  75626. } catch (e) {}
  75627. window.moment = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
  75628. /**
  75629. * We'll load the axios HTTP library which allows us to easily issue requests
  75630. * to our Laravel back-end. This library automatically handles sending the
  75631. * CSRF token as a header based on the value of the "XSRF" token cookie.
  75632. */
  75633. window.axios = __webpack_require__(/*! axios */ "./node_modules/axios/index.js");
  75634. window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
  75635. /**
  75636. * Next we will register the CSRF Token as a common header with Axios so that
  75637. * all outgoing HTTP requests automatically have it attached. This is just
  75638. * a simple convenience so we don't have to attach every token manually.
  75639. */
  75640. var token = document.head.querySelector('meta[name="csrf-token"]');
  75641. if (token) {
  75642. window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
  75643. } else {
  75644. console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
  75645. }
  75646. /**
  75647. * Echo exposes an expressive API for subscribing to channels and listening
  75648. * for events that are broadcast by Laravel. Echo and event broadcasting
  75649. * allows your team to easily build robust real-time web applications.
  75650. */
  75651. //
  75652. // const client = require('pusher-js');
  75653. window.io = __webpack_require__(/*! socket.io-client */ "./node_modules/socket.io-client/lib/index.js");
  75654. window.initEcho = function () {
  75655. window.Echo = new laravel_echo__WEBPACK_IMPORTED_MODULE_0__["default"]({
  75656. broadcaster: 'socket.io',
  75657. host: window.location.hostname + ':6001' //broadcaster: 'pusher',
  75658. // key: process.env.MIX_PUSHER_APP_KEY,
  75659. // key: 'bo20alg-1',
  75660. // authEndpoint: '/custom/endpoint/auth',
  75661. // cluster: process.env.MIX_PUSHER_APP_CLUSTER,
  75662. // encrypted: true,
  75663. // client:client
  75664. });
  75665. };
  75666. /***/ }),
  75667. /***/ "./resources/js/mounted.js":
  75668. /*!*********************************!*\
  75669. !*** ./resources/js/mounted.js ***!
  75670. \*********************************/
  75671. /*! no static exports found */
  75672. /***/ (function(module, exports) {
  75673. //解决input number类型上下滚动 禁用滚轮事件
  75674. setTimeout(function () {
  75675. for (var i = 0; i < $("input[type='number']").length; i++) {
  75676. $("input[type='number']")[i].setAttribute('onmousewheel', 'return false'); //禁止谷歌浏览器、Opera浏览器以及360浏览器等采用谷歌内核的浏览器
  75677. $("input[type='number']")[i].addEventListener('DOMMouseScroll', MouseWheel, false); //禁止Firefox浏览器
  75678. }
  75679. }, 100);
  75680. function MouseWheel(event) {
  75681. event = event || window.event;
  75682. event.preventDefault();
  75683. }
  75684. /***/ }),
  75685. /***/ "./resources/js/utilities/datetimeRelating.js":
  75686. /*!****************************************************!*\
  75687. !*** ./resources/js/utilities/datetimeRelating.js ***!
  75688. \****************************************************/
  75689. /*! no static exports found */
  75690. /***/ (function(module, exports) {
  75691. var datetime = {
  75692. verifyTime: function verifyTime(time) {
  75693. setTimeout(function () {
  75694. time.target.value = time.target.value.replace(':', ':');
  75695. time.target.value = time.target.value.replace(/[a-zA-Z]/, '');
  75696. time.target.value = time.target.value.replace(/^([\d]{1})([\s]{1})/, "$1:");
  75697. time.target.value = time.target.value.replace(/^([\d]{1})([\d]{1})([\s]{1})/, "$1$2:");
  75698. time.target.value = time.target.value.replace(/^([\d]{1})([\d]{1})([\d]{1})/, "$1$2:$3");
  75699. time.target.value = time.target.value.replace(/^([\d]{1})([\d]{1})([\d]{1})([\d]{1})(.*?)/, "$1$2$3$4");
  75700. time.target.value = time.target.value.replace(/^([\d]{1})([\d]{1})([\d]{1})([\d]{1})/, "$1$2:$3$4");
  75701. time.target.value = time.target.value.replace(/^([\d]{1})([\d]{1}):([\d]{1})([\d]{1})([\s\S]{1})/, "$1$2:$3$4");
  75702. time.target.value = time.target.value.replace(/^([\d]{1})([\d]{1}):([\D]{1,99})/, "$1$2:");
  75703. time.target.value = time.target.value.replace(/^([\d]{1})([\d]{1})([\d]{1})\./, "$1:$2$3");
  75704. time.target.value = time.target.value.replace(/^([\d]{1})\.([\d]{1})([\d]{1})/, "$1:$2$3");
  75705. time.target.value = time.target.value.replace(/^([\d]{1})([\d]{2})([\S\s]{1,99})/, "$1$2:$3");
  75706. time.target.value = time.target.value.replace(/^([\d]{1}):([\d]{2})([\S\s]{1,99})/, "$1:$2");
  75707. time.target.value = time.target.value.replace(/^([\d])/, "$1");
  75708. time.target.value = time.target.value.replace(/^([1])([\d]{1})/, "$1$2");
  75709. time.target.value = time.target.value.replace(/^([3-9])([\d]{1})/, "2$2");
  75710. time.target.value = time.target.value.replace(/^([2-9]{1})([4-9]{1})/, "$13");
  75711. time.target.value = time.target.value.replace(/^([\d]{1})([\d]{1}):([6-9]{1})/, "$1$2:5");
  75712. time.target.value = time.target.value.replace(/^([\d]{1})([\d]{1})$/, "$1$2:");
  75713. }, 10);
  75714. }
  75715. };
  75716. module.exports = datetime;
  75717. /***/ }),
  75718. /***/ "./resources/js/utilities/getGetVal.js":
  75719. /*!*********************************************!*\
  75720. !*** ./resources/js/utilities/getGetVal.js ***!
  75721. \*********************************************/
  75722. /*! no static exports found */
  75723. /***/ (function(module, exports) {
  75724. var get = function get(name) {
  75725. var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
  75726. var r = window.location.search.substr(1).match(reg);
  75727. if (r != null) {
  75728. return unescape(r[2]);
  75729. }
  75730. return null;
  75731. };
  75732. module.exports = get;
  75733. /***/ }),
  75734. /***/ "./resources/js/utilities/scanner.js":
  75735. /*!*******************************************!*\
  75736. !*** ./resources/js/utilities/scanner.js ***!
  75737. \*******************************************/
  75738. /*! no static exports found */
  75739. /***/ (function(module, exports) {
  75740. var scanner = {
  75741. /**
  75742. * 监听document的扫描枪活动,扫描后调用doFunc执行,doFunc(str)
  75743. * str是扫到的内容,在doFunc内执行
  75744. * @param doFunc
  75745. */
  75746. monitorScan: function monitorScan(doFunc) {
  75747. var tightInputInterval = 50;
  75748. var leastCodeLength = 3;
  75749. var lastPressedAt = 0;
  75750. var scannedStr = "";
  75751. $(document).on('keyup', function (e) {
  75752. var nowAtMilli = new Date().getTime();
  75753. var inputInterval = nowAtMilli - lastPressedAt;
  75754. if (inputInterval < tightInputInterval) {
  75755. if (e.key !== 'Enter') {
  75756. scannedStr += e.key;
  75757. } else {
  75758. if (scannedStr.length >= leastCodeLength) {
  75759. doFunc(scannedStr);
  75760. }
  75761. scannedStr = '';
  75762. }
  75763. } else {
  75764. if (e.key !== 'Enter') {
  75765. scannedStr = e.key;
  75766. } else {
  75767. scannedStr = '';
  75768. }
  75769. }
  75770. lastPressedAt = nowAtMilli;
  75771. });
  75772. },
  75773. monitorFocusingTarget: function monitorFocusingTarget(doFunc) {
  75774. $('input').on('focus', function (e) {
  75775. doFunc(e.target);
  75776. });
  75777. }
  75778. };
  75779. module.exports = scanner;
  75780. /***/ }),
  75781. /***/ "./resources/js/utilities/tempTip.js":
  75782. /*!*******************************************!*\
  75783. !*** ./resources/js/utilities/tempTip.js ***!
  75784. \*******************************************/
  75785. /*! no static exports found */
  75786. /***/ (function(module, exports) {
  75787. var tempTip = {
  75788. fadingDuration: 4500,
  75789. inputType: 'input',
  75790. index: 99,
  75791. setIndex: function setIndex(index) {
  75792. this.index = parseInt(index);
  75793. },
  75794. setDuration: function setDuration(milliSec) {
  75795. this.fadingDuration = parseInt(milliSec);
  75796. },
  75797. setInputType: function setInputType(type) {
  75798. this.inputType = type;
  75799. },
  75800. showSuccess: function showSuccess(text) {
  75801. var tiper = $("<div class='row' style='color:white;opacity:0.9;position: fixed;top:40%;transform:translateY(-50%);z-index:" + this.index + ";width:100%;'>" + "<div class='col-8 offset-2'><div class='card'><div class='card-body h4 bg-success text-center'>" + text + "</div></div></div></div>");
  75802. tiper.animate({
  75803. opacity: '0'
  75804. }, this.fadingDuration, 'swing', function () {
  75805. tiper.remove();
  75806. });
  75807. $('body').append(tiper);
  75808. },
  75809. show: function show(text) {
  75810. var tiper = $("<div class='row' style='color:white;opacity:0.9;top:40%;position: fixed;transform:translateY(-50%);width:100%;z-index:" + this.index + ";'>" + "<div class='col-8 offset-2'><div class='card'><div class='card-body h2 bg-danger text-center'>" + text + "</div></div></div></div>");
  75811. tiper.animate({
  75812. opacity: '0'
  75813. }, this.fadingDuration, 'swing', function () {
  75814. tiper.remove();
  75815. });
  75816. $('body').append(tiper);
  75817. },
  75818. okWindow: function okWindow(text, okText) {
  75819. var bg = $("<div style='opacity:0.4;position:fixed;top:0;width:100%;height:100%;z-index:" + this.index + ";background-color:#000;'></div>");
  75820. if (typeof okText == 'undefined') okText = '确定';
  75821. var tiper = $("<div class='row' style='opacity:0.9;position:fixed;top:40%;transform:translateY(-50%);width:100%;z-index:" + (this.index + 1) + "'>" + "<div class='col-8 offset-2'><div class='card'><div class='card-body h2 text-center'>" + text + "<p><button class='btn btn-success btn-lg okWindow'>" + okText + "</button></p><div>" + "</div></div></div>");
  75822. tiper.find('.okWindow').on('click', function () {
  75823. tiper.off('click');
  75824. tiper.remove();
  75825. bg.remove();
  75826. });
  75827. $('html').css('height', '100%').append(bg);
  75828. $('body').append(tiper);
  75829. },
  75830. waitingTip: function waitingTip(text) {
  75831. var bg = $("<div style='opacity:0.4;position:fixed;top:0;width:100%;height:100%;z-index:" + this.index + ";background-color:#fff;' class='tipperBg'></div>");
  75832. var tipper = $("<div class='row tipper' style='color:white;opacity:0.9;position:fixed;top:40%;transform:translateY(-50%);width:100%;z-index:" + (this.index + 1) + ";'>" + "<div class='col-8 offset-2'><div class='card-body h5 bg-dark text-center' style='border-radius: 50px'>" + text + "</div></div></div>");
  75833. tipper.animate({
  75834. opacity: '0'
  75835. }, this.fadingDuration, 'swing', function () {
  75836. tipper.remove();
  75837. bg.remove();
  75838. });
  75839. $('html').css('height', '100%').append(bg);
  75840. $('body').append(tipper);
  75841. },
  75842. cancelWaitingTip: function cancelWaitingTip() {
  75843. var bg = $(".tipperBg");
  75844. var tipper = $(".tipper");
  75845. tipper.remove();
  75846. bg.remove();
  75847. },
  75848. confirm: function confirm(text, yesFunc, noFunc, yesText, noText) {
  75849. if (typeof yesText === 'undefined') yesText = '确定';
  75850. if (typeof noText === 'undefined') noText = '取消';
  75851. var bg = $("<div style='opacity:0.4;position:fixed;top:0;width:100%;height:100%;z-index:" + this.index + ";background-color:#000;'></div>");
  75852. var tiper = $("<div class='row' style='color:#000;opacity:0.9;position:fixed;top:40%;transform:translateY(-50%);width:100%;z-index:" + (this.index + 1) + "'>" + "<div class='col-8 offset-2'><div class='card'><div class='card-body'><div class='card-title h4'>" + text + "</div><div class='card-text'><button class='btn btn-dark btn-lg ok'>" + yesText + "</button>" + "<button class='btn btn-success btn-lg cancel ml-4'>" + noText + "</button></div>" + "</div></div></div></div>");
  75853. var $ok = tiper.find('.ok');
  75854. var $cancel = tiper.find('.cancel');
  75855. $ok.on('click', function () {
  75856. $ok.off('click');
  75857. $cancel.off('click');
  75858. tiper.remove();
  75859. bg.remove();
  75860. yesFunc();
  75861. });
  75862. $cancel.on('click', function () {
  75863. $ok.off('click');
  75864. $cancel.off('click');
  75865. tiper.remove();
  75866. bg.remove();
  75867. if (typeof noFunc != 'undefined') noFunc();
  75868. });
  75869. $('html').css('height', '100%').append(bg);
  75870. $('body').append(tiper);
  75871. },
  75872. inputVal: function inputVal(tipText, resultFunc) {
  75873. var bg = $("<div style='opacity:0.4;position:fixed;top:0;width:100%;height:100%;z-index:" + (this.index - 1) + ";background-color:#000;'></div>");
  75874. var tiper = $("<div class='row' style='color:#000;opacity:0.9;position:fixed;top:40%;transform:translateY(-50%);width:100%;z-index:" + this.index + "'>" + "<div class='col-8 offset-2'><div class='card'><div class='card-body'><div class='card-title h5'>" + tipText + "</div><div><input type='" + this.inputType + "' class='input form-control mb-3'/></div>" + "<div class='card-text'><button class='btn btn-outline-success ok'>确定</button></div>" + "</div></div></div></div>");
  75875. var $ok = tiper.find('.ok');
  75876. var $input = tiper.find('.input');
  75877. $ok.on('click', function () {
  75878. $ok.off('click');
  75879. tiper.remove();
  75880. bg.remove();
  75881. resultFunc($input.val());
  75882. });
  75883. $('html').css('height', '100%').append(bg);
  75884. $('body').append(tiper);
  75885. $input.focus();
  75886. }
  75887. };
  75888. module.exports = tempTip;
  75889. /***/ }),
  75890. /***/ "./resources/sass/app.scss":
  75891. /*!*********************************!*\
  75892. !*** ./resources/sass/app.scss ***!
  75893. \*********************************/
  75894. /*! no static exports found */
  75895. /***/ (function(module, exports) {
  75896. // removed by extract-text-webpack-plugin
  75897. /***/ }),
  75898. /***/ 0:
  75899. /*!*************************************************************!*\
  75900. !*** multi ./resources/js/app.js ./resources/sass/app.scss ***!
  75901. \*************************************************************/
  75902. /*! no static exports found */
  75903. /***/ (function(module, exports, __webpack_require__) {
  75904. __webpack_require__(/*! D:\wamp64\www\bswas\resources\js\app.js */"./resources/js/app.js");
  75905. module.exports = __webpack_require__(/*! D:\wamp64\www\bswas\resources\sass\app.scss */"./resources/sass/app.scss");
  75906. /***/ }),
  75907. /***/ 1:
  75908. /*!********************!*\
  75909. !*** ws (ignored) ***!
  75910. \********************/
  75911. /*! no static exports found */
  75912. /***/ (function(module, exports) {
  75913. /* (ignored) */
  75914. /***/ })
  75915. /******/ });