hls-demo.js 1.2 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195
  1. typeof window !== "undefined" &&
  2. (function webpackUniversalModuleDefinition(root, factory) {
  3. if(typeof exports === 'object' && typeof module === 'object')
  4. module.exports = factory();
  5. else if(typeof define === 'function' && define.amd)
  6. define([], factory);
  7. else if(typeof exports === 'object')
  8. exports["HlsDemo"] = factory();
  9. else
  10. root["HlsDemo"] = factory();
  11. })(this, function() {
  12. return /******/ (function(modules) { // webpackBootstrap
  13. /******/ // The module cache
  14. /******/ var installedModules = {};
  15. /******/
  16. /******/ // The require function
  17. /******/ function __webpack_require__(moduleId) {
  18. /******/
  19. /******/ // Check if module is in cache
  20. /******/ if(installedModules[moduleId]) {
  21. /******/ return installedModules[moduleId].exports;
  22. /******/ }
  23. /******/ // Create a new module (and put it into the cache)
  24. /******/ var module = installedModules[moduleId] = {
  25. /******/ i: moduleId,
  26. /******/ l: false,
  27. /******/ exports: {}
  28. /******/ };
  29. /******/
  30. /******/ // Execute the module function
  31. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  32. /******/
  33. /******/ // Flag the module as loaded
  34. /******/ module.l = true;
  35. /******/
  36. /******/ // Return the exports of the module
  37. /******/ return module.exports;
  38. /******/ }
  39. /******/
  40. /******/
  41. /******/ // expose the modules object (__webpack_modules__)
  42. /******/ __webpack_require__.m = modules;
  43. /******/
  44. /******/ // expose the module cache
  45. /******/ __webpack_require__.c = installedModules;
  46. /******/
  47. /******/ // define getter function for harmony exports
  48. /******/ __webpack_require__.d = function(exports, name, getter) {
  49. /******/ if(!__webpack_require__.o(exports, name)) {
  50. /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
  51. /******/ }
  52. /******/ };
  53. /******/
  54. /******/ // define __esModule on exports
  55. /******/ __webpack_require__.r = function(exports) {
  56. /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
  57. /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
  58. /******/ }
  59. /******/ Object.defineProperty(exports, '__esModule', { value: true });
  60. /******/ };
  61. /******/
  62. /******/ // create a fake namespace object
  63. /******/ // mode & 1: value is a module id, require it
  64. /******/ // mode & 2: merge all properties of value into the ns
  65. /******/ // mode & 4: return value when already ns object
  66. /******/ // mode & 8|1: behave like require
  67. /******/ __webpack_require__.t = function(value, mode) {
  68. /******/ if(mode & 1) value = __webpack_require__(value);
  69. /******/ if(mode & 8) return value;
  70. /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
  71. /******/ var ns = Object.create(null);
  72. /******/ __webpack_require__.r(ns);
  73. /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
  74. /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
  75. /******/ return ns;
  76. /******/ };
  77. /******/
  78. /******/ // getDefaultExport function for compatibility with non-harmony modules
  79. /******/ __webpack_require__.n = function(module) {
  80. /******/ var getter = module && module.__esModule ?
  81. /******/ function getDefault() { return module['default']; } :
  82. /******/ function getModuleExports() { return module; };
  83. /******/ __webpack_require__.d(getter, 'a', getter);
  84. /******/ return getter;
  85. /******/ };
  86. /******/
  87. /******/ // Object.prototype.hasOwnProperty.call
  88. /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  89. /******/
  90. /******/ // __webpack_public_path__
  91. /******/ __webpack_require__.p = "/dist/";
  92. /******/
  93. /******/
  94. /******/ // Load entry module and return exports
  95. /******/ return __webpack_require__(__webpack_require__.s = "./demo/main.js");
  96. /******/ })
  97. /************************************************************************/
  98. /******/ ({
  99. /***/ "./demo/chart/chartjs-horizontal-bar.ts":
  100. /*!**********************************************!*\
  101. !*** ./demo/chart/chartjs-horizontal-bar.ts ***!
  102. \**********************************************/
  103. /*! exports provided: applyChartInstanceOverrides, hhmmss */
  104. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  105. "use strict";
  106. __webpack_require__.r(__webpack_exports__);
  107. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "applyChartInstanceOverrides", function() { return applyChartInstanceOverrides; });
  108. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hhmmss", function() { return hhmmss; });
  109. /* harmony import */ var chart_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! chart.js */ "./node_modules/chart.js/dist/Chart.js");
  110. /* harmony import */ var chart_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chart_js__WEBPACK_IMPORTED_MODULE_0__);
  111. function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
  112. // Modify horizontalBar so that each dataset (fragments, timeRanges) draws on the same row (level, track or buffer)
  113. chart_js__WEBPACK_IMPORTED_MODULE_0___default.a.controllers.horizontalBar.prototype.calculateBarValuePixels = function (datasetIndex, index, options) {
  114. var chart = this.chart;
  115. var scale = this._getValueScale();
  116. var datasets = chart.data.datasets;
  117. if (!datasets) {
  118. throw new Error("Chart datasets are " + datasets);
  119. }
  120. scale._parseValue = scaleParseValue;
  121. var obj = datasets[datasetIndex].data[index];
  122. var value = scale._parseValue(obj);
  123. var start = value.start === undefined ? 0 : value.max >= 0 && value.min >= 0 ? value.min : value.max;
  124. var length = value.start === undefined ? value.end : value.max >= 0 && value.min >= 0 ? value.max - value.min : value.min - value.max;
  125. var base = scale.getPixelForValue(start);
  126. var head = scale.getPixelForValue(start + length);
  127. var size = head - base;
  128. return {
  129. size: size,
  130. base: base,
  131. head: head,
  132. center: head + size / 2
  133. };
  134. };
  135. chart_js__WEBPACK_IMPORTED_MODULE_0___default.a.controllers.horizontalBar.prototype.calculateBarIndexPixels = function (datasetIndex, index, ruler, options) {
  136. var rowHeight = options.barThickness;
  137. var size = rowHeight * options.categoryPercentage;
  138. var center = ruler.start + (datasetIndex * rowHeight + rowHeight / 2);
  139. return {
  140. base: center - size / 2,
  141. head: center + size / 2,
  142. center: center,
  143. size: size
  144. };
  145. };
  146. chart_js__WEBPACK_IMPORTED_MODULE_0___default.a.controllers.horizontalBar.prototype.draw = function () {
  147. var rects = this.getMeta().data;
  148. var len = rects.length;
  149. var dataset = this.getDataset();
  150. if (len !== dataset.data.length) {
  151. // View does not match dataset (wait for redraw)
  152. return;
  153. }
  154. var chart = this.chart;
  155. var scale = this._getValueScale();
  156. scale._parseValue = scaleParseValue;
  157. var ctx = chart.ctx;
  158. var chartArea = chart.chartArea;
  159. chart_js__WEBPACK_IMPORTED_MODULE_0___default.a.helpers.canvas.clipArea(ctx, chartArea);
  160. if (!this.lineHeight) {
  161. this.lineHeight = Math.ceil(ctx.measureText('0').actualBoundingBoxAscent) + 2;
  162. }
  163. var lineHeight = this.lineHeight;
  164. var range = 0;
  165. for (var i = 0; i < len; ++i) {
  166. var rect = rects[i];
  167. var view = rect._view;
  168. if (!intersects(view.base, view.x, chartArea.left, chartArea.right)) {
  169. // Do not draw elements outside of the chart's viewport
  170. continue;
  171. }
  172. var obj = dataset.data[i];
  173. var val = scale._parseValue(obj);
  174. if (!isNaN(val.min) && !isNaN(val.max)) {
  175. var dataType = obj.dataType;
  176. var stats = obj.stats;
  177. var isPart = dataType === 'part';
  178. var isFragmentHint = dataType === 'fragmentHint';
  179. var isFragment = dataType === 'fragment' || isPart || isFragmentHint;
  180. var isCue = dataType === 'cue';
  181. if (isCue) {
  182. view.y += view.height * 0.5 * (i % 2) - view.height * 0.25;
  183. } else if (isPart) {
  184. view.height -= 22;
  185. }
  186. var bounds = boundingRects(view);
  187. var drawText = bounds.w > lineHeight * 1.5 && !isFragmentHint;
  188. if (isFragment || isCue) {
  189. if (drawText) {
  190. view.borderWidth = 1;
  191. if (i === 0) {
  192. view.borderSkipped = false;
  193. }
  194. } else {
  195. range = range || scale.getValueForPixel(chartArea.right) - scale.getValueForPixel(chartArea.left);
  196. if (range > 300 || isCue) {
  197. view.borderWidth = 0;
  198. }
  199. }
  200. if (isFragmentHint) {
  201. view.borderWidth = 0;
  202. view.backgroundColor = 'rgba(0, 0, 0, 0.1)';
  203. } else {
  204. view.backgroundColor = "rgba(0, 0, 0, " + (0.05 + i % 2 / 12) + ")";
  205. }
  206. }
  207. rect.draw();
  208. if (isFragment) {
  209. if (!stats) {
  210. stats = {};
  211. }
  212. if (isPart) {
  213. ctx.fillStyle = 'rgba(255, 255, 255, 0.5)';
  214. ctx.fillRect(bounds.x, bounds.y, bounds.w, bounds.h);
  215. }
  216. if (stats.aborted) {
  217. ctx.fillStyle = 'rgba(100, 0, 0, 0.3)';
  218. ctx.fillRect(bounds.x, bounds.y, bounds.w, bounds.h);
  219. }
  220. if (stats.loaded && stats.total) {
  221. ctx.fillStyle = 'rgba(50, 20, 100, 0.3)';
  222. ctx.fillRect(bounds.x, bounds.y, bounds.w * stats.loaded / stats.total, bounds.h);
  223. }
  224. } else if (isCue) {
  225. if (obj.active) {
  226. ctx.fillStyle = 'rgba(100, 100, 10, 0.4)';
  227. ctx.fillRect(bounds.x, bounds.y, bounds.w, bounds.h);
  228. }
  229. }
  230. if (drawText) {
  231. var start = val.start; // obj.start;
  232. ctx.fillStyle = 'rgb(0, 0, 0)';
  233. if (stats) {
  234. var snBounds = _extends({}, bounds);
  235. if (obj.cc) {
  236. var ccLabel = "cc:" + obj.cc;
  237. var ccWidth = Math.min(ctx.measureText(ccLabel).width + 2, snBounds.w / 2 - 2);
  238. if (ccWidth) {
  239. ctx.fillText(ccLabel, snBounds.x + 2, snBounds.y + lineHeight, snBounds.w / 2 - 4);
  240. snBounds.x += ccWidth;
  241. snBounds.w -= ccWidth;
  242. }
  243. }
  244. var snLabel = isPart ? "part: " + obj.index : "sn: " + obj.sn;
  245. var textWidth = Math.min(ctx.measureText(snLabel).width + 2, snBounds.w - 2);
  246. ctx.fillText(snLabel, snBounds.x + snBounds.w - textWidth, snBounds.y + lineHeight, snBounds.w - 4);
  247. }
  248. if (isCue) {
  249. var strLength = Math.min(30, Math.ceil(bounds.w / (lineHeight / 3)));
  250. ctx.fillText(('' + obj.content).substr(0, strLength), bounds.x + 2, bounds.y + bounds.h - 3, bounds.w - 5);
  251. } else if (!isPart) {
  252. var _float = start !== (start | 0);
  253. var fixedDigits = _float ? Math.min(5, Math.max(1, Math.floor(bounds.w / 10 - 1))) : 0;
  254. var startString = hhmmss(start, fixedDigits);
  255. ctx.fillText(startString, bounds.x + 2, bounds.y + bounds.h - 3, bounds.w - 5);
  256. }
  257. }
  258. }
  259. }
  260. chart_js__WEBPACK_IMPORTED_MODULE_0___default.a.helpers.canvas.unclipArea(chart.ctx);
  261. };
  262. function applyChartInstanceOverrides(chart) {
  263. Object.keys(chart.scales).forEach(function (axis) {
  264. var scale = chart.scales[axis];
  265. scale._parseValue = scaleParseValue;
  266. });
  267. }
  268. function scaleParseValue(value) {
  269. if (value === undefined) {
  270. console.warn('Chart values undefined (update chart)');
  271. return {};
  272. }
  273. var start;
  274. var end;
  275. var min;
  276. var max;
  277. if (Array.isArray(value)) {
  278. start = +this.getRightValue(value[0]);
  279. end = +this.getRightValue(value[1]);
  280. min = Math.min(start, end);
  281. max = Math.max(start, end);
  282. } else {
  283. start = +this.getRightValue(value.start);
  284. if ('end' in value) {
  285. end = +this.getRightValue(value.end);
  286. } else {
  287. end = +this.getRightValue(value.start + value.duration);
  288. }
  289. min = Math.min(start, end);
  290. max = Math.max(start, end);
  291. }
  292. return {
  293. min: min,
  294. max: max,
  295. start: start,
  296. end: end
  297. };
  298. }
  299. function intersects(x1, x2, x3, x4) {
  300. return x2 > x3 && x1 < x4;
  301. }
  302. function boundingRects(vm) {
  303. var half = vm.height / 2;
  304. var left = Math.min(vm.x, vm.base);
  305. var right = Math.max(vm.x, vm.base);
  306. var top = vm.y - half;
  307. var bottom = vm.y + half;
  308. return {
  309. x: left,
  310. y: top,
  311. w: right - left,
  312. h: bottom - top
  313. };
  314. }
  315. function hhmmss(value, fixedDigits) {
  316. var h = value / 3600 | 0;
  317. var m = (value / 60 | 0) % 60;
  318. var s = value % 60;
  319. return (h + ":" + pad(m, 2) + ":" + pad(s.toFixed(fixedDigits), fixedDigits ? fixedDigits + 3 : 2)).replace(/^(?:0+:?)*(\d.*?)(?:\.0*)?$/, '$1');
  320. }
  321. function pad(str, length) {
  322. str = '' + str;
  323. while (str.length < length) {
  324. str = '0' + str;
  325. }
  326. return str;
  327. }
  328. /***/ }),
  329. /***/ "./demo/chart/timeline-chart.ts":
  330. /*!**************************************!*\
  331. !*** ./demo/chart/timeline-chart.ts ***!
  332. \**************************************/
  333. /*! exports provided: TimelineChart */
  334. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  335. "use strict";
  336. __webpack_require__.r(__webpack_exports__);
  337. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TimelineChart", function() { return TimelineChart; });
  338. /* harmony import */ var chart_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! chart.js */ "./node_modules/chart.js/dist/Chart.js");
  339. /* harmony import */ var chart_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(chart_js__WEBPACK_IMPORTED_MODULE_0__);
  340. /* harmony import */ var _chartjs_horizontal_bar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./chartjs-horizontal-bar */ "./demo/chart/chartjs-horizontal-bar.ts");
  341. function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
  342. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  343. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  344. var X_AXIS_SECONDS = 'x-axis-seconds';
  345. var TimelineChart = /*#__PURE__*/function () {
  346. function TimelineChart(canvas, chartJsOptions) {
  347. var _this = this;
  348. this.chart = void 0;
  349. this.rafDebounceRequestId = -1;
  350. this.imageDataBuffer = null;
  351. this.media = null;
  352. this.tracksChangeHandler = void 0;
  353. this.cuesChangeHandler = void 0;
  354. this.hidden = true;
  355. this.zoom100 = 60;
  356. var ctx = canvas.getContext('2d');
  357. if (!ctx) {
  358. throw new Error("Could not get CanvasRenderingContext2D from canvas: " + canvas);
  359. }
  360. var chart = this.chart = self.chart = new chart_js__WEBPACK_IMPORTED_MODULE_0___default.a(ctx, {
  361. type: 'horizontalBar',
  362. data: {
  363. labels: [],
  364. datasets: []
  365. },
  366. options: _extends(getChartOptions(), chartJsOptions),
  367. plugins: [{
  368. afterRender: function afterRender(chart) {
  369. _this.imageDataBuffer = null;
  370. _this.drawCurrentTime();
  371. }
  372. }]
  373. });
  374. Object(_chartjs_horizontal_bar__WEBPACK_IMPORTED_MODULE_1__["applyChartInstanceOverrides"])(chart);
  375. canvas.ondblclick = function (event) {
  376. var chart = _this.chart;
  377. var chartArea = chart.chartArea;
  378. var element = chart.getElementAtEvent(event);
  379. var pos = chart_js__WEBPACK_IMPORTED_MODULE_0___default.a.helpers.getRelativePosition(event, chart);
  380. var scale = _this.chartScales[X_AXIS_SECONDS]; // zoom in when double clicking near elements in chart area
  381. if (element.length || pos.x > chartArea.left) {
  382. var amount = event.getModifierState('Shift') ? -1.0 : 0.5;
  383. _this.zoom(scale, pos, amount);
  384. } else {
  385. scale.options.ticks.min = 0;
  386. scale.options.ticks.max = _this.zoom100;
  387. }
  388. _this.update();
  389. };
  390. canvas.onwheel = function (event) {
  391. if (event.deltaMode) {
  392. // exit if wheel is in page or line scrolling mode
  393. return;
  394. }
  395. var chart = _this.chart;
  396. var chartArea = chart.chartArea;
  397. var pos = chart_js__WEBPACK_IMPORTED_MODULE_0___default.a.helpers.getRelativePosition(event, chart); // zoom when scrolling over chart elements
  398. if (pos.x > chartArea.left - 11) {
  399. var scale = _this.chartScales[X_AXIS_SECONDS];
  400. if (event.deltaY) {
  401. var direction = -event.deltaY / Math.abs(event.deltaY);
  402. var normal = Math.min(333, Math.abs(event.deltaY)) / 1000;
  403. var ease = 1 - (1 - normal) * (1 - normal);
  404. _this.zoom(scale, pos, ease * direction);
  405. } else if (event.deltaX) {
  406. _this.pan(scale, event.deltaX / 10, scale.min, scale.max);
  407. }
  408. event.preventDefault();
  409. }
  410. };
  411. var moved = false;
  412. var gestureScale = 1;
  413. canvas.onpointerdown = function (downEvent) {
  414. if (!downEvent.isPrimary || gestureScale !== 1) {
  415. return;
  416. }
  417. var chart = _this.chart;
  418. var chartArea = chart.chartArea;
  419. var pos = chart_js__WEBPACK_IMPORTED_MODULE_0___default.a.helpers.getRelativePosition(downEvent, chart); // pan when dragging over chart elements
  420. if (pos.x > chartArea.left) {
  421. var scale = _this.chartScales[X_AXIS_SECONDS];
  422. var startX = downEvent.clientX;
  423. var min = scale.min,
  424. max = scale.max;
  425. var xToVal = (max - min) / scale.width;
  426. moved = false;
  427. canvas.setPointerCapture(downEvent.pointerId);
  428. canvas.onpointermove = function (moveEvent) {
  429. if (!downEvent.isPrimary || gestureScale !== 1) {
  430. return;
  431. }
  432. var movedX = startX - moveEvent.clientX;
  433. var movedValue = movedX * xToVal;
  434. moved = moved || Math.abs(movedX) > 8;
  435. _this.pan(scale, movedValue, min, max);
  436. };
  437. }
  438. };
  439. canvas.onpointerup = canvas.onpointercancel = function (upEvent) {
  440. if (canvas.onpointermove) {
  441. canvas.onpointermove = null;
  442. canvas.releasePointerCapture(upEvent.pointerId);
  443. }
  444. if (!moved && upEvent.isPrimary) {
  445. _this.click(upEvent);
  446. }
  447. }; // Gesture events are for iOS and easier to implement than pinch-zoom with multiple pointers for all browsers
  448. // @ts-ignore
  449. canvas.ongesturestart = function (event) {
  450. gestureScale = 1;
  451. event.preventDefault();
  452. }; // @ts-ignore
  453. canvas.ongestureend = function (event) {
  454. gestureScale = 1;
  455. }; // @ts-ignore
  456. canvas.ongesturechange = function (event) {
  457. var chart = _this.chart;
  458. var chartArea = chart.chartArea;
  459. var pos = chart_js__WEBPACK_IMPORTED_MODULE_0___default.a.helpers.getRelativePosition(event, chart); // zoom when scrolling over chart elements
  460. if (pos.x > chartArea.left) {
  461. var scale = _this.chartScales[X_AXIS_SECONDS];
  462. var amount = event.scale - gestureScale;
  463. _this.zoom(scale, pos, amount);
  464. gestureScale = event.scale;
  465. }
  466. };
  467. }
  468. var _proto = TimelineChart.prototype;
  469. _proto.click = function click(event) {
  470. // Log object on click and seek to position
  471. var chart = this.chart;
  472. var element = chart.getElementAtEvent(event);
  473. if (element.length && chart.data.datasets) {
  474. var _self$hls;
  475. var dataset = chart.data.datasets[element[0]._datasetIndex];
  476. var obj = dataset.data[element[0]._index]; // eslint-disable-next-line no-console
  477. console.log(obj);
  478. if ((_self$hls = self.hls) !== null && _self$hls !== void 0 && _self$hls.media) {
  479. var scale = this.chartScales[X_AXIS_SECONDS];
  480. var pos = chart_js__WEBPACK_IMPORTED_MODULE_0___default.a.helpers.getRelativePosition(event, chart);
  481. self.hls.media.currentTime = scale.getValueForPixel(pos.x);
  482. }
  483. }
  484. };
  485. _proto.pan = function pan(scale, amount, min, max) {
  486. if (amount === 0) {
  487. return;
  488. }
  489. var pan = amount;
  490. if (amount > 0) {
  491. pan = Math.min(this.zoom100 + 10 - max, amount);
  492. } else {
  493. pan = Math.max(-10 - min, amount);
  494. }
  495. scale.options.ticks.min = min + pan;
  496. scale.options.ticks.max = max + pan;
  497. this.updateOnRepaint();
  498. };
  499. _proto.zoom = function zoom(scale, pos, amount) {
  500. var range = scale.max - scale.min;
  501. var diff = range * amount;
  502. var minPercent = (scale.getValueForPixel(pos.x) - scale.min) / range;
  503. var maxPercent = 1 - minPercent;
  504. var minDelta = diff * minPercent;
  505. var maxDelta = diff * maxPercent;
  506. scale.options.ticks.min = Math.max(-10, scale.min + minDelta);
  507. scale.options.ticks.max = Math.min(this.zoom100 + 10, scale.max - maxDelta);
  508. this.updateOnRepaint();
  509. };
  510. _proto.reset = function reset() {
  511. var scale = this.chartScales[X_AXIS_SECONDS];
  512. scale.options.ticks.min = 0;
  513. scale.options.ticks.max = 60;
  514. var _this$chart$data = this.chart.data,
  515. labels = _this$chart$data.labels,
  516. datasets = _this$chart$data.datasets;
  517. if (labels && datasets) {
  518. labels.length = 0;
  519. datasets.length = 0;
  520. this.resize(datasets);
  521. }
  522. };
  523. _proto.update = function update() {
  524. var _this$chart$ctx;
  525. if (this.hidden || !((_this$chart$ctx = this.chart.ctx) !== null && _this$chart$ctx !== void 0 && _this$chart$ctx.canvas.width)) {
  526. return;
  527. }
  528. self.cancelAnimationFrame(this.rafDebounceRequestId);
  529. this.chart.update({
  530. duration: 0,
  531. lazy: true
  532. });
  533. };
  534. _proto.updateOnRepaint = function updateOnRepaint() {
  535. var _this2 = this;
  536. if (this.hidden) {
  537. return;
  538. }
  539. self.cancelAnimationFrame(this.rafDebounceRequestId);
  540. this.rafDebounceRequestId = self.requestAnimationFrame(function () {
  541. return _this2.update();
  542. });
  543. };
  544. _proto.resize = function resize(datasets) {
  545. var _this3 = this;
  546. if (this.hidden) {
  547. return;
  548. }
  549. if (datasets !== null && datasets !== void 0 && datasets.length) {
  550. var _this$chart$canvas;
  551. var scale = this.chartScales[X_AXIS_SECONDS];
  552. var top = this.chart.chartArea.top;
  553. var height = top + datasets.reduce(function (val, dataset) {
  554. return val + dataset.barThickness;
  555. }, 0) + scale.height + 5;
  556. var container = (_this$chart$canvas = this.chart.canvas) === null || _this$chart$canvas === void 0 ? void 0 : _this$chart$canvas.parentElement;
  557. if (container) {
  558. container.style.height = height + "px";
  559. }
  560. }
  561. self.cancelAnimationFrame(this.rafDebounceRequestId);
  562. this.rafDebounceRequestId = self.requestAnimationFrame(function () {
  563. _this3.chart.resize();
  564. });
  565. };
  566. _proto.show = function show() {
  567. this.hidden = false;
  568. };
  569. _proto.hide = function hide() {
  570. this.hidden = true;
  571. };
  572. _proto.updateLevels = function updateLevels(levels, levelSwitched) {
  573. var _this4 = this;
  574. var _this$chart$data2 = this.chart.data,
  575. labels = _this$chart$data2.labels,
  576. datasets = _this$chart$data2.datasets;
  577. if (!labels || !datasets) {
  578. return;
  579. }
  580. var _self$hls2 = self.hls,
  581. loadLevel = _self$hls2.loadLevel,
  582. nextLoadLevel = _self$hls2.nextLoadLevel,
  583. nextAutoLevel = _self$hls2.nextAutoLevel; // eslint-disable-next-line no-undefined
  584. var currentLevel = levelSwitched !== undefined ? levelSwitched : self.hls.currentLevel;
  585. levels.forEach(function (level, i) {
  586. var index = level.id || i;
  587. labels.push(getLevelName(level, index));
  588. var borderColor = null;
  589. if (currentLevel === i) {
  590. borderColor = 'rgba(32, 32, 240, 1.0)';
  591. } else if (loadLevel === i) {
  592. borderColor = 'rgba(255, 128, 0, 1.0)';
  593. } else if (nextLoadLevel === i) {
  594. borderColor = 'rgba(200, 200, 64, 1.0)';
  595. } else if (nextAutoLevel === i) {
  596. borderColor = 'rgba(160, 0, 160, 1.0)';
  597. }
  598. datasets.push(datasetWithDefaults({
  599. url: Array.isArray(level.url) ? level.url[level.urlId || 0] : level.url,
  600. trackType: 'level',
  601. borderColor: borderColor,
  602. level: index
  603. }));
  604. if (level.details) {
  605. _this4.updateLevelOrTrack(level.details);
  606. }
  607. });
  608. this.resize(datasets);
  609. };
  610. _proto.updateAudioTracks = function updateAudioTracks(audioTracks) {
  611. var _this5 = this;
  612. var _this$chart$data3 = this.chart.data,
  613. labels = _this$chart$data3.labels,
  614. datasets = _this$chart$data3.datasets;
  615. if (!labels || !datasets) {
  616. return;
  617. }
  618. var audioTrack = self.hls.audioTrack;
  619. audioTracks.forEach(function (track, i) {
  620. labels.push(getAudioTrackName(track, i));
  621. datasets.push(datasetWithDefaults({
  622. url: track.url,
  623. trackType: 'audioTrack',
  624. borderColor: audioTrack === i ? 'rgba(32, 32, 240, 1.0)' : null,
  625. audioTrack: i
  626. }));
  627. if (track.details) {
  628. _this5.updateLevelOrTrack(track.details);
  629. }
  630. });
  631. this.resize(datasets);
  632. };
  633. _proto.updateSubtitleTracks = function updateSubtitleTracks(subtitles) {
  634. var _this6 = this;
  635. var _this$chart$data4 = this.chart.data,
  636. labels = _this$chart$data4.labels,
  637. datasets = _this$chart$data4.datasets;
  638. if (!labels || !datasets) {
  639. return;
  640. }
  641. var subtitleTrack = self.hls.subtitleTrack;
  642. subtitles.forEach(function (track, i) {
  643. labels.push(getSubtitlesName(track, i));
  644. datasets.push(datasetWithDefaults({
  645. url: track.url,
  646. trackType: 'subtitleTrack',
  647. borderColor: subtitleTrack === i ? 'rgba(32, 32, 240, 1.0)' : null,
  648. subtitleTrack: i
  649. }));
  650. if (track.details) {
  651. _this6.updateLevelOrTrack(track.details);
  652. }
  653. });
  654. this.resize(datasets);
  655. };
  656. _proto.removeType = function removeType(trackType) {
  657. var _this$chart$data5 = this.chart.data,
  658. labels = _this$chart$data5.labels,
  659. datasets = _this$chart$data5.datasets;
  660. if (!labels || !datasets) {
  661. return;
  662. }
  663. var i = datasets.length;
  664. while (i--) {
  665. if (datasets[i].trackType === trackType) {
  666. datasets.splice(i, 1);
  667. labels.splice(i, 1);
  668. }
  669. }
  670. };
  671. _proto.updateLevelOrTrack = function updateLevelOrTrack(details) {
  672. var targetduration = details.targetduration,
  673. totalduration = details.totalduration,
  674. url = details.url;
  675. var datasets = this.chart.data.datasets;
  676. var levelDataSet = arrayFind(datasets, function (dataset) {
  677. return stripDeliveryDirectives(url) === stripDeliveryDirectives(dataset.url || '');
  678. });
  679. if (!levelDataSet) {
  680. levelDataSet = arrayFind(datasets, function (dataset) {
  681. var _details$fragments$;
  682. return ((_details$fragments$ = details.fragments[0]) === null || _details$fragments$ === void 0 ? void 0 : _details$fragments$.level) === dataset.level;
  683. });
  684. }
  685. if (!levelDataSet) {
  686. return;
  687. }
  688. var data = levelDataSet.data;
  689. data.length = 0;
  690. if (details.fragments) {
  691. details.fragments.forEach(function (fragment) {
  692. // TODO: keep track of initial playlist start and duration so that we can show drift and pts offset
  693. // (Make that a feature of hls.js v1.0.0 fragments)
  694. var chartFragment = _extends({
  695. dataType: 'fragment'
  696. }, fragment, // Remove loader references for GC
  697. {
  698. loader: null
  699. });
  700. data.push(chartFragment);
  701. });
  702. }
  703. if (details.partList) {
  704. details.partList.forEach(function (part) {
  705. var chartPart = _extends({
  706. dataType: 'part',
  707. start: part.fragment.start + part.fragOffset
  708. }, part, {
  709. fragment: _extends({}, part.fragment, {
  710. loader: null
  711. })
  712. });
  713. data.push(chartPart);
  714. });
  715. if (details.fragmentHint) {
  716. var chartFragment = _extends({
  717. dataType: 'fragmentHint'
  718. }, details.fragmentHint, // Remove loader references for GC
  719. {
  720. loader: null
  721. });
  722. data.push(chartFragment);
  723. }
  724. }
  725. var start = getPlaylistStart(details);
  726. this.maxZoom = this.zoom100 = Math.max(start + totalduration + targetduration * 3, this.zoom100);
  727. this.updateOnRepaint();
  728. } // @ts-ignore
  729. ;
  730. _proto.updateFragment = function updateFragment(data) {
  731. var datasets = this.chart.data.datasets;
  732. var frag = data.frag;
  733. var levelDataSet = arrayFind(datasets, function (dataset) {
  734. return frag.baseurl === dataset.url;
  735. });
  736. if (!levelDataSet) {
  737. levelDataSet = arrayFind(datasets, function (dataset) {
  738. return frag.level === dataset.level;
  739. });
  740. }
  741. if (!levelDataSet) {
  742. return;
  743. } // eslint-disable-next-line no-restricted-properties
  744. var fragData = arrayFind(levelDataSet.data, function (fragData) {
  745. return fragData.relurl === frag.relurl && fragData.sn === frag.sn;
  746. });
  747. if (fragData && fragData !== frag) {
  748. _extends(fragData, frag);
  749. }
  750. this.updateOnRepaint();
  751. };
  752. _proto.updateSourceBuffers = function updateSourceBuffers(tracks, media) {
  753. var _this7 = this;
  754. var _this$chart$data6 = this.chart.data,
  755. labels = _this$chart$data6.labels,
  756. datasets = _this$chart$data6.datasets;
  757. if (!labels || !datasets) {
  758. return;
  759. }
  760. var trackTypes = Object.keys(tracks).sort(function (type) {
  761. return type === 'video' ? 1 : -1;
  762. });
  763. var mediaBufferData = [];
  764. this.removeSourceBuffers();
  765. this.media = media;
  766. trackTypes.forEach(function (type) {
  767. var track = tracks[type];
  768. var data = [];
  769. var sourceBuffer = track.buffer;
  770. var backgroundColor = {
  771. video: 'rgba(0, 0, 255, 0.2)',
  772. audio: 'rgba(128, 128, 0, 0.2)',
  773. audiovideo: 'rgba(128, 128, 255, 0.2)'
  774. }[type];
  775. labels.unshift(type + " buffer (" + track.id + ")");
  776. datasets.unshift(datasetWithDefaults({
  777. data: data,
  778. categoryPercentage: 0.5,
  779. backgroundColor: backgroundColor,
  780. sourceBuffer: sourceBuffer
  781. }));
  782. sourceBuffer.addEventListener('update', function () {
  783. try {
  784. replaceTimeRangeTuples(sourceBuffer.buffered, data);
  785. } catch (error) {
  786. // eslint-disable-next-line no-console
  787. console.warn(error);
  788. return;
  789. }
  790. replaceTimeRangeTuples(media.buffered, mediaBufferData);
  791. _this7.update();
  792. });
  793. });
  794. if (trackTypes.length === 0) {
  795. media.onprogress = function () {
  796. replaceTimeRangeTuples(media.buffered, mediaBufferData);
  797. _this7.update();
  798. };
  799. }
  800. labels.unshift('media buffer');
  801. datasets.unshift(datasetWithDefaults({
  802. data: mediaBufferData,
  803. categoryPercentage: 0.5,
  804. backgroundColor: 'rgba(0, 255, 0, 0.2)',
  805. media: media
  806. }));
  807. media.ontimeupdate = function () {
  808. return _this7.drawCurrentTime();
  809. }; // TextTrackList
  810. var textTracks = media.textTracks;
  811. this.tracksChangeHandler = this.tracksChangeHandler || function (e) {
  812. return _this7.setTextTracks(e.currentTarget);
  813. };
  814. textTracks.removeEventListener('addtrack', this.tracksChangeHandler);
  815. textTracks.removeEventListener('removetrack', this.tracksChangeHandler);
  816. textTracks.removeEventListener('change', this.tracksChangeHandler);
  817. textTracks.addEventListener('addtrack', this.tracksChangeHandler);
  818. textTracks.addEventListener('removetrack', this.tracksChangeHandler);
  819. textTracks.addEventListener('change', this.tracksChangeHandler);
  820. this.setTextTracks(textTracks);
  821. this.resize(datasets);
  822. };
  823. _proto.removeSourceBuffers = function removeSourceBuffers() {
  824. var _this$chart$data7 = this.chart.data,
  825. labels = _this$chart$data7.labels,
  826. datasets = _this$chart$data7.datasets;
  827. if (!labels || !datasets) {
  828. return;
  829. }
  830. var i = datasets.length;
  831. while (i--) {
  832. if ((labels[0] || '').toString().indexOf('buffer') > -1) {
  833. datasets.splice(i, 1);
  834. labels.splice(i, 1);
  835. }
  836. }
  837. };
  838. _proto.setTextTracks = function setTextTracks(textTracks) {
  839. var _this8 = this;
  840. var _this$chart$data8 = this.chart.data,
  841. labels = _this$chart$data8.labels,
  842. datasets = _this$chart$data8.datasets;
  843. if (!labels || !datasets) {
  844. return;
  845. }
  846. this.removeType('textTrack');
  847. [].forEach.call(textTracks, function (textTrack, i) {
  848. // Uncomment to disable rending of subtitle/caption cues in the timeline
  849. // if (textTrack.kind === 'subtitles' || textTrack.kind === 'captions') {
  850. // return;
  851. // }
  852. var data = [];
  853. labels.push((textTrack.name || textTrack.label) + " " + textTrack.kind + " (" + textTrack.mode + ")");
  854. datasets.push(datasetWithDefaults({
  855. data: data,
  856. categoryPercentage: 0.5,
  857. url: '',
  858. trackType: 'textTrack',
  859. borderColor: textTrack.mode !== 'hidden' === i ? 'rgba(32, 32, 240, 1.0)' : null,
  860. textTrack: i
  861. }));
  862. _this8.cuesChangeHandler = _this8.cuesChangeHandler || function (e) {
  863. return _this8.updateTextTrackCues(e.currentTarget);
  864. };
  865. textTrack._data = data;
  866. textTrack.removeEventListener('cuechange', _this8.cuesChangeHandler);
  867. textTrack.addEventListener('cuechange', _this8.cuesChangeHandler);
  868. _this8.updateTextTrackCues(textTrack);
  869. });
  870. this.resize(datasets);
  871. };
  872. _proto.updateTextTrackCues = function updateTextTrackCues(textTrack) {
  873. var data = textTrack._data;
  874. if (!data) {
  875. return;
  876. }
  877. var activeCues = textTrack.activeCues,
  878. cues = textTrack.cues;
  879. data.length = 0;
  880. if (!cues) {
  881. return;
  882. }
  883. var length = cues.length;
  884. var activeLength = 0;
  885. var activeMin = Infinity;
  886. var activeMax = 0;
  887. if (activeCues) {
  888. activeLength = activeCues.length;
  889. for (var i = 0; i < activeLength; i++) {
  890. var cue = activeCues[i];
  891. if (!cue && activeCues.item) {
  892. cue = activeCues.item(i);
  893. }
  894. if (cue) {
  895. activeMin = Math.min(activeMin, cue.startTime);
  896. activeMax = cue.endTime ? Math.max(activeMax, cue.endTime) : activeMax;
  897. } else {
  898. activeLength--;
  899. }
  900. }
  901. }
  902. var _loop = function _loop(_i) {
  903. var cue = cues[_i];
  904. if (!cue && cues.item) {
  905. cue = cues.item(_i);
  906. }
  907. if (!cue) {
  908. return "continue";
  909. }
  910. var start = cue.startTime;
  911. var end = cue.endTime;
  912. var content = getCueLabel(cue);
  913. var active = false;
  914. if (activeLength && end >= activeMin && start <= activeMax) {
  915. active = [].some.call(activeCues, function (activeCue) {
  916. return cuesMatch(activeCue, cue);
  917. });
  918. }
  919. data.push({
  920. start: start,
  921. end: end,
  922. content: content,
  923. active: active,
  924. dataType: 'cue'
  925. });
  926. };
  927. for (var _i = 0; _i < length; _i++) {
  928. var _ret = _loop(_i);
  929. if (_ret === "continue") continue;
  930. }
  931. this.updateOnRepaint();
  932. };
  933. _proto.drawCurrentTime = function drawCurrentTime() {
  934. var _self$hls3;
  935. var chart = this.chart;
  936. if ((_self$hls3 = self.hls) !== null && _self$hls3 !== void 0 && _self$hls3.media && chart.data.datasets.length) {
  937. var currentTime = self.hls.media.currentTime;
  938. var scale = this.chartScales[X_AXIS_SECONDS];
  939. var ctx = chart.ctx;
  940. if (this.hidden || !ctx || !ctx.canvas.width) {
  941. return;
  942. }
  943. var chartArea = chart.chartArea;
  944. var x = scale.getPixelForValue(currentTime);
  945. ctx.restore();
  946. ctx.save();
  947. this.drawLineX(ctx, x, chartArea);
  948. if (x > chartArea.left && x < chartArea.right) {
  949. ctx.fillStyle = this.getCurrentTimeColor(self.hls.media);
  950. var y = chartArea.top + chart.data.datasets[0].barThickness + 1;
  951. ctx.fillText(Object(_chartjs_horizontal_bar__WEBPACK_IMPORTED_MODULE_1__["hhmmss"])(currentTime, 5), x + 2, y, 100);
  952. }
  953. ctx.restore();
  954. }
  955. };
  956. _proto.getCurrentTimeColor = function getCurrentTimeColor(video) {
  957. if (!video.readyState || video.ended) {
  958. return 'rgba(0, 0, 0, 0.9)';
  959. }
  960. if (video.seeking || video.readyState < 3) {
  961. return 'rgba(255, 128, 0, 0.9)';
  962. }
  963. if (video.paused) {
  964. return 'rgba(128, 0, 255, 0.9)';
  965. }
  966. return 'rgba(0, 0, 255, 0.9)';
  967. };
  968. _proto.drawLineX = function drawLineX(ctx, x, chartArea) {
  969. if (!this.imageDataBuffer) {
  970. var devicePixelRatio = self.devicePixelRatio || 1;
  971. this.imageDataBuffer = ctx.getImageData(0, 0, chartArea.right * devicePixelRatio, chartArea.bottom * devicePixelRatio);
  972. } else {
  973. ctx.fillStyle = '#ffffff';
  974. ctx.fillRect(0, 0, chartArea.right, chartArea.bottom);
  975. ctx.putImageData(this.imageDataBuffer, 0, 0);
  976. }
  977. if (x > chartArea.left && x < chartArea.right) {
  978. ctx.lineWidth = 1;
  979. ctx.strokeStyle = this.getCurrentTimeColor(self.hls.media); // alpha '0.5'
  980. ctx.beginPath();
  981. ctx.moveTo(x, chartArea.top);
  982. ctx.lineTo(x, chartArea.bottom);
  983. ctx.stroke();
  984. }
  985. };
  986. _createClass(TimelineChart, [{
  987. key: "chartScales",
  988. get: function get() {
  989. return this.chart.scales;
  990. }
  991. }, {
  992. key: "minZoom",
  993. get: function get() {
  994. var scale = this.chartScales[X_AXIS_SECONDS];
  995. if (scale) {
  996. return scale.options.ticks.min;
  997. }
  998. return 1;
  999. } // @ts-ignore
  1000. }, {
  1001. key: "maxZoom",
  1002. get: function get() {
  1003. var scale = this.chartScales[X_AXIS_SECONDS];
  1004. if (scale) {
  1005. return scale.options.ticks.max;
  1006. }
  1007. return this.zoom100;
  1008. } // @ts-ignore
  1009. ,
  1010. set: function set(x) {
  1011. var currentZoom = this.maxZoom;
  1012. var newZoom = Math.max(x, currentZoom);
  1013. if (currentZoom === 60 && newZoom !== currentZoom) {
  1014. var scale = this.chartScales[X_AXIS_SECONDS];
  1015. scale.options.ticks.max = newZoom;
  1016. }
  1017. }
  1018. }]);
  1019. return TimelineChart;
  1020. }();
  1021. function stripDeliveryDirectives(url) {
  1022. if (url === '') {
  1023. return url;
  1024. }
  1025. try {
  1026. var webUrl = new self.URL(url);
  1027. webUrl.searchParams.delete('_HLS_msn');
  1028. webUrl.searchParams.delete('_HLS_part');
  1029. webUrl.searchParams.delete('_HLS_skip');
  1030. webUrl.searchParams.sort();
  1031. return webUrl.href;
  1032. } catch (e) {
  1033. return url.replace(/[?&]_HLS_(?:msn|part|skip)=[^?&]+/g, '');
  1034. }
  1035. }
  1036. function datasetWithDefaults(options) {
  1037. return _extends({
  1038. data: [],
  1039. xAxisID: X_AXIS_SECONDS,
  1040. barThickness: 35,
  1041. categoryPercentage: 1
  1042. }, options);
  1043. }
  1044. function getPlaylistStart(details) {
  1045. var _details$fragments;
  1046. return (_details$fragments = details.fragments) !== null && _details$fragments !== void 0 && _details$fragments.length ? details.fragments[0].start : 0;
  1047. }
  1048. function getLevelName(level, index) {
  1049. var _level$attrs;
  1050. var label = '(main playlist)';
  1051. if ((_level$attrs = level.attrs) !== null && _level$attrs !== void 0 && _level$attrs.BANDWIDTH) {
  1052. label = getMainLevelAttribute(level) + "@" + level.attrs.BANDWIDTH;
  1053. if (level.name) {
  1054. label = label + " (" + level.name + ")";
  1055. }
  1056. } else if (level.name) {
  1057. label = level.name;
  1058. }
  1059. return label + " L-" + index;
  1060. }
  1061. function getMainLevelAttribute(level) {
  1062. return level.attrs.RESOLUTION || level.attrs.CODECS || level.attrs.AUDIO;
  1063. }
  1064. function getAudioTrackName(track, index) {
  1065. var label = track.lang ? track.name + "/" + track.lang : track.name;
  1066. return label + " (" + (track.groupId || track.attrs['GROUP-ID']) + ") A-" + index;
  1067. }
  1068. function getSubtitlesName(track, index) {
  1069. var label = track.lang ? track.name + "/" + track.lang : track.name;
  1070. return label + " (" + (track.groupId || track.attrs['GROUP-ID']) + ") S-" + index;
  1071. }
  1072. function replaceTimeRangeTuples(timeRanges, data) {
  1073. data.length = 0;
  1074. var length = timeRanges.length;
  1075. for (var i = 0; i < length; i++) {
  1076. data.push([timeRanges.start(i), timeRanges.end(i)]);
  1077. }
  1078. }
  1079. function cuesMatch(cue1, cue2) {
  1080. return cue1.startTime === cue2.startTime && cue1.endTime === cue2.endTime && cue1.text === cue2.text && cue1.data === cue2.data && JSON.stringify(cue1.value) === JSON.stringify(cue2.value);
  1081. }
  1082. function getCueLabel(cue) {
  1083. if (cue.text) {
  1084. return cue.text;
  1085. }
  1086. var result = parseDataCue(cue);
  1087. return JSON.stringify(result);
  1088. }
  1089. function parseDataCue(cue) {
  1090. var data = {};
  1091. var value = cue.value;
  1092. if (value) {
  1093. if (value.info) {
  1094. var collection = data[value.key];
  1095. if (collection !== Object(collection)) {
  1096. collection = {};
  1097. data[value.key] = collection;
  1098. }
  1099. collection[value.info] = value.data;
  1100. } else {
  1101. data[value.key] = value.data;
  1102. }
  1103. }
  1104. return data;
  1105. }
  1106. function getChartOptions() {
  1107. return {
  1108. animation: {
  1109. duration: 0
  1110. },
  1111. elements: {
  1112. rectangle: {
  1113. borderWidth: 1,
  1114. borderColor: 'rgba(20, 20, 20, 1)'
  1115. }
  1116. },
  1117. events: ['click', 'touchstart'],
  1118. hover: {
  1119. mode: null,
  1120. animationDuration: 0
  1121. },
  1122. legend: {
  1123. display: false
  1124. },
  1125. maintainAspectRatio: false,
  1126. responsiveAnimationDuration: 0,
  1127. scales: {
  1128. // TODO: additional xAxes for PTS and PDT
  1129. xAxes: [{
  1130. id: X_AXIS_SECONDS,
  1131. ticks: {
  1132. beginAtZero: true,
  1133. sampleSize: 0,
  1134. maxRotation: 0,
  1135. callback: function callback(tickValue, i, ticks) {
  1136. if (i === 0 || i === ticks.length - 1) {
  1137. return tickValue ? '' : '0';
  1138. } else {
  1139. return Object(_chartjs_horizontal_bar__WEBPACK_IMPORTED_MODULE_1__["hhmmss"])(tickValue, 2);
  1140. }
  1141. }
  1142. }
  1143. }],
  1144. yAxes: [{
  1145. gridLines: {
  1146. display: false
  1147. }
  1148. }]
  1149. },
  1150. tooltips: {
  1151. enabled: false
  1152. }
  1153. };
  1154. }
  1155. function arrayFind(array, predicate) {
  1156. var len = array.length >>> 0;
  1157. if (typeof predicate !== 'function') {
  1158. throw TypeError('predicate must be a function');
  1159. }
  1160. var thisArg = arguments[2];
  1161. var k = 0;
  1162. while (k < len) {
  1163. var kValue = array[k];
  1164. if (predicate.call(thisArg, kValue, k, array)) {
  1165. return kValue;
  1166. }
  1167. k++;
  1168. } // eslint-disable-next-line no-undefined
  1169. return undefined;
  1170. }
  1171. /***/ }),
  1172. /***/ "./demo/demo-utils.js":
  1173. /*!****************************!*\
  1174. !*** ./demo/demo-utils.js ***!
  1175. \****************************/
  1176. /*! exports provided: sortObject, copyTextToClipboard */
  1177. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1178. "use strict";
  1179. __webpack_require__.r(__webpack_exports__);
  1180. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sortObject", function() { return sortObject; });
  1181. /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "copyTextToClipboard", function() { return copyTextToClipboard; });
  1182. function sortObject(obj) {
  1183. if (typeof obj !== 'object') {
  1184. return obj;
  1185. }
  1186. var temp = {};
  1187. var keys = [];
  1188. for (var key in obj) {
  1189. keys.push(key);
  1190. }
  1191. keys.sort();
  1192. for (var index in keys) {
  1193. temp[keys[index]] = sortObject(obj[keys[index]]);
  1194. }
  1195. return temp;
  1196. }
  1197. function copyTextToClipboard(text) {
  1198. var textArea = document.createElement('textarea');
  1199. textArea.value = text;
  1200. document.body.appendChild(textArea);
  1201. textArea.select();
  1202. try {
  1203. var successful = document.execCommand('copy');
  1204. var msg = successful ? 'successful' : 'unsuccessful';
  1205. console.log('Copying text command was ' + msg);
  1206. } catch (err) {
  1207. console.log('Oops, unable to copy');
  1208. }
  1209. document.body.removeChild(textArea);
  1210. }
  1211. /***/ }),
  1212. /***/ "./demo/main.js":
  1213. /*!**********************!*\
  1214. !*** ./demo/main.js ***!
  1215. \**********************/
  1216. /*! no exports provided */
  1217. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  1218. "use strict";
  1219. __webpack_require__.r(__webpack_exports__);
  1220. /* harmony import */ var jsonpack__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jsonpack */ "./node_modules/jsonpack/main.js");
  1221. /* harmony import */ var jsonpack__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jsonpack__WEBPACK_IMPORTED_MODULE_0__);
  1222. /* harmony import */ var promise_polyfill_src_polyfill__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! promise-polyfill/src/polyfill */ "./node_modules/promise-polyfill/src/polyfill.js");
  1223. /* harmony import */ var _demo_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./demo-utils */ "./demo/demo-utils.js");
  1224. /* harmony import */ var _chart_timeline_chart__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./chart/timeline-chart */ "./demo/chart/timeline-chart.ts");
  1225. /* global $, Hls, __NETLIFY__ */
  1226. /* eslint camelcase: 0 */
  1227. var NETLIFY = {}; // replaced in build
  1228. var STORAGE_KEYS = {
  1229. Editor_Persistence: 'hlsjs:config-editor-persist',
  1230. Hls_Config: 'hlsjs:config',
  1231. volume: 'hlsjs:volume',
  1232. demo_tabs: 'hlsjs:demo-tabs'
  1233. };
  1234. var testStreams = __webpack_require__(/*! ../tests/test-streams */ "./tests/test-streams.js");
  1235. var defaultTestStreamUrl = testStreams[Object.keys(testStreams)[0]].url;
  1236. var sourceURL = decodeURIComponent(getURLParam('src', defaultTestStreamUrl));
  1237. var demoConfig = getURLParam('demoConfig', null);
  1238. if (demoConfig) {
  1239. demoConfig = JSON.parse(atob(demoConfig));
  1240. } else {
  1241. demoConfig = {};
  1242. }
  1243. var hlsjsDefaults = {
  1244. debug: true,
  1245. enableWorker: true,
  1246. lowLatencyMode: true,
  1247. backBufferLength: 60 * 1.5
  1248. };
  1249. var enableStreaming = getDemoConfigPropOrDefault('enableStreaming', true);
  1250. var autoRecoverError = getDemoConfigPropOrDefault('autoRecoverError', true);
  1251. var levelCapping = getDemoConfigPropOrDefault('levelCapping', -1);
  1252. var limitMetrics = getDemoConfigPropOrDefault('limitMetrics', -1);
  1253. var dumpfMP4 = getDemoConfigPropOrDefault('dumpfMP4', false);
  1254. var stopOnStall = getDemoConfigPropOrDefault('stopOnStall', false);
  1255. var bufferingIdx = -1;
  1256. var selectedTestStream = null;
  1257. var video = document.querySelector('#video');
  1258. var startTime = Date.now();
  1259. var lastSeekingIdx;
  1260. var lastStartPosition;
  1261. var lastDuration;
  1262. var lastAudioTrackSwitchingIdx;
  1263. var hls;
  1264. var url;
  1265. var events;
  1266. var stats;
  1267. var tracks;
  1268. var fmp4Data;
  1269. var configPersistenceEnabled = false;
  1270. var configEditor = null;
  1271. var chart;
  1272. var resizeAsyncCallbackId = -1;
  1273. var requestAnimationFrame = self.requestAnimationFrame || self.setTimeout;
  1274. var cancelAnimationFrame = self.cancelAnimationFrame || self.clearTimeout;
  1275. var resizeHandlers = [];
  1276. var resize = function resize() {
  1277. cancelAnimationFrame(resizeAsyncCallbackId);
  1278. resizeAsyncCallbackId = requestAnimationFrame(function () {
  1279. resizeHandlers.forEach(function (handler) {
  1280. handler();
  1281. });
  1282. });
  1283. };
  1284. self.onresize = resize;
  1285. if (self.screen && self.screen.orientation) {
  1286. self.screen.orientation.onchange = resize;
  1287. }
  1288. var playerResize = function playerResize() {
  1289. var bounds = video.getBoundingClientRect();
  1290. $('#currentSize').html(Math.round(bounds.width * 10) / 10 + " x " + Math.round(bounds.height * 10) / 10);
  1291. if (video.videoWidth && video.videoHeight) {
  1292. $('#currentResolution').html(video.videoWidth + " x " + video.videoHeight);
  1293. }
  1294. };
  1295. resizeHandlers.push(playerResize);
  1296. $(document).ready(function () {
  1297. setupConfigEditor();
  1298. chart = setupTimelineChart();
  1299. Object.keys(testStreams).forEach(function (key, index) {
  1300. var stream = testStreams[key];
  1301. var option = new Option(stream.description, key);
  1302. $('#streamSelect').append(option);
  1303. if (stream.url === sourceURL) {
  1304. document.querySelector('#streamSelect').selectedIndex = index + 1;
  1305. }
  1306. });
  1307. var videoWidth = video.style.width;
  1308. if (videoWidth) {
  1309. $('#videoSize option').each(function (i, option) {
  1310. if (option.value === videoWidth) {
  1311. document.querySelector('#videoSize').selectedIndex = i;
  1312. $('#bufferedCanvas').width(videoWidth);
  1313. resize();
  1314. return false;
  1315. }
  1316. });
  1317. }
  1318. $('#streamSelect').change(function () {
  1319. var key = $('#streamSelect').val() || Object.keys(testStreams)[0];
  1320. selectedTestStream = testStreams[key];
  1321. var streamUrl = selectedTestStream.url;
  1322. $('#streamURL').val(streamUrl);
  1323. loadSelectedStream();
  1324. });
  1325. $('#streamURL').change(function () {
  1326. selectedTestStream = null;
  1327. loadSelectedStream();
  1328. });
  1329. $('#videoSize').change(function () {
  1330. $('#video').width($('#videoSize').val());
  1331. $('#bufferedCanvas').width($('#videoSize').val());
  1332. checkBuffer();
  1333. resize();
  1334. });
  1335. $('#enableStreaming').click(function () {
  1336. enableStreaming = this.checked;
  1337. loadSelectedStream();
  1338. });
  1339. $('#autoRecoverError').click(function () {
  1340. autoRecoverError = this.checked;
  1341. onDemoConfigChanged();
  1342. });
  1343. $('#stopOnStall').click(function () {
  1344. stopOnStall = this.checked;
  1345. onDemoConfigChanged();
  1346. });
  1347. $('#dumpfMP4').click(function () {
  1348. dumpfMP4 = this.checked;
  1349. $('.btn-dump').toggle(dumpfMP4);
  1350. onDemoConfigChanged();
  1351. });
  1352. $('#limitMetrics').change(function () {
  1353. limitMetrics = this.value;
  1354. onDemoConfigChanged();
  1355. });
  1356. $('#levelCapping').change(function () {
  1357. levelCapping = this.value;
  1358. onDemoConfigChanged();
  1359. });
  1360. $('#limitMetrics').val(limitMetrics);
  1361. $('#enableStreaming').prop('checked', enableStreaming);
  1362. $('#autoRecoverError').prop('checked', autoRecoverError);
  1363. $('#stopOnStall').prop('checked', stopOnStall);
  1364. $('#dumpfMP4').prop('checked', dumpfMP4);
  1365. $('#levelCapping').val(levelCapping); // link to version on npm if canary
  1366. // github branch for a branch version
  1367. // github tag for a normal tag
  1368. // github PR for a pr
  1369. function getVersionLink(version) {
  1370. var alphaRegex = /[-.]0\.alpha\./;
  1371. if (alphaRegex.test(version)) {
  1372. return "https://www.npmjs.com/package/hls.js/v/" + encodeURIComponent(version);
  1373. } else if (NETLIFY.reviewID) {
  1374. return "https://github.com/video-dev/hls.js/pull/" + NETLIFY.reviewID;
  1375. } else if (NETLIFY.branch) {
  1376. return "https://github.com/video-dev/hls.js/tree/" + encodeURIComponent(NETLIFY.branch);
  1377. }
  1378. return "https://github.com/video-dev/hls.js/releases/tag/v" + encodeURIComponent(version);
  1379. }
  1380. var version = Hls.version;
  1381. if (version) {
  1382. var $a = $('<a />').attr('target', '_blank').attr('rel', 'noopener noreferrer').attr('href', getVersionLink(version)).text('v' + version);
  1383. $('.title').append(' ').append($a);
  1384. }
  1385. $('#streamURL').val(sourceURL);
  1386. var volumeSettings = JSON.parse(localStorage.getItem(STORAGE_KEYS.volume)) || {
  1387. volume: 0.05,
  1388. muted: false
  1389. };
  1390. video.volume = volumeSettings.volume;
  1391. video.muted = volumeSettings.muted;
  1392. $('.btn-dump').toggle(dumpfMP4);
  1393. $('#toggleButtons').show();
  1394. $('#metricsButtonWindow').toggle(self.windowSliding);
  1395. $('#metricsButtonFixed').toggle(!self.windowSliding);
  1396. loadSelectedStream();
  1397. var tabIndexesCSV = localStorage.getItem(STORAGE_KEYS.demo_tabs);
  1398. if (tabIndexesCSV === null) {
  1399. tabIndexesCSV = '0,1,2';
  1400. }
  1401. if (tabIndexesCSV) {
  1402. tabIndexesCSV.split(',').forEach(function (indexString) {
  1403. toggleTab($('.demo-tab-btn')[parseInt(indexString) || 0], true);
  1404. });
  1405. }
  1406. $(window).on('popstate', function () {
  1407. window.location.reload();
  1408. });
  1409. });
  1410. function setupGlobals() {
  1411. self.events = events = {
  1412. url: url,
  1413. t0: self.performance.now(),
  1414. load: [],
  1415. buffer: [],
  1416. video: [],
  1417. level: [],
  1418. bitrate: []
  1419. };
  1420. lastAudioTrackSwitchingIdx = undefined;
  1421. lastSeekingIdx = undefined;
  1422. bufferingIdx = -1; // actual values, only on window
  1423. self.recoverDecodingErrorDate = null;
  1424. self.recoverSwapAudioCodecDate = null;
  1425. self.fmp4Data = fmp4Data = {
  1426. audio: [],
  1427. video: []
  1428. };
  1429. self.onClickBufferedRange = onClickBufferedRange;
  1430. self.updateLevelInfo = updateLevelInfo;
  1431. self.onDemoConfigChanged = onDemoConfigChanged;
  1432. self.createfMP4 = createfMP4;
  1433. self.goToMetricsPermaLink = goToMetricsPermaLink;
  1434. self.toggleTab = toggleTab;
  1435. self.toggleTabClick = toggleTabClick;
  1436. self.applyConfigEditorValue = applyConfigEditorValue;
  1437. }
  1438. function trimArray(target, limit) {
  1439. if (limit < 0) {
  1440. return;
  1441. }
  1442. while (target.length > limit) {
  1443. target.shift();
  1444. }
  1445. }
  1446. function trimEventHistory() {
  1447. var x = limitMetrics;
  1448. if (x < 0) {
  1449. return;
  1450. }
  1451. trimArray(events.load, x);
  1452. trimArray(events.buffer, x);
  1453. trimArray(events.video, x);
  1454. trimArray(events.level, x);
  1455. trimArray(events.bitrate, x);
  1456. }
  1457. function loadSelectedStream() {
  1458. $('#statusOut,#errorOut').empty();
  1459. if (!Hls.isSupported()) {
  1460. handleUnsupported();
  1461. return;
  1462. }
  1463. url = $('#streamURL').val();
  1464. setupGlobals();
  1465. hideCanvas();
  1466. if (hls) {
  1467. hls.destroy();
  1468. clearInterval(hls.bufferTimer);
  1469. hls = null;
  1470. }
  1471. if (!enableStreaming) {
  1472. logStatus('Streaming disabled');
  1473. return;
  1474. }
  1475. logStatus('Loading ' + url); // Extending both a demo-specific config and the user config which can override all
  1476. var hlsConfig = $.extend({}, hlsjsDefaults, getEditorValue({
  1477. parse: true
  1478. }));
  1479. if (selectedTestStream && selectedTestStream.config) {
  1480. console.info('[loadSelectedStream] extending hls config with stream-specific config: ', selectedTestStream.config);
  1481. $.extend(hlsConfig, selectedTestStream.config);
  1482. updateConfigEditorValue(hlsConfig);
  1483. }
  1484. onDemoConfigChanged(true);
  1485. console.log('Using Hls.js config:', hlsConfig);
  1486. self.hls = hls = new Hls(hlsConfig);
  1487. logStatus('Loading manifest and attaching video element...');
  1488. var expiredTracks = [].filter.call(video.textTracks, function (track) {
  1489. return track.kind !== 'metadata';
  1490. });
  1491. if (expiredTracks.length) {
  1492. var kinds = expiredTracks.map(function (track) {
  1493. return track.kind;
  1494. }).filter(function (kind, index, self) {
  1495. return self.indexOf(kind) === index;
  1496. });
  1497. logStatus("Replacing video element to remove " + kinds.join(' and ') + " text tracks");
  1498. var videoWithExpiredTextTracks = video;
  1499. video = videoWithExpiredTextTracks.cloneNode(false);
  1500. video.removeAttribute('src');
  1501. video.volume = videoWithExpiredTextTracks.volume;
  1502. video.muted = videoWithExpiredTextTracks.muted;
  1503. videoWithExpiredTextTracks.parentNode.insertBefore(video, videoWithExpiredTextTracks);
  1504. videoWithExpiredTextTracks.parentNode.removeChild(videoWithExpiredTextTracks);
  1505. }
  1506. addChartEventListeners(hls);
  1507. addVideoEventListeners(video);
  1508. hls.loadSource(url);
  1509. hls.autoLevelCapping = levelCapping;
  1510. hls.attachMedia(video);
  1511. hls.on(Hls.Events.MEDIA_ATTACHED, function () {
  1512. logStatus('Media element attached');
  1513. bufferingIdx = -1;
  1514. events.video.push({
  1515. time: self.performance.now() - events.t0,
  1516. type: 'Media attached'
  1517. });
  1518. trimEventHistory();
  1519. });
  1520. hls.on(Hls.Events.MEDIA_DETACHED, function () {
  1521. logStatus('Media element detached');
  1522. clearInterval(hls.bufferTimer);
  1523. bufferingIdx = -1;
  1524. tracks = [];
  1525. events.video.push({
  1526. time: self.performance.now() - events.t0,
  1527. type: 'Media detached'
  1528. });
  1529. trimEventHistory();
  1530. });
  1531. hls.on(Hls.Events.DESTROYING, function () {
  1532. clearInterval(hls.bufferTimer);
  1533. });
  1534. hls.on(Hls.Events.BUFFER_RESET, function () {
  1535. clearInterval(hls.bufferTimer);
  1536. });
  1537. hls.on(Hls.Events.FRAG_PARSING_INIT_SEGMENT, function (eventName, data) {
  1538. showCanvas();
  1539. events.video.push({
  1540. time: self.performance.now() - events.t0,
  1541. type: data.id + ' init segment'
  1542. });
  1543. trimEventHistory();
  1544. });
  1545. hls.on(Hls.Events.FRAG_PARSING_METADATA, function (eventName, data) {// console.log("Id3 samples ", data.samples);
  1546. });
  1547. hls.on(Hls.Events.LEVEL_SWITCHING, function (eventName, data) {
  1548. events.level.push({
  1549. time: self.performance.now() - events.t0,
  1550. id: data.level,
  1551. bitrate: Math.round(hls.levels[data.level].bitrate / 1000)
  1552. });
  1553. trimEventHistory();
  1554. updateLevelInfo();
  1555. });
  1556. hls.on(Hls.Events.MANIFEST_PARSED, function (eventName, data) {
  1557. events.load.push({
  1558. type: 'manifest',
  1559. name: '',
  1560. start: 0,
  1561. end: data.levels.length,
  1562. time: data.stats.loading.start - events.t0,
  1563. latency: data.stats.loading.first - data.stats.loading.start,
  1564. load: data.stats.loading.end - data.stats.loading.first,
  1565. duration: data.stats.loading.end - data.stats.loading.first
  1566. });
  1567. trimEventHistory();
  1568. self.refreshCanvas();
  1569. });
  1570. hls.on(Hls.Events.MANIFEST_PARSED, function (eventName, data) {
  1571. logStatus(hls.levels.length + " quality levels found");
  1572. logStatus('Manifest successfully loaded');
  1573. stats = {
  1574. levelNb: data.levels.length,
  1575. levelParsed: 0
  1576. };
  1577. trimEventHistory();
  1578. updateLevelInfo();
  1579. });
  1580. hls.on(Hls.Events.AUDIO_TRACKS_UPDATED, function (eventName, data) {
  1581. logStatus('No of audio tracks found: ' + data.audioTracks.length);
  1582. updateAudioTrackInfo();
  1583. });
  1584. hls.on(Hls.Events.AUDIO_TRACK_SWITCHING, function (eventName, data) {
  1585. logStatus('Audio track switching...');
  1586. updateAudioTrackInfo();
  1587. events.video.push({
  1588. time: self.performance.now() - events.t0,
  1589. type: 'audio switching',
  1590. name: '@' + data.id
  1591. });
  1592. trimEventHistory();
  1593. lastAudioTrackSwitchingIdx = events.video.length - 1;
  1594. });
  1595. hls.on(Hls.Events.AUDIO_TRACK_SWITCHED, function (eventName, data) {
  1596. logStatus('Audio track switched');
  1597. updateAudioTrackInfo();
  1598. var event = {
  1599. time: self.performance.now() - events.t0,
  1600. type: 'audio switched',
  1601. name: '@' + data.id
  1602. };
  1603. if (lastAudioTrackSwitchingIdx !== undefined) {
  1604. events.video[lastAudioTrackSwitchingIdx].duration = event.time - events.video[lastAudioTrackSwitchingIdx].time;
  1605. lastAudioTrackSwitchingIdx = undefined;
  1606. }
  1607. events.video.push(event);
  1608. trimEventHistory();
  1609. });
  1610. hls.on(Hls.Events.LEVEL_LOADED, function (eventName, data) {
  1611. events.isLive = data.details.live;
  1612. var event = {
  1613. type: 'level',
  1614. id: data.level,
  1615. start: data.details.startSN,
  1616. end: data.details.endSN,
  1617. time: data.stats.loading.start - events.t0,
  1618. latency: data.stats.loading.first - data.stats.loading.start,
  1619. load: data.stats.loading.end - data.stats.loading.first,
  1620. parsing: data.stats.parsing.end - data.stats.loading.end,
  1621. duration: data.stats.loading.end - data.stats.loading.first
  1622. };
  1623. var parsingDuration = data.stats.parsing.end - data.stats.loading.end;
  1624. if (stats.levelParsed) {
  1625. this.sumLevelParsingMs += parsingDuration;
  1626. } else {
  1627. this.sumLevelParsingMs = parsingDuration;
  1628. }
  1629. stats.levelParsed++;
  1630. stats.levelParsingUs = Math.round(1000 * this.sumLevelParsingMs / stats.levelParsed); // console.log('parsing level duration :' + stats.levelParsingUs + 'us,count:' + stats.levelParsed);
  1631. events.load.push(event);
  1632. trimEventHistory();
  1633. self.refreshCanvas();
  1634. });
  1635. hls.on(Hls.Events.AUDIO_TRACK_LOADED, function (eventName, data) {
  1636. events.isLive = data.details.live;
  1637. var event = {
  1638. type: 'audio track',
  1639. id: data.id,
  1640. start: data.details.startSN,
  1641. end: data.details.endSN,
  1642. time: data.stats.loading.start - events.t0,
  1643. latency: data.stats.loading.first - data.stats.loading.start,
  1644. load: data.stats.loading.end - data.stats.loading.first,
  1645. parsing: data.stats.parsing.end - data.stats.loading.end,
  1646. duration: data.stats.loading.end - data.stats.loading.first
  1647. };
  1648. events.load.push(event);
  1649. trimEventHistory();
  1650. self.refreshCanvas();
  1651. });
  1652. hls.on(Hls.Events.FRAG_BUFFERED, function (eventName, data) {
  1653. var event = {
  1654. type: data.frag.type + (data.part ? ' part' : ' fragment'),
  1655. id: data.frag.level,
  1656. id2: data.frag.sn,
  1657. id3: data.part ? data.part.index : undefined,
  1658. time: data.stats.loading.start - events.t0,
  1659. latency: data.stats.loading.first - data.stats.loading.start,
  1660. load: data.stats.loading.end - data.stats.loading.first,
  1661. parsing: data.stats.parsing.end - data.stats.loading.end,
  1662. buffer: data.stats.buffering.end - data.stats.parsing.end,
  1663. duration: data.stats.buffering.end - data.stats.loading.first,
  1664. bw: Math.round(8 * data.stats.total / (data.stats.buffering.end - data.stats.loading.start)),
  1665. size: data.stats.total
  1666. };
  1667. events.load.push(event);
  1668. events.bitrate.push({
  1669. time: self.performance.now() - events.t0,
  1670. bitrate: event.bw,
  1671. duration: data.frag.duration,
  1672. level: event.id
  1673. });
  1674. if (events.buffer.length === 0) {
  1675. events.buffer.push({
  1676. time: 0,
  1677. buffer: 0,
  1678. pos: 0
  1679. });
  1680. }
  1681. clearInterval(hls.bufferTimer);
  1682. hls.bufferTimer = self.setInterval(checkBuffer, 100);
  1683. trimEventHistory();
  1684. self.refreshCanvas();
  1685. updateLevelInfo();
  1686. var latency = data.stats.loading.first - data.stats.loading.start;
  1687. var parsing = data.stats.parsing.end - data.stats.loading.end;
  1688. var process = data.stats.buffering.end - data.stats.loading.start;
  1689. var bitrate = Math.round(8 * data.stats.total / (data.stats.buffering.end - data.stats.loading.first));
  1690. if (stats.fragBuffered) {
  1691. stats.fragMinLatency = Math.min(stats.fragMinLatency, latency);
  1692. stats.fragMaxLatency = Math.max(stats.fragMaxLatency, latency);
  1693. stats.fragMinProcess = Math.min(stats.fragMinProcess, process);
  1694. stats.fragMaxProcess = Math.max(stats.fragMaxProcess, process);
  1695. stats.fragMinKbps = Math.min(stats.fragMinKbps, bitrate);
  1696. stats.fragMaxKbps = Math.max(stats.fragMaxKbps, bitrate);
  1697. stats.autoLevelCappingMin = Math.min(stats.autoLevelCappingMin, hls.autoLevelCapping);
  1698. stats.autoLevelCappingMax = Math.max(stats.autoLevelCappingMax, hls.autoLevelCapping);
  1699. stats.fragBuffered++;
  1700. } else {
  1701. stats.fragMinLatency = stats.fragMaxLatency = latency;
  1702. stats.fragMinProcess = stats.fragMaxProcess = process;
  1703. stats.fragMinKbps = stats.fragMaxKbps = bitrate;
  1704. stats.fragBuffered = 1;
  1705. stats.fragBufferedBytes = 0;
  1706. stats.autoLevelCappingMin = stats.autoLevelCappingMax = hls.autoLevelCapping;
  1707. this.sumLatency = 0;
  1708. this.sumKbps = 0;
  1709. this.sumProcess = 0;
  1710. this.sumParsing = 0;
  1711. }
  1712. stats.fraglastLatency = latency;
  1713. this.sumLatency += latency;
  1714. stats.fragAvgLatency = Math.round(this.sumLatency / stats.fragBuffered);
  1715. stats.fragLastProcess = process;
  1716. this.sumProcess += process;
  1717. this.sumParsing += parsing;
  1718. stats.fragAvgProcess = Math.round(this.sumProcess / stats.fragBuffered);
  1719. stats.fragLastKbps = bitrate;
  1720. this.sumKbps += bitrate;
  1721. stats.fragAvgKbps = Math.round(this.sumKbps / stats.fragBuffered);
  1722. stats.fragBufferedBytes += data.stats.total;
  1723. stats.fragparsingKbps = Math.round(8 * stats.fragBufferedBytes / this.sumParsing);
  1724. stats.fragparsingMs = Math.round(this.sumParsing);
  1725. stats.autoLevelCappingLast = hls.autoLevelCapping;
  1726. });
  1727. hls.on(Hls.Events.LEVEL_SWITCHED, function (eventName, data) {
  1728. var event = {
  1729. time: self.performance.now() - events.t0,
  1730. type: 'level switched',
  1731. name: data.level
  1732. };
  1733. events.video.push(event);
  1734. trimEventHistory();
  1735. self.refreshCanvas();
  1736. updateLevelInfo();
  1737. });
  1738. hls.on(Hls.Events.FRAG_CHANGED, function (eventName, data) {
  1739. var event = {
  1740. time: self.performance.now() - events.t0,
  1741. type: 'frag changed',
  1742. name: data.frag.sn + ' @ ' + data.frag.level
  1743. };
  1744. events.video.push(event);
  1745. trimEventHistory();
  1746. self.refreshCanvas();
  1747. updateLevelInfo();
  1748. stats.tagList = data.frag.tagList;
  1749. var level = data.frag.level;
  1750. var autoLevel = hls.autoLevelEnabled;
  1751. if (stats.levelStart === undefined) {
  1752. stats.levelStart = level;
  1753. }
  1754. stats.fragProgramDateTime = data.frag.programDateTime;
  1755. stats.fragStart = data.frag.start;
  1756. if (autoLevel) {
  1757. if (stats.fragChangedAuto) {
  1758. stats.autoLevelMin = Math.min(stats.autoLevelMin, level);
  1759. stats.autoLevelMax = Math.max(stats.autoLevelMax, level);
  1760. stats.fragChangedAuto++;
  1761. if (this.levelLastAuto && level !== stats.autoLevelLast) {
  1762. stats.autoLevelSwitch++;
  1763. }
  1764. } else {
  1765. stats.autoLevelMin = stats.autoLevelMax = level;
  1766. stats.autoLevelSwitch = 0;
  1767. stats.fragChangedAuto = 1;
  1768. this.sumAutoLevel = 0;
  1769. }
  1770. this.sumAutoLevel += level;
  1771. stats.autoLevelAvg = Math.round(1000 * this.sumAutoLevel / stats.fragChangedAuto) / 1000;
  1772. stats.autoLevelLast = level;
  1773. } else {
  1774. if (stats.fragChangedManual) {
  1775. stats.manualLevelMin = Math.min(stats.manualLevelMin, level);
  1776. stats.manualLevelMax = Math.max(stats.manualLevelMax, level);
  1777. stats.fragChangedManual++;
  1778. if (!this.levelLastAuto && level !== stats.manualLevelLast) {
  1779. stats.manualLevelSwitch++;
  1780. }
  1781. } else {
  1782. stats.manualLevelMin = stats.manualLevelMax = level;
  1783. stats.manualLevelSwitch = 0;
  1784. stats.fragChangedManual = 1;
  1785. }
  1786. stats.manualLevelLast = level;
  1787. }
  1788. this.levelLastAuto = autoLevel;
  1789. });
  1790. hls.on(Hls.Events.FRAG_LOAD_EMERGENCY_ABORTED, function (eventName, data) {
  1791. if (stats) {
  1792. if (stats.fragLoadEmergencyAborted === undefined) {
  1793. stats.fragLoadEmergencyAborted = 1;
  1794. } else {
  1795. stats.fragLoadEmergencyAborted++;
  1796. }
  1797. }
  1798. });
  1799. hls.on(Hls.Events.FRAG_DECRYPTED, function (eventName, data) {
  1800. if (!stats.fragDecrypted) {
  1801. stats.fragDecrypted = 0;
  1802. this.totalDecryptTime = 0;
  1803. stats.fragAvgDecryptTime = 0;
  1804. }
  1805. stats.fragDecrypted++;
  1806. this.totalDecryptTime += data.stats.tdecrypt - data.stats.tstart;
  1807. stats.fragAvgDecryptTime = this.totalDecryptTime / stats.fragDecrypted;
  1808. });
  1809. hls.on(Hls.Events.ERROR, function (eventName, data) {
  1810. console.warn('Error event:', data);
  1811. switch (data.details) {
  1812. case Hls.ErrorDetails.MANIFEST_LOAD_ERROR:
  1813. try {
  1814. $('#errorOut').html('Cannot load <a href="' + data.context.url + '">' + url + '</a><br>HTTP response code:' + data.response.code + ' <br>' + data.response.text);
  1815. if (data.response.code === 0) {
  1816. $('#errorOut').append('This might be a CORS issue, consider installing <a href="https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi">Allow-Control-Allow-Origin</a> Chrome Extension');
  1817. }
  1818. } catch (err) {
  1819. $('#errorOut').html('Cannot load <a href="' + data.context.url + '">' + url + '</a><br>Response body: ' + data.response.text);
  1820. }
  1821. break;
  1822. case Hls.ErrorDetails.MANIFEST_LOAD_TIMEOUT:
  1823. logError('Timeout while loading manifest');
  1824. break;
  1825. case Hls.ErrorDetails.MANIFEST_PARSING_ERROR:
  1826. logError('Error while parsing manifest:' + data.reason);
  1827. break;
  1828. case Hls.ErrorDetails.LEVEL_EMPTY_ERROR:
  1829. logError('Loaded level contains no fragments ' + data.level + ' ' + data.url); // handleLevelError demonstrates how to remove a level that errors followed by a downswitch
  1830. // handleLevelError(data);
  1831. break;
  1832. case Hls.ErrorDetails.LEVEL_LOAD_ERROR:
  1833. logError('Error while loading level playlist ' + data.context.level + ' ' + data.url); // handleLevelError demonstrates how to remove a level that errors followed by a downswitch
  1834. // handleLevelError(data);
  1835. break;
  1836. case Hls.ErrorDetails.LEVEL_LOAD_TIMEOUT:
  1837. logError('Timeout while loading level playlist ' + data.context.level + ' ' + data.url); // handleLevelError demonstrates how to remove a level that errors followed by a downswitch
  1838. // handleLevelError(data);
  1839. break;
  1840. case Hls.ErrorDetails.LEVEL_SWITCH_ERROR:
  1841. logError('Error while trying to switch to level ' + data.level);
  1842. break;
  1843. case Hls.ErrorDetails.FRAG_LOAD_ERROR:
  1844. logError('Error while loading fragment ' + data.frag.url);
  1845. break;
  1846. case Hls.ErrorDetails.FRAG_LOAD_TIMEOUT:
  1847. logError('Timeout while loading fragment ' + data.frag.url);
  1848. break;
  1849. case Hls.ErrorDetails.FRAG_LOOP_LOADING_ERROR:
  1850. logError('Fragment-loop loading error');
  1851. break;
  1852. case Hls.ErrorDetails.FRAG_DECRYPT_ERROR:
  1853. logError('Decrypting error:' + data.reason);
  1854. break;
  1855. case Hls.ErrorDetails.FRAG_PARSING_ERROR:
  1856. logError('Parsing error:' + data.reason);
  1857. break;
  1858. case Hls.ErrorDetails.KEY_LOAD_ERROR:
  1859. logError('Error while loading key ' + data.frag.decryptdata.uri);
  1860. break;
  1861. case Hls.ErrorDetails.KEY_LOAD_TIMEOUT:
  1862. logError('Timeout while loading key ' + data.frag.decryptdata.uri);
  1863. break;
  1864. case Hls.ErrorDetails.BUFFER_APPEND_ERROR:
  1865. logError('Buffer append error');
  1866. break;
  1867. case Hls.ErrorDetails.BUFFER_ADD_CODEC_ERROR:
  1868. logError('Buffer add codec error for ' + data.mimeType + ':' + data.error.message);
  1869. break;
  1870. case Hls.ErrorDetails.BUFFER_APPENDING_ERROR:
  1871. logError('Buffer appending error');
  1872. break;
  1873. case Hls.ErrorDetails.BUFFER_STALLED_ERROR:
  1874. logError('Buffer stalled error');
  1875. if (stopOnStall) {
  1876. hls.stopLoad();
  1877. video.pause();
  1878. }
  1879. break;
  1880. default:
  1881. break;
  1882. }
  1883. if (data.fatal) {
  1884. console.error("Fatal error : " + data.details);
  1885. switch (data.type) {
  1886. case Hls.ErrorTypes.MEDIA_ERROR:
  1887. logError("A media error occurred: " + data.details);
  1888. handleMediaError();
  1889. break;
  1890. case Hls.ErrorTypes.NETWORK_ERROR:
  1891. logError("A network error occurred: " + data.details);
  1892. break;
  1893. default:
  1894. logError("An unrecoverable error occurred: " + data.details);
  1895. hls.destroy();
  1896. break;
  1897. }
  1898. }
  1899. if (!stats) {
  1900. stats = {};
  1901. } // track all errors independently
  1902. if (stats[data.details] === undefined) {
  1903. stats[data.details] = 1;
  1904. } else {
  1905. stats[data.details] += 1;
  1906. } // track fatal error
  1907. if (data.fatal) {
  1908. if (stats.fatalError === undefined) {
  1909. stats.fatalError = 1;
  1910. } else {
  1911. stats.fatalError += 1;
  1912. }
  1913. }
  1914. $('#statisticsOut').text(JSON.stringify(Object(_demo_utils__WEBPACK_IMPORTED_MODULE_2__["sortObject"])(stats), null, '\t'));
  1915. });
  1916. hls.on(Hls.Events.BUFFER_CREATED, function (eventName, data) {
  1917. tracks = data.tracks;
  1918. });
  1919. hls.on(Hls.Events.BUFFER_APPENDING, function (eventName, data) {
  1920. if (dumpfMP4) {
  1921. fmp4Data[data.type].push(data.data);
  1922. }
  1923. });
  1924. hls.on(Hls.Events.FPS_DROP, function (eventName, data) {
  1925. var event = {
  1926. time: self.performance.now() - events.t0,
  1927. type: 'frame drop',
  1928. name: data.currentDropped + '/' + data.currentDecoded
  1929. };
  1930. events.video.push(event);
  1931. trimEventHistory();
  1932. if (stats) {
  1933. if (stats.fpsDropEvent === undefined) {
  1934. stats.fpsDropEvent = 1;
  1935. } else {
  1936. stats.fpsDropEvent++;
  1937. }
  1938. stats.fpsTotalDroppedFrames = data.totalDroppedFrames;
  1939. }
  1940. });
  1941. }
  1942. function addVideoEventListeners(video) {
  1943. video.removeEventListener('resize', handleVideoEvent);
  1944. video.removeEventListener('seeking', handleVideoEvent);
  1945. video.removeEventListener('seeked', handleVideoEvent);
  1946. video.removeEventListener('pause', handleVideoEvent);
  1947. video.removeEventListener('play', handleVideoEvent);
  1948. video.removeEventListener('canplay', handleVideoEvent);
  1949. video.removeEventListener('canplaythrough', handleVideoEvent);
  1950. video.removeEventListener('ended', handleVideoEvent);
  1951. video.removeEventListener('playing', handleVideoEvent);
  1952. video.removeEventListener('error', handleVideoEvent);
  1953. video.removeEventListener('loadedmetadata', handleVideoEvent);
  1954. video.removeEventListener('loadeddata', handleVideoEvent);
  1955. video.removeEventListener('durationchange', handleVideoEvent);
  1956. video.removeEventListener('volumechange', handleVolumeEvent);
  1957. video.addEventListener('resize', handleVideoEvent);
  1958. video.addEventListener('seeking', handleVideoEvent);
  1959. video.addEventListener('seeked', handleVideoEvent);
  1960. video.addEventListener('pause', handleVideoEvent);
  1961. video.addEventListener('play', handleVideoEvent);
  1962. video.addEventListener('canplay', handleVideoEvent);
  1963. video.addEventListener('canplaythrough', handleVideoEvent);
  1964. video.addEventListener('ended', handleVideoEvent);
  1965. video.addEventListener('playing', handleVideoEvent);
  1966. video.addEventListener('error', handleVideoEvent);
  1967. video.addEventListener('loadedmetadata', handleVideoEvent);
  1968. video.addEventListener('loadeddata', handleVideoEvent);
  1969. video.addEventListener('durationchange', handleVideoEvent);
  1970. video.addEventListener('volumechange', handleVolumeEvent);
  1971. }
  1972. function handleUnsupported() {
  1973. if (navigator.userAgent.toLowerCase().indexOf('firefox') !== -1) {
  1974. logStatus('You are using Firefox, it looks like MediaSource is not enabled,<br>please ensure the following keys are set appropriately in <b>about:config</b><br>media.mediasource.enabled=true<br>media.mediasource.mp4.enabled=true<br><b>media.mediasource.whitelist=false</b>');
  1975. } else {
  1976. logStatus('Your Browser does not support MediaSourceExtension / MP4 mediasource');
  1977. }
  1978. }
  1979. function handleVideoEvent(evt) {
  1980. var data = '';
  1981. switch (evt.type) {
  1982. case 'durationchange':
  1983. if (evt.target.duration - lastDuration <= 0.5) {
  1984. // some browsers report several duration change events with almost the same value ... avoid spamming video events
  1985. return;
  1986. }
  1987. lastDuration = evt.target.duration;
  1988. data = Math.round(evt.target.duration * 1000);
  1989. break;
  1990. case 'resize':
  1991. data = evt.target.videoWidth + '/' + evt.target.videoHeight;
  1992. playerResize();
  1993. break;
  1994. case 'loadedmetadata':
  1995. case 'loadeddata':
  1996. case 'canplay':
  1997. case 'canplaythrough':
  1998. case 'ended':
  1999. case 'seeking':
  2000. case 'seeked':
  2001. case 'play':
  2002. case 'playing':
  2003. lastStartPosition = evt.target.currentTime;
  2004. case 'pause':
  2005. case 'waiting':
  2006. case 'stalled':
  2007. case 'error':
  2008. data = Math.round(evt.target.currentTime * 1000);
  2009. if (evt.type === 'error') {
  2010. var errorTxt;
  2011. var mediaError = evt.currentTarget.error;
  2012. switch (mediaError.code) {
  2013. case mediaError.MEDIA_ERR_ABORTED:
  2014. errorTxt = 'You aborted the video playback';
  2015. break;
  2016. case mediaError.MEDIA_ERR_DECODE:
  2017. errorTxt = 'The video playback was aborted due to a corruption problem or because the video used features your browser did not support';
  2018. handleMediaError();
  2019. break;
  2020. case mediaError.MEDIA_ERR_NETWORK:
  2021. errorTxt = 'A network error caused the video download to fail part-way';
  2022. break;
  2023. case mediaError.MEDIA_ERR_SRC_NOT_SUPPORTED:
  2024. errorTxt = 'The video could not be loaded, either because the server or network failed or because the format is not supported';
  2025. break;
  2026. }
  2027. if (mediaError.message) {
  2028. errorTxt += ' - ' + mediaError.message;
  2029. }
  2030. logStatus(errorTxt);
  2031. console.error(errorTxt);
  2032. }
  2033. break;
  2034. default:
  2035. break;
  2036. }
  2037. var event = {
  2038. time: self.performance.now() - events.t0,
  2039. type: evt.type,
  2040. name: data
  2041. };
  2042. events.video.push(event);
  2043. if (evt.type === 'seeking') {
  2044. lastSeekingIdx = events.video.length - 1;
  2045. }
  2046. if (evt.type === 'seeked') {
  2047. events.video[lastSeekingIdx].duration = event.time - events.video[lastSeekingIdx].time;
  2048. }
  2049. trimEventHistory();
  2050. }
  2051. function handleVolumeEvent() {
  2052. localStorage.setItem(STORAGE_KEYS.volume, JSON.stringify({
  2053. muted: video.muted,
  2054. volume: video.volume
  2055. }));
  2056. }
  2057. function handleLevelError(data) {
  2058. var levelObj = data.context || data;
  2059. hls.removeLevel(levelObj.level, levelObj.urlId || 0);
  2060. if (!hls.levels.length) {
  2061. logError('All levels have been removed');
  2062. hls.destroy();
  2063. return;
  2064. } // Trigger an immediate downswitch to the first level
  2065. // This is to handle the case where we start at an empty level, where switching to auto causes hlsjs to stall
  2066. hls.currentLevel = 0; // Set the quality back to auto so that we return to optimal quality
  2067. hls.currentLevel = -1;
  2068. }
  2069. function handleMediaError() {
  2070. if (autoRecoverError) {
  2071. var now = self.performance.now();
  2072. if (!self.recoverDecodingErrorDate || now - self.recoverDecodingErrorDate > 3000) {
  2073. self.recoverDecodingErrorDate = self.performance.now();
  2074. $('#statusOut').append(', trying to recover media error.');
  2075. hls.recoverMediaError();
  2076. } else {
  2077. if (!self.recoverSwapAudioCodecDate || now - self.recoverSwapAudioCodecDate > 3000) {
  2078. self.recoverSwapAudioCodecDate = self.performance.now();
  2079. $('#statusOut').append(', trying to swap audio codec and recover media error.');
  2080. hls.swapAudioCodec();
  2081. hls.recoverMediaError();
  2082. } else {
  2083. $('#statusOut').append(', cannot recover. Last media error recovery failed.');
  2084. }
  2085. }
  2086. }
  2087. }
  2088. function timeRangesToString(r) {
  2089. var log = '';
  2090. for (var i = 0; i < r.length; i++) {
  2091. log += '[' + r.start(i) + ', ' + r.end(i) + ']';
  2092. log += ' ';
  2093. }
  2094. return log;
  2095. }
  2096. function checkBuffer() {
  2097. var canvas = document.querySelector('#bufferedCanvas');
  2098. var ctx = canvas.getContext('2d');
  2099. var r = video.buffered;
  2100. var seekableEnd = getSeekableEnd();
  2101. var bufferingDuration;
  2102. if (r) {
  2103. ctx.fillStyle = 'black';
  2104. if (!canvas.width || canvas.width !== video.clientWidth) {
  2105. canvas.width = video.clientWidth;
  2106. }
  2107. ctx.fillRect(0, 0, canvas.width, canvas.height);
  2108. var pos = video.currentTime;
  2109. var bufferLen = 0;
  2110. ctx.fillStyle = 'gray';
  2111. for (var i = 0; i < r.length; i++) {
  2112. var start = r.start(i) / seekableEnd * canvas.width;
  2113. var end = r.end(i) / seekableEnd * canvas.width;
  2114. ctx.fillRect(start, 2, Math.max(2, end - start), 11);
  2115. if (pos >= r.start(i) && pos < r.end(i)) {
  2116. // play position is inside this buffer TimeRange, retrieve end of buffer position and buffer length
  2117. bufferLen = r.end(i) - pos;
  2118. }
  2119. } // check if we are in buffering / or playback ended state
  2120. if (bufferLen <= 0.1 && video.paused === false && pos - lastStartPosition > 0.5) {
  2121. if (lastDuration - pos <= 0.5 && events.isLive === false) {// don't create buffering event if we are at the end of the playlist, don't report ended for live playlist
  2122. } else {
  2123. // we are not at the end of the playlist ... real buffering
  2124. if (bufferingIdx !== -1) {
  2125. bufferingDuration = self.performance.now() - events.t0 - events.video[bufferingIdx].time;
  2126. events.video[bufferingIdx].duration = bufferingDuration;
  2127. events.video[bufferingIdx].name = bufferingDuration;
  2128. } else {
  2129. events.video.push({
  2130. type: 'buffering',
  2131. time: self.performance.now() - events.t0
  2132. });
  2133. trimEventHistory(); // we are in buffering state
  2134. bufferingIdx = events.video.length - 1;
  2135. }
  2136. }
  2137. }
  2138. if (bufferLen > 0.1 && bufferingIdx !== -1) {
  2139. bufferingDuration = self.performance.now() - events.t0 - events.video[bufferingIdx].time;
  2140. events.video[bufferingIdx].duration = bufferingDuration;
  2141. events.video[bufferingIdx].name = bufferingDuration; // we are out of buffering state
  2142. bufferingIdx = -1;
  2143. } // update buffer/position for current Time
  2144. var event = {
  2145. time: self.performance.now() - events.t0,
  2146. buffer: Math.round(bufferLen * 1000),
  2147. pos: Math.round(pos * 1000)
  2148. };
  2149. var bufEvents = events.buffer;
  2150. var bufEventLen = bufEvents.length;
  2151. if (bufEventLen > 1) {
  2152. var event0 = bufEvents[bufEventLen - 2];
  2153. var event1 = bufEvents[bufEventLen - 1];
  2154. var slopeBuf0 = (event0.buffer - event1.buffer) / (event0.time - event1.time);
  2155. var slopeBuf1 = (event1.buffer - event.buffer) / (event1.time - event.time);
  2156. var slopePos0 = (event0.pos - event1.pos) / (event0.time - event1.time);
  2157. var slopePos1 = (event1.pos - event.pos) / (event1.time - event.time); // compute slopes. if less than 30% difference, remove event1
  2158. if ((slopeBuf0 === slopeBuf1 || Math.abs(slopeBuf0 / slopeBuf1 - 1) <= 0.3) && (slopePos0 === slopePos1 || Math.abs(slopePos0 / slopePos1 - 1) <= 0.3)) {
  2159. bufEvents.pop();
  2160. }
  2161. }
  2162. events.buffer.push(event);
  2163. trimEventHistory();
  2164. self.refreshCanvas();
  2165. if ($('#statsDisplayTab').is(':visible')) {
  2166. var log = "Duration: " + video.duration + "\nBuffered: " + timeRangesToString(video.buffered) + "\nSeekable: " + timeRangesToString(video.seekable) + "\nPlayed: " + timeRangesToString(video.played) + "\n";
  2167. if (hls.media) {
  2168. for (var type in tracks) {
  2169. log += "Buffer for " + type + " contains:" + timeRangesToString(tracks[type].buffer.buffered) + "\n";
  2170. }
  2171. var videoPlaybackQuality = video.getVideoPlaybackQuality;
  2172. if (videoPlaybackQuality && typeof videoPlaybackQuality === typeof Function) {
  2173. log += "Dropped frames: " + video.getVideoPlaybackQuality().droppedVideoFrames + "\n";
  2174. log += "Corrupted frames: " + video.getVideoPlaybackQuality().corruptedVideoFrames + "\n";
  2175. } else if (video.webkitDroppedFrameCount) {
  2176. log += "Dropped frames: " + video.webkitDroppedFrameCount + "\n";
  2177. }
  2178. }
  2179. log += "Bandwidth Estimate: " + hls.bandwidthEstimate.toFixed(3) + "\n";
  2180. if (events.isLive) {
  2181. log += 'Live Stats:\n' + (" Max Latency: " + hls.maxLatency + "\n") + (" Target Latency: " + hls.targetLatency.toFixed(3) + "\n") + (" Latency: " + hls.latency.toFixed(3) + "\n") + (" Drift: " + hls.drift.toFixed(3) + " (edge advance rate)\n") + (" Edge Stall: " + hls.latencyController.edgeStalled.toFixed(3) + " (playlist refresh over target duration/part)\n") + (" Playback rate: " + video.playbackRate.toFixed(2) + "\n");
  2182. if (stats.fragProgramDateTime) {
  2183. var currentPDT = stats.fragProgramDateTime + (video.currentTime - stats.fragStart) * 1000;
  2184. log += " Program Date Time: " + new Date(currentPDT).toISOString();
  2185. var pdtLatency = (Date.now() - currentPDT) / 1000;
  2186. if (pdtLatency > 0) {
  2187. log += " (" + pdtLatency.toFixed(3) + " seconds ago)";
  2188. }
  2189. }
  2190. }
  2191. $('#bufferedOut').text(log);
  2192. $('#statisticsOut').text(JSON.stringify(Object(_demo_utils__WEBPACK_IMPORTED_MODULE_2__["sortObject"])(stats), null, '\t'));
  2193. }
  2194. ctx.fillStyle = 'blue';
  2195. var x = video.currentTime / seekableEnd * canvas.width;
  2196. ctx.fillRect(x, 0, 2, 15);
  2197. } else if (ctx.fillStyle !== 'black') {
  2198. ctx.fillStyle = 'black';
  2199. ctx.fillRect(0, 0, canvas.width, canvas.height);
  2200. }
  2201. }
  2202. function showCanvas() {
  2203. self.showMetrics();
  2204. $('#bufferedOut').show();
  2205. $('#bufferedCanvas').show();
  2206. }
  2207. function hideCanvas() {
  2208. self.hideMetrics();
  2209. $('#bufferedOut').hide();
  2210. $('#bufferedCanvas').hide();
  2211. }
  2212. function getMetrics() {
  2213. var json = JSON.stringify(events);
  2214. var jsonpacked = Object(jsonpack__WEBPACK_IMPORTED_MODULE_0__["pack"])(json); // console.log('packing JSON from ' + json.length + ' to ' + jsonpacked.length + ' bytes');
  2215. return btoa(jsonpacked);
  2216. }
  2217. self.copyMetricsToClipBoard = function () {
  2218. Object(_demo_utils__WEBPACK_IMPORTED_MODULE_2__["copyTextToClipboard"])(getMetrics());
  2219. };
  2220. self.goToMetrics = function () {
  2221. var url = document.URL;
  2222. url = url.substr(0, url.lastIndexOf('/') + 1) + 'metrics.html';
  2223. self.open(url, '_blank');
  2224. };
  2225. function goToMetricsPermaLink() {
  2226. var url = document.URL;
  2227. var b64 = getMetrics();
  2228. url = url.substr(0, url.lastIndexOf('/') + 1) + 'metrics.html#data=' + b64;
  2229. self.open(url, '_blank');
  2230. }
  2231. function onClickBufferedRange(event) {
  2232. var canvas = document.querySelector('#bufferedCanvas');
  2233. var target = (event.clientX - canvas.offsetLeft) / canvas.width * getSeekableEnd();
  2234. video.currentTime = target;
  2235. }
  2236. function getSeekableEnd() {
  2237. if (isFinite(video.duration)) {
  2238. return video.duration;
  2239. }
  2240. if (video.seekable.length) {
  2241. return video.seekable.end(video.seekable.length - 1);
  2242. }
  2243. return 0;
  2244. }
  2245. function getLevelButtonHtml(key, levels, onclickReplace, autoEnabled) {
  2246. var onclickAuto = (key + "=-1").replace(/^(\w+)=([^=]+)$/, onclickReplace);
  2247. var codecs = levels.reduce(function (uniqueCodecs, level) {
  2248. var levelCodecs = codecs2label(level.attrs.CODECS);
  2249. if (levelCodecs && uniqueCodecs.indexOf(levelCodecs) === -1) {
  2250. uniqueCodecs.push(levelCodecs);
  2251. }
  2252. return uniqueCodecs;
  2253. }, []);
  2254. return "<button type=\"button\" class=\"btn btn-sm " + (autoEnabled ? 'btn-primary' : 'btn-success') + "\" onclick=\"" + onclickAuto + "\">auto</button>" + levels.map(function (level, i) {
  2255. var enabled = hls[key] === i;
  2256. var onclick = (key + "=" + i).replace(/^(\w+)=(\w+)$/, onclickReplace);
  2257. var label = level2label(levels[i], i, codecs);
  2258. return "<button type=\"button\" class=\"btn btn-sm " + (enabled ? 'btn-primary' : 'btn-success') + "\" onclick=\"" + onclick + "\">" + label + "</button>";
  2259. }).join('');
  2260. }
  2261. function updateLevelInfo() {
  2262. var levels = hls.levels;
  2263. if (!levels) {
  2264. return;
  2265. }
  2266. var htmlCurrentLevel = getLevelButtonHtml('currentLevel', levels, 'hls.$1=$2', hls.autoLevelEnabled);
  2267. var htmlNextLevel = getLevelButtonHtml('nextLevel', levels, 'hls.$1=$2', hls.autoLevelEnabled);
  2268. var htmlLoadLevel = getLevelButtonHtml('loadLevel', levels, 'hls.$1=$2', hls.autoLevelEnabled);
  2269. var htmlCapLevel = getLevelButtonHtml('autoLevelCapping', levels, 'levelCapping=hls.$1=$2;updateLevelInfo();onDemoConfigChanged();', hls.autoLevelCapping === -1);
  2270. if ($('#currentLevelControl').html() !== htmlCurrentLevel) {
  2271. $('#currentLevelControl').html(htmlCurrentLevel);
  2272. }
  2273. if ($('#nextLevelControl').html() !== htmlNextLevel) {
  2274. $('#nextLevelControl').html(htmlNextLevel);
  2275. }
  2276. if ($('#loadLevelControl').html() !== htmlLoadLevel) {
  2277. $('#loadLevelControl').html(htmlLoadLevel);
  2278. }
  2279. if ($('#levelCappingControl').html() !== htmlCapLevel) {
  2280. $('#levelCappingControl').html(htmlCapLevel);
  2281. }
  2282. }
  2283. function updateAudioTrackInfo() {
  2284. var buttonTemplate = '<button type="button" class="btn btn-sm ';
  2285. var buttonEnabled = 'btn-primary" ';
  2286. var buttonDisabled = 'btn-success" ';
  2287. var html1 = '';
  2288. var audioTrackId = hls.audioTrack;
  2289. var len = hls.audioTracks.length;
  2290. var track = hls.audioTracks[audioTrackId];
  2291. for (var i = 0; i < len; i++) {
  2292. html1 += buttonTemplate;
  2293. if (audioTrackId === i) {
  2294. html1 += buttonEnabled;
  2295. } else {
  2296. html1 += buttonDisabled;
  2297. }
  2298. html1 += 'onclick="hls.audioTrack=' + i + '">' + hls.audioTracks[i].name + '</button>';
  2299. }
  2300. $('#audioTrackLabel').text(track ? track.lang || track.name : 'None selected');
  2301. $('#audioTrackControl').html(html1);
  2302. }
  2303. function codecs2label(levelCodecs) {
  2304. if (levelCodecs) {
  2305. return levelCodecs.replace(/([ah]vc.)[^,;]+/, '$1').replace('mp4a.40.2', 'mp4a');
  2306. }
  2307. return '';
  2308. }
  2309. function level2label(level, i, manifestCodecs) {
  2310. var levelCodecs = codecs2label(level.attrs.CODECS);
  2311. var levelNameInfo = level.name ? "\"" + level.name + "\": " : '';
  2312. var codecInfo = levelCodecs && manifestCodecs.length > 1 ? " / " + levelCodecs : '';
  2313. if (level.height) {
  2314. return i + " (" + levelNameInfo + level.height + "p / " + Math.round(level.bitrate / 1024) + "kb" + codecInfo + ")";
  2315. }
  2316. if (level.bitrate) {
  2317. return i + " (" + levelNameInfo + Math.round(level.bitrate / 1024) + "kb" + codecInfo + ")";
  2318. }
  2319. if (codecInfo) {
  2320. return i + " (" + levelNameInfo + levelCodecs + ")";
  2321. }
  2322. if (level.name) {
  2323. return i + " (" + level.name + ")";
  2324. }
  2325. return "" + i;
  2326. }
  2327. function getDemoConfigPropOrDefault(propName, defaultVal) {
  2328. return typeof demoConfig[propName] !== 'undefined' ? demoConfig[propName] : defaultVal;
  2329. }
  2330. function getURLParam(sParam, defaultValue) {
  2331. var sPageURL = self.location.search.substring(1);
  2332. var sURLVariables = sPageURL.split('&');
  2333. for (var i = 0; i < sURLVariables.length; i++) {
  2334. var sParameterName = sURLVariables[i].split('=');
  2335. if (sParameterName[0] === sParam) {
  2336. return sParameterName[1] === 'undefined' ? undefined : sParameterName[1] === 'false' ? false : sParameterName[1];
  2337. }
  2338. }
  2339. return defaultValue;
  2340. }
  2341. function onDemoConfigChanged(firstLoad) {
  2342. demoConfig = {
  2343. enableStreaming: enableStreaming,
  2344. autoRecoverError: autoRecoverError,
  2345. stopOnStall: stopOnStall,
  2346. dumpfMP4: dumpfMP4,
  2347. levelCapping: levelCapping,
  2348. limitMetrics: limitMetrics
  2349. };
  2350. if (configPersistenceEnabled) {
  2351. persistEditorValue();
  2352. }
  2353. var serializedDemoConfig = btoa(JSON.stringify(demoConfig));
  2354. var baseURL = document.URL.split('?')[0];
  2355. var streamURL = $('#streamURL').val();
  2356. var permalinkURL = baseURL + "?src=" + encodeURIComponent(streamURL) + "&demoConfig=" + serializedDemoConfig;
  2357. $('#StreamPermalink').html("<a href=\"" + permalinkURL + "\">" + permalinkURL + "</a>");
  2358. if (!firstLoad && window.location.href !== permalinkURL) {
  2359. window.history.pushState(null, null, permalinkURL);
  2360. }
  2361. }
  2362. function onConfigPersistenceChanged(event) {
  2363. configPersistenceEnabled = event.target.checked;
  2364. localStorage.setItem(STORAGE_KEYS.Editor_Persistence, JSON.stringify(configPersistenceEnabled));
  2365. if (configPersistenceEnabled) {
  2366. persistEditorValue();
  2367. } else {
  2368. localStorage.removeItem(STORAGE_KEYS.Hls_Config);
  2369. }
  2370. }
  2371. function getEditorValue(options) {
  2372. options = $.extend({
  2373. parse: false
  2374. }, options || {});
  2375. var value = configEditor.session.getValue();
  2376. if (options.parse) {
  2377. try {
  2378. value = JSON.parse(value);
  2379. } catch (e) {
  2380. console.warn('[getEditorValue] could not parse editor value', e);
  2381. value = {};
  2382. }
  2383. }
  2384. return value;
  2385. }
  2386. function getPersistedHlsConfig() {
  2387. var value = localStorage.getItem(STORAGE_KEYS.Hls_Config);
  2388. if (value === null) {
  2389. return value;
  2390. }
  2391. try {
  2392. value = JSON.parse(value);
  2393. } catch (e) {
  2394. console.warn('[getPersistedHlsConfig] could not hls config json', e);
  2395. value = {};
  2396. }
  2397. return value;
  2398. }
  2399. function persistEditorValue() {
  2400. localStorage.setItem(STORAGE_KEYS.Hls_Config, getEditorValue());
  2401. }
  2402. function setupConfigEditor() {
  2403. configEditor = self.ace.edit('config-editor');
  2404. configEditor.setTheme('ace/theme/github');
  2405. configEditor.session.setMode('ace/mode/json');
  2406. var contents = hlsjsDefaults;
  2407. var shouldRestorePersisted = JSON.parse(localStorage.getItem(STORAGE_KEYS.Editor_Persistence)) === true;
  2408. if (shouldRestorePersisted) {
  2409. $.extend(contents, getPersistedHlsConfig());
  2410. }
  2411. var elPersistence = document.querySelector('#config-persistence');
  2412. elPersistence.addEventListener('change', onConfigPersistenceChanged);
  2413. elPersistence.checked = shouldRestorePersisted;
  2414. configPersistenceEnabled = shouldRestorePersisted;
  2415. updateConfigEditorValue(contents);
  2416. }
  2417. function setupTimelineChart() {
  2418. var canvas = document.querySelector('#timeline-chart');
  2419. var chart = new _chart_timeline_chart__WEBPACK_IMPORTED_MODULE_3__["TimelineChart"](canvas, {
  2420. responsive: false
  2421. });
  2422. resizeHandlers.push(function () {
  2423. chart.resize();
  2424. });
  2425. chart.resize();
  2426. return chart;
  2427. }
  2428. function addChartEventListeners(hls) {
  2429. var updateLevelOrTrack = function updateLevelOrTrack(eventName, data) {
  2430. chart.updateLevelOrTrack(data.details);
  2431. };
  2432. var updateFragment = function updateFragment(eventName, data) {
  2433. if (data.stats) {
  2434. // Convert 0.x stats to partial v1 stats
  2435. var _data$stats = data.stats,
  2436. retry = _data$stats.retry,
  2437. loaded = _data$stats.loaded,
  2438. total = _data$stats.total,
  2439. trequest = _data$stats.trequest,
  2440. tfirst = _data$stats.tfirst,
  2441. tload = _data$stats.tload;
  2442. if (trequest && tload) {
  2443. data.frag.stats = {
  2444. loaded: loaded,
  2445. retry: retry,
  2446. total: total,
  2447. loading: {
  2448. start: trequest,
  2449. first: tfirst,
  2450. end: tload
  2451. }
  2452. };
  2453. }
  2454. }
  2455. chart.updateFragment(data);
  2456. };
  2457. var updateChart = function updateChart() {
  2458. chart.update();
  2459. };
  2460. hls.on(Hls.Events.MANIFEST_LOADING, function () {
  2461. chart.reset();
  2462. }, chart);
  2463. hls.on(Hls.Events.MANIFEST_PARSED, function (eventName, data) {
  2464. var levels = data.levels;
  2465. chart.removeType('level');
  2466. chart.removeType('audioTrack');
  2467. chart.removeType('subtitleTrack');
  2468. chart.updateLevels(levels);
  2469. }, chart);
  2470. hls.on(Hls.Events.BUFFER_CREATED, function (eventName, _ref) {
  2471. var tracks = _ref.tracks;
  2472. chart.updateSourceBuffers(tracks, hls.media);
  2473. }, chart);
  2474. hls.on(Hls.Events.BUFFER_RESET, function () {
  2475. chart.removeSourceBuffers();
  2476. }, chart);
  2477. hls.on(Hls.Events.LEVELS_UPDATED, function (eventName, _ref2) {
  2478. var levels = _ref2.levels;
  2479. chart.removeType('level');
  2480. chart.updateLevels(levels);
  2481. });
  2482. hls.on(Hls.Events.LEVEL_SWITCHED, function (eventName, _ref3) {
  2483. var level = _ref3.level;
  2484. chart.removeType('level');
  2485. chart.updateLevels(hls.levels, level);
  2486. }, chart);
  2487. hls.on(Hls.Events.LEVEL_LOADING, function () {
  2488. // TODO: mutate level datasets
  2489. // Update loadLevel
  2490. chart.removeType('level');
  2491. chart.updateLevels(hls.levels);
  2492. }, chart);
  2493. hls.on(Hls.Events.LEVEL_UPDATED, function (eventName, _ref4) {
  2494. var details = _ref4.details;
  2495. chart.updateLevelOrTrack(details);
  2496. }, chart);
  2497. hls.on(Hls.Events.AUDIO_TRACKS_UPDATED, function (eventName, _ref5) {
  2498. var audioTracks = _ref5.audioTracks;
  2499. chart.removeType('audioTrack');
  2500. chart.updateAudioTracks(audioTracks);
  2501. }, chart);
  2502. hls.on(Hls.Events.SUBTITLE_TRACKS_UPDATED, function (eventName, _ref6) {
  2503. var subtitleTracks = _ref6.subtitleTracks;
  2504. chart.removeType('subtitleTrack');
  2505. chart.updateSubtitleTracks(subtitleTracks);
  2506. }, chart);
  2507. hls.on(Hls.Events.AUDIO_TRACK_SWITCHED, function (eventName) {
  2508. // TODO: mutate level datasets
  2509. chart.removeType('audioTrack');
  2510. chart.updateAudioTracks(hls.audioTracks);
  2511. }, chart);
  2512. hls.on(Hls.Events.SUBTITLE_TRACK_SWITCH, function (eventName) {
  2513. // TODO: mutate level datasets
  2514. chart.removeType('subtitleTrack');
  2515. chart.updateSubtitleTracks(hls.subtitleTracks);
  2516. }, chart);
  2517. hls.on(Hls.Events.AUDIO_TRACK_LOADED, updateLevelOrTrack, chart);
  2518. hls.on(Hls.Events.SUBTITLE_TRACK_LOADED, updateLevelOrTrack, chart);
  2519. hls.on(Hls.Events.LEVEL_PTS_UPDATED, updateLevelOrTrack, chart);
  2520. hls.on(Hls.Events.FRAG_LOADED, updateFragment, chart);
  2521. hls.on(Hls.Events.FRAG_PARSED, updateFragment, chart);
  2522. hls.on(Hls.Events.FRAG_CHANGED, updateFragment, chart);
  2523. hls.on(Hls.Events.BUFFER_APPENDING, updateChart, chart);
  2524. hls.on(Hls.Events.BUFFER_APPENDED, updateChart, chart);
  2525. hls.on(Hls.Events.BUFFER_FLUSHED, updateChart, chart);
  2526. }
  2527. function updateConfigEditorValue(obj) {
  2528. var json = JSON.stringify(obj, null, 2);
  2529. configEditor.session.setValue(json);
  2530. }
  2531. function applyConfigEditorValue() {
  2532. onDemoConfigChanged();
  2533. loadSelectedStream();
  2534. }
  2535. function createfMP4(type) {
  2536. if (fmp4Data[type].length) {
  2537. var blob = new Blob([arrayConcat(fmp4Data[type])], {
  2538. type: 'application/octet-stream'
  2539. });
  2540. var filename = type + '-' + new Date().toISOString() + '.mp4';
  2541. self.saveAs(blob, filename); // $('body').append('<a download="hlsjs-' + filename + '" href="' + self.URL.createObjectURL(blob) + '">Download ' + filename + ' track</a><br>');
  2542. } else if (!dumpfMP4) {
  2543. console.error('Check "Dump transmuxed fMP4 data" first to make appended media available for saving.');
  2544. }
  2545. }
  2546. function arrayConcat(inputArray) {
  2547. var totalLength = inputArray.reduce(function (prev, cur) {
  2548. return prev + cur.length;
  2549. }, 0);
  2550. var result = new Uint8Array(totalLength);
  2551. var offset = 0;
  2552. inputArray.forEach(function (element) {
  2553. result.set(element, offset);
  2554. offset += element.length;
  2555. });
  2556. return result;
  2557. }
  2558. function hideAllTabs() {
  2559. $('.demo-tab-btn').css('background-color', '');
  2560. $('.demo-tab').hide();
  2561. }
  2562. function toggleTabClick(btn) {
  2563. toggleTab(btn);
  2564. var tabIndexes = $('.demo-tab-btn').toArray().map(function (el, i) {
  2565. return $('#' + $(el).data('tab')).is(':visible') ? i : null;
  2566. }).filter(function (i) {
  2567. return i !== null;
  2568. });
  2569. localStorage.setItem(STORAGE_KEYS.demo_tabs, tabIndexes.join(','));
  2570. }
  2571. function toggleTab(btn, dontHideOpenTabs) {
  2572. var tabElId = $(btn).data('tab'); // eslint-disable-next-line no-restricted-globals
  2573. var modifierPressed = dontHideOpenTabs || self.event && (self.event.metaKey || self.event.shiftKey);
  2574. if (!modifierPressed) {
  2575. hideAllTabs();
  2576. }
  2577. if (modifierPressed) {
  2578. $("#" + tabElId).toggle();
  2579. } else {
  2580. $("#" + tabElId).show();
  2581. }
  2582. $(btn).css('background-color', $("#" + tabElId).is(':visible') ? 'orange' : '');
  2583. if (!$('#statsDisplayTab').is(':visible')) {
  2584. self.hideMetrics();
  2585. }
  2586. if (hls) {
  2587. if ($('#timelineTab').is(':visible')) {
  2588. chart.show();
  2589. chart.resize(chart.chart.data ? chart.chart.data.datasets : null);
  2590. } else {
  2591. chart.hide();
  2592. }
  2593. }
  2594. }
  2595. function appendLog(textElId, message) {
  2596. var el = $('#' + textElId);
  2597. var logText = el.text();
  2598. if (logText.length) {
  2599. logText += '\n';
  2600. }
  2601. var timestamp = (Date.now() - startTime) / 1000;
  2602. var newMessage = timestamp + ' | ' + message;
  2603. logText += newMessage; // update
  2604. el.text(logText);
  2605. var element = el[0];
  2606. element.scrollTop = element.scrollHeight - element.clientHeight;
  2607. }
  2608. function logStatus(message) {
  2609. appendLog('statusOut', message);
  2610. }
  2611. function logError(message) {
  2612. appendLog('errorOut', message);
  2613. }
  2614. /***/ }),
  2615. /***/ "./node_modules/chart.js/dist/Chart.js":
  2616. /*!*********************************************!*\
  2617. !*** ./node_modules/chart.js/dist/Chart.js ***!
  2618. \*********************************************/
  2619. /*! no static exports found */
  2620. /***/ (function(module, exports, __webpack_require__) {
  2621. /*!
  2622. * Chart.js v2.9.4
  2623. * https://www.chartjs.org
  2624. * (c) 2020 Chart.js Contributors
  2625. * Released under the MIT License
  2626. */
  2627. (function (global, factory) {
  2628. true ? module.exports = factory(function() { try { return __webpack_require__(/*! moment */ "./node_modules/moment/moment.js"); } catch(e) { } }()) :
  2629. undefined;
  2630. }(this, (function (moment) { 'use strict';
  2631. moment = moment && moment.hasOwnProperty('default') ? moment['default'] : moment;
  2632. function createCommonjsModule(fn, module) {
  2633. return module = { exports: {} }, fn(module, module.exports), module.exports;
  2634. }
  2635. function getCjsExportFromNamespace (n) {
  2636. return n && n['default'] || n;
  2637. }
  2638. var colorName = {
  2639. "aliceblue": [240, 248, 255],
  2640. "antiquewhite": [250, 235, 215],
  2641. "aqua": [0, 255, 255],
  2642. "aquamarine": [127, 255, 212],
  2643. "azure": [240, 255, 255],
  2644. "beige": [245, 245, 220],
  2645. "bisque": [255, 228, 196],
  2646. "black": [0, 0, 0],
  2647. "blanchedalmond": [255, 235, 205],
  2648. "blue": [0, 0, 255],
  2649. "blueviolet": [138, 43, 226],
  2650. "brown": [165, 42, 42],
  2651. "burlywood": [222, 184, 135],
  2652. "cadetblue": [95, 158, 160],
  2653. "chartreuse": [127, 255, 0],
  2654. "chocolate": [210, 105, 30],
  2655. "coral": [255, 127, 80],
  2656. "cornflowerblue": [100, 149, 237],
  2657. "cornsilk": [255, 248, 220],
  2658. "crimson": [220, 20, 60],
  2659. "cyan": [0, 255, 255],
  2660. "darkblue": [0, 0, 139],
  2661. "darkcyan": [0, 139, 139],
  2662. "darkgoldenrod": [184, 134, 11],
  2663. "darkgray": [169, 169, 169],
  2664. "darkgreen": [0, 100, 0],
  2665. "darkgrey": [169, 169, 169],
  2666. "darkkhaki": [189, 183, 107],
  2667. "darkmagenta": [139, 0, 139],
  2668. "darkolivegreen": [85, 107, 47],
  2669. "darkorange": [255, 140, 0],
  2670. "darkorchid": [153, 50, 204],
  2671. "darkred": [139, 0, 0],
  2672. "darksalmon": [233, 150, 122],
  2673. "darkseagreen": [143, 188, 143],
  2674. "darkslateblue": [72, 61, 139],
  2675. "darkslategray": [47, 79, 79],
  2676. "darkslategrey": [47, 79, 79],
  2677. "darkturquoise": [0, 206, 209],
  2678. "darkviolet": [148, 0, 211],
  2679. "deeppink": [255, 20, 147],
  2680. "deepskyblue": [0, 191, 255],
  2681. "dimgray": [105, 105, 105],
  2682. "dimgrey": [105, 105, 105],
  2683. "dodgerblue": [30, 144, 255],
  2684. "firebrick": [178, 34, 34],
  2685. "floralwhite": [255, 250, 240],
  2686. "forestgreen": [34, 139, 34],
  2687. "fuchsia": [255, 0, 255],
  2688. "gainsboro": [220, 220, 220],
  2689. "ghostwhite": [248, 248, 255],
  2690. "gold": [255, 215, 0],
  2691. "goldenrod": [218, 165, 32],
  2692. "gray": [128, 128, 128],
  2693. "green": [0, 128, 0],
  2694. "greenyellow": [173, 255, 47],
  2695. "grey": [128, 128, 128],
  2696. "honeydew": [240, 255, 240],
  2697. "hotpink": [255, 105, 180],
  2698. "indianred": [205, 92, 92],
  2699. "indigo": [75, 0, 130],
  2700. "ivory": [255, 255, 240],
  2701. "khaki": [240, 230, 140],
  2702. "lavender": [230, 230, 250],
  2703. "lavenderblush": [255, 240, 245],
  2704. "lawngreen": [124, 252, 0],
  2705. "lemonchiffon": [255, 250, 205],
  2706. "lightblue": [173, 216, 230],
  2707. "lightcoral": [240, 128, 128],
  2708. "lightcyan": [224, 255, 255],
  2709. "lightgoldenrodyellow": [250, 250, 210],
  2710. "lightgray": [211, 211, 211],
  2711. "lightgreen": [144, 238, 144],
  2712. "lightgrey": [211, 211, 211],
  2713. "lightpink": [255, 182, 193],
  2714. "lightsalmon": [255, 160, 122],
  2715. "lightseagreen": [32, 178, 170],
  2716. "lightskyblue": [135, 206, 250],
  2717. "lightslategray": [119, 136, 153],
  2718. "lightslategrey": [119, 136, 153],
  2719. "lightsteelblue": [176, 196, 222],
  2720. "lightyellow": [255, 255, 224],
  2721. "lime": [0, 255, 0],
  2722. "limegreen": [50, 205, 50],
  2723. "linen": [250, 240, 230],
  2724. "magenta": [255, 0, 255],
  2725. "maroon": [128, 0, 0],
  2726. "mediumaquamarine": [102, 205, 170],
  2727. "mediumblue": [0, 0, 205],
  2728. "mediumorchid": [186, 85, 211],
  2729. "mediumpurple": [147, 112, 219],
  2730. "mediumseagreen": [60, 179, 113],
  2731. "mediumslateblue": [123, 104, 238],
  2732. "mediumspringgreen": [0, 250, 154],
  2733. "mediumturquoise": [72, 209, 204],
  2734. "mediumvioletred": [199, 21, 133],
  2735. "midnightblue": [25, 25, 112],
  2736. "mintcream": [245, 255, 250],
  2737. "mistyrose": [255, 228, 225],
  2738. "moccasin": [255, 228, 181],
  2739. "navajowhite": [255, 222, 173],
  2740. "navy": [0, 0, 128],
  2741. "oldlace": [253, 245, 230],
  2742. "olive": [128, 128, 0],
  2743. "olivedrab": [107, 142, 35],
  2744. "orange": [255, 165, 0],
  2745. "orangered": [255, 69, 0],
  2746. "orchid": [218, 112, 214],
  2747. "palegoldenrod": [238, 232, 170],
  2748. "palegreen": [152, 251, 152],
  2749. "paleturquoise": [175, 238, 238],
  2750. "palevioletred": [219, 112, 147],
  2751. "papayawhip": [255, 239, 213],
  2752. "peachpuff": [255, 218, 185],
  2753. "peru": [205, 133, 63],
  2754. "pink": [255, 192, 203],
  2755. "plum": [221, 160, 221],
  2756. "powderblue": [176, 224, 230],
  2757. "purple": [128, 0, 128],
  2758. "rebeccapurple": [102, 51, 153],
  2759. "red": [255, 0, 0],
  2760. "rosybrown": [188, 143, 143],
  2761. "royalblue": [65, 105, 225],
  2762. "saddlebrown": [139, 69, 19],
  2763. "salmon": [250, 128, 114],
  2764. "sandybrown": [244, 164, 96],
  2765. "seagreen": [46, 139, 87],
  2766. "seashell": [255, 245, 238],
  2767. "sienna": [160, 82, 45],
  2768. "silver": [192, 192, 192],
  2769. "skyblue": [135, 206, 235],
  2770. "slateblue": [106, 90, 205],
  2771. "slategray": [112, 128, 144],
  2772. "slategrey": [112, 128, 144],
  2773. "snow": [255, 250, 250],
  2774. "springgreen": [0, 255, 127],
  2775. "steelblue": [70, 130, 180],
  2776. "tan": [210, 180, 140],
  2777. "teal": [0, 128, 128],
  2778. "thistle": [216, 191, 216],
  2779. "tomato": [255, 99, 71],
  2780. "turquoise": [64, 224, 208],
  2781. "violet": [238, 130, 238],
  2782. "wheat": [245, 222, 179],
  2783. "white": [255, 255, 255],
  2784. "whitesmoke": [245, 245, 245],
  2785. "yellow": [255, 255, 0],
  2786. "yellowgreen": [154, 205, 50]
  2787. };
  2788. var conversions = createCommonjsModule(function (module) {
  2789. /* MIT license */
  2790. // NOTE: conversions should only return primitive values (i.e. arrays, or
  2791. // values that give correct `typeof` results).
  2792. // do not use box values types (i.e. Number(), String(), etc.)
  2793. var reverseKeywords = {};
  2794. for (var key in colorName) {
  2795. if (colorName.hasOwnProperty(key)) {
  2796. reverseKeywords[colorName[key]] = key;
  2797. }
  2798. }
  2799. var convert = module.exports = {
  2800. rgb: {channels: 3, labels: 'rgb'},
  2801. hsl: {channels: 3, labels: 'hsl'},
  2802. hsv: {channels: 3, labels: 'hsv'},
  2803. hwb: {channels: 3, labels: 'hwb'},
  2804. cmyk: {channels: 4, labels: 'cmyk'},
  2805. xyz: {channels: 3, labels: 'xyz'},
  2806. lab: {channels: 3, labels: 'lab'},
  2807. lch: {channels: 3, labels: 'lch'},
  2808. hex: {channels: 1, labels: ['hex']},
  2809. keyword: {channels: 1, labels: ['keyword']},
  2810. ansi16: {channels: 1, labels: ['ansi16']},
  2811. ansi256: {channels: 1, labels: ['ansi256']},
  2812. hcg: {channels: 3, labels: ['h', 'c', 'g']},
  2813. apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
  2814. gray: {channels: 1, labels: ['gray']}
  2815. };
  2816. // hide .channels and .labels properties
  2817. for (var model in convert) {
  2818. if (convert.hasOwnProperty(model)) {
  2819. if (!('channels' in convert[model])) {
  2820. throw new Error('missing channels property: ' + model);
  2821. }
  2822. if (!('labels' in convert[model])) {
  2823. throw new Error('missing channel labels property: ' + model);
  2824. }
  2825. if (convert[model].labels.length !== convert[model].channels) {
  2826. throw new Error('channel and label counts mismatch: ' + model);
  2827. }
  2828. var channels = convert[model].channels;
  2829. var labels = convert[model].labels;
  2830. delete convert[model].channels;
  2831. delete convert[model].labels;
  2832. Object.defineProperty(convert[model], 'channels', {value: channels});
  2833. Object.defineProperty(convert[model], 'labels', {value: labels});
  2834. }
  2835. }
  2836. convert.rgb.hsl = function (rgb) {
  2837. var r = rgb[0] / 255;
  2838. var g = rgb[1] / 255;
  2839. var b = rgb[2] / 255;
  2840. var min = Math.min(r, g, b);
  2841. var max = Math.max(r, g, b);
  2842. var delta = max - min;
  2843. var h;
  2844. var s;
  2845. var l;
  2846. if (max === min) {
  2847. h = 0;
  2848. } else if (r === max) {
  2849. h = (g - b) / delta;
  2850. } else if (g === max) {
  2851. h = 2 + (b - r) / delta;
  2852. } else if (b === max) {
  2853. h = 4 + (r - g) / delta;
  2854. }
  2855. h = Math.min(h * 60, 360);
  2856. if (h < 0) {
  2857. h += 360;
  2858. }
  2859. l = (min + max) / 2;
  2860. if (max === min) {
  2861. s = 0;
  2862. } else if (l <= 0.5) {
  2863. s = delta / (max + min);
  2864. } else {
  2865. s = delta / (2 - max - min);
  2866. }
  2867. return [h, s * 100, l * 100];
  2868. };
  2869. convert.rgb.hsv = function (rgb) {
  2870. var rdif;
  2871. var gdif;
  2872. var bdif;
  2873. var h;
  2874. var s;
  2875. var r = rgb[0] / 255;
  2876. var g = rgb[1] / 255;
  2877. var b = rgb[2] / 255;
  2878. var v = Math.max(r, g, b);
  2879. var diff = v - Math.min(r, g, b);
  2880. var diffc = function (c) {
  2881. return (v - c) / 6 / diff + 1 / 2;
  2882. };
  2883. if (diff === 0) {
  2884. h = s = 0;
  2885. } else {
  2886. s = diff / v;
  2887. rdif = diffc(r);
  2888. gdif = diffc(g);
  2889. bdif = diffc(b);
  2890. if (r === v) {
  2891. h = bdif - gdif;
  2892. } else if (g === v) {
  2893. h = (1 / 3) + rdif - bdif;
  2894. } else if (b === v) {
  2895. h = (2 / 3) + gdif - rdif;
  2896. }
  2897. if (h < 0) {
  2898. h += 1;
  2899. } else if (h > 1) {
  2900. h -= 1;
  2901. }
  2902. }
  2903. return [
  2904. h * 360,
  2905. s * 100,
  2906. v * 100
  2907. ];
  2908. };
  2909. convert.rgb.hwb = function (rgb) {
  2910. var r = rgb[0];
  2911. var g = rgb[1];
  2912. var b = rgb[2];
  2913. var h = convert.rgb.hsl(rgb)[0];
  2914. var w = 1 / 255 * Math.min(r, Math.min(g, b));
  2915. b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
  2916. return [h, w * 100, b * 100];
  2917. };
  2918. convert.rgb.cmyk = function (rgb) {
  2919. var r = rgb[0] / 255;
  2920. var g = rgb[1] / 255;
  2921. var b = rgb[2] / 255;
  2922. var c;
  2923. var m;
  2924. var y;
  2925. var k;
  2926. k = Math.min(1 - r, 1 - g, 1 - b);
  2927. c = (1 - r - k) / (1 - k) || 0;
  2928. m = (1 - g - k) / (1 - k) || 0;
  2929. y = (1 - b - k) / (1 - k) || 0;
  2930. return [c * 100, m * 100, y * 100, k * 100];
  2931. };
  2932. /**
  2933. * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
  2934. * */
  2935. function comparativeDistance(x, y) {
  2936. return (
  2937. Math.pow(x[0] - y[0], 2) +
  2938. Math.pow(x[1] - y[1], 2) +
  2939. Math.pow(x[2] - y[2], 2)
  2940. );
  2941. }
  2942. convert.rgb.keyword = function (rgb) {
  2943. var reversed = reverseKeywords[rgb];
  2944. if (reversed) {
  2945. return reversed;
  2946. }
  2947. var currentClosestDistance = Infinity;
  2948. var currentClosestKeyword;
  2949. for (var keyword in colorName) {
  2950. if (colorName.hasOwnProperty(keyword)) {
  2951. var value = colorName[keyword];
  2952. // Compute comparative distance
  2953. var distance = comparativeDistance(rgb, value);
  2954. // Check if its less, if so set as closest
  2955. if (distance < currentClosestDistance) {
  2956. currentClosestDistance = distance;
  2957. currentClosestKeyword = keyword;
  2958. }
  2959. }
  2960. }
  2961. return currentClosestKeyword;
  2962. };
  2963. convert.keyword.rgb = function (keyword) {
  2964. return colorName[keyword];
  2965. };
  2966. convert.rgb.xyz = function (rgb) {
  2967. var r = rgb[0] / 255;
  2968. var g = rgb[1] / 255;
  2969. var b = rgb[2] / 255;
  2970. // assume sRGB
  2971. r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);
  2972. g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);
  2973. b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);
  2974. var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
  2975. var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
  2976. var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
  2977. return [x * 100, y * 100, z * 100];
  2978. };
  2979. convert.rgb.lab = function (rgb) {
  2980. var xyz = convert.rgb.xyz(rgb);
  2981. var x = xyz[0];
  2982. var y = xyz[1];
  2983. var z = xyz[2];
  2984. var l;
  2985. var a;
  2986. var b;
  2987. x /= 95.047;
  2988. y /= 100;
  2989. z /= 108.883;
  2990. x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
  2991. y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
  2992. z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);
  2993. l = (116 * y) - 16;
  2994. a = 500 * (x - y);
  2995. b = 200 * (y - z);
  2996. return [l, a, b];
  2997. };
  2998. convert.hsl.rgb = function (hsl) {
  2999. var h = hsl[0] / 360;
  3000. var s = hsl[1] / 100;
  3001. var l = hsl[2] / 100;
  3002. var t1;
  3003. var t2;
  3004. var t3;
  3005. var rgb;
  3006. var val;
  3007. if (s === 0) {
  3008. val = l * 255;
  3009. return [val, val, val];
  3010. }
  3011. if (l < 0.5) {
  3012. t2 = l * (1 + s);
  3013. } else {
  3014. t2 = l + s - l * s;
  3015. }
  3016. t1 = 2 * l - t2;
  3017. rgb = [0, 0, 0];
  3018. for (var i = 0; i < 3; i++) {
  3019. t3 = h + 1 / 3 * -(i - 1);
  3020. if (t3 < 0) {
  3021. t3++;
  3022. }
  3023. if (t3 > 1) {
  3024. t3--;
  3025. }
  3026. if (6 * t3 < 1) {
  3027. val = t1 + (t2 - t1) * 6 * t3;
  3028. } else if (2 * t3 < 1) {
  3029. val = t2;
  3030. } else if (3 * t3 < 2) {
  3031. val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
  3032. } else {
  3033. val = t1;
  3034. }
  3035. rgb[i] = val * 255;
  3036. }
  3037. return rgb;
  3038. };
  3039. convert.hsl.hsv = function (hsl) {
  3040. var h = hsl[0];
  3041. var s = hsl[1] / 100;
  3042. var l = hsl[2] / 100;
  3043. var smin = s;
  3044. var lmin = Math.max(l, 0.01);
  3045. var sv;
  3046. var v;
  3047. l *= 2;
  3048. s *= (l <= 1) ? l : 2 - l;
  3049. smin *= lmin <= 1 ? lmin : 2 - lmin;
  3050. v = (l + s) / 2;
  3051. sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
  3052. return [h, sv * 100, v * 100];
  3053. };
  3054. convert.hsv.rgb = function (hsv) {
  3055. var h = hsv[0] / 60;
  3056. var s = hsv[1] / 100;
  3057. var v = hsv[2] / 100;
  3058. var hi = Math.floor(h) % 6;
  3059. var f = h - Math.floor(h);
  3060. var p = 255 * v * (1 - s);
  3061. var q = 255 * v * (1 - (s * f));
  3062. var t = 255 * v * (1 - (s * (1 - f)));
  3063. v *= 255;
  3064. switch (hi) {
  3065. case 0:
  3066. return [v, t, p];
  3067. case 1:
  3068. return [q, v, p];
  3069. case 2:
  3070. return [p, v, t];
  3071. case 3:
  3072. return [p, q, v];
  3073. case 4:
  3074. return [t, p, v];
  3075. case 5:
  3076. return [v, p, q];
  3077. }
  3078. };
  3079. convert.hsv.hsl = function (hsv) {
  3080. var h = hsv[0];
  3081. var s = hsv[1] / 100;
  3082. var v = hsv[2] / 100;
  3083. var vmin = Math.max(v, 0.01);
  3084. var lmin;
  3085. var sl;
  3086. var l;
  3087. l = (2 - s) * v;
  3088. lmin = (2 - s) * vmin;
  3089. sl = s * vmin;
  3090. sl /= (lmin <= 1) ? lmin : 2 - lmin;
  3091. sl = sl || 0;
  3092. l /= 2;
  3093. return [h, sl * 100, l * 100];
  3094. };
  3095. // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
  3096. convert.hwb.rgb = function (hwb) {
  3097. var h = hwb[0] / 360;
  3098. var wh = hwb[1] / 100;
  3099. var bl = hwb[2] / 100;
  3100. var ratio = wh + bl;
  3101. var i;
  3102. var v;
  3103. var f;
  3104. var n;
  3105. // wh + bl cant be > 1
  3106. if (ratio > 1) {
  3107. wh /= ratio;
  3108. bl /= ratio;
  3109. }
  3110. i = Math.floor(6 * h);
  3111. v = 1 - bl;
  3112. f = 6 * h - i;
  3113. if ((i & 0x01) !== 0) {
  3114. f = 1 - f;
  3115. }
  3116. n = wh + f * (v - wh); // linear interpolation
  3117. var r;
  3118. var g;
  3119. var b;
  3120. switch (i) {
  3121. default:
  3122. case 6:
  3123. case 0: r = v; g = n; b = wh; break;
  3124. case 1: r = n; g = v; b = wh; break;
  3125. case 2: r = wh; g = v; b = n; break;
  3126. case 3: r = wh; g = n; b = v; break;
  3127. case 4: r = n; g = wh; b = v; break;
  3128. case 5: r = v; g = wh; b = n; break;
  3129. }
  3130. return [r * 255, g * 255, b * 255];
  3131. };
  3132. convert.cmyk.rgb = function (cmyk) {
  3133. var c = cmyk[0] / 100;
  3134. var m = cmyk[1] / 100;
  3135. var y = cmyk[2] / 100;
  3136. var k = cmyk[3] / 100;
  3137. var r;
  3138. var g;
  3139. var b;
  3140. r = 1 - Math.min(1, c * (1 - k) + k);
  3141. g = 1 - Math.min(1, m * (1 - k) + k);
  3142. b = 1 - Math.min(1, y * (1 - k) + k);
  3143. return [r * 255, g * 255, b * 255];
  3144. };
  3145. convert.xyz.rgb = function (xyz) {
  3146. var x = xyz[0] / 100;
  3147. var y = xyz[1] / 100;
  3148. var z = xyz[2] / 100;
  3149. var r;
  3150. var g;
  3151. var b;
  3152. r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
  3153. g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
  3154. b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
  3155. // assume sRGB
  3156. r = r > 0.0031308
  3157. ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)
  3158. : r * 12.92;
  3159. g = g > 0.0031308
  3160. ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)
  3161. : g * 12.92;
  3162. b = b > 0.0031308
  3163. ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)
  3164. : b * 12.92;
  3165. r = Math.min(Math.max(0, r), 1);
  3166. g = Math.min(Math.max(0, g), 1);
  3167. b = Math.min(Math.max(0, b), 1);
  3168. return [r * 255, g * 255, b * 255];
  3169. };
  3170. convert.xyz.lab = function (xyz) {
  3171. var x = xyz[0];
  3172. var y = xyz[1];
  3173. var z = xyz[2];
  3174. var l;
  3175. var a;
  3176. var b;
  3177. x /= 95.047;
  3178. y /= 100;
  3179. z /= 108.883;
  3180. x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
  3181. y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
  3182. z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);
  3183. l = (116 * y) - 16;
  3184. a = 500 * (x - y);
  3185. b = 200 * (y - z);
  3186. return [l, a, b];
  3187. };
  3188. convert.lab.xyz = function (lab) {
  3189. var l = lab[0];
  3190. var a = lab[1];
  3191. var b = lab[2];
  3192. var x;
  3193. var y;
  3194. var z;
  3195. y = (l + 16) / 116;
  3196. x = a / 500 + y;
  3197. z = y - b / 200;
  3198. var y2 = Math.pow(y, 3);
  3199. var x2 = Math.pow(x, 3);
  3200. var z2 = Math.pow(z, 3);
  3201. y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
  3202. x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
  3203. z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
  3204. x *= 95.047;
  3205. y *= 100;
  3206. z *= 108.883;
  3207. return [x, y, z];
  3208. };
  3209. convert.lab.lch = function (lab) {
  3210. var l = lab[0];
  3211. var a = lab[1];
  3212. var b = lab[2];
  3213. var hr;
  3214. var h;
  3215. var c;
  3216. hr = Math.atan2(b, a);
  3217. h = hr * 360 / 2 / Math.PI;
  3218. if (h < 0) {
  3219. h += 360;
  3220. }
  3221. c = Math.sqrt(a * a + b * b);
  3222. return [l, c, h];
  3223. };
  3224. convert.lch.lab = function (lch) {
  3225. var l = lch[0];
  3226. var c = lch[1];
  3227. var h = lch[2];
  3228. var a;
  3229. var b;
  3230. var hr;
  3231. hr = h / 360 * 2 * Math.PI;
  3232. a = c * Math.cos(hr);
  3233. b = c * Math.sin(hr);
  3234. return [l, a, b];
  3235. };
  3236. convert.rgb.ansi16 = function (args) {
  3237. var r = args[0];
  3238. var g = args[1];
  3239. var b = args[2];
  3240. var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization
  3241. value = Math.round(value / 50);
  3242. if (value === 0) {
  3243. return 30;
  3244. }
  3245. var ansi = 30
  3246. + ((Math.round(b / 255) << 2)
  3247. | (Math.round(g / 255) << 1)
  3248. | Math.round(r / 255));
  3249. if (value === 2) {
  3250. ansi += 60;
  3251. }
  3252. return ansi;
  3253. };
  3254. convert.hsv.ansi16 = function (args) {
  3255. // optimization here; we already know the value and don't need to get
  3256. // it converted for us.
  3257. return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
  3258. };
  3259. convert.rgb.ansi256 = function (args) {
  3260. var r = args[0];
  3261. var g = args[1];
  3262. var b = args[2];
  3263. // we use the extended greyscale palette here, with the exception of
  3264. // black and white. normal palette only has 4 greyscale shades.
  3265. if (r === g && g === b) {
  3266. if (r < 8) {
  3267. return 16;
  3268. }
  3269. if (r > 248) {
  3270. return 231;
  3271. }
  3272. return Math.round(((r - 8) / 247) * 24) + 232;
  3273. }
  3274. var ansi = 16
  3275. + (36 * Math.round(r / 255 * 5))
  3276. + (6 * Math.round(g / 255 * 5))
  3277. + Math.round(b / 255 * 5);
  3278. return ansi;
  3279. };
  3280. convert.ansi16.rgb = function (args) {
  3281. var color = args % 10;
  3282. // handle greyscale
  3283. if (color === 0 || color === 7) {
  3284. if (args > 50) {
  3285. color += 3.5;
  3286. }
  3287. color = color / 10.5 * 255;
  3288. return [color, color, color];
  3289. }
  3290. var mult = (~~(args > 50) + 1) * 0.5;
  3291. var r = ((color & 1) * mult) * 255;
  3292. var g = (((color >> 1) & 1) * mult) * 255;
  3293. var b = (((color >> 2) & 1) * mult) * 255;
  3294. return [r, g, b];
  3295. };
  3296. convert.ansi256.rgb = function (args) {
  3297. // handle greyscale
  3298. if (args >= 232) {
  3299. var c = (args - 232) * 10 + 8;
  3300. return [c, c, c];
  3301. }
  3302. args -= 16;
  3303. var rem;
  3304. var r = Math.floor(args / 36) / 5 * 255;
  3305. var g = Math.floor((rem = args % 36) / 6) / 5 * 255;
  3306. var b = (rem % 6) / 5 * 255;
  3307. return [r, g, b];
  3308. };
  3309. convert.rgb.hex = function (args) {
  3310. var integer = ((Math.round(args[0]) & 0xFF) << 16)
  3311. + ((Math.round(args[1]) & 0xFF) << 8)
  3312. + (Math.round(args[2]) & 0xFF);
  3313. var string = integer.toString(16).toUpperCase();
  3314. return '000000'.substring(string.length) + string;
  3315. };
  3316. convert.hex.rgb = function (args) {
  3317. var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
  3318. if (!match) {
  3319. return [0, 0, 0];
  3320. }
  3321. var colorString = match[0];
  3322. if (match[0].length === 3) {
  3323. colorString = colorString.split('').map(function (char) {
  3324. return char + char;
  3325. }).join('');
  3326. }
  3327. var integer = parseInt(colorString, 16);
  3328. var r = (integer >> 16) & 0xFF;
  3329. var g = (integer >> 8) & 0xFF;
  3330. var b = integer & 0xFF;
  3331. return [r, g, b];
  3332. };
  3333. convert.rgb.hcg = function (rgb) {
  3334. var r = rgb[0] / 255;
  3335. var g = rgb[1] / 255;
  3336. var b = rgb[2] / 255;
  3337. var max = Math.max(Math.max(r, g), b);
  3338. var min = Math.min(Math.min(r, g), b);
  3339. var chroma = (max - min);
  3340. var grayscale;
  3341. var hue;
  3342. if (chroma < 1) {
  3343. grayscale = min / (1 - chroma);
  3344. } else {
  3345. grayscale = 0;
  3346. }
  3347. if (chroma <= 0) {
  3348. hue = 0;
  3349. } else
  3350. if (max === r) {
  3351. hue = ((g - b) / chroma) % 6;
  3352. } else
  3353. if (max === g) {
  3354. hue = 2 + (b - r) / chroma;
  3355. } else {
  3356. hue = 4 + (r - g) / chroma + 4;
  3357. }
  3358. hue /= 6;
  3359. hue %= 1;
  3360. return [hue * 360, chroma * 100, grayscale * 100];
  3361. };
  3362. convert.hsl.hcg = function (hsl) {
  3363. var s = hsl[1] / 100;
  3364. var l = hsl[2] / 100;
  3365. var c = 1;
  3366. var f = 0;
  3367. if (l < 0.5) {
  3368. c = 2.0 * s * l;
  3369. } else {
  3370. c = 2.0 * s * (1.0 - l);
  3371. }
  3372. if (c < 1.0) {
  3373. f = (l - 0.5 * c) / (1.0 - c);
  3374. }
  3375. return [hsl[0], c * 100, f * 100];
  3376. };
  3377. convert.hsv.hcg = function (hsv) {
  3378. var s = hsv[1] / 100;
  3379. var v = hsv[2] / 100;
  3380. var c = s * v;
  3381. var f = 0;
  3382. if (c < 1.0) {
  3383. f = (v - c) / (1 - c);
  3384. }
  3385. return [hsv[0], c * 100, f * 100];
  3386. };
  3387. convert.hcg.rgb = function (hcg) {
  3388. var h = hcg[0] / 360;
  3389. var c = hcg[1] / 100;
  3390. var g = hcg[2] / 100;
  3391. if (c === 0.0) {
  3392. return [g * 255, g * 255, g * 255];
  3393. }
  3394. var pure = [0, 0, 0];
  3395. var hi = (h % 1) * 6;
  3396. var v = hi % 1;
  3397. var w = 1 - v;
  3398. var mg = 0;
  3399. switch (Math.floor(hi)) {
  3400. case 0:
  3401. pure[0] = 1; pure[1] = v; pure[2] = 0; break;
  3402. case 1:
  3403. pure[0] = w; pure[1] = 1; pure[2] = 0; break;
  3404. case 2:
  3405. pure[0] = 0; pure[1] = 1; pure[2] = v; break;
  3406. case 3:
  3407. pure[0] = 0; pure[1] = w; pure[2] = 1; break;
  3408. case 4:
  3409. pure[0] = v; pure[1] = 0; pure[2] = 1; break;
  3410. default:
  3411. pure[0] = 1; pure[1] = 0; pure[2] = w;
  3412. }
  3413. mg = (1.0 - c) * g;
  3414. return [
  3415. (c * pure[0] + mg) * 255,
  3416. (c * pure[1] + mg) * 255,
  3417. (c * pure[2] + mg) * 255
  3418. ];
  3419. };
  3420. convert.hcg.hsv = function (hcg) {
  3421. var c = hcg[1] / 100;
  3422. var g = hcg[2] / 100;
  3423. var v = c + g * (1.0 - c);
  3424. var f = 0;
  3425. if (v > 0.0) {
  3426. f = c / v;
  3427. }
  3428. return [hcg[0], f * 100, v * 100];
  3429. };
  3430. convert.hcg.hsl = function (hcg) {
  3431. var c = hcg[1] / 100;
  3432. var g = hcg[2] / 100;
  3433. var l = g * (1.0 - c) + 0.5 * c;
  3434. var s = 0;
  3435. if (l > 0.0 && l < 0.5) {
  3436. s = c / (2 * l);
  3437. } else
  3438. if (l >= 0.5 && l < 1.0) {
  3439. s = c / (2 * (1 - l));
  3440. }
  3441. return [hcg[0], s * 100, l * 100];
  3442. };
  3443. convert.hcg.hwb = function (hcg) {
  3444. var c = hcg[1] / 100;
  3445. var g = hcg[2] / 100;
  3446. var v = c + g * (1.0 - c);
  3447. return [hcg[0], (v - c) * 100, (1 - v) * 100];
  3448. };
  3449. convert.hwb.hcg = function (hwb) {
  3450. var w = hwb[1] / 100;
  3451. var b = hwb[2] / 100;
  3452. var v = 1 - b;
  3453. var c = v - w;
  3454. var g = 0;
  3455. if (c < 1) {
  3456. g = (v - c) / (1 - c);
  3457. }
  3458. return [hwb[0], c * 100, g * 100];
  3459. };
  3460. convert.apple.rgb = function (apple) {
  3461. return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
  3462. };
  3463. convert.rgb.apple = function (rgb) {
  3464. return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
  3465. };
  3466. convert.gray.rgb = function (args) {
  3467. return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
  3468. };
  3469. convert.gray.hsl = convert.gray.hsv = function (args) {
  3470. return [0, 0, args[0]];
  3471. };
  3472. convert.gray.hwb = function (gray) {
  3473. return [0, 100, gray[0]];
  3474. };
  3475. convert.gray.cmyk = function (gray) {
  3476. return [0, 0, 0, gray[0]];
  3477. };
  3478. convert.gray.lab = function (gray) {
  3479. return [gray[0], 0, 0];
  3480. };
  3481. convert.gray.hex = function (gray) {
  3482. var val = Math.round(gray[0] / 100 * 255) & 0xFF;
  3483. var integer = (val << 16) + (val << 8) + val;
  3484. var string = integer.toString(16).toUpperCase();
  3485. return '000000'.substring(string.length) + string;
  3486. };
  3487. convert.rgb.gray = function (rgb) {
  3488. var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
  3489. return [val / 255 * 100];
  3490. };
  3491. });
  3492. var conversions_1 = conversions.rgb;
  3493. var conversions_2 = conversions.hsl;
  3494. var conversions_3 = conversions.hsv;
  3495. var conversions_4 = conversions.hwb;
  3496. var conversions_5 = conversions.cmyk;
  3497. var conversions_6 = conversions.xyz;
  3498. var conversions_7 = conversions.lab;
  3499. var conversions_8 = conversions.lch;
  3500. var conversions_9 = conversions.hex;
  3501. var conversions_10 = conversions.keyword;
  3502. var conversions_11 = conversions.ansi16;
  3503. var conversions_12 = conversions.ansi256;
  3504. var conversions_13 = conversions.hcg;
  3505. var conversions_14 = conversions.apple;
  3506. var conversions_15 = conversions.gray;
  3507. /*
  3508. this function routes a model to all other models.
  3509. all functions that are routed have a property `.conversion` attached
  3510. to the returned synthetic function. This property is an array
  3511. of strings, each with the steps in between the 'from' and 'to'
  3512. color models (inclusive).
  3513. conversions that are not possible simply are not included.
  3514. */
  3515. function buildGraph() {
  3516. var graph = {};
  3517. // https://jsperf.com/object-keys-vs-for-in-with-closure/3
  3518. var models = Object.keys(conversions);
  3519. for (var len = models.length, i = 0; i < len; i++) {
  3520. graph[models[i]] = {
  3521. // http://jsperf.com/1-vs-infinity
  3522. // micro-opt, but this is simple.
  3523. distance: -1,
  3524. parent: null
  3525. };
  3526. }
  3527. return graph;
  3528. }
  3529. // https://en.wikipedia.org/wiki/Breadth-first_search
  3530. function deriveBFS(fromModel) {
  3531. var graph = buildGraph();
  3532. var queue = [fromModel]; // unshift -> queue -> pop
  3533. graph[fromModel].distance = 0;
  3534. while (queue.length) {
  3535. var current = queue.pop();
  3536. var adjacents = Object.keys(conversions[current]);
  3537. for (var len = adjacents.length, i = 0; i < len; i++) {
  3538. var adjacent = adjacents[i];
  3539. var node = graph[adjacent];
  3540. if (node.distance === -1) {
  3541. node.distance = graph[current].distance + 1;
  3542. node.parent = current;
  3543. queue.unshift(adjacent);
  3544. }
  3545. }
  3546. }
  3547. return graph;
  3548. }
  3549. function link(from, to) {
  3550. return function (args) {
  3551. return to(from(args));
  3552. };
  3553. }
  3554. function wrapConversion(toModel, graph) {
  3555. var path = [graph[toModel].parent, toModel];
  3556. var fn = conversions[graph[toModel].parent][toModel];
  3557. var cur = graph[toModel].parent;
  3558. while (graph[cur].parent) {
  3559. path.unshift(graph[cur].parent);
  3560. fn = link(conversions[graph[cur].parent][cur], fn);
  3561. cur = graph[cur].parent;
  3562. }
  3563. fn.conversion = path;
  3564. return fn;
  3565. }
  3566. var route = function (fromModel) {
  3567. var graph = deriveBFS(fromModel);
  3568. var conversion = {};
  3569. var models = Object.keys(graph);
  3570. for (var len = models.length, i = 0; i < len; i++) {
  3571. var toModel = models[i];
  3572. var node = graph[toModel];
  3573. if (node.parent === null) {
  3574. // no possible conversion, or this node is the source model.
  3575. continue;
  3576. }
  3577. conversion[toModel] = wrapConversion(toModel, graph);
  3578. }
  3579. return conversion;
  3580. };
  3581. var convert = {};
  3582. var models = Object.keys(conversions);
  3583. function wrapRaw(fn) {
  3584. var wrappedFn = function (args) {
  3585. if (args === undefined || args === null) {
  3586. return args;
  3587. }
  3588. if (arguments.length > 1) {
  3589. args = Array.prototype.slice.call(arguments);
  3590. }
  3591. return fn(args);
  3592. };
  3593. // preserve .conversion property if there is one
  3594. if ('conversion' in fn) {
  3595. wrappedFn.conversion = fn.conversion;
  3596. }
  3597. return wrappedFn;
  3598. }
  3599. function wrapRounded(fn) {
  3600. var wrappedFn = function (args) {
  3601. if (args === undefined || args === null) {
  3602. return args;
  3603. }
  3604. if (arguments.length > 1) {
  3605. args = Array.prototype.slice.call(arguments);
  3606. }
  3607. var result = fn(args);
  3608. // we're assuming the result is an array here.
  3609. // see notice in conversions.js; don't use box types
  3610. // in conversion functions.
  3611. if (typeof result === 'object') {
  3612. for (var len = result.length, i = 0; i < len; i++) {
  3613. result[i] = Math.round(result[i]);
  3614. }
  3615. }
  3616. return result;
  3617. };
  3618. // preserve .conversion property if there is one
  3619. if ('conversion' in fn) {
  3620. wrappedFn.conversion = fn.conversion;
  3621. }
  3622. return wrappedFn;
  3623. }
  3624. models.forEach(function (fromModel) {
  3625. convert[fromModel] = {};
  3626. Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
  3627. Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
  3628. var routes = route(fromModel);
  3629. var routeModels = Object.keys(routes);
  3630. routeModels.forEach(function (toModel) {
  3631. var fn = routes[toModel];
  3632. convert[fromModel][toModel] = wrapRounded(fn);
  3633. convert[fromModel][toModel].raw = wrapRaw(fn);
  3634. });
  3635. });
  3636. var colorConvert = convert;
  3637. var colorName$1 = {
  3638. "aliceblue": [240, 248, 255],
  3639. "antiquewhite": [250, 235, 215],
  3640. "aqua": [0, 255, 255],
  3641. "aquamarine": [127, 255, 212],
  3642. "azure": [240, 255, 255],
  3643. "beige": [245, 245, 220],
  3644. "bisque": [255, 228, 196],
  3645. "black": [0, 0, 0],
  3646. "blanchedalmond": [255, 235, 205],
  3647. "blue": [0, 0, 255],
  3648. "blueviolet": [138, 43, 226],
  3649. "brown": [165, 42, 42],
  3650. "burlywood": [222, 184, 135],
  3651. "cadetblue": [95, 158, 160],
  3652. "chartreuse": [127, 255, 0],
  3653. "chocolate": [210, 105, 30],
  3654. "coral": [255, 127, 80],
  3655. "cornflowerblue": [100, 149, 237],
  3656. "cornsilk": [255, 248, 220],
  3657. "crimson": [220, 20, 60],
  3658. "cyan": [0, 255, 255],
  3659. "darkblue": [0, 0, 139],
  3660. "darkcyan": [0, 139, 139],
  3661. "darkgoldenrod": [184, 134, 11],
  3662. "darkgray": [169, 169, 169],
  3663. "darkgreen": [0, 100, 0],
  3664. "darkgrey": [169, 169, 169],
  3665. "darkkhaki": [189, 183, 107],
  3666. "darkmagenta": [139, 0, 139],
  3667. "darkolivegreen": [85, 107, 47],
  3668. "darkorange": [255, 140, 0],
  3669. "darkorchid": [153, 50, 204],
  3670. "darkred": [139, 0, 0],
  3671. "darksalmon": [233, 150, 122],
  3672. "darkseagreen": [143, 188, 143],
  3673. "darkslateblue": [72, 61, 139],
  3674. "darkslategray": [47, 79, 79],
  3675. "darkslategrey": [47, 79, 79],
  3676. "darkturquoise": [0, 206, 209],
  3677. "darkviolet": [148, 0, 211],
  3678. "deeppink": [255, 20, 147],
  3679. "deepskyblue": [0, 191, 255],
  3680. "dimgray": [105, 105, 105],
  3681. "dimgrey": [105, 105, 105],
  3682. "dodgerblue": [30, 144, 255],
  3683. "firebrick": [178, 34, 34],
  3684. "floralwhite": [255, 250, 240],
  3685. "forestgreen": [34, 139, 34],
  3686. "fuchsia": [255, 0, 255],
  3687. "gainsboro": [220, 220, 220],
  3688. "ghostwhite": [248, 248, 255],
  3689. "gold": [255, 215, 0],
  3690. "goldenrod": [218, 165, 32],
  3691. "gray": [128, 128, 128],
  3692. "green": [0, 128, 0],
  3693. "greenyellow": [173, 255, 47],
  3694. "grey": [128, 128, 128],
  3695. "honeydew": [240, 255, 240],
  3696. "hotpink": [255, 105, 180],
  3697. "indianred": [205, 92, 92],
  3698. "indigo": [75, 0, 130],
  3699. "ivory": [255, 255, 240],
  3700. "khaki": [240, 230, 140],
  3701. "lavender": [230, 230, 250],
  3702. "lavenderblush": [255, 240, 245],
  3703. "lawngreen": [124, 252, 0],
  3704. "lemonchiffon": [255, 250, 205],
  3705. "lightblue": [173, 216, 230],
  3706. "lightcoral": [240, 128, 128],
  3707. "lightcyan": [224, 255, 255],
  3708. "lightgoldenrodyellow": [250, 250, 210],
  3709. "lightgray": [211, 211, 211],
  3710. "lightgreen": [144, 238, 144],
  3711. "lightgrey": [211, 211, 211],
  3712. "lightpink": [255, 182, 193],
  3713. "lightsalmon": [255, 160, 122],
  3714. "lightseagreen": [32, 178, 170],
  3715. "lightskyblue": [135, 206, 250],
  3716. "lightslategray": [119, 136, 153],
  3717. "lightslategrey": [119, 136, 153],
  3718. "lightsteelblue": [176, 196, 222],
  3719. "lightyellow": [255, 255, 224],
  3720. "lime": [0, 255, 0],
  3721. "limegreen": [50, 205, 50],
  3722. "linen": [250, 240, 230],
  3723. "magenta": [255, 0, 255],
  3724. "maroon": [128, 0, 0],
  3725. "mediumaquamarine": [102, 205, 170],
  3726. "mediumblue": [0, 0, 205],
  3727. "mediumorchid": [186, 85, 211],
  3728. "mediumpurple": [147, 112, 219],
  3729. "mediumseagreen": [60, 179, 113],
  3730. "mediumslateblue": [123, 104, 238],
  3731. "mediumspringgreen": [0, 250, 154],
  3732. "mediumturquoise": [72, 209, 204],
  3733. "mediumvioletred": [199, 21, 133],
  3734. "midnightblue": [25, 25, 112],
  3735. "mintcream": [245, 255, 250],
  3736. "mistyrose": [255, 228, 225],
  3737. "moccasin": [255, 228, 181],
  3738. "navajowhite": [255, 222, 173],
  3739. "navy": [0, 0, 128],
  3740. "oldlace": [253, 245, 230],
  3741. "olive": [128, 128, 0],
  3742. "olivedrab": [107, 142, 35],
  3743. "orange": [255, 165, 0],
  3744. "orangered": [255, 69, 0],
  3745. "orchid": [218, 112, 214],
  3746. "palegoldenrod": [238, 232, 170],
  3747. "palegreen": [152, 251, 152],
  3748. "paleturquoise": [175, 238, 238],
  3749. "palevioletred": [219, 112, 147],
  3750. "papayawhip": [255, 239, 213],
  3751. "peachpuff": [255, 218, 185],
  3752. "peru": [205, 133, 63],
  3753. "pink": [255, 192, 203],
  3754. "plum": [221, 160, 221],
  3755. "powderblue": [176, 224, 230],
  3756. "purple": [128, 0, 128],
  3757. "rebeccapurple": [102, 51, 153],
  3758. "red": [255, 0, 0],
  3759. "rosybrown": [188, 143, 143],
  3760. "royalblue": [65, 105, 225],
  3761. "saddlebrown": [139, 69, 19],
  3762. "salmon": [250, 128, 114],
  3763. "sandybrown": [244, 164, 96],
  3764. "seagreen": [46, 139, 87],
  3765. "seashell": [255, 245, 238],
  3766. "sienna": [160, 82, 45],
  3767. "silver": [192, 192, 192],
  3768. "skyblue": [135, 206, 235],
  3769. "slateblue": [106, 90, 205],
  3770. "slategray": [112, 128, 144],
  3771. "slategrey": [112, 128, 144],
  3772. "snow": [255, 250, 250],
  3773. "springgreen": [0, 255, 127],
  3774. "steelblue": [70, 130, 180],
  3775. "tan": [210, 180, 140],
  3776. "teal": [0, 128, 128],
  3777. "thistle": [216, 191, 216],
  3778. "tomato": [255, 99, 71],
  3779. "turquoise": [64, 224, 208],
  3780. "violet": [238, 130, 238],
  3781. "wheat": [245, 222, 179],
  3782. "white": [255, 255, 255],
  3783. "whitesmoke": [245, 245, 245],
  3784. "yellow": [255, 255, 0],
  3785. "yellowgreen": [154, 205, 50]
  3786. };
  3787. /* MIT license */
  3788. var colorString = {
  3789. getRgba: getRgba,
  3790. getHsla: getHsla,
  3791. getRgb: getRgb,
  3792. getHsl: getHsl,
  3793. getHwb: getHwb,
  3794. getAlpha: getAlpha,
  3795. hexString: hexString,
  3796. rgbString: rgbString,
  3797. rgbaString: rgbaString,
  3798. percentString: percentString,
  3799. percentaString: percentaString,
  3800. hslString: hslString,
  3801. hslaString: hslaString,
  3802. hwbString: hwbString,
  3803. keyword: keyword
  3804. };
  3805. function getRgba(string) {
  3806. if (!string) {
  3807. return;
  3808. }
  3809. var abbr = /^#([a-fA-F0-9]{3,4})$/i,
  3810. hex = /^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i,
  3811. rgba = /^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,
  3812. per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,
  3813. keyword = /(\w+)/;
  3814. var rgb = [0, 0, 0],
  3815. a = 1,
  3816. match = string.match(abbr),
  3817. hexAlpha = "";
  3818. if (match) {
  3819. match = match[1];
  3820. hexAlpha = match[3];
  3821. for (var i = 0; i < rgb.length; i++) {
  3822. rgb[i] = parseInt(match[i] + match[i], 16);
  3823. }
  3824. if (hexAlpha) {
  3825. a = Math.round((parseInt(hexAlpha + hexAlpha, 16) / 255) * 100) / 100;
  3826. }
  3827. }
  3828. else if (match = string.match(hex)) {
  3829. hexAlpha = match[2];
  3830. match = match[1];
  3831. for (var i = 0; i < rgb.length; i++) {
  3832. rgb[i] = parseInt(match.slice(i * 2, i * 2 + 2), 16);
  3833. }
  3834. if (hexAlpha) {
  3835. a = Math.round((parseInt(hexAlpha, 16) / 255) * 100) / 100;
  3836. }
  3837. }
  3838. else if (match = string.match(rgba)) {
  3839. for (var i = 0; i < rgb.length; i++) {
  3840. rgb[i] = parseInt(match[i + 1]);
  3841. }
  3842. a = parseFloat(match[4]);
  3843. }
  3844. else if (match = string.match(per)) {
  3845. for (var i = 0; i < rgb.length; i++) {
  3846. rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
  3847. }
  3848. a = parseFloat(match[4]);
  3849. }
  3850. else if (match = string.match(keyword)) {
  3851. if (match[1] == "transparent") {
  3852. return [0, 0, 0, 0];
  3853. }
  3854. rgb = colorName$1[match[1]];
  3855. if (!rgb) {
  3856. return;
  3857. }
  3858. }
  3859. for (var i = 0; i < rgb.length; i++) {
  3860. rgb[i] = scale(rgb[i], 0, 255);
  3861. }
  3862. if (!a && a != 0) {
  3863. a = 1;
  3864. }
  3865. else {
  3866. a = scale(a, 0, 1);
  3867. }
  3868. rgb[3] = a;
  3869. return rgb;
  3870. }
  3871. function getHsla(string) {
  3872. if (!string) {
  3873. return;
  3874. }
  3875. var hsl = /^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/;
  3876. var match = string.match(hsl);
  3877. if (match) {
  3878. var alpha = parseFloat(match[4]);
  3879. var h = scale(parseInt(match[1]), 0, 360),
  3880. s = scale(parseFloat(match[2]), 0, 100),
  3881. l = scale(parseFloat(match[3]), 0, 100),
  3882. a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);
  3883. return [h, s, l, a];
  3884. }
  3885. }
  3886. function getHwb(string) {
  3887. if (!string) {
  3888. return;
  3889. }
  3890. var hwb = /^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/;
  3891. var match = string.match(hwb);
  3892. if (match) {
  3893. var alpha = parseFloat(match[4]);
  3894. var h = scale(parseInt(match[1]), 0, 360),
  3895. w = scale(parseFloat(match[2]), 0, 100),
  3896. b = scale(parseFloat(match[3]), 0, 100),
  3897. a = scale(isNaN(alpha) ? 1 : alpha, 0, 1);
  3898. return [h, w, b, a];
  3899. }
  3900. }
  3901. function getRgb(string) {
  3902. var rgba = getRgba(string);
  3903. return rgba && rgba.slice(0, 3);
  3904. }
  3905. function getHsl(string) {
  3906. var hsla = getHsla(string);
  3907. return hsla && hsla.slice(0, 3);
  3908. }
  3909. function getAlpha(string) {
  3910. var vals = getRgba(string);
  3911. if (vals) {
  3912. return vals[3];
  3913. }
  3914. else if (vals = getHsla(string)) {
  3915. return vals[3];
  3916. }
  3917. else if (vals = getHwb(string)) {
  3918. return vals[3];
  3919. }
  3920. }
  3921. // generators
  3922. function hexString(rgba, a) {
  3923. var a = (a !== undefined && rgba.length === 3) ? a : rgba[3];
  3924. return "#" + hexDouble(rgba[0])
  3925. + hexDouble(rgba[1])
  3926. + hexDouble(rgba[2])
  3927. + (
  3928. (a >= 0 && a < 1)
  3929. ? hexDouble(Math.round(a * 255))
  3930. : ""
  3931. );
  3932. }
  3933. function rgbString(rgba, alpha) {
  3934. if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {
  3935. return rgbaString(rgba, alpha);
  3936. }
  3937. return "rgb(" + rgba[0] + ", " + rgba[1] + ", " + rgba[2] + ")";
  3938. }
  3939. function rgbaString(rgba, alpha) {
  3940. if (alpha === undefined) {
  3941. alpha = (rgba[3] !== undefined ? rgba[3] : 1);
  3942. }
  3943. return "rgba(" + rgba[0] + ", " + rgba[1] + ", " + rgba[2]
  3944. + ", " + alpha + ")";
  3945. }
  3946. function percentString(rgba, alpha) {
  3947. if (alpha < 1 || (rgba[3] && rgba[3] < 1)) {
  3948. return percentaString(rgba, alpha);
  3949. }
  3950. var r = Math.round(rgba[0]/255 * 100),
  3951. g = Math.round(rgba[1]/255 * 100),
  3952. b = Math.round(rgba[2]/255 * 100);
  3953. return "rgb(" + r + "%, " + g + "%, " + b + "%)";
  3954. }
  3955. function percentaString(rgba, alpha) {
  3956. var r = Math.round(rgba[0]/255 * 100),
  3957. g = Math.round(rgba[1]/255 * 100),
  3958. b = Math.round(rgba[2]/255 * 100);
  3959. return "rgba(" + r + "%, " + g + "%, " + b + "%, " + (alpha || rgba[3] || 1) + ")";
  3960. }
  3961. function hslString(hsla, alpha) {
  3962. if (alpha < 1 || (hsla[3] && hsla[3] < 1)) {
  3963. return hslaString(hsla, alpha);
  3964. }
  3965. return "hsl(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%)";
  3966. }
  3967. function hslaString(hsla, alpha) {
  3968. if (alpha === undefined) {
  3969. alpha = (hsla[3] !== undefined ? hsla[3] : 1);
  3970. }
  3971. return "hsla(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%, "
  3972. + alpha + ")";
  3973. }
  3974. // hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax
  3975. // (hwb have alpha optional & 1 is default value)
  3976. function hwbString(hwb, alpha) {
  3977. if (alpha === undefined) {
  3978. alpha = (hwb[3] !== undefined ? hwb[3] : 1);
  3979. }
  3980. return "hwb(" + hwb[0] + ", " + hwb[1] + "%, " + hwb[2] + "%"
  3981. + (alpha !== undefined && alpha !== 1 ? ", " + alpha : "") + ")";
  3982. }
  3983. function keyword(rgb) {
  3984. return reverseNames[rgb.slice(0, 3)];
  3985. }
  3986. // helpers
  3987. function scale(num, min, max) {
  3988. return Math.min(Math.max(min, num), max);
  3989. }
  3990. function hexDouble(num) {
  3991. var str = num.toString(16).toUpperCase();
  3992. return (str.length < 2) ? "0" + str : str;
  3993. }
  3994. //create a list of reverse color names
  3995. var reverseNames = {};
  3996. for (var name in colorName$1) {
  3997. reverseNames[colorName$1[name]] = name;
  3998. }
  3999. /* MIT license */
  4000. var Color = function (obj) {
  4001. if (obj instanceof Color) {
  4002. return obj;
  4003. }
  4004. if (!(this instanceof Color)) {
  4005. return new Color(obj);
  4006. }
  4007. this.valid = false;
  4008. this.values = {
  4009. rgb: [0, 0, 0],
  4010. hsl: [0, 0, 0],
  4011. hsv: [0, 0, 0],
  4012. hwb: [0, 0, 0],
  4013. cmyk: [0, 0, 0, 0],
  4014. alpha: 1
  4015. };
  4016. // parse Color() argument
  4017. var vals;
  4018. if (typeof obj === 'string') {
  4019. vals = colorString.getRgba(obj);
  4020. if (vals) {
  4021. this.setValues('rgb', vals);
  4022. } else if (vals = colorString.getHsla(obj)) {
  4023. this.setValues('hsl', vals);
  4024. } else if (vals = colorString.getHwb(obj)) {
  4025. this.setValues('hwb', vals);
  4026. }
  4027. } else if (typeof obj === 'object') {
  4028. vals = obj;
  4029. if (vals.r !== undefined || vals.red !== undefined) {
  4030. this.setValues('rgb', vals);
  4031. } else if (vals.l !== undefined || vals.lightness !== undefined) {
  4032. this.setValues('hsl', vals);
  4033. } else if (vals.v !== undefined || vals.value !== undefined) {
  4034. this.setValues('hsv', vals);
  4035. } else if (vals.w !== undefined || vals.whiteness !== undefined) {
  4036. this.setValues('hwb', vals);
  4037. } else if (vals.c !== undefined || vals.cyan !== undefined) {
  4038. this.setValues('cmyk', vals);
  4039. }
  4040. }
  4041. };
  4042. Color.prototype = {
  4043. isValid: function () {
  4044. return this.valid;
  4045. },
  4046. rgb: function () {
  4047. return this.setSpace('rgb', arguments);
  4048. },
  4049. hsl: function () {
  4050. return this.setSpace('hsl', arguments);
  4051. },
  4052. hsv: function () {
  4053. return this.setSpace('hsv', arguments);
  4054. },
  4055. hwb: function () {
  4056. return this.setSpace('hwb', arguments);
  4057. },
  4058. cmyk: function () {
  4059. return this.setSpace('cmyk', arguments);
  4060. },
  4061. rgbArray: function () {
  4062. return this.values.rgb;
  4063. },
  4064. hslArray: function () {
  4065. return this.values.hsl;
  4066. },
  4067. hsvArray: function () {
  4068. return this.values.hsv;
  4069. },
  4070. hwbArray: function () {
  4071. var values = this.values;
  4072. if (values.alpha !== 1) {
  4073. return values.hwb.concat([values.alpha]);
  4074. }
  4075. return values.hwb;
  4076. },
  4077. cmykArray: function () {
  4078. return this.values.cmyk;
  4079. },
  4080. rgbaArray: function () {
  4081. var values = this.values;
  4082. return values.rgb.concat([values.alpha]);
  4083. },
  4084. hslaArray: function () {
  4085. var values = this.values;
  4086. return values.hsl.concat([values.alpha]);
  4087. },
  4088. alpha: function (val) {
  4089. if (val === undefined) {
  4090. return this.values.alpha;
  4091. }
  4092. this.setValues('alpha', val);
  4093. return this;
  4094. },
  4095. red: function (val) {
  4096. return this.setChannel('rgb', 0, val);
  4097. },
  4098. green: function (val) {
  4099. return this.setChannel('rgb', 1, val);
  4100. },
  4101. blue: function (val) {
  4102. return this.setChannel('rgb', 2, val);
  4103. },
  4104. hue: function (val) {
  4105. if (val) {
  4106. val %= 360;
  4107. val = val < 0 ? 360 + val : val;
  4108. }
  4109. return this.setChannel('hsl', 0, val);
  4110. },
  4111. saturation: function (val) {
  4112. return this.setChannel('hsl', 1, val);
  4113. },
  4114. lightness: function (val) {
  4115. return this.setChannel('hsl', 2, val);
  4116. },
  4117. saturationv: function (val) {
  4118. return this.setChannel('hsv', 1, val);
  4119. },
  4120. whiteness: function (val) {
  4121. return this.setChannel('hwb', 1, val);
  4122. },
  4123. blackness: function (val) {
  4124. return this.setChannel('hwb', 2, val);
  4125. },
  4126. value: function (val) {
  4127. return this.setChannel('hsv', 2, val);
  4128. },
  4129. cyan: function (val) {
  4130. return this.setChannel('cmyk', 0, val);
  4131. },
  4132. magenta: function (val) {
  4133. return this.setChannel('cmyk', 1, val);
  4134. },
  4135. yellow: function (val) {
  4136. return this.setChannel('cmyk', 2, val);
  4137. },
  4138. black: function (val) {
  4139. return this.setChannel('cmyk', 3, val);
  4140. },
  4141. hexString: function () {
  4142. return colorString.hexString(this.values.rgb);
  4143. },
  4144. rgbString: function () {
  4145. return colorString.rgbString(this.values.rgb, this.values.alpha);
  4146. },
  4147. rgbaString: function () {
  4148. return colorString.rgbaString(this.values.rgb, this.values.alpha);
  4149. },
  4150. percentString: function () {
  4151. return colorString.percentString(this.values.rgb, this.values.alpha);
  4152. },
  4153. hslString: function () {
  4154. return colorString.hslString(this.values.hsl, this.values.alpha);
  4155. },
  4156. hslaString: function () {
  4157. return colorString.hslaString(this.values.hsl, this.values.alpha);
  4158. },
  4159. hwbString: function () {
  4160. return colorString.hwbString(this.values.hwb, this.values.alpha);
  4161. },
  4162. keyword: function () {
  4163. return colorString.keyword(this.values.rgb, this.values.alpha);
  4164. },
  4165. rgbNumber: function () {
  4166. var rgb = this.values.rgb;
  4167. return (rgb[0] << 16) | (rgb[1] << 8) | rgb[2];
  4168. },
  4169. luminosity: function () {
  4170. // http://www.w3.org/TR/WCAG20/#relativeluminancedef
  4171. var rgb = this.values.rgb;
  4172. var lum = [];
  4173. for (var i = 0; i < rgb.length; i++) {
  4174. var chan = rgb[i] / 255;
  4175. lum[i] = (chan <= 0.03928) ? chan / 12.92 : Math.pow(((chan + 0.055) / 1.055), 2.4);
  4176. }
  4177. return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
  4178. },
  4179. contrast: function (color2) {
  4180. // http://www.w3.org/TR/WCAG20/#contrast-ratiodef
  4181. var lum1 = this.luminosity();
  4182. var lum2 = color2.luminosity();
  4183. if (lum1 > lum2) {
  4184. return (lum1 + 0.05) / (lum2 + 0.05);
  4185. }
  4186. return (lum2 + 0.05) / (lum1 + 0.05);
  4187. },
  4188. level: function (color2) {
  4189. var contrastRatio = this.contrast(color2);
  4190. if (contrastRatio >= 7.1) {
  4191. return 'AAA';
  4192. }
  4193. return (contrastRatio >= 4.5) ? 'AA' : '';
  4194. },
  4195. dark: function () {
  4196. // YIQ equation from http://24ways.org/2010/calculating-color-contrast
  4197. var rgb = this.values.rgb;
  4198. var yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;
  4199. return yiq < 128;
  4200. },
  4201. light: function () {
  4202. return !this.dark();
  4203. },
  4204. negate: function () {
  4205. var rgb = [];
  4206. for (var i = 0; i < 3; i++) {
  4207. rgb[i] = 255 - this.values.rgb[i];
  4208. }
  4209. this.setValues('rgb', rgb);
  4210. return this;
  4211. },
  4212. lighten: function (ratio) {
  4213. var hsl = this.values.hsl;
  4214. hsl[2] += hsl[2] * ratio;
  4215. this.setValues('hsl', hsl);
  4216. return this;
  4217. },
  4218. darken: function (ratio) {
  4219. var hsl = this.values.hsl;
  4220. hsl[2] -= hsl[2] * ratio;
  4221. this.setValues('hsl', hsl);
  4222. return this;
  4223. },
  4224. saturate: function (ratio) {
  4225. var hsl = this.values.hsl;
  4226. hsl[1] += hsl[1] * ratio;
  4227. this.setValues('hsl', hsl);
  4228. return this;
  4229. },
  4230. desaturate: function (ratio) {
  4231. var hsl = this.values.hsl;
  4232. hsl[1] -= hsl[1] * ratio;
  4233. this.setValues('hsl', hsl);
  4234. return this;
  4235. },
  4236. whiten: function (ratio) {
  4237. var hwb = this.values.hwb;
  4238. hwb[1] += hwb[1] * ratio;
  4239. this.setValues('hwb', hwb);
  4240. return this;
  4241. },
  4242. blacken: function (ratio) {
  4243. var hwb = this.values.hwb;
  4244. hwb[2] += hwb[2] * ratio;
  4245. this.setValues('hwb', hwb);
  4246. return this;
  4247. },
  4248. greyscale: function () {
  4249. var rgb = this.values.rgb;
  4250. // http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale
  4251. var val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
  4252. this.setValues('rgb', [val, val, val]);
  4253. return this;
  4254. },
  4255. clearer: function (ratio) {
  4256. var alpha = this.values.alpha;
  4257. this.setValues('alpha', alpha - (alpha * ratio));
  4258. return this;
  4259. },
  4260. opaquer: function (ratio) {
  4261. var alpha = this.values.alpha;
  4262. this.setValues('alpha', alpha + (alpha * ratio));
  4263. return this;
  4264. },
  4265. rotate: function (degrees) {
  4266. var hsl = this.values.hsl;
  4267. var hue = (hsl[0] + degrees) % 360;
  4268. hsl[0] = hue < 0 ? 360 + hue : hue;
  4269. this.setValues('hsl', hsl);
  4270. return this;
  4271. },
  4272. /**
  4273. * Ported from sass implementation in C
  4274. * https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209
  4275. */
  4276. mix: function (mixinColor, weight) {
  4277. var color1 = this;
  4278. var color2 = mixinColor;
  4279. var p = weight === undefined ? 0.5 : weight;
  4280. var w = 2 * p - 1;
  4281. var a = color1.alpha() - color2.alpha();
  4282. var w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
  4283. var w2 = 1 - w1;
  4284. return this
  4285. .rgb(
  4286. w1 * color1.red() + w2 * color2.red(),
  4287. w1 * color1.green() + w2 * color2.green(),
  4288. w1 * color1.blue() + w2 * color2.blue()
  4289. )
  4290. .alpha(color1.alpha() * p + color2.alpha() * (1 - p));
  4291. },
  4292. toJSON: function () {
  4293. return this.rgb();
  4294. },
  4295. clone: function () {
  4296. // NOTE(SB): using node-clone creates a dependency to Buffer when using browserify,
  4297. // making the final build way to big to embed in Chart.js. So let's do it manually,
  4298. // assuming that values to clone are 1 dimension arrays containing only numbers,
  4299. // except 'alpha' which is a number.
  4300. var result = new Color();
  4301. var source = this.values;
  4302. var target = result.values;
  4303. var value, type;
  4304. for (var prop in source) {
  4305. if (source.hasOwnProperty(prop)) {
  4306. value = source[prop];
  4307. type = ({}).toString.call(value);
  4308. if (type === '[object Array]') {
  4309. target[prop] = value.slice(0);
  4310. } else if (type === '[object Number]') {
  4311. target[prop] = value;
  4312. } else {
  4313. console.error('unexpected color value:', value);
  4314. }
  4315. }
  4316. }
  4317. return result;
  4318. }
  4319. };
  4320. Color.prototype.spaces = {
  4321. rgb: ['red', 'green', 'blue'],
  4322. hsl: ['hue', 'saturation', 'lightness'],
  4323. hsv: ['hue', 'saturation', 'value'],
  4324. hwb: ['hue', 'whiteness', 'blackness'],
  4325. cmyk: ['cyan', 'magenta', 'yellow', 'black']
  4326. };
  4327. Color.prototype.maxes = {
  4328. rgb: [255, 255, 255],
  4329. hsl: [360, 100, 100],
  4330. hsv: [360, 100, 100],
  4331. hwb: [360, 100, 100],
  4332. cmyk: [100, 100, 100, 100]
  4333. };
  4334. Color.prototype.getValues = function (space) {
  4335. var values = this.values;
  4336. var vals = {};
  4337. for (var i = 0; i < space.length; i++) {
  4338. vals[space.charAt(i)] = values[space][i];
  4339. }
  4340. if (values.alpha !== 1) {
  4341. vals.a = values.alpha;
  4342. }
  4343. // {r: 255, g: 255, b: 255, a: 0.4}
  4344. return vals;
  4345. };
  4346. Color.prototype.setValues = function (space, vals) {
  4347. var values = this.values;
  4348. var spaces = this.spaces;
  4349. var maxes = this.maxes;
  4350. var alpha = 1;
  4351. var i;
  4352. this.valid = true;
  4353. if (space === 'alpha') {
  4354. alpha = vals;
  4355. } else if (vals.length) {
  4356. // [10, 10, 10]
  4357. values[space] = vals.slice(0, space.length);
  4358. alpha = vals[space.length];
  4359. } else if (vals[space.charAt(0)] !== undefined) {
  4360. // {r: 10, g: 10, b: 10}
  4361. for (i = 0; i < space.length; i++) {
  4362. values[space][i] = vals[space.charAt(i)];
  4363. }
  4364. alpha = vals.a;
  4365. } else if (vals[spaces[space][0]] !== undefined) {
  4366. // {red: 10, green: 10, blue: 10}
  4367. var chans = spaces[space];
  4368. for (i = 0; i < space.length; i++) {
  4369. values[space][i] = vals[chans[i]];
  4370. }
  4371. alpha = vals.alpha;
  4372. }
  4373. values.alpha = Math.max(0, Math.min(1, (alpha === undefined ? values.alpha : alpha)));
  4374. if (space === 'alpha') {
  4375. return false;
  4376. }
  4377. var capped;
  4378. // cap values of the space prior converting all values
  4379. for (i = 0; i < space.length; i++) {
  4380. capped = Math.max(0, Math.min(maxes[space][i], values[space][i]));
  4381. values[space][i] = Math.round(capped);
  4382. }
  4383. // convert to all the other color spaces
  4384. for (var sname in spaces) {
  4385. if (sname !== space) {
  4386. values[sname] = colorConvert[space][sname](values[space]);
  4387. }
  4388. }
  4389. return true;
  4390. };
  4391. Color.prototype.setSpace = function (space, args) {
  4392. var vals = args[0];
  4393. if (vals === undefined) {
  4394. // color.rgb()
  4395. return this.getValues(space);
  4396. }
  4397. // color.rgb(10, 10, 10)
  4398. if (typeof vals === 'number') {
  4399. vals = Array.prototype.slice.call(args);
  4400. }
  4401. this.setValues(space, vals);
  4402. return this;
  4403. };
  4404. Color.prototype.setChannel = function (space, index, val) {
  4405. var svalues = this.values[space];
  4406. if (val === undefined) {
  4407. // color.red()
  4408. return svalues[index];
  4409. } else if (val === svalues[index]) {
  4410. // color.red(color.red())
  4411. return this;
  4412. }
  4413. // color.red(100)
  4414. svalues[index] = val;
  4415. this.setValues(space, svalues);
  4416. return this;
  4417. };
  4418. if (typeof window !== 'undefined') {
  4419. window.Color = Color;
  4420. }
  4421. var chartjsColor = Color;
  4422. function isValidKey(key) {
  4423. return ['__proto__', 'prototype', 'constructor'].indexOf(key) === -1;
  4424. }
  4425. /**
  4426. * @namespace Chart.helpers
  4427. */
  4428. var helpers = {
  4429. /**
  4430. * An empty function that can be used, for example, for optional callback.
  4431. */
  4432. noop: function() {},
  4433. /**
  4434. * Returns a unique id, sequentially generated from a global variable.
  4435. * @returns {number}
  4436. * @function
  4437. */
  4438. uid: (function() {
  4439. var id = 0;
  4440. return function() {
  4441. return id++;
  4442. };
  4443. }()),
  4444. /**
  4445. * Returns true if `value` is neither null nor undefined, else returns false.
  4446. * @param {*} value - The value to test.
  4447. * @returns {boolean}
  4448. * @since 2.7.0
  4449. */
  4450. isNullOrUndef: function(value) {
  4451. return value === null || typeof value === 'undefined';
  4452. },
  4453. /**
  4454. * Returns true if `value` is an array (including typed arrays), else returns false.
  4455. * @param {*} value - The value to test.
  4456. * @returns {boolean}
  4457. * @function
  4458. */
  4459. isArray: function(value) {
  4460. if (Array.isArray && Array.isArray(value)) {
  4461. return true;
  4462. }
  4463. var type = Object.prototype.toString.call(value);
  4464. if (type.substr(0, 7) === '[object' && type.substr(-6) === 'Array]') {
  4465. return true;
  4466. }
  4467. return false;
  4468. },
  4469. /**
  4470. * Returns true if `value` is an object (excluding null), else returns false.
  4471. * @param {*} value - The value to test.
  4472. * @returns {boolean}
  4473. * @since 2.7.0
  4474. */
  4475. isObject: function(value) {
  4476. return value !== null && Object.prototype.toString.call(value) === '[object Object]';
  4477. },
  4478. /**
  4479. * Returns true if `value` is a finite number, else returns false
  4480. * @param {*} value - The value to test.
  4481. * @returns {boolean}
  4482. */
  4483. isFinite: function(value) {
  4484. return (typeof value === 'number' || value instanceof Number) && isFinite(value);
  4485. },
  4486. /**
  4487. * Returns `value` if defined, else returns `defaultValue`.
  4488. * @param {*} value - The value to return if defined.
  4489. * @param {*} defaultValue - The value to return if `value` is undefined.
  4490. * @returns {*}
  4491. */
  4492. valueOrDefault: function(value, defaultValue) {
  4493. return typeof value === 'undefined' ? defaultValue : value;
  4494. },
  4495. /**
  4496. * Returns value at the given `index` in array if defined, else returns `defaultValue`.
  4497. * @param {Array} value - The array to lookup for value at `index`.
  4498. * @param {number} index - The index in `value` to lookup for value.
  4499. * @param {*} defaultValue - The value to return if `value[index]` is undefined.
  4500. * @returns {*}
  4501. */
  4502. valueAtIndexOrDefault: function(value, index, defaultValue) {
  4503. return helpers.valueOrDefault(helpers.isArray(value) ? value[index] : value, defaultValue);
  4504. },
  4505. /**
  4506. * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the
  4507. * value returned by `fn`. If `fn` is not a function, this method returns undefined.
  4508. * @param {function} fn - The function to call.
  4509. * @param {Array|undefined|null} args - The arguments with which `fn` should be called.
  4510. * @param {object} [thisArg] - The value of `this` provided for the call to `fn`.
  4511. * @returns {*}
  4512. */
  4513. callback: function(fn, args, thisArg) {
  4514. if (fn && typeof fn.call === 'function') {
  4515. return fn.apply(thisArg, args);
  4516. }
  4517. },
  4518. /**
  4519. * Note(SB) for performance sake, this method should only be used when loopable type
  4520. * is unknown or in none intensive code (not called often and small loopable). Else
  4521. * it's preferable to use a regular for() loop and save extra function calls.
  4522. * @param {object|Array} loopable - The object or array to be iterated.
  4523. * @param {function} fn - The function to call for each item.
  4524. * @param {object} [thisArg] - The value of `this` provided for the call to `fn`.
  4525. * @param {boolean} [reverse] - If true, iterates backward on the loopable.
  4526. */
  4527. each: function(loopable, fn, thisArg, reverse) {
  4528. var i, len, keys;
  4529. if (helpers.isArray(loopable)) {
  4530. len = loopable.length;
  4531. if (reverse) {
  4532. for (i = len - 1; i >= 0; i--) {
  4533. fn.call(thisArg, loopable[i], i);
  4534. }
  4535. } else {
  4536. for (i = 0; i < len; i++) {
  4537. fn.call(thisArg, loopable[i], i);
  4538. }
  4539. }
  4540. } else if (helpers.isObject(loopable)) {
  4541. keys = Object.keys(loopable);
  4542. len = keys.length;
  4543. for (i = 0; i < len; i++) {
  4544. fn.call(thisArg, loopable[keys[i]], keys[i]);
  4545. }
  4546. }
  4547. },
  4548. /**
  4549. * Returns true if the `a0` and `a1` arrays have the same content, else returns false.
  4550. * @see https://stackoverflow.com/a/14853974
  4551. * @param {Array} a0 - The array to compare
  4552. * @param {Array} a1 - The array to compare
  4553. * @returns {boolean}
  4554. */
  4555. arrayEquals: function(a0, a1) {
  4556. var i, ilen, v0, v1;
  4557. if (!a0 || !a1 || a0.length !== a1.length) {
  4558. return false;
  4559. }
  4560. for (i = 0, ilen = a0.length; i < ilen; ++i) {
  4561. v0 = a0[i];
  4562. v1 = a1[i];
  4563. if (v0 instanceof Array && v1 instanceof Array) {
  4564. if (!helpers.arrayEquals(v0, v1)) {
  4565. return false;
  4566. }
  4567. } else if (v0 !== v1) {
  4568. // NOTE: two different object instances will never be equal: {x:20} != {x:20}
  4569. return false;
  4570. }
  4571. }
  4572. return true;
  4573. },
  4574. /**
  4575. * Returns a deep copy of `source` without keeping references on objects and arrays.
  4576. * @param {*} source - The value to clone.
  4577. * @returns {*}
  4578. */
  4579. clone: function(source) {
  4580. if (helpers.isArray(source)) {
  4581. return source.map(helpers.clone);
  4582. }
  4583. if (helpers.isObject(source)) {
  4584. var target = Object.create(source);
  4585. var keys = Object.keys(source);
  4586. var klen = keys.length;
  4587. var k = 0;
  4588. for (; k < klen; ++k) {
  4589. target[keys[k]] = helpers.clone(source[keys[k]]);
  4590. }
  4591. return target;
  4592. }
  4593. return source;
  4594. },
  4595. /**
  4596. * The default merger when Chart.helpers.merge is called without merger option.
  4597. * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.
  4598. * @private
  4599. */
  4600. _merger: function(key, target, source, options) {
  4601. if (!isValidKey(key)) {
  4602. // We want to ensure we do not copy prototypes over
  4603. // as this can pollute global namespaces
  4604. return;
  4605. }
  4606. var tval = target[key];
  4607. var sval = source[key];
  4608. if (helpers.isObject(tval) && helpers.isObject(sval)) {
  4609. helpers.merge(tval, sval, options);
  4610. } else {
  4611. target[key] = helpers.clone(sval);
  4612. }
  4613. },
  4614. /**
  4615. * Merges source[key] in target[key] only if target[key] is undefined.
  4616. * @private
  4617. */
  4618. _mergerIf: function(key, target, source) {
  4619. if (!isValidKey(key)) {
  4620. // We want to ensure we do not copy prototypes over
  4621. // as this can pollute global namespaces
  4622. return;
  4623. }
  4624. var tval = target[key];
  4625. var sval = source[key];
  4626. if (helpers.isObject(tval) && helpers.isObject(sval)) {
  4627. helpers.mergeIf(tval, sval);
  4628. } else if (!target.hasOwnProperty(key)) {
  4629. target[key] = helpers.clone(sval);
  4630. }
  4631. },
  4632. /**
  4633. * Recursively deep copies `source` properties into `target` with the given `options`.
  4634. * IMPORTANT: `target` is not cloned and will be updated with `source` properties.
  4635. * @param {object} target - The target object in which all sources are merged into.
  4636. * @param {object|object[]} source - Object(s) to merge into `target`.
  4637. * @param {object} [options] - Merging options:
  4638. * @param {function} [options.merger] - The merge method (key, target, source, options)
  4639. * @returns {object} The `target` object.
  4640. */
  4641. merge: function(target, source, options) {
  4642. var sources = helpers.isArray(source) ? source : [source];
  4643. var ilen = sources.length;
  4644. var merge, i, keys, klen, k;
  4645. if (!helpers.isObject(target)) {
  4646. return target;
  4647. }
  4648. options = options || {};
  4649. merge = options.merger || helpers._merger;
  4650. for (i = 0; i < ilen; ++i) {
  4651. source = sources[i];
  4652. if (!helpers.isObject(source)) {
  4653. continue;
  4654. }
  4655. keys = Object.keys(source);
  4656. for (k = 0, klen = keys.length; k < klen; ++k) {
  4657. merge(keys[k], target, source, options);
  4658. }
  4659. }
  4660. return target;
  4661. },
  4662. /**
  4663. * Recursively deep copies `source` properties into `target` *only* if not defined in target.
  4664. * IMPORTANT: `target` is not cloned and will be updated with `source` properties.
  4665. * @param {object} target - The target object in which all sources are merged into.
  4666. * @param {object|object[]} source - Object(s) to merge into `target`.
  4667. * @returns {object} The `target` object.
  4668. */
  4669. mergeIf: function(target, source) {
  4670. return helpers.merge(target, source, {merger: helpers._mergerIf});
  4671. },
  4672. /**
  4673. * Applies the contents of two or more objects together into the first object.
  4674. * @param {object} target - The target object in which all objects are merged into.
  4675. * @param {object} arg1 - Object containing additional properties to merge in target.
  4676. * @param {object} argN - Additional objects containing properties to merge in target.
  4677. * @returns {object} The `target` object.
  4678. */
  4679. extend: Object.assign || function(target) {
  4680. return helpers.merge(target, [].slice.call(arguments, 1), {
  4681. merger: function(key, dst, src) {
  4682. dst[key] = src[key];
  4683. }
  4684. });
  4685. },
  4686. /**
  4687. * Basic javascript inheritance based on the model created in Backbone.js
  4688. */
  4689. inherits: function(extensions) {
  4690. var me = this;
  4691. var ChartElement = (extensions && extensions.hasOwnProperty('constructor')) ? extensions.constructor : function() {
  4692. return me.apply(this, arguments);
  4693. };
  4694. var Surrogate = function() {
  4695. this.constructor = ChartElement;
  4696. };
  4697. Surrogate.prototype = me.prototype;
  4698. ChartElement.prototype = new Surrogate();
  4699. ChartElement.extend = helpers.inherits;
  4700. if (extensions) {
  4701. helpers.extend(ChartElement.prototype, extensions);
  4702. }
  4703. ChartElement.__super__ = me.prototype;
  4704. return ChartElement;
  4705. },
  4706. _deprecated: function(scope, value, previous, current) {
  4707. if (value !== undefined) {
  4708. console.warn(scope + ': "' + previous +
  4709. '" is deprecated. Please use "' + current + '" instead');
  4710. }
  4711. }
  4712. };
  4713. var helpers_core = helpers;
  4714. // DEPRECATIONS
  4715. /**
  4716. * Provided for backward compatibility, use Chart.helpers.callback instead.
  4717. * @function Chart.helpers.callCallback
  4718. * @deprecated since version 2.6.0
  4719. * @todo remove at version 3
  4720. * @private
  4721. */
  4722. helpers.callCallback = helpers.callback;
  4723. /**
  4724. * Provided for backward compatibility, use Array.prototype.indexOf instead.
  4725. * Array.prototype.indexOf compatibility: Chrome, Opera, Safari, FF1.5+, IE9+
  4726. * @function Chart.helpers.indexOf
  4727. * @deprecated since version 2.7.0
  4728. * @todo remove at version 3
  4729. * @private
  4730. */
  4731. helpers.indexOf = function(array, item, fromIndex) {
  4732. return Array.prototype.indexOf.call(array, item, fromIndex);
  4733. };
  4734. /**
  4735. * Provided for backward compatibility, use Chart.helpers.valueOrDefault instead.
  4736. * @function Chart.helpers.getValueOrDefault
  4737. * @deprecated since version 2.7.0
  4738. * @todo remove at version 3
  4739. * @private
  4740. */
  4741. helpers.getValueOrDefault = helpers.valueOrDefault;
  4742. /**
  4743. * Provided for backward compatibility, use Chart.helpers.valueAtIndexOrDefault instead.
  4744. * @function Chart.helpers.getValueAtIndexOrDefault
  4745. * @deprecated since version 2.7.0
  4746. * @todo remove at version 3
  4747. * @private
  4748. */
  4749. helpers.getValueAtIndexOrDefault = helpers.valueAtIndexOrDefault;
  4750. /**
  4751. * Easing functions adapted from Robert Penner's easing equations.
  4752. * @namespace Chart.helpers.easingEffects
  4753. * @see http://www.robertpenner.com/easing/
  4754. */
  4755. var effects = {
  4756. linear: function(t) {
  4757. return t;
  4758. },
  4759. easeInQuad: function(t) {
  4760. return t * t;
  4761. },
  4762. easeOutQuad: function(t) {
  4763. return -t * (t - 2);
  4764. },
  4765. easeInOutQuad: function(t) {
  4766. if ((t /= 0.5) < 1) {
  4767. return 0.5 * t * t;
  4768. }
  4769. return -0.5 * ((--t) * (t - 2) - 1);
  4770. },
  4771. easeInCubic: function(t) {
  4772. return t * t * t;
  4773. },
  4774. easeOutCubic: function(t) {
  4775. return (t = t - 1) * t * t + 1;
  4776. },
  4777. easeInOutCubic: function(t) {
  4778. if ((t /= 0.5) < 1) {
  4779. return 0.5 * t * t * t;
  4780. }
  4781. return 0.5 * ((t -= 2) * t * t + 2);
  4782. },
  4783. easeInQuart: function(t) {
  4784. return t * t * t * t;
  4785. },
  4786. easeOutQuart: function(t) {
  4787. return -((t = t - 1) * t * t * t - 1);
  4788. },
  4789. easeInOutQuart: function(t) {
  4790. if ((t /= 0.5) < 1) {
  4791. return 0.5 * t * t * t * t;
  4792. }
  4793. return -0.5 * ((t -= 2) * t * t * t - 2);
  4794. },
  4795. easeInQuint: function(t) {
  4796. return t * t * t * t * t;
  4797. },
  4798. easeOutQuint: function(t) {
  4799. return (t = t - 1) * t * t * t * t + 1;
  4800. },
  4801. easeInOutQuint: function(t) {
  4802. if ((t /= 0.5) < 1) {
  4803. return 0.5 * t * t * t * t * t;
  4804. }
  4805. return 0.5 * ((t -= 2) * t * t * t * t + 2);
  4806. },
  4807. easeInSine: function(t) {
  4808. return -Math.cos(t * (Math.PI / 2)) + 1;
  4809. },
  4810. easeOutSine: function(t) {
  4811. return Math.sin(t * (Math.PI / 2));
  4812. },
  4813. easeInOutSine: function(t) {
  4814. return -0.5 * (Math.cos(Math.PI * t) - 1);
  4815. },
  4816. easeInExpo: function(t) {
  4817. return (t === 0) ? 0 : Math.pow(2, 10 * (t - 1));
  4818. },
  4819. easeOutExpo: function(t) {
  4820. return (t === 1) ? 1 : -Math.pow(2, -10 * t) + 1;
  4821. },
  4822. easeInOutExpo: function(t) {
  4823. if (t === 0) {
  4824. return 0;
  4825. }
  4826. if (t === 1) {
  4827. return 1;
  4828. }
  4829. if ((t /= 0.5) < 1) {
  4830. return 0.5 * Math.pow(2, 10 * (t - 1));
  4831. }
  4832. return 0.5 * (-Math.pow(2, -10 * --t) + 2);
  4833. },
  4834. easeInCirc: function(t) {
  4835. if (t >= 1) {
  4836. return t;
  4837. }
  4838. return -(Math.sqrt(1 - t * t) - 1);
  4839. },
  4840. easeOutCirc: function(t) {
  4841. return Math.sqrt(1 - (t = t - 1) * t);
  4842. },
  4843. easeInOutCirc: function(t) {
  4844. if ((t /= 0.5) < 1) {
  4845. return -0.5 * (Math.sqrt(1 - t * t) - 1);
  4846. }
  4847. return 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);
  4848. },
  4849. easeInElastic: function(t) {
  4850. var s = 1.70158;
  4851. var p = 0;
  4852. var a = 1;
  4853. if (t === 0) {
  4854. return 0;
  4855. }
  4856. if (t === 1) {
  4857. return 1;
  4858. }
  4859. if (!p) {
  4860. p = 0.3;
  4861. }
  4862. if (a < 1) {
  4863. a = 1;
  4864. s = p / 4;
  4865. } else {
  4866. s = p / (2 * Math.PI) * Math.asin(1 / a);
  4867. }
  4868. return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p));
  4869. },
  4870. easeOutElastic: function(t) {
  4871. var s = 1.70158;
  4872. var p = 0;
  4873. var a = 1;
  4874. if (t === 0) {
  4875. return 0;
  4876. }
  4877. if (t === 1) {
  4878. return 1;
  4879. }
  4880. if (!p) {
  4881. p = 0.3;
  4882. }
  4883. if (a < 1) {
  4884. a = 1;
  4885. s = p / 4;
  4886. } else {
  4887. s = p / (2 * Math.PI) * Math.asin(1 / a);
  4888. }
  4889. return a * Math.pow(2, -10 * t) * Math.sin((t - s) * (2 * Math.PI) / p) + 1;
  4890. },
  4891. easeInOutElastic: function(t) {
  4892. var s = 1.70158;
  4893. var p = 0;
  4894. var a = 1;
  4895. if (t === 0) {
  4896. return 0;
  4897. }
  4898. if ((t /= 0.5) === 2) {
  4899. return 1;
  4900. }
  4901. if (!p) {
  4902. p = 0.45;
  4903. }
  4904. if (a < 1) {
  4905. a = 1;
  4906. s = p / 4;
  4907. } else {
  4908. s = p / (2 * Math.PI) * Math.asin(1 / a);
  4909. }
  4910. if (t < 1) {
  4911. return -0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p));
  4912. }
  4913. return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t - s) * (2 * Math.PI) / p) * 0.5 + 1;
  4914. },
  4915. easeInBack: function(t) {
  4916. var s = 1.70158;
  4917. return t * t * ((s + 1) * t - s);
  4918. },
  4919. easeOutBack: function(t) {
  4920. var s = 1.70158;
  4921. return (t = t - 1) * t * ((s + 1) * t + s) + 1;
  4922. },
  4923. easeInOutBack: function(t) {
  4924. var s = 1.70158;
  4925. if ((t /= 0.5) < 1) {
  4926. return 0.5 * (t * t * (((s *= (1.525)) + 1) * t - s));
  4927. }
  4928. return 0.5 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);
  4929. },
  4930. easeInBounce: function(t) {
  4931. return 1 - effects.easeOutBounce(1 - t);
  4932. },
  4933. easeOutBounce: function(t) {
  4934. if (t < (1 / 2.75)) {
  4935. return 7.5625 * t * t;
  4936. }
  4937. if (t < (2 / 2.75)) {
  4938. return 7.5625 * (t -= (1.5 / 2.75)) * t + 0.75;
  4939. }
  4940. if (t < (2.5 / 2.75)) {
  4941. return 7.5625 * (t -= (2.25 / 2.75)) * t + 0.9375;
  4942. }
  4943. return 7.5625 * (t -= (2.625 / 2.75)) * t + 0.984375;
  4944. },
  4945. easeInOutBounce: function(t) {
  4946. if (t < 0.5) {
  4947. return effects.easeInBounce(t * 2) * 0.5;
  4948. }
  4949. return effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5;
  4950. }
  4951. };
  4952. var helpers_easing = {
  4953. effects: effects
  4954. };
  4955. // DEPRECATIONS
  4956. /**
  4957. * Provided for backward compatibility, use Chart.helpers.easing.effects instead.
  4958. * @function Chart.helpers.easingEffects
  4959. * @deprecated since version 2.7.0
  4960. * @todo remove at version 3
  4961. * @private
  4962. */
  4963. helpers_core.easingEffects = effects;
  4964. var PI = Math.PI;
  4965. var RAD_PER_DEG = PI / 180;
  4966. var DOUBLE_PI = PI * 2;
  4967. var HALF_PI = PI / 2;
  4968. var QUARTER_PI = PI / 4;
  4969. var TWO_THIRDS_PI = PI * 2 / 3;
  4970. /**
  4971. * @namespace Chart.helpers.canvas
  4972. */
  4973. var exports$1 = {
  4974. /**
  4975. * Clears the entire canvas associated to the given `chart`.
  4976. * @param {Chart} chart - The chart for which to clear the canvas.
  4977. */
  4978. clear: function(chart) {
  4979. chart.ctx.clearRect(0, 0, chart.width, chart.height);
  4980. },
  4981. /**
  4982. * Creates a "path" for a rectangle with rounded corners at position (x, y) with a
  4983. * given size (width, height) and the same `radius` for all corners.
  4984. * @param {CanvasRenderingContext2D} ctx - The canvas 2D Context.
  4985. * @param {number} x - The x axis of the coordinate for the rectangle starting point.
  4986. * @param {number} y - The y axis of the coordinate for the rectangle starting point.
  4987. * @param {number} width - The rectangle's width.
  4988. * @param {number} height - The rectangle's height.
  4989. * @param {number} radius - The rounded amount (in pixels) for the four corners.
  4990. * @todo handle `radius` as top-left, top-right, bottom-right, bottom-left array/object?
  4991. */
  4992. roundedRect: function(ctx, x, y, width, height, radius) {
  4993. if (radius) {
  4994. var r = Math.min(radius, height / 2, width / 2);
  4995. var left = x + r;
  4996. var top = y + r;
  4997. var right = x + width - r;
  4998. var bottom = y + height - r;
  4999. ctx.moveTo(x, top);
  5000. if (left < right && top < bottom) {
  5001. ctx.arc(left, top, r, -PI, -HALF_PI);
  5002. ctx.arc(right, top, r, -HALF_PI, 0);
  5003. ctx.arc(right, bottom, r, 0, HALF_PI);
  5004. ctx.arc(left, bottom, r, HALF_PI, PI);
  5005. } else if (left < right) {
  5006. ctx.moveTo(left, y);
  5007. ctx.arc(right, top, r, -HALF_PI, HALF_PI);
  5008. ctx.arc(left, top, r, HALF_PI, PI + HALF_PI);
  5009. } else if (top < bottom) {
  5010. ctx.arc(left, top, r, -PI, 0);
  5011. ctx.arc(left, bottom, r, 0, PI);
  5012. } else {
  5013. ctx.arc(left, top, r, -PI, PI);
  5014. }
  5015. ctx.closePath();
  5016. ctx.moveTo(x, y);
  5017. } else {
  5018. ctx.rect(x, y, width, height);
  5019. }
  5020. },
  5021. drawPoint: function(ctx, style, radius, x, y, rotation) {
  5022. var type, xOffset, yOffset, size, cornerRadius;
  5023. var rad = (rotation || 0) * RAD_PER_DEG;
  5024. if (style && typeof style === 'object') {
  5025. type = style.toString();
  5026. if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {
  5027. ctx.save();
  5028. ctx.translate(x, y);
  5029. ctx.rotate(rad);
  5030. ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);
  5031. ctx.restore();
  5032. return;
  5033. }
  5034. }
  5035. if (isNaN(radius) || radius <= 0) {
  5036. return;
  5037. }
  5038. ctx.beginPath();
  5039. switch (style) {
  5040. // Default includes circle
  5041. default:
  5042. ctx.arc(x, y, radius, 0, DOUBLE_PI);
  5043. ctx.closePath();
  5044. break;
  5045. case 'triangle':
  5046. ctx.moveTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);
  5047. rad += TWO_THIRDS_PI;
  5048. ctx.lineTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);
  5049. rad += TWO_THIRDS_PI;
  5050. ctx.lineTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);
  5051. ctx.closePath();
  5052. break;
  5053. case 'rectRounded':
  5054. // NOTE: the rounded rect implementation changed to use `arc` instead of
  5055. // `quadraticCurveTo` since it generates better results when rect is
  5056. // almost a circle. 0.516 (instead of 0.5) produces results with visually
  5057. // closer proportion to the previous impl and it is inscribed in the
  5058. // circle with `radius`. For more details, see the following PRs:
  5059. // https://github.com/chartjs/Chart.js/issues/5597
  5060. // https://github.com/chartjs/Chart.js/issues/5858
  5061. cornerRadius = radius * 0.516;
  5062. size = radius - cornerRadius;
  5063. xOffset = Math.cos(rad + QUARTER_PI) * size;
  5064. yOffset = Math.sin(rad + QUARTER_PI) * size;
  5065. ctx.arc(x - xOffset, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);
  5066. ctx.arc(x + yOffset, y - xOffset, cornerRadius, rad - HALF_PI, rad);
  5067. ctx.arc(x + xOffset, y + yOffset, cornerRadius, rad, rad + HALF_PI);
  5068. ctx.arc(x - yOffset, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);
  5069. ctx.closePath();
  5070. break;
  5071. case 'rect':
  5072. if (!rotation) {
  5073. size = Math.SQRT1_2 * radius;
  5074. ctx.rect(x - size, y - size, 2 * size, 2 * size);
  5075. break;
  5076. }
  5077. rad += QUARTER_PI;
  5078. /* falls through */
  5079. case 'rectRot':
  5080. xOffset = Math.cos(rad) * radius;
  5081. yOffset = Math.sin(rad) * radius;
  5082. ctx.moveTo(x - xOffset, y - yOffset);
  5083. ctx.lineTo(x + yOffset, y - xOffset);
  5084. ctx.lineTo(x + xOffset, y + yOffset);
  5085. ctx.lineTo(x - yOffset, y + xOffset);
  5086. ctx.closePath();
  5087. break;
  5088. case 'crossRot':
  5089. rad += QUARTER_PI;
  5090. /* falls through */
  5091. case 'cross':
  5092. xOffset = Math.cos(rad) * radius;
  5093. yOffset = Math.sin(rad) * radius;
  5094. ctx.moveTo(x - xOffset, y - yOffset);
  5095. ctx.lineTo(x + xOffset, y + yOffset);
  5096. ctx.moveTo(x + yOffset, y - xOffset);
  5097. ctx.lineTo(x - yOffset, y + xOffset);
  5098. break;
  5099. case 'star':
  5100. xOffset = Math.cos(rad) * radius;
  5101. yOffset = Math.sin(rad) * radius;
  5102. ctx.moveTo(x - xOffset, y - yOffset);
  5103. ctx.lineTo(x + xOffset, y + yOffset);
  5104. ctx.moveTo(x + yOffset, y - xOffset);
  5105. ctx.lineTo(x - yOffset, y + xOffset);
  5106. rad += QUARTER_PI;
  5107. xOffset = Math.cos(rad) * radius;
  5108. yOffset = Math.sin(rad) * radius;
  5109. ctx.moveTo(x - xOffset, y - yOffset);
  5110. ctx.lineTo(x + xOffset, y + yOffset);
  5111. ctx.moveTo(x + yOffset, y - xOffset);
  5112. ctx.lineTo(x - yOffset, y + xOffset);
  5113. break;
  5114. case 'line':
  5115. xOffset = Math.cos(rad) * radius;
  5116. yOffset = Math.sin(rad) * radius;
  5117. ctx.moveTo(x - xOffset, y - yOffset);
  5118. ctx.lineTo(x + xOffset, y + yOffset);
  5119. break;
  5120. case 'dash':
  5121. ctx.moveTo(x, y);
  5122. ctx.lineTo(x + Math.cos(rad) * radius, y + Math.sin(rad) * radius);
  5123. break;
  5124. }
  5125. ctx.fill();
  5126. ctx.stroke();
  5127. },
  5128. /**
  5129. * Returns true if the point is inside the rectangle
  5130. * @param {object} point - The point to test
  5131. * @param {object} area - The rectangle
  5132. * @returns {boolean}
  5133. * @private
  5134. */
  5135. _isPointInArea: function(point, area) {
  5136. var epsilon = 1e-6; // 1e-6 is margin in pixels for accumulated error.
  5137. return point.x > area.left - epsilon && point.x < area.right + epsilon &&
  5138. point.y > area.top - epsilon && point.y < area.bottom + epsilon;
  5139. },
  5140. clipArea: function(ctx, area) {
  5141. ctx.save();
  5142. ctx.beginPath();
  5143. ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);
  5144. ctx.clip();
  5145. },
  5146. unclipArea: function(ctx) {
  5147. ctx.restore();
  5148. },
  5149. lineTo: function(ctx, previous, target, flip) {
  5150. var stepped = target.steppedLine;
  5151. if (stepped) {
  5152. if (stepped === 'middle') {
  5153. var midpoint = (previous.x + target.x) / 2.0;
  5154. ctx.lineTo(midpoint, flip ? target.y : previous.y);
  5155. ctx.lineTo(midpoint, flip ? previous.y : target.y);
  5156. } else if ((stepped === 'after' && !flip) || (stepped !== 'after' && flip)) {
  5157. ctx.lineTo(previous.x, target.y);
  5158. } else {
  5159. ctx.lineTo(target.x, previous.y);
  5160. }
  5161. ctx.lineTo(target.x, target.y);
  5162. return;
  5163. }
  5164. if (!target.tension) {
  5165. ctx.lineTo(target.x, target.y);
  5166. return;
  5167. }
  5168. ctx.bezierCurveTo(
  5169. flip ? previous.controlPointPreviousX : previous.controlPointNextX,
  5170. flip ? previous.controlPointPreviousY : previous.controlPointNextY,
  5171. flip ? target.controlPointNextX : target.controlPointPreviousX,
  5172. flip ? target.controlPointNextY : target.controlPointPreviousY,
  5173. target.x,
  5174. target.y);
  5175. }
  5176. };
  5177. var helpers_canvas = exports$1;
  5178. // DEPRECATIONS
  5179. /**
  5180. * Provided for backward compatibility, use Chart.helpers.canvas.clear instead.
  5181. * @namespace Chart.helpers.clear
  5182. * @deprecated since version 2.7.0
  5183. * @todo remove at version 3
  5184. * @private
  5185. */
  5186. helpers_core.clear = exports$1.clear;
  5187. /**
  5188. * Provided for backward compatibility, use Chart.helpers.canvas.roundedRect instead.
  5189. * @namespace Chart.helpers.drawRoundedRectangle
  5190. * @deprecated since version 2.7.0
  5191. * @todo remove at version 3
  5192. * @private
  5193. */
  5194. helpers_core.drawRoundedRectangle = function(ctx) {
  5195. ctx.beginPath();
  5196. exports$1.roundedRect.apply(exports$1, arguments);
  5197. };
  5198. var defaults = {
  5199. /**
  5200. * @private
  5201. */
  5202. _set: function(scope, values) {
  5203. return helpers_core.merge(this[scope] || (this[scope] = {}), values);
  5204. }
  5205. };
  5206. // TODO(v3): remove 'global' from namespace. all default are global and
  5207. // there's inconsistency around which options are under 'global'
  5208. defaults._set('global', {
  5209. defaultColor: 'rgba(0,0,0,0.1)',
  5210. defaultFontColor: '#666',
  5211. defaultFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
  5212. defaultFontSize: 12,
  5213. defaultFontStyle: 'normal',
  5214. defaultLineHeight: 1.2,
  5215. showLines: true
  5216. });
  5217. var core_defaults = defaults;
  5218. var valueOrDefault = helpers_core.valueOrDefault;
  5219. /**
  5220. * Converts the given font object into a CSS font string.
  5221. * @param {object} font - A font object.
  5222. * @return {string} The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font
  5223. * @private
  5224. */
  5225. function toFontString(font) {
  5226. if (!font || helpers_core.isNullOrUndef(font.size) || helpers_core.isNullOrUndef(font.family)) {
  5227. return null;
  5228. }
  5229. return (font.style ? font.style + ' ' : '')
  5230. + (font.weight ? font.weight + ' ' : '')
  5231. + font.size + 'px '
  5232. + font.family;
  5233. }
  5234. /**
  5235. * @alias Chart.helpers.options
  5236. * @namespace
  5237. */
  5238. var helpers_options = {
  5239. /**
  5240. * Converts the given line height `value` in pixels for a specific font `size`.
  5241. * @param {number|string} value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').
  5242. * @param {number} size - The font size (in pixels) used to resolve relative `value`.
  5243. * @returns {number} The effective line height in pixels (size * 1.2 if value is invalid).
  5244. * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height
  5245. * @since 2.7.0
  5246. */
  5247. toLineHeight: function(value, size) {
  5248. var matches = ('' + value).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);
  5249. if (!matches || matches[1] === 'normal') {
  5250. return size * 1.2;
  5251. }
  5252. value = +matches[2];
  5253. switch (matches[3]) {
  5254. case 'px':
  5255. return value;
  5256. case '%':
  5257. value /= 100;
  5258. break;
  5259. }
  5260. return size * value;
  5261. },
  5262. /**
  5263. * Converts the given value into a padding object with pre-computed width/height.
  5264. * @param {number|object} value - If a number, set the value to all TRBL component,
  5265. * else, if and object, use defined properties and sets undefined ones to 0.
  5266. * @returns {object} The padding values (top, right, bottom, left, width, height)
  5267. * @since 2.7.0
  5268. */
  5269. toPadding: function(value) {
  5270. var t, r, b, l;
  5271. if (helpers_core.isObject(value)) {
  5272. t = +value.top || 0;
  5273. r = +value.right || 0;
  5274. b = +value.bottom || 0;
  5275. l = +value.left || 0;
  5276. } else {
  5277. t = r = b = l = +value || 0;
  5278. }
  5279. return {
  5280. top: t,
  5281. right: r,
  5282. bottom: b,
  5283. left: l,
  5284. height: t + b,
  5285. width: l + r
  5286. };
  5287. },
  5288. /**
  5289. * Parses font options and returns the font object.
  5290. * @param {object} options - A object that contains font options to be parsed.
  5291. * @return {object} The font object.
  5292. * @todo Support font.* options and renamed to toFont().
  5293. * @private
  5294. */
  5295. _parseFont: function(options) {
  5296. var globalDefaults = core_defaults.global;
  5297. var size = valueOrDefault(options.fontSize, globalDefaults.defaultFontSize);
  5298. var font = {
  5299. family: valueOrDefault(options.fontFamily, globalDefaults.defaultFontFamily),
  5300. lineHeight: helpers_core.options.toLineHeight(valueOrDefault(options.lineHeight, globalDefaults.defaultLineHeight), size),
  5301. size: size,
  5302. style: valueOrDefault(options.fontStyle, globalDefaults.defaultFontStyle),
  5303. weight: null,
  5304. string: ''
  5305. };
  5306. font.string = toFontString(font);
  5307. return font;
  5308. },
  5309. /**
  5310. * Evaluates the given `inputs` sequentially and returns the first defined value.
  5311. * @param {Array} inputs - An array of values, falling back to the last value.
  5312. * @param {object} [context] - If defined and the current value is a function, the value
  5313. * is called with `context` as first argument and the result becomes the new input.
  5314. * @param {number} [index] - If defined and the current value is an array, the value
  5315. * at `index` become the new input.
  5316. * @param {object} [info] - object to return information about resolution in
  5317. * @param {boolean} [info.cacheable] - Will be set to `false` if option is not cacheable.
  5318. * @since 2.7.0
  5319. */
  5320. resolve: function(inputs, context, index, info) {
  5321. var cacheable = true;
  5322. var i, ilen, value;
  5323. for (i = 0, ilen = inputs.length; i < ilen; ++i) {
  5324. value = inputs[i];
  5325. if (value === undefined) {
  5326. continue;
  5327. }
  5328. if (context !== undefined && typeof value === 'function') {
  5329. value = value(context);
  5330. cacheable = false;
  5331. }
  5332. if (index !== undefined && helpers_core.isArray(value)) {
  5333. value = value[index];
  5334. cacheable = false;
  5335. }
  5336. if (value !== undefined) {
  5337. if (info && !cacheable) {
  5338. info.cacheable = false;
  5339. }
  5340. return value;
  5341. }
  5342. }
  5343. }
  5344. };
  5345. /**
  5346. * @alias Chart.helpers.math
  5347. * @namespace
  5348. */
  5349. var exports$2 = {
  5350. /**
  5351. * Returns an array of factors sorted from 1 to sqrt(value)
  5352. * @private
  5353. */
  5354. _factorize: function(value) {
  5355. var result = [];
  5356. var sqrt = Math.sqrt(value);
  5357. var i;
  5358. for (i = 1; i < sqrt; i++) {
  5359. if (value % i === 0) {
  5360. result.push(i);
  5361. result.push(value / i);
  5362. }
  5363. }
  5364. if (sqrt === (sqrt | 0)) { // if value is a square number
  5365. result.push(sqrt);
  5366. }
  5367. result.sort(function(a, b) {
  5368. return a - b;
  5369. }).pop();
  5370. return result;
  5371. },
  5372. log10: Math.log10 || function(x) {
  5373. var exponent = Math.log(x) * Math.LOG10E; // Math.LOG10E = 1 / Math.LN10.
  5374. // Check for whole powers of 10,
  5375. // which due to floating point rounding error should be corrected.
  5376. var powerOf10 = Math.round(exponent);
  5377. var isPowerOf10 = x === Math.pow(10, powerOf10);
  5378. return isPowerOf10 ? powerOf10 : exponent;
  5379. }
  5380. };
  5381. var helpers_math = exports$2;
  5382. // DEPRECATIONS
  5383. /**
  5384. * Provided for backward compatibility, use Chart.helpers.math.log10 instead.
  5385. * @namespace Chart.helpers.log10
  5386. * @deprecated since version 2.9.0
  5387. * @todo remove at version 3
  5388. * @private
  5389. */
  5390. helpers_core.log10 = exports$2.log10;
  5391. var getRtlAdapter = function(rectX, width) {
  5392. return {
  5393. x: function(x) {
  5394. return rectX + rectX + width - x;
  5395. },
  5396. setWidth: function(w) {
  5397. width = w;
  5398. },
  5399. textAlign: function(align) {
  5400. if (align === 'center') {
  5401. return align;
  5402. }
  5403. return align === 'right' ? 'left' : 'right';
  5404. },
  5405. xPlus: function(x, value) {
  5406. return x - value;
  5407. },
  5408. leftForLtr: function(x, itemWidth) {
  5409. return x - itemWidth;
  5410. },
  5411. };
  5412. };
  5413. var getLtrAdapter = function() {
  5414. return {
  5415. x: function(x) {
  5416. return x;
  5417. },
  5418. setWidth: function(w) { // eslint-disable-line no-unused-vars
  5419. },
  5420. textAlign: function(align) {
  5421. return align;
  5422. },
  5423. xPlus: function(x, value) {
  5424. return x + value;
  5425. },
  5426. leftForLtr: function(x, _itemWidth) { // eslint-disable-line no-unused-vars
  5427. return x;
  5428. },
  5429. };
  5430. };
  5431. var getAdapter = function(rtl, rectX, width) {
  5432. return rtl ? getRtlAdapter(rectX, width) : getLtrAdapter();
  5433. };
  5434. var overrideTextDirection = function(ctx, direction) {
  5435. var style, original;
  5436. if (direction === 'ltr' || direction === 'rtl') {
  5437. style = ctx.canvas.style;
  5438. original = [
  5439. style.getPropertyValue('direction'),
  5440. style.getPropertyPriority('direction'),
  5441. ];
  5442. style.setProperty('direction', direction, 'important');
  5443. ctx.prevTextDirection = original;
  5444. }
  5445. };
  5446. var restoreTextDirection = function(ctx) {
  5447. var original = ctx.prevTextDirection;
  5448. if (original !== undefined) {
  5449. delete ctx.prevTextDirection;
  5450. ctx.canvas.style.setProperty('direction', original[0], original[1]);
  5451. }
  5452. };
  5453. var helpers_rtl = {
  5454. getRtlAdapter: getAdapter,
  5455. overrideTextDirection: overrideTextDirection,
  5456. restoreTextDirection: restoreTextDirection,
  5457. };
  5458. var helpers$1 = helpers_core;
  5459. var easing = helpers_easing;
  5460. var canvas = helpers_canvas;
  5461. var options = helpers_options;
  5462. var math = helpers_math;
  5463. var rtl = helpers_rtl;
  5464. helpers$1.easing = easing;
  5465. helpers$1.canvas = canvas;
  5466. helpers$1.options = options;
  5467. helpers$1.math = math;
  5468. helpers$1.rtl = rtl;
  5469. function interpolate(start, view, model, ease) {
  5470. var keys = Object.keys(model);
  5471. var i, ilen, key, actual, origin, target, type, c0, c1;
  5472. for (i = 0, ilen = keys.length; i < ilen; ++i) {
  5473. key = keys[i];
  5474. target = model[key];
  5475. // if a value is added to the model after pivot() has been called, the view
  5476. // doesn't contain it, so let's initialize the view to the target value.
  5477. if (!view.hasOwnProperty(key)) {
  5478. view[key] = target;
  5479. }
  5480. actual = view[key];
  5481. if (actual === target || key[0] === '_') {
  5482. continue;
  5483. }
  5484. if (!start.hasOwnProperty(key)) {
  5485. start[key] = actual;
  5486. }
  5487. origin = start[key];
  5488. type = typeof target;
  5489. if (type === typeof origin) {
  5490. if (type === 'string') {
  5491. c0 = chartjsColor(origin);
  5492. if (c0.valid) {
  5493. c1 = chartjsColor(target);
  5494. if (c1.valid) {
  5495. view[key] = c1.mix(c0, ease).rgbString();
  5496. continue;
  5497. }
  5498. }
  5499. } else if (helpers$1.isFinite(origin) && helpers$1.isFinite(target)) {
  5500. view[key] = origin + (target - origin) * ease;
  5501. continue;
  5502. }
  5503. }
  5504. view[key] = target;
  5505. }
  5506. }
  5507. var Element = function(configuration) {
  5508. helpers$1.extend(this, configuration);
  5509. this.initialize.apply(this, arguments);
  5510. };
  5511. helpers$1.extend(Element.prototype, {
  5512. _type: undefined,
  5513. initialize: function() {
  5514. this.hidden = false;
  5515. },
  5516. pivot: function() {
  5517. var me = this;
  5518. if (!me._view) {
  5519. me._view = helpers$1.extend({}, me._model);
  5520. }
  5521. me._start = {};
  5522. return me;
  5523. },
  5524. transition: function(ease) {
  5525. var me = this;
  5526. var model = me._model;
  5527. var start = me._start;
  5528. var view = me._view;
  5529. // No animation -> No Transition
  5530. if (!model || ease === 1) {
  5531. me._view = helpers$1.extend({}, model);
  5532. me._start = null;
  5533. return me;
  5534. }
  5535. if (!view) {
  5536. view = me._view = {};
  5537. }
  5538. if (!start) {
  5539. start = me._start = {};
  5540. }
  5541. interpolate(start, view, model, ease);
  5542. return me;
  5543. },
  5544. tooltipPosition: function() {
  5545. return {
  5546. x: this._model.x,
  5547. y: this._model.y
  5548. };
  5549. },
  5550. hasValue: function() {
  5551. return helpers$1.isNumber(this._model.x) && helpers$1.isNumber(this._model.y);
  5552. }
  5553. });
  5554. Element.extend = helpers$1.inherits;
  5555. var core_element = Element;
  5556. var exports$3 = core_element.extend({
  5557. chart: null, // the animation associated chart instance
  5558. currentStep: 0, // the current animation step
  5559. numSteps: 60, // default number of steps
  5560. easing: '', // the easing to use for this animation
  5561. render: null, // render function used by the animation service
  5562. onAnimationProgress: null, // user specified callback to fire on each step of the animation
  5563. onAnimationComplete: null, // user specified callback to fire when the animation finishes
  5564. });
  5565. var core_animation = exports$3;
  5566. // DEPRECATIONS
  5567. /**
  5568. * Provided for backward compatibility, use Chart.Animation instead
  5569. * @prop Chart.Animation#animationObject
  5570. * @deprecated since version 2.6.0
  5571. * @todo remove at version 3
  5572. */
  5573. Object.defineProperty(exports$3.prototype, 'animationObject', {
  5574. get: function() {
  5575. return this;
  5576. }
  5577. });
  5578. /**
  5579. * Provided for backward compatibility, use Chart.Animation#chart instead
  5580. * @prop Chart.Animation#chartInstance
  5581. * @deprecated since version 2.6.0
  5582. * @todo remove at version 3
  5583. */
  5584. Object.defineProperty(exports$3.prototype, 'chartInstance', {
  5585. get: function() {
  5586. return this.chart;
  5587. },
  5588. set: function(value) {
  5589. this.chart = value;
  5590. }
  5591. });
  5592. core_defaults._set('global', {
  5593. animation: {
  5594. duration: 1000,
  5595. easing: 'easeOutQuart',
  5596. onProgress: helpers$1.noop,
  5597. onComplete: helpers$1.noop
  5598. }
  5599. });
  5600. var core_animations = {
  5601. animations: [],
  5602. request: null,
  5603. /**
  5604. * @param {Chart} chart - The chart to animate.
  5605. * @param {Chart.Animation} animation - The animation that we will animate.
  5606. * @param {number} duration - The animation duration in ms.
  5607. * @param {boolean} lazy - if true, the chart is not marked as animating to enable more responsive interactions
  5608. */
  5609. addAnimation: function(chart, animation, duration, lazy) {
  5610. var animations = this.animations;
  5611. var i, ilen;
  5612. animation.chart = chart;
  5613. animation.startTime = Date.now();
  5614. animation.duration = duration;
  5615. if (!lazy) {
  5616. chart.animating = true;
  5617. }
  5618. for (i = 0, ilen = animations.length; i < ilen; ++i) {
  5619. if (animations[i].chart === chart) {
  5620. animations[i] = animation;
  5621. return;
  5622. }
  5623. }
  5624. animations.push(animation);
  5625. // If there are no animations queued, manually kickstart a digest, for lack of a better word
  5626. if (animations.length === 1) {
  5627. this.requestAnimationFrame();
  5628. }
  5629. },
  5630. cancelAnimation: function(chart) {
  5631. var index = helpers$1.findIndex(this.animations, function(animation) {
  5632. return animation.chart === chart;
  5633. });
  5634. if (index !== -1) {
  5635. this.animations.splice(index, 1);
  5636. chart.animating = false;
  5637. }
  5638. },
  5639. requestAnimationFrame: function() {
  5640. var me = this;
  5641. if (me.request === null) {
  5642. // Skip animation frame requests until the active one is executed.
  5643. // This can happen when processing mouse events, e.g. 'mousemove'
  5644. // and 'mouseout' events will trigger multiple renders.
  5645. me.request = helpers$1.requestAnimFrame.call(window, function() {
  5646. me.request = null;
  5647. me.startDigest();
  5648. });
  5649. }
  5650. },
  5651. /**
  5652. * @private
  5653. */
  5654. startDigest: function() {
  5655. var me = this;
  5656. me.advance();
  5657. // Do we have more stuff to animate?
  5658. if (me.animations.length > 0) {
  5659. me.requestAnimationFrame();
  5660. }
  5661. },
  5662. /**
  5663. * @private
  5664. */
  5665. advance: function() {
  5666. var animations = this.animations;
  5667. var animation, chart, numSteps, nextStep;
  5668. var i = 0;
  5669. // 1 animation per chart, so we are looping charts here
  5670. while (i < animations.length) {
  5671. animation = animations[i];
  5672. chart = animation.chart;
  5673. numSteps = animation.numSteps;
  5674. // Make sure that currentStep starts at 1
  5675. // https://github.com/chartjs/Chart.js/issues/6104
  5676. nextStep = Math.floor((Date.now() - animation.startTime) / animation.duration * numSteps) + 1;
  5677. animation.currentStep = Math.min(nextStep, numSteps);
  5678. helpers$1.callback(animation.render, [chart, animation], chart);
  5679. helpers$1.callback(animation.onAnimationProgress, [animation], chart);
  5680. if (animation.currentStep >= numSteps) {
  5681. helpers$1.callback(animation.onAnimationComplete, [animation], chart);
  5682. chart.animating = false;
  5683. animations.splice(i, 1);
  5684. } else {
  5685. ++i;
  5686. }
  5687. }
  5688. }
  5689. };
  5690. var resolve = helpers$1.options.resolve;
  5691. var arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'];
  5692. /**
  5693. * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice',
  5694. * 'unshift') and notify the listener AFTER the array has been altered. Listeners are
  5695. * called on the 'onData*' callbacks (e.g. onDataPush, etc.) with same arguments.
  5696. */
  5697. function listenArrayEvents(array, listener) {
  5698. if (array._chartjs) {
  5699. array._chartjs.listeners.push(listener);
  5700. return;
  5701. }
  5702. Object.defineProperty(array, '_chartjs', {
  5703. configurable: true,
  5704. enumerable: false,
  5705. value: {
  5706. listeners: [listener]
  5707. }
  5708. });
  5709. arrayEvents.forEach(function(key) {
  5710. var method = 'onData' + key.charAt(0).toUpperCase() + key.slice(1);
  5711. var base = array[key];
  5712. Object.defineProperty(array, key, {
  5713. configurable: true,
  5714. enumerable: false,
  5715. value: function() {
  5716. var args = Array.prototype.slice.call(arguments);
  5717. var res = base.apply(this, args);
  5718. helpers$1.each(array._chartjs.listeners, function(object) {
  5719. if (typeof object[method] === 'function') {
  5720. object[method].apply(object, args);
  5721. }
  5722. });
  5723. return res;
  5724. }
  5725. });
  5726. });
  5727. }
  5728. /**
  5729. * Removes the given array event listener and cleanup extra attached properties (such as
  5730. * the _chartjs stub and overridden methods) if array doesn't have any more listeners.
  5731. */
  5732. function unlistenArrayEvents(array, listener) {
  5733. var stub = array._chartjs;
  5734. if (!stub) {
  5735. return;
  5736. }
  5737. var listeners = stub.listeners;
  5738. var index = listeners.indexOf(listener);
  5739. if (index !== -1) {
  5740. listeners.splice(index, 1);
  5741. }
  5742. if (listeners.length > 0) {
  5743. return;
  5744. }
  5745. arrayEvents.forEach(function(key) {
  5746. delete array[key];
  5747. });
  5748. delete array._chartjs;
  5749. }
  5750. // Base class for all dataset controllers (line, bar, etc)
  5751. var DatasetController = function(chart, datasetIndex) {
  5752. this.initialize(chart, datasetIndex);
  5753. };
  5754. helpers$1.extend(DatasetController.prototype, {
  5755. /**
  5756. * Element type used to generate a meta dataset (e.g. Chart.element.Line).
  5757. * @type {Chart.core.element}
  5758. */
  5759. datasetElementType: null,
  5760. /**
  5761. * Element type used to generate a meta data (e.g. Chart.element.Point).
  5762. * @type {Chart.core.element}
  5763. */
  5764. dataElementType: null,
  5765. /**
  5766. * Dataset element option keys to be resolved in _resolveDatasetElementOptions.
  5767. * A derived controller may override this to resolve controller-specific options.
  5768. * The keys defined here are for backward compatibility for legend styles.
  5769. * @private
  5770. */
  5771. _datasetElementOptions: [
  5772. 'backgroundColor',
  5773. 'borderCapStyle',
  5774. 'borderColor',
  5775. 'borderDash',
  5776. 'borderDashOffset',
  5777. 'borderJoinStyle',
  5778. 'borderWidth'
  5779. ],
  5780. /**
  5781. * Data element option keys to be resolved in _resolveDataElementOptions.
  5782. * A derived controller may override this to resolve controller-specific options.
  5783. * The keys defined here are for backward compatibility for legend styles.
  5784. * @private
  5785. */
  5786. _dataElementOptions: [
  5787. 'backgroundColor',
  5788. 'borderColor',
  5789. 'borderWidth',
  5790. 'pointStyle'
  5791. ],
  5792. initialize: function(chart, datasetIndex) {
  5793. var me = this;
  5794. me.chart = chart;
  5795. me.index = datasetIndex;
  5796. me.linkScales();
  5797. me.addElements();
  5798. me._type = me.getMeta().type;
  5799. },
  5800. updateIndex: function(datasetIndex) {
  5801. this.index = datasetIndex;
  5802. },
  5803. linkScales: function() {
  5804. var me = this;
  5805. var meta = me.getMeta();
  5806. var chart = me.chart;
  5807. var scales = chart.scales;
  5808. var dataset = me.getDataset();
  5809. var scalesOpts = chart.options.scales;
  5810. if (meta.xAxisID === null || !(meta.xAxisID in scales) || dataset.xAxisID) {
  5811. meta.xAxisID = dataset.xAxisID || scalesOpts.xAxes[0].id;
  5812. }
  5813. if (meta.yAxisID === null || !(meta.yAxisID in scales) || dataset.yAxisID) {
  5814. meta.yAxisID = dataset.yAxisID || scalesOpts.yAxes[0].id;
  5815. }
  5816. },
  5817. getDataset: function() {
  5818. return this.chart.data.datasets[this.index];
  5819. },
  5820. getMeta: function() {
  5821. return this.chart.getDatasetMeta(this.index);
  5822. },
  5823. getScaleForId: function(scaleID) {
  5824. return this.chart.scales[scaleID];
  5825. },
  5826. /**
  5827. * @private
  5828. */
  5829. _getValueScaleId: function() {
  5830. return this.getMeta().yAxisID;
  5831. },
  5832. /**
  5833. * @private
  5834. */
  5835. _getIndexScaleId: function() {
  5836. return this.getMeta().xAxisID;
  5837. },
  5838. /**
  5839. * @private
  5840. */
  5841. _getValueScale: function() {
  5842. return this.getScaleForId(this._getValueScaleId());
  5843. },
  5844. /**
  5845. * @private
  5846. */
  5847. _getIndexScale: function() {
  5848. return this.getScaleForId(this._getIndexScaleId());
  5849. },
  5850. reset: function() {
  5851. this._update(true);
  5852. },
  5853. /**
  5854. * @private
  5855. */
  5856. destroy: function() {
  5857. if (this._data) {
  5858. unlistenArrayEvents(this._data, this);
  5859. }
  5860. },
  5861. createMetaDataset: function() {
  5862. var me = this;
  5863. var type = me.datasetElementType;
  5864. return type && new type({
  5865. _chart: me.chart,
  5866. _datasetIndex: me.index
  5867. });
  5868. },
  5869. createMetaData: function(index) {
  5870. var me = this;
  5871. var type = me.dataElementType;
  5872. return type && new type({
  5873. _chart: me.chart,
  5874. _datasetIndex: me.index,
  5875. _index: index
  5876. });
  5877. },
  5878. addElements: function() {
  5879. var me = this;
  5880. var meta = me.getMeta();
  5881. var data = me.getDataset().data || [];
  5882. var metaData = meta.data;
  5883. var i, ilen;
  5884. for (i = 0, ilen = data.length; i < ilen; ++i) {
  5885. metaData[i] = metaData[i] || me.createMetaData(i);
  5886. }
  5887. meta.dataset = meta.dataset || me.createMetaDataset();
  5888. },
  5889. addElementAndReset: function(index) {
  5890. var element = this.createMetaData(index);
  5891. this.getMeta().data.splice(index, 0, element);
  5892. this.updateElement(element, index, true);
  5893. },
  5894. buildOrUpdateElements: function() {
  5895. var me = this;
  5896. var dataset = me.getDataset();
  5897. var data = dataset.data || (dataset.data = []);
  5898. // In order to correctly handle data addition/deletion animation (an thus simulate
  5899. // real-time charts), we need to monitor these data modifications and synchronize
  5900. // the internal meta data accordingly.
  5901. if (me._data !== data) {
  5902. if (me._data) {
  5903. // This case happens when the user replaced the data array instance.
  5904. unlistenArrayEvents(me._data, me);
  5905. }
  5906. if (data && Object.isExtensible(data)) {
  5907. listenArrayEvents(data, me);
  5908. }
  5909. me._data = data;
  5910. }
  5911. // Re-sync meta data in case the user replaced the data array or if we missed
  5912. // any updates and so make sure that we handle number of datapoints changing.
  5913. me.resyncElements();
  5914. },
  5915. /**
  5916. * Returns the merged user-supplied and default dataset-level options
  5917. * @private
  5918. */
  5919. _configure: function() {
  5920. var me = this;
  5921. me._config = helpers$1.merge(Object.create(null), [
  5922. me.chart.options.datasets[me._type],
  5923. me.getDataset(),
  5924. ], {
  5925. merger: function(key, target, source) {
  5926. if (key !== '_meta' && key !== 'data') {
  5927. helpers$1._merger(key, target, source);
  5928. }
  5929. }
  5930. });
  5931. },
  5932. _update: function(reset) {
  5933. var me = this;
  5934. me._configure();
  5935. me._cachedDataOpts = null;
  5936. me.update(reset);
  5937. },
  5938. update: helpers$1.noop,
  5939. transition: function(easingValue) {
  5940. var meta = this.getMeta();
  5941. var elements = meta.data || [];
  5942. var ilen = elements.length;
  5943. var i = 0;
  5944. for (; i < ilen; ++i) {
  5945. elements[i].transition(easingValue);
  5946. }
  5947. if (meta.dataset) {
  5948. meta.dataset.transition(easingValue);
  5949. }
  5950. },
  5951. draw: function() {
  5952. var meta = this.getMeta();
  5953. var elements = meta.data || [];
  5954. var ilen = elements.length;
  5955. var i = 0;
  5956. if (meta.dataset) {
  5957. meta.dataset.draw();
  5958. }
  5959. for (; i < ilen; ++i) {
  5960. elements[i].draw();
  5961. }
  5962. },
  5963. /**
  5964. * Returns a set of predefined style properties that should be used to represent the dataset
  5965. * or the data if the index is specified
  5966. * @param {number} index - data index
  5967. * @return {IStyleInterface} style object
  5968. */
  5969. getStyle: function(index) {
  5970. var me = this;
  5971. var meta = me.getMeta();
  5972. var dataset = meta.dataset;
  5973. var style;
  5974. me._configure();
  5975. if (dataset && index === undefined) {
  5976. style = me._resolveDatasetElementOptions(dataset || {});
  5977. } else {
  5978. index = index || 0;
  5979. style = me._resolveDataElementOptions(meta.data[index] || {}, index);
  5980. }
  5981. if (style.fill === false || style.fill === null) {
  5982. style.backgroundColor = style.borderColor;
  5983. }
  5984. return style;
  5985. },
  5986. /**
  5987. * @private
  5988. */
  5989. _resolveDatasetElementOptions: function(element, hover) {
  5990. var me = this;
  5991. var chart = me.chart;
  5992. var datasetOpts = me._config;
  5993. var custom = element.custom || {};
  5994. var options = chart.options.elements[me.datasetElementType.prototype._type] || {};
  5995. var elementOptions = me._datasetElementOptions;
  5996. var values = {};
  5997. var i, ilen, key, readKey;
  5998. // Scriptable options
  5999. var context = {
  6000. chart: chart,
  6001. dataset: me.getDataset(),
  6002. datasetIndex: me.index,
  6003. hover: hover
  6004. };
  6005. for (i = 0, ilen = elementOptions.length; i < ilen; ++i) {
  6006. key = elementOptions[i];
  6007. readKey = hover ? 'hover' + key.charAt(0).toUpperCase() + key.slice(1) : key;
  6008. values[key] = resolve([
  6009. custom[readKey],
  6010. datasetOpts[readKey],
  6011. options[readKey]
  6012. ], context);
  6013. }
  6014. return values;
  6015. },
  6016. /**
  6017. * @private
  6018. */
  6019. _resolveDataElementOptions: function(element, index) {
  6020. var me = this;
  6021. var custom = element && element.custom;
  6022. var cached = me._cachedDataOpts;
  6023. if (cached && !custom) {
  6024. return cached;
  6025. }
  6026. var chart = me.chart;
  6027. var datasetOpts = me._config;
  6028. var options = chart.options.elements[me.dataElementType.prototype._type] || {};
  6029. var elementOptions = me._dataElementOptions;
  6030. var values = {};
  6031. // Scriptable options
  6032. var context = {
  6033. chart: chart,
  6034. dataIndex: index,
  6035. dataset: me.getDataset(),
  6036. datasetIndex: me.index
  6037. };
  6038. // `resolve` sets cacheable to `false` if any option is indexed or scripted
  6039. var info = {cacheable: !custom};
  6040. var keys, i, ilen, key;
  6041. custom = custom || {};
  6042. if (helpers$1.isArray(elementOptions)) {
  6043. for (i = 0, ilen = elementOptions.length; i < ilen; ++i) {
  6044. key = elementOptions[i];
  6045. values[key] = resolve([
  6046. custom[key],
  6047. datasetOpts[key],
  6048. options[key]
  6049. ], context, index, info);
  6050. }
  6051. } else {
  6052. keys = Object.keys(elementOptions);
  6053. for (i = 0, ilen = keys.length; i < ilen; ++i) {
  6054. key = keys[i];
  6055. values[key] = resolve([
  6056. custom[key],
  6057. datasetOpts[elementOptions[key]],
  6058. datasetOpts[key],
  6059. options[key]
  6060. ], context, index, info);
  6061. }
  6062. }
  6063. if (info.cacheable) {
  6064. me._cachedDataOpts = Object.freeze(values);
  6065. }
  6066. return values;
  6067. },
  6068. removeHoverStyle: function(element) {
  6069. helpers$1.merge(element._model, element.$previousStyle || {});
  6070. delete element.$previousStyle;
  6071. },
  6072. setHoverStyle: function(element) {
  6073. var dataset = this.chart.data.datasets[element._datasetIndex];
  6074. var index = element._index;
  6075. var custom = element.custom || {};
  6076. var model = element._model;
  6077. var getHoverColor = helpers$1.getHoverColor;
  6078. element.$previousStyle = {
  6079. backgroundColor: model.backgroundColor,
  6080. borderColor: model.borderColor,
  6081. borderWidth: model.borderWidth
  6082. };
  6083. model.backgroundColor = resolve([custom.hoverBackgroundColor, dataset.hoverBackgroundColor, getHoverColor(model.backgroundColor)], undefined, index);
  6084. model.borderColor = resolve([custom.hoverBorderColor, dataset.hoverBorderColor, getHoverColor(model.borderColor)], undefined, index);
  6085. model.borderWidth = resolve([custom.hoverBorderWidth, dataset.hoverBorderWidth, model.borderWidth], undefined, index);
  6086. },
  6087. /**
  6088. * @private
  6089. */
  6090. _removeDatasetHoverStyle: function() {
  6091. var element = this.getMeta().dataset;
  6092. if (element) {
  6093. this.removeHoverStyle(element);
  6094. }
  6095. },
  6096. /**
  6097. * @private
  6098. */
  6099. _setDatasetHoverStyle: function() {
  6100. var element = this.getMeta().dataset;
  6101. var prev = {};
  6102. var i, ilen, key, keys, hoverOptions, model;
  6103. if (!element) {
  6104. return;
  6105. }
  6106. model = element._model;
  6107. hoverOptions = this._resolveDatasetElementOptions(element, true);
  6108. keys = Object.keys(hoverOptions);
  6109. for (i = 0, ilen = keys.length; i < ilen; ++i) {
  6110. key = keys[i];
  6111. prev[key] = model[key];
  6112. model[key] = hoverOptions[key];
  6113. }
  6114. element.$previousStyle = prev;
  6115. },
  6116. /**
  6117. * @private
  6118. */
  6119. resyncElements: function() {
  6120. var me = this;
  6121. var meta = me.getMeta();
  6122. var data = me.getDataset().data;
  6123. var numMeta = meta.data.length;
  6124. var numData = data.length;
  6125. if (numData < numMeta) {
  6126. meta.data.splice(numData, numMeta - numData);
  6127. } else if (numData > numMeta) {
  6128. me.insertElements(numMeta, numData - numMeta);
  6129. }
  6130. },
  6131. /**
  6132. * @private
  6133. */
  6134. insertElements: function(start, count) {
  6135. for (var i = 0; i < count; ++i) {
  6136. this.addElementAndReset(start + i);
  6137. }
  6138. },
  6139. /**
  6140. * @private
  6141. */
  6142. onDataPush: function() {
  6143. var count = arguments.length;
  6144. this.insertElements(this.getDataset().data.length - count, count);
  6145. },
  6146. /**
  6147. * @private
  6148. */
  6149. onDataPop: function() {
  6150. this.getMeta().data.pop();
  6151. },
  6152. /**
  6153. * @private
  6154. */
  6155. onDataShift: function() {
  6156. this.getMeta().data.shift();
  6157. },
  6158. /**
  6159. * @private
  6160. */
  6161. onDataSplice: function(start, count) {
  6162. this.getMeta().data.splice(start, count);
  6163. this.insertElements(start, arguments.length - 2);
  6164. },
  6165. /**
  6166. * @private
  6167. */
  6168. onDataUnshift: function() {
  6169. this.insertElements(0, arguments.length);
  6170. }
  6171. });
  6172. DatasetController.extend = helpers$1.inherits;
  6173. var core_datasetController = DatasetController;
  6174. var TAU = Math.PI * 2;
  6175. core_defaults._set('global', {
  6176. elements: {
  6177. arc: {
  6178. backgroundColor: core_defaults.global.defaultColor,
  6179. borderColor: '#fff',
  6180. borderWidth: 2,
  6181. borderAlign: 'center'
  6182. }
  6183. }
  6184. });
  6185. function clipArc(ctx, arc) {
  6186. var startAngle = arc.startAngle;
  6187. var endAngle = arc.endAngle;
  6188. var pixelMargin = arc.pixelMargin;
  6189. var angleMargin = pixelMargin / arc.outerRadius;
  6190. var x = arc.x;
  6191. var y = arc.y;
  6192. // Draw an inner border by cliping the arc and drawing a double-width border
  6193. // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders
  6194. ctx.beginPath();
  6195. ctx.arc(x, y, arc.outerRadius, startAngle - angleMargin, endAngle + angleMargin);
  6196. if (arc.innerRadius > pixelMargin) {
  6197. angleMargin = pixelMargin / arc.innerRadius;
  6198. ctx.arc(x, y, arc.innerRadius - pixelMargin, endAngle + angleMargin, startAngle - angleMargin, true);
  6199. } else {
  6200. ctx.arc(x, y, pixelMargin, endAngle + Math.PI / 2, startAngle - Math.PI / 2);
  6201. }
  6202. ctx.closePath();
  6203. ctx.clip();
  6204. }
  6205. function drawFullCircleBorders(ctx, vm, arc, inner) {
  6206. var endAngle = arc.endAngle;
  6207. var i;
  6208. if (inner) {
  6209. arc.endAngle = arc.startAngle + TAU;
  6210. clipArc(ctx, arc);
  6211. arc.endAngle = endAngle;
  6212. if (arc.endAngle === arc.startAngle && arc.fullCircles) {
  6213. arc.endAngle += TAU;
  6214. arc.fullCircles--;
  6215. }
  6216. }
  6217. ctx.beginPath();
  6218. ctx.arc(arc.x, arc.y, arc.innerRadius, arc.startAngle + TAU, arc.startAngle, true);
  6219. for (i = 0; i < arc.fullCircles; ++i) {
  6220. ctx.stroke();
  6221. }
  6222. ctx.beginPath();
  6223. ctx.arc(arc.x, arc.y, vm.outerRadius, arc.startAngle, arc.startAngle + TAU);
  6224. for (i = 0; i < arc.fullCircles; ++i) {
  6225. ctx.stroke();
  6226. }
  6227. }
  6228. function drawBorder(ctx, vm, arc) {
  6229. var inner = vm.borderAlign === 'inner';
  6230. if (inner) {
  6231. ctx.lineWidth = vm.borderWidth * 2;
  6232. ctx.lineJoin = 'round';
  6233. } else {
  6234. ctx.lineWidth = vm.borderWidth;
  6235. ctx.lineJoin = 'bevel';
  6236. }
  6237. if (arc.fullCircles) {
  6238. drawFullCircleBorders(ctx, vm, arc, inner);
  6239. }
  6240. if (inner) {
  6241. clipArc(ctx, arc);
  6242. }
  6243. ctx.beginPath();
  6244. ctx.arc(arc.x, arc.y, vm.outerRadius, arc.startAngle, arc.endAngle);
  6245. ctx.arc(arc.x, arc.y, arc.innerRadius, arc.endAngle, arc.startAngle, true);
  6246. ctx.closePath();
  6247. ctx.stroke();
  6248. }
  6249. var element_arc = core_element.extend({
  6250. _type: 'arc',
  6251. inLabelRange: function(mouseX) {
  6252. var vm = this._view;
  6253. if (vm) {
  6254. return (Math.pow(mouseX - vm.x, 2) < Math.pow(vm.radius + vm.hoverRadius, 2));
  6255. }
  6256. return false;
  6257. },
  6258. inRange: function(chartX, chartY) {
  6259. var vm = this._view;
  6260. if (vm) {
  6261. var pointRelativePosition = helpers$1.getAngleFromPoint(vm, {x: chartX, y: chartY});
  6262. var angle = pointRelativePosition.angle;
  6263. var distance = pointRelativePosition.distance;
  6264. // Sanitise angle range
  6265. var startAngle = vm.startAngle;
  6266. var endAngle = vm.endAngle;
  6267. while (endAngle < startAngle) {
  6268. endAngle += TAU;
  6269. }
  6270. while (angle > endAngle) {
  6271. angle -= TAU;
  6272. }
  6273. while (angle < startAngle) {
  6274. angle += TAU;
  6275. }
  6276. // Check if within the range of the open/close angle
  6277. var betweenAngles = (angle >= startAngle && angle <= endAngle);
  6278. var withinRadius = (distance >= vm.innerRadius && distance <= vm.outerRadius);
  6279. return (betweenAngles && withinRadius);
  6280. }
  6281. return false;
  6282. },
  6283. getCenterPoint: function() {
  6284. var vm = this._view;
  6285. var halfAngle = (vm.startAngle + vm.endAngle) / 2;
  6286. var halfRadius = (vm.innerRadius + vm.outerRadius) / 2;
  6287. return {
  6288. x: vm.x + Math.cos(halfAngle) * halfRadius,
  6289. y: vm.y + Math.sin(halfAngle) * halfRadius
  6290. };
  6291. },
  6292. getArea: function() {
  6293. var vm = this._view;
  6294. return Math.PI * ((vm.endAngle - vm.startAngle) / (2 * Math.PI)) * (Math.pow(vm.outerRadius, 2) - Math.pow(vm.innerRadius, 2));
  6295. },
  6296. tooltipPosition: function() {
  6297. var vm = this._view;
  6298. var centreAngle = vm.startAngle + ((vm.endAngle - vm.startAngle) / 2);
  6299. var rangeFromCentre = (vm.outerRadius - vm.innerRadius) / 2 + vm.innerRadius;
  6300. return {
  6301. x: vm.x + (Math.cos(centreAngle) * rangeFromCentre),
  6302. y: vm.y + (Math.sin(centreAngle) * rangeFromCentre)
  6303. };
  6304. },
  6305. draw: function() {
  6306. var ctx = this._chart.ctx;
  6307. var vm = this._view;
  6308. var pixelMargin = (vm.borderAlign === 'inner') ? 0.33 : 0;
  6309. var arc = {
  6310. x: vm.x,
  6311. y: vm.y,
  6312. innerRadius: vm.innerRadius,
  6313. outerRadius: Math.max(vm.outerRadius - pixelMargin, 0),
  6314. pixelMargin: pixelMargin,
  6315. startAngle: vm.startAngle,
  6316. endAngle: vm.endAngle,
  6317. fullCircles: Math.floor(vm.circumference / TAU)
  6318. };
  6319. var i;
  6320. ctx.save();
  6321. ctx.fillStyle = vm.backgroundColor;
  6322. ctx.strokeStyle = vm.borderColor;
  6323. if (arc.fullCircles) {
  6324. arc.endAngle = arc.startAngle + TAU;
  6325. ctx.beginPath();
  6326. ctx.arc(arc.x, arc.y, arc.outerRadius, arc.startAngle, arc.endAngle);
  6327. ctx.arc(arc.x, arc.y, arc.innerRadius, arc.endAngle, arc.startAngle, true);
  6328. ctx.closePath();
  6329. for (i = 0; i < arc.fullCircles; ++i) {
  6330. ctx.fill();
  6331. }
  6332. arc.endAngle = arc.startAngle + vm.circumference % TAU;
  6333. }
  6334. ctx.beginPath();
  6335. ctx.arc(arc.x, arc.y, arc.outerRadius, arc.startAngle, arc.endAngle);
  6336. ctx.arc(arc.x, arc.y, arc.innerRadius, arc.endAngle, arc.startAngle, true);
  6337. ctx.closePath();
  6338. ctx.fill();
  6339. if (vm.borderWidth) {
  6340. drawBorder(ctx, vm, arc);
  6341. }
  6342. ctx.restore();
  6343. }
  6344. });
  6345. var valueOrDefault$1 = helpers$1.valueOrDefault;
  6346. var defaultColor = core_defaults.global.defaultColor;
  6347. core_defaults._set('global', {
  6348. elements: {
  6349. line: {
  6350. tension: 0.4,
  6351. backgroundColor: defaultColor,
  6352. borderWidth: 3,
  6353. borderColor: defaultColor,
  6354. borderCapStyle: 'butt',
  6355. borderDash: [],
  6356. borderDashOffset: 0.0,
  6357. borderJoinStyle: 'miter',
  6358. capBezierPoints: true,
  6359. fill: true, // do we fill in the area between the line and its base axis
  6360. }
  6361. }
  6362. });
  6363. var element_line = core_element.extend({
  6364. _type: 'line',
  6365. draw: function() {
  6366. var me = this;
  6367. var vm = me._view;
  6368. var ctx = me._chart.ctx;
  6369. var spanGaps = vm.spanGaps;
  6370. var points = me._children.slice(); // clone array
  6371. var globalDefaults = core_defaults.global;
  6372. var globalOptionLineElements = globalDefaults.elements.line;
  6373. var lastDrawnIndex = -1;
  6374. var closePath = me._loop;
  6375. var index, previous, currentVM;
  6376. if (!points.length) {
  6377. return;
  6378. }
  6379. if (me._loop) {
  6380. for (index = 0; index < points.length; ++index) {
  6381. previous = helpers$1.previousItem(points, index);
  6382. // If the line has an open path, shift the point array
  6383. if (!points[index]._view.skip && previous._view.skip) {
  6384. points = points.slice(index).concat(points.slice(0, index));
  6385. closePath = spanGaps;
  6386. break;
  6387. }
  6388. }
  6389. // If the line has a close path, add the first point again
  6390. if (closePath) {
  6391. points.push(points[0]);
  6392. }
  6393. }
  6394. ctx.save();
  6395. // Stroke Line Options
  6396. ctx.lineCap = vm.borderCapStyle || globalOptionLineElements.borderCapStyle;
  6397. // IE 9 and 10 do not support line dash
  6398. if (ctx.setLineDash) {
  6399. ctx.setLineDash(vm.borderDash || globalOptionLineElements.borderDash);
  6400. }
  6401. ctx.lineDashOffset = valueOrDefault$1(vm.borderDashOffset, globalOptionLineElements.borderDashOffset);
  6402. ctx.lineJoin = vm.borderJoinStyle || globalOptionLineElements.borderJoinStyle;
  6403. ctx.lineWidth = valueOrDefault$1(vm.borderWidth, globalOptionLineElements.borderWidth);
  6404. ctx.strokeStyle = vm.borderColor || globalDefaults.defaultColor;
  6405. // Stroke Line
  6406. ctx.beginPath();
  6407. // First point moves to it's starting position no matter what
  6408. currentVM = points[0]._view;
  6409. if (!currentVM.skip) {
  6410. ctx.moveTo(currentVM.x, currentVM.y);
  6411. lastDrawnIndex = 0;
  6412. }
  6413. for (index = 1; index < points.length; ++index) {
  6414. currentVM = points[index]._view;
  6415. previous = lastDrawnIndex === -1 ? helpers$1.previousItem(points, index) : points[lastDrawnIndex];
  6416. if (!currentVM.skip) {
  6417. if ((lastDrawnIndex !== (index - 1) && !spanGaps) || lastDrawnIndex === -1) {
  6418. // There was a gap and this is the first point after the gap
  6419. ctx.moveTo(currentVM.x, currentVM.y);
  6420. } else {
  6421. // Line to next point
  6422. helpers$1.canvas.lineTo(ctx, previous._view, currentVM);
  6423. }
  6424. lastDrawnIndex = index;
  6425. }
  6426. }
  6427. if (closePath) {
  6428. ctx.closePath();
  6429. }
  6430. ctx.stroke();
  6431. ctx.restore();
  6432. }
  6433. });
  6434. var valueOrDefault$2 = helpers$1.valueOrDefault;
  6435. var defaultColor$1 = core_defaults.global.defaultColor;
  6436. core_defaults._set('global', {
  6437. elements: {
  6438. point: {
  6439. radius: 3,
  6440. pointStyle: 'circle',
  6441. backgroundColor: defaultColor$1,
  6442. borderColor: defaultColor$1,
  6443. borderWidth: 1,
  6444. // Hover
  6445. hitRadius: 1,
  6446. hoverRadius: 4,
  6447. hoverBorderWidth: 1
  6448. }
  6449. }
  6450. });
  6451. function xRange(mouseX) {
  6452. var vm = this._view;
  6453. return vm ? (Math.abs(mouseX - vm.x) < vm.radius + vm.hitRadius) : false;
  6454. }
  6455. function yRange(mouseY) {
  6456. var vm = this._view;
  6457. return vm ? (Math.abs(mouseY - vm.y) < vm.radius + vm.hitRadius) : false;
  6458. }
  6459. var element_point = core_element.extend({
  6460. _type: 'point',
  6461. inRange: function(mouseX, mouseY) {
  6462. var vm = this._view;
  6463. return vm ? ((Math.pow(mouseX - vm.x, 2) + Math.pow(mouseY - vm.y, 2)) < Math.pow(vm.hitRadius + vm.radius, 2)) : false;
  6464. },
  6465. inLabelRange: xRange,
  6466. inXRange: xRange,
  6467. inYRange: yRange,
  6468. getCenterPoint: function() {
  6469. var vm = this._view;
  6470. return {
  6471. x: vm.x,
  6472. y: vm.y
  6473. };
  6474. },
  6475. getArea: function() {
  6476. return Math.PI * Math.pow(this._view.radius, 2);
  6477. },
  6478. tooltipPosition: function() {
  6479. var vm = this._view;
  6480. return {
  6481. x: vm.x,
  6482. y: vm.y,
  6483. padding: vm.radius + vm.borderWidth
  6484. };
  6485. },
  6486. draw: function(chartArea) {
  6487. var vm = this._view;
  6488. var ctx = this._chart.ctx;
  6489. var pointStyle = vm.pointStyle;
  6490. var rotation = vm.rotation;
  6491. var radius = vm.radius;
  6492. var x = vm.x;
  6493. var y = vm.y;
  6494. var globalDefaults = core_defaults.global;
  6495. var defaultColor = globalDefaults.defaultColor; // eslint-disable-line no-shadow
  6496. if (vm.skip) {
  6497. return;
  6498. }
  6499. // Clipping for Points.
  6500. if (chartArea === undefined || helpers$1.canvas._isPointInArea(vm, chartArea)) {
  6501. ctx.strokeStyle = vm.borderColor || defaultColor;
  6502. ctx.lineWidth = valueOrDefault$2(vm.borderWidth, globalDefaults.elements.point.borderWidth);
  6503. ctx.fillStyle = vm.backgroundColor || defaultColor;
  6504. helpers$1.canvas.drawPoint(ctx, pointStyle, radius, x, y, rotation);
  6505. }
  6506. }
  6507. });
  6508. var defaultColor$2 = core_defaults.global.defaultColor;
  6509. core_defaults._set('global', {
  6510. elements: {
  6511. rectangle: {
  6512. backgroundColor: defaultColor$2,
  6513. borderColor: defaultColor$2,
  6514. borderSkipped: 'bottom',
  6515. borderWidth: 0
  6516. }
  6517. }
  6518. });
  6519. function isVertical(vm) {
  6520. return vm && vm.width !== undefined;
  6521. }
  6522. /**
  6523. * Helper function to get the bounds of the bar regardless of the orientation
  6524. * @param bar {Chart.Element.Rectangle} the bar
  6525. * @return {Bounds} bounds of the bar
  6526. * @private
  6527. */
  6528. function getBarBounds(vm) {
  6529. var x1, x2, y1, y2, half;
  6530. if (isVertical(vm)) {
  6531. half = vm.width / 2;
  6532. x1 = vm.x - half;
  6533. x2 = vm.x + half;
  6534. y1 = Math.min(vm.y, vm.base);
  6535. y2 = Math.max(vm.y, vm.base);
  6536. } else {
  6537. half = vm.height / 2;
  6538. x1 = Math.min(vm.x, vm.base);
  6539. x2 = Math.max(vm.x, vm.base);
  6540. y1 = vm.y - half;
  6541. y2 = vm.y + half;
  6542. }
  6543. return {
  6544. left: x1,
  6545. top: y1,
  6546. right: x2,
  6547. bottom: y2
  6548. };
  6549. }
  6550. function swap(orig, v1, v2) {
  6551. return orig === v1 ? v2 : orig === v2 ? v1 : orig;
  6552. }
  6553. function parseBorderSkipped(vm) {
  6554. var edge = vm.borderSkipped;
  6555. var res = {};
  6556. if (!edge) {
  6557. return res;
  6558. }
  6559. if (vm.horizontal) {
  6560. if (vm.base > vm.x) {
  6561. edge = swap(edge, 'left', 'right');
  6562. }
  6563. } else if (vm.base < vm.y) {
  6564. edge = swap(edge, 'bottom', 'top');
  6565. }
  6566. res[edge] = true;
  6567. return res;
  6568. }
  6569. function parseBorderWidth(vm, maxW, maxH) {
  6570. var value = vm.borderWidth;
  6571. var skip = parseBorderSkipped(vm);
  6572. var t, r, b, l;
  6573. if (helpers$1.isObject(value)) {
  6574. t = +value.top || 0;
  6575. r = +value.right || 0;
  6576. b = +value.bottom || 0;
  6577. l = +value.left || 0;
  6578. } else {
  6579. t = r = b = l = +value || 0;
  6580. }
  6581. return {
  6582. t: skip.top || (t < 0) ? 0 : t > maxH ? maxH : t,
  6583. r: skip.right || (r < 0) ? 0 : r > maxW ? maxW : r,
  6584. b: skip.bottom || (b < 0) ? 0 : b > maxH ? maxH : b,
  6585. l: skip.left || (l < 0) ? 0 : l > maxW ? maxW : l
  6586. };
  6587. }
  6588. function boundingRects(vm) {
  6589. var bounds = getBarBounds(vm);
  6590. var width = bounds.right - bounds.left;
  6591. var height = bounds.bottom - bounds.top;
  6592. var border = parseBorderWidth(vm, width / 2, height / 2);
  6593. return {
  6594. outer: {
  6595. x: bounds.left,
  6596. y: bounds.top,
  6597. w: width,
  6598. h: height
  6599. },
  6600. inner: {
  6601. x: bounds.left + border.l,
  6602. y: bounds.top + border.t,
  6603. w: width - border.l - border.r,
  6604. h: height - border.t - border.b
  6605. }
  6606. };
  6607. }
  6608. function inRange(vm, x, y) {
  6609. var skipX = x === null;
  6610. var skipY = y === null;
  6611. var bounds = !vm || (skipX && skipY) ? false : getBarBounds(vm);
  6612. return bounds
  6613. && (skipX || x >= bounds.left && x <= bounds.right)
  6614. && (skipY || y >= bounds.top && y <= bounds.bottom);
  6615. }
  6616. var element_rectangle = core_element.extend({
  6617. _type: 'rectangle',
  6618. draw: function() {
  6619. var ctx = this._chart.ctx;
  6620. var vm = this._view;
  6621. var rects = boundingRects(vm);
  6622. var outer = rects.outer;
  6623. var inner = rects.inner;
  6624. ctx.fillStyle = vm.backgroundColor;
  6625. ctx.fillRect(outer.x, outer.y, outer.w, outer.h);
  6626. if (outer.w === inner.w && outer.h === inner.h) {
  6627. return;
  6628. }
  6629. ctx.save();
  6630. ctx.beginPath();
  6631. ctx.rect(outer.x, outer.y, outer.w, outer.h);
  6632. ctx.clip();
  6633. ctx.fillStyle = vm.borderColor;
  6634. ctx.rect(inner.x, inner.y, inner.w, inner.h);
  6635. ctx.fill('evenodd');
  6636. ctx.restore();
  6637. },
  6638. height: function() {
  6639. var vm = this._view;
  6640. return vm.base - vm.y;
  6641. },
  6642. inRange: function(mouseX, mouseY) {
  6643. return inRange(this._view, mouseX, mouseY);
  6644. },
  6645. inLabelRange: function(mouseX, mouseY) {
  6646. var vm = this._view;
  6647. return isVertical(vm)
  6648. ? inRange(vm, mouseX, null)
  6649. : inRange(vm, null, mouseY);
  6650. },
  6651. inXRange: function(mouseX) {
  6652. return inRange(this._view, mouseX, null);
  6653. },
  6654. inYRange: function(mouseY) {
  6655. return inRange(this._view, null, mouseY);
  6656. },
  6657. getCenterPoint: function() {
  6658. var vm = this._view;
  6659. var x, y;
  6660. if (isVertical(vm)) {
  6661. x = vm.x;
  6662. y = (vm.y + vm.base) / 2;
  6663. } else {
  6664. x = (vm.x + vm.base) / 2;
  6665. y = vm.y;
  6666. }
  6667. return {x: x, y: y};
  6668. },
  6669. getArea: function() {
  6670. var vm = this._view;
  6671. return isVertical(vm)
  6672. ? vm.width * Math.abs(vm.y - vm.base)
  6673. : vm.height * Math.abs(vm.x - vm.base);
  6674. },
  6675. tooltipPosition: function() {
  6676. var vm = this._view;
  6677. return {
  6678. x: vm.x,
  6679. y: vm.y
  6680. };
  6681. }
  6682. });
  6683. var elements = {};
  6684. var Arc = element_arc;
  6685. var Line = element_line;
  6686. var Point = element_point;
  6687. var Rectangle = element_rectangle;
  6688. elements.Arc = Arc;
  6689. elements.Line = Line;
  6690. elements.Point = Point;
  6691. elements.Rectangle = Rectangle;
  6692. var deprecated = helpers$1._deprecated;
  6693. var valueOrDefault$3 = helpers$1.valueOrDefault;
  6694. core_defaults._set('bar', {
  6695. hover: {
  6696. mode: 'label'
  6697. },
  6698. scales: {
  6699. xAxes: [{
  6700. type: 'category',
  6701. offset: true,
  6702. gridLines: {
  6703. offsetGridLines: true
  6704. }
  6705. }],
  6706. yAxes: [{
  6707. type: 'linear'
  6708. }]
  6709. }
  6710. });
  6711. core_defaults._set('global', {
  6712. datasets: {
  6713. bar: {
  6714. categoryPercentage: 0.8,
  6715. barPercentage: 0.9
  6716. }
  6717. }
  6718. });
  6719. /**
  6720. * Computes the "optimal" sample size to maintain bars equally sized while preventing overlap.
  6721. * @private
  6722. */
  6723. function computeMinSampleSize(scale, pixels) {
  6724. var min = scale._length;
  6725. var prev, curr, i, ilen;
  6726. for (i = 1, ilen = pixels.length; i < ilen; ++i) {
  6727. min = Math.min(min, Math.abs(pixels[i] - pixels[i - 1]));
  6728. }
  6729. for (i = 0, ilen = scale.getTicks().length; i < ilen; ++i) {
  6730. curr = scale.getPixelForTick(i);
  6731. min = i > 0 ? Math.min(min, Math.abs(curr - prev)) : min;
  6732. prev = curr;
  6733. }
  6734. return min;
  6735. }
  6736. /**
  6737. * Computes an "ideal" category based on the absolute bar thickness or, if undefined or null,
  6738. * uses the smallest interval (see computeMinSampleSize) that prevents bar overlapping. This
  6739. * mode currently always generates bars equally sized (until we introduce scriptable options?).
  6740. * @private
  6741. */
  6742. function computeFitCategoryTraits(index, ruler, options) {
  6743. var thickness = options.barThickness;
  6744. var count = ruler.stackCount;
  6745. var curr = ruler.pixels[index];
  6746. var min = helpers$1.isNullOrUndef(thickness)
  6747. ? computeMinSampleSize(ruler.scale, ruler.pixels)
  6748. : -1;
  6749. var size, ratio;
  6750. if (helpers$1.isNullOrUndef(thickness)) {
  6751. size = min * options.categoryPercentage;
  6752. ratio = options.barPercentage;
  6753. } else {
  6754. // When bar thickness is enforced, category and bar percentages are ignored.
  6755. // Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')
  6756. // and deprecate barPercentage since this value is ignored when thickness is absolute.
  6757. size = thickness * count;
  6758. ratio = 1;
  6759. }
  6760. return {
  6761. chunk: size / count,
  6762. ratio: ratio,
  6763. start: curr - (size / 2)
  6764. };
  6765. }
  6766. /**
  6767. * Computes an "optimal" category that globally arranges bars side by side (no gap when
  6768. * percentage options are 1), based on the previous and following categories. This mode
  6769. * generates bars with different widths when data are not evenly spaced.
  6770. * @private
  6771. */
  6772. function computeFlexCategoryTraits(index, ruler, options) {
  6773. var pixels = ruler.pixels;
  6774. var curr = pixels[index];
  6775. var prev = index > 0 ? pixels[index - 1] : null;
  6776. var next = index < pixels.length - 1 ? pixels[index + 1] : null;
  6777. var percent = options.categoryPercentage;
  6778. var start, size;
  6779. if (prev === null) {
  6780. // first data: its size is double based on the next point or,
  6781. // if it's also the last data, we use the scale size.
  6782. prev = curr - (next === null ? ruler.end - ruler.start : next - curr);
  6783. }
  6784. if (next === null) {
  6785. // last data: its size is also double based on the previous point.
  6786. next = curr + curr - prev;
  6787. }
  6788. start = curr - (curr - Math.min(prev, next)) / 2 * percent;
  6789. size = Math.abs(next - prev) / 2 * percent;
  6790. return {
  6791. chunk: size / ruler.stackCount,
  6792. ratio: options.barPercentage,
  6793. start: start
  6794. };
  6795. }
  6796. var controller_bar = core_datasetController.extend({
  6797. dataElementType: elements.Rectangle,
  6798. /**
  6799. * @private
  6800. */
  6801. _dataElementOptions: [
  6802. 'backgroundColor',
  6803. 'borderColor',
  6804. 'borderSkipped',
  6805. 'borderWidth',
  6806. 'barPercentage',
  6807. 'barThickness',
  6808. 'categoryPercentage',
  6809. 'maxBarThickness',
  6810. 'minBarLength'
  6811. ],
  6812. initialize: function() {
  6813. var me = this;
  6814. var meta, scaleOpts;
  6815. core_datasetController.prototype.initialize.apply(me, arguments);
  6816. meta = me.getMeta();
  6817. meta.stack = me.getDataset().stack;
  6818. meta.bar = true;
  6819. scaleOpts = me._getIndexScale().options;
  6820. deprecated('bar chart', scaleOpts.barPercentage, 'scales.[x/y]Axes.barPercentage', 'dataset.barPercentage');
  6821. deprecated('bar chart', scaleOpts.barThickness, 'scales.[x/y]Axes.barThickness', 'dataset.barThickness');
  6822. deprecated('bar chart', scaleOpts.categoryPercentage, 'scales.[x/y]Axes.categoryPercentage', 'dataset.categoryPercentage');
  6823. deprecated('bar chart', me._getValueScale().options.minBarLength, 'scales.[x/y]Axes.minBarLength', 'dataset.minBarLength');
  6824. deprecated('bar chart', scaleOpts.maxBarThickness, 'scales.[x/y]Axes.maxBarThickness', 'dataset.maxBarThickness');
  6825. },
  6826. update: function(reset) {
  6827. var me = this;
  6828. var rects = me.getMeta().data;
  6829. var i, ilen;
  6830. me._ruler = me.getRuler();
  6831. for (i = 0, ilen = rects.length; i < ilen; ++i) {
  6832. me.updateElement(rects[i], i, reset);
  6833. }
  6834. },
  6835. updateElement: function(rectangle, index, reset) {
  6836. var me = this;
  6837. var meta = me.getMeta();
  6838. var dataset = me.getDataset();
  6839. var options = me._resolveDataElementOptions(rectangle, index);
  6840. rectangle._xScale = me.getScaleForId(meta.xAxisID);
  6841. rectangle._yScale = me.getScaleForId(meta.yAxisID);
  6842. rectangle._datasetIndex = me.index;
  6843. rectangle._index = index;
  6844. rectangle._model = {
  6845. backgroundColor: options.backgroundColor,
  6846. borderColor: options.borderColor,
  6847. borderSkipped: options.borderSkipped,
  6848. borderWidth: options.borderWidth,
  6849. datasetLabel: dataset.label,
  6850. label: me.chart.data.labels[index]
  6851. };
  6852. if (helpers$1.isArray(dataset.data[index])) {
  6853. rectangle._model.borderSkipped = null;
  6854. }
  6855. me._updateElementGeometry(rectangle, index, reset, options);
  6856. rectangle.pivot();
  6857. },
  6858. /**
  6859. * @private
  6860. */
  6861. _updateElementGeometry: function(rectangle, index, reset, options) {
  6862. var me = this;
  6863. var model = rectangle._model;
  6864. var vscale = me._getValueScale();
  6865. var base = vscale.getBasePixel();
  6866. var horizontal = vscale.isHorizontal();
  6867. var ruler = me._ruler || me.getRuler();
  6868. var vpixels = me.calculateBarValuePixels(me.index, index, options);
  6869. var ipixels = me.calculateBarIndexPixels(me.index, index, ruler, options);
  6870. model.horizontal = horizontal;
  6871. model.base = reset ? base : vpixels.base;
  6872. model.x = horizontal ? reset ? base : vpixels.head : ipixels.center;
  6873. model.y = horizontal ? ipixels.center : reset ? base : vpixels.head;
  6874. model.height = horizontal ? ipixels.size : undefined;
  6875. model.width = horizontal ? undefined : ipixels.size;
  6876. },
  6877. /**
  6878. * Returns the stacks based on groups and bar visibility.
  6879. * @param {number} [last] - The dataset index
  6880. * @returns {string[]} The list of stack IDs
  6881. * @private
  6882. */
  6883. _getStacks: function(last) {
  6884. var me = this;
  6885. var scale = me._getIndexScale();
  6886. var metasets = scale._getMatchingVisibleMetas(me._type);
  6887. var stacked = scale.options.stacked;
  6888. var ilen = metasets.length;
  6889. var stacks = [];
  6890. var i, meta;
  6891. for (i = 0; i < ilen; ++i) {
  6892. meta = metasets[i];
  6893. // stacked | meta.stack
  6894. // | found | not found | undefined
  6895. // false | x | x | x
  6896. // true | | x |
  6897. // undefined | | x | x
  6898. if (stacked === false || stacks.indexOf(meta.stack) === -1 ||
  6899. (stacked === undefined && meta.stack === undefined)) {
  6900. stacks.push(meta.stack);
  6901. }
  6902. if (meta.index === last) {
  6903. break;
  6904. }
  6905. }
  6906. return stacks;
  6907. },
  6908. /**
  6909. * Returns the effective number of stacks based on groups and bar visibility.
  6910. * @private
  6911. */
  6912. getStackCount: function() {
  6913. return this._getStacks().length;
  6914. },
  6915. /**
  6916. * Returns the stack index for the given dataset based on groups and bar visibility.
  6917. * @param {number} [datasetIndex] - The dataset index
  6918. * @param {string} [name] - The stack name to find
  6919. * @returns {number} The stack index
  6920. * @private
  6921. */
  6922. getStackIndex: function(datasetIndex, name) {
  6923. var stacks = this._getStacks(datasetIndex);
  6924. var index = (name !== undefined)
  6925. ? stacks.indexOf(name)
  6926. : -1; // indexOf returns -1 if element is not present
  6927. return (index === -1)
  6928. ? stacks.length - 1
  6929. : index;
  6930. },
  6931. /**
  6932. * @private
  6933. */
  6934. getRuler: function() {
  6935. var me = this;
  6936. var scale = me._getIndexScale();
  6937. var pixels = [];
  6938. var i, ilen;
  6939. for (i = 0, ilen = me.getMeta().data.length; i < ilen; ++i) {
  6940. pixels.push(scale.getPixelForValue(null, i, me.index));
  6941. }
  6942. return {
  6943. pixels: pixels,
  6944. start: scale._startPixel,
  6945. end: scale._endPixel,
  6946. stackCount: me.getStackCount(),
  6947. scale: scale
  6948. };
  6949. },
  6950. /**
  6951. * Note: pixel values are not clamped to the scale area.
  6952. * @private
  6953. */
  6954. calculateBarValuePixels: function(datasetIndex, index, options) {
  6955. var me = this;
  6956. var chart = me.chart;
  6957. var scale = me._getValueScale();
  6958. var isHorizontal = scale.isHorizontal();
  6959. var datasets = chart.data.datasets;
  6960. var metasets = scale._getMatchingVisibleMetas(me._type);
  6961. var value = scale._parseValue(datasets[datasetIndex].data[index]);
  6962. var minBarLength = options.minBarLength;
  6963. var stacked = scale.options.stacked;
  6964. var stack = me.getMeta().stack;
  6965. var start = value.start === undefined ? 0 : value.max >= 0 && value.min >= 0 ? value.min : value.max;
  6966. var length = value.start === undefined ? value.end : value.max >= 0 && value.min >= 0 ? value.max - value.min : value.min - value.max;
  6967. var ilen = metasets.length;
  6968. var i, imeta, ivalue, base, head, size, stackLength;
  6969. if (stacked || (stacked === undefined && stack !== undefined)) {
  6970. for (i = 0; i < ilen; ++i) {
  6971. imeta = metasets[i];
  6972. if (imeta.index === datasetIndex) {
  6973. break;
  6974. }
  6975. if (imeta.stack === stack) {
  6976. stackLength = scale._parseValue(datasets[imeta.index].data[index]);
  6977. ivalue = stackLength.start === undefined ? stackLength.end : stackLength.min >= 0 && stackLength.max >= 0 ? stackLength.max : stackLength.min;
  6978. if ((value.min < 0 && ivalue < 0) || (value.max >= 0 && ivalue > 0)) {
  6979. start += ivalue;
  6980. }
  6981. }
  6982. }
  6983. }
  6984. base = scale.getPixelForValue(start);
  6985. head = scale.getPixelForValue(start + length);
  6986. size = head - base;
  6987. if (minBarLength !== undefined && Math.abs(size) < minBarLength) {
  6988. size = minBarLength;
  6989. if (length >= 0 && !isHorizontal || length < 0 && isHorizontal) {
  6990. head = base - minBarLength;
  6991. } else {
  6992. head = base + minBarLength;
  6993. }
  6994. }
  6995. return {
  6996. size: size,
  6997. base: base,
  6998. head: head,
  6999. center: head + size / 2
  7000. };
  7001. },
  7002. /**
  7003. * @private
  7004. */
  7005. calculateBarIndexPixels: function(datasetIndex, index, ruler, options) {
  7006. var me = this;
  7007. var range = options.barThickness === 'flex'
  7008. ? computeFlexCategoryTraits(index, ruler, options)
  7009. : computeFitCategoryTraits(index, ruler, options);
  7010. var stackIndex = me.getStackIndex(datasetIndex, me.getMeta().stack);
  7011. var center = range.start + (range.chunk * stackIndex) + (range.chunk / 2);
  7012. var size = Math.min(
  7013. valueOrDefault$3(options.maxBarThickness, Infinity),
  7014. range.chunk * range.ratio);
  7015. return {
  7016. base: center - size / 2,
  7017. head: center + size / 2,
  7018. center: center,
  7019. size: size
  7020. };
  7021. },
  7022. draw: function() {
  7023. var me = this;
  7024. var chart = me.chart;
  7025. var scale = me._getValueScale();
  7026. var rects = me.getMeta().data;
  7027. var dataset = me.getDataset();
  7028. var ilen = rects.length;
  7029. var i = 0;
  7030. helpers$1.canvas.clipArea(chart.ctx, chart.chartArea);
  7031. for (; i < ilen; ++i) {
  7032. var val = scale._parseValue(dataset.data[i]);
  7033. if (!isNaN(val.min) && !isNaN(val.max)) {
  7034. rects[i].draw();
  7035. }
  7036. }
  7037. helpers$1.canvas.unclipArea(chart.ctx);
  7038. },
  7039. /**
  7040. * @private
  7041. */
  7042. _resolveDataElementOptions: function() {
  7043. var me = this;
  7044. var values = helpers$1.extend({}, core_datasetController.prototype._resolveDataElementOptions.apply(me, arguments));
  7045. var indexOpts = me._getIndexScale().options;
  7046. var valueOpts = me._getValueScale().options;
  7047. values.barPercentage = valueOrDefault$3(indexOpts.barPercentage, values.barPercentage);
  7048. values.barThickness = valueOrDefault$3(indexOpts.barThickness, values.barThickness);
  7049. values.categoryPercentage = valueOrDefault$3(indexOpts.categoryPercentage, values.categoryPercentage);
  7050. values.maxBarThickness = valueOrDefault$3(indexOpts.maxBarThickness, values.maxBarThickness);
  7051. values.minBarLength = valueOrDefault$3(valueOpts.minBarLength, values.minBarLength);
  7052. return values;
  7053. }
  7054. });
  7055. var valueOrDefault$4 = helpers$1.valueOrDefault;
  7056. var resolve$1 = helpers$1.options.resolve;
  7057. core_defaults._set('bubble', {
  7058. hover: {
  7059. mode: 'single'
  7060. },
  7061. scales: {
  7062. xAxes: [{
  7063. type: 'linear', // bubble should probably use a linear scale by default
  7064. position: 'bottom',
  7065. id: 'x-axis-0' // need an ID so datasets can reference the scale
  7066. }],
  7067. yAxes: [{
  7068. type: 'linear',
  7069. position: 'left',
  7070. id: 'y-axis-0'
  7071. }]
  7072. },
  7073. tooltips: {
  7074. callbacks: {
  7075. title: function() {
  7076. // Title doesn't make sense for scatter since we format the data as a point
  7077. return '';
  7078. },
  7079. label: function(item, data) {
  7080. var datasetLabel = data.datasets[item.datasetIndex].label || '';
  7081. var dataPoint = data.datasets[item.datasetIndex].data[item.index];
  7082. return datasetLabel + ': (' + item.xLabel + ', ' + item.yLabel + ', ' + dataPoint.r + ')';
  7083. }
  7084. }
  7085. }
  7086. });
  7087. var controller_bubble = core_datasetController.extend({
  7088. /**
  7089. * @protected
  7090. */
  7091. dataElementType: elements.Point,
  7092. /**
  7093. * @private
  7094. */
  7095. _dataElementOptions: [
  7096. 'backgroundColor',
  7097. 'borderColor',
  7098. 'borderWidth',
  7099. 'hoverBackgroundColor',
  7100. 'hoverBorderColor',
  7101. 'hoverBorderWidth',
  7102. 'hoverRadius',
  7103. 'hitRadius',
  7104. 'pointStyle',
  7105. 'rotation'
  7106. ],
  7107. /**
  7108. * @protected
  7109. */
  7110. update: function(reset) {
  7111. var me = this;
  7112. var meta = me.getMeta();
  7113. var points = meta.data;
  7114. // Update Points
  7115. helpers$1.each(points, function(point, index) {
  7116. me.updateElement(point, index, reset);
  7117. });
  7118. },
  7119. /**
  7120. * @protected
  7121. */
  7122. updateElement: function(point, index, reset) {
  7123. var me = this;
  7124. var meta = me.getMeta();
  7125. var custom = point.custom || {};
  7126. var xScale = me.getScaleForId(meta.xAxisID);
  7127. var yScale = me.getScaleForId(meta.yAxisID);
  7128. var options = me._resolveDataElementOptions(point, index);
  7129. var data = me.getDataset().data[index];
  7130. var dsIndex = me.index;
  7131. var x = reset ? xScale.getPixelForDecimal(0.5) : xScale.getPixelForValue(typeof data === 'object' ? data : NaN, index, dsIndex);
  7132. var y = reset ? yScale.getBasePixel() : yScale.getPixelForValue(data, index, dsIndex);
  7133. point._xScale = xScale;
  7134. point._yScale = yScale;
  7135. point._options = options;
  7136. point._datasetIndex = dsIndex;
  7137. point._index = index;
  7138. point._model = {
  7139. backgroundColor: options.backgroundColor,
  7140. borderColor: options.borderColor,
  7141. borderWidth: options.borderWidth,
  7142. hitRadius: options.hitRadius,
  7143. pointStyle: options.pointStyle,
  7144. rotation: options.rotation,
  7145. radius: reset ? 0 : options.radius,
  7146. skip: custom.skip || isNaN(x) || isNaN(y),
  7147. x: x,
  7148. y: y,
  7149. };
  7150. point.pivot();
  7151. },
  7152. /**
  7153. * @protected
  7154. */
  7155. setHoverStyle: function(point) {
  7156. var model = point._model;
  7157. var options = point._options;
  7158. var getHoverColor = helpers$1.getHoverColor;
  7159. point.$previousStyle = {
  7160. backgroundColor: model.backgroundColor,
  7161. borderColor: model.borderColor,
  7162. borderWidth: model.borderWidth,
  7163. radius: model.radius
  7164. };
  7165. model.backgroundColor = valueOrDefault$4(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));
  7166. model.borderColor = valueOrDefault$4(options.hoverBorderColor, getHoverColor(options.borderColor));
  7167. model.borderWidth = valueOrDefault$4(options.hoverBorderWidth, options.borderWidth);
  7168. model.radius = options.radius + options.hoverRadius;
  7169. },
  7170. /**
  7171. * @private
  7172. */
  7173. _resolveDataElementOptions: function(point, index) {
  7174. var me = this;
  7175. var chart = me.chart;
  7176. var dataset = me.getDataset();
  7177. var custom = point.custom || {};
  7178. var data = dataset.data[index] || {};
  7179. var values = core_datasetController.prototype._resolveDataElementOptions.apply(me, arguments);
  7180. // Scriptable options
  7181. var context = {
  7182. chart: chart,
  7183. dataIndex: index,
  7184. dataset: dataset,
  7185. datasetIndex: me.index
  7186. };
  7187. // In case values were cached (and thus frozen), we need to clone the values
  7188. if (me._cachedDataOpts === values) {
  7189. values = helpers$1.extend({}, values);
  7190. }
  7191. // Custom radius resolution
  7192. values.radius = resolve$1([
  7193. custom.radius,
  7194. data.r,
  7195. me._config.radius,
  7196. chart.options.elements.point.radius
  7197. ], context, index);
  7198. return values;
  7199. }
  7200. });
  7201. var valueOrDefault$5 = helpers$1.valueOrDefault;
  7202. var PI$1 = Math.PI;
  7203. var DOUBLE_PI$1 = PI$1 * 2;
  7204. var HALF_PI$1 = PI$1 / 2;
  7205. core_defaults._set('doughnut', {
  7206. animation: {
  7207. // Boolean - Whether we animate the rotation of the Doughnut
  7208. animateRotate: true,
  7209. // Boolean - Whether we animate scaling the Doughnut from the centre
  7210. animateScale: false
  7211. },
  7212. hover: {
  7213. mode: 'single'
  7214. },
  7215. legendCallback: function(chart) {
  7216. var list = document.createElement('ul');
  7217. var data = chart.data;
  7218. var datasets = data.datasets;
  7219. var labels = data.labels;
  7220. var i, ilen, listItem, listItemSpan;
  7221. list.setAttribute('class', chart.id + '-legend');
  7222. if (datasets.length) {
  7223. for (i = 0, ilen = datasets[0].data.length; i < ilen; ++i) {
  7224. listItem = list.appendChild(document.createElement('li'));
  7225. listItemSpan = listItem.appendChild(document.createElement('span'));
  7226. listItemSpan.style.backgroundColor = datasets[0].backgroundColor[i];
  7227. if (labels[i]) {
  7228. listItem.appendChild(document.createTextNode(labels[i]));
  7229. }
  7230. }
  7231. }
  7232. return list.outerHTML;
  7233. },
  7234. legend: {
  7235. labels: {
  7236. generateLabels: function(chart) {
  7237. var data = chart.data;
  7238. if (data.labels.length && data.datasets.length) {
  7239. return data.labels.map(function(label, i) {
  7240. var meta = chart.getDatasetMeta(0);
  7241. var style = meta.controller.getStyle(i);
  7242. return {
  7243. text: label,
  7244. fillStyle: style.backgroundColor,
  7245. strokeStyle: style.borderColor,
  7246. lineWidth: style.borderWidth,
  7247. hidden: isNaN(data.datasets[0].data[i]) || meta.data[i].hidden,
  7248. // Extra data used for toggling the correct item
  7249. index: i
  7250. };
  7251. });
  7252. }
  7253. return [];
  7254. }
  7255. },
  7256. onClick: function(e, legendItem) {
  7257. var index = legendItem.index;
  7258. var chart = this.chart;
  7259. var i, ilen, meta;
  7260. for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {
  7261. meta = chart.getDatasetMeta(i);
  7262. // toggle visibility of index if exists
  7263. if (meta.data[index]) {
  7264. meta.data[index].hidden = !meta.data[index].hidden;
  7265. }
  7266. }
  7267. chart.update();
  7268. }
  7269. },
  7270. // The percentage of the chart that we cut out of the middle.
  7271. cutoutPercentage: 50,
  7272. // The rotation of the chart, where the first data arc begins.
  7273. rotation: -HALF_PI$1,
  7274. // The total circumference of the chart.
  7275. circumference: DOUBLE_PI$1,
  7276. // Need to override these to give a nice default
  7277. tooltips: {
  7278. callbacks: {
  7279. title: function() {
  7280. return '';
  7281. },
  7282. label: function(tooltipItem, data) {
  7283. var dataLabel = data.labels[tooltipItem.index];
  7284. var value = ': ' + data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index];
  7285. if (helpers$1.isArray(dataLabel)) {
  7286. // show value on first line of multiline label
  7287. // need to clone because we are changing the value
  7288. dataLabel = dataLabel.slice();
  7289. dataLabel[0] += value;
  7290. } else {
  7291. dataLabel += value;
  7292. }
  7293. return dataLabel;
  7294. }
  7295. }
  7296. }
  7297. });
  7298. var controller_doughnut = core_datasetController.extend({
  7299. dataElementType: elements.Arc,
  7300. linkScales: helpers$1.noop,
  7301. /**
  7302. * @private
  7303. */
  7304. _dataElementOptions: [
  7305. 'backgroundColor',
  7306. 'borderColor',
  7307. 'borderWidth',
  7308. 'borderAlign',
  7309. 'hoverBackgroundColor',
  7310. 'hoverBorderColor',
  7311. 'hoverBorderWidth',
  7312. ],
  7313. // Get index of the dataset in relation to the visible datasets. This allows determining the inner and outer radius correctly
  7314. getRingIndex: function(datasetIndex) {
  7315. var ringIndex = 0;
  7316. for (var j = 0; j < datasetIndex; ++j) {
  7317. if (this.chart.isDatasetVisible(j)) {
  7318. ++ringIndex;
  7319. }
  7320. }
  7321. return ringIndex;
  7322. },
  7323. update: function(reset) {
  7324. var me = this;
  7325. var chart = me.chart;
  7326. var chartArea = chart.chartArea;
  7327. var opts = chart.options;
  7328. var ratioX = 1;
  7329. var ratioY = 1;
  7330. var offsetX = 0;
  7331. var offsetY = 0;
  7332. var meta = me.getMeta();
  7333. var arcs = meta.data;
  7334. var cutout = opts.cutoutPercentage / 100 || 0;
  7335. var circumference = opts.circumference;
  7336. var chartWeight = me._getRingWeight(me.index);
  7337. var maxWidth, maxHeight, i, ilen;
  7338. // If the chart's circumference isn't a full circle, calculate size as a ratio of the width/height of the arc
  7339. if (circumference < DOUBLE_PI$1) {
  7340. var startAngle = opts.rotation % DOUBLE_PI$1;
  7341. startAngle += startAngle >= PI$1 ? -DOUBLE_PI$1 : startAngle < -PI$1 ? DOUBLE_PI$1 : 0;
  7342. var endAngle = startAngle + circumference;
  7343. var startX = Math.cos(startAngle);
  7344. var startY = Math.sin(startAngle);
  7345. var endX = Math.cos(endAngle);
  7346. var endY = Math.sin(endAngle);
  7347. var contains0 = (startAngle <= 0 && endAngle >= 0) || endAngle >= DOUBLE_PI$1;
  7348. var contains90 = (startAngle <= HALF_PI$1 && endAngle >= HALF_PI$1) || endAngle >= DOUBLE_PI$1 + HALF_PI$1;
  7349. var contains180 = startAngle === -PI$1 || endAngle >= PI$1;
  7350. var contains270 = (startAngle <= -HALF_PI$1 && endAngle >= -HALF_PI$1) || endAngle >= PI$1 + HALF_PI$1;
  7351. var minX = contains180 ? -1 : Math.min(startX, startX * cutout, endX, endX * cutout);
  7352. var minY = contains270 ? -1 : Math.min(startY, startY * cutout, endY, endY * cutout);
  7353. var maxX = contains0 ? 1 : Math.max(startX, startX * cutout, endX, endX * cutout);
  7354. var maxY = contains90 ? 1 : Math.max(startY, startY * cutout, endY, endY * cutout);
  7355. ratioX = (maxX - minX) / 2;
  7356. ratioY = (maxY - minY) / 2;
  7357. offsetX = -(maxX + minX) / 2;
  7358. offsetY = -(maxY + minY) / 2;
  7359. }
  7360. for (i = 0, ilen = arcs.length; i < ilen; ++i) {
  7361. arcs[i]._options = me._resolveDataElementOptions(arcs[i], i);
  7362. }
  7363. chart.borderWidth = me.getMaxBorderWidth();
  7364. maxWidth = (chartArea.right - chartArea.left - chart.borderWidth) / ratioX;
  7365. maxHeight = (chartArea.bottom - chartArea.top - chart.borderWidth) / ratioY;
  7366. chart.outerRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);
  7367. chart.innerRadius = Math.max(chart.outerRadius * cutout, 0);
  7368. chart.radiusLength = (chart.outerRadius - chart.innerRadius) / (me._getVisibleDatasetWeightTotal() || 1);
  7369. chart.offsetX = offsetX * chart.outerRadius;
  7370. chart.offsetY = offsetY * chart.outerRadius;
  7371. meta.total = me.calculateTotal();
  7372. me.outerRadius = chart.outerRadius - chart.radiusLength * me._getRingWeightOffset(me.index);
  7373. me.innerRadius = Math.max(me.outerRadius - chart.radiusLength * chartWeight, 0);
  7374. for (i = 0, ilen = arcs.length; i < ilen; ++i) {
  7375. me.updateElement(arcs[i], i, reset);
  7376. }
  7377. },
  7378. updateElement: function(arc, index, reset) {
  7379. var me = this;
  7380. var chart = me.chart;
  7381. var chartArea = chart.chartArea;
  7382. var opts = chart.options;
  7383. var animationOpts = opts.animation;
  7384. var centerX = (chartArea.left + chartArea.right) / 2;
  7385. var centerY = (chartArea.top + chartArea.bottom) / 2;
  7386. var startAngle = opts.rotation; // non reset case handled later
  7387. var endAngle = opts.rotation; // non reset case handled later
  7388. var dataset = me.getDataset();
  7389. var circumference = reset && animationOpts.animateRotate ? 0 : arc.hidden ? 0 : me.calculateCircumference(dataset.data[index]) * (opts.circumference / DOUBLE_PI$1);
  7390. var innerRadius = reset && animationOpts.animateScale ? 0 : me.innerRadius;
  7391. var outerRadius = reset && animationOpts.animateScale ? 0 : me.outerRadius;
  7392. var options = arc._options || {};
  7393. helpers$1.extend(arc, {
  7394. // Utility
  7395. _datasetIndex: me.index,
  7396. _index: index,
  7397. // Desired view properties
  7398. _model: {
  7399. backgroundColor: options.backgroundColor,
  7400. borderColor: options.borderColor,
  7401. borderWidth: options.borderWidth,
  7402. borderAlign: options.borderAlign,
  7403. x: centerX + chart.offsetX,
  7404. y: centerY + chart.offsetY,
  7405. startAngle: startAngle,
  7406. endAngle: endAngle,
  7407. circumference: circumference,
  7408. outerRadius: outerRadius,
  7409. innerRadius: innerRadius,
  7410. label: helpers$1.valueAtIndexOrDefault(dataset.label, index, chart.data.labels[index])
  7411. }
  7412. });
  7413. var model = arc._model;
  7414. // Set correct angles if not resetting
  7415. if (!reset || !animationOpts.animateRotate) {
  7416. if (index === 0) {
  7417. model.startAngle = opts.rotation;
  7418. } else {
  7419. model.startAngle = me.getMeta().data[index - 1]._model.endAngle;
  7420. }
  7421. model.endAngle = model.startAngle + model.circumference;
  7422. }
  7423. arc.pivot();
  7424. },
  7425. calculateTotal: function() {
  7426. var dataset = this.getDataset();
  7427. var meta = this.getMeta();
  7428. var total = 0;
  7429. var value;
  7430. helpers$1.each(meta.data, function(element, index) {
  7431. value = dataset.data[index];
  7432. if (!isNaN(value) && !element.hidden) {
  7433. total += Math.abs(value);
  7434. }
  7435. });
  7436. /* if (total === 0) {
  7437. total = NaN;
  7438. }*/
  7439. return total;
  7440. },
  7441. calculateCircumference: function(value) {
  7442. var total = this.getMeta().total;
  7443. if (total > 0 && !isNaN(value)) {
  7444. return DOUBLE_PI$1 * (Math.abs(value) / total);
  7445. }
  7446. return 0;
  7447. },
  7448. // gets the max border or hover width to properly scale pie charts
  7449. getMaxBorderWidth: function(arcs) {
  7450. var me = this;
  7451. var max = 0;
  7452. var chart = me.chart;
  7453. var i, ilen, meta, arc, controller, options, borderWidth, hoverWidth;
  7454. if (!arcs) {
  7455. // Find the outmost visible dataset
  7456. for (i = 0, ilen = chart.data.datasets.length; i < ilen; ++i) {
  7457. if (chart.isDatasetVisible(i)) {
  7458. meta = chart.getDatasetMeta(i);
  7459. arcs = meta.data;
  7460. if (i !== me.index) {
  7461. controller = meta.controller;
  7462. }
  7463. break;
  7464. }
  7465. }
  7466. }
  7467. if (!arcs) {
  7468. return 0;
  7469. }
  7470. for (i = 0, ilen = arcs.length; i < ilen; ++i) {
  7471. arc = arcs[i];
  7472. if (controller) {
  7473. controller._configure();
  7474. options = controller._resolveDataElementOptions(arc, i);
  7475. } else {
  7476. options = arc._options;
  7477. }
  7478. if (options.borderAlign !== 'inner') {
  7479. borderWidth = options.borderWidth;
  7480. hoverWidth = options.hoverBorderWidth;
  7481. max = borderWidth > max ? borderWidth : max;
  7482. max = hoverWidth > max ? hoverWidth : max;
  7483. }
  7484. }
  7485. return max;
  7486. },
  7487. /**
  7488. * @protected
  7489. */
  7490. setHoverStyle: function(arc) {
  7491. var model = arc._model;
  7492. var options = arc._options;
  7493. var getHoverColor = helpers$1.getHoverColor;
  7494. arc.$previousStyle = {
  7495. backgroundColor: model.backgroundColor,
  7496. borderColor: model.borderColor,
  7497. borderWidth: model.borderWidth,
  7498. };
  7499. model.backgroundColor = valueOrDefault$5(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));
  7500. model.borderColor = valueOrDefault$5(options.hoverBorderColor, getHoverColor(options.borderColor));
  7501. model.borderWidth = valueOrDefault$5(options.hoverBorderWidth, options.borderWidth);
  7502. },
  7503. /**
  7504. * Get radius length offset of the dataset in relation to the visible datasets weights. This allows determining the inner and outer radius correctly
  7505. * @private
  7506. */
  7507. _getRingWeightOffset: function(datasetIndex) {
  7508. var ringWeightOffset = 0;
  7509. for (var i = 0; i < datasetIndex; ++i) {
  7510. if (this.chart.isDatasetVisible(i)) {
  7511. ringWeightOffset += this._getRingWeight(i);
  7512. }
  7513. }
  7514. return ringWeightOffset;
  7515. },
  7516. /**
  7517. * @private
  7518. */
  7519. _getRingWeight: function(dataSetIndex) {
  7520. return Math.max(valueOrDefault$5(this.chart.data.datasets[dataSetIndex].weight, 1), 0);
  7521. },
  7522. /**
  7523. * Returns the sum of all visibile data set weights. This value can be 0.
  7524. * @private
  7525. */
  7526. _getVisibleDatasetWeightTotal: function() {
  7527. return this._getRingWeightOffset(this.chart.data.datasets.length);
  7528. }
  7529. });
  7530. core_defaults._set('horizontalBar', {
  7531. hover: {
  7532. mode: 'index',
  7533. axis: 'y'
  7534. },
  7535. scales: {
  7536. xAxes: [{
  7537. type: 'linear',
  7538. position: 'bottom'
  7539. }],
  7540. yAxes: [{
  7541. type: 'category',
  7542. position: 'left',
  7543. offset: true,
  7544. gridLines: {
  7545. offsetGridLines: true
  7546. }
  7547. }]
  7548. },
  7549. elements: {
  7550. rectangle: {
  7551. borderSkipped: 'left'
  7552. }
  7553. },
  7554. tooltips: {
  7555. mode: 'index',
  7556. axis: 'y'
  7557. }
  7558. });
  7559. core_defaults._set('global', {
  7560. datasets: {
  7561. horizontalBar: {
  7562. categoryPercentage: 0.8,
  7563. barPercentage: 0.9
  7564. }
  7565. }
  7566. });
  7567. var controller_horizontalBar = controller_bar.extend({
  7568. /**
  7569. * @private
  7570. */
  7571. _getValueScaleId: function() {
  7572. return this.getMeta().xAxisID;
  7573. },
  7574. /**
  7575. * @private
  7576. */
  7577. _getIndexScaleId: function() {
  7578. return this.getMeta().yAxisID;
  7579. }
  7580. });
  7581. var valueOrDefault$6 = helpers$1.valueOrDefault;
  7582. var resolve$2 = helpers$1.options.resolve;
  7583. var isPointInArea = helpers$1.canvas._isPointInArea;
  7584. core_defaults._set('line', {
  7585. showLines: true,
  7586. spanGaps: false,
  7587. hover: {
  7588. mode: 'label'
  7589. },
  7590. scales: {
  7591. xAxes: [{
  7592. type: 'category',
  7593. id: 'x-axis-0'
  7594. }],
  7595. yAxes: [{
  7596. type: 'linear',
  7597. id: 'y-axis-0'
  7598. }]
  7599. }
  7600. });
  7601. function scaleClip(scale, halfBorderWidth) {
  7602. var tickOpts = scale && scale.options.ticks || {};
  7603. var reverse = tickOpts.reverse;
  7604. var min = tickOpts.min === undefined ? halfBorderWidth : 0;
  7605. var max = tickOpts.max === undefined ? halfBorderWidth : 0;
  7606. return {
  7607. start: reverse ? max : min,
  7608. end: reverse ? min : max
  7609. };
  7610. }
  7611. function defaultClip(xScale, yScale, borderWidth) {
  7612. var halfBorderWidth = borderWidth / 2;
  7613. var x = scaleClip(xScale, halfBorderWidth);
  7614. var y = scaleClip(yScale, halfBorderWidth);
  7615. return {
  7616. top: y.end,
  7617. right: x.end,
  7618. bottom: y.start,
  7619. left: x.start
  7620. };
  7621. }
  7622. function toClip(value) {
  7623. var t, r, b, l;
  7624. if (helpers$1.isObject(value)) {
  7625. t = value.top;
  7626. r = value.right;
  7627. b = value.bottom;
  7628. l = value.left;
  7629. } else {
  7630. t = r = b = l = value;
  7631. }
  7632. return {
  7633. top: t,
  7634. right: r,
  7635. bottom: b,
  7636. left: l
  7637. };
  7638. }
  7639. var controller_line = core_datasetController.extend({
  7640. datasetElementType: elements.Line,
  7641. dataElementType: elements.Point,
  7642. /**
  7643. * @private
  7644. */
  7645. _datasetElementOptions: [
  7646. 'backgroundColor',
  7647. 'borderCapStyle',
  7648. 'borderColor',
  7649. 'borderDash',
  7650. 'borderDashOffset',
  7651. 'borderJoinStyle',
  7652. 'borderWidth',
  7653. 'cubicInterpolationMode',
  7654. 'fill'
  7655. ],
  7656. /**
  7657. * @private
  7658. */
  7659. _dataElementOptions: {
  7660. backgroundColor: 'pointBackgroundColor',
  7661. borderColor: 'pointBorderColor',
  7662. borderWidth: 'pointBorderWidth',
  7663. hitRadius: 'pointHitRadius',
  7664. hoverBackgroundColor: 'pointHoverBackgroundColor',
  7665. hoverBorderColor: 'pointHoverBorderColor',
  7666. hoverBorderWidth: 'pointHoverBorderWidth',
  7667. hoverRadius: 'pointHoverRadius',
  7668. pointStyle: 'pointStyle',
  7669. radius: 'pointRadius',
  7670. rotation: 'pointRotation'
  7671. },
  7672. update: function(reset) {
  7673. var me = this;
  7674. var meta = me.getMeta();
  7675. var line = meta.dataset;
  7676. var points = meta.data || [];
  7677. var options = me.chart.options;
  7678. var config = me._config;
  7679. var showLine = me._showLine = valueOrDefault$6(config.showLine, options.showLines);
  7680. var i, ilen;
  7681. me._xScale = me.getScaleForId(meta.xAxisID);
  7682. me._yScale = me.getScaleForId(meta.yAxisID);
  7683. // Update Line
  7684. if (showLine) {
  7685. // Compatibility: If the properties are defined with only the old name, use those values
  7686. if (config.tension !== undefined && config.lineTension === undefined) {
  7687. config.lineTension = config.tension;
  7688. }
  7689. // Utility
  7690. line._scale = me._yScale;
  7691. line._datasetIndex = me.index;
  7692. // Data
  7693. line._children = points;
  7694. // Model
  7695. line._model = me._resolveDatasetElementOptions(line);
  7696. line.pivot();
  7697. }
  7698. // Update Points
  7699. for (i = 0, ilen = points.length; i < ilen; ++i) {
  7700. me.updateElement(points[i], i, reset);
  7701. }
  7702. if (showLine && line._model.tension !== 0) {
  7703. me.updateBezierControlPoints();
  7704. }
  7705. // Now pivot the point for animation
  7706. for (i = 0, ilen = points.length; i < ilen; ++i) {
  7707. points[i].pivot();
  7708. }
  7709. },
  7710. updateElement: function(point, index, reset) {
  7711. var me = this;
  7712. var meta = me.getMeta();
  7713. var custom = point.custom || {};
  7714. var dataset = me.getDataset();
  7715. var datasetIndex = me.index;
  7716. var value = dataset.data[index];
  7717. var xScale = me._xScale;
  7718. var yScale = me._yScale;
  7719. var lineModel = meta.dataset._model;
  7720. var x, y;
  7721. var options = me._resolveDataElementOptions(point, index);
  7722. x = xScale.getPixelForValue(typeof value === 'object' ? value : NaN, index, datasetIndex);
  7723. y = reset ? yScale.getBasePixel() : me.calculatePointY(value, index, datasetIndex);
  7724. // Utility
  7725. point._xScale = xScale;
  7726. point._yScale = yScale;
  7727. point._options = options;
  7728. point._datasetIndex = datasetIndex;
  7729. point._index = index;
  7730. // Desired view properties
  7731. point._model = {
  7732. x: x,
  7733. y: y,
  7734. skip: custom.skip || isNaN(x) || isNaN(y),
  7735. // Appearance
  7736. radius: options.radius,
  7737. pointStyle: options.pointStyle,
  7738. rotation: options.rotation,
  7739. backgroundColor: options.backgroundColor,
  7740. borderColor: options.borderColor,
  7741. borderWidth: options.borderWidth,
  7742. tension: valueOrDefault$6(custom.tension, lineModel ? lineModel.tension : 0),
  7743. steppedLine: lineModel ? lineModel.steppedLine : false,
  7744. // Tooltip
  7745. hitRadius: options.hitRadius
  7746. };
  7747. },
  7748. /**
  7749. * @private
  7750. */
  7751. _resolveDatasetElementOptions: function(element) {
  7752. var me = this;
  7753. var config = me._config;
  7754. var custom = element.custom || {};
  7755. var options = me.chart.options;
  7756. var lineOptions = options.elements.line;
  7757. var values = core_datasetController.prototype._resolveDatasetElementOptions.apply(me, arguments);
  7758. // The default behavior of lines is to break at null values, according
  7759. // to https://github.com/chartjs/Chart.js/issues/2435#issuecomment-216718158
  7760. // This option gives lines the ability to span gaps
  7761. values.spanGaps = valueOrDefault$6(config.spanGaps, options.spanGaps);
  7762. values.tension = valueOrDefault$6(config.lineTension, lineOptions.tension);
  7763. values.steppedLine = resolve$2([custom.steppedLine, config.steppedLine, lineOptions.stepped]);
  7764. values.clip = toClip(valueOrDefault$6(config.clip, defaultClip(me._xScale, me._yScale, values.borderWidth)));
  7765. return values;
  7766. },
  7767. calculatePointY: function(value, index, datasetIndex) {
  7768. var me = this;
  7769. var chart = me.chart;
  7770. var yScale = me._yScale;
  7771. var sumPos = 0;
  7772. var sumNeg = 0;
  7773. var i, ds, dsMeta, stackedRightValue, rightValue, metasets, ilen;
  7774. if (yScale.options.stacked) {
  7775. rightValue = +yScale.getRightValue(value);
  7776. metasets = chart._getSortedVisibleDatasetMetas();
  7777. ilen = metasets.length;
  7778. for (i = 0; i < ilen; ++i) {
  7779. dsMeta = metasets[i];
  7780. if (dsMeta.index === datasetIndex) {
  7781. break;
  7782. }
  7783. ds = chart.data.datasets[dsMeta.index];
  7784. if (dsMeta.type === 'line' && dsMeta.yAxisID === yScale.id) {
  7785. stackedRightValue = +yScale.getRightValue(ds.data[index]);
  7786. if (stackedRightValue < 0) {
  7787. sumNeg += stackedRightValue || 0;
  7788. } else {
  7789. sumPos += stackedRightValue || 0;
  7790. }
  7791. }
  7792. }
  7793. if (rightValue < 0) {
  7794. return yScale.getPixelForValue(sumNeg + rightValue);
  7795. }
  7796. return yScale.getPixelForValue(sumPos + rightValue);
  7797. }
  7798. return yScale.getPixelForValue(value);
  7799. },
  7800. updateBezierControlPoints: function() {
  7801. var me = this;
  7802. var chart = me.chart;
  7803. var meta = me.getMeta();
  7804. var lineModel = meta.dataset._model;
  7805. var area = chart.chartArea;
  7806. var points = meta.data || [];
  7807. var i, ilen, model, controlPoints;
  7808. // Only consider points that are drawn in case the spanGaps option is used
  7809. if (lineModel.spanGaps) {
  7810. points = points.filter(function(pt) {
  7811. return !pt._model.skip;
  7812. });
  7813. }
  7814. function capControlPoint(pt, min, max) {
  7815. return Math.max(Math.min(pt, max), min);
  7816. }
  7817. if (lineModel.cubicInterpolationMode === 'monotone') {
  7818. helpers$1.splineCurveMonotone(points);
  7819. } else {
  7820. for (i = 0, ilen = points.length; i < ilen; ++i) {
  7821. model = points[i]._model;
  7822. controlPoints = helpers$1.splineCurve(
  7823. helpers$1.previousItem(points, i)._model,
  7824. model,
  7825. helpers$1.nextItem(points, i)._model,
  7826. lineModel.tension
  7827. );
  7828. model.controlPointPreviousX = controlPoints.previous.x;
  7829. model.controlPointPreviousY = controlPoints.previous.y;
  7830. model.controlPointNextX = controlPoints.next.x;
  7831. model.controlPointNextY = controlPoints.next.y;
  7832. }
  7833. }
  7834. if (chart.options.elements.line.capBezierPoints) {
  7835. for (i = 0, ilen = points.length; i < ilen; ++i) {
  7836. model = points[i]._model;
  7837. if (isPointInArea(model, area)) {
  7838. if (i > 0 && isPointInArea(points[i - 1]._model, area)) {
  7839. model.controlPointPreviousX = capControlPoint(model.controlPointPreviousX, area.left, area.right);
  7840. model.controlPointPreviousY = capControlPoint(model.controlPointPreviousY, area.top, area.bottom);
  7841. }
  7842. if (i < points.length - 1 && isPointInArea(points[i + 1]._model, area)) {
  7843. model.controlPointNextX = capControlPoint(model.controlPointNextX, area.left, area.right);
  7844. model.controlPointNextY = capControlPoint(model.controlPointNextY, area.top, area.bottom);
  7845. }
  7846. }
  7847. }
  7848. }
  7849. },
  7850. draw: function() {
  7851. var me = this;
  7852. var chart = me.chart;
  7853. var meta = me.getMeta();
  7854. var points = meta.data || [];
  7855. var area = chart.chartArea;
  7856. var canvas = chart.canvas;
  7857. var i = 0;
  7858. var ilen = points.length;
  7859. var clip;
  7860. if (me._showLine) {
  7861. clip = meta.dataset._model.clip;
  7862. helpers$1.canvas.clipArea(chart.ctx, {
  7863. left: clip.left === false ? 0 : area.left - clip.left,
  7864. right: clip.right === false ? canvas.width : area.right + clip.right,
  7865. top: clip.top === false ? 0 : area.top - clip.top,
  7866. bottom: clip.bottom === false ? canvas.height : area.bottom + clip.bottom
  7867. });
  7868. meta.dataset.draw();
  7869. helpers$1.canvas.unclipArea(chart.ctx);
  7870. }
  7871. // Draw the points
  7872. for (; i < ilen; ++i) {
  7873. points[i].draw(area);
  7874. }
  7875. },
  7876. /**
  7877. * @protected
  7878. */
  7879. setHoverStyle: function(point) {
  7880. var model = point._model;
  7881. var options = point._options;
  7882. var getHoverColor = helpers$1.getHoverColor;
  7883. point.$previousStyle = {
  7884. backgroundColor: model.backgroundColor,
  7885. borderColor: model.borderColor,
  7886. borderWidth: model.borderWidth,
  7887. radius: model.radius
  7888. };
  7889. model.backgroundColor = valueOrDefault$6(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));
  7890. model.borderColor = valueOrDefault$6(options.hoverBorderColor, getHoverColor(options.borderColor));
  7891. model.borderWidth = valueOrDefault$6(options.hoverBorderWidth, options.borderWidth);
  7892. model.radius = valueOrDefault$6(options.hoverRadius, options.radius);
  7893. },
  7894. });
  7895. var resolve$3 = helpers$1.options.resolve;
  7896. core_defaults._set('polarArea', {
  7897. scale: {
  7898. type: 'radialLinear',
  7899. angleLines: {
  7900. display: false
  7901. },
  7902. gridLines: {
  7903. circular: true
  7904. },
  7905. pointLabels: {
  7906. display: false
  7907. },
  7908. ticks: {
  7909. beginAtZero: true
  7910. }
  7911. },
  7912. // Boolean - Whether to animate the rotation of the chart
  7913. animation: {
  7914. animateRotate: true,
  7915. animateScale: true
  7916. },
  7917. startAngle: -0.5 * Math.PI,
  7918. legendCallback: function(chart) {
  7919. var list = document.createElement('ul');
  7920. var data = chart.data;
  7921. var datasets = data.datasets;
  7922. var labels = data.labels;
  7923. var i, ilen, listItem, listItemSpan;
  7924. list.setAttribute('class', chart.id + '-legend');
  7925. if (datasets.length) {
  7926. for (i = 0, ilen = datasets[0].data.length; i < ilen; ++i) {
  7927. listItem = list.appendChild(document.createElement('li'));
  7928. listItemSpan = listItem.appendChild(document.createElement('span'));
  7929. listItemSpan.style.backgroundColor = datasets[0].backgroundColor[i];
  7930. if (labels[i]) {
  7931. listItem.appendChild(document.createTextNode(labels[i]));
  7932. }
  7933. }
  7934. }
  7935. return list.outerHTML;
  7936. },
  7937. legend: {
  7938. labels: {
  7939. generateLabels: function(chart) {
  7940. var data = chart.data;
  7941. if (data.labels.length && data.datasets.length) {
  7942. return data.labels.map(function(label, i) {
  7943. var meta = chart.getDatasetMeta(0);
  7944. var style = meta.controller.getStyle(i);
  7945. return {
  7946. text: label,
  7947. fillStyle: style.backgroundColor,
  7948. strokeStyle: style.borderColor,
  7949. lineWidth: style.borderWidth,
  7950. hidden: isNaN(data.datasets[0].data[i]) || meta.data[i].hidden,
  7951. // Extra data used for toggling the correct item
  7952. index: i
  7953. };
  7954. });
  7955. }
  7956. return [];
  7957. }
  7958. },
  7959. onClick: function(e, legendItem) {
  7960. var index = legendItem.index;
  7961. var chart = this.chart;
  7962. var i, ilen, meta;
  7963. for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {
  7964. meta = chart.getDatasetMeta(i);
  7965. meta.data[index].hidden = !meta.data[index].hidden;
  7966. }
  7967. chart.update();
  7968. }
  7969. },
  7970. // Need to override these to give a nice default
  7971. tooltips: {
  7972. callbacks: {
  7973. title: function() {
  7974. return '';
  7975. },
  7976. label: function(item, data) {
  7977. return data.labels[item.index] + ': ' + item.yLabel;
  7978. }
  7979. }
  7980. }
  7981. });
  7982. var controller_polarArea = core_datasetController.extend({
  7983. dataElementType: elements.Arc,
  7984. linkScales: helpers$1.noop,
  7985. /**
  7986. * @private
  7987. */
  7988. _dataElementOptions: [
  7989. 'backgroundColor',
  7990. 'borderColor',
  7991. 'borderWidth',
  7992. 'borderAlign',
  7993. 'hoverBackgroundColor',
  7994. 'hoverBorderColor',
  7995. 'hoverBorderWidth',
  7996. ],
  7997. /**
  7998. * @private
  7999. */
  8000. _getIndexScaleId: function() {
  8001. return this.chart.scale.id;
  8002. },
  8003. /**
  8004. * @private
  8005. */
  8006. _getValueScaleId: function() {
  8007. return this.chart.scale.id;
  8008. },
  8009. update: function(reset) {
  8010. var me = this;
  8011. var dataset = me.getDataset();
  8012. var meta = me.getMeta();
  8013. var start = me.chart.options.startAngle || 0;
  8014. var starts = me._starts = [];
  8015. var angles = me._angles = [];
  8016. var arcs = meta.data;
  8017. var i, ilen, angle;
  8018. me._updateRadius();
  8019. meta.count = me.countVisibleElements();
  8020. for (i = 0, ilen = dataset.data.length; i < ilen; i++) {
  8021. starts[i] = start;
  8022. angle = me._computeAngle(i);
  8023. angles[i] = angle;
  8024. start += angle;
  8025. }
  8026. for (i = 0, ilen = arcs.length; i < ilen; ++i) {
  8027. arcs[i]._options = me._resolveDataElementOptions(arcs[i], i);
  8028. me.updateElement(arcs[i], i, reset);
  8029. }
  8030. },
  8031. /**
  8032. * @private
  8033. */
  8034. _updateRadius: function() {
  8035. var me = this;
  8036. var chart = me.chart;
  8037. var chartArea = chart.chartArea;
  8038. var opts = chart.options;
  8039. var minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);
  8040. chart.outerRadius = Math.max(minSize / 2, 0);
  8041. chart.innerRadius = Math.max(opts.cutoutPercentage ? (chart.outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);
  8042. chart.radiusLength = (chart.outerRadius - chart.innerRadius) / chart.getVisibleDatasetCount();
  8043. me.outerRadius = chart.outerRadius - (chart.radiusLength * me.index);
  8044. me.innerRadius = me.outerRadius - chart.radiusLength;
  8045. },
  8046. updateElement: function(arc, index, reset) {
  8047. var me = this;
  8048. var chart = me.chart;
  8049. var dataset = me.getDataset();
  8050. var opts = chart.options;
  8051. var animationOpts = opts.animation;
  8052. var scale = chart.scale;
  8053. var labels = chart.data.labels;
  8054. var centerX = scale.xCenter;
  8055. var centerY = scale.yCenter;
  8056. // var negHalfPI = -0.5 * Math.PI;
  8057. var datasetStartAngle = opts.startAngle;
  8058. var distance = arc.hidden ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);
  8059. var startAngle = me._starts[index];
  8060. var endAngle = startAngle + (arc.hidden ? 0 : me._angles[index]);
  8061. var resetRadius = animationOpts.animateScale ? 0 : scale.getDistanceFromCenterForValue(dataset.data[index]);
  8062. var options = arc._options || {};
  8063. helpers$1.extend(arc, {
  8064. // Utility
  8065. _datasetIndex: me.index,
  8066. _index: index,
  8067. _scale: scale,
  8068. // Desired view properties
  8069. _model: {
  8070. backgroundColor: options.backgroundColor,
  8071. borderColor: options.borderColor,
  8072. borderWidth: options.borderWidth,
  8073. borderAlign: options.borderAlign,
  8074. x: centerX,
  8075. y: centerY,
  8076. innerRadius: 0,
  8077. outerRadius: reset ? resetRadius : distance,
  8078. startAngle: reset && animationOpts.animateRotate ? datasetStartAngle : startAngle,
  8079. endAngle: reset && animationOpts.animateRotate ? datasetStartAngle : endAngle,
  8080. label: helpers$1.valueAtIndexOrDefault(labels, index, labels[index])
  8081. }
  8082. });
  8083. arc.pivot();
  8084. },
  8085. countVisibleElements: function() {
  8086. var dataset = this.getDataset();
  8087. var meta = this.getMeta();
  8088. var count = 0;
  8089. helpers$1.each(meta.data, function(element, index) {
  8090. if (!isNaN(dataset.data[index]) && !element.hidden) {
  8091. count++;
  8092. }
  8093. });
  8094. return count;
  8095. },
  8096. /**
  8097. * @protected
  8098. */
  8099. setHoverStyle: function(arc) {
  8100. var model = arc._model;
  8101. var options = arc._options;
  8102. var getHoverColor = helpers$1.getHoverColor;
  8103. var valueOrDefault = helpers$1.valueOrDefault;
  8104. arc.$previousStyle = {
  8105. backgroundColor: model.backgroundColor,
  8106. borderColor: model.borderColor,
  8107. borderWidth: model.borderWidth,
  8108. };
  8109. model.backgroundColor = valueOrDefault(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));
  8110. model.borderColor = valueOrDefault(options.hoverBorderColor, getHoverColor(options.borderColor));
  8111. model.borderWidth = valueOrDefault(options.hoverBorderWidth, options.borderWidth);
  8112. },
  8113. /**
  8114. * @private
  8115. */
  8116. _computeAngle: function(index) {
  8117. var me = this;
  8118. var count = this.getMeta().count;
  8119. var dataset = me.getDataset();
  8120. var meta = me.getMeta();
  8121. if (isNaN(dataset.data[index]) || meta.data[index].hidden) {
  8122. return 0;
  8123. }
  8124. // Scriptable options
  8125. var context = {
  8126. chart: me.chart,
  8127. dataIndex: index,
  8128. dataset: dataset,
  8129. datasetIndex: me.index
  8130. };
  8131. return resolve$3([
  8132. me.chart.options.elements.arc.angle,
  8133. (2 * Math.PI) / count
  8134. ], context, index);
  8135. }
  8136. });
  8137. core_defaults._set('pie', helpers$1.clone(core_defaults.doughnut));
  8138. core_defaults._set('pie', {
  8139. cutoutPercentage: 0
  8140. });
  8141. // Pie charts are Doughnut chart with different defaults
  8142. var controller_pie = controller_doughnut;
  8143. var valueOrDefault$7 = helpers$1.valueOrDefault;
  8144. core_defaults._set('radar', {
  8145. spanGaps: false,
  8146. scale: {
  8147. type: 'radialLinear'
  8148. },
  8149. elements: {
  8150. line: {
  8151. fill: 'start',
  8152. tension: 0 // no bezier in radar
  8153. }
  8154. }
  8155. });
  8156. var controller_radar = core_datasetController.extend({
  8157. datasetElementType: elements.Line,
  8158. dataElementType: elements.Point,
  8159. linkScales: helpers$1.noop,
  8160. /**
  8161. * @private
  8162. */
  8163. _datasetElementOptions: [
  8164. 'backgroundColor',
  8165. 'borderWidth',
  8166. 'borderColor',
  8167. 'borderCapStyle',
  8168. 'borderDash',
  8169. 'borderDashOffset',
  8170. 'borderJoinStyle',
  8171. 'fill'
  8172. ],
  8173. /**
  8174. * @private
  8175. */
  8176. _dataElementOptions: {
  8177. backgroundColor: 'pointBackgroundColor',
  8178. borderColor: 'pointBorderColor',
  8179. borderWidth: 'pointBorderWidth',
  8180. hitRadius: 'pointHitRadius',
  8181. hoverBackgroundColor: 'pointHoverBackgroundColor',
  8182. hoverBorderColor: 'pointHoverBorderColor',
  8183. hoverBorderWidth: 'pointHoverBorderWidth',
  8184. hoverRadius: 'pointHoverRadius',
  8185. pointStyle: 'pointStyle',
  8186. radius: 'pointRadius',
  8187. rotation: 'pointRotation'
  8188. },
  8189. /**
  8190. * @private
  8191. */
  8192. _getIndexScaleId: function() {
  8193. return this.chart.scale.id;
  8194. },
  8195. /**
  8196. * @private
  8197. */
  8198. _getValueScaleId: function() {
  8199. return this.chart.scale.id;
  8200. },
  8201. update: function(reset) {
  8202. var me = this;
  8203. var meta = me.getMeta();
  8204. var line = meta.dataset;
  8205. var points = meta.data || [];
  8206. var scale = me.chart.scale;
  8207. var config = me._config;
  8208. var i, ilen;
  8209. // Compatibility: If the properties are defined with only the old name, use those values
  8210. if (config.tension !== undefined && config.lineTension === undefined) {
  8211. config.lineTension = config.tension;
  8212. }
  8213. // Utility
  8214. line._scale = scale;
  8215. line._datasetIndex = me.index;
  8216. // Data
  8217. line._children = points;
  8218. line._loop = true;
  8219. // Model
  8220. line._model = me._resolveDatasetElementOptions(line);
  8221. line.pivot();
  8222. // Update Points
  8223. for (i = 0, ilen = points.length; i < ilen; ++i) {
  8224. me.updateElement(points[i], i, reset);
  8225. }
  8226. // Update bezier control points
  8227. me.updateBezierControlPoints();
  8228. // Now pivot the point for animation
  8229. for (i = 0, ilen = points.length; i < ilen; ++i) {
  8230. points[i].pivot();
  8231. }
  8232. },
  8233. updateElement: function(point, index, reset) {
  8234. var me = this;
  8235. var custom = point.custom || {};
  8236. var dataset = me.getDataset();
  8237. var scale = me.chart.scale;
  8238. var pointPosition = scale.getPointPositionForValue(index, dataset.data[index]);
  8239. var options = me._resolveDataElementOptions(point, index);
  8240. var lineModel = me.getMeta().dataset._model;
  8241. var x = reset ? scale.xCenter : pointPosition.x;
  8242. var y = reset ? scale.yCenter : pointPosition.y;
  8243. // Utility
  8244. point._scale = scale;
  8245. point._options = options;
  8246. point._datasetIndex = me.index;
  8247. point._index = index;
  8248. // Desired view properties
  8249. point._model = {
  8250. x: x, // value not used in dataset scale, but we want a consistent API between scales
  8251. y: y,
  8252. skip: custom.skip || isNaN(x) || isNaN(y),
  8253. // Appearance
  8254. radius: options.radius,
  8255. pointStyle: options.pointStyle,
  8256. rotation: options.rotation,
  8257. backgroundColor: options.backgroundColor,
  8258. borderColor: options.borderColor,
  8259. borderWidth: options.borderWidth,
  8260. tension: valueOrDefault$7(custom.tension, lineModel ? lineModel.tension : 0),
  8261. // Tooltip
  8262. hitRadius: options.hitRadius
  8263. };
  8264. },
  8265. /**
  8266. * @private
  8267. */
  8268. _resolveDatasetElementOptions: function() {
  8269. var me = this;
  8270. var config = me._config;
  8271. var options = me.chart.options;
  8272. var values = core_datasetController.prototype._resolveDatasetElementOptions.apply(me, arguments);
  8273. values.spanGaps = valueOrDefault$7(config.spanGaps, options.spanGaps);
  8274. values.tension = valueOrDefault$7(config.lineTension, options.elements.line.tension);
  8275. return values;
  8276. },
  8277. updateBezierControlPoints: function() {
  8278. var me = this;
  8279. var meta = me.getMeta();
  8280. var area = me.chart.chartArea;
  8281. var points = meta.data || [];
  8282. var i, ilen, model, controlPoints;
  8283. // Only consider points that are drawn in case the spanGaps option is used
  8284. if (meta.dataset._model.spanGaps) {
  8285. points = points.filter(function(pt) {
  8286. return !pt._model.skip;
  8287. });
  8288. }
  8289. function capControlPoint(pt, min, max) {
  8290. return Math.max(Math.min(pt, max), min);
  8291. }
  8292. for (i = 0, ilen = points.length; i < ilen; ++i) {
  8293. model = points[i]._model;
  8294. controlPoints = helpers$1.splineCurve(
  8295. helpers$1.previousItem(points, i, true)._model,
  8296. model,
  8297. helpers$1.nextItem(points, i, true)._model,
  8298. model.tension
  8299. );
  8300. // Prevent the bezier going outside of the bounds of the graph
  8301. model.controlPointPreviousX = capControlPoint(controlPoints.previous.x, area.left, area.right);
  8302. model.controlPointPreviousY = capControlPoint(controlPoints.previous.y, area.top, area.bottom);
  8303. model.controlPointNextX = capControlPoint(controlPoints.next.x, area.left, area.right);
  8304. model.controlPointNextY = capControlPoint(controlPoints.next.y, area.top, area.bottom);
  8305. }
  8306. },
  8307. setHoverStyle: function(point) {
  8308. var model = point._model;
  8309. var options = point._options;
  8310. var getHoverColor = helpers$1.getHoverColor;
  8311. point.$previousStyle = {
  8312. backgroundColor: model.backgroundColor,
  8313. borderColor: model.borderColor,
  8314. borderWidth: model.borderWidth,
  8315. radius: model.radius
  8316. };
  8317. model.backgroundColor = valueOrDefault$7(options.hoverBackgroundColor, getHoverColor(options.backgroundColor));
  8318. model.borderColor = valueOrDefault$7(options.hoverBorderColor, getHoverColor(options.borderColor));
  8319. model.borderWidth = valueOrDefault$7(options.hoverBorderWidth, options.borderWidth);
  8320. model.radius = valueOrDefault$7(options.hoverRadius, options.radius);
  8321. }
  8322. });
  8323. core_defaults._set('scatter', {
  8324. hover: {
  8325. mode: 'single'
  8326. },
  8327. scales: {
  8328. xAxes: [{
  8329. id: 'x-axis-1', // need an ID so datasets can reference the scale
  8330. type: 'linear', // scatter should not use a category axis
  8331. position: 'bottom'
  8332. }],
  8333. yAxes: [{
  8334. id: 'y-axis-1',
  8335. type: 'linear',
  8336. position: 'left'
  8337. }]
  8338. },
  8339. tooltips: {
  8340. callbacks: {
  8341. title: function() {
  8342. return ''; // doesn't make sense for scatter since data are formatted as a point
  8343. },
  8344. label: function(item) {
  8345. return '(' + item.xLabel + ', ' + item.yLabel + ')';
  8346. }
  8347. }
  8348. }
  8349. });
  8350. core_defaults._set('global', {
  8351. datasets: {
  8352. scatter: {
  8353. showLine: false
  8354. }
  8355. }
  8356. });
  8357. // Scatter charts use line controllers
  8358. var controller_scatter = controller_line;
  8359. // NOTE export a map in which the key represents the controller type, not
  8360. // the class, and so must be CamelCase in order to be correctly retrieved
  8361. // by the controller in core.controller.js (`controllers[meta.type]`).
  8362. var controllers = {
  8363. bar: controller_bar,
  8364. bubble: controller_bubble,
  8365. doughnut: controller_doughnut,
  8366. horizontalBar: controller_horizontalBar,
  8367. line: controller_line,
  8368. polarArea: controller_polarArea,
  8369. pie: controller_pie,
  8370. radar: controller_radar,
  8371. scatter: controller_scatter
  8372. };
  8373. /**
  8374. * Helper function to get relative position for an event
  8375. * @param {Event|IEvent} event - The event to get the position for
  8376. * @param {Chart} chart - The chart
  8377. * @returns {object} the event position
  8378. */
  8379. function getRelativePosition(e, chart) {
  8380. if (e.native) {
  8381. return {
  8382. x: e.x,
  8383. y: e.y
  8384. };
  8385. }
  8386. return helpers$1.getRelativePosition(e, chart);
  8387. }
  8388. /**
  8389. * Helper function to traverse all of the visible elements in the chart
  8390. * @param {Chart} chart - the chart
  8391. * @param {function} handler - the callback to execute for each visible item
  8392. */
  8393. function parseVisibleItems(chart, handler) {
  8394. var metasets = chart._getSortedVisibleDatasetMetas();
  8395. var metadata, i, j, ilen, jlen, element;
  8396. for (i = 0, ilen = metasets.length; i < ilen; ++i) {
  8397. metadata = metasets[i].data;
  8398. for (j = 0, jlen = metadata.length; j < jlen; ++j) {
  8399. element = metadata[j];
  8400. if (!element._view.skip) {
  8401. handler(element);
  8402. }
  8403. }
  8404. }
  8405. }
  8406. /**
  8407. * Helper function to get the items that intersect the event position
  8408. * @param {ChartElement[]} items - elements to filter
  8409. * @param {object} position - the point to be nearest to
  8410. * @return {ChartElement[]} the nearest items
  8411. */
  8412. function getIntersectItems(chart, position) {
  8413. var elements = [];
  8414. parseVisibleItems(chart, function(element) {
  8415. if (element.inRange(position.x, position.y)) {
  8416. elements.push(element);
  8417. }
  8418. });
  8419. return elements;
  8420. }
  8421. /**
  8422. * Helper function to get the items nearest to the event position considering all visible items in teh chart
  8423. * @param {Chart} chart - the chart to look at elements from
  8424. * @param {object} position - the point to be nearest to
  8425. * @param {boolean} intersect - if true, only consider items that intersect the position
  8426. * @param {function} distanceMetric - function to provide the distance between points
  8427. * @return {ChartElement[]} the nearest items
  8428. */
  8429. function getNearestItems(chart, position, intersect, distanceMetric) {
  8430. var minDistance = Number.POSITIVE_INFINITY;
  8431. var nearestItems = [];
  8432. parseVisibleItems(chart, function(element) {
  8433. if (intersect && !element.inRange(position.x, position.y)) {
  8434. return;
  8435. }
  8436. var center = element.getCenterPoint();
  8437. var distance = distanceMetric(position, center);
  8438. if (distance < minDistance) {
  8439. nearestItems = [element];
  8440. minDistance = distance;
  8441. } else if (distance === minDistance) {
  8442. // Can have multiple items at the same distance in which case we sort by size
  8443. nearestItems.push(element);
  8444. }
  8445. });
  8446. return nearestItems;
  8447. }
  8448. /**
  8449. * Get a distance metric function for two points based on the
  8450. * axis mode setting
  8451. * @param {string} axis - the axis mode. x|y|xy
  8452. */
  8453. function getDistanceMetricForAxis(axis) {
  8454. var useX = axis.indexOf('x') !== -1;
  8455. var useY = axis.indexOf('y') !== -1;
  8456. return function(pt1, pt2) {
  8457. var deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;
  8458. var deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;
  8459. return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));
  8460. };
  8461. }
  8462. function indexMode(chart, e, options) {
  8463. var position = getRelativePosition(e, chart);
  8464. // Default axis for index mode is 'x' to match old behaviour
  8465. options.axis = options.axis || 'x';
  8466. var distanceMetric = getDistanceMetricForAxis(options.axis);
  8467. var items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false, distanceMetric);
  8468. var elements = [];
  8469. if (!items.length) {
  8470. return [];
  8471. }
  8472. chart._getSortedVisibleDatasetMetas().forEach(function(meta) {
  8473. var element = meta.data[items[0]._index];
  8474. // don't count items that are skipped (null data)
  8475. if (element && !element._view.skip) {
  8476. elements.push(element);
  8477. }
  8478. });
  8479. return elements;
  8480. }
  8481. /**
  8482. * @interface IInteractionOptions
  8483. */
  8484. /**
  8485. * If true, only consider items that intersect the point
  8486. * @name IInterfaceOptions#boolean
  8487. * @type Boolean
  8488. */
  8489. /**
  8490. * Contains interaction related functions
  8491. * @namespace Chart.Interaction
  8492. */
  8493. var core_interaction = {
  8494. // Helper function for different modes
  8495. modes: {
  8496. single: function(chart, e) {
  8497. var position = getRelativePosition(e, chart);
  8498. var elements = [];
  8499. parseVisibleItems(chart, function(element) {
  8500. if (element.inRange(position.x, position.y)) {
  8501. elements.push(element);
  8502. return elements;
  8503. }
  8504. });
  8505. return elements.slice(0, 1);
  8506. },
  8507. /**
  8508. * @function Chart.Interaction.modes.label
  8509. * @deprecated since version 2.4.0
  8510. * @todo remove at version 3
  8511. * @private
  8512. */
  8513. label: indexMode,
  8514. /**
  8515. * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something
  8516. * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item
  8517. * @function Chart.Interaction.modes.index
  8518. * @since v2.4.0
  8519. * @param {Chart} chart - the chart we are returning items from
  8520. * @param {Event} e - the event we are find things at
  8521. * @param {IInteractionOptions} options - options to use during interaction
  8522. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  8523. */
  8524. index: indexMode,
  8525. /**
  8526. * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something
  8527. * If the options.intersect is false, we find the nearest item and return the items in that dataset
  8528. * @function Chart.Interaction.modes.dataset
  8529. * @param {Chart} chart - the chart we are returning items from
  8530. * @param {Event} e - the event we are find things at
  8531. * @param {IInteractionOptions} options - options to use during interaction
  8532. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  8533. */
  8534. dataset: function(chart, e, options) {
  8535. var position = getRelativePosition(e, chart);
  8536. options.axis = options.axis || 'xy';
  8537. var distanceMetric = getDistanceMetricForAxis(options.axis);
  8538. var items = options.intersect ? getIntersectItems(chart, position) : getNearestItems(chart, position, false, distanceMetric);
  8539. if (items.length > 0) {
  8540. items = chart.getDatasetMeta(items[0]._datasetIndex).data;
  8541. }
  8542. return items;
  8543. },
  8544. /**
  8545. * @function Chart.Interaction.modes.x-axis
  8546. * @deprecated since version 2.4.0. Use index mode and intersect == true
  8547. * @todo remove at version 3
  8548. * @private
  8549. */
  8550. 'x-axis': function(chart, e) {
  8551. return indexMode(chart, e, {intersect: false});
  8552. },
  8553. /**
  8554. * Point mode returns all elements that hit test based on the event position
  8555. * of the event
  8556. * @function Chart.Interaction.modes.intersect
  8557. * @param {Chart} chart - the chart we are returning items from
  8558. * @param {Event} e - the event we are find things at
  8559. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  8560. */
  8561. point: function(chart, e) {
  8562. var position = getRelativePosition(e, chart);
  8563. return getIntersectItems(chart, position);
  8564. },
  8565. /**
  8566. * nearest mode returns the element closest to the point
  8567. * @function Chart.Interaction.modes.intersect
  8568. * @param {Chart} chart - the chart we are returning items from
  8569. * @param {Event} e - the event we are find things at
  8570. * @param {IInteractionOptions} options - options to use
  8571. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  8572. */
  8573. nearest: function(chart, e, options) {
  8574. var position = getRelativePosition(e, chart);
  8575. options.axis = options.axis || 'xy';
  8576. var distanceMetric = getDistanceMetricForAxis(options.axis);
  8577. return getNearestItems(chart, position, options.intersect, distanceMetric);
  8578. },
  8579. /**
  8580. * x mode returns the elements that hit-test at the current x coordinate
  8581. * @function Chart.Interaction.modes.x
  8582. * @param {Chart} chart - the chart we are returning items from
  8583. * @param {Event} e - the event we are find things at
  8584. * @param {IInteractionOptions} options - options to use
  8585. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  8586. */
  8587. x: function(chart, e, options) {
  8588. var position = getRelativePosition(e, chart);
  8589. var items = [];
  8590. var intersectsItem = false;
  8591. parseVisibleItems(chart, function(element) {
  8592. if (element.inXRange(position.x)) {
  8593. items.push(element);
  8594. }
  8595. if (element.inRange(position.x, position.y)) {
  8596. intersectsItem = true;
  8597. }
  8598. });
  8599. // If we want to trigger on an intersect and we don't have any items
  8600. // that intersect the position, return nothing
  8601. if (options.intersect && !intersectsItem) {
  8602. items = [];
  8603. }
  8604. return items;
  8605. },
  8606. /**
  8607. * y mode returns the elements that hit-test at the current y coordinate
  8608. * @function Chart.Interaction.modes.y
  8609. * @param {Chart} chart - the chart we are returning items from
  8610. * @param {Event} e - the event we are find things at
  8611. * @param {IInteractionOptions} options - options to use
  8612. * @return {Chart.Element[]} Array of elements that are under the point. If none are found, an empty array is returned
  8613. */
  8614. y: function(chart, e, options) {
  8615. var position = getRelativePosition(e, chart);
  8616. var items = [];
  8617. var intersectsItem = false;
  8618. parseVisibleItems(chart, function(element) {
  8619. if (element.inYRange(position.y)) {
  8620. items.push(element);
  8621. }
  8622. if (element.inRange(position.x, position.y)) {
  8623. intersectsItem = true;
  8624. }
  8625. });
  8626. // If we want to trigger on an intersect and we don't have any items
  8627. // that intersect the position, return nothing
  8628. if (options.intersect && !intersectsItem) {
  8629. items = [];
  8630. }
  8631. return items;
  8632. }
  8633. }
  8634. };
  8635. var extend = helpers$1.extend;
  8636. function filterByPosition(array, position) {
  8637. return helpers$1.where(array, function(v) {
  8638. return v.pos === position;
  8639. });
  8640. }
  8641. function sortByWeight(array, reverse) {
  8642. return array.sort(function(a, b) {
  8643. var v0 = reverse ? b : a;
  8644. var v1 = reverse ? a : b;
  8645. return v0.weight === v1.weight ?
  8646. v0.index - v1.index :
  8647. v0.weight - v1.weight;
  8648. });
  8649. }
  8650. function wrapBoxes(boxes) {
  8651. var layoutBoxes = [];
  8652. var i, ilen, box;
  8653. for (i = 0, ilen = (boxes || []).length; i < ilen; ++i) {
  8654. box = boxes[i];
  8655. layoutBoxes.push({
  8656. index: i,
  8657. box: box,
  8658. pos: box.position,
  8659. horizontal: box.isHorizontal(),
  8660. weight: box.weight
  8661. });
  8662. }
  8663. return layoutBoxes;
  8664. }
  8665. function setLayoutDims(layouts, params) {
  8666. var i, ilen, layout;
  8667. for (i = 0, ilen = layouts.length; i < ilen; ++i) {
  8668. layout = layouts[i];
  8669. // store width used instead of chartArea.w in fitBoxes
  8670. layout.width = layout.horizontal
  8671. ? layout.box.fullWidth && params.availableWidth
  8672. : params.vBoxMaxWidth;
  8673. // store height used instead of chartArea.h in fitBoxes
  8674. layout.height = layout.horizontal && params.hBoxMaxHeight;
  8675. }
  8676. }
  8677. function buildLayoutBoxes(boxes) {
  8678. var layoutBoxes = wrapBoxes(boxes);
  8679. var left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);
  8680. var right = sortByWeight(filterByPosition(layoutBoxes, 'right'));
  8681. var top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);
  8682. var bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));
  8683. return {
  8684. leftAndTop: left.concat(top),
  8685. rightAndBottom: right.concat(bottom),
  8686. chartArea: filterByPosition(layoutBoxes, 'chartArea'),
  8687. vertical: left.concat(right),
  8688. horizontal: top.concat(bottom)
  8689. };
  8690. }
  8691. function getCombinedMax(maxPadding, chartArea, a, b) {
  8692. return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);
  8693. }
  8694. function updateDims(chartArea, params, layout) {
  8695. var box = layout.box;
  8696. var maxPadding = chartArea.maxPadding;
  8697. var newWidth, newHeight;
  8698. if (layout.size) {
  8699. // this layout was already counted for, lets first reduce old size
  8700. chartArea[layout.pos] -= layout.size;
  8701. }
  8702. layout.size = layout.horizontal ? box.height : box.width;
  8703. chartArea[layout.pos] += layout.size;
  8704. if (box.getPadding) {
  8705. var boxPadding = box.getPadding();
  8706. maxPadding.top = Math.max(maxPadding.top, boxPadding.top);
  8707. maxPadding.left = Math.max(maxPadding.left, boxPadding.left);
  8708. maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);
  8709. maxPadding.right = Math.max(maxPadding.right, boxPadding.right);
  8710. }
  8711. newWidth = params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right');
  8712. newHeight = params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom');
  8713. if (newWidth !== chartArea.w || newHeight !== chartArea.h) {
  8714. chartArea.w = newWidth;
  8715. chartArea.h = newHeight;
  8716. // return true if chart area changed in layout's direction
  8717. var sizes = layout.horizontal ? [newWidth, chartArea.w] : [newHeight, chartArea.h];
  8718. return sizes[0] !== sizes[1] && (!isNaN(sizes[0]) || !isNaN(sizes[1]));
  8719. }
  8720. }
  8721. function handleMaxPadding(chartArea) {
  8722. var maxPadding = chartArea.maxPadding;
  8723. function updatePos(pos) {
  8724. var change = Math.max(maxPadding[pos] - chartArea[pos], 0);
  8725. chartArea[pos] += change;
  8726. return change;
  8727. }
  8728. chartArea.y += updatePos('top');
  8729. chartArea.x += updatePos('left');
  8730. updatePos('right');
  8731. updatePos('bottom');
  8732. }
  8733. function getMargins(horizontal, chartArea) {
  8734. var maxPadding = chartArea.maxPadding;
  8735. function marginForPositions(positions) {
  8736. var margin = {left: 0, top: 0, right: 0, bottom: 0};
  8737. positions.forEach(function(pos) {
  8738. margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);
  8739. });
  8740. return margin;
  8741. }
  8742. return horizontal
  8743. ? marginForPositions(['left', 'right'])
  8744. : marginForPositions(['top', 'bottom']);
  8745. }
  8746. function fitBoxes(boxes, chartArea, params) {
  8747. var refitBoxes = [];
  8748. var i, ilen, layout, box, refit, changed;
  8749. for (i = 0, ilen = boxes.length; i < ilen; ++i) {
  8750. layout = boxes[i];
  8751. box = layout.box;
  8752. box.update(
  8753. layout.width || chartArea.w,
  8754. layout.height || chartArea.h,
  8755. getMargins(layout.horizontal, chartArea)
  8756. );
  8757. if (updateDims(chartArea, params, layout)) {
  8758. changed = true;
  8759. if (refitBoxes.length) {
  8760. // Dimensions changed and there were non full width boxes before this
  8761. // -> we have to refit those
  8762. refit = true;
  8763. }
  8764. }
  8765. if (!box.fullWidth) { // fullWidth boxes don't need to be re-fitted in any case
  8766. refitBoxes.push(layout);
  8767. }
  8768. }
  8769. return refit ? fitBoxes(refitBoxes, chartArea, params) || changed : changed;
  8770. }
  8771. function placeBoxes(boxes, chartArea, params) {
  8772. var userPadding = params.padding;
  8773. var x = chartArea.x;
  8774. var y = chartArea.y;
  8775. var i, ilen, layout, box;
  8776. for (i = 0, ilen = boxes.length; i < ilen; ++i) {
  8777. layout = boxes[i];
  8778. box = layout.box;
  8779. if (layout.horizontal) {
  8780. box.left = box.fullWidth ? userPadding.left : chartArea.left;
  8781. box.right = box.fullWidth ? params.outerWidth - userPadding.right : chartArea.left + chartArea.w;
  8782. box.top = y;
  8783. box.bottom = y + box.height;
  8784. box.width = box.right - box.left;
  8785. y = box.bottom;
  8786. } else {
  8787. box.left = x;
  8788. box.right = x + box.width;
  8789. box.top = chartArea.top;
  8790. box.bottom = chartArea.top + chartArea.h;
  8791. box.height = box.bottom - box.top;
  8792. x = box.right;
  8793. }
  8794. }
  8795. chartArea.x = x;
  8796. chartArea.y = y;
  8797. }
  8798. core_defaults._set('global', {
  8799. layout: {
  8800. padding: {
  8801. top: 0,
  8802. right: 0,
  8803. bottom: 0,
  8804. left: 0
  8805. }
  8806. }
  8807. });
  8808. /**
  8809. * @interface ILayoutItem
  8810. * @prop {string} position - The position of the item in the chart layout. Possible values are
  8811. * 'left', 'top', 'right', 'bottom', and 'chartArea'
  8812. * @prop {number} weight - The weight used to sort the item. Higher weights are further away from the chart area
  8813. * @prop {boolean} fullWidth - if true, and the item is horizontal, then push vertical boxes down
  8814. * @prop {function} isHorizontal - returns true if the layout item is horizontal (ie. top or bottom)
  8815. * @prop {function} update - Takes two parameters: width and height. Returns size of item
  8816. * @prop {function} getPadding - Returns an object with padding on the edges
  8817. * @prop {number} width - Width of item. Must be valid after update()
  8818. * @prop {number} height - Height of item. Must be valid after update()
  8819. * @prop {number} left - Left edge of the item. Set by layout system and cannot be used in update
  8820. * @prop {number} top - Top edge of the item. Set by layout system and cannot be used in update
  8821. * @prop {number} right - Right edge of the item. Set by layout system and cannot be used in update
  8822. * @prop {number} bottom - Bottom edge of the item. Set by layout system and cannot be used in update
  8823. */
  8824. // The layout service is very self explanatory. It's responsible for the layout within a chart.
  8825. // Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need
  8826. // It is this service's responsibility of carrying out that layout.
  8827. var core_layouts = {
  8828. defaults: {},
  8829. /**
  8830. * Register a box to a chart.
  8831. * A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title.
  8832. * @param {Chart} chart - the chart to use
  8833. * @param {ILayoutItem} item - the item to add to be layed out
  8834. */
  8835. addBox: function(chart, item) {
  8836. if (!chart.boxes) {
  8837. chart.boxes = [];
  8838. }
  8839. // initialize item with default values
  8840. item.fullWidth = item.fullWidth || false;
  8841. item.position = item.position || 'top';
  8842. item.weight = item.weight || 0;
  8843. item._layers = item._layers || function() {
  8844. return [{
  8845. z: 0,
  8846. draw: function() {
  8847. item.draw.apply(item, arguments);
  8848. }
  8849. }];
  8850. };
  8851. chart.boxes.push(item);
  8852. },
  8853. /**
  8854. * Remove a layoutItem from a chart
  8855. * @param {Chart} chart - the chart to remove the box from
  8856. * @param {ILayoutItem} layoutItem - the item to remove from the layout
  8857. */
  8858. removeBox: function(chart, layoutItem) {
  8859. var index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;
  8860. if (index !== -1) {
  8861. chart.boxes.splice(index, 1);
  8862. }
  8863. },
  8864. /**
  8865. * Sets (or updates) options on the given `item`.
  8866. * @param {Chart} chart - the chart in which the item lives (or will be added to)
  8867. * @param {ILayoutItem} item - the item to configure with the given options
  8868. * @param {object} options - the new item options.
  8869. */
  8870. configure: function(chart, item, options) {
  8871. var props = ['fullWidth', 'position', 'weight'];
  8872. var ilen = props.length;
  8873. var i = 0;
  8874. var prop;
  8875. for (; i < ilen; ++i) {
  8876. prop = props[i];
  8877. if (options.hasOwnProperty(prop)) {
  8878. item[prop] = options[prop];
  8879. }
  8880. }
  8881. },
  8882. /**
  8883. * Fits boxes of the given chart into the given size by having each box measure itself
  8884. * then running a fitting algorithm
  8885. * @param {Chart} chart - the chart
  8886. * @param {number} width - the width to fit into
  8887. * @param {number} height - the height to fit into
  8888. */
  8889. update: function(chart, width, height) {
  8890. if (!chart) {
  8891. return;
  8892. }
  8893. var layoutOptions = chart.options.layout || {};
  8894. var padding = helpers$1.options.toPadding(layoutOptions.padding);
  8895. var availableWidth = width - padding.width;
  8896. var availableHeight = height - padding.height;
  8897. var boxes = buildLayoutBoxes(chart.boxes);
  8898. var verticalBoxes = boxes.vertical;
  8899. var horizontalBoxes = boxes.horizontal;
  8900. // Essentially we now have any number of boxes on each of the 4 sides.
  8901. // Our canvas looks like the following.
  8902. // The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and
  8903. // B1 is the bottom axis
  8904. // There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays
  8905. // These locations are single-box locations only, when trying to register a chartArea location that is already taken,
  8906. // an error will be thrown.
  8907. //
  8908. // |----------------------------------------------------|
  8909. // | T1 (Full Width) |
  8910. // |----------------------------------------------------|
  8911. // | | | T2 | |
  8912. // | |----|-------------------------------------|----|
  8913. // | | | C1 | | C2 | |
  8914. // | | |----| |----| |
  8915. // | | | | |
  8916. // | L1 | L2 | ChartArea (C0) | R1 |
  8917. // | | | | |
  8918. // | | |----| |----| |
  8919. // | | | C3 | | C4 | |
  8920. // | |----|-------------------------------------|----|
  8921. // | | | B1 | |
  8922. // |----------------------------------------------------|
  8923. // | B2 (Full Width) |
  8924. // |----------------------------------------------------|
  8925. //
  8926. var params = Object.freeze({
  8927. outerWidth: width,
  8928. outerHeight: height,
  8929. padding: padding,
  8930. availableWidth: availableWidth,
  8931. vBoxMaxWidth: availableWidth / 2 / verticalBoxes.length,
  8932. hBoxMaxHeight: availableHeight / 2
  8933. });
  8934. var chartArea = extend({
  8935. maxPadding: extend({}, padding),
  8936. w: availableWidth,
  8937. h: availableHeight,
  8938. x: padding.left,
  8939. y: padding.top
  8940. }, padding);
  8941. setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);
  8942. // First fit vertical boxes
  8943. fitBoxes(verticalBoxes, chartArea, params);
  8944. // Then fit horizontal boxes
  8945. if (fitBoxes(horizontalBoxes, chartArea, params)) {
  8946. // if the area changed, re-fit vertical boxes
  8947. fitBoxes(verticalBoxes, chartArea, params);
  8948. }
  8949. handleMaxPadding(chartArea);
  8950. // Finally place the boxes to correct coordinates
  8951. placeBoxes(boxes.leftAndTop, chartArea, params);
  8952. // Move to opposite side of chart
  8953. chartArea.x += chartArea.w;
  8954. chartArea.y += chartArea.h;
  8955. placeBoxes(boxes.rightAndBottom, chartArea, params);
  8956. chart.chartArea = {
  8957. left: chartArea.left,
  8958. top: chartArea.top,
  8959. right: chartArea.left + chartArea.w,
  8960. bottom: chartArea.top + chartArea.h
  8961. };
  8962. // Finally update boxes in chartArea (radial scale for example)
  8963. helpers$1.each(boxes.chartArea, function(layout) {
  8964. var box = layout.box;
  8965. extend(box, chart.chartArea);
  8966. box.update(chartArea.w, chartArea.h);
  8967. });
  8968. }
  8969. };
  8970. /**
  8971. * Platform fallback implementation (minimal).
  8972. * @see https://github.com/chartjs/Chart.js/pull/4591#issuecomment-319575939
  8973. */
  8974. var platform_basic = {
  8975. acquireContext: function(item) {
  8976. if (item && item.canvas) {
  8977. // Support for any object associated to a canvas (including a context2d)
  8978. item = item.canvas;
  8979. }
  8980. return item && item.getContext('2d') || null;
  8981. }
  8982. };
  8983. var platform_dom = "/*\r\n * DOM element rendering detection\r\n * https://davidwalsh.name/detect-node-insertion\r\n */\r\n@keyframes chartjs-render-animation {\r\n\tfrom { opacity: 0.99; }\r\n\tto { opacity: 1; }\r\n}\r\n\r\n.chartjs-render-monitor {\r\n\tanimation: chartjs-render-animation 0.001s;\r\n}\r\n\r\n/*\r\n * DOM element resizing detection\r\n * https://github.com/marcj/css-element-queries\r\n */\r\n.chartjs-size-monitor,\r\n.chartjs-size-monitor-expand,\r\n.chartjs-size-monitor-shrink {\r\n\tposition: absolute;\r\n\tdirection: ltr;\r\n\tleft: 0;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\toverflow: hidden;\r\n\tpointer-events: none;\r\n\tvisibility: hidden;\r\n\tz-index: -1;\r\n}\r\n\r\n.chartjs-size-monitor-expand > div {\r\n\tposition: absolute;\r\n\twidth: 1000000px;\r\n\theight: 1000000px;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n\r\n.chartjs-size-monitor-shrink > div {\r\n\tposition: absolute;\r\n\twidth: 200%;\r\n\theight: 200%;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n";
  8984. var platform_dom$1 = /*#__PURE__*/Object.freeze({
  8985. __proto__: null,
  8986. 'default': platform_dom
  8987. });
  8988. var stylesheet = getCjsExportFromNamespace(platform_dom$1);
  8989. var EXPANDO_KEY = '$chartjs';
  8990. var CSS_PREFIX = 'chartjs-';
  8991. var CSS_SIZE_MONITOR = CSS_PREFIX + 'size-monitor';
  8992. var CSS_RENDER_MONITOR = CSS_PREFIX + 'render-monitor';
  8993. var CSS_RENDER_ANIMATION = CSS_PREFIX + 'render-animation';
  8994. var ANIMATION_START_EVENTS = ['animationstart', 'webkitAnimationStart'];
  8995. /**
  8996. * DOM event types -> Chart.js event types.
  8997. * Note: only events with different types are mapped.
  8998. * @see https://developer.mozilla.org/en-US/docs/Web/Events
  8999. */
  9000. var EVENT_TYPES = {
  9001. touchstart: 'mousedown',
  9002. touchmove: 'mousemove',
  9003. touchend: 'mouseup',
  9004. pointerenter: 'mouseenter',
  9005. pointerdown: 'mousedown',
  9006. pointermove: 'mousemove',
  9007. pointerup: 'mouseup',
  9008. pointerleave: 'mouseout',
  9009. pointerout: 'mouseout'
  9010. };
  9011. /**
  9012. * The "used" size is the final value of a dimension property after all calculations have
  9013. * been performed. This method uses the computed style of `element` but returns undefined
  9014. * if the computed style is not expressed in pixels. That can happen in some cases where
  9015. * `element` has a size relative to its parent and this last one is not yet displayed,
  9016. * for example because of `display: none` on a parent node.
  9017. * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value
  9018. * @returns {number} Size in pixels or undefined if unknown.
  9019. */
  9020. function readUsedSize(element, property) {
  9021. var value = helpers$1.getStyle(element, property);
  9022. var matches = value && value.match(/^(\d+)(\.\d+)?px$/);
  9023. return matches ? Number(matches[1]) : undefined;
  9024. }
  9025. /**
  9026. * Initializes the canvas style and render size without modifying the canvas display size,
  9027. * since responsiveness is handled by the controller.resize() method. The config is used
  9028. * to determine the aspect ratio to apply in case no explicit height has been specified.
  9029. */
  9030. function initCanvas(canvas, config) {
  9031. var style = canvas.style;
  9032. // NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it
  9033. // returns null or '' if no explicit value has been set to the canvas attribute.
  9034. var renderHeight = canvas.getAttribute('height');
  9035. var renderWidth = canvas.getAttribute('width');
  9036. // Chart.js modifies some canvas values that we want to restore on destroy
  9037. canvas[EXPANDO_KEY] = {
  9038. initial: {
  9039. height: renderHeight,
  9040. width: renderWidth,
  9041. style: {
  9042. display: style.display,
  9043. height: style.height,
  9044. width: style.width
  9045. }
  9046. }
  9047. };
  9048. // Force canvas to display as block to avoid extra space caused by inline
  9049. // elements, which would interfere with the responsive resize process.
  9050. // https://github.com/chartjs/Chart.js/issues/2538
  9051. style.display = style.display || 'block';
  9052. if (renderWidth === null || renderWidth === '') {
  9053. var displayWidth = readUsedSize(canvas, 'width');
  9054. if (displayWidth !== undefined) {
  9055. canvas.width = displayWidth;
  9056. }
  9057. }
  9058. if (renderHeight === null || renderHeight === '') {
  9059. if (canvas.style.height === '') {
  9060. // If no explicit render height and style height, let's apply the aspect ratio,
  9061. // which one can be specified by the user but also by charts as default option
  9062. // (i.e. options.aspectRatio). If not specified, use canvas aspect ratio of 2.
  9063. canvas.height = canvas.width / (config.options.aspectRatio || 2);
  9064. } else {
  9065. var displayHeight = readUsedSize(canvas, 'height');
  9066. if (displayWidth !== undefined) {
  9067. canvas.height = displayHeight;
  9068. }
  9069. }
  9070. }
  9071. return canvas;
  9072. }
  9073. /**
  9074. * Detects support for options object argument in addEventListener.
  9075. * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support
  9076. * @private
  9077. */
  9078. var supportsEventListenerOptions = (function() {
  9079. var supports = false;
  9080. try {
  9081. var options = Object.defineProperty({}, 'passive', {
  9082. // eslint-disable-next-line getter-return
  9083. get: function() {
  9084. supports = true;
  9085. }
  9086. });
  9087. window.addEventListener('e', null, options);
  9088. } catch (e) {
  9089. // continue regardless of error
  9090. }
  9091. return supports;
  9092. }());
  9093. // Default passive to true as expected by Chrome for 'touchstart' and 'touchend' events.
  9094. // https://github.com/chartjs/Chart.js/issues/4287
  9095. var eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false;
  9096. function addListener(node, type, listener) {
  9097. node.addEventListener(type, listener, eventListenerOptions);
  9098. }
  9099. function removeListener(node, type, listener) {
  9100. node.removeEventListener(type, listener, eventListenerOptions);
  9101. }
  9102. function createEvent(type, chart, x, y, nativeEvent) {
  9103. return {
  9104. type: type,
  9105. chart: chart,
  9106. native: nativeEvent || null,
  9107. x: x !== undefined ? x : null,
  9108. y: y !== undefined ? y : null,
  9109. };
  9110. }
  9111. function fromNativeEvent(event, chart) {
  9112. var type = EVENT_TYPES[event.type] || event.type;
  9113. var pos = helpers$1.getRelativePosition(event, chart);
  9114. return createEvent(type, chart, pos.x, pos.y, event);
  9115. }
  9116. function throttled(fn, thisArg) {
  9117. var ticking = false;
  9118. var args = [];
  9119. return function() {
  9120. args = Array.prototype.slice.call(arguments);
  9121. thisArg = thisArg || this;
  9122. if (!ticking) {
  9123. ticking = true;
  9124. helpers$1.requestAnimFrame.call(window, function() {
  9125. ticking = false;
  9126. fn.apply(thisArg, args);
  9127. });
  9128. }
  9129. };
  9130. }
  9131. function createDiv(cls) {
  9132. var el = document.createElement('div');
  9133. el.className = cls || '';
  9134. return el;
  9135. }
  9136. // Implementation based on https://github.com/marcj/css-element-queries
  9137. function createResizer(handler) {
  9138. var maxSize = 1000000;
  9139. // NOTE(SB) Don't use innerHTML because it could be considered unsafe.
  9140. // https://github.com/chartjs/Chart.js/issues/5902
  9141. var resizer = createDiv(CSS_SIZE_MONITOR);
  9142. var expand = createDiv(CSS_SIZE_MONITOR + '-expand');
  9143. var shrink = createDiv(CSS_SIZE_MONITOR + '-shrink');
  9144. expand.appendChild(createDiv());
  9145. shrink.appendChild(createDiv());
  9146. resizer.appendChild(expand);
  9147. resizer.appendChild(shrink);
  9148. resizer._reset = function() {
  9149. expand.scrollLeft = maxSize;
  9150. expand.scrollTop = maxSize;
  9151. shrink.scrollLeft = maxSize;
  9152. shrink.scrollTop = maxSize;
  9153. };
  9154. var onScroll = function() {
  9155. resizer._reset();
  9156. handler();
  9157. };
  9158. addListener(expand, 'scroll', onScroll.bind(expand, 'expand'));
  9159. addListener(shrink, 'scroll', onScroll.bind(shrink, 'shrink'));
  9160. return resizer;
  9161. }
  9162. // https://davidwalsh.name/detect-node-insertion
  9163. function watchForRender(node, handler) {
  9164. var expando = node[EXPANDO_KEY] || (node[EXPANDO_KEY] = {});
  9165. var proxy = expando.renderProxy = function(e) {
  9166. if (e.animationName === CSS_RENDER_ANIMATION) {
  9167. handler();
  9168. }
  9169. };
  9170. helpers$1.each(ANIMATION_START_EVENTS, function(type) {
  9171. addListener(node, type, proxy);
  9172. });
  9173. // #4737: Chrome might skip the CSS animation when the CSS_RENDER_MONITOR class
  9174. // is removed then added back immediately (same animation frame?). Accessing the
  9175. // `offsetParent` property will force a reflow and re-evaluate the CSS animation.
  9176. // https://gist.github.com/paulirish/5d52fb081b3570c81e3a#box-metrics
  9177. // https://github.com/chartjs/Chart.js/issues/4737
  9178. expando.reflow = !!node.offsetParent;
  9179. node.classList.add(CSS_RENDER_MONITOR);
  9180. }
  9181. function unwatchForRender(node) {
  9182. var expando = node[EXPANDO_KEY] || {};
  9183. var proxy = expando.renderProxy;
  9184. if (proxy) {
  9185. helpers$1.each(ANIMATION_START_EVENTS, function(type) {
  9186. removeListener(node, type, proxy);
  9187. });
  9188. delete expando.renderProxy;
  9189. }
  9190. node.classList.remove(CSS_RENDER_MONITOR);
  9191. }
  9192. function addResizeListener(node, listener, chart) {
  9193. var expando = node[EXPANDO_KEY] || (node[EXPANDO_KEY] = {});
  9194. // Let's keep track of this added resizer and thus avoid DOM query when removing it.
  9195. var resizer = expando.resizer = createResizer(throttled(function() {
  9196. if (expando.resizer) {
  9197. var container = chart.options.maintainAspectRatio && node.parentNode;
  9198. var w = container ? container.clientWidth : 0;
  9199. listener(createEvent('resize', chart));
  9200. if (container && container.clientWidth < w && chart.canvas) {
  9201. // If the container size shrank during chart resize, let's assume
  9202. // scrollbar appeared. So we resize again with the scrollbar visible -
  9203. // effectively making chart smaller and the scrollbar hidden again.
  9204. // Because we are inside `throttled`, and currently `ticking`, scroll
  9205. // events are ignored during this whole 2 resize process.
  9206. // If we assumed wrong and something else happened, we are resizing
  9207. // twice in a frame (potential performance issue)
  9208. listener(createEvent('resize', chart));
  9209. }
  9210. }
  9211. }));
  9212. // The resizer needs to be attached to the node parent, so we first need to be
  9213. // sure that `node` is attached to the DOM before injecting the resizer element.
  9214. watchForRender(node, function() {
  9215. if (expando.resizer) {
  9216. var container = node.parentNode;
  9217. if (container && container !== resizer.parentNode) {
  9218. container.insertBefore(resizer, container.firstChild);
  9219. }
  9220. // The container size might have changed, let's reset the resizer state.
  9221. resizer._reset();
  9222. }
  9223. });
  9224. }
  9225. function removeResizeListener(node) {
  9226. var expando = node[EXPANDO_KEY] || {};
  9227. var resizer = expando.resizer;
  9228. delete expando.resizer;
  9229. unwatchForRender(node);
  9230. if (resizer && resizer.parentNode) {
  9231. resizer.parentNode.removeChild(resizer);
  9232. }
  9233. }
  9234. /**
  9235. * Injects CSS styles inline if the styles are not already present.
  9236. * @param {HTMLDocument|ShadowRoot} rootNode - the node to contain the <style>.
  9237. * @param {string} css - the CSS to be injected.
  9238. */
  9239. function injectCSS(rootNode, css) {
  9240. // https://stackoverflow.com/q/3922139
  9241. var expando = rootNode[EXPANDO_KEY] || (rootNode[EXPANDO_KEY] = {});
  9242. if (!expando.containsStyles) {
  9243. expando.containsStyles = true;
  9244. css = '/* Chart.js */\n' + css;
  9245. var style = document.createElement('style');
  9246. style.setAttribute('type', 'text/css');
  9247. style.appendChild(document.createTextNode(css));
  9248. rootNode.appendChild(style);
  9249. }
  9250. }
  9251. var platform_dom$2 = {
  9252. /**
  9253. * When `true`, prevents the automatic injection of the stylesheet required to
  9254. * correctly detect when the chart is added to the DOM and then resized. This
  9255. * switch has been added to allow external stylesheet (`dist/Chart(.min)?.js`)
  9256. * to be manually imported to make this library compatible with any CSP.
  9257. * See https://github.com/chartjs/Chart.js/issues/5208
  9258. */
  9259. disableCSSInjection: false,
  9260. /**
  9261. * This property holds whether this platform is enabled for the current environment.
  9262. * Currently used by platform.js to select the proper implementation.
  9263. * @private
  9264. */
  9265. _enabled: typeof window !== 'undefined' && typeof document !== 'undefined',
  9266. /**
  9267. * Initializes resources that depend on platform options.
  9268. * @param {HTMLCanvasElement} canvas - The Canvas element.
  9269. * @private
  9270. */
  9271. _ensureLoaded: function(canvas) {
  9272. if (!this.disableCSSInjection) {
  9273. // If the canvas is in a shadow DOM, then the styles must also be inserted
  9274. // into the same shadow DOM.
  9275. // https://github.com/chartjs/Chart.js/issues/5763
  9276. var root = canvas.getRootNode ? canvas.getRootNode() : document;
  9277. var targetNode = root.host ? root : document.head;
  9278. injectCSS(targetNode, stylesheet);
  9279. }
  9280. },
  9281. acquireContext: function(item, config) {
  9282. if (typeof item === 'string') {
  9283. item = document.getElementById(item);
  9284. } else if (item.length) {
  9285. // Support for array based queries (such as jQuery)
  9286. item = item[0];
  9287. }
  9288. if (item && item.canvas) {
  9289. // Support for any object associated to a canvas (including a context2d)
  9290. item = item.canvas;
  9291. }
  9292. // To prevent canvas fingerprinting, some add-ons undefine the getContext
  9293. // method, for example: https://github.com/kkapsner/CanvasBlocker
  9294. // https://github.com/chartjs/Chart.js/issues/2807
  9295. var context = item && item.getContext && item.getContext('2d');
  9296. // `instanceof HTMLCanvasElement/CanvasRenderingContext2D` fails when the item is
  9297. // inside an iframe or when running in a protected environment. We could guess the
  9298. // types from their toString() value but let's keep things flexible and assume it's
  9299. // a sufficient condition if the item has a context2D which has item as `canvas`.
  9300. // https://github.com/chartjs/Chart.js/issues/3887
  9301. // https://github.com/chartjs/Chart.js/issues/4102
  9302. // https://github.com/chartjs/Chart.js/issues/4152
  9303. if (context && context.canvas === item) {
  9304. // Load platform resources on first chart creation, to make it possible to
  9305. // import the library before setting platform options.
  9306. this._ensureLoaded(item);
  9307. initCanvas(item, config);
  9308. return context;
  9309. }
  9310. return null;
  9311. },
  9312. releaseContext: function(context) {
  9313. var canvas = context.canvas;
  9314. if (!canvas[EXPANDO_KEY]) {
  9315. return;
  9316. }
  9317. var initial = canvas[EXPANDO_KEY].initial;
  9318. ['height', 'width'].forEach(function(prop) {
  9319. var value = initial[prop];
  9320. if (helpers$1.isNullOrUndef(value)) {
  9321. canvas.removeAttribute(prop);
  9322. } else {
  9323. canvas.setAttribute(prop, value);
  9324. }
  9325. });
  9326. helpers$1.each(initial.style || {}, function(value, key) {
  9327. canvas.style[key] = value;
  9328. });
  9329. // The canvas render size might have been changed (and thus the state stack discarded),
  9330. // we can't use save() and restore() to restore the initial state. So make sure that at
  9331. // least the canvas context is reset to the default state by setting the canvas width.
  9332. // https://www.w3.org/TR/2011/WD-html5-20110525/the-canvas-element.html
  9333. // eslint-disable-next-line no-self-assign
  9334. canvas.width = canvas.width;
  9335. delete canvas[EXPANDO_KEY];
  9336. },
  9337. addEventListener: function(chart, type, listener) {
  9338. var canvas = chart.canvas;
  9339. if (type === 'resize') {
  9340. // Note: the resize event is not supported on all browsers.
  9341. addResizeListener(canvas, listener, chart);
  9342. return;
  9343. }
  9344. var expando = listener[EXPANDO_KEY] || (listener[EXPANDO_KEY] = {});
  9345. var proxies = expando.proxies || (expando.proxies = {});
  9346. var proxy = proxies[chart.id + '_' + type] = function(event) {
  9347. listener(fromNativeEvent(event, chart));
  9348. };
  9349. addListener(canvas, type, proxy);
  9350. },
  9351. removeEventListener: function(chart, type, listener) {
  9352. var canvas = chart.canvas;
  9353. if (type === 'resize') {
  9354. // Note: the resize event is not supported on all browsers.
  9355. removeResizeListener(canvas);
  9356. return;
  9357. }
  9358. var expando = listener[EXPANDO_KEY] || {};
  9359. var proxies = expando.proxies || {};
  9360. var proxy = proxies[chart.id + '_' + type];
  9361. if (!proxy) {
  9362. return;
  9363. }
  9364. removeListener(canvas, type, proxy);
  9365. }
  9366. };
  9367. // DEPRECATIONS
  9368. /**
  9369. * Provided for backward compatibility, use EventTarget.addEventListener instead.
  9370. * EventTarget.addEventListener compatibility: Chrome, Opera 7, Safari, FF1.5+, IE9+
  9371. * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
  9372. * @function Chart.helpers.addEvent
  9373. * @deprecated since version 2.7.0
  9374. * @todo remove at version 3
  9375. * @private
  9376. */
  9377. helpers$1.addEvent = addListener;
  9378. /**
  9379. * Provided for backward compatibility, use EventTarget.removeEventListener instead.
  9380. * EventTarget.removeEventListener compatibility: Chrome, Opera 7, Safari, FF1.5+, IE9+
  9381. * @see https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/removeEventListener
  9382. * @function Chart.helpers.removeEvent
  9383. * @deprecated since version 2.7.0
  9384. * @todo remove at version 3
  9385. * @private
  9386. */
  9387. helpers$1.removeEvent = removeListener;
  9388. // @TODO Make possible to select another platform at build time.
  9389. var implementation = platform_dom$2._enabled ? platform_dom$2 : platform_basic;
  9390. /**
  9391. * @namespace Chart.platform
  9392. * @see https://chartjs.gitbooks.io/proposals/content/Platform.html
  9393. * @since 2.4.0
  9394. */
  9395. var platform = helpers$1.extend({
  9396. /**
  9397. * @since 2.7.0
  9398. */
  9399. initialize: function() {},
  9400. /**
  9401. * Called at chart construction time, returns a context2d instance implementing
  9402. * the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}.
  9403. * @param {*} item - The native item from which to acquire context (platform specific)
  9404. * @param {object} options - The chart options
  9405. * @returns {CanvasRenderingContext2D} context2d instance
  9406. */
  9407. acquireContext: function() {},
  9408. /**
  9409. * Called at chart destruction time, releases any resources associated to the context
  9410. * previously returned by the acquireContext() method.
  9411. * @param {CanvasRenderingContext2D} context - The context2d instance
  9412. * @returns {boolean} true if the method succeeded, else false
  9413. */
  9414. releaseContext: function() {},
  9415. /**
  9416. * Registers the specified listener on the given chart.
  9417. * @param {Chart} chart - Chart from which to listen for event
  9418. * @param {string} type - The ({@link IEvent}) type to listen for
  9419. * @param {function} listener - Receives a notification (an object that implements
  9420. * the {@link IEvent} interface) when an event of the specified type occurs.
  9421. */
  9422. addEventListener: function() {},
  9423. /**
  9424. * Removes the specified listener previously registered with addEventListener.
  9425. * @param {Chart} chart - Chart from which to remove the listener
  9426. * @param {string} type - The ({@link IEvent}) type to remove
  9427. * @param {function} listener - The listener function to remove from the event target.
  9428. */
  9429. removeEventListener: function() {}
  9430. }, implementation);
  9431. core_defaults._set('global', {
  9432. plugins: {}
  9433. });
  9434. /**
  9435. * The plugin service singleton
  9436. * @namespace Chart.plugins
  9437. * @since 2.1.0
  9438. */
  9439. var core_plugins = {
  9440. /**
  9441. * Globally registered plugins.
  9442. * @private
  9443. */
  9444. _plugins: [],
  9445. /**
  9446. * This identifier is used to invalidate the descriptors cache attached to each chart
  9447. * when a global plugin is registered or unregistered. In this case, the cache ID is
  9448. * incremented and descriptors are regenerated during following API calls.
  9449. * @private
  9450. */
  9451. _cacheId: 0,
  9452. /**
  9453. * Registers the given plugin(s) if not already registered.
  9454. * @param {IPlugin[]|IPlugin} plugins plugin instance(s).
  9455. */
  9456. register: function(plugins) {
  9457. var p = this._plugins;
  9458. ([]).concat(plugins).forEach(function(plugin) {
  9459. if (p.indexOf(plugin) === -1) {
  9460. p.push(plugin);
  9461. }
  9462. });
  9463. this._cacheId++;
  9464. },
  9465. /**
  9466. * Unregisters the given plugin(s) only if registered.
  9467. * @param {IPlugin[]|IPlugin} plugins plugin instance(s).
  9468. */
  9469. unregister: function(plugins) {
  9470. var p = this._plugins;
  9471. ([]).concat(plugins).forEach(function(plugin) {
  9472. var idx = p.indexOf(plugin);
  9473. if (idx !== -1) {
  9474. p.splice(idx, 1);
  9475. }
  9476. });
  9477. this._cacheId++;
  9478. },
  9479. /**
  9480. * Remove all registered plugins.
  9481. * @since 2.1.5
  9482. */
  9483. clear: function() {
  9484. this._plugins = [];
  9485. this._cacheId++;
  9486. },
  9487. /**
  9488. * Returns the number of registered plugins?
  9489. * @returns {number}
  9490. * @since 2.1.5
  9491. */
  9492. count: function() {
  9493. return this._plugins.length;
  9494. },
  9495. /**
  9496. * Returns all registered plugin instances.
  9497. * @returns {IPlugin[]} array of plugin objects.
  9498. * @since 2.1.5
  9499. */
  9500. getAll: function() {
  9501. return this._plugins;
  9502. },
  9503. /**
  9504. * Calls enabled plugins for `chart` on the specified hook and with the given args.
  9505. * This method immediately returns as soon as a plugin explicitly returns false. The
  9506. * returned value can be used, for instance, to interrupt the current action.
  9507. * @param {Chart} chart - The chart instance for which plugins should be called.
  9508. * @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').
  9509. * @param {Array} [args] - Extra arguments to apply to the hook call.
  9510. * @returns {boolean} false if any of the plugins return false, else returns true.
  9511. */
  9512. notify: function(chart, hook, args) {
  9513. var descriptors = this.descriptors(chart);
  9514. var ilen = descriptors.length;
  9515. var i, descriptor, plugin, params, method;
  9516. for (i = 0; i < ilen; ++i) {
  9517. descriptor = descriptors[i];
  9518. plugin = descriptor.plugin;
  9519. method = plugin[hook];
  9520. if (typeof method === 'function') {
  9521. params = [chart].concat(args || []);
  9522. params.push(descriptor.options);
  9523. if (method.apply(plugin, params) === false) {
  9524. return false;
  9525. }
  9526. }
  9527. }
  9528. return true;
  9529. },
  9530. /**
  9531. * Returns descriptors of enabled plugins for the given chart.
  9532. * @returns {object[]} [{ plugin, options }]
  9533. * @private
  9534. */
  9535. descriptors: function(chart) {
  9536. var cache = chart.$plugins || (chart.$plugins = {});
  9537. if (cache.id === this._cacheId) {
  9538. return cache.descriptors;
  9539. }
  9540. var plugins = [];
  9541. var descriptors = [];
  9542. var config = (chart && chart.config) || {};
  9543. var options = (config.options && config.options.plugins) || {};
  9544. this._plugins.concat(config.plugins || []).forEach(function(plugin) {
  9545. var idx = plugins.indexOf(plugin);
  9546. if (idx !== -1) {
  9547. return;
  9548. }
  9549. var id = plugin.id;
  9550. var opts = options[id];
  9551. if (opts === false) {
  9552. return;
  9553. }
  9554. if (opts === true) {
  9555. opts = helpers$1.clone(core_defaults.global.plugins[id]);
  9556. }
  9557. plugins.push(plugin);
  9558. descriptors.push({
  9559. plugin: plugin,
  9560. options: opts || {}
  9561. });
  9562. });
  9563. cache.descriptors = descriptors;
  9564. cache.id = this._cacheId;
  9565. return descriptors;
  9566. },
  9567. /**
  9568. * Invalidates cache for the given chart: descriptors hold a reference on plugin option,
  9569. * but in some cases, this reference can be changed by the user when updating options.
  9570. * https://github.com/chartjs/Chart.js/issues/5111#issuecomment-355934167
  9571. * @private
  9572. */
  9573. _invalidate: function(chart) {
  9574. delete chart.$plugins;
  9575. }
  9576. };
  9577. var core_scaleService = {
  9578. // Scale registration object. Extensions can register new scale types (such as log or DB scales) and then
  9579. // use the new chart options to grab the correct scale
  9580. constructors: {},
  9581. // Use a registration function so that we can move to an ES6 map when we no longer need to support
  9582. // old browsers
  9583. // Scale config defaults
  9584. defaults: {},
  9585. registerScaleType: function(type, scaleConstructor, scaleDefaults) {
  9586. this.constructors[type] = scaleConstructor;
  9587. this.defaults[type] = helpers$1.clone(scaleDefaults);
  9588. },
  9589. getScaleConstructor: function(type) {
  9590. return this.constructors.hasOwnProperty(type) ? this.constructors[type] : undefined;
  9591. },
  9592. getScaleDefaults: function(type) {
  9593. // Return the scale defaults merged with the global settings so that we always use the latest ones
  9594. return this.defaults.hasOwnProperty(type) ? helpers$1.merge(Object.create(null), [core_defaults.scale, this.defaults[type]]) : {};
  9595. },
  9596. updateScaleDefaults: function(type, additions) {
  9597. var me = this;
  9598. if (me.defaults.hasOwnProperty(type)) {
  9599. me.defaults[type] = helpers$1.extend(me.defaults[type], additions);
  9600. }
  9601. },
  9602. addScalesToLayout: function(chart) {
  9603. // Adds each scale to the chart.boxes array to be sized accordingly
  9604. helpers$1.each(chart.scales, function(scale) {
  9605. // Set ILayoutItem parameters for backwards compatibility
  9606. scale.fullWidth = scale.options.fullWidth;
  9607. scale.position = scale.options.position;
  9608. scale.weight = scale.options.weight;
  9609. core_layouts.addBox(chart, scale);
  9610. });
  9611. }
  9612. };
  9613. var valueOrDefault$8 = helpers$1.valueOrDefault;
  9614. var getRtlHelper = helpers$1.rtl.getRtlAdapter;
  9615. core_defaults._set('global', {
  9616. tooltips: {
  9617. enabled: true,
  9618. custom: null,
  9619. mode: 'nearest',
  9620. position: 'average',
  9621. intersect: true,
  9622. backgroundColor: 'rgba(0,0,0,0.8)',
  9623. titleFontStyle: 'bold',
  9624. titleSpacing: 2,
  9625. titleMarginBottom: 6,
  9626. titleFontColor: '#fff',
  9627. titleAlign: 'left',
  9628. bodySpacing: 2,
  9629. bodyFontColor: '#fff',
  9630. bodyAlign: 'left',
  9631. footerFontStyle: 'bold',
  9632. footerSpacing: 2,
  9633. footerMarginTop: 6,
  9634. footerFontColor: '#fff',
  9635. footerAlign: 'left',
  9636. yPadding: 6,
  9637. xPadding: 6,
  9638. caretPadding: 2,
  9639. caretSize: 5,
  9640. cornerRadius: 6,
  9641. multiKeyBackground: '#fff',
  9642. displayColors: true,
  9643. borderColor: 'rgba(0,0,0,0)',
  9644. borderWidth: 0,
  9645. callbacks: {
  9646. // Args are: (tooltipItems, data)
  9647. beforeTitle: helpers$1.noop,
  9648. title: function(tooltipItems, data) {
  9649. var title = '';
  9650. var labels = data.labels;
  9651. var labelCount = labels ? labels.length : 0;
  9652. if (tooltipItems.length > 0) {
  9653. var item = tooltipItems[0];
  9654. if (item.label) {
  9655. title = item.label;
  9656. } else if (item.xLabel) {
  9657. title = item.xLabel;
  9658. } else if (labelCount > 0 && item.index < labelCount) {
  9659. title = labels[item.index];
  9660. }
  9661. }
  9662. return title;
  9663. },
  9664. afterTitle: helpers$1.noop,
  9665. // Args are: (tooltipItems, data)
  9666. beforeBody: helpers$1.noop,
  9667. // Args are: (tooltipItem, data)
  9668. beforeLabel: helpers$1.noop,
  9669. label: function(tooltipItem, data) {
  9670. var label = data.datasets[tooltipItem.datasetIndex].label || '';
  9671. if (label) {
  9672. label += ': ';
  9673. }
  9674. if (!helpers$1.isNullOrUndef(tooltipItem.value)) {
  9675. label += tooltipItem.value;
  9676. } else {
  9677. label += tooltipItem.yLabel;
  9678. }
  9679. return label;
  9680. },
  9681. labelColor: function(tooltipItem, chart) {
  9682. var meta = chart.getDatasetMeta(tooltipItem.datasetIndex);
  9683. var activeElement = meta.data[tooltipItem.index];
  9684. var view = activeElement._view;
  9685. return {
  9686. borderColor: view.borderColor,
  9687. backgroundColor: view.backgroundColor
  9688. };
  9689. },
  9690. labelTextColor: function() {
  9691. return this._options.bodyFontColor;
  9692. },
  9693. afterLabel: helpers$1.noop,
  9694. // Args are: (tooltipItems, data)
  9695. afterBody: helpers$1.noop,
  9696. // Args are: (tooltipItems, data)
  9697. beforeFooter: helpers$1.noop,
  9698. footer: helpers$1.noop,
  9699. afterFooter: helpers$1.noop
  9700. }
  9701. }
  9702. });
  9703. var positioners = {
  9704. /**
  9705. * Average mode places the tooltip at the average position of the elements shown
  9706. * @function Chart.Tooltip.positioners.average
  9707. * @param elements {ChartElement[]} the elements being displayed in the tooltip
  9708. * @returns {object} tooltip position
  9709. */
  9710. average: function(elements) {
  9711. if (!elements.length) {
  9712. return false;
  9713. }
  9714. var i, len;
  9715. var x = 0;
  9716. var y = 0;
  9717. var count = 0;
  9718. for (i = 0, len = elements.length; i < len; ++i) {
  9719. var el = elements[i];
  9720. if (el && el.hasValue()) {
  9721. var pos = el.tooltipPosition();
  9722. x += pos.x;
  9723. y += pos.y;
  9724. ++count;
  9725. }
  9726. }
  9727. return {
  9728. x: x / count,
  9729. y: y / count
  9730. };
  9731. },
  9732. /**
  9733. * Gets the tooltip position nearest of the item nearest to the event position
  9734. * @function Chart.Tooltip.positioners.nearest
  9735. * @param elements {Chart.Element[]} the tooltip elements
  9736. * @param eventPosition {object} the position of the event in canvas coordinates
  9737. * @returns {object} the tooltip position
  9738. */
  9739. nearest: function(elements, eventPosition) {
  9740. var x = eventPosition.x;
  9741. var y = eventPosition.y;
  9742. var minDistance = Number.POSITIVE_INFINITY;
  9743. var i, len, nearestElement;
  9744. for (i = 0, len = elements.length; i < len; ++i) {
  9745. var el = elements[i];
  9746. if (el && el.hasValue()) {
  9747. var center = el.getCenterPoint();
  9748. var d = helpers$1.distanceBetweenPoints(eventPosition, center);
  9749. if (d < minDistance) {
  9750. minDistance = d;
  9751. nearestElement = el;
  9752. }
  9753. }
  9754. }
  9755. if (nearestElement) {
  9756. var tp = nearestElement.tooltipPosition();
  9757. x = tp.x;
  9758. y = tp.y;
  9759. }
  9760. return {
  9761. x: x,
  9762. y: y
  9763. };
  9764. }
  9765. };
  9766. // Helper to push or concat based on if the 2nd parameter is an array or not
  9767. function pushOrConcat(base, toPush) {
  9768. if (toPush) {
  9769. if (helpers$1.isArray(toPush)) {
  9770. // base = base.concat(toPush);
  9771. Array.prototype.push.apply(base, toPush);
  9772. } else {
  9773. base.push(toPush);
  9774. }
  9775. }
  9776. return base;
  9777. }
  9778. /**
  9779. * Returns array of strings split by newline
  9780. * @param {string} value - The value to split by newline.
  9781. * @returns {string[]} value if newline present - Returned from String split() method
  9782. * @function
  9783. */
  9784. function splitNewlines(str) {
  9785. if ((typeof str === 'string' || str instanceof String) && str.indexOf('\n') > -1) {
  9786. return str.split('\n');
  9787. }
  9788. return str;
  9789. }
  9790. /**
  9791. * Private helper to create a tooltip item model
  9792. * @param element - the chart element (point, arc, bar) to create the tooltip item for
  9793. * @return new tooltip item
  9794. */
  9795. function createTooltipItem(element) {
  9796. var xScale = element._xScale;
  9797. var yScale = element._yScale || element._scale; // handle radar || polarArea charts
  9798. var index = element._index;
  9799. var datasetIndex = element._datasetIndex;
  9800. var controller = element._chart.getDatasetMeta(datasetIndex).controller;
  9801. var indexScale = controller._getIndexScale();
  9802. var valueScale = controller._getValueScale();
  9803. return {
  9804. xLabel: xScale ? xScale.getLabelForIndex(index, datasetIndex) : '',
  9805. yLabel: yScale ? yScale.getLabelForIndex(index, datasetIndex) : '',
  9806. label: indexScale ? '' + indexScale.getLabelForIndex(index, datasetIndex) : '',
  9807. value: valueScale ? '' + valueScale.getLabelForIndex(index, datasetIndex) : '',
  9808. index: index,
  9809. datasetIndex: datasetIndex,
  9810. x: element._model.x,
  9811. y: element._model.y
  9812. };
  9813. }
  9814. /**
  9815. * Helper to get the reset model for the tooltip
  9816. * @param tooltipOpts {object} the tooltip options
  9817. */
  9818. function getBaseModel(tooltipOpts) {
  9819. var globalDefaults = core_defaults.global;
  9820. return {
  9821. // Positioning
  9822. xPadding: tooltipOpts.xPadding,
  9823. yPadding: tooltipOpts.yPadding,
  9824. xAlign: tooltipOpts.xAlign,
  9825. yAlign: tooltipOpts.yAlign,
  9826. // Drawing direction and text direction
  9827. rtl: tooltipOpts.rtl,
  9828. textDirection: tooltipOpts.textDirection,
  9829. // Body
  9830. bodyFontColor: tooltipOpts.bodyFontColor,
  9831. _bodyFontFamily: valueOrDefault$8(tooltipOpts.bodyFontFamily, globalDefaults.defaultFontFamily),
  9832. _bodyFontStyle: valueOrDefault$8(tooltipOpts.bodyFontStyle, globalDefaults.defaultFontStyle),
  9833. _bodyAlign: tooltipOpts.bodyAlign,
  9834. bodyFontSize: valueOrDefault$8(tooltipOpts.bodyFontSize, globalDefaults.defaultFontSize),
  9835. bodySpacing: tooltipOpts.bodySpacing,
  9836. // Title
  9837. titleFontColor: tooltipOpts.titleFontColor,
  9838. _titleFontFamily: valueOrDefault$8(tooltipOpts.titleFontFamily, globalDefaults.defaultFontFamily),
  9839. _titleFontStyle: valueOrDefault$8(tooltipOpts.titleFontStyle, globalDefaults.defaultFontStyle),
  9840. titleFontSize: valueOrDefault$8(tooltipOpts.titleFontSize, globalDefaults.defaultFontSize),
  9841. _titleAlign: tooltipOpts.titleAlign,
  9842. titleSpacing: tooltipOpts.titleSpacing,
  9843. titleMarginBottom: tooltipOpts.titleMarginBottom,
  9844. // Footer
  9845. footerFontColor: tooltipOpts.footerFontColor,
  9846. _footerFontFamily: valueOrDefault$8(tooltipOpts.footerFontFamily, globalDefaults.defaultFontFamily),
  9847. _footerFontStyle: valueOrDefault$8(tooltipOpts.footerFontStyle, globalDefaults.defaultFontStyle),
  9848. footerFontSize: valueOrDefault$8(tooltipOpts.footerFontSize, globalDefaults.defaultFontSize),
  9849. _footerAlign: tooltipOpts.footerAlign,
  9850. footerSpacing: tooltipOpts.footerSpacing,
  9851. footerMarginTop: tooltipOpts.footerMarginTop,
  9852. // Appearance
  9853. caretSize: tooltipOpts.caretSize,
  9854. cornerRadius: tooltipOpts.cornerRadius,
  9855. backgroundColor: tooltipOpts.backgroundColor,
  9856. opacity: 0,
  9857. legendColorBackground: tooltipOpts.multiKeyBackground,
  9858. displayColors: tooltipOpts.displayColors,
  9859. borderColor: tooltipOpts.borderColor,
  9860. borderWidth: tooltipOpts.borderWidth
  9861. };
  9862. }
  9863. /**
  9864. * Get the size of the tooltip
  9865. */
  9866. function getTooltipSize(tooltip, model) {
  9867. var ctx = tooltip._chart.ctx;
  9868. var height = model.yPadding * 2; // Tooltip Padding
  9869. var width = 0;
  9870. // Count of all lines in the body
  9871. var body = model.body;
  9872. var combinedBodyLength = body.reduce(function(count, bodyItem) {
  9873. return count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length;
  9874. }, 0);
  9875. combinedBodyLength += model.beforeBody.length + model.afterBody.length;
  9876. var titleLineCount = model.title.length;
  9877. var footerLineCount = model.footer.length;
  9878. var titleFontSize = model.titleFontSize;
  9879. var bodyFontSize = model.bodyFontSize;
  9880. var footerFontSize = model.footerFontSize;
  9881. height += titleLineCount * titleFontSize; // Title Lines
  9882. height += titleLineCount ? (titleLineCount - 1) * model.titleSpacing : 0; // Title Line Spacing
  9883. height += titleLineCount ? model.titleMarginBottom : 0; // Title's bottom Margin
  9884. height += combinedBodyLength * bodyFontSize; // Body Lines
  9885. height += combinedBodyLength ? (combinedBodyLength - 1) * model.bodySpacing : 0; // Body Line Spacing
  9886. height += footerLineCount ? model.footerMarginTop : 0; // Footer Margin
  9887. height += footerLineCount * (footerFontSize); // Footer Lines
  9888. height += footerLineCount ? (footerLineCount - 1) * model.footerSpacing : 0; // Footer Line Spacing
  9889. // Title width
  9890. var widthPadding = 0;
  9891. var maxLineWidth = function(line) {
  9892. width = Math.max(width, ctx.measureText(line).width + widthPadding);
  9893. };
  9894. ctx.font = helpers$1.fontString(titleFontSize, model._titleFontStyle, model._titleFontFamily);
  9895. helpers$1.each(model.title, maxLineWidth);
  9896. // Body width
  9897. ctx.font = helpers$1.fontString(bodyFontSize, model._bodyFontStyle, model._bodyFontFamily);
  9898. helpers$1.each(model.beforeBody.concat(model.afterBody), maxLineWidth);
  9899. // Body lines may include some extra width due to the color box
  9900. widthPadding = model.displayColors ? (bodyFontSize + 2) : 0;
  9901. helpers$1.each(body, function(bodyItem) {
  9902. helpers$1.each(bodyItem.before, maxLineWidth);
  9903. helpers$1.each(bodyItem.lines, maxLineWidth);
  9904. helpers$1.each(bodyItem.after, maxLineWidth);
  9905. });
  9906. // Reset back to 0
  9907. widthPadding = 0;
  9908. // Footer width
  9909. ctx.font = helpers$1.fontString(footerFontSize, model._footerFontStyle, model._footerFontFamily);
  9910. helpers$1.each(model.footer, maxLineWidth);
  9911. // Add padding
  9912. width += 2 * model.xPadding;
  9913. return {
  9914. width: width,
  9915. height: height
  9916. };
  9917. }
  9918. /**
  9919. * Helper to get the alignment of a tooltip given the size
  9920. */
  9921. function determineAlignment(tooltip, size) {
  9922. var model = tooltip._model;
  9923. var chart = tooltip._chart;
  9924. var chartArea = tooltip._chart.chartArea;
  9925. var xAlign = 'center';
  9926. var yAlign = 'center';
  9927. if (model.y < size.height) {
  9928. yAlign = 'top';
  9929. } else if (model.y > (chart.height - size.height)) {
  9930. yAlign = 'bottom';
  9931. }
  9932. var lf, rf; // functions to determine left, right alignment
  9933. var olf, orf; // functions to determine if left/right alignment causes tooltip to go outside chart
  9934. var yf; // function to get the y alignment if the tooltip goes outside of the left or right edges
  9935. var midX = (chartArea.left + chartArea.right) / 2;
  9936. var midY = (chartArea.top + chartArea.bottom) / 2;
  9937. if (yAlign === 'center') {
  9938. lf = function(x) {
  9939. return x <= midX;
  9940. };
  9941. rf = function(x) {
  9942. return x > midX;
  9943. };
  9944. } else {
  9945. lf = function(x) {
  9946. return x <= (size.width / 2);
  9947. };
  9948. rf = function(x) {
  9949. return x >= (chart.width - (size.width / 2));
  9950. };
  9951. }
  9952. olf = function(x) {
  9953. return x + size.width + model.caretSize + model.caretPadding > chart.width;
  9954. };
  9955. orf = function(x) {
  9956. return x - size.width - model.caretSize - model.caretPadding < 0;
  9957. };
  9958. yf = function(y) {
  9959. return y <= midY ? 'top' : 'bottom';
  9960. };
  9961. if (lf(model.x)) {
  9962. xAlign = 'left';
  9963. // Is tooltip too wide and goes over the right side of the chart.?
  9964. if (olf(model.x)) {
  9965. xAlign = 'center';
  9966. yAlign = yf(model.y);
  9967. }
  9968. } else if (rf(model.x)) {
  9969. xAlign = 'right';
  9970. // Is tooltip too wide and goes outside left edge of canvas?
  9971. if (orf(model.x)) {
  9972. xAlign = 'center';
  9973. yAlign = yf(model.y);
  9974. }
  9975. }
  9976. var opts = tooltip._options;
  9977. return {
  9978. xAlign: opts.xAlign ? opts.xAlign : xAlign,
  9979. yAlign: opts.yAlign ? opts.yAlign : yAlign
  9980. };
  9981. }
  9982. /**
  9983. * Helper to get the location a tooltip needs to be placed at given the initial position (via the vm) and the size and alignment
  9984. */
  9985. function getBackgroundPoint(vm, size, alignment, chart) {
  9986. // Background Position
  9987. var x = vm.x;
  9988. var y = vm.y;
  9989. var caretSize = vm.caretSize;
  9990. var caretPadding = vm.caretPadding;
  9991. var cornerRadius = vm.cornerRadius;
  9992. var xAlign = alignment.xAlign;
  9993. var yAlign = alignment.yAlign;
  9994. var paddingAndSize = caretSize + caretPadding;
  9995. var radiusAndPadding = cornerRadius + caretPadding;
  9996. if (xAlign === 'right') {
  9997. x -= size.width;
  9998. } else if (xAlign === 'center') {
  9999. x -= (size.width / 2);
  10000. if (x + size.width > chart.width) {
  10001. x = chart.width - size.width;
  10002. }
  10003. if (x < 0) {
  10004. x = 0;
  10005. }
  10006. }
  10007. if (yAlign === 'top') {
  10008. y += paddingAndSize;
  10009. } else if (yAlign === 'bottom') {
  10010. y -= size.height + paddingAndSize;
  10011. } else {
  10012. y -= (size.height / 2);
  10013. }
  10014. if (yAlign === 'center') {
  10015. if (xAlign === 'left') {
  10016. x += paddingAndSize;
  10017. } else if (xAlign === 'right') {
  10018. x -= paddingAndSize;
  10019. }
  10020. } else if (xAlign === 'left') {
  10021. x -= radiusAndPadding;
  10022. } else if (xAlign === 'right') {
  10023. x += radiusAndPadding;
  10024. }
  10025. return {
  10026. x: x,
  10027. y: y
  10028. };
  10029. }
  10030. function getAlignedX(vm, align) {
  10031. return align === 'center'
  10032. ? vm.x + vm.width / 2
  10033. : align === 'right'
  10034. ? vm.x + vm.width - vm.xPadding
  10035. : vm.x + vm.xPadding;
  10036. }
  10037. /**
  10038. * Helper to build before and after body lines
  10039. */
  10040. function getBeforeAfterBodyLines(callback) {
  10041. return pushOrConcat([], splitNewlines(callback));
  10042. }
  10043. var exports$4 = core_element.extend({
  10044. initialize: function() {
  10045. this._model = getBaseModel(this._options);
  10046. this._lastActive = [];
  10047. },
  10048. // Get the title
  10049. // Args are: (tooltipItem, data)
  10050. getTitle: function() {
  10051. var me = this;
  10052. var opts = me._options;
  10053. var callbacks = opts.callbacks;
  10054. var beforeTitle = callbacks.beforeTitle.apply(me, arguments);
  10055. var title = callbacks.title.apply(me, arguments);
  10056. var afterTitle = callbacks.afterTitle.apply(me, arguments);
  10057. var lines = [];
  10058. lines = pushOrConcat(lines, splitNewlines(beforeTitle));
  10059. lines = pushOrConcat(lines, splitNewlines(title));
  10060. lines = pushOrConcat(lines, splitNewlines(afterTitle));
  10061. return lines;
  10062. },
  10063. // Args are: (tooltipItem, data)
  10064. getBeforeBody: function() {
  10065. return getBeforeAfterBodyLines(this._options.callbacks.beforeBody.apply(this, arguments));
  10066. },
  10067. // Args are: (tooltipItem, data)
  10068. getBody: function(tooltipItems, data) {
  10069. var me = this;
  10070. var callbacks = me._options.callbacks;
  10071. var bodyItems = [];
  10072. helpers$1.each(tooltipItems, function(tooltipItem) {
  10073. var bodyItem = {
  10074. before: [],
  10075. lines: [],
  10076. after: []
  10077. };
  10078. pushOrConcat(bodyItem.before, splitNewlines(callbacks.beforeLabel.call(me, tooltipItem, data)));
  10079. pushOrConcat(bodyItem.lines, callbacks.label.call(me, tooltipItem, data));
  10080. pushOrConcat(bodyItem.after, splitNewlines(callbacks.afterLabel.call(me, tooltipItem, data)));
  10081. bodyItems.push(bodyItem);
  10082. });
  10083. return bodyItems;
  10084. },
  10085. // Args are: (tooltipItem, data)
  10086. getAfterBody: function() {
  10087. return getBeforeAfterBodyLines(this._options.callbacks.afterBody.apply(this, arguments));
  10088. },
  10089. // Get the footer and beforeFooter and afterFooter lines
  10090. // Args are: (tooltipItem, data)
  10091. getFooter: function() {
  10092. var me = this;
  10093. var callbacks = me._options.callbacks;
  10094. var beforeFooter = callbacks.beforeFooter.apply(me, arguments);
  10095. var footer = callbacks.footer.apply(me, arguments);
  10096. var afterFooter = callbacks.afterFooter.apply(me, arguments);
  10097. var lines = [];
  10098. lines = pushOrConcat(lines, splitNewlines(beforeFooter));
  10099. lines = pushOrConcat(lines, splitNewlines(footer));
  10100. lines = pushOrConcat(lines, splitNewlines(afterFooter));
  10101. return lines;
  10102. },
  10103. update: function(changed) {
  10104. var me = this;
  10105. var opts = me._options;
  10106. // Need to regenerate the model because its faster than using extend and it is necessary due to the optimization in Chart.Element.transition
  10107. // that does _view = _model if ease === 1. This causes the 2nd tooltip update to set properties in both the view and model at the same time
  10108. // which breaks any animations.
  10109. var existingModel = me._model;
  10110. var model = me._model = getBaseModel(opts);
  10111. var active = me._active;
  10112. var data = me._data;
  10113. // In the case where active.length === 0 we need to keep these at existing values for good animations
  10114. var alignment = {
  10115. xAlign: existingModel.xAlign,
  10116. yAlign: existingModel.yAlign
  10117. };
  10118. var backgroundPoint = {
  10119. x: existingModel.x,
  10120. y: existingModel.y
  10121. };
  10122. var tooltipSize = {
  10123. width: existingModel.width,
  10124. height: existingModel.height
  10125. };
  10126. var tooltipPosition = {
  10127. x: existingModel.caretX,
  10128. y: existingModel.caretY
  10129. };
  10130. var i, len;
  10131. if (active.length) {
  10132. model.opacity = 1;
  10133. var labelColors = [];
  10134. var labelTextColors = [];
  10135. tooltipPosition = positioners[opts.position].call(me, active, me._eventPosition);
  10136. var tooltipItems = [];
  10137. for (i = 0, len = active.length; i < len; ++i) {
  10138. tooltipItems.push(createTooltipItem(active[i]));
  10139. }
  10140. // If the user provided a filter function, use it to modify the tooltip items
  10141. if (opts.filter) {
  10142. tooltipItems = tooltipItems.filter(function(a) {
  10143. return opts.filter(a, data);
  10144. });
  10145. }
  10146. // If the user provided a sorting function, use it to modify the tooltip items
  10147. if (opts.itemSort) {
  10148. tooltipItems = tooltipItems.sort(function(a, b) {
  10149. return opts.itemSort(a, b, data);
  10150. });
  10151. }
  10152. // Determine colors for boxes
  10153. helpers$1.each(tooltipItems, function(tooltipItem) {
  10154. labelColors.push(opts.callbacks.labelColor.call(me, tooltipItem, me._chart));
  10155. labelTextColors.push(opts.callbacks.labelTextColor.call(me, tooltipItem, me._chart));
  10156. });
  10157. // Build the Text Lines
  10158. model.title = me.getTitle(tooltipItems, data);
  10159. model.beforeBody = me.getBeforeBody(tooltipItems, data);
  10160. model.body = me.getBody(tooltipItems, data);
  10161. model.afterBody = me.getAfterBody(tooltipItems, data);
  10162. model.footer = me.getFooter(tooltipItems, data);
  10163. // Initial positioning and colors
  10164. model.x = tooltipPosition.x;
  10165. model.y = tooltipPosition.y;
  10166. model.caretPadding = opts.caretPadding;
  10167. model.labelColors = labelColors;
  10168. model.labelTextColors = labelTextColors;
  10169. // data points
  10170. model.dataPoints = tooltipItems;
  10171. // We need to determine alignment of the tooltip
  10172. tooltipSize = getTooltipSize(this, model);
  10173. alignment = determineAlignment(this, tooltipSize);
  10174. // Final Size and Position
  10175. backgroundPoint = getBackgroundPoint(model, tooltipSize, alignment, me._chart);
  10176. } else {
  10177. model.opacity = 0;
  10178. }
  10179. model.xAlign = alignment.xAlign;
  10180. model.yAlign = alignment.yAlign;
  10181. model.x = backgroundPoint.x;
  10182. model.y = backgroundPoint.y;
  10183. model.width = tooltipSize.width;
  10184. model.height = tooltipSize.height;
  10185. // Point where the caret on the tooltip points to
  10186. model.caretX = tooltipPosition.x;
  10187. model.caretY = tooltipPosition.y;
  10188. me._model = model;
  10189. if (changed && opts.custom) {
  10190. opts.custom.call(me, model);
  10191. }
  10192. return me;
  10193. },
  10194. drawCaret: function(tooltipPoint, size) {
  10195. var ctx = this._chart.ctx;
  10196. var vm = this._view;
  10197. var caretPosition = this.getCaretPosition(tooltipPoint, size, vm);
  10198. ctx.lineTo(caretPosition.x1, caretPosition.y1);
  10199. ctx.lineTo(caretPosition.x2, caretPosition.y2);
  10200. ctx.lineTo(caretPosition.x3, caretPosition.y3);
  10201. },
  10202. getCaretPosition: function(tooltipPoint, size, vm) {
  10203. var x1, x2, x3, y1, y2, y3;
  10204. var caretSize = vm.caretSize;
  10205. var cornerRadius = vm.cornerRadius;
  10206. var xAlign = vm.xAlign;
  10207. var yAlign = vm.yAlign;
  10208. var ptX = tooltipPoint.x;
  10209. var ptY = tooltipPoint.y;
  10210. var width = size.width;
  10211. var height = size.height;
  10212. if (yAlign === 'center') {
  10213. y2 = ptY + (height / 2);
  10214. if (xAlign === 'left') {
  10215. x1 = ptX;
  10216. x2 = x1 - caretSize;
  10217. x3 = x1;
  10218. y1 = y2 + caretSize;
  10219. y3 = y2 - caretSize;
  10220. } else {
  10221. x1 = ptX + width;
  10222. x2 = x1 + caretSize;
  10223. x3 = x1;
  10224. y1 = y2 - caretSize;
  10225. y3 = y2 + caretSize;
  10226. }
  10227. } else {
  10228. if (xAlign === 'left') {
  10229. x2 = ptX + cornerRadius + (caretSize);
  10230. x1 = x2 - caretSize;
  10231. x3 = x2 + caretSize;
  10232. } else if (xAlign === 'right') {
  10233. x2 = ptX + width - cornerRadius - caretSize;
  10234. x1 = x2 - caretSize;
  10235. x3 = x2 + caretSize;
  10236. } else {
  10237. x2 = vm.caretX;
  10238. x1 = x2 - caretSize;
  10239. x3 = x2 + caretSize;
  10240. }
  10241. if (yAlign === 'top') {
  10242. y1 = ptY;
  10243. y2 = y1 - caretSize;
  10244. y3 = y1;
  10245. } else {
  10246. y1 = ptY + height;
  10247. y2 = y1 + caretSize;
  10248. y3 = y1;
  10249. // invert drawing order
  10250. var tmp = x3;
  10251. x3 = x1;
  10252. x1 = tmp;
  10253. }
  10254. }
  10255. return {x1: x1, x2: x2, x3: x3, y1: y1, y2: y2, y3: y3};
  10256. },
  10257. drawTitle: function(pt, vm, ctx) {
  10258. var title = vm.title;
  10259. var length = title.length;
  10260. var titleFontSize, titleSpacing, i;
  10261. if (length) {
  10262. var rtlHelper = getRtlHelper(vm.rtl, vm.x, vm.width);
  10263. pt.x = getAlignedX(vm, vm._titleAlign);
  10264. ctx.textAlign = rtlHelper.textAlign(vm._titleAlign);
  10265. ctx.textBaseline = 'middle';
  10266. titleFontSize = vm.titleFontSize;
  10267. titleSpacing = vm.titleSpacing;
  10268. ctx.fillStyle = vm.titleFontColor;
  10269. ctx.font = helpers$1.fontString(titleFontSize, vm._titleFontStyle, vm._titleFontFamily);
  10270. for (i = 0; i < length; ++i) {
  10271. ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFontSize / 2);
  10272. pt.y += titleFontSize + titleSpacing; // Line Height and spacing
  10273. if (i + 1 === length) {
  10274. pt.y += vm.titleMarginBottom - titleSpacing; // If Last, add margin, remove spacing
  10275. }
  10276. }
  10277. }
  10278. },
  10279. drawBody: function(pt, vm, ctx) {
  10280. var bodyFontSize = vm.bodyFontSize;
  10281. var bodySpacing = vm.bodySpacing;
  10282. var bodyAlign = vm._bodyAlign;
  10283. var body = vm.body;
  10284. var drawColorBoxes = vm.displayColors;
  10285. var xLinePadding = 0;
  10286. var colorX = drawColorBoxes ? getAlignedX(vm, 'left') : 0;
  10287. var rtlHelper = getRtlHelper(vm.rtl, vm.x, vm.width);
  10288. var fillLineOfText = function(line) {
  10289. ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyFontSize / 2);
  10290. pt.y += bodyFontSize + bodySpacing;
  10291. };
  10292. var bodyItem, textColor, labelColors, lines, i, j, ilen, jlen;
  10293. var bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);
  10294. ctx.textAlign = bodyAlign;
  10295. ctx.textBaseline = 'middle';
  10296. ctx.font = helpers$1.fontString(bodyFontSize, vm._bodyFontStyle, vm._bodyFontFamily);
  10297. pt.x = getAlignedX(vm, bodyAlignForCalculation);
  10298. // Before body lines
  10299. ctx.fillStyle = vm.bodyFontColor;
  10300. helpers$1.each(vm.beforeBody, fillLineOfText);
  10301. xLinePadding = drawColorBoxes && bodyAlignForCalculation !== 'right'
  10302. ? bodyAlign === 'center' ? (bodyFontSize / 2 + 1) : (bodyFontSize + 2)
  10303. : 0;
  10304. // Draw body lines now
  10305. for (i = 0, ilen = body.length; i < ilen; ++i) {
  10306. bodyItem = body[i];
  10307. textColor = vm.labelTextColors[i];
  10308. labelColors = vm.labelColors[i];
  10309. ctx.fillStyle = textColor;
  10310. helpers$1.each(bodyItem.before, fillLineOfText);
  10311. lines = bodyItem.lines;
  10312. for (j = 0, jlen = lines.length; j < jlen; ++j) {
  10313. // Draw Legend-like boxes if needed
  10314. if (drawColorBoxes) {
  10315. var rtlColorX = rtlHelper.x(colorX);
  10316. // Fill a white rect so that colours merge nicely if the opacity is < 1
  10317. ctx.fillStyle = vm.legendColorBackground;
  10318. ctx.fillRect(rtlHelper.leftForLtr(rtlColorX, bodyFontSize), pt.y, bodyFontSize, bodyFontSize);
  10319. // Border
  10320. ctx.lineWidth = 1;
  10321. ctx.strokeStyle = labelColors.borderColor;
  10322. ctx.strokeRect(rtlHelper.leftForLtr(rtlColorX, bodyFontSize), pt.y, bodyFontSize, bodyFontSize);
  10323. // Inner square
  10324. ctx.fillStyle = labelColors.backgroundColor;
  10325. ctx.fillRect(rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), bodyFontSize - 2), pt.y + 1, bodyFontSize - 2, bodyFontSize - 2);
  10326. ctx.fillStyle = textColor;
  10327. }
  10328. fillLineOfText(lines[j]);
  10329. }
  10330. helpers$1.each(bodyItem.after, fillLineOfText);
  10331. }
  10332. // Reset back to 0 for after body
  10333. xLinePadding = 0;
  10334. // After body lines
  10335. helpers$1.each(vm.afterBody, fillLineOfText);
  10336. pt.y -= bodySpacing; // Remove last body spacing
  10337. },
  10338. drawFooter: function(pt, vm, ctx) {
  10339. var footer = vm.footer;
  10340. var length = footer.length;
  10341. var footerFontSize, i;
  10342. if (length) {
  10343. var rtlHelper = getRtlHelper(vm.rtl, vm.x, vm.width);
  10344. pt.x = getAlignedX(vm, vm._footerAlign);
  10345. pt.y += vm.footerMarginTop;
  10346. ctx.textAlign = rtlHelper.textAlign(vm._footerAlign);
  10347. ctx.textBaseline = 'middle';
  10348. footerFontSize = vm.footerFontSize;
  10349. ctx.fillStyle = vm.footerFontColor;
  10350. ctx.font = helpers$1.fontString(footerFontSize, vm._footerFontStyle, vm._footerFontFamily);
  10351. for (i = 0; i < length; ++i) {
  10352. ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFontSize / 2);
  10353. pt.y += footerFontSize + vm.footerSpacing;
  10354. }
  10355. }
  10356. },
  10357. drawBackground: function(pt, vm, ctx, tooltipSize) {
  10358. ctx.fillStyle = vm.backgroundColor;
  10359. ctx.strokeStyle = vm.borderColor;
  10360. ctx.lineWidth = vm.borderWidth;
  10361. var xAlign = vm.xAlign;
  10362. var yAlign = vm.yAlign;
  10363. var x = pt.x;
  10364. var y = pt.y;
  10365. var width = tooltipSize.width;
  10366. var height = tooltipSize.height;
  10367. var radius = vm.cornerRadius;
  10368. ctx.beginPath();
  10369. ctx.moveTo(x + radius, y);
  10370. if (yAlign === 'top') {
  10371. this.drawCaret(pt, tooltipSize);
  10372. }
  10373. ctx.lineTo(x + width - radius, y);
  10374. ctx.quadraticCurveTo(x + width, y, x + width, y + radius);
  10375. if (yAlign === 'center' && xAlign === 'right') {
  10376. this.drawCaret(pt, tooltipSize);
  10377. }
  10378. ctx.lineTo(x + width, y + height - radius);
  10379. ctx.quadraticCurveTo(x + width, y + height, x + width - radius, y + height);
  10380. if (yAlign === 'bottom') {
  10381. this.drawCaret(pt, tooltipSize);
  10382. }
  10383. ctx.lineTo(x + radius, y + height);
  10384. ctx.quadraticCurveTo(x, y + height, x, y + height - radius);
  10385. if (yAlign === 'center' && xAlign === 'left') {
  10386. this.drawCaret(pt, tooltipSize);
  10387. }
  10388. ctx.lineTo(x, y + radius);
  10389. ctx.quadraticCurveTo(x, y, x + radius, y);
  10390. ctx.closePath();
  10391. ctx.fill();
  10392. if (vm.borderWidth > 0) {
  10393. ctx.stroke();
  10394. }
  10395. },
  10396. draw: function() {
  10397. var ctx = this._chart.ctx;
  10398. var vm = this._view;
  10399. if (vm.opacity === 0) {
  10400. return;
  10401. }
  10402. var tooltipSize = {
  10403. width: vm.width,
  10404. height: vm.height
  10405. };
  10406. var pt = {
  10407. x: vm.x,
  10408. y: vm.y
  10409. };
  10410. // IE11/Edge does not like very small opacities, so snap to 0
  10411. var opacity = Math.abs(vm.opacity < 1e-3) ? 0 : vm.opacity;
  10412. // Truthy/falsey value for empty tooltip
  10413. var hasTooltipContent = vm.title.length || vm.beforeBody.length || vm.body.length || vm.afterBody.length || vm.footer.length;
  10414. if (this._options.enabled && hasTooltipContent) {
  10415. ctx.save();
  10416. ctx.globalAlpha = opacity;
  10417. // Draw Background
  10418. this.drawBackground(pt, vm, ctx, tooltipSize);
  10419. // Draw Title, Body, and Footer
  10420. pt.y += vm.yPadding;
  10421. helpers$1.rtl.overrideTextDirection(ctx, vm.textDirection);
  10422. // Titles
  10423. this.drawTitle(pt, vm, ctx);
  10424. // Body
  10425. this.drawBody(pt, vm, ctx);
  10426. // Footer
  10427. this.drawFooter(pt, vm, ctx);
  10428. helpers$1.rtl.restoreTextDirection(ctx, vm.textDirection);
  10429. ctx.restore();
  10430. }
  10431. },
  10432. /**
  10433. * Handle an event
  10434. * @private
  10435. * @param {IEvent} event - The event to handle
  10436. * @returns {boolean} true if the tooltip changed
  10437. */
  10438. handleEvent: function(e) {
  10439. var me = this;
  10440. var options = me._options;
  10441. var changed = false;
  10442. me._lastActive = me._lastActive || [];
  10443. // Find Active Elements for tooltips
  10444. if (e.type === 'mouseout') {
  10445. me._active = [];
  10446. } else {
  10447. me._active = me._chart.getElementsAtEventForMode(e, options.mode, options);
  10448. if (options.reverse) {
  10449. me._active.reverse();
  10450. }
  10451. }
  10452. // Remember Last Actives
  10453. changed = !helpers$1.arrayEquals(me._active, me._lastActive);
  10454. // Only handle target event on tooltip change
  10455. if (changed) {
  10456. me._lastActive = me._active;
  10457. if (options.enabled || options.custom) {
  10458. me._eventPosition = {
  10459. x: e.x,
  10460. y: e.y
  10461. };
  10462. me.update(true);
  10463. me.pivot();
  10464. }
  10465. }
  10466. return changed;
  10467. }
  10468. });
  10469. /**
  10470. * @namespace Chart.Tooltip.positioners
  10471. */
  10472. var positioners_1 = positioners;
  10473. var core_tooltip = exports$4;
  10474. core_tooltip.positioners = positioners_1;
  10475. var valueOrDefault$9 = helpers$1.valueOrDefault;
  10476. core_defaults._set('global', {
  10477. elements: {},
  10478. events: [
  10479. 'mousemove',
  10480. 'mouseout',
  10481. 'click',
  10482. 'touchstart',
  10483. 'touchmove'
  10484. ],
  10485. hover: {
  10486. onHover: null,
  10487. mode: 'nearest',
  10488. intersect: true,
  10489. animationDuration: 400
  10490. },
  10491. onClick: null,
  10492. maintainAspectRatio: true,
  10493. responsive: true,
  10494. responsiveAnimationDuration: 0
  10495. });
  10496. /**
  10497. * Recursively merge the given config objects representing the `scales` option
  10498. * by incorporating scale defaults in `xAxes` and `yAxes` array items, then
  10499. * returns a deep copy of the result, thus doesn't alter inputs.
  10500. */
  10501. function mergeScaleConfig(/* config objects ... */) {
  10502. return helpers$1.merge(Object.create(null), [].slice.call(arguments), {
  10503. merger: function(key, target, source, options) {
  10504. if (key === 'xAxes' || key === 'yAxes') {
  10505. var slen = source[key].length;
  10506. var i, type, scale;
  10507. if (!target[key]) {
  10508. target[key] = [];
  10509. }
  10510. for (i = 0; i < slen; ++i) {
  10511. scale = source[key][i];
  10512. type = valueOrDefault$9(scale.type, key === 'xAxes' ? 'category' : 'linear');
  10513. if (i >= target[key].length) {
  10514. target[key].push({});
  10515. }
  10516. if (!target[key][i].type || (scale.type && scale.type !== target[key][i].type)) {
  10517. // new/untyped scale or type changed: let's apply the new defaults
  10518. // then merge source scale to correctly overwrite the defaults.
  10519. helpers$1.merge(target[key][i], [core_scaleService.getScaleDefaults(type), scale]);
  10520. } else {
  10521. // scales type are the same
  10522. helpers$1.merge(target[key][i], scale);
  10523. }
  10524. }
  10525. } else {
  10526. helpers$1._merger(key, target, source, options);
  10527. }
  10528. }
  10529. });
  10530. }
  10531. /**
  10532. * Recursively merge the given config objects as the root options by handling
  10533. * default scale options for the `scales` and `scale` properties, then returns
  10534. * a deep copy of the result, thus doesn't alter inputs.
  10535. */
  10536. function mergeConfig(/* config objects ... */) {
  10537. return helpers$1.merge(Object.create(null), [].slice.call(arguments), {
  10538. merger: function(key, target, source, options) {
  10539. var tval = target[key] || Object.create(null);
  10540. var sval = source[key];
  10541. if (key === 'scales') {
  10542. // scale config merging is complex. Add our own function here for that
  10543. target[key] = mergeScaleConfig(tval, sval);
  10544. } else if (key === 'scale') {
  10545. // used in polar area & radar charts since there is only one scale
  10546. target[key] = helpers$1.merge(tval, [core_scaleService.getScaleDefaults(sval.type), sval]);
  10547. } else {
  10548. helpers$1._merger(key, target, source, options);
  10549. }
  10550. }
  10551. });
  10552. }
  10553. function initConfig(config) {
  10554. config = config || Object.create(null);
  10555. // Do NOT use mergeConfig for the data object because this method merges arrays
  10556. // and so would change references to labels and datasets, preventing data updates.
  10557. var data = config.data = config.data || {};
  10558. data.datasets = data.datasets || [];
  10559. data.labels = data.labels || [];
  10560. config.options = mergeConfig(
  10561. core_defaults.global,
  10562. core_defaults[config.type],
  10563. config.options || {});
  10564. return config;
  10565. }
  10566. function updateConfig(chart) {
  10567. var newOptions = chart.options;
  10568. helpers$1.each(chart.scales, function(scale) {
  10569. core_layouts.removeBox(chart, scale);
  10570. });
  10571. newOptions = mergeConfig(
  10572. core_defaults.global,
  10573. core_defaults[chart.config.type],
  10574. newOptions);
  10575. chart.options = chart.config.options = newOptions;
  10576. chart.ensureScalesHaveIDs();
  10577. chart.buildOrUpdateScales();
  10578. // Tooltip
  10579. chart.tooltip._options = newOptions.tooltips;
  10580. chart.tooltip.initialize();
  10581. }
  10582. function nextAvailableScaleId(axesOpts, prefix, index) {
  10583. var id;
  10584. var hasId = function(obj) {
  10585. return obj.id === id;
  10586. };
  10587. do {
  10588. id = prefix + index++;
  10589. } while (helpers$1.findIndex(axesOpts, hasId) >= 0);
  10590. return id;
  10591. }
  10592. function positionIsHorizontal(position) {
  10593. return position === 'top' || position === 'bottom';
  10594. }
  10595. function compare2Level(l1, l2) {
  10596. return function(a, b) {
  10597. return a[l1] === b[l1]
  10598. ? a[l2] - b[l2]
  10599. : a[l1] - b[l1];
  10600. };
  10601. }
  10602. var Chart = function(item, config) {
  10603. this.construct(item, config);
  10604. return this;
  10605. };
  10606. helpers$1.extend(Chart.prototype, /** @lends Chart */ {
  10607. /**
  10608. * @private
  10609. */
  10610. construct: function(item, config) {
  10611. var me = this;
  10612. config = initConfig(config);
  10613. var context = platform.acquireContext(item, config);
  10614. var canvas = context && context.canvas;
  10615. var height = canvas && canvas.height;
  10616. var width = canvas && canvas.width;
  10617. me.id = helpers$1.uid();
  10618. me.ctx = context;
  10619. me.canvas = canvas;
  10620. me.config = config;
  10621. me.width = width;
  10622. me.height = height;
  10623. me.aspectRatio = height ? width / height : null;
  10624. me.options = config.options;
  10625. me._bufferedRender = false;
  10626. me._layers = [];
  10627. /**
  10628. * Provided for backward compatibility, Chart and Chart.Controller have been merged,
  10629. * the "instance" still need to be defined since it might be called from plugins.
  10630. * @prop Chart#chart
  10631. * @deprecated since version 2.6.0
  10632. * @todo remove at version 3
  10633. * @private
  10634. */
  10635. me.chart = me;
  10636. me.controller = me; // chart.chart.controller #inception
  10637. // Add the chart instance to the global namespace
  10638. Chart.instances[me.id] = me;
  10639. // Define alias to the config data: `chart.data === chart.config.data`
  10640. Object.defineProperty(me, 'data', {
  10641. get: function() {
  10642. return me.config.data;
  10643. },
  10644. set: function(value) {
  10645. me.config.data = value;
  10646. }
  10647. });
  10648. if (!context || !canvas) {
  10649. // The given item is not a compatible context2d element, let's return before finalizing
  10650. // the chart initialization but after setting basic chart / controller properties that
  10651. // can help to figure out that the chart is not valid (e.g chart.canvas !== null);
  10652. // https://github.com/chartjs/Chart.js/issues/2807
  10653. console.error("Failed to create chart: can't acquire context from the given item");
  10654. return;
  10655. }
  10656. me.initialize();
  10657. me.update();
  10658. },
  10659. /**
  10660. * @private
  10661. */
  10662. initialize: function() {
  10663. var me = this;
  10664. // Before init plugin notification
  10665. core_plugins.notify(me, 'beforeInit');
  10666. helpers$1.retinaScale(me, me.options.devicePixelRatio);
  10667. me.bindEvents();
  10668. if (me.options.responsive) {
  10669. // Initial resize before chart draws (must be silent to preserve initial animations).
  10670. me.resize(true);
  10671. }
  10672. me.initToolTip();
  10673. // After init plugin notification
  10674. core_plugins.notify(me, 'afterInit');
  10675. return me;
  10676. },
  10677. clear: function() {
  10678. helpers$1.canvas.clear(this);
  10679. return this;
  10680. },
  10681. stop: function() {
  10682. // Stops any current animation loop occurring
  10683. core_animations.cancelAnimation(this);
  10684. return this;
  10685. },
  10686. resize: function(silent) {
  10687. var me = this;
  10688. var options = me.options;
  10689. var canvas = me.canvas;
  10690. var aspectRatio = (options.maintainAspectRatio && me.aspectRatio) || null;
  10691. // the canvas render width and height will be casted to integers so make sure that
  10692. // the canvas display style uses the same integer values to avoid blurring effect.
  10693. // Set to 0 instead of canvas.size because the size defaults to 300x150 if the element is collapsed
  10694. var newWidth = Math.max(0, Math.floor(helpers$1.getMaximumWidth(canvas)));
  10695. var newHeight = Math.max(0, Math.floor(aspectRatio ? newWidth / aspectRatio : helpers$1.getMaximumHeight(canvas)));
  10696. if (me.width === newWidth && me.height === newHeight) {
  10697. return;
  10698. }
  10699. canvas.width = me.width = newWidth;
  10700. canvas.height = me.height = newHeight;
  10701. canvas.style.width = newWidth + 'px';
  10702. canvas.style.height = newHeight + 'px';
  10703. helpers$1.retinaScale(me, options.devicePixelRatio);
  10704. if (!silent) {
  10705. // Notify any plugins about the resize
  10706. var newSize = {width: newWidth, height: newHeight};
  10707. core_plugins.notify(me, 'resize', [newSize]);
  10708. // Notify of resize
  10709. if (options.onResize) {
  10710. options.onResize(me, newSize);
  10711. }
  10712. me.stop();
  10713. me.update({
  10714. duration: options.responsiveAnimationDuration
  10715. });
  10716. }
  10717. },
  10718. ensureScalesHaveIDs: function() {
  10719. var options = this.options;
  10720. var scalesOptions = options.scales || {};
  10721. var scaleOptions = options.scale;
  10722. helpers$1.each(scalesOptions.xAxes, function(xAxisOptions, index) {
  10723. if (!xAxisOptions.id) {
  10724. xAxisOptions.id = nextAvailableScaleId(scalesOptions.xAxes, 'x-axis-', index);
  10725. }
  10726. });
  10727. helpers$1.each(scalesOptions.yAxes, function(yAxisOptions, index) {
  10728. if (!yAxisOptions.id) {
  10729. yAxisOptions.id = nextAvailableScaleId(scalesOptions.yAxes, 'y-axis-', index);
  10730. }
  10731. });
  10732. if (scaleOptions) {
  10733. scaleOptions.id = scaleOptions.id || 'scale';
  10734. }
  10735. },
  10736. /**
  10737. * Builds a map of scale ID to scale object for future lookup.
  10738. */
  10739. buildOrUpdateScales: function() {
  10740. var me = this;
  10741. var options = me.options;
  10742. var scales = me.scales || {};
  10743. var items = [];
  10744. var updated = Object.keys(scales).reduce(function(obj, id) {
  10745. obj[id] = false;
  10746. return obj;
  10747. }, {});
  10748. if (options.scales) {
  10749. items = items.concat(
  10750. (options.scales.xAxes || []).map(function(xAxisOptions) {
  10751. return {options: xAxisOptions, dtype: 'category', dposition: 'bottom'};
  10752. }),
  10753. (options.scales.yAxes || []).map(function(yAxisOptions) {
  10754. return {options: yAxisOptions, dtype: 'linear', dposition: 'left'};
  10755. })
  10756. );
  10757. }
  10758. if (options.scale) {
  10759. items.push({
  10760. options: options.scale,
  10761. dtype: 'radialLinear',
  10762. isDefault: true,
  10763. dposition: 'chartArea'
  10764. });
  10765. }
  10766. helpers$1.each(items, function(item) {
  10767. var scaleOptions = item.options;
  10768. var id = scaleOptions.id;
  10769. var scaleType = valueOrDefault$9(scaleOptions.type, item.dtype);
  10770. if (positionIsHorizontal(scaleOptions.position) !== positionIsHorizontal(item.dposition)) {
  10771. scaleOptions.position = item.dposition;
  10772. }
  10773. updated[id] = true;
  10774. var scale = null;
  10775. if (id in scales && scales[id].type === scaleType) {
  10776. scale = scales[id];
  10777. scale.options = scaleOptions;
  10778. scale.ctx = me.ctx;
  10779. scale.chart = me;
  10780. } else {
  10781. var scaleClass = core_scaleService.getScaleConstructor(scaleType);
  10782. if (!scaleClass) {
  10783. return;
  10784. }
  10785. scale = new scaleClass({
  10786. id: id,
  10787. type: scaleType,
  10788. options: scaleOptions,
  10789. ctx: me.ctx,
  10790. chart: me
  10791. });
  10792. scales[scale.id] = scale;
  10793. }
  10794. scale.mergeTicksOptions();
  10795. // TODO(SB): I think we should be able to remove this custom case (options.scale)
  10796. // and consider it as a regular scale part of the "scales"" map only! This would
  10797. // make the logic easier and remove some useless? custom code.
  10798. if (item.isDefault) {
  10799. me.scale = scale;
  10800. }
  10801. });
  10802. // clear up discarded scales
  10803. helpers$1.each(updated, function(hasUpdated, id) {
  10804. if (!hasUpdated) {
  10805. delete scales[id];
  10806. }
  10807. });
  10808. me.scales = scales;
  10809. core_scaleService.addScalesToLayout(this);
  10810. },
  10811. buildOrUpdateControllers: function() {
  10812. var me = this;
  10813. var newControllers = [];
  10814. var datasets = me.data.datasets;
  10815. var i, ilen;
  10816. for (i = 0, ilen = datasets.length; i < ilen; i++) {
  10817. var dataset = datasets[i];
  10818. var meta = me.getDatasetMeta(i);
  10819. var type = dataset.type || me.config.type;
  10820. if (meta.type && meta.type !== type) {
  10821. me.destroyDatasetMeta(i);
  10822. meta = me.getDatasetMeta(i);
  10823. }
  10824. meta.type = type;
  10825. meta.order = dataset.order || 0;
  10826. meta.index = i;
  10827. if (meta.controller) {
  10828. meta.controller.updateIndex(i);
  10829. meta.controller.linkScales();
  10830. } else {
  10831. var ControllerClass = controllers[meta.type];
  10832. if (ControllerClass === undefined) {
  10833. throw new Error('"' + meta.type + '" is not a chart type.');
  10834. }
  10835. meta.controller = new ControllerClass(me, i);
  10836. newControllers.push(meta.controller);
  10837. }
  10838. }
  10839. return newControllers;
  10840. },
  10841. /**
  10842. * Reset the elements of all datasets
  10843. * @private
  10844. */
  10845. resetElements: function() {
  10846. var me = this;
  10847. helpers$1.each(me.data.datasets, function(dataset, datasetIndex) {
  10848. me.getDatasetMeta(datasetIndex).controller.reset();
  10849. }, me);
  10850. },
  10851. /**
  10852. * Resets the chart back to it's state before the initial animation
  10853. */
  10854. reset: function() {
  10855. this.resetElements();
  10856. this.tooltip.initialize();
  10857. },
  10858. update: function(config) {
  10859. var me = this;
  10860. var i, ilen;
  10861. if (!config || typeof config !== 'object') {
  10862. // backwards compatibility
  10863. config = {
  10864. duration: config,
  10865. lazy: arguments[1]
  10866. };
  10867. }
  10868. updateConfig(me);
  10869. // plugins options references might have change, let's invalidate the cache
  10870. // https://github.com/chartjs/Chart.js/issues/5111#issuecomment-355934167
  10871. core_plugins._invalidate(me);
  10872. if (core_plugins.notify(me, 'beforeUpdate') === false) {
  10873. return;
  10874. }
  10875. // In case the entire data object changed
  10876. me.tooltip._data = me.data;
  10877. // Make sure dataset controllers are updated and new controllers are reset
  10878. var newControllers = me.buildOrUpdateControllers();
  10879. // Make sure all dataset controllers have correct meta data counts
  10880. for (i = 0, ilen = me.data.datasets.length; i < ilen; i++) {
  10881. me.getDatasetMeta(i).controller.buildOrUpdateElements();
  10882. }
  10883. me.updateLayout();
  10884. // Can only reset the new controllers after the scales have been updated
  10885. if (me.options.animation && me.options.animation.duration) {
  10886. helpers$1.each(newControllers, function(controller) {
  10887. controller.reset();
  10888. });
  10889. }
  10890. me.updateDatasets();
  10891. // Need to reset tooltip in case it is displayed with elements that are removed
  10892. // after update.
  10893. me.tooltip.initialize();
  10894. // Last active contains items that were previously in the tooltip.
  10895. // When we reset the tooltip, we need to clear it
  10896. me.lastActive = [];
  10897. // Do this before render so that any plugins that need final scale updates can use it
  10898. core_plugins.notify(me, 'afterUpdate');
  10899. me._layers.sort(compare2Level('z', '_idx'));
  10900. if (me._bufferedRender) {
  10901. me._bufferedRequest = {
  10902. duration: config.duration,
  10903. easing: config.easing,
  10904. lazy: config.lazy
  10905. };
  10906. } else {
  10907. me.render(config);
  10908. }
  10909. },
  10910. /**
  10911. * Updates the chart layout unless a plugin returns `false` to the `beforeLayout`
  10912. * hook, in which case, plugins will not be called on `afterLayout`.
  10913. * @private
  10914. */
  10915. updateLayout: function() {
  10916. var me = this;
  10917. if (core_plugins.notify(me, 'beforeLayout') === false) {
  10918. return;
  10919. }
  10920. core_layouts.update(this, this.width, this.height);
  10921. me._layers = [];
  10922. helpers$1.each(me.boxes, function(box) {
  10923. // _configure is called twice, once in core.scale.update and once here.
  10924. // Here the boxes are fully updated and at their final positions.
  10925. if (box._configure) {
  10926. box._configure();
  10927. }
  10928. me._layers.push.apply(me._layers, box._layers());
  10929. }, me);
  10930. me._layers.forEach(function(item, index) {
  10931. item._idx = index;
  10932. });
  10933. /**
  10934. * Provided for backward compatibility, use `afterLayout` instead.
  10935. * @method IPlugin#afterScaleUpdate
  10936. * @deprecated since version 2.5.0
  10937. * @todo remove at version 3
  10938. * @private
  10939. */
  10940. core_plugins.notify(me, 'afterScaleUpdate');
  10941. core_plugins.notify(me, 'afterLayout');
  10942. },
  10943. /**
  10944. * Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate`
  10945. * hook, in which case, plugins will not be called on `afterDatasetsUpdate`.
  10946. * @private
  10947. */
  10948. updateDatasets: function() {
  10949. var me = this;
  10950. if (core_plugins.notify(me, 'beforeDatasetsUpdate') === false) {
  10951. return;
  10952. }
  10953. for (var i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {
  10954. me.updateDataset(i);
  10955. }
  10956. core_plugins.notify(me, 'afterDatasetsUpdate');
  10957. },
  10958. /**
  10959. * Updates dataset at index unless a plugin returns `false` to the `beforeDatasetUpdate`
  10960. * hook, in which case, plugins will not be called on `afterDatasetUpdate`.
  10961. * @private
  10962. */
  10963. updateDataset: function(index) {
  10964. var me = this;
  10965. var meta = me.getDatasetMeta(index);
  10966. var args = {
  10967. meta: meta,
  10968. index: index
  10969. };
  10970. if (core_plugins.notify(me, 'beforeDatasetUpdate', [args]) === false) {
  10971. return;
  10972. }
  10973. meta.controller._update();
  10974. core_plugins.notify(me, 'afterDatasetUpdate', [args]);
  10975. },
  10976. render: function(config) {
  10977. var me = this;
  10978. if (!config || typeof config !== 'object') {
  10979. // backwards compatibility
  10980. config = {
  10981. duration: config,
  10982. lazy: arguments[1]
  10983. };
  10984. }
  10985. var animationOptions = me.options.animation;
  10986. var duration = valueOrDefault$9(config.duration, animationOptions && animationOptions.duration);
  10987. var lazy = config.lazy;
  10988. if (core_plugins.notify(me, 'beforeRender') === false) {
  10989. return;
  10990. }
  10991. var onComplete = function(animation) {
  10992. core_plugins.notify(me, 'afterRender');
  10993. helpers$1.callback(animationOptions && animationOptions.onComplete, [animation], me);
  10994. };
  10995. if (animationOptions && duration) {
  10996. var animation = new core_animation({
  10997. numSteps: duration / 16.66, // 60 fps
  10998. easing: config.easing || animationOptions.easing,
  10999. render: function(chart, animationObject) {
  11000. var easingFunction = helpers$1.easing.effects[animationObject.easing];
  11001. var currentStep = animationObject.currentStep;
  11002. var stepDecimal = currentStep / animationObject.numSteps;
  11003. chart.draw(easingFunction(stepDecimal), stepDecimal, currentStep);
  11004. },
  11005. onAnimationProgress: animationOptions.onProgress,
  11006. onAnimationComplete: onComplete
  11007. });
  11008. core_animations.addAnimation(me, animation, duration, lazy);
  11009. } else {
  11010. me.draw();
  11011. // See https://github.com/chartjs/Chart.js/issues/3781
  11012. onComplete(new core_animation({numSteps: 0, chart: me}));
  11013. }
  11014. return me;
  11015. },
  11016. draw: function(easingValue) {
  11017. var me = this;
  11018. var i, layers;
  11019. me.clear();
  11020. if (helpers$1.isNullOrUndef(easingValue)) {
  11021. easingValue = 1;
  11022. }
  11023. me.transition(easingValue);
  11024. if (me.width <= 0 || me.height <= 0) {
  11025. return;
  11026. }
  11027. if (core_plugins.notify(me, 'beforeDraw', [easingValue]) === false) {
  11028. return;
  11029. }
  11030. // Because of plugin hooks (before/afterDatasetsDraw), datasets can't
  11031. // currently be part of layers. Instead, we draw
  11032. // layers <= 0 before(default, backward compat), and the rest after
  11033. layers = me._layers;
  11034. for (i = 0; i < layers.length && layers[i].z <= 0; ++i) {
  11035. layers[i].draw(me.chartArea);
  11036. }
  11037. me.drawDatasets(easingValue);
  11038. // Rest of layers
  11039. for (; i < layers.length; ++i) {
  11040. layers[i].draw(me.chartArea);
  11041. }
  11042. me._drawTooltip(easingValue);
  11043. core_plugins.notify(me, 'afterDraw', [easingValue]);
  11044. },
  11045. /**
  11046. * @private
  11047. */
  11048. transition: function(easingValue) {
  11049. var me = this;
  11050. for (var i = 0, ilen = (me.data.datasets || []).length; i < ilen; ++i) {
  11051. if (me.isDatasetVisible(i)) {
  11052. me.getDatasetMeta(i).controller.transition(easingValue);
  11053. }
  11054. }
  11055. me.tooltip.transition(easingValue);
  11056. },
  11057. /**
  11058. * @private
  11059. */
  11060. _getSortedDatasetMetas: function(filterVisible) {
  11061. var me = this;
  11062. var datasets = me.data.datasets || [];
  11063. var result = [];
  11064. var i, ilen;
  11065. for (i = 0, ilen = datasets.length; i < ilen; ++i) {
  11066. if (!filterVisible || me.isDatasetVisible(i)) {
  11067. result.push(me.getDatasetMeta(i));
  11068. }
  11069. }
  11070. result.sort(compare2Level('order', 'index'));
  11071. return result;
  11072. },
  11073. /**
  11074. * @private
  11075. */
  11076. _getSortedVisibleDatasetMetas: function() {
  11077. return this._getSortedDatasetMetas(true);
  11078. },
  11079. /**
  11080. * Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw`
  11081. * hook, in which case, plugins will not be called on `afterDatasetsDraw`.
  11082. * @private
  11083. */
  11084. drawDatasets: function(easingValue) {
  11085. var me = this;
  11086. var metasets, i;
  11087. if (core_plugins.notify(me, 'beforeDatasetsDraw', [easingValue]) === false) {
  11088. return;
  11089. }
  11090. metasets = me._getSortedVisibleDatasetMetas();
  11091. for (i = metasets.length - 1; i >= 0; --i) {
  11092. me.drawDataset(metasets[i], easingValue);
  11093. }
  11094. core_plugins.notify(me, 'afterDatasetsDraw', [easingValue]);
  11095. },
  11096. /**
  11097. * Draws dataset at index unless a plugin returns `false` to the `beforeDatasetDraw`
  11098. * hook, in which case, plugins will not be called on `afterDatasetDraw`.
  11099. * @private
  11100. */
  11101. drawDataset: function(meta, easingValue) {
  11102. var me = this;
  11103. var args = {
  11104. meta: meta,
  11105. index: meta.index,
  11106. easingValue: easingValue
  11107. };
  11108. if (core_plugins.notify(me, 'beforeDatasetDraw', [args]) === false) {
  11109. return;
  11110. }
  11111. meta.controller.draw(easingValue);
  11112. core_plugins.notify(me, 'afterDatasetDraw', [args]);
  11113. },
  11114. /**
  11115. * Draws tooltip unless a plugin returns `false` to the `beforeTooltipDraw`
  11116. * hook, in which case, plugins will not be called on `afterTooltipDraw`.
  11117. * @private
  11118. */
  11119. _drawTooltip: function(easingValue) {
  11120. var me = this;
  11121. var tooltip = me.tooltip;
  11122. var args = {
  11123. tooltip: tooltip,
  11124. easingValue: easingValue
  11125. };
  11126. if (core_plugins.notify(me, 'beforeTooltipDraw', [args]) === false) {
  11127. return;
  11128. }
  11129. tooltip.draw();
  11130. core_plugins.notify(me, 'afterTooltipDraw', [args]);
  11131. },
  11132. /**
  11133. * Get the single element that was clicked on
  11134. * @return An object containing the dataset index and element index of the matching element. Also contains the rectangle that was draw
  11135. */
  11136. getElementAtEvent: function(e) {
  11137. return core_interaction.modes.single(this, e);
  11138. },
  11139. getElementsAtEvent: function(e) {
  11140. return core_interaction.modes.label(this, e, {intersect: true});
  11141. },
  11142. getElementsAtXAxis: function(e) {
  11143. return core_interaction.modes['x-axis'](this, e, {intersect: true});
  11144. },
  11145. getElementsAtEventForMode: function(e, mode, options) {
  11146. var method = core_interaction.modes[mode];
  11147. if (typeof method === 'function') {
  11148. return method(this, e, options);
  11149. }
  11150. return [];
  11151. },
  11152. getDatasetAtEvent: function(e) {
  11153. return core_interaction.modes.dataset(this, e, {intersect: true});
  11154. },
  11155. getDatasetMeta: function(datasetIndex) {
  11156. var me = this;
  11157. var dataset = me.data.datasets[datasetIndex];
  11158. if (!dataset._meta) {
  11159. dataset._meta = {};
  11160. }
  11161. var meta = dataset._meta[me.id];
  11162. if (!meta) {
  11163. meta = dataset._meta[me.id] = {
  11164. type: null,
  11165. data: [],
  11166. dataset: null,
  11167. controller: null,
  11168. hidden: null, // See isDatasetVisible() comment
  11169. xAxisID: null,
  11170. yAxisID: null,
  11171. order: dataset.order || 0,
  11172. index: datasetIndex
  11173. };
  11174. }
  11175. return meta;
  11176. },
  11177. getVisibleDatasetCount: function() {
  11178. var count = 0;
  11179. for (var i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {
  11180. if (this.isDatasetVisible(i)) {
  11181. count++;
  11182. }
  11183. }
  11184. return count;
  11185. },
  11186. isDatasetVisible: function(datasetIndex) {
  11187. var meta = this.getDatasetMeta(datasetIndex);
  11188. // meta.hidden is a per chart dataset hidden flag override with 3 states: if true or false,
  11189. // the dataset.hidden value is ignored, else if null, the dataset hidden state is returned.
  11190. return typeof meta.hidden === 'boolean' ? !meta.hidden : !this.data.datasets[datasetIndex].hidden;
  11191. },
  11192. generateLegend: function() {
  11193. return this.options.legendCallback(this);
  11194. },
  11195. /**
  11196. * @private
  11197. */
  11198. destroyDatasetMeta: function(datasetIndex) {
  11199. var id = this.id;
  11200. var dataset = this.data.datasets[datasetIndex];
  11201. var meta = dataset._meta && dataset._meta[id];
  11202. if (meta) {
  11203. meta.controller.destroy();
  11204. delete dataset._meta[id];
  11205. }
  11206. },
  11207. destroy: function() {
  11208. var me = this;
  11209. var canvas = me.canvas;
  11210. var i, ilen;
  11211. me.stop();
  11212. // dataset controllers need to cleanup associated data
  11213. for (i = 0, ilen = me.data.datasets.length; i < ilen; ++i) {
  11214. me.destroyDatasetMeta(i);
  11215. }
  11216. if (canvas) {
  11217. me.unbindEvents();
  11218. helpers$1.canvas.clear(me);
  11219. platform.releaseContext(me.ctx);
  11220. me.canvas = null;
  11221. me.ctx = null;
  11222. }
  11223. core_plugins.notify(me, 'destroy');
  11224. delete Chart.instances[me.id];
  11225. },
  11226. toBase64Image: function() {
  11227. return this.canvas.toDataURL.apply(this.canvas, arguments);
  11228. },
  11229. initToolTip: function() {
  11230. var me = this;
  11231. me.tooltip = new core_tooltip({
  11232. _chart: me,
  11233. _chartInstance: me, // deprecated, backward compatibility
  11234. _data: me.data,
  11235. _options: me.options.tooltips
  11236. }, me);
  11237. },
  11238. /**
  11239. * @private
  11240. */
  11241. bindEvents: function() {
  11242. var me = this;
  11243. var listeners = me._listeners = {};
  11244. var listener = function() {
  11245. me.eventHandler.apply(me, arguments);
  11246. };
  11247. helpers$1.each(me.options.events, function(type) {
  11248. platform.addEventListener(me, type, listener);
  11249. listeners[type] = listener;
  11250. });
  11251. // Elements used to detect size change should not be injected for non responsive charts.
  11252. // See https://github.com/chartjs/Chart.js/issues/2210
  11253. if (me.options.responsive) {
  11254. listener = function() {
  11255. me.resize();
  11256. };
  11257. platform.addEventListener(me, 'resize', listener);
  11258. listeners.resize = listener;
  11259. }
  11260. },
  11261. /**
  11262. * @private
  11263. */
  11264. unbindEvents: function() {
  11265. var me = this;
  11266. var listeners = me._listeners;
  11267. if (!listeners) {
  11268. return;
  11269. }
  11270. delete me._listeners;
  11271. helpers$1.each(listeners, function(listener, type) {
  11272. platform.removeEventListener(me, type, listener);
  11273. });
  11274. },
  11275. updateHoverStyle: function(elements, mode, enabled) {
  11276. var prefix = enabled ? 'set' : 'remove';
  11277. var element, i, ilen;
  11278. for (i = 0, ilen = elements.length; i < ilen; ++i) {
  11279. element = elements[i];
  11280. if (element) {
  11281. this.getDatasetMeta(element._datasetIndex).controller[prefix + 'HoverStyle'](element);
  11282. }
  11283. }
  11284. if (mode === 'dataset') {
  11285. this.getDatasetMeta(elements[0]._datasetIndex).controller['_' + prefix + 'DatasetHoverStyle']();
  11286. }
  11287. },
  11288. /**
  11289. * @private
  11290. */
  11291. eventHandler: function(e) {
  11292. var me = this;
  11293. var tooltip = me.tooltip;
  11294. if (core_plugins.notify(me, 'beforeEvent', [e]) === false) {
  11295. return;
  11296. }
  11297. // Buffer any update calls so that renders do not occur
  11298. me._bufferedRender = true;
  11299. me._bufferedRequest = null;
  11300. var changed = me.handleEvent(e);
  11301. // for smooth tooltip animations issue #4989
  11302. // the tooltip should be the source of change
  11303. // Animation check workaround:
  11304. // tooltip._start will be null when tooltip isn't animating
  11305. if (tooltip) {
  11306. changed = tooltip._start
  11307. ? tooltip.handleEvent(e)
  11308. : changed | tooltip.handleEvent(e);
  11309. }
  11310. core_plugins.notify(me, 'afterEvent', [e]);
  11311. var bufferedRequest = me._bufferedRequest;
  11312. if (bufferedRequest) {
  11313. // If we have an update that was triggered, we need to do a normal render
  11314. me.render(bufferedRequest);
  11315. } else if (changed && !me.animating) {
  11316. // If entering, leaving, or changing elements, animate the change via pivot
  11317. me.stop();
  11318. // We only need to render at this point. Updating will cause scales to be
  11319. // recomputed generating flicker & using more memory than necessary.
  11320. me.render({
  11321. duration: me.options.hover.animationDuration,
  11322. lazy: true
  11323. });
  11324. }
  11325. me._bufferedRender = false;
  11326. me._bufferedRequest = null;
  11327. return me;
  11328. },
  11329. /**
  11330. * Handle an event
  11331. * @private
  11332. * @param {IEvent} event the event to handle
  11333. * @return {boolean} true if the chart needs to re-render
  11334. */
  11335. handleEvent: function(e) {
  11336. var me = this;
  11337. var options = me.options || {};
  11338. var hoverOptions = options.hover;
  11339. var changed = false;
  11340. me.lastActive = me.lastActive || [];
  11341. // Find Active Elements for hover and tooltips
  11342. if (e.type === 'mouseout') {
  11343. me.active = [];
  11344. } else {
  11345. me.active = me.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions);
  11346. }
  11347. // Invoke onHover hook
  11348. // Need to call with native event here to not break backwards compatibility
  11349. helpers$1.callback(options.onHover || options.hover.onHover, [e.native, me.active], me);
  11350. if (e.type === 'mouseup' || e.type === 'click') {
  11351. if (options.onClick) {
  11352. // Use e.native here for backwards compatibility
  11353. options.onClick.call(me, e.native, me.active);
  11354. }
  11355. }
  11356. // Remove styling for last active (even if it may still be active)
  11357. if (me.lastActive.length) {
  11358. me.updateHoverStyle(me.lastActive, hoverOptions.mode, false);
  11359. }
  11360. // Built in hover styling
  11361. if (me.active.length && hoverOptions.mode) {
  11362. me.updateHoverStyle(me.active, hoverOptions.mode, true);
  11363. }
  11364. changed = !helpers$1.arrayEquals(me.active, me.lastActive);
  11365. // Remember Last Actives
  11366. me.lastActive = me.active;
  11367. return changed;
  11368. }
  11369. });
  11370. /**
  11371. * NOTE(SB) We actually don't use this container anymore but we need to keep it
  11372. * for backward compatibility. Though, it can still be useful for plugins that
  11373. * would need to work on multiple charts?!
  11374. */
  11375. Chart.instances = {};
  11376. var core_controller = Chart;
  11377. // DEPRECATIONS
  11378. /**
  11379. * Provided for backward compatibility, use Chart instead.
  11380. * @class Chart.Controller
  11381. * @deprecated since version 2.6
  11382. * @todo remove at version 3
  11383. * @private
  11384. */
  11385. Chart.Controller = Chart;
  11386. /**
  11387. * Provided for backward compatibility, not available anymore.
  11388. * @namespace Chart
  11389. * @deprecated since version 2.8
  11390. * @todo remove at version 3
  11391. * @private
  11392. */
  11393. Chart.types = {};
  11394. /**
  11395. * Provided for backward compatibility, not available anymore.
  11396. * @namespace Chart.helpers.configMerge
  11397. * @deprecated since version 2.8.0
  11398. * @todo remove at version 3
  11399. * @private
  11400. */
  11401. helpers$1.configMerge = mergeConfig;
  11402. /**
  11403. * Provided for backward compatibility, not available anymore.
  11404. * @namespace Chart.helpers.scaleMerge
  11405. * @deprecated since version 2.8.0
  11406. * @todo remove at version 3
  11407. * @private
  11408. */
  11409. helpers$1.scaleMerge = mergeScaleConfig;
  11410. var core_helpers = function() {
  11411. // -- Basic js utility methods
  11412. helpers$1.where = function(collection, filterCallback) {
  11413. if (helpers$1.isArray(collection) && Array.prototype.filter) {
  11414. return collection.filter(filterCallback);
  11415. }
  11416. var filtered = [];
  11417. helpers$1.each(collection, function(item) {
  11418. if (filterCallback(item)) {
  11419. filtered.push(item);
  11420. }
  11421. });
  11422. return filtered;
  11423. };
  11424. helpers$1.findIndex = Array.prototype.findIndex ?
  11425. function(array, callback, scope) {
  11426. return array.findIndex(callback, scope);
  11427. } :
  11428. function(array, callback, scope) {
  11429. scope = scope === undefined ? array : scope;
  11430. for (var i = 0, ilen = array.length; i < ilen; ++i) {
  11431. if (callback.call(scope, array[i], i, array)) {
  11432. return i;
  11433. }
  11434. }
  11435. return -1;
  11436. };
  11437. helpers$1.findNextWhere = function(arrayToSearch, filterCallback, startIndex) {
  11438. // Default to start of the array
  11439. if (helpers$1.isNullOrUndef(startIndex)) {
  11440. startIndex = -1;
  11441. }
  11442. for (var i = startIndex + 1; i < arrayToSearch.length; i++) {
  11443. var currentItem = arrayToSearch[i];
  11444. if (filterCallback(currentItem)) {
  11445. return currentItem;
  11446. }
  11447. }
  11448. };
  11449. helpers$1.findPreviousWhere = function(arrayToSearch, filterCallback, startIndex) {
  11450. // Default to end of the array
  11451. if (helpers$1.isNullOrUndef(startIndex)) {
  11452. startIndex = arrayToSearch.length;
  11453. }
  11454. for (var i = startIndex - 1; i >= 0; i--) {
  11455. var currentItem = arrayToSearch[i];
  11456. if (filterCallback(currentItem)) {
  11457. return currentItem;
  11458. }
  11459. }
  11460. };
  11461. // -- Math methods
  11462. helpers$1.isNumber = function(n) {
  11463. return !isNaN(parseFloat(n)) && isFinite(n);
  11464. };
  11465. helpers$1.almostEquals = function(x, y, epsilon) {
  11466. return Math.abs(x - y) < epsilon;
  11467. };
  11468. helpers$1.almostWhole = function(x, epsilon) {
  11469. var rounded = Math.round(x);
  11470. return ((rounded - epsilon) <= x) && ((rounded + epsilon) >= x);
  11471. };
  11472. helpers$1.max = function(array) {
  11473. return array.reduce(function(max, value) {
  11474. if (!isNaN(value)) {
  11475. return Math.max(max, value);
  11476. }
  11477. return max;
  11478. }, Number.NEGATIVE_INFINITY);
  11479. };
  11480. helpers$1.min = function(array) {
  11481. return array.reduce(function(min, value) {
  11482. if (!isNaN(value)) {
  11483. return Math.min(min, value);
  11484. }
  11485. return min;
  11486. }, Number.POSITIVE_INFINITY);
  11487. };
  11488. helpers$1.sign = Math.sign ?
  11489. function(x) {
  11490. return Math.sign(x);
  11491. } :
  11492. function(x) {
  11493. x = +x; // convert to a number
  11494. if (x === 0 || isNaN(x)) {
  11495. return x;
  11496. }
  11497. return x > 0 ? 1 : -1;
  11498. };
  11499. helpers$1.toRadians = function(degrees) {
  11500. return degrees * (Math.PI / 180);
  11501. };
  11502. helpers$1.toDegrees = function(radians) {
  11503. return radians * (180 / Math.PI);
  11504. };
  11505. /**
  11506. * Returns the number of decimal places
  11507. * i.e. the number of digits after the decimal point, of the value of this Number.
  11508. * @param {number} x - A number.
  11509. * @returns {number} The number of decimal places.
  11510. * @private
  11511. */
  11512. helpers$1._decimalPlaces = function(x) {
  11513. if (!helpers$1.isFinite(x)) {
  11514. return;
  11515. }
  11516. var e = 1;
  11517. var p = 0;
  11518. while (Math.round(x * e) / e !== x) {
  11519. e *= 10;
  11520. p++;
  11521. }
  11522. return p;
  11523. };
  11524. // Gets the angle from vertical upright to the point about a centre.
  11525. helpers$1.getAngleFromPoint = function(centrePoint, anglePoint) {
  11526. var distanceFromXCenter = anglePoint.x - centrePoint.x;
  11527. var distanceFromYCenter = anglePoint.y - centrePoint.y;
  11528. var radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);
  11529. var angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);
  11530. if (angle < (-0.5 * Math.PI)) {
  11531. angle += 2.0 * Math.PI; // make sure the returned angle is in the range of (-PI/2, 3PI/2]
  11532. }
  11533. return {
  11534. angle: angle,
  11535. distance: radialDistanceFromCenter
  11536. };
  11537. };
  11538. helpers$1.distanceBetweenPoints = function(pt1, pt2) {
  11539. return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));
  11540. };
  11541. /**
  11542. * Provided for backward compatibility, not available anymore
  11543. * @function Chart.helpers.aliasPixel
  11544. * @deprecated since version 2.8.0
  11545. * @todo remove at version 3
  11546. */
  11547. helpers$1.aliasPixel = function(pixelWidth) {
  11548. return (pixelWidth % 2 === 0) ? 0 : 0.5;
  11549. };
  11550. /**
  11551. * Returns the aligned pixel value to avoid anti-aliasing blur
  11552. * @param {Chart} chart - The chart instance.
  11553. * @param {number} pixel - A pixel value.
  11554. * @param {number} width - The width of the element.
  11555. * @returns {number} The aligned pixel value.
  11556. * @private
  11557. */
  11558. helpers$1._alignPixel = function(chart, pixel, width) {
  11559. var devicePixelRatio = chart.currentDevicePixelRatio;
  11560. var halfWidth = width / 2;
  11561. return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;
  11562. };
  11563. helpers$1.splineCurve = function(firstPoint, middlePoint, afterPoint, t) {
  11564. // Props to Rob Spencer at scaled innovation for his post on splining between points
  11565. // http://scaledinnovation.com/analytics/splines/aboutSplines.html
  11566. // This function must also respect "skipped" points
  11567. var previous = firstPoint.skip ? middlePoint : firstPoint;
  11568. var current = middlePoint;
  11569. var next = afterPoint.skip ? middlePoint : afterPoint;
  11570. var d01 = Math.sqrt(Math.pow(current.x - previous.x, 2) + Math.pow(current.y - previous.y, 2));
  11571. var d12 = Math.sqrt(Math.pow(next.x - current.x, 2) + Math.pow(next.y - current.y, 2));
  11572. var s01 = d01 / (d01 + d12);
  11573. var s12 = d12 / (d01 + d12);
  11574. // If all points are the same, s01 & s02 will be inf
  11575. s01 = isNaN(s01) ? 0 : s01;
  11576. s12 = isNaN(s12) ? 0 : s12;
  11577. var fa = t * s01; // scaling factor for triangle Ta
  11578. var fb = t * s12;
  11579. return {
  11580. previous: {
  11581. x: current.x - fa * (next.x - previous.x),
  11582. y: current.y - fa * (next.y - previous.y)
  11583. },
  11584. next: {
  11585. x: current.x + fb * (next.x - previous.x),
  11586. y: current.y + fb * (next.y - previous.y)
  11587. }
  11588. };
  11589. };
  11590. helpers$1.EPSILON = Number.EPSILON || 1e-14;
  11591. helpers$1.splineCurveMonotone = function(points) {
  11592. // This function calculates Bézier control points in a similar way than |splineCurve|,
  11593. // but preserves monotonicity of the provided data and ensures no local extremums are added
  11594. // between the dataset discrete points due to the interpolation.
  11595. // See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation
  11596. var pointsWithTangents = (points || []).map(function(point) {
  11597. return {
  11598. model: point._model,
  11599. deltaK: 0,
  11600. mK: 0
  11601. };
  11602. });
  11603. // Calculate slopes (deltaK) and initialize tangents (mK)
  11604. var pointsLen = pointsWithTangents.length;
  11605. var i, pointBefore, pointCurrent, pointAfter;
  11606. for (i = 0; i < pointsLen; ++i) {
  11607. pointCurrent = pointsWithTangents[i];
  11608. if (pointCurrent.model.skip) {
  11609. continue;
  11610. }
  11611. pointBefore = i > 0 ? pointsWithTangents[i - 1] : null;
  11612. pointAfter = i < pointsLen - 1 ? pointsWithTangents[i + 1] : null;
  11613. if (pointAfter && !pointAfter.model.skip) {
  11614. var slopeDeltaX = (pointAfter.model.x - pointCurrent.model.x);
  11615. // In the case of two points that appear at the same x pixel, slopeDeltaX is 0
  11616. pointCurrent.deltaK = slopeDeltaX !== 0 ? (pointAfter.model.y - pointCurrent.model.y) / slopeDeltaX : 0;
  11617. }
  11618. if (!pointBefore || pointBefore.model.skip) {
  11619. pointCurrent.mK = pointCurrent.deltaK;
  11620. } else if (!pointAfter || pointAfter.model.skip) {
  11621. pointCurrent.mK = pointBefore.deltaK;
  11622. } else if (this.sign(pointBefore.deltaK) !== this.sign(pointCurrent.deltaK)) {
  11623. pointCurrent.mK = 0;
  11624. } else {
  11625. pointCurrent.mK = (pointBefore.deltaK + pointCurrent.deltaK) / 2;
  11626. }
  11627. }
  11628. // Adjust tangents to ensure monotonic properties
  11629. var alphaK, betaK, tauK, squaredMagnitude;
  11630. for (i = 0; i < pointsLen - 1; ++i) {
  11631. pointCurrent = pointsWithTangents[i];
  11632. pointAfter = pointsWithTangents[i + 1];
  11633. if (pointCurrent.model.skip || pointAfter.model.skip) {
  11634. continue;
  11635. }
  11636. if (helpers$1.almostEquals(pointCurrent.deltaK, 0, this.EPSILON)) {
  11637. pointCurrent.mK = pointAfter.mK = 0;
  11638. continue;
  11639. }
  11640. alphaK = pointCurrent.mK / pointCurrent.deltaK;
  11641. betaK = pointAfter.mK / pointCurrent.deltaK;
  11642. squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);
  11643. if (squaredMagnitude <= 9) {
  11644. continue;
  11645. }
  11646. tauK = 3 / Math.sqrt(squaredMagnitude);
  11647. pointCurrent.mK = alphaK * tauK * pointCurrent.deltaK;
  11648. pointAfter.mK = betaK * tauK * pointCurrent.deltaK;
  11649. }
  11650. // Compute control points
  11651. var deltaX;
  11652. for (i = 0; i < pointsLen; ++i) {
  11653. pointCurrent = pointsWithTangents[i];
  11654. if (pointCurrent.model.skip) {
  11655. continue;
  11656. }
  11657. pointBefore = i > 0 ? pointsWithTangents[i - 1] : null;
  11658. pointAfter = i < pointsLen - 1 ? pointsWithTangents[i + 1] : null;
  11659. if (pointBefore && !pointBefore.model.skip) {
  11660. deltaX = (pointCurrent.model.x - pointBefore.model.x) / 3;
  11661. pointCurrent.model.controlPointPreviousX = pointCurrent.model.x - deltaX;
  11662. pointCurrent.model.controlPointPreviousY = pointCurrent.model.y - deltaX * pointCurrent.mK;
  11663. }
  11664. if (pointAfter && !pointAfter.model.skip) {
  11665. deltaX = (pointAfter.model.x - pointCurrent.model.x) / 3;
  11666. pointCurrent.model.controlPointNextX = pointCurrent.model.x + deltaX;
  11667. pointCurrent.model.controlPointNextY = pointCurrent.model.y + deltaX * pointCurrent.mK;
  11668. }
  11669. }
  11670. };
  11671. helpers$1.nextItem = function(collection, index, loop) {
  11672. if (loop) {
  11673. return index >= collection.length - 1 ? collection[0] : collection[index + 1];
  11674. }
  11675. return index >= collection.length - 1 ? collection[collection.length - 1] : collection[index + 1];
  11676. };
  11677. helpers$1.previousItem = function(collection, index, loop) {
  11678. if (loop) {
  11679. return index <= 0 ? collection[collection.length - 1] : collection[index - 1];
  11680. }
  11681. return index <= 0 ? collection[0] : collection[index - 1];
  11682. };
  11683. // Implementation of the nice number algorithm used in determining where axis labels will go
  11684. helpers$1.niceNum = function(range, round) {
  11685. var exponent = Math.floor(helpers$1.log10(range));
  11686. var fraction = range / Math.pow(10, exponent);
  11687. var niceFraction;
  11688. if (round) {
  11689. if (fraction < 1.5) {
  11690. niceFraction = 1;
  11691. } else if (fraction < 3) {
  11692. niceFraction = 2;
  11693. } else if (fraction < 7) {
  11694. niceFraction = 5;
  11695. } else {
  11696. niceFraction = 10;
  11697. }
  11698. } else if (fraction <= 1.0) {
  11699. niceFraction = 1;
  11700. } else if (fraction <= 2) {
  11701. niceFraction = 2;
  11702. } else if (fraction <= 5) {
  11703. niceFraction = 5;
  11704. } else {
  11705. niceFraction = 10;
  11706. }
  11707. return niceFraction * Math.pow(10, exponent);
  11708. };
  11709. // Request animation polyfill - https://www.paulirish.com/2011/requestanimationframe-for-smart-animating/
  11710. helpers$1.requestAnimFrame = (function() {
  11711. if (typeof window === 'undefined') {
  11712. return function(callback) {
  11713. callback();
  11714. };
  11715. }
  11716. return window.requestAnimationFrame ||
  11717. window.webkitRequestAnimationFrame ||
  11718. window.mozRequestAnimationFrame ||
  11719. window.oRequestAnimationFrame ||
  11720. window.msRequestAnimationFrame ||
  11721. function(callback) {
  11722. return window.setTimeout(callback, 1000 / 60);
  11723. };
  11724. }());
  11725. // -- DOM methods
  11726. helpers$1.getRelativePosition = function(evt, chart) {
  11727. var mouseX, mouseY;
  11728. var e = evt.originalEvent || evt;
  11729. var canvas = evt.target || evt.srcElement;
  11730. var boundingRect = canvas.getBoundingClientRect();
  11731. var touches = e.touches;
  11732. if (touches && touches.length > 0) {
  11733. mouseX = touches[0].clientX;
  11734. mouseY = touches[0].clientY;
  11735. } else {
  11736. mouseX = e.clientX;
  11737. mouseY = e.clientY;
  11738. }
  11739. // Scale mouse coordinates into canvas coordinates
  11740. // by following the pattern laid out by 'jerryj' in the comments of
  11741. // https://www.html5canvastutorials.com/advanced/html5-canvas-mouse-coordinates/
  11742. var paddingLeft = parseFloat(helpers$1.getStyle(canvas, 'padding-left'));
  11743. var paddingTop = parseFloat(helpers$1.getStyle(canvas, 'padding-top'));
  11744. var paddingRight = parseFloat(helpers$1.getStyle(canvas, 'padding-right'));
  11745. var paddingBottom = parseFloat(helpers$1.getStyle(canvas, 'padding-bottom'));
  11746. var width = boundingRect.right - boundingRect.left - paddingLeft - paddingRight;
  11747. var height = boundingRect.bottom - boundingRect.top - paddingTop - paddingBottom;
  11748. // We divide by the current device pixel ratio, because the canvas is scaled up by that amount in each direction. However
  11749. // the backend model is in unscaled coordinates. Since we are going to deal with our model coordinates, we go back here
  11750. mouseX = Math.round((mouseX - boundingRect.left - paddingLeft) / (width) * canvas.width / chart.currentDevicePixelRatio);
  11751. mouseY = Math.round((mouseY - boundingRect.top - paddingTop) / (height) * canvas.height / chart.currentDevicePixelRatio);
  11752. return {
  11753. x: mouseX,
  11754. y: mouseY
  11755. };
  11756. };
  11757. // Private helper function to convert max-width/max-height values that may be percentages into a number
  11758. function parseMaxStyle(styleValue, node, parentProperty) {
  11759. var valueInPixels;
  11760. if (typeof styleValue === 'string') {
  11761. valueInPixels = parseInt(styleValue, 10);
  11762. if (styleValue.indexOf('%') !== -1) {
  11763. // percentage * size in dimension
  11764. valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];
  11765. }
  11766. } else {
  11767. valueInPixels = styleValue;
  11768. }
  11769. return valueInPixels;
  11770. }
  11771. /**
  11772. * Returns if the given value contains an effective constraint.
  11773. * @private
  11774. */
  11775. function isConstrainedValue(value) {
  11776. return value !== undefined && value !== null && value !== 'none';
  11777. }
  11778. /**
  11779. * Returns the max width or height of the given DOM node in a cross-browser compatible fashion
  11780. * @param {HTMLElement} domNode - the node to check the constraint on
  11781. * @param {string} maxStyle - the style that defines the maximum for the direction we are using ('max-width' / 'max-height')
  11782. * @param {string} percentageProperty - property of parent to use when calculating width as a percentage
  11783. * @see {@link https://www.nathanaeljones.com/blog/2013/reading-max-width-cross-browser}
  11784. */
  11785. function getConstraintDimension(domNode, maxStyle, percentageProperty) {
  11786. var view = document.defaultView;
  11787. var parentNode = helpers$1._getParentNode(domNode);
  11788. var constrainedNode = view.getComputedStyle(domNode)[maxStyle];
  11789. var constrainedContainer = view.getComputedStyle(parentNode)[maxStyle];
  11790. var hasCNode = isConstrainedValue(constrainedNode);
  11791. var hasCContainer = isConstrainedValue(constrainedContainer);
  11792. var infinity = Number.POSITIVE_INFINITY;
  11793. if (hasCNode || hasCContainer) {
  11794. return Math.min(
  11795. hasCNode ? parseMaxStyle(constrainedNode, domNode, percentageProperty) : infinity,
  11796. hasCContainer ? parseMaxStyle(constrainedContainer, parentNode, percentageProperty) : infinity);
  11797. }
  11798. return 'none';
  11799. }
  11800. // returns Number or undefined if no constraint
  11801. helpers$1.getConstraintWidth = function(domNode) {
  11802. return getConstraintDimension(domNode, 'max-width', 'clientWidth');
  11803. };
  11804. // returns Number or undefined if no constraint
  11805. helpers$1.getConstraintHeight = function(domNode) {
  11806. return getConstraintDimension(domNode, 'max-height', 'clientHeight');
  11807. };
  11808. /**
  11809. * @private
  11810. */
  11811. helpers$1._calculatePadding = function(container, padding, parentDimension) {
  11812. padding = helpers$1.getStyle(container, padding);
  11813. return padding.indexOf('%') > -1 ? parentDimension * parseInt(padding, 10) / 100 : parseInt(padding, 10);
  11814. };
  11815. /**
  11816. * @private
  11817. */
  11818. helpers$1._getParentNode = function(domNode) {
  11819. var parent = domNode.parentNode;
  11820. if (parent && parent.toString() === '[object ShadowRoot]') {
  11821. parent = parent.host;
  11822. }
  11823. return parent;
  11824. };
  11825. helpers$1.getMaximumWidth = function(domNode) {
  11826. var container = helpers$1._getParentNode(domNode);
  11827. if (!container) {
  11828. return domNode.clientWidth;
  11829. }
  11830. var clientWidth = container.clientWidth;
  11831. var paddingLeft = helpers$1._calculatePadding(container, 'padding-left', clientWidth);
  11832. var paddingRight = helpers$1._calculatePadding(container, 'padding-right', clientWidth);
  11833. var w = clientWidth - paddingLeft - paddingRight;
  11834. var cw = helpers$1.getConstraintWidth(domNode);
  11835. return isNaN(cw) ? w : Math.min(w, cw);
  11836. };
  11837. helpers$1.getMaximumHeight = function(domNode) {
  11838. var container = helpers$1._getParentNode(domNode);
  11839. if (!container) {
  11840. return domNode.clientHeight;
  11841. }
  11842. var clientHeight = container.clientHeight;
  11843. var paddingTop = helpers$1._calculatePadding(container, 'padding-top', clientHeight);
  11844. var paddingBottom = helpers$1._calculatePadding(container, 'padding-bottom', clientHeight);
  11845. var h = clientHeight - paddingTop - paddingBottom;
  11846. var ch = helpers$1.getConstraintHeight(domNode);
  11847. return isNaN(ch) ? h : Math.min(h, ch);
  11848. };
  11849. helpers$1.getStyle = function(el, property) {
  11850. return el.currentStyle ?
  11851. el.currentStyle[property] :
  11852. document.defaultView.getComputedStyle(el, null).getPropertyValue(property);
  11853. };
  11854. helpers$1.retinaScale = function(chart, forceRatio) {
  11855. var pixelRatio = chart.currentDevicePixelRatio = forceRatio || (typeof window !== 'undefined' && window.devicePixelRatio) || 1;
  11856. if (pixelRatio === 1) {
  11857. return;
  11858. }
  11859. var canvas = chart.canvas;
  11860. var height = chart.height;
  11861. var width = chart.width;
  11862. canvas.height = height * pixelRatio;
  11863. canvas.width = width * pixelRatio;
  11864. chart.ctx.scale(pixelRatio, pixelRatio);
  11865. // If no style has been set on the canvas, the render size is used as display size,
  11866. // making the chart visually bigger, so let's enforce it to the "correct" values.
  11867. // See https://github.com/chartjs/Chart.js/issues/3575
  11868. if (!canvas.style.height && !canvas.style.width) {
  11869. canvas.style.height = height + 'px';
  11870. canvas.style.width = width + 'px';
  11871. }
  11872. };
  11873. // -- Canvas methods
  11874. helpers$1.fontString = function(pixelSize, fontStyle, fontFamily) {
  11875. return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;
  11876. };
  11877. helpers$1.longestText = function(ctx, font, arrayOfThings, cache) {
  11878. cache = cache || {};
  11879. var data = cache.data = cache.data || {};
  11880. var gc = cache.garbageCollect = cache.garbageCollect || [];
  11881. if (cache.font !== font) {
  11882. data = cache.data = {};
  11883. gc = cache.garbageCollect = [];
  11884. cache.font = font;
  11885. }
  11886. ctx.font = font;
  11887. var longest = 0;
  11888. var ilen = arrayOfThings.length;
  11889. var i, j, jlen, thing, nestedThing;
  11890. for (i = 0; i < ilen; i++) {
  11891. thing = arrayOfThings[i];
  11892. // Undefined strings and arrays should not be measured
  11893. if (thing !== undefined && thing !== null && helpers$1.isArray(thing) !== true) {
  11894. longest = helpers$1.measureText(ctx, data, gc, longest, thing);
  11895. } else if (helpers$1.isArray(thing)) {
  11896. // if it is an array lets measure each element
  11897. // to do maybe simplify this function a bit so we can do this more recursively?
  11898. for (j = 0, jlen = thing.length; j < jlen; j++) {
  11899. nestedThing = thing[j];
  11900. // Undefined strings and arrays should not be measured
  11901. if (nestedThing !== undefined && nestedThing !== null && !helpers$1.isArray(nestedThing)) {
  11902. longest = helpers$1.measureText(ctx, data, gc, longest, nestedThing);
  11903. }
  11904. }
  11905. }
  11906. }
  11907. var gcLen = gc.length / 2;
  11908. if (gcLen > arrayOfThings.length) {
  11909. for (i = 0; i < gcLen; i++) {
  11910. delete data[gc[i]];
  11911. }
  11912. gc.splice(0, gcLen);
  11913. }
  11914. return longest;
  11915. };
  11916. helpers$1.measureText = function(ctx, data, gc, longest, string) {
  11917. var textWidth = data[string];
  11918. if (!textWidth) {
  11919. textWidth = data[string] = ctx.measureText(string).width;
  11920. gc.push(string);
  11921. }
  11922. if (textWidth > longest) {
  11923. longest = textWidth;
  11924. }
  11925. return longest;
  11926. };
  11927. /**
  11928. * @deprecated
  11929. */
  11930. helpers$1.numberOfLabelLines = function(arrayOfThings) {
  11931. var numberOfLines = 1;
  11932. helpers$1.each(arrayOfThings, function(thing) {
  11933. if (helpers$1.isArray(thing)) {
  11934. if (thing.length > numberOfLines) {
  11935. numberOfLines = thing.length;
  11936. }
  11937. }
  11938. });
  11939. return numberOfLines;
  11940. };
  11941. helpers$1.color = !chartjsColor ?
  11942. function(value) {
  11943. console.error('Color.js not found!');
  11944. return value;
  11945. } :
  11946. function(value) {
  11947. /* global CanvasGradient */
  11948. if (value instanceof CanvasGradient) {
  11949. value = core_defaults.global.defaultColor;
  11950. }
  11951. return chartjsColor(value);
  11952. };
  11953. helpers$1.getHoverColor = function(colorValue) {
  11954. /* global CanvasPattern */
  11955. return (colorValue instanceof CanvasPattern || colorValue instanceof CanvasGradient) ?
  11956. colorValue :
  11957. helpers$1.color(colorValue).saturate(0.5).darken(0.1).rgbString();
  11958. };
  11959. };
  11960. function abstract() {
  11961. throw new Error(
  11962. 'This method is not implemented: either no adapter can ' +
  11963. 'be found or an incomplete integration was provided.'
  11964. );
  11965. }
  11966. /**
  11967. * Date adapter (current used by the time scale)
  11968. * @namespace Chart._adapters._date
  11969. * @memberof Chart._adapters
  11970. * @private
  11971. */
  11972. /**
  11973. * Currently supported unit string values.
  11974. * @typedef {('millisecond'|'second'|'minute'|'hour'|'day'|'week'|'month'|'quarter'|'year')}
  11975. * @memberof Chart._adapters._date
  11976. * @name Unit
  11977. */
  11978. /**
  11979. * @class
  11980. */
  11981. function DateAdapter(options) {
  11982. this.options = options || {};
  11983. }
  11984. helpers$1.extend(DateAdapter.prototype, /** @lends DateAdapter */ {
  11985. /**
  11986. * Returns a map of time formats for the supported formatting units defined
  11987. * in Unit as well as 'datetime' representing a detailed date/time string.
  11988. * @returns {{string: string}}
  11989. */
  11990. formats: abstract,
  11991. /**
  11992. * Parses the given `value` and return the associated timestamp.
  11993. * @param {any} value - the value to parse (usually comes from the data)
  11994. * @param {string} [format] - the expected data format
  11995. * @returns {(number|null)}
  11996. * @function
  11997. */
  11998. parse: abstract,
  11999. /**
  12000. * Returns the formatted date in the specified `format` for a given `timestamp`.
  12001. * @param {number} timestamp - the timestamp to format
  12002. * @param {string} format - the date/time token
  12003. * @return {string}
  12004. * @function
  12005. */
  12006. format: abstract,
  12007. /**
  12008. * Adds the specified `amount` of `unit` to the given `timestamp`.
  12009. * @param {number} timestamp - the input timestamp
  12010. * @param {number} amount - the amount to add
  12011. * @param {Unit} unit - the unit as string
  12012. * @return {number}
  12013. * @function
  12014. */
  12015. add: abstract,
  12016. /**
  12017. * Returns the number of `unit` between the given timestamps.
  12018. * @param {number} max - the input timestamp (reference)
  12019. * @param {number} min - the timestamp to substract
  12020. * @param {Unit} unit - the unit as string
  12021. * @return {number}
  12022. * @function
  12023. */
  12024. diff: abstract,
  12025. /**
  12026. * Returns start of `unit` for the given `timestamp`.
  12027. * @param {number} timestamp - the input timestamp
  12028. * @param {Unit} unit - the unit as string
  12029. * @param {number} [weekday] - the ISO day of the week with 1 being Monday
  12030. * and 7 being Sunday (only needed if param *unit* is `isoWeek`).
  12031. * @function
  12032. */
  12033. startOf: abstract,
  12034. /**
  12035. * Returns end of `unit` for the given `timestamp`.
  12036. * @param {number} timestamp - the input timestamp
  12037. * @param {Unit} unit - the unit as string
  12038. * @function
  12039. */
  12040. endOf: abstract,
  12041. // DEPRECATIONS
  12042. /**
  12043. * Provided for backward compatibility for scale.getValueForPixel(),
  12044. * this method should be overridden only by the moment adapter.
  12045. * @deprecated since version 2.8.0
  12046. * @todo remove at version 3
  12047. * @private
  12048. */
  12049. _create: function(value) {
  12050. return value;
  12051. }
  12052. });
  12053. DateAdapter.override = function(members) {
  12054. helpers$1.extend(DateAdapter.prototype, members);
  12055. };
  12056. var _date = DateAdapter;
  12057. var core_adapters = {
  12058. _date: _date
  12059. };
  12060. /**
  12061. * Namespace to hold static tick generation functions
  12062. * @namespace Chart.Ticks
  12063. */
  12064. var core_ticks = {
  12065. /**
  12066. * Namespace to hold formatters for different types of ticks
  12067. * @namespace Chart.Ticks.formatters
  12068. */
  12069. formatters: {
  12070. /**
  12071. * Formatter for value labels
  12072. * @method Chart.Ticks.formatters.values
  12073. * @param value the value to display
  12074. * @return {string|string[]} the label to display
  12075. */
  12076. values: function(value) {
  12077. return helpers$1.isArray(value) ? value : '' + value;
  12078. },
  12079. /**
  12080. * Formatter for linear numeric ticks
  12081. * @method Chart.Ticks.formatters.linear
  12082. * @param tickValue {number} the value to be formatted
  12083. * @param index {number} the position of the tickValue parameter in the ticks array
  12084. * @param ticks {number[]} the list of ticks being converted
  12085. * @return {string} string representation of the tickValue parameter
  12086. */
  12087. linear: function(tickValue, index, ticks) {
  12088. // If we have lots of ticks, don't use the ones
  12089. var delta = ticks.length > 3 ? ticks[2] - ticks[1] : ticks[1] - ticks[0];
  12090. // If we have a number like 2.5 as the delta, figure out how many decimal places we need
  12091. if (Math.abs(delta) > 1) {
  12092. if (tickValue !== Math.floor(tickValue)) {
  12093. // not an integer
  12094. delta = tickValue - Math.floor(tickValue);
  12095. }
  12096. }
  12097. var logDelta = helpers$1.log10(Math.abs(delta));
  12098. var tickString = '';
  12099. if (tickValue !== 0) {
  12100. var maxTick = Math.max(Math.abs(ticks[0]), Math.abs(ticks[ticks.length - 1]));
  12101. if (maxTick < 1e-4) { // all ticks are small numbers; use scientific notation
  12102. var logTick = helpers$1.log10(Math.abs(tickValue));
  12103. var numExponential = Math.floor(logTick) - Math.floor(logDelta);
  12104. numExponential = Math.max(Math.min(numExponential, 20), 0);
  12105. tickString = tickValue.toExponential(numExponential);
  12106. } else {
  12107. var numDecimal = -1 * Math.floor(logDelta);
  12108. numDecimal = Math.max(Math.min(numDecimal, 20), 0); // toFixed has a max of 20 decimal places
  12109. tickString = tickValue.toFixed(numDecimal);
  12110. }
  12111. } else {
  12112. tickString = '0'; // never show decimal places for 0
  12113. }
  12114. return tickString;
  12115. },
  12116. logarithmic: function(tickValue, index, ticks) {
  12117. var remain = tickValue / (Math.pow(10, Math.floor(helpers$1.log10(tickValue))));
  12118. if (tickValue === 0) {
  12119. return '0';
  12120. } else if (remain === 1 || remain === 2 || remain === 5 || index === 0 || index === ticks.length - 1) {
  12121. return tickValue.toExponential();
  12122. }
  12123. return '';
  12124. }
  12125. }
  12126. };
  12127. var isArray = helpers$1.isArray;
  12128. var isNullOrUndef = helpers$1.isNullOrUndef;
  12129. var valueOrDefault$a = helpers$1.valueOrDefault;
  12130. var valueAtIndexOrDefault = helpers$1.valueAtIndexOrDefault;
  12131. core_defaults._set('scale', {
  12132. display: true,
  12133. position: 'left',
  12134. offset: false,
  12135. // grid line settings
  12136. gridLines: {
  12137. display: true,
  12138. color: 'rgba(0,0,0,0.1)',
  12139. lineWidth: 1,
  12140. drawBorder: true,
  12141. drawOnChartArea: true,
  12142. drawTicks: true,
  12143. tickMarkLength: 10,
  12144. zeroLineWidth: 1,
  12145. zeroLineColor: 'rgba(0,0,0,0.25)',
  12146. zeroLineBorderDash: [],
  12147. zeroLineBorderDashOffset: 0.0,
  12148. offsetGridLines: false,
  12149. borderDash: [],
  12150. borderDashOffset: 0.0
  12151. },
  12152. // scale label
  12153. scaleLabel: {
  12154. // display property
  12155. display: false,
  12156. // actual label
  12157. labelString: '',
  12158. // top/bottom padding
  12159. padding: {
  12160. top: 4,
  12161. bottom: 4
  12162. }
  12163. },
  12164. // label settings
  12165. ticks: {
  12166. beginAtZero: false,
  12167. minRotation: 0,
  12168. maxRotation: 50,
  12169. mirror: false,
  12170. padding: 0,
  12171. reverse: false,
  12172. display: true,
  12173. autoSkip: true,
  12174. autoSkipPadding: 0,
  12175. labelOffset: 0,
  12176. // We pass through arrays to be rendered as multiline labels, we convert Others to strings here.
  12177. callback: core_ticks.formatters.values,
  12178. minor: {},
  12179. major: {}
  12180. }
  12181. });
  12182. /** Returns a new array containing numItems from arr */
  12183. function sample(arr, numItems) {
  12184. var result = [];
  12185. var increment = arr.length / numItems;
  12186. var i = 0;
  12187. var len = arr.length;
  12188. for (; i < len; i += increment) {
  12189. result.push(arr[Math.floor(i)]);
  12190. }
  12191. return result;
  12192. }
  12193. function getPixelForGridLine(scale, index, offsetGridLines) {
  12194. var length = scale.getTicks().length;
  12195. var validIndex = Math.min(index, length - 1);
  12196. var lineValue = scale.getPixelForTick(validIndex);
  12197. var start = scale._startPixel;
  12198. var end = scale._endPixel;
  12199. var epsilon = 1e-6; // 1e-6 is margin in pixels for accumulated error.
  12200. var offset;
  12201. if (offsetGridLines) {
  12202. if (length === 1) {
  12203. offset = Math.max(lineValue - start, end - lineValue);
  12204. } else if (index === 0) {
  12205. offset = (scale.getPixelForTick(1) - lineValue) / 2;
  12206. } else {
  12207. offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;
  12208. }
  12209. lineValue += validIndex < index ? offset : -offset;
  12210. // Return undefined if the pixel is out of the range
  12211. if (lineValue < start - epsilon || lineValue > end + epsilon) {
  12212. return;
  12213. }
  12214. }
  12215. return lineValue;
  12216. }
  12217. function garbageCollect(caches, length) {
  12218. helpers$1.each(caches, function(cache) {
  12219. var gc = cache.gc;
  12220. var gcLen = gc.length / 2;
  12221. var i;
  12222. if (gcLen > length) {
  12223. for (i = 0; i < gcLen; ++i) {
  12224. delete cache.data[gc[i]];
  12225. }
  12226. gc.splice(0, gcLen);
  12227. }
  12228. });
  12229. }
  12230. /**
  12231. * Returns {width, height, offset} objects for the first, last, widest, highest tick
  12232. * labels where offset indicates the anchor point offset from the top in pixels.
  12233. */
  12234. function computeLabelSizes(ctx, tickFonts, ticks, caches) {
  12235. var length = ticks.length;
  12236. var widths = [];
  12237. var heights = [];
  12238. var offsets = [];
  12239. var widestLabelSize = 0;
  12240. var highestLabelSize = 0;
  12241. var i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel, widest, highest;
  12242. for (i = 0; i < length; ++i) {
  12243. label = ticks[i].label;
  12244. tickFont = ticks[i].major ? tickFonts.major : tickFonts.minor;
  12245. ctx.font = fontString = tickFont.string;
  12246. cache = caches[fontString] = caches[fontString] || {data: {}, gc: []};
  12247. lineHeight = tickFont.lineHeight;
  12248. width = height = 0;
  12249. // Undefined labels and arrays should not be measured
  12250. if (!isNullOrUndef(label) && !isArray(label)) {
  12251. width = helpers$1.measureText(ctx, cache.data, cache.gc, width, label);
  12252. height = lineHeight;
  12253. } else if (isArray(label)) {
  12254. // if it is an array let's measure each element
  12255. for (j = 0, jlen = label.length; j < jlen; ++j) {
  12256. nestedLabel = label[j];
  12257. // Undefined labels and arrays should not be measured
  12258. if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {
  12259. width = helpers$1.measureText(ctx, cache.data, cache.gc, width, nestedLabel);
  12260. height += lineHeight;
  12261. }
  12262. }
  12263. }
  12264. widths.push(width);
  12265. heights.push(height);
  12266. offsets.push(lineHeight / 2);
  12267. widestLabelSize = Math.max(width, widestLabelSize);
  12268. highestLabelSize = Math.max(height, highestLabelSize);
  12269. }
  12270. garbageCollect(caches, length);
  12271. widest = widths.indexOf(widestLabelSize);
  12272. highest = heights.indexOf(highestLabelSize);
  12273. function valueAt(idx) {
  12274. return {
  12275. width: widths[idx] || 0,
  12276. height: heights[idx] || 0,
  12277. offset: offsets[idx] || 0
  12278. };
  12279. }
  12280. return {
  12281. first: valueAt(0),
  12282. last: valueAt(length - 1),
  12283. widest: valueAt(widest),
  12284. highest: valueAt(highest)
  12285. };
  12286. }
  12287. function getTickMarkLength(options) {
  12288. return options.drawTicks ? options.tickMarkLength : 0;
  12289. }
  12290. function getScaleLabelHeight(options) {
  12291. var font, padding;
  12292. if (!options.display) {
  12293. return 0;
  12294. }
  12295. font = helpers$1.options._parseFont(options);
  12296. padding = helpers$1.options.toPadding(options.padding);
  12297. return font.lineHeight + padding.height;
  12298. }
  12299. function parseFontOptions(options, nestedOpts) {
  12300. return helpers$1.extend(helpers$1.options._parseFont({
  12301. fontFamily: valueOrDefault$a(nestedOpts.fontFamily, options.fontFamily),
  12302. fontSize: valueOrDefault$a(nestedOpts.fontSize, options.fontSize),
  12303. fontStyle: valueOrDefault$a(nestedOpts.fontStyle, options.fontStyle),
  12304. lineHeight: valueOrDefault$a(nestedOpts.lineHeight, options.lineHeight)
  12305. }), {
  12306. color: helpers$1.options.resolve([nestedOpts.fontColor, options.fontColor, core_defaults.global.defaultFontColor])
  12307. });
  12308. }
  12309. function parseTickFontOptions(options) {
  12310. var minor = parseFontOptions(options, options.minor);
  12311. var major = options.major.enabled ? parseFontOptions(options, options.major) : minor;
  12312. return {minor: minor, major: major};
  12313. }
  12314. function nonSkipped(ticksToFilter) {
  12315. var filtered = [];
  12316. var item, index, len;
  12317. for (index = 0, len = ticksToFilter.length; index < len; ++index) {
  12318. item = ticksToFilter[index];
  12319. if (typeof item._index !== 'undefined') {
  12320. filtered.push(item);
  12321. }
  12322. }
  12323. return filtered;
  12324. }
  12325. function getEvenSpacing(arr) {
  12326. var len = arr.length;
  12327. var i, diff;
  12328. if (len < 2) {
  12329. return false;
  12330. }
  12331. for (diff = arr[0], i = 1; i < len; ++i) {
  12332. if (arr[i] - arr[i - 1] !== diff) {
  12333. return false;
  12334. }
  12335. }
  12336. return diff;
  12337. }
  12338. function calculateSpacing(majorIndices, ticks, axisLength, ticksLimit) {
  12339. var evenMajorSpacing = getEvenSpacing(majorIndices);
  12340. var spacing = (ticks.length - 1) / ticksLimit;
  12341. var factors, factor, i, ilen;
  12342. // If the major ticks are evenly spaced apart, place the minor ticks
  12343. // so that they divide the major ticks into even chunks
  12344. if (!evenMajorSpacing) {
  12345. return Math.max(spacing, 1);
  12346. }
  12347. factors = helpers$1.math._factorize(evenMajorSpacing);
  12348. for (i = 0, ilen = factors.length - 1; i < ilen; i++) {
  12349. factor = factors[i];
  12350. if (factor > spacing) {
  12351. return factor;
  12352. }
  12353. }
  12354. return Math.max(spacing, 1);
  12355. }
  12356. function getMajorIndices(ticks) {
  12357. var result = [];
  12358. var i, ilen;
  12359. for (i = 0, ilen = ticks.length; i < ilen; i++) {
  12360. if (ticks[i].major) {
  12361. result.push(i);
  12362. }
  12363. }
  12364. return result;
  12365. }
  12366. function skipMajors(ticks, majorIndices, spacing) {
  12367. var count = 0;
  12368. var next = majorIndices[0];
  12369. var i, tick;
  12370. spacing = Math.ceil(spacing);
  12371. for (i = 0; i < ticks.length; i++) {
  12372. tick = ticks[i];
  12373. if (i === next) {
  12374. tick._index = i;
  12375. count++;
  12376. next = majorIndices[count * spacing];
  12377. } else {
  12378. delete tick.label;
  12379. }
  12380. }
  12381. }
  12382. function skip(ticks, spacing, majorStart, majorEnd) {
  12383. var start = valueOrDefault$a(majorStart, 0);
  12384. var end = Math.min(valueOrDefault$a(majorEnd, ticks.length), ticks.length);
  12385. var count = 0;
  12386. var length, i, tick, next;
  12387. spacing = Math.ceil(spacing);
  12388. if (majorEnd) {
  12389. length = majorEnd - majorStart;
  12390. spacing = length / Math.floor(length / spacing);
  12391. }
  12392. next = start;
  12393. while (next < 0) {
  12394. count++;
  12395. next = Math.round(start + count * spacing);
  12396. }
  12397. for (i = Math.max(start, 0); i < end; i++) {
  12398. tick = ticks[i];
  12399. if (i === next) {
  12400. tick._index = i;
  12401. count++;
  12402. next = Math.round(start + count * spacing);
  12403. } else {
  12404. delete tick.label;
  12405. }
  12406. }
  12407. }
  12408. var Scale = core_element.extend({
  12409. zeroLineIndex: 0,
  12410. /**
  12411. * Get the padding needed for the scale
  12412. * @method getPadding
  12413. * @private
  12414. * @returns {Padding} the necessary padding
  12415. */
  12416. getPadding: function() {
  12417. var me = this;
  12418. return {
  12419. left: me.paddingLeft || 0,
  12420. top: me.paddingTop || 0,
  12421. right: me.paddingRight || 0,
  12422. bottom: me.paddingBottom || 0
  12423. };
  12424. },
  12425. /**
  12426. * Returns the scale tick objects ({label, major})
  12427. * @since 2.7
  12428. */
  12429. getTicks: function() {
  12430. return this._ticks;
  12431. },
  12432. /**
  12433. * @private
  12434. */
  12435. _getLabels: function() {
  12436. var data = this.chart.data;
  12437. return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];
  12438. },
  12439. // These methods are ordered by lifecyle. Utilities then follow.
  12440. // Any function defined here is inherited by all scale types.
  12441. // Any function can be extended by the scale type
  12442. /**
  12443. * Provided for backward compatibility, not available anymore
  12444. * @function Chart.Scale.mergeTicksOptions
  12445. * @deprecated since version 2.8.0
  12446. * @todo remove at version 3
  12447. */
  12448. mergeTicksOptions: function() {
  12449. // noop
  12450. },
  12451. beforeUpdate: function() {
  12452. helpers$1.callback(this.options.beforeUpdate, [this]);
  12453. },
  12454. /**
  12455. * @param {number} maxWidth - the max width in pixels
  12456. * @param {number} maxHeight - the max height in pixels
  12457. * @param {object} margins - the space between the edge of the other scales and edge of the chart
  12458. * This space comes from two sources:
  12459. * - padding - space that's required to show the labels at the edges of the scale
  12460. * - thickness of scales or legends in another orientation
  12461. */
  12462. update: function(maxWidth, maxHeight, margins) {
  12463. var me = this;
  12464. var tickOpts = me.options.ticks;
  12465. var sampleSize = tickOpts.sampleSize;
  12466. var i, ilen, labels, ticks, samplingEnabled;
  12467. // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)
  12468. me.beforeUpdate();
  12469. // Absorb the master measurements
  12470. me.maxWidth = maxWidth;
  12471. me.maxHeight = maxHeight;
  12472. me.margins = helpers$1.extend({
  12473. left: 0,
  12474. right: 0,
  12475. top: 0,
  12476. bottom: 0
  12477. }, margins);
  12478. me._ticks = null;
  12479. me.ticks = null;
  12480. me._labelSizes = null;
  12481. me._maxLabelLines = 0;
  12482. me.longestLabelWidth = 0;
  12483. me.longestTextCache = me.longestTextCache || {};
  12484. me._gridLineItems = null;
  12485. me._labelItems = null;
  12486. // Dimensions
  12487. me.beforeSetDimensions();
  12488. me.setDimensions();
  12489. me.afterSetDimensions();
  12490. // Data min/max
  12491. me.beforeDataLimits();
  12492. me.determineDataLimits();
  12493. me.afterDataLimits();
  12494. // Ticks - `this.ticks` is now DEPRECATED!
  12495. // Internal ticks are now stored as objects in the PRIVATE `this._ticks` member
  12496. // and must not be accessed directly from outside this class. `this.ticks` being
  12497. // around for long time and not marked as private, we can't change its structure
  12498. // without unexpected breaking changes. If you need to access the scale ticks,
  12499. // use scale.getTicks() instead.
  12500. me.beforeBuildTicks();
  12501. // New implementations should return an array of objects but for BACKWARD COMPAT,
  12502. // we still support no return (`this.ticks` internally set by calling this method).
  12503. ticks = me.buildTicks() || [];
  12504. // Allow modification of ticks in callback.
  12505. ticks = me.afterBuildTicks(ticks) || ticks;
  12506. // Ensure ticks contains ticks in new tick format
  12507. if ((!ticks || !ticks.length) && me.ticks) {
  12508. ticks = [];
  12509. for (i = 0, ilen = me.ticks.length; i < ilen; ++i) {
  12510. ticks.push({
  12511. value: me.ticks[i],
  12512. major: false
  12513. });
  12514. }
  12515. }
  12516. me._ticks = ticks;
  12517. // Compute tick rotation and fit using a sampled subset of labels
  12518. // We generally don't need to compute the size of every single label for determining scale size
  12519. samplingEnabled = sampleSize < ticks.length;
  12520. labels = me._convertTicksToLabels(samplingEnabled ? sample(ticks, sampleSize) : ticks);
  12521. // _configure is called twice, once here, once from core.controller.updateLayout.
  12522. // Here we haven't been positioned yet, but dimensions are correct.
  12523. // Variables set in _configure are needed for calculateTickRotation, and
  12524. // it's ok that coordinates are not correct there, only dimensions matter.
  12525. me._configure();
  12526. // Tick Rotation
  12527. me.beforeCalculateTickRotation();
  12528. me.calculateTickRotation();
  12529. me.afterCalculateTickRotation();
  12530. me.beforeFit();
  12531. me.fit();
  12532. me.afterFit();
  12533. // Auto-skip
  12534. me._ticksToDraw = tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto') ? me._autoSkip(ticks) : ticks;
  12535. if (samplingEnabled) {
  12536. // Generate labels using all non-skipped ticks
  12537. labels = me._convertTicksToLabels(me._ticksToDraw);
  12538. }
  12539. me.ticks = labels; // BACKWARD COMPATIBILITY
  12540. // IMPORTANT: after this point, we consider that `this.ticks` will NEVER change!
  12541. me.afterUpdate();
  12542. // TODO(v3): remove minSize as a public property and return value from all layout boxes. It is unused
  12543. // make maxWidth and maxHeight private
  12544. return me.minSize;
  12545. },
  12546. /**
  12547. * @private
  12548. */
  12549. _configure: function() {
  12550. var me = this;
  12551. var reversePixels = me.options.ticks.reverse;
  12552. var startPixel, endPixel;
  12553. if (me.isHorizontal()) {
  12554. startPixel = me.left;
  12555. endPixel = me.right;
  12556. } else {
  12557. startPixel = me.top;
  12558. endPixel = me.bottom;
  12559. // by default vertical scales are from bottom to top, so pixels are reversed
  12560. reversePixels = !reversePixels;
  12561. }
  12562. me._startPixel = startPixel;
  12563. me._endPixel = endPixel;
  12564. me._reversePixels = reversePixels;
  12565. me._length = endPixel - startPixel;
  12566. },
  12567. afterUpdate: function() {
  12568. helpers$1.callback(this.options.afterUpdate, [this]);
  12569. },
  12570. //
  12571. beforeSetDimensions: function() {
  12572. helpers$1.callback(this.options.beforeSetDimensions, [this]);
  12573. },
  12574. setDimensions: function() {
  12575. var me = this;
  12576. // Set the unconstrained dimension before label rotation
  12577. if (me.isHorizontal()) {
  12578. // Reset position before calculating rotation
  12579. me.width = me.maxWidth;
  12580. me.left = 0;
  12581. me.right = me.width;
  12582. } else {
  12583. me.height = me.maxHeight;
  12584. // Reset position before calculating rotation
  12585. me.top = 0;
  12586. me.bottom = me.height;
  12587. }
  12588. // Reset padding
  12589. me.paddingLeft = 0;
  12590. me.paddingTop = 0;
  12591. me.paddingRight = 0;
  12592. me.paddingBottom = 0;
  12593. },
  12594. afterSetDimensions: function() {
  12595. helpers$1.callback(this.options.afterSetDimensions, [this]);
  12596. },
  12597. // Data limits
  12598. beforeDataLimits: function() {
  12599. helpers$1.callback(this.options.beforeDataLimits, [this]);
  12600. },
  12601. determineDataLimits: helpers$1.noop,
  12602. afterDataLimits: function() {
  12603. helpers$1.callback(this.options.afterDataLimits, [this]);
  12604. },
  12605. //
  12606. beforeBuildTicks: function() {
  12607. helpers$1.callback(this.options.beforeBuildTicks, [this]);
  12608. },
  12609. buildTicks: helpers$1.noop,
  12610. afterBuildTicks: function(ticks) {
  12611. var me = this;
  12612. // ticks is empty for old axis implementations here
  12613. if (isArray(ticks) && ticks.length) {
  12614. return helpers$1.callback(me.options.afterBuildTicks, [me, ticks]);
  12615. }
  12616. // Support old implementations (that modified `this.ticks` directly in buildTicks)
  12617. me.ticks = helpers$1.callback(me.options.afterBuildTicks, [me, me.ticks]) || me.ticks;
  12618. return ticks;
  12619. },
  12620. beforeTickToLabelConversion: function() {
  12621. helpers$1.callback(this.options.beforeTickToLabelConversion, [this]);
  12622. },
  12623. convertTicksToLabels: function() {
  12624. var me = this;
  12625. // Convert ticks to strings
  12626. var tickOpts = me.options.ticks;
  12627. me.ticks = me.ticks.map(tickOpts.userCallback || tickOpts.callback, this);
  12628. },
  12629. afterTickToLabelConversion: function() {
  12630. helpers$1.callback(this.options.afterTickToLabelConversion, [this]);
  12631. },
  12632. //
  12633. beforeCalculateTickRotation: function() {
  12634. helpers$1.callback(this.options.beforeCalculateTickRotation, [this]);
  12635. },
  12636. calculateTickRotation: function() {
  12637. var me = this;
  12638. var options = me.options;
  12639. var tickOpts = options.ticks;
  12640. var numTicks = me.getTicks().length;
  12641. var minRotation = tickOpts.minRotation || 0;
  12642. var maxRotation = tickOpts.maxRotation;
  12643. var labelRotation = minRotation;
  12644. var labelSizes, maxLabelWidth, maxLabelHeight, maxWidth, tickWidth, maxHeight, maxLabelDiagonal;
  12645. if (!me._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !me.isHorizontal()) {
  12646. me.labelRotation = minRotation;
  12647. return;
  12648. }
  12649. labelSizes = me._getLabelSizes();
  12650. maxLabelWidth = labelSizes.widest.width;
  12651. maxLabelHeight = labelSizes.highest.height - labelSizes.highest.offset;
  12652. // Estimate the width of each grid based on the canvas width, the maximum
  12653. // label width and the number of tick intervals
  12654. maxWidth = Math.min(me.maxWidth, me.chart.width - maxLabelWidth);
  12655. tickWidth = options.offset ? me.maxWidth / numTicks : maxWidth / (numTicks - 1);
  12656. // Allow 3 pixels x2 padding either side for label readability
  12657. if (maxLabelWidth + 6 > tickWidth) {
  12658. tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));
  12659. maxHeight = me.maxHeight - getTickMarkLength(options.gridLines)
  12660. - tickOpts.padding - getScaleLabelHeight(options.scaleLabel);
  12661. maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);
  12662. labelRotation = helpers$1.toDegrees(Math.min(
  12663. Math.asin(Math.min((labelSizes.highest.height + 6) / tickWidth, 1)),
  12664. Math.asin(Math.min(maxHeight / maxLabelDiagonal, 1)) - Math.asin(maxLabelHeight / maxLabelDiagonal)
  12665. ));
  12666. labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));
  12667. }
  12668. me.labelRotation = labelRotation;
  12669. },
  12670. afterCalculateTickRotation: function() {
  12671. helpers$1.callback(this.options.afterCalculateTickRotation, [this]);
  12672. },
  12673. //
  12674. beforeFit: function() {
  12675. helpers$1.callback(this.options.beforeFit, [this]);
  12676. },
  12677. fit: function() {
  12678. var me = this;
  12679. // Reset
  12680. var minSize = me.minSize = {
  12681. width: 0,
  12682. height: 0
  12683. };
  12684. var chart = me.chart;
  12685. var opts = me.options;
  12686. var tickOpts = opts.ticks;
  12687. var scaleLabelOpts = opts.scaleLabel;
  12688. var gridLineOpts = opts.gridLines;
  12689. var display = me._isVisible();
  12690. var isBottom = opts.position === 'bottom';
  12691. var isHorizontal = me.isHorizontal();
  12692. // Width
  12693. if (isHorizontal) {
  12694. minSize.width = me.maxWidth;
  12695. } else if (display) {
  12696. minSize.width = getTickMarkLength(gridLineOpts) + getScaleLabelHeight(scaleLabelOpts);
  12697. }
  12698. // height
  12699. if (!isHorizontal) {
  12700. minSize.height = me.maxHeight; // fill all the height
  12701. } else if (display) {
  12702. minSize.height = getTickMarkLength(gridLineOpts) + getScaleLabelHeight(scaleLabelOpts);
  12703. }
  12704. // Don't bother fitting the ticks if we are not showing the labels
  12705. if (tickOpts.display && display) {
  12706. var tickFonts = parseTickFontOptions(tickOpts);
  12707. var labelSizes = me._getLabelSizes();
  12708. var firstLabelSize = labelSizes.first;
  12709. var lastLabelSize = labelSizes.last;
  12710. var widestLabelSize = labelSizes.widest;
  12711. var highestLabelSize = labelSizes.highest;
  12712. var lineSpace = tickFonts.minor.lineHeight * 0.4;
  12713. var tickPadding = tickOpts.padding;
  12714. if (isHorizontal) {
  12715. // A horizontal axis is more constrained by the height.
  12716. var isRotated = me.labelRotation !== 0;
  12717. var angleRadians = helpers$1.toRadians(me.labelRotation);
  12718. var cosRotation = Math.cos(angleRadians);
  12719. var sinRotation = Math.sin(angleRadians);
  12720. var labelHeight = sinRotation * widestLabelSize.width
  12721. + cosRotation * (highestLabelSize.height - (isRotated ? highestLabelSize.offset : 0))
  12722. + (isRotated ? 0 : lineSpace); // padding
  12723. minSize.height = Math.min(me.maxHeight, minSize.height + labelHeight + tickPadding);
  12724. var offsetLeft = me.getPixelForTick(0) - me.left;
  12725. var offsetRight = me.right - me.getPixelForTick(me.getTicks().length - 1);
  12726. var paddingLeft, paddingRight;
  12727. // Ensure that our ticks are always inside the canvas. When rotated, ticks are right aligned
  12728. // which means that the right padding is dominated by the font height
  12729. if (isRotated) {
  12730. paddingLeft = isBottom ?
  12731. cosRotation * firstLabelSize.width + sinRotation * firstLabelSize.offset :
  12732. sinRotation * (firstLabelSize.height - firstLabelSize.offset);
  12733. paddingRight = isBottom ?
  12734. sinRotation * (lastLabelSize.height - lastLabelSize.offset) :
  12735. cosRotation * lastLabelSize.width + sinRotation * lastLabelSize.offset;
  12736. } else {
  12737. paddingLeft = firstLabelSize.width / 2;
  12738. paddingRight = lastLabelSize.width / 2;
  12739. }
  12740. // Adjust padding taking into account changes in offsets
  12741. // and add 3 px to move away from canvas edges
  12742. me.paddingLeft = Math.max((paddingLeft - offsetLeft) * me.width / (me.width - offsetLeft), 0) + 3;
  12743. me.paddingRight = Math.max((paddingRight - offsetRight) * me.width / (me.width - offsetRight), 0) + 3;
  12744. } else {
  12745. // A vertical axis is more constrained by the width. Labels are the
  12746. // dominant factor here, so get that length first and account for padding
  12747. var labelWidth = tickOpts.mirror ? 0 :
  12748. // use lineSpace for consistency with horizontal axis
  12749. // tickPadding is not implemented for horizontal
  12750. widestLabelSize.width + tickPadding + lineSpace;
  12751. minSize.width = Math.min(me.maxWidth, minSize.width + labelWidth);
  12752. me.paddingTop = firstLabelSize.height / 2;
  12753. me.paddingBottom = lastLabelSize.height / 2;
  12754. }
  12755. }
  12756. me.handleMargins();
  12757. if (isHorizontal) {
  12758. me.width = me._length = chart.width - me.margins.left - me.margins.right;
  12759. me.height = minSize.height;
  12760. } else {
  12761. me.width = minSize.width;
  12762. me.height = me._length = chart.height - me.margins.top - me.margins.bottom;
  12763. }
  12764. },
  12765. /**
  12766. * Handle margins and padding interactions
  12767. * @private
  12768. */
  12769. handleMargins: function() {
  12770. var me = this;
  12771. if (me.margins) {
  12772. me.margins.left = Math.max(me.paddingLeft, me.margins.left);
  12773. me.margins.top = Math.max(me.paddingTop, me.margins.top);
  12774. me.margins.right = Math.max(me.paddingRight, me.margins.right);
  12775. me.margins.bottom = Math.max(me.paddingBottom, me.margins.bottom);
  12776. }
  12777. },
  12778. afterFit: function() {
  12779. helpers$1.callback(this.options.afterFit, [this]);
  12780. },
  12781. // Shared Methods
  12782. isHorizontal: function() {
  12783. var pos = this.options.position;
  12784. return pos === 'top' || pos === 'bottom';
  12785. },
  12786. isFullWidth: function() {
  12787. return this.options.fullWidth;
  12788. },
  12789. // Get the correct value. NaN bad inputs, If the value type is object get the x or y based on whether we are horizontal or not
  12790. getRightValue: function(rawValue) {
  12791. // Null and undefined values first
  12792. if (isNullOrUndef(rawValue)) {
  12793. return NaN;
  12794. }
  12795. // isNaN(object) returns true, so make sure NaN is checking for a number; Discard Infinite values
  12796. if ((typeof rawValue === 'number' || rawValue instanceof Number) && !isFinite(rawValue)) {
  12797. return NaN;
  12798. }
  12799. // If it is in fact an object, dive in one more level
  12800. if (rawValue) {
  12801. if (this.isHorizontal()) {
  12802. if (rawValue.x !== undefined) {
  12803. return this.getRightValue(rawValue.x);
  12804. }
  12805. } else if (rawValue.y !== undefined) {
  12806. return this.getRightValue(rawValue.y);
  12807. }
  12808. }
  12809. // Value is good, return it
  12810. return rawValue;
  12811. },
  12812. _convertTicksToLabels: function(ticks) {
  12813. var me = this;
  12814. var labels, i, ilen;
  12815. me.ticks = ticks.map(function(tick) {
  12816. return tick.value;
  12817. });
  12818. me.beforeTickToLabelConversion();
  12819. // New implementations should return the formatted tick labels but for BACKWARD
  12820. // COMPAT, we still support no return (`this.ticks` internally changed by calling
  12821. // this method and supposed to contain only string values).
  12822. labels = me.convertTicksToLabels(ticks) || me.ticks;
  12823. me.afterTickToLabelConversion();
  12824. // BACKWARD COMPAT: synchronize `_ticks` with labels (so potentially `this.ticks`)
  12825. for (i = 0, ilen = ticks.length; i < ilen; ++i) {
  12826. ticks[i].label = labels[i];
  12827. }
  12828. return labels;
  12829. },
  12830. /**
  12831. * @private
  12832. */
  12833. _getLabelSizes: function() {
  12834. var me = this;
  12835. var labelSizes = me._labelSizes;
  12836. if (!labelSizes) {
  12837. me._labelSizes = labelSizes = computeLabelSizes(me.ctx, parseTickFontOptions(me.options.ticks), me.getTicks(), me.longestTextCache);
  12838. me.longestLabelWidth = labelSizes.widest.width;
  12839. }
  12840. return labelSizes;
  12841. },
  12842. /**
  12843. * @private
  12844. */
  12845. _parseValue: function(value) {
  12846. var start, end, min, max;
  12847. if (isArray(value)) {
  12848. start = +this.getRightValue(value[0]);
  12849. end = +this.getRightValue(value[1]);
  12850. min = Math.min(start, end);
  12851. max = Math.max(start, end);
  12852. } else {
  12853. value = +this.getRightValue(value);
  12854. start = undefined;
  12855. end = value;
  12856. min = value;
  12857. max = value;
  12858. }
  12859. return {
  12860. min: min,
  12861. max: max,
  12862. start: start,
  12863. end: end
  12864. };
  12865. },
  12866. /**
  12867. * @private
  12868. */
  12869. _getScaleLabel: function(rawValue) {
  12870. var v = this._parseValue(rawValue);
  12871. if (v.start !== undefined) {
  12872. return '[' + v.start + ', ' + v.end + ']';
  12873. }
  12874. return +this.getRightValue(rawValue);
  12875. },
  12876. /**
  12877. * Used to get the value to display in the tooltip for the data at the given index
  12878. * @param index
  12879. * @param datasetIndex
  12880. */
  12881. getLabelForIndex: helpers$1.noop,
  12882. /**
  12883. * Returns the location of the given data point. Value can either be an index or a numerical value
  12884. * The coordinate (0, 0) is at the upper-left corner of the canvas
  12885. * @param value
  12886. * @param index
  12887. * @param datasetIndex
  12888. */
  12889. getPixelForValue: helpers$1.noop,
  12890. /**
  12891. * Used to get the data value from a given pixel. This is the inverse of getPixelForValue
  12892. * The coordinate (0, 0) is at the upper-left corner of the canvas
  12893. * @param pixel
  12894. */
  12895. getValueForPixel: helpers$1.noop,
  12896. /**
  12897. * Returns the location of the tick at the given index
  12898. * The coordinate (0, 0) is at the upper-left corner of the canvas
  12899. */
  12900. getPixelForTick: function(index) {
  12901. var me = this;
  12902. var offset = me.options.offset;
  12903. var numTicks = me._ticks.length;
  12904. var tickWidth = 1 / Math.max(numTicks - (offset ? 0 : 1), 1);
  12905. return index < 0 || index > numTicks - 1
  12906. ? null
  12907. : me.getPixelForDecimal(index * tickWidth + (offset ? tickWidth / 2 : 0));
  12908. },
  12909. /**
  12910. * Utility for getting the pixel location of a percentage of scale
  12911. * The coordinate (0, 0) is at the upper-left corner of the canvas
  12912. */
  12913. getPixelForDecimal: function(decimal) {
  12914. var me = this;
  12915. if (me._reversePixels) {
  12916. decimal = 1 - decimal;
  12917. }
  12918. return me._startPixel + decimal * me._length;
  12919. },
  12920. getDecimalForPixel: function(pixel) {
  12921. var decimal = (pixel - this._startPixel) / this._length;
  12922. return this._reversePixels ? 1 - decimal : decimal;
  12923. },
  12924. /**
  12925. * Returns the pixel for the minimum chart value
  12926. * The coordinate (0, 0) is at the upper-left corner of the canvas
  12927. */
  12928. getBasePixel: function() {
  12929. return this.getPixelForValue(this.getBaseValue());
  12930. },
  12931. getBaseValue: function() {
  12932. var me = this;
  12933. var min = me.min;
  12934. var max = me.max;
  12935. return me.beginAtZero ? 0 :
  12936. min < 0 && max < 0 ? max :
  12937. min > 0 && max > 0 ? min :
  12938. 0;
  12939. },
  12940. /**
  12941. * Returns a subset of ticks to be plotted to avoid overlapping labels.
  12942. * @private
  12943. */
  12944. _autoSkip: function(ticks) {
  12945. var me = this;
  12946. var tickOpts = me.options.ticks;
  12947. var axisLength = me._length;
  12948. var ticksLimit = tickOpts.maxTicksLimit || axisLength / me._tickSize() + 1;
  12949. var majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];
  12950. var numMajorIndices = majorIndices.length;
  12951. var first = majorIndices[0];
  12952. var last = majorIndices[numMajorIndices - 1];
  12953. var i, ilen, spacing, avgMajorSpacing;
  12954. // If there are too many major ticks to display them all
  12955. if (numMajorIndices > ticksLimit) {
  12956. skipMajors(ticks, majorIndices, numMajorIndices / ticksLimit);
  12957. return nonSkipped(ticks);
  12958. }
  12959. spacing = calculateSpacing(majorIndices, ticks, axisLength, ticksLimit);
  12960. if (numMajorIndices > 0) {
  12961. for (i = 0, ilen = numMajorIndices - 1; i < ilen; i++) {
  12962. skip(ticks, spacing, majorIndices[i], majorIndices[i + 1]);
  12963. }
  12964. avgMajorSpacing = numMajorIndices > 1 ? (last - first) / (numMajorIndices - 1) : null;
  12965. skip(ticks, spacing, helpers$1.isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);
  12966. skip(ticks, spacing, last, helpers$1.isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);
  12967. return nonSkipped(ticks);
  12968. }
  12969. skip(ticks, spacing);
  12970. return nonSkipped(ticks);
  12971. },
  12972. /**
  12973. * @private
  12974. */
  12975. _tickSize: function() {
  12976. var me = this;
  12977. var optionTicks = me.options.ticks;
  12978. // Calculate space needed by label in axis direction.
  12979. var rot = helpers$1.toRadians(me.labelRotation);
  12980. var cos = Math.abs(Math.cos(rot));
  12981. var sin = Math.abs(Math.sin(rot));
  12982. var labelSizes = me._getLabelSizes();
  12983. var padding = optionTicks.autoSkipPadding || 0;
  12984. var w = labelSizes ? labelSizes.widest.width + padding : 0;
  12985. var h = labelSizes ? labelSizes.highest.height + padding : 0;
  12986. // Calculate space needed for 1 tick in axis direction.
  12987. return me.isHorizontal()
  12988. ? h * cos > w * sin ? w / cos : h / sin
  12989. : h * sin < w * cos ? h / cos : w / sin;
  12990. },
  12991. /**
  12992. * @private
  12993. */
  12994. _isVisible: function() {
  12995. var me = this;
  12996. var chart = me.chart;
  12997. var display = me.options.display;
  12998. var i, ilen, meta;
  12999. if (display !== 'auto') {
  13000. return !!display;
  13001. }
  13002. // When 'auto', the scale is visible if at least one associated dataset is visible.
  13003. for (i = 0, ilen = chart.data.datasets.length; i < ilen; ++i) {
  13004. if (chart.isDatasetVisible(i)) {
  13005. meta = chart.getDatasetMeta(i);
  13006. if (meta.xAxisID === me.id || meta.yAxisID === me.id) {
  13007. return true;
  13008. }
  13009. }
  13010. }
  13011. return false;
  13012. },
  13013. /**
  13014. * @private
  13015. */
  13016. _computeGridLineItems: function(chartArea) {
  13017. var me = this;
  13018. var chart = me.chart;
  13019. var options = me.options;
  13020. var gridLines = options.gridLines;
  13021. var position = options.position;
  13022. var offsetGridLines = gridLines.offsetGridLines;
  13023. var isHorizontal = me.isHorizontal();
  13024. var ticks = me._ticksToDraw;
  13025. var ticksLength = ticks.length + (offsetGridLines ? 1 : 0);
  13026. var tl = getTickMarkLength(gridLines);
  13027. var items = [];
  13028. var axisWidth = gridLines.drawBorder ? valueAtIndexOrDefault(gridLines.lineWidth, 0, 0) : 0;
  13029. var axisHalfWidth = axisWidth / 2;
  13030. var alignPixel = helpers$1._alignPixel;
  13031. var alignBorderValue = function(pixel) {
  13032. return alignPixel(chart, pixel, axisWidth);
  13033. };
  13034. var borderValue, i, tick, lineValue, alignedLineValue;
  13035. var tx1, ty1, tx2, ty2, x1, y1, x2, y2, lineWidth, lineColor, borderDash, borderDashOffset;
  13036. if (position === 'top') {
  13037. borderValue = alignBorderValue(me.bottom);
  13038. ty1 = me.bottom - tl;
  13039. ty2 = borderValue - axisHalfWidth;
  13040. y1 = alignBorderValue(chartArea.top) + axisHalfWidth;
  13041. y2 = chartArea.bottom;
  13042. } else if (position === 'bottom') {
  13043. borderValue = alignBorderValue(me.top);
  13044. y1 = chartArea.top;
  13045. y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;
  13046. ty1 = borderValue + axisHalfWidth;
  13047. ty2 = me.top + tl;
  13048. } else if (position === 'left') {
  13049. borderValue = alignBorderValue(me.right);
  13050. tx1 = me.right - tl;
  13051. tx2 = borderValue - axisHalfWidth;
  13052. x1 = alignBorderValue(chartArea.left) + axisHalfWidth;
  13053. x2 = chartArea.right;
  13054. } else {
  13055. borderValue = alignBorderValue(me.left);
  13056. x1 = chartArea.left;
  13057. x2 = alignBorderValue(chartArea.right) - axisHalfWidth;
  13058. tx1 = borderValue + axisHalfWidth;
  13059. tx2 = me.left + tl;
  13060. }
  13061. for (i = 0; i < ticksLength; ++i) {
  13062. tick = ticks[i] || {};
  13063. // autoskipper skipped this tick (#4635)
  13064. if (isNullOrUndef(tick.label) && i < ticks.length) {
  13065. continue;
  13066. }
  13067. if (i === me.zeroLineIndex && options.offset === offsetGridLines) {
  13068. // Draw the first index specially
  13069. lineWidth = gridLines.zeroLineWidth;
  13070. lineColor = gridLines.zeroLineColor;
  13071. borderDash = gridLines.zeroLineBorderDash || [];
  13072. borderDashOffset = gridLines.zeroLineBorderDashOffset || 0.0;
  13073. } else {
  13074. lineWidth = valueAtIndexOrDefault(gridLines.lineWidth, i, 1);
  13075. lineColor = valueAtIndexOrDefault(gridLines.color, i, 'rgba(0,0,0,0.1)');
  13076. borderDash = gridLines.borderDash || [];
  13077. borderDashOffset = gridLines.borderDashOffset || 0.0;
  13078. }
  13079. lineValue = getPixelForGridLine(me, tick._index || i, offsetGridLines);
  13080. // Skip if the pixel is out of the range
  13081. if (lineValue === undefined) {
  13082. continue;
  13083. }
  13084. alignedLineValue = alignPixel(chart, lineValue, lineWidth);
  13085. if (isHorizontal) {
  13086. tx1 = tx2 = x1 = x2 = alignedLineValue;
  13087. } else {
  13088. ty1 = ty2 = y1 = y2 = alignedLineValue;
  13089. }
  13090. items.push({
  13091. tx1: tx1,
  13092. ty1: ty1,
  13093. tx2: tx2,
  13094. ty2: ty2,
  13095. x1: x1,
  13096. y1: y1,
  13097. x2: x2,
  13098. y2: y2,
  13099. width: lineWidth,
  13100. color: lineColor,
  13101. borderDash: borderDash,
  13102. borderDashOffset: borderDashOffset,
  13103. });
  13104. }
  13105. items.ticksLength = ticksLength;
  13106. items.borderValue = borderValue;
  13107. return items;
  13108. },
  13109. /**
  13110. * @private
  13111. */
  13112. _computeLabelItems: function() {
  13113. var me = this;
  13114. var options = me.options;
  13115. var optionTicks = options.ticks;
  13116. var position = options.position;
  13117. var isMirrored = optionTicks.mirror;
  13118. var isHorizontal = me.isHorizontal();
  13119. var ticks = me._ticksToDraw;
  13120. var fonts = parseTickFontOptions(optionTicks);
  13121. var tickPadding = optionTicks.padding;
  13122. var tl = getTickMarkLength(options.gridLines);
  13123. var rotation = -helpers$1.toRadians(me.labelRotation);
  13124. var items = [];
  13125. var i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;
  13126. if (position === 'top') {
  13127. y = me.bottom - tl - tickPadding;
  13128. textAlign = !rotation ? 'center' : 'left';
  13129. } else if (position === 'bottom') {
  13130. y = me.top + tl + tickPadding;
  13131. textAlign = !rotation ? 'center' : 'right';
  13132. } else if (position === 'left') {
  13133. x = me.right - (isMirrored ? 0 : tl) - tickPadding;
  13134. textAlign = isMirrored ? 'left' : 'right';
  13135. } else {
  13136. x = me.left + (isMirrored ? 0 : tl) + tickPadding;
  13137. textAlign = isMirrored ? 'right' : 'left';
  13138. }
  13139. for (i = 0, ilen = ticks.length; i < ilen; ++i) {
  13140. tick = ticks[i];
  13141. label = tick.label;
  13142. // autoskipper skipped this tick (#4635)
  13143. if (isNullOrUndef(label)) {
  13144. continue;
  13145. }
  13146. pixel = me.getPixelForTick(tick._index || i) + optionTicks.labelOffset;
  13147. font = tick.major ? fonts.major : fonts.minor;
  13148. lineHeight = font.lineHeight;
  13149. lineCount = isArray(label) ? label.length : 1;
  13150. if (isHorizontal) {
  13151. x = pixel;
  13152. textOffset = position === 'top'
  13153. ? ((!rotation ? 0.5 : 1) - lineCount) * lineHeight
  13154. : (!rotation ? 0.5 : 0) * lineHeight;
  13155. } else {
  13156. y = pixel;
  13157. textOffset = (1 - lineCount) * lineHeight / 2;
  13158. }
  13159. items.push({
  13160. x: x,
  13161. y: y,
  13162. rotation: rotation,
  13163. label: label,
  13164. font: font,
  13165. textOffset: textOffset,
  13166. textAlign: textAlign
  13167. });
  13168. }
  13169. return items;
  13170. },
  13171. /**
  13172. * @private
  13173. */
  13174. _drawGrid: function(chartArea) {
  13175. var me = this;
  13176. var gridLines = me.options.gridLines;
  13177. if (!gridLines.display) {
  13178. return;
  13179. }
  13180. var ctx = me.ctx;
  13181. var chart = me.chart;
  13182. var alignPixel = helpers$1._alignPixel;
  13183. var axisWidth = gridLines.drawBorder ? valueAtIndexOrDefault(gridLines.lineWidth, 0, 0) : 0;
  13184. var items = me._gridLineItems || (me._gridLineItems = me._computeGridLineItems(chartArea));
  13185. var width, color, i, ilen, item;
  13186. for (i = 0, ilen = items.length; i < ilen; ++i) {
  13187. item = items[i];
  13188. width = item.width;
  13189. color = item.color;
  13190. if (width && color) {
  13191. ctx.save();
  13192. ctx.lineWidth = width;
  13193. ctx.strokeStyle = color;
  13194. if (ctx.setLineDash) {
  13195. ctx.setLineDash(item.borderDash);
  13196. ctx.lineDashOffset = item.borderDashOffset;
  13197. }
  13198. ctx.beginPath();
  13199. if (gridLines.drawTicks) {
  13200. ctx.moveTo(item.tx1, item.ty1);
  13201. ctx.lineTo(item.tx2, item.ty2);
  13202. }
  13203. if (gridLines.drawOnChartArea) {
  13204. ctx.moveTo(item.x1, item.y1);
  13205. ctx.lineTo(item.x2, item.y2);
  13206. }
  13207. ctx.stroke();
  13208. ctx.restore();
  13209. }
  13210. }
  13211. if (axisWidth) {
  13212. // Draw the line at the edge of the axis
  13213. var firstLineWidth = axisWidth;
  13214. var lastLineWidth = valueAtIndexOrDefault(gridLines.lineWidth, items.ticksLength - 1, 1);
  13215. var borderValue = items.borderValue;
  13216. var x1, x2, y1, y2;
  13217. if (me.isHorizontal()) {
  13218. x1 = alignPixel(chart, me.left, firstLineWidth) - firstLineWidth / 2;
  13219. x2 = alignPixel(chart, me.right, lastLineWidth) + lastLineWidth / 2;
  13220. y1 = y2 = borderValue;
  13221. } else {
  13222. y1 = alignPixel(chart, me.top, firstLineWidth) - firstLineWidth / 2;
  13223. y2 = alignPixel(chart, me.bottom, lastLineWidth) + lastLineWidth / 2;
  13224. x1 = x2 = borderValue;
  13225. }
  13226. ctx.lineWidth = axisWidth;
  13227. ctx.strokeStyle = valueAtIndexOrDefault(gridLines.color, 0);
  13228. ctx.beginPath();
  13229. ctx.moveTo(x1, y1);
  13230. ctx.lineTo(x2, y2);
  13231. ctx.stroke();
  13232. }
  13233. },
  13234. /**
  13235. * @private
  13236. */
  13237. _drawLabels: function() {
  13238. var me = this;
  13239. var optionTicks = me.options.ticks;
  13240. if (!optionTicks.display) {
  13241. return;
  13242. }
  13243. var ctx = me.ctx;
  13244. var items = me._labelItems || (me._labelItems = me._computeLabelItems());
  13245. var i, j, ilen, jlen, item, tickFont, label, y;
  13246. for (i = 0, ilen = items.length; i < ilen; ++i) {
  13247. item = items[i];
  13248. tickFont = item.font;
  13249. // Make sure we draw text in the correct color and font
  13250. ctx.save();
  13251. ctx.translate(item.x, item.y);
  13252. ctx.rotate(item.rotation);
  13253. ctx.font = tickFont.string;
  13254. ctx.fillStyle = tickFont.color;
  13255. ctx.textBaseline = 'middle';
  13256. ctx.textAlign = item.textAlign;
  13257. label = item.label;
  13258. y = item.textOffset;
  13259. if (isArray(label)) {
  13260. for (j = 0, jlen = label.length; j < jlen; ++j) {
  13261. // We just make sure the multiline element is a string here..
  13262. ctx.fillText('' + label[j], 0, y);
  13263. y += tickFont.lineHeight;
  13264. }
  13265. } else {
  13266. ctx.fillText(label, 0, y);
  13267. }
  13268. ctx.restore();
  13269. }
  13270. },
  13271. /**
  13272. * @private
  13273. */
  13274. _drawTitle: function() {
  13275. var me = this;
  13276. var ctx = me.ctx;
  13277. var options = me.options;
  13278. var scaleLabel = options.scaleLabel;
  13279. if (!scaleLabel.display) {
  13280. return;
  13281. }
  13282. var scaleLabelFontColor = valueOrDefault$a(scaleLabel.fontColor, core_defaults.global.defaultFontColor);
  13283. var scaleLabelFont = helpers$1.options._parseFont(scaleLabel);
  13284. var scaleLabelPadding = helpers$1.options.toPadding(scaleLabel.padding);
  13285. var halfLineHeight = scaleLabelFont.lineHeight / 2;
  13286. var position = options.position;
  13287. var rotation = 0;
  13288. var scaleLabelX, scaleLabelY;
  13289. if (me.isHorizontal()) {
  13290. scaleLabelX = me.left + me.width / 2; // midpoint of the width
  13291. scaleLabelY = position === 'bottom'
  13292. ? me.bottom - halfLineHeight - scaleLabelPadding.bottom
  13293. : me.top + halfLineHeight + scaleLabelPadding.top;
  13294. } else {
  13295. var isLeft = position === 'left';
  13296. scaleLabelX = isLeft
  13297. ? me.left + halfLineHeight + scaleLabelPadding.top
  13298. : me.right - halfLineHeight - scaleLabelPadding.top;
  13299. scaleLabelY = me.top + me.height / 2;
  13300. rotation = isLeft ? -0.5 * Math.PI : 0.5 * Math.PI;
  13301. }
  13302. ctx.save();
  13303. ctx.translate(scaleLabelX, scaleLabelY);
  13304. ctx.rotate(rotation);
  13305. ctx.textAlign = 'center';
  13306. ctx.textBaseline = 'middle';
  13307. ctx.fillStyle = scaleLabelFontColor; // render in correct colour
  13308. ctx.font = scaleLabelFont.string;
  13309. ctx.fillText(scaleLabel.labelString, 0, 0);
  13310. ctx.restore();
  13311. },
  13312. draw: function(chartArea) {
  13313. var me = this;
  13314. if (!me._isVisible()) {
  13315. return;
  13316. }
  13317. me._drawGrid(chartArea);
  13318. me._drawTitle();
  13319. me._drawLabels();
  13320. },
  13321. /**
  13322. * @private
  13323. */
  13324. _layers: function() {
  13325. var me = this;
  13326. var opts = me.options;
  13327. var tz = opts.ticks && opts.ticks.z || 0;
  13328. var gz = opts.gridLines && opts.gridLines.z || 0;
  13329. if (!me._isVisible() || tz === gz || me.draw !== me._draw) {
  13330. // backward compatibility: draw has been overridden by custom scale
  13331. return [{
  13332. z: tz,
  13333. draw: function() {
  13334. me.draw.apply(me, arguments);
  13335. }
  13336. }];
  13337. }
  13338. return [{
  13339. z: gz,
  13340. draw: function() {
  13341. me._drawGrid.apply(me, arguments);
  13342. me._drawTitle.apply(me, arguments);
  13343. }
  13344. }, {
  13345. z: tz,
  13346. draw: function() {
  13347. me._drawLabels.apply(me, arguments);
  13348. }
  13349. }];
  13350. },
  13351. /**
  13352. * @private
  13353. */
  13354. _getMatchingVisibleMetas: function(type) {
  13355. var me = this;
  13356. var isHorizontal = me.isHorizontal();
  13357. return me.chart._getSortedVisibleDatasetMetas()
  13358. .filter(function(meta) {
  13359. return (!type || meta.type === type)
  13360. && (isHorizontal ? meta.xAxisID === me.id : meta.yAxisID === me.id);
  13361. });
  13362. }
  13363. });
  13364. Scale.prototype._draw = Scale.prototype.draw;
  13365. var core_scale = Scale;
  13366. var isNullOrUndef$1 = helpers$1.isNullOrUndef;
  13367. var defaultConfig = {
  13368. position: 'bottom'
  13369. };
  13370. var scale_category = core_scale.extend({
  13371. determineDataLimits: function() {
  13372. var me = this;
  13373. var labels = me._getLabels();
  13374. var ticksOpts = me.options.ticks;
  13375. var min = ticksOpts.min;
  13376. var max = ticksOpts.max;
  13377. var minIndex = 0;
  13378. var maxIndex = labels.length - 1;
  13379. var findIndex;
  13380. if (min !== undefined) {
  13381. // user specified min value
  13382. findIndex = labels.indexOf(min);
  13383. if (findIndex >= 0) {
  13384. minIndex = findIndex;
  13385. }
  13386. }
  13387. if (max !== undefined) {
  13388. // user specified max value
  13389. findIndex = labels.indexOf(max);
  13390. if (findIndex >= 0) {
  13391. maxIndex = findIndex;
  13392. }
  13393. }
  13394. me.minIndex = minIndex;
  13395. me.maxIndex = maxIndex;
  13396. me.min = labels[minIndex];
  13397. me.max = labels[maxIndex];
  13398. },
  13399. buildTicks: function() {
  13400. var me = this;
  13401. var labels = me._getLabels();
  13402. var minIndex = me.minIndex;
  13403. var maxIndex = me.maxIndex;
  13404. // If we are viewing some subset of labels, slice the original array
  13405. me.ticks = (minIndex === 0 && maxIndex === labels.length - 1) ? labels : labels.slice(minIndex, maxIndex + 1);
  13406. },
  13407. getLabelForIndex: function(index, datasetIndex) {
  13408. var me = this;
  13409. var chart = me.chart;
  13410. if (chart.getDatasetMeta(datasetIndex).controller._getValueScaleId() === me.id) {
  13411. return me.getRightValue(chart.data.datasets[datasetIndex].data[index]);
  13412. }
  13413. return me._getLabels()[index];
  13414. },
  13415. _configure: function() {
  13416. var me = this;
  13417. var offset = me.options.offset;
  13418. var ticks = me.ticks;
  13419. core_scale.prototype._configure.call(me);
  13420. if (!me.isHorizontal()) {
  13421. // For backward compatibility, vertical category scale reverse is inverted.
  13422. me._reversePixels = !me._reversePixels;
  13423. }
  13424. if (!ticks) {
  13425. return;
  13426. }
  13427. me._startValue = me.minIndex - (offset ? 0.5 : 0);
  13428. me._valueRange = Math.max(ticks.length - (offset ? 0 : 1), 1);
  13429. },
  13430. // Used to get data value locations. Value can either be an index or a numerical value
  13431. getPixelForValue: function(value, index, datasetIndex) {
  13432. var me = this;
  13433. var valueCategory, labels, idx;
  13434. if (!isNullOrUndef$1(index) && !isNullOrUndef$1(datasetIndex)) {
  13435. value = me.chart.data.datasets[datasetIndex].data[index];
  13436. }
  13437. // If value is a data object, then index is the index in the data array,
  13438. // not the index of the scale. We need to change that.
  13439. if (!isNullOrUndef$1(value)) {
  13440. valueCategory = me.isHorizontal() ? value.x : value.y;
  13441. }
  13442. if (valueCategory !== undefined || (value !== undefined && isNaN(index))) {
  13443. labels = me._getLabels();
  13444. value = helpers$1.valueOrDefault(valueCategory, value);
  13445. idx = labels.indexOf(value);
  13446. index = idx !== -1 ? idx : index;
  13447. if (isNaN(index)) {
  13448. index = value;
  13449. }
  13450. }
  13451. return me.getPixelForDecimal((index - me._startValue) / me._valueRange);
  13452. },
  13453. getPixelForTick: function(index) {
  13454. var ticks = this.ticks;
  13455. return index < 0 || index > ticks.length - 1
  13456. ? null
  13457. : this.getPixelForValue(ticks[index], index + this.minIndex);
  13458. },
  13459. getValueForPixel: function(pixel) {
  13460. var me = this;
  13461. var value = Math.round(me._startValue + me.getDecimalForPixel(pixel) * me._valueRange);
  13462. return Math.min(Math.max(value, 0), me.ticks.length - 1);
  13463. },
  13464. getBasePixel: function() {
  13465. return this.bottom;
  13466. }
  13467. });
  13468. // INTERNAL: static default options, registered in src/index.js
  13469. var _defaults = defaultConfig;
  13470. scale_category._defaults = _defaults;
  13471. var noop = helpers$1.noop;
  13472. var isNullOrUndef$2 = helpers$1.isNullOrUndef;
  13473. /**
  13474. * Generate a set of linear ticks
  13475. * @param generationOptions the options used to generate the ticks
  13476. * @param dataRange the range of the data
  13477. * @returns {number[]} array of tick values
  13478. */
  13479. function generateTicks(generationOptions, dataRange) {
  13480. var ticks = [];
  13481. // To get a "nice" value for the tick spacing, we will use the appropriately named
  13482. // "nice number" algorithm. See https://stackoverflow.com/questions/8506881/nice-label-algorithm-for-charts-with-minimum-ticks
  13483. // for details.
  13484. var MIN_SPACING = 1e-14;
  13485. var stepSize = generationOptions.stepSize;
  13486. var unit = stepSize || 1;
  13487. var maxNumSpaces = generationOptions.maxTicks - 1;
  13488. var min = generationOptions.min;
  13489. var max = generationOptions.max;
  13490. var precision = generationOptions.precision;
  13491. var rmin = dataRange.min;
  13492. var rmax = dataRange.max;
  13493. var spacing = helpers$1.niceNum((rmax - rmin) / maxNumSpaces / unit) * unit;
  13494. var factor, niceMin, niceMax, numSpaces;
  13495. // Beyond MIN_SPACING floating point numbers being to lose precision
  13496. // such that we can't do the math necessary to generate ticks
  13497. if (spacing < MIN_SPACING && isNullOrUndef$2(min) && isNullOrUndef$2(max)) {
  13498. return [rmin, rmax];
  13499. }
  13500. numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);
  13501. if (numSpaces > maxNumSpaces) {
  13502. // If the calculated num of spaces exceeds maxNumSpaces, recalculate it
  13503. spacing = helpers$1.niceNum(numSpaces * spacing / maxNumSpaces / unit) * unit;
  13504. }
  13505. if (stepSize || isNullOrUndef$2(precision)) {
  13506. // If a precision is not specified, calculate factor based on spacing
  13507. factor = Math.pow(10, helpers$1._decimalPlaces(spacing));
  13508. } else {
  13509. // If the user specified a precision, round to that number of decimal places
  13510. factor = Math.pow(10, precision);
  13511. spacing = Math.ceil(spacing * factor) / factor;
  13512. }
  13513. niceMin = Math.floor(rmin / spacing) * spacing;
  13514. niceMax = Math.ceil(rmax / spacing) * spacing;
  13515. // If min, max and stepSize is set and they make an evenly spaced scale use it.
  13516. if (stepSize) {
  13517. // If very close to our whole number, use it.
  13518. if (!isNullOrUndef$2(min) && helpers$1.almostWhole(min / spacing, spacing / 1000)) {
  13519. niceMin = min;
  13520. }
  13521. if (!isNullOrUndef$2(max) && helpers$1.almostWhole(max / spacing, spacing / 1000)) {
  13522. niceMax = max;
  13523. }
  13524. }
  13525. numSpaces = (niceMax - niceMin) / spacing;
  13526. // If very close to our rounded value, use it.
  13527. if (helpers$1.almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {
  13528. numSpaces = Math.round(numSpaces);
  13529. } else {
  13530. numSpaces = Math.ceil(numSpaces);
  13531. }
  13532. niceMin = Math.round(niceMin * factor) / factor;
  13533. niceMax = Math.round(niceMax * factor) / factor;
  13534. ticks.push(isNullOrUndef$2(min) ? niceMin : min);
  13535. for (var j = 1; j < numSpaces; ++j) {
  13536. ticks.push(Math.round((niceMin + j * spacing) * factor) / factor);
  13537. }
  13538. ticks.push(isNullOrUndef$2(max) ? niceMax : max);
  13539. return ticks;
  13540. }
  13541. var scale_linearbase = core_scale.extend({
  13542. getRightValue: function(value) {
  13543. if (typeof value === 'string') {
  13544. return +value;
  13545. }
  13546. return core_scale.prototype.getRightValue.call(this, value);
  13547. },
  13548. handleTickRangeOptions: function() {
  13549. var me = this;
  13550. var opts = me.options;
  13551. var tickOpts = opts.ticks;
  13552. // If we are forcing it to begin at 0, but 0 will already be rendered on the chart,
  13553. // do nothing since that would make the chart weird. If the user really wants a weird chart
  13554. // axis, they can manually override it
  13555. if (tickOpts.beginAtZero) {
  13556. var minSign = helpers$1.sign(me.min);
  13557. var maxSign = helpers$1.sign(me.max);
  13558. if (minSign < 0 && maxSign < 0) {
  13559. // move the top up to 0
  13560. me.max = 0;
  13561. } else if (minSign > 0 && maxSign > 0) {
  13562. // move the bottom down to 0
  13563. me.min = 0;
  13564. }
  13565. }
  13566. var setMin = tickOpts.min !== undefined || tickOpts.suggestedMin !== undefined;
  13567. var setMax = tickOpts.max !== undefined || tickOpts.suggestedMax !== undefined;
  13568. if (tickOpts.min !== undefined) {
  13569. me.min = tickOpts.min;
  13570. } else if (tickOpts.suggestedMin !== undefined) {
  13571. if (me.min === null) {
  13572. me.min = tickOpts.suggestedMin;
  13573. } else {
  13574. me.min = Math.min(me.min, tickOpts.suggestedMin);
  13575. }
  13576. }
  13577. if (tickOpts.max !== undefined) {
  13578. me.max = tickOpts.max;
  13579. } else if (tickOpts.suggestedMax !== undefined) {
  13580. if (me.max === null) {
  13581. me.max = tickOpts.suggestedMax;
  13582. } else {
  13583. me.max = Math.max(me.max, tickOpts.suggestedMax);
  13584. }
  13585. }
  13586. if (setMin !== setMax) {
  13587. // We set the min or the max but not both.
  13588. // So ensure that our range is good
  13589. // Inverted or 0 length range can happen when
  13590. // ticks.min is set, and no datasets are visible
  13591. if (me.min >= me.max) {
  13592. if (setMin) {
  13593. me.max = me.min + 1;
  13594. } else {
  13595. me.min = me.max - 1;
  13596. }
  13597. }
  13598. }
  13599. if (me.min === me.max) {
  13600. me.max++;
  13601. if (!tickOpts.beginAtZero) {
  13602. me.min--;
  13603. }
  13604. }
  13605. },
  13606. getTickLimit: function() {
  13607. var me = this;
  13608. var tickOpts = me.options.ticks;
  13609. var stepSize = tickOpts.stepSize;
  13610. var maxTicksLimit = tickOpts.maxTicksLimit;
  13611. var maxTicks;
  13612. if (stepSize) {
  13613. maxTicks = Math.ceil(me.max / stepSize) - Math.floor(me.min / stepSize) + 1;
  13614. } else {
  13615. maxTicks = me._computeTickLimit();
  13616. maxTicksLimit = maxTicksLimit || 11;
  13617. }
  13618. if (maxTicksLimit) {
  13619. maxTicks = Math.min(maxTicksLimit, maxTicks);
  13620. }
  13621. return maxTicks;
  13622. },
  13623. _computeTickLimit: function() {
  13624. return Number.POSITIVE_INFINITY;
  13625. },
  13626. handleDirectionalChanges: noop,
  13627. buildTicks: function() {
  13628. var me = this;
  13629. var opts = me.options;
  13630. var tickOpts = opts.ticks;
  13631. // Figure out what the max number of ticks we can support it is based on the size of
  13632. // the axis area. For now, we say that the minimum tick spacing in pixels must be 40
  13633. // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on
  13634. // the graph. Make sure we always have at least 2 ticks
  13635. var maxTicks = me.getTickLimit();
  13636. maxTicks = Math.max(2, maxTicks);
  13637. var numericGeneratorOptions = {
  13638. maxTicks: maxTicks,
  13639. min: tickOpts.min,
  13640. max: tickOpts.max,
  13641. precision: tickOpts.precision,
  13642. stepSize: helpers$1.valueOrDefault(tickOpts.fixedStepSize, tickOpts.stepSize)
  13643. };
  13644. var ticks = me.ticks = generateTicks(numericGeneratorOptions, me);
  13645. me.handleDirectionalChanges();
  13646. // At this point, we need to update our max and min given the tick values since we have expanded the
  13647. // range of the scale
  13648. me.max = helpers$1.max(ticks);
  13649. me.min = helpers$1.min(ticks);
  13650. if (tickOpts.reverse) {
  13651. ticks.reverse();
  13652. me.start = me.max;
  13653. me.end = me.min;
  13654. } else {
  13655. me.start = me.min;
  13656. me.end = me.max;
  13657. }
  13658. },
  13659. convertTicksToLabels: function() {
  13660. var me = this;
  13661. me.ticksAsNumbers = me.ticks.slice();
  13662. me.zeroLineIndex = me.ticks.indexOf(0);
  13663. core_scale.prototype.convertTicksToLabels.call(me);
  13664. },
  13665. _configure: function() {
  13666. var me = this;
  13667. var ticks = me.getTicks();
  13668. var start = me.min;
  13669. var end = me.max;
  13670. var offset;
  13671. core_scale.prototype._configure.call(me);
  13672. if (me.options.offset && ticks.length) {
  13673. offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;
  13674. start -= offset;
  13675. end += offset;
  13676. }
  13677. me._startValue = start;
  13678. me._endValue = end;
  13679. me._valueRange = end - start;
  13680. }
  13681. });
  13682. var defaultConfig$1 = {
  13683. position: 'left',
  13684. ticks: {
  13685. callback: core_ticks.formatters.linear
  13686. }
  13687. };
  13688. var DEFAULT_MIN = 0;
  13689. var DEFAULT_MAX = 1;
  13690. function getOrCreateStack(stacks, stacked, meta) {
  13691. var key = [
  13692. meta.type,
  13693. // we have a separate stack for stack=undefined datasets when the opts.stacked is undefined
  13694. stacked === undefined && meta.stack === undefined ? meta.index : '',
  13695. meta.stack
  13696. ].join('.');
  13697. if (stacks[key] === undefined) {
  13698. stacks[key] = {
  13699. pos: [],
  13700. neg: []
  13701. };
  13702. }
  13703. return stacks[key];
  13704. }
  13705. function stackData(scale, stacks, meta, data) {
  13706. var opts = scale.options;
  13707. var stacked = opts.stacked;
  13708. var stack = getOrCreateStack(stacks, stacked, meta);
  13709. var pos = stack.pos;
  13710. var neg = stack.neg;
  13711. var ilen = data.length;
  13712. var i, value;
  13713. for (i = 0; i < ilen; ++i) {
  13714. value = scale._parseValue(data[i]);
  13715. if (isNaN(value.min) || isNaN(value.max) || meta.data[i].hidden) {
  13716. continue;
  13717. }
  13718. pos[i] = pos[i] || 0;
  13719. neg[i] = neg[i] || 0;
  13720. if (opts.relativePoints) {
  13721. pos[i] = 100;
  13722. } else if (value.min < 0 || value.max < 0) {
  13723. neg[i] += value.min;
  13724. } else {
  13725. pos[i] += value.max;
  13726. }
  13727. }
  13728. }
  13729. function updateMinMax(scale, meta, data) {
  13730. var ilen = data.length;
  13731. var i, value;
  13732. for (i = 0; i < ilen; ++i) {
  13733. value = scale._parseValue(data[i]);
  13734. if (isNaN(value.min) || isNaN(value.max) || meta.data[i].hidden) {
  13735. continue;
  13736. }
  13737. scale.min = Math.min(scale.min, value.min);
  13738. scale.max = Math.max(scale.max, value.max);
  13739. }
  13740. }
  13741. var scale_linear = scale_linearbase.extend({
  13742. determineDataLimits: function() {
  13743. var me = this;
  13744. var opts = me.options;
  13745. var chart = me.chart;
  13746. var datasets = chart.data.datasets;
  13747. var metasets = me._getMatchingVisibleMetas();
  13748. var hasStacks = opts.stacked;
  13749. var stacks = {};
  13750. var ilen = metasets.length;
  13751. var i, meta, data, values;
  13752. me.min = Number.POSITIVE_INFINITY;
  13753. me.max = Number.NEGATIVE_INFINITY;
  13754. if (hasStacks === undefined) {
  13755. for (i = 0; !hasStacks && i < ilen; ++i) {
  13756. meta = metasets[i];
  13757. hasStacks = meta.stack !== undefined;
  13758. }
  13759. }
  13760. for (i = 0; i < ilen; ++i) {
  13761. meta = metasets[i];
  13762. data = datasets[meta.index].data;
  13763. if (hasStacks) {
  13764. stackData(me, stacks, meta, data);
  13765. } else {
  13766. updateMinMax(me, meta, data);
  13767. }
  13768. }
  13769. helpers$1.each(stacks, function(stackValues) {
  13770. values = stackValues.pos.concat(stackValues.neg);
  13771. me.min = Math.min(me.min, helpers$1.min(values));
  13772. me.max = Math.max(me.max, helpers$1.max(values));
  13773. });
  13774. me.min = helpers$1.isFinite(me.min) && !isNaN(me.min) ? me.min : DEFAULT_MIN;
  13775. me.max = helpers$1.isFinite(me.max) && !isNaN(me.max) ? me.max : DEFAULT_MAX;
  13776. // Common base implementation to handle ticks.min, ticks.max, ticks.beginAtZero
  13777. me.handleTickRangeOptions();
  13778. },
  13779. // Returns the maximum number of ticks based on the scale dimension
  13780. _computeTickLimit: function() {
  13781. var me = this;
  13782. var tickFont;
  13783. if (me.isHorizontal()) {
  13784. return Math.ceil(me.width / 40);
  13785. }
  13786. tickFont = helpers$1.options._parseFont(me.options.ticks);
  13787. return Math.ceil(me.height / tickFont.lineHeight);
  13788. },
  13789. // Called after the ticks are built. We need
  13790. handleDirectionalChanges: function() {
  13791. if (!this.isHorizontal()) {
  13792. // We are in a vertical orientation. The top value is the highest. So reverse the array
  13793. this.ticks.reverse();
  13794. }
  13795. },
  13796. getLabelForIndex: function(index, datasetIndex) {
  13797. return this._getScaleLabel(this.chart.data.datasets[datasetIndex].data[index]);
  13798. },
  13799. // Utils
  13800. getPixelForValue: function(value) {
  13801. var me = this;
  13802. return me.getPixelForDecimal((+me.getRightValue(value) - me._startValue) / me._valueRange);
  13803. },
  13804. getValueForPixel: function(pixel) {
  13805. return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;
  13806. },
  13807. getPixelForTick: function(index) {
  13808. var ticks = this.ticksAsNumbers;
  13809. if (index < 0 || index > ticks.length - 1) {
  13810. return null;
  13811. }
  13812. return this.getPixelForValue(ticks[index]);
  13813. }
  13814. });
  13815. // INTERNAL: static default options, registered in src/index.js
  13816. var _defaults$1 = defaultConfig$1;
  13817. scale_linear._defaults = _defaults$1;
  13818. var valueOrDefault$b = helpers$1.valueOrDefault;
  13819. var log10 = helpers$1.math.log10;
  13820. /**
  13821. * Generate a set of logarithmic ticks
  13822. * @param generationOptions the options used to generate the ticks
  13823. * @param dataRange the range of the data
  13824. * @returns {number[]} array of tick values
  13825. */
  13826. function generateTicks$1(generationOptions, dataRange) {
  13827. var ticks = [];
  13828. var tickVal = valueOrDefault$b(generationOptions.min, Math.pow(10, Math.floor(log10(dataRange.min))));
  13829. var endExp = Math.floor(log10(dataRange.max));
  13830. var endSignificand = Math.ceil(dataRange.max / Math.pow(10, endExp));
  13831. var exp, significand;
  13832. if (tickVal === 0) {
  13833. exp = Math.floor(log10(dataRange.minNotZero));
  13834. significand = Math.floor(dataRange.minNotZero / Math.pow(10, exp));
  13835. ticks.push(tickVal);
  13836. tickVal = significand * Math.pow(10, exp);
  13837. } else {
  13838. exp = Math.floor(log10(tickVal));
  13839. significand = Math.floor(tickVal / Math.pow(10, exp));
  13840. }
  13841. var precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;
  13842. do {
  13843. ticks.push(tickVal);
  13844. ++significand;
  13845. if (significand === 10) {
  13846. significand = 1;
  13847. ++exp;
  13848. precision = exp >= 0 ? 1 : precision;
  13849. }
  13850. tickVal = Math.round(significand * Math.pow(10, exp) * precision) / precision;
  13851. } while (exp < endExp || (exp === endExp && significand < endSignificand));
  13852. var lastTick = valueOrDefault$b(generationOptions.max, tickVal);
  13853. ticks.push(lastTick);
  13854. return ticks;
  13855. }
  13856. var defaultConfig$2 = {
  13857. position: 'left',
  13858. // label settings
  13859. ticks: {
  13860. callback: core_ticks.formatters.logarithmic
  13861. }
  13862. };
  13863. // TODO(v3): change this to positiveOrDefault
  13864. function nonNegativeOrDefault(value, defaultValue) {
  13865. return helpers$1.isFinite(value) && value >= 0 ? value : defaultValue;
  13866. }
  13867. var scale_logarithmic = core_scale.extend({
  13868. determineDataLimits: function() {
  13869. var me = this;
  13870. var opts = me.options;
  13871. var chart = me.chart;
  13872. var datasets = chart.data.datasets;
  13873. var isHorizontal = me.isHorizontal();
  13874. function IDMatches(meta) {
  13875. return isHorizontal ? meta.xAxisID === me.id : meta.yAxisID === me.id;
  13876. }
  13877. var datasetIndex, meta, value, data, i, ilen;
  13878. // Calculate Range
  13879. me.min = Number.POSITIVE_INFINITY;
  13880. me.max = Number.NEGATIVE_INFINITY;
  13881. me.minNotZero = Number.POSITIVE_INFINITY;
  13882. var hasStacks = opts.stacked;
  13883. if (hasStacks === undefined) {
  13884. for (datasetIndex = 0; datasetIndex < datasets.length; datasetIndex++) {
  13885. meta = chart.getDatasetMeta(datasetIndex);
  13886. if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta) &&
  13887. meta.stack !== undefined) {
  13888. hasStacks = true;
  13889. break;
  13890. }
  13891. }
  13892. }
  13893. if (opts.stacked || hasStacks) {
  13894. var valuesPerStack = {};
  13895. for (datasetIndex = 0; datasetIndex < datasets.length; datasetIndex++) {
  13896. meta = chart.getDatasetMeta(datasetIndex);
  13897. var key = [
  13898. meta.type,
  13899. // we have a separate stack for stack=undefined datasets when the opts.stacked is undefined
  13900. ((opts.stacked === undefined && meta.stack === undefined) ? datasetIndex : ''),
  13901. meta.stack
  13902. ].join('.');
  13903. if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {
  13904. if (valuesPerStack[key] === undefined) {
  13905. valuesPerStack[key] = [];
  13906. }
  13907. data = datasets[datasetIndex].data;
  13908. for (i = 0, ilen = data.length; i < ilen; i++) {
  13909. var values = valuesPerStack[key];
  13910. value = me._parseValue(data[i]);
  13911. // invalid, hidden and negative values are ignored
  13912. if (isNaN(value.min) || isNaN(value.max) || meta.data[i].hidden || value.min < 0 || value.max < 0) {
  13913. continue;
  13914. }
  13915. values[i] = values[i] || 0;
  13916. values[i] += value.max;
  13917. }
  13918. }
  13919. }
  13920. helpers$1.each(valuesPerStack, function(valuesForType) {
  13921. if (valuesForType.length > 0) {
  13922. var minVal = helpers$1.min(valuesForType);
  13923. var maxVal = helpers$1.max(valuesForType);
  13924. me.min = Math.min(me.min, minVal);
  13925. me.max = Math.max(me.max, maxVal);
  13926. }
  13927. });
  13928. } else {
  13929. for (datasetIndex = 0; datasetIndex < datasets.length; datasetIndex++) {
  13930. meta = chart.getDatasetMeta(datasetIndex);
  13931. if (chart.isDatasetVisible(datasetIndex) && IDMatches(meta)) {
  13932. data = datasets[datasetIndex].data;
  13933. for (i = 0, ilen = data.length; i < ilen; i++) {
  13934. value = me._parseValue(data[i]);
  13935. // invalid, hidden and negative values are ignored
  13936. if (isNaN(value.min) || isNaN(value.max) || meta.data[i].hidden || value.min < 0 || value.max < 0) {
  13937. continue;
  13938. }
  13939. me.min = Math.min(value.min, me.min);
  13940. me.max = Math.max(value.max, me.max);
  13941. if (value.min !== 0) {
  13942. me.minNotZero = Math.min(value.min, me.minNotZero);
  13943. }
  13944. }
  13945. }
  13946. }
  13947. }
  13948. me.min = helpers$1.isFinite(me.min) ? me.min : null;
  13949. me.max = helpers$1.isFinite(me.max) ? me.max : null;
  13950. me.minNotZero = helpers$1.isFinite(me.minNotZero) ? me.minNotZero : null;
  13951. // Common base implementation to handle ticks.min, ticks.max
  13952. this.handleTickRangeOptions();
  13953. },
  13954. handleTickRangeOptions: function() {
  13955. var me = this;
  13956. var tickOpts = me.options.ticks;
  13957. var DEFAULT_MIN = 1;
  13958. var DEFAULT_MAX = 10;
  13959. me.min = nonNegativeOrDefault(tickOpts.min, me.min);
  13960. me.max = nonNegativeOrDefault(tickOpts.max, me.max);
  13961. if (me.min === me.max) {
  13962. if (me.min !== 0 && me.min !== null) {
  13963. me.min = Math.pow(10, Math.floor(log10(me.min)) - 1);
  13964. me.max = Math.pow(10, Math.floor(log10(me.max)) + 1);
  13965. } else {
  13966. me.min = DEFAULT_MIN;
  13967. me.max = DEFAULT_MAX;
  13968. }
  13969. }
  13970. if (me.min === null) {
  13971. me.min = Math.pow(10, Math.floor(log10(me.max)) - 1);
  13972. }
  13973. if (me.max === null) {
  13974. me.max = me.min !== 0
  13975. ? Math.pow(10, Math.floor(log10(me.min)) + 1)
  13976. : DEFAULT_MAX;
  13977. }
  13978. if (me.minNotZero === null) {
  13979. if (me.min > 0) {
  13980. me.minNotZero = me.min;
  13981. } else if (me.max < 1) {
  13982. me.minNotZero = Math.pow(10, Math.floor(log10(me.max)));
  13983. } else {
  13984. me.minNotZero = DEFAULT_MIN;
  13985. }
  13986. }
  13987. },
  13988. buildTicks: function() {
  13989. var me = this;
  13990. var tickOpts = me.options.ticks;
  13991. var reverse = !me.isHorizontal();
  13992. var generationOptions = {
  13993. min: nonNegativeOrDefault(tickOpts.min),
  13994. max: nonNegativeOrDefault(tickOpts.max)
  13995. };
  13996. var ticks = me.ticks = generateTicks$1(generationOptions, me);
  13997. // At this point, we need to update our max and min given the tick values since we have expanded the
  13998. // range of the scale
  13999. me.max = helpers$1.max(ticks);
  14000. me.min = helpers$1.min(ticks);
  14001. if (tickOpts.reverse) {
  14002. reverse = !reverse;
  14003. me.start = me.max;
  14004. me.end = me.min;
  14005. } else {
  14006. me.start = me.min;
  14007. me.end = me.max;
  14008. }
  14009. if (reverse) {
  14010. ticks.reverse();
  14011. }
  14012. },
  14013. convertTicksToLabels: function() {
  14014. this.tickValues = this.ticks.slice();
  14015. core_scale.prototype.convertTicksToLabels.call(this);
  14016. },
  14017. // Get the correct tooltip label
  14018. getLabelForIndex: function(index, datasetIndex) {
  14019. return this._getScaleLabel(this.chart.data.datasets[datasetIndex].data[index]);
  14020. },
  14021. getPixelForTick: function(index) {
  14022. var ticks = this.tickValues;
  14023. if (index < 0 || index > ticks.length - 1) {
  14024. return null;
  14025. }
  14026. return this.getPixelForValue(ticks[index]);
  14027. },
  14028. /**
  14029. * Returns the value of the first tick.
  14030. * @param {number} value - The minimum not zero value.
  14031. * @return {number} The first tick value.
  14032. * @private
  14033. */
  14034. _getFirstTickValue: function(value) {
  14035. var exp = Math.floor(log10(value));
  14036. var significand = Math.floor(value / Math.pow(10, exp));
  14037. return significand * Math.pow(10, exp);
  14038. },
  14039. _configure: function() {
  14040. var me = this;
  14041. var start = me.min;
  14042. var offset = 0;
  14043. core_scale.prototype._configure.call(me);
  14044. if (start === 0) {
  14045. start = me._getFirstTickValue(me.minNotZero);
  14046. offset = valueOrDefault$b(me.options.ticks.fontSize, core_defaults.global.defaultFontSize) / me._length;
  14047. }
  14048. me._startValue = log10(start);
  14049. me._valueOffset = offset;
  14050. me._valueRange = (log10(me.max) - log10(start)) / (1 - offset);
  14051. },
  14052. getPixelForValue: function(value) {
  14053. var me = this;
  14054. var decimal = 0;
  14055. value = +me.getRightValue(value);
  14056. if (value > me.min && value > 0) {
  14057. decimal = (log10(value) - me._startValue) / me._valueRange + me._valueOffset;
  14058. }
  14059. return me.getPixelForDecimal(decimal);
  14060. },
  14061. getValueForPixel: function(pixel) {
  14062. var me = this;
  14063. var decimal = me.getDecimalForPixel(pixel);
  14064. return decimal === 0 && me.min === 0
  14065. ? 0
  14066. : Math.pow(10, me._startValue + (decimal - me._valueOffset) * me._valueRange);
  14067. }
  14068. });
  14069. // INTERNAL: static default options, registered in src/index.js
  14070. var _defaults$2 = defaultConfig$2;
  14071. scale_logarithmic._defaults = _defaults$2;
  14072. var valueOrDefault$c = helpers$1.valueOrDefault;
  14073. var valueAtIndexOrDefault$1 = helpers$1.valueAtIndexOrDefault;
  14074. var resolve$4 = helpers$1.options.resolve;
  14075. var defaultConfig$3 = {
  14076. display: true,
  14077. // Boolean - Whether to animate scaling the chart from the centre
  14078. animate: true,
  14079. position: 'chartArea',
  14080. angleLines: {
  14081. display: true,
  14082. color: 'rgba(0,0,0,0.1)',
  14083. lineWidth: 1,
  14084. borderDash: [],
  14085. borderDashOffset: 0.0
  14086. },
  14087. gridLines: {
  14088. circular: false
  14089. },
  14090. // label settings
  14091. ticks: {
  14092. // Boolean - Show a backdrop to the scale label
  14093. showLabelBackdrop: true,
  14094. // String - The colour of the label backdrop
  14095. backdropColor: 'rgba(255,255,255,0.75)',
  14096. // Number - The backdrop padding above & below the label in pixels
  14097. backdropPaddingY: 2,
  14098. // Number - The backdrop padding to the side of the label in pixels
  14099. backdropPaddingX: 2,
  14100. callback: core_ticks.formatters.linear
  14101. },
  14102. pointLabels: {
  14103. // Boolean - if true, show point labels
  14104. display: true,
  14105. // Number - Point label font size in pixels
  14106. fontSize: 10,
  14107. // Function - Used to convert point labels
  14108. callback: function(label) {
  14109. return label;
  14110. }
  14111. }
  14112. };
  14113. function getTickBackdropHeight(opts) {
  14114. var tickOpts = opts.ticks;
  14115. if (tickOpts.display && opts.display) {
  14116. return valueOrDefault$c(tickOpts.fontSize, core_defaults.global.defaultFontSize) + tickOpts.backdropPaddingY * 2;
  14117. }
  14118. return 0;
  14119. }
  14120. function measureLabelSize(ctx, lineHeight, label) {
  14121. if (helpers$1.isArray(label)) {
  14122. return {
  14123. w: helpers$1.longestText(ctx, ctx.font, label),
  14124. h: label.length * lineHeight
  14125. };
  14126. }
  14127. return {
  14128. w: ctx.measureText(label).width,
  14129. h: lineHeight
  14130. };
  14131. }
  14132. function determineLimits(angle, pos, size, min, max) {
  14133. if (angle === min || angle === max) {
  14134. return {
  14135. start: pos - (size / 2),
  14136. end: pos + (size / 2)
  14137. };
  14138. } else if (angle < min || angle > max) {
  14139. return {
  14140. start: pos - size,
  14141. end: pos
  14142. };
  14143. }
  14144. return {
  14145. start: pos,
  14146. end: pos + size
  14147. };
  14148. }
  14149. /**
  14150. * Helper function to fit a radial linear scale with point labels
  14151. */
  14152. function fitWithPointLabels(scale) {
  14153. // Right, this is really confusing and there is a lot of maths going on here
  14154. // The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9
  14155. //
  14156. // Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif
  14157. //
  14158. // Solution:
  14159. //
  14160. // We assume the radius of the polygon is half the size of the canvas at first
  14161. // at each index we check if the text overlaps.
  14162. //
  14163. // Where it does, we store that angle and that index.
  14164. //
  14165. // After finding the largest index and angle we calculate how much we need to remove
  14166. // from the shape radius to move the point inwards by that x.
  14167. //
  14168. // We average the left and right distances to get the maximum shape radius that can fit in the box
  14169. // along with labels.
  14170. //
  14171. // Once we have that, we can find the centre point for the chart, by taking the x text protrusion
  14172. // on each side, removing that from the size, halving it and adding the left x protrusion width.
  14173. //
  14174. // This will mean we have a shape fitted to the canvas, as large as it can be with the labels
  14175. // and position it in the most space efficient manner
  14176. //
  14177. // https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif
  14178. var plFont = helpers$1.options._parseFont(scale.options.pointLabels);
  14179. // Get maximum radius of the polygon. Either half the height (minus the text width) or half the width.
  14180. // Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points
  14181. var furthestLimits = {
  14182. l: 0,
  14183. r: scale.width,
  14184. t: 0,
  14185. b: scale.height - scale.paddingTop
  14186. };
  14187. var furthestAngles = {};
  14188. var i, textSize, pointPosition;
  14189. scale.ctx.font = plFont.string;
  14190. scale._pointLabelSizes = [];
  14191. var valueCount = scale.chart.data.labels.length;
  14192. for (i = 0; i < valueCount; i++) {
  14193. pointPosition = scale.getPointPosition(i, scale.drawingArea + 5);
  14194. textSize = measureLabelSize(scale.ctx, plFont.lineHeight, scale.pointLabels[i]);
  14195. scale._pointLabelSizes[i] = textSize;
  14196. // Add quarter circle to make degree 0 mean top of circle
  14197. var angleRadians = scale.getIndexAngle(i);
  14198. var angle = helpers$1.toDegrees(angleRadians) % 360;
  14199. var hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);
  14200. var vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);
  14201. if (hLimits.start < furthestLimits.l) {
  14202. furthestLimits.l = hLimits.start;
  14203. furthestAngles.l = angleRadians;
  14204. }
  14205. if (hLimits.end > furthestLimits.r) {
  14206. furthestLimits.r = hLimits.end;
  14207. furthestAngles.r = angleRadians;
  14208. }
  14209. if (vLimits.start < furthestLimits.t) {
  14210. furthestLimits.t = vLimits.start;
  14211. furthestAngles.t = angleRadians;
  14212. }
  14213. if (vLimits.end > furthestLimits.b) {
  14214. furthestLimits.b = vLimits.end;
  14215. furthestAngles.b = angleRadians;
  14216. }
  14217. }
  14218. scale.setReductions(scale.drawingArea, furthestLimits, furthestAngles);
  14219. }
  14220. function getTextAlignForAngle(angle) {
  14221. if (angle === 0 || angle === 180) {
  14222. return 'center';
  14223. } else if (angle < 180) {
  14224. return 'left';
  14225. }
  14226. return 'right';
  14227. }
  14228. function fillText(ctx, text, position, lineHeight) {
  14229. var y = position.y + lineHeight / 2;
  14230. var i, ilen;
  14231. if (helpers$1.isArray(text)) {
  14232. for (i = 0, ilen = text.length; i < ilen; ++i) {
  14233. ctx.fillText(text[i], position.x, y);
  14234. y += lineHeight;
  14235. }
  14236. } else {
  14237. ctx.fillText(text, position.x, y);
  14238. }
  14239. }
  14240. function adjustPointPositionForLabelHeight(angle, textSize, position) {
  14241. if (angle === 90 || angle === 270) {
  14242. position.y -= (textSize.h / 2);
  14243. } else if (angle > 270 || angle < 90) {
  14244. position.y -= textSize.h;
  14245. }
  14246. }
  14247. function drawPointLabels(scale) {
  14248. var ctx = scale.ctx;
  14249. var opts = scale.options;
  14250. var pointLabelOpts = opts.pointLabels;
  14251. var tickBackdropHeight = getTickBackdropHeight(opts);
  14252. var outerDistance = scale.getDistanceFromCenterForValue(opts.ticks.reverse ? scale.min : scale.max);
  14253. var plFont = helpers$1.options._parseFont(pointLabelOpts);
  14254. ctx.save();
  14255. ctx.font = plFont.string;
  14256. ctx.textBaseline = 'middle';
  14257. for (var i = scale.chart.data.labels.length - 1; i >= 0; i--) {
  14258. // Extra pixels out for some label spacing
  14259. var extra = (i === 0 ? tickBackdropHeight / 2 : 0);
  14260. var pointLabelPosition = scale.getPointPosition(i, outerDistance + extra + 5);
  14261. // Keep this in loop since we may support array properties here
  14262. var pointLabelFontColor = valueAtIndexOrDefault$1(pointLabelOpts.fontColor, i, core_defaults.global.defaultFontColor);
  14263. ctx.fillStyle = pointLabelFontColor;
  14264. var angleRadians = scale.getIndexAngle(i);
  14265. var angle = helpers$1.toDegrees(angleRadians);
  14266. ctx.textAlign = getTextAlignForAngle(angle);
  14267. adjustPointPositionForLabelHeight(angle, scale._pointLabelSizes[i], pointLabelPosition);
  14268. fillText(ctx, scale.pointLabels[i], pointLabelPosition, plFont.lineHeight);
  14269. }
  14270. ctx.restore();
  14271. }
  14272. function drawRadiusLine(scale, gridLineOpts, radius, index) {
  14273. var ctx = scale.ctx;
  14274. var circular = gridLineOpts.circular;
  14275. var valueCount = scale.chart.data.labels.length;
  14276. var lineColor = valueAtIndexOrDefault$1(gridLineOpts.color, index - 1);
  14277. var lineWidth = valueAtIndexOrDefault$1(gridLineOpts.lineWidth, index - 1);
  14278. var pointPosition;
  14279. if ((!circular && !valueCount) || !lineColor || !lineWidth) {
  14280. return;
  14281. }
  14282. ctx.save();
  14283. ctx.strokeStyle = lineColor;
  14284. ctx.lineWidth = lineWidth;
  14285. if (ctx.setLineDash) {
  14286. ctx.setLineDash(gridLineOpts.borderDash || []);
  14287. ctx.lineDashOffset = gridLineOpts.borderDashOffset || 0.0;
  14288. }
  14289. ctx.beginPath();
  14290. if (circular) {
  14291. // Draw circular arcs between the points
  14292. ctx.arc(scale.xCenter, scale.yCenter, radius, 0, Math.PI * 2);
  14293. } else {
  14294. // Draw straight lines connecting each index
  14295. pointPosition = scale.getPointPosition(0, radius);
  14296. ctx.moveTo(pointPosition.x, pointPosition.y);
  14297. for (var i = 1; i < valueCount; i++) {
  14298. pointPosition = scale.getPointPosition(i, radius);
  14299. ctx.lineTo(pointPosition.x, pointPosition.y);
  14300. }
  14301. }
  14302. ctx.closePath();
  14303. ctx.stroke();
  14304. ctx.restore();
  14305. }
  14306. function numberOrZero(param) {
  14307. return helpers$1.isNumber(param) ? param : 0;
  14308. }
  14309. var scale_radialLinear = scale_linearbase.extend({
  14310. setDimensions: function() {
  14311. var me = this;
  14312. // Set the unconstrained dimension before label rotation
  14313. me.width = me.maxWidth;
  14314. me.height = me.maxHeight;
  14315. me.paddingTop = getTickBackdropHeight(me.options) / 2;
  14316. me.xCenter = Math.floor(me.width / 2);
  14317. me.yCenter = Math.floor((me.height - me.paddingTop) / 2);
  14318. me.drawingArea = Math.min(me.height - me.paddingTop, me.width) / 2;
  14319. },
  14320. determineDataLimits: function() {
  14321. var me = this;
  14322. var chart = me.chart;
  14323. var min = Number.POSITIVE_INFINITY;
  14324. var max = Number.NEGATIVE_INFINITY;
  14325. helpers$1.each(chart.data.datasets, function(dataset, datasetIndex) {
  14326. if (chart.isDatasetVisible(datasetIndex)) {
  14327. var meta = chart.getDatasetMeta(datasetIndex);
  14328. helpers$1.each(dataset.data, function(rawValue, index) {
  14329. var value = +me.getRightValue(rawValue);
  14330. if (isNaN(value) || meta.data[index].hidden) {
  14331. return;
  14332. }
  14333. min = Math.min(value, min);
  14334. max = Math.max(value, max);
  14335. });
  14336. }
  14337. });
  14338. me.min = (min === Number.POSITIVE_INFINITY ? 0 : min);
  14339. me.max = (max === Number.NEGATIVE_INFINITY ? 0 : max);
  14340. // Common base implementation to handle ticks.min, ticks.max, ticks.beginAtZero
  14341. me.handleTickRangeOptions();
  14342. },
  14343. // Returns the maximum number of ticks based on the scale dimension
  14344. _computeTickLimit: function() {
  14345. return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));
  14346. },
  14347. convertTicksToLabels: function() {
  14348. var me = this;
  14349. scale_linearbase.prototype.convertTicksToLabels.call(me);
  14350. // Point labels
  14351. me.pointLabels = me.chart.data.labels.map(function() {
  14352. var label = helpers$1.callback(me.options.pointLabels.callback, arguments, me);
  14353. return label || label === 0 ? label : '';
  14354. });
  14355. },
  14356. getLabelForIndex: function(index, datasetIndex) {
  14357. return +this.getRightValue(this.chart.data.datasets[datasetIndex].data[index]);
  14358. },
  14359. fit: function() {
  14360. var me = this;
  14361. var opts = me.options;
  14362. if (opts.display && opts.pointLabels.display) {
  14363. fitWithPointLabels(me);
  14364. } else {
  14365. me.setCenterPoint(0, 0, 0, 0);
  14366. }
  14367. },
  14368. /**
  14369. * Set radius reductions and determine new radius and center point
  14370. * @private
  14371. */
  14372. setReductions: function(largestPossibleRadius, furthestLimits, furthestAngles) {
  14373. var me = this;
  14374. var radiusReductionLeft = furthestLimits.l / Math.sin(furthestAngles.l);
  14375. var radiusReductionRight = Math.max(furthestLimits.r - me.width, 0) / Math.sin(furthestAngles.r);
  14376. var radiusReductionTop = -furthestLimits.t / Math.cos(furthestAngles.t);
  14377. var radiusReductionBottom = -Math.max(furthestLimits.b - (me.height - me.paddingTop), 0) / Math.cos(furthestAngles.b);
  14378. radiusReductionLeft = numberOrZero(radiusReductionLeft);
  14379. radiusReductionRight = numberOrZero(radiusReductionRight);
  14380. radiusReductionTop = numberOrZero(radiusReductionTop);
  14381. radiusReductionBottom = numberOrZero(radiusReductionBottom);
  14382. me.drawingArea = Math.min(
  14383. Math.floor(largestPossibleRadius - (radiusReductionLeft + radiusReductionRight) / 2),
  14384. Math.floor(largestPossibleRadius - (radiusReductionTop + radiusReductionBottom) / 2));
  14385. me.setCenterPoint(radiusReductionLeft, radiusReductionRight, radiusReductionTop, radiusReductionBottom);
  14386. },
  14387. setCenterPoint: function(leftMovement, rightMovement, topMovement, bottomMovement) {
  14388. var me = this;
  14389. var maxRight = me.width - rightMovement - me.drawingArea;
  14390. var maxLeft = leftMovement + me.drawingArea;
  14391. var maxTop = topMovement + me.drawingArea;
  14392. var maxBottom = (me.height - me.paddingTop) - bottomMovement - me.drawingArea;
  14393. me.xCenter = Math.floor(((maxLeft + maxRight) / 2) + me.left);
  14394. me.yCenter = Math.floor(((maxTop + maxBottom) / 2) + me.top + me.paddingTop);
  14395. },
  14396. getIndexAngle: function(index) {
  14397. var chart = this.chart;
  14398. var angleMultiplier = 360 / chart.data.labels.length;
  14399. var options = chart.options || {};
  14400. var startAngle = options.startAngle || 0;
  14401. // Start from the top instead of right, so remove a quarter of the circle
  14402. var angle = (index * angleMultiplier + startAngle) % 360;
  14403. return (angle < 0 ? angle + 360 : angle) * Math.PI * 2 / 360;
  14404. },
  14405. getDistanceFromCenterForValue: function(value) {
  14406. var me = this;
  14407. if (helpers$1.isNullOrUndef(value)) {
  14408. return NaN;
  14409. }
  14410. // Take into account half font size + the yPadding of the top value
  14411. var scalingFactor = me.drawingArea / (me.max - me.min);
  14412. if (me.options.ticks.reverse) {
  14413. return (me.max - value) * scalingFactor;
  14414. }
  14415. return (value - me.min) * scalingFactor;
  14416. },
  14417. getPointPosition: function(index, distanceFromCenter) {
  14418. var me = this;
  14419. var thisAngle = me.getIndexAngle(index) - (Math.PI / 2);
  14420. return {
  14421. x: Math.cos(thisAngle) * distanceFromCenter + me.xCenter,
  14422. y: Math.sin(thisAngle) * distanceFromCenter + me.yCenter
  14423. };
  14424. },
  14425. getPointPositionForValue: function(index, value) {
  14426. return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));
  14427. },
  14428. getBasePosition: function(index) {
  14429. var me = this;
  14430. var min = me.min;
  14431. var max = me.max;
  14432. return me.getPointPositionForValue(index || 0,
  14433. me.beginAtZero ? 0 :
  14434. min < 0 && max < 0 ? max :
  14435. min > 0 && max > 0 ? min :
  14436. 0);
  14437. },
  14438. /**
  14439. * @private
  14440. */
  14441. _drawGrid: function() {
  14442. var me = this;
  14443. var ctx = me.ctx;
  14444. var opts = me.options;
  14445. var gridLineOpts = opts.gridLines;
  14446. var angleLineOpts = opts.angleLines;
  14447. var lineWidth = valueOrDefault$c(angleLineOpts.lineWidth, gridLineOpts.lineWidth);
  14448. var lineColor = valueOrDefault$c(angleLineOpts.color, gridLineOpts.color);
  14449. var i, offset, position;
  14450. if (opts.pointLabels.display) {
  14451. drawPointLabels(me);
  14452. }
  14453. if (gridLineOpts.display) {
  14454. helpers$1.each(me.ticks, function(label, index) {
  14455. if (index !== 0) {
  14456. offset = me.getDistanceFromCenterForValue(me.ticksAsNumbers[index]);
  14457. drawRadiusLine(me, gridLineOpts, offset, index);
  14458. }
  14459. });
  14460. }
  14461. if (angleLineOpts.display && lineWidth && lineColor) {
  14462. ctx.save();
  14463. ctx.lineWidth = lineWidth;
  14464. ctx.strokeStyle = lineColor;
  14465. if (ctx.setLineDash) {
  14466. ctx.setLineDash(resolve$4([angleLineOpts.borderDash, gridLineOpts.borderDash, []]));
  14467. ctx.lineDashOffset = resolve$4([angleLineOpts.borderDashOffset, gridLineOpts.borderDashOffset, 0.0]);
  14468. }
  14469. for (i = me.chart.data.labels.length - 1; i >= 0; i--) {
  14470. offset = me.getDistanceFromCenterForValue(opts.ticks.reverse ? me.min : me.max);
  14471. position = me.getPointPosition(i, offset);
  14472. ctx.beginPath();
  14473. ctx.moveTo(me.xCenter, me.yCenter);
  14474. ctx.lineTo(position.x, position.y);
  14475. ctx.stroke();
  14476. }
  14477. ctx.restore();
  14478. }
  14479. },
  14480. /**
  14481. * @private
  14482. */
  14483. _drawLabels: function() {
  14484. var me = this;
  14485. var ctx = me.ctx;
  14486. var opts = me.options;
  14487. var tickOpts = opts.ticks;
  14488. if (!tickOpts.display) {
  14489. return;
  14490. }
  14491. var startAngle = me.getIndexAngle(0);
  14492. var tickFont = helpers$1.options._parseFont(tickOpts);
  14493. var tickFontColor = valueOrDefault$c(tickOpts.fontColor, core_defaults.global.defaultFontColor);
  14494. var offset, width;
  14495. ctx.save();
  14496. ctx.font = tickFont.string;
  14497. ctx.translate(me.xCenter, me.yCenter);
  14498. ctx.rotate(startAngle);
  14499. ctx.textAlign = 'center';
  14500. ctx.textBaseline = 'middle';
  14501. helpers$1.each(me.ticks, function(label, index) {
  14502. if (index === 0 && !tickOpts.reverse) {
  14503. return;
  14504. }
  14505. offset = me.getDistanceFromCenterForValue(me.ticksAsNumbers[index]);
  14506. if (tickOpts.showLabelBackdrop) {
  14507. width = ctx.measureText(label).width;
  14508. ctx.fillStyle = tickOpts.backdropColor;
  14509. ctx.fillRect(
  14510. -width / 2 - tickOpts.backdropPaddingX,
  14511. -offset - tickFont.size / 2 - tickOpts.backdropPaddingY,
  14512. width + tickOpts.backdropPaddingX * 2,
  14513. tickFont.size + tickOpts.backdropPaddingY * 2
  14514. );
  14515. }
  14516. ctx.fillStyle = tickFontColor;
  14517. ctx.fillText(label, 0, -offset);
  14518. });
  14519. ctx.restore();
  14520. },
  14521. /**
  14522. * @private
  14523. */
  14524. _drawTitle: helpers$1.noop
  14525. });
  14526. // INTERNAL: static default options, registered in src/index.js
  14527. var _defaults$3 = defaultConfig$3;
  14528. scale_radialLinear._defaults = _defaults$3;
  14529. var deprecated$1 = helpers$1._deprecated;
  14530. var resolve$5 = helpers$1.options.resolve;
  14531. var valueOrDefault$d = helpers$1.valueOrDefault;
  14532. // Integer constants are from the ES6 spec.
  14533. var MIN_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991;
  14534. var MAX_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
  14535. var INTERVALS = {
  14536. millisecond: {
  14537. common: true,
  14538. size: 1,
  14539. steps: 1000
  14540. },
  14541. second: {
  14542. common: true,
  14543. size: 1000,
  14544. steps: 60
  14545. },
  14546. minute: {
  14547. common: true,
  14548. size: 60000,
  14549. steps: 60
  14550. },
  14551. hour: {
  14552. common: true,
  14553. size: 3600000,
  14554. steps: 24
  14555. },
  14556. day: {
  14557. common: true,
  14558. size: 86400000,
  14559. steps: 30
  14560. },
  14561. week: {
  14562. common: false,
  14563. size: 604800000,
  14564. steps: 4
  14565. },
  14566. month: {
  14567. common: true,
  14568. size: 2.628e9,
  14569. steps: 12
  14570. },
  14571. quarter: {
  14572. common: false,
  14573. size: 7.884e9,
  14574. steps: 4
  14575. },
  14576. year: {
  14577. common: true,
  14578. size: 3.154e10
  14579. }
  14580. };
  14581. var UNITS = Object.keys(INTERVALS);
  14582. function sorter(a, b) {
  14583. return a - b;
  14584. }
  14585. function arrayUnique(items) {
  14586. var hash = {};
  14587. var out = [];
  14588. var i, ilen, item;
  14589. for (i = 0, ilen = items.length; i < ilen; ++i) {
  14590. item = items[i];
  14591. if (!hash[item]) {
  14592. hash[item] = true;
  14593. out.push(item);
  14594. }
  14595. }
  14596. return out;
  14597. }
  14598. function getMin(options) {
  14599. return helpers$1.valueOrDefault(options.time.min, options.ticks.min);
  14600. }
  14601. function getMax(options) {
  14602. return helpers$1.valueOrDefault(options.time.max, options.ticks.max);
  14603. }
  14604. /**
  14605. * Returns an array of {time, pos} objects used to interpolate a specific `time` or position
  14606. * (`pos`) on the scale, by searching entries before and after the requested value. `pos` is
  14607. * a decimal between 0 and 1: 0 being the start of the scale (left or top) and 1 the other
  14608. * extremity (left + width or top + height). Note that it would be more optimized to directly
  14609. * store pre-computed pixels, but the scale dimensions are not guaranteed at the time we need
  14610. * to create the lookup table. The table ALWAYS contains at least two items: min and max.
  14611. *
  14612. * @param {number[]} timestamps - timestamps sorted from lowest to highest.
  14613. * @param {string} distribution - If 'linear', timestamps will be spread linearly along the min
  14614. * and max range, so basically, the table will contains only two items: {min, 0} and {max, 1}.
  14615. * If 'series', timestamps will be positioned at the same distance from each other. In this
  14616. * case, only timestamps that break the time linearity are registered, meaning that in the
  14617. * best case, all timestamps are linear, the table contains only min and max.
  14618. */
  14619. function buildLookupTable(timestamps, min, max, distribution) {
  14620. if (distribution === 'linear' || !timestamps.length) {
  14621. return [
  14622. {time: min, pos: 0},
  14623. {time: max, pos: 1}
  14624. ];
  14625. }
  14626. var table = [];
  14627. var items = [min];
  14628. var i, ilen, prev, curr, next;
  14629. for (i = 0, ilen = timestamps.length; i < ilen; ++i) {
  14630. curr = timestamps[i];
  14631. if (curr > min && curr < max) {
  14632. items.push(curr);
  14633. }
  14634. }
  14635. items.push(max);
  14636. for (i = 0, ilen = items.length; i < ilen; ++i) {
  14637. next = items[i + 1];
  14638. prev = items[i - 1];
  14639. curr = items[i];
  14640. // only add points that breaks the scale linearity
  14641. if (prev === undefined || next === undefined || Math.round((next + prev) / 2) !== curr) {
  14642. table.push({time: curr, pos: i / (ilen - 1)});
  14643. }
  14644. }
  14645. return table;
  14646. }
  14647. // @see adapted from https://www.anujgakhar.com/2014/03/01/binary-search-in-javascript/
  14648. function lookup(table, key, value) {
  14649. var lo = 0;
  14650. var hi = table.length - 1;
  14651. var mid, i0, i1;
  14652. while (lo >= 0 && lo <= hi) {
  14653. mid = (lo + hi) >> 1;
  14654. i0 = table[mid - 1] || null;
  14655. i1 = table[mid];
  14656. if (!i0) {
  14657. // given value is outside table (before first item)
  14658. return {lo: null, hi: i1};
  14659. } else if (i1[key] < value) {
  14660. lo = mid + 1;
  14661. } else if (i0[key] > value) {
  14662. hi = mid - 1;
  14663. } else {
  14664. return {lo: i0, hi: i1};
  14665. }
  14666. }
  14667. // given value is outside table (after last item)
  14668. return {lo: i1, hi: null};
  14669. }
  14670. /**
  14671. * Linearly interpolates the given source `value` using the table items `skey` values and
  14672. * returns the associated `tkey` value. For example, interpolate(table, 'time', 42, 'pos')
  14673. * returns the position for a timestamp equal to 42. If value is out of bounds, values at
  14674. * index [0, 1] or [n - 1, n] are used for the interpolation.
  14675. */
  14676. function interpolate$1(table, skey, sval, tkey) {
  14677. var range = lookup(table, skey, sval);
  14678. // Note: the lookup table ALWAYS contains at least 2 items (min and max)
  14679. var prev = !range.lo ? table[0] : !range.hi ? table[table.length - 2] : range.lo;
  14680. var next = !range.lo ? table[1] : !range.hi ? table[table.length - 1] : range.hi;
  14681. var span = next[skey] - prev[skey];
  14682. var ratio = span ? (sval - prev[skey]) / span : 0;
  14683. var offset = (next[tkey] - prev[tkey]) * ratio;
  14684. return prev[tkey] + offset;
  14685. }
  14686. function toTimestamp(scale, input) {
  14687. var adapter = scale._adapter;
  14688. var options = scale.options.time;
  14689. var parser = options.parser;
  14690. var format = parser || options.format;
  14691. var value = input;
  14692. if (typeof parser === 'function') {
  14693. value = parser(value);
  14694. }
  14695. // Only parse if its not a timestamp already
  14696. if (!helpers$1.isFinite(value)) {
  14697. value = typeof format === 'string'
  14698. ? adapter.parse(value, format)
  14699. : adapter.parse(value);
  14700. }
  14701. if (value !== null) {
  14702. return +value;
  14703. }
  14704. // Labels are in an incompatible format and no `parser` has been provided.
  14705. // The user might still use the deprecated `format` option for parsing.
  14706. if (!parser && typeof format === 'function') {
  14707. value = format(input);
  14708. // `format` could return something else than a timestamp, if so, parse it
  14709. if (!helpers$1.isFinite(value)) {
  14710. value = adapter.parse(value);
  14711. }
  14712. }
  14713. return value;
  14714. }
  14715. function parse(scale, input) {
  14716. if (helpers$1.isNullOrUndef(input)) {
  14717. return null;
  14718. }
  14719. var options = scale.options.time;
  14720. var value = toTimestamp(scale, scale.getRightValue(input));
  14721. if (value === null) {
  14722. return value;
  14723. }
  14724. if (options.round) {
  14725. value = +scale._adapter.startOf(value, options.round);
  14726. }
  14727. return value;
  14728. }
  14729. /**
  14730. * Figures out what unit results in an appropriate number of auto-generated ticks
  14731. */
  14732. function determineUnitForAutoTicks(minUnit, min, max, capacity) {
  14733. var ilen = UNITS.length;
  14734. var i, interval, factor;
  14735. for (i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {
  14736. interval = INTERVALS[UNITS[i]];
  14737. factor = interval.steps ? interval.steps : MAX_INTEGER;
  14738. if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {
  14739. return UNITS[i];
  14740. }
  14741. }
  14742. return UNITS[ilen - 1];
  14743. }
  14744. /**
  14745. * Figures out what unit to format a set of ticks with
  14746. */
  14747. function determineUnitForFormatting(scale, numTicks, minUnit, min, max) {
  14748. var i, unit;
  14749. for (i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--) {
  14750. unit = UNITS[i];
  14751. if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {
  14752. return unit;
  14753. }
  14754. }
  14755. return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];
  14756. }
  14757. function determineMajorUnit(unit) {
  14758. for (var i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) {
  14759. if (INTERVALS[UNITS[i]].common) {
  14760. return UNITS[i];
  14761. }
  14762. }
  14763. }
  14764. /**
  14765. * Generates a maximum of `capacity` timestamps between min and max, rounded to the
  14766. * `minor` unit using the given scale time `options`.
  14767. * Important: this method can return ticks outside the min and max range, it's the
  14768. * responsibility of the calling code to clamp values if needed.
  14769. */
  14770. function generate(scale, min, max, capacity) {
  14771. var adapter = scale._adapter;
  14772. var options = scale.options;
  14773. var timeOpts = options.time;
  14774. var minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, capacity);
  14775. var stepSize = resolve$5([timeOpts.stepSize, timeOpts.unitStepSize, 1]);
  14776. var weekday = minor === 'week' ? timeOpts.isoWeekday : false;
  14777. var first = min;
  14778. var ticks = [];
  14779. var time;
  14780. // For 'week' unit, handle the first day of week option
  14781. if (weekday) {
  14782. first = +adapter.startOf(first, 'isoWeek', weekday);
  14783. }
  14784. // Align first ticks on unit
  14785. first = +adapter.startOf(first, weekday ? 'day' : minor);
  14786. // Prevent browser from freezing in case user options request millions of milliseconds
  14787. if (adapter.diff(max, min, minor) > 100000 * stepSize) {
  14788. throw min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor;
  14789. }
  14790. for (time = first; time < max; time = +adapter.add(time, stepSize, minor)) {
  14791. ticks.push(time);
  14792. }
  14793. if (time === max || options.bounds === 'ticks') {
  14794. ticks.push(time);
  14795. }
  14796. return ticks;
  14797. }
  14798. /**
  14799. * Returns the start and end offsets from edges in the form of {start, end}
  14800. * where each value is a relative width to the scale and ranges between 0 and 1.
  14801. * They add extra margins on the both sides by scaling down the original scale.
  14802. * Offsets are added when the `offset` option is true.
  14803. */
  14804. function computeOffsets(table, ticks, min, max, options) {
  14805. var start = 0;
  14806. var end = 0;
  14807. var first, last;
  14808. if (options.offset && ticks.length) {
  14809. first = interpolate$1(table, 'time', ticks[0], 'pos');
  14810. if (ticks.length === 1) {
  14811. start = 1 - first;
  14812. } else {
  14813. start = (interpolate$1(table, 'time', ticks[1], 'pos') - first) / 2;
  14814. }
  14815. last = interpolate$1(table, 'time', ticks[ticks.length - 1], 'pos');
  14816. if (ticks.length === 1) {
  14817. end = last;
  14818. } else {
  14819. end = (last - interpolate$1(table, 'time', ticks[ticks.length - 2], 'pos')) / 2;
  14820. }
  14821. }
  14822. return {start: start, end: end, factor: 1 / (start + 1 + end)};
  14823. }
  14824. function setMajorTicks(scale, ticks, map, majorUnit) {
  14825. var adapter = scale._adapter;
  14826. var first = +adapter.startOf(ticks[0].value, majorUnit);
  14827. var last = ticks[ticks.length - 1].value;
  14828. var major, index;
  14829. for (major = first; major <= last; major = +adapter.add(major, 1, majorUnit)) {
  14830. index = map[major];
  14831. if (index >= 0) {
  14832. ticks[index].major = true;
  14833. }
  14834. }
  14835. return ticks;
  14836. }
  14837. function ticksFromTimestamps(scale, values, majorUnit) {
  14838. var ticks = [];
  14839. var map = {};
  14840. var ilen = values.length;
  14841. var i, value;
  14842. for (i = 0; i < ilen; ++i) {
  14843. value = values[i];
  14844. map[value] = i;
  14845. ticks.push({
  14846. value: value,
  14847. major: false
  14848. });
  14849. }
  14850. // We set the major ticks separately from the above loop because calling startOf for every tick
  14851. // is expensive when there is a large number of ticks
  14852. return (ilen === 0 || !majorUnit) ? ticks : setMajorTicks(scale, ticks, map, majorUnit);
  14853. }
  14854. var defaultConfig$4 = {
  14855. position: 'bottom',
  14856. /**
  14857. * Data distribution along the scale:
  14858. * - 'linear': data are spread according to their time (distances can vary),
  14859. * - 'series': data are spread at the same distance from each other.
  14860. * @see https://github.com/chartjs/Chart.js/pull/4507
  14861. * @since 2.7.0
  14862. */
  14863. distribution: 'linear',
  14864. /**
  14865. * Scale boundary strategy (bypassed by min/max time options)
  14866. * - `data`: make sure data are fully visible, ticks outside are removed
  14867. * - `ticks`: make sure ticks are fully visible, data outside are truncated
  14868. * @see https://github.com/chartjs/Chart.js/pull/4556
  14869. * @since 2.7.0
  14870. */
  14871. bounds: 'data',
  14872. adapters: {},
  14873. time: {
  14874. parser: false, // false == a pattern string from https://momentjs.com/docs/#/parsing/string-format/ or a custom callback that converts its argument to a moment
  14875. unit: false, // false == automatic or override with week, month, year, etc.
  14876. round: false, // none, or override with week, month, year, etc.
  14877. displayFormat: false, // DEPRECATED
  14878. isoWeekday: false, // override week start day - see https://momentjs.com/docs/#/get-set/iso-weekday/
  14879. minUnit: 'millisecond',
  14880. displayFormats: {}
  14881. },
  14882. ticks: {
  14883. autoSkip: false,
  14884. /**
  14885. * Ticks generation input values:
  14886. * - 'auto': generates "optimal" ticks based on scale size and time options.
  14887. * - 'data': generates ticks from data (including labels from data {t|x|y} objects).
  14888. * - 'labels': generates ticks from user given `data.labels` values ONLY.
  14889. * @see https://github.com/chartjs/Chart.js/pull/4507
  14890. * @since 2.7.0
  14891. */
  14892. source: 'auto',
  14893. major: {
  14894. enabled: false
  14895. }
  14896. }
  14897. };
  14898. var scale_time = core_scale.extend({
  14899. initialize: function() {
  14900. this.mergeTicksOptions();
  14901. core_scale.prototype.initialize.call(this);
  14902. },
  14903. update: function() {
  14904. var me = this;
  14905. var options = me.options;
  14906. var time = options.time || (options.time = {});
  14907. var adapter = me._adapter = new core_adapters._date(options.adapters.date);
  14908. // DEPRECATIONS: output a message only one time per update
  14909. deprecated$1('time scale', time.format, 'time.format', 'time.parser');
  14910. deprecated$1('time scale', time.min, 'time.min', 'ticks.min');
  14911. deprecated$1('time scale', time.max, 'time.max', 'ticks.max');
  14912. // Backward compatibility: before introducing adapter, `displayFormats` was
  14913. // supposed to contain *all* unit/string pairs but this can't be resolved
  14914. // when loading the scale (adapters are loaded afterward), so let's populate
  14915. // missing formats on update
  14916. helpers$1.mergeIf(time.displayFormats, adapter.formats());
  14917. return core_scale.prototype.update.apply(me, arguments);
  14918. },
  14919. /**
  14920. * Allows data to be referenced via 't' attribute
  14921. */
  14922. getRightValue: function(rawValue) {
  14923. if (rawValue && rawValue.t !== undefined) {
  14924. rawValue = rawValue.t;
  14925. }
  14926. return core_scale.prototype.getRightValue.call(this, rawValue);
  14927. },
  14928. determineDataLimits: function() {
  14929. var me = this;
  14930. var chart = me.chart;
  14931. var adapter = me._adapter;
  14932. var options = me.options;
  14933. var unit = options.time.unit || 'day';
  14934. var min = MAX_INTEGER;
  14935. var max = MIN_INTEGER;
  14936. var timestamps = [];
  14937. var datasets = [];
  14938. var labels = [];
  14939. var i, j, ilen, jlen, data, timestamp, labelsAdded;
  14940. var dataLabels = me._getLabels();
  14941. for (i = 0, ilen = dataLabels.length; i < ilen; ++i) {
  14942. labels.push(parse(me, dataLabels[i]));
  14943. }
  14944. for (i = 0, ilen = (chart.data.datasets || []).length; i < ilen; ++i) {
  14945. if (chart.isDatasetVisible(i)) {
  14946. data = chart.data.datasets[i].data;
  14947. // Let's consider that all data have the same format.
  14948. if (helpers$1.isObject(data[0])) {
  14949. datasets[i] = [];
  14950. for (j = 0, jlen = data.length; j < jlen; ++j) {
  14951. timestamp = parse(me, data[j]);
  14952. timestamps.push(timestamp);
  14953. datasets[i][j] = timestamp;
  14954. }
  14955. } else {
  14956. datasets[i] = labels.slice(0);
  14957. if (!labelsAdded) {
  14958. timestamps = timestamps.concat(labels);
  14959. labelsAdded = true;
  14960. }
  14961. }
  14962. } else {
  14963. datasets[i] = [];
  14964. }
  14965. }
  14966. if (labels.length) {
  14967. min = Math.min(min, labels[0]);
  14968. max = Math.max(max, labels[labels.length - 1]);
  14969. }
  14970. if (timestamps.length) {
  14971. timestamps = ilen > 1 ? arrayUnique(timestamps).sort(sorter) : timestamps.sort(sorter);
  14972. min = Math.min(min, timestamps[0]);
  14973. max = Math.max(max, timestamps[timestamps.length - 1]);
  14974. }
  14975. min = parse(me, getMin(options)) || min;
  14976. max = parse(me, getMax(options)) || max;
  14977. // In case there is no valid min/max, set limits based on unit time option
  14978. min = min === MAX_INTEGER ? +adapter.startOf(Date.now(), unit) : min;
  14979. max = max === MIN_INTEGER ? +adapter.endOf(Date.now(), unit) + 1 : max;
  14980. // Make sure that max is strictly higher than min (required by the lookup table)
  14981. me.min = Math.min(min, max);
  14982. me.max = Math.max(min + 1, max);
  14983. // PRIVATE
  14984. me._table = [];
  14985. me._timestamps = {
  14986. data: timestamps,
  14987. datasets: datasets,
  14988. labels: labels
  14989. };
  14990. },
  14991. buildTicks: function() {
  14992. var me = this;
  14993. var min = me.min;
  14994. var max = me.max;
  14995. var options = me.options;
  14996. var tickOpts = options.ticks;
  14997. var timeOpts = options.time;
  14998. var timestamps = me._timestamps;
  14999. var ticks = [];
  15000. var capacity = me.getLabelCapacity(min);
  15001. var source = tickOpts.source;
  15002. var distribution = options.distribution;
  15003. var i, ilen, timestamp;
  15004. if (source === 'data' || (source === 'auto' && distribution === 'series')) {
  15005. timestamps = timestamps.data;
  15006. } else if (source === 'labels') {
  15007. timestamps = timestamps.labels;
  15008. } else {
  15009. timestamps = generate(me, min, max, capacity);
  15010. }
  15011. if (options.bounds === 'ticks' && timestamps.length) {
  15012. min = timestamps[0];
  15013. max = timestamps[timestamps.length - 1];
  15014. }
  15015. // Enforce limits with user min/max options
  15016. min = parse(me, getMin(options)) || min;
  15017. max = parse(me, getMax(options)) || max;
  15018. // Remove ticks outside the min/max range
  15019. for (i = 0, ilen = timestamps.length; i < ilen; ++i) {
  15020. timestamp = timestamps[i];
  15021. if (timestamp >= min && timestamp <= max) {
  15022. ticks.push(timestamp);
  15023. }
  15024. }
  15025. me.min = min;
  15026. me.max = max;
  15027. // PRIVATE
  15028. // determineUnitForFormatting relies on the number of ticks so we don't use it when
  15029. // autoSkip is enabled because we don't yet know what the final number of ticks will be
  15030. me._unit = timeOpts.unit || (tickOpts.autoSkip
  15031. ? determineUnitForAutoTicks(timeOpts.minUnit, me.min, me.max, capacity)
  15032. : determineUnitForFormatting(me, ticks.length, timeOpts.minUnit, me.min, me.max));
  15033. me._majorUnit = !tickOpts.major.enabled || me._unit === 'year' ? undefined
  15034. : determineMajorUnit(me._unit);
  15035. me._table = buildLookupTable(me._timestamps.data, min, max, distribution);
  15036. me._offsets = computeOffsets(me._table, ticks, min, max, options);
  15037. if (tickOpts.reverse) {
  15038. ticks.reverse();
  15039. }
  15040. return ticksFromTimestamps(me, ticks, me._majorUnit);
  15041. },
  15042. getLabelForIndex: function(index, datasetIndex) {
  15043. var me = this;
  15044. var adapter = me._adapter;
  15045. var data = me.chart.data;
  15046. var timeOpts = me.options.time;
  15047. var label = data.labels && index < data.labels.length ? data.labels[index] : '';
  15048. var value = data.datasets[datasetIndex].data[index];
  15049. if (helpers$1.isObject(value)) {
  15050. label = me.getRightValue(value);
  15051. }
  15052. if (timeOpts.tooltipFormat) {
  15053. return adapter.format(toTimestamp(me, label), timeOpts.tooltipFormat);
  15054. }
  15055. if (typeof label === 'string') {
  15056. return label;
  15057. }
  15058. return adapter.format(toTimestamp(me, label), timeOpts.displayFormats.datetime);
  15059. },
  15060. /**
  15061. * Function to format an individual tick mark
  15062. * @private
  15063. */
  15064. tickFormatFunction: function(time, index, ticks, format) {
  15065. var me = this;
  15066. var adapter = me._adapter;
  15067. var options = me.options;
  15068. var formats = options.time.displayFormats;
  15069. var minorFormat = formats[me._unit];
  15070. var majorUnit = me._majorUnit;
  15071. var majorFormat = formats[majorUnit];
  15072. var tick = ticks[index];
  15073. var tickOpts = options.ticks;
  15074. var major = majorUnit && majorFormat && tick && tick.major;
  15075. var label = adapter.format(time, format ? format : major ? majorFormat : minorFormat);
  15076. var nestedTickOpts = major ? tickOpts.major : tickOpts.minor;
  15077. var formatter = resolve$5([
  15078. nestedTickOpts.callback,
  15079. nestedTickOpts.userCallback,
  15080. tickOpts.callback,
  15081. tickOpts.userCallback
  15082. ]);
  15083. return formatter ? formatter(label, index, ticks) : label;
  15084. },
  15085. convertTicksToLabels: function(ticks) {
  15086. var labels = [];
  15087. var i, ilen;
  15088. for (i = 0, ilen = ticks.length; i < ilen; ++i) {
  15089. labels.push(this.tickFormatFunction(ticks[i].value, i, ticks));
  15090. }
  15091. return labels;
  15092. },
  15093. /**
  15094. * @private
  15095. */
  15096. getPixelForOffset: function(time) {
  15097. var me = this;
  15098. var offsets = me._offsets;
  15099. var pos = interpolate$1(me._table, 'time', time, 'pos');
  15100. return me.getPixelForDecimal((offsets.start + pos) * offsets.factor);
  15101. },
  15102. getPixelForValue: function(value, index, datasetIndex) {
  15103. var me = this;
  15104. var time = null;
  15105. if (index !== undefined && datasetIndex !== undefined) {
  15106. time = me._timestamps.datasets[datasetIndex][index];
  15107. }
  15108. if (time === null) {
  15109. time = parse(me, value);
  15110. }
  15111. if (time !== null) {
  15112. return me.getPixelForOffset(time);
  15113. }
  15114. },
  15115. getPixelForTick: function(index) {
  15116. var ticks = this.getTicks();
  15117. return index >= 0 && index < ticks.length ?
  15118. this.getPixelForOffset(ticks[index].value) :
  15119. null;
  15120. },
  15121. getValueForPixel: function(pixel) {
  15122. var me = this;
  15123. var offsets = me._offsets;
  15124. var pos = me.getDecimalForPixel(pixel) / offsets.factor - offsets.end;
  15125. var time = interpolate$1(me._table, 'pos', pos, 'time');
  15126. // DEPRECATION, we should return time directly
  15127. return me._adapter._create(time);
  15128. },
  15129. /**
  15130. * @private
  15131. */
  15132. _getLabelSize: function(label) {
  15133. var me = this;
  15134. var ticksOpts = me.options.ticks;
  15135. var tickLabelWidth = me.ctx.measureText(label).width;
  15136. var angle = helpers$1.toRadians(me.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);
  15137. var cosRotation = Math.cos(angle);
  15138. var sinRotation = Math.sin(angle);
  15139. var tickFontSize = valueOrDefault$d(ticksOpts.fontSize, core_defaults.global.defaultFontSize);
  15140. return {
  15141. w: (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation),
  15142. h: (tickLabelWidth * sinRotation) + (tickFontSize * cosRotation)
  15143. };
  15144. },
  15145. /**
  15146. * Crude approximation of what the label width might be
  15147. * @private
  15148. */
  15149. getLabelWidth: function(label) {
  15150. return this._getLabelSize(label).w;
  15151. },
  15152. /**
  15153. * @private
  15154. */
  15155. getLabelCapacity: function(exampleTime) {
  15156. var me = this;
  15157. var timeOpts = me.options.time;
  15158. var displayFormats = timeOpts.displayFormats;
  15159. // pick the longest format (milliseconds) for guestimation
  15160. var format = displayFormats[timeOpts.unit] || displayFormats.millisecond;
  15161. var exampleLabel = me.tickFormatFunction(exampleTime, 0, ticksFromTimestamps(me, [exampleTime], me._majorUnit), format);
  15162. var size = me._getLabelSize(exampleLabel);
  15163. var capacity = Math.floor(me.isHorizontal() ? me.width / size.w : me.height / size.h);
  15164. if (me.options.offset) {
  15165. capacity--;
  15166. }
  15167. return capacity > 0 ? capacity : 1;
  15168. }
  15169. });
  15170. // INTERNAL: static default options, registered in src/index.js
  15171. var _defaults$4 = defaultConfig$4;
  15172. scale_time._defaults = _defaults$4;
  15173. var scales = {
  15174. category: scale_category,
  15175. linear: scale_linear,
  15176. logarithmic: scale_logarithmic,
  15177. radialLinear: scale_radialLinear,
  15178. time: scale_time
  15179. };
  15180. var FORMATS = {
  15181. datetime: 'MMM D, YYYY, h:mm:ss a',
  15182. millisecond: 'h:mm:ss.SSS a',
  15183. second: 'h:mm:ss a',
  15184. minute: 'h:mm a',
  15185. hour: 'hA',
  15186. day: 'MMM D',
  15187. week: 'll',
  15188. month: 'MMM YYYY',
  15189. quarter: '[Q]Q - YYYY',
  15190. year: 'YYYY'
  15191. };
  15192. core_adapters._date.override(typeof moment === 'function' ? {
  15193. _id: 'moment', // DEBUG ONLY
  15194. formats: function() {
  15195. return FORMATS;
  15196. },
  15197. parse: function(value, format) {
  15198. if (typeof value === 'string' && typeof format === 'string') {
  15199. value = moment(value, format);
  15200. } else if (!(value instanceof moment)) {
  15201. value = moment(value);
  15202. }
  15203. return value.isValid() ? value.valueOf() : null;
  15204. },
  15205. format: function(time, format) {
  15206. return moment(time).format(format);
  15207. },
  15208. add: function(time, amount, unit) {
  15209. return moment(time).add(amount, unit).valueOf();
  15210. },
  15211. diff: function(max, min, unit) {
  15212. return moment(max).diff(moment(min), unit);
  15213. },
  15214. startOf: function(time, unit, weekday) {
  15215. time = moment(time);
  15216. if (unit === 'isoWeek') {
  15217. return time.isoWeekday(weekday).valueOf();
  15218. }
  15219. return time.startOf(unit).valueOf();
  15220. },
  15221. endOf: function(time, unit) {
  15222. return moment(time).endOf(unit).valueOf();
  15223. },
  15224. // DEPRECATIONS
  15225. /**
  15226. * Provided for backward compatibility with scale.getValueForPixel().
  15227. * @deprecated since version 2.8.0
  15228. * @todo remove at version 3
  15229. * @private
  15230. */
  15231. _create: function(time) {
  15232. return moment(time);
  15233. },
  15234. } : {});
  15235. core_defaults._set('global', {
  15236. plugins: {
  15237. filler: {
  15238. propagate: true
  15239. }
  15240. }
  15241. });
  15242. var mappers = {
  15243. dataset: function(source) {
  15244. var index = source.fill;
  15245. var chart = source.chart;
  15246. var meta = chart.getDatasetMeta(index);
  15247. var visible = meta && chart.isDatasetVisible(index);
  15248. var points = (visible && meta.dataset._children) || [];
  15249. var length = points.length || 0;
  15250. return !length ? null : function(point, i) {
  15251. return (i < length && points[i]._view) || null;
  15252. };
  15253. },
  15254. boundary: function(source) {
  15255. var boundary = source.boundary;
  15256. var x = boundary ? boundary.x : null;
  15257. var y = boundary ? boundary.y : null;
  15258. if (helpers$1.isArray(boundary)) {
  15259. return function(point, i) {
  15260. return boundary[i];
  15261. };
  15262. }
  15263. return function(point) {
  15264. return {
  15265. x: x === null ? point.x : x,
  15266. y: y === null ? point.y : y,
  15267. };
  15268. };
  15269. }
  15270. };
  15271. // @todo if (fill[0] === '#')
  15272. function decodeFill(el, index, count) {
  15273. var model = el._model || {};
  15274. var fill = model.fill;
  15275. var target;
  15276. if (fill === undefined) {
  15277. fill = !!model.backgroundColor;
  15278. }
  15279. if (fill === false || fill === null) {
  15280. return false;
  15281. }
  15282. if (fill === true) {
  15283. return 'origin';
  15284. }
  15285. target = parseFloat(fill, 10);
  15286. if (isFinite(target) && Math.floor(target) === target) {
  15287. if (fill[0] === '-' || fill[0] === '+') {
  15288. target = index + target;
  15289. }
  15290. if (target === index || target < 0 || target >= count) {
  15291. return false;
  15292. }
  15293. return target;
  15294. }
  15295. switch (fill) {
  15296. // compatibility
  15297. case 'bottom':
  15298. return 'start';
  15299. case 'top':
  15300. return 'end';
  15301. case 'zero':
  15302. return 'origin';
  15303. // supported boundaries
  15304. case 'origin':
  15305. case 'start':
  15306. case 'end':
  15307. return fill;
  15308. // invalid fill values
  15309. default:
  15310. return false;
  15311. }
  15312. }
  15313. function computeLinearBoundary(source) {
  15314. var model = source.el._model || {};
  15315. var scale = source.el._scale || {};
  15316. var fill = source.fill;
  15317. var target = null;
  15318. var horizontal;
  15319. if (isFinite(fill)) {
  15320. return null;
  15321. }
  15322. // Backward compatibility: until v3, we still need to support boundary values set on
  15323. // the model (scaleTop, scaleBottom and scaleZero) because some external plugins and
  15324. // controllers might still use it (e.g. the Smith chart).
  15325. if (fill === 'start') {
  15326. target = model.scaleBottom === undefined ? scale.bottom : model.scaleBottom;
  15327. } else if (fill === 'end') {
  15328. target = model.scaleTop === undefined ? scale.top : model.scaleTop;
  15329. } else if (model.scaleZero !== undefined) {
  15330. target = model.scaleZero;
  15331. } else if (scale.getBasePixel) {
  15332. target = scale.getBasePixel();
  15333. }
  15334. if (target !== undefined && target !== null) {
  15335. if (target.x !== undefined && target.y !== undefined) {
  15336. return target;
  15337. }
  15338. if (helpers$1.isFinite(target)) {
  15339. horizontal = scale.isHorizontal();
  15340. return {
  15341. x: horizontal ? target : null,
  15342. y: horizontal ? null : target
  15343. };
  15344. }
  15345. }
  15346. return null;
  15347. }
  15348. function computeCircularBoundary(source) {
  15349. var scale = source.el._scale;
  15350. var options = scale.options;
  15351. var length = scale.chart.data.labels.length;
  15352. var fill = source.fill;
  15353. var target = [];
  15354. var start, end, center, i, point;
  15355. if (!length) {
  15356. return null;
  15357. }
  15358. start = options.ticks.reverse ? scale.max : scale.min;
  15359. end = options.ticks.reverse ? scale.min : scale.max;
  15360. center = scale.getPointPositionForValue(0, start);
  15361. for (i = 0; i < length; ++i) {
  15362. point = fill === 'start' || fill === 'end'
  15363. ? scale.getPointPositionForValue(i, fill === 'start' ? start : end)
  15364. : scale.getBasePosition(i);
  15365. if (options.gridLines.circular) {
  15366. point.cx = center.x;
  15367. point.cy = center.y;
  15368. point.angle = scale.getIndexAngle(i) - Math.PI / 2;
  15369. }
  15370. target.push(point);
  15371. }
  15372. return target;
  15373. }
  15374. function computeBoundary(source) {
  15375. var scale = source.el._scale || {};
  15376. if (scale.getPointPositionForValue) {
  15377. return computeCircularBoundary(source);
  15378. }
  15379. return computeLinearBoundary(source);
  15380. }
  15381. function resolveTarget(sources, index, propagate) {
  15382. var source = sources[index];
  15383. var fill = source.fill;
  15384. var visited = [index];
  15385. var target;
  15386. if (!propagate) {
  15387. return fill;
  15388. }
  15389. while (fill !== false && visited.indexOf(fill) === -1) {
  15390. if (!isFinite(fill)) {
  15391. return fill;
  15392. }
  15393. target = sources[fill];
  15394. if (!target) {
  15395. return false;
  15396. }
  15397. if (target.visible) {
  15398. return fill;
  15399. }
  15400. visited.push(fill);
  15401. fill = target.fill;
  15402. }
  15403. return false;
  15404. }
  15405. function createMapper(source) {
  15406. var fill = source.fill;
  15407. var type = 'dataset';
  15408. if (fill === false) {
  15409. return null;
  15410. }
  15411. if (!isFinite(fill)) {
  15412. type = 'boundary';
  15413. }
  15414. return mappers[type](source);
  15415. }
  15416. function isDrawable(point) {
  15417. return point && !point.skip;
  15418. }
  15419. function drawArea(ctx, curve0, curve1, len0, len1) {
  15420. var i, cx, cy, r;
  15421. if (!len0 || !len1) {
  15422. return;
  15423. }
  15424. // building first area curve (normal)
  15425. ctx.moveTo(curve0[0].x, curve0[0].y);
  15426. for (i = 1; i < len0; ++i) {
  15427. helpers$1.canvas.lineTo(ctx, curve0[i - 1], curve0[i]);
  15428. }
  15429. if (curve1[0].angle !== undefined) {
  15430. cx = curve1[0].cx;
  15431. cy = curve1[0].cy;
  15432. r = Math.sqrt(Math.pow(curve1[0].x - cx, 2) + Math.pow(curve1[0].y - cy, 2));
  15433. for (i = len1 - 1; i > 0; --i) {
  15434. ctx.arc(cx, cy, r, curve1[i].angle, curve1[i - 1].angle, true);
  15435. }
  15436. return;
  15437. }
  15438. // joining the two area curves
  15439. ctx.lineTo(curve1[len1 - 1].x, curve1[len1 - 1].y);
  15440. // building opposite area curve (reverse)
  15441. for (i = len1 - 1; i > 0; --i) {
  15442. helpers$1.canvas.lineTo(ctx, curve1[i], curve1[i - 1], true);
  15443. }
  15444. }
  15445. function doFill(ctx, points, mapper, view, color, loop) {
  15446. var count = points.length;
  15447. var span = view.spanGaps;
  15448. var curve0 = [];
  15449. var curve1 = [];
  15450. var len0 = 0;
  15451. var len1 = 0;
  15452. var i, ilen, index, p0, p1, d0, d1, loopOffset;
  15453. ctx.beginPath();
  15454. for (i = 0, ilen = count; i < ilen; ++i) {
  15455. index = i % count;
  15456. p0 = points[index]._view;
  15457. p1 = mapper(p0, index, view);
  15458. d0 = isDrawable(p0);
  15459. d1 = isDrawable(p1);
  15460. if (loop && loopOffset === undefined && d0) {
  15461. loopOffset = i + 1;
  15462. ilen = count + loopOffset;
  15463. }
  15464. if (d0 && d1) {
  15465. len0 = curve0.push(p0);
  15466. len1 = curve1.push(p1);
  15467. } else if (len0 && len1) {
  15468. if (!span) {
  15469. drawArea(ctx, curve0, curve1, len0, len1);
  15470. len0 = len1 = 0;
  15471. curve0 = [];
  15472. curve1 = [];
  15473. } else {
  15474. if (d0) {
  15475. curve0.push(p0);
  15476. }
  15477. if (d1) {
  15478. curve1.push(p1);
  15479. }
  15480. }
  15481. }
  15482. }
  15483. drawArea(ctx, curve0, curve1, len0, len1);
  15484. ctx.closePath();
  15485. ctx.fillStyle = color;
  15486. ctx.fill();
  15487. }
  15488. var plugin_filler = {
  15489. id: 'filler',
  15490. afterDatasetsUpdate: function(chart, options) {
  15491. var count = (chart.data.datasets || []).length;
  15492. var propagate = options.propagate;
  15493. var sources = [];
  15494. var meta, i, el, source;
  15495. for (i = 0; i < count; ++i) {
  15496. meta = chart.getDatasetMeta(i);
  15497. el = meta.dataset;
  15498. source = null;
  15499. if (el && el._model && el instanceof elements.Line) {
  15500. source = {
  15501. visible: chart.isDatasetVisible(i),
  15502. fill: decodeFill(el, i, count),
  15503. chart: chart,
  15504. el: el
  15505. };
  15506. }
  15507. meta.$filler = source;
  15508. sources.push(source);
  15509. }
  15510. for (i = 0; i < count; ++i) {
  15511. source = sources[i];
  15512. if (!source) {
  15513. continue;
  15514. }
  15515. source.fill = resolveTarget(sources, i, propagate);
  15516. source.boundary = computeBoundary(source);
  15517. source.mapper = createMapper(source);
  15518. }
  15519. },
  15520. beforeDatasetsDraw: function(chart) {
  15521. var metasets = chart._getSortedVisibleDatasetMetas();
  15522. var ctx = chart.ctx;
  15523. var meta, i, el, view, points, mapper, color;
  15524. for (i = metasets.length - 1; i >= 0; --i) {
  15525. meta = metasets[i].$filler;
  15526. if (!meta || !meta.visible) {
  15527. continue;
  15528. }
  15529. el = meta.el;
  15530. view = el._view;
  15531. points = el._children || [];
  15532. mapper = meta.mapper;
  15533. color = view.backgroundColor || core_defaults.global.defaultColor;
  15534. if (mapper && color && points.length) {
  15535. helpers$1.canvas.clipArea(ctx, chart.chartArea);
  15536. doFill(ctx, points, mapper, view, color, el._loop);
  15537. helpers$1.canvas.unclipArea(ctx);
  15538. }
  15539. }
  15540. }
  15541. };
  15542. var getRtlHelper$1 = helpers$1.rtl.getRtlAdapter;
  15543. var noop$1 = helpers$1.noop;
  15544. var valueOrDefault$e = helpers$1.valueOrDefault;
  15545. core_defaults._set('global', {
  15546. legend: {
  15547. display: true,
  15548. position: 'top',
  15549. align: 'center',
  15550. fullWidth: true,
  15551. reverse: false,
  15552. weight: 1000,
  15553. // a callback that will handle
  15554. onClick: function(e, legendItem) {
  15555. var index = legendItem.datasetIndex;
  15556. var ci = this.chart;
  15557. var meta = ci.getDatasetMeta(index);
  15558. // See controller.isDatasetVisible comment
  15559. meta.hidden = meta.hidden === null ? !ci.data.datasets[index].hidden : null;
  15560. // We hid a dataset ... rerender the chart
  15561. ci.update();
  15562. },
  15563. onHover: null,
  15564. onLeave: null,
  15565. labels: {
  15566. boxWidth: 40,
  15567. padding: 10,
  15568. // Generates labels shown in the legend
  15569. // Valid properties to return:
  15570. // text : text to display
  15571. // fillStyle : fill of coloured box
  15572. // strokeStyle: stroke of coloured box
  15573. // hidden : if this legend item refers to a hidden item
  15574. // lineCap : cap style for line
  15575. // lineDash
  15576. // lineDashOffset :
  15577. // lineJoin :
  15578. // lineWidth :
  15579. generateLabels: function(chart) {
  15580. var datasets = chart.data.datasets;
  15581. var options = chart.options.legend || {};
  15582. var usePointStyle = options.labels && options.labels.usePointStyle;
  15583. return chart._getSortedDatasetMetas().map(function(meta) {
  15584. var style = meta.controller.getStyle(usePointStyle ? 0 : undefined);
  15585. return {
  15586. text: datasets[meta.index].label,
  15587. fillStyle: style.backgroundColor,
  15588. hidden: !chart.isDatasetVisible(meta.index),
  15589. lineCap: style.borderCapStyle,
  15590. lineDash: style.borderDash,
  15591. lineDashOffset: style.borderDashOffset,
  15592. lineJoin: style.borderJoinStyle,
  15593. lineWidth: style.borderWidth,
  15594. strokeStyle: style.borderColor,
  15595. pointStyle: style.pointStyle,
  15596. rotation: style.rotation,
  15597. // Below is extra data used for toggling the datasets
  15598. datasetIndex: meta.index
  15599. };
  15600. }, this);
  15601. }
  15602. }
  15603. },
  15604. legendCallback: function(chart) {
  15605. var list = document.createElement('ul');
  15606. var datasets = chart.data.datasets;
  15607. var i, ilen, listItem, listItemSpan;
  15608. list.setAttribute('class', chart.id + '-legend');
  15609. for (i = 0, ilen = datasets.length; i < ilen; i++) {
  15610. listItem = list.appendChild(document.createElement('li'));
  15611. listItemSpan = listItem.appendChild(document.createElement('span'));
  15612. listItemSpan.style.backgroundColor = datasets[i].backgroundColor;
  15613. if (datasets[i].label) {
  15614. listItem.appendChild(document.createTextNode(datasets[i].label));
  15615. }
  15616. }
  15617. return list.outerHTML;
  15618. }
  15619. });
  15620. /**
  15621. * Helper function to get the box width based on the usePointStyle option
  15622. * @param {object} labelopts - the label options on the legend
  15623. * @param {number} fontSize - the label font size
  15624. * @return {number} width of the color box area
  15625. */
  15626. function getBoxWidth(labelOpts, fontSize) {
  15627. return labelOpts.usePointStyle && labelOpts.boxWidth > fontSize ?
  15628. fontSize :
  15629. labelOpts.boxWidth;
  15630. }
  15631. /**
  15632. * IMPORTANT: this class is exposed publicly as Chart.Legend, backward compatibility required!
  15633. */
  15634. var Legend = core_element.extend({
  15635. initialize: function(config) {
  15636. var me = this;
  15637. helpers$1.extend(me, config);
  15638. // Contains hit boxes for each dataset (in dataset order)
  15639. me.legendHitBoxes = [];
  15640. /**
  15641. * @private
  15642. */
  15643. me._hoveredItem = null;
  15644. // Are we in doughnut mode which has a different data type
  15645. me.doughnutMode = false;
  15646. },
  15647. // These methods are ordered by lifecycle. Utilities then follow.
  15648. // Any function defined here is inherited by all legend types.
  15649. // Any function can be extended by the legend type
  15650. beforeUpdate: noop$1,
  15651. update: function(maxWidth, maxHeight, margins) {
  15652. var me = this;
  15653. // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)
  15654. me.beforeUpdate();
  15655. // Absorb the master measurements
  15656. me.maxWidth = maxWidth;
  15657. me.maxHeight = maxHeight;
  15658. me.margins = margins;
  15659. // Dimensions
  15660. me.beforeSetDimensions();
  15661. me.setDimensions();
  15662. me.afterSetDimensions();
  15663. // Labels
  15664. me.beforeBuildLabels();
  15665. me.buildLabels();
  15666. me.afterBuildLabels();
  15667. // Fit
  15668. me.beforeFit();
  15669. me.fit();
  15670. me.afterFit();
  15671. //
  15672. me.afterUpdate();
  15673. return me.minSize;
  15674. },
  15675. afterUpdate: noop$1,
  15676. //
  15677. beforeSetDimensions: noop$1,
  15678. setDimensions: function() {
  15679. var me = this;
  15680. // Set the unconstrained dimension before label rotation
  15681. if (me.isHorizontal()) {
  15682. // Reset position before calculating rotation
  15683. me.width = me.maxWidth;
  15684. me.left = 0;
  15685. me.right = me.width;
  15686. } else {
  15687. me.height = me.maxHeight;
  15688. // Reset position before calculating rotation
  15689. me.top = 0;
  15690. me.bottom = me.height;
  15691. }
  15692. // Reset padding
  15693. me.paddingLeft = 0;
  15694. me.paddingTop = 0;
  15695. me.paddingRight = 0;
  15696. me.paddingBottom = 0;
  15697. // Reset minSize
  15698. me.minSize = {
  15699. width: 0,
  15700. height: 0
  15701. };
  15702. },
  15703. afterSetDimensions: noop$1,
  15704. //
  15705. beforeBuildLabels: noop$1,
  15706. buildLabels: function() {
  15707. var me = this;
  15708. var labelOpts = me.options.labels || {};
  15709. var legendItems = helpers$1.callback(labelOpts.generateLabels, [me.chart], me) || [];
  15710. if (labelOpts.filter) {
  15711. legendItems = legendItems.filter(function(item) {
  15712. return labelOpts.filter(item, me.chart.data);
  15713. });
  15714. }
  15715. if (me.options.reverse) {
  15716. legendItems.reverse();
  15717. }
  15718. me.legendItems = legendItems;
  15719. },
  15720. afterBuildLabels: noop$1,
  15721. //
  15722. beforeFit: noop$1,
  15723. fit: function() {
  15724. var me = this;
  15725. var opts = me.options;
  15726. var labelOpts = opts.labels;
  15727. var display = opts.display;
  15728. var ctx = me.ctx;
  15729. var labelFont = helpers$1.options._parseFont(labelOpts);
  15730. var fontSize = labelFont.size;
  15731. // Reset hit boxes
  15732. var hitboxes = me.legendHitBoxes = [];
  15733. var minSize = me.minSize;
  15734. var isHorizontal = me.isHorizontal();
  15735. if (isHorizontal) {
  15736. minSize.width = me.maxWidth; // fill all the width
  15737. minSize.height = display ? 10 : 0;
  15738. } else {
  15739. minSize.width = display ? 10 : 0;
  15740. minSize.height = me.maxHeight; // fill all the height
  15741. }
  15742. // Increase sizes here
  15743. if (!display) {
  15744. me.width = minSize.width = me.height = minSize.height = 0;
  15745. return;
  15746. }
  15747. ctx.font = labelFont.string;
  15748. if (isHorizontal) {
  15749. // Labels
  15750. // Width of each line of legend boxes. Labels wrap onto multiple lines when there are too many to fit on one
  15751. var lineWidths = me.lineWidths = [0];
  15752. var totalHeight = 0;
  15753. ctx.textAlign = 'left';
  15754. ctx.textBaseline = 'middle';
  15755. helpers$1.each(me.legendItems, function(legendItem, i) {
  15756. var boxWidth = getBoxWidth(labelOpts, fontSize);
  15757. var width = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;
  15758. if (i === 0 || lineWidths[lineWidths.length - 1] + width + 2 * labelOpts.padding > minSize.width) {
  15759. totalHeight += fontSize + labelOpts.padding;
  15760. lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;
  15761. }
  15762. // Store the hitbox width and height here. Final position will be updated in `draw`
  15763. hitboxes[i] = {
  15764. left: 0,
  15765. top: 0,
  15766. width: width,
  15767. height: fontSize
  15768. };
  15769. lineWidths[lineWidths.length - 1] += width + labelOpts.padding;
  15770. });
  15771. minSize.height += totalHeight;
  15772. } else {
  15773. var vPadding = labelOpts.padding;
  15774. var columnWidths = me.columnWidths = [];
  15775. var columnHeights = me.columnHeights = [];
  15776. var totalWidth = labelOpts.padding;
  15777. var currentColWidth = 0;
  15778. var currentColHeight = 0;
  15779. helpers$1.each(me.legendItems, function(legendItem, i) {
  15780. var boxWidth = getBoxWidth(labelOpts, fontSize);
  15781. var itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;
  15782. // If too tall, go to new column
  15783. if (i > 0 && currentColHeight + fontSize + 2 * vPadding > minSize.height) {
  15784. totalWidth += currentColWidth + labelOpts.padding;
  15785. columnWidths.push(currentColWidth); // previous column width
  15786. columnHeights.push(currentColHeight);
  15787. currentColWidth = 0;
  15788. currentColHeight = 0;
  15789. }
  15790. // Get max width
  15791. currentColWidth = Math.max(currentColWidth, itemWidth);
  15792. currentColHeight += fontSize + vPadding;
  15793. // Store the hitbox width and height here. Final position will be updated in `draw`
  15794. hitboxes[i] = {
  15795. left: 0,
  15796. top: 0,
  15797. width: itemWidth,
  15798. height: fontSize
  15799. };
  15800. });
  15801. totalWidth += currentColWidth;
  15802. columnWidths.push(currentColWidth);
  15803. columnHeights.push(currentColHeight);
  15804. minSize.width += totalWidth;
  15805. }
  15806. me.width = minSize.width;
  15807. me.height = minSize.height;
  15808. },
  15809. afterFit: noop$1,
  15810. // Shared Methods
  15811. isHorizontal: function() {
  15812. return this.options.position === 'top' || this.options.position === 'bottom';
  15813. },
  15814. // Actually draw the legend on the canvas
  15815. draw: function() {
  15816. var me = this;
  15817. var opts = me.options;
  15818. var labelOpts = opts.labels;
  15819. var globalDefaults = core_defaults.global;
  15820. var defaultColor = globalDefaults.defaultColor;
  15821. var lineDefault = globalDefaults.elements.line;
  15822. var legendHeight = me.height;
  15823. var columnHeights = me.columnHeights;
  15824. var legendWidth = me.width;
  15825. var lineWidths = me.lineWidths;
  15826. if (!opts.display) {
  15827. return;
  15828. }
  15829. var rtlHelper = getRtlHelper$1(opts.rtl, me.left, me.minSize.width);
  15830. var ctx = me.ctx;
  15831. var fontColor = valueOrDefault$e(labelOpts.fontColor, globalDefaults.defaultFontColor);
  15832. var labelFont = helpers$1.options._parseFont(labelOpts);
  15833. var fontSize = labelFont.size;
  15834. var cursor;
  15835. // Canvas setup
  15836. ctx.textAlign = rtlHelper.textAlign('left');
  15837. ctx.textBaseline = 'middle';
  15838. ctx.lineWidth = 0.5;
  15839. ctx.strokeStyle = fontColor; // for strikethrough effect
  15840. ctx.fillStyle = fontColor; // render in correct colour
  15841. ctx.font = labelFont.string;
  15842. var boxWidth = getBoxWidth(labelOpts, fontSize);
  15843. var hitboxes = me.legendHitBoxes;
  15844. // current position
  15845. var drawLegendBox = function(x, y, legendItem) {
  15846. if (isNaN(boxWidth) || boxWidth <= 0) {
  15847. return;
  15848. }
  15849. // Set the ctx for the box
  15850. ctx.save();
  15851. var lineWidth = valueOrDefault$e(legendItem.lineWidth, lineDefault.borderWidth);
  15852. ctx.fillStyle = valueOrDefault$e(legendItem.fillStyle, defaultColor);
  15853. ctx.lineCap = valueOrDefault$e(legendItem.lineCap, lineDefault.borderCapStyle);
  15854. ctx.lineDashOffset = valueOrDefault$e(legendItem.lineDashOffset, lineDefault.borderDashOffset);
  15855. ctx.lineJoin = valueOrDefault$e(legendItem.lineJoin, lineDefault.borderJoinStyle);
  15856. ctx.lineWidth = lineWidth;
  15857. ctx.strokeStyle = valueOrDefault$e(legendItem.strokeStyle, defaultColor);
  15858. if (ctx.setLineDash) {
  15859. // IE 9 and 10 do not support line dash
  15860. ctx.setLineDash(valueOrDefault$e(legendItem.lineDash, lineDefault.borderDash));
  15861. }
  15862. if (labelOpts && labelOpts.usePointStyle) {
  15863. // Recalculate x and y for drawPoint() because its expecting
  15864. // x and y to be center of figure (instead of top left)
  15865. var radius = boxWidth * Math.SQRT2 / 2;
  15866. var centerX = rtlHelper.xPlus(x, boxWidth / 2);
  15867. var centerY = y + fontSize / 2;
  15868. // Draw pointStyle as legend symbol
  15869. helpers$1.canvas.drawPoint(ctx, legendItem.pointStyle, radius, centerX, centerY, legendItem.rotation);
  15870. } else {
  15871. // Draw box as legend symbol
  15872. ctx.fillRect(rtlHelper.leftForLtr(x, boxWidth), y, boxWidth, fontSize);
  15873. if (lineWidth !== 0) {
  15874. ctx.strokeRect(rtlHelper.leftForLtr(x, boxWidth), y, boxWidth, fontSize);
  15875. }
  15876. }
  15877. ctx.restore();
  15878. };
  15879. var fillText = function(x, y, legendItem, textWidth) {
  15880. var halfFontSize = fontSize / 2;
  15881. var xLeft = rtlHelper.xPlus(x, boxWidth + halfFontSize);
  15882. var yMiddle = y + halfFontSize;
  15883. ctx.fillText(legendItem.text, xLeft, yMiddle);
  15884. if (legendItem.hidden) {
  15885. // Strikethrough the text if hidden
  15886. ctx.beginPath();
  15887. ctx.lineWidth = 2;
  15888. ctx.moveTo(xLeft, yMiddle);
  15889. ctx.lineTo(rtlHelper.xPlus(xLeft, textWidth), yMiddle);
  15890. ctx.stroke();
  15891. }
  15892. };
  15893. var alignmentOffset = function(dimension, blockSize) {
  15894. switch (opts.align) {
  15895. case 'start':
  15896. return labelOpts.padding;
  15897. case 'end':
  15898. return dimension - blockSize;
  15899. default: // center
  15900. return (dimension - blockSize + labelOpts.padding) / 2;
  15901. }
  15902. };
  15903. // Horizontal
  15904. var isHorizontal = me.isHorizontal();
  15905. if (isHorizontal) {
  15906. cursor = {
  15907. x: me.left + alignmentOffset(legendWidth, lineWidths[0]),
  15908. y: me.top + labelOpts.padding,
  15909. line: 0
  15910. };
  15911. } else {
  15912. cursor = {
  15913. x: me.left + labelOpts.padding,
  15914. y: me.top + alignmentOffset(legendHeight, columnHeights[0]),
  15915. line: 0
  15916. };
  15917. }
  15918. helpers$1.rtl.overrideTextDirection(me.ctx, opts.textDirection);
  15919. var itemHeight = fontSize + labelOpts.padding;
  15920. helpers$1.each(me.legendItems, function(legendItem, i) {
  15921. var textWidth = ctx.measureText(legendItem.text).width;
  15922. var width = boxWidth + (fontSize / 2) + textWidth;
  15923. var x = cursor.x;
  15924. var y = cursor.y;
  15925. rtlHelper.setWidth(me.minSize.width);
  15926. // Use (me.left + me.minSize.width) and (me.top + me.minSize.height)
  15927. // instead of me.right and me.bottom because me.width and me.height
  15928. // may have been changed since me.minSize was calculated
  15929. if (isHorizontal) {
  15930. if (i > 0 && x + width + labelOpts.padding > me.left + me.minSize.width) {
  15931. y = cursor.y += itemHeight;
  15932. cursor.line++;
  15933. x = cursor.x = me.left + alignmentOffset(legendWidth, lineWidths[cursor.line]);
  15934. }
  15935. } else if (i > 0 && y + itemHeight > me.top + me.minSize.height) {
  15936. x = cursor.x = x + me.columnWidths[cursor.line] + labelOpts.padding;
  15937. cursor.line++;
  15938. y = cursor.y = me.top + alignmentOffset(legendHeight, columnHeights[cursor.line]);
  15939. }
  15940. var realX = rtlHelper.x(x);
  15941. drawLegendBox(realX, y, legendItem);
  15942. hitboxes[i].left = rtlHelper.leftForLtr(realX, hitboxes[i].width);
  15943. hitboxes[i].top = y;
  15944. // Fill the actual label
  15945. fillText(realX, y, legendItem, textWidth);
  15946. if (isHorizontal) {
  15947. cursor.x += width + labelOpts.padding;
  15948. } else {
  15949. cursor.y += itemHeight;
  15950. }
  15951. });
  15952. helpers$1.rtl.restoreTextDirection(me.ctx, opts.textDirection);
  15953. },
  15954. /**
  15955. * @private
  15956. */
  15957. _getLegendItemAt: function(x, y) {
  15958. var me = this;
  15959. var i, hitBox, lh;
  15960. if (x >= me.left && x <= me.right && y >= me.top && y <= me.bottom) {
  15961. // See if we are touching one of the dataset boxes
  15962. lh = me.legendHitBoxes;
  15963. for (i = 0; i < lh.length; ++i) {
  15964. hitBox = lh[i];
  15965. if (x >= hitBox.left && x <= hitBox.left + hitBox.width && y >= hitBox.top && y <= hitBox.top + hitBox.height) {
  15966. // Touching an element
  15967. return me.legendItems[i];
  15968. }
  15969. }
  15970. }
  15971. return null;
  15972. },
  15973. /**
  15974. * Handle an event
  15975. * @private
  15976. * @param {IEvent} event - The event to handle
  15977. */
  15978. handleEvent: function(e) {
  15979. var me = this;
  15980. var opts = me.options;
  15981. var type = e.type === 'mouseup' ? 'click' : e.type;
  15982. var hoveredItem;
  15983. if (type === 'mousemove') {
  15984. if (!opts.onHover && !opts.onLeave) {
  15985. return;
  15986. }
  15987. } else if (type === 'click') {
  15988. if (!opts.onClick) {
  15989. return;
  15990. }
  15991. } else {
  15992. return;
  15993. }
  15994. // Chart event already has relative position in it
  15995. hoveredItem = me._getLegendItemAt(e.x, e.y);
  15996. if (type === 'click') {
  15997. if (hoveredItem && opts.onClick) {
  15998. // use e.native for backwards compatibility
  15999. opts.onClick.call(me, e.native, hoveredItem);
  16000. }
  16001. } else {
  16002. if (opts.onLeave && hoveredItem !== me._hoveredItem) {
  16003. if (me._hoveredItem) {
  16004. opts.onLeave.call(me, e.native, me._hoveredItem);
  16005. }
  16006. me._hoveredItem = hoveredItem;
  16007. }
  16008. if (opts.onHover && hoveredItem) {
  16009. // use e.native for backwards compatibility
  16010. opts.onHover.call(me, e.native, hoveredItem);
  16011. }
  16012. }
  16013. }
  16014. });
  16015. function createNewLegendAndAttach(chart, legendOpts) {
  16016. var legend = new Legend({
  16017. ctx: chart.ctx,
  16018. options: legendOpts,
  16019. chart: chart
  16020. });
  16021. core_layouts.configure(chart, legend, legendOpts);
  16022. core_layouts.addBox(chart, legend);
  16023. chart.legend = legend;
  16024. }
  16025. var plugin_legend = {
  16026. id: 'legend',
  16027. /**
  16028. * Backward compatibility: since 2.1.5, the legend is registered as a plugin, making
  16029. * Chart.Legend obsolete. To avoid a breaking change, we export the Legend as part of
  16030. * the plugin, which one will be re-exposed in the chart.js file.
  16031. * https://github.com/chartjs/Chart.js/pull/2640
  16032. * @private
  16033. */
  16034. _element: Legend,
  16035. beforeInit: function(chart) {
  16036. var legendOpts = chart.options.legend;
  16037. if (legendOpts) {
  16038. createNewLegendAndAttach(chart, legendOpts);
  16039. }
  16040. },
  16041. beforeUpdate: function(chart) {
  16042. var legendOpts = chart.options.legend;
  16043. var legend = chart.legend;
  16044. if (legendOpts) {
  16045. helpers$1.mergeIf(legendOpts, core_defaults.global.legend);
  16046. if (legend) {
  16047. core_layouts.configure(chart, legend, legendOpts);
  16048. legend.options = legendOpts;
  16049. } else {
  16050. createNewLegendAndAttach(chart, legendOpts);
  16051. }
  16052. } else if (legend) {
  16053. core_layouts.removeBox(chart, legend);
  16054. delete chart.legend;
  16055. }
  16056. },
  16057. afterEvent: function(chart, e) {
  16058. var legend = chart.legend;
  16059. if (legend) {
  16060. legend.handleEvent(e);
  16061. }
  16062. }
  16063. };
  16064. var noop$2 = helpers$1.noop;
  16065. core_defaults._set('global', {
  16066. title: {
  16067. display: false,
  16068. fontStyle: 'bold',
  16069. fullWidth: true,
  16070. padding: 10,
  16071. position: 'top',
  16072. text: '',
  16073. weight: 2000 // by default greater than legend (1000) to be above
  16074. }
  16075. });
  16076. /**
  16077. * IMPORTANT: this class is exposed publicly as Chart.Legend, backward compatibility required!
  16078. */
  16079. var Title = core_element.extend({
  16080. initialize: function(config) {
  16081. var me = this;
  16082. helpers$1.extend(me, config);
  16083. // Contains hit boxes for each dataset (in dataset order)
  16084. me.legendHitBoxes = [];
  16085. },
  16086. // These methods are ordered by lifecycle. Utilities then follow.
  16087. beforeUpdate: noop$2,
  16088. update: function(maxWidth, maxHeight, margins) {
  16089. var me = this;
  16090. // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)
  16091. me.beforeUpdate();
  16092. // Absorb the master measurements
  16093. me.maxWidth = maxWidth;
  16094. me.maxHeight = maxHeight;
  16095. me.margins = margins;
  16096. // Dimensions
  16097. me.beforeSetDimensions();
  16098. me.setDimensions();
  16099. me.afterSetDimensions();
  16100. // Labels
  16101. me.beforeBuildLabels();
  16102. me.buildLabels();
  16103. me.afterBuildLabels();
  16104. // Fit
  16105. me.beforeFit();
  16106. me.fit();
  16107. me.afterFit();
  16108. //
  16109. me.afterUpdate();
  16110. return me.minSize;
  16111. },
  16112. afterUpdate: noop$2,
  16113. //
  16114. beforeSetDimensions: noop$2,
  16115. setDimensions: function() {
  16116. var me = this;
  16117. // Set the unconstrained dimension before label rotation
  16118. if (me.isHorizontal()) {
  16119. // Reset position before calculating rotation
  16120. me.width = me.maxWidth;
  16121. me.left = 0;
  16122. me.right = me.width;
  16123. } else {
  16124. me.height = me.maxHeight;
  16125. // Reset position before calculating rotation
  16126. me.top = 0;
  16127. me.bottom = me.height;
  16128. }
  16129. // Reset padding
  16130. me.paddingLeft = 0;
  16131. me.paddingTop = 0;
  16132. me.paddingRight = 0;
  16133. me.paddingBottom = 0;
  16134. // Reset minSize
  16135. me.minSize = {
  16136. width: 0,
  16137. height: 0
  16138. };
  16139. },
  16140. afterSetDimensions: noop$2,
  16141. //
  16142. beforeBuildLabels: noop$2,
  16143. buildLabels: noop$2,
  16144. afterBuildLabels: noop$2,
  16145. //
  16146. beforeFit: noop$2,
  16147. fit: function() {
  16148. var me = this;
  16149. var opts = me.options;
  16150. var minSize = me.minSize = {};
  16151. var isHorizontal = me.isHorizontal();
  16152. var lineCount, textSize;
  16153. if (!opts.display) {
  16154. me.width = minSize.width = me.height = minSize.height = 0;
  16155. return;
  16156. }
  16157. lineCount = helpers$1.isArray(opts.text) ? opts.text.length : 1;
  16158. textSize = lineCount * helpers$1.options._parseFont(opts).lineHeight + opts.padding * 2;
  16159. me.width = minSize.width = isHorizontal ? me.maxWidth : textSize;
  16160. me.height = minSize.height = isHorizontal ? textSize : me.maxHeight;
  16161. },
  16162. afterFit: noop$2,
  16163. // Shared Methods
  16164. isHorizontal: function() {
  16165. var pos = this.options.position;
  16166. return pos === 'top' || pos === 'bottom';
  16167. },
  16168. // Actually draw the title block on the canvas
  16169. draw: function() {
  16170. var me = this;
  16171. var ctx = me.ctx;
  16172. var opts = me.options;
  16173. if (!opts.display) {
  16174. return;
  16175. }
  16176. var fontOpts = helpers$1.options._parseFont(opts);
  16177. var lineHeight = fontOpts.lineHeight;
  16178. var offset = lineHeight / 2 + opts.padding;
  16179. var rotation = 0;
  16180. var top = me.top;
  16181. var left = me.left;
  16182. var bottom = me.bottom;
  16183. var right = me.right;
  16184. var maxWidth, titleX, titleY;
  16185. ctx.fillStyle = helpers$1.valueOrDefault(opts.fontColor, core_defaults.global.defaultFontColor); // render in correct colour
  16186. ctx.font = fontOpts.string;
  16187. // Horizontal
  16188. if (me.isHorizontal()) {
  16189. titleX = left + ((right - left) / 2); // midpoint of the width
  16190. titleY = top + offset;
  16191. maxWidth = right - left;
  16192. } else {
  16193. titleX = opts.position === 'left' ? left + offset : right - offset;
  16194. titleY = top + ((bottom - top) / 2);
  16195. maxWidth = bottom - top;
  16196. rotation = Math.PI * (opts.position === 'left' ? -0.5 : 0.5);
  16197. }
  16198. ctx.save();
  16199. ctx.translate(titleX, titleY);
  16200. ctx.rotate(rotation);
  16201. ctx.textAlign = 'center';
  16202. ctx.textBaseline = 'middle';
  16203. var text = opts.text;
  16204. if (helpers$1.isArray(text)) {
  16205. var y = 0;
  16206. for (var i = 0; i < text.length; ++i) {
  16207. ctx.fillText(text[i], 0, y, maxWidth);
  16208. y += lineHeight;
  16209. }
  16210. } else {
  16211. ctx.fillText(text, 0, 0, maxWidth);
  16212. }
  16213. ctx.restore();
  16214. }
  16215. });
  16216. function createNewTitleBlockAndAttach(chart, titleOpts) {
  16217. var title = new Title({
  16218. ctx: chart.ctx,
  16219. options: titleOpts,
  16220. chart: chart
  16221. });
  16222. core_layouts.configure(chart, title, titleOpts);
  16223. core_layouts.addBox(chart, title);
  16224. chart.titleBlock = title;
  16225. }
  16226. var plugin_title = {
  16227. id: 'title',
  16228. /**
  16229. * Backward compatibility: since 2.1.5, the title is registered as a plugin, making
  16230. * Chart.Title obsolete. To avoid a breaking change, we export the Title as part of
  16231. * the plugin, which one will be re-exposed in the chart.js file.
  16232. * https://github.com/chartjs/Chart.js/pull/2640
  16233. * @private
  16234. */
  16235. _element: Title,
  16236. beforeInit: function(chart) {
  16237. var titleOpts = chart.options.title;
  16238. if (titleOpts) {
  16239. createNewTitleBlockAndAttach(chart, titleOpts);
  16240. }
  16241. },
  16242. beforeUpdate: function(chart) {
  16243. var titleOpts = chart.options.title;
  16244. var titleBlock = chart.titleBlock;
  16245. if (titleOpts) {
  16246. helpers$1.mergeIf(titleOpts, core_defaults.global.title);
  16247. if (titleBlock) {
  16248. core_layouts.configure(chart, titleBlock, titleOpts);
  16249. titleBlock.options = titleOpts;
  16250. } else {
  16251. createNewTitleBlockAndAttach(chart, titleOpts);
  16252. }
  16253. } else if (titleBlock) {
  16254. core_layouts.removeBox(chart, titleBlock);
  16255. delete chart.titleBlock;
  16256. }
  16257. }
  16258. };
  16259. var plugins = {};
  16260. var filler = plugin_filler;
  16261. var legend = plugin_legend;
  16262. var title = plugin_title;
  16263. plugins.filler = filler;
  16264. plugins.legend = legend;
  16265. plugins.title = title;
  16266. /**
  16267. * @namespace Chart
  16268. */
  16269. core_controller.helpers = helpers$1;
  16270. // @todo dispatch these helpers into appropriated helpers/helpers.* file and write unit tests!
  16271. core_helpers();
  16272. core_controller._adapters = core_adapters;
  16273. core_controller.Animation = core_animation;
  16274. core_controller.animationService = core_animations;
  16275. core_controller.controllers = controllers;
  16276. core_controller.DatasetController = core_datasetController;
  16277. core_controller.defaults = core_defaults;
  16278. core_controller.Element = core_element;
  16279. core_controller.elements = elements;
  16280. core_controller.Interaction = core_interaction;
  16281. core_controller.layouts = core_layouts;
  16282. core_controller.platform = platform;
  16283. core_controller.plugins = core_plugins;
  16284. core_controller.Scale = core_scale;
  16285. core_controller.scaleService = core_scaleService;
  16286. core_controller.Ticks = core_ticks;
  16287. core_controller.Tooltip = core_tooltip;
  16288. // Register built-in scales
  16289. core_controller.helpers.each(scales, function(scale, type) {
  16290. core_controller.scaleService.registerScaleType(type, scale, scale._defaults);
  16291. });
  16292. // Load to register built-in adapters (as side effects)
  16293. // Loading built-in plugins
  16294. for (var k in plugins) {
  16295. if (plugins.hasOwnProperty(k)) {
  16296. core_controller.plugins.register(plugins[k]);
  16297. }
  16298. }
  16299. core_controller.platform.initialize();
  16300. var src = core_controller;
  16301. if (typeof window !== 'undefined') {
  16302. window.Chart = core_controller;
  16303. }
  16304. // DEPRECATIONS
  16305. /**
  16306. * Provided for backward compatibility, not available anymore
  16307. * @namespace Chart.Chart
  16308. * @deprecated since version 2.8.0
  16309. * @todo remove at version 3
  16310. * @private
  16311. */
  16312. core_controller.Chart = core_controller;
  16313. /**
  16314. * Provided for backward compatibility, not available anymore
  16315. * @namespace Chart.Legend
  16316. * @deprecated since version 2.1.5
  16317. * @todo remove at version 3
  16318. * @private
  16319. */
  16320. core_controller.Legend = plugins.legend._element;
  16321. /**
  16322. * Provided for backward compatibility, not available anymore
  16323. * @namespace Chart.Title
  16324. * @deprecated since version 2.1.5
  16325. * @todo remove at version 3
  16326. * @private
  16327. */
  16328. core_controller.Title = plugins.title._element;
  16329. /**
  16330. * Provided for backward compatibility, use Chart.plugins instead
  16331. * @namespace Chart.pluginService
  16332. * @deprecated since version 2.1.5
  16333. * @todo remove at version 3
  16334. * @private
  16335. */
  16336. core_controller.pluginService = core_controller.plugins;
  16337. /**
  16338. * Provided for backward compatibility, inheriting from Chart.PlugingBase has no
  16339. * effect, instead simply create/register plugins via plain JavaScript objects.
  16340. * @interface Chart.PluginBase
  16341. * @deprecated since version 2.5.0
  16342. * @todo remove at version 3
  16343. * @private
  16344. */
  16345. core_controller.PluginBase = core_controller.Element.extend({});
  16346. /**
  16347. * Provided for backward compatibility, use Chart.helpers.canvas instead.
  16348. * @namespace Chart.canvasHelpers
  16349. * @deprecated since version 2.6.0
  16350. * @todo remove at version 3
  16351. * @private
  16352. */
  16353. core_controller.canvasHelpers = core_controller.helpers.canvas;
  16354. /**
  16355. * Provided for backward compatibility, use Chart.layouts instead.
  16356. * @namespace Chart.layoutService
  16357. * @deprecated since version 2.7.3
  16358. * @todo remove at version 3
  16359. * @private
  16360. */
  16361. core_controller.layoutService = core_controller.layouts;
  16362. /**
  16363. * Provided for backward compatibility, not available anymore.
  16364. * @namespace Chart.LinearScaleBase
  16365. * @deprecated since version 2.8
  16366. * @todo remove at version 3
  16367. * @private
  16368. */
  16369. core_controller.LinearScaleBase = scale_linearbase;
  16370. /**
  16371. * Provided for backward compatibility, instead we should create a new Chart
  16372. * by setting the type in the config (`new Chart(id, {type: '{chart-type}'}`).
  16373. * @deprecated since version 2.8.0
  16374. * @todo remove at version 3
  16375. */
  16376. core_controller.helpers.each(
  16377. [
  16378. 'Bar',
  16379. 'Bubble',
  16380. 'Doughnut',
  16381. 'Line',
  16382. 'PolarArea',
  16383. 'Radar',
  16384. 'Scatter'
  16385. ],
  16386. function(klass) {
  16387. core_controller[klass] = function(ctx, cfg) {
  16388. return new core_controller(ctx, core_controller.helpers.merge(cfg || {}, {
  16389. type: klass.charAt(0).toLowerCase() + klass.slice(1)
  16390. }));
  16391. };
  16392. }
  16393. );
  16394. return src;
  16395. })));
  16396. /***/ }),
  16397. /***/ "./node_modules/jsonpack/main.js":
  16398. /*!***************************************!*\
  16399. !*** ./node_modules/jsonpack/main.js ***!
  16400. \***************************************/
  16401. /*! no static exports found */
  16402. /***/ (function(module, exports, __webpack_require__) {
  16403. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*
  16404. Copyright (c) 2013, Rodrigo González, Sapienlab All Rights Reserved.
  16405. Available via MIT LICENSE. See https://github.com/roro89/jsonpack/blob/master/LICENSE.md for details.
  16406. */
  16407. (function(define) {
  16408. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  16409. var TOKEN_TRUE = -1;
  16410. var TOKEN_FALSE = -2;
  16411. var TOKEN_NULL = -3;
  16412. var TOKEN_EMPTY_STRING = -4;
  16413. var TOKEN_UNDEFINED = -5;
  16414. var pack = function(json, options) {
  16415. // Canonizes the options
  16416. options = options || {};
  16417. // A shorthand for debugging
  16418. var verbose = options.verbose || false;
  16419. verbose && console.log('Normalize the JSON Object');
  16420. // JSON as Javascript Object (Not string representation)
  16421. json = typeof json === 'string' ? this.JSON.parse(json) : json;
  16422. verbose && console.log('Creating a empty dictionary');
  16423. // The dictionary
  16424. var dictionary = {
  16425. strings : [],
  16426. integers : [],
  16427. floats : []
  16428. };
  16429. verbose && console.log('Creating the AST');
  16430. // The AST
  16431. var ast = (function recursiveAstBuilder(item) {
  16432. verbose && console.log('Calling recursiveAstBuilder with ' + this.JSON.stringify(item));
  16433. // The type of the item
  16434. var type = typeof item;
  16435. // Case 7: The item is null
  16436. if (item === null) {
  16437. return {
  16438. type : 'null',
  16439. index : TOKEN_NULL
  16440. };
  16441. }
  16442. //add undefined
  16443. if (typeof item === 'undefined') {
  16444. return {
  16445. type : 'undefined',
  16446. index : TOKEN_UNDEFINED
  16447. };
  16448. }
  16449. // Case 1: The item is Array Object
  16450. if ( item instanceof Array) {
  16451. // Create a new sub-AST of type Array (@)
  16452. var ast = ['@'];
  16453. // Add each items
  16454. for (var i in item) {
  16455. if (!item.hasOwnProperty(i)) continue;
  16456. ast.push(recursiveAstBuilder(item[i]));
  16457. }
  16458. // And return
  16459. return ast;
  16460. }
  16461. // Case 2: The item is Object
  16462. if (type === 'object') {
  16463. // Create a new sub-AST of type Object ($)
  16464. var ast = ['$'];
  16465. // Add each items
  16466. for (var key in item) {
  16467. if (!item.hasOwnProperty(key))
  16468. continue;
  16469. ast.push(recursiveAstBuilder(key));
  16470. ast.push(recursiveAstBuilder(item[key]));
  16471. }
  16472. // And return
  16473. return ast;
  16474. }
  16475. // Case 3: The item empty string
  16476. if (item === '') {
  16477. return {
  16478. type : 'empty',
  16479. index : TOKEN_EMPTY_STRING
  16480. };
  16481. }
  16482. // Case 4: The item is String
  16483. if (type === 'string') {
  16484. // The index of that word in the dictionary
  16485. var index = _indexOf.call(dictionary.strings, item);
  16486. // If not, add to the dictionary and actualize the index
  16487. if (index == -1) {
  16488. dictionary.strings.push(_encode(item));
  16489. index = dictionary.strings.length - 1;
  16490. }
  16491. // Return the token
  16492. return {
  16493. type : 'strings',
  16494. index : index
  16495. };
  16496. }
  16497. // Case 5: The item is integer
  16498. if (type === 'number' && item % 1 === 0) {
  16499. // The index of that number in the dictionary
  16500. var index = _indexOf.call(dictionary.integers, item);
  16501. // If not, add to the dictionary and actualize the index
  16502. if (index == -1) {
  16503. dictionary.integers.push(_base10To36(item));
  16504. index = dictionary.integers.length - 1;
  16505. }
  16506. // Return the token
  16507. return {
  16508. type : 'integers',
  16509. index : index
  16510. };
  16511. }
  16512. // Case 6: The item is float
  16513. if (type === 'number') {
  16514. // The index of that number in the dictionary
  16515. var index = _indexOf.call(dictionary.floats, item);
  16516. // If not, add to the dictionary and actualize the index
  16517. if (index == -1) {
  16518. // Float not use base 36
  16519. dictionary.floats.push(item);
  16520. index = dictionary.floats.length - 1;
  16521. }
  16522. // Return the token
  16523. return {
  16524. type : 'floats',
  16525. index : index
  16526. };
  16527. }
  16528. // Case 7: The item is boolean
  16529. if (type === 'boolean') {
  16530. return {
  16531. type : 'boolean',
  16532. index : item ? TOKEN_TRUE : TOKEN_FALSE
  16533. };
  16534. }
  16535. // Default
  16536. throw new Error('Unexpected argument of type ' + typeof (item));
  16537. })(json);
  16538. // A set of shorthands proxies for the length of the dictionaries
  16539. var stringLength = dictionary.strings.length;
  16540. var integerLength = dictionary.integers.length;
  16541. var floatLength = dictionary.floats.length;
  16542. verbose && console.log('Parsing the dictionary');
  16543. // Create a raw dictionary
  16544. var packed = dictionary.strings.join('|');
  16545. packed += '^' + dictionary.integers.join('|');
  16546. packed += '^' + dictionary.floats.join('|');
  16547. verbose && console.log('Parsing the structure');
  16548. // And add the structure
  16549. packed += '^' + (function recursiveParser(item) {
  16550. verbose && console.log('Calling a recursiveParser with ' + this.JSON.stringify(item));
  16551. // If the item is Array, then is a object of
  16552. // type [object Object] or [object Array]
  16553. if ( item instanceof Array) {
  16554. // The packed resulting
  16555. var packed = item.shift();
  16556. for (var i in item) {
  16557. if (!item.hasOwnProperty(i))
  16558. continue;
  16559. packed += recursiveParser(item[i]) + '|';
  16560. }
  16561. return (packed[packed.length - 1] === '|' ? packed.slice(0, -1) : packed) + ']';
  16562. }
  16563. // A shorthand proxies
  16564. var type = item.type, index = item.index;
  16565. if (type === 'strings') {
  16566. // Just return the base 36 of index
  16567. return _base10To36(index);
  16568. }
  16569. if (type === 'integers') {
  16570. // Return a base 36 of index plus stringLength offset
  16571. return _base10To36(stringLength + index);
  16572. }
  16573. if (type === 'floats') {
  16574. // Return a base 36 of index plus stringLength and integerLength offset
  16575. return _base10To36(stringLength + integerLength + index);
  16576. }
  16577. if (type === 'boolean') {
  16578. return item.index;
  16579. }
  16580. if (type === 'null') {
  16581. return TOKEN_NULL;
  16582. }
  16583. if (type === 'undefined') {
  16584. return TOKEN_UNDEFINED;
  16585. }
  16586. if (type === 'empty') {
  16587. return TOKEN_EMPTY_STRING;
  16588. }
  16589. throw new TypeError('The item is alien!');
  16590. })(ast);
  16591. verbose && console.log('Ending parser');
  16592. // If debug, return a internal representation of dictionary and stuff
  16593. if (options.debug)
  16594. return {
  16595. dictionary : dictionary,
  16596. ast : ast,
  16597. packed : packed
  16598. };
  16599. return packed;
  16600. };
  16601. var unpack = function(packed, options) {
  16602. // Canonizes the options
  16603. options = options || {};
  16604. // A raw buffer
  16605. var rawBuffers = packed.split('^');
  16606. // Create a dictionary
  16607. options.verbose && console.log('Building dictionary');
  16608. var dictionary = [];
  16609. // Add the strings values
  16610. var buffer = rawBuffers[0];
  16611. if (buffer !== '') {
  16612. buffer = buffer.split('|');
  16613. options.verbose && console.log('Parse the strings dictionary');
  16614. for (var i=0, n=buffer.length; i<n; i++){
  16615. dictionary.push(_decode(buffer[i]));
  16616. }
  16617. }
  16618. // Add the integers values
  16619. buffer = rawBuffers[1];
  16620. if (buffer !== '') {
  16621. buffer = buffer.split('|');
  16622. options.verbose && console.log('Parse the integers dictionary');
  16623. for (var i=0, n=buffer.length; i<n; i++){
  16624. dictionary.push(_base36To10(buffer[i]));
  16625. }
  16626. }
  16627. // Add the floats values
  16628. buffer = rawBuffers[2];
  16629. if (buffer !== '') {
  16630. buffer = buffer.split('|')
  16631. options.verbose && console.log('Parse the floats dictionary');
  16632. for (var i=0, n=buffer.length; i<n; i++){
  16633. dictionary.push(parseFloat(buffer[i]));
  16634. }
  16635. }
  16636. // Free memory
  16637. buffer = null;
  16638. options.verbose && console.log('Tokenizing the structure');
  16639. // Tokenizer the structure
  16640. var number36 = '';
  16641. var tokens = [];
  16642. var len=rawBuffers[3].length;
  16643. for (var i = 0; i < len; i++) {
  16644. var symbol = rawBuffers[3].charAt(i);
  16645. if (symbol === '|' || symbol === '$' || symbol === '@' || symbol === ']') {
  16646. if (number36) {
  16647. tokens.push(_base36To10(number36));
  16648. number36 = '';
  16649. }
  16650. symbol !== '|' && tokens.push(symbol);
  16651. } else {
  16652. number36 += symbol;
  16653. }
  16654. }
  16655. // A shorthand proxy for tokens.length
  16656. var tokensLength = tokens.length;
  16657. // The index of the next token to read
  16658. var tokensIndex = 0;
  16659. options.verbose && console.log('Starting recursive parser');
  16660. return (function recursiveUnpackerParser() {
  16661. // Maybe '$' (object) or '@' (array)
  16662. var type = tokens[tokensIndex++];
  16663. options.verbose && console.log('Reading collection type ' + (type === '$' ? 'object' : 'Array'));
  16664. // Parse an array
  16665. if (type === '@') {
  16666. var node = [];
  16667. for (; tokensIndex < tokensLength; tokensIndex++) {
  16668. var value = tokens[tokensIndex];
  16669. options.verbose && console.log('Read ' + value + ' symbol');
  16670. if (value === ']')
  16671. return node;
  16672. if (value === '@' || value === '$') {
  16673. node.push(recursiveUnpackerParser());
  16674. } else {
  16675. switch(value) {
  16676. case TOKEN_TRUE:
  16677. node.push(true);
  16678. break;
  16679. case TOKEN_FALSE:
  16680. node.push(false);
  16681. break;
  16682. case TOKEN_NULL:
  16683. node.push(null);
  16684. break;
  16685. case TOKEN_UNDEFINED:
  16686. node.push(undefined);
  16687. break;
  16688. case TOKEN_EMPTY_STRING:
  16689. node.push('');
  16690. break;
  16691. default:
  16692. node.push(dictionary[value]);
  16693. }
  16694. }
  16695. }
  16696. options.verbose && console.log('Parsed ' + this.JSON.stringify(node));
  16697. return node;
  16698. }
  16699. // Parse a object
  16700. if (type === '$') {
  16701. var node = {};
  16702. for (; tokensIndex < tokensLength; tokensIndex++) {
  16703. var key = tokens[tokensIndex];
  16704. if (key === ']')
  16705. return node;
  16706. if (key === TOKEN_EMPTY_STRING)
  16707. key = '';
  16708. else
  16709. key = dictionary[key];
  16710. var value = tokens[++tokensIndex];
  16711. if (value === '@' || value === '$') {
  16712. node[key] = recursiveUnpackerParser();
  16713. } else {
  16714. switch(value) {
  16715. case TOKEN_TRUE:
  16716. node[key] = true;
  16717. break;
  16718. case TOKEN_FALSE:
  16719. node[key] = false;
  16720. break;
  16721. case TOKEN_NULL:
  16722. node[key] = null;
  16723. break;
  16724. case TOKEN_UNDEFINED:
  16725. node[key] = undefined;
  16726. break;
  16727. case TOKEN_EMPTY_STRING:
  16728. node[key] = '';
  16729. break;
  16730. default:
  16731. node[key] = dictionary[value];
  16732. }
  16733. }
  16734. }
  16735. options.verbose && console.log('Parsed ' + this.JSON.stringify(node));
  16736. return node;
  16737. }
  16738. throw new TypeError('Bad token ' + type + ' isn\'t a type');
  16739. })();
  16740. }
  16741. /**
  16742. * Get the index value of the dictionary
  16743. * @param {Object} dictionary a object that have two array attributes: 'string' and 'number'
  16744. * @param {Object} data
  16745. */
  16746. var _indexOfDictionary = function(dictionary, value) {
  16747. // The type of the value
  16748. var type = typeof value;
  16749. // If is boolean, return a boolean token
  16750. if (type === 'boolean')
  16751. return value ? TOKEN_TRUE : TOKEN_FALSE;
  16752. // If is null, return a... yes! the null token
  16753. if (value === null)
  16754. return TOKEN_NULL;
  16755. //add undefined
  16756. if (typeof value === 'undefined')
  16757. return TOKEN_UNDEFINED;
  16758. if (value === '') {
  16759. return TOKEN_EMPTY_STRING;
  16760. }
  16761. if (type === 'string') {
  16762. value = _encode(value);
  16763. var index = _indexOf.call(dictionary.strings, value);
  16764. if (index === -1) {
  16765. dictionary.strings.push(value);
  16766. index = dictionary.strings.length - 1;
  16767. }
  16768. }
  16769. // If has an invalid JSON type (example a function)
  16770. if (type !== 'string' && type !== 'number') {
  16771. throw new Error('The type is not a JSON type');
  16772. };
  16773. if (type === 'string') {// string
  16774. value = _encode(value);
  16775. } else if (value % 1 === 0) {// integer
  16776. value = _base10To36(value);
  16777. } else {// float
  16778. }
  16779. // If is number, "serialize" the value
  16780. value = type === 'number' ? _base10To36(value) : _encode(value);
  16781. // Retrieve the index of that value in the dictionary
  16782. var index = _indexOf.call(dictionary[type], value);
  16783. // If that value is not in the dictionary
  16784. if (index === -1) {
  16785. // Push the value
  16786. dictionary[type].push(value);
  16787. // And return their index
  16788. index = dictionary[type].length - 1;
  16789. }
  16790. // If the type is a number, then add the '+' prefix character
  16791. // to differentiate that they is a number index. If not, then
  16792. // just return a 36-based representation of the index
  16793. return type === 'number' ? '+' + index : index;
  16794. };
  16795. var _encode = function(str) {
  16796. if ( typeof str !== 'string')
  16797. return str;
  16798. return str.replace(/[\+ \|\^\%]/g, function(a) {
  16799. return ({
  16800. ' ' : '+',
  16801. '+' : '%2B',
  16802. '|' : '%7C',
  16803. '^' : '%5E',
  16804. '%' : '%25'
  16805. })[a]
  16806. });
  16807. };
  16808. var _decode = function(str) {
  16809. if ( typeof str !== 'string')
  16810. return str;
  16811. return str.replace(/\+|%2B|%7C|%5E|%25/g, function(a) {
  16812. return ({
  16813. '+' : ' ',
  16814. '%2B' : '+',
  16815. '%7C' : '|',
  16816. '%5E' : '^',
  16817. '%25' : '%'
  16818. })[a]
  16819. })
  16820. };
  16821. var _base10To36 = function(number) {
  16822. return Number.prototype.toString.call(number, 36).toUpperCase();
  16823. };
  16824. var _base36To10 = function(number) {
  16825. return parseInt(number, 36);
  16826. };
  16827. var _indexOf = Array.prototype.indexOf ||
  16828. function(obj, start) {
  16829. for (var i = (start || 0), j = this.length; i < j; i++) {
  16830. if (this[i] === obj) {
  16831. return i;
  16832. }
  16833. }
  16834. return -1;
  16835. };
  16836. return {
  16837. JSON : JSON,
  16838. pack : pack,
  16839. unpack : unpack
  16840. };
  16841. }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
  16842. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  16843. })( __webpack_require__(/*! !webpack amd define */ "./node_modules/webpack/buildin/amd-define.js"));
  16844. /***/ }),
  16845. /***/ "./node_modules/moment/locale sync recursive ^\\.\\/.*$":
  16846. /*!**************************************************!*\
  16847. !*** ./node_modules/moment/locale sync ^\.\/.*$ ***!
  16848. \**************************************************/
  16849. /*! no static exports found */
  16850. /***/ (function(module, exports, __webpack_require__) {
  16851. var map = {
  16852. "./af": "./node_modules/moment/locale/af.js",
  16853. "./af.js": "./node_modules/moment/locale/af.js",
  16854. "./ar": "./node_modules/moment/locale/ar.js",
  16855. "./ar-dz": "./node_modules/moment/locale/ar-dz.js",
  16856. "./ar-dz.js": "./node_modules/moment/locale/ar-dz.js",
  16857. "./ar-kw": "./node_modules/moment/locale/ar-kw.js",
  16858. "./ar-kw.js": "./node_modules/moment/locale/ar-kw.js",
  16859. "./ar-ly": "./node_modules/moment/locale/ar-ly.js",
  16860. "./ar-ly.js": "./node_modules/moment/locale/ar-ly.js",
  16861. "./ar-ma": "./node_modules/moment/locale/ar-ma.js",
  16862. "./ar-ma.js": "./node_modules/moment/locale/ar-ma.js",
  16863. "./ar-sa": "./node_modules/moment/locale/ar-sa.js",
  16864. "./ar-sa.js": "./node_modules/moment/locale/ar-sa.js",
  16865. "./ar-tn": "./node_modules/moment/locale/ar-tn.js",
  16866. "./ar-tn.js": "./node_modules/moment/locale/ar-tn.js",
  16867. "./ar.js": "./node_modules/moment/locale/ar.js",
  16868. "./az": "./node_modules/moment/locale/az.js",
  16869. "./az.js": "./node_modules/moment/locale/az.js",
  16870. "./be": "./node_modules/moment/locale/be.js",
  16871. "./be.js": "./node_modules/moment/locale/be.js",
  16872. "./bg": "./node_modules/moment/locale/bg.js",
  16873. "./bg.js": "./node_modules/moment/locale/bg.js",
  16874. "./bm": "./node_modules/moment/locale/bm.js",
  16875. "./bm.js": "./node_modules/moment/locale/bm.js",
  16876. "./bn": "./node_modules/moment/locale/bn.js",
  16877. "./bn-bd": "./node_modules/moment/locale/bn-bd.js",
  16878. "./bn-bd.js": "./node_modules/moment/locale/bn-bd.js",
  16879. "./bn.js": "./node_modules/moment/locale/bn.js",
  16880. "./bo": "./node_modules/moment/locale/bo.js",
  16881. "./bo.js": "./node_modules/moment/locale/bo.js",
  16882. "./br": "./node_modules/moment/locale/br.js",
  16883. "./br.js": "./node_modules/moment/locale/br.js",
  16884. "./bs": "./node_modules/moment/locale/bs.js",
  16885. "./bs.js": "./node_modules/moment/locale/bs.js",
  16886. "./ca": "./node_modules/moment/locale/ca.js",
  16887. "./ca.js": "./node_modules/moment/locale/ca.js",
  16888. "./cs": "./node_modules/moment/locale/cs.js",
  16889. "./cs.js": "./node_modules/moment/locale/cs.js",
  16890. "./cv": "./node_modules/moment/locale/cv.js",
  16891. "./cv.js": "./node_modules/moment/locale/cv.js",
  16892. "./cy": "./node_modules/moment/locale/cy.js",
  16893. "./cy.js": "./node_modules/moment/locale/cy.js",
  16894. "./da": "./node_modules/moment/locale/da.js",
  16895. "./da.js": "./node_modules/moment/locale/da.js",
  16896. "./de": "./node_modules/moment/locale/de.js",
  16897. "./de-at": "./node_modules/moment/locale/de-at.js",
  16898. "./de-at.js": "./node_modules/moment/locale/de-at.js",
  16899. "./de-ch": "./node_modules/moment/locale/de-ch.js",
  16900. "./de-ch.js": "./node_modules/moment/locale/de-ch.js",
  16901. "./de.js": "./node_modules/moment/locale/de.js",
  16902. "./dv": "./node_modules/moment/locale/dv.js",
  16903. "./dv.js": "./node_modules/moment/locale/dv.js",
  16904. "./el": "./node_modules/moment/locale/el.js",
  16905. "./el.js": "./node_modules/moment/locale/el.js",
  16906. "./en-au": "./node_modules/moment/locale/en-au.js",
  16907. "./en-au.js": "./node_modules/moment/locale/en-au.js",
  16908. "./en-ca": "./node_modules/moment/locale/en-ca.js",
  16909. "./en-ca.js": "./node_modules/moment/locale/en-ca.js",
  16910. "./en-gb": "./node_modules/moment/locale/en-gb.js",
  16911. "./en-gb.js": "./node_modules/moment/locale/en-gb.js",
  16912. "./en-ie": "./node_modules/moment/locale/en-ie.js",
  16913. "./en-ie.js": "./node_modules/moment/locale/en-ie.js",
  16914. "./en-il": "./node_modules/moment/locale/en-il.js",
  16915. "./en-il.js": "./node_modules/moment/locale/en-il.js",
  16916. "./en-in": "./node_modules/moment/locale/en-in.js",
  16917. "./en-in.js": "./node_modules/moment/locale/en-in.js",
  16918. "./en-nz": "./node_modules/moment/locale/en-nz.js",
  16919. "./en-nz.js": "./node_modules/moment/locale/en-nz.js",
  16920. "./en-sg": "./node_modules/moment/locale/en-sg.js",
  16921. "./en-sg.js": "./node_modules/moment/locale/en-sg.js",
  16922. "./eo": "./node_modules/moment/locale/eo.js",
  16923. "./eo.js": "./node_modules/moment/locale/eo.js",
  16924. "./es": "./node_modules/moment/locale/es.js",
  16925. "./es-do": "./node_modules/moment/locale/es-do.js",
  16926. "./es-do.js": "./node_modules/moment/locale/es-do.js",
  16927. "./es-mx": "./node_modules/moment/locale/es-mx.js",
  16928. "./es-mx.js": "./node_modules/moment/locale/es-mx.js",
  16929. "./es-us": "./node_modules/moment/locale/es-us.js",
  16930. "./es-us.js": "./node_modules/moment/locale/es-us.js",
  16931. "./es.js": "./node_modules/moment/locale/es.js",
  16932. "./et": "./node_modules/moment/locale/et.js",
  16933. "./et.js": "./node_modules/moment/locale/et.js",
  16934. "./eu": "./node_modules/moment/locale/eu.js",
  16935. "./eu.js": "./node_modules/moment/locale/eu.js",
  16936. "./fa": "./node_modules/moment/locale/fa.js",
  16937. "./fa.js": "./node_modules/moment/locale/fa.js",
  16938. "./fi": "./node_modules/moment/locale/fi.js",
  16939. "./fi.js": "./node_modules/moment/locale/fi.js",
  16940. "./fil": "./node_modules/moment/locale/fil.js",
  16941. "./fil.js": "./node_modules/moment/locale/fil.js",
  16942. "./fo": "./node_modules/moment/locale/fo.js",
  16943. "./fo.js": "./node_modules/moment/locale/fo.js",
  16944. "./fr": "./node_modules/moment/locale/fr.js",
  16945. "./fr-ca": "./node_modules/moment/locale/fr-ca.js",
  16946. "./fr-ca.js": "./node_modules/moment/locale/fr-ca.js",
  16947. "./fr-ch": "./node_modules/moment/locale/fr-ch.js",
  16948. "./fr-ch.js": "./node_modules/moment/locale/fr-ch.js",
  16949. "./fr.js": "./node_modules/moment/locale/fr.js",
  16950. "./fy": "./node_modules/moment/locale/fy.js",
  16951. "./fy.js": "./node_modules/moment/locale/fy.js",
  16952. "./ga": "./node_modules/moment/locale/ga.js",
  16953. "./ga.js": "./node_modules/moment/locale/ga.js",
  16954. "./gd": "./node_modules/moment/locale/gd.js",
  16955. "./gd.js": "./node_modules/moment/locale/gd.js",
  16956. "./gl": "./node_modules/moment/locale/gl.js",
  16957. "./gl.js": "./node_modules/moment/locale/gl.js",
  16958. "./gom-deva": "./node_modules/moment/locale/gom-deva.js",
  16959. "./gom-deva.js": "./node_modules/moment/locale/gom-deva.js",
  16960. "./gom-latn": "./node_modules/moment/locale/gom-latn.js",
  16961. "./gom-latn.js": "./node_modules/moment/locale/gom-latn.js",
  16962. "./gu": "./node_modules/moment/locale/gu.js",
  16963. "./gu.js": "./node_modules/moment/locale/gu.js",
  16964. "./he": "./node_modules/moment/locale/he.js",
  16965. "./he.js": "./node_modules/moment/locale/he.js",
  16966. "./hi": "./node_modules/moment/locale/hi.js",
  16967. "./hi.js": "./node_modules/moment/locale/hi.js",
  16968. "./hr": "./node_modules/moment/locale/hr.js",
  16969. "./hr.js": "./node_modules/moment/locale/hr.js",
  16970. "./hu": "./node_modules/moment/locale/hu.js",
  16971. "./hu.js": "./node_modules/moment/locale/hu.js",
  16972. "./hy-am": "./node_modules/moment/locale/hy-am.js",
  16973. "./hy-am.js": "./node_modules/moment/locale/hy-am.js",
  16974. "./id": "./node_modules/moment/locale/id.js",
  16975. "./id.js": "./node_modules/moment/locale/id.js",
  16976. "./is": "./node_modules/moment/locale/is.js",
  16977. "./is.js": "./node_modules/moment/locale/is.js",
  16978. "./it": "./node_modules/moment/locale/it.js",
  16979. "./it-ch": "./node_modules/moment/locale/it-ch.js",
  16980. "./it-ch.js": "./node_modules/moment/locale/it-ch.js",
  16981. "./it.js": "./node_modules/moment/locale/it.js",
  16982. "./ja": "./node_modules/moment/locale/ja.js",
  16983. "./ja.js": "./node_modules/moment/locale/ja.js",
  16984. "./jv": "./node_modules/moment/locale/jv.js",
  16985. "./jv.js": "./node_modules/moment/locale/jv.js",
  16986. "./ka": "./node_modules/moment/locale/ka.js",
  16987. "./ka.js": "./node_modules/moment/locale/ka.js",
  16988. "./kk": "./node_modules/moment/locale/kk.js",
  16989. "./kk.js": "./node_modules/moment/locale/kk.js",
  16990. "./km": "./node_modules/moment/locale/km.js",
  16991. "./km.js": "./node_modules/moment/locale/km.js",
  16992. "./kn": "./node_modules/moment/locale/kn.js",
  16993. "./kn.js": "./node_modules/moment/locale/kn.js",
  16994. "./ko": "./node_modules/moment/locale/ko.js",
  16995. "./ko.js": "./node_modules/moment/locale/ko.js",
  16996. "./ku": "./node_modules/moment/locale/ku.js",
  16997. "./ku.js": "./node_modules/moment/locale/ku.js",
  16998. "./ky": "./node_modules/moment/locale/ky.js",
  16999. "./ky.js": "./node_modules/moment/locale/ky.js",
  17000. "./lb": "./node_modules/moment/locale/lb.js",
  17001. "./lb.js": "./node_modules/moment/locale/lb.js",
  17002. "./lo": "./node_modules/moment/locale/lo.js",
  17003. "./lo.js": "./node_modules/moment/locale/lo.js",
  17004. "./lt": "./node_modules/moment/locale/lt.js",
  17005. "./lt.js": "./node_modules/moment/locale/lt.js",
  17006. "./lv": "./node_modules/moment/locale/lv.js",
  17007. "./lv.js": "./node_modules/moment/locale/lv.js",
  17008. "./me": "./node_modules/moment/locale/me.js",
  17009. "./me.js": "./node_modules/moment/locale/me.js",
  17010. "./mi": "./node_modules/moment/locale/mi.js",
  17011. "./mi.js": "./node_modules/moment/locale/mi.js",
  17012. "./mk": "./node_modules/moment/locale/mk.js",
  17013. "./mk.js": "./node_modules/moment/locale/mk.js",
  17014. "./ml": "./node_modules/moment/locale/ml.js",
  17015. "./ml.js": "./node_modules/moment/locale/ml.js",
  17016. "./mn": "./node_modules/moment/locale/mn.js",
  17017. "./mn.js": "./node_modules/moment/locale/mn.js",
  17018. "./mr": "./node_modules/moment/locale/mr.js",
  17019. "./mr.js": "./node_modules/moment/locale/mr.js",
  17020. "./ms": "./node_modules/moment/locale/ms.js",
  17021. "./ms-my": "./node_modules/moment/locale/ms-my.js",
  17022. "./ms-my.js": "./node_modules/moment/locale/ms-my.js",
  17023. "./ms.js": "./node_modules/moment/locale/ms.js",
  17024. "./mt": "./node_modules/moment/locale/mt.js",
  17025. "./mt.js": "./node_modules/moment/locale/mt.js",
  17026. "./my": "./node_modules/moment/locale/my.js",
  17027. "./my.js": "./node_modules/moment/locale/my.js",
  17028. "./nb": "./node_modules/moment/locale/nb.js",
  17029. "./nb.js": "./node_modules/moment/locale/nb.js",
  17030. "./ne": "./node_modules/moment/locale/ne.js",
  17031. "./ne.js": "./node_modules/moment/locale/ne.js",
  17032. "./nl": "./node_modules/moment/locale/nl.js",
  17033. "./nl-be": "./node_modules/moment/locale/nl-be.js",
  17034. "./nl-be.js": "./node_modules/moment/locale/nl-be.js",
  17035. "./nl.js": "./node_modules/moment/locale/nl.js",
  17036. "./nn": "./node_modules/moment/locale/nn.js",
  17037. "./nn.js": "./node_modules/moment/locale/nn.js",
  17038. "./oc-lnc": "./node_modules/moment/locale/oc-lnc.js",
  17039. "./oc-lnc.js": "./node_modules/moment/locale/oc-lnc.js",
  17040. "./pa-in": "./node_modules/moment/locale/pa-in.js",
  17041. "./pa-in.js": "./node_modules/moment/locale/pa-in.js",
  17042. "./pl": "./node_modules/moment/locale/pl.js",
  17043. "./pl.js": "./node_modules/moment/locale/pl.js",
  17044. "./pt": "./node_modules/moment/locale/pt.js",
  17045. "./pt-br": "./node_modules/moment/locale/pt-br.js",
  17046. "./pt-br.js": "./node_modules/moment/locale/pt-br.js",
  17047. "./pt.js": "./node_modules/moment/locale/pt.js",
  17048. "./ro": "./node_modules/moment/locale/ro.js",
  17049. "./ro.js": "./node_modules/moment/locale/ro.js",
  17050. "./ru": "./node_modules/moment/locale/ru.js",
  17051. "./ru.js": "./node_modules/moment/locale/ru.js",
  17052. "./sd": "./node_modules/moment/locale/sd.js",
  17053. "./sd.js": "./node_modules/moment/locale/sd.js",
  17054. "./se": "./node_modules/moment/locale/se.js",
  17055. "./se.js": "./node_modules/moment/locale/se.js",
  17056. "./si": "./node_modules/moment/locale/si.js",
  17057. "./si.js": "./node_modules/moment/locale/si.js",
  17058. "./sk": "./node_modules/moment/locale/sk.js",
  17059. "./sk.js": "./node_modules/moment/locale/sk.js",
  17060. "./sl": "./node_modules/moment/locale/sl.js",
  17061. "./sl.js": "./node_modules/moment/locale/sl.js",
  17062. "./sq": "./node_modules/moment/locale/sq.js",
  17063. "./sq.js": "./node_modules/moment/locale/sq.js",
  17064. "./sr": "./node_modules/moment/locale/sr.js",
  17065. "./sr-cyrl": "./node_modules/moment/locale/sr-cyrl.js",
  17066. "./sr-cyrl.js": "./node_modules/moment/locale/sr-cyrl.js",
  17067. "./sr.js": "./node_modules/moment/locale/sr.js",
  17068. "./ss": "./node_modules/moment/locale/ss.js",
  17069. "./ss.js": "./node_modules/moment/locale/ss.js",
  17070. "./sv": "./node_modules/moment/locale/sv.js",
  17071. "./sv.js": "./node_modules/moment/locale/sv.js",
  17072. "./sw": "./node_modules/moment/locale/sw.js",
  17073. "./sw.js": "./node_modules/moment/locale/sw.js",
  17074. "./ta": "./node_modules/moment/locale/ta.js",
  17075. "./ta.js": "./node_modules/moment/locale/ta.js",
  17076. "./te": "./node_modules/moment/locale/te.js",
  17077. "./te.js": "./node_modules/moment/locale/te.js",
  17078. "./tet": "./node_modules/moment/locale/tet.js",
  17079. "./tet.js": "./node_modules/moment/locale/tet.js",
  17080. "./tg": "./node_modules/moment/locale/tg.js",
  17081. "./tg.js": "./node_modules/moment/locale/tg.js",
  17082. "./th": "./node_modules/moment/locale/th.js",
  17083. "./th.js": "./node_modules/moment/locale/th.js",
  17084. "./tk": "./node_modules/moment/locale/tk.js",
  17085. "./tk.js": "./node_modules/moment/locale/tk.js",
  17086. "./tl-ph": "./node_modules/moment/locale/tl-ph.js",
  17087. "./tl-ph.js": "./node_modules/moment/locale/tl-ph.js",
  17088. "./tlh": "./node_modules/moment/locale/tlh.js",
  17089. "./tlh.js": "./node_modules/moment/locale/tlh.js",
  17090. "./tr": "./node_modules/moment/locale/tr.js",
  17091. "./tr.js": "./node_modules/moment/locale/tr.js",
  17092. "./tzl": "./node_modules/moment/locale/tzl.js",
  17093. "./tzl.js": "./node_modules/moment/locale/tzl.js",
  17094. "./tzm": "./node_modules/moment/locale/tzm.js",
  17095. "./tzm-latn": "./node_modules/moment/locale/tzm-latn.js",
  17096. "./tzm-latn.js": "./node_modules/moment/locale/tzm-latn.js",
  17097. "./tzm.js": "./node_modules/moment/locale/tzm.js",
  17098. "./ug-cn": "./node_modules/moment/locale/ug-cn.js",
  17099. "./ug-cn.js": "./node_modules/moment/locale/ug-cn.js",
  17100. "./uk": "./node_modules/moment/locale/uk.js",
  17101. "./uk.js": "./node_modules/moment/locale/uk.js",
  17102. "./ur": "./node_modules/moment/locale/ur.js",
  17103. "./ur.js": "./node_modules/moment/locale/ur.js",
  17104. "./uz": "./node_modules/moment/locale/uz.js",
  17105. "./uz-latn": "./node_modules/moment/locale/uz-latn.js",
  17106. "./uz-latn.js": "./node_modules/moment/locale/uz-latn.js",
  17107. "./uz.js": "./node_modules/moment/locale/uz.js",
  17108. "./vi": "./node_modules/moment/locale/vi.js",
  17109. "./vi.js": "./node_modules/moment/locale/vi.js",
  17110. "./x-pseudo": "./node_modules/moment/locale/x-pseudo.js",
  17111. "./x-pseudo.js": "./node_modules/moment/locale/x-pseudo.js",
  17112. "./yo": "./node_modules/moment/locale/yo.js",
  17113. "./yo.js": "./node_modules/moment/locale/yo.js",
  17114. "./zh-cn": "./node_modules/moment/locale/zh-cn.js",
  17115. "./zh-cn.js": "./node_modules/moment/locale/zh-cn.js",
  17116. "./zh-hk": "./node_modules/moment/locale/zh-hk.js",
  17117. "./zh-hk.js": "./node_modules/moment/locale/zh-hk.js",
  17118. "./zh-mo": "./node_modules/moment/locale/zh-mo.js",
  17119. "./zh-mo.js": "./node_modules/moment/locale/zh-mo.js",
  17120. "./zh-tw": "./node_modules/moment/locale/zh-tw.js",
  17121. "./zh-tw.js": "./node_modules/moment/locale/zh-tw.js"
  17122. };
  17123. function webpackContext(req) {
  17124. var id = webpackContextResolve(req);
  17125. return __webpack_require__(id);
  17126. }
  17127. function webpackContextResolve(req) {
  17128. if(!__webpack_require__.o(map, req)) {
  17129. var e = new Error("Cannot find module '" + req + "'");
  17130. e.code = 'MODULE_NOT_FOUND';
  17131. throw e;
  17132. }
  17133. return map[req];
  17134. }
  17135. webpackContext.keys = function webpackContextKeys() {
  17136. return Object.keys(map);
  17137. };
  17138. webpackContext.resolve = webpackContextResolve;
  17139. module.exports = webpackContext;
  17140. webpackContext.id = "./node_modules/moment/locale sync recursive ^\\.\\/.*$";
  17141. /***/ }),
  17142. /***/ "./node_modules/moment/locale/af.js":
  17143. /*!******************************************!*\
  17144. !*** ./node_modules/moment/locale/af.js ***!
  17145. \******************************************/
  17146. /*! no static exports found */
  17147. /***/ (function(module, exports, __webpack_require__) {
  17148. //! moment.js locale configuration
  17149. //! locale : Afrikaans [af]
  17150. //! author : Werner Mollentze : https://github.com/wernerm
  17151. ;(function (global, factory) {
  17152. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  17153. undefined
  17154. }(this, (function (moment) { 'use strict';
  17155. //! moment.js locale configuration
  17156. var af = moment.defineLocale('af', {
  17157. months: 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split(
  17158. '_'
  17159. ),
  17160. monthsShort: 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'),
  17161. weekdays: 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split(
  17162. '_'
  17163. ),
  17164. weekdaysShort: 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'),
  17165. weekdaysMin: 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'),
  17166. meridiemParse: /vm|nm/i,
  17167. isPM: function (input) {
  17168. return /^nm$/i.test(input);
  17169. },
  17170. meridiem: function (hours, minutes, isLower) {
  17171. if (hours < 12) {
  17172. return isLower ? 'vm' : 'VM';
  17173. } else {
  17174. return isLower ? 'nm' : 'NM';
  17175. }
  17176. },
  17177. longDateFormat: {
  17178. LT: 'HH:mm',
  17179. LTS: 'HH:mm:ss',
  17180. L: 'DD/MM/YYYY',
  17181. LL: 'D MMMM YYYY',
  17182. LLL: 'D MMMM YYYY HH:mm',
  17183. LLLL: 'dddd, D MMMM YYYY HH:mm',
  17184. },
  17185. calendar: {
  17186. sameDay: '[Vandag om] LT',
  17187. nextDay: '[Môre om] LT',
  17188. nextWeek: 'dddd [om] LT',
  17189. lastDay: '[Gister om] LT',
  17190. lastWeek: '[Laas] dddd [om] LT',
  17191. sameElse: 'L',
  17192. },
  17193. relativeTime: {
  17194. future: 'oor %s',
  17195. past: '%s gelede',
  17196. s: "'n paar sekondes",
  17197. ss: '%d sekondes',
  17198. m: "'n minuut",
  17199. mm: '%d minute',
  17200. h: "'n uur",
  17201. hh: '%d ure',
  17202. d: "'n dag",
  17203. dd: '%d dae',
  17204. M: "'n maand",
  17205. MM: '%d maande',
  17206. y: "'n jaar",
  17207. yy: '%d jaar',
  17208. },
  17209. dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
  17210. ordinal: function (number) {
  17211. return (
  17212. number +
  17213. (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')
  17214. ); // Thanks to Joris Röling : https://github.com/jjupiter
  17215. },
  17216. week: {
  17217. dow: 1, // Maandag is die eerste dag van die week.
  17218. doy: 4, // Die week wat die 4de Januarie bevat is die eerste week van die jaar.
  17219. },
  17220. });
  17221. return af;
  17222. })));
  17223. /***/ }),
  17224. /***/ "./node_modules/moment/locale/ar-dz.js":
  17225. /*!*********************************************!*\
  17226. !*** ./node_modules/moment/locale/ar-dz.js ***!
  17227. \*********************************************/
  17228. /*! no static exports found */
  17229. /***/ (function(module, exports, __webpack_require__) {
  17230. //! moment.js locale configuration
  17231. //! locale : Arabic (Algeria) [ar-dz]
  17232. //! author : Amine Roukh: https://github.com/Amine27
  17233. //! author : Abdel Said: https://github.com/abdelsaid
  17234. //! author : Ahmed Elkhatib
  17235. //! author : forabi https://github.com/forabi
  17236. //! author : Noureddine LOUAHEDJ : https://github.com/noureddinem
  17237. ;(function (global, factory) {
  17238. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  17239. undefined
  17240. }(this, (function (moment) { 'use strict';
  17241. //! moment.js locale configuration
  17242. var pluralForm = function (n) {
  17243. return n === 0
  17244. ? 0
  17245. : n === 1
  17246. ? 1
  17247. : n === 2
  17248. ? 2
  17249. : n % 100 >= 3 && n % 100 <= 10
  17250. ? 3
  17251. : n % 100 >= 11
  17252. ? 4
  17253. : 5;
  17254. },
  17255. plurals = {
  17256. s: [
  17257. 'أقل من ثانية',
  17258. 'ثانية واحدة',
  17259. ['ثانيتان', 'ثانيتين'],
  17260. '%d ثوان',
  17261. '%d ثانية',
  17262. '%d ثانية',
  17263. ],
  17264. m: [
  17265. 'أقل من دقيقة',
  17266. 'دقيقة واحدة',
  17267. ['دقيقتان', 'دقيقتين'],
  17268. '%d دقائق',
  17269. '%d دقيقة',
  17270. '%d دقيقة',
  17271. ],
  17272. h: [
  17273. 'أقل من ساعة',
  17274. 'ساعة واحدة',
  17275. ['ساعتان', 'ساعتين'],
  17276. '%d ساعات',
  17277. '%d ساعة',
  17278. '%d ساعة',
  17279. ],
  17280. d: [
  17281. 'أقل من يوم',
  17282. 'يوم واحد',
  17283. ['يومان', 'يومين'],
  17284. '%d أيام',
  17285. '%d يومًا',
  17286. '%d يوم',
  17287. ],
  17288. M: [
  17289. 'أقل من شهر',
  17290. 'شهر واحد',
  17291. ['شهران', 'شهرين'],
  17292. '%d أشهر',
  17293. '%d شهرا',
  17294. '%d شهر',
  17295. ],
  17296. y: [
  17297. 'أقل من عام',
  17298. 'عام واحد',
  17299. ['عامان', 'عامين'],
  17300. '%d أعوام',
  17301. '%d عامًا',
  17302. '%d عام',
  17303. ],
  17304. },
  17305. pluralize = function (u) {
  17306. return function (number, withoutSuffix, string, isFuture) {
  17307. var f = pluralForm(number),
  17308. str = plurals[u][pluralForm(number)];
  17309. if (f === 2) {
  17310. str = str[withoutSuffix ? 0 : 1];
  17311. }
  17312. return str.replace(/%d/i, number);
  17313. };
  17314. },
  17315. months = [
  17316. 'جانفي',
  17317. 'فيفري',
  17318. 'مارس',
  17319. 'أفريل',
  17320. 'ماي',
  17321. 'جوان',
  17322. 'جويلية',
  17323. 'أوت',
  17324. 'سبتمبر',
  17325. 'أكتوبر',
  17326. 'نوفمبر',
  17327. 'ديسمبر',
  17328. ];
  17329. var arDz = moment.defineLocale('ar-dz', {
  17330. months: months,
  17331. monthsShort: months,
  17332. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  17333. weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  17334. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  17335. weekdaysParseExact: true,
  17336. longDateFormat: {
  17337. LT: 'HH:mm',
  17338. LTS: 'HH:mm:ss',
  17339. L: 'D/\u200FM/\u200FYYYY',
  17340. LL: 'D MMMM YYYY',
  17341. LLL: 'D MMMM YYYY HH:mm',
  17342. LLLL: 'dddd D MMMM YYYY HH:mm',
  17343. },
  17344. meridiemParse: /ص|م/,
  17345. isPM: function (input) {
  17346. return 'م' === input;
  17347. },
  17348. meridiem: function (hour, minute, isLower) {
  17349. if (hour < 12) {
  17350. return 'ص';
  17351. } else {
  17352. return 'م';
  17353. }
  17354. },
  17355. calendar: {
  17356. sameDay: '[اليوم عند الساعة] LT',
  17357. nextDay: '[غدًا عند الساعة] LT',
  17358. nextWeek: 'dddd [عند الساعة] LT',
  17359. lastDay: '[أمس عند الساعة] LT',
  17360. lastWeek: 'dddd [عند الساعة] LT',
  17361. sameElse: 'L',
  17362. },
  17363. relativeTime: {
  17364. future: 'بعد %s',
  17365. past: 'منذ %s',
  17366. s: pluralize('s'),
  17367. ss: pluralize('s'),
  17368. m: pluralize('m'),
  17369. mm: pluralize('m'),
  17370. h: pluralize('h'),
  17371. hh: pluralize('h'),
  17372. d: pluralize('d'),
  17373. dd: pluralize('d'),
  17374. M: pluralize('M'),
  17375. MM: pluralize('M'),
  17376. y: pluralize('y'),
  17377. yy: pluralize('y'),
  17378. },
  17379. postformat: function (string) {
  17380. return string.replace(/,/g, '،');
  17381. },
  17382. week: {
  17383. dow: 0, // Sunday is the first day of the week.
  17384. doy: 4, // The week that contains Jan 4th is the first week of the year.
  17385. },
  17386. });
  17387. return arDz;
  17388. })));
  17389. /***/ }),
  17390. /***/ "./node_modules/moment/locale/ar-kw.js":
  17391. /*!*********************************************!*\
  17392. !*** ./node_modules/moment/locale/ar-kw.js ***!
  17393. \*********************************************/
  17394. /*! no static exports found */
  17395. /***/ (function(module, exports, __webpack_require__) {
  17396. //! moment.js locale configuration
  17397. //! locale : Arabic (Kuwait) [ar-kw]
  17398. //! author : Nusret Parlak: https://github.com/nusretparlak
  17399. ;(function (global, factory) {
  17400. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  17401. undefined
  17402. }(this, (function (moment) { 'use strict';
  17403. //! moment.js locale configuration
  17404. var arKw = moment.defineLocale('ar-kw', {
  17405. months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
  17406. '_'
  17407. ),
  17408. monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
  17409. '_'
  17410. ),
  17411. weekdays: 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  17412. weekdaysShort: 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
  17413. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  17414. weekdaysParseExact: true,
  17415. longDateFormat: {
  17416. LT: 'HH:mm',
  17417. LTS: 'HH:mm:ss',
  17418. L: 'DD/MM/YYYY',
  17419. LL: 'D MMMM YYYY',
  17420. LLL: 'D MMMM YYYY HH:mm',
  17421. LLLL: 'dddd D MMMM YYYY HH:mm',
  17422. },
  17423. calendar: {
  17424. sameDay: '[اليوم على الساعة] LT',
  17425. nextDay: '[غدا على الساعة] LT',
  17426. nextWeek: 'dddd [على الساعة] LT',
  17427. lastDay: '[أمس على الساعة] LT',
  17428. lastWeek: 'dddd [على الساعة] LT',
  17429. sameElse: 'L',
  17430. },
  17431. relativeTime: {
  17432. future: 'في %s',
  17433. past: 'منذ %s',
  17434. s: 'ثوان',
  17435. ss: '%d ثانية',
  17436. m: 'دقيقة',
  17437. mm: '%d دقائق',
  17438. h: 'ساعة',
  17439. hh: '%d ساعات',
  17440. d: 'يوم',
  17441. dd: '%d أيام',
  17442. M: 'شهر',
  17443. MM: '%d أشهر',
  17444. y: 'سنة',
  17445. yy: '%d سنوات',
  17446. },
  17447. week: {
  17448. dow: 0, // Sunday is the first day of the week.
  17449. doy: 12, // The week that contains Jan 12th is the first week of the year.
  17450. },
  17451. });
  17452. return arKw;
  17453. })));
  17454. /***/ }),
  17455. /***/ "./node_modules/moment/locale/ar-ly.js":
  17456. /*!*********************************************!*\
  17457. !*** ./node_modules/moment/locale/ar-ly.js ***!
  17458. \*********************************************/
  17459. /*! no static exports found */
  17460. /***/ (function(module, exports, __webpack_require__) {
  17461. //! moment.js locale configuration
  17462. //! locale : Arabic (Lybia) [ar-ly]
  17463. //! author : Ali Hmer: https://github.com/kikoanis
  17464. ;(function (global, factory) {
  17465. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  17466. undefined
  17467. }(this, (function (moment) { 'use strict';
  17468. //! moment.js locale configuration
  17469. var symbolMap = {
  17470. 1: '1',
  17471. 2: '2',
  17472. 3: '3',
  17473. 4: '4',
  17474. 5: '5',
  17475. 6: '6',
  17476. 7: '7',
  17477. 8: '8',
  17478. 9: '9',
  17479. 0: '0',
  17480. },
  17481. pluralForm = function (n) {
  17482. return n === 0
  17483. ? 0
  17484. : n === 1
  17485. ? 1
  17486. : n === 2
  17487. ? 2
  17488. : n % 100 >= 3 && n % 100 <= 10
  17489. ? 3
  17490. : n % 100 >= 11
  17491. ? 4
  17492. : 5;
  17493. },
  17494. plurals = {
  17495. s: [
  17496. 'أقل من ثانية',
  17497. 'ثانية واحدة',
  17498. ['ثانيتان', 'ثانيتين'],
  17499. '%d ثوان',
  17500. '%d ثانية',
  17501. '%d ثانية',
  17502. ],
  17503. m: [
  17504. 'أقل من دقيقة',
  17505. 'دقيقة واحدة',
  17506. ['دقيقتان', 'دقيقتين'],
  17507. '%d دقائق',
  17508. '%d دقيقة',
  17509. '%d دقيقة',
  17510. ],
  17511. h: [
  17512. 'أقل من ساعة',
  17513. 'ساعة واحدة',
  17514. ['ساعتان', 'ساعتين'],
  17515. '%d ساعات',
  17516. '%d ساعة',
  17517. '%d ساعة',
  17518. ],
  17519. d: [
  17520. 'أقل من يوم',
  17521. 'يوم واحد',
  17522. ['يومان', 'يومين'],
  17523. '%d أيام',
  17524. '%d يومًا',
  17525. '%d يوم',
  17526. ],
  17527. M: [
  17528. 'أقل من شهر',
  17529. 'شهر واحد',
  17530. ['شهران', 'شهرين'],
  17531. '%d أشهر',
  17532. '%d شهرا',
  17533. '%d شهر',
  17534. ],
  17535. y: [
  17536. 'أقل من عام',
  17537. 'عام واحد',
  17538. ['عامان', 'عامين'],
  17539. '%d أعوام',
  17540. '%d عامًا',
  17541. '%d عام',
  17542. ],
  17543. },
  17544. pluralize = function (u) {
  17545. return function (number, withoutSuffix, string, isFuture) {
  17546. var f = pluralForm(number),
  17547. str = plurals[u][pluralForm(number)];
  17548. if (f === 2) {
  17549. str = str[withoutSuffix ? 0 : 1];
  17550. }
  17551. return str.replace(/%d/i, number);
  17552. };
  17553. },
  17554. months = [
  17555. 'يناير',
  17556. 'فبراير',
  17557. 'مارس',
  17558. 'أبريل',
  17559. 'مايو',
  17560. 'يونيو',
  17561. 'يوليو',
  17562. 'أغسطس',
  17563. 'سبتمبر',
  17564. 'أكتوبر',
  17565. 'نوفمبر',
  17566. 'ديسمبر',
  17567. ];
  17568. var arLy = moment.defineLocale('ar-ly', {
  17569. months: months,
  17570. monthsShort: months,
  17571. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  17572. weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  17573. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  17574. weekdaysParseExact: true,
  17575. longDateFormat: {
  17576. LT: 'HH:mm',
  17577. LTS: 'HH:mm:ss',
  17578. L: 'D/\u200FM/\u200FYYYY',
  17579. LL: 'D MMMM YYYY',
  17580. LLL: 'D MMMM YYYY HH:mm',
  17581. LLLL: 'dddd D MMMM YYYY HH:mm',
  17582. },
  17583. meridiemParse: /ص|م/,
  17584. isPM: function (input) {
  17585. return 'م' === input;
  17586. },
  17587. meridiem: function (hour, minute, isLower) {
  17588. if (hour < 12) {
  17589. return 'ص';
  17590. } else {
  17591. return 'م';
  17592. }
  17593. },
  17594. calendar: {
  17595. sameDay: '[اليوم عند الساعة] LT',
  17596. nextDay: '[غدًا عند الساعة] LT',
  17597. nextWeek: 'dddd [عند الساعة] LT',
  17598. lastDay: '[أمس عند الساعة] LT',
  17599. lastWeek: 'dddd [عند الساعة] LT',
  17600. sameElse: 'L',
  17601. },
  17602. relativeTime: {
  17603. future: 'بعد %s',
  17604. past: 'منذ %s',
  17605. s: pluralize('s'),
  17606. ss: pluralize('s'),
  17607. m: pluralize('m'),
  17608. mm: pluralize('m'),
  17609. h: pluralize('h'),
  17610. hh: pluralize('h'),
  17611. d: pluralize('d'),
  17612. dd: pluralize('d'),
  17613. M: pluralize('M'),
  17614. MM: pluralize('M'),
  17615. y: pluralize('y'),
  17616. yy: pluralize('y'),
  17617. },
  17618. preparse: function (string) {
  17619. return string.replace(/،/g, ',');
  17620. },
  17621. postformat: function (string) {
  17622. return string
  17623. .replace(/\d/g, function (match) {
  17624. return symbolMap[match];
  17625. })
  17626. .replace(/,/g, '،');
  17627. },
  17628. week: {
  17629. dow: 6, // Saturday is the first day of the week.
  17630. doy: 12, // The week that contains Jan 12th is the first week of the year.
  17631. },
  17632. });
  17633. return arLy;
  17634. })));
  17635. /***/ }),
  17636. /***/ "./node_modules/moment/locale/ar-ma.js":
  17637. /*!*********************************************!*\
  17638. !*** ./node_modules/moment/locale/ar-ma.js ***!
  17639. \*********************************************/
  17640. /*! no static exports found */
  17641. /***/ (function(module, exports, __webpack_require__) {
  17642. //! moment.js locale configuration
  17643. //! locale : Arabic (Morocco) [ar-ma]
  17644. //! author : ElFadili Yassine : https://github.com/ElFadiliY
  17645. //! author : Abdel Said : https://github.com/abdelsaid
  17646. ;(function (global, factory) {
  17647. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  17648. undefined
  17649. }(this, (function (moment) { 'use strict';
  17650. //! moment.js locale configuration
  17651. var arMa = moment.defineLocale('ar-ma', {
  17652. months: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
  17653. '_'
  17654. ),
  17655. monthsShort: 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split(
  17656. '_'
  17657. ),
  17658. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  17659. weekdaysShort: 'احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'),
  17660. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  17661. weekdaysParseExact: true,
  17662. longDateFormat: {
  17663. LT: 'HH:mm',
  17664. LTS: 'HH:mm:ss',
  17665. L: 'DD/MM/YYYY',
  17666. LL: 'D MMMM YYYY',
  17667. LLL: 'D MMMM YYYY HH:mm',
  17668. LLLL: 'dddd D MMMM YYYY HH:mm',
  17669. },
  17670. calendar: {
  17671. sameDay: '[اليوم على الساعة] LT',
  17672. nextDay: '[غدا على الساعة] LT',
  17673. nextWeek: 'dddd [على الساعة] LT',
  17674. lastDay: '[أمس على الساعة] LT',
  17675. lastWeek: 'dddd [على الساعة] LT',
  17676. sameElse: 'L',
  17677. },
  17678. relativeTime: {
  17679. future: 'في %s',
  17680. past: 'منذ %s',
  17681. s: 'ثوان',
  17682. ss: '%d ثانية',
  17683. m: 'دقيقة',
  17684. mm: '%d دقائق',
  17685. h: 'ساعة',
  17686. hh: '%d ساعات',
  17687. d: 'يوم',
  17688. dd: '%d أيام',
  17689. M: 'شهر',
  17690. MM: '%d أشهر',
  17691. y: 'سنة',
  17692. yy: '%d سنوات',
  17693. },
  17694. week: {
  17695. dow: 1, // Monday is the first day of the week.
  17696. doy: 4, // The week that contains Jan 4th is the first week of the year.
  17697. },
  17698. });
  17699. return arMa;
  17700. })));
  17701. /***/ }),
  17702. /***/ "./node_modules/moment/locale/ar-sa.js":
  17703. /*!*********************************************!*\
  17704. !*** ./node_modules/moment/locale/ar-sa.js ***!
  17705. \*********************************************/
  17706. /*! no static exports found */
  17707. /***/ (function(module, exports, __webpack_require__) {
  17708. //! moment.js locale configuration
  17709. //! locale : Arabic (Saudi Arabia) [ar-sa]
  17710. //! author : Suhail Alkowaileet : https://github.com/xsoh
  17711. ;(function (global, factory) {
  17712. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  17713. undefined
  17714. }(this, (function (moment) { 'use strict';
  17715. //! moment.js locale configuration
  17716. var symbolMap = {
  17717. 1: '١',
  17718. 2: '٢',
  17719. 3: '٣',
  17720. 4: '٤',
  17721. 5: '٥',
  17722. 6: '٦',
  17723. 7: '٧',
  17724. 8: '٨',
  17725. 9: '٩',
  17726. 0: '٠',
  17727. },
  17728. numberMap = {
  17729. '١': '1',
  17730. '٢': '2',
  17731. '٣': '3',
  17732. '٤': '4',
  17733. '٥': '5',
  17734. '٦': '6',
  17735. '٧': '7',
  17736. '٨': '8',
  17737. '٩': '9',
  17738. '٠': '0',
  17739. };
  17740. var arSa = moment.defineLocale('ar-sa', {
  17741. months: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
  17742. '_'
  17743. ),
  17744. monthsShort: 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
  17745. '_'
  17746. ),
  17747. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  17748. weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  17749. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  17750. weekdaysParseExact: true,
  17751. longDateFormat: {
  17752. LT: 'HH:mm',
  17753. LTS: 'HH:mm:ss',
  17754. L: 'DD/MM/YYYY',
  17755. LL: 'D MMMM YYYY',
  17756. LLL: 'D MMMM YYYY HH:mm',
  17757. LLLL: 'dddd D MMMM YYYY HH:mm',
  17758. },
  17759. meridiemParse: /ص|م/,
  17760. isPM: function (input) {
  17761. return 'م' === input;
  17762. },
  17763. meridiem: function (hour, minute, isLower) {
  17764. if (hour < 12) {
  17765. return 'ص';
  17766. } else {
  17767. return 'م';
  17768. }
  17769. },
  17770. calendar: {
  17771. sameDay: '[اليوم على الساعة] LT',
  17772. nextDay: '[غدا على الساعة] LT',
  17773. nextWeek: 'dddd [على الساعة] LT',
  17774. lastDay: '[أمس على الساعة] LT',
  17775. lastWeek: 'dddd [على الساعة] LT',
  17776. sameElse: 'L',
  17777. },
  17778. relativeTime: {
  17779. future: 'في %s',
  17780. past: 'منذ %s',
  17781. s: 'ثوان',
  17782. ss: '%d ثانية',
  17783. m: 'دقيقة',
  17784. mm: '%d دقائق',
  17785. h: 'ساعة',
  17786. hh: '%d ساعات',
  17787. d: 'يوم',
  17788. dd: '%d أيام',
  17789. M: 'شهر',
  17790. MM: '%d أشهر',
  17791. y: 'سنة',
  17792. yy: '%d سنوات',
  17793. },
  17794. preparse: function (string) {
  17795. return string
  17796. .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
  17797. return numberMap[match];
  17798. })
  17799. .replace(/،/g, ',');
  17800. },
  17801. postformat: function (string) {
  17802. return string
  17803. .replace(/\d/g, function (match) {
  17804. return symbolMap[match];
  17805. })
  17806. .replace(/,/g, '،');
  17807. },
  17808. week: {
  17809. dow: 0, // Sunday is the first day of the week.
  17810. doy: 6, // The week that contains Jan 6th is the first week of the year.
  17811. },
  17812. });
  17813. return arSa;
  17814. })));
  17815. /***/ }),
  17816. /***/ "./node_modules/moment/locale/ar-tn.js":
  17817. /*!*********************************************!*\
  17818. !*** ./node_modules/moment/locale/ar-tn.js ***!
  17819. \*********************************************/
  17820. /*! no static exports found */
  17821. /***/ (function(module, exports, __webpack_require__) {
  17822. //! moment.js locale configuration
  17823. //! locale : Arabic (Tunisia) [ar-tn]
  17824. //! author : Nader Toukabri : https://github.com/naderio
  17825. ;(function (global, factory) {
  17826. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  17827. undefined
  17828. }(this, (function (moment) { 'use strict';
  17829. //! moment.js locale configuration
  17830. var arTn = moment.defineLocale('ar-tn', {
  17831. months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
  17832. '_'
  17833. ),
  17834. monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split(
  17835. '_'
  17836. ),
  17837. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  17838. weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  17839. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  17840. weekdaysParseExact: true,
  17841. longDateFormat: {
  17842. LT: 'HH:mm',
  17843. LTS: 'HH:mm:ss',
  17844. L: 'DD/MM/YYYY',
  17845. LL: 'D MMMM YYYY',
  17846. LLL: 'D MMMM YYYY HH:mm',
  17847. LLLL: 'dddd D MMMM YYYY HH:mm',
  17848. },
  17849. calendar: {
  17850. sameDay: '[اليوم على الساعة] LT',
  17851. nextDay: '[غدا على الساعة] LT',
  17852. nextWeek: 'dddd [على الساعة] LT',
  17853. lastDay: '[أمس على الساعة] LT',
  17854. lastWeek: 'dddd [على الساعة] LT',
  17855. sameElse: 'L',
  17856. },
  17857. relativeTime: {
  17858. future: 'في %s',
  17859. past: 'منذ %s',
  17860. s: 'ثوان',
  17861. ss: '%d ثانية',
  17862. m: 'دقيقة',
  17863. mm: '%d دقائق',
  17864. h: 'ساعة',
  17865. hh: '%d ساعات',
  17866. d: 'يوم',
  17867. dd: '%d أيام',
  17868. M: 'شهر',
  17869. MM: '%d أشهر',
  17870. y: 'سنة',
  17871. yy: '%d سنوات',
  17872. },
  17873. week: {
  17874. dow: 1, // Monday is the first day of the week.
  17875. doy: 4, // The week that contains Jan 4th is the first week of the year.
  17876. },
  17877. });
  17878. return arTn;
  17879. })));
  17880. /***/ }),
  17881. /***/ "./node_modules/moment/locale/ar.js":
  17882. /*!******************************************!*\
  17883. !*** ./node_modules/moment/locale/ar.js ***!
  17884. \******************************************/
  17885. /*! no static exports found */
  17886. /***/ (function(module, exports, __webpack_require__) {
  17887. //! moment.js locale configuration
  17888. //! locale : Arabic [ar]
  17889. //! author : Abdel Said: https://github.com/abdelsaid
  17890. //! author : Ahmed Elkhatib
  17891. //! author : forabi https://github.com/forabi
  17892. ;(function (global, factory) {
  17893. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  17894. undefined
  17895. }(this, (function (moment) { 'use strict';
  17896. //! moment.js locale configuration
  17897. var symbolMap = {
  17898. 1: '١',
  17899. 2: '٢',
  17900. 3: '٣',
  17901. 4: '٤',
  17902. 5: '٥',
  17903. 6: '٦',
  17904. 7: '٧',
  17905. 8: '٨',
  17906. 9: '٩',
  17907. 0: '٠',
  17908. },
  17909. numberMap = {
  17910. '١': '1',
  17911. '٢': '2',
  17912. '٣': '3',
  17913. '٤': '4',
  17914. '٥': '5',
  17915. '٦': '6',
  17916. '٧': '7',
  17917. '٨': '8',
  17918. '٩': '9',
  17919. '٠': '0',
  17920. },
  17921. pluralForm = function (n) {
  17922. return n === 0
  17923. ? 0
  17924. : n === 1
  17925. ? 1
  17926. : n === 2
  17927. ? 2
  17928. : n % 100 >= 3 && n % 100 <= 10
  17929. ? 3
  17930. : n % 100 >= 11
  17931. ? 4
  17932. : 5;
  17933. },
  17934. plurals = {
  17935. s: [
  17936. 'أقل من ثانية',
  17937. 'ثانية واحدة',
  17938. ['ثانيتان', 'ثانيتين'],
  17939. '%d ثوان',
  17940. '%d ثانية',
  17941. '%d ثانية',
  17942. ],
  17943. m: [
  17944. 'أقل من دقيقة',
  17945. 'دقيقة واحدة',
  17946. ['دقيقتان', 'دقيقتين'],
  17947. '%d دقائق',
  17948. '%d دقيقة',
  17949. '%d دقيقة',
  17950. ],
  17951. h: [
  17952. 'أقل من ساعة',
  17953. 'ساعة واحدة',
  17954. ['ساعتان', 'ساعتين'],
  17955. '%d ساعات',
  17956. '%d ساعة',
  17957. '%d ساعة',
  17958. ],
  17959. d: [
  17960. 'أقل من يوم',
  17961. 'يوم واحد',
  17962. ['يومان', 'يومين'],
  17963. '%d أيام',
  17964. '%d يومًا',
  17965. '%d يوم',
  17966. ],
  17967. M: [
  17968. 'أقل من شهر',
  17969. 'شهر واحد',
  17970. ['شهران', 'شهرين'],
  17971. '%d أشهر',
  17972. '%d شهرا',
  17973. '%d شهر',
  17974. ],
  17975. y: [
  17976. 'أقل من عام',
  17977. 'عام واحد',
  17978. ['عامان', 'عامين'],
  17979. '%d أعوام',
  17980. '%d عامًا',
  17981. '%d عام',
  17982. ],
  17983. },
  17984. pluralize = function (u) {
  17985. return function (number, withoutSuffix, string, isFuture) {
  17986. var f = pluralForm(number),
  17987. str = plurals[u][pluralForm(number)];
  17988. if (f === 2) {
  17989. str = str[withoutSuffix ? 0 : 1];
  17990. }
  17991. return str.replace(/%d/i, number);
  17992. };
  17993. },
  17994. months = [
  17995. 'يناير',
  17996. 'فبراير',
  17997. 'مارس',
  17998. 'أبريل',
  17999. 'مايو',
  18000. 'يونيو',
  18001. 'يوليو',
  18002. 'أغسطس',
  18003. 'سبتمبر',
  18004. 'أكتوبر',
  18005. 'نوفمبر',
  18006. 'ديسمبر',
  18007. ];
  18008. var ar = moment.defineLocale('ar', {
  18009. months: months,
  18010. monthsShort: months,
  18011. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  18012. weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  18013. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  18014. weekdaysParseExact: true,
  18015. longDateFormat: {
  18016. LT: 'HH:mm',
  18017. LTS: 'HH:mm:ss',
  18018. L: 'D/\u200FM/\u200FYYYY',
  18019. LL: 'D MMMM YYYY',
  18020. LLL: 'D MMMM YYYY HH:mm',
  18021. LLLL: 'dddd D MMMM YYYY HH:mm',
  18022. },
  18023. meridiemParse: /ص|م/,
  18024. isPM: function (input) {
  18025. return 'م' === input;
  18026. },
  18027. meridiem: function (hour, minute, isLower) {
  18028. if (hour < 12) {
  18029. return 'ص';
  18030. } else {
  18031. return 'م';
  18032. }
  18033. },
  18034. calendar: {
  18035. sameDay: '[اليوم عند الساعة] LT',
  18036. nextDay: '[غدًا عند الساعة] LT',
  18037. nextWeek: 'dddd [عند الساعة] LT',
  18038. lastDay: '[أمس عند الساعة] LT',
  18039. lastWeek: 'dddd [عند الساعة] LT',
  18040. sameElse: 'L',
  18041. },
  18042. relativeTime: {
  18043. future: 'بعد %s',
  18044. past: 'منذ %s',
  18045. s: pluralize('s'),
  18046. ss: pluralize('s'),
  18047. m: pluralize('m'),
  18048. mm: pluralize('m'),
  18049. h: pluralize('h'),
  18050. hh: pluralize('h'),
  18051. d: pluralize('d'),
  18052. dd: pluralize('d'),
  18053. M: pluralize('M'),
  18054. MM: pluralize('M'),
  18055. y: pluralize('y'),
  18056. yy: pluralize('y'),
  18057. },
  18058. preparse: function (string) {
  18059. return string
  18060. .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
  18061. return numberMap[match];
  18062. })
  18063. .replace(/،/g, ',');
  18064. },
  18065. postformat: function (string) {
  18066. return string
  18067. .replace(/\d/g, function (match) {
  18068. return symbolMap[match];
  18069. })
  18070. .replace(/,/g, '،');
  18071. },
  18072. week: {
  18073. dow: 6, // Saturday is the first day of the week.
  18074. doy: 12, // The week that contains Jan 12th is the first week of the year.
  18075. },
  18076. });
  18077. return ar;
  18078. })));
  18079. /***/ }),
  18080. /***/ "./node_modules/moment/locale/az.js":
  18081. /*!******************************************!*\
  18082. !*** ./node_modules/moment/locale/az.js ***!
  18083. \******************************************/
  18084. /*! no static exports found */
  18085. /***/ (function(module, exports, __webpack_require__) {
  18086. //! moment.js locale configuration
  18087. //! locale : Azerbaijani [az]
  18088. //! author : topchiyev : https://github.com/topchiyev
  18089. ;(function (global, factory) {
  18090. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  18091. undefined
  18092. }(this, (function (moment) { 'use strict';
  18093. //! moment.js locale configuration
  18094. var suffixes = {
  18095. 1: '-inci',
  18096. 5: '-inci',
  18097. 8: '-inci',
  18098. 70: '-inci',
  18099. 80: '-inci',
  18100. 2: '-nci',
  18101. 7: '-nci',
  18102. 20: '-nci',
  18103. 50: '-nci',
  18104. 3: '-üncü',
  18105. 4: '-üncü',
  18106. 100: '-üncü',
  18107. 6: '-ncı',
  18108. 9: '-uncu',
  18109. 10: '-uncu',
  18110. 30: '-uncu',
  18111. 60: '-ıncı',
  18112. 90: '-ıncı',
  18113. };
  18114. var az = moment.defineLocale('az', {
  18115. months: 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split(
  18116. '_'
  18117. ),
  18118. monthsShort: 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'),
  18119. weekdays: 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split(
  18120. '_'
  18121. ),
  18122. weekdaysShort: 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'),
  18123. weekdaysMin: 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'),
  18124. weekdaysParseExact: true,
  18125. longDateFormat: {
  18126. LT: 'HH:mm',
  18127. LTS: 'HH:mm:ss',
  18128. L: 'DD.MM.YYYY',
  18129. LL: 'D MMMM YYYY',
  18130. LLL: 'D MMMM YYYY HH:mm',
  18131. LLLL: 'dddd, D MMMM YYYY HH:mm',
  18132. },
  18133. calendar: {
  18134. sameDay: '[bugün saat] LT',
  18135. nextDay: '[sabah saat] LT',
  18136. nextWeek: '[gələn həftə] dddd [saat] LT',
  18137. lastDay: '[dünən] LT',
  18138. lastWeek: '[keçən həftə] dddd [saat] LT',
  18139. sameElse: 'L',
  18140. },
  18141. relativeTime: {
  18142. future: '%s sonra',
  18143. past: '%s əvvəl',
  18144. s: 'bir neçə saniyə',
  18145. ss: '%d saniyə',
  18146. m: 'bir dəqiqə',
  18147. mm: '%d dəqiqə',
  18148. h: 'bir saat',
  18149. hh: '%d saat',
  18150. d: 'bir gün',
  18151. dd: '%d gün',
  18152. M: 'bir ay',
  18153. MM: '%d ay',
  18154. y: 'bir il',
  18155. yy: '%d il',
  18156. },
  18157. meridiemParse: /gecə|səhər|gündüz|axşam/,
  18158. isPM: function (input) {
  18159. return /^(gündüz|axşam)$/.test(input);
  18160. },
  18161. meridiem: function (hour, minute, isLower) {
  18162. if (hour < 4) {
  18163. return 'gecə';
  18164. } else if (hour < 12) {
  18165. return 'səhər';
  18166. } else if (hour < 17) {
  18167. return 'gündüz';
  18168. } else {
  18169. return 'axşam';
  18170. }
  18171. },
  18172. dayOfMonthOrdinalParse: /\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/,
  18173. ordinal: function (number) {
  18174. if (number === 0) {
  18175. // special case for zero
  18176. return number + '-ıncı';
  18177. }
  18178. var a = number % 10,
  18179. b = (number % 100) - a,
  18180. c = number >= 100 ? 100 : null;
  18181. return number + (suffixes[a] || suffixes[b] || suffixes[c]);
  18182. },
  18183. week: {
  18184. dow: 1, // Monday is the first day of the week.
  18185. doy: 7, // The week that contains Jan 7th is the first week of the year.
  18186. },
  18187. });
  18188. return az;
  18189. })));
  18190. /***/ }),
  18191. /***/ "./node_modules/moment/locale/be.js":
  18192. /*!******************************************!*\
  18193. !*** ./node_modules/moment/locale/be.js ***!
  18194. \******************************************/
  18195. /*! no static exports found */
  18196. /***/ (function(module, exports, __webpack_require__) {
  18197. //! moment.js locale configuration
  18198. //! locale : Belarusian [be]
  18199. //! author : Dmitry Demidov : https://github.com/demidov91
  18200. //! author: Praleska: http://praleska.pro/
  18201. //! Author : Menelion Elensúle : https://github.com/Oire
  18202. ;(function (global, factory) {
  18203. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  18204. undefined
  18205. }(this, (function (moment) { 'use strict';
  18206. //! moment.js locale configuration
  18207. function plural(word, num) {
  18208. var forms = word.split('_');
  18209. return num % 10 === 1 && num % 100 !== 11
  18210. ? forms[0]
  18211. : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)
  18212. ? forms[1]
  18213. : forms[2];
  18214. }
  18215. function relativeTimeWithPlural(number, withoutSuffix, key) {
  18216. var format = {
  18217. ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',
  18218. mm: withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін',
  18219. hh: withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін',
  18220. dd: 'дзень_дні_дзён',
  18221. MM: 'месяц_месяцы_месяцаў',
  18222. yy: 'год_гады_гадоў',
  18223. };
  18224. if (key === 'm') {
  18225. return withoutSuffix ? 'хвіліна' : 'хвіліну';
  18226. } else if (key === 'h') {
  18227. return withoutSuffix ? 'гадзіна' : 'гадзіну';
  18228. } else {
  18229. return number + ' ' + plural(format[key], +number);
  18230. }
  18231. }
  18232. var be = moment.defineLocale('be', {
  18233. months: {
  18234. format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split(
  18235. '_'
  18236. ),
  18237. standalone: 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split(
  18238. '_'
  18239. ),
  18240. },
  18241. monthsShort: 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split(
  18242. '_'
  18243. ),
  18244. weekdays: {
  18245. format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split(
  18246. '_'
  18247. ),
  18248. standalone: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split(
  18249. '_'
  18250. ),
  18251. isFormat: /\[ ?[Ууў] ?(?:мінулую|наступную)? ?\] ?dddd/,
  18252. },
  18253. weekdaysShort: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
  18254. weekdaysMin: 'нд_пн_ат_ср_чц_пт_сб'.split('_'),
  18255. longDateFormat: {
  18256. LT: 'HH:mm',
  18257. LTS: 'HH:mm:ss',
  18258. L: 'DD.MM.YYYY',
  18259. LL: 'D MMMM YYYY г.',
  18260. LLL: 'D MMMM YYYY г., HH:mm',
  18261. LLLL: 'dddd, D MMMM YYYY г., HH:mm',
  18262. },
  18263. calendar: {
  18264. sameDay: '[Сёння ў] LT',
  18265. nextDay: '[Заўтра ў] LT',
  18266. lastDay: '[Учора ў] LT',
  18267. nextWeek: function () {
  18268. return '[У] dddd [ў] LT';
  18269. },
  18270. lastWeek: function () {
  18271. switch (this.day()) {
  18272. case 0:
  18273. case 3:
  18274. case 5:
  18275. case 6:
  18276. return '[У мінулую] dddd [ў] LT';
  18277. case 1:
  18278. case 2:
  18279. case 4:
  18280. return '[У мінулы] dddd [ў] LT';
  18281. }
  18282. },
  18283. sameElse: 'L',
  18284. },
  18285. relativeTime: {
  18286. future: 'праз %s',
  18287. past: '%s таму',
  18288. s: 'некалькі секунд',
  18289. m: relativeTimeWithPlural,
  18290. mm: relativeTimeWithPlural,
  18291. h: relativeTimeWithPlural,
  18292. hh: relativeTimeWithPlural,
  18293. d: 'дзень',
  18294. dd: relativeTimeWithPlural,
  18295. M: 'месяц',
  18296. MM: relativeTimeWithPlural,
  18297. y: 'год',
  18298. yy: relativeTimeWithPlural,
  18299. },
  18300. meridiemParse: /ночы|раніцы|дня|вечара/,
  18301. isPM: function (input) {
  18302. return /^(дня|вечара)$/.test(input);
  18303. },
  18304. meridiem: function (hour, minute, isLower) {
  18305. if (hour < 4) {
  18306. return 'ночы';
  18307. } else if (hour < 12) {
  18308. return 'раніцы';
  18309. } else if (hour < 17) {
  18310. return 'дня';
  18311. } else {
  18312. return 'вечара';
  18313. }
  18314. },
  18315. dayOfMonthOrdinalParse: /\d{1,2}-(і|ы|га)/,
  18316. ordinal: function (number, period) {
  18317. switch (period) {
  18318. case 'M':
  18319. case 'd':
  18320. case 'DDD':
  18321. case 'w':
  18322. case 'W':
  18323. return (number % 10 === 2 || number % 10 === 3) &&
  18324. number % 100 !== 12 &&
  18325. number % 100 !== 13
  18326. ? number + '-і'
  18327. : number + '-ы';
  18328. case 'D':
  18329. return number + '-га';
  18330. default:
  18331. return number;
  18332. }
  18333. },
  18334. week: {
  18335. dow: 1, // Monday is the first day of the week.
  18336. doy: 7, // The week that contains Jan 7th is the first week of the year.
  18337. },
  18338. });
  18339. return be;
  18340. })));
  18341. /***/ }),
  18342. /***/ "./node_modules/moment/locale/bg.js":
  18343. /*!******************************************!*\
  18344. !*** ./node_modules/moment/locale/bg.js ***!
  18345. \******************************************/
  18346. /*! no static exports found */
  18347. /***/ (function(module, exports, __webpack_require__) {
  18348. //! moment.js locale configuration
  18349. //! locale : Bulgarian [bg]
  18350. //! author : Krasen Borisov : https://github.com/kraz
  18351. ;(function (global, factory) {
  18352. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  18353. undefined
  18354. }(this, (function (moment) { 'use strict';
  18355. //! moment.js locale configuration
  18356. var bg = moment.defineLocale('bg', {
  18357. months: 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split(
  18358. '_'
  18359. ),
  18360. monthsShort: 'яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),
  18361. weekdays: 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split(
  18362. '_'
  18363. ),
  18364. weekdaysShort: 'нед_пон_вто_сря_чет_пет_съб'.split('_'),
  18365. weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  18366. longDateFormat: {
  18367. LT: 'H:mm',
  18368. LTS: 'H:mm:ss',
  18369. L: 'D.MM.YYYY',
  18370. LL: 'D MMMM YYYY',
  18371. LLL: 'D MMMM YYYY H:mm',
  18372. LLLL: 'dddd, D MMMM YYYY H:mm',
  18373. },
  18374. calendar: {
  18375. sameDay: '[Днес в] LT',
  18376. nextDay: '[Утре в] LT',
  18377. nextWeek: 'dddd [в] LT',
  18378. lastDay: '[Вчера в] LT',
  18379. lastWeek: function () {
  18380. switch (this.day()) {
  18381. case 0:
  18382. case 3:
  18383. case 6:
  18384. return '[Миналата] dddd [в] LT';
  18385. case 1:
  18386. case 2:
  18387. case 4:
  18388. case 5:
  18389. return '[Миналия] dddd [в] LT';
  18390. }
  18391. },
  18392. sameElse: 'L',
  18393. },
  18394. relativeTime: {
  18395. future: 'след %s',
  18396. past: 'преди %s',
  18397. s: 'няколко секунди',
  18398. ss: '%d секунди',
  18399. m: 'минута',
  18400. mm: '%d минути',
  18401. h: 'час',
  18402. hh: '%d часа',
  18403. d: 'ден',
  18404. dd: '%d дена',
  18405. w: 'седмица',
  18406. ww: '%d седмици',
  18407. M: 'месец',
  18408. MM: '%d месеца',
  18409. y: 'година',
  18410. yy: '%d години',
  18411. },
  18412. dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
  18413. ordinal: function (number) {
  18414. var lastDigit = number % 10,
  18415. last2Digits = number % 100;
  18416. if (number === 0) {
  18417. return number + '-ев';
  18418. } else if (last2Digits === 0) {
  18419. return number + '-ен';
  18420. } else if (last2Digits > 10 && last2Digits < 20) {
  18421. return number + '-ти';
  18422. } else if (lastDigit === 1) {
  18423. return number + '-ви';
  18424. } else if (lastDigit === 2) {
  18425. return number + '-ри';
  18426. } else if (lastDigit === 7 || lastDigit === 8) {
  18427. return number + '-ми';
  18428. } else {
  18429. return number + '-ти';
  18430. }
  18431. },
  18432. week: {
  18433. dow: 1, // Monday is the first day of the week.
  18434. doy: 7, // The week that contains Jan 7th is the first week of the year.
  18435. },
  18436. });
  18437. return bg;
  18438. })));
  18439. /***/ }),
  18440. /***/ "./node_modules/moment/locale/bm.js":
  18441. /*!******************************************!*\
  18442. !*** ./node_modules/moment/locale/bm.js ***!
  18443. \******************************************/
  18444. /*! no static exports found */
  18445. /***/ (function(module, exports, __webpack_require__) {
  18446. //! moment.js locale configuration
  18447. //! locale : Bambara [bm]
  18448. //! author : Estelle Comment : https://github.com/estellecomment
  18449. ;(function (global, factory) {
  18450. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  18451. undefined
  18452. }(this, (function (moment) { 'use strict';
  18453. //! moment.js locale configuration
  18454. var bm = moment.defineLocale('bm', {
  18455. months: 'Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo'.split(
  18456. '_'
  18457. ),
  18458. monthsShort: 'Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des'.split('_'),
  18459. weekdays: 'Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri'.split('_'),
  18460. weekdaysShort: 'Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib'.split('_'),
  18461. weekdaysMin: 'Ka_Nt_Ta_Ar_Al_Ju_Si'.split('_'),
  18462. longDateFormat: {
  18463. LT: 'HH:mm',
  18464. LTS: 'HH:mm:ss',
  18465. L: 'DD/MM/YYYY',
  18466. LL: 'MMMM [tile] D [san] YYYY',
  18467. LLL: 'MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',
  18468. LLLL: 'dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm',
  18469. },
  18470. calendar: {
  18471. sameDay: '[Bi lɛrɛ] LT',
  18472. nextDay: '[Sini lɛrɛ] LT',
  18473. nextWeek: 'dddd [don lɛrɛ] LT',
  18474. lastDay: '[Kunu lɛrɛ] LT',
  18475. lastWeek: 'dddd [tɛmɛnen lɛrɛ] LT',
  18476. sameElse: 'L',
  18477. },
  18478. relativeTime: {
  18479. future: '%s kɔnɔ',
  18480. past: 'a bɛ %s bɔ',
  18481. s: 'sanga dama dama',
  18482. ss: 'sekondi %d',
  18483. m: 'miniti kelen',
  18484. mm: 'miniti %d',
  18485. h: 'lɛrɛ kelen',
  18486. hh: 'lɛrɛ %d',
  18487. d: 'tile kelen',
  18488. dd: 'tile %d',
  18489. M: 'kalo kelen',
  18490. MM: 'kalo %d',
  18491. y: 'san kelen',
  18492. yy: 'san %d',
  18493. },
  18494. week: {
  18495. dow: 1, // Monday is the first day of the week.
  18496. doy: 4, // The week that contains Jan 4th is the first week of the year.
  18497. },
  18498. });
  18499. return bm;
  18500. })));
  18501. /***/ }),
  18502. /***/ "./node_modules/moment/locale/bn-bd.js":
  18503. /*!*********************************************!*\
  18504. !*** ./node_modules/moment/locale/bn-bd.js ***!
  18505. \*********************************************/
  18506. /*! no static exports found */
  18507. /***/ (function(module, exports, __webpack_require__) {
  18508. //! moment.js locale configuration
  18509. //! locale : Bengali (Bangladesh) [bn-bd]
  18510. //! author : Asraf Hossain Patoary : https://github.com/ashwoolford
  18511. ;(function (global, factory) {
  18512. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  18513. undefined
  18514. }(this, (function (moment) { 'use strict';
  18515. //! moment.js locale configuration
  18516. var symbolMap = {
  18517. 1: '১',
  18518. 2: '২',
  18519. 3: '৩',
  18520. 4: '৪',
  18521. 5: '৫',
  18522. 6: '৬',
  18523. 7: '৭',
  18524. 8: '৮',
  18525. 9: '৯',
  18526. 0: '০',
  18527. },
  18528. numberMap = {
  18529. '১': '1',
  18530. '২': '2',
  18531. '৩': '3',
  18532. '৪': '4',
  18533. '৫': '5',
  18534. '৬': '6',
  18535. '৭': '7',
  18536. '৮': '8',
  18537. '৯': '9',
  18538. '০': '0',
  18539. };
  18540. var bnBd = moment.defineLocale('bn-bd', {
  18541. months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split(
  18542. '_'
  18543. ),
  18544. monthsShort: 'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split(
  18545. '_'
  18546. ),
  18547. weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split(
  18548. '_'
  18549. ),
  18550. weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'),
  18551. weekdaysMin: 'রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি'.split('_'),
  18552. longDateFormat: {
  18553. LT: 'A h:mm সময়',
  18554. LTS: 'A h:mm:ss সময়',
  18555. L: 'DD/MM/YYYY',
  18556. LL: 'D MMMM YYYY',
  18557. LLL: 'D MMMM YYYY, A h:mm সময়',
  18558. LLLL: 'dddd, D MMMM YYYY, A h:mm সময়',
  18559. },
  18560. calendar: {
  18561. sameDay: '[আজ] LT',
  18562. nextDay: '[আগামীকাল] LT',
  18563. nextWeek: 'dddd, LT',
  18564. lastDay: '[গতকাল] LT',
  18565. lastWeek: '[গত] dddd, LT',
  18566. sameElse: 'L',
  18567. },
  18568. relativeTime: {
  18569. future: '%s পরে',
  18570. past: '%s আগে',
  18571. s: 'কয়েক সেকেন্ড',
  18572. ss: '%d সেকেন্ড',
  18573. m: 'এক মিনিট',
  18574. mm: '%d মিনিট',
  18575. h: 'এক ঘন্টা',
  18576. hh: '%d ঘন্টা',
  18577. d: 'এক দিন',
  18578. dd: '%d দিন',
  18579. M: 'এক মাস',
  18580. MM: '%d মাস',
  18581. y: 'এক বছর',
  18582. yy: '%d বছর',
  18583. },
  18584. preparse: function (string) {
  18585. return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {
  18586. return numberMap[match];
  18587. });
  18588. },
  18589. postformat: function (string) {
  18590. return string.replace(/\d/g, function (match) {
  18591. return symbolMap[match];
  18592. });
  18593. },
  18594. meridiemParse: /রাত|ভোর|সকাল|দুপুর|বিকাল|সন্ধ্যা|রাত/,
  18595. meridiemHour: function (hour, meridiem) {
  18596. if (hour === 12) {
  18597. hour = 0;
  18598. }
  18599. if (meridiem === 'রাত') {
  18600. return hour < 4 ? hour : hour + 12;
  18601. } else if (meridiem === 'ভোর') {
  18602. return hour;
  18603. } else if (meridiem === 'সকাল') {
  18604. return hour;
  18605. } else if (meridiem === 'দুপুর') {
  18606. return hour >= 3 ? hour : hour + 12;
  18607. } else if (meridiem === 'বিকাল') {
  18608. return hour + 12;
  18609. } else if (meridiem === 'সন্ধ্যা') {
  18610. return hour + 12;
  18611. }
  18612. },
  18613. meridiem: function (hour, minute, isLower) {
  18614. if (hour < 4) {
  18615. return 'রাত';
  18616. } else if (hour < 6) {
  18617. return 'ভোর';
  18618. } else if (hour < 12) {
  18619. return 'সকাল';
  18620. } else if (hour < 15) {
  18621. return 'দুপুর';
  18622. } else if (hour < 18) {
  18623. return 'বিকাল';
  18624. } else if (hour < 20) {
  18625. return 'সন্ধ্যা';
  18626. } else {
  18627. return 'রাত';
  18628. }
  18629. },
  18630. week: {
  18631. dow: 0, // Sunday is the first day of the week.
  18632. doy: 6, // The week that contains Jan 6th is the first week of the year.
  18633. },
  18634. });
  18635. return bnBd;
  18636. })));
  18637. /***/ }),
  18638. /***/ "./node_modules/moment/locale/bn.js":
  18639. /*!******************************************!*\
  18640. !*** ./node_modules/moment/locale/bn.js ***!
  18641. \******************************************/
  18642. /*! no static exports found */
  18643. /***/ (function(module, exports, __webpack_require__) {
  18644. //! moment.js locale configuration
  18645. //! locale : Bengali [bn]
  18646. //! author : Kaushik Gandhi : https://github.com/kaushikgandhi
  18647. ;(function (global, factory) {
  18648. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  18649. undefined
  18650. }(this, (function (moment) { 'use strict';
  18651. //! moment.js locale configuration
  18652. var symbolMap = {
  18653. 1: '১',
  18654. 2: '২',
  18655. 3: '৩',
  18656. 4: '৪',
  18657. 5: '৫',
  18658. 6: '৬',
  18659. 7: '৭',
  18660. 8: '৮',
  18661. 9: '৯',
  18662. 0: '০',
  18663. },
  18664. numberMap = {
  18665. '১': '1',
  18666. '২': '2',
  18667. '৩': '3',
  18668. '৪': '4',
  18669. '৫': '5',
  18670. '৬': '6',
  18671. '৭': '7',
  18672. '৮': '8',
  18673. '৯': '9',
  18674. '০': '0',
  18675. };
  18676. var bn = moment.defineLocale('bn', {
  18677. months: 'জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split(
  18678. '_'
  18679. ),
  18680. monthsShort: 'জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে'.split(
  18681. '_'
  18682. ),
  18683. weekdays: 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার'.split(
  18684. '_'
  18685. ),
  18686. weekdaysShort: 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি'.split('_'),
  18687. weekdaysMin: 'রবি_সোম_মঙ্গল_বুধ_বৃহ_শুক্র_শনি'.split('_'),
  18688. longDateFormat: {
  18689. LT: 'A h:mm সময়',
  18690. LTS: 'A h:mm:ss সময়',
  18691. L: 'DD/MM/YYYY',
  18692. LL: 'D MMMM YYYY',
  18693. LLL: 'D MMMM YYYY, A h:mm সময়',
  18694. LLLL: 'dddd, D MMMM YYYY, A h:mm সময়',
  18695. },
  18696. calendar: {
  18697. sameDay: '[আজ] LT',
  18698. nextDay: '[আগামীকাল] LT',
  18699. nextWeek: 'dddd, LT',
  18700. lastDay: '[গতকাল] LT',
  18701. lastWeek: '[গত] dddd, LT',
  18702. sameElse: 'L',
  18703. },
  18704. relativeTime: {
  18705. future: '%s পরে',
  18706. past: '%s আগে',
  18707. s: 'কয়েক সেকেন্ড',
  18708. ss: '%d সেকেন্ড',
  18709. m: 'এক মিনিট',
  18710. mm: '%d মিনিট',
  18711. h: 'এক ঘন্টা',
  18712. hh: '%d ঘন্টা',
  18713. d: 'এক দিন',
  18714. dd: '%d দিন',
  18715. M: 'এক মাস',
  18716. MM: '%d মাস',
  18717. y: 'এক বছর',
  18718. yy: '%d বছর',
  18719. },
  18720. preparse: function (string) {
  18721. return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) {
  18722. return numberMap[match];
  18723. });
  18724. },
  18725. postformat: function (string) {
  18726. return string.replace(/\d/g, function (match) {
  18727. return symbolMap[match];
  18728. });
  18729. },
  18730. meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/,
  18731. meridiemHour: function (hour, meridiem) {
  18732. if (hour === 12) {
  18733. hour = 0;
  18734. }
  18735. if (
  18736. (meridiem === 'রাত' && hour >= 4) ||
  18737. (meridiem === 'দুপুর' && hour < 5) ||
  18738. meridiem === 'বিকাল'
  18739. ) {
  18740. return hour + 12;
  18741. } else {
  18742. return hour;
  18743. }
  18744. },
  18745. meridiem: function (hour, minute, isLower) {
  18746. if (hour < 4) {
  18747. return 'রাত';
  18748. } else if (hour < 10) {
  18749. return 'সকাল';
  18750. } else if (hour < 17) {
  18751. return 'দুপুর';
  18752. } else if (hour < 20) {
  18753. return 'বিকাল';
  18754. } else {
  18755. return 'রাত';
  18756. }
  18757. },
  18758. week: {
  18759. dow: 0, // Sunday is the first day of the week.
  18760. doy: 6, // The week that contains Jan 6th is the first week of the year.
  18761. },
  18762. });
  18763. return bn;
  18764. })));
  18765. /***/ }),
  18766. /***/ "./node_modules/moment/locale/bo.js":
  18767. /*!******************************************!*\
  18768. !*** ./node_modules/moment/locale/bo.js ***!
  18769. \******************************************/
  18770. /*! no static exports found */
  18771. /***/ (function(module, exports, __webpack_require__) {
  18772. //! moment.js locale configuration
  18773. //! locale : Tibetan [bo]
  18774. //! author : Thupten N. Chakrishar : https://github.com/vajradog
  18775. ;(function (global, factory) {
  18776. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  18777. undefined
  18778. }(this, (function (moment) { 'use strict';
  18779. //! moment.js locale configuration
  18780. var symbolMap = {
  18781. 1: '༡',
  18782. 2: '༢',
  18783. 3: '༣',
  18784. 4: '༤',
  18785. 5: '༥',
  18786. 6: '༦',
  18787. 7: '༧',
  18788. 8: '༨',
  18789. 9: '༩',
  18790. 0: '༠',
  18791. },
  18792. numberMap = {
  18793. '༡': '1',
  18794. '༢': '2',
  18795. '༣': '3',
  18796. '༤': '4',
  18797. '༥': '5',
  18798. '༦': '6',
  18799. '༧': '7',
  18800. '༨': '8',
  18801. '༩': '9',
  18802. '༠': '0',
  18803. };
  18804. var bo = moment.defineLocale('bo', {
  18805. months: 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split(
  18806. '_'
  18807. ),
  18808. monthsShort: 'ཟླ་1_ཟླ་2_ཟླ་3_ཟླ་4_ཟླ་5_ཟླ་6_ཟླ་7_ཟླ་8_ཟླ་9_ཟླ་10_ཟླ་11_ཟླ་12'.split(
  18809. '_'
  18810. ),
  18811. monthsShortRegex: /^(ཟླ་\d{1,2})/,
  18812. monthsParseExact: true,
  18813. weekdays: 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split(
  18814. '_'
  18815. ),
  18816. weekdaysShort: 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split(
  18817. '_'
  18818. ),
  18819. weekdaysMin: 'ཉི_ཟླ_མིག_ལྷག_ཕུར_སངས_སྤེན'.split('_'),
  18820. longDateFormat: {
  18821. LT: 'A h:mm',
  18822. LTS: 'A h:mm:ss',
  18823. L: 'DD/MM/YYYY',
  18824. LL: 'D MMMM YYYY',
  18825. LLL: 'D MMMM YYYY, A h:mm',
  18826. LLLL: 'dddd, D MMMM YYYY, A h:mm',
  18827. },
  18828. calendar: {
  18829. sameDay: '[དི་རིང] LT',
  18830. nextDay: '[སང་ཉིན] LT',
  18831. nextWeek: '[བདུན་ཕྲག་རྗེས་མ], LT',
  18832. lastDay: '[ཁ་སང] LT',
  18833. lastWeek: '[བདུན་ཕྲག་མཐའ་མ] dddd, LT',
  18834. sameElse: 'L',
  18835. },
  18836. relativeTime: {
  18837. future: '%s ལ་',
  18838. past: '%s སྔན་ལ',
  18839. s: 'ལམ་སང',
  18840. ss: '%d སྐར་ཆ།',
  18841. m: 'སྐར་མ་གཅིག',
  18842. mm: '%d སྐར་མ',
  18843. h: 'ཆུ་ཚོད་གཅིག',
  18844. hh: '%d ཆུ་ཚོད',
  18845. d: 'ཉིན་གཅིག',
  18846. dd: '%d ཉིན་',
  18847. M: 'ཟླ་བ་གཅིག',
  18848. MM: '%d ཟླ་བ',
  18849. y: 'ལོ་གཅིག',
  18850. yy: '%d ལོ',
  18851. },
  18852. preparse: function (string) {
  18853. return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) {
  18854. return numberMap[match];
  18855. });
  18856. },
  18857. postformat: function (string) {
  18858. return string.replace(/\d/g, function (match) {
  18859. return symbolMap[match];
  18860. });
  18861. },
  18862. meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/,
  18863. meridiemHour: function (hour, meridiem) {
  18864. if (hour === 12) {
  18865. hour = 0;
  18866. }
  18867. if (
  18868. (meridiem === 'མཚན་མོ' && hour >= 4) ||
  18869. (meridiem === 'ཉིན་གུང' && hour < 5) ||
  18870. meridiem === 'དགོང་དག'
  18871. ) {
  18872. return hour + 12;
  18873. } else {
  18874. return hour;
  18875. }
  18876. },
  18877. meridiem: function (hour, minute, isLower) {
  18878. if (hour < 4) {
  18879. return 'མཚན་མོ';
  18880. } else if (hour < 10) {
  18881. return 'ཞོགས་ཀས';
  18882. } else if (hour < 17) {
  18883. return 'ཉིན་གུང';
  18884. } else if (hour < 20) {
  18885. return 'དགོང་དག';
  18886. } else {
  18887. return 'མཚན་མོ';
  18888. }
  18889. },
  18890. week: {
  18891. dow: 0, // Sunday is the first day of the week.
  18892. doy: 6, // The week that contains Jan 6th is the first week of the year.
  18893. },
  18894. });
  18895. return bo;
  18896. })));
  18897. /***/ }),
  18898. /***/ "./node_modules/moment/locale/br.js":
  18899. /*!******************************************!*\
  18900. !*** ./node_modules/moment/locale/br.js ***!
  18901. \******************************************/
  18902. /*! no static exports found */
  18903. /***/ (function(module, exports, __webpack_require__) {
  18904. //! moment.js locale configuration
  18905. //! locale : Breton [br]
  18906. //! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou
  18907. ;(function (global, factory) {
  18908. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  18909. undefined
  18910. }(this, (function (moment) { 'use strict';
  18911. //! moment.js locale configuration
  18912. function relativeTimeWithMutation(number, withoutSuffix, key) {
  18913. var format = {
  18914. mm: 'munutenn',
  18915. MM: 'miz',
  18916. dd: 'devezh',
  18917. };
  18918. return number + ' ' + mutation(format[key], number);
  18919. }
  18920. function specialMutationForYears(number) {
  18921. switch (lastNumber(number)) {
  18922. case 1:
  18923. case 3:
  18924. case 4:
  18925. case 5:
  18926. case 9:
  18927. return number + ' bloaz';
  18928. default:
  18929. return number + ' vloaz';
  18930. }
  18931. }
  18932. function lastNumber(number) {
  18933. if (number > 9) {
  18934. return lastNumber(number % 10);
  18935. }
  18936. return number;
  18937. }
  18938. function mutation(text, number) {
  18939. if (number === 2) {
  18940. return softMutation(text);
  18941. }
  18942. return text;
  18943. }
  18944. function softMutation(text) {
  18945. var mutationTable = {
  18946. m: 'v',
  18947. b: 'v',
  18948. d: 'z',
  18949. };
  18950. if (mutationTable[text.charAt(0)] === undefined) {
  18951. return text;
  18952. }
  18953. return mutationTable[text.charAt(0)] + text.substring(1);
  18954. }
  18955. var monthsParse = [
  18956. /^gen/i,
  18957. /^c[ʼ\']hwe/i,
  18958. /^meu/i,
  18959. /^ebr/i,
  18960. /^mae/i,
  18961. /^(mez|eve)/i,
  18962. /^gou/i,
  18963. /^eos/i,
  18964. /^gwe/i,
  18965. /^her/i,
  18966. /^du/i,
  18967. /^ker/i,
  18968. ],
  18969. 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,
  18970. monthsStrictRegex = /^(genver|c[ʼ\']hwevrer|meurzh|ebrel|mae|mezheven|gouere|eost|gwengolo|here|du|kerzu)/i,
  18971. monthsShortStrictRegex = /^(gen|c[ʼ\']hwe|meu|ebr|mae|eve|gou|eos|gwe|her|du|ker)/i,
  18972. fullWeekdaysParse = [
  18973. /^sul/i,
  18974. /^lun/i,
  18975. /^meurzh/i,
  18976. /^merc[ʼ\']her/i,
  18977. /^yaou/i,
  18978. /^gwener/i,
  18979. /^sadorn/i,
  18980. ],
  18981. shortWeekdaysParse = [
  18982. /^Sul/i,
  18983. /^Lun/i,
  18984. /^Meu/i,
  18985. /^Mer/i,
  18986. /^Yao/i,
  18987. /^Gwe/i,
  18988. /^Sad/i,
  18989. ],
  18990. minWeekdaysParse = [
  18991. /^Su/i,
  18992. /^Lu/i,
  18993. /^Me([^r]|$)/i,
  18994. /^Mer/i,
  18995. /^Ya/i,
  18996. /^Gw/i,
  18997. /^Sa/i,
  18998. ];
  18999. var br = moment.defineLocale('br', {
  19000. months: 'Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split(
  19001. '_'
  19002. ),
  19003. monthsShort: 'Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'),
  19004. weekdays: 'Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn'.split('_'),
  19005. weekdaysShort: 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'),
  19006. weekdaysMin: 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'),
  19007. weekdaysParse: minWeekdaysParse,
  19008. fullWeekdaysParse: fullWeekdaysParse,
  19009. shortWeekdaysParse: shortWeekdaysParse,
  19010. minWeekdaysParse: minWeekdaysParse,
  19011. monthsRegex: monthsRegex,
  19012. monthsShortRegex: monthsRegex,
  19013. monthsStrictRegex: monthsStrictRegex,
  19014. monthsShortStrictRegex: monthsShortStrictRegex,
  19015. monthsParse: monthsParse,
  19016. longMonthsParse: monthsParse,
  19017. shortMonthsParse: monthsParse,
  19018. longDateFormat: {
  19019. LT: 'HH:mm',
  19020. LTS: 'HH:mm:ss',
  19021. L: 'DD/MM/YYYY',
  19022. LL: 'D [a viz] MMMM YYYY',
  19023. LLL: 'D [a viz] MMMM YYYY HH:mm',
  19024. LLLL: 'dddd, D [a viz] MMMM YYYY HH:mm',
  19025. },
  19026. calendar: {
  19027. sameDay: '[Hiziv da] LT',
  19028. nextDay: '[Warcʼhoazh da] LT',
  19029. nextWeek: 'dddd [da] LT',
  19030. lastDay: '[Decʼh da] LT',
  19031. lastWeek: 'dddd [paset da] LT',
  19032. sameElse: 'L',
  19033. },
  19034. relativeTime: {
  19035. future: 'a-benn %s',
  19036. past: '%s ʼzo',
  19037. s: 'un nebeud segondennoù',
  19038. ss: '%d eilenn',
  19039. m: 'ur vunutenn',
  19040. mm: relativeTimeWithMutation,
  19041. h: 'un eur',
  19042. hh: '%d eur',
  19043. d: 'un devezh',
  19044. dd: relativeTimeWithMutation,
  19045. M: 'ur miz',
  19046. MM: relativeTimeWithMutation,
  19047. y: 'ur bloaz',
  19048. yy: specialMutationForYears,
  19049. },
  19050. dayOfMonthOrdinalParse: /\d{1,2}(añ|vet)/,
  19051. ordinal: function (number) {
  19052. var output = number === 1 ? 'añ' : 'vet';
  19053. return number + output;
  19054. },
  19055. week: {
  19056. dow: 1, // Monday is the first day of the week.
  19057. doy: 4, // The week that contains Jan 4th is the first week of the year.
  19058. },
  19059. meridiemParse: /a.m.|g.m./, // goude merenn | a-raok merenn
  19060. isPM: function (token) {
  19061. return token === 'g.m.';
  19062. },
  19063. meridiem: function (hour, minute, isLower) {
  19064. return hour < 12 ? 'a.m.' : 'g.m.';
  19065. },
  19066. });
  19067. return br;
  19068. })));
  19069. /***/ }),
  19070. /***/ "./node_modules/moment/locale/bs.js":
  19071. /*!******************************************!*\
  19072. !*** ./node_modules/moment/locale/bs.js ***!
  19073. \******************************************/
  19074. /*! no static exports found */
  19075. /***/ (function(module, exports, __webpack_require__) {
  19076. //! moment.js locale configuration
  19077. //! locale : Bosnian [bs]
  19078. //! author : Nedim Cholich : https://github.com/frontyard
  19079. //! based on (hr) translation by Bojan Marković
  19080. ;(function (global, factory) {
  19081. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  19082. undefined
  19083. }(this, (function (moment) { 'use strict';
  19084. //! moment.js locale configuration
  19085. function translate(number, withoutSuffix, key) {
  19086. var result = number + ' ';
  19087. switch (key) {
  19088. case 'ss':
  19089. if (number === 1) {
  19090. result += 'sekunda';
  19091. } else if (number === 2 || number === 3 || number === 4) {
  19092. result += 'sekunde';
  19093. } else {
  19094. result += 'sekundi';
  19095. }
  19096. return result;
  19097. case 'm':
  19098. return withoutSuffix ? 'jedna minuta' : 'jedne minute';
  19099. case 'mm':
  19100. if (number === 1) {
  19101. result += 'minuta';
  19102. } else if (number === 2 || number === 3 || number === 4) {
  19103. result += 'minute';
  19104. } else {
  19105. result += 'minuta';
  19106. }
  19107. return result;
  19108. case 'h':
  19109. return withoutSuffix ? 'jedan sat' : 'jednog sata';
  19110. case 'hh':
  19111. if (number === 1) {
  19112. result += 'sat';
  19113. } else if (number === 2 || number === 3 || number === 4) {
  19114. result += 'sata';
  19115. } else {
  19116. result += 'sati';
  19117. }
  19118. return result;
  19119. case 'dd':
  19120. if (number === 1) {
  19121. result += 'dan';
  19122. } else {
  19123. result += 'dana';
  19124. }
  19125. return result;
  19126. case 'MM':
  19127. if (number === 1) {
  19128. result += 'mjesec';
  19129. } else if (number === 2 || number === 3 || number === 4) {
  19130. result += 'mjeseca';
  19131. } else {
  19132. result += 'mjeseci';
  19133. }
  19134. return result;
  19135. case 'yy':
  19136. if (number === 1) {
  19137. result += 'godina';
  19138. } else if (number === 2 || number === 3 || number === 4) {
  19139. result += 'godine';
  19140. } else {
  19141. result += 'godina';
  19142. }
  19143. return result;
  19144. }
  19145. }
  19146. var bs = moment.defineLocale('bs', {
  19147. months: 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split(
  19148. '_'
  19149. ),
  19150. monthsShort: 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split(
  19151. '_'
  19152. ),
  19153. monthsParseExact: true,
  19154. weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(
  19155. '_'
  19156. ),
  19157. weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  19158. weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
  19159. weekdaysParseExact: true,
  19160. longDateFormat: {
  19161. LT: 'H:mm',
  19162. LTS: 'H:mm:ss',
  19163. L: 'DD.MM.YYYY',
  19164. LL: 'D. MMMM YYYY',
  19165. LLL: 'D. MMMM YYYY H:mm',
  19166. LLLL: 'dddd, D. MMMM YYYY H:mm',
  19167. },
  19168. calendar: {
  19169. sameDay: '[danas u] LT',
  19170. nextDay: '[sutra u] LT',
  19171. nextWeek: function () {
  19172. switch (this.day()) {
  19173. case 0:
  19174. return '[u] [nedjelju] [u] LT';
  19175. case 3:
  19176. return '[u] [srijedu] [u] LT';
  19177. case 6:
  19178. return '[u] [subotu] [u] LT';
  19179. case 1:
  19180. case 2:
  19181. case 4:
  19182. case 5:
  19183. return '[u] dddd [u] LT';
  19184. }
  19185. },
  19186. lastDay: '[jučer u] LT',
  19187. lastWeek: function () {
  19188. switch (this.day()) {
  19189. case 0:
  19190. case 3:
  19191. return '[prošlu] dddd [u] LT';
  19192. case 6:
  19193. return '[prošle] [subote] [u] LT';
  19194. case 1:
  19195. case 2:
  19196. case 4:
  19197. case 5:
  19198. return '[prošli] dddd [u] LT';
  19199. }
  19200. },
  19201. sameElse: 'L',
  19202. },
  19203. relativeTime: {
  19204. future: 'za %s',
  19205. past: 'prije %s',
  19206. s: 'par sekundi',
  19207. ss: translate,
  19208. m: translate,
  19209. mm: translate,
  19210. h: translate,
  19211. hh: translate,
  19212. d: 'dan',
  19213. dd: translate,
  19214. M: 'mjesec',
  19215. MM: translate,
  19216. y: 'godinu',
  19217. yy: translate,
  19218. },
  19219. dayOfMonthOrdinalParse: /\d{1,2}\./,
  19220. ordinal: '%d.',
  19221. week: {
  19222. dow: 1, // Monday is the first day of the week.
  19223. doy: 7, // The week that contains Jan 7th is the first week of the year.
  19224. },
  19225. });
  19226. return bs;
  19227. })));
  19228. /***/ }),
  19229. /***/ "./node_modules/moment/locale/ca.js":
  19230. /*!******************************************!*\
  19231. !*** ./node_modules/moment/locale/ca.js ***!
  19232. \******************************************/
  19233. /*! no static exports found */
  19234. /***/ (function(module, exports, __webpack_require__) {
  19235. //! moment.js locale configuration
  19236. //! locale : Catalan [ca]
  19237. //! author : Juan G. Hurtado : https://github.com/juanghurtado
  19238. ;(function (global, factory) {
  19239. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  19240. undefined
  19241. }(this, (function (moment) { 'use strict';
  19242. //! moment.js locale configuration
  19243. var ca = moment.defineLocale('ca', {
  19244. months: {
  19245. standalone: 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split(
  19246. '_'
  19247. ),
  19248. 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(
  19249. '_'
  19250. ),
  19251. isFormat: /D[oD]?(\s)+MMMM/,
  19252. },
  19253. monthsShort: 'gen._febr._març_abr._maig_juny_jul._ag._set._oct._nov._des.'.split(
  19254. '_'
  19255. ),
  19256. monthsParseExact: true,
  19257. weekdays: 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split(
  19258. '_'
  19259. ),
  19260. weekdaysShort: 'dg._dl._dt._dc._dj._dv._ds.'.split('_'),
  19261. weekdaysMin: 'dg_dl_dt_dc_dj_dv_ds'.split('_'),
  19262. weekdaysParseExact: true,
  19263. longDateFormat: {
  19264. LT: 'H:mm',
  19265. LTS: 'H:mm:ss',
  19266. L: 'DD/MM/YYYY',
  19267. LL: 'D MMMM [de] YYYY',
  19268. ll: 'D MMM YYYY',
  19269. LLL: 'D MMMM [de] YYYY [a les] H:mm',
  19270. lll: 'D MMM YYYY, H:mm',
  19271. LLLL: 'dddd D MMMM [de] YYYY [a les] H:mm',
  19272. llll: 'ddd D MMM YYYY, H:mm',
  19273. },
  19274. calendar: {
  19275. sameDay: function () {
  19276. return '[avui a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
  19277. },
  19278. nextDay: function () {
  19279. return '[demà a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
  19280. },
  19281. nextWeek: function () {
  19282. return 'dddd [a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
  19283. },
  19284. lastDay: function () {
  19285. return '[ahir a ' + (this.hours() !== 1 ? 'les' : 'la') + '] LT';
  19286. },
  19287. lastWeek: function () {
  19288. return (
  19289. '[el] dddd [passat a ' +
  19290. (this.hours() !== 1 ? 'les' : 'la') +
  19291. '] LT'
  19292. );
  19293. },
  19294. sameElse: 'L',
  19295. },
  19296. relativeTime: {
  19297. future: "d'aquí %s",
  19298. past: 'fa %s',
  19299. s: 'uns segons',
  19300. ss: '%d segons',
  19301. m: 'un minut',
  19302. mm: '%d minuts',
  19303. h: 'una hora',
  19304. hh: '%d hores',
  19305. d: 'un dia',
  19306. dd: '%d dies',
  19307. M: 'un mes',
  19308. MM: '%d mesos',
  19309. y: 'un any',
  19310. yy: '%d anys',
  19311. },
  19312. dayOfMonthOrdinalParse: /\d{1,2}(r|n|t|è|a)/,
  19313. ordinal: function (number, period) {
  19314. var output =
  19315. number === 1
  19316. ? 'r'
  19317. : number === 2
  19318. ? 'n'
  19319. : number === 3
  19320. ? 'r'
  19321. : number === 4
  19322. ? 't'
  19323. : 'è';
  19324. if (period === 'w' || period === 'W') {
  19325. output = 'a';
  19326. }
  19327. return number + output;
  19328. },
  19329. week: {
  19330. dow: 1, // Monday is the first day of the week.
  19331. doy: 4, // The week that contains Jan 4th is the first week of the year.
  19332. },
  19333. });
  19334. return ca;
  19335. })));
  19336. /***/ }),
  19337. /***/ "./node_modules/moment/locale/cs.js":
  19338. /*!******************************************!*\
  19339. !*** ./node_modules/moment/locale/cs.js ***!
  19340. \******************************************/
  19341. /*! no static exports found */
  19342. /***/ (function(module, exports, __webpack_require__) {
  19343. //! moment.js locale configuration
  19344. //! locale : Czech [cs]
  19345. //! author : petrbela : https://github.com/petrbela
  19346. ;(function (global, factory) {
  19347. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  19348. undefined
  19349. }(this, (function (moment) { 'use strict';
  19350. //! moment.js locale configuration
  19351. var months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split(
  19352. '_'
  19353. ),
  19354. monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_'),
  19355. monthsParse = [
  19356. /^led/i,
  19357. /^úno/i,
  19358. /^bře/i,
  19359. /^dub/i,
  19360. /^kvě/i,
  19361. /^(čvn|červen$|června)/i,
  19362. /^(čvc|červenec|července)/i,
  19363. /^srp/i,
  19364. /^zář/i,
  19365. /^říj/i,
  19366. /^lis/i,
  19367. /^pro/i,
  19368. ],
  19369. // NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched.
  19370. // Otherwise parser matches '1. červenec' as '1. červen' + 'ec'.
  19371. 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;
  19372. function plural(n) {
  19373. return n > 1 && n < 5 && ~~(n / 10) !== 1;
  19374. }
  19375. function translate(number, withoutSuffix, key, isFuture) {
  19376. var result = number + ' ';
  19377. switch (key) {
  19378. case 's': // a few seconds / in a few seconds / a few seconds ago
  19379. return withoutSuffix || isFuture ? 'pár sekund' : 'pár sekundami';
  19380. case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago
  19381. if (withoutSuffix || isFuture) {
  19382. return result + (plural(number) ? 'sekundy' : 'sekund');
  19383. } else {
  19384. return result + 'sekundami';
  19385. }
  19386. case 'm': // a minute / in a minute / a minute ago
  19387. return withoutSuffix ? 'minuta' : isFuture ? 'minutu' : 'minutou';
  19388. case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
  19389. if (withoutSuffix || isFuture) {
  19390. return result + (plural(number) ? 'minuty' : 'minut');
  19391. } else {
  19392. return result + 'minutami';
  19393. }
  19394. case 'h': // an hour / in an hour / an hour ago
  19395. return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';
  19396. case 'hh': // 9 hours / in 9 hours / 9 hours ago
  19397. if (withoutSuffix || isFuture) {
  19398. return result + (plural(number) ? 'hodiny' : 'hodin');
  19399. } else {
  19400. return result + 'hodinami';
  19401. }
  19402. case 'd': // a day / in a day / a day ago
  19403. return withoutSuffix || isFuture ? 'den' : 'dnem';
  19404. case 'dd': // 9 days / in 9 days / 9 days ago
  19405. if (withoutSuffix || isFuture) {
  19406. return result + (plural(number) ? 'dny' : 'dní');
  19407. } else {
  19408. return result + 'dny';
  19409. }
  19410. case 'M': // a month / in a month / a month ago
  19411. return withoutSuffix || isFuture ? 'měsíc' : 'měsícem';
  19412. case 'MM': // 9 months / in 9 months / 9 months ago
  19413. if (withoutSuffix || isFuture) {
  19414. return result + (plural(number) ? 'měsíce' : 'měsíců');
  19415. } else {
  19416. return result + 'měsíci';
  19417. }
  19418. case 'y': // a year / in a year / a year ago
  19419. return withoutSuffix || isFuture ? 'rok' : 'rokem';
  19420. case 'yy': // 9 years / in 9 years / 9 years ago
  19421. if (withoutSuffix || isFuture) {
  19422. return result + (plural(number) ? 'roky' : 'let');
  19423. } else {
  19424. return result + 'lety';
  19425. }
  19426. }
  19427. }
  19428. var cs = moment.defineLocale('cs', {
  19429. months: months,
  19430. monthsShort: monthsShort,
  19431. monthsRegex: monthsRegex,
  19432. monthsShortRegex: monthsRegex,
  19433. // NOTE: 'červen' is substring of 'červenec'; therefore 'červenec' must precede 'červen' in the regex to be fully matched.
  19434. // Otherwise parser matches '1. červenec' as '1. červen' + 'ec'.
  19435. 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,
  19436. monthsShortStrictRegex: /^(led|úno|bře|dub|kvě|čvn|čvc|srp|zář|říj|lis|pro)/i,
  19437. monthsParse: monthsParse,
  19438. longMonthsParse: monthsParse,
  19439. shortMonthsParse: monthsParse,
  19440. weekdays: 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),
  19441. weekdaysShort: 'ne_po_út_st_čt_pá_so'.split('_'),
  19442. weekdaysMin: 'ne_po_út_st_čt_pá_so'.split('_'),
  19443. longDateFormat: {
  19444. LT: 'H:mm',
  19445. LTS: 'H:mm:ss',
  19446. L: 'DD.MM.YYYY',
  19447. LL: 'D. MMMM YYYY',
  19448. LLL: 'D. MMMM YYYY H:mm',
  19449. LLLL: 'dddd D. MMMM YYYY H:mm',
  19450. l: 'D. M. YYYY',
  19451. },
  19452. calendar: {
  19453. sameDay: '[dnes v] LT',
  19454. nextDay: '[zítra v] LT',
  19455. nextWeek: function () {
  19456. switch (this.day()) {
  19457. case 0:
  19458. return '[v neděli v] LT';
  19459. case 1:
  19460. case 2:
  19461. return '[v] dddd [v] LT';
  19462. case 3:
  19463. return '[ve středu v] LT';
  19464. case 4:
  19465. return '[ve čtvrtek v] LT';
  19466. case 5:
  19467. return '[v pátek v] LT';
  19468. case 6:
  19469. return '[v sobotu v] LT';
  19470. }
  19471. },
  19472. lastDay: '[včera v] LT',
  19473. lastWeek: function () {
  19474. switch (this.day()) {
  19475. case 0:
  19476. return '[minulou neděli v] LT';
  19477. case 1:
  19478. case 2:
  19479. return '[minulé] dddd [v] LT';
  19480. case 3:
  19481. return '[minulou středu v] LT';
  19482. case 4:
  19483. case 5:
  19484. return '[minulý] dddd [v] LT';
  19485. case 6:
  19486. return '[minulou sobotu v] LT';
  19487. }
  19488. },
  19489. sameElse: 'L',
  19490. },
  19491. relativeTime: {
  19492. future: 'za %s',
  19493. past: 'před %s',
  19494. s: translate,
  19495. ss: translate,
  19496. m: translate,
  19497. mm: translate,
  19498. h: translate,
  19499. hh: translate,
  19500. d: translate,
  19501. dd: translate,
  19502. M: translate,
  19503. MM: translate,
  19504. y: translate,
  19505. yy: translate,
  19506. },
  19507. dayOfMonthOrdinalParse: /\d{1,2}\./,
  19508. ordinal: '%d.',
  19509. week: {
  19510. dow: 1, // Monday is the first day of the week.
  19511. doy: 4, // The week that contains Jan 4th is the first week of the year.
  19512. },
  19513. });
  19514. return cs;
  19515. })));
  19516. /***/ }),
  19517. /***/ "./node_modules/moment/locale/cv.js":
  19518. /*!******************************************!*\
  19519. !*** ./node_modules/moment/locale/cv.js ***!
  19520. \******************************************/
  19521. /*! no static exports found */
  19522. /***/ (function(module, exports, __webpack_require__) {
  19523. //! moment.js locale configuration
  19524. //! locale : Chuvash [cv]
  19525. //! author : Anatoly Mironov : https://github.com/mirontoli
  19526. ;(function (global, factory) {
  19527. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  19528. undefined
  19529. }(this, (function (moment) { 'use strict';
  19530. //! moment.js locale configuration
  19531. var cv = moment.defineLocale('cv', {
  19532. months: 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split(
  19533. '_'
  19534. ),
  19535. monthsShort: 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'),
  19536. weekdays: 'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split(
  19537. '_'
  19538. ),
  19539. weekdaysShort: 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'),
  19540. weekdaysMin: 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'),
  19541. longDateFormat: {
  19542. LT: 'HH:mm',
  19543. LTS: 'HH:mm:ss',
  19544. L: 'DD-MM-YYYY',
  19545. LL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]',
  19546. LLL: 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
  19547. LLLL: 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm',
  19548. },
  19549. calendar: {
  19550. sameDay: '[Паян] LT [сехетре]',
  19551. nextDay: '[Ыран] LT [сехетре]',
  19552. lastDay: '[Ӗнер] LT [сехетре]',
  19553. nextWeek: '[Ҫитес] dddd LT [сехетре]',
  19554. lastWeek: '[Иртнӗ] dddd LT [сехетре]',
  19555. sameElse: 'L',
  19556. },
  19557. relativeTime: {
  19558. future: function (output) {
  19559. var affix = /сехет$/i.exec(output)
  19560. ? 'рен'
  19561. : /ҫул$/i.exec(output)
  19562. ? 'тан'
  19563. : 'ран';
  19564. return output + affix;
  19565. },
  19566. past: '%s каялла',
  19567. s: 'пӗр-ик ҫеккунт',
  19568. ss: '%d ҫеккунт',
  19569. m: 'пӗр минут',
  19570. mm: '%d минут',
  19571. h: 'пӗр сехет',
  19572. hh: '%d сехет',
  19573. d: 'пӗр кун',
  19574. dd: '%d кун',
  19575. M: 'пӗр уйӑх',
  19576. MM: '%d уйӑх',
  19577. y: 'пӗр ҫул',
  19578. yy: '%d ҫул',
  19579. },
  19580. dayOfMonthOrdinalParse: /\d{1,2}-мӗш/,
  19581. ordinal: '%d-мӗш',
  19582. week: {
  19583. dow: 1, // Monday is the first day of the week.
  19584. doy: 7, // The week that contains Jan 7th is the first week of the year.
  19585. },
  19586. });
  19587. return cv;
  19588. })));
  19589. /***/ }),
  19590. /***/ "./node_modules/moment/locale/cy.js":
  19591. /*!******************************************!*\
  19592. !*** ./node_modules/moment/locale/cy.js ***!
  19593. \******************************************/
  19594. /*! no static exports found */
  19595. /***/ (function(module, exports, __webpack_require__) {
  19596. //! moment.js locale configuration
  19597. //! locale : Welsh [cy]
  19598. //! author : Robert Allen : https://github.com/robgallen
  19599. //! author : https://github.com/ryangreaves
  19600. ;(function (global, factory) {
  19601. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  19602. undefined
  19603. }(this, (function (moment) { 'use strict';
  19604. //! moment.js locale configuration
  19605. var cy = moment.defineLocale('cy', {
  19606. months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split(
  19607. '_'
  19608. ),
  19609. monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split(
  19610. '_'
  19611. ),
  19612. weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split(
  19613. '_'
  19614. ),
  19615. weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'),
  19616. weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'),
  19617. weekdaysParseExact: true,
  19618. // time formats are the same as en-gb
  19619. longDateFormat: {
  19620. LT: 'HH:mm',
  19621. LTS: 'HH:mm:ss',
  19622. L: 'DD/MM/YYYY',
  19623. LL: 'D MMMM YYYY',
  19624. LLL: 'D MMMM YYYY HH:mm',
  19625. LLLL: 'dddd, D MMMM YYYY HH:mm',
  19626. },
  19627. calendar: {
  19628. sameDay: '[Heddiw am] LT',
  19629. nextDay: '[Yfory am] LT',
  19630. nextWeek: 'dddd [am] LT',
  19631. lastDay: '[Ddoe am] LT',
  19632. lastWeek: 'dddd [diwethaf am] LT',
  19633. sameElse: 'L',
  19634. },
  19635. relativeTime: {
  19636. future: 'mewn %s',
  19637. past: '%s yn ôl',
  19638. s: 'ychydig eiliadau',
  19639. ss: '%d eiliad',
  19640. m: 'munud',
  19641. mm: '%d munud',
  19642. h: 'awr',
  19643. hh: '%d awr',
  19644. d: 'diwrnod',
  19645. dd: '%d diwrnod',
  19646. M: 'mis',
  19647. MM: '%d mis',
  19648. y: 'blwyddyn',
  19649. yy: '%d flynedd',
  19650. },
  19651. dayOfMonthOrdinalParse: /\d{1,2}(fed|ain|af|il|ydd|ed|eg)/,
  19652. // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh
  19653. ordinal: function (number) {
  19654. var b = number,
  19655. output = '',
  19656. lookup = [
  19657. '',
  19658. 'af',
  19659. 'il',
  19660. 'ydd',
  19661. 'ydd',
  19662. 'ed',
  19663. 'ed',
  19664. 'ed',
  19665. 'fed',
  19666. 'fed',
  19667. 'fed', // 1af to 10fed
  19668. 'eg',
  19669. 'fed',
  19670. 'eg',
  19671. 'eg',
  19672. 'fed',
  19673. 'eg',
  19674. 'eg',
  19675. 'fed',
  19676. 'eg',
  19677. 'fed', // 11eg to 20fed
  19678. ];
  19679. if (b > 20) {
  19680. if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) {
  19681. output = 'fed'; // not 30ain, 70ain or 90ain
  19682. } else {
  19683. output = 'ain';
  19684. }
  19685. } else if (b > 0) {
  19686. output = lookup[b];
  19687. }
  19688. return number + output;
  19689. },
  19690. week: {
  19691. dow: 1, // Monday is the first day of the week.
  19692. doy: 4, // The week that contains Jan 4th is the first week of the year.
  19693. },
  19694. });
  19695. return cy;
  19696. })));
  19697. /***/ }),
  19698. /***/ "./node_modules/moment/locale/da.js":
  19699. /*!******************************************!*\
  19700. !*** ./node_modules/moment/locale/da.js ***!
  19701. \******************************************/
  19702. /*! no static exports found */
  19703. /***/ (function(module, exports, __webpack_require__) {
  19704. //! moment.js locale configuration
  19705. //! locale : Danish [da]
  19706. //! author : Ulrik Nielsen : https://github.com/mrbase
  19707. ;(function (global, factory) {
  19708. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  19709. undefined
  19710. }(this, (function (moment) { 'use strict';
  19711. //! moment.js locale configuration
  19712. var da = moment.defineLocale('da', {
  19713. months: 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split(
  19714. '_'
  19715. ),
  19716. monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
  19717. weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
  19718. weekdaysShort: 'søn_man_tir_ons_tor_fre_lør'.split('_'),
  19719. weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'),
  19720. longDateFormat: {
  19721. LT: 'HH:mm',
  19722. LTS: 'HH:mm:ss',
  19723. L: 'DD.MM.YYYY',
  19724. LL: 'D. MMMM YYYY',
  19725. LLL: 'D. MMMM YYYY HH:mm',
  19726. LLLL: 'dddd [d.] D. MMMM YYYY [kl.] HH:mm',
  19727. },
  19728. calendar: {
  19729. sameDay: '[i dag kl.] LT',
  19730. nextDay: '[i morgen kl.] LT',
  19731. nextWeek: 'på dddd [kl.] LT',
  19732. lastDay: '[i går kl.] LT',
  19733. lastWeek: '[i] dddd[s kl.] LT',
  19734. sameElse: 'L',
  19735. },
  19736. relativeTime: {
  19737. future: 'om %s',
  19738. past: '%s siden',
  19739. s: 'få sekunder',
  19740. ss: '%d sekunder',
  19741. m: 'et minut',
  19742. mm: '%d minutter',
  19743. h: 'en time',
  19744. hh: '%d timer',
  19745. d: 'en dag',
  19746. dd: '%d dage',
  19747. M: 'en måned',
  19748. MM: '%d måneder',
  19749. y: 'et år',
  19750. yy: '%d år',
  19751. },
  19752. dayOfMonthOrdinalParse: /\d{1,2}\./,
  19753. ordinal: '%d.',
  19754. week: {
  19755. dow: 1, // Monday is the first day of the week.
  19756. doy: 4, // The week that contains Jan 4th is the first week of the year.
  19757. },
  19758. });
  19759. return da;
  19760. })));
  19761. /***/ }),
  19762. /***/ "./node_modules/moment/locale/de-at.js":
  19763. /*!*********************************************!*\
  19764. !*** ./node_modules/moment/locale/de-at.js ***!
  19765. \*********************************************/
  19766. /*! no static exports found */
  19767. /***/ (function(module, exports, __webpack_require__) {
  19768. //! moment.js locale configuration
  19769. //! locale : German (Austria) [de-at]
  19770. //! author : lluchs : https://github.com/lluchs
  19771. //! author: Menelion Elensúle: https://github.com/Oire
  19772. //! author : Martin Groller : https://github.com/MadMG
  19773. //! author : Mikolaj Dadela : https://github.com/mik01aj
  19774. ;(function (global, factory) {
  19775. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  19776. undefined
  19777. }(this, (function (moment) { 'use strict';
  19778. //! moment.js locale configuration
  19779. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  19780. var format = {
  19781. m: ['eine Minute', 'einer Minute'],
  19782. h: ['eine Stunde', 'einer Stunde'],
  19783. d: ['ein Tag', 'einem Tag'],
  19784. dd: [number + ' Tage', number + ' Tagen'],
  19785. w: ['eine Woche', 'einer Woche'],
  19786. M: ['ein Monat', 'einem Monat'],
  19787. MM: [number + ' Monate', number + ' Monaten'],
  19788. y: ['ein Jahr', 'einem Jahr'],
  19789. yy: [number + ' Jahre', number + ' Jahren'],
  19790. };
  19791. return withoutSuffix ? format[key][0] : format[key][1];
  19792. }
  19793. var deAt = moment.defineLocale('de-at', {
  19794. months: 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(
  19795. '_'
  19796. ),
  19797. monthsShort: 'Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split(
  19798. '_'
  19799. ),
  19800. monthsParseExact: true,
  19801. weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(
  19802. '_'
  19803. ),
  19804. weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
  19805. weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  19806. weekdaysParseExact: true,
  19807. longDateFormat: {
  19808. LT: 'HH:mm',
  19809. LTS: 'HH:mm:ss',
  19810. L: 'DD.MM.YYYY',
  19811. LL: 'D. MMMM YYYY',
  19812. LLL: 'D. MMMM YYYY HH:mm',
  19813. LLLL: 'dddd, D. MMMM YYYY HH:mm',
  19814. },
  19815. calendar: {
  19816. sameDay: '[heute um] LT [Uhr]',
  19817. sameElse: 'L',
  19818. nextDay: '[morgen um] LT [Uhr]',
  19819. nextWeek: 'dddd [um] LT [Uhr]',
  19820. lastDay: '[gestern um] LT [Uhr]',
  19821. lastWeek: '[letzten] dddd [um] LT [Uhr]',
  19822. },
  19823. relativeTime: {
  19824. future: 'in %s',
  19825. past: 'vor %s',
  19826. s: 'ein paar Sekunden',
  19827. ss: '%d Sekunden',
  19828. m: processRelativeTime,
  19829. mm: '%d Minuten',
  19830. h: processRelativeTime,
  19831. hh: '%d Stunden',
  19832. d: processRelativeTime,
  19833. dd: processRelativeTime,
  19834. w: processRelativeTime,
  19835. ww: '%d Wochen',
  19836. M: processRelativeTime,
  19837. MM: processRelativeTime,
  19838. y: processRelativeTime,
  19839. yy: processRelativeTime,
  19840. },
  19841. dayOfMonthOrdinalParse: /\d{1,2}\./,
  19842. ordinal: '%d.',
  19843. week: {
  19844. dow: 1, // Monday is the first day of the week.
  19845. doy: 4, // The week that contains Jan 4th is the first week of the year.
  19846. },
  19847. });
  19848. return deAt;
  19849. })));
  19850. /***/ }),
  19851. /***/ "./node_modules/moment/locale/de-ch.js":
  19852. /*!*********************************************!*\
  19853. !*** ./node_modules/moment/locale/de-ch.js ***!
  19854. \*********************************************/
  19855. /*! no static exports found */
  19856. /***/ (function(module, exports, __webpack_require__) {
  19857. //! moment.js locale configuration
  19858. //! locale : German (Switzerland) [de-ch]
  19859. //! author : sschueller : https://github.com/sschueller
  19860. ;(function (global, factory) {
  19861. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  19862. undefined
  19863. }(this, (function (moment) { 'use strict';
  19864. //! moment.js locale configuration
  19865. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  19866. var format = {
  19867. m: ['eine Minute', 'einer Minute'],
  19868. h: ['eine Stunde', 'einer Stunde'],
  19869. d: ['ein Tag', 'einem Tag'],
  19870. dd: [number + ' Tage', number + ' Tagen'],
  19871. w: ['eine Woche', 'einer Woche'],
  19872. M: ['ein Monat', 'einem Monat'],
  19873. MM: [number + ' Monate', number + ' Monaten'],
  19874. y: ['ein Jahr', 'einem Jahr'],
  19875. yy: [number + ' Jahre', number + ' Jahren'],
  19876. };
  19877. return withoutSuffix ? format[key][0] : format[key][1];
  19878. }
  19879. var deCh = moment.defineLocale('de-ch', {
  19880. months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(
  19881. '_'
  19882. ),
  19883. monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split(
  19884. '_'
  19885. ),
  19886. monthsParseExact: true,
  19887. weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(
  19888. '_'
  19889. ),
  19890. weekdaysShort: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  19891. weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  19892. weekdaysParseExact: true,
  19893. longDateFormat: {
  19894. LT: 'HH:mm',
  19895. LTS: 'HH:mm:ss',
  19896. L: 'DD.MM.YYYY',
  19897. LL: 'D. MMMM YYYY',
  19898. LLL: 'D. MMMM YYYY HH:mm',
  19899. LLLL: 'dddd, D. MMMM YYYY HH:mm',
  19900. },
  19901. calendar: {
  19902. sameDay: '[heute um] LT [Uhr]',
  19903. sameElse: 'L',
  19904. nextDay: '[morgen um] LT [Uhr]',
  19905. nextWeek: 'dddd [um] LT [Uhr]',
  19906. lastDay: '[gestern um] LT [Uhr]',
  19907. lastWeek: '[letzten] dddd [um] LT [Uhr]',
  19908. },
  19909. relativeTime: {
  19910. future: 'in %s',
  19911. past: 'vor %s',
  19912. s: 'ein paar Sekunden',
  19913. ss: '%d Sekunden',
  19914. m: processRelativeTime,
  19915. mm: '%d Minuten',
  19916. h: processRelativeTime,
  19917. hh: '%d Stunden',
  19918. d: processRelativeTime,
  19919. dd: processRelativeTime,
  19920. w: processRelativeTime,
  19921. ww: '%d Wochen',
  19922. M: processRelativeTime,
  19923. MM: processRelativeTime,
  19924. y: processRelativeTime,
  19925. yy: processRelativeTime,
  19926. },
  19927. dayOfMonthOrdinalParse: /\d{1,2}\./,
  19928. ordinal: '%d.',
  19929. week: {
  19930. dow: 1, // Monday is the first day of the week.
  19931. doy: 4, // The week that contains Jan 4th is the first week of the year.
  19932. },
  19933. });
  19934. return deCh;
  19935. })));
  19936. /***/ }),
  19937. /***/ "./node_modules/moment/locale/de.js":
  19938. /*!******************************************!*\
  19939. !*** ./node_modules/moment/locale/de.js ***!
  19940. \******************************************/
  19941. /*! no static exports found */
  19942. /***/ (function(module, exports, __webpack_require__) {
  19943. //! moment.js locale configuration
  19944. //! locale : German [de]
  19945. //! author : lluchs : https://github.com/lluchs
  19946. //! author: Menelion Elensúle: https://github.com/Oire
  19947. //! author : Mikolaj Dadela : https://github.com/mik01aj
  19948. ;(function (global, factory) {
  19949. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  19950. undefined
  19951. }(this, (function (moment) { 'use strict';
  19952. //! moment.js locale configuration
  19953. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  19954. var format = {
  19955. m: ['eine Minute', 'einer Minute'],
  19956. h: ['eine Stunde', 'einer Stunde'],
  19957. d: ['ein Tag', 'einem Tag'],
  19958. dd: [number + ' Tage', number + ' Tagen'],
  19959. w: ['eine Woche', 'einer Woche'],
  19960. M: ['ein Monat', 'einem Monat'],
  19961. MM: [number + ' Monate', number + ' Monaten'],
  19962. y: ['ein Jahr', 'einem Jahr'],
  19963. yy: [number + ' Jahre', number + ' Jahren'],
  19964. };
  19965. return withoutSuffix ? format[key][0] : format[key][1];
  19966. }
  19967. var de = moment.defineLocale('de', {
  19968. months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(
  19969. '_'
  19970. ),
  19971. monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split(
  19972. '_'
  19973. ),
  19974. monthsParseExact: true,
  19975. weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(
  19976. '_'
  19977. ),
  19978. weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
  19979. weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  19980. weekdaysParseExact: true,
  19981. longDateFormat: {
  19982. LT: 'HH:mm',
  19983. LTS: 'HH:mm:ss',
  19984. L: 'DD.MM.YYYY',
  19985. LL: 'D. MMMM YYYY',
  19986. LLL: 'D. MMMM YYYY HH:mm',
  19987. LLLL: 'dddd, D. MMMM YYYY HH:mm',
  19988. },
  19989. calendar: {
  19990. sameDay: '[heute um] LT [Uhr]',
  19991. sameElse: 'L',
  19992. nextDay: '[morgen um] LT [Uhr]',
  19993. nextWeek: 'dddd [um] LT [Uhr]',
  19994. lastDay: '[gestern um] LT [Uhr]',
  19995. lastWeek: '[letzten] dddd [um] LT [Uhr]',
  19996. },
  19997. relativeTime: {
  19998. future: 'in %s',
  19999. past: 'vor %s',
  20000. s: 'ein paar Sekunden',
  20001. ss: '%d Sekunden',
  20002. m: processRelativeTime,
  20003. mm: '%d Minuten',
  20004. h: processRelativeTime,
  20005. hh: '%d Stunden',
  20006. d: processRelativeTime,
  20007. dd: processRelativeTime,
  20008. w: processRelativeTime,
  20009. ww: '%d Wochen',
  20010. M: processRelativeTime,
  20011. MM: processRelativeTime,
  20012. y: processRelativeTime,
  20013. yy: processRelativeTime,
  20014. },
  20015. dayOfMonthOrdinalParse: /\d{1,2}\./,
  20016. ordinal: '%d.',
  20017. week: {
  20018. dow: 1, // Monday is the first day of the week.
  20019. doy: 4, // The week that contains Jan 4th is the first week of the year.
  20020. },
  20021. });
  20022. return de;
  20023. })));
  20024. /***/ }),
  20025. /***/ "./node_modules/moment/locale/dv.js":
  20026. /*!******************************************!*\
  20027. !*** ./node_modules/moment/locale/dv.js ***!
  20028. \******************************************/
  20029. /*! no static exports found */
  20030. /***/ (function(module, exports, __webpack_require__) {
  20031. //! moment.js locale configuration
  20032. //! locale : Maldivian [dv]
  20033. //! author : Jawish Hameed : https://github.com/jawish
  20034. ;(function (global, factory) {
  20035. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  20036. undefined
  20037. }(this, (function (moment) { 'use strict';
  20038. //! moment.js locale configuration
  20039. var months = [
  20040. 'ޖެނުއަރީ',
  20041. 'ފެބްރުއަރީ',
  20042. 'މާރިޗު',
  20043. 'އޭޕްރީލު',
  20044. 'މޭ',
  20045. 'ޖޫން',
  20046. 'ޖުލައި',
  20047. 'އޯގަސްޓު',
  20048. 'ސެޕްޓެމްބަރު',
  20049. 'އޮކްޓޯބަރު',
  20050. 'ނޮވެމްބަރު',
  20051. 'ޑިސެމްބަރު',
  20052. ],
  20053. weekdays = [
  20054. 'އާދިއްތަ',
  20055. 'ހޯމަ',
  20056. 'އަންގާރަ',
  20057. 'ބުދަ',
  20058. 'ބުރާސްފަތި',
  20059. 'ހުކުރު',
  20060. 'ހޮނިހިރު',
  20061. ];
  20062. var dv = moment.defineLocale('dv', {
  20063. months: months,
  20064. monthsShort: months,
  20065. weekdays: weekdays,
  20066. weekdaysShort: weekdays,
  20067. weekdaysMin: 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'),
  20068. longDateFormat: {
  20069. LT: 'HH:mm',
  20070. LTS: 'HH:mm:ss',
  20071. L: 'D/M/YYYY',
  20072. LL: 'D MMMM YYYY',
  20073. LLL: 'D MMMM YYYY HH:mm',
  20074. LLLL: 'dddd D MMMM YYYY HH:mm',
  20075. },
  20076. meridiemParse: /މކ|މފ/,
  20077. isPM: function (input) {
  20078. return 'މފ' === input;
  20079. },
  20080. meridiem: function (hour, minute, isLower) {
  20081. if (hour < 12) {
  20082. return 'މކ';
  20083. } else {
  20084. return 'މފ';
  20085. }
  20086. },
  20087. calendar: {
  20088. sameDay: '[މިއަދު] LT',
  20089. nextDay: '[މާދަމާ] LT',
  20090. nextWeek: 'dddd LT',
  20091. lastDay: '[އިއްޔެ] LT',
  20092. lastWeek: '[ފާއިތުވި] dddd LT',
  20093. sameElse: 'L',
  20094. },
  20095. relativeTime: {
  20096. future: 'ތެރޭގައި %s',
  20097. past: 'ކުރިން %s',
  20098. s: 'ސިކުންތުކޮޅެއް',
  20099. ss: 'd% ސިކުންތު',
  20100. m: 'މިނިޓެއް',
  20101. mm: 'މިނިޓު %d',
  20102. h: 'ގަޑިއިރެއް',
  20103. hh: 'ގަޑިއިރު %d',
  20104. d: 'ދުވަހެއް',
  20105. dd: 'ދުވަސް %d',
  20106. M: 'މަހެއް',
  20107. MM: 'މަސް %d',
  20108. y: 'އަހަރެއް',
  20109. yy: 'އަހަރު %d',
  20110. },
  20111. preparse: function (string) {
  20112. return string.replace(/،/g, ',');
  20113. },
  20114. postformat: function (string) {
  20115. return string.replace(/,/g, '،');
  20116. },
  20117. week: {
  20118. dow: 7, // Sunday is the first day of the week.
  20119. doy: 12, // The week that contains Jan 12th is the first week of the year.
  20120. },
  20121. });
  20122. return dv;
  20123. })));
  20124. /***/ }),
  20125. /***/ "./node_modules/moment/locale/el.js":
  20126. /*!******************************************!*\
  20127. !*** ./node_modules/moment/locale/el.js ***!
  20128. \******************************************/
  20129. /*! no static exports found */
  20130. /***/ (function(module, exports, __webpack_require__) {
  20131. //! moment.js locale configuration
  20132. //! locale : Greek [el]
  20133. //! author : Aggelos Karalias : https://github.com/mehiel
  20134. ;(function (global, factory) {
  20135. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  20136. undefined
  20137. }(this, (function (moment) { 'use strict';
  20138. //! moment.js locale configuration
  20139. function isFunction(input) {
  20140. return (
  20141. (typeof Function !== 'undefined' && input instanceof Function) ||
  20142. Object.prototype.toString.call(input) === '[object Function]'
  20143. );
  20144. }
  20145. var el = moment.defineLocale('el', {
  20146. monthsNominativeEl: 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split(
  20147. '_'
  20148. ),
  20149. monthsGenitiveEl: 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split(
  20150. '_'
  20151. ),
  20152. months: function (momentToFormat, format) {
  20153. if (!momentToFormat) {
  20154. return this._monthsNominativeEl;
  20155. } else if (
  20156. typeof format === 'string' &&
  20157. /D/.test(format.substring(0, format.indexOf('MMMM')))
  20158. ) {
  20159. // if there is a day number before 'MMMM'
  20160. return this._monthsGenitiveEl[momentToFormat.month()];
  20161. } else {
  20162. return this._monthsNominativeEl[momentToFormat.month()];
  20163. }
  20164. },
  20165. monthsShort: 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'),
  20166. weekdays: 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split(
  20167. '_'
  20168. ),
  20169. weekdaysShort: 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'),
  20170. weekdaysMin: 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'),
  20171. meridiem: function (hours, minutes, isLower) {
  20172. if (hours > 11) {
  20173. return isLower ? 'μμ' : 'ΜΜ';
  20174. } else {
  20175. return isLower ? 'πμ' : 'ΠΜ';
  20176. }
  20177. },
  20178. isPM: function (input) {
  20179. return (input + '').toLowerCase()[0] === 'μ';
  20180. },
  20181. meridiemParse: /[ΠΜ]\.?Μ?\.?/i,
  20182. longDateFormat: {
  20183. LT: 'h:mm A',
  20184. LTS: 'h:mm:ss A',
  20185. L: 'DD/MM/YYYY',
  20186. LL: 'D MMMM YYYY',
  20187. LLL: 'D MMMM YYYY h:mm A',
  20188. LLLL: 'dddd, D MMMM YYYY h:mm A',
  20189. },
  20190. calendarEl: {
  20191. sameDay: '[Σήμερα {}] LT',
  20192. nextDay: '[Αύριο {}] LT',
  20193. nextWeek: 'dddd [{}] LT',
  20194. lastDay: '[Χθες {}] LT',
  20195. lastWeek: function () {
  20196. switch (this.day()) {
  20197. case 6:
  20198. return '[το προηγούμενο] dddd [{}] LT';
  20199. default:
  20200. return '[την προηγούμενη] dddd [{}] LT';
  20201. }
  20202. },
  20203. sameElse: 'L',
  20204. },
  20205. calendar: function (key, mom) {
  20206. var output = this._calendarEl[key],
  20207. hours = mom && mom.hours();
  20208. if (isFunction(output)) {
  20209. output = output.apply(mom);
  20210. }
  20211. return output.replace('{}', hours % 12 === 1 ? 'στη' : 'στις');
  20212. },
  20213. relativeTime: {
  20214. future: 'σε %s',
  20215. past: '%s πριν',
  20216. s: 'λίγα δευτερόλεπτα',
  20217. ss: '%d δευτερόλεπτα',
  20218. m: 'ένα λεπτό',
  20219. mm: '%d λεπτά',
  20220. h: 'μία ώρα',
  20221. hh: '%d ώρες',
  20222. d: 'μία μέρα',
  20223. dd: '%d μέρες',
  20224. M: 'ένας μήνας',
  20225. MM: '%d μήνες',
  20226. y: 'ένας χρόνος',
  20227. yy: '%d χρόνια',
  20228. },
  20229. dayOfMonthOrdinalParse: /\d{1,2}η/,
  20230. ordinal: '%dη',
  20231. week: {
  20232. dow: 1, // Monday is the first day of the week.
  20233. doy: 4, // The week that contains Jan 4st is the first week of the year.
  20234. },
  20235. });
  20236. return el;
  20237. })));
  20238. /***/ }),
  20239. /***/ "./node_modules/moment/locale/en-au.js":
  20240. /*!*********************************************!*\
  20241. !*** ./node_modules/moment/locale/en-au.js ***!
  20242. \*********************************************/
  20243. /*! no static exports found */
  20244. /***/ (function(module, exports, __webpack_require__) {
  20245. //! moment.js locale configuration
  20246. //! locale : English (Australia) [en-au]
  20247. //! author : Jared Morse : https://github.com/jarcoal
  20248. ;(function (global, factory) {
  20249. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  20250. undefined
  20251. }(this, (function (moment) { 'use strict';
  20252. //! moment.js locale configuration
  20253. var enAu = moment.defineLocale('en-au', {
  20254. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  20255. '_'
  20256. ),
  20257. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  20258. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  20259. '_'
  20260. ),
  20261. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  20262. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  20263. longDateFormat: {
  20264. LT: 'h:mm A',
  20265. LTS: 'h:mm:ss A',
  20266. L: 'DD/MM/YYYY',
  20267. LL: 'D MMMM YYYY',
  20268. LLL: 'D MMMM YYYY h:mm A',
  20269. LLLL: 'dddd, D MMMM YYYY h:mm A',
  20270. },
  20271. calendar: {
  20272. sameDay: '[Today at] LT',
  20273. nextDay: '[Tomorrow at] LT',
  20274. nextWeek: 'dddd [at] LT',
  20275. lastDay: '[Yesterday at] LT',
  20276. lastWeek: '[Last] dddd [at] LT',
  20277. sameElse: 'L',
  20278. },
  20279. relativeTime: {
  20280. future: 'in %s',
  20281. past: '%s ago',
  20282. s: 'a few seconds',
  20283. ss: '%d seconds',
  20284. m: 'a minute',
  20285. mm: '%d minutes',
  20286. h: 'an hour',
  20287. hh: '%d hours',
  20288. d: 'a day',
  20289. dd: '%d days',
  20290. M: 'a month',
  20291. MM: '%d months',
  20292. y: 'a year',
  20293. yy: '%d years',
  20294. },
  20295. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  20296. ordinal: function (number) {
  20297. var b = number % 10,
  20298. output =
  20299. ~~((number % 100) / 10) === 1
  20300. ? 'th'
  20301. : b === 1
  20302. ? 'st'
  20303. : b === 2
  20304. ? 'nd'
  20305. : b === 3
  20306. ? 'rd'
  20307. : 'th';
  20308. return number + output;
  20309. },
  20310. week: {
  20311. dow: 0, // Sunday is the first day of the week.
  20312. doy: 4, // The week that contains Jan 4th is the first week of the year.
  20313. },
  20314. });
  20315. return enAu;
  20316. })));
  20317. /***/ }),
  20318. /***/ "./node_modules/moment/locale/en-ca.js":
  20319. /*!*********************************************!*\
  20320. !*** ./node_modules/moment/locale/en-ca.js ***!
  20321. \*********************************************/
  20322. /*! no static exports found */
  20323. /***/ (function(module, exports, __webpack_require__) {
  20324. //! moment.js locale configuration
  20325. //! locale : English (Canada) [en-ca]
  20326. //! author : Jonathan Abourbih : https://github.com/jonbca
  20327. ;(function (global, factory) {
  20328. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  20329. undefined
  20330. }(this, (function (moment) { 'use strict';
  20331. //! moment.js locale configuration
  20332. var enCa = moment.defineLocale('en-ca', {
  20333. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  20334. '_'
  20335. ),
  20336. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  20337. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  20338. '_'
  20339. ),
  20340. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  20341. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  20342. longDateFormat: {
  20343. LT: 'h:mm A',
  20344. LTS: 'h:mm:ss A',
  20345. L: 'YYYY-MM-DD',
  20346. LL: 'MMMM D, YYYY',
  20347. LLL: 'MMMM D, YYYY h:mm A',
  20348. LLLL: 'dddd, MMMM D, YYYY h:mm A',
  20349. },
  20350. calendar: {
  20351. sameDay: '[Today at] LT',
  20352. nextDay: '[Tomorrow at] LT',
  20353. nextWeek: 'dddd [at] LT',
  20354. lastDay: '[Yesterday at] LT',
  20355. lastWeek: '[Last] dddd [at] LT',
  20356. sameElse: 'L',
  20357. },
  20358. relativeTime: {
  20359. future: 'in %s',
  20360. past: '%s ago',
  20361. s: 'a few seconds',
  20362. ss: '%d seconds',
  20363. m: 'a minute',
  20364. mm: '%d minutes',
  20365. h: 'an hour',
  20366. hh: '%d hours',
  20367. d: 'a day',
  20368. dd: '%d days',
  20369. M: 'a month',
  20370. MM: '%d months',
  20371. y: 'a year',
  20372. yy: '%d years',
  20373. },
  20374. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  20375. ordinal: function (number) {
  20376. var b = number % 10,
  20377. output =
  20378. ~~((number % 100) / 10) === 1
  20379. ? 'th'
  20380. : b === 1
  20381. ? 'st'
  20382. : b === 2
  20383. ? 'nd'
  20384. : b === 3
  20385. ? 'rd'
  20386. : 'th';
  20387. return number + output;
  20388. },
  20389. });
  20390. return enCa;
  20391. })));
  20392. /***/ }),
  20393. /***/ "./node_modules/moment/locale/en-gb.js":
  20394. /*!*********************************************!*\
  20395. !*** ./node_modules/moment/locale/en-gb.js ***!
  20396. \*********************************************/
  20397. /*! no static exports found */
  20398. /***/ (function(module, exports, __webpack_require__) {
  20399. //! moment.js locale configuration
  20400. //! locale : English (United Kingdom) [en-gb]
  20401. //! author : Chris Gedrim : https://github.com/chrisgedrim
  20402. ;(function (global, factory) {
  20403. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  20404. undefined
  20405. }(this, (function (moment) { 'use strict';
  20406. //! moment.js locale configuration
  20407. var enGb = moment.defineLocale('en-gb', {
  20408. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  20409. '_'
  20410. ),
  20411. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  20412. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  20413. '_'
  20414. ),
  20415. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  20416. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  20417. longDateFormat: {
  20418. LT: 'HH:mm',
  20419. LTS: 'HH:mm:ss',
  20420. L: 'DD/MM/YYYY',
  20421. LL: 'D MMMM YYYY',
  20422. LLL: 'D MMMM YYYY HH:mm',
  20423. LLLL: 'dddd, D MMMM YYYY HH:mm',
  20424. },
  20425. calendar: {
  20426. sameDay: '[Today at] LT',
  20427. nextDay: '[Tomorrow at] LT',
  20428. nextWeek: 'dddd [at] LT',
  20429. lastDay: '[Yesterday at] LT',
  20430. lastWeek: '[Last] dddd [at] LT',
  20431. sameElse: 'L',
  20432. },
  20433. relativeTime: {
  20434. future: 'in %s',
  20435. past: '%s ago',
  20436. s: 'a few seconds',
  20437. ss: '%d seconds',
  20438. m: 'a minute',
  20439. mm: '%d minutes',
  20440. h: 'an hour',
  20441. hh: '%d hours',
  20442. d: 'a day',
  20443. dd: '%d days',
  20444. M: 'a month',
  20445. MM: '%d months',
  20446. y: 'a year',
  20447. yy: '%d years',
  20448. },
  20449. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  20450. ordinal: function (number) {
  20451. var b = number % 10,
  20452. output =
  20453. ~~((number % 100) / 10) === 1
  20454. ? 'th'
  20455. : b === 1
  20456. ? 'st'
  20457. : b === 2
  20458. ? 'nd'
  20459. : b === 3
  20460. ? 'rd'
  20461. : 'th';
  20462. return number + output;
  20463. },
  20464. week: {
  20465. dow: 1, // Monday is the first day of the week.
  20466. doy: 4, // The week that contains Jan 4th is the first week of the year.
  20467. },
  20468. });
  20469. return enGb;
  20470. })));
  20471. /***/ }),
  20472. /***/ "./node_modules/moment/locale/en-ie.js":
  20473. /*!*********************************************!*\
  20474. !*** ./node_modules/moment/locale/en-ie.js ***!
  20475. \*********************************************/
  20476. /*! no static exports found */
  20477. /***/ (function(module, exports, __webpack_require__) {
  20478. //! moment.js locale configuration
  20479. //! locale : English (Ireland) [en-ie]
  20480. //! author : Chris Cartlidge : https://github.com/chriscartlidge
  20481. ;(function (global, factory) {
  20482. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  20483. undefined
  20484. }(this, (function (moment) { 'use strict';
  20485. //! moment.js locale configuration
  20486. var enIe = moment.defineLocale('en-ie', {
  20487. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  20488. '_'
  20489. ),
  20490. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  20491. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  20492. '_'
  20493. ),
  20494. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  20495. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  20496. longDateFormat: {
  20497. LT: 'HH:mm',
  20498. LTS: 'HH:mm:ss',
  20499. L: 'DD/MM/YYYY',
  20500. LL: 'D MMMM YYYY',
  20501. LLL: 'D MMMM YYYY HH:mm',
  20502. LLLL: 'dddd D MMMM YYYY HH:mm',
  20503. },
  20504. calendar: {
  20505. sameDay: '[Today at] LT',
  20506. nextDay: '[Tomorrow at] LT',
  20507. nextWeek: 'dddd [at] LT',
  20508. lastDay: '[Yesterday at] LT',
  20509. lastWeek: '[Last] dddd [at] LT',
  20510. sameElse: 'L',
  20511. },
  20512. relativeTime: {
  20513. future: 'in %s',
  20514. past: '%s ago',
  20515. s: 'a few seconds',
  20516. ss: '%d seconds',
  20517. m: 'a minute',
  20518. mm: '%d minutes',
  20519. h: 'an hour',
  20520. hh: '%d hours',
  20521. d: 'a day',
  20522. dd: '%d days',
  20523. M: 'a month',
  20524. MM: '%d months',
  20525. y: 'a year',
  20526. yy: '%d years',
  20527. },
  20528. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  20529. ordinal: function (number) {
  20530. var b = number % 10,
  20531. output =
  20532. ~~((number % 100) / 10) === 1
  20533. ? 'th'
  20534. : b === 1
  20535. ? 'st'
  20536. : b === 2
  20537. ? 'nd'
  20538. : b === 3
  20539. ? 'rd'
  20540. : 'th';
  20541. return number + output;
  20542. },
  20543. week: {
  20544. dow: 1, // Monday is the first day of the week.
  20545. doy: 4, // The week that contains Jan 4th is the first week of the year.
  20546. },
  20547. });
  20548. return enIe;
  20549. })));
  20550. /***/ }),
  20551. /***/ "./node_modules/moment/locale/en-il.js":
  20552. /*!*********************************************!*\
  20553. !*** ./node_modules/moment/locale/en-il.js ***!
  20554. \*********************************************/
  20555. /*! no static exports found */
  20556. /***/ (function(module, exports, __webpack_require__) {
  20557. //! moment.js locale configuration
  20558. //! locale : English (Israel) [en-il]
  20559. //! author : Chris Gedrim : https://github.com/chrisgedrim
  20560. ;(function (global, factory) {
  20561. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  20562. undefined
  20563. }(this, (function (moment) { 'use strict';
  20564. //! moment.js locale configuration
  20565. var enIl = moment.defineLocale('en-il', {
  20566. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  20567. '_'
  20568. ),
  20569. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  20570. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  20571. '_'
  20572. ),
  20573. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  20574. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  20575. longDateFormat: {
  20576. LT: 'HH:mm',
  20577. LTS: 'HH:mm:ss',
  20578. L: 'DD/MM/YYYY',
  20579. LL: 'D MMMM YYYY',
  20580. LLL: 'D MMMM YYYY HH:mm',
  20581. LLLL: 'dddd, D MMMM YYYY HH:mm',
  20582. },
  20583. calendar: {
  20584. sameDay: '[Today at] LT',
  20585. nextDay: '[Tomorrow at] LT',
  20586. nextWeek: 'dddd [at] LT',
  20587. lastDay: '[Yesterday at] LT',
  20588. lastWeek: '[Last] dddd [at] LT',
  20589. sameElse: 'L',
  20590. },
  20591. relativeTime: {
  20592. future: 'in %s',
  20593. past: '%s ago',
  20594. s: 'a few seconds',
  20595. ss: '%d seconds',
  20596. m: 'a minute',
  20597. mm: '%d minutes',
  20598. h: 'an hour',
  20599. hh: '%d hours',
  20600. d: 'a day',
  20601. dd: '%d days',
  20602. M: 'a month',
  20603. MM: '%d months',
  20604. y: 'a year',
  20605. yy: '%d years',
  20606. },
  20607. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  20608. ordinal: function (number) {
  20609. var b = number % 10,
  20610. output =
  20611. ~~((number % 100) / 10) === 1
  20612. ? 'th'
  20613. : b === 1
  20614. ? 'st'
  20615. : b === 2
  20616. ? 'nd'
  20617. : b === 3
  20618. ? 'rd'
  20619. : 'th';
  20620. return number + output;
  20621. },
  20622. });
  20623. return enIl;
  20624. })));
  20625. /***/ }),
  20626. /***/ "./node_modules/moment/locale/en-in.js":
  20627. /*!*********************************************!*\
  20628. !*** ./node_modules/moment/locale/en-in.js ***!
  20629. \*********************************************/
  20630. /*! no static exports found */
  20631. /***/ (function(module, exports, __webpack_require__) {
  20632. //! moment.js locale configuration
  20633. //! locale : English (India) [en-in]
  20634. //! author : Jatin Agrawal : https://github.com/jatinag22
  20635. ;(function (global, factory) {
  20636. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  20637. undefined
  20638. }(this, (function (moment) { 'use strict';
  20639. //! moment.js locale configuration
  20640. var enIn = moment.defineLocale('en-in', {
  20641. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  20642. '_'
  20643. ),
  20644. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  20645. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  20646. '_'
  20647. ),
  20648. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  20649. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  20650. longDateFormat: {
  20651. LT: 'h:mm A',
  20652. LTS: 'h:mm:ss A',
  20653. L: 'DD/MM/YYYY',
  20654. LL: 'D MMMM YYYY',
  20655. LLL: 'D MMMM YYYY h:mm A',
  20656. LLLL: 'dddd, D MMMM YYYY h:mm A',
  20657. },
  20658. calendar: {
  20659. sameDay: '[Today at] LT',
  20660. nextDay: '[Tomorrow at] LT',
  20661. nextWeek: 'dddd [at] LT',
  20662. lastDay: '[Yesterday at] LT',
  20663. lastWeek: '[Last] dddd [at] LT',
  20664. sameElse: 'L',
  20665. },
  20666. relativeTime: {
  20667. future: 'in %s',
  20668. past: '%s ago',
  20669. s: 'a few seconds',
  20670. ss: '%d seconds',
  20671. m: 'a minute',
  20672. mm: '%d minutes',
  20673. h: 'an hour',
  20674. hh: '%d hours',
  20675. d: 'a day',
  20676. dd: '%d days',
  20677. M: 'a month',
  20678. MM: '%d months',
  20679. y: 'a year',
  20680. yy: '%d years',
  20681. },
  20682. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  20683. ordinal: function (number) {
  20684. var b = number % 10,
  20685. output =
  20686. ~~((number % 100) / 10) === 1
  20687. ? 'th'
  20688. : b === 1
  20689. ? 'st'
  20690. : b === 2
  20691. ? 'nd'
  20692. : b === 3
  20693. ? 'rd'
  20694. : 'th';
  20695. return number + output;
  20696. },
  20697. week: {
  20698. dow: 0, // Sunday is the first day of the week.
  20699. doy: 6, // The week that contains Jan 1st is the first week of the year.
  20700. },
  20701. });
  20702. return enIn;
  20703. })));
  20704. /***/ }),
  20705. /***/ "./node_modules/moment/locale/en-nz.js":
  20706. /*!*********************************************!*\
  20707. !*** ./node_modules/moment/locale/en-nz.js ***!
  20708. \*********************************************/
  20709. /*! no static exports found */
  20710. /***/ (function(module, exports, __webpack_require__) {
  20711. //! moment.js locale configuration
  20712. //! locale : English (New Zealand) [en-nz]
  20713. //! author : Luke McGregor : https://github.com/lukemcgregor
  20714. ;(function (global, factory) {
  20715. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  20716. undefined
  20717. }(this, (function (moment) { 'use strict';
  20718. //! moment.js locale configuration
  20719. var enNz = moment.defineLocale('en-nz', {
  20720. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  20721. '_'
  20722. ),
  20723. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  20724. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  20725. '_'
  20726. ),
  20727. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  20728. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  20729. longDateFormat: {
  20730. LT: 'h:mm A',
  20731. LTS: 'h:mm:ss A',
  20732. L: 'DD/MM/YYYY',
  20733. LL: 'D MMMM YYYY',
  20734. LLL: 'D MMMM YYYY h:mm A',
  20735. LLLL: 'dddd, D MMMM YYYY h:mm A',
  20736. },
  20737. calendar: {
  20738. sameDay: '[Today at] LT',
  20739. nextDay: '[Tomorrow at] LT',
  20740. nextWeek: 'dddd [at] LT',
  20741. lastDay: '[Yesterday at] LT',
  20742. lastWeek: '[Last] dddd [at] LT',
  20743. sameElse: 'L',
  20744. },
  20745. relativeTime: {
  20746. future: 'in %s',
  20747. past: '%s ago',
  20748. s: 'a few seconds',
  20749. ss: '%d seconds',
  20750. m: 'a minute',
  20751. mm: '%d minutes',
  20752. h: 'an hour',
  20753. hh: '%d hours',
  20754. d: 'a day',
  20755. dd: '%d days',
  20756. M: 'a month',
  20757. MM: '%d months',
  20758. y: 'a year',
  20759. yy: '%d years',
  20760. },
  20761. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  20762. ordinal: function (number) {
  20763. var b = number % 10,
  20764. output =
  20765. ~~((number % 100) / 10) === 1
  20766. ? 'th'
  20767. : b === 1
  20768. ? 'st'
  20769. : b === 2
  20770. ? 'nd'
  20771. : b === 3
  20772. ? 'rd'
  20773. : 'th';
  20774. return number + output;
  20775. },
  20776. week: {
  20777. dow: 1, // Monday is the first day of the week.
  20778. doy: 4, // The week that contains Jan 4th is the first week of the year.
  20779. },
  20780. });
  20781. return enNz;
  20782. })));
  20783. /***/ }),
  20784. /***/ "./node_modules/moment/locale/en-sg.js":
  20785. /*!*********************************************!*\
  20786. !*** ./node_modules/moment/locale/en-sg.js ***!
  20787. \*********************************************/
  20788. /*! no static exports found */
  20789. /***/ (function(module, exports, __webpack_require__) {
  20790. //! moment.js locale configuration
  20791. //! locale : English (Singapore) [en-sg]
  20792. //! author : Matthew Castrillon-Madrigal : https://github.com/techdimension
  20793. ;(function (global, factory) {
  20794. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  20795. undefined
  20796. }(this, (function (moment) { 'use strict';
  20797. //! moment.js locale configuration
  20798. var enSg = moment.defineLocale('en-sg', {
  20799. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  20800. '_'
  20801. ),
  20802. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  20803. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  20804. '_'
  20805. ),
  20806. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  20807. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  20808. longDateFormat: {
  20809. LT: 'HH:mm',
  20810. LTS: 'HH:mm:ss',
  20811. L: 'DD/MM/YYYY',
  20812. LL: 'D MMMM YYYY',
  20813. LLL: 'D MMMM YYYY HH:mm',
  20814. LLLL: 'dddd, D MMMM YYYY HH:mm',
  20815. },
  20816. calendar: {
  20817. sameDay: '[Today at] LT',
  20818. nextDay: '[Tomorrow at] LT',
  20819. nextWeek: 'dddd [at] LT',
  20820. lastDay: '[Yesterday at] LT',
  20821. lastWeek: '[Last] dddd [at] LT',
  20822. sameElse: 'L',
  20823. },
  20824. relativeTime: {
  20825. future: 'in %s',
  20826. past: '%s ago',
  20827. s: 'a few seconds',
  20828. ss: '%d seconds',
  20829. m: 'a minute',
  20830. mm: '%d minutes',
  20831. h: 'an hour',
  20832. hh: '%d hours',
  20833. d: 'a day',
  20834. dd: '%d days',
  20835. M: 'a month',
  20836. MM: '%d months',
  20837. y: 'a year',
  20838. yy: '%d years',
  20839. },
  20840. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  20841. ordinal: function (number) {
  20842. var b = number % 10,
  20843. output =
  20844. ~~((number % 100) / 10) === 1
  20845. ? 'th'
  20846. : b === 1
  20847. ? 'st'
  20848. : b === 2
  20849. ? 'nd'
  20850. : b === 3
  20851. ? 'rd'
  20852. : 'th';
  20853. return number + output;
  20854. },
  20855. week: {
  20856. dow: 1, // Monday is the first day of the week.
  20857. doy: 4, // The week that contains Jan 4th is the first week of the year.
  20858. },
  20859. });
  20860. return enSg;
  20861. })));
  20862. /***/ }),
  20863. /***/ "./node_modules/moment/locale/eo.js":
  20864. /*!******************************************!*\
  20865. !*** ./node_modules/moment/locale/eo.js ***!
  20866. \******************************************/
  20867. /*! no static exports found */
  20868. /***/ (function(module, exports, __webpack_require__) {
  20869. //! moment.js locale configuration
  20870. //! locale : Esperanto [eo]
  20871. //! author : Colin Dean : https://github.com/colindean
  20872. //! author : Mia Nordentoft Imperatori : https://github.com/miestasmia
  20873. //! comment : miestasmia corrected the translation by colindean
  20874. //! comment : Vivakvo corrected the translation by colindean and miestasmia
  20875. ;(function (global, factory) {
  20876. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  20877. undefined
  20878. }(this, (function (moment) { 'use strict';
  20879. //! moment.js locale configuration
  20880. var eo = moment.defineLocale('eo', {
  20881. months: 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split(
  20882. '_'
  20883. ),
  20884. monthsShort: 'jan_feb_mart_apr_maj_jun_jul_aŭg_sept_okt_nov_dec'.split('_'),
  20885. weekdays: 'dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato'.split('_'),
  20886. weekdaysShort: 'dim_lun_mard_merk_ĵaŭ_ven_sab'.split('_'),
  20887. weekdaysMin: 'di_lu_ma_me_ĵa_ve_sa'.split('_'),
  20888. longDateFormat: {
  20889. LT: 'HH:mm',
  20890. LTS: 'HH:mm:ss',
  20891. L: 'YYYY-MM-DD',
  20892. LL: '[la] D[-an de] MMMM, YYYY',
  20893. LLL: '[la] D[-an de] MMMM, YYYY HH:mm',
  20894. LLLL: 'dddd[n], [la] D[-an de] MMMM, YYYY HH:mm',
  20895. llll: 'ddd, [la] D[-an de] MMM, YYYY HH:mm',
  20896. },
  20897. meridiemParse: /[ap]\.t\.m/i,
  20898. isPM: function (input) {
  20899. return input.charAt(0).toLowerCase() === 'p';
  20900. },
  20901. meridiem: function (hours, minutes, isLower) {
  20902. if (hours > 11) {
  20903. return isLower ? 'p.t.m.' : 'P.T.M.';
  20904. } else {
  20905. return isLower ? 'a.t.m.' : 'A.T.M.';
  20906. }
  20907. },
  20908. calendar: {
  20909. sameDay: '[Hodiaŭ je] LT',
  20910. nextDay: '[Morgaŭ je] LT',
  20911. nextWeek: 'dddd[n je] LT',
  20912. lastDay: '[Hieraŭ je] LT',
  20913. lastWeek: '[pasintan] dddd[n je] LT',
  20914. sameElse: 'L',
  20915. },
  20916. relativeTime: {
  20917. future: 'post %s',
  20918. past: 'antaŭ %s',
  20919. s: 'kelkaj sekundoj',
  20920. ss: '%d sekundoj',
  20921. m: 'unu minuto',
  20922. mm: '%d minutoj',
  20923. h: 'unu horo',
  20924. hh: '%d horoj',
  20925. d: 'unu tago', //ne 'diurno', ĉar estas uzita por proksimumo
  20926. dd: '%d tagoj',
  20927. M: 'unu monato',
  20928. MM: '%d monatoj',
  20929. y: 'unu jaro',
  20930. yy: '%d jaroj',
  20931. },
  20932. dayOfMonthOrdinalParse: /\d{1,2}a/,
  20933. ordinal: '%da',
  20934. week: {
  20935. dow: 1, // Monday is the first day of the week.
  20936. doy: 7, // The week that contains Jan 7th is the first week of the year.
  20937. },
  20938. });
  20939. return eo;
  20940. })));
  20941. /***/ }),
  20942. /***/ "./node_modules/moment/locale/es-do.js":
  20943. /*!*********************************************!*\
  20944. !*** ./node_modules/moment/locale/es-do.js ***!
  20945. \*********************************************/
  20946. /*! no static exports found */
  20947. /***/ (function(module, exports, __webpack_require__) {
  20948. //! moment.js locale configuration
  20949. //! locale : Spanish (Dominican Republic) [es-do]
  20950. ;(function (global, factory) {
  20951. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  20952. undefined
  20953. }(this, (function (moment) { 'use strict';
  20954. //! moment.js locale configuration
  20955. var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(
  20956. '_'
  20957. ),
  20958. monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
  20959. monthsParse = [
  20960. /^ene/i,
  20961. /^feb/i,
  20962. /^mar/i,
  20963. /^abr/i,
  20964. /^may/i,
  20965. /^jun/i,
  20966. /^jul/i,
  20967. /^ago/i,
  20968. /^sep/i,
  20969. /^oct/i,
  20970. /^nov/i,
  20971. /^dic/i,
  20972. ],
  20973. 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;
  20974. var esDo = moment.defineLocale('es-do', {
  20975. months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(
  20976. '_'
  20977. ),
  20978. monthsShort: function (m, format) {
  20979. if (!m) {
  20980. return monthsShortDot;
  20981. } else if (/-MMM-/.test(format)) {
  20982. return monthsShort[m.month()];
  20983. } else {
  20984. return monthsShortDot[m.month()];
  20985. }
  20986. },
  20987. monthsRegex: monthsRegex,
  20988. monthsShortRegex: monthsRegex,
  20989. monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
  20990. monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
  20991. monthsParse: monthsParse,
  20992. longMonthsParse: monthsParse,
  20993. shortMonthsParse: monthsParse,
  20994. weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  20995. weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  20996. weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  20997. weekdaysParseExact: true,
  20998. longDateFormat: {
  20999. LT: 'h:mm A',
  21000. LTS: 'h:mm:ss A',
  21001. L: 'DD/MM/YYYY',
  21002. LL: 'D [de] MMMM [de] YYYY',
  21003. LLL: 'D [de] MMMM [de] YYYY h:mm A',
  21004. LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A',
  21005. },
  21006. calendar: {
  21007. sameDay: function () {
  21008. return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  21009. },
  21010. nextDay: function () {
  21011. return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  21012. },
  21013. nextWeek: function () {
  21014. return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  21015. },
  21016. lastDay: function () {
  21017. return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  21018. },
  21019. lastWeek: function () {
  21020. return (
  21021. '[el] dddd [pasado a la' +
  21022. (this.hours() !== 1 ? 's' : '') +
  21023. '] LT'
  21024. );
  21025. },
  21026. sameElse: 'L',
  21027. },
  21028. relativeTime: {
  21029. future: 'en %s',
  21030. past: 'hace %s',
  21031. s: 'unos segundos',
  21032. ss: '%d segundos',
  21033. m: 'un minuto',
  21034. mm: '%d minutos',
  21035. h: 'una hora',
  21036. hh: '%d horas',
  21037. d: 'un día',
  21038. dd: '%d días',
  21039. w: 'una semana',
  21040. ww: '%d semanas',
  21041. M: 'un mes',
  21042. MM: '%d meses',
  21043. y: 'un año',
  21044. yy: '%d años',
  21045. },
  21046. dayOfMonthOrdinalParse: /\d{1,2}º/,
  21047. ordinal: '%dº',
  21048. week: {
  21049. dow: 1, // Monday is the first day of the week.
  21050. doy: 4, // The week that contains Jan 4th is the first week of the year.
  21051. },
  21052. });
  21053. return esDo;
  21054. })));
  21055. /***/ }),
  21056. /***/ "./node_modules/moment/locale/es-mx.js":
  21057. /*!*********************************************!*\
  21058. !*** ./node_modules/moment/locale/es-mx.js ***!
  21059. \*********************************************/
  21060. /*! no static exports found */
  21061. /***/ (function(module, exports, __webpack_require__) {
  21062. //! moment.js locale configuration
  21063. //! locale : Spanish (Mexico) [es-mx]
  21064. //! author : JC Franco : https://github.com/jcfranco
  21065. ;(function (global, factory) {
  21066. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  21067. undefined
  21068. }(this, (function (moment) { 'use strict';
  21069. //! moment.js locale configuration
  21070. var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(
  21071. '_'
  21072. ),
  21073. monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
  21074. monthsParse = [
  21075. /^ene/i,
  21076. /^feb/i,
  21077. /^mar/i,
  21078. /^abr/i,
  21079. /^may/i,
  21080. /^jun/i,
  21081. /^jul/i,
  21082. /^ago/i,
  21083. /^sep/i,
  21084. /^oct/i,
  21085. /^nov/i,
  21086. /^dic/i,
  21087. ],
  21088. 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;
  21089. var esMx = moment.defineLocale('es-mx', {
  21090. months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(
  21091. '_'
  21092. ),
  21093. monthsShort: function (m, format) {
  21094. if (!m) {
  21095. return monthsShortDot;
  21096. } else if (/-MMM-/.test(format)) {
  21097. return monthsShort[m.month()];
  21098. } else {
  21099. return monthsShortDot[m.month()];
  21100. }
  21101. },
  21102. monthsRegex: monthsRegex,
  21103. monthsShortRegex: monthsRegex,
  21104. monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
  21105. monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
  21106. monthsParse: monthsParse,
  21107. longMonthsParse: monthsParse,
  21108. shortMonthsParse: monthsParse,
  21109. weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  21110. weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  21111. weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  21112. weekdaysParseExact: true,
  21113. longDateFormat: {
  21114. LT: 'H:mm',
  21115. LTS: 'H:mm:ss',
  21116. L: 'DD/MM/YYYY',
  21117. LL: 'D [de] MMMM [de] YYYY',
  21118. LLL: 'D [de] MMMM [de] YYYY H:mm',
  21119. LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',
  21120. },
  21121. calendar: {
  21122. sameDay: function () {
  21123. return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  21124. },
  21125. nextDay: function () {
  21126. return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  21127. },
  21128. nextWeek: function () {
  21129. return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  21130. },
  21131. lastDay: function () {
  21132. return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  21133. },
  21134. lastWeek: function () {
  21135. return (
  21136. '[el] dddd [pasado a la' +
  21137. (this.hours() !== 1 ? 's' : '') +
  21138. '] LT'
  21139. );
  21140. },
  21141. sameElse: 'L',
  21142. },
  21143. relativeTime: {
  21144. future: 'en %s',
  21145. past: 'hace %s',
  21146. s: 'unos segundos',
  21147. ss: '%d segundos',
  21148. m: 'un minuto',
  21149. mm: '%d minutos',
  21150. h: 'una hora',
  21151. hh: '%d horas',
  21152. d: 'un día',
  21153. dd: '%d días',
  21154. w: 'una semana',
  21155. ww: '%d semanas',
  21156. M: 'un mes',
  21157. MM: '%d meses',
  21158. y: 'un año',
  21159. yy: '%d años',
  21160. },
  21161. dayOfMonthOrdinalParse: /\d{1,2}º/,
  21162. ordinal: '%dº',
  21163. week: {
  21164. dow: 0, // Sunday is the first day of the week.
  21165. doy: 4, // The week that contains Jan 4th is the first week of the year.
  21166. },
  21167. invalidDate: 'Fecha inválida',
  21168. });
  21169. return esMx;
  21170. })));
  21171. /***/ }),
  21172. /***/ "./node_modules/moment/locale/es-us.js":
  21173. /*!*********************************************!*\
  21174. !*** ./node_modules/moment/locale/es-us.js ***!
  21175. \*********************************************/
  21176. /*! no static exports found */
  21177. /***/ (function(module, exports, __webpack_require__) {
  21178. //! moment.js locale configuration
  21179. //! locale : Spanish (United States) [es-us]
  21180. //! author : bustta : https://github.com/bustta
  21181. //! author : chrisrodz : https://github.com/chrisrodz
  21182. ;(function (global, factory) {
  21183. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  21184. undefined
  21185. }(this, (function (moment) { 'use strict';
  21186. //! moment.js locale configuration
  21187. var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(
  21188. '_'
  21189. ),
  21190. monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
  21191. monthsParse = [
  21192. /^ene/i,
  21193. /^feb/i,
  21194. /^mar/i,
  21195. /^abr/i,
  21196. /^may/i,
  21197. /^jun/i,
  21198. /^jul/i,
  21199. /^ago/i,
  21200. /^sep/i,
  21201. /^oct/i,
  21202. /^nov/i,
  21203. /^dic/i,
  21204. ],
  21205. 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;
  21206. var esUs = moment.defineLocale('es-us', {
  21207. months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(
  21208. '_'
  21209. ),
  21210. monthsShort: function (m, format) {
  21211. if (!m) {
  21212. return monthsShortDot;
  21213. } else if (/-MMM-/.test(format)) {
  21214. return monthsShort[m.month()];
  21215. } else {
  21216. return monthsShortDot[m.month()];
  21217. }
  21218. },
  21219. monthsRegex: monthsRegex,
  21220. monthsShortRegex: monthsRegex,
  21221. monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
  21222. monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
  21223. monthsParse: monthsParse,
  21224. longMonthsParse: monthsParse,
  21225. shortMonthsParse: monthsParse,
  21226. weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  21227. weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  21228. weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  21229. weekdaysParseExact: true,
  21230. longDateFormat: {
  21231. LT: 'h:mm A',
  21232. LTS: 'h:mm:ss A',
  21233. L: 'MM/DD/YYYY',
  21234. LL: 'D [de] MMMM [de] YYYY',
  21235. LLL: 'D [de] MMMM [de] YYYY h:mm A',
  21236. LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A',
  21237. },
  21238. calendar: {
  21239. sameDay: function () {
  21240. return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  21241. },
  21242. nextDay: function () {
  21243. return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  21244. },
  21245. nextWeek: function () {
  21246. return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  21247. },
  21248. lastDay: function () {
  21249. return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  21250. },
  21251. lastWeek: function () {
  21252. return (
  21253. '[el] dddd [pasado a la' +
  21254. (this.hours() !== 1 ? 's' : '') +
  21255. '] LT'
  21256. );
  21257. },
  21258. sameElse: 'L',
  21259. },
  21260. relativeTime: {
  21261. future: 'en %s',
  21262. past: 'hace %s',
  21263. s: 'unos segundos',
  21264. ss: '%d segundos',
  21265. m: 'un minuto',
  21266. mm: '%d minutos',
  21267. h: 'una hora',
  21268. hh: '%d horas',
  21269. d: 'un día',
  21270. dd: '%d días',
  21271. w: 'una semana',
  21272. ww: '%d semanas',
  21273. M: 'un mes',
  21274. MM: '%d meses',
  21275. y: 'un año',
  21276. yy: '%d años',
  21277. },
  21278. dayOfMonthOrdinalParse: /\d{1,2}º/,
  21279. ordinal: '%dº',
  21280. week: {
  21281. dow: 0, // Sunday is the first day of the week.
  21282. doy: 6, // The week that contains Jan 6th is the first week of the year.
  21283. },
  21284. });
  21285. return esUs;
  21286. })));
  21287. /***/ }),
  21288. /***/ "./node_modules/moment/locale/es.js":
  21289. /*!******************************************!*\
  21290. !*** ./node_modules/moment/locale/es.js ***!
  21291. \******************************************/
  21292. /*! no static exports found */
  21293. /***/ (function(module, exports, __webpack_require__) {
  21294. //! moment.js locale configuration
  21295. //! locale : Spanish [es]
  21296. //! author : Julio Napurí : https://github.com/julionc
  21297. ;(function (global, factory) {
  21298. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  21299. undefined
  21300. }(this, (function (moment) { 'use strict';
  21301. //! moment.js locale configuration
  21302. var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split(
  21303. '_'
  21304. ),
  21305. monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
  21306. monthsParse = [
  21307. /^ene/i,
  21308. /^feb/i,
  21309. /^mar/i,
  21310. /^abr/i,
  21311. /^may/i,
  21312. /^jun/i,
  21313. /^jul/i,
  21314. /^ago/i,
  21315. /^sep/i,
  21316. /^oct/i,
  21317. /^nov/i,
  21318. /^dic/i,
  21319. ],
  21320. 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;
  21321. var es = moment.defineLocale('es', {
  21322. months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split(
  21323. '_'
  21324. ),
  21325. monthsShort: function (m, format) {
  21326. if (!m) {
  21327. return monthsShortDot;
  21328. } else if (/-MMM-/.test(format)) {
  21329. return monthsShort[m.month()];
  21330. } else {
  21331. return monthsShortDot[m.month()];
  21332. }
  21333. },
  21334. monthsRegex: monthsRegex,
  21335. monthsShortRegex: monthsRegex,
  21336. monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
  21337. monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
  21338. monthsParse: monthsParse,
  21339. longMonthsParse: monthsParse,
  21340. shortMonthsParse: monthsParse,
  21341. weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  21342. weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  21343. weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  21344. weekdaysParseExact: true,
  21345. longDateFormat: {
  21346. LT: 'H:mm',
  21347. LTS: 'H:mm:ss',
  21348. L: 'DD/MM/YYYY',
  21349. LL: 'D [de] MMMM [de] YYYY',
  21350. LLL: 'D [de] MMMM [de] YYYY H:mm',
  21351. LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',
  21352. },
  21353. calendar: {
  21354. sameDay: function () {
  21355. return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  21356. },
  21357. nextDay: function () {
  21358. return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  21359. },
  21360. nextWeek: function () {
  21361. return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  21362. },
  21363. lastDay: function () {
  21364. return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT';
  21365. },
  21366. lastWeek: function () {
  21367. return (
  21368. '[el] dddd [pasado a la' +
  21369. (this.hours() !== 1 ? 's' : '') +
  21370. '] LT'
  21371. );
  21372. },
  21373. sameElse: 'L',
  21374. },
  21375. relativeTime: {
  21376. future: 'en %s',
  21377. past: 'hace %s',
  21378. s: 'unos segundos',
  21379. ss: '%d segundos',
  21380. m: 'un minuto',
  21381. mm: '%d minutos',
  21382. h: 'una hora',
  21383. hh: '%d horas',
  21384. d: 'un día',
  21385. dd: '%d días',
  21386. w: 'una semana',
  21387. ww: '%d semanas',
  21388. M: 'un mes',
  21389. MM: '%d meses',
  21390. y: 'un año',
  21391. yy: '%d años',
  21392. },
  21393. dayOfMonthOrdinalParse: /\d{1,2}º/,
  21394. ordinal: '%dº',
  21395. week: {
  21396. dow: 1, // Monday is the first day of the week.
  21397. doy: 4, // The week that contains Jan 4th is the first week of the year.
  21398. },
  21399. invalidDate: 'Fecha inválida',
  21400. });
  21401. return es;
  21402. })));
  21403. /***/ }),
  21404. /***/ "./node_modules/moment/locale/et.js":
  21405. /*!******************************************!*\
  21406. !*** ./node_modules/moment/locale/et.js ***!
  21407. \******************************************/
  21408. /*! no static exports found */
  21409. /***/ (function(module, exports, __webpack_require__) {
  21410. //! moment.js locale configuration
  21411. //! locale : Estonian [et]
  21412. //! author : Henry Kehlmann : https://github.com/madhenry
  21413. //! improvements : Illimar Tambek : https://github.com/ragulka
  21414. ;(function (global, factory) {
  21415. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  21416. undefined
  21417. }(this, (function (moment) { 'use strict';
  21418. //! moment.js locale configuration
  21419. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  21420. var format = {
  21421. s: ['mõne sekundi', 'mõni sekund', 'paar sekundit'],
  21422. ss: [number + 'sekundi', number + 'sekundit'],
  21423. m: ['ühe minuti', 'üks minut'],
  21424. mm: [number + ' minuti', number + ' minutit'],
  21425. h: ['ühe tunni', 'tund aega', 'üks tund'],
  21426. hh: [number + ' tunni', number + ' tundi'],
  21427. d: ['ühe päeva', 'üks päev'],
  21428. M: ['kuu aja', 'kuu aega', 'üks kuu'],
  21429. MM: [number + ' kuu', number + ' kuud'],
  21430. y: ['ühe aasta', 'aasta', 'üks aasta'],
  21431. yy: [number + ' aasta', number + ' aastat'],
  21432. };
  21433. if (withoutSuffix) {
  21434. return format[key][2] ? format[key][2] : format[key][1];
  21435. }
  21436. return isFuture ? format[key][0] : format[key][1];
  21437. }
  21438. var et = moment.defineLocale('et', {
  21439. months: 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split(
  21440. '_'
  21441. ),
  21442. monthsShort: 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split(
  21443. '_'
  21444. ),
  21445. weekdays: 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split(
  21446. '_'
  21447. ),
  21448. weekdaysShort: 'P_E_T_K_N_R_L'.split('_'),
  21449. weekdaysMin: 'P_E_T_K_N_R_L'.split('_'),
  21450. longDateFormat: {
  21451. LT: 'H:mm',
  21452. LTS: 'H:mm:ss',
  21453. L: 'DD.MM.YYYY',
  21454. LL: 'D. MMMM YYYY',
  21455. LLL: 'D. MMMM YYYY H:mm',
  21456. LLLL: 'dddd, D. MMMM YYYY H:mm',
  21457. },
  21458. calendar: {
  21459. sameDay: '[Täna,] LT',
  21460. nextDay: '[Homme,] LT',
  21461. nextWeek: '[Järgmine] dddd LT',
  21462. lastDay: '[Eile,] LT',
  21463. lastWeek: '[Eelmine] dddd LT',
  21464. sameElse: 'L',
  21465. },
  21466. relativeTime: {
  21467. future: '%s pärast',
  21468. past: '%s tagasi',
  21469. s: processRelativeTime,
  21470. ss: processRelativeTime,
  21471. m: processRelativeTime,
  21472. mm: processRelativeTime,
  21473. h: processRelativeTime,
  21474. hh: processRelativeTime,
  21475. d: processRelativeTime,
  21476. dd: '%d päeva',
  21477. M: processRelativeTime,
  21478. MM: processRelativeTime,
  21479. y: processRelativeTime,
  21480. yy: processRelativeTime,
  21481. },
  21482. dayOfMonthOrdinalParse: /\d{1,2}\./,
  21483. ordinal: '%d.',
  21484. week: {
  21485. dow: 1, // Monday is the first day of the week.
  21486. doy: 4, // The week that contains Jan 4th is the first week of the year.
  21487. },
  21488. });
  21489. return et;
  21490. })));
  21491. /***/ }),
  21492. /***/ "./node_modules/moment/locale/eu.js":
  21493. /*!******************************************!*\
  21494. !*** ./node_modules/moment/locale/eu.js ***!
  21495. \******************************************/
  21496. /*! no static exports found */
  21497. /***/ (function(module, exports, __webpack_require__) {
  21498. //! moment.js locale configuration
  21499. //! locale : Basque [eu]
  21500. //! author : Eneko Illarramendi : https://github.com/eillarra
  21501. ;(function (global, factory) {
  21502. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  21503. undefined
  21504. }(this, (function (moment) { 'use strict';
  21505. //! moment.js locale configuration
  21506. var eu = moment.defineLocale('eu', {
  21507. months: 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split(
  21508. '_'
  21509. ),
  21510. monthsShort: 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split(
  21511. '_'
  21512. ),
  21513. monthsParseExact: true,
  21514. weekdays: 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split(
  21515. '_'
  21516. ),
  21517. weekdaysShort: 'ig._al._ar._az._og._ol._lr.'.split('_'),
  21518. weekdaysMin: 'ig_al_ar_az_og_ol_lr'.split('_'),
  21519. weekdaysParseExact: true,
  21520. longDateFormat: {
  21521. LT: 'HH:mm',
  21522. LTS: 'HH:mm:ss',
  21523. L: 'YYYY-MM-DD',
  21524. LL: 'YYYY[ko] MMMM[ren] D[a]',
  21525. LLL: 'YYYY[ko] MMMM[ren] D[a] HH:mm',
  21526. LLLL: 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm',
  21527. l: 'YYYY-M-D',
  21528. ll: 'YYYY[ko] MMM D[a]',
  21529. lll: 'YYYY[ko] MMM D[a] HH:mm',
  21530. llll: 'ddd, YYYY[ko] MMM D[a] HH:mm',
  21531. },
  21532. calendar: {
  21533. sameDay: '[gaur] LT[etan]',
  21534. nextDay: '[bihar] LT[etan]',
  21535. nextWeek: 'dddd LT[etan]',
  21536. lastDay: '[atzo] LT[etan]',
  21537. lastWeek: '[aurreko] dddd LT[etan]',
  21538. sameElse: 'L',
  21539. },
  21540. relativeTime: {
  21541. future: '%s barru',
  21542. past: 'duela %s',
  21543. s: 'segundo batzuk',
  21544. ss: '%d segundo',
  21545. m: 'minutu bat',
  21546. mm: '%d minutu',
  21547. h: 'ordu bat',
  21548. hh: '%d ordu',
  21549. d: 'egun bat',
  21550. dd: '%d egun',
  21551. M: 'hilabete bat',
  21552. MM: '%d hilabete',
  21553. y: 'urte bat',
  21554. yy: '%d urte',
  21555. },
  21556. dayOfMonthOrdinalParse: /\d{1,2}\./,
  21557. ordinal: '%d.',
  21558. week: {
  21559. dow: 1, // Monday is the first day of the week.
  21560. doy: 7, // The week that contains Jan 7th is the first week of the year.
  21561. },
  21562. });
  21563. return eu;
  21564. })));
  21565. /***/ }),
  21566. /***/ "./node_modules/moment/locale/fa.js":
  21567. /*!******************************************!*\
  21568. !*** ./node_modules/moment/locale/fa.js ***!
  21569. \******************************************/
  21570. /*! no static exports found */
  21571. /***/ (function(module, exports, __webpack_require__) {
  21572. //! moment.js locale configuration
  21573. //! locale : Persian [fa]
  21574. //! author : Ebrahim Byagowi : https://github.com/ebraminio
  21575. ;(function (global, factory) {
  21576. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  21577. undefined
  21578. }(this, (function (moment) { 'use strict';
  21579. //! moment.js locale configuration
  21580. var symbolMap = {
  21581. 1: '۱',
  21582. 2: '۲',
  21583. 3: '۳',
  21584. 4: '۴',
  21585. 5: '۵',
  21586. 6: '۶',
  21587. 7: '۷',
  21588. 8: '۸',
  21589. 9: '۹',
  21590. 0: '۰',
  21591. },
  21592. numberMap = {
  21593. '۱': '1',
  21594. '۲': '2',
  21595. '۳': '3',
  21596. '۴': '4',
  21597. '۵': '5',
  21598. '۶': '6',
  21599. '۷': '7',
  21600. '۸': '8',
  21601. '۹': '9',
  21602. '۰': '0',
  21603. };
  21604. var fa = moment.defineLocale('fa', {
  21605. months: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split(
  21606. '_'
  21607. ),
  21608. monthsShort: 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split(
  21609. '_'
  21610. ),
  21611. weekdays: 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split(
  21612. '_'
  21613. ),
  21614. weekdaysShort: 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split(
  21615. '_'
  21616. ),
  21617. weekdaysMin: 'ی_د_س_چ_پ_ج_ش'.split('_'),
  21618. weekdaysParseExact: true,
  21619. longDateFormat: {
  21620. LT: 'HH:mm',
  21621. LTS: 'HH:mm:ss',
  21622. L: 'DD/MM/YYYY',
  21623. LL: 'D MMMM YYYY',
  21624. LLL: 'D MMMM YYYY HH:mm',
  21625. LLLL: 'dddd, D MMMM YYYY HH:mm',
  21626. },
  21627. meridiemParse: /قبل از ظهر|بعد از ظهر/,
  21628. isPM: function (input) {
  21629. return /بعد از ظهر/.test(input);
  21630. },
  21631. meridiem: function (hour, minute, isLower) {
  21632. if (hour < 12) {
  21633. return 'قبل از ظهر';
  21634. } else {
  21635. return 'بعد از ظهر';
  21636. }
  21637. },
  21638. calendar: {
  21639. sameDay: '[امروز ساعت] LT',
  21640. nextDay: '[فردا ساعت] LT',
  21641. nextWeek: 'dddd [ساعت] LT',
  21642. lastDay: '[دیروز ساعت] LT',
  21643. lastWeek: 'dddd [پیش] [ساعت] LT',
  21644. sameElse: 'L',
  21645. },
  21646. relativeTime: {
  21647. future: 'در %s',
  21648. past: '%s پیش',
  21649. s: 'چند ثانیه',
  21650. ss: '%d ثانیه',
  21651. m: 'یک دقیقه',
  21652. mm: '%d دقیقه',
  21653. h: 'یک ساعت',
  21654. hh: '%d ساعت',
  21655. d: 'یک روز',
  21656. dd: '%d روز',
  21657. M: 'یک ماه',
  21658. MM: '%d ماه',
  21659. y: 'یک سال',
  21660. yy: '%d سال',
  21661. },
  21662. preparse: function (string) {
  21663. return string
  21664. .replace(/[۰-۹]/g, function (match) {
  21665. return numberMap[match];
  21666. })
  21667. .replace(/،/g, ',');
  21668. },
  21669. postformat: function (string) {
  21670. return string
  21671. .replace(/\d/g, function (match) {
  21672. return symbolMap[match];
  21673. })
  21674. .replace(/,/g, '،');
  21675. },
  21676. dayOfMonthOrdinalParse: /\d{1,2}م/,
  21677. ordinal: '%dم',
  21678. week: {
  21679. dow: 6, // Saturday is the first day of the week.
  21680. doy: 12, // The week that contains Jan 12th is the first week of the year.
  21681. },
  21682. });
  21683. return fa;
  21684. })));
  21685. /***/ }),
  21686. /***/ "./node_modules/moment/locale/fi.js":
  21687. /*!******************************************!*\
  21688. !*** ./node_modules/moment/locale/fi.js ***!
  21689. \******************************************/
  21690. /*! no static exports found */
  21691. /***/ (function(module, exports, __webpack_require__) {
  21692. //! moment.js locale configuration
  21693. //! locale : Finnish [fi]
  21694. //! author : Tarmo Aidantausta : https://github.com/bleadof
  21695. ;(function (global, factory) {
  21696. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  21697. undefined
  21698. }(this, (function (moment) { 'use strict';
  21699. //! moment.js locale configuration
  21700. var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(
  21701. ' '
  21702. ),
  21703. numbersFuture = [
  21704. 'nolla',
  21705. 'yhden',
  21706. 'kahden',
  21707. 'kolmen',
  21708. 'neljän',
  21709. 'viiden',
  21710. 'kuuden',
  21711. numbersPast[7],
  21712. numbersPast[8],
  21713. numbersPast[9],
  21714. ];
  21715. function translate(number, withoutSuffix, key, isFuture) {
  21716. var result = '';
  21717. switch (key) {
  21718. case 's':
  21719. return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';
  21720. case 'ss':
  21721. result = isFuture ? 'sekunnin' : 'sekuntia';
  21722. break;
  21723. case 'm':
  21724. return isFuture ? 'minuutin' : 'minuutti';
  21725. case 'mm':
  21726. result = isFuture ? 'minuutin' : 'minuuttia';
  21727. break;
  21728. case 'h':
  21729. return isFuture ? 'tunnin' : 'tunti';
  21730. case 'hh':
  21731. result = isFuture ? 'tunnin' : 'tuntia';
  21732. break;
  21733. case 'd':
  21734. return isFuture ? 'päivän' : 'päivä';
  21735. case 'dd':
  21736. result = isFuture ? 'päivän' : 'päivää';
  21737. break;
  21738. case 'M':
  21739. return isFuture ? 'kuukauden' : 'kuukausi';
  21740. case 'MM':
  21741. result = isFuture ? 'kuukauden' : 'kuukautta';
  21742. break;
  21743. case 'y':
  21744. return isFuture ? 'vuoden' : 'vuosi';
  21745. case 'yy':
  21746. result = isFuture ? 'vuoden' : 'vuotta';
  21747. break;
  21748. }
  21749. result = verbalNumber(number, isFuture) + ' ' + result;
  21750. return result;
  21751. }
  21752. function verbalNumber(number, isFuture) {
  21753. return number < 10
  21754. ? isFuture
  21755. ? numbersFuture[number]
  21756. : numbersPast[number]
  21757. : number;
  21758. }
  21759. var fi = moment.defineLocale('fi', {
  21760. months: 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split(
  21761. '_'
  21762. ),
  21763. monthsShort: 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split(
  21764. '_'
  21765. ),
  21766. weekdays: 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split(
  21767. '_'
  21768. ),
  21769. weekdaysShort: 'su_ma_ti_ke_to_pe_la'.split('_'),
  21770. weekdaysMin: 'su_ma_ti_ke_to_pe_la'.split('_'),
  21771. longDateFormat: {
  21772. LT: 'HH.mm',
  21773. LTS: 'HH.mm.ss',
  21774. L: 'DD.MM.YYYY',
  21775. LL: 'Do MMMM[ta] YYYY',
  21776. LLL: 'Do MMMM[ta] YYYY, [klo] HH.mm',
  21777. LLLL: 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm',
  21778. l: 'D.M.YYYY',
  21779. ll: 'Do MMM YYYY',
  21780. lll: 'Do MMM YYYY, [klo] HH.mm',
  21781. llll: 'ddd, Do MMM YYYY, [klo] HH.mm',
  21782. },
  21783. calendar: {
  21784. sameDay: '[tänään] [klo] LT',
  21785. nextDay: '[huomenna] [klo] LT',
  21786. nextWeek: 'dddd [klo] LT',
  21787. lastDay: '[eilen] [klo] LT',
  21788. lastWeek: '[viime] dddd[na] [klo] LT',
  21789. sameElse: 'L',
  21790. },
  21791. relativeTime: {
  21792. future: '%s päästä',
  21793. past: '%s sitten',
  21794. s: translate,
  21795. ss: translate,
  21796. m: translate,
  21797. mm: translate,
  21798. h: translate,
  21799. hh: translate,
  21800. d: translate,
  21801. dd: translate,
  21802. M: translate,
  21803. MM: translate,
  21804. y: translate,
  21805. yy: translate,
  21806. },
  21807. dayOfMonthOrdinalParse: /\d{1,2}\./,
  21808. ordinal: '%d.',
  21809. week: {
  21810. dow: 1, // Monday is the first day of the week.
  21811. doy: 4, // The week that contains Jan 4th is the first week of the year.
  21812. },
  21813. });
  21814. return fi;
  21815. })));
  21816. /***/ }),
  21817. /***/ "./node_modules/moment/locale/fil.js":
  21818. /*!*******************************************!*\
  21819. !*** ./node_modules/moment/locale/fil.js ***!
  21820. \*******************************************/
  21821. /*! no static exports found */
  21822. /***/ (function(module, exports, __webpack_require__) {
  21823. //! moment.js locale configuration
  21824. //! locale : Filipino [fil]
  21825. //! author : Dan Hagman : https://github.com/hagmandan
  21826. //! author : Matthew Co : https://github.com/matthewdeeco
  21827. ;(function (global, factory) {
  21828. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  21829. undefined
  21830. }(this, (function (moment) { 'use strict';
  21831. //! moment.js locale configuration
  21832. var fil = moment.defineLocale('fil', {
  21833. months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split(
  21834. '_'
  21835. ),
  21836. monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),
  21837. weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split(
  21838. '_'
  21839. ),
  21840. weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),
  21841. weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),
  21842. longDateFormat: {
  21843. LT: 'HH:mm',
  21844. LTS: 'HH:mm:ss',
  21845. L: 'MM/D/YYYY',
  21846. LL: 'MMMM D, YYYY',
  21847. LLL: 'MMMM D, YYYY HH:mm',
  21848. LLLL: 'dddd, MMMM DD, YYYY HH:mm',
  21849. },
  21850. calendar: {
  21851. sameDay: 'LT [ngayong araw]',
  21852. nextDay: '[Bukas ng] LT',
  21853. nextWeek: 'LT [sa susunod na] dddd',
  21854. lastDay: 'LT [kahapon]',
  21855. lastWeek: 'LT [noong nakaraang] dddd',
  21856. sameElse: 'L',
  21857. },
  21858. relativeTime: {
  21859. future: 'sa loob ng %s',
  21860. past: '%s ang nakalipas',
  21861. s: 'ilang segundo',
  21862. ss: '%d segundo',
  21863. m: 'isang minuto',
  21864. mm: '%d minuto',
  21865. h: 'isang oras',
  21866. hh: '%d oras',
  21867. d: 'isang araw',
  21868. dd: '%d araw',
  21869. M: 'isang buwan',
  21870. MM: '%d buwan',
  21871. y: 'isang taon',
  21872. yy: '%d taon',
  21873. },
  21874. dayOfMonthOrdinalParse: /\d{1,2}/,
  21875. ordinal: function (number) {
  21876. return number;
  21877. },
  21878. week: {
  21879. dow: 1, // Monday is the first day of the week.
  21880. doy: 4, // The week that contains Jan 4th is the first week of the year.
  21881. },
  21882. });
  21883. return fil;
  21884. })));
  21885. /***/ }),
  21886. /***/ "./node_modules/moment/locale/fo.js":
  21887. /*!******************************************!*\
  21888. !*** ./node_modules/moment/locale/fo.js ***!
  21889. \******************************************/
  21890. /*! no static exports found */
  21891. /***/ (function(module, exports, __webpack_require__) {
  21892. //! moment.js locale configuration
  21893. //! locale : Faroese [fo]
  21894. //! author : Ragnar Johannesen : https://github.com/ragnar123
  21895. //! author : Kristian Sakarisson : https://github.com/sakarisson
  21896. ;(function (global, factory) {
  21897. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  21898. undefined
  21899. }(this, (function (moment) { 'use strict';
  21900. //! moment.js locale configuration
  21901. var fo = moment.defineLocale('fo', {
  21902. months: 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split(
  21903. '_'
  21904. ),
  21905. monthsShort: 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
  21906. weekdays: 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split(
  21907. '_'
  21908. ),
  21909. weekdaysShort: 'sun_mán_týs_mik_hós_frí_ley'.split('_'),
  21910. weekdaysMin: 'su_má_tý_mi_hó_fr_le'.split('_'),
  21911. longDateFormat: {
  21912. LT: 'HH:mm',
  21913. LTS: 'HH:mm:ss',
  21914. L: 'DD/MM/YYYY',
  21915. LL: 'D MMMM YYYY',
  21916. LLL: 'D MMMM YYYY HH:mm',
  21917. LLLL: 'dddd D. MMMM, YYYY HH:mm',
  21918. },
  21919. calendar: {
  21920. sameDay: '[Í dag kl.] LT',
  21921. nextDay: '[Í morgin kl.] LT',
  21922. nextWeek: 'dddd [kl.] LT',
  21923. lastDay: '[Í gjár kl.] LT',
  21924. lastWeek: '[síðstu] dddd [kl] LT',
  21925. sameElse: 'L',
  21926. },
  21927. relativeTime: {
  21928. future: 'um %s',
  21929. past: '%s síðani',
  21930. s: 'fá sekund',
  21931. ss: '%d sekundir',
  21932. m: 'ein minuttur',
  21933. mm: '%d minuttir',
  21934. h: 'ein tími',
  21935. hh: '%d tímar',
  21936. d: 'ein dagur',
  21937. dd: '%d dagar',
  21938. M: 'ein mánaður',
  21939. MM: '%d mánaðir',
  21940. y: 'eitt ár',
  21941. yy: '%d ár',
  21942. },
  21943. dayOfMonthOrdinalParse: /\d{1,2}\./,
  21944. ordinal: '%d.',
  21945. week: {
  21946. dow: 1, // Monday is the first day of the week.
  21947. doy: 4, // The week that contains Jan 4th is the first week of the year.
  21948. },
  21949. });
  21950. return fo;
  21951. })));
  21952. /***/ }),
  21953. /***/ "./node_modules/moment/locale/fr-ca.js":
  21954. /*!*********************************************!*\
  21955. !*** ./node_modules/moment/locale/fr-ca.js ***!
  21956. \*********************************************/
  21957. /*! no static exports found */
  21958. /***/ (function(module, exports, __webpack_require__) {
  21959. //! moment.js locale configuration
  21960. //! locale : French (Canada) [fr-ca]
  21961. //! author : Jonathan Abourbih : https://github.com/jonbca
  21962. ;(function (global, factory) {
  21963. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  21964. undefined
  21965. }(this, (function (moment) { 'use strict';
  21966. //! moment.js locale configuration
  21967. var frCa = moment.defineLocale('fr-ca', {
  21968. months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(
  21969. '_'
  21970. ),
  21971. monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(
  21972. '_'
  21973. ),
  21974. monthsParseExact: true,
  21975. weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  21976. weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
  21977. weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
  21978. weekdaysParseExact: true,
  21979. longDateFormat: {
  21980. LT: 'HH:mm',
  21981. LTS: 'HH:mm:ss',
  21982. L: 'YYYY-MM-DD',
  21983. LL: 'D MMMM YYYY',
  21984. LLL: 'D MMMM YYYY HH:mm',
  21985. LLLL: 'dddd D MMMM YYYY HH:mm',
  21986. },
  21987. calendar: {
  21988. sameDay: '[Aujourd’hui à] LT',
  21989. nextDay: '[Demain à] LT',
  21990. nextWeek: 'dddd [à] LT',
  21991. lastDay: '[Hier à] LT',
  21992. lastWeek: 'dddd [dernier à] LT',
  21993. sameElse: 'L',
  21994. },
  21995. relativeTime: {
  21996. future: 'dans %s',
  21997. past: 'il y a %s',
  21998. s: 'quelques secondes',
  21999. ss: '%d secondes',
  22000. m: 'une minute',
  22001. mm: '%d minutes',
  22002. h: 'une heure',
  22003. hh: '%d heures',
  22004. d: 'un jour',
  22005. dd: '%d jours',
  22006. M: 'un mois',
  22007. MM: '%d mois',
  22008. y: 'un an',
  22009. yy: '%d ans',
  22010. },
  22011. dayOfMonthOrdinalParse: /\d{1,2}(er|e)/,
  22012. ordinal: function (number, period) {
  22013. switch (period) {
  22014. // Words with masculine grammatical gender: mois, trimestre, jour
  22015. default:
  22016. case 'M':
  22017. case 'Q':
  22018. case 'D':
  22019. case 'DDD':
  22020. case 'd':
  22021. return number + (number === 1 ? 'er' : 'e');
  22022. // Words with feminine grammatical gender: semaine
  22023. case 'w':
  22024. case 'W':
  22025. return number + (number === 1 ? 're' : 'e');
  22026. }
  22027. },
  22028. });
  22029. return frCa;
  22030. })));
  22031. /***/ }),
  22032. /***/ "./node_modules/moment/locale/fr-ch.js":
  22033. /*!*********************************************!*\
  22034. !*** ./node_modules/moment/locale/fr-ch.js ***!
  22035. \*********************************************/
  22036. /*! no static exports found */
  22037. /***/ (function(module, exports, __webpack_require__) {
  22038. //! moment.js locale configuration
  22039. //! locale : French (Switzerland) [fr-ch]
  22040. //! author : Gaspard Bucher : https://github.com/gaspard
  22041. ;(function (global, factory) {
  22042. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  22043. undefined
  22044. }(this, (function (moment) { 'use strict';
  22045. //! moment.js locale configuration
  22046. var frCh = moment.defineLocale('fr-ch', {
  22047. months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(
  22048. '_'
  22049. ),
  22050. monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(
  22051. '_'
  22052. ),
  22053. monthsParseExact: true,
  22054. weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  22055. weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
  22056. weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
  22057. weekdaysParseExact: true,
  22058. longDateFormat: {
  22059. LT: 'HH:mm',
  22060. LTS: 'HH:mm:ss',
  22061. L: 'DD.MM.YYYY',
  22062. LL: 'D MMMM YYYY',
  22063. LLL: 'D MMMM YYYY HH:mm',
  22064. LLLL: 'dddd D MMMM YYYY HH:mm',
  22065. },
  22066. calendar: {
  22067. sameDay: '[Aujourd’hui à] LT',
  22068. nextDay: '[Demain à] LT',
  22069. nextWeek: 'dddd [à] LT',
  22070. lastDay: '[Hier à] LT',
  22071. lastWeek: 'dddd [dernier à] LT',
  22072. sameElse: 'L',
  22073. },
  22074. relativeTime: {
  22075. future: 'dans %s',
  22076. past: 'il y a %s',
  22077. s: 'quelques secondes',
  22078. ss: '%d secondes',
  22079. m: 'une minute',
  22080. mm: '%d minutes',
  22081. h: 'une heure',
  22082. hh: '%d heures',
  22083. d: 'un jour',
  22084. dd: '%d jours',
  22085. M: 'un mois',
  22086. MM: '%d mois',
  22087. y: 'un an',
  22088. yy: '%d ans',
  22089. },
  22090. dayOfMonthOrdinalParse: /\d{1,2}(er|e)/,
  22091. ordinal: function (number, period) {
  22092. switch (period) {
  22093. // Words with masculine grammatical gender: mois, trimestre, jour
  22094. default:
  22095. case 'M':
  22096. case 'Q':
  22097. case 'D':
  22098. case 'DDD':
  22099. case 'd':
  22100. return number + (number === 1 ? 'er' : 'e');
  22101. // Words with feminine grammatical gender: semaine
  22102. case 'w':
  22103. case 'W':
  22104. return number + (number === 1 ? 're' : 'e');
  22105. }
  22106. },
  22107. week: {
  22108. dow: 1, // Monday is the first day of the week.
  22109. doy: 4, // The week that contains Jan 4th is the first week of the year.
  22110. },
  22111. });
  22112. return frCh;
  22113. })));
  22114. /***/ }),
  22115. /***/ "./node_modules/moment/locale/fr.js":
  22116. /*!******************************************!*\
  22117. !*** ./node_modules/moment/locale/fr.js ***!
  22118. \******************************************/
  22119. /*! no static exports found */
  22120. /***/ (function(module, exports, __webpack_require__) {
  22121. //! moment.js locale configuration
  22122. //! locale : French [fr]
  22123. //! author : John Fischer : https://github.com/jfroffice
  22124. ;(function (global, factory) {
  22125. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  22126. undefined
  22127. }(this, (function (moment) { 'use strict';
  22128. //! moment.js locale configuration
  22129. var monthsStrictRegex = /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,
  22130. monthsShortStrictRegex = /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,
  22131. 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,
  22132. monthsParse = [
  22133. /^janv/i,
  22134. /^févr/i,
  22135. /^mars/i,
  22136. /^avr/i,
  22137. /^mai/i,
  22138. /^juin/i,
  22139. /^juil/i,
  22140. /^août/i,
  22141. /^sept/i,
  22142. /^oct/i,
  22143. /^nov/i,
  22144. /^déc/i,
  22145. ];
  22146. var fr = moment.defineLocale('fr', {
  22147. months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(
  22148. '_'
  22149. ),
  22150. monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(
  22151. '_'
  22152. ),
  22153. monthsRegex: monthsRegex,
  22154. monthsShortRegex: monthsRegex,
  22155. monthsStrictRegex: monthsStrictRegex,
  22156. monthsShortStrictRegex: monthsShortStrictRegex,
  22157. monthsParse: monthsParse,
  22158. longMonthsParse: monthsParse,
  22159. shortMonthsParse: monthsParse,
  22160. weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  22161. weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
  22162. weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
  22163. weekdaysParseExact: true,
  22164. longDateFormat: {
  22165. LT: 'HH:mm',
  22166. LTS: 'HH:mm:ss',
  22167. L: 'DD/MM/YYYY',
  22168. LL: 'D MMMM YYYY',
  22169. LLL: 'D MMMM YYYY HH:mm',
  22170. LLLL: 'dddd D MMMM YYYY HH:mm',
  22171. },
  22172. calendar: {
  22173. sameDay: '[Aujourd’hui à] LT',
  22174. nextDay: '[Demain à] LT',
  22175. nextWeek: 'dddd [à] LT',
  22176. lastDay: '[Hier à] LT',
  22177. lastWeek: 'dddd [dernier à] LT',
  22178. sameElse: 'L',
  22179. },
  22180. relativeTime: {
  22181. future: 'dans %s',
  22182. past: 'il y a %s',
  22183. s: 'quelques secondes',
  22184. ss: '%d secondes',
  22185. m: 'une minute',
  22186. mm: '%d minutes',
  22187. h: 'une heure',
  22188. hh: '%d heures',
  22189. d: 'un jour',
  22190. dd: '%d jours',
  22191. w: 'une semaine',
  22192. ww: '%d semaines',
  22193. M: 'un mois',
  22194. MM: '%d mois',
  22195. y: 'un an',
  22196. yy: '%d ans',
  22197. },
  22198. dayOfMonthOrdinalParse: /\d{1,2}(er|)/,
  22199. ordinal: function (number, period) {
  22200. switch (period) {
  22201. // TODO: Return 'e' when day of month > 1. Move this case inside
  22202. // block for masculine words below.
  22203. // See https://github.com/moment/moment/issues/3375
  22204. case 'D':
  22205. return number + (number === 1 ? 'er' : '');
  22206. // Words with masculine grammatical gender: mois, trimestre, jour
  22207. default:
  22208. case 'M':
  22209. case 'Q':
  22210. case 'DDD':
  22211. case 'd':
  22212. return number + (number === 1 ? 'er' : 'e');
  22213. // Words with feminine grammatical gender: semaine
  22214. case 'w':
  22215. case 'W':
  22216. return number + (number === 1 ? 're' : 'e');
  22217. }
  22218. },
  22219. week: {
  22220. dow: 1, // Monday is the first day of the week.
  22221. doy: 4, // The week that contains Jan 4th is the first week of the year.
  22222. },
  22223. });
  22224. return fr;
  22225. })));
  22226. /***/ }),
  22227. /***/ "./node_modules/moment/locale/fy.js":
  22228. /*!******************************************!*\
  22229. !*** ./node_modules/moment/locale/fy.js ***!
  22230. \******************************************/
  22231. /*! no static exports found */
  22232. /***/ (function(module, exports, __webpack_require__) {
  22233. //! moment.js locale configuration
  22234. //! locale : Frisian [fy]
  22235. //! author : Robin van der Vliet : https://github.com/robin0van0der0v
  22236. ;(function (global, factory) {
  22237. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  22238. undefined
  22239. }(this, (function (moment) { 'use strict';
  22240. //! moment.js locale configuration
  22241. var monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split(
  22242. '_'
  22243. ),
  22244. monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split(
  22245. '_'
  22246. );
  22247. var fy = moment.defineLocale('fy', {
  22248. months: 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split(
  22249. '_'
  22250. ),
  22251. monthsShort: function (m, format) {
  22252. if (!m) {
  22253. return monthsShortWithDots;
  22254. } else if (/-MMM-/.test(format)) {
  22255. return monthsShortWithoutDots[m.month()];
  22256. } else {
  22257. return monthsShortWithDots[m.month()];
  22258. }
  22259. },
  22260. monthsParseExact: true,
  22261. weekdays: 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split(
  22262. '_'
  22263. ),
  22264. weekdaysShort: 'si._mo._ti._wo._to._fr._so.'.split('_'),
  22265. weekdaysMin: 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'),
  22266. weekdaysParseExact: true,
  22267. longDateFormat: {
  22268. LT: 'HH:mm',
  22269. LTS: 'HH:mm:ss',
  22270. L: 'DD-MM-YYYY',
  22271. LL: 'D MMMM YYYY',
  22272. LLL: 'D MMMM YYYY HH:mm',
  22273. LLLL: 'dddd D MMMM YYYY HH:mm',
  22274. },
  22275. calendar: {
  22276. sameDay: '[hjoed om] LT',
  22277. nextDay: '[moarn om] LT',
  22278. nextWeek: 'dddd [om] LT',
  22279. lastDay: '[juster om] LT',
  22280. lastWeek: '[ôfrûne] dddd [om] LT',
  22281. sameElse: 'L',
  22282. },
  22283. relativeTime: {
  22284. future: 'oer %s',
  22285. past: '%s lyn',
  22286. s: 'in pear sekonden',
  22287. ss: '%d sekonden',
  22288. m: 'ien minút',
  22289. mm: '%d minuten',
  22290. h: 'ien oere',
  22291. hh: '%d oeren',
  22292. d: 'ien dei',
  22293. dd: '%d dagen',
  22294. M: 'ien moanne',
  22295. MM: '%d moannen',
  22296. y: 'ien jier',
  22297. yy: '%d jierren',
  22298. },
  22299. dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
  22300. ordinal: function (number) {
  22301. return (
  22302. number +
  22303. (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')
  22304. );
  22305. },
  22306. week: {
  22307. dow: 1, // Monday is the first day of the week.
  22308. doy: 4, // The week that contains Jan 4th is the first week of the year.
  22309. },
  22310. });
  22311. return fy;
  22312. })));
  22313. /***/ }),
  22314. /***/ "./node_modules/moment/locale/ga.js":
  22315. /*!******************************************!*\
  22316. !*** ./node_modules/moment/locale/ga.js ***!
  22317. \******************************************/
  22318. /*! no static exports found */
  22319. /***/ (function(module, exports, __webpack_require__) {
  22320. //! moment.js locale configuration
  22321. //! locale : Irish or Irish Gaelic [ga]
  22322. //! author : André Silva : https://github.com/askpt
  22323. ;(function (global, factory) {
  22324. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  22325. undefined
  22326. }(this, (function (moment) { 'use strict';
  22327. //! moment.js locale configuration
  22328. var months = [
  22329. 'Eanáir',
  22330. 'Feabhra',
  22331. 'Márta',
  22332. 'Aibreán',
  22333. 'Bealtaine',
  22334. 'Meitheamh',
  22335. 'Iúil',
  22336. 'Lúnasa',
  22337. 'Meán Fómhair',
  22338. 'Deireadh Fómhair',
  22339. 'Samhain',
  22340. 'Nollaig',
  22341. ],
  22342. monthsShort = [
  22343. 'Ean',
  22344. 'Feabh',
  22345. 'Márt',
  22346. 'Aib',
  22347. 'Beal',
  22348. 'Meith',
  22349. 'Iúil',
  22350. 'Lún',
  22351. 'M.F.',
  22352. 'D.F.',
  22353. 'Samh',
  22354. 'Noll',
  22355. ],
  22356. weekdays = [
  22357. 'Dé Domhnaigh',
  22358. 'Dé Luain',
  22359. 'Dé Máirt',
  22360. 'Dé Céadaoin',
  22361. 'Déardaoin',
  22362. 'Dé hAoine',
  22363. 'Dé Sathairn',
  22364. ],
  22365. weekdaysShort = ['Domh', 'Luan', 'Máirt', 'Céad', 'Déar', 'Aoine', 'Sath'],
  22366. weekdaysMin = ['Do', 'Lu', 'Má', 'Cé', 'Dé', 'A', 'Sa'];
  22367. var ga = moment.defineLocale('ga', {
  22368. months: months,
  22369. monthsShort: monthsShort,
  22370. monthsParseExact: true,
  22371. weekdays: weekdays,
  22372. weekdaysShort: weekdaysShort,
  22373. weekdaysMin: weekdaysMin,
  22374. longDateFormat: {
  22375. LT: 'HH:mm',
  22376. LTS: 'HH:mm:ss',
  22377. L: 'DD/MM/YYYY',
  22378. LL: 'D MMMM YYYY',
  22379. LLL: 'D MMMM YYYY HH:mm',
  22380. LLLL: 'dddd, D MMMM YYYY HH:mm',
  22381. },
  22382. calendar: {
  22383. sameDay: '[Inniu ag] LT',
  22384. nextDay: '[Amárach ag] LT',
  22385. nextWeek: 'dddd [ag] LT',
  22386. lastDay: '[Inné ag] LT',
  22387. lastWeek: 'dddd [seo caite] [ag] LT',
  22388. sameElse: 'L',
  22389. },
  22390. relativeTime: {
  22391. future: 'i %s',
  22392. past: '%s ó shin',
  22393. s: 'cúpla soicind',
  22394. ss: '%d soicind',
  22395. m: 'nóiméad',
  22396. mm: '%d nóiméad',
  22397. h: 'uair an chloig',
  22398. hh: '%d uair an chloig',
  22399. d: 'lá',
  22400. dd: '%d lá',
  22401. M: 'mí',
  22402. MM: '%d míonna',
  22403. y: 'bliain',
  22404. yy: '%d bliain',
  22405. },
  22406. dayOfMonthOrdinalParse: /\d{1,2}(d|na|mh)/,
  22407. ordinal: function (number) {
  22408. var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';
  22409. return number + output;
  22410. },
  22411. week: {
  22412. dow: 1, // Monday is the first day of the week.
  22413. doy: 4, // The week that contains Jan 4th is the first week of the year.
  22414. },
  22415. });
  22416. return ga;
  22417. })));
  22418. /***/ }),
  22419. /***/ "./node_modules/moment/locale/gd.js":
  22420. /*!******************************************!*\
  22421. !*** ./node_modules/moment/locale/gd.js ***!
  22422. \******************************************/
  22423. /*! no static exports found */
  22424. /***/ (function(module, exports, __webpack_require__) {
  22425. //! moment.js locale configuration
  22426. //! locale : Scottish Gaelic [gd]
  22427. //! author : Jon Ashdown : https://github.com/jonashdown
  22428. ;(function (global, factory) {
  22429. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  22430. undefined
  22431. }(this, (function (moment) { 'use strict';
  22432. //! moment.js locale configuration
  22433. var months = [
  22434. 'Am Faoilleach',
  22435. 'An Gearran',
  22436. 'Am Màrt',
  22437. 'An Giblean',
  22438. 'An Cèitean',
  22439. 'An t-Ògmhios',
  22440. 'An t-Iuchar',
  22441. 'An Lùnastal',
  22442. 'An t-Sultain',
  22443. 'An Dàmhair',
  22444. 'An t-Samhain',
  22445. 'An Dùbhlachd',
  22446. ],
  22447. monthsShort = [
  22448. 'Faoi',
  22449. 'Gear',
  22450. 'Màrt',
  22451. 'Gibl',
  22452. 'Cèit',
  22453. 'Ògmh',
  22454. 'Iuch',
  22455. 'Lùn',
  22456. 'Sult',
  22457. 'Dàmh',
  22458. 'Samh',
  22459. 'Dùbh',
  22460. ],
  22461. weekdays = [
  22462. 'Didòmhnaich',
  22463. 'Diluain',
  22464. 'Dimàirt',
  22465. 'Diciadain',
  22466. 'Diardaoin',
  22467. 'Dihaoine',
  22468. 'Disathairne',
  22469. ],
  22470. weekdaysShort = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis'],
  22471. weekdaysMin = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa'];
  22472. var gd = moment.defineLocale('gd', {
  22473. months: months,
  22474. monthsShort: monthsShort,
  22475. monthsParseExact: true,
  22476. weekdays: weekdays,
  22477. weekdaysShort: weekdaysShort,
  22478. weekdaysMin: weekdaysMin,
  22479. longDateFormat: {
  22480. LT: 'HH:mm',
  22481. LTS: 'HH:mm:ss',
  22482. L: 'DD/MM/YYYY',
  22483. LL: 'D MMMM YYYY',
  22484. LLL: 'D MMMM YYYY HH:mm',
  22485. LLLL: 'dddd, D MMMM YYYY HH:mm',
  22486. },
  22487. calendar: {
  22488. sameDay: '[An-diugh aig] LT',
  22489. nextDay: '[A-màireach aig] LT',
  22490. nextWeek: 'dddd [aig] LT',
  22491. lastDay: '[An-dè aig] LT',
  22492. lastWeek: 'dddd [seo chaidh] [aig] LT',
  22493. sameElse: 'L',
  22494. },
  22495. relativeTime: {
  22496. future: 'ann an %s',
  22497. past: 'bho chionn %s',
  22498. s: 'beagan diogan',
  22499. ss: '%d diogan',
  22500. m: 'mionaid',
  22501. mm: '%d mionaidean',
  22502. h: 'uair',
  22503. hh: '%d uairean',
  22504. d: 'latha',
  22505. dd: '%d latha',
  22506. M: 'mìos',
  22507. MM: '%d mìosan',
  22508. y: 'bliadhna',
  22509. yy: '%d bliadhna',
  22510. },
  22511. dayOfMonthOrdinalParse: /\d{1,2}(d|na|mh)/,
  22512. ordinal: function (number) {
  22513. var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh';
  22514. return number + output;
  22515. },
  22516. week: {
  22517. dow: 1, // Monday is the first day of the week.
  22518. doy: 4, // The week that contains Jan 4th is the first week of the year.
  22519. },
  22520. });
  22521. return gd;
  22522. })));
  22523. /***/ }),
  22524. /***/ "./node_modules/moment/locale/gl.js":
  22525. /*!******************************************!*\
  22526. !*** ./node_modules/moment/locale/gl.js ***!
  22527. \******************************************/
  22528. /*! no static exports found */
  22529. /***/ (function(module, exports, __webpack_require__) {
  22530. //! moment.js locale configuration
  22531. //! locale : Galician [gl]
  22532. //! author : Juan G. Hurtado : https://github.com/juanghurtado
  22533. ;(function (global, factory) {
  22534. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  22535. undefined
  22536. }(this, (function (moment) { 'use strict';
  22537. //! moment.js locale configuration
  22538. var gl = moment.defineLocale('gl', {
  22539. months: 'xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro'.split(
  22540. '_'
  22541. ),
  22542. monthsShort: 'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split(
  22543. '_'
  22544. ),
  22545. monthsParseExact: true,
  22546. weekdays: 'domingo_luns_martes_mércores_xoves_venres_sábado'.split('_'),
  22547. weekdaysShort: 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'),
  22548. weekdaysMin: 'do_lu_ma_mé_xo_ve_sá'.split('_'),
  22549. weekdaysParseExact: true,
  22550. longDateFormat: {
  22551. LT: 'H:mm',
  22552. LTS: 'H:mm:ss',
  22553. L: 'DD/MM/YYYY',
  22554. LL: 'D [de] MMMM [de] YYYY',
  22555. LLL: 'D [de] MMMM [de] YYYY H:mm',
  22556. LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm',
  22557. },
  22558. calendar: {
  22559. sameDay: function () {
  22560. return '[hoxe ' + (this.hours() !== 1 ? 'ás' : 'á') + '] LT';
  22561. },
  22562. nextDay: function () {
  22563. return '[mañá ' + (this.hours() !== 1 ? 'ás' : 'á') + '] LT';
  22564. },
  22565. nextWeek: function () {
  22566. return 'dddd [' + (this.hours() !== 1 ? 'ás' : 'a') + '] LT';
  22567. },
  22568. lastDay: function () {
  22569. return '[onte ' + (this.hours() !== 1 ? 'á' : 'a') + '] LT';
  22570. },
  22571. lastWeek: function () {
  22572. return (
  22573. '[o] dddd [pasado ' + (this.hours() !== 1 ? 'ás' : 'a') + '] LT'
  22574. );
  22575. },
  22576. sameElse: 'L',
  22577. },
  22578. relativeTime: {
  22579. future: function (str) {
  22580. if (str.indexOf('un') === 0) {
  22581. return 'n' + str;
  22582. }
  22583. return 'en ' + str;
  22584. },
  22585. past: 'hai %s',
  22586. s: 'uns segundos',
  22587. ss: '%d segundos',
  22588. m: 'un minuto',
  22589. mm: '%d minutos',
  22590. h: 'unha hora',
  22591. hh: '%d horas',
  22592. d: 'un día',
  22593. dd: '%d días',
  22594. M: 'un mes',
  22595. MM: '%d meses',
  22596. y: 'un ano',
  22597. yy: '%d anos',
  22598. },
  22599. dayOfMonthOrdinalParse: /\d{1,2}º/,
  22600. ordinal: '%dº',
  22601. week: {
  22602. dow: 1, // Monday is the first day of the week.
  22603. doy: 4, // The week that contains Jan 4th is the first week of the year.
  22604. },
  22605. });
  22606. return gl;
  22607. })));
  22608. /***/ }),
  22609. /***/ "./node_modules/moment/locale/gom-deva.js":
  22610. /*!************************************************!*\
  22611. !*** ./node_modules/moment/locale/gom-deva.js ***!
  22612. \************************************************/
  22613. /*! no static exports found */
  22614. /***/ (function(module, exports, __webpack_require__) {
  22615. //! moment.js locale configuration
  22616. //! locale : Konkani Devanagari script [gom-deva]
  22617. //! author : The Discoverer : https://github.com/WikiDiscoverer
  22618. ;(function (global, factory) {
  22619. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  22620. undefined
  22621. }(this, (function (moment) { 'use strict';
  22622. //! moment.js locale configuration
  22623. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  22624. var format = {
  22625. s: ['थोडया सॅकंडांनी', 'थोडे सॅकंड'],
  22626. ss: [number + ' सॅकंडांनी', number + ' सॅकंड'],
  22627. m: ['एका मिणटान', 'एक मिनूट'],
  22628. mm: [number + ' मिणटांनी', number + ' मिणटां'],
  22629. h: ['एका वरान', 'एक वर'],
  22630. hh: [number + ' वरांनी', number + ' वरां'],
  22631. d: ['एका दिसान', 'एक दीस'],
  22632. dd: [number + ' दिसांनी', number + ' दीस'],
  22633. M: ['एका म्हयन्यान', 'एक म्हयनो'],
  22634. MM: [number + ' म्हयन्यानी', number + ' म्हयने'],
  22635. y: ['एका वर्सान', 'एक वर्स'],
  22636. yy: [number + ' वर्सांनी', number + ' वर्सां'],
  22637. };
  22638. return isFuture ? format[key][0] : format[key][1];
  22639. }
  22640. var gomDeva = moment.defineLocale('gom-deva', {
  22641. months: {
  22642. standalone: 'जानेवारी_फेब्रुवारी_मार्च_एप्रील_मे_जून_जुलय_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split(
  22643. '_'
  22644. ),
  22645. format: 'जानेवारीच्या_फेब्रुवारीच्या_मार्चाच्या_एप्रीलाच्या_मेयाच्या_जूनाच्या_जुलयाच्या_ऑगस्टाच्या_सप्टेंबराच्या_ऑक्टोबराच्या_नोव्हेंबराच्या_डिसेंबराच्या'.split(
  22646. '_'
  22647. ),
  22648. isFormat: /MMMM(\s)+D[oD]?/,
  22649. },
  22650. monthsShort: 'जाने._फेब्रु._मार्च_एप्री._मे_जून_जुल._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split(
  22651. '_'
  22652. ),
  22653. monthsParseExact: true,
  22654. weekdays: 'आयतार_सोमार_मंगळार_बुधवार_बिरेस्तार_सुक्रार_शेनवार'.split('_'),
  22655. weekdaysShort: 'आयत._सोम._मंगळ._बुध._ब्रेस्त._सुक्र._शेन.'.split('_'),
  22656. weekdaysMin: 'आ_सो_मं_बु_ब्रे_सु_शे'.split('_'),
  22657. weekdaysParseExact: true,
  22658. longDateFormat: {
  22659. LT: 'A h:mm [वाजतां]',
  22660. LTS: 'A h:mm:ss [वाजतां]',
  22661. L: 'DD-MM-YYYY',
  22662. LL: 'D MMMM YYYY',
  22663. LLL: 'D MMMM YYYY A h:mm [वाजतां]',
  22664. LLLL: 'dddd, MMMM Do, YYYY, A h:mm [वाजतां]',
  22665. llll: 'ddd, D MMM YYYY, A h:mm [वाजतां]',
  22666. },
  22667. calendar: {
  22668. sameDay: '[आयज] LT',
  22669. nextDay: '[फाल्यां] LT',
  22670. nextWeek: '[फुडलो] dddd[,] LT',
  22671. lastDay: '[काल] LT',
  22672. lastWeek: '[फाटलो] dddd[,] LT',
  22673. sameElse: 'L',
  22674. },
  22675. relativeTime: {
  22676. future: '%s',
  22677. past: '%s आदीं',
  22678. s: processRelativeTime,
  22679. ss: processRelativeTime,
  22680. m: processRelativeTime,
  22681. mm: processRelativeTime,
  22682. h: processRelativeTime,
  22683. hh: processRelativeTime,
  22684. d: processRelativeTime,
  22685. dd: processRelativeTime,
  22686. M: processRelativeTime,
  22687. MM: processRelativeTime,
  22688. y: processRelativeTime,
  22689. yy: processRelativeTime,
  22690. },
  22691. dayOfMonthOrdinalParse: /\d{1,2}(वेर)/,
  22692. ordinal: function (number, period) {
  22693. switch (period) {
  22694. // the ordinal 'वेर' only applies to day of the month
  22695. case 'D':
  22696. return number + 'वेर';
  22697. default:
  22698. case 'M':
  22699. case 'Q':
  22700. case 'DDD':
  22701. case 'd':
  22702. case 'w':
  22703. case 'W':
  22704. return number;
  22705. }
  22706. },
  22707. week: {
  22708. dow: 0, // Sunday is the first day of the week
  22709. doy: 3, // The week that contains Jan 4th is the first week of the year (7 + 0 - 4)
  22710. },
  22711. meridiemParse: /राती|सकाळीं|दनपारां|सांजे/,
  22712. meridiemHour: function (hour, meridiem) {
  22713. if (hour === 12) {
  22714. hour = 0;
  22715. }
  22716. if (meridiem === 'राती') {
  22717. return hour < 4 ? hour : hour + 12;
  22718. } else if (meridiem === 'सकाळीं') {
  22719. return hour;
  22720. } else if (meridiem === 'दनपारां') {
  22721. return hour > 12 ? hour : hour + 12;
  22722. } else if (meridiem === 'सांजे') {
  22723. return hour + 12;
  22724. }
  22725. },
  22726. meridiem: function (hour, minute, isLower) {
  22727. if (hour < 4) {
  22728. return 'राती';
  22729. } else if (hour < 12) {
  22730. return 'सकाळीं';
  22731. } else if (hour < 16) {
  22732. return 'दनपारां';
  22733. } else if (hour < 20) {
  22734. return 'सांजे';
  22735. } else {
  22736. return 'राती';
  22737. }
  22738. },
  22739. });
  22740. return gomDeva;
  22741. })));
  22742. /***/ }),
  22743. /***/ "./node_modules/moment/locale/gom-latn.js":
  22744. /*!************************************************!*\
  22745. !*** ./node_modules/moment/locale/gom-latn.js ***!
  22746. \************************************************/
  22747. /*! no static exports found */
  22748. /***/ (function(module, exports, __webpack_require__) {
  22749. //! moment.js locale configuration
  22750. //! locale : Konkani Latin script [gom-latn]
  22751. //! author : The Discoverer : https://github.com/WikiDiscoverer
  22752. ;(function (global, factory) {
  22753. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  22754. undefined
  22755. }(this, (function (moment) { 'use strict';
  22756. //! moment.js locale configuration
  22757. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  22758. var format = {
  22759. s: ['thoddea sekondamni', 'thodde sekond'],
  22760. ss: [number + ' sekondamni', number + ' sekond'],
  22761. m: ['eka mintan', 'ek minut'],
  22762. mm: [number + ' mintamni', number + ' mintam'],
  22763. h: ['eka voran', 'ek vor'],
  22764. hh: [number + ' voramni', number + ' voram'],
  22765. d: ['eka disan', 'ek dis'],
  22766. dd: [number + ' disamni', number + ' dis'],
  22767. M: ['eka mhoinean', 'ek mhoino'],
  22768. MM: [number + ' mhoineamni', number + ' mhoine'],
  22769. y: ['eka vorsan', 'ek voros'],
  22770. yy: [number + ' vorsamni', number + ' vorsam'],
  22771. };
  22772. return isFuture ? format[key][0] : format[key][1];
  22773. }
  22774. var gomLatn = moment.defineLocale('gom-latn', {
  22775. months: {
  22776. standalone: 'Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr'.split(
  22777. '_'
  22778. ),
  22779. format: 'Janerachea_Febrerachea_Marsachea_Abrilachea_Maiachea_Junachea_Julaiachea_Agostachea_Setembrachea_Otubrachea_Novembrachea_Dezembrachea'.split(
  22780. '_'
  22781. ),
  22782. isFormat: /MMMM(\s)+D[oD]?/,
  22783. },
  22784. monthsShort: 'Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.'.split(
  22785. '_'
  22786. ),
  22787. monthsParseExact: true,
  22788. weekdays: "Aitar_Somar_Mongllar_Budhvar_Birestar_Sukrar_Son'var".split('_'),
  22789. weekdaysShort: 'Ait._Som._Mon._Bud._Bre._Suk._Son.'.split('_'),
  22790. weekdaysMin: 'Ai_Sm_Mo_Bu_Br_Su_Sn'.split('_'),
  22791. weekdaysParseExact: true,
  22792. longDateFormat: {
  22793. LT: 'A h:mm [vazta]',
  22794. LTS: 'A h:mm:ss [vazta]',
  22795. L: 'DD-MM-YYYY',
  22796. LL: 'D MMMM YYYY',
  22797. LLL: 'D MMMM YYYY A h:mm [vazta]',
  22798. LLLL: 'dddd, MMMM Do, YYYY, A h:mm [vazta]',
  22799. llll: 'ddd, D MMM YYYY, A h:mm [vazta]',
  22800. },
  22801. calendar: {
  22802. sameDay: '[Aiz] LT',
  22803. nextDay: '[Faleam] LT',
  22804. nextWeek: '[Fuddlo] dddd[,] LT',
  22805. lastDay: '[Kal] LT',
  22806. lastWeek: '[Fattlo] dddd[,] LT',
  22807. sameElse: 'L',
  22808. },
  22809. relativeTime: {
  22810. future: '%s',
  22811. past: '%s adim',
  22812. s: processRelativeTime,
  22813. ss: processRelativeTime,
  22814. m: processRelativeTime,
  22815. mm: processRelativeTime,
  22816. h: processRelativeTime,
  22817. hh: processRelativeTime,
  22818. d: processRelativeTime,
  22819. dd: processRelativeTime,
  22820. M: processRelativeTime,
  22821. MM: processRelativeTime,
  22822. y: processRelativeTime,
  22823. yy: processRelativeTime,
  22824. },
  22825. dayOfMonthOrdinalParse: /\d{1,2}(er)/,
  22826. ordinal: function (number, period) {
  22827. switch (period) {
  22828. // the ordinal 'er' only applies to day of the month
  22829. case 'D':
  22830. return number + 'er';
  22831. default:
  22832. case 'M':
  22833. case 'Q':
  22834. case 'DDD':
  22835. case 'd':
  22836. case 'w':
  22837. case 'W':
  22838. return number;
  22839. }
  22840. },
  22841. week: {
  22842. dow: 0, // Sunday is the first day of the week
  22843. doy: 3, // The week that contains Jan 4th is the first week of the year (7 + 0 - 4)
  22844. },
  22845. meridiemParse: /rati|sokallim|donparam|sanje/,
  22846. meridiemHour: function (hour, meridiem) {
  22847. if (hour === 12) {
  22848. hour = 0;
  22849. }
  22850. if (meridiem === 'rati') {
  22851. return hour < 4 ? hour : hour + 12;
  22852. } else if (meridiem === 'sokallim') {
  22853. return hour;
  22854. } else if (meridiem === 'donparam') {
  22855. return hour > 12 ? hour : hour + 12;
  22856. } else if (meridiem === 'sanje') {
  22857. return hour + 12;
  22858. }
  22859. },
  22860. meridiem: function (hour, minute, isLower) {
  22861. if (hour < 4) {
  22862. return 'rati';
  22863. } else if (hour < 12) {
  22864. return 'sokallim';
  22865. } else if (hour < 16) {
  22866. return 'donparam';
  22867. } else if (hour < 20) {
  22868. return 'sanje';
  22869. } else {
  22870. return 'rati';
  22871. }
  22872. },
  22873. });
  22874. return gomLatn;
  22875. })));
  22876. /***/ }),
  22877. /***/ "./node_modules/moment/locale/gu.js":
  22878. /*!******************************************!*\
  22879. !*** ./node_modules/moment/locale/gu.js ***!
  22880. \******************************************/
  22881. /*! no static exports found */
  22882. /***/ (function(module, exports, __webpack_require__) {
  22883. //! moment.js locale configuration
  22884. //! locale : Gujarati [gu]
  22885. //! author : Kaushik Thanki : https://github.com/Kaushik1987
  22886. ;(function (global, factory) {
  22887. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  22888. undefined
  22889. }(this, (function (moment) { 'use strict';
  22890. //! moment.js locale configuration
  22891. var symbolMap = {
  22892. 1: '૧',
  22893. 2: '૨',
  22894. 3: '૩',
  22895. 4: '૪',
  22896. 5: '૫',
  22897. 6: '૬',
  22898. 7: '૭',
  22899. 8: '૮',
  22900. 9: '૯',
  22901. 0: '૦',
  22902. },
  22903. numberMap = {
  22904. '૧': '1',
  22905. '૨': '2',
  22906. '૩': '3',
  22907. '૪': '4',
  22908. '૫': '5',
  22909. '૬': '6',
  22910. '૭': '7',
  22911. '૮': '8',
  22912. '૯': '9',
  22913. '૦': '0',
  22914. };
  22915. var gu = moment.defineLocale('gu', {
  22916. months: 'જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર'.split(
  22917. '_'
  22918. ),
  22919. monthsShort: 'જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.'.split(
  22920. '_'
  22921. ),
  22922. monthsParseExact: true,
  22923. weekdays: 'રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર'.split(
  22924. '_'
  22925. ),
  22926. weekdaysShort: 'રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ'.split('_'),
  22927. weekdaysMin: 'ર_સો_મં_બુ_ગુ_શુ_શ'.split('_'),
  22928. longDateFormat: {
  22929. LT: 'A h:mm વાગ્યે',
  22930. LTS: 'A h:mm:ss વાગ્યે',
  22931. L: 'DD/MM/YYYY',
  22932. LL: 'D MMMM YYYY',
  22933. LLL: 'D MMMM YYYY, A h:mm વાગ્યે',
  22934. LLLL: 'dddd, D MMMM YYYY, A h:mm વાગ્યે',
  22935. },
  22936. calendar: {
  22937. sameDay: '[આજ] LT',
  22938. nextDay: '[કાલે] LT',
  22939. nextWeek: 'dddd, LT',
  22940. lastDay: '[ગઇકાલે] LT',
  22941. lastWeek: '[પાછલા] dddd, LT',
  22942. sameElse: 'L',
  22943. },
  22944. relativeTime: {
  22945. future: '%s મા',
  22946. past: '%s પહેલા',
  22947. s: 'અમુક પળો',
  22948. ss: '%d સેકંડ',
  22949. m: 'એક મિનિટ',
  22950. mm: '%d મિનિટ',
  22951. h: 'એક કલાક',
  22952. hh: '%d કલાક',
  22953. d: 'એક દિવસ',
  22954. dd: '%d દિવસ',
  22955. M: 'એક મહિનો',
  22956. MM: '%d મહિનો',
  22957. y: 'એક વર્ષ',
  22958. yy: '%d વર્ષ',
  22959. },
  22960. preparse: function (string) {
  22961. return string.replace(/[૧૨૩૪૫૬૭૮૯૦]/g, function (match) {
  22962. return numberMap[match];
  22963. });
  22964. },
  22965. postformat: function (string) {
  22966. return string.replace(/\d/g, function (match) {
  22967. return symbolMap[match];
  22968. });
  22969. },
  22970. // Gujarati notation for meridiems are quite fuzzy in practice. While there exists
  22971. // a rigid notion of a 'Pahar' it is not used as rigidly in modern Gujarati.
  22972. meridiemParse: /રાત|બપોર|સવાર|સાંજ/,
  22973. meridiemHour: function (hour, meridiem) {
  22974. if (hour === 12) {
  22975. hour = 0;
  22976. }
  22977. if (meridiem === 'રાત') {
  22978. return hour < 4 ? hour : hour + 12;
  22979. } else if (meridiem === 'સવાર') {
  22980. return hour;
  22981. } else if (meridiem === 'બપોર') {
  22982. return hour >= 10 ? hour : hour + 12;
  22983. } else if (meridiem === 'સાંજ') {
  22984. return hour + 12;
  22985. }
  22986. },
  22987. meridiem: function (hour, minute, isLower) {
  22988. if (hour < 4) {
  22989. return 'રાત';
  22990. } else if (hour < 10) {
  22991. return 'સવાર';
  22992. } else if (hour < 17) {
  22993. return 'બપોર';
  22994. } else if (hour < 20) {
  22995. return 'સાંજ';
  22996. } else {
  22997. return 'રાત';
  22998. }
  22999. },
  23000. week: {
  23001. dow: 0, // Sunday is the first day of the week.
  23002. doy: 6, // The week that contains Jan 6th is the first week of the year.
  23003. },
  23004. });
  23005. return gu;
  23006. })));
  23007. /***/ }),
  23008. /***/ "./node_modules/moment/locale/he.js":
  23009. /*!******************************************!*\
  23010. !*** ./node_modules/moment/locale/he.js ***!
  23011. \******************************************/
  23012. /*! no static exports found */
  23013. /***/ (function(module, exports, __webpack_require__) {
  23014. //! moment.js locale configuration
  23015. //! locale : Hebrew [he]
  23016. //! author : Tomer Cohen : https://github.com/tomer
  23017. //! author : Moshe Simantov : https://github.com/DevelopmentIL
  23018. //! author : Tal Ater : https://github.com/TalAter
  23019. ;(function (global, factory) {
  23020. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  23021. undefined
  23022. }(this, (function (moment) { 'use strict';
  23023. //! moment.js locale configuration
  23024. var he = moment.defineLocale('he', {
  23025. months: 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split(
  23026. '_'
  23027. ),
  23028. monthsShort: 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split(
  23029. '_'
  23030. ),
  23031. weekdays: 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),
  23032. weekdaysShort: 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),
  23033. weekdaysMin: 'א_ב_ג_ד_ה_ו_ש'.split('_'),
  23034. longDateFormat: {
  23035. LT: 'HH:mm',
  23036. LTS: 'HH:mm:ss',
  23037. L: 'DD/MM/YYYY',
  23038. LL: 'D [ב]MMMM YYYY',
  23039. LLL: 'D [ב]MMMM YYYY HH:mm',
  23040. LLLL: 'dddd, D [ב]MMMM YYYY HH:mm',
  23041. l: 'D/M/YYYY',
  23042. ll: 'D MMM YYYY',
  23043. lll: 'D MMM YYYY HH:mm',
  23044. llll: 'ddd, D MMM YYYY HH:mm',
  23045. },
  23046. calendar: {
  23047. sameDay: '[היום ב־]LT',
  23048. nextDay: '[מחר ב־]LT',
  23049. nextWeek: 'dddd [בשעה] LT',
  23050. lastDay: '[אתמול ב־]LT',
  23051. lastWeek: '[ביום] dddd [האחרון בשעה] LT',
  23052. sameElse: 'L',
  23053. },
  23054. relativeTime: {
  23055. future: 'בעוד %s',
  23056. past: 'לפני %s',
  23057. s: 'מספר שניות',
  23058. ss: '%d שניות',
  23059. m: 'דקה',
  23060. mm: '%d דקות',
  23061. h: 'שעה',
  23062. hh: function (number) {
  23063. if (number === 2) {
  23064. return 'שעתיים';
  23065. }
  23066. return number + ' שעות';
  23067. },
  23068. d: 'יום',
  23069. dd: function (number) {
  23070. if (number === 2) {
  23071. return 'יומיים';
  23072. }
  23073. return number + ' ימים';
  23074. },
  23075. M: 'חודש',
  23076. MM: function (number) {
  23077. if (number === 2) {
  23078. return 'חודשיים';
  23079. }
  23080. return number + ' חודשים';
  23081. },
  23082. y: 'שנה',
  23083. yy: function (number) {
  23084. if (number === 2) {
  23085. return 'שנתיים';
  23086. } else if (number % 10 === 0 && number !== 10) {
  23087. return number + ' שנה';
  23088. }
  23089. return number + ' שנים';
  23090. },
  23091. },
  23092. meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,
  23093. isPM: function (input) {
  23094. return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input);
  23095. },
  23096. meridiem: function (hour, minute, isLower) {
  23097. if (hour < 5) {
  23098. return 'לפנות בוקר';
  23099. } else if (hour < 10) {
  23100. return 'בבוקר';
  23101. } else if (hour < 12) {
  23102. return isLower ? 'לפנה"צ' : 'לפני הצהריים';
  23103. } else if (hour < 18) {
  23104. return isLower ? 'אחה"צ' : 'אחרי הצהריים';
  23105. } else {
  23106. return 'בערב';
  23107. }
  23108. },
  23109. });
  23110. return he;
  23111. })));
  23112. /***/ }),
  23113. /***/ "./node_modules/moment/locale/hi.js":
  23114. /*!******************************************!*\
  23115. !*** ./node_modules/moment/locale/hi.js ***!
  23116. \******************************************/
  23117. /*! no static exports found */
  23118. /***/ (function(module, exports, __webpack_require__) {
  23119. //! moment.js locale configuration
  23120. //! locale : Hindi [hi]
  23121. //! author : Mayank Singhal : https://github.com/mayanksinghal
  23122. ;(function (global, factory) {
  23123. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  23124. undefined
  23125. }(this, (function (moment) { 'use strict';
  23126. //! moment.js locale configuration
  23127. var symbolMap = {
  23128. 1: '१',
  23129. 2: '२',
  23130. 3: '३',
  23131. 4: '४',
  23132. 5: '५',
  23133. 6: '६',
  23134. 7: '७',
  23135. 8: '८',
  23136. 9: '९',
  23137. 0: '०',
  23138. },
  23139. numberMap = {
  23140. '१': '1',
  23141. '२': '2',
  23142. '३': '3',
  23143. '४': '4',
  23144. '५': '5',
  23145. '६': '6',
  23146. '७': '7',
  23147. '८': '8',
  23148. '९': '9',
  23149. '०': '0',
  23150. },
  23151. monthsParse = [
  23152. /^जन/i,
  23153. /^फ़र|फर/i,
  23154. /^मार्च/i,
  23155. /^अप्रै/i,
  23156. /^मई/i,
  23157. /^जून/i,
  23158. /^जुल/i,
  23159. /^अग/i,
  23160. /^सितं|सित/i,
  23161. /^अक्टू/i,
  23162. /^नव|नवं/i,
  23163. /^दिसं|दिस/i,
  23164. ],
  23165. shortMonthsParse = [
  23166. /^जन/i,
  23167. /^फ़र/i,
  23168. /^मार्च/i,
  23169. /^अप्रै/i,
  23170. /^मई/i,
  23171. /^जून/i,
  23172. /^जुल/i,
  23173. /^अग/i,
  23174. /^सित/i,
  23175. /^अक्टू/i,
  23176. /^नव/i,
  23177. /^दिस/i,
  23178. ];
  23179. var hi = moment.defineLocale('hi', {
  23180. months: {
  23181. format: 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split(
  23182. '_'
  23183. ),
  23184. standalone: 'जनवरी_फरवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितंबर_अक्टूबर_नवंबर_दिसंबर'.split(
  23185. '_'
  23186. ),
  23187. },
  23188. monthsShort: 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split(
  23189. '_'
  23190. ),
  23191. weekdays: 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
  23192. weekdaysShort: 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),
  23193. weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),
  23194. longDateFormat: {
  23195. LT: 'A h:mm बजे',
  23196. LTS: 'A h:mm:ss बजे',
  23197. L: 'DD/MM/YYYY',
  23198. LL: 'D MMMM YYYY',
  23199. LLL: 'D MMMM YYYY, A h:mm बजे',
  23200. LLLL: 'dddd, D MMMM YYYY, A h:mm बजे',
  23201. },
  23202. monthsParse: monthsParse,
  23203. longMonthsParse: monthsParse,
  23204. shortMonthsParse: shortMonthsParse,
  23205. monthsRegex: /^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,
  23206. monthsShortRegex: /^(जनवरी|जन\.?|फ़रवरी|फरवरी|फ़र\.?|मार्च?|अप्रैल|अप्रै\.?|मई?|जून?|जुलाई|जुल\.?|अगस्त|अग\.?|सितम्बर|सितंबर|सित\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर|नव\.?|दिसम्बर|दिसंबर|दिस\.?)/i,
  23207. monthsStrictRegex: /^(जनवरी?|फ़रवरी|फरवरी?|मार्च?|अप्रैल?|मई?|जून?|जुलाई?|अगस्त?|सितम्बर|सितंबर|सित?\.?|अक्टूबर|अक्टू\.?|नवम्बर|नवंबर?|दिसम्बर|दिसंबर?)/i,
  23208. monthsShortStrictRegex: /^(जन\.?|फ़र\.?|मार्च?|अप्रै\.?|मई?|जून?|जुल\.?|अग\.?|सित\.?|अक्टू\.?|नव\.?|दिस\.?)/i,
  23209. calendar: {
  23210. sameDay: '[आज] LT',
  23211. nextDay: '[कल] LT',
  23212. nextWeek: 'dddd, LT',
  23213. lastDay: '[कल] LT',
  23214. lastWeek: '[पिछले] dddd, LT',
  23215. sameElse: 'L',
  23216. },
  23217. relativeTime: {
  23218. future: '%s में',
  23219. past: '%s पहले',
  23220. s: 'कुछ ही क्षण',
  23221. ss: '%d सेकंड',
  23222. m: 'एक मिनट',
  23223. mm: '%d मिनट',
  23224. h: 'एक घंटा',
  23225. hh: '%d घंटे',
  23226. d: 'एक दिन',
  23227. dd: '%d दिन',
  23228. M: 'एक महीने',
  23229. MM: '%d महीने',
  23230. y: 'एक वर्ष',
  23231. yy: '%d वर्ष',
  23232. },
  23233. preparse: function (string) {
  23234. return string.replace(/[१२३४५६७८९०]/g, function (match) {
  23235. return numberMap[match];
  23236. });
  23237. },
  23238. postformat: function (string) {
  23239. return string.replace(/\d/g, function (match) {
  23240. return symbolMap[match];
  23241. });
  23242. },
  23243. // Hindi notation for meridiems are quite fuzzy in practice. While there exists
  23244. // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.
  23245. meridiemParse: /रात|सुबह|दोपहर|शाम/,
  23246. meridiemHour: function (hour, meridiem) {
  23247. if (hour === 12) {
  23248. hour = 0;
  23249. }
  23250. if (meridiem === 'रात') {
  23251. return hour < 4 ? hour : hour + 12;
  23252. } else if (meridiem === 'सुबह') {
  23253. return hour;
  23254. } else if (meridiem === 'दोपहर') {
  23255. return hour >= 10 ? hour : hour + 12;
  23256. } else if (meridiem === 'शाम') {
  23257. return hour + 12;
  23258. }
  23259. },
  23260. meridiem: function (hour, minute, isLower) {
  23261. if (hour < 4) {
  23262. return 'रात';
  23263. } else if (hour < 10) {
  23264. return 'सुबह';
  23265. } else if (hour < 17) {
  23266. return 'दोपहर';
  23267. } else if (hour < 20) {
  23268. return 'शाम';
  23269. } else {
  23270. return 'रात';
  23271. }
  23272. },
  23273. week: {
  23274. dow: 0, // Sunday is the first day of the week.
  23275. doy: 6, // The week that contains Jan 6th is the first week of the year.
  23276. },
  23277. });
  23278. return hi;
  23279. })));
  23280. /***/ }),
  23281. /***/ "./node_modules/moment/locale/hr.js":
  23282. /*!******************************************!*\
  23283. !*** ./node_modules/moment/locale/hr.js ***!
  23284. \******************************************/
  23285. /*! no static exports found */
  23286. /***/ (function(module, exports, __webpack_require__) {
  23287. //! moment.js locale configuration
  23288. //! locale : Croatian [hr]
  23289. //! author : Bojan Marković : https://github.com/bmarkovic
  23290. ;(function (global, factory) {
  23291. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  23292. undefined
  23293. }(this, (function (moment) { 'use strict';
  23294. //! moment.js locale configuration
  23295. function translate(number, withoutSuffix, key) {
  23296. var result = number + ' ';
  23297. switch (key) {
  23298. case 'ss':
  23299. if (number === 1) {
  23300. result += 'sekunda';
  23301. } else if (number === 2 || number === 3 || number === 4) {
  23302. result += 'sekunde';
  23303. } else {
  23304. result += 'sekundi';
  23305. }
  23306. return result;
  23307. case 'm':
  23308. return withoutSuffix ? 'jedna minuta' : 'jedne minute';
  23309. case 'mm':
  23310. if (number === 1) {
  23311. result += 'minuta';
  23312. } else if (number === 2 || number === 3 || number === 4) {
  23313. result += 'minute';
  23314. } else {
  23315. result += 'minuta';
  23316. }
  23317. return result;
  23318. case 'h':
  23319. return withoutSuffix ? 'jedan sat' : 'jednog sata';
  23320. case 'hh':
  23321. if (number === 1) {
  23322. result += 'sat';
  23323. } else if (number === 2 || number === 3 || number === 4) {
  23324. result += 'sata';
  23325. } else {
  23326. result += 'sati';
  23327. }
  23328. return result;
  23329. case 'dd':
  23330. if (number === 1) {
  23331. result += 'dan';
  23332. } else {
  23333. result += 'dana';
  23334. }
  23335. return result;
  23336. case 'MM':
  23337. if (number === 1) {
  23338. result += 'mjesec';
  23339. } else if (number === 2 || number === 3 || number === 4) {
  23340. result += 'mjeseca';
  23341. } else {
  23342. result += 'mjeseci';
  23343. }
  23344. return result;
  23345. case 'yy':
  23346. if (number === 1) {
  23347. result += 'godina';
  23348. } else if (number === 2 || number === 3 || number === 4) {
  23349. result += 'godine';
  23350. } else {
  23351. result += 'godina';
  23352. }
  23353. return result;
  23354. }
  23355. }
  23356. var hr = moment.defineLocale('hr', {
  23357. months: {
  23358. format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split(
  23359. '_'
  23360. ),
  23361. standalone: 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split(
  23362. '_'
  23363. ),
  23364. },
  23365. monthsShort: 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split(
  23366. '_'
  23367. ),
  23368. monthsParseExact: true,
  23369. weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(
  23370. '_'
  23371. ),
  23372. weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  23373. weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
  23374. weekdaysParseExact: true,
  23375. longDateFormat: {
  23376. LT: 'H:mm',
  23377. LTS: 'H:mm:ss',
  23378. L: 'DD.MM.YYYY',
  23379. LL: 'Do MMMM YYYY',
  23380. LLL: 'Do MMMM YYYY H:mm',
  23381. LLLL: 'dddd, Do MMMM YYYY H:mm',
  23382. },
  23383. calendar: {
  23384. sameDay: '[danas u] LT',
  23385. nextDay: '[sutra u] LT',
  23386. nextWeek: function () {
  23387. switch (this.day()) {
  23388. case 0:
  23389. return '[u] [nedjelju] [u] LT';
  23390. case 3:
  23391. return '[u] [srijedu] [u] LT';
  23392. case 6:
  23393. return '[u] [subotu] [u] LT';
  23394. case 1:
  23395. case 2:
  23396. case 4:
  23397. case 5:
  23398. return '[u] dddd [u] LT';
  23399. }
  23400. },
  23401. lastDay: '[jučer u] LT',
  23402. lastWeek: function () {
  23403. switch (this.day()) {
  23404. case 0:
  23405. return '[prošlu] [nedjelju] [u] LT';
  23406. case 3:
  23407. return '[prošlu] [srijedu] [u] LT';
  23408. case 6:
  23409. return '[prošle] [subote] [u] LT';
  23410. case 1:
  23411. case 2:
  23412. case 4:
  23413. case 5:
  23414. return '[prošli] dddd [u] LT';
  23415. }
  23416. },
  23417. sameElse: 'L',
  23418. },
  23419. relativeTime: {
  23420. future: 'za %s',
  23421. past: 'prije %s',
  23422. s: 'par sekundi',
  23423. ss: translate,
  23424. m: translate,
  23425. mm: translate,
  23426. h: translate,
  23427. hh: translate,
  23428. d: 'dan',
  23429. dd: translate,
  23430. M: 'mjesec',
  23431. MM: translate,
  23432. y: 'godinu',
  23433. yy: translate,
  23434. },
  23435. dayOfMonthOrdinalParse: /\d{1,2}\./,
  23436. ordinal: '%d.',
  23437. week: {
  23438. dow: 1, // Monday is the first day of the week.
  23439. doy: 7, // The week that contains Jan 7th is the first week of the year.
  23440. },
  23441. });
  23442. return hr;
  23443. })));
  23444. /***/ }),
  23445. /***/ "./node_modules/moment/locale/hu.js":
  23446. /*!******************************************!*\
  23447. !*** ./node_modules/moment/locale/hu.js ***!
  23448. \******************************************/
  23449. /*! no static exports found */
  23450. /***/ (function(module, exports, __webpack_require__) {
  23451. //! moment.js locale configuration
  23452. //! locale : Hungarian [hu]
  23453. //! author : Adam Brunner : https://github.com/adambrunner
  23454. //! author : Peter Viszt : https://github.com/passatgt
  23455. ;(function (global, factory) {
  23456. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  23457. undefined
  23458. }(this, (function (moment) { 'use strict';
  23459. //! moment.js locale configuration
  23460. var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(
  23461. ' '
  23462. );
  23463. function translate(number, withoutSuffix, key, isFuture) {
  23464. var num = number;
  23465. switch (key) {
  23466. case 's':
  23467. return isFuture || withoutSuffix
  23468. ? 'néhány másodperc'
  23469. : 'néhány másodperce';
  23470. case 'ss':
  23471. return num + (isFuture || withoutSuffix)
  23472. ? ' másodperc'
  23473. : ' másodperce';
  23474. case 'm':
  23475. return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');
  23476. case 'mm':
  23477. return num + (isFuture || withoutSuffix ? ' perc' : ' perce');
  23478. case 'h':
  23479. return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');
  23480. case 'hh':
  23481. return num + (isFuture || withoutSuffix ? ' óra' : ' órája');
  23482. case 'd':
  23483. return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');
  23484. case 'dd':
  23485. return num + (isFuture || withoutSuffix ? ' nap' : ' napja');
  23486. case 'M':
  23487. return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
  23488. case 'MM':
  23489. return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
  23490. case 'y':
  23491. return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');
  23492. case 'yy':
  23493. return num + (isFuture || withoutSuffix ? ' év' : ' éve');
  23494. }
  23495. return '';
  23496. }
  23497. function week(isFuture) {
  23498. return (
  23499. (isFuture ? '' : '[múlt] ') +
  23500. '[' +
  23501. weekEndings[this.day()] +
  23502. '] LT[-kor]'
  23503. );
  23504. }
  23505. var hu = moment.defineLocale('hu', {
  23506. months: 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split(
  23507. '_'
  23508. ),
  23509. monthsShort: 'jan._feb._márc._ápr._máj._jún._júl._aug._szept._okt._nov._dec.'.split(
  23510. '_'
  23511. ),
  23512. monthsParseExact: true,
  23513. weekdays: 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),
  23514. weekdaysShort: 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),
  23515. weekdaysMin: 'v_h_k_sze_cs_p_szo'.split('_'),
  23516. longDateFormat: {
  23517. LT: 'H:mm',
  23518. LTS: 'H:mm:ss',
  23519. L: 'YYYY.MM.DD.',
  23520. LL: 'YYYY. MMMM D.',
  23521. LLL: 'YYYY. MMMM D. H:mm',
  23522. LLLL: 'YYYY. MMMM D., dddd H:mm',
  23523. },
  23524. meridiemParse: /de|du/i,
  23525. isPM: function (input) {
  23526. return input.charAt(1).toLowerCase() === 'u';
  23527. },
  23528. meridiem: function (hours, minutes, isLower) {
  23529. if (hours < 12) {
  23530. return isLower === true ? 'de' : 'DE';
  23531. } else {
  23532. return isLower === true ? 'du' : 'DU';
  23533. }
  23534. },
  23535. calendar: {
  23536. sameDay: '[ma] LT[-kor]',
  23537. nextDay: '[holnap] LT[-kor]',
  23538. nextWeek: function () {
  23539. return week.call(this, true);
  23540. },
  23541. lastDay: '[tegnap] LT[-kor]',
  23542. lastWeek: function () {
  23543. return week.call(this, false);
  23544. },
  23545. sameElse: 'L',
  23546. },
  23547. relativeTime: {
  23548. future: '%s múlva',
  23549. past: '%s',
  23550. s: translate,
  23551. ss: translate,
  23552. m: translate,
  23553. mm: translate,
  23554. h: translate,
  23555. hh: translate,
  23556. d: translate,
  23557. dd: translate,
  23558. M: translate,
  23559. MM: translate,
  23560. y: translate,
  23561. yy: translate,
  23562. },
  23563. dayOfMonthOrdinalParse: /\d{1,2}\./,
  23564. ordinal: '%d.',
  23565. week: {
  23566. dow: 1, // Monday is the first day of the week.
  23567. doy: 4, // The week that contains Jan 4th is the first week of the year.
  23568. },
  23569. });
  23570. return hu;
  23571. })));
  23572. /***/ }),
  23573. /***/ "./node_modules/moment/locale/hy-am.js":
  23574. /*!*********************************************!*\
  23575. !*** ./node_modules/moment/locale/hy-am.js ***!
  23576. \*********************************************/
  23577. /*! no static exports found */
  23578. /***/ (function(module, exports, __webpack_require__) {
  23579. //! moment.js locale configuration
  23580. //! locale : Armenian [hy-am]
  23581. //! author : Armendarabyan : https://github.com/armendarabyan
  23582. ;(function (global, factory) {
  23583. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  23584. undefined
  23585. }(this, (function (moment) { 'use strict';
  23586. //! moment.js locale configuration
  23587. var hyAm = moment.defineLocale('hy-am', {
  23588. months: {
  23589. format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split(
  23590. '_'
  23591. ),
  23592. standalone: 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split(
  23593. '_'
  23594. ),
  23595. },
  23596. monthsShort: 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'),
  23597. weekdays: 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split(
  23598. '_'
  23599. ),
  23600. weekdaysShort: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
  23601. weekdaysMin: 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'),
  23602. longDateFormat: {
  23603. LT: 'HH:mm',
  23604. LTS: 'HH:mm:ss',
  23605. L: 'DD.MM.YYYY',
  23606. LL: 'D MMMM YYYY թ.',
  23607. LLL: 'D MMMM YYYY թ., HH:mm',
  23608. LLLL: 'dddd, D MMMM YYYY թ., HH:mm',
  23609. },
  23610. calendar: {
  23611. sameDay: '[այսօր] LT',
  23612. nextDay: '[վաղը] LT',
  23613. lastDay: '[երեկ] LT',
  23614. nextWeek: function () {
  23615. return 'dddd [օրը ժամը] LT';
  23616. },
  23617. lastWeek: function () {
  23618. return '[անցած] dddd [օրը ժամը] LT';
  23619. },
  23620. sameElse: 'L',
  23621. },
  23622. relativeTime: {
  23623. future: '%s հետո',
  23624. past: '%s առաջ',
  23625. s: 'մի քանի վայրկյան',
  23626. ss: '%d վայրկյան',
  23627. m: 'րոպե',
  23628. mm: '%d րոպե',
  23629. h: 'ժամ',
  23630. hh: '%d ժամ',
  23631. d: 'օր',
  23632. dd: '%d օր',
  23633. M: 'ամիս',
  23634. MM: '%d ամիս',
  23635. y: 'տարի',
  23636. yy: '%d տարի',
  23637. },
  23638. meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/,
  23639. isPM: function (input) {
  23640. return /^(ցերեկվա|երեկոյան)$/.test(input);
  23641. },
  23642. meridiem: function (hour) {
  23643. if (hour < 4) {
  23644. return 'գիշերվա';
  23645. } else if (hour < 12) {
  23646. return 'առավոտվա';
  23647. } else if (hour < 17) {
  23648. return 'ցերեկվա';
  23649. } else {
  23650. return 'երեկոյան';
  23651. }
  23652. },
  23653. dayOfMonthOrdinalParse: /\d{1,2}|\d{1,2}-(ին|րդ)/,
  23654. ordinal: function (number, period) {
  23655. switch (period) {
  23656. case 'DDD':
  23657. case 'w':
  23658. case 'W':
  23659. case 'DDDo':
  23660. if (number === 1) {
  23661. return number + '-ին';
  23662. }
  23663. return number + '-րդ';
  23664. default:
  23665. return number;
  23666. }
  23667. },
  23668. week: {
  23669. dow: 1, // Monday is the first day of the week.
  23670. doy: 7, // The week that contains Jan 7th is the first week of the year.
  23671. },
  23672. });
  23673. return hyAm;
  23674. })));
  23675. /***/ }),
  23676. /***/ "./node_modules/moment/locale/id.js":
  23677. /*!******************************************!*\
  23678. !*** ./node_modules/moment/locale/id.js ***!
  23679. \******************************************/
  23680. /*! no static exports found */
  23681. /***/ (function(module, exports, __webpack_require__) {
  23682. //! moment.js locale configuration
  23683. //! locale : Indonesian [id]
  23684. //! author : Mohammad Satrio Utomo : https://github.com/tyok
  23685. //! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan
  23686. ;(function (global, factory) {
  23687. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  23688. undefined
  23689. }(this, (function (moment) { 'use strict';
  23690. //! moment.js locale configuration
  23691. var id = moment.defineLocale('id', {
  23692. months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split(
  23693. '_'
  23694. ),
  23695. monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des'.split('_'),
  23696. weekdays: 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),
  23697. weekdaysShort: 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),
  23698. weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),
  23699. longDateFormat: {
  23700. LT: 'HH.mm',
  23701. LTS: 'HH.mm.ss',
  23702. L: 'DD/MM/YYYY',
  23703. LL: 'D MMMM YYYY',
  23704. LLL: 'D MMMM YYYY [pukul] HH.mm',
  23705. LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',
  23706. },
  23707. meridiemParse: /pagi|siang|sore|malam/,
  23708. meridiemHour: function (hour, meridiem) {
  23709. if (hour === 12) {
  23710. hour = 0;
  23711. }
  23712. if (meridiem === 'pagi') {
  23713. return hour;
  23714. } else if (meridiem === 'siang') {
  23715. return hour >= 11 ? hour : hour + 12;
  23716. } else if (meridiem === 'sore' || meridiem === 'malam') {
  23717. return hour + 12;
  23718. }
  23719. },
  23720. meridiem: function (hours, minutes, isLower) {
  23721. if (hours < 11) {
  23722. return 'pagi';
  23723. } else if (hours < 15) {
  23724. return 'siang';
  23725. } else if (hours < 19) {
  23726. return 'sore';
  23727. } else {
  23728. return 'malam';
  23729. }
  23730. },
  23731. calendar: {
  23732. sameDay: '[Hari ini pukul] LT',
  23733. nextDay: '[Besok pukul] LT',
  23734. nextWeek: 'dddd [pukul] LT',
  23735. lastDay: '[Kemarin pukul] LT',
  23736. lastWeek: 'dddd [lalu pukul] LT',
  23737. sameElse: 'L',
  23738. },
  23739. relativeTime: {
  23740. future: 'dalam %s',
  23741. past: '%s yang lalu',
  23742. s: 'beberapa detik',
  23743. ss: '%d detik',
  23744. m: 'semenit',
  23745. mm: '%d menit',
  23746. h: 'sejam',
  23747. hh: '%d jam',
  23748. d: 'sehari',
  23749. dd: '%d hari',
  23750. M: 'sebulan',
  23751. MM: '%d bulan',
  23752. y: 'setahun',
  23753. yy: '%d tahun',
  23754. },
  23755. week: {
  23756. dow: 0, // Sunday is the first day of the week.
  23757. doy: 6, // The week that contains Jan 6th is the first week of the year.
  23758. },
  23759. });
  23760. return id;
  23761. })));
  23762. /***/ }),
  23763. /***/ "./node_modules/moment/locale/is.js":
  23764. /*!******************************************!*\
  23765. !*** ./node_modules/moment/locale/is.js ***!
  23766. \******************************************/
  23767. /*! no static exports found */
  23768. /***/ (function(module, exports, __webpack_require__) {
  23769. //! moment.js locale configuration
  23770. //! locale : Icelandic [is]
  23771. //! author : Hinrik Örn Sigurðsson : https://github.com/hinrik
  23772. ;(function (global, factory) {
  23773. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  23774. undefined
  23775. }(this, (function (moment) { 'use strict';
  23776. //! moment.js locale configuration
  23777. function plural(n) {
  23778. if (n % 100 === 11) {
  23779. return true;
  23780. } else if (n % 10 === 1) {
  23781. return false;
  23782. }
  23783. return true;
  23784. }
  23785. function translate(number, withoutSuffix, key, isFuture) {
  23786. var result = number + ' ';
  23787. switch (key) {
  23788. case 's':
  23789. return withoutSuffix || isFuture
  23790. ? 'nokkrar sekúndur'
  23791. : 'nokkrum sekúndum';
  23792. case 'ss':
  23793. if (plural(number)) {
  23794. return (
  23795. result +
  23796. (withoutSuffix || isFuture ? 'sekúndur' : 'sekúndum')
  23797. );
  23798. }
  23799. return result + 'sekúnda';
  23800. case 'm':
  23801. return withoutSuffix ? 'mínúta' : 'mínútu';
  23802. case 'mm':
  23803. if (plural(number)) {
  23804. return (
  23805. result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum')
  23806. );
  23807. } else if (withoutSuffix) {
  23808. return result + 'mínúta';
  23809. }
  23810. return result + 'mínútu';
  23811. case 'hh':
  23812. if (plural(number)) {
  23813. return (
  23814. result +
  23815. (withoutSuffix || isFuture
  23816. ? 'klukkustundir'
  23817. : 'klukkustundum')
  23818. );
  23819. }
  23820. return result + 'klukkustund';
  23821. case 'd':
  23822. if (withoutSuffix) {
  23823. return 'dagur';
  23824. }
  23825. return isFuture ? 'dag' : 'degi';
  23826. case 'dd':
  23827. if (plural(number)) {
  23828. if (withoutSuffix) {
  23829. return result + 'dagar';
  23830. }
  23831. return result + (isFuture ? 'daga' : 'dögum');
  23832. } else if (withoutSuffix) {
  23833. return result + 'dagur';
  23834. }
  23835. return result + (isFuture ? 'dag' : 'degi');
  23836. case 'M':
  23837. if (withoutSuffix) {
  23838. return 'mánuður';
  23839. }
  23840. return isFuture ? 'mánuð' : 'mánuði';
  23841. case 'MM':
  23842. if (plural(number)) {
  23843. if (withoutSuffix) {
  23844. return result + 'mánuðir';
  23845. }
  23846. return result + (isFuture ? 'mánuði' : 'mánuðum');
  23847. } else if (withoutSuffix) {
  23848. return result + 'mánuður';
  23849. }
  23850. return result + (isFuture ? 'mánuð' : 'mánuði');
  23851. case 'y':
  23852. return withoutSuffix || isFuture ? 'ár' : 'ári';
  23853. case 'yy':
  23854. if (plural(number)) {
  23855. return result + (withoutSuffix || isFuture ? 'ár' : 'árum');
  23856. }
  23857. return result + (withoutSuffix || isFuture ? 'ár' : 'ári');
  23858. }
  23859. }
  23860. var is = moment.defineLocale('is', {
  23861. months: 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split(
  23862. '_'
  23863. ),
  23864. monthsShort: 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'),
  23865. weekdays: 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split(
  23866. '_'
  23867. ),
  23868. weekdaysShort: 'sun_mán_þri_mið_fim_fös_lau'.split('_'),
  23869. weekdaysMin: 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'),
  23870. longDateFormat: {
  23871. LT: 'H:mm',
  23872. LTS: 'H:mm:ss',
  23873. L: 'DD.MM.YYYY',
  23874. LL: 'D. MMMM YYYY',
  23875. LLL: 'D. MMMM YYYY [kl.] H:mm',
  23876. LLLL: 'dddd, D. MMMM YYYY [kl.] H:mm',
  23877. },
  23878. calendar: {
  23879. sameDay: '[í dag kl.] LT',
  23880. nextDay: '[á morgun kl.] LT',
  23881. nextWeek: 'dddd [kl.] LT',
  23882. lastDay: '[í gær kl.] LT',
  23883. lastWeek: '[síðasta] dddd [kl.] LT',
  23884. sameElse: 'L',
  23885. },
  23886. relativeTime: {
  23887. future: 'eftir %s',
  23888. past: 'fyrir %s síðan',
  23889. s: translate,
  23890. ss: translate,
  23891. m: translate,
  23892. mm: translate,
  23893. h: 'klukkustund',
  23894. hh: translate,
  23895. d: translate,
  23896. dd: translate,
  23897. M: translate,
  23898. MM: translate,
  23899. y: translate,
  23900. yy: translate,
  23901. },
  23902. dayOfMonthOrdinalParse: /\d{1,2}\./,
  23903. ordinal: '%d.',
  23904. week: {
  23905. dow: 1, // Monday is the first day of the week.
  23906. doy: 4, // The week that contains Jan 4th is the first week of the year.
  23907. },
  23908. });
  23909. return is;
  23910. })));
  23911. /***/ }),
  23912. /***/ "./node_modules/moment/locale/it-ch.js":
  23913. /*!*********************************************!*\
  23914. !*** ./node_modules/moment/locale/it-ch.js ***!
  23915. \*********************************************/
  23916. /*! no static exports found */
  23917. /***/ (function(module, exports, __webpack_require__) {
  23918. //! moment.js locale configuration
  23919. //! locale : Italian (Switzerland) [it-ch]
  23920. //! author : xfh : https://github.com/xfh
  23921. ;(function (global, factory) {
  23922. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  23923. undefined
  23924. }(this, (function (moment) { 'use strict';
  23925. //! moment.js locale configuration
  23926. var itCh = moment.defineLocale('it-ch', {
  23927. months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split(
  23928. '_'
  23929. ),
  23930. monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
  23931. weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split(
  23932. '_'
  23933. ),
  23934. weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
  23935. weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),
  23936. longDateFormat: {
  23937. LT: 'HH:mm',
  23938. LTS: 'HH:mm:ss',
  23939. L: 'DD.MM.YYYY',
  23940. LL: 'D MMMM YYYY',
  23941. LLL: 'D MMMM YYYY HH:mm',
  23942. LLLL: 'dddd D MMMM YYYY HH:mm',
  23943. },
  23944. calendar: {
  23945. sameDay: '[Oggi alle] LT',
  23946. nextDay: '[Domani alle] LT',
  23947. nextWeek: 'dddd [alle] LT',
  23948. lastDay: '[Ieri alle] LT',
  23949. lastWeek: function () {
  23950. switch (this.day()) {
  23951. case 0:
  23952. return '[la scorsa] dddd [alle] LT';
  23953. default:
  23954. return '[lo scorso] dddd [alle] LT';
  23955. }
  23956. },
  23957. sameElse: 'L',
  23958. },
  23959. relativeTime: {
  23960. future: function (s) {
  23961. return (/^[0-9].+$/.test(s) ? 'tra' : 'in') + ' ' + s;
  23962. },
  23963. past: '%s fa',
  23964. s: 'alcuni secondi',
  23965. ss: '%d secondi',
  23966. m: 'un minuto',
  23967. mm: '%d minuti',
  23968. h: "un'ora",
  23969. hh: '%d ore',
  23970. d: 'un giorno',
  23971. dd: '%d giorni',
  23972. M: 'un mese',
  23973. MM: '%d mesi',
  23974. y: 'un anno',
  23975. yy: '%d anni',
  23976. },
  23977. dayOfMonthOrdinalParse: /\d{1,2}º/,
  23978. ordinal: '%dº',
  23979. week: {
  23980. dow: 1, // Monday is the first day of the week.
  23981. doy: 4, // The week that contains Jan 4th is the first week of the year.
  23982. },
  23983. });
  23984. return itCh;
  23985. })));
  23986. /***/ }),
  23987. /***/ "./node_modules/moment/locale/it.js":
  23988. /*!******************************************!*\
  23989. !*** ./node_modules/moment/locale/it.js ***!
  23990. \******************************************/
  23991. /*! no static exports found */
  23992. /***/ (function(module, exports, __webpack_require__) {
  23993. //! moment.js locale configuration
  23994. //! locale : Italian [it]
  23995. //! author : Lorenzo : https://github.com/aliem
  23996. //! author: Mattia Larentis: https://github.com/nostalgiaz
  23997. //! author: Marco : https://github.com/Manfre98
  23998. ;(function (global, factory) {
  23999. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  24000. undefined
  24001. }(this, (function (moment) { 'use strict';
  24002. //! moment.js locale configuration
  24003. var it = moment.defineLocale('it', {
  24004. months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split(
  24005. '_'
  24006. ),
  24007. monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
  24008. weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split(
  24009. '_'
  24010. ),
  24011. weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
  24012. weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),
  24013. longDateFormat: {
  24014. LT: 'HH:mm',
  24015. LTS: 'HH:mm:ss',
  24016. L: 'DD/MM/YYYY',
  24017. LL: 'D MMMM YYYY',
  24018. LLL: 'D MMMM YYYY HH:mm',
  24019. LLLL: 'dddd D MMMM YYYY HH:mm',
  24020. },
  24021. calendar: {
  24022. sameDay: function () {
  24023. return (
  24024. '[Oggi a' +
  24025. (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") +
  24026. ']LT'
  24027. );
  24028. },
  24029. nextDay: function () {
  24030. return (
  24031. '[Domani a' +
  24032. (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") +
  24033. ']LT'
  24034. );
  24035. },
  24036. nextWeek: function () {
  24037. return (
  24038. 'dddd [a' +
  24039. (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") +
  24040. ']LT'
  24041. );
  24042. },
  24043. lastDay: function () {
  24044. return (
  24045. '[Ieri a' +
  24046. (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") +
  24047. ']LT'
  24048. );
  24049. },
  24050. lastWeek: function () {
  24051. switch (this.day()) {
  24052. case 0:
  24053. return (
  24054. '[La scorsa] dddd [a' +
  24055. (this.hours() > 1
  24056. ? 'lle '
  24057. : this.hours() === 0
  24058. ? ' '
  24059. : "ll'") +
  24060. ']LT'
  24061. );
  24062. default:
  24063. return (
  24064. '[Lo scorso] dddd [a' +
  24065. (this.hours() > 1
  24066. ? 'lle '
  24067. : this.hours() === 0
  24068. ? ' '
  24069. : "ll'") +
  24070. ']LT'
  24071. );
  24072. }
  24073. },
  24074. sameElse: 'L',
  24075. },
  24076. relativeTime: {
  24077. future: 'tra %s',
  24078. past: '%s fa',
  24079. s: 'alcuni secondi',
  24080. ss: '%d secondi',
  24081. m: 'un minuto',
  24082. mm: '%d minuti',
  24083. h: "un'ora",
  24084. hh: '%d ore',
  24085. d: 'un giorno',
  24086. dd: '%d giorni',
  24087. w: 'una settimana',
  24088. ww: '%d settimane',
  24089. M: 'un mese',
  24090. MM: '%d mesi',
  24091. y: 'un anno',
  24092. yy: '%d anni',
  24093. },
  24094. dayOfMonthOrdinalParse: /\d{1,2}º/,
  24095. ordinal: '%dº',
  24096. week: {
  24097. dow: 1, // Monday is the first day of the week.
  24098. doy: 4, // The week that contains Jan 4th is the first week of the year.
  24099. },
  24100. });
  24101. return it;
  24102. })));
  24103. /***/ }),
  24104. /***/ "./node_modules/moment/locale/ja.js":
  24105. /*!******************************************!*\
  24106. !*** ./node_modules/moment/locale/ja.js ***!
  24107. \******************************************/
  24108. /*! no static exports found */
  24109. /***/ (function(module, exports, __webpack_require__) {
  24110. //! moment.js locale configuration
  24111. //! locale : Japanese [ja]
  24112. //! author : LI Long : https://github.com/baryon
  24113. ;(function (global, factory) {
  24114. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  24115. undefined
  24116. }(this, (function (moment) { 'use strict';
  24117. //! moment.js locale configuration
  24118. var ja = moment.defineLocale('ja', {
  24119. eras: [
  24120. {
  24121. since: '2019-05-01',
  24122. offset: 1,
  24123. name: '令和',
  24124. narrow: '㋿',
  24125. abbr: 'R',
  24126. },
  24127. {
  24128. since: '1989-01-08',
  24129. until: '2019-04-30',
  24130. offset: 1,
  24131. name: '平成',
  24132. narrow: '㍻',
  24133. abbr: 'H',
  24134. },
  24135. {
  24136. since: '1926-12-25',
  24137. until: '1989-01-07',
  24138. offset: 1,
  24139. name: '昭和',
  24140. narrow: '㍼',
  24141. abbr: 'S',
  24142. },
  24143. {
  24144. since: '1912-07-30',
  24145. until: '1926-12-24',
  24146. offset: 1,
  24147. name: '大正',
  24148. narrow: '㍽',
  24149. abbr: 'T',
  24150. },
  24151. {
  24152. since: '1873-01-01',
  24153. until: '1912-07-29',
  24154. offset: 6,
  24155. name: '明治',
  24156. narrow: '㍾',
  24157. abbr: 'M',
  24158. },
  24159. {
  24160. since: '0001-01-01',
  24161. until: '1873-12-31',
  24162. offset: 1,
  24163. name: '西暦',
  24164. narrow: 'AD',
  24165. abbr: 'AD',
  24166. },
  24167. {
  24168. since: '0000-12-31',
  24169. until: -Infinity,
  24170. offset: 1,
  24171. name: '紀元前',
  24172. narrow: 'BC',
  24173. abbr: 'BC',
  24174. },
  24175. ],
  24176. eraYearOrdinalRegex: /(元|\d+)年/,
  24177. eraYearOrdinalParse: function (input, match) {
  24178. return match[1] === '元' ? 1 : parseInt(match[1] || input, 10);
  24179. },
  24180. months: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  24181. monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
  24182. '_'
  24183. ),
  24184. weekdays: '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),
  24185. weekdaysShort: '日_月_火_水_木_金_土'.split('_'),
  24186. weekdaysMin: '日_月_火_水_木_金_土'.split('_'),
  24187. longDateFormat: {
  24188. LT: 'HH:mm',
  24189. LTS: 'HH:mm:ss',
  24190. L: 'YYYY/MM/DD',
  24191. LL: 'YYYY年M月D日',
  24192. LLL: 'YYYY年M月D日 HH:mm',
  24193. LLLL: 'YYYY年M月D日 dddd HH:mm',
  24194. l: 'YYYY/MM/DD',
  24195. ll: 'YYYY年M月D日',
  24196. lll: 'YYYY年M月D日 HH:mm',
  24197. llll: 'YYYY年M月D日(ddd) HH:mm',
  24198. },
  24199. meridiemParse: /午前|午後/i,
  24200. isPM: function (input) {
  24201. return input === '午後';
  24202. },
  24203. meridiem: function (hour, minute, isLower) {
  24204. if (hour < 12) {
  24205. return '午前';
  24206. } else {
  24207. return '午後';
  24208. }
  24209. },
  24210. calendar: {
  24211. sameDay: '[今日] LT',
  24212. nextDay: '[明日] LT',
  24213. nextWeek: function (now) {
  24214. if (now.week() !== this.week()) {
  24215. return '[来週]dddd LT';
  24216. } else {
  24217. return 'dddd LT';
  24218. }
  24219. },
  24220. lastDay: '[昨日] LT',
  24221. lastWeek: function (now) {
  24222. if (this.week() !== now.week()) {
  24223. return '[先週]dddd LT';
  24224. } else {
  24225. return 'dddd LT';
  24226. }
  24227. },
  24228. sameElse: 'L',
  24229. },
  24230. dayOfMonthOrdinalParse: /\d{1,2}日/,
  24231. ordinal: function (number, period) {
  24232. switch (period) {
  24233. case 'y':
  24234. return number === 1 ? '元年' : number + '年';
  24235. case 'd':
  24236. case 'D':
  24237. case 'DDD':
  24238. return number + '日';
  24239. default:
  24240. return number;
  24241. }
  24242. },
  24243. relativeTime: {
  24244. future: '%s後',
  24245. past: '%s前',
  24246. s: '数秒',
  24247. ss: '%d秒',
  24248. m: '1分',
  24249. mm: '%d分',
  24250. h: '1時間',
  24251. hh: '%d時間',
  24252. d: '1日',
  24253. dd: '%d日',
  24254. M: '1ヶ月',
  24255. MM: '%dヶ月',
  24256. y: '1年',
  24257. yy: '%d年',
  24258. },
  24259. });
  24260. return ja;
  24261. })));
  24262. /***/ }),
  24263. /***/ "./node_modules/moment/locale/jv.js":
  24264. /*!******************************************!*\
  24265. !*** ./node_modules/moment/locale/jv.js ***!
  24266. \******************************************/
  24267. /*! no static exports found */
  24268. /***/ (function(module, exports, __webpack_require__) {
  24269. //! moment.js locale configuration
  24270. //! locale : Javanese [jv]
  24271. //! author : Rony Lantip : https://github.com/lantip
  24272. //! reference: http://jv.wikipedia.org/wiki/Basa_Jawa
  24273. ;(function (global, factory) {
  24274. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  24275. undefined
  24276. }(this, (function (moment) { 'use strict';
  24277. //! moment.js locale configuration
  24278. var jv = moment.defineLocale('jv', {
  24279. months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split(
  24280. '_'
  24281. ),
  24282. monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'),
  24283. weekdays: 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'),
  24284. weekdaysShort: 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'),
  24285. weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'),
  24286. longDateFormat: {
  24287. LT: 'HH.mm',
  24288. LTS: 'HH.mm.ss',
  24289. L: 'DD/MM/YYYY',
  24290. LL: 'D MMMM YYYY',
  24291. LLL: 'D MMMM YYYY [pukul] HH.mm',
  24292. LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',
  24293. },
  24294. meridiemParse: /enjing|siyang|sonten|ndalu/,
  24295. meridiemHour: function (hour, meridiem) {
  24296. if (hour === 12) {
  24297. hour = 0;
  24298. }
  24299. if (meridiem === 'enjing') {
  24300. return hour;
  24301. } else if (meridiem === 'siyang') {
  24302. return hour >= 11 ? hour : hour + 12;
  24303. } else if (meridiem === 'sonten' || meridiem === 'ndalu') {
  24304. return hour + 12;
  24305. }
  24306. },
  24307. meridiem: function (hours, minutes, isLower) {
  24308. if (hours < 11) {
  24309. return 'enjing';
  24310. } else if (hours < 15) {
  24311. return 'siyang';
  24312. } else if (hours < 19) {
  24313. return 'sonten';
  24314. } else {
  24315. return 'ndalu';
  24316. }
  24317. },
  24318. calendar: {
  24319. sameDay: '[Dinten puniko pukul] LT',
  24320. nextDay: '[Mbenjang pukul] LT',
  24321. nextWeek: 'dddd [pukul] LT',
  24322. lastDay: '[Kala wingi pukul] LT',
  24323. lastWeek: 'dddd [kepengker pukul] LT',
  24324. sameElse: 'L',
  24325. },
  24326. relativeTime: {
  24327. future: 'wonten ing %s',
  24328. past: '%s ingkang kepengker',
  24329. s: 'sawetawis detik',
  24330. ss: '%d detik',
  24331. m: 'setunggal menit',
  24332. mm: '%d menit',
  24333. h: 'setunggal jam',
  24334. hh: '%d jam',
  24335. d: 'sedinten',
  24336. dd: '%d dinten',
  24337. M: 'sewulan',
  24338. MM: '%d wulan',
  24339. y: 'setaun',
  24340. yy: '%d taun',
  24341. },
  24342. week: {
  24343. dow: 1, // Monday is the first day of the week.
  24344. doy: 7, // The week that contains Jan 7th is the first week of the year.
  24345. },
  24346. });
  24347. return jv;
  24348. })));
  24349. /***/ }),
  24350. /***/ "./node_modules/moment/locale/ka.js":
  24351. /*!******************************************!*\
  24352. !*** ./node_modules/moment/locale/ka.js ***!
  24353. \******************************************/
  24354. /*! no static exports found */
  24355. /***/ (function(module, exports, __webpack_require__) {
  24356. //! moment.js locale configuration
  24357. //! locale : Georgian [ka]
  24358. //! author : Irakli Janiashvili : https://github.com/IrakliJani
  24359. ;(function (global, factory) {
  24360. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  24361. undefined
  24362. }(this, (function (moment) { 'use strict';
  24363. //! moment.js locale configuration
  24364. var ka = moment.defineLocale('ka', {
  24365. months: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split(
  24366. '_'
  24367. ),
  24368. monthsShort: 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'),
  24369. weekdays: {
  24370. standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split(
  24371. '_'
  24372. ),
  24373. format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split(
  24374. '_'
  24375. ),
  24376. isFormat: /(წინა|შემდეგ)/,
  24377. },
  24378. weekdaysShort: 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'),
  24379. weekdaysMin: 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'),
  24380. longDateFormat: {
  24381. LT: 'HH:mm',
  24382. LTS: 'HH:mm:ss',
  24383. L: 'DD/MM/YYYY',
  24384. LL: 'D MMMM YYYY',
  24385. LLL: 'D MMMM YYYY HH:mm',
  24386. LLLL: 'dddd, D MMMM YYYY HH:mm',
  24387. },
  24388. calendar: {
  24389. sameDay: '[დღეს] LT[-ზე]',
  24390. nextDay: '[ხვალ] LT[-ზე]',
  24391. lastDay: '[გუშინ] LT[-ზე]',
  24392. nextWeek: '[შემდეგ] dddd LT[-ზე]',
  24393. lastWeek: '[წინა] dddd LT-ზე',
  24394. sameElse: 'L',
  24395. },
  24396. relativeTime: {
  24397. future: function (s) {
  24398. return s.replace(/(წამ|წუთ|საათ|წელ|დღ|თვ)(ი|ე)/, function (
  24399. $0,
  24400. $1,
  24401. $2
  24402. ) {
  24403. return $2 === 'ი' ? $1 + 'ში' : $1 + $2 + 'ში';
  24404. });
  24405. },
  24406. past: function (s) {
  24407. if (/(წამი|წუთი|საათი|დღე|თვე)/.test(s)) {
  24408. return s.replace(/(ი|ე)$/, 'ის წინ');
  24409. }
  24410. if (/წელი/.test(s)) {
  24411. return s.replace(/წელი$/, 'წლის წინ');
  24412. }
  24413. return s;
  24414. },
  24415. s: 'რამდენიმე წამი',
  24416. ss: '%d წამი',
  24417. m: 'წუთი',
  24418. mm: '%d წუთი',
  24419. h: 'საათი',
  24420. hh: '%d საათი',
  24421. d: 'დღე',
  24422. dd: '%d დღე',
  24423. M: 'თვე',
  24424. MM: '%d თვე',
  24425. y: 'წელი',
  24426. yy: '%d წელი',
  24427. },
  24428. dayOfMonthOrdinalParse: /0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/,
  24429. ordinal: function (number) {
  24430. if (number === 0) {
  24431. return number;
  24432. }
  24433. if (number === 1) {
  24434. return number + '-ლი';
  24435. }
  24436. if (
  24437. number < 20 ||
  24438. (number <= 100 && number % 20 === 0) ||
  24439. number % 100 === 0
  24440. ) {
  24441. return 'მე-' + number;
  24442. }
  24443. return number + '-ე';
  24444. },
  24445. week: {
  24446. dow: 1,
  24447. doy: 7,
  24448. },
  24449. });
  24450. return ka;
  24451. })));
  24452. /***/ }),
  24453. /***/ "./node_modules/moment/locale/kk.js":
  24454. /*!******************************************!*\
  24455. !*** ./node_modules/moment/locale/kk.js ***!
  24456. \******************************************/
  24457. /*! no static exports found */
  24458. /***/ (function(module, exports, __webpack_require__) {
  24459. //! moment.js locale configuration
  24460. //! locale : Kazakh [kk]
  24461. //! authors : Nurlan Rakhimzhanov : https://github.com/nurlan
  24462. ;(function (global, factory) {
  24463. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  24464. undefined
  24465. }(this, (function (moment) { 'use strict';
  24466. //! moment.js locale configuration
  24467. var suffixes = {
  24468. 0: '-ші',
  24469. 1: '-ші',
  24470. 2: '-ші',
  24471. 3: '-ші',
  24472. 4: '-ші',
  24473. 5: '-ші',
  24474. 6: '-шы',
  24475. 7: '-ші',
  24476. 8: '-ші',
  24477. 9: '-шы',
  24478. 10: '-шы',
  24479. 20: '-шы',
  24480. 30: '-шы',
  24481. 40: '-шы',
  24482. 50: '-ші',
  24483. 60: '-шы',
  24484. 70: '-ші',
  24485. 80: '-ші',
  24486. 90: '-шы',
  24487. 100: '-ші',
  24488. };
  24489. var kk = moment.defineLocale('kk', {
  24490. months: 'қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан'.split(
  24491. '_'
  24492. ),
  24493. monthsShort: 'қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'),
  24494. weekdays: 'жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі'.split(
  24495. '_'
  24496. ),
  24497. weekdaysShort: 'жек_дүй_сей_сәр_бей_жұм_сен'.split('_'),
  24498. weekdaysMin: 'жк_дй_сй_ср_бй_жм_сн'.split('_'),
  24499. longDateFormat: {
  24500. LT: 'HH:mm',
  24501. LTS: 'HH:mm:ss',
  24502. L: 'DD.MM.YYYY',
  24503. LL: 'D MMMM YYYY',
  24504. LLL: 'D MMMM YYYY HH:mm',
  24505. LLLL: 'dddd, D MMMM YYYY HH:mm',
  24506. },
  24507. calendar: {
  24508. sameDay: '[Бүгін сағат] LT',
  24509. nextDay: '[Ертең сағат] LT',
  24510. nextWeek: 'dddd [сағат] LT',
  24511. lastDay: '[Кеше сағат] LT',
  24512. lastWeek: '[Өткен аптаның] dddd [сағат] LT',
  24513. sameElse: 'L',
  24514. },
  24515. relativeTime: {
  24516. future: '%s ішінде',
  24517. past: '%s бұрын',
  24518. s: 'бірнеше секунд',
  24519. ss: '%d секунд',
  24520. m: 'бір минут',
  24521. mm: '%d минут',
  24522. h: 'бір сағат',
  24523. hh: '%d сағат',
  24524. d: 'бір күн',
  24525. dd: '%d күн',
  24526. M: 'бір ай',
  24527. MM: '%d ай',
  24528. y: 'бір жыл',
  24529. yy: '%d жыл',
  24530. },
  24531. dayOfMonthOrdinalParse: /\d{1,2}-(ші|шы)/,
  24532. ordinal: function (number) {
  24533. var a = number % 10,
  24534. b = number >= 100 ? 100 : null;
  24535. return number + (suffixes[number] || suffixes[a] || suffixes[b]);
  24536. },
  24537. week: {
  24538. dow: 1, // Monday is the first day of the week.
  24539. doy: 7, // The week that contains Jan 7th is the first week of the year.
  24540. },
  24541. });
  24542. return kk;
  24543. })));
  24544. /***/ }),
  24545. /***/ "./node_modules/moment/locale/km.js":
  24546. /*!******************************************!*\
  24547. !*** ./node_modules/moment/locale/km.js ***!
  24548. \******************************************/
  24549. /*! no static exports found */
  24550. /***/ (function(module, exports, __webpack_require__) {
  24551. //! moment.js locale configuration
  24552. //! locale : Cambodian [km]
  24553. //! author : Kruy Vanna : https://github.com/kruyvanna
  24554. ;(function (global, factory) {
  24555. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  24556. undefined
  24557. }(this, (function (moment) { 'use strict';
  24558. //! moment.js locale configuration
  24559. var symbolMap = {
  24560. 1: '១',
  24561. 2: '២',
  24562. 3: '៣',
  24563. 4: '៤',
  24564. 5: '៥',
  24565. 6: '៦',
  24566. 7: '៧',
  24567. 8: '៨',
  24568. 9: '៩',
  24569. 0: '០',
  24570. },
  24571. numberMap = {
  24572. '១': '1',
  24573. '២': '2',
  24574. '៣': '3',
  24575. '៤': '4',
  24576. '៥': '5',
  24577. '៦': '6',
  24578. '៧': '7',
  24579. '៨': '8',
  24580. '៩': '9',
  24581. '០': '0',
  24582. };
  24583. var km = moment.defineLocale('km', {
  24584. months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split(
  24585. '_'
  24586. ),
  24587. monthsShort: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split(
  24588. '_'
  24589. ),
  24590. weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'),
  24591. weekdaysShort: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
  24592. weekdaysMin: 'អា_ច_អ_ព_ព្រ_សុ_ស'.split('_'),
  24593. weekdaysParseExact: true,
  24594. longDateFormat: {
  24595. LT: 'HH:mm',
  24596. LTS: 'HH:mm:ss',
  24597. L: 'DD/MM/YYYY',
  24598. LL: 'D MMMM YYYY',
  24599. LLL: 'D MMMM YYYY HH:mm',
  24600. LLLL: 'dddd, D MMMM YYYY HH:mm',
  24601. },
  24602. meridiemParse: /ព្រឹក|ល្ងាច/,
  24603. isPM: function (input) {
  24604. return input === 'ល្ងាច';
  24605. },
  24606. meridiem: function (hour, minute, isLower) {
  24607. if (hour < 12) {
  24608. return 'ព្រឹក';
  24609. } else {
  24610. return 'ល្ងាច';
  24611. }
  24612. },
  24613. calendar: {
  24614. sameDay: '[ថ្ងៃនេះ ម៉ោង] LT',
  24615. nextDay: '[ស្អែក ម៉ោង] LT',
  24616. nextWeek: 'dddd [ម៉ោង] LT',
  24617. lastDay: '[ម្សិលមិញ ម៉ោង] LT',
  24618. lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT',
  24619. sameElse: 'L',
  24620. },
  24621. relativeTime: {
  24622. future: '%sទៀត',
  24623. past: '%sមុន',
  24624. s: 'ប៉ុន្មានវិនាទី',
  24625. ss: '%d វិនាទី',
  24626. m: 'មួយនាទី',
  24627. mm: '%d នាទី',
  24628. h: 'មួយម៉ោង',
  24629. hh: '%d ម៉ោង',
  24630. d: 'មួយថ្ងៃ',
  24631. dd: '%d ថ្ងៃ',
  24632. M: 'មួយខែ',
  24633. MM: '%d ខែ',
  24634. y: 'មួយឆ្នាំ',
  24635. yy: '%d ឆ្នាំ',
  24636. },
  24637. dayOfMonthOrdinalParse: /ទី\d{1,2}/,
  24638. ordinal: 'ទី%d',
  24639. preparse: function (string) {
  24640. return string.replace(/[១២៣៤៥៦៧៨៩០]/g, function (match) {
  24641. return numberMap[match];
  24642. });
  24643. },
  24644. postformat: function (string) {
  24645. return string.replace(/\d/g, function (match) {
  24646. return symbolMap[match];
  24647. });
  24648. },
  24649. week: {
  24650. dow: 1, // Monday is the first day of the week.
  24651. doy: 4, // The week that contains Jan 4th is the first week of the year.
  24652. },
  24653. });
  24654. return km;
  24655. })));
  24656. /***/ }),
  24657. /***/ "./node_modules/moment/locale/kn.js":
  24658. /*!******************************************!*\
  24659. !*** ./node_modules/moment/locale/kn.js ***!
  24660. \******************************************/
  24661. /*! no static exports found */
  24662. /***/ (function(module, exports, __webpack_require__) {
  24663. //! moment.js locale configuration
  24664. //! locale : Kannada [kn]
  24665. //! author : Rajeev Naik : https://github.com/rajeevnaikte
  24666. ;(function (global, factory) {
  24667. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  24668. undefined
  24669. }(this, (function (moment) { 'use strict';
  24670. //! moment.js locale configuration
  24671. var symbolMap = {
  24672. 1: '೧',
  24673. 2: '೨',
  24674. 3: '೩',
  24675. 4: '೪',
  24676. 5: '೫',
  24677. 6: '೬',
  24678. 7: '೭',
  24679. 8: '೮',
  24680. 9: '೯',
  24681. 0: '೦',
  24682. },
  24683. numberMap = {
  24684. '೧': '1',
  24685. '೨': '2',
  24686. '೩': '3',
  24687. '೪': '4',
  24688. '೫': '5',
  24689. '೬': '6',
  24690. '೭': '7',
  24691. '೮': '8',
  24692. '೯': '9',
  24693. '೦': '0',
  24694. };
  24695. var kn = moment.defineLocale('kn', {
  24696. months: 'ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್'.split(
  24697. '_'
  24698. ),
  24699. monthsShort: 'ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ'.split(
  24700. '_'
  24701. ),
  24702. monthsParseExact: true,
  24703. weekdays: 'ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ'.split(
  24704. '_'
  24705. ),
  24706. weekdaysShort: 'ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ'.split('_'),
  24707. weekdaysMin: 'ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ'.split('_'),
  24708. longDateFormat: {
  24709. LT: 'A h:mm',
  24710. LTS: 'A h:mm:ss',
  24711. L: 'DD/MM/YYYY',
  24712. LL: 'D MMMM YYYY',
  24713. LLL: 'D MMMM YYYY, A h:mm',
  24714. LLLL: 'dddd, D MMMM YYYY, A h:mm',
  24715. },
  24716. calendar: {
  24717. sameDay: '[ಇಂದು] LT',
  24718. nextDay: '[ನಾಳೆ] LT',
  24719. nextWeek: 'dddd, LT',
  24720. lastDay: '[ನಿನ್ನೆ] LT',
  24721. lastWeek: '[ಕೊನೆಯ] dddd, LT',
  24722. sameElse: 'L',
  24723. },
  24724. relativeTime: {
  24725. future: '%s ನಂತರ',
  24726. past: '%s ಹಿಂದೆ',
  24727. s: 'ಕೆಲವು ಕ್ಷಣಗಳು',
  24728. ss: '%d ಸೆಕೆಂಡುಗಳು',
  24729. m: 'ಒಂದು ನಿಮಿಷ',
  24730. mm: '%d ನಿಮಿಷ',
  24731. h: 'ಒಂದು ಗಂಟೆ',
  24732. hh: '%d ಗಂಟೆ',
  24733. d: 'ಒಂದು ದಿನ',
  24734. dd: '%d ದಿನ',
  24735. M: 'ಒಂದು ತಿಂಗಳು',
  24736. MM: '%d ತಿಂಗಳು',
  24737. y: 'ಒಂದು ವರ್ಷ',
  24738. yy: '%d ವರ್ಷ',
  24739. },
  24740. preparse: function (string) {
  24741. return string.replace(/[೧೨೩೪೫೬೭೮೯೦]/g, function (match) {
  24742. return numberMap[match];
  24743. });
  24744. },
  24745. postformat: function (string) {
  24746. return string.replace(/\d/g, function (match) {
  24747. return symbolMap[match];
  24748. });
  24749. },
  24750. meridiemParse: /ರಾತ್ರಿ|ಬೆಳಿಗ್ಗೆ|ಮಧ್ಯಾಹ್ನ|ಸಂಜೆ/,
  24751. meridiemHour: function (hour, meridiem) {
  24752. if (hour === 12) {
  24753. hour = 0;
  24754. }
  24755. if (meridiem === 'ರಾತ್ರಿ') {
  24756. return hour < 4 ? hour : hour + 12;
  24757. } else if (meridiem === 'ಬೆಳಿಗ್ಗೆ') {
  24758. return hour;
  24759. } else if (meridiem === 'ಮಧ್ಯಾಹ್ನ') {
  24760. return hour >= 10 ? hour : hour + 12;
  24761. } else if (meridiem === 'ಸಂಜೆ') {
  24762. return hour + 12;
  24763. }
  24764. },
  24765. meridiem: function (hour, minute, isLower) {
  24766. if (hour < 4) {
  24767. return 'ರಾತ್ರಿ';
  24768. } else if (hour < 10) {
  24769. return 'ಬೆಳಿಗ್ಗೆ';
  24770. } else if (hour < 17) {
  24771. return 'ಮಧ್ಯಾಹ್ನ';
  24772. } else if (hour < 20) {
  24773. return 'ಸಂಜೆ';
  24774. } else {
  24775. return 'ರಾತ್ರಿ';
  24776. }
  24777. },
  24778. dayOfMonthOrdinalParse: /\d{1,2}(ನೇ)/,
  24779. ordinal: function (number) {
  24780. return number + 'ನೇ';
  24781. },
  24782. week: {
  24783. dow: 0, // Sunday is the first day of the week.
  24784. doy: 6, // The week that contains Jan 6th is the first week of the year.
  24785. },
  24786. });
  24787. return kn;
  24788. })));
  24789. /***/ }),
  24790. /***/ "./node_modules/moment/locale/ko.js":
  24791. /*!******************************************!*\
  24792. !*** ./node_modules/moment/locale/ko.js ***!
  24793. \******************************************/
  24794. /*! no static exports found */
  24795. /***/ (function(module, exports, __webpack_require__) {
  24796. //! moment.js locale configuration
  24797. //! locale : Korean [ko]
  24798. //! author : Kyungwook, Park : https://github.com/kyungw00k
  24799. //! author : Jeeeyul Lee <jeeeyul@gmail.com>
  24800. ;(function (global, factory) {
  24801. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  24802. undefined
  24803. }(this, (function (moment) { 'use strict';
  24804. //! moment.js locale configuration
  24805. var ko = moment.defineLocale('ko', {
  24806. months: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
  24807. monthsShort: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split(
  24808. '_'
  24809. ),
  24810. weekdays: '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),
  24811. weekdaysShort: '일_월_화_수_목_금_토'.split('_'),
  24812. weekdaysMin: '일_월_화_수_목_금_토'.split('_'),
  24813. longDateFormat: {
  24814. LT: 'A h:mm',
  24815. LTS: 'A h:mm:ss',
  24816. L: 'YYYY.MM.DD.',
  24817. LL: 'YYYY년 MMMM D일',
  24818. LLL: 'YYYY년 MMMM D일 A h:mm',
  24819. LLLL: 'YYYY년 MMMM D일 dddd A h:mm',
  24820. l: 'YYYY.MM.DD.',
  24821. ll: 'YYYY년 MMMM D일',
  24822. lll: 'YYYY년 MMMM D일 A h:mm',
  24823. llll: 'YYYY년 MMMM D일 dddd A h:mm',
  24824. },
  24825. calendar: {
  24826. sameDay: '오늘 LT',
  24827. nextDay: '내일 LT',
  24828. nextWeek: 'dddd LT',
  24829. lastDay: '어제 LT',
  24830. lastWeek: '지난주 dddd LT',
  24831. sameElse: 'L',
  24832. },
  24833. relativeTime: {
  24834. future: '%s 후',
  24835. past: '%s 전',
  24836. s: '몇 초',
  24837. ss: '%d초',
  24838. m: '1분',
  24839. mm: '%d분',
  24840. h: '한 시간',
  24841. hh: '%d시간',
  24842. d: '하루',
  24843. dd: '%d일',
  24844. M: '한 달',
  24845. MM: '%d달',
  24846. y: '일 년',
  24847. yy: '%d년',
  24848. },
  24849. dayOfMonthOrdinalParse: /\d{1,2}(일|월|주)/,
  24850. ordinal: function (number, period) {
  24851. switch (period) {
  24852. case 'd':
  24853. case 'D':
  24854. case 'DDD':
  24855. return number + '일';
  24856. case 'M':
  24857. return number + '월';
  24858. case 'w':
  24859. case 'W':
  24860. return number + '주';
  24861. default:
  24862. return number;
  24863. }
  24864. },
  24865. meridiemParse: /오전|오후/,
  24866. isPM: function (token) {
  24867. return token === '오후';
  24868. },
  24869. meridiem: function (hour, minute, isUpper) {
  24870. return hour < 12 ? '오전' : '오후';
  24871. },
  24872. });
  24873. return ko;
  24874. })));
  24875. /***/ }),
  24876. /***/ "./node_modules/moment/locale/ku.js":
  24877. /*!******************************************!*\
  24878. !*** ./node_modules/moment/locale/ku.js ***!
  24879. \******************************************/
  24880. /*! no static exports found */
  24881. /***/ (function(module, exports, __webpack_require__) {
  24882. //! moment.js locale configuration
  24883. //! locale : Kurdish [ku]
  24884. //! author : Shahram Mebashar : https://github.com/ShahramMebashar
  24885. ;(function (global, factory) {
  24886. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  24887. undefined
  24888. }(this, (function (moment) { 'use strict';
  24889. //! moment.js locale configuration
  24890. var symbolMap = {
  24891. 1: '١',
  24892. 2: '٢',
  24893. 3: '٣',
  24894. 4: '٤',
  24895. 5: '٥',
  24896. 6: '٦',
  24897. 7: '٧',
  24898. 8: '٨',
  24899. 9: '٩',
  24900. 0: '٠',
  24901. },
  24902. numberMap = {
  24903. '١': '1',
  24904. '٢': '2',
  24905. '٣': '3',
  24906. '٤': '4',
  24907. '٥': '5',
  24908. '٦': '6',
  24909. '٧': '7',
  24910. '٨': '8',
  24911. '٩': '9',
  24912. '٠': '0',
  24913. },
  24914. months = [
  24915. 'کانونی دووەم',
  24916. 'شوبات',
  24917. 'ئازار',
  24918. 'نیسان',
  24919. 'ئایار',
  24920. 'حوزەیران',
  24921. 'تەمموز',
  24922. 'ئاب',
  24923. 'ئەیلوول',
  24924. 'تشرینی یەكەم',
  24925. 'تشرینی دووەم',
  24926. 'كانونی یەکەم',
  24927. ];
  24928. var ku = moment.defineLocale('ku', {
  24929. months: months,
  24930. monthsShort: months,
  24931. weekdays: 'یه‌كشه‌ممه‌_دووشه‌ممه‌_سێشه‌ممه‌_چوارشه‌ممه‌_پێنجشه‌ممه‌_هه‌ینی_شه‌ممه‌'.split(
  24932. '_'
  24933. ),
  24934. weekdaysShort: 'یه‌كشه‌م_دووشه‌م_سێشه‌م_چوارشه‌م_پێنجشه‌م_هه‌ینی_شه‌ممه‌'.split(
  24935. '_'
  24936. ),
  24937. weekdaysMin: 'ی_د_س_چ_پ_ه_ش'.split('_'),
  24938. weekdaysParseExact: true,
  24939. longDateFormat: {
  24940. LT: 'HH:mm',
  24941. LTS: 'HH:mm:ss',
  24942. L: 'DD/MM/YYYY',
  24943. LL: 'D MMMM YYYY',
  24944. LLL: 'D MMMM YYYY HH:mm',
  24945. LLLL: 'dddd, D MMMM YYYY HH:mm',
  24946. },
  24947. meridiemParse: /ئێواره‌|به‌یانی/,
  24948. isPM: function (input) {
  24949. return /ئێواره‌/.test(input);
  24950. },
  24951. meridiem: function (hour, minute, isLower) {
  24952. if (hour < 12) {
  24953. return 'به‌یانی';
  24954. } else {
  24955. return 'ئێواره‌';
  24956. }
  24957. },
  24958. calendar: {
  24959. sameDay: '[ئه‌مرۆ كاتژمێر] LT',
  24960. nextDay: '[به‌یانی كاتژمێر] LT',
  24961. nextWeek: 'dddd [كاتژمێر] LT',
  24962. lastDay: '[دوێنێ كاتژمێر] LT',
  24963. lastWeek: 'dddd [كاتژمێر] LT',
  24964. sameElse: 'L',
  24965. },
  24966. relativeTime: {
  24967. future: 'له‌ %s',
  24968. past: '%s',
  24969. s: 'چه‌ند چركه‌یه‌ك',
  24970. ss: 'چركه‌ %d',
  24971. m: 'یه‌ك خوله‌ك',
  24972. mm: '%d خوله‌ك',
  24973. h: 'یه‌ك كاتژمێر',
  24974. hh: '%d كاتژمێر',
  24975. d: 'یه‌ك ڕۆژ',
  24976. dd: '%d ڕۆژ',
  24977. M: 'یه‌ك مانگ',
  24978. MM: '%d مانگ',
  24979. y: 'یه‌ك ساڵ',
  24980. yy: '%d ساڵ',
  24981. },
  24982. preparse: function (string) {
  24983. return string
  24984. .replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) {
  24985. return numberMap[match];
  24986. })
  24987. .replace(/،/g, ',');
  24988. },
  24989. postformat: function (string) {
  24990. return string
  24991. .replace(/\d/g, function (match) {
  24992. return symbolMap[match];
  24993. })
  24994. .replace(/,/g, '،');
  24995. },
  24996. week: {
  24997. dow: 6, // Saturday is the first day of the week.
  24998. doy: 12, // The week that contains Jan 12th is the first week of the year.
  24999. },
  25000. });
  25001. return ku;
  25002. })));
  25003. /***/ }),
  25004. /***/ "./node_modules/moment/locale/ky.js":
  25005. /*!******************************************!*\
  25006. !*** ./node_modules/moment/locale/ky.js ***!
  25007. \******************************************/
  25008. /*! no static exports found */
  25009. /***/ (function(module, exports, __webpack_require__) {
  25010. //! moment.js locale configuration
  25011. //! locale : Kyrgyz [ky]
  25012. //! author : Chyngyz Arystan uulu : https://github.com/chyngyz
  25013. ;(function (global, factory) {
  25014. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  25015. undefined
  25016. }(this, (function (moment) { 'use strict';
  25017. //! moment.js locale configuration
  25018. var suffixes = {
  25019. 0: '-чү',
  25020. 1: '-чи',
  25021. 2: '-чи',
  25022. 3: '-чү',
  25023. 4: '-чү',
  25024. 5: '-чи',
  25025. 6: '-чы',
  25026. 7: '-чи',
  25027. 8: '-чи',
  25028. 9: '-чу',
  25029. 10: '-чу',
  25030. 20: '-чы',
  25031. 30: '-чу',
  25032. 40: '-чы',
  25033. 50: '-чү',
  25034. 60: '-чы',
  25035. 70: '-чи',
  25036. 80: '-чи',
  25037. 90: '-чу',
  25038. 100: '-чү',
  25039. };
  25040. var ky = moment.defineLocale('ky', {
  25041. months: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split(
  25042. '_'
  25043. ),
  25044. monthsShort: 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split(
  25045. '_'
  25046. ),
  25047. weekdays: 'Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби'.split(
  25048. '_'
  25049. ),
  25050. weekdaysShort: 'Жек_Дүй_Шей_Шар_Бей_Жум_Ише'.split('_'),
  25051. weekdaysMin: 'Жк_Дй_Шй_Шр_Бй_Жм_Иш'.split('_'),
  25052. longDateFormat: {
  25053. LT: 'HH:mm',
  25054. LTS: 'HH:mm:ss',
  25055. L: 'DD.MM.YYYY',
  25056. LL: 'D MMMM YYYY',
  25057. LLL: 'D MMMM YYYY HH:mm',
  25058. LLLL: 'dddd, D MMMM YYYY HH:mm',
  25059. },
  25060. calendar: {
  25061. sameDay: '[Бүгүн саат] LT',
  25062. nextDay: '[Эртең саат] LT',
  25063. nextWeek: 'dddd [саат] LT',
  25064. lastDay: '[Кечээ саат] LT',
  25065. lastWeek: '[Өткөн аптанын] dddd [күнү] [саат] LT',
  25066. sameElse: 'L',
  25067. },
  25068. relativeTime: {
  25069. future: '%s ичинде',
  25070. past: '%s мурун',
  25071. s: 'бирнече секунд',
  25072. ss: '%d секунд',
  25073. m: 'бир мүнөт',
  25074. mm: '%d мүнөт',
  25075. h: 'бир саат',
  25076. hh: '%d саат',
  25077. d: 'бир күн',
  25078. dd: '%d күн',
  25079. M: 'бир ай',
  25080. MM: '%d ай',
  25081. y: 'бир жыл',
  25082. yy: '%d жыл',
  25083. },
  25084. dayOfMonthOrdinalParse: /\d{1,2}-(чи|чы|чү|чу)/,
  25085. ordinal: function (number) {
  25086. var a = number % 10,
  25087. b = number >= 100 ? 100 : null;
  25088. return number + (suffixes[number] || suffixes[a] || suffixes[b]);
  25089. },
  25090. week: {
  25091. dow: 1, // Monday is the first day of the week.
  25092. doy: 7, // The week that contains Jan 7th is the first week of the year.
  25093. },
  25094. });
  25095. return ky;
  25096. })));
  25097. /***/ }),
  25098. /***/ "./node_modules/moment/locale/lb.js":
  25099. /*!******************************************!*\
  25100. !*** ./node_modules/moment/locale/lb.js ***!
  25101. \******************************************/
  25102. /*! no static exports found */
  25103. /***/ (function(module, exports, __webpack_require__) {
  25104. //! moment.js locale configuration
  25105. //! locale : Luxembourgish [lb]
  25106. //! author : mweimerskirch : https://github.com/mweimerskirch
  25107. //! author : David Raison : https://github.com/kwisatz
  25108. ;(function (global, factory) {
  25109. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  25110. undefined
  25111. }(this, (function (moment) { 'use strict';
  25112. //! moment.js locale configuration
  25113. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  25114. var format = {
  25115. m: ['eng Minutt', 'enger Minutt'],
  25116. h: ['eng Stonn', 'enger Stonn'],
  25117. d: ['een Dag', 'engem Dag'],
  25118. M: ['ee Mount', 'engem Mount'],
  25119. y: ['ee Joer', 'engem Joer'],
  25120. };
  25121. return withoutSuffix ? format[key][0] : format[key][1];
  25122. }
  25123. function processFutureTime(string) {
  25124. var number = string.substr(0, string.indexOf(' '));
  25125. if (eifelerRegelAppliesToNumber(number)) {
  25126. return 'a ' + string;
  25127. }
  25128. return 'an ' + string;
  25129. }
  25130. function processPastTime(string) {
  25131. var number = string.substr(0, string.indexOf(' '));
  25132. if (eifelerRegelAppliesToNumber(number)) {
  25133. return 'viru ' + string;
  25134. }
  25135. return 'virun ' + string;
  25136. }
  25137. /**
  25138. * Returns true if the word before the given number loses the '-n' ending.
  25139. * e.g. 'an 10 Deeg' but 'a 5 Deeg'
  25140. *
  25141. * @param number {integer}
  25142. * @returns {boolean}
  25143. */
  25144. function eifelerRegelAppliesToNumber(number) {
  25145. number = parseInt(number, 10);
  25146. if (isNaN(number)) {
  25147. return false;
  25148. }
  25149. if (number < 0) {
  25150. // Negative Number --> always true
  25151. return true;
  25152. } else if (number < 10) {
  25153. // Only 1 digit
  25154. if (4 <= number && number <= 7) {
  25155. return true;
  25156. }
  25157. return false;
  25158. } else if (number < 100) {
  25159. // 2 digits
  25160. var lastDigit = number % 10,
  25161. firstDigit = number / 10;
  25162. if (lastDigit === 0) {
  25163. return eifelerRegelAppliesToNumber(firstDigit);
  25164. }
  25165. return eifelerRegelAppliesToNumber(lastDigit);
  25166. } else if (number < 10000) {
  25167. // 3 or 4 digits --> recursively check first digit
  25168. while (number >= 10) {
  25169. number = number / 10;
  25170. }
  25171. return eifelerRegelAppliesToNumber(number);
  25172. } else {
  25173. // Anything larger than 4 digits: recursively check first n-3 digits
  25174. number = number / 1000;
  25175. return eifelerRegelAppliesToNumber(number);
  25176. }
  25177. }
  25178. var lb = moment.defineLocale('lb', {
  25179. months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split(
  25180. '_'
  25181. ),
  25182. monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split(
  25183. '_'
  25184. ),
  25185. monthsParseExact: true,
  25186. weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split(
  25187. '_'
  25188. ),
  25189. weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'),
  25190. weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'),
  25191. weekdaysParseExact: true,
  25192. longDateFormat: {
  25193. LT: 'H:mm [Auer]',
  25194. LTS: 'H:mm:ss [Auer]',
  25195. L: 'DD.MM.YYYY',
  25196. LL: 'D. MMMM YYYY',
  25197. LLL: 'D. MMMM YYYY H:mm [Auer]',
  25198. LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]',
  25199. },
  25200. calendar: {
  25201. sameDay: '[Haut um] LT',
  25202. sameElse: 'L',
  25203. nextDay: '[Muer um] LT',
  25204. nextWeek: 'dddd [um] LT',
  25205. lastDay: '[Gëschter um] LT',
  25206. lastWeek: function () {
  25207. // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule
  25208. switch (this.day()) {
  25209. case 2:
  25210. case 4:
  25211. return '[Leschten] dddd [um] LT';
  25212. default:
  25213. return '[Leschte] dddd [um] LT';
  25214. }
  25215. },
  25216. },
  25217. relativeTime: {
  25218. future: processFutureTime,
  25219. past: processPastTime,
  25220. s: 'e puer Sekonnen',
  25221. ss: '%d Sekonnen',
  25222. m: processRelativeTime,
  25223. mm: '%d Minutten',
  25224. h: processRelativeTime,
  25225. hh: '%d Stonnen',
  25226. d: processRelativeTime,
  25227. dd: '%d Deeg',
  25228. M: processRelativeTime,
  25229. MM: '%d Méint',
  25230. y: processRelativeTime,
  25231. yy: '%d Joer',
  25232. },
  25233. dayOfMonthOrdinalParse: /\d{1,2}\./,
  25234. ordinal: '%d.',
  25235. week: {
  25236. dow: 1, // Monday is the first day of the week.
  25237. doy: 4, // The week that contains Jan 4th is the first week of the year.
  25238. },
  25239. });
  25240. return lb;
  25241. })));
  25242. /***/ }),
  25243. /***/ "./node_modules/moment/locale/lo.js":
  25244. /*!******************************************!*\
  25245. !*** ./node_modules/moment/locale/lo.js ***!
  25246. \******************************************/
  25247. /*! no static exports found */
  25248. /***/ (function(module, exports, __webpack_require__) {
  25249. //! moment.js locale configuration
  25250. //! locale : Lao [lo]
  25251. //! author : Ryan Hart : https://github.com/ryanhart2
  25252. ;(function (global, factory) {
  25253. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  25254. undefined
  25255. }(this, (function (moment) { 'use strict';
  25256. //! moment.js locale configuration
  25257. var lo = moment.defineLocale('lo', {
  25258. months: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split(
  25259. '_'
  25260. ),
  25261. monthsShort: 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split(
  25262. '_'
  25263. ),
  25264. weekdays: 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
  25265. weekdaysShort: 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'),
  25266. weekdaysMin: 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'),
  25267. weekdaysParseExact: true,
  25268. longDateFormat: {
  25269. LT: 'HH:mm',
  25270. LTS: 'HH:mm:ss',
  25271. L: 'DD/MM/YYYY',
  25272. LL: 'D MMMM YYYY',
  25273. LLL: 'D MMMM YYYY HH:mm',
  25274. LLLL: 'ວັນdddd D MMMM YYYY HH:mm',
  25275. },
  25276. meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/,
  25277. isPM: function (input) {
  25278. return input === 'ຕອນແລງ';
  25279. },
  25280. meridiem: function (hour, minute, isLower) {
  25281. if (hour < 12) {
  25282. return 'ຕອນເຊົ້າ';
  25283. } else {
  25284. return 'ຕອນແລງ';
  25285. }
  25286. },
  25287. calendar: {
  25288. sameDay: '[ມື້ນີ້ເວລາ] LT',
  25289. nextDay: '[ມື້ອື່ນເວລາ] LT',
  25290. nextWeek: '[ວັນ]dddd[ໜ້າເວລາ] LT',
  25291. lastDay: '[ມື້ວານນີ້ເວລາ] LT',
  25292. lastWeek: '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT',
  25293. sameElse: 'L',
  25294. },
  25295. relativeTime: {
  25296. future: 'ອີກ %s',
  25297. past: '%sຜ່ານມາ',
  25298. s: 'ບໍ່ເທົ່າໃດວິນາທີ',
  25299. ss: '%d ວິນາທີ',
  25300. m: '1 ນາທີ',
  25301. mm: '%d ນາທີ',
  25302. h: '1 ຊົ່ວໂມງ',
  25303. hh: '%d ຊົ່ວໂມງ',
  25304. d: '1 ມື້',
  25305. dd: '%d ມື້',
  25306. M: '1 ເດືອນ',
  25307. MM: '%d ເດືອນ',
  25308. y: '1 ປີ',
  25309. yy: '%d ປີ',
  25310. },
  25311. dayOfMonthOrdinalParse: /(ທີ່)\d{1,2}/,
  25312. ordinal: function (number) {
  25313. return 'ທີ່' + number;
  25314. },
  25315. });
  25316. return lo;
  25317. })));
  25318. /***/ }),
  25319. /***/ "./node_modules/moment/locale/lt.js":
  25320. /*!******************************************!*\
  25321. !*** ./node_modules/moment/locale/lt.js ***!
  25322. \******************************************/
  25323. /*! no static exports found */
  25324. /***/ (function(module, exports, __webpack_require__) {
  25325. //! moment.js locale configuration
  25326. //! locale : Lithuanian [lt]
  25327. //! author : Mindaugas Mozūras : https://github.com/mmozuras
  25328. ;(function (global, factory) {
  25329. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  25330. undefined
  25331. }(this, (function (moment) { 'use strict';
  25332. //! moment.js locale configuration
  25333. var units = {
  25334. ss: 'sekundė_sekundžių_sekundes',
  25335. m: 'minutė_minutės_minutę',
  25336. mm: 'minutės_minučių_minutes',
  25337. h: 'valanda_valandos_valandą',
  25338. hh: 'valandos_valandų_valandas',
  25339. d: 'diena_dienos_dieną',
  25340. dd: 'dienos_dienų_dienas',
  25341. M: 'mėnuo_mėnesio_mėnesį',
  25342. MM: 'mėnesiai_mėnesių_mėnesius',
  25343. y: 'metai_metų_metus',
  25344. yy: 'metai_metų_metus',
  25345. };
  25346. function translateSeconds(number, withoutSuffix, key, isFuture) {
  25347. if (withoutSuffix) {
  25348. return 'kelios sekundės';
  25349. } else {
  25350. return isFuture ? 'kelių sekundžių' : 'kelias sekundes';
  25351. }
  25352. }
  25353. function translateSingular(number, withoutSuffix, key, isFuture) {
  25354. return withoutSuffix
  25355. ? forms(key)[0]
  25356. : isFuture
  25357. ? forms(key)[1]
  25358. : forms(key)[2];
  25359. }
  25360. function special(number) {
  25361. return number % 10 === 0 || (number > 10 && number < 20);
  25362. }
  25363. function forms(key) {
  25364. return units[key].split('_');
  25365. }
  25366. function translate(number, withoutSuffix, key, isFuture) {
  25367. var result = number + ' ';
  25368. if (number === 1) {
  25369. return (
  25370. result + translateSingular(number, withoutSuffix, key[0], isFuture)
  25371. );
  25372. } else if (withoutSuffix) {
  25373. return result + (special(number) ? forms(key)[1] : forms(key)[0]);
  25374. } else {
  25375. if (isFuture) {
  25376. return result + forms(key)[1];
  25377. } else {
  25378. return result + (special(number) ? forms(key)[1] : forms(key)[2]);
  25379. }
  25380. }
  25381. }
  25382. var lt = moment.defineLocale('lt', {
  25383. months: {
  25384. format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split(
  25385. '_'
  25386. ),
  25387. standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split(
  25388. '_'
  25389. ),
  25390. isFormat: /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/,
  25391. },
  25392. monthsShort: 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),
  25393. weekdays: {
  25394. format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split(
  25395. '_'
  25396. ),
  25397. standalone: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split(
  25398. '_'
  25399. ),
  25400. isFormat: /dddd HH:mm/,
  25401. },
  25402. weekdaysShort: 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),
  25403. weekdaysMin: 'S_P_A_T_K_Pn_Š'.split('_'),
  25404. weekdaysParseExact: true,
  25405. longDateFormat: {
  25406. LT: 'HH:mm',
  25407. LTS: 'HH:mm:ss',
  25408. L: 'YYYY-MM-DD',
  25409. LL: 'YYYY [m.] MMMM D [d.]',
  25410. LLL: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
  25411. LLLL: 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',
  25412. l: 'YYYY-MM-DD',
  25413. ll: 'YYYY [m.] MMMM D [d.]',
  25414. lll: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
  25415. llll: 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]',
  25416. },
  25417. calendar: {
  25418. sameDay: '[Šiandien] LT',
  25419. nextDay: '[Rytoj] LT',
  25420. nextWeek: 'dddd LT',
  25421. lastDay: '[Vakar] LT',
  25422. lastWeek: '[Praėjusį] dddd LT',
  25423. sameElse: 'L',
  25424. },
  25425. relativeTime: {
  25426. future: 'po %s',
  25427. past: 'prieš %s',
  25428. s: translateSeconds,
  25429. ss: translate,
  25430. m: translateSingular,
  25431. mm: translate,
  25432. h: translateSingular,
  25433. hh: translate,
  25434. d: translateSingular,
  25435. dd: translate,
  25436. M: translateSingular,
  25437. MM: translate,
  25438. y: translateSingular,
  25439. yy: translate,
  25440. },
  25441. dayOfMonthOrdinalParse: /\d{1,2}-oji/,
  25442. ordinal: function (number) {
  25443. return number + '-oji';
  25444. },
  25445. week: {
  25446. dow: 1, // Monday is the first day of the week.
  25447. doy: 4, // The week that contains Jan 4th is the first week of the year.
  25448. },
  25449. });
  25450. return lt;
  25451. })));
  25452. /***/ }),
  25453. /***/ "./node_modules/moment/locale/lv.js":
  25454. /*!******************************************!*\
  25455. !*** ./node_modules/moment/locale/lv.js ***!
  25456. \******************************************/
  25457. /*! no static exports found */
  25458. /***/ (function(module, exports, __webpack_require__) {
  25459. //! moment.js locale configuration
  25460. //! locale : Latvian [lv]
  25461. //! author : Kristaps Karlsons : https://github.com/skakri
  25462. //! author : Jānis Elmeris : https://github.com/JanisE
  25463. ;(function (global, factory) {
  25464. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  25465. undefined
  25466. }(this, (function (moment) { 'use strict';
  25467. //! moment.js locale configuration
  25468. var units = {
  25469. ss: 'sekundes_sekundēm_sekunde_sekundes'.split('_'),
  25470. m: 'minūtes_minūtēm_minūte_minūtes'.split('_'),
  25471. mm: 'minūtes_minūtēm_minūte_minūtes'.split('_'),
  25472. h: 'stundas_stundām_stunda_stundas'.split('_'),
  25473. hh: 'stundas_stundām_stunda_stundas'.split('_'),
  25474. d: 'dienas_dienām_diena_dienas'.split('_'),
  25475. dd: 'dienas_dienām_diena_dienas'.split('_'),
  25476. M: 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
  25477. MM: 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'),
  25478. y: 'gada_gadiem_gads_gadi'.split('_'),
  25479. yy: 'gada_gadiem_gads_gadi'.split('_'),
  25480. };
  25481. /**
  25482. * @param withoutSuffix boolean true = a length of time; false = before/after a period of time.
  25483. */
  25484. function format(forms, number, withoutSuffix) {
  25485. if (withoutSuffix) {
  25486. // E.g. "21 minūte", "3 minūtes".
  25487. return number % 10 === 1 && number % 100 !== 11 ? forms[2] : forms[3];
  25488. } else {
  25489. // E.g. "21 minūtes" as in "pēc 21 minūtes".
  25490. // E.g. "3 minūtēm" as in "pēc 3 minūtēm".
  25491. return number % 10 === 1 && number % 100 !== 11 ? forms[0] : forms[1];
  25492. }
  25493. }
  25494. function relativeTimeWithPlural(number, withoutSuffix, key) {
  25495. return number + ' ' + format(units[key], number, withoutSuffix);
  25496. }
  25497. function relativeTimeWithSingular(number, withoutSuffix, key) {
  25498. return format(units[key], number, withoutSuffix);
  25499. }
  25500. function relativeSeconds(number, withoutSuffix) {
  25501. return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm';
  25502. }
  25503. var lv = moment.defineLocale('lv', {
  25504. months: 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split(
  25505. '_'
  25506. ),
  25507. monthsShort: 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'),
  25508. weekdays: 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split(
  25509. '_'
  25510. ),
  25511. weekdaysShort: 'Sv_P_O_T_C_Pk_S'.split('_'),
  25512. weekdaysMin: 'Sv_P_O_T_C_Pk_S'.split('_'),
  25513. weekdaysParseExact: true,
  25514. longDateFormat: {
  25515. LT: 'HH:mm',
  25516. LTS: 'HH:mm:ss',
  25517. L: 'DD.MM.YYYY.',
  25518. LL: 'YYYY. [gada] D. MMMM',
  25519. LLL: 'YYYY. [gada] D. MMMM, HH:mm',
  25520. LLLL: 'YYYY. [gada] D. MMMM, dddd, HH:mm',
  25521. },
  25522. calendar: {
  25523. sameDay: '[Šodien pulksten] LT',
  25524. nextDay: '[Rīt pulksten] LT',
  25525. nextWeek: 'dddd [pulksten] LT',
  25526. lastDay: '[Vakar pulksten] LT',
  25527. lastWeek: '[Pagājušā] dddd [pulksten] LT',
  25528. sameElse: 'L',
  25529. },
  25530. relativeTime: {
  25531. future: 'pēc %s',
  25532. past: 'pirms %s',
  25533. s: relativeSeconds,
  25534. ss: relativeTimeWithPlural,
  25535. m: relativeTimeWithSingular,
  25536. mm: relativeTimeWithPlural,
  25537. h: relativeTimeWithSingular,
  25538. hh: relativeTimeWithPlural,
  25539. d: relativeTimeWithSingular,
  25540. dd: relativeTimeWithPlural,
  25541. M: relativeTimeWithSingular,
  25542. MM: relativeTimeWithPlural,
  25543. y: relativeTimeWithSingular,
  25544. yy: relativeTimeWithPlural,
  25545. },
  25546. dayOfMonthOrdinalParse: /\d{1,2}\./,
  25547. ordinal: '%d.',
  25548. week: {
  25549. dow: 1, // Monday is the first day of the week.
  25550. doy: 4, // The week that contains Jan 4th is the first week of the year.
  25551. },
  25552. });
  25553. return lv;
  25554. })));
  25555. /***/ }),
  25556. /***/ "./node_modules/moment/locale/me.js":
  25557. /*!******************************************!*\
  25558. !*** ./node_modules/moment/locale/me.js ***!
  25559. \******************************************/
  25560. /*! no static exports found */
  25561. /***/ (function(module, exports, __webpack_require__) {
  25562. //! moment.js locale configuration
  25563. //! locale : Montenegrin [me]
  25564. //! author : Miodrag Nikač <miodrag@restartit.me> : https://github.com/miodragnikac
  25565. ;(function (global, factory) {
  25566. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  25567. undefined
  25568. }(this, (function (moment) { 'use strict';
  25569. //! moment.js locale configuration
  25570. var translator = {
  25571. words: {
  25572. //Different grammatical cases
  25573. ss: ['sekund', 'sekunda', 'sekundi'],
  25574. m: ['jedan minut', 'jednog minuta'],
  25575. mm: ['minut', 'minuta', 'minuta'],
  25576. h: ['jedan sat', 'jednog sata'],
  25577. hh: ['sat', 'sata', 'sati'],
  25578. dd: ['dan', 'dana', 'dana'],
  25579. MM: ['mjesec', 'mjeseca', 'mjeseci'],
  25580. yy: ['godina', 'godine', 'godina'],
  25581. },
  25582. correctGrammaticalCase: function (number, wordKey) {
  25583. return number === 1
  25584. ? wordKey[0]
  25585. : number >= 2 && number <= 4
  25586. ? wordKey[1]
  25587. : wordKey[2];
  25588. },
  25589. translate: function (number, withoutSuffix, key) {
  25590. var wordKey = translator.words[key];
  25591. if (key.length === 1) {
  25592. return withoutSuffix ? wordKey[0] : wordKey[1];
  25593. } else {
  25594. return (
  25595. number +
  25596. ' ' +
  25597. translator.correctGrammaticalCase(number, wordKey)
  25598. );
  25599. }
  25600. },
  25601. };
  25602. var me = moment.defineLocale('me', {
  25603. months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(
  25604. '_'
  25605. ),
  25606. monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split(
  25607. '_'
  25608. ),
  25609. monthsParseExact: true,
  25610. weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split(
  25611. '_'
  25612. ),
  25613. weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'),
  25614. weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
  25615. weekdaysParseExact: true,
  25616. longDateFormat: {
  25617. LT: 'H:mm',
  25618. LTS: 'H:mm:ss',
  25619. L: 'DD.MM.YYYY',
  25620. LL: 'D. MMMM YYYY',
  25621. LLL: 'D. MMMM YYYY H:mm',
  25622. LLLL: 'dddd, D. MMMM YYYY H:mm',
  25623. },
  25624. calendar: {
  25625. sameDay: '[danas u] LT',
  25626. nextDay: '[sjutra u] LT',
  25627. nextWeek: function () {
  25628. switch (this.day()) {
  25629. case 0:
  25630. return '[u] [nedjelju] [u] LT';
  25631. case 3:
  25632. return '[u] [srijedu] [u] LT';
  25633. case 6:
  25634. return '[u] [subotu] [u] LT';
  25635. case 1:
  25636. case 2:
  25637. case 4:
  25638. case 5:
  25639. return '[u] dddd [u] LT';
  25640. }
  25641. },
  25642. lastDay: '[juče u] LT',
  25643. lastWeek: function () {
  25644. var lastWeekDays = [
  25645. '[prošle] [nedjelje] [u] LT',
  25646. '[prošlog] [ponedjeljka] [u] LT',
  25647. '[prošlog] [utorka] [u] LT',
  25648. '[prošle] [srijede] [u] LT',
  25649. '[prošlog] [četvrtka] [u] LT',
  25650. '[prošlog] [petka] [u] LT',
  25651. '[prošle] [subote] [u] LT',
  25652. ];
  25653. return lastWeekDays[this.day()];
  25654. },
  25655. sameElse: 'L',
  25656. },
  25657. relativeTime: {
  25658. future: 'za %s',
  25659. past: 'prije %s',
  25660. s: 'nekoliko sekundi',
  25661. ss: translator.translate,
  25662. m: translator.translate,
  25663. mm: translator.translate,
  25664. h: translator.translate,
  25665. hh: translator.translate,
  25666. d: 'dan',
  25667. dd: translator.translate,
  25668. M: 'mjesec',
  25669. MM: translator.translate,
  25670. y: 'godinu',
  25671. yy: translator.translate,
  25672. },
  25673. dayOfMonthOrdinalParse: /\d{1,2}\./,
  25674. ordinal: '%d.',
  25675. week: {
  25676. dow: 1, // Monday is the first day of the week.
  25677. doy: 7, // The week that contains Jan 7th is the first week of the year.
  25678. },
  25679. });
  25680. return me;
  25681. })));
  25682. /***/ }),
  25683. /***/ "./node_modules/moment/locale/mi.js":
  25684. /*!******************************************!*\
  25685. !*** ./node_modules/moment/locale/mi.js ***!
  25686. \******************************************/
  25687. /*! no static exports found */
  25688. /***/ (function(module, exports, __webpack_require__) {
  25689. //! moment.js locale configuration
  25690. //! locale : Maori [mi]
  25691. //! author : John Corrigan <robbiecloset@gmail.com> : https://github.com/johnideal
  25692. ;(function (global, factory) {
  25693. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  25694. undefined
  25695. }(this, (function (moment) { 'use strict';
  25696. //! moment.js locale configuration
  25697. var mi = moment.defineLocale('mi', {
  25698. 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(
  25699. '_'
  25700. ),
  25701. monthsShort: 'Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki'.split(
  25702. '_'
  25703. ),
  25704. monthsRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
  25705. monthsStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
  25706. monthsShortRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,3}/i,
  25707. monthsShortStrictRegex: /(?:['a-z\u0101\u014D\u016B]+\-?){1,2}/i,
  25708. weekdays: 'Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei'.split('_'),
  25709. weekdaysShort: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
  25710. weekdaysMin: 'Ta_Ma_Tū_We_Tāi_Pa_Hā'.split('_'),
  25711. longDateFormat: {
  25712. LT: 'HH:mm',
  25713. LTS: 'HH:mm:ss',
  25714. L: 'DD/MM/YYYY',
  25715. LL: 'D MMMM YYYY',
  25716. LLL: 'D MMMM YYYY [i] HH:mm',
  25717. LLLL: 'dddd, D MMMM YYYY [i] HH:mm',
  25718. },
  25719. calendar: {
  25720. sameDay: '[i teie mahana, i] LT',
  25721. nextDay: '[apopo i] LT',
  25722. nextWeek: 'dddd [i] LT',
  25723. lastDay: '[inanahi i] LT',
  25724. lastWeek: 'dddd [whakamutunga i] LT',
  25725. sameElse: 'L',
  25726. },
  25727. relativeTime: {
  25728. future: 'i roto i %s',
  25729. past: '%s i mua',
  25730. s: 'te hēkona ruarua',
  25731. ss: '%d hēkona',
  25732. m: 'he meneti',
  25733. mm: '%d meneti',
  25734. h: 'te haora',
  25735. hh: '%d haora',
  25736. d: 'he ra',
  25737. dd: '%d ra',
  25738. M: 'he marama',
  25739. MM: '%d marama',
  25740. y: 'he tau',
  25741. yy: '%d tau',
  25742. },
  25743. dayOfMonthOrdinalParse: /\d{1,2}º/,
  25744. ordinal: '%dº',
  25745. week: {
  25746. dow: 1, // Monday is the first day of the week.
  25747. doy: 4, // The week that contains Jan 4th is the first week of the year.
  25748. },
  25749. });
  25750. return mi;
  25751. })));
  25752. /***/ }),
  25753. /***/ "./node_modules/moment/locale/mk.js":
  25754. /*!******************************************!*\
  25755. !*** ./node_modules/moment/locale/mk.js ***!
  25756. \******************************************/
  25757. /*! no static exports found */
  25758. /***/ (function(module, exports, __webpack_require__) {
  25759. //! moment.js locale configuration
  25760. //! locale : Macedonian [mk]
  25761. //! author : Borislav Mickov : https://github.com/B0k0
  25762. //! author : Sashko Todorov : https://github.com/bkyceh
  25763. ;(function (global, factory) {
  25764. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  25765. undefined
  25766. }(this, (function (moment) { 'use strict';
  25767. //! moment.js locale configuration
  25768. var mk = moment.defineLocale('mk', {
  25769. months: 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split(
  25770. '_'
  25771. ),
  25772. monthsShort: 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'),
  25773. weekdays: 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split(
  25774. '_'
  25775. ),
  25776. weekdaysShort: 'нед_пон_вто_сре_чет_пет_саб'.split('_'),
  25777. weekdaysMin: 'нe_пo_вт_ср_че_пе_сa'.split('_'),
  25778. longDateFormat: {
  25779. LT: 'H:mm',
  25780. LTS: 'H:mm:ss',
  25781. L: 'D.MM.YYYY',
  25782. LL: 'D MMMM YYYY',
  25783. LLL: 'D MMMM YYYY H:mm',
  25784. LLLL: 'dddd, D MMMM YYYY H:mm',
  25785. },
  25786. calendar: {
  25787. sameDay: '[Денес во] LT',
  25788. nextDay: '[Утре во] LT',
  25789. nextWeek: '[Во] dddd [во] LT',
  25790. lastDay: '[Вчера во] LT',
  25791. lastWeek: function () {
  25792. switch (this.day()) {
  25793. case 0:
  25794. case 3:
  25795. case 6:
  25796. return '[Изминатата] dddd [во] LT';
  25797. case 1:
  25798. case 2:
  25799. case 4:
  25800. case 5:
  25801. return '[Изминатиот] dddd [во] LT';
  25802. }
  25803. },
  25804. sameElse: 'L',
  25805. },
  25806. relativeTime: {
  25807. future: 'за %s',
  25808. past: 'пред %s',
  25809. s: 'неколку секунди',
  25810. ss: '%d секунди',
  25811. m: 'една минута',
  25812. mm: '%d минути',
  25813. h: 'еден час',
  25814. hh: '%d часа',
  25815. d: 'еден ден',
  25816. dd: '%d дена',
  25817. M: 'еден месец',
  25818. MM: '%d месеци',
  25819. y: 'една година',
  25820. yy: '%d години',
  25821. },
  25822. dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
  25823. ordinal: function (number) {
  25824. var lastDigit = number % 10,
  25825. last2Digits = number % 100;
  25826. if (number === 0) {
  25827. return number + '-ев';
  25828. } else if (last2Digits === 0) {
  25829. return number + '-ен';
  25830. } else if (last2Digits > 10 && last2Digits < 20) {
  25831. return number + '-ти';
  25832. } else if (lastDigit === 1) {
  25833. return number + '-ви';
  25834. } else if (lastDigit === 2) {
  25835. return number + '-ри';
  25836. } else if (lastDigit === 7 || lastDigit === 8) {
  25837. return number + '-ми';
  25838. } else {
  25839. return number + '-ти';
  25840. }
  25841. },
  25842. week: {
  25843. dow: 1, // Monday is the first day of the week.
  25844. doy: 7, // The week that contains Jan 7th is the first week of the year.
  25845. },
  25846. });
  25847. return mk;
  25848. })));
  25849. /***/ }),
  25850. /***/ "./node_modules/moment/locale/ml.js":
  25851. /*!******************************************!*\
  25852. !*** ./node_modules/moment/locale/ml.js ***!
  25853. \******************************************/
  25854. /*! no static exports found */
  25855. /***/ (function(module, exports, __webpack_require__) {
  25856. //! moment.js locale configuration
  25857. //! locale : Malayalam [ml]
  25858. //! author : Floyd Pink : https://github.com/floydpink
  25859. ;(function (global, factory) {
  25860. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  25861. undefined
  25862. }(this, (function (moment) { 'use strict';
  25863. //! moment.js locale configuration
  25864. var ml = moment.defineLocale('ml', {
  25865. months: 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split(
  25866. '_'
  25867. ),
  25868. monthsShort: 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split(
  25869. '_'
  25870. ),
  25871. monthsParseExact: true,
  25872. weekdays: 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split(
  25873. '_'
  25874. ),
  25875. weekdaysShort: 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'),
  25876. weekdaysMin: 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'),
  25877. longDateFormat: {
  25878. LT: 'A h:mm -നു',
  25879. LTS: 'A h:mm:ss -നു',
  25880. L: 'DD/MM/YYYY',
  25881. LL: 'D MMMM YYYY',
  25882. LLL: 'D MMMM YYYY, A h:mm -നു',
  25883. LLLL: 'dddd, D MMMM YYYY, A h:mm -നു',
  25884. },
  25885. calendar: {
  25886. sameDay: '[ഇന്ന്] LT',
  25887. nextDay: '[നാളെ] LT',
  25888. nextWeek: 'dddd, LT',
  25889. lastDay: '[ഇന്നലെ] LT',
  25890. lastWeek: '[കഴിഞ്ഞ] dddd, LT',
  25891. sameElse: 'L',
  25892. },
  25893. relativeTime: {
  25894. future: '%s കഴിഞ്ഞ്',
  25895. past: '%s മുൻപ്',
  25896. s: 'അൽപ നിമിഷങ്ങൾ',
  25897. ss: '%d സെക്കൻഡ്',
  25898. m: 'ഒരു മിനിറ്റ്',
  25899. mm: '%d മിനിറ്റ്',
  25900. h: 'ഒരു മണിക്കൂർ',
  25901. hh: '%d മണിക്കൂർ',
  25902. d: 'ഒരു ദിവസം',
  25903. dd: '%d ദിവസം',
  25904. M: 'ഒരു മാസം',
  25905. MM: '%d മാസം',
  25906. y: 'ഒരു വർഷം',
  25907. yy: '%d വർഷം',
  25908. },
  25909. meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i,
  25910. meridiemHour: function (hour, meridiem) {
  25911. if (hour === 12) {
  25912. hour = 0;
  25913. }
  25914. if (
  25915. (meridiem === 'രാത്രി' && hour >= 4) ||
  25916. meridiem === 'ഉച്ച കഴിഞ്ഞ്' ||
  25917. meridiem === 'വൈകുന്നേരം'
  25918. ) {
  25919. return hour + 12;
  25920. } else {
  25921. return hour;
  25922. }
  25923. },
  25924. meridiem: function (hour, minute, isLower) {
  25925. if (hour < 4) {
  25926. return 'രാത്രി';
  25927. } else if (hour < 12) {
  25928. return 'രാവിലെ';
  25929. } else if (hour < 17) {
  25930. return 'ഉച്ച കഴിഞ്ഞ്';
  25931. } else if (hour < 20) {
  25932. return 'വൈകുന്നേരം';
  25933. } else {
  25934. return 'രാത്രി';
  25935. }
  25936. },
  25937. });
  25938. return ml;
  25939. })));
  25940. /***/ }),
  25941. /***/ "./node_modules/moment/locale/mn.js":
  25942. /*!******************************************!*\
  25943. !*** ./node_modules/moment/locale/mn.js ***!
  25944. \******************************************/
  25945. /*! no static exports found */
  25946. /***/ (function(module, exports, __webpack_require__) {
  25947. //! moment.js locale configuration
  25948. //! locale : Mongolian [mn]
  25949. //! author : Javkhlantugs Nyamdorj : https://github.com/javkhaanj7
  25950. ;(function (global, factory) {
  25951. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  25952. undefined
  25953. }(this, (function (moment) { 'use strict';
  25954. //! moment.js locale configuration
  25955. function translate(number, withoutSuffix, key, isFuture) {
  25956. switch (key) {
  25957. case 's':
  25958. return withoutSuffix ? 'хэдхэн секунд' : 'хэдхэн секундын';
  25959. case 'ss':
  25960. return number + (withoutSuffix ? ' секунд' : ' секундын');
  25961. case 'm':
  25962. case 'mm':
  25963. return number + (withoutSuffix ? ' минут' : ' минутын');
  25964. case 'h':
  25965. case 'hh':
  25966. return number + (withoutSuffix ? ' цаг' : ' цагийн');
  25967. case 'd':
  25968. case 'dd':
  25969. return number + (withoutSuffix ? ' өдөр' : ' өдрийн');
  25970. case 'M':
  25971. case 'MM':
  25972. return number + (withoutSuffix ? ' сар' : ' сарын');
  25973. case 'y':
  25974. case 'yy':
  25975. return number + (withoutSuffix ? ' жил' : ' жилийн');
  25976. default:
  25977. return number;
  25978. }
  25979. }
  25980. var mn = moment.defineLocale('mn', {
  25981. months: 'Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар'.split(
  25982. '_'
  25983. ),
  25984. monthsShort: '1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар'.split(
  25985. '_'
  25986. ),
  25987. monthsParseExact: true,
  25988. weekdays: 'Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба'.split('_'),
  25989. weekdaysShort: 'Ням_Дав_Мяг_Лха_Пүр_Баа_Бям'.split('_'),
  25990. weekdaysMin: 'Ня_Да_Мя_Лх_Пү_Ба_Бя'.split('_'),
  25991. weekdaysParseExact: true,
  25992. longDateFormat: {
  25993. LT: 'HH:mm',
  25994. LTS: 'HH:mm:ss',
  25995. L: 'YYYY-MM-DD',
  25996. LL: 'YYYY оны MMMMын D',
  25997. LLL: 'YYYY оны MMMMын D HH:mm',
  25998. LLLL: 'dddd, YYYY оны MMMMын D HH:mm',
  25999. },
  26000. meridiemParse: /ҮӨ|ҮХ/i,
  26001. isPM: function (input) {
  26002. return input === 'ҮХ';
  26003. },
  26004. meridiem: function (hour, minute, isLower) {
  26005. if (hour < 12) {
  26006. return 'ҮӨ';
  26007. } else {
  26008. return 'ҮХ';
  26009. }
  26010. },
  26011. calendar: {
  26012. sameDay: '[Өнөөдөр] LT',
  26013. nextDay: '[Маргааш] LT',
  26014. nextWeek: '[Ирэх] dddd LT',
  26015. lastDay: '[Өчигдөр] LT',
  26016. lastWeek: '[Өнгөрсөн] dddd LT',
  26017. sameElse: 'L',
  26018. },
  26019. relativeTime: {
  26020. future: '%s дараа',
  26021. past: '%s өмнө',
  26022. s: translate,
  26023. ss: translate,
  26024. m: translate,
  26025. mm: translate,
  26026. h: translate,
  26027. hh: translate,
  26028. d: translate,
  26029. dd: translate,
  26030. M: translate,
  26031. MM: translate,
  26032. y: translate,
  26033. yy: translate,
  26034. },
  26035. dayOfMonthOrdinalParse: /\d{1,2} өдөр/,
  26036. ordinal: function (number, period) {
  26037. switch (period) {
  26038. case 'd':
  26039. case 'D':
  26040. case 'DDD':
  26041. return number + ' өдөр';
  26042. default:
  26043. return number;
  26044. }
  26045. },
  26046. });
  26047. return mn;
  26048. })));
  26049. /***/ }),
  26050. /***/ "./node_modules/moment/locale/mr.js":
  26051. /*!******************************************!*\
  26052. !*** ./node_modules/moment/locale/mr.js ***!
  26053. \******************************************/
  26054. /*! no static exports found */
  26055. /***/ (function(module, exports, __webpack_require__) {
  26056. //! moment.js locale configuration
  26057. //! locale : Marathi [mr]
  26058. //! author : Harshad Kale : https://github.com/kalehv
  26059. //! author : Vivek Athalye : https://github.com/vnathalye
  26060. ;(function (global, factory) {
  26061. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  26062. undefined
  26063. }(this, (function (moment) { 'use strict';
  26064. //! moment.js locale configuration
  26065. var symbolMap = {
  26066. 1: '१',
  26067. 2: '२',
  26068. 3: '३',
  26069. 4: '४',
  26070. 5: '५',
  26071. 6: '६',
  26072. 7: '७',
  26073. 8: '८',
  26074. 9: '९',
  26075. 0: '०',
  26076. },
  26077. numberMap = {
  26078. '१': '1',
  26079. '२': '2',
  26080. '३': '3',
  26081. '४': '4',
  26082. '५': '5',
  26083. '६': '6',
  26084. '७': '7',
  26085. '८': '8',
  26086. '९': '9',
  26087. '०': '0',
  26088. };
  26089. function relativeTimeMr(number, withoutSuffix, string, isFuture) {
  26090. var output = '';
  26091. if (withoutSuffix) {
  26092. switch (string) {
  26093. case 's':
  26094. output = 'काही सेकंद';
  26095. break;
  26096. case 'ss':
  26097. output = '%d सेकंद';
  26098. break;
  26099. case 'm':
  26100. output = 'एक मिनिट';
  26101. break;
  26102. case 'mm':
  26103. output = '%d मिनिटे';
  26104. break;
  26105. case 'h':
  26106. output = 'एक तास';
  26107. break;
  26108. case 'hh':
  26109. output = '%d तास';
  26110. break;
  26111. case 'd':
  26112. output = 'एक दिवस';
  26113. break;
  26114. case 'dd':
  26115. output = '%d दिवस';
  26116. break;
  26117. case 'M':
  26118. output = 'एक महिना';
  26119. break;
  26120. case 'MM':
  26121. output = '%d महिने';
  26122. break;
  26123. case 'y':
  26124. output = 'एक वर्ष';
  26125. break;
  26126. case 'yy':
  26127. output = '%d वर्षे';
  26128. break;
  26129. }
  26130. } else {
  26131. switch (string) {
  26132. case 's':
  26133. output = 'काही सेकंदां';
  26134. break;
  26135. case 'ss':
  26136. output = '%d सेकंदां';
  26137. break;
  26138. case 'm':
  26139. output = 'एका मिनिटा';
  26140. break;
  26141. case 'mm':
  26142. output = '%d मिनिटां';
  26143. break;
  26144. case 'h':
  26145. output = 'एका तासा';
  26146. break;
  26147. case 'hh':
  26148. output = '%d तासां';
  26149. break;
  26150. case 'd':
  26151. output = 'एका दिवसा';
  26152. break;
  26153. case 'dd':
  26154. output = '%d दिवसां';
  26155. break;
  26156. case 'M':
  26157. output = 'एका महिन्या';
  26158. break;
  26159. case 'MM':
  26160. output = '%d महिन्यां';
  26161. break;
  26162. case 'y':
  26163. output = 'एका वर्षा';
  26164. break;
  26165. case 'yy':
  26166. output = '%d वर्षां';
  26167. break;
  26168. }
  26169. }
  26170. return output.replace(/%d/i, number);
  26171. }
  26172. var mr = moment.defineLocale('mr', {
  26173. months: 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split(
  26174. '_'
  26175. ),
  26176. monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split(
  26177. '_'
  26178. ),
  26179. monthsParseExact: true,
  26180. weekdays: 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
  26181. weekdaysShort: 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'),
  26182. weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),
  26183. longDateFormat: {
  26184. LT: 'A h:mm वाजता',
  26185. LTS: 'A h:mm:ss वाजता',
  26186. L: 'DD/MM/YYYY',
  26187. LL: 'D MMMM YYYY',
  26188. LLL: 'D MMMM YYYY, A h:mm वाजता',
  26189. LLLL: 'dddd, D MMMM YYYY, A h:mm वाजता',
  26190. },
  26191. calendar: {
  26192. sameDay: '[आज] LT',
  26193. nextDay: '[उद्या] LT',
  26194. nextWeek: 'dddd, LT',
  26195. lastDay: '[काल] LT',
  26196. lastWeek: '[मागील] dddd, LT',
  26197. sameElse: 'L',
  26198. },
  26199. relativeTime: {
  26200. future: '%sमध्ये',
  26201. past: '%sपूर्वी',
  26202. s: relativeTimeMr,
  26203. ss: relativeTimeMr,
  26204. m: relativeTimeMr,
  26205. mm: relativeTimeMr,
  26206. h: relativeTimeMr,
  26207. hh: relativeTimeMr,
  26208. d: relativeTimeMr,
  26209. dd: relativeTimeMr,
  26210. M: relativeTimeMr,
  26211. MM: relativeTimeMr,
  26212. y: relativeTimeMr,
  26213. yy: relativeTimeMr,
  26214. },
  26215. preparse: function (string) {
  26216. return string.replace(/[१२३४५६७८९०]/g, function (match) {
  26217. return numberMap[match];
  26218. });
  26219. },
  26220. postformat: function (string) {
  26221. return string.replace(/\d/g, function (match) {
  26222. return symbolMap[match];
  26223. });
  26224. },
  26225. meridiemParse: /पहाटे|सकाळी|दुपारी|सायंकाळी|रात्री/,
  26226. meridiemHour: function (hour, meridiem) {
  26227. if (hour === 12) {
  26228. hour = 0;
  26229. }
  26230. if (meridiem === 'पहाटे' || meridiem === 'सकाळी') {
  26231. return hour;
  26232. } else if (
  26233. meridiem === 'दुपारी' ||
  26234. meridiem === 'सायंकाळी' ||
  26235. meridiem === 'रात्री'
  26236. ) {
  26237. return hour >= 12 ? hour : hour + 12;
  26238. }
  26239. },
  26240. meridiem: function (hour, minute, isLower) {
  26241. if (hour >= 0 && hour < 6) {
  26242. return 'पहाटे';
  26243. } else if (hour < 12) {
  26244. return 'सकाळी';
  26245. } else if (hour < 17) {
  26246. return 'दुपारी';
  26247. } else if (hour < 20) {
  26248. return 'सायंकाळी';
  26249. } else {
  26250. return 'रात्री';
  26251. }
  26252. },
  26253. week: {
  26254. dow: 0, // Sunday is the first day of the week.
  26255. doy: 6, // The week that contains Jan 6th is the first week of the year.
  26256. },
  26257. });
  26258. return mr;
  26259. })));
  26260. /***/ }),
  26261. /***/ "./node_modules/moment/locale/ms-my.js":
  26262. /*!*********************************************!*\
  26263. !*** ./node_modules/moment/locale/ms-my.js ***!
  26264. \*********************************************/
  26265. /*! no static exports found */
  26266. /***/ (function(module, exports, __webpack_require__) {
  26267. //! moment.js locale configuration
  26268. //! locale : Malay [ms-my]
  26269. //! note : DEPRECATED, the correct one is [ms]
  26270. //! author : Weldan Jamili : https://github.com/weldan
  26271. ;(function (global, factory) {
  26272. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  26273. undefined
  26274. }(this, (function (moment) { 'use strict';
  26275. //! moment.js locale configuration
  26276. var msMy = moment.defineLocale('ms-my', {
  26277. months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split(
  26278. '_'
  26279. ),
  26280. monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
  26281. weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
  26282. weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
  26283. weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
  26284. longDateFormat: {
  26285. LT: 'HH.mm',
  26286. LTS: 'HH.mm.ss',
  26287. L: 'DD/MM/YYYY',
  26288. LL: 'D MMMM YYYY',
  26289. LLL: 'D MMMM YYYY [pukul] HH.mm',
  26290. LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',
  26291. },
  26292. meridiemParse: /pagi|tengahari|petang|malam/,
  26293. meridiemHour: function (hour, meridiem) {
  26294. if (hour === 12) {
  26295. hour = 0;
  26296. }
  26297. if (meridiem === 'pagi') {
  26298. return hour;
  26299. } else if (meridiem === 'tengahari') {
  26300. return hour >= 11 ? hour : hour + 12;
  26301. } else if (meridiem === 'petang' || meridiem === 'malam') {
  26302. return hour + 12;
  26303. }
  26304. },
  26305. meridiem: function (hours, minutes, isLower) {
  26306. if (hours < 11) {
  26307. return 'pagi';
  26308. } else if (hours < 15) {
  26309. return 'tengahari';
  26310. } else if (hours < 19) {
  26311. return 'petang';
  26312. } else {
  26313. return 'malam';
  26314. }
  26315. },
  26316. calendar: {
  26317. sameDay: '[Hari ini pukul] LT',
  26318. nextDay: '[Esok pukul] LT',
  26319. nextWeek: 'dddd [pukul] LT',
  26320. lastDay: '[Kelmarin pukul] LT',
  26321. lastWeek: 'dddd [lepas pukul] LT',
  26322. sameElse: 'L',
  26323. },
  26324. relativeTime: {
  26325. future: 'dalam %s',
  26326. past: '%s yang lepas',
  26327. s: 'beberapa saat',
  26328. ss: '%d saat',
  26329. m: 'seminit',
  26330. mm: '%d minit',
  26331. h: 'sejam',
  26332. hh: '%d jam',
  26333. d: 'sehari',
  26334. dd: '%d hari',
  26335. M: 'sebulan',
  26336. MM: '%d bulan',
  26337. y: 'setahun',
  26338. yy: '%d tahun',
  26339. },
  26340. week: {
  26341. dow: 1, // Monday is the first day of the week.
  26342. doy: 7, // The week that contains Jan 7th is the first week of the year.
  26343. },
  26344. });
  26345. return msMy;
  26346. })));
  26347. /***/ }),
  26348. /***/ "./node_modules/moment/locale/ms.js":
  26349. /*!******************************************!*\
  26350. !*** ./node_modules/moment/locale/ms.js ***!
  26351. \******************************************/
  26352. /*! no static exports found */
  26353. /***/ (function(module, exports, __webpack_require__) {
  26354. //! moment.js locale configuration
  26355. //! locale : Malay [ms]
  26356. //! author : Weldan Jamili : https://github.com/weldan
  26357. ;(function (global, factory) {
  26358. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  26359. undefined
  26360. }(this, (function (moment) { 'use strict';
  26361. //! moment.js locale configuration
  26362. var ms = moment.defineLocale('ms', {
  26363. months: 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split(
  26364. '_'
  26365. ),
  26366. monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'),
  26367. weekdays: 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'),
  26368. weekdaysShort: 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'),
  26369. weekdaysMin: 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'),
  26370. longDateFormat: {
  26371. LT: 'HH.mm',
  26372. LTS: 'HH.mm.ss',
  26373. L: 'DD/MM/YYYY',
  26374. LL: 'D MMMM YYYY',
  26375. LLL: 'D MMMM YYYY [pukul] HH.mm',
  26376. LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm',
  26377. },
  26378. meridiemParse: /pagi|tengahari|petang|malam/,
  26379. meridiemHour: function (hour, meridiem) {
  26380. if (hour === 12) {
  26381. hour = 0;
  26382. }
  26383. if (meridiem === 'pagi') {
  26384. return hour;
  26385. } else if (meridiem === 'tengahari') {
  26386. return hour >= 11 ? hour : hour + 12;
  26387. } else if (meridiem === 'petang' || meridiem === 'malam') {
  26388. return hour + 12;
  26389. }
  26390. },
  26391. meridiem: function (hours, minutes, isLower) {
  26392. if (hours < 11) {
  26393. return 'pagi';
  26394. } else if (hours < 15) {
  26395. return 'tengahari';
  26396. } else if (hours < 19) {
  26397. return 'petang';
  26398. } else {
  26399. return 'malam';
  26400. }
  26401. },
  26402. calendar: {
  26403. sameDay: '[Hari ini pukul] LT',
  26404. nextDay: '[Esok pukul] LT',
  26405. nextWeek: 'dddd [pukul] LT',
  26406. lastDay: '[Kelmarin pukul] LT',
  26407. lastWeek: 'dddd [lepas pukul] LT',
  26408. sameElse: 'L',
  26409. },
  26410. relativeTime: {
  26411. future: 'dalam %s',
  26412. past: '%s yang lepas',
  26413. s: 'beberapa saat',
  26414. ss: '%d saat',
  26415. m: 'seminit',
  26416. mm: '%d minit',
  26417. h: 'sejam',
  26418. hh: '%d jam',
  26419. d: 'sehari',
  26420. dd: '%d hari',
  26421. M: 'sebulan',
  26422. MM: '%d bulan',
  26423. y: 'setahun',
  26424. yy: '%d tahun',
  26425. },
  26426. week: {
  26427. dow: 1, // Monday is the first day of the week.
  26428. doy: 7, // The week that contains Jan 7th is the first week of the year.
  26429. },
  26430. });
  26431. return ms;
  26432. })));
  26433. /***/ }),
  26434. /***/ "./node_modules/moment/locale/mt.js":
  26435. /*!******************************************!*\
  26436. !*** ./node_modules/moment/locale/mt.js ***!
  26437. \******************************************/
  26438. /*! no static exports found */
  26439. /***/ (function(module, exports, __webpack_require__) {
  26440. //! moment.js locale configuration
  26441. //! locale : Maltese (Malta) [mt]
  26442. //! author : Alessandro Maruccia : https://github.com/alesma
  26443. ;(function (global, factory) {
  26444. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  26445. undefined
  26446. }(this, (function (moment) { 'use strict';
  26447. //! moment.js locale configuration
  26448. var mt = moment.defineLocale('mt', {
  26449. months: 'Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru'.split(
  26450. '_'
  26451. ),
  26452. monthsShort: 'Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ'.split('_'),
  26453. weekdays: 'Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt'.split(
  26454. '_'
  26455. ),
  26456. weekdaysShort: 'Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib'.split('_'),
  26457. weekdaysMin: 'Ħa_Tn_Tl_Er_Ħa_Ġi_Si'.split('_'),
  26458. longDateFormat: {
  26459. LT: 'HH:mm',
  26460. LTS: 'HH:mm:ss',
  26461. L: 'DD/MM/YYYY',
  26462. LL: 'D MMMM YYYY',
  26463. LLL: 'D MMMM YYYY HH:mm',
  26464. LLLL: 'dddd, D MMMM YYYY HH:mm',
  26465. },
  26466. calendar: {
  26467. sameDay: '[Illum fil-]LT',
  26468. nextDay: '[Għada fil-]LT',
  26469. nextWeek: 'dddd [fil-]LT',
  26470. lastDay: '[Il-bieraħ fil-]LT',
  26471. lastWeek: 'dddd [li għadda] [fil-]LT',
  26472. sameElse: 'L',
  26473. },
  26474. relativeTime: {
  26475. future: 'f’ %s',
  26476. past: '%s ilu',
  26477. s: 'ftit sekondi',
  26478. ss: '%d sekondi',
  26479. m: 'minuta',
  26480. mm: '%d minuti',
  26481. h: 'siegħa',
  26482. hh: '%d siegħat',
  26483. d: 'ġurnata',
  26484. dd: '%d ġranet',
  26485. M: 'xahar',
  26486. MM: '%d xhur',
  26487. y: 'sena',
  26488. yy: '%d sni',
  26489. },
  26490. dayOfMonthOrdinalParse: /\d{1,2}º/,
  26491. ordinal: '%dº',
  26492. week: {
  26493. dow: 1, // Monday is the first day of the week.
  26494. doy: 4, // The week that contains Jan 4th is the first week of the year.
  26495. },
  26496. });
  26497. return mt;
  26498. })));
  26499. /***/ }),
  26500. /***/ "./node_modules/moment/locale/my.js":
  26501. /*!******************************************!*\
  26502. !*** ./node_modules/moment/locale/my.js ***!
  26503. \******************************************/
  26504. /*! no static exports found */
  26505. /***/ (function(module, exports, __webpack_require__) {
  26506. //! moment.js locale configuration
  26507. //! locale : Burmese [my]
  26508. //! author : Squar team, mysquar.com
  26509. //! author : David Rossellat : https://github.com/gholadr
  26510. //! author : Tin Aung Lin : https://github.com/thanyawzinmin
  26511. ;(function (global, factory) {
  26512. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  26513. undefined
  26514. }(this, (function (moment) { 'use strict';
  26515. //! moment.js locale configuration
  26516. var symbolMap = {
  26517. 1: '၁',
  26518. 2: '၂',
  26519. 3: '၃',
  26520. 4: '၄',
  26521. 5: '၅',
  26522. 6: '၆',
  26523. 7: '၇',
  26524. 8: '၈',
  26525. 9: '၉',
  26526. 0: '၀',
  26527. },
  26528. numberMap = {
  26529. '၁': '1',
  26530. '၂': '2',
  26531. '၃': '3',
  26532. '၄': '4',
  26533. '၅': '5',
  26534. '၆': '6',
  26535. '၇': '7',
  26536. '၈': '8',
  26537. '၉': '9',
  26538. '၀': '0',
  26539. };
  26540. var my = moment.defineLocale('my', {
  26541. months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split(
  26542. '_'
  26543. ),
  26544. monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'),
  26545. weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split(
  26546. '_'
  26547. ),
  26548. weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
  26549. weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'),
  26550. longDateFormat: {
  26551. LT: 'HH:mm',
  26552. LTS: 'HH:mm:ss',
  26553. L: 'DD/MM/YYYY',
  26554. LL: 'D MMMM YYYY',
  26555. LLL: 'D MMMM YYYY HH:mm',
  26556. LLLL: 'dddd D MMMM YYYY HH:mm',
  26557. },
  26558. calendar: {
  26559. sameDay: '[ယနေ.] LT [မှာ]',
  26560. nextDay: '[မနက်ဖြန်] LT [မှာ]',
  26561. nextWeek: 'dddd LT [မှာ]',
  26562. lastDay: '[မနေ.က] LT [မှာ]',
  26563. lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]',
  26564. sameElse: 'L',
  26565. },
  26566. relativeTime: {
  26567. future: 'လာမည့် %s မှာ',
  26568. past: 'လွန်ခဲ့သော %s က',
  26569. s: 'စက္ကန်.အနည်းငယ်',
  26570. ss: '%d စက္ကန့်',
  26571. m: 'တစ်မိနစ်',
  26572. mm: '%d မိနစ်',
  26573. h: 'တစ်နာရီ',
  26574. hh: '%d နာရီ',
  26575. d: 'တစ်ရက်',
  26576. dd: '%d ရက်',
  26577. M: 'တစ်လ',
  26578. MM: '%d လ',
  26579. y: 'တစ်နှစ်',
  26580. yy: '%d နှစ်',
  26581. },
  26582. preparse: function (string) {
  26583. return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) {
  26584. return numberMap[match];
  26585. });
  26586. },
  26587. postformat: function (string) {
  26588. return string.replace(/\d/g, function (match) {
  26589. return symbolMap[match];
  26590. });
  26591. },
  26592. week: {
  26593. dow: 1, // Monday is the first day of the week.
  26594. doy: 4, // The week that contains Jan 4th is the first week of the year.
  26595. },
  26596. });
  26597. return my;
  26598. })));
  26599. /***/ }),
  26600. /***/ "./node_modules/moment/locale/nb.js":
  26601. /*!******************************************!*\
  26602. !*** ./node_modules/moment/locale/nb.js ***!
  26603. \******************************************/
  26604. /*! no static exports found */
  26605. /***/ (function(module, exports, __webpack_require__) {
  26606. //! moment.js locale configuration
  26607. //! locale : Norwegian Bokmål [nb]
  26608. //! authors : Espen Hovlandsdal : https://github.com/rexxars
  26609. //! Sigurd Gartmann : https://github.com/sigurdga
  26610. //! Stephen Ramthun : https://github.com/stephenramthun
  26611. ;(function (global, factory) {
  26612. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  26613. undefined
  26614. }(this, (function (moment) { 'use strict';
  26615. //! moment.js locale configuration
  26616. var nb = moment.defineLocale('nb', {
  26617. months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split(
  26618. '_'
  26619. ),
  26620. monthsShort: 'jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.'.split(
  26621. '_'
  26622. ),
  26623. monthsParseExact: true,
  26624. weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
  26625. weekdaysShort: 'sø._ma._ti._on._to._fr._lø.'.split('_'),
  26626. weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'),
  26627. weekdaysParseExact: true,
  26628. longDateFormat: {
  26629. LT: 'HH:mm',
  26630. LTS: 'HH:mm:ss',
  26631. L: 'DD.MM.YYYY',
  26632. LL: 'D. MMMM YYYY',
  26633. LLL: 'D. MMMM YYYY [kl.] HH:mm',
  26634. LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm',
  26635. },
  26636. calendar: {
  26637. sameDay: '[i dag kl.] LT',
  26638. nextDay: '[i morgen kl.] LT',
  26639. nextWeek: 'dddd [kl.] LT',
  26640. lastDay: '[i går kl.] LT',
  26641. lastWeek: '[forrige] dddd [kl.] LT',
  26642. sameElse: 'L',
  26643. },
  26644. relativeTime: {
  26645. future: 'om %s',
  26646. past: '%s siden',
  26647. s: 'noen sekunder',
  26648. ss: '%d sekunder',
  26649. m: 'ett minutt',
  26650. mm: '%d minutter',
  26651. h: 'en time',
  26652. hh: '%d timer',
  26653. d: 'en dag',
  26654. dd: '%d dager',
  26655. w: 'en uke',
  26656. ww: '%d uker',
  26657. M: 'en måned',
  26658. MM: '%d måneder',
  26659. y: 'ett år',
  26660. yy: '%d år',
  26661. },
  26662. dayOfMonthOrdinalParse: /\d{1,2}\./,
  26663. ordinal: '%d.',
  26664. week: {
  26665. dow: 1, // Monday is the first day of the week.
  26666. doy: 4, // The week that contains Jan 4th is the first week of the year.
  26667. },
  26668. });
  26669. return nb;
  26670. })));
  26671. /***/ }),
  26672. /***/ "./node_modules/moment/locale/ne.js":
  26673. /*!******************************************!*\
  26674. !*** ./node_modules/moment/locale/ne.js ***!
  26675. \******************************************/
  26676. /*! no static exports found */
  26677. /***/ (function(module, exports, __webpack_require__) {
  26678. //! moment.js locale configuration
  26679. //! locale : Nepalese [ne]
  26680. //! author : suvash : https://github.com/suvash
  26681. ;(function (global, factory) {
  26682. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  26683. undefined
  26684. }(this, (function (moment) { 'use strict';
  26685. //! moment.js locale configuration
  26686. var symbolMap = {
  26687. 1: '१',
  26688. 2: '२',
  26689. 3: '३',
  26690. 4: '४',
  26691. 5: '५',
  26692. 6: '६',
  26693. 7: '७',
  26694. 8: '८',
  26695. 9: '९',
  26696. 0: '०',
  26697. },
  26698. numberMap = {
  26699. '१': '1',
  26700. '२': '2',
  26701. '३': '3',
  26702. '४': '4',
  26703. '५': '5',
  26704. '६': '6',
  26705. '७': '7',
  26706. '८': '8',
  26707. '९': '9',
  26708. '०': '0',
  26709. };
  26710. var ne = moment.defineLocale('ne', {
  26711. months: 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split(
  26712. '_'
  26713. ),
  26714. monthsShort: 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split(
  26715. '_'
  26716. ),
  26717. monthsParseExact: true,
  26718. weekdays: 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split(
  26719. '_'
  26720. ),
  26721. weekdaysShort: 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'),
  26722. weekdaysMin: 'आ._सो._मं._बु._बि._शु._श.'.split('_'),
  26723. weekdaysParseExact: true,
  26724. longDateFormat: {
  26725. LT: 'Aको h:mm बजे',
  26726. LTS: 'Aको h:mm:ss बजे',
  26727. L: 'DD/MM/YYYY',
  26728. LL: 'D MMMM YYYY',
  26729. LLL: 'D MMMM YYYY, Aको h:mm बजे',
  26730. LLLL: 'dddd, D MMMM YYYY, Aको h:mm बजे',
  26731. },
  26732. preparse: function (string) {
  26733. return string.replace(/[१२३४५६७८९०]/g, function (match) {
  26734. return numberMap[match];
  26735. });
  26736. },
  26737. postformat: function (string) {
  26738. return string.replace(/\d/g, function (match) {
  26739. return symbolMap[match];
  26740. });
  26741. },
  26742. meridiemParse: /राति|बिहान|दिउँसो|साँझ/,
  26743. meridiemHour: function (hour, meridiem) {
  26744. if (hour === 12) {
  26745. hour = 0;
  26746. }
  26747. if (meridiem === 'राति') {
  26748. return hour < 4 ? hour : hour + 12;
  26749. } else if (meridiem === 'बिहान') {
  26750. return hour;
  26751. } else if (meridiem === 'दिउँसो') {
  26752. return hour >= 10 ? hour : hour + 12;
  26753. } else if (meridiem === 'साँझ') {
  26754. return hour + 12;
  26755. }
  26756. },
  26757. meridiem: function (hour, minute, isLower) {
  26758. if (hour < 3) {
  26759. return 'राति';
  26760. } else if (hour < 12) {
  26761. return 'बिहान';
  26762. } else if (hour < 16) {
  26763. return 'दिउँसो';
  26764. } else if (hour < 20) {
  26765. return 'साँझ';
  26766. } else {
  26767. return 'राति';
  26768. }
  26769. },
  26770. calendar: {
  26771. sameDay: '[आज] LT',
  26772. nextDay: '[भोलि] LT',
  26773. nextWeek: '[आउँदो] dddd[,] LT',
  26774. lastDay: '[हिजो] LT',
  26775. lastWeek: '[गएको] dddd[,] LT',
  26776. sameElse: 'L',
  26777. },
  26778. relativeTime: {
  26779. future: '%sमा',
  26780. past: '%s अगाडि',
  26781. s: 'केही क्षण',
  26782. ss: '%d सेकेण्ड',
  26783. m: 'एक मिनेट',
  26784. mm: '%d मिनेट',
  26785. h: 'एक घण्टा',
  26786. hh: '%d घण्टा',
  26787. d: 'एक दिन',
  26788. dd: '%d दिन',
  26789. M: 'एक महिना',
  26790. MM: '%d महिना',
  26791. y: 'एक बर्ष',
  26792. yy: '%d बर्ष',
  26793. },
  26794. week: {
  26795. dow: 0, // Sunday is the first day of the week.
  26796. doy: 6, // The week that contains Jan 6th is the first week of the year.
  26797. },
  26798. });
  26799. return ne;
  26800. })));
  26801. /***/ }),
  26802. /***/ "./node_modules/moment/locale/nl-be.js":
  26803. /*!*********************************************!*\
  26804. !*** ./node_modules/moment/locale/nl-be.js ***!
  26805. \*********************************************/
  26806. /*! no static exports found */
  26807. /***/ (function(module, exports, __webpack_require__) {
  26808. //! moment.js locale configuration
  26809. //! locale : Dutch (Belgium) [nl-be]
  26810. //! author : Joris Röling : https://github.com/jorisroling
  26811. //! author : Jacob Middag : https://github.com/middagj
  26812. ;(function (global, factory) {
  26813. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  26814. undefined
  26815. }(this, (function (moment) { 'use strict';
  26816. //! moment.js locale configuration
  26817. var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split(
  26818. '_'
  26819. ),
  26820. monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split(
  26821. '_'
  26822. ),
  26823. monthsParse = [
  26824. /^jan/i,
  26825. /^feb/i,
  26826. /^maart|mrt.?$/i,
  26827. /^apr/i,
  26828. /^mei$/i,
  26829. /^jun[i.]?$/i,
  26830. /^jul[i.]?$/i,
  26831. /^aug/i,
  26832. /^sep/i,
  26833. /^okt/i,
  26834. /^nov/i,
  26835. /^dec/i,
  26836. ],
  26837. 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;
  26838. var nlBe = moment.defineLocale('nl-be', {
  26839. months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split(
  26840. '_'
  26841. ),
  26842. monthsShort: function (m, format) {
  26843. if (!m) {
  26844. return monthsShortWithDots;
  26845. } else if (/-MMM-/.test(format)) {
  26846. return monthsShortWithoutDots[m.month()];
  26847. } else {
  26848. return monthsShortWithDots[m.month()];
  26849. }
  26850. },
  26851. monthsRegex: monthsRegex,
  26852. monthsShortRegex: monthsRegex,
  26853. monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,
  26854. monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
  26855. monthsParse: monthsParse,
  26856. longMonthsParse: monthsParse,
  26857. shortMonthsParse: monthsParse,
  26858. weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split(
  26859. '_'
  26860. ),
  26861. weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),
  26862. weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),
  26863. weekdaysParseExact: true,
  26864. longDateFormat: {
  26865. LT: 'HH:mm',
  26866. LTS: 'HH:mm:ss',
  26867. L: 'DD/MM/YYYY',
  26868. LL: 'D MMMM YYYY',
  26869. LLL: 'D MMMM YYYY HH:mm',
  26870. LLLL: 'dddd D MMMM YYYY HH:mm',
  26871. },
  26872. calendar: {
  26873. sameDay: '[vandaag om] LT',
  26874. nextDay: '[morgen om] LT',
  26875. nextWeek: 'dddd [om] LT',
  26876. lastDay: '[gisteren om] LT',
  26877. lastWeek: '[afgelopen] dddd [om] LT',
  26878. sameElse: 'L',
  26879. },
  26880. relativeTime: {
  26881. future: 'over %s',
  26882. past: '%s geleden',
  26883. s: 'een paar seconden',
  26884. ss: '%d seconden',
  26885. m: 'één minuut',
  26886. mm: '%d minuten',
  26887. h: 'één uur',
  26888. hh: '%d uur',
  26889. d: 'één dag',
  26890. dd: '%d dagen',
  26891. M: 'één maand',
  26892. MM: '%d maanden',
  26893. y: 'één jaar',
  26894. yy: '%d jaar',
  26895. },
  26896. dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
  26897. ordinal: function (number) {
  26898. return (
  26899. number +
  26900. (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')
  26901. );
  26902. },
  26903. week: {
  26904. dow: 1, // Monday is the first day of the week.
  26905. doy: 4, // The week that contains Jan 4th is the first week of the year.
  26906. },
  26907. });
  26908. return nlBe;
  26909. })));
  26910. /***/ }),
  26911. /***/ "./node_modules/moment/locale/nl.js":
  26912. /*!******************************************!*\
  26913. !*** ./node_modules/moment/locale/nl.js ***!
  26914. \******************************************/
  26915. /*! no static exports found */
  26916. /***/ (function(module, exports, __webpack_require__) {
  26917. //! moment.js locale configuration
  26918. //! locale : Dutch [nl]
  26919. //! author : Joris Röling : https://github.com/jorisroling
  26920. //! author : Jacob Middag : https://github.com/middagj
  26921. ;(function (global, factory) {
  26922. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  26923. undefined
  26924. }(this, (function (moment) { 'use strict';
  26925. //! moment.js locale configuration
  26926. var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split(
  26927. '_'
  26928. ),
  26929. monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split(
  26930. '_'
  26931. ),
  26932. monthsParse = [
  26933. /^jan/i,
  26934. /^feb/i,
  26935. /^maart|mrt.?$/i,
  26936. /^apr/i,
  26937. /^mei$/i,
  26938. /^jun[i.]?$/i,
  26939. /^jul[i.]?$/i,
  26940. /^aug/i,
  26941. /^sep/i,
  26942. /^okt/i,
  26943. /^nov/i,
  26944. /^dec/i,
  26945. ],
  26946. 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;
  26947. var nl = moment.defineLocale('nl', {
  26948. months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split(
  26949. '_'
  26950. ),
  26951. monthsShort: function (m, format) {
  26952. if (!m) {
  26953. return monthsShortWithDots;
  26954. } else if (/-MMM-/.test(format)) {
  26955. return monthsShortWithoutDots[m.month()];
  26956. } else {
  26957. return monthsShortWithDots[m.month()];
  26958. }
  26959. },
  26960. monthsRegex: monthsRegex,
  26961. monthsShortRegex: monthsRegex,
  26962. monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i,
  26963. monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
  26964. monthsParse: monthsParse,
  26965. longMonthsParse: monthsParse,
  26966. shortMonthsParse: monthsParse,
  26967. weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split(
  26968. '_'
  26969. ),
  26970. weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),
  26971. weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),
  26972. weekdaysParseExact: true,
  26973. longDateFormat: {
  26974. LT: 'HH:mm',
  26975. LTS: 'HH:mm:ss',
  26976. L: 'DD-MM-YYYY',
  26977. LL: 'D MMMM YYYY',
  26978. LLL: 'D MMMM YYYY HH:mm',
  26979. LLLL: 'dddd D MMMM YYYY HH:mm',
  26980. },
  26981. calendar: {
  26982. sameDay: '[vandaag om] LT',
  26983. nextDay: '[morgen om] LT',
  26984. nextWeek: 'dddd [om] LT',
  26985. lastDay: '[gisteren om] LT',
  26986. lastWeek: '[afgelopen] dddd [om] LT',
  26987. sameElse: 'L',
  26988. },
  26989. relativeTime: {
  26990. future: 'over %s',
  26991. past: '%s geleden',
  26992. s: 'een paar seconden',
  26993. ss: '%d seconden',
  26994. m: 'één minuut',
  26995. mm: '%d minuten',
  26996. h: 'één uur',
  26997. hh: '%d uur',
  26998. d: 'één dag',
  26999. dd: '%d dagen',
  27000. w: 'één week',
  27001. ww: '%d weken',
  27002. M: 'één maand',
  27003. MM: '%d maanden',
  27004. y: 'één jaar',
  27005. yy: '%d jaar',
  27006. },
  27007. dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
  27008. ordinal: function (number) {
  27009. return (
  27010. number +
  27011. (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de')
  27012. );
  27013. },
  27014. week: {
  27015. dow: 1, // Monday is the first day of the week.
  27016. doy: 4, // The week that contains Jan 4th is the first week of the year.
  27017. },
  27018. });
  27019. return nl;
  27020. })));
  27021. /***/ }),
  27022. /***/ "./node_modules/moment/locale/nn.js":
  27023. /*!******************************************!*\
  27024. !*** ./node_modules/moment/locale/nn.js ***!
  27025. \******************************************/
  27026. /*! no static exports found */
  27027. /***/ (function(module, exports, __webpack_require__) {
  27028. //! moment.js locale configuration
  27029. //! locale : Nynorsk [nn]
  27030. //! authors : https://github.com/mechuwind
  27031. //! Stephen Ramthun : https://github.com/stephenramthun
  27032. ;(function (global, factory) {
  27033. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  27034. undefined
  27035. }(this, (function (moment) { 'use strict';
  27036. //! moment.js locale configuration
  27037. var nn = moment.defineLocale('nn', {
  27038. months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split(
  27039. '_'
  27040. ),
  27041. monthsShort: 'jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.'.split(
  27042. '_'
  27043. ),
  27044. monthsParseExact: true,
  27045. weekdays: 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'),
  27046. weekdaysShort: 'su._må._ty._on._to._fr._lau.'.split('_'),
  27047. weekdaysMin: 'su_må_ty_on_to_fr_la'.split('_'),
  27048. weekdaysParseExact: true,
  27049. longDateFormat: {
  27050. LT: 'HH:mm',
  27051. LTS: 'HH:mm:ss',
  27052. L: 'DD.MM.YYYY',
  27053. LL: 'D. MMMM YYYY',
  27054. LLL: 'D. MMMM YYYY [kl.] H:mm',
  27055. LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm',
  27056. },
  27057. calendar: {
  27058. sameDay: '[I dag klokka] LT',
  27059. nextDay: '[I morgon klokka] LT',
  27060. nextWeek: 'dddd [klokka] LT',
  27061. lastDay: '[I går klokka] LT',
  27062. lastWeek: '[Føregåande] dddd [klokka] LT',
  27063. sameElse: 'L',
  27064. },
  27065. relativeTime: {
  27066. future: 'om %s',
  27067. past: '%s sidan',
  27068. s: 'nokre sekund',
  27069. ss: '%d sekund',
  27070. m: 'eit minutt',
  27071. mm: '%d minutt',
  27072. h: 'ein time',
  27073. hh: '%d timar',
  27074. d: 'ein dag',
  27075. dd: '%d dagar',
  27076. w: 'ei veke',
  27077. ww: '%d veker',
  27078. M: 'ein månad',
  27079. MM: '%d månader',
  27080. y: 'eit år',
  27081. yy: '%d år',
  27082. },
  27083. dayOfMonthOrdinalParse: /\d{1,2}\./,
  27084. ordinal: '%d.',
  27085. week: {
  27086. dow: 1, // Monday is the first day of the week.
  27087. doy: 4, // The week that contains Jan 4th is the first week of the year.
  27088. },
  27089. });
  27090. return nn;
  27091. })));
  27092. /***/ }),
  27093. /***/ "./node_modules/moment/locale/oc-lnc.js":
  27094. /*!**********************************************!*\
  27095. !*** ./node_modules/moment/locale/oc-lnc.js ***!
  27096. \**********************************************/
  27097. /*! no static exports found */
  27098. /***/ (function(module, exports, __webpack_require__) {
  27099. //! moment.js locale configuration
  27100. //! locale : Occitan, lengadocian dialecte [oc-lnc]
  27101. //! author : Quentin PAGÈS : https://github.com/Quenty31
  27102. ;(function (global, factory) {
  27103. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  27104. undefined
  27105. }(this, (function (moment) { 'use strict';
  27106. //! moment.js locale configuration
  27107. var ocLnc = moment.defineLocale('oc-lnc', {
  27108. months: {
  27109. standalone: 'genièr_febrièr_març_abril_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre'.split(
  27110. '_'
  27111. ),
  27112. 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(
  27113. '_'
  27114. ),
  27115. isFormat: /D[oD]?(\s)+MMMM/,
  27116. },
  27117. monthsShort: 'gen._febr._març_abr._mai_junh_julh._ago._set._oct._nov._dec.'.split(
  27118. '_'
  27119. ),
  27120. monthsParseExact: true,
  27121. weekdays: 'dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte'.split(
  27122. '_'
  27123. ),
  27124. weekdaysShort: 'dg._dl._dm._dc._dj._dv._ds.'.split('_'),
  27125. weekdaysMin: 'dg_dl_dm_dc_dj_dv_ds'.split('_'),
  27126. weekdaysParseExact: true,
  27127. longDateFormat: {
  27128. LT: 'H:mm',
  27129. LTS: 'H:mm:ss',
  27130. L: 'DD/MM/YYYY',
  27131. LL: 'D MMMM [de] YYYY',
  27132. ll: 'D MMM YYYY',
  27133. LLL: 'D MMMM [de] YYYY [a] H:mm',
  27134. lll: 'D MMM YYYY, H:mm',
  27135. LLLL: 'dddd D MMMM [de] YYYY [a] H:mm',
  27136. llll: 'ddd D MMM YYYY, H:mm',
  27137. },
  27138. calendar: {
  27139. sameDay: '[uèi a] LT',
  27140. nextDay: '[deman a] LT',
  27141. nextWeek: 'dddd [a] LT',
  27142. lastDay: '[ièr a] LT',
  27143. lastWeek: 'dddd [passat a] LT',
  27144. sameElse: 'L',
  27145. },
  27146. relativeTime: {
  27147. future: "d'aquí %s",
  27148. past: 'fa %s',
  27149. s: 'unas segondas',
  27150. ss: '%d segondas',
  27151. m: 'una minuta',
  27152. mm: '%d minutas',
  27153. h: 'una ora',
  27154. hh: '%d oras',
  27155. d: 'un jorn',
  27156. dd: '%d jorns',
  27157. M: 'un mes',
  27158. MM: '%d meses',
  27159. y: 'un an',
  27160. yy: '%d ans',
  27161. },
  27162. dayOfMonthOrdinalParse: /\d{1,2}(r|n|t|è|a)/,
  27163. ordinal: function (number, period) {
  27164. var output =
  27165. number === 1
  27166. ? 'r'
  27167. : number === 2
  27168. ? 'n'
  27169. : number === 3
  27170. ? 'r'
  27171. : number === 4
  27172. ? 't'
  27173. : 'è';
  27174. if (period === 'w' || period === 'W') {
  27175. output = 'a';
  27176. }
  27177. return number + output;
  27178. },
  27179. week: {
  27180. dow: 1, // Monday is the first day of the week.
  27181. doy: 4,
  27182. },
  27183. });
  27184. return ocLnc;
  27185. })));
  27186. /***/ }),
  27187. /***/ "./node_modules/moment/locale/pa-in.js":
  27188. /*!*********************************************!*\
  27189. !*** ./node_modules/moment/locale/pa-in.js ***!
  27190. \*********************************************/
  27191. /*! no static exports found */
  27192. /***/ (function(module, exports, __webpack_require__) {
  27193. //! moment.js locale configuration
  27194. //! locale : Punjabi (India) [pa-in]
  27195. //! author : Harpreet Singh : https://github.com/harpreetkhalsagtbit
  27196. ;(function (global, factory) {
  27197. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  27198. undefined
  27199. }(this, (function (moment) { 'use strict';
  27200. //! moment.js locale configuration
  27201. var symbolMap = {
  27202. 1: '੧',
  27203. 2: '੨',
  27204. 3: '੩',
  27205. 4: '੪',
  27206. 5: '੫',
  27207. 6: '੬',
  27208. 7: '੭',
  27209. 8: '੮',
  27210. 9: '੯',
  27211. 0: '੦',
  27212. },
  27213. numberMap = {
  27214. '੧': '1',
  27215. '੨': '2',
  27216. '੩': '3',
  27217. '੪': '4',
  27218. '੫': '5',
  27219. '੬': '6',
  27220. '੭': '7',
  27221. '੮': '8',
  27222. '੯': '9',
  27223. '੦': '0',
  27224. };
  27225. var paIn = moment.defineLocale('pa-in', {
  27226. // There are months name as per Nanakshahi Calendar but they are not used as rigidly in modern Punjabi.
  27227. months: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split(
  27228. '_'
  27229. ),
  27230. monthsShort: 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split(
  27231. '_'
  27232. ),
  27233. weekdays: 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split(
  27234. '_'
  27235. ),
  27236. weekdaysShort: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
  27237. weekdaysMin: 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'),
  27238. longDateFormat: {
  27239. LT: 'A h:mm ਵਜੇ',
  27240. LTS: 'A h:mm:ss ਵਜੇ',
  27241. L: 'DD/MM/YYYY',
  27242. LL: 'D MMMM YYYY',
  27243. LLL: 'D MMMM YYYY, A h:mm ਵਜੇ',
  27244. LLLL: 'dddd, D MMMM YYYY, A h:mm ਵਜੇ',
  27245. },
  27246. calendar: {
  27247. sameDay: '[ਅਜ] LT',
  27248. nextDay: '[ਕਲ] LT',
  27249. nextWeek: '[ਅਗਲਾ] dddd, LT',
  27250. lastDay: '[ਕਲ] LT',
  27251. lastWeek: '[ਪਿਛਲੇ] dddd, LT',
  27252. sameElse: 'L',
  27253. },
  27254. relativeTime: {
  27255. future: '%s ਵਿੱਚ',
  27256. past: '%s ਪਿਛਲੇ',
  27257. s: 'ਕੁਝ ਸਕਿੰਟ',
  27258. ss: '%d ਸਕਿੰਟ',
  27259. m: 'ਇਕ ਮਿੰਟ',
  27260. mm: '%d ਮਿੰਟ',
  27261. h: 'ਇੱਕ ਘੰਟਾ',
  27262. hh: '%d ਘੰਟੇ',
  27263. d: 'ਇੱਕ ਦਿਨ',
  27264. dd: '%d ਦਿਨ',
  27265. M: 'ਇੱਕ ਮਹੀਨਾ',
  27266. MM: '%d ਮਹੀਨੇ',
  27267. y: 'ਇੱਕ ਸਾਲ',
  27268. yy: '%d ਸਾਲ',
  27269. },
  27270. preparse: function (string) {
  27271. return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) {
  27272. return numberMap[match];
  27273. });
  27274. },
  27275. postformat: function (string) {
  27276. return string.replace(/\d/g, function (match) {
  27277. return symbolMap[match];
  27278. });
  27279. },
  27280. // Punjabi notation for meridiems are quite fuzzy in practice. While there exists
  27281. // a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi.
  27282. meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/,
  27283. meridiemHour: function (hour, meridiem) {
  27284. if (hour === 12) {
  27285. hour = 0;
  27286. }
  27287. if (meridiem === 'ਰਾਤ') {
  27288. return hour < 4 ? hour : hour + 12;
  27289. } else if (meridiem === 'ਸਵੇਰ') {
  27290. return hour;
  27291. } else if (meridiem === 'ਦੁਪਹਿਰ') {
  27292. return hour >= 10 ? hour : hour + 12;
  27293. } else if (meridiem === 'ਸ਼ਾਮ') {
  27294. return hour + 12;
  27295. }
  27296. },
  27297. meridiem: function (hour, minute, isLower) {
  27298. if (hour < 4) {
  27299. return 'ਰਾਤ';
  27300. } else if (hour < 10) {
  27301. return 'ਸਵੇਰ';
  27302. } else if (hour < 17) {
  27303. return 'ਦੁਪਹਿਰ';
  27304. } else if (hour < 20) {
  27305. return 'ਸ਼ਾਮ';
  27306. } else {
  27307. return 'ਰਾਤ';
  27308. }
  27309. },
  27310. week: {
  27311. dow: 0, // Sunday is the first day of the week.
  27312. doy: 6, // The week that contains Jan 6th is the first week of the year.
  27313. },
  27314. });
  27315. return paIn;
  27316. })));
  27317. /***/ }),
  27318. /***/ "./node_modules/moment/locale/pl.js":
  27319. /*!******************************************!*\
  27320. !*** ./node_modules/moment/locale/pl.js ***!
  27321. \******************************************/
  27322. /*! no static exports found */
  27323. /***/ (function(module, exports, __webpack_require__) {
  27324. //! moment.js locale configuration
  27325. //! locale : Polish [pl]
  27326. //! author : Rafal Hirsz : https://github.com/evoL
  27327. ;(function (global, factory) {
  27328. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  27329. undefined
  27330. }(this, (function (moment) { 'use strict';
  27331. //! moment.js locale configuration
  27332. var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split(
  27333. '_'
  27334. ),
  27335. monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split(
  27336. '_'
  27337. ),
  27338. monthsParse = [
  27339. /^sty/i,
  27340. /^lut/i,
  27341. /^mar/i,
  27342. /^kwi/i,
  27343. /^maj/i,
  27344. /^cze/i,
  27345. /^lip/i,
  27346. /^sie/i,
  27347. /^wrz/i,
  27348. /^paź/i,
  27349. /^lis/i,
  27350. /^gru/i,
  27351. ];
  27352. function plural(n) {
  27353. return n % 10 < 5 && n % 10 > 1 && ~~(n / 10) % 10 !== 1;
  27354. }
  27355. function translate(number, withoutSuffix, key) {
  27356. var result = number + ' ';
  27357. switch (key) {
  27358. case 'ss':
  27359. return result + (plural(number) ? 'sekundy' : 'sekund');
  27360. case 'm':
  27361. return withoutSuffix ? 'minuta' : 'minutę';
  27362. case 'mm':
  27363. return result + (plural(number) ? 'minuty' : 'minut');
  27364. case 'h':
  27365. return withoutSuffix ? 'godzina' : 'godzinę';
  27366. case 'hh':
  27367. return result + (plural(number) ? 'godziny' : 'godzin');
  27368. case 'ww':
  27369. return result + (plural(number) ? 'tygodnie' : 'tygodni');
  27370. case 'MM':
  27371. return result + (plural(number) ? 'miesiące' : 'miesięcy');
  27372. case 'yy':
  27373. return result + (plural(number) ? 'lata' : 'lat');
  27374. }
  27375. }
  27376. var pl = moment.defineLocale('pl', {
  27377. months: function (momentToFormat, format) {
  27378. if (!momentToFormat) {
  27379. return monthsNominative;
  27380. } else if (/D MMMM/.test(format)) {
  27381. return monthsSubjective[momentToFormat.month()];
  27382. } else {
  27383. return monthsNominative[momentToFormat.month()];
  27384. }
  27385. },
  27386. monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),
  27387. monthsParse: monthsParse,
  27388. longMonthsParse: monthsParse,
  27389. shortMonthsParse: monthsParse,
  27390. weekdays: 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split(
  27391. '_'
  27392. ),
  27393. weekdaysShort: 'ndz_pon_wt_śr_czw_pt_sob'.split('_'),
  27394. weekdaysMin: 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),
  27395. longDateFormat: {
  27396. LT: 'HH:mm',
  27397. LTS: 'HH:mm:ss',
  27398. L: 'DD.MM.YYYY',
  27399. LL: 'D MMMM YYYY',
  27400. LLL: 'D MMMM YYYY HH:mm',
  27401. LLLL: 'dddd, D MMMM YYYY HH:mm',
  27402. },
  27403. calendar: {
  27404. sameDay: '[Dziś o] LT',
  27405. nextDay: '[Jutro o] LT',
  27406. nextWeek: function () {
  27407. switch (this.day()) {
  27408. case 0:
  27409. return '[W niedzielę o] LT';
  27410. case 2:
  27411. return '[We wtorek o] LT';
  27412. case 3:
  27413. return '[W środę o] LT';
  27414. case 6:
  27415. return '[W sobotę o] LT';
  27416. default:
  27417. return '[W] dddd [o] LT';
  27418. }
  27419. },
  27420. lastDay: '[Wczoraj o] LT',
  27421. lastWeek: function () {
  27422. switch (this.day()) {
  27423. case 0:
  27424. return '[W zeszłą niedzielę o] LT';
  27425. case 3:
  27426. return '[W zeszłą środę o] LT';
  27427. case 6:
  27428. return '[W zeszłą sobotę o] LT';
  27429. default:
  27430. return '[W zeszły] dddd [o] LT';
  27431. }
  27432. },
  27433. sameElse: 'L',
  27434. },
  27435. relativeTime: {
  27436. future: 'za %s',
  27437. past: '%s temu',
  27438. s: 'kilka sekund',
  27439. ss: translate,
  27440. m: translate,
  27441. mm: translate,
  27442. h: translate,
  27443. hh: translate,
  27444. d: '1 dzień',
  27445. dd: '%d dni',
  27446. w: 'tydzień',
  27447. ww: translate,
  27448. M: 'miesiąc',
  27449. MM: translate,
  27450. y: 'rok',
  27451. yy: translate,
  27452. },
  27453. dayOfMonthOrdinalParse: /\d{1,2}\./,
  27454. ordinal: '%d.',
  27455. week: {
  27456. dow: 1, // Monday is the first day of the week.
  27457. doy: 4, // The week that contains Jan 4th is the first week of the year.
  27458. },
  27459. });
  27460. return pl;
  27461. })));
  27462. /***/ }),
  27463. /***/ "./node_modules/moment/locale/pt-br.js":
  27464. /*!*********************************************!*\
  27465. !*** ./node_modules/moment/locale/pt-br.js ***!
  27466. \*********************************************/
  27467. /*! no static exports found */
  27468. /***/ (function(module, exports, __webpack_require__) {
  27469. //! moment.js locale configuration
  27470. //! locale : Portuguese (Brazil) [pt-br]
  27471. //! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira
  27472. ;(function (global, factory) {
  27473. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  27474. undefined
  27475. }(this, (function (moment) { 'use strict';
  27476. //! moment.js locale configuration
  27477. var ptBr = moment.defineLocale('pt-br', {
  27478. months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split(
  27479. '_'
  27480. ),
  27481. monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),
  27482. weekdays: 'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split(
  27483. '_'
  27484. ),
  27485. weekdaysShort: 'dom_seg_ter_qua_qui_sex_sáb'.split('_'),
  27486. weekdaysMin: 'do_2ª_3ª_4ª_5ª_6ª_sá'.split('_'),
  27487. weekdaysParseExact: true,
  27488. longDateFormat: {
  27489. LT: 'HH:mm',
  27490. LTS: 'HH:mm:ss',
  27491. L: 'DD/MM/YYYY',
  27492. LL: 'D [de] MMMM [de] YYYY',
  27493. LLL: 'D [de] MMMM [de] YYYY [às] HH:mm',
  27494. LLLL: 'dddd, D [de] MMMM [de] YYYY [às] HH:mm',
  27495. },
  27496. calendar: {
  27497. sameDay: '[Hoje às] LT',
  27498. nextDay: '[Amanhã às] LT',
  27499. nextWeek: 'dddd [às] LT',
  27500. lastDay: '[Ontem às] LT',
  27501. lastWeek: function () {
  27502. return this.day() === 0 || this.day() === 6
  27503. ? '[Último] dddd [às] LT' // Saturday + Sunday
  27504. : '[Última] dddd [às] LT'; // Monday - Friday
  27505. },
  27506. sameElse: 'L',
  27507. },
  27508. relativeTime: {
  27509. future: 'em %s',
  27510. past: 'há %s',
  27511. s: 'poucos segundos',
  27512. ss: '%d segundos',
  27513. m: 'um minuto',
  27514. mm: '%d minutos',
  27515. h: 'uma hora',
  27516. hh: '%d horas',
  27517. d: 'um dia',
  27518. dd: '%d dias',
  27519. M: 'um mês',
  27520. MM: '%d meses',
  27521. y: 'um ano',
  27522. yy: '%d anos',
  27523. },
  27524. dayOfMonthOrdinalParse: /\d{1,2}º/,
  27525. ordinal: '%dº',
  27526. invalidDate: 'Data inválida',
  27527. });
  27528. return ptBr;
  27529. })));
  27530. /***/ }),
  27531. /***/ "./node_modules/moment/locale/pt.js":
  27532. /*!******************************************!*\
  27533. !*** ./node_modules/moment/locale/pt.js ***!
  27534. \******************************************/
  27535. /*! no static exports found */
  27536. /***/ (function(module, exports, __webpack_require__) {
  27537. //! moment.js locale configuration
  27538. //! locale : Portuguese [pt]
  27539. //! author : Jefferson : https://github.com/jalex79
  27540. ;(function (global, factory) {
  27541. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  27542. undefined
  27543. }(this, (function (moment) { 'use strict';
  27544. //! moment.js locale configuration
  27545. var pt = moment.defineLocale('pt', {
  27546. months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split(
  27547. '_'
  27548. ),
  27549. monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),
  27550. weekdays: 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split(
  27551. '_'
  27552. ),
  27553. weekdaysShort: 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
  27554. weekdaysMin: 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'),
  27555. weekdaysParseExact: true,
  27556. longDateFormat: {
  27557. LT: 'HH:mm',
  27558. LTS: 'HH:mm:ss',
  27559. L: 'DD/MM/YYYY',
  27560. LL: 'D [de] MMMM [de] YYYY',
  27561. LLL: 'D [de] MMMM [de] YYYY HH:mm',
  27562. LLLL: 'dddd, D [de] MMMM [de] YYYY HH:mm',
  27563. },
  27564. calendar: {
  27565. sameDay: '[Hoje às] LT',
  27566. nextDay: '[Amanhã às] LT',
  27567. nextWeek: 'dddd [às] LT',
  27568. lastDay: '[Ontem às] LT',
  27569. lastWeek: function () {
  27570. return this.day() === 0 || this.day() === 6
  27571. ? '[Último] dddd [às] LT' // Saturday + Sunday
  27572. : '[Última] dddd [às] LT'; // Monday - Friday
  27573. },
  27574. sameElse: 'L',
  27575. },
  27576. relativeTime: {
  27577. future: 'em %s',
  27578. past: 'há %s',
  27579. s: 'segundos',
  27580. ss: '%d segundos',
  27581. m: 'um minuto',
  27582. mm: '%d minutos',
  27583. h: 'uma hora',
  27584. hh: '%d horas',
  27585. d: 'um dia',
  27586. dd: '%d dias',
  27587. w: 'uma semana',
  27588. ww: '%d semanas',
  27589. M: 'um mês',
  27590. MM: '%d meses',
  27591. y: 'um ano',
  27592. yy: '%d anos',
  27593. },
  27594. dayOfMonthOrdinalParse: /\d{1,2}º/,
  27595. ordinal: '%dº',
  27596. week: {
  27597. dow: 1, // Monday is the first day of the week.
  27598. doy: 4, // The week that contains Jan 4th is the first week of the year.
  27599. },
  27600. });
  27601. return pt;
  27602. })));
  27603. /***/ }),
  27604. /***/ "./node_modules/moment/locale/ro.js":
  27605. /*!******************************************!*\
  27606. !*** ./node_modules/moment/locale/ro.js ***!
  27607. \******************************************/
  27608. /*! no static exports found */
  27609. /***/ (function(module, exports, __webpack_require__) {
  27610. //! moment.js locale configuration
  27611. //! locale : Romanian [ro]
  27612. //! author : Vlad Gurdiga : https://github.com/gurdiga
  27613. //! author : Valentin Agachi : https://github.com/avaly
  27614. //! author : Emanuel Cepoi : https://github.com/cepem
  27615. ;(function (global, factory) {
  27616. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  27617. undefined
  27618. }(this, (function (moment) { 'use strict';
  27619. //! moment.js locale configuration
  27620. function relativeTimeWithPlural(number, withoutSuffix, key) {
  27621. var format = {
  27622. ss: 'secunde',
  27623. mm: 'minute',
  27624. hh: 'ore',
  27625. dd: 'zile',
  27626. ww: 'săptămâni',
  27627. MM: 'luni',
  27628. yy: 'ani',
  27629. },
  27630. separator = ' ';
  27631. if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) {
  27632. separator = ' de ';
  27633. }
  27634. return number + separator + format[key];
  27635. }
  27636. var ro = moment.defineLocale('ro', {
  27637. months: 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split(
  27638. '_'
  27639. ),
  27640. monthsShort: 'ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split(
  27641. '_'
  27642. ),
  27643. monthsParseExact: true,
  27644. weekdays: 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),
  27645. weekdaysShort: 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),
  27646. weekdaysMin: 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),
  27647. longDateFormat: {
  27648. LT: 'H:mm',
  27649. LTS: 'H:mm:ss',
  27650. L: 'DD.MM.YYYY',
  27651. LL: 'D MMMM YYYY',
  27652. LLL: 'D MMMM YYYY H:mm',
  27653. LLLL: 'dddd, D MMMM YYYY H:mm',
  27654. },
  27655. calendar: {
  27656. sameDay: '[azi la] LT',
  27657. nextDay: '[mâine la] LT',
  27658. nextWeek: 'dddd [la] LT',
  27659. lastDay: '[ieri la] LT',
  27660. lastWeek: '[fosta] dddd [la] LT',
  27661. sameElse: 'L',
  27662. },
  27663. relativeTime: {
  27664. future: 'peste %s',
  27665. past: '%s în urmă',
  27666. s: 'câteva secunde',
  27667. ss: relativeTimeWithPlural,
  27668. m: 'un minut',
  27669. mm: relativeTimeWithPlural,
  27670. h: 'o oră',
  27671. hh: relativeTimeWithPlural,
  27672. d: 'o zi',
  27673. dd: relativeTimeWithPlural,
  27674. w: 'o săptămână',
  27675. ww: relativeTimeWithPlural,
  27676. M: 'o lună',
  27677. MM: relativeTimeWithPlural,
  27678. y: 'un an',
  27679. yy: relativeTimeWithPlural,
  27680. },
  27681. week: {
  27682. dow: 1, // Monday is the first day of the week.
  27683. doy: 7, // The week that contains Jan 7th is the first week of the year.
  27684. },
  27685. });
  27686. return ro;
  27687. })));
  27688. /***/ }),
  27689. /***/ "./node_modules/moment/locale/ru.js":
  27690. /*!******************************************!*\
  27691. !*** ./node_modules/moment/locale/ru.js ***!
  27692. \******************************************/
  27693. /*! no static exports found */
  27694. /***/ (function(module, exports, __webpack_require__) {
  27695. //! moment.js locale configuration
  27696. //! locale : Russian [ru]
  27697. //! author : Viktorminator : https://github.com/Viktorminator
  27698. //! author : Menelion Elensúle : https://github.com/Oire
  27699. //! author : Коренберг Марк : https://github.com/socketpair
  27700. ;(function (global, factory) {
  27701. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  27702. undefined
  27703. }(this, (function (moment) { 'use strict';
  27704. //! moment.js locale configuration
  27705. function plural(word, num) {
  27706. var forms = word.split('_');
  27707. return num % 10 === 1 && num % 100 !== 11
  27708. ? forms[0]
  27709. : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)
  27710. ? forms[1]
  27711. : forms[2];
  27712. }
  27713. function relativeTimeWithPlural(number, withoutSuffix, key) {
  27714. var format = {
  27715. ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',
  27716. mm: withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',
  27717. hh: 'час_часа_часов',
  27718. dd: 'день_дня_дней',
  27719. ww: 'неделя_недели_недель',
  27720. MM: 'месяц_месяца_месяцев',
  27721. yy: 'год_года_лет',
  27722. };
  27723. if (key === 'm') {
  27724. return withoutSuffix ? 'минута' : 'минуту';
  27725. } else {
  27726. return number + ' ' + plural(format[key], +number);
  27727. }
  27728. }
  27729. var monthsParse = [
  27730. /^янв/i,
  27731. /^фев/i,
  27732. /^мар/i,
  27733. /^апр/i,
  27734. /^ма[йя]/i,
  27735. /^июн/i,
  27736. /^июл/i,
  27737. /^авг/i,
  27738. /^сен/i,
  27739. /^окт/i,
  27740. /^ноя/i,
  27741. /^дек/i,
  27742. ];
  27743. // http://new.gramota.ru/spravka/rules/139-prop : § 103
  27744. // Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637
  27745. // CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753
  27746. var ru = moment.defineLocale('ru', {
  27747. months: {
  27748. format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split(
  27749. '_'
  27750. ),
  27751. standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split(
  27752. '_'
  27753. ),
  27754. },
  27755. monthsShort: {
  27756. // по CLDR именно "июл." и "июн.", но какой смысл менять букву на точку?
  27757. format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split(
  27758. '_'
  27759. ),
  27760. standalone: 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split(
  27761. '_'
  27762. ),
  27763. },
  27764. weekdays: {
  27765. standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split(
  27766. '_'
  27767. ),
  27768. format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split(
  27769. '_'
  27770. ),
  27771. isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?] ?dddd/,
  27772. },
  27773. weekdaysShort: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
  27774. weekdaysMin: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
  27775. monthsParse: monthsParse,
  27776. longMonthsParse: monthsParse,
  27777. shortMonthsParse: monthsParse,
  27778. // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки
  27779. monthsRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
  27780. // копия предыдущего
  27781. monthsShortRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
  27782. // полные названия с падежами
  27783. monthsStrictRegex: /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,
  27784. // Выражение, которое соответствует только сокращённым формам
  27785. monthsShortStrictRegex: /^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,
  27786. longDateFormat: {
  27787. LT: 'H:mm',
  27788. LTS: 'H:mm:ss',
  27789. L: 'DD.MM.YYYY',
  27790. LL: 'D MMMM YYYY г.',
  27791. LLL: 'D MMMM YYYY г., H:mm',
  27792. LLLL: 'dddd, D MMMM YYYY г., H:mm',
  27793. },
  27794. calendar: {
  27795. sameDay: '[Сегодня, в] LT',
  27796. nextDay: '[Завтра, в] LT',
  27797. lastDay: '[Вчера, в] LT',
  27798. nextWeek: function (now) {
  27799. if (now.week() !== this.week()) {
  27800. switch (this.day()) {
  27801. case 0:
  27802. return '[В следующее] dddd, [в] LT';
  27803. case 1:
  27804. case 2:
  27805. case 4:
  27806. return '[В следующий] dddd, [в] LT';
  27807. case 3:
  27808. case 5:
  27809. case 6:
  27810. return '[В следующую] dddd, [в] LT';
  27811. }
  27812. } else {
  27813. if (this.day() === 2) {
  27814. return '[Во] dddd, [в] LT';
  27815. } else {
  27816. return '[В] dddd, [в] LT';
  27817. }
  27818. }
  27819. },
  27820. lastWeek: function (now) {
  27821. if (now.week() !== this.week()) {
  27822. switch (this.day()) {
  27823. case 0:
  27824. return '[В прошлое] dddd, [в] LT';
  27825. case 1:
  27826. case 2:
  27827. case 4:
  27828. return '[В прошлый] dddd, [в] LT';
  27829. case 3:
  27830. case 5:
  27831. case 6:
  27832. return '[В прошлую] dddd, [в] LT';
  27833. }
  27834. } else {
  27835. if (this.day() === 2) {
  27836. return '[Во] dddd, [в] LT';
  27837. } else {
  27838. return '[В] dddd, [в] LT';
  27839. }
  27840. }
  27841. },
  27842. sameElse: 'L',
  27843. },
  27844. relativeTime: {
  27845. future: 'через %s',
  27846. past: '%s назад',
  27847. s: 'несколько секунд',
  27848. ss: relativeTimeWithPlural,
  27849. m: relativeTimeWithPlural,
  27850. mm: relativeTimeWithPlural,
  27851. h: 'час',
  27852. hh: relativeTimeWithPlural,
  27853. d: 'день',
  27854. dd: relativeTimeWithPlural,
  27855. w: 'неделя',
  27856. ww: relativeTimeWithPlural,
  27857. M: 'месяц',
  27858. MM: relativeTimeWithPlural,
  27859. y: 'год',
  27860. yy: relativeTimeWithPlural,
  27861. },
  27862. meridiemParse: /ночи|утра|дня|вечера/i,
  27863. isPM: function (input) {
  27864. return /^(дня|вечера)$/.test(input);
  27865. },
  27866. meridiem: function (hour, minute, isLower) {
  27867. if (hour < 4) {
  27868. return 'ночи';
  27869. } else if (hour < 12) {
  27870. return 'утра';
  27871. } else if (hour < 17) {
  27872. return 'дня';
  27873. } else {
  27874. return 'вечера';
  27875. }
  27876. },
  27877. dayOfMonthOrdinalParse: /\d{1,2}-(й|го|я)/,
  27878. ordinal: function (number, period) {
  27879. switch (period) {
  27880. case 'M':
  27881. case 'd':
  27882. case 'DDD':
  27883. return number + '-й';
  27884. case 'D':
  27885. return number + '-го';
  27886. case 'w':
  27887. case 'W':
  27888. return number + '-я';
  27889. default:
  27890. return number;
  27891. }
  27892. },
  27893. week: {
  27894. dow: 1, // Monday is the first day of the week.
  27895. doy: 4, // The week that contains Jan 4th is the first week of the year.
  27896. },
  27897. });
  27898. return ru;
  27899. })));
  27900. /***/ }),
  27901. /***/ "./node_modules/moment/locale/sd.js":
  27902. /*!******************************************!*\
  27903. !*** ./node_modules/moment/locale/sd.js ***!
  27904. \******************************************/
  27905. /*! no static exports found */
  27906. /***/ (function(module, exports, __webpack_require__) {
  27907. //! moment.js locale configuration
  27908. //! locale : Sindhi [sd]
  27909. //! author : Narain Sagar : https://github.com/narainsagar
  27910. ;(function (global, factory) {
  27911. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  27912. undefined
  27913. }(this, (function (moment) { 'use strict';
  27914. //! moment.js locale configuration
  27915. var months = [
  27916. 'جنوري',
  27917. 'فيبروري',
  27918. 'مارچ',
  27919. 'اپريل',
  27920. 'مئي',
  27921. 'جون',
  27922. 'جولاءِ',
  27923. 'آگسٽ',
  27924. 'سيپٽمبر',
  27925. 'آڪٽوبر',
  27926. 'نومبر',
  27927. 'ڊسمبر',
  27928. ],
  27929. days = ['آچر', 'سومر', 'اڱارو', 'اربع', 'خميس', 'جمع', 'ڇنڇر'];
  27930. var sd = moment.defineLocale('sd', {
  27931. months: months,
  27932. monthsShort: months,
  27933. weekdays: days,
  27934. weekdaysShort: days,
  27935. weekdaysMin: days,
  27936. longDateFormat: {
  27937. LT: 'HH:mm',
  27938. LTS: 'HH:mm:ss',
  27939. L: 'DD/MM/YYYY',
  27940. LL: 'D MMMM YYYY',
  27941. LLL: 'D MMMM YYYY HH:mm',
  27942. LLLL: 'dddd، D MMMM YYYY HH:mm',
  27943. },
  27944. meridiemParse: /صبح|شام/,
  27945. isPM: function (input) {
  27946. return 'شام' === input;
  27947. },
  27948. meridiem: function (hour, minute, isLower) {
  27949. if (hour < 12) {
  27950. return 'صبح';
  27951. }
  27952. return 'شام';
  27953. },
  27954. calendar: {
  27955. sameDay: '[اڄ] LT',
  27956. nextDay: '[سڀاڻي] LT',
  27957. nextWeek: 'dddd [اڳين هفتي تي] LT',
  27958. lastDay: '[ڪالهه] LT',
  27959. lastWeek: '[گزريل هفتي] dddd [تي] LT',
  27960. sameElse: 'L',
  27961. },
  27962. relativeTime: {
  27963. future: '%s پوء',
  27964. past: '%s اڳ',
  27965. s: 'چند سيڪنڊ',
  27966. ss: '%d سيڪنڊ',
  27967. m: 'هڪ منٽ',
  27968. mm: '%d منٽ',
  27969. h: 'هڪ ڪلاڪ',
  27970. hh: '%d ڪلاڪ',
  27971. d: 'هڪ ڏينهن',
  27972. dd: '%d ڏينهن',
  27973. M: 'هڪ مهينو',
  27974. MM: '%d مهينا',
  27975. y: 'هڪ سال',
  27976. yy: '%d سال',
  27977. },
  27978. preparse: function (string) {
  27979. return string.replace(/،/g, ',');
  27980. },
  27981. postformat: function (string) {
  27982. return string.replace(/,/g, '،');
  27983. },
  27984. week: {
  27985. dow: 1, // Monday is the first day of the week.
  27986. doy: 4, // The week that contains Jan 4th is the first week of the year.
  27987. },
  27988. });
  27989. return sd;
  27990. })));
  27991. /***/ }),
  27992. /***/ "./node_modules/moment/locale/se.js":
  27993. /*!******************************************!*\
  27994. !*** ./node_modules/moment/locale/se.js ***!
  27995. \******************************************/
  27996. /*! no static exports found */
  27997. /***/ (function(module, exports, __webpack_require__) {
  27998. //! moment.js locale configuration
  27999. //! locale : Northern Sami [se]
  28000. //! authors : Bård Rolstad Henriksen : https://github.com/karamell
  28001. ;(function (global, factory) {
  28002. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  28003. undefined
  28004. }(this, (function (moment) { 'use strict';
  28005. //! moment.js locale configuration
  28006. var se = moment.defineLocale('se', {
  28007. 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(
  28008. '_'
  28009. ),
  28010. monthsShort: 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split(
  28011. '_'
  28012. ),
  28013. weekdays: 'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split(
  28014. '_'
  28015. ),
  28016. weekdaysShort: 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'),
  28017. weekdaysMin: 's_v_m_g_d_b_L'.split('_'),
  28018. longDateFormat: {
  28019. LT: 'HH:mm',
  28020. LTS: 'HH:mm:ss',
  28021. L: 'DD.MM.YYYY',
  28022. LL: 'MMMM D. [b.] YYYY',
  28023. LLL: 'MMMM D. [b.] YYYY [ti.] HH:mm',
  28024. LLLL: 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm',
  28025. },
  28026. calendar: {
  28027. sameDay: '[otne ti] LT',
  28028. nextDay: '[ihttin ti] LT',
  28029. nextWeek: 'dddd [ti] LT',
  28030. lastDay: '[ikte ti] LT',
  28031. lastWeek: '[ovddit] dddd [ti] LT',
  28032. sameElse: 'L',
  28033. },
  28034. relativeTime: {
  28035. future: '%s geažes',
  28036. past: 'maŋit %s',
  28037. s: 'moadde sekunddat',
  28038. ss: '%d sekunddat',
  28039. m: 'okta minuhta',
  28040. mm: '%d minuhtat',
  28041. h: 'okta diimmu',
  28042. hh: '%d diimmut',
  28043. d: 'okta beaivi',
  28044. dd: '%d beaivvit',
  28045. M: 'okta mánnu',
  28046. MM: '%d mánut',
  28047. y: 'okta jahki',
  28048. yy: '%d jagit',
  28049. },
  28050. dayOfMonthOrdinalParse: /\d{1,2}\./,
  28051. ordinal: '%d.',
  28052. week: {
  28053. dow: 1, // Monday is the first day of the week.
  28054. doy: 4, // The week that contains Jan 4th is the first week of the year.
  28055. },
  28056. });
  28057. return se;
  28058. })));
  28059. /***/ }),
  28060. /***/ "./node_modules/moment/locale/si.js":
  28061. /*!******************************************!*\
  28062. !*** ./node_modules/moment/locale/si.js ***!
  28063. \******************************************/
  28064. /*! no static exports found */
  28065. /***/ (function(module, exports, __webpack_require__) {
  28066. //! moment.js locale configuration
  28067. //! locale : Sinhalese [si]
  28068. //! author : Sampath Sitinamaluwa : https://github.com/sampathsris
  28069. ;(function (global, factory) {
  28070. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  28071. undefined
  28072. }(this, (function (moment) { 'use strict';
  28073. //! moment.js locale configuration
  28074. /*jshint -W100*/
  28075. var si = moment.defineLocale('si', {
  28076. months: 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split(
  28077. '_'
  28078. ),
  28079. monthsShort: 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split(
  28080. '_'
  28081. ),
  28082. weekdays: 'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split(
  28083. '_'
  28084. ),
  28085. weekdaysShort: 'ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන'.split('_'),
  28086. weekdaysMin: 'ඉ_ස_අ_බ_බ්‍ර_සි_සෙ'.split('_'),
  28087. weekdaysParseExact: true,
  28088. longDateFormat: {
  28089. LT: 'a h:mm',
  28090. LTS: 'a h:mm:ss',
  28091. L: 'YYYY/MM/DD',
  28092. LL: 'YYYY MMMM D',
  28093. LLL: 'YYYY MMMM D, a h:mm',
  28094. LLLL: 'YYYY MMMM D [වැනි] dddd, a h:mm:ss',
  28095. },
  28096. calendar: {
  28097. sameDay: '[අද] LT[ට]',
  28098. nextDay: '[හෙට] LT[ට]',
  28099. nextWeek: 'dddd LT[ට]',
  28100. lastDay: '[ඊයේ] LT[ට]',
  28101. lastWeek: '[පසුගිය] dddd LT[ට]',
  28102. sameElse: 'L',
  28103. },
  28104. relativeTime: {
  28105. future: '%sකින්',
  28106. past: '%sකට පෙර',
  28107. s: 'තත්පර කිහිපය',
  28108. ss: 'තත්පර %d',
  28109. m: 'මිනිත්තුව',
  28110. mm: 'මිනිත්තු %d',
  28111. h: 'පැය',
  28112. hh: 'පැය %d',
  28113. d: 'දිනය',
  28114. dd: 'දින %d',
  28115. M: 'මාසය',
  28116. MM: 'මාස %d',
  28117. y: 'වසර',
  28118. yy: 'වසර %d',
  28119. },
  28120. dayOfMonthOrdinalParse: /\d{1,2} වැනි/,
  28121. ordinal: function (number) {
  28122. return number + ' වැනි';
  28123. },
  28124. meridiemParse: /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./,
  28125. isPM: function (input) {
  28126. return input === 'ප.ව.' || input === 'පස් වරු';
  28127. },
  28128. meridiem: function (hours, minutes, isLower) {
  28129. if (hours > 11) {
  28130. return isLower ? 'ප.ව.' : 'පස් වරු';
  28131. } else {
  28132. return isLower ? 'පෙ.ව.' : 'පෙර වරු';
  28133. }
  28134. },
  28135. });
  28136. return si;
  28137. })));
  28138. /***/ }),
  28139. /***/ "./node_modules/moment/locale/sk.js":
  28140. /*!******************************************!*\
  28141. !*** ./node_modules/moment/locale/sk.js ***!
  28142. \******************************************/
  28143. /*! no static exports found */
  28144. /***/ (function(module, exports, __webpack_require__) {
  28145. //! moment.js locale configuration
  28146. //! locale : Slovak [sk]
  28147. //! author : Martin Minka : https://github.com/k2s
  28148. //! based on work of petrbela : https://github.com/petrbela
  28149. ;(function (global, factory) {
  28150. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  28151. undefined
  28152. }(this, (function (moment) { 'use strict';
  28153. //! moment.js locale configuration
  28154. var months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split(
  28155. '_'
  28156. ),
  28157. monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');
  28158. function plural(n) {
  28159. return n > 1 && n < 5;
  28160. }
  28161. function translate(number, withoutSuffix, key, isFuture) {
  28162. var result = number + ' ';
  28163. switch (key) {
  28164. case 's': // a few seconds / in a few seconds / a few seconds ago
  28165. return withoutSuffix || isFuture ? 'pár sekúnd' : 'pár sekundami';
  28166. case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago
  28167. if (withoutSuffix || isFuture) {
  28168. return result + (plural(number) ? 'sekundy' : 'sekúnd');
  28169. } else {
  28170. return result + 'sekundami';
  28171. }
  28172. case 'm': // a minute / in a minute / a minute ago
  28173. return withoutSuffix ? 'minúta' : isFuture ? 'minútu' : 'minútou';
  28174. case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
  28175. if (withoutSuffix || isFuture) {
  28176. return result + (plural(number) ? 'minúty' : 'minút');
  28177. } else {
  28178. return result + 'minútami';
  28179. }
  28180. case 'h': // an hour / in an hour / an hour ago
  28181. return withoutSuffix ? 'hodina' : isFuture ? 'hodinu' : 'hodinou';
  28182. case 'hh': // 9 hours / in 9 hours / 9 hours ago
  28183. if (withoutSuffix || isFuture) {
  28184. return result + (plural(number) ? 'hodiny' : 'hodín');
  28185. } else {
  28186. return result + 'hodinami';
  28187. }
  28188. case 'd': // a day / in a day / a day ago
  28189. return withoutSuffix || isFuture ? 'deň' : 'dňom';
  28190. case 'dd': // 9 days / in 9 days / 9 days ago
  28191. if (withoutSuffix || isFuture) {
  28192. return result + (plural(number) ? 'dni' : 'dní');
  28193. } else {
  28194. return result + 'dňami';
  28195. }
  28196. case 'M': // a month / in a month / a month ago
  28197. return withoutSuffix || isFuture ? 'mesiac' : 'mesiacom';
  28198. case 'MM': // 9 months / in 9 months / 9 months ago
  28199. if (withoutSuffix || isFuture) {
  28200. return result + (plural(number) ? 'mesiace' : 'mesiacov');
  28201. } else {
  28202. return result + 'mesiacmi';
  28203. }
  28204. case 'y': // a year / in a year / a year ago
  28205. return withoutSuffix || isFuture ? 'rok' : 'rokom';
  28206. case 'yy': // 9 years / in 9 years / 9 years ago
  28207. if (withoutSuffix || isFuture) {
  28208. return result + (plural(number) ? 'roky' : 'rokov');
  28209. } else {
  28210. return result + 'rokmi';
  28211. }
  28212. }
  28213. }
  28214. var sk = moment.defineLocale('sk', {
  28215. months: months,
  28216. monthsShort: monthsShort,
  28217. weekdays: 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),
  28218. weekdaysShort: 'ne_po_ut_st_št_pi_so'.split('_'),
  28219. weekdaysMin: 'ne_po_ut_st_št_pi_so'.split('_'),
  28220. longDateFormat: {
  28221. LT: 'H:mm',
  28222. LTS: 'H:mm:ss',
  28223. L: 'DD.MM.YYYY',
  28224. LL: 'D. MMMM YYYY',
  28225. LLL: 'D. MMMM YYYY H:mm',
  28226. LLLL: 'dddd D. MMMM YYYY H:mm',
  28227. },
  28228. calendar: {
  28229. sameDay: '[dnes o] LT',
  28230. nextDay: '[zajtra o] LT',
  28231. nextWeek: function () {
  28232. switch (this.day()) {
  28233. case 0:
  28234. return '[v nedeľu o] LT';
  28235. case 1:
  28236. case 2:
  28237. return '[v] dddd [o] LT';
  28238. case 3:
  28239. return '[v stredu o] LT';
  28240. case 4:
  28241. return '[vo štvrtok o] LT';
  28242. case 5:
  28243. return '[v piatok o] LT';
  28244. case 6:
  28245. return '[v sobotu o] LT';
  28246. }
  28247. },
  28248. lastDay: '[včera o] LT',
  28249. lastWeek: function () {
  28250. switch (this.day()) {
  28251. case 0:
  28252. return '[minulú nedeľu o] LT';
  28253. case 1:
  28254. case 2:
  28255. return '[minulý] dddd [o] LT';
  28256. case 3:
  28257. return '[minulú stredu o] LT';
  28258. case 4:
  28259. case 5:
  28260. return '[minulý] dddd [o] LT';
  28261. case 6:
  28262. return '[minulú sobotu o] LT';
  28263. }
  28264. },
  28265. sameElse: 'L',
  28266. },
  28267. relativeTime: {
  28268. future: 'za %s',
  28269. past: 'pred %s',
  28270. s: translate,
  28271. ss: translate,
  28272. m: translate,
  28273. mm: translate,
  28274. h: translate,
  28275. hh: translate,
  28276. d: translate,
  28277. dd: translate,
  28278. M: translate,
  28279. MM: translate,
  28280. y: translate,
  28281. yy: translate,
  28282. },
  28283. dayOfMonthOrdinalParse: /\d{1,2}\./,
  28284. ordinal: '%d.',
  28285. week: {
  28286. dow: 1, // Monday is the first day of the week.
  28287. doy: 4, // The week that contains Jan 4th is the first week of the year.
  28288. },
  28289. });
  28290. return sk;
  28291. })));
  28292. /***/ }),
  28293. /***/ "./node_modules/moment/locale/sl.js":
  28294. /*!******************************************!*\
  28295. !*** ./node_modules/moment/locale/sl.js ***!
  28296. \******************************************/
  28297. /*! no static exports found */
  28298. /***/ (function(module, exports, __webpack_require__) {
  28299. //! moment.js locale configuration
  28300. //! locale : Slovenian [sl]
  28301. //! author : Robert Sedovšek : https://github.com/sedovsek
  28302. ;(function (global, factory) {
  28303. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  28304. undefined
  28305. }(this, (function (moment) { 'use strict';
  28306. //! moment.js locale configuration
  28307. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  28308. var result = number + ' ';
  28309. switch (key) {
  28310. case 's':
  28311. return withoutSuffix || isFuture
  28312. ? 'nekaj sekund'
  28313. : 'nekaj sekundami';
  28314. case 'ss':
  28315. if (number === 1) {
  28316. result += withoutSuffix ? 'sekundo' : 'sekundi';
  28317. } else if (number === 2) {
  28318. result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';
  28319. } else if (number < 5) {
  28320. result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';
  28321. } else {
  28322. result += 'sekund';
  28323. }
  28324. return result;
  28325. case 'm':
  28326. return withoutSuffix ? 'ena minuta' : 'eno minuto';
  28327. case 'mm':
  28328. if (number === 1) {
  28329. result += withoutSuffix ? 'minuta' : 'minuto';
  28330. } else if (number === 2) {
  28331. result += withoutSuffix || isFuture ? 'minuti' : 'minutama';
  28332. } else if (number < 5) {
  28333. result += withoutSuffix || isFuture ? 'minute' : 'minutami';
  28334. } else {
  28335. result += withoutSuffix || isFuture ? 'minut' : 'minutami';
  28336. }
  28337. return result;
  28338. case 'h':
  28339. return withoutSuffix ? 'ena ura' : 'eno uro';
  28340. case 'hh':
  28341. if (number === 1) {
  28342. result += withoutSuffix ? 'ura' : 'uro';
  28343. } else if (number === 2) {
  28344. result += withoutSuffix || isFuture ? 'uri' : 'urama';
  28345. } else if (number < 5) {
  28346. result += withoutSuffix || isFuture ? 'ure' : 'urami';
  28347. } else {
  28348. result += withoutSuffix || isFuture ? 'ur' : 'urami';
  28349. }
  28350. return result;
  28351. case 'd':
  28352. return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';
  28353. case 'dd':
  28354. if (number === 1) {
  28355. result += withoutSuffix || isFuture ? 'dan' : 'dnem';
  28356. } else if (number === 2) {
  28357. result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';
  28358. } else {
  28359. result += withoutSuffix || isFuture ? 'dni' : 'dnevi';
  28360. }
  28361. return result;
  28362. case 'M':
  28363. return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';
  28364. case 'MM':
  28365. if (number === 1) {
  28366. result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';
  28367. } else if (number === 2) {
  28368. result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';
  28369. } else if (number < 5) {
  28370. result += withoutSuffix || isFuture ? 'mesece' : 'meseci';
  28371. } else {
  28372. result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';
  28373. }
  28374. return result;
  28375. case 'y':
  28376. return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';
  28377. case 'yy':
  28378. if (number === 1) {
  28379. result += withoutSuffix || isFuture ? 'leto' : 'letom';
  28380. } else if (number === 2) {
  28381. result += withoutSuffix || isFuture ? 'leti' : 'letoma';
  28382. } else if (number < 5) {
  28383. result += withoutSuffix || isFuture ? 'leta' : 'leti';
  28384. } else {
  28385. result += withoutSuffix || isFuture ? 'let' : 'leti';
  28386. }
  28387. return result;
  28388. }
  28389. }
  28390. var sl = moment.defineLocale('sl', {
  28391. months: 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split(
  28392. '_'
  28393. ),
  28394. monthsShort: 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split(
  28395. '_'
  28396. ),
  28397. monthsParseExact: true,
  28398. weekdays: 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),
  28399. weekdaysShort: 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),
  28400. weekdaysMin: 'ne_po_to_sr_če_pe_so'.split('_'),
  28401. weekdaysParseExact: true,
  28402. longDateFormat: {
  28403. LT: 'H:mm',
  28404. LTS: 'H:mm:ss',
  28405. L: 'DD. MM. YYYY',
  28406. LL: 'D. MMMM YYYY',
  28407. LLL: 'D. MMMM YYYY H:mm',
  28408. LLLL: 'dddd, D. MMMM YYYY H:mm',
  28409. },
  28410. calendar: {
  28411. sameDay: '[danes ob] LT',
  28412. nextDay: '[jutri ob] LT',
  28413. nextWeek: function () {
  28414. switch (this.day()) {
  28415. case 0:
  28416. return '[v] [nedeljo] [ob] LT';
  28417. case 3:
  28418. return '[v] [sredo] [ob] LT';
  28419. case 6:
  28420. return '[v] [soboto] [ob] LT';
  28421. case 1:
  28422. case 2:
  28423. case 4:
  28424. case 5:
  28425. return '[v] dddd [ob] LT';
  28426. }
  28427. },
  28428. lastDay: '[včeraj ob] LT',
  28429. lastWeek: function () {
  28430. switch (this.day()) {
  28431. case 0:
  28432. return '[prejšnjo] [nedeljo] [ob] LT';
  28433. case 3:
  28434. return '[prejšnjo] [sredo] [ob] LT';
  28435. case 6:
  28436. return '[prejšnjo] [soboto] [ob] LT';
  28437. case 1:
  28438. case 2:
  28439. case 4:
  28440. case 5:
  28441. return '[prejšnji] dddd [ob] LT';
  28442. }
  28443. },
  28444. sameElse: 'L',
  28445. },
  28446. relativeTime: {
  28447. future: 'čez %s',
  28448. past: 'pred %s',
  28449. s: processRelativeTime,
  28450. ss: processRelativeTime,
  28451. m: processRelativeTime,
  28452. mm: processRelativeTime,
  28453. h: processRelativeTime,
  28454. hh: processRelativeTime,
  28455. d: processRelativeTime,
  28456. dd: processRelativeTime,
  28457. M: processRelativeTime,
  28458. MM: processRelativeTime,
  28459. y: processRelativeTime,
  28460. yy: processRelativeTime,
  28461. },
  28462. dayOfMonthOrdinalParse: /\d{1,2}\./,
  28463. ordinal: '%d.',
  28464. week: {
  28465. dow: 1, // Monday is the first day of the week.
  28466. doy: 7, // The week that contains Jan 7th is the first week of the year.
  28467. },
  28468. });
  28469. return sl;
  28470. })));
  28471. /***/ }),
  28472. /***/ "./node_modules/moment/locale/sq.js":
  28473. /*!******************************************!*\
  28474. !*** ./node_modules/moment/locale/sq.js ***!
  28475. \******************************************/
  28476. /*! no static exports found */
  28477. /***/ (function(module, exports, __webpack_require__) {
  28478. //! moment.js locale configuration
  28479. //! locale : Albanian [sq]
  28480. //! author : Flakërim Ismani : https://github.com/flakerimi
  28481. //! author : Menelion Elensúle : https://github.com/Oire
  28482. //! author : Oerd Cukalla : https://github.com/oerd
  28483. ;(function (global, factory) {
  28484. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  28485. undefined
  28486. }(this, (function (moment) { 'use strict';
  28487. //! moment.js locale configuration
  28488. var sq = moment.defineLocale('sq', {
  28489. months: 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split(
  28490. '_'
  28491. ),
  28492. monthsShort: 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'),
  28493. weekdays: 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split(
  28494. '_'
  28495. ),
  28496. weekdaysShort: 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'),
  28497. weekdaysMin: 'D_H_Ma_Më_E_P_Sh'.split('_'),
  28498. weekdaysParseExact: true,
  28499. meridiemParse: /PD|MD/,
  28500. isPM: function (input) {
  28501. return input.charAt(0) === 'M';
  28502. },
  28503. meridiem: function (hours, minutes, isLower) {
  28504. return hours < 12 ? 'PD' : 'MD';
  28505. },
  28506. longDateFormat: {
  28507. LT: 'HH:mm',
  28508. LTS: 'HH:mm:ss',
  28509. L: 'DD/MM/YYYY',
  28510. LL: 'D MMMM YYYY',
  28511. LLL: 'D MMMM YYYY HH:mm',
  28512. LLLL: 'dddd, D MMMM YYYY HH:mm',
  28513. },
  28514. calendar: {
  28515. sameDay: '[Sot në] LT',
  28516. nextDay: '[Nesër në] LT',
  28517. nextWeek: 'dddd [në] LT',
  28518. lastDay: '[Dje në] LT',
  28519. lastWeek: 'dddd [e kaluar në] LT',
  28520. sameElse: 'L',
  28521. },
  28522. relativeTime: {
  28523. future: 'në %s',
  28524. past: '%s më parë',
  28525. s: 'disa sekonda',
  28526. ss: '%d sekonda',
  28527. m: 'një minutë',
  28528. mm: '%d minuta',
  28529. h: 'një orë',
  28530. hh: '%d orë',
  28531. d: 'një ditë',
  28532. dd: '%d ditë',
  28533. M: 'një muaj',
  28534. MM: '%d muaj',
  28535. y: 'një vit',
  28536. yy: '%d vite',
  28537. },
  28538. dayOfMonthOrdinalParse: /\d{1,2}\./,
  28539. ordinal: '%d.',
  28540. week: {
  28541. dow: 1, // Monday is the first day of the week.
  28542. doy: 4, // The week that contains Jan 4th is the first week of the year.
  28543. },
  28544. });
  28545. return sq;
  28546. })));
  28547. /***/ }),
  28548. /***/ "./node_modules/moment/locale/sr-cyrl.js":
  28549. /*!***********************************************!*\
  28550. !*** ./node_modules/moment/locale/sr-cyrl.js ***!
  28551. \***********************************************/
  28552. /*! no static exports found */
  28553. /***/ (function(module, exports, __webpack_require__) {
  28554. //! moment.js locale configuration
  28555. //! locale : Serbian Cyrillic [sr-cyrl]
  28556. //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
  28557. //! author : Stefan Crnjaković <stefan@hotmail.rs> : https://github.com/crnjakovic
  28558. ;(function (global, factory) {
  28559. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  28560. undefined
  28561. }(this, (function (moment) { 'use strict';
  28562. //! moment.js locale configuration
  28563. var translator = {
  28564. words: {
  28565. //Different grammatical cases
  28566. ss: ['секунда', 'секунде', 'секунди'],
  28567. m: ['један минут', 'једне минуте'],
  28568. mm: ['минут', 'минуте', 'минута'],
  28569. h: ['један сат', 'једног сата'],
  28570. hh: ['сат', 'сата', 'сати'],
  28571. dd: ['дан', 'дана', 'дана'],
  28572. MM: ['месец', 'месеца', 'месеци'],
  28573. yy: ['година', 'године', 'година'],
  28574. },
  28575. correctGrammaticalCase: function (number, wordKey) {
  28576. return number === 1
  28577. ? wordKey[0]
  28578. : number >= 2 && number <= 4
  28579. ? wordKey[1]
  28580. : wordKey[2];
  28581. },
  28582. translate: function (number, withoutSuffix, key) {
  28583. var wordKey = translator.words[key];
  28584. if (key.length === 1) {
  28585. return withoutSuffix ? wordKey[0] : wordKey[1];
  28586. } else {
  28587. return (
  28588. number +
  28589. ' ' +
  28590. translator.correctGrammaticalCase(number, wordKey)
  28591. );
  28592. }
  28593. },
  28594. };
  28595. var srCyrl = moment.defineLocale('sr-cyrl', {
  28596. months: 'јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар'.split(
  28597. '_'
  28598. ),
  28599. monthsShort: 'јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.'.split(
  28600. '_'
  28601. ),
  28602. monthsParseExact: true,
  28603. weekdays: 'недеља_понедељак_уторак_среда_четвртак_петак_субота'.split('_'),
  28604. weekdaysShort: 'нед._пон._уто._сре._чет._пет._суб.'.split('_'),
  28605. weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'),
  28606. weekdaysParseExact: true,
  28607. longDateFormat: {
  28608. LT: 'H:mm',
  28609. LTS: 'H:mm:ss',
  28610. L: 'D. M. YYYY.',
  28611. LL: 'D. MMMM YYYY.',
  28612. LLL: 'D. MMMM YYYY. H:mm',
  28613. LLLL: 'dddd, D. MMMM YYYY. H:mm',
  28614. },
  28615. calendar: {
  28616. sameDay: '[данас у] LT',
  28617. nextDay: '[сутра у] LT',
  28618. nextWeek: function () {
  28619. switch (this.day()) {
  28620. case 0:
  28621. return '[у] [недељу] [у] LT';
  28622. case 3:
  28623. return '[у] [среду] [у] LT';
  28624. case 6:
  28625. return '[у] [суботу] [у] LT';
  28626. case 1:
  28627. case 2:
  28628. case 4:
  28629. case 5:
  28630. return '[у] dddd [у] LT';
  28631. }
  28632. },
  28633. lastDay: '[јуче у] LT',
  28634. lastWeek: function () {
  28635. var lastWeekDays = [
  28636. '[прошле] [недеље] [у] LT',
  28637. '[прошлог] [понедељка] [у] LT',
  28638. '[прошлог] [уторка] [у] LT',
  28639. '[прошле] [среде] [у] LT',
  28640. '[прошлог] [четвртка] [у] LT',
  28641. '[прошлог] [петка] [у] LT',
  28642. '[прошле] [суботе] [у] LT',
  28643. ];
  28644. return lastWeekDays[this.day()];
  28645. },
  28646. sameElse: 'L',
  28647. },
  28648. relativeTime: {
  28649. future: 'за %s',
  28650. past: 'пре %s',
  28651. s: 'неколико секунди',
  28652. ss: translator.translate,
  28653. m: translator.translate,
  28654. mm: translator.translate,
  28655. h: translator.translate,
  28656. hh: translator.translate,
  28657. d: 'дан',
  28658. dd: translator.translate,
  28659. M: 'месец',
  28660. MM: translator.translate,
  28661. y: 'годину',
  28662. yy: translator.translate,
  28663. },
  28664. dayOfMonthOrdinalParse: /\d{1,2}\./,
  28665. ordinal: '%d.',
  28666. week: {
  28667. dow: 1, // Monday is the first day of the week.
  28668. doy: 7, // The week that contains Jan 1st is the first week of the year.
  28669. },
  28670. });
  28671. return srCyrl;
  28672. })));
  28673. /***/ }),
  28674. /***/ "./node_modules/moment/locale/sr.js":
  28675. /*!******************************************!*\
  28676. !*** ./node_modules/moment/locale/sr.js ***!
  28677. \******************************************/
  28678. /*! no static exports found */
  28679. /***/ (function(module, exports, __webpack_require__) {
  28680. //! moment.js locale configuration
  28681. //! locale : Serbian [sr]
  28682. //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
  28683. //! author : Stefan Crnjaković <stefan@hotmail.rs> : https://github.com/crnjakovic
  28684. ;(function (global, factory) {
  28685. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  28686. undefined
  28687. }(this, (function (moment) { 'use strict';
  28688. //! moment.js locale configuration
  28689. var translator = {
  28690. words: {
  28691. //Different grammatical cases
  28692. ss: ['sekunda', 'sekunde', 'sekundi'],
  28693. m: ['jedan minut', 'jedne minute'],
  28694. mm: ['minut', 'minute', 'minuta'],
  28695. h: ['jedan sat', 'jednog sata'],
  28696. hh: ['sat', 'sata', 'sati'],
  28697. dd: ['dan', 'dana', 'dana'],
  28698. MM: ['mesec', 'meseca', 'meseci'],
  28699. yy: ['godina', 'godine', 'godina'],
  28700. },
  28701. correctGrammaticalCase: function (number, wordKey) {
  28702. return number === 1
  28703. ? wordKey[0]
  28704. : number >= 2 && number <= 4
  28705. ? wordKey[1]
  28706. : wordKey[2];
  28707. },
  28708. translate: function (number, withoutSuffix, key) {
  28709. var wordKey = translator.words[key];
  28710. if (key.length === 1) {
  28711. return withoutSuffix ? wordKey[0] : wordKey[1];
  28712. } else {
  28713. return (
  28714. number +
  28715. ' ' +
  28716. translator.correctGrammaticalCase(number, wordKey)
  28717. );
  28718. }
  28719. },
  28720. };
  28721. var sr = moment.defineLocale('sr', {
  28722. months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split(
  28723. '_'
  28724. ),
  28725. monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split(
  28726. '_'
  28727. ),
  28728. monthsParseExact: true,
  28729. weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split(
  28730. '_'
  28731. ),
  28732. weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'),
  28733. weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'),
  28734. weekdaysParseExact: true,
  28735. longDateFormat: {
  28736. LT: 'H:mm',
  28737. LTS: 'H:mm:ss',
  28738. L: 'D. M. YYYY.',
  28739. LL: 'D. MMMM YYYY.',
  28740. LLL: 'D. MMMM YYYY. H:mm',
  28741. LLLL: 'dddd, D. MMMM YYYY. H:mm',
  28742. },
  28743. calendar: {
  28744. sameDay: '[danas u] LT',
  28745. nextDay: '[sutra u] LT',
  28746. nextWeek: function () {
  28747. switch (this.day()) {
  28748. case 0:
  28749. return '[u] [nedelju] [u] LT';
  28750. case 3:
  28751. return '[u] [sredu] [u] LT';
  28752. case 6:
  28753. return '[u] [subotu] [u] LT';
  28754. case 1:
  28755. case 2:
  28756. case 4:
  28757. case 5:
  28758. return '[u] dddd [u] LT';
  28759. }
  28760. },
  28761. lastDay: '[juče u] LT',
  28762. lastWeek: function () {
  28763. var lastWeekDays = [
  28764. '[prošle] [nedelje] [u] LT',
  28765. '[prošlog] [ponedeljka] [u] LT',
  28766. '[prošlog] [utorka] [u] LT',
  28767. '[prošle] [srede] [u] LT',
  28768. '[prošlog] [četvrtka] [u] LT',
  28769. '[prošlog] [petka] [u] LT',
  28770. '[prošle] [subote] [u] LT',
  28771. ];
  28772. return lastWeekDays[this.day()];
  28773. },
  28774. sameElse: 'L',
  28775. },
  28776. relativeTime: {
  28777. future: 'za %s',
  28778. past: 'pre %s',
  28779. s: 'nekoliko sekundi',
  28780. ss: translator.translate,
  28781. m: translator.translate,
  28782. mm: translator.translate,
  28783. h: translator.translate,
  28784. hh: translator.translate,
  28785. d: 'dan',
  28786. dd: translator.translate,
  28787. M: 'mesec',
  28788. MM: translator.translate,
  28789. y: 'godinu',
  28790. yy: translator.translate,
  28791. },
  28792. dayOfMonthOrdinalParse: /\d{1,2}\./,
  28793. ordinal: '%d.',
  28794. week: {
  28795. dow: 1, // Monday is the first day of the week.
  28796. doy: 7, // The week that contains Jan 7th is the first week of the year.
  28797. },
  28798. });
  28799. return sr;
  28800. })));
  28801. /***/ }),
  28802. /***/ "./node_modules/moment/locale/ss.js":
  28803. /*!******************************************!*\
  28804. !*** ./node_modules/moment/locale/ss.js ***!
  28805. \******************************************/
  28806. /*! no static exports found */
  28807. /***/ (function(module, exports, __webpack_require__) {
  28808. //! moment.js locale configuration
  28809. //! locale : siSwati [ss]
  28810. //! author : Nicolai Davies<mail@nicolai.io> : https://github.com/nicolaidavies
  28811. ;(function (global, factory) {
  28812. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  28813. undefined
  28814. }(this, (function (moment) { 'use strict';
  28815. //! moment.js locale configuration
  28816. var ss = moment.defineLocale('ss', {
  28817. months: "Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split(
  28818. '_'
  28819. ),
  28820. monthsShort: 'Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo'.split('_'),
  28821. weekdays: 'Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo'.split(
  28822. '_'
  28823. ),
  28824. weekdaysShort: 'Lis_Umb_Lsb_Les_Lsi_Lsh_Umg'.split('_'),
  28825. weekdaysMin: 'Li_Us_Lb_Lt_Ls_Lh_Ug'.split('_'),
  28826. weekdaysParseExact: true,
  28827. longDateFormat: {
  28828. LT: 'h:mm A',
  28829. LTS: 'h:mm:ss A',
  28830. L: 'DD/MM/YYYY',
  28831. LL: 'D MMMM YYYY',
  28832. LLL: 'D MMMM YYYY h:mm A',
  28833. LLLL: 'dddd, D MMMM YYYY h:mm A',
  28834. },
  28835. calendar: {
  28836. sameDay: '[Namuhla nga] LT',
  28837. nextDay: '[Kusasa nga] LT',
  28838. nextWeek: 'dddd [nga] LT',
  28839. lastDay: '[Itolo nga] LT',
  28840. lastWeek: 'dddd [leliphelile] [nga] LT',
  28841. sameElse: 'L',
  28842. },
  28843. relativeTime: {
  28844. future: 'nga %s',
  28845. past: 'wenteka nga %s',
  28846. s: 'emizuzwana lomcane',
  28847. ss: '%d mzuzwana',
  28848. m: 'umzuzu',
  28849. mm: '%d emizuzu',
  28850. h: 'lihora',
  28851. hh: '%d emahora',
  28852. d: 'lilanga',
  28853. dd: '%d emalanga',
  28854. M: 'inyanga',
  28855. MM: '%d tinyanga',
  28856. y: 'umnyaka',
  28857. yy: '%d iminyaka',
  28858. },
  28859. meridiemParse: /ekuseni|emini|entsambama|ebusuku/,
  28860. meridiem: function (hours, minutes, isLower) {
  28861. if (hours < 11) {
  28862. return 'ekuseni';
  28863. } else if (hours < 15) {
  28864. return 'emini';
  28865. } else if (hours < 19) {
  28866. return 'entsambama';
  28867. } else {
  28868. return 'ebusuku';
  28869. }
  28870. },
  28871. meridiemHour: function (hour, meridiem) {
  28872. if (hour === 12) {
  28873. hour = 0;
  28874. }
  28875. if (meridiem === 'ekuseni') {
  28876. return hour;
  28877. } else if (meridiem === 'emini') {
  28878. return hour >= 11 ? hour : hour + 12;
  28879. } else if (meridiem === 'entsambama' || meridiem === 'ebusuku') {
  28880. if (hour === 0) {
  28881. return 0;
  28882. }
  28883. return hour + 12;
  28884. }
  28885. },
  28886. dayOfMonthOrdinalParse: /\d{1,2}/,
  28887. ordinal: '%d',
  28888. week: {
  28889. dow: 1, // Monday is the first day of the week.
  28890. doy: 4, // The week that contains Jan 4th is the first week of the year.
  28891. },
  28892. });
  28893. return ss;
  28894. })));
  28895. /***/ }),
  28896. /***/ "./node_modules/moment/locale/sv.js":
  28897. /*!******************************************!*\
  28898. !*** ./node_modules/moment/locale/sv.js ***!
  28899. \******************************************/
  28900. /*! no static exports found */
  28901. /***/ (function(module, exports, __webpack_require__) {
  28902. //! moment.js locale configuration
  28903. //! locale : Swedish [sv]
  28904. //! author : Jens Alm : https://github.com/ulmus
  28905. ;(function (global, factory) {
  28906. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  28907. undefined
  28908. }(this, (function (moment) { 'use strict';
  28909. //! moment.js locale configuration
  28910. var sv = moment.defineLocale('sv', {
  28911. months: 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split(
  28912. '_'
  28913. ),
  28914. monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
  28915. weekdays: 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),
  28916. weekdaysShort: 'sön_mån_tis_ons_tor_fre_lör'.split('_'),
  28917. weekdaysMin: 'sö_må_ti_on_to_fr_lö'.split('_'),
  28918. longDateFormat: {
  28919. LT: 'HH:mm',
  28920. LTS: 'HH:mm:ss',
  28921. L: 'YYYY-MM-DD',
  28922. LL: 'D MMMM YYYY',
  28923. LLL: 'D MMMM YYYY [kl.] HH:mm',
  28924. LLLL: 'dddd D MMMM YYYY [kl.] HH:mm',
  28925. lll: 'D MMM YYYY HH:mm',
  28926. llll: 'ddd D MMM YYYY HH:mm',
  28927. },
  28928. calendar: {
  28929. sameDay: '[Idag] LT',
  28930. nextDay: '[Imorgon] LT',
  28931. lastDay: '[Igår] LT',
  28932. nextWeek: '[På] dddd LT',
  28933. lastWeek: '[I] dddd[s] LT',
  28934. sameElse: 'L',
  28935. },
  28936. relativeTime: {
  28937. future: 'om %s',
  28938. past: 'för %s sedan',
  28939. s: 'några sekunder',
  28940. ss: '%d sekunder',
  28941. m: 'en minut',
  28942. mm: '%d minuter',
  28943. h: 'en timme',
  28944. hh: '%d timmar',
  28945. d: 'en dag',
  28946. dd: '%d dagar',
  28947. M: 'en månad',
  28948. MM: '%d månader',
  28949. y: 'ett år',
  28950. yy: '%d år',
  28951. },
  28952. dayOfMonthOrdinalParse: /\d{1,2}(\:e|\:a)/,
  28953. ordinal: function (number) {
  28954. var b = number % 10,
  28955. output =
  28956. ~~((number % 100) / 10) === 1
  28957. ? ':e'
  28958. : b === 1
  28959. ? ':a'
  28960. : b === 2
  28961. ? ':a'
  28962. : b === 3
  28963. ? ':e'
  28964. : ':e';
  28965. return number + output;
  28966. },
  28967. week: {
  28968. dow: 1, // Monday is the first day of the week.
  28969. doy: 4, // The week that contains Jan 4th is the first week of the year.
  28970. },
  28971. });
  28972. return sv;
  28973. })));
  28974. /***/ }),
  28975. /***/ "./node_modules/moment/locale/sw.js":
  28976. /*!******************************************!*\
  28977. !*** ./node_modules/moment/locale/sw.js ***!
  28978. \******************************************/
  28979. /*! no static exports found */
  28980. /***/ (function(module, exports, __webpack_require__) {
  28981. //! moment.js locale configuration
  28982. //! locale : Swahili [sw]
  28983. //! author : Fahad Kassim : https://github.com/fadsel
  28984. ;(function (global, factory) {
  28985. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  28986. undefined
  28987. }(this, (function (moment) { 'use strict';
  28988. //! moment.js locale configuration
  28989. var sw = moment.defineLocale('sw', {
  28990. months: 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split(
  28991. '_'
  28992. ),
  28993. monthsShort: 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'),
  28994. weekdays: 'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split(
  28995. '_'
  28996. ),
  28997. weekdaysShort: 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'),
  28998. weekdaysMin: 'J2_J3_J4_J5_Al_Ij_J1'.split('_'),
  28999. weekdaysParseExact: true,
  29000. longDateFormat: {
  29001. LT: 'hh:mm A',
  29002. LTS: 'HH:mm:ss',
  29003. L: 'DD.MM.YYYY',
  29004. LL: 'D MMMM YYYY',
  29005. LLL: 'D MMMM YYYY HH:mm',
  29006. LLLL: 'dddd, D MMMM YYYY HH:mm',
  29007. },
  29008. calendar: {
  29009. sameDay: '[leo saa] LT',
  29010. nextDay: '[kesho saa] LT',
  29011. nextWeek: '[wiki ijayo] dddd [saat] LT',
  29012. lastDay: '[jana] LT',
  29013. lastWeek: '[wiki iliyopita] dddd [saat] LT',
  29014. sameElse: 'L',
  29015. },
  29016. relativeTime: {
  29017. future: '%s baadaye',
  29018. past: 'tokea %s',
  29019. s: 'hivi punde',
  29020. ss: 'sekunde %d',
  29021. m: 'dakika moja',
  29022. mm: 'dakika %d',
  29023. h: 'saa limoja',
  29024. hh: 'masaa %d',
  29025. d: 'siku moja',
  29026. dd: 'siku %d',
  29027. M: 'mwezi mmoja',
  29028. MM: 'miezi %d',
  29029. y: 'mwaka mmoja',
  29030. yy: 'miaka %d',
  29031. },
  29032. week: {
  29033. dow: 1, // Monday is the first day of the week.
  29034. doy: 7, // The week that contains Jan 7th is the first week of the year.
  29035. },
  29036. });
  29037. return sw;
  29038. })));
  29039. /***/ }),
  29040. /***/ "./node_modules/moment/locale/ta.js":
  29041. /*!******************************************!*\
  29042. !*** ./node_modules/moment/locale/ta.js ***!
  29043. \******************************************/
  29044. /*! no static exports found */
  29045. /***/ (function(module, exports, __webpack_require__) {
  29046. //! moment.js locale configuration
  29047. //! locale : Tamil [ta]
  29048. //! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404
  29049. ;(function (global, factory) {
  29050. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  29051. undefined
  29052. }(this, (function (moment) { 'use strict';
  29053. //! moment.js locale configuration
  29054. var symbolMap = {
  29055. 1: '௧',
  29056. 2: '௨',
  29057. 3: '௩',
  29058. 4: '௪',
  29059. 5: '௫',
  29060. 6: '௬',
  29061. 7: '௭',
  29062. 8: '௮',
  29063. 9: '௯',
  29064. 0: '௦',
  29065. },
  29066. numberMap = {
  29067. '௧': '1',
  29068. '௨': '2',
  29069. '௩': '3',
  29070. '௪': '4',
  29071. '௫': '5',
  29072. '௬': '6',
  29073. '௭': '7',
  29074. '௮': '8',
  29075. '௯': '9',
  29076. '௦': '0',
  29077. };
  29078. var ta = moment.defineLocale('ta', {
  29079. months: 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split(
  29080. '_'
  29081. ),
  29082. monthsShort: 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split(
  29083. '_'
  29084. ),
  29085. weekdays: 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split(
  29086. '_'
  29087. ),
  29088. weekdaysShort: 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split(
  29089. '_'
  29090. ),
  29091. weekdaysMin: 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'),
  29092. longDateFormat: {
  29093. LT: 'HH:mm',
  29094. LTS: 'HH:mm:ss',
  29095. L: 'DD/MM/YYYY',
  29096. LL: 'D MMMM YYYY',
  29097. LLL: 'D MMMM YYYY, HH:mm',
  29098. LLLL: 'dddd, D MMMM YYYY, HH:mm',
  29099. },
  29100. calendar: {
  29101. sameDay: '[இன்று] LT',
  29102. nextDay: '[நாளை] LT',
  29103. nextWeek: 'dddd, LT',
  29104. lastDay: '[நேற்று] LT',
  29105. lastWeek: '[கடந்த வாரம்] dddd, LT',
  29106. sameElse: 'L',
  29107. },
  29108. relativeTime: {
  29109. future: '%s இல்',
  29110. past: '%s முன்',
  29111. s: 'ஒரு சில விநாடிகள்',
  29112. ss: '%d விநாடிகள்',
  29113. m: 'ஒரு நிமிடம்',
  29114. mm: '%d நிமிடங்கள்',
  29115. h: 'ஒரு மணி நேரம்',
  29116. hh: '%d மணி நேரம்',
  29117. d: 'ஒரு நாள்',
  29118. dd: '%d நாட்கள்',
  29119. M: 'ஒரு மாதம்',
  29120. MM: '%d மாதங்கள்',
  29121. y: 'ஒரு வருடம்',
  29122. yy: '%d ஆண்டுகள்',
  29123. },
  29124. dayOfMonthOrdinalParse: /\d{1,2}வது/,
  29125. ordinal: function (number) {
  29126. return number + 'வது';
  29127. },
  29128. preparse: function (string) {
  29129. return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) {
  29130. return numberMap[match];
  29131. });
  29132. },
  29133. postformat: function (string) {
  29134. return string.replace(/\d/g, function (match) {
  29135. return symbolMap[match];
  29136. });
  29137. },
  29138. // refer http://ta.wikipedia.org/s/1er1
  29139. meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/,
  29140. meridiem: function (hour, minute, isLower) {
  29141. if (hour < 2) {
  29142. return ' யாமம்';
  29143. } else if (hour < 6) {
  29144. return ' வைகறை'; // வைகறை
  29145. } else if (hour < 10) {
  29146. return ' காலை'; // காலை
  29147. } else if (hour < 14) {
  29148. return ' நண்பகல்'; // நண்பகல்
  29149. } else if (hour < 18) {
  29150. return ' எற்பாடு'; // எற்பாடு
  29151. } else if (hour < 22) {
  29152. return ' மாலை'; // மாலை
  29153. } else {
  29154. return ' யாமம்';
  29155. }
  29156. },
  29157. meridiemHour: function (hour, meridiem) {
  29158. if (hour === 12) {
  29159. hour = 0;
  29160. }
  29161. if (meridiem === 'யாமம்') {
  29162. return hour < 2 ? hour : hour + 12;
  29163. } else if (meridiem === 'வைகறை' || meridiem === 'காலை') {
  29164. return hour;
  29165. } else if (meridiem === 'நண்பகல்') {
  29166. return hour >= 10 ? hour : hour + 12;
  29167. } else {
  29168. return hour + 12;
  29169. }
  29170. },
  29171. week: {
  29172. dow: 0, // Sunday is the first day of the week.
  29173. doy: 6, // The week that contains Jan 6th is the first week of the year.
  29174. },
  29175. });
  29176. return ta;
  29177. })));
  29178. /***/ }),
  29179. /***/ "./node_modules/moment/locale/te.js":
  29180. /*!******************************************!*\
  29181. !*** ./node_modules/moment/locale/te.js ***!
  29182. \******************************************/
  29183. /*! no static exports found */
  29184. /***/ (function(module, exports, __webpack_require__) {
  29185. //! moment.js locale configuration
  29186. //! locale : Telugu [te]
  29187. //! author : Krishna Chaitanya Thota : https://github.com/kcthota
  29188. ;(function (global, factory) {
  29189. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  29190. undefined
  29191. }(this, (function (moment) { 'use strict';
  29192. //! moment.js locale configuration
  29193. var te = moment.defineLocale('te', {
  29194. months: 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split(
  29195. '_'
  29196. ),
  29197. monthsShort: 'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split(
  29198. '_'
  29199. ),
  29200. monthsParseExact: true,
  29201. weekdays: 'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split(
  29202. '_'
  29203. ),
  29204. weekdaysShort: 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'),
  29205. weekdaysMin: 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'),
  29206. longDateFormat: {
  29207. LT: 'A h:mm',
  29208. LTS: 'A h:mm:ss',
  29209. L: 'DD/MM/YYYY',
  29210. LL: 'D MMMM YYYY',
  29211. LLL: 'D MMMM YYYY, A h:mm',
  29212. LLLL: 'dddd, D MMMM YYYY, A h:mm',
  29213. },
  29214. calendar: {
  29215. sameDay: '[నేడు] LT',
  29216. nextDay: '[రేపు] LT',
  29217. nextWeek: 'dddd, LT',
  29218. lastDay: '[నిన్న] LT',
  29219. lastWeek: '[గత] dddd, LT',
  29220. sameElse: 'L',
  29221. },
  29222. relativeTime: {
  29223. future: '%s లో',
  29224. past: '%s క్రితం',
  29225. s: 'కొన్ని క్షణాలు',
  29226. ss: '%d సెకన్లు',
  29227. m: 'ఒక నిమిషం',
  29228. mm: '%d నిమిషాలు',
  29229. h: 'ఒక గంట',
  29230. hh: '%d గంటలు',
  29231. d: 'ఒక రోజు',
  29232. dd: '%d రోజులు',
  29233. M: 'ఒక నెల',
  29234. MM: '%d నెలలు',
  29235. y: 'ఒక సంవత్సరం',
  29236. yy: '%d సంవత్సరాలు',
  29237. },
  29238. dayOfMonthOrdinalParse: /\d{1,2}వ/,
  29239. ordinal: '%dవ',
  29240. meridiemParse: /రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/,
  29241. meridiemHour: function (hour, meridiem) {
  29242. if (hour === 12) {
  29243. hour = 0;
  29244. }
  29245. if (meridiem === 'రాత్రి') {
  29246. return hour < 4 ? hour : hour + 12;
  29247. } else if (meridiem === 'ఉదయం') {
  29248. return hour;
  29249. } else if (meridiem === 'మధ్యాహ్నం') {
  29250. return hour >= 10 ? hour : hour + 12;
  29251. } else if (meridiem === 'సాయంత్రం') {
  29252. return hour + 12;
  29253. }
  29254. },
  29255. meridiem: function (hour, minute, isLower) {
  29256. if (hour < 4) {
  29257. return 'రాత్రి';
  29258. } else if (hour < 10) {
  29259. return 'ఉదయం';
  29260. } else if (hour < 17) {
  29261. return 'మధ్యాహ్నం';
  29262. } else if (hour < 20) {
  29263. return 'సాయంత్రం';
  29264. } else {
  29265. return 'రాత్రి';
  29266. }
  29267. },
  29268. week: {
  29269. dow: 0, // Sunday is the first day of the week.
  29270. doy: 6, // The week that contains Jan 6th is the first week of the year.
  29271. },
  29272. });
  29273. return te;
  29274. })));
  29275. /***/ }),
  29276. /***/ "./node_modules/moment/locale/tet.js":
  29277. /*!*******************************************!*\
  29278. !*** ./node_modules/moment/locale/tet.js ***!
  29279. \*******************************************/
  29280. /*! no static exports found */
  29281. /***/ (function(module, exports, __webpack_require__) {
  29282. //! moment.js locale configuration
  29283. //! locale : Tetun Dili (East Timor) [tet]
  29284. //! author : Joshua Brooks : https://github.com/joshbrooks
  29285. //! author : Onorio De J. Afonso : https://github.com/marobo
  29286. //! author : Sonia Simoes : https://github.com/soniasimoes
  29287. ;(function (global, factory) {
  29288. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  29289. undefined
  29290. }(this, (function (moment) { 'use strict';
  29291. //! moment.js locale configuration
  29292. var tet = moment.defineLocale('tet', {
  29293. months: 'Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru'.split(
  29294. '_'
  29295. ),
  29296. monthsShort: 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
  29297. weekdays: 'Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu'.split('_'),
  29298. weekdaysShort: 'Dom_Seg_Ters_Kua_Kint_Sest_Sab'.split('_'),
  29299. weekdaysMin: 'Do_Seg_Te_Ku_Ki_Ses_Sa'.split('_'),
  29300. longDateFormat: {
  29301. LT: 'HH:mm',
  29302. LTS: 'HH:mm:ss',
  29303. L: 'DD/MM/YYYY',
  29304. LL: 'D MMMM YYYY',
  29305. LLL: 'D MMMM YYYY HH:mm',
  29306. LLLL: 'dddd, D MMMM YYYY HH:mm',
  29307. },
  29308. calendar: {
  29309. sameDay: '[Ohin iha] LT',
  29310. nextDay: '[Aban iha] LT',
  29311. nextWeek: 'dddd [iha] LT',
  29312. lastDay: '[Horiseik iha] LT',
  29313. lastWeek: 'dddd [semana kotuk] [iha] LT',
  29314. sameElse: 'L',
  29315. },
  29316. relativeTime: {
  29317. future: 'iha %s',
  29318. past: '%s liuba',
  29319. s: 'segundu balun',
  29320. ss: 'segundu %d',
  29321. m: 'minutu ida',
  29322. mm: 'minutu %d',
  29323. h: 'oras ida',
  29324. hh: 'oras %d',
  29325. d: 'loron ida',
  29326. dd: 'loron %d',
  29327. M: 'fulan ida',
  29328. MM: 'fulan %d',
  29329. y: 'tinan ida',
  29330. yy: 'tinan %d',
  29331. },
  29332. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  29333. ordinal: function (number) {
  29334. var b = number % 10,
  29335. output =
  29336. ~~((number % 100) / 10) === 1
  29337. ? 'th'
  29338. : b === 1
  29339. ? 'st'
  29340. : b === 2
  29341. ? 'nd'
  29342. : b === 3
  29343. ? 'rd'
  29344. : 'th';
  29345. return number + output;
  29346. },
  29347. week: {
  29348. dow: 1, // Monday is the first day of the week.
  29349. doy: 4, // The week that contains Jan 4th is the first week of the year.
  29350. },
  29351. });
  29352. return tet;
  29353. })));
  29354. /***/ }),
  29355. /***/ "./node_modules/moment/locale/tg.js":
  29356. /*!******************************************!*\
  29357. !*** ./node_modules/moment/locale/tg.js ***!
  29358. \******************************************/
  29359. /*! no static exports found */
  29360. /***/ (function(module, exports, __webpack_require__) {
  29361. //! moment.js locale configuration
  29362. //! locale : Tajik [tg]
  29363. //! author : Orif N. Jr. : https://github.com/orif-jr
  29364. ;(function (global, factory) {
  29365. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  29366. undefined
  29367. }(this, (function (moment) { 'use strict';
  29368. //! moment.js locale configuration
  29369. var suffixes = {
  29370. 0: '-ум',
  29371. 1: '-ум',
  29372. 2: '-юм',
  29373. 3: '-юм',
  29374. 4: '-ум',
  29375. 5: '-ум',
  29376. 6: '-ум',
  29377. 7: '-ум',
  29378. 8: '-ум',
  29379. 9: '-ум',
  29380. 10: '-ум',
  29381. 12: '-ум',
  29382. 13: '-ум',
  29383. 20: '-ум',
  29384. 30: '-юм',
  29385. 40: '-ум',
  29386. 50: '-ум',
  29387. 60: '-ум',
  29388. 70: '-ум',
  29389. 80: '-ум',
  29390. 90: '-ум',
  29391. 100: '-ум',
  29392. };
  29393. var tg = moment.defineLocale('tg', {
  29394. months: {
  29395. format: 'январи_феврали_марти_апрели_майи_июни_июли_августи_сентябри_октябри_ноябри_декабри'.split(
  29396. '_'
  29397. ),
  29398. standalone: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split(
  29399. '_'
  29400. ),
  29401. },
  29402. monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
  29403. weekdays: 'якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе'.split(
  29404. '_'
  29405. ),
  29406. weekdaysShort: 'яшб_дшб_сшб_чшб_пшб_ҷум_шнб'.split('_'),
  29407. weekdaysMin: 'яш_дш_сш_чш_пш_ҷм_шб'.split('_'),
  29408. longDateFormat: {
  29409. LT: 'HH:mm',
  29410. LTS: 'HH:mm:ss',
  29411. L: 'DD.MM.YYYY',
  29412. LL: 'D MMMM YYYY',
  29413. LLL: 'D MMMM YYYY HH:mm',
  29414. LLLL: 'dddd, D MMMM YYYY HH:mm',
  29415. },
  29416. calendar: {
  29417. sameDay: '[Имрӯз соати] LT',
  29418. nextDay: '[Фардо соати] LT',
  29419. lastDay: '[Дирӯз соати] LT',
  29420. nextWeek: 'dddd[и] [ҳафтаи оянда соати] LT',
  29421. lastWeek: 'dddd[и] [ҳафтаи гузашта соати] LT',
  29422. sameElse: 'L',
  29423. },
  29424. relativeTime: {
  29425. future: 'баъди %s',
  29426. past: '%s пеш',
  29427. s: 'якчанд сония',
  29428. m: 'як дақиқа',
  29429. mm: '%d дақиқа',
  29430. h: 'як соат',
  29431. hh: '%d соат',
  29432. d: 'як рӯз',
  29433. dd: '%d рӯз',
  29434. M: 'як моҳ',
  29435. MM: '%d моҳ',
  29436. y: 'як сол',
  29437. yy: '%d сол',
  29438. },
  29439. meridiemParse: /шаб|субҳ|рӯз|бегоҳ/,
  29440. meridiemHour: function (hour, meridiem) {
  29441. if (hour === 12) {
  29442. hour = 0;
  29443. }
  29444. if (meridiem === 'шаб') {
  29445. return hour < 4 ? hour : hour + 12;
  29446. } else if (meridiem === 'субҳ') {
  29447. return hour;
  29448. } else if (meridiem === 'рӯз') {
  29449. return hour >= 11 ? hour : hour + 12;
  29450. } else if (meridiem === 'бегоҳ') {
  29451. return hour + 12;
  29452. }
  29453. },
  29454. meridiem: function (hour, minute, isLower) {
  29455. if (hour < 4) {
  29456. return 'шаб';
  29457. } else if (hour < 11) {
  29458. return 'субҳ';
  29459. } else if (hour < 16) {
  29460. return 'рӯз';
  29461. } else if (hour < 19) {
  29462. return 'бегоҳ';
  29463. } else {
  29464. return 'шаб';
  29465. }
  29466. },
  29467. dayOfMonthOrdinalParse: /\d{1,2}-(ум|юм)/,
  29468. ordinal: function (number) {
  29469. var a = number % 10,
  29470. b = number >= 100 ? 100 : null;
  29471. return number + (suffixes[number] || suffixes[a] || suffixes[b]);
  29472. },
  29473. week: {
  29474. dow: 1, // Monday is the first day of the week.
  29475. doy: 7, // The week that contains Jan 1th is the first week of the year.
  29476. },
  29477. });
  29478. return tg;
  29479. })));
  29480. /***/ }),
  29481. /***/ "./node_modules/moment/locale/th.js":
  29482. /*!******************************************!*\
  29483. !*** ./node_modules/moment/locale/th.js ***!
  29484. \******************************************/
  29485. /*! no static exports found */
  29486. /***/ (function(module, exports, __webpack_require__) {
  29487. //! moment.js locale configuration
  29488. //! locale : Thai [th]
  29489. //! author : Kridsada Thanabulpong : https://github.com/sirn
  29490. ;(function (global, factory) {
  29491. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  29492. undefined
  29493. }(this, (function (moment) { 'use strict';
  29494. //! moment.js locale configuration
  29495. var th = moment.defineLocale('th', {
  29496. months: 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split(
  29497. '_'
  29498. ),
  29499. monthsShort: 'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split(
  29500. '_'
  29501. ),
  29502. monthsParseExact: true,
  29503. weekdays: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),
  29504. weekdaysShort: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference
  29505. weekdaysMin: 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),
  29506. weekdaysParseExact: true,
  29507. longDateFormat: {
  29508. LT: 'H:mm',
  29509. LTS: 'H:mm:ss',
  29510. L: 'DD/MM/YYYY',
  29511. LL: 'D MMMM YYYY',
  29512. LLL: 'D MMMM YYYY เวลา H:mm',
  29513. LLLL: 'วันddddที่ D MMMM YYYY เวลา H:mm',
  29514. },
  29515. meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,
  29516. isPM: function (input) {
  29517. return input === 'หลังเที่ยง';
  29518. },
  29519. meridiem: function (hour, minute, isLower) {
  29520. if (hour < 12) {
  29521. return 'ก่อนเที่ยง';
  29522. } else {
  29523. return 'หลังเที่ยง';
  29524. }
  29525. },
  29526. calendar: {
  29527. sameDay: '[วันนี้ เวลา] LT',
  29528. nextDay: '[พรุ่งนี้ เวลา] LT',
  29529. nextWeek: 'dddd[หน้า เวลา] LT',
  29530. lastDay: '[เมื่อวานนี้ เวลา] LT',
  29531. lastWeek: '[วัน]dddd[ที่แล้ว เวลา] LT',
  29532. sameElse: 'L',
  29533. },
  29534. relativeTime: {
  29535. future: 'อีก %s',
  29536. past: '%sที่แล้ว',
  29537. s: 'ไม่กี่วินาที',
  29538. ss: '%d วินาที',
  29539. m: '1 นาที',
  29540. mm: '%d นาที',
  29541. h: '1 ชั่วโมง',
  29542. hh: '%d ชั่วโมง',
  29543. d: '1 วัน',
  29544. dd: '%d วัน',
  29545. w: '1 สัปดาห์',
  29546. ww: '%d สัปดาห์',
  29547. M: '1 เดือน',
  29548. MM: '%d เดือน',
  29549. y: '1 ปี',
  29550. yy: '%d ปี',
  29551. },
  29552. });
  29553. return th;
  29554. })));
  29555. /***/ }),
  29556. /***/ "./node_modules/moment/locale/tk.js":
  29557. /*!******************************************!*\
  29558. !*** ./node_modules/moment/locale/tk.js ***!
  29559. \******************************************/
  29560. /*! no static exports found */
  29561. /***/ (function(module, exports, __webpack_require__) {
  29562. //! moment.js locale configuration
  29563. //! locale : Turkmen [tk]
  29564. //! author : Atamyrat Abdyrahmanov : https://github.com/atamyratabdy
  29565. ;(function (global, factory) {
  29566. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  29567. undefined
  29568. }(this, (function (moment) { 'use strict';
  29569. //! moment.js locale configuration
  29570. var suffixes = {
  29571. 1: "'inji",
  29572. 5: "'inji",
  29573. 8: "'inji",
  29574. 70: "'inji",
  29575. 80: "'inji",
  29576. 2: "'nji",
  29577. 7: "'nji",
  29578. 20: "'nji",
  29579. 50: "'nji",
  29580. 3: "'ünji",
  29581. 4: "'ünji",
  29582. 100: "'ünji",
  29583. 6: "'njy",
  29584. 9: "'unjy",
  29585. 10: "'unjy",
  29586. 30: "'unjy",
  29587. 60: "'ynjy",
  29588. 90: "'ynjy",
  29589. };
  29590. var tk = moment.defineLocale('tk', {
  29591. months: 'Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr'.split(
  29592. '_'
  29593. ),
  29594. monthsShort: 'Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek'.split('_'),
  29595. weekdays: 'Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe'.split(
  29596. '_'
  29597. ),
  29598. weekdaysShort: 'Ýek_Duş_Siş_Çar_Pen_Ann_Şen'.split('_'),
  29599. weekdaysMin: 'Ýk_Dş_Sş_Çr_Pn_An_Şn'.split('_'),
  29600. longDateFormat: {
  29601. LT: 'HH:mm',
  29602. LTS: 'HH:mm:ss',
  29603. L: 'DD.MM.YYYY',
  29604. LL: 'D MMMM YYYY',
  29605. LLL: 'D MMMM YYYY HH:mm',
  29606. LLLL: 'dddd, D MMMM YYYY HH:mm',
  29607. },
  29608. calendar: {
  29609. sameDay: '[bugün sagat] LT',
  29610. nextDay: '[ertir sagat] LT',
  29611. nextWeek: '[indiki] dddd [sagat] LT',
  29612. lastDay: '[düýn] LT',
  29613. lastWeek: '[geçen] dddd [sagat] LT',
  29614. sameElse: 'L',
  29615. },
  29616. relativeTime: {
  29617. future: '%s soň',
  29618. past: '%s öň',
  29619. s: 'birnäçe sekunt',
  29620. m: 'bir minut',
  29621. mm: '%d minut',
  29622. h: 'bir sagat',
  29623. hh: '%d sagat',
  29624. d: 'bir gün',
  29625. dd: '%d gün',
  29626. M: 'bir aý',
  29627. MM: '%d aý',
  29628. y: 'bir ýyl',
  29629. yy: '%d ýyl',
  29630. },
  29631. ordinal: function (number, period) {
  29632. switch (period) {
  29633. case 'd':
  29634. case 'D':
  29635. case 'Do':
  29636. case 'DD':
  29637. return number;
  29638. default:
  29639. if (number === 0) {
  29640. // special case for zero
  29641. return number + "'unjy";
  29642. }
  29643. var a = number % 10,
  29644. b = (number % 100) - a,
  29645. c = number >= 100 ? 100 : null;
  29646. return number + (suffixes[a] || suffixes[b] || suffixes[c]);
  29647. }
  29648. },
  29649. week: {
  29650. dow: 1, // Monday is the first day of the week.
  29651. doy: 7, // The week that contains Jan 7th is the first week of the year.
  29652. },
  29653. });
  29654. return tk;
  29655. })));
  29656. /***/ }),
  29657. /***/ "./node_modules/moment/locale/tl-ph.js":
  29658. /*!*********************************************!*\
  29659. !*** ./node_modules/moment/locale/tl-ph.js ***!
  29660. \*********************************************/
  29661. /*! no static exports found */
  29662. /***/ (function(module, exports, __webpack_require__) {
  29663. //! moment.js locale configuration
  29664. //! locale : Tagalog (Philippines) [tl-ph]
  29665. //! author : Dan Hagman : https://github.com/hagmandan
  29666. ;(function (global, factory) {
  29667. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  29668. undefined
  29669. }(this, (function (moment) { 'use strict';
  29670. //! moment.js locale configuration
  29671. var tlPh = moment.defineLocale('tl-ph', {
  29672. months: 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split(
  29673. '_'
  29674. ),
  29675. monthsShort: 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'),
  29676. weekdays: 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split(
  29677. '_'
  29678. ),
  29679. weekdaysShort: 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'),
  29680. weekdaysMin: 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'),
  29681. longDateFormat: {
  29682. LT: 'HH:mm',
  29683. LTS: 'HH:mm:ss',
  29684. L: 'MM/D/YYYY',
  29685. LL: 'MMMM D, YYYY',
  29686. LLL: 'MMMM D, YYYY HH:mm',
  29687. LLLL: 'dddd, MMMM DD, YYYY HH:mm',
  29688. },
  29689. calendar: {
  29690. sameDay: 'LT [ngayong araw]',
  29691. nextDay: '[Bukas ng] LT',
  29692. nextWeek: 'LT [sa susunod na] dddd',
  29693. lastDay: 'LT [kahapon]',
  29694. lastWeek: 'LT [noong nakaraang] dddd',
  29695. sameElse: 'L',
  29696. },
  29697. relativeTime: {
  29698. future: 'sa loob ng %s',
  29699. past: '%s ang nakalipas',
  29700. s: 'ilang segundo',
  29701. ss: '%d segundo',
  29702. m: 'isang minuto',
  29703. mm: '%d minuto',
  29704. h: 'isang oras',
  29705. hh: '%d oras',
  29706. d: 'isang araw',
  29707. dd: '%d araw',
  29708. M: 'isang buwan',
  29709. MM: '%d buwan',
  29710. y: 'isang taon',
  29711. yy: '%d taon',
  29712. },
  29713. dayOfMonthOrdinalParse: /\d{1,2}/,
  29714. ordinal: function (number) {
  29715. return number;
  29716. },
  29717. week: {
  29718. dow: 1, // Monday is the first day of the week.
  29719. doy: 4, // The week that contains Jan 4th is the first week of the year.
  29720. },
  29721. });
  29722. return tlPh;
  29723. })));
  29724. /***/ }),
  29725. /***/ "./node_modules/moment/locale/tlh.js":
  29726. /*!*******************************************!*\
  29727. !*** ./node_modules/moment/locale/tlh.js ***!
  29728. \*******************************************/
  29729. /*! no static exports found */
  29730. /***/ (function(module, exports, __webpack_require__) {
  29731. //! moment.js locale configuration
  29732. //! locale : Klingon [tlh]
  29733. //! author : Dominika Kruk : https://github.com/amaranthrose
  29734. ;(function (global, factory) {
  29735. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  29736. undefined
  29737. }(this, (function (moment) { 'use strict';
  29738. //! moment.js locale configuration
  29739. var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_');
  29740. function translateFuture(output) {
  29741. var time = output;
  29742. time =
  29743. output.indexOf('jaj') !== -1
  29744. ? time.slice(0, -3) + 'leS'
  29745. : output.indexOf('jar') !== -1
  29746. ? time.slice(0, -3) + 'waQ'
  29747. : output.indexOf('DIS') !== -1
  29748. ? time.slice(0, -3) + 'nem'
  29749. : time + ' pIq';
  29750. return time;
  29751. }
  29752. function translatePast(output) {
  29753. var time = output;
  29754. time =
  29755. output.indexOf('jaj') !== -1
  29756. ? time.slice(0, -3) + 'Hu’'
  29757. : output.indexOf('jar') !== -1
  29758. ? time.slice(0, -3) + 'wen'
  29759. : output.indexOf('DIS') !== -1
  29760. ? time.slice(0, -3) + 'ben'
  29761. : time + ' ret';
  29762. return time;
  29763. }
  29764. function translate(number, withoutSuffix, string, isFuture) {
  29765. var numberNoun = numberAsNoun(number);
  29766. switch (string) {
  29767. case 'ss':
  29768. return numberNoun + ' lup';
  29769. case 'mm':
  29770. return numberNoun + ' tup';
  29771. case 'hh':
  29772. return numberNoun + ' rep';
  29773. case 'dd':
  29774. return numberNoun + ' jaj';
  29775. case 'MM':
  29776. return numberNoun + ' jar';
  29777. case 'yy':
  29778. return numberNoun + ' DIS';
  29779. }
  29780. }
  29781. function numberAsNoun(number) {
  29782. var hundred = Math.floor((number % 1000) / 100),
  29783. ten = Math.floor((number % 100) / 10),
  29784. one = number % 10,
  29785. word = '';
  29786. if (hundred > 0) {
  29787. word += numbersNouns[hundred] + 'vatlh';
  29788. }
  29789. if (ten > 0) {
  29790. word += (word !== '' ? ' ' : '') + numbersNouns[ten] + 'maH';
  29791. }
  29792. if (one > 0) {
  29793. word += (word !== '' ? ' ' : '') + numbersNouns[one];
  29794. }
  29795. return word === '' ? 'pagh' : word;
  29796. }
  29797. var tlh = moment.defineLocale('tlh', {
  29798. 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(
  29799. '_'
  29800. ),
  29801. 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(
  29802. '_'
  29803. ),
  29804. monthsParseExact: true,
  29805. weekdays: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split(
  29806. '_'
  29807. ),
  29808. weekdaysShort: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split(
  29809. '_'
  29810. ),
  29811. weekdaysMin: 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split(
  29812. '_'
  29813. ),
  29814. longDateFormat: {
  29815. LT: 'HH:mm',
  29816. LTS: 'HH:mm:ss',
  29817. L: 'DD.MM.YYYY',
  29818. LL: 'D MMMM YYYY',
  29819. LLL: 'D MMMM YYYY HH:mm',
  29820. LLLL: 'dddd, D MMMM YYYY HH:mm',
  29821. },
  29822. calendar: {
  29823. sameDay: '[DaHjaj] LT',
  29824. nextDay: '[wa’leS] LT',
  29825. nextWeek: 'LLL',
  29826. lastDay: '[wa’Hu’] LT',
  29827. lastWeek: 'LLL',
  29828. sameElse: 'L',
  29829. },
  29830. relativeTime: {
  29831. future: translateFuture,
  29832. past: translatePast,
  29833. s: 'puS lup',
  29834. ss: translate,
  29835. m: 'wa’ tup',
  29836. mm: translate,
  29837. h: 'wa’ rep',
  29838. hh: translate,
  29839. d: 'wa’ jaj',
  29840. dd: translate,
  29841. M: 'wa’ jar',
  29842. MM: translate,
  29843. y: 'wa’ DIS',
  29844. yy: translate,
  29845. },
  29846. dayOfMonthOrdinalParse: /\d{1,2}\./,
  29847. ordinal: '%d.',
  29848. week: {
  29849. dow: 1, // Monday is the first day of the week.
  29850. doy: 4, // The week that contains Jan 4th is the first week of the year.
  29851. },
  29852. });
  29853. return tlh;
  29854. })));
  29855. /***/ }),
  29856. /***/ "./node_modules/moment/locale/tr.js":
  29857. /*!******************************************!*\
  29858. !*** ./node_modules/moment/locale/tr.js ***!
  29859. \******************************************/
  29860. /*! no static exports found */
  29861. /***/ (function(module, exports, __webpack_require__) {
  29862. //! moment.js locale configuration
  29863. //! locale : Turkish [tr]
  29864. //! authors : Erhan Gundogan : https://github.com/erhangundogan,
  29865. //! Burak Yiğit Kaya: https://github.com/BYK
  29866. ;(function (global, factory) {
  29867. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  29868. undefined
  29869. }(this, (function (moment) { 'use strict';
  29870. //! moment.js locale configuration
  29871. var suffixes = {
  29872. 1: "'inci",
  29873. 5: "'inci",
  29874. 8: "'inci",
  29875. 70: "'inci",
  29876. 80: "'inci",
  29877. 2: "'nci",
  29878. 7: "'nci",
  29879. 20: "'nci",
  29880. 50: "'nci",
  29881. 3: "'üncü",
  29882. 4: "'üncü",
  29883. 100: "'üncü",
  29884. 6: "'ncı",
  29885. 9: "'uncu",
  29886. 10: "'uncu",
  29887. 30: "'uncu",
  29888. 60: "'ıncı",
  29889. 90: "'ıncı",
  29890. };
  29891. var tr = moment.defineLocale('tr', {
  29892. months: 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split(
  29893. '_'
  29894. ),
  29895. monthsShort: 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),
  29896. weekdays: 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split(
  29897. '_'
  29898. ),
  29899. weekdaysShort: 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),
  29900. weekdaysMin: 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),
  29901. meridiem: function (hours, minutes, isLower) {
  29902. if (hours < 12) {
  29903. return isLower ? 'öö' : 'ÖÖ';
  29904. } else {
  29905. return isLower ? 'ös' : 'ÖS';
  29906. }
  29907. },
  29908. meridiemParse: /öö|ÖÖ|ös|ÖS/,
  29909. isPM: function (input) {
  29910. return input === 'ös' || input === 'ÖS';
  29911. },
  29912. longDateFormat: {
  29913. LT: 'HH:mm',
  29914. LTS: 'HH:mm:ss',
  29915. L: 'DD.MM.YYYY',
  29916. LL: 'D MMMM YYYY',
  29917. LLL: 'D MMMM YYYY HH:mm',
  29918. LLLL: 'dddd, D MMMM YYYY HH:mm',
  29919. },
  29920. calendar: {
  29921. sameDay: '[bugün saat] LT',
  29922. nextDay: '[yarın saat] LT',
  29923. nextWeek: '[gelecek] dddd [saat] LT',
  29924. lastDay: '[dün] LT',
  29925. lastWeek: '[geçen] dddd [saat] LT',
  29926. sameElse: 'L',
  29927. },
  29928. relativeTime: {
  29929. future: '%s sonra',
  29930. past: '%s önce',
  29931. s: 'birkaç saniye',
  29932. ss: '%d saniye',
  29933. m: 'bir dakika',
  29934. mm: '%d dakika',
  29935. h: 'bir saat',
  29936. hh: '%d saat',
  29937. d: 'bir gün',
  29938. dd: '%d gün',
  29939. w: 'bir hafta',
  29940. ww: '%d hafta',
  29941. M: 'bir ay',
  29942. MM: '%d ay',
  29943. y: 'bir yıl',
  29944. yy: '%d yıl',
  29945. },
  29946. ordinal: function (number, period) {
  29947. switch (period) {
  29948. case 'd':
  29949. case 'D':
  29950. case 'Do':
  29951. case 'DD':
  29952. return number;
  29953. default:
  29954. if (number === 0) {
  29955. // special case for zero
  29956. return number + "'ıncı";
  29957. }
  29958. var a = number % 10,
  29959. b = (number % 100) - a,
  29960. c = number >= 100 ? 100 : null;
  29961. return number + (suffixes[a] || suffixes[b] || suffixes[c]);
  29962. }
  29963. },
  29964. week: {
  29965. dow: 1, // Monday is the first day of the week.
  29966. doy: 7, // The week that contains Jan 7th is the first week of the year.
  29967. },
  29968. });
  29969. return tr;
  29970. })));
  29971. /***/ }),
  29972. /***/ "./node_modules/moment/locale/tzl.js":
  29973. /*!*******************************************!*\
  29974. !*** ./node_modules/moment/locale/tzl.js ***!
  29975. \*******************************************/
  29976. /*! no static exports found */
  29977. /***/ (function(module, exports, __webpack_require__) {
  29978. //! moment.js locale configuration
  29979. //! locale : Talossan [tzl]
  29980. //! author : Robin van der Vliet : https://github.com/robin0van0der0v
  29981. //! author : Iustì Canun
  29982. ;(function (global, factory) {
  29983. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  29984. undefined
  29985. }(this, (function (moment) { 'use strict';
  29986. //! moment.js locale configuration
  29987. // After the year there should be a slash and the amount of years since December 26, 1979 in Roman numerals.
  29988. // This is currently too difficult (maybe even impossible) to add.
  29989. var tzl = moment.defineLocale('tzl', {
  29990. months: 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split(
  29991. '_'
  29992. ),
  29993. monthsShort: 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'),
  29994. weekdays: 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'),
  29995. weekdaysShort: 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'),
  29996. weekdaysMin: 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'),
  29997. longDateFormat: {
  29998. LT: 'HH.mm',
  29999. LTS: 'HH.mm.ss',
  30000. L: 'DD.MM.YYYY',
  30001. LL: 'D. MMMM [dallas] YYYY',
  30002. LLL: 'D. MMMM [dallas] YYYY HH.mm',
  30003. LLLL: 'dddd, [li] D. MMMM [dallas] YYYY HH.mm',
  30004. },
  30005. meridiemParse: /d\'o|d\'a/i,
  30006. isPM: function (input) {
  30007. return "d'o" === input.toLowerCase();
  30008. },
  30009. meridiem: function (hours, minutes, isLower) {
  30010. if (hours > 11) {
  30011. return isLower ? "d'o" : "D'O";
  30012. } else {
  30013. return isLower ? "d'a" : "D'A";
  30014. }
  30015. },
  30016. calendar: {
  30017. sameDay: '[oxhi à] LT',
  30018. nextDay: '[demà à] LT',
  30019. nextWeek: 'dddd [à] LT',
  30020. lastDay: '[ieiri à] LT',
  30021. lastWeek: '[sür el] dddd [lasteu à] LT',
  30022. sameElse: 'L',
  30023. },
  30024. relativeTime: {
  30025. future: 'osprei %s',
  30026. past: 'ja%s',
  30027. s: processRelativeTime,
  30028. ss: processRelativeTime,
  30029. m: processRelativeTime,
  30030. mm: processRelativeTime,
  30031. h: processRelativeTime,
  30032. hh: processRelativeTime,
  30033. d: processRelativeTime,
  30034. dd: processRelativeTime,
  30035. M: processRelativeTime,
  30036. MM: processRelativeTime,
  30037. y: processRelativeTime,
  30038. yy: processRelativeTime,
  30039. },
  30040. dayOfMonthOrdinalParse: /\d{1,2}\./,
  30041. ordinal: '%d.',
  30042. week: {
  30043. dow: 1, // Monday is the first day of the week.
  30044. doy: 4, // The week that contains Jan 4th is the first week of the year.
  30045. },
  30046. });
  30047. function processRelativeTime(number, withoutSuffix, key, isFuture) {
  30048. var format = {
  30049. s: ['viensas secunds', "'iensas secunds"],
  30050. ss: [number + ' secunds', '' + number + ' secunds'],
  30051. m: ["'n míut", "'iens míut"],
  30052. mm: [number + ' míuts', '' + number + ' míuts'],
  30053. h: ["'n þora", "'iensa þora"],
  30054. hh: [number + ' þoras', '' + number + ' þoras'],
  30055. d: ["'n ziua", "'iensa ziua"],
  30056. dd: [number + ' ziuas', '' + number + ' ziuas'],
  30057. M: ["'n mes", "'iens mes"],
  30058. MM: [number + ' mesen', '' + number + ' mesen'],
  30059. y: ["'n ar", "'iens ar"],
  30060. yy: [number + ' ars', '' + number + ' ars'],
  30061. };
  30062. return isFuture
  30063. ? format[key][0]
  30064. : withoutSuffix
  30065. ? format[key][0]
  30066. : format[key][1];
  30067. }
  30068. return tzl;
  30069. })));
  30070. /***/ }),
  30071. /***/ "./node_modules/moment/locale/tzm-latn.js":
  30072. /*!************************************************!*\
  30073. !*** ./node_modules/moment/locale/tzm-latn.js ***!
  30074. \************************************************/
  30075. /*! no static exports found */
  30076. /***/ (function(module, exports, __webpack_require__) {
  30077. //! moment.js locale configuration
  30078. //! locale : Central Atlas Tamazight Latin [tzm-latn]
  30079. //! author : Abdel Said : https://github.com/abdelsaid
  30080. ;(function (global, factory) {
  30081. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  30082. undefined
  30083. }(this, (function (moment) { 'use strict';
  30084. //! moment.js locale configuration
  30085. var tzmLatn = moment.defineLocale('tzm-latn', {
  30086. months: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split(
  30087. '_'
  30088. ),
  30089. monthsShort: 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split(
  30090. '_'
  30091. ),
  30092. weekdays: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
  30093. weekdaysShort: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
  30094. weekdaysMin: 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
  30095. longDateFormat: {
  30096. LT: 'HH:mm',
  30097. LTS: 'HH:mm:ss',
  30098. L: 'DD/MM/YYYY',
  30099. LL: 'D MMMM YYYY',
  30100. LLL: 'D MMMM YYYY HH:mm',
  30101. LLLL: 'dddd D MMMM YYYY HH:mm',
  30102. },
  30103. calendar: {
  30104. sameDay: '[asdkh g] LT',
  30105. nextDay: '[aska g] LT',
  30106. nextWeek: 'dddd [g] LT',
  30107. lastDay: '[assant g] LT',
  30108. lastWeek: 'dddd [g] LT',
  30109. sameElse: 'L',
  30110. },
  30111. relativeTime: {
  30112. future: 'dadkh s yan %s',
  30113. past: 'yan %s',
  30114. s: 'imik',
  30115. ss: '%d imik',
  30116. m: 'minuḍ',
  30117. mm: '%d minuḍ',
  30118. h: 'saɛa',
  30119. hh: '%d tassaɛin',
  30120. d: 'ass',
  30121. dd: '%d ossan',
  30122. M: 'ayowr',
  30123. MM: '%d iyyirn',
  30124. y: 'asgas',
  30125. yy: '%d isgasn',
  30126. },
  30127. week: {
  30128. dow: 6, // Saturday is the first day of the week.
  30129. doy: 12, // The week that contains Jan 12th is the first week of the year.
  30130. },
  30131. });
  30132. return tzmLatn;
  30133. })));
  30134. /***/ }),
  30135. /***/ "./node_modules/moment/locale/tzm.js":
  30136. /*!*******************************************!*\
  30137. !*** ./node_modules/moment/locale/tzm.js ***!
  30138. \*******************************************/
  30139. /*! no static exports found */
  30140. /***/ (function(module, exports, __webpack_require__) {
  30141. //! moment.js locale configuration
  30142. //! locale : Central Atlas Tamazight [tzm]
  30143. //! author : Abdel Said : https://github.com/abdelsaid
  30144. ;(function (global, factory) {
  30145. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  30146. undefined
  30147. }(this, (function (moment) { 'use strict';
  30148. //! moment.js locale configuration
  30149. var tzm = moment.defineLocale('tzm', {
  30150. months: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split(
  30151. '_'
  30152. ),
  30153. monthsShort: 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split(
  30154. '_'
  30155. ),
  30156. weekdays: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
  30157. weekdaysShort: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
  30158. weekdaysMin: 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'),
  30159. longDateFormat: {
  30160. LT: 'HH:mm',
  30161. LTS: 'HH:mm:ss',
  30162. L: 'DD/MM/YYYY',
  30163. LL: 'D MMMM YYYY',
  30164. LLL: 'D MMMM YYYY HH:mm',
  30165. LLLL: 'dddd D MMMM YYYY HH:mm',
  30166. },
  30167. calendar: {
  30168. sameDay: '[ⴰⵙⴷⵅ ⴴ] LT',
  30169. nextDay: '[ⴰⵙⴽⴰ ⴴ] LT',
  30170. nextWeek: 'dddd [ⴴ] LT',
  30171. lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT',
  30172. lastWeek: 'dddd [ⴴ] LT',
  30173. sameElse: 'L',
  30174. },
  30175. relativeTime: {
  30176. future: 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s',
  30177. past: 'ⵢⴰⵏ %s',
  30178. s: 'ⵉⵎⵉⴽ',
  30179. ss: '%d ⵉⵎⵉⴽ',
  30180. m: 'ⵎⵉⵏⵓⴺ',
  30181. mm: '%d ⵎⵉⵏⵓⴺ',
  30182. h: 'ⵙⴰⵄⴰ',
  30183. hh: '%d ⵜⴰⵙⵙⴰⵄⵉⵏ',
  30184. d: 'ⴰⵙⵙ',
  30185. dd: '%d oⵙⵙⴰⵏ',
  30186. M: 'ⴰⵢoⵓⵔ',
  30187. MM: '%d ⵉⵢⵢⵉⵔⵏ',
  30188. y: 'ⴰⵙⴳⴰⵙ',
  30189. yy: '%d ⵉⵙⴳⴰⵙⵏ',
  30190. },
  30191. week: {
  30192. dow: 6, // Saturday is the first day of the week.
  30193. doy: 12, // The week that contains Jan 12th is the first week of the year.
  30194. },
  30195. });
  30196. return tzm;
  30197. })));
  30198. /***/ }),
  30199. /***/ "./node_modules/moment/locale/ug-cn.js":
  30200. /*!*********************************************!*\
  30201. !*** ./node_modules/moment/locale/ug-cn.js ***!
  30202. \*********************************************/
  30203. /*! no static exports found */
  30204. /***/ (function(module, exports, __webpack_require__) {
  30205. //! moment.js locale configuration
  30206. //! locale : Uyghur (China) [ug-cn]
  30207. //! author: boyaq : https://github.com/boyaq
  30208. ;(function (global, factory) {
  30209. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  30210. undefined
  30211. }(this, (function (moment) { 'use strict';
  30212. //! moment.js locale configuration
  30213. var ugCn = moment.defineLocale('ug-cn', {
  30214. months: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split(
  30215. '_'
  30216. ),
  30217. monthsShort: 'يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر'.split(
  30218. '_'
  30219. ),
  30220. weekdays: 'يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە'.split(
  30221. '_'
  30222. ),
  30223. weekdaysShort: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),
  30224. weekdaysMin: 'يە_دۈ_سە_چا_پە_جۈ_شە'.split('_'),
  30225. longDateFormat: {
  30226. LT: 'HH:mm',
  30227. LTS: 'HH:mm:ss',
  30228. L: 'YYYY-MM-DD',
  30229. LL: 'YYYY-يىلىM-ئاينىڭD-كۈنى',
  30230. LLL: 'YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm',
  30231. LLLL: 'dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm',
  30232. },
  30233. meridiemParse: /يېرىم كېچە|سەھەر|چۈشتىن بۇرۇن|چۈش|چۈشتىن كېيىن|كەچ/,
  30234. meridiemHour: function (hour, meridiem) {
  30235. if (hour === 12) {
  30236. hour = 0;
  30237. }
  30238. if (
  30239. meridiem === 'يېرىم كېچە' ||
  30240. meridiem === 'سەھەر' ||
  30241. meridiem === 'چۈشتىن بۇرۇن'
  30242. ) {
  30243. return hour;
  30244. } else if (meridiem === 'چۈشتىن كېيىن' || meridiem === 'كەچ') {
  30245. return hour + 12;
  30246. } else {
  30247. return hour >= 11 ? hour : hour + 12;
  30248. }
  30249. },
  30250. meridiem: function (hour, minute, isLower) {
  30251. var hm = hour * 100 + minute;
  30252. if (hm < 600) {
  30253. return 'يېرىم كېچە';
  30254. } else if (hm < 900) {
  30255. return 'سەھەر';
  30256. } else if (hm < 1130) {
  30257. return 'چۈشتىن بۇرۇن';
  30258. } else if (hm < 1230) {
  30259. return 'چۈش';
  30260. } else if (hm < 1800) {
  30261. return 'چۈشتىن كېيىن';
  30262. } else {
  30263. return 'كەچ';
  30264. }
  30265. },
  30266. calendar: {
  30267. sameDay: '[بۈگۈن سائەت] LT',
  30268. nextDay: '[ئەتە سائەت] LT',
  30269. nextWeek: '[كېلەركى] dddd [سائەت] LT',
  30270. lastDay: '[تۆنۈگۈن] LT',
  30271. lastWeek: '[ئالدىنقى] dddd [سائەت] LT',
  30272. sameElse: 'L',
  30273. },
  30274. relativeTime: {
  30275. future: '%s كېيىن',
  30276. past: '%s بۇرۇن',
  30277. s: 'نەچچە سېكونت',
  30278. ss: '%d سېكونت',
  30279. m: 'بىر مىنۇت',
  30280. mm: '%d مىنۇت',
  30281. h: 'بىر سائەت',
  30282. hh: '%d سائەت',
  30283. d: 'بىر كۈن',
  30284. dd: '%d كۈن',
  30285. M: 'بىر ئاي',
  30286. MM: '%d ئاي',
  30287. y: 'بىر يىل',
  30288. yy: '%d يىل',
  30289. },
  30290. dayOfMonthOrdinalParse: /\d{1,2}(-كۈنى|-ئاي|-ھەپتە)/,
  30291. ordinal: function (number, period) {
  30292. switch (period) {
  30293. case 'd':
  30294. case 'D':
  30295. case 'DDD':
  30296. return number + '-كۈنى';
  30297. case 'w':
  30298. case 'W':
  30299. return number + '-ھەپتە';
  30300. default:
  30301. return number;
  30302. }
  30303. },
  30304. preparse: function (string) {
  30305. return string.replace(/،/g, ',');
  30306. },
  30307. postformat: function (string) {
  30308. return string.replace(/,/g, '،');
  30309. },
  30310. week: {
  30311. // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
  30312. dow: 1, // Monday is the first day of the week.
  30313. doy: 7, // The week that contains Jan 1st is the first week of the year.
  30314. },
  30315. });
  30316. return ugCn;
  30317. })));
  30318. /***/ }),
  30319. /***/ "./node_modules/moment/locale/uk.js":
  30320. /*!******************************************!*\
  30321. !*** ./node_modules/moment/locale/uk.js ***!
  30322. \******************************************/
  30323. /*! no static exports found */
  30324. /***/ (function(module, exports, __webpack_require__) {
  30325. //! moment.js locale configuration
  30326. //! locale : Ukrainian [uk]
  30327. //! author : zemlanin : https://github.com/zemlanin
  30328. //! Author : Menelion Elensúle : https://github.com/Oire
  30329. ;(function (global, factory) {
  30330. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  30331. undefined
  30332. }(this, (function (moment) { 'use strict';
  30333. //! moment.js locale configuration
  30334. function plural(word, num) {
  30335. var forms = word.split('_');
  30336. return num % 10 === 1 && num % 100 !== 11
  30337. ? forms[0]
  30338. : num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20)
  30339. ? forms[1]
  30340. : forms[2];
  30341. }
  30342. function relativeTimeWithPlural(number, withoutSuffix, key) {
  30343. var format = {
  30344. ss: withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд',
  30345. mm: withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',
  30346. hh: withoutSuffix ? 'година_години_годин' : 'годину_години_годин',
  30347. dd: 'день_дні_днів',
  30348. MM: 'місяць_місяці_місяців',
  30349. yy: 'рік_роки_років',
  30350. };
  30351. if (key === 'm') {
  30352. return withoutSuffix ? 'хвилина' : 'хвилину';
  30353. } else if (key === 'h') {
  30354. return withoutSuffix ? 'година' : 'годину';
  30355. } else {
  30356. return number + ' ' + plural(format[key], +number);
  30357. }
  30358. }
  30359. function weekdaysCaseReplace(m, format) {
  30360. var weekdays = {
  30361. nominative: 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split(
  30362. '_'
  30363. ),
  30364. accusative: 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split(
  30365. '_'
  30366. ),
  30367. genitive: 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split(
  30368. '_'
  30369. ),
  30370. },
  30371. nounCase;
  30372. if (m === true) {
  30373. return weekdays['nominative']
  30374. .slice(1, 7)
  30375. .concat(weekdays['nominative'].slice(0, 1));
  30376. }
  30377. if (!m) {
  30378. return weekdays['nominative'];
  30379. }
  30380. nounCase = /(\[[ВвУу]\]) ?dddd/.test(format)
  30381. ? 'accusative'
  30382. : /\[?(?:минулої|наступної)? ?\] ?dddd/.test(format)
  30383. ? 'genitive'
  30384. : 'nominative';
  30385. return weekdays[nounCase][m.day()];
  30386. }
  30387. function processHoursFunction(str) {
  30388. return function () {
  30389. return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT';
  30390. };
  30391. }
  30392. var uk = moment.defineLocale('uk', {
  30393. months: {
  30394. format: 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split(
  30395. '_'
  30396. ),
  30397. standalone: 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split(
  30398. '_'
  30399. ),
  30400. },
  30401. monthsShort: 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split(
  30402. '_'
  30403. ),
  30404. weekdays: weekdaysCaseReplace,
  30405. weekdaysShort: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  30406. weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  30407. longDateFormat: {
  30408. LT: 'HH:mm',
  30409. LTS: 'HH:mm:ss',
  30410. L: 'DD.MM.YYYY',
  30411. LL: 'D MMMM YYYY р.',
  30412. LLL: 'D MMMM YYYY р., HH:mm',
  30413. LLLL: 'dddd, D MMMM YYYY р., HH:mm',
  30414. },
  30415. calendar: {
  30416. sameDay: processHoursFunction('[Сьогодні '),
  30417. nextDay: processHoursFunction('[Завтра '),
  30418. lastDay: processHoursFunction('[Вчора '),
  30419. nextWeek: processHoursFunction('[У] dddd ['),
  30420. lastWeek: function () {
  30421. switch (this.day()) {
  30422. case 0:
  30423. case 3:
  30424. case 5:
  30425. case 6:
  30426. return processHoursFunction('[Минулої] dddd [').call(this);
  30427. case 1:
  30428. case 2:
  30429. case 4:
  30430. return processHoursFunction('[Минулого] dddd [').call(this);
  30431. }
  30432. },
  30433. sameElse: 'L',
  30434. },
  30435. relativeTime: {
  30436. future: 'за %s',
  30437. past: '%s тому',
  30438. s: 'декілька секунд',
  30439. ss: relativeTimeWithPlural,
  30440. m: relativeTimeWithPlural,
  30441. mm: relativeTimeWithPlural,
  30442. h: 'годину',
  30443. hh: relativeTimeWithPlural,
  30444. d: 'день',
  30445. dd: relativeTimeWithPlural,
  30446. M: 'місяць',
  30447. MM: relativeTimeWithPlural,
  30448. y: 'рік',
  30449. yy: relativeTimeWithPlural,
  30450. },
  30451. // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason
  30452. meridiemParse: /ночі|ранку|дня|вечора/,
  30453. isPM: function (input) {
  30454. return /^(дня|вечора)$/.test(input);
  30455. },
  30456. meridiem: function (hour, minute, isLower) {
  30457. if (hour < 4) {
  30458. return 'ночі';
  30459. } else if (hour < 12) {
  30460. return 'ранку';
  30461. } else if (hour < 17) {
  30462. return 'дня';
  30463. } else {
  30464. return 'вечора';
  30465. }
  30466. },
  30467. dayOfMonthOrdinalParse: /\d{1,2}-(й|го)/,
  30468. ordinal: function (number, period) {
  30469. switch (period) {
  30470. case 'M':
  30471. case 'd':
  30472. case 'DDD':
  30473. case 'w':
  30474. case 'W':
  30475. return number + '-й';
  30476. case 'D':
  30477. return number + '-го';
  30478. default:
  30479. return number;
  30480. }
  30481. },
  30482. week: {
  30483. dow: 1, // Monday is the first day of the week.
  30484. doy: 7, // The week that contains Jan 7th is the first week of the year.
  30485. },
  30486. });
  30487. return uk;
  30488. })));
  30489. /***/ }),
  30490. /***/ "./node_modules/moment/locale/ur.js":
  30491. /*!******************************************!*\
  30492. !*** ./node_modules/moment/locale/ur.js ***!
  30493. \******************************************/
  30494. /*! no static exports found */
  30495. /***/ (function(module, exports, __webpack_require__) {
  30496. //! moment.js locale configuration
  30497. //! locale : Urdu [ur]
  30498. //! author : Sawood Alam : https://github.com/ibnesayeed
  30499. //! author : Zack : https://github.com/ZackVision
  30500. ;(function (global, factory) {
  30501. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  30502. undefined
  30503. }(this, (function (moment) { 'use strict';
  30504. //! moment.js locale configuration
  30505. var months = [
  30506. 'جنوری',
  30507. 'فروری',
  30508. 'مارچ',
  30509. 'اپریل',
  30510. 'مئی',
  30511. 'جون',
  30512. 'جولائی',
  30513. 'اگست',
  30514. 'ستمبر',
  30515. 'اکتوبر',
  30516. 'نومبر',
  30517. 'دسمبر',
  30518. ],
  30519. days = ['اتوار', 'پیر', 'منگل', 'بدھ', 'جمعرات', 'جمعہ', 'ہفتہ'];
  30520. var ur = moment.defineLocale('ur', {
  30521. months: months,
  30522. monthsShort: months,
  30523. weekdays: days,
  30524. weekdaysShort: days,
  30525. weekdaysMin: days,
  30526. longDateFormat: {
  30527. LT: 'HH:mm',
  30528. LTS: 'HH:mm:ss',
  30529. L: 'DD/MM/YYYY',
  30530. LL: 'D MMMM YYYY',
  30531. LLL: 'D MMMM YYYY HH:mm',
  30532. LLLL: 'dddd، D MMMM YYYY HH:mm',
  30533. },
  30534. meridiemParse: /صبح|شام/,
  30535. isPM: function (input) {
  30536. return 'شام' === input;
  30537. },
  30538. meridiem: function (hour, minute, isLower) {
  30539. if (hour < 12) {
  30540. return 'صبح';
  30541. }
  30542. return 'شام';
  30543. },
  30544. calendar: {
  30545. sameDay: '[آج بوقت] LT',
  30546. nextDay: '[کل بوقت] LT',
  30547. nextWeek: 'dddd [بوقت] LT',
  30548. lastDay: '[گذشتہ روز بوقت] LT',
  30549. lastWeek: '[گذشتہ] dddd [بوقت] LT',
  30550. sameElse: 'L',
  30551. },
  30552. relativeTime: {
  30553. future: '%s بعد',
  30554. past: '%s قبل',
  30555. s: 'چند سیکنڈ',
  30556. ss: '%d سیکنڈ',
  30557. m: 'ایک منٹ',
  30558. mm: '%d منٹ',
  30559. h: 'ایک گھنٹہ',
  30560. hh: '%d گھنٹے',
  30561. d: 'ایک دن',
  30562. dd: '%d دن',
  30563. M: 'ایک ماہ',
  30564. MM: '%d ماہ',
  30565. y: 'ایک سال',
  30566. yy: '%d سال',
  30567. },
  30568. preparse: function (string) {
  30569. return string.replace(/،/g, ',');
  30570. },
  30571. postformat: function (string) {
  30572. return string.replace(/,/g, '،');
  30573. },
  30574. week: {
  30575. dow: 1, // Monday is the first day of the week.
  30576. doy: 4, // The week that contains Jan 4th is the first week of the year.
  30577. },
  30578. });
  30579. return ur;
  30580. })));
  30581. /***/ }),
  30582. /***/ "./node_modules/moment/locale/uz-latn.js":
  30583. /*!***********************************************!*\
  30584. !*** ./node_modules/moment/locale/uz-latn.js ***!
  30585. \***********************************************/
  30586. /*! no static exports found */
  30587. /***/ (function(module, exports, __webpack_require__) {
  30588. //! moment.js locale configuration
  30589. //! locale : Uzbek Latin [uz-latn]
  30590. //! author : Rasulbek Mirzayev : github.com/Rasulbeeek
  30591. ;(function (global, factory) {
  30592. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  30593. undefined
  30594. }(this, (function (moment) { 'use strict';
  30595. //! moment.js locale configuration
  30596. var uzLatn = moment.defineLocale('uz-latn', {
  30597. months: 'Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr'.split(
  30598. '_'
  30599. ),
  30600. monthsShort: 'Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek'.split('_'),
  30601. weekdays: 'Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba'.split(
  30602. '_'
  30603. ),
  30604. weekdaysShort: 'Yak_Dush_Sesh_Chor_Pay_Jum_Shan'.split('_'),
  30605. weekdaysMin: 'Ya_Du_Se_Cho_Pa_Ju_Sha'.split('_'),
  30606. longDateFormat: {
  30607. LT: 'HH:mm',
  30608. LTS: 'HH:mm:ss',
  30609. L: 'DD/MM/YYYY',
  30610. LL: 'D MMMM YYYY',
  30611. LLL: 'D MMMM YYYY HH:mm',
  30612. LLLL: 'D MMMM YYYY, dddd HH:mm',
  30613. },
  30614. calendar: {
  30615. sameDay: '[Bugun soat] LT [da]',
  30616. nextDay: '[Ertaga] LT [da]',
  30617. nextWeek: 'dddd [kuni soat] LT [da]',
  30618. lastDay: '[Kecha soat] LT [da]',
  30619. lastWeek: "[O'tgan] dddd [kuni soat] LT [da]",
  30620. sameElse: 'L',
  30621. },
  30622. relativeTime: {
  30623. future: 'Yaqin %s ichida',
  30624. past: 'Bir necha %s oldin',
  30625. s: 'soniya',
  30626. ss: '%d soniya',
  30627. m: 'bir daqiqa',
  30628. mm: '%d daqiqa',
  30629. h: 'bir soat',
  30630. hh: '%d soat',
  30631. d: 'bir kun',
  30632. dd: '%d kun',
  30633. M: 'bir oy',
  30634. MM: '%d oy',
  30635. y: 'bir yil',
  30636. yy: '%d yil',
  30637. },
  30638. week: {
  30639. dow: 1, // Monday is the first day of the week.
  30640. doy: 7, // The week that contains Jan 7th is the first week of the year.
  30641. },
  30642. });
  30643. return uzLatn;
  30644. })));
  30645. /***/ }),
  30646. /***/ "./node_modules/moment/locale/uz.js":
  30647. /*!******************************************!*\
  30648. !*** ./node_modules/moment/locale/uz.js ***!
  30649. \******************************************/
  30650. /*! no static exports found */
  30651. /***/ (function(module, exports, __webpack_require__) {
  30652. //! moment.js locale configuration
  30653. //! locale : Uzbek [uz]
  30654. //! author : Sardor Muminov : https://github.com/muminoff
  30655. ;(function (global, factory) {
  30656. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  30657. undefined
  30658. }(this, (function (moment) { 'use strict';
  30659. //! moment.js locale configuration
  30660. var uz = moment.defineLocale('uz', {
  30661. months: 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split(
  30662. '_'
  30663. ),
  30664. monthsShort: 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
  30665. weekdays: 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),
  30666. weekdaysShort: 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),
  30667. weekdaysMin: 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'),
  30668. longDateFormat: {
  30669. LT: 'HH:mm',
  30670. LTS: 'HH:mm:ss',
  30671. L: 'DD/MM/YYYY',
  30672. LL: 'D MMMM YYYY',
  30673. LLL: 'D MMMM YYYY HH:mm',
  30674. LLLL: 'D MMMM YYYY, dddd HH:mm',
  30675. },
  30676. calendar: {
  30677. sameDay: '[Бугун соат] LT [да]',
  30678. nextDay: '[Эртага] LT [да]',
  30679. nextWeek: 'dddd [куни соат] LT [да]',
  30680. lastDay: '[Кеча соат] LT [да]',
  30681. lastWeek: '[Утган] dddd [куни соат] LT [да]',
  30682. sameElse: 'L',
  30683. },
  30684. relativeTime: {
  30685. future: 'Якин %s ичида',
  30686. past: 'Бир неча %s олдин',
  30687. s: 'фурсат',
  30688. ss: '%d фурсат',
  30689. m: 'бир дакика',
  30690. mm: '%d дакика',
  30691. h: 'бир соат',
  30692. hh: '%d соат',
  30693. d: 'бир кун',
  30694. dd: '%d кун',
  30695. M: 'бир ой',
  30696. MM: '%d ой',
  30697. y: 'бир йил',
  30698. yy: '%d йил',
  30699. },
  30700. week: {
  30701. dow: 1, // Monday is the first day of the week.
  30702. doy: 7, // The week that contains Jan 4th is the first week of the year.
  30703. },
  30704. });
  30705. return uz;
  30706. })));
  30707. /***/ }),
  30708. /***/ "./node_modules/moment/locale/vi.js":
  30709. /*!******************************************!*\
  30710. !*** ./node_modules/moment/locale/vi.js ***!
  30711. \******************************************/
  30712. /*! no static exports found */
  30713. /***/ (function(module, exports, __webpack_require__) {
  30714. //! moment.js locale configuration
  30715. //! locale : Vietnamese [vi]
  30716. //! author : Bang Nguyen : https://github.com/bangnk
  30717. //! author : Chien Kira : https://github.com/chienkira
  30718. ;(function (global, factory) {
  30719. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  30720. undefined
  30721. }(this, (function (moment) { 'use strict';
  30722. //! moment.js locale configuration
  30723. var vi = moment.defineLocale('vi', {
  30724. 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(
  30725. '_'
  30726. ),
  30727. 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(
  30728. '_'
  30729. ),
  30730. monthsParseExact: true,
  30731. weekdays: 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split(
  30732. '_'
  30733. ),
  30734. weekdaysShort: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
  30735. weekdaysMin: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
  30736. weekdaysParseExact: true,
  30737. meridiemParse: /sa|ch/i,
  30738. isPM: function (input) {
  30739. return /^ch$/i.test(input);
  30740. },
  30741. meridiem: function (hours, minutes, isLower) {
  30742. if (hours < 12) {
  30743. return isLower ? 'sa' : 'SA';
  30744. } else {
  30745. return isLower ? 'ch' : 'CH';
  30746. }
  30747. },
  30748. longDateFormat: {
  30749. LT: 'HH:mm',
  30750. LTS: 'HH:mm:ss',
  30751. L: 'DD/MM/YYYY',
  30752. LL: 'D MMMM [năm] YYYY',
  30753. LLL: 'D MMMM [năm] YYYY HH:mm',
  30754. LLLL: 'dddd, D MMMM [năm] YYYY HH:mm',
  30755. l: 'DD/M/YYYY',
  30756. ll: 'D MMM YYYY',
  30757. lll: 'D MMM YYYY HH:mm',
  30758. llll: 'ddd, D MMM YYYY HH:mm',
  30759. },
  30760. calendar: {
  30761. sameDay: '[Hôm nay lúc] LT',
  30762. nextDay: '[Ngày mai lúc] LT',
  30763. nextWeek: 'dddd [tuần tới lúc] LT',
  30764. lastDay: '[Hôm qua lúc] LT',
  30765. lastWeek: 'dddd [tuần trước lúc] LT',
  30766. sameElse: 'L',
  30767. },
  30768. relativeTime: {
  30769. future: '%s tới',
  30770. past: '%s trước',
  30771. s: 'vài giây',
  30772. ss: '%d giây',
  30773. m: 'một phút',
  30774. mm: '%d phút',
  30775. h: 'một giờ',
  30776. hh: '%d giờ',
  30777. d: 'một ngày',
  30778. dd: '%d ngày',
  30779. w: 'một tuần',
  30780. ww: '%d tuần',
  30781. M: 'một tháng',
  30782. MM: '%d tháng',
  30783. y: 'một năm',
  30784. yy: '%d năm',
  30785. },
  30786. dayOfMonthOrdinalParse: /\d{1,2}/,
  30787. ordinal: function (number) {
  30788. return number;
  30789. },
  30790. week: {
  30791. dow: 1, // Monday is the first day of the week.
  30792. doy: 4, // The week that contains Jan 4th is the first week of the year.
  30793. },
  30794. });
  30795. return vi;
  30796. })));
  30797. /***/ }),
  30798. /***/ "./node_modules/moment/locale/x-pseudo.js":
  30799. /*!************************************************!*\
  30800. !*** ./node_modules/moment/locale/x-pseudo.js ***!
  30801. \************************************************/
  30802. /*! no static exports found */
  30803. /***/ (function(module, exports, __webpack_require__) {
  30804. //! moment.js locale configuration
  30805. //! locale : Pseudo [x-pseudo]
  30806. //! author : Andrew Hood : https://github.com/andrewhood125
  30807. ;(function (global, factory) {
  30808. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  30809. undefined
  30810. }(this, (function (moment) { 'use strict';
  30811. //! moment.js locale configuration
  30812. var xPseudo = moment.defineLocale('x-pseudo', {
  30813. 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(
  30814. '_'
  30815. ),
  30816. monthsShort: 'J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc'.split(
  30817. '_'
  30818. ),
  30819. monthsParseExact: true,
  30820. weekdays: 'S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý'.split(
  30821. '_'
  30822. ),
  30823. weekdaysShort: 'S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát'.split('_'),
  30824. weekdaysMin: 'S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá'.split('_'),
  30825. weekdaysParseExact: true,
  30826. longDateFormat: {
  30827. LT: 'HH:mm',
  30828. L: 'DD/MM/YYYY',
  30829. LL: 'D MMMM YYYY',
  30830. LLL: 'D MMMM YYYY HH:mm',
  30831. LLLL: 'dddd, D MMMM YYYY HH:mm',
  30832. },
  30833. calendar: {
  30834. sameDay: '[T~ódá~ý át] LT',
  30835. nextDay: '[T~ómó~rró~w át] LT',
  30836. nextWeek: 'dddd [át] LT',
  30837. lastDay: '[Ý~ést~érdá~ý át] LT',
  30838. lastWeek: '[L~ást] dddd [át] LT',
  30839. sameElse: 'L',
  30840. },
  30841. relativeTime: {
  30842. future: 'í~ñ %s',
  30843. past: '%s á~gó',
  30844. s: 'á ~féw ~sécó~ñds',
  30845. ss: '%d s~écóñ~ds',
  30846. m: 'á ~míñ~úté',
  30847. mm: '%d m~íñú~tés',
  30848. h: 'á~ñ hó~úr',
  30849. hh: '%d h~óúrs',
  30850. d: 'á ~dáý',
  30851. dd: '%d d~áýs',
  30852. M: 'á ~móñ~th',
  30853. MM: '%d m~óñt~hs',
  30854. y: 'á ~ýéár',
  30855. yy: '%d ý~éárs',
  30856. },
  30857. dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
  30858. ordinal: function (number) {
  30859. var b = number % 10,
  30860. output =
  30861. ~~((number % 100) / 10) === 1
  30862. ? 'th'
  30863. : b === 1
  30864. ? 'st'
  30865. : b === 2
  30866. ? 'nd'
  30867. : b === 3
  30868. ? 'rd'
  30869. : 'th';
  30870. return number + output;
  30871. },
  30872. week: {
  30873. dow: 1, // Monday is the first day of the week.
  30874. doy: 4, // The week that contains Jan 4th is the first week of the year.
  30875. },
  30876. });
  30877. return xPseudo;
  30878. })));
  30879. /***/ }),
  30880. /***/ "./node_modules/moment/locale/yo.js":
  30881. /*!******************************************!*\
  30882. !*** ./node_modules/moment/locale/yo.js ***!
  30883. \******************************************/
  30884. /*! no static exports found */
  30885. /***/ (function(module, exports, __webpack_require__) {
  30886. //! moment.js locale configuration
  30887. //! locale : Yoruba Nigeria [yo]
  30888. //! author : Atolagbe Abisoye : https://github.com/andela-batolagbe
  30889. ;(function (global, factory) {
  30890. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  30891. undefined
  30892. }(this, (function (moment) { 'use strict';
  30893. //! moment.js locale configuration
  30894. var yo = moment.defineLocale('yo', {
  30895. months: 'Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀'.split(
  30896. '_'
  30897. ),
  30898. monthsShort: 'Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀'.split('_'),
  30899. weekdays: 'Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta'.split('_'),
  30900. weekdaysShort: 'Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá'.split('_'),
  30901. weekdaysMin: 'Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb'.split('_'),
  30902. longDateFormat: {
  30903. LT: 'h:mm A',
  30904. LTS: 'h:mm:ss A',
  30905. L: 'DD/MM/YYYY',
  30906. LL: 'D MMMM YYYY',
  30907. LLL: 'D MMMM YYYY h:mm A',
  30908. LLLL: 'dddd, D MMMM YYYY h:mm A',
  30909. },
  30910. calendar: {
  30911. sameDay: '[Ònì ni] LT',
  30912. nextDay: '[Ọ̀la ni] LT',
  30913. nextWeek: "dddd [Ọsẹ̀ tón'bọ] [ni] LT",
  30914. lastDay: '[Àna ni] LT',
  30915. lastWeek: 'dddd [Ọsẹ̀ tólọ́] [ni] LT',
  30916. sameElse: 'L',
  30917. },
  30918. relativeTime: {
  30919. future: 'ní %s',
  30920. past: '%s kọjá',
  30921. s: 'ìsẹjú aayá die',
  30922. ss: 'aayá %d',
  30923. m: 'ìsẹjú kan',
  30924. mm: 'ìsẹjú %d',
  30925. h: 'wákati kan',
  30926. hh: 'wákati %d',
  30927. d: 'ọjọ́ kan',
  30928. dd: 'ọjọ́ %d',
  30929. M: 'osù kan',
  30930. MM: 'osù %d',
  30931. y: 'ọdún kan',
  30932. yy: 'ọdún %d',
  30933. },
  30934. dayOfMonthOrdinalParse: /ọjọ́\s\d{1,2}/,
  30935. ordinal: 'ọjọ́ %d',
  30936. week: {
  30937. dow: 1, // Monday is the first day of the week.
  30938. doy: 4, // The week that contains Jan 4th is the first week of the year.
  30939. },
  30940. });
  30941. return yo;
  30942. })));
  30943. /***/ }),
  30944. /***/ "./node_modules/moment/locale/zh-cn.js":
  30945. /*!*********************************************!*\
  30946. !*** ./node_modules/moment/locale/zh-cn.js ***!
  30947. \*********************************************/
  30948. /*! no static exports found */
  30949. /***/ (function(module, exports, __webpack_require__) {
  30950. //! moment.js locale configuration
  30951. //! locale : Chinese (China) [zh-cn]
  30952. //! author : suupic : https://github.com/suupic
  30953. //! author : Zeno Zeng : https://github.com/zenozeng
  30954. //! author : uu109 : https://github.com/uu109
  30955. ;(function (global, factory) {
  30956. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  30957. undefined
  30958. }(this, (function (moment) { 'use strict';
  30959. //! moment.js locale configuration
  30960. var zhCn = moment.defineLocale('zh-cn', {
  30961. months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
  30962. '_'
  30963. ),
  30964. monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
  30965. '_'
  30966. ),
  30967. weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  30968. weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'),
  30969. weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
  30970. longDateFormat: {
  30971. LT: 'HH:mm',
  30972. LTS: 'HH:mm:ss',
  30973. L: 'YYYY/MM/DD',
  30974. LL: 'YYYY年M月D日',
  30975. LLL: 'YYYY年M月D日Ah点mm分',
  30976. LLLL: 'YYYY年M月D日ddddAh点mm分',
  30977. l: 'YYYY/M/D',
  30978. ll: 'YYYY年M月D日',
  30979. lll: 'YYYY年M月D日 HH:mm',
  30980. llll: 'YYYY年M月D日dddd HH:mm',
  30981. },
  30982. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  30983. meridiemHour: function (hour, meridiem) {
  30984. if (hour === 12) {
  30985. hour = 0;
  30986. }
  30987. if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
  30988. return hour;
  30989. } else if (meridiem === '下午' || meridiem === '晚上') {
  30990. return hour + 12;
  30991. } else {
  30992. // '中午'
  30993. return hour >= 11 ? hour : hour + 12;
  30994. }
  30995. },
  30996. meridiem: function (hour, minute, isLower) {
  30997. var hm = hour * 100 + minute;
  30998. if (hm < 600) {
  30999. return '凌晨';
  31000. } else if (hm < 900) {
  31001. return '早上';
  31002. } else if (hm < 1130) {
  31003. return '上午';
  31004. } else if (hm < 1230) {
  31005. return '中午';
  31006. } else if (hm < 1800) {
  31007. return '下午';
  31008. } else {
  31009. return '晚上';
  31010. }
  31011. },
  31012. calendar: {
  31013. sameDay: '[今天]LT',
  31014. nextDay: '[明天]LT',
  31015. nextWeek: function (now) {
  31016. if (now.week() !== this.week()) {
  31017. return '[下]dddLT';
  31018. } else {
  31019. return '[本]dddLT';
  31020. }
  31021. },
  31022. lastDay: '[昨天]LT',
  31023. lastWeek: function (now) {
  31024. if (this.week() !== now.week()) {
  31025. return '[上]dddLT';
  31026. } else {
  31027. return '[本]dddLT';
  31028. }
  31029. },
  31030. sameElse: 'L',
  31031. },
  31032. dayOfMonthOrdinalParse: /\d{1,2}(日|月|周)/,
  31033. ordinal: function (number, period) {
  31034. switch (period) {
  31035. case 'd':
  31036. case 'D':
  31037. case 'DDD':
  31038. return number + '日';
  31039. case 'M':
  31040. return number + '月';
  31041. case 'w':
  31042. case 'W':
  31043. return number + '周';
  31044. default:
  31045. return number;
  31046. }
  31047. },
  31048. relativeTime: {
  31049. future: '%s后',
  31050. past: '%s前',
  31051. s: '几秒',
  31052. ss: '%d 秒',
  31053. m: '1 分钟',
  31054. mm: '%d 分钟',
  31055. h: '1 小时',
  31056. hh: '%d 小时',
  31057. d: '1 天',
  31058. dd: '%d 天',
  31059. w: '1 周',
  31060. ww: '%d 周',
  31061. M: '1 个月',
  31062. MM: '%d 个月',
  31063. y: '1 年',
  31064. yy: '%d 年',
  31065. },
  31066. week: {
  31067. // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
  31068. dow: 1, // Monday is the first day of the week.
  31069. doy: 4, // The week that contains Jan 4th is the first week of the year.
  31070. },
  31071. });
  31072. return zhCn;
  31073. })));
  31074. /***/ }),
  31075. /***/ "./node_modules/moment/locale/zh-hk.js":
  31076. /*!*********************************************!*\
  31077. !*** ./node_modules/moment/locale/zh-hk.js ***!
  31078. \*********************************************/
  31079. /*! no static exports found */
  31080. /***/ (function(module, exports, __webpack_require__) {
  31081. //! moment.js locale configuration
  31082. //! locale : Chinese (Hong Kong) [zh-hk]
  31083. //! author : Ben : https://github.com/ben-lin
  31084. //! author : Chris Lam : https://github.com/hehachris
  31085. //! author : Konstantin : https://github.com/skfd
  31086. //! author : Anthony : https://github.com/anthonylau
  31087. ;(function (global, factory) {
  31088. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  31089. undefined
  31090. }(this, (function (moment) { 'use strict';
  31091. //! moment.js locale configuration
  31092. var zhHk = moment.defineLocale('zh-hk', {
  31093. months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
  31094. '_'
  31095. ),
  31096. monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
  31097. '_'
  31098. ),
  31099. weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  31100. weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
  31101. weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
  31102. longDateFormat: {
  31103. LT: 'HH:mm',
  31104. LTS: 'HH:mm:ss',
  31105. L: 'YYYY/MM/DD',
  31106. LL: 'YYYY年M月D日',
  31107. LLL: 'YYYY年M月D日 HH:mm',
  31108. LLLL: 'YYYY年M月D日dddd HH:mm',
  31109. l: 'YYYY/M/D',
  31110. ll: 'YYYY年M月D日',
  31111. lll: 'YYYY年M月D日 HH:mm',
  31112. llll: 'YYYY年M月D日dddd HH:mm',
  31113. },
  31114. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  31115. meridiemHour: function (hour, meridiem) {
  31116. if (hour === 12) {
  31117. hour = 0;
  31118. }
  31119. if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
  31120. return hour;
  31121. } else if (meridiem === '中午') {
  31122. return hour >= 11 ? hour : hour + 12;
  31123. } else if (meridiem === '下午' || meridiem === '晚上') {
  31124. return hour + 12;
  31125. }
  31126. },
  31127. meridiem: function (hour, minute, isLower) {
  31128. var hm = hour * 100 + minute;
  31129. if (hm < 600) {
  31130. return '凌晨';
  31131. } else if (hm < 900) {
  31132. return '早上';
  31133. } else if (hm < 1200) {
  31134. return '上午';
  31135. } else if (hm === 1200) {
  31136. return '中午';
  31137. } else if (hm < 1800) {
  31138. return '下午';
  31139. } else {
  31140. return '晚上';
  31141. }
  31142. },
  31143. calendar: {
  31144. sameDay: '[今天]LT',
  31145. nextDay: '[明天]LT',
  31146. nextWeek: '[下]ddddLT',
  31147. lastDay: '[昨天]LT',
  31148. lastWeek: '[上]ddddLT',
  31149. sameElse: 'L',
  31150. },
  31151. dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
  31152. ordinal: function (number, period) {
  31153. switch (period) {
  31154. case 'd':
  31155. case 'D':
  31156. case 'DDD':
  31157. return number + '日';
  31158. case 'M':
  31159. return number + '月';
  31160. case 'w':
  31161. case 'W':
  31162. return number + '週';
  31163. default:
  31164. return number;
  31165. }
  31166. },
  31167. relativeTime: {
  31168. future: '%s後',
  31169. past: '%s前',
  31170. s: '幾秒',
  31171. ss: '%d 秒',
  31172. m: '1 分鐘',
  31173. mm: '%d 分鐘',
  31174. h: '1 小時',
  31175. hh: '%d 小時',
  31176. d: '1 天',
  31177. dd: '%d 天',
  31178. M: '1 個月',
  31179. MM: '%d 個月',
  31180. y: '1 年',
  31181. yy: '%d 年',
  31182. },
  31183. });
  31184. return zhHk;
  31185. })));
  31186. /***/ }),
  31187. /***/ "./node_modules/moment/locale/zh-mo.js":
  31188. /*!*********************************************!*\
  31189. !*** ./node_modules/moment/locale/zh-mo.js ***!
  31190. \*********************************************/
  31191. /*! no static exports found */
  31192. /***/ (function(module, exports, __webpack_require__) {
  31193. //! moment.js locale configuration
  31194. //! locale : Chinese (Macau) [zh-mo]
  31195. //! author : Ben : https://github.com/ben-lin
  31196. //! author : Chris Lam : https://github.com/hehachris
  31197. //! author : Tan Yuanhong : https://github.com/le0tan
  31198. ;(function (global, factory) {
  31199. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  31200. undefined
  31201. }(this, (function (moment) { 'use strict';
  31202. //! moment.js locale configuration
  31203. var zhMo = moment.defineLocale('zh-mo', {
  31204. months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
  31205. '_'
  31206. ),
  31207. monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
  31208. '_'
  31209. ),
  31210. weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  31211. weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
  31212. weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
  31213. longDateFormat: {
  31214. LT: 'HH:mm',
  31215. LTS: 'HH:mm:ss',
  31216. L: 'DD/MM/YYYY',
  31217. LL: 'YYYY年M月D日',
  31218. LLL: 'YYYY年M月D日 HH:mm',
  31219. LLLL: 'YYYY年M月D日dddd HH:mm',
  31220. l: 'D/M/YYYY',
  31221. ll: 'YYYY年M月D日',
  31222. lll: 'YYYY年M月D日 HH:mm',
  31223. llll: 'YYYY年M月D日dddd HH:mm',
  31224. },
  31225. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  31226. meridiemHour: function (hour, meridiem) {
  31227. if (hour === 12) {
  31228. hour = 0;
  31229. }
  31230. if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
  31231. return hour;
  31232. } else if (meridiem === '中午') {
  31233. return hour >= 11 ? hour : hour + 12;
  31234. } else if (meridiem === '下午' || meridiem === '晚上') {
  31235. return hour + 12;
  31236. }
  31237. },
  31238. meridiem: function (hour, minute, isLower) {
  31239. var hm = hour * 100 + minute;
  31240. if (hm < 600) {
  31241. return '凌晨';
  31242. } else if (hm < 900) {
  31243. return '早上';
  31244. } else if (hm < 1130) {
  31245. return '上午';
  31246. } else if (hm < 1230) {
  31247. return '中午';
  31248. } else if (hm < 1800) {
  31249. return '下午';
  31250. } else {
  31251. return '晚上';
  31252. }
  31253. },
  31254. calendar: {
  31255. sameDay: '[今天] LT',
  31256. nextDay: '[明天] LT',
  31257. nextWeek: '[下]dddd LT',
  31258. lastDay: '[昨天] LT',
  31259. lastWeek: '[上]dddd LT',
  31260. sameElse: 'L',
  31261. },
  31262. dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
  31263. ordinal: function (number, period) {
  31264. switch (period) {
  31265. case 'd':
  31266. case 'D':
  31267. case 'DDD':
  31268. return number + '日';
  31269. case 'M':
  31270. return number + '月';
  31271. case 'w':
  31272. case 'W':
  31273. return number + '週';
  31274. default:
  31275. return number;
  31276. }
  31277. },
  31278. relativeTime: {
  31279. future: '%s內',
  31280. past: '%s前',
  31281. s: '幾秒',
  31282. ss: '%d 秒',
  31283. m: '1 分鐘',
  31284. mm: '%d 分鐘',
  31285. h: '1 小時',
  31286. hh: '%d 小時',
  31287. d: '1 天',
  31288. dd: '%d 天',
  31289. M: '1 個月',
  31290. MM: '%d 個月',
  31291. y: '1 年',
  31292. yy: '%d 年',
  31293. },
  31294. });
  31295. return zhMo;
  31296. })));
  31297. /***/ }),
  31298. /***/ "./node_modules/moment/locale/zh-tw.js":
  31299. /*!*********************************************!*\
  31300. !*** ./node_modules/moment/locale/zh-tw.js ***!
  31301. \*********************************************/
  31302. /*! no static exports found */
  31303. /***/ (function(module, exports, __webpack_require__) {
  31304. //! moment.js locale configuration
  31305. //! locale : Chinese (Taiwan) [zh-tw]
  31306. //! author : Ben : https://github.com/ben-lin
  31307. //! author : Chris Lam : https://github.com/hehachris
  31308. ;(function (global, factory) {
  31309. true ? factory(__webpack_require__(/*! ../moment */ "./node_modules/moment/moment.js")) :
  31310. undefined
  31311. }(this, (function (moment) { 'use strict';
  31312. //! moment.js locale configuration
  31313. var zhTw = moment.defineLocale('zh-tw', {
  31314. months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split(
  31315. '_'
  31316. ),
  31317. monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split(
  31318. '_'
  31319. ),
  31320. weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  31321. weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
  31322. weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
  31323. longDateFormat: {
  31324. LT: 'HH:mm',
  31325. LTS: 'HH:mm:ss',
  31326. L: 'YYYY/MM/DD',
  31327. LL: 'YYYY年M月D日',
  31328. LLL: 'YYYY年M月D日 HH:mm',
  31329. LLLL: 'YYYY年M月D日dddd HH:mm',
  31330. l: 'YYYY/M/D',
  31331. ll: 'YYYY年M月D日',
  31332. lll: 'YYYY年M月D日 HH:mm',
  31333. llll: 'YYYY年M月D日dddd HH:mm',
  31334. },
  31335. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  31336. meridiemHour: function (hour, meridiem) {
  31337. if (hour === 12) {
  31338. hour = 0;
  31339. }
  31340. if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') {
  31341. return hour;
  31342. } else if (meridiem === '中午') {
  31343. return hour >= 11 ? hour : hour + 12;
  31344. } else if (meridiem === '下午' || meridiem === '晚上') {
  31345. return hour + 12;
  31346. }
  31347. },
  31348. meridiem: function (hour, minute, isLower) {
  31349. var hm = hour * 100 + minute;
  31350. if (hm < 600) {
  31351. return '凌晨';
  31352. } else if (hm < 900) {
  31353. return '早上';
  31354. } else if (hm < 1130) {
  31355. return '上午';
  31356. } else if (hm < 1230) {
  31357. return '中午';
  31358. } else if (hm < 1800) {
  31359. return '下午';
  31360. } else {
  31361. return '晚上';
  31362. }
  31363. },
  31364. calendar: {
  31365. sameDay: '[今天] LT',
  31366. nextDay: '[明天] LT',
  31367. nextWeek: '[下]dddd LT',
  31368. lastDay: '[昨天] LT',
  31369. lastWeek: '[上]dddd LT',
  31370. sameElse: 'L',
  31371. },
  31372. dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
  31373. ordinal: function (number, period) {
  31374. switch (period) {
  31375. case 'd':
  31376. case 'D':
  31377. case 'DDD':
  31378. return number + '日';
  31379. case 'M':
  31380. return number + '月';
  31381. case 'w':
  31382. case 'W':
  31383. return number + '週';
  31384. default:
  31385. return number;
  31386. }
  31387. },
  31388. relativeTime: {
  31389. future: '%s後',
  31390. past: '%s前',
  31391. s: '幾秒',
  31392. ss: '%d 秒',
  31393. m: '1 分鐘',
  31394. mm: '%d 分鐘',
  31395. h: '1 小時',
  31396. hh: '%d 小時',
  31397. d: '1 天',
  31398. dd: '%d 天',
  31399. M: '1 個月',
  31400. MM: '%d 個月',
  31401. y: '1 年',
  31402. yy: '%d 年',
  31403. },
  31404. });
  31405. return zhTw;
  31406. })));
  31407. /***/ }),
  31408. /***/ "./node_modules/moment/moment.js":
  31409. /*!***************************************!*\
  31410. !*** ./node_modules/moment/moment.js ***!
  31411. \***************************************/
  31412. /*! no static exports found */
  31413. /***/ (function(module, exports, __webpack_require__) {
  31414. /* WEBPACK VAR INJECTION */(function(module) {var require;//! moment.js
  31415. //! version : 2.29.1
  31416. //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
  31417. //! license : MIT
  31418. //! momentjs.com
  31419. ;(function (global, factory) {
  31420. true ? module.exports = factory() :
  31421. undefined
  31422. }(this, (function () { 'use strict';
  31423. var hookCallback;
  31424. function hooks() {
  31425. return hookCallback.apply(null, arguments);
  31426. }
  31427. // This is done to register the method called with moment()
  31428. // without creating circular dependencies.
  31429. function setHookCallback(callback) {
  31430. hookCallback = callback;
  31431. }
  31432. function isArray(input) {
  31433. return (
  31434. input instanceof Array ||
  31435. Object.prototype.toString.call(input) === '[object Array]'
  31436. );
  31437. }
  31438. function isObject(input) {
  31439. // IE8 will treat undefined and null as object if it wasn't for
  31440. // input != null
  31441. return (
  31442. input != null &&
  31443. Object.prototype.toString.call(input) === '[object Object]'
  31444. );
  31445. }
  31446. function hasOwnProp(a, b) {
  31447. return Object.prototype.hasOwnProperty.call(a, b);
  31448. }
  31449. function isObjectEmpty(obj) {
  31450. if (Object.getOwnPropertyNames) {
  31451. return Object.getOwnPropertyNames(obj).length === 0;
  31452. } else {
  31453. var k;
  31454. for (k in obj) {
  31455. if (hasOwnProp(obj, k)) {
  31456. return false;
  31457. }
  31458. }
  31459. return true;
  31460. }
  31461. }
  31462. function isUndefined(input) {
  31463. return input === void 0;
  31464. }
  31465. function isNumber(input) {
  31466. return (
  31467. typeof input === 'number' ||
  31468. Object.prototype.toString.call(input) === '[object Number]'
  31469. );
  31470. }
  31471. function isDate(input) {
  31472. return (
  31473. input instanceof Date ||
  31474. Object.prototype.toString.call(input) === '[object Date]'
  31475. );
  31476. }
  31477. function map(arr, fn) {
  31478. var res = [],
  31479. i;
  31480. for (i = 0; i < arr.length; ++i) {
  31481. res.push(fn(arr[i], i));
  31482. }
  31483. return res;
  31484. }
  31485. function extend(a, b) {
  31486. for (var i in b) {
  31487. if (hasOwnProp(b, i)) {
  31488. a[i] = b[i];
  31489. }
  31490. }
  31491. if (hasOwnProp(b, 'toString')) {
  31492. a.toString = b.toString;
  31493. }
  31494. if (hasOwnProp(b, 'valueOf')) {
  31495. a.valueOf = b.valueOf;
  31496. }
  31497. return a;
  31498. }
  31499. function createUTC(input, format, locale, strict) {
  31500. return createLocalOrUTC(input, format, locale, strict, true).utc();
  31501. }
  31502. function defaultParsingFlags() {
  31503. // We need to deep clone this object.
  31504. return {
  31505. empty: false,
  31506. unusedTokens: [],
  31507. unusedInput: [],
  31508. overflow: -2,
  31509. charsLeftOver: 0,
  31510. nullInput: false,
  31511. invalidEra: null,
  31512. invalidMonth: null,
  31513. invalidFormat: false,
  31514. userInvalidated: false,
  31515. iso: false,
  31516. parsedDateParts: [],
  31517. era: null,
  31518. meridiem: null,
  31519. rfc2822: false,
  31520. weekdayMismatch: false,
  31521. };
  31522. }
  31523. function getParsingFlags(m) {
  31524. if (m._pf == null) {
  31525. m._pf = defaultParsingFlags();
  31526. }
  31527. return m._pf;
  31528. }
  31529. var some;
  31530. if (Array.prototype.some) {
  31531. some = Array.prototype.some;
  31532. } else {
  31533. some = function (fun) {
  31534. var t = Object(this),
  31535. len = t.length >>> 0,
  31536. i;
  31537. for (i = 0; i < len; i++) {
  31538. if (i in t && fun.call(this, t[i], i, t)) {
  31539. return true;
  31540. }
  31541. }
  31542. return false;
  31543. };
  31544. }
  31545. function isValid(m) {
  31546. if (m._isValid == null) {
  31547. var flags = getParsingFlags(m),
  31548. parsedParts = some.call(flags.parsedDateParts, function (i) {
  31549. return i != null;
  31550. }),
  31551. isNowValid =
  31552. !isNaN(m._d.getTime()) &&
  31553. flags.overflow < 0 &&
  31554. !flags.empty &&
  31555. !flags.invalidEra &&
  31556. !flags.invalidMonth &&
  31557. !flags.invalidWeekday &&
  31558. !flags.weekdayMismatch &&
  31559. !flags.nullInput &&
  31560. !flags.invalidFormat &&
  31561. !flags.userInvalidated &&
  31562. (!flags.meridiem || (flags.meridiem && parsedParts));
  31563. if (m._strict) {
  31564. isNowValid =
  31565. isNowValid &&
  31566. flags.charsLeftOver === 0 &&
  31567. flags.unusedTokens.length === 0 &&
  31568. flags.bigHour === undefined;
  31569. }
  31570. if (Object.isFrozen == null || !Object.isFrozen(m)) {
  31571. m._isValid = isNowValid;
  31572. } else {
  31573. return isNowValid;
  31574. }
  31575. }
  31576. return m._isValid;
  31577. }
  31578. function createInvalid(flags) {
  31579. var m = createUTC(NaN);
  31580. if (flags != null) {
  31581. extend(getParsingFlags(m), flags);
  31582. } else {
  31583. getParsingFlags(m).userInvalidated = true;
  31584. }
  31585. return m;
  31586. }
  31587. // Plugins that add properties should also add the key here (null value),
  31588. // so we can properly clone ourselves.
  31589. var momentProperties = (hooks.momentProperties = []),
  31590. updateInProgress = false;
  31591. function copyConfig(to, from) {
  31592. var i, prop, val;
  31593. if (!isUndefined(from._isAMomentObject)) {
  31594. to._isAMomentObject = from._isAMomentObject;
  31595. }
  31596. if (!isUndefined(from._i)) {
  31597. to._i = from._i;
  31598. }
  31599. if (!isUndefined(from._f)) {
  31600. to._f = from._f;
  31601. }
  31602. if (!isUndefined(from._l)) {
  31603. to._l = from._l;
  31604. }
  31605. if (!isUndefined(from._strict)) {
  31606. to._strict = from._strict;
  31607. }
  31608. if (!isUndefined(from._tzm)) {
  31609. to._tzm = from._tzm;
  31610. }
  31611. if (!isUndefined(from._isUTC)) {
  31612. to._isUTC = from._isUTC;
  31613. }
  31614. if (!isUndefined(from._offset)) {
  31615. to._offset = from._offset;
  31616. }
  31617. if (!isUndefined(from._pf)) {
  31618. to._pf = getParsingFlags(from);
  31619. }
  31620. if (!isUndefined(from._locale)) {
  31621. to._locale = from._locale;
  31622. }
  31623. if (momentProperties.length > 0) {
  31624. for (i = 0; i < momentProperties.length; i++) {
  31625. prop = momentProperties[i];
  31626. val = from[prop];
  31627. if (!isUndefined(val)) {
  31628. to[prop] = val;
  31629. }
  31630. }
  31631. }
  31632. return to;
  31633. }
  31634. // Moment prototype object
  31635. function Moment(config) {
  31636. copyConfig(this, config);
  31637. this._d = new Date(config._d != null ? config._d.getTime() : NaN);
  31638. if (!this.isValid()) {
  31639. this._d = new Date(NaN);
  31640. }
  31641. // Prevent infinite loop in case updateOffset creates new moment
  31642. // objects.
  31643. if (updateInProgress === false) {
  31644. updateInProgress = true;
  31645. hooks.updateOffset(this);
  31646. updateInProgress = false;
  31647. }
  31648. }
  31649. function isMoment(obj) {
  31650. return (
  31651. obj instanceof Moment || (obj != null && obj._isAMomentObject != null)
  31652. );
  31653. }
  31654. function warn(msg) {
  31655. if (
  31656. hooks.suppressDeprecationWarnings === false &&
  31657. typeof console !== 'undefined' &&
  31658. console.warn
  31659. ) {
  31660. console.warn('Deprecation warning: ' + msg);
  31661. }
  31662. }
  31663. function deprecate(msg, fn) {
  31664. var firstTime = true;
  31665. return extend(function () {
  31666. if (hooks.deprecationHandler != null) {
  31667. hooks.deprecationHandler(null, msg);
  31668. }
  31669. if (firstTime) {
  31670. var args = [],
  31671. arg,
  31672. i,
  31673. key;
  31674. for (i = 0; i < arguments.length; i++) {
  31675. arg = '';
  31676. if (typeof arguments[i] === 'object') {
  31677. arg += '\n[' + i + '] ';
  31678. for (key in arguments[0]) {
  31679. if (hasOwnProp(arguments[0], key)) {
  31680. arg += key + ': ' + arguments[0][key] + ', ';
  31681. }
  31682. }
  31683. arg = arg.slice(0, -2); // Remove trailing comma and space
  31684. } else {
  31685. arg = arguments[i];
  31686. }
  31687. args.push(arg);
  31688. }
  31689. warn(
  31690. msg +
  31691. '\nArguments: ' +
  31692. Array.prototype.slice.call(args).join('') +
  31693. '\n' +
  31694. new Error().stack
  31695. );
  31696. firstTime = false;
  31697. }
  31698. return fn.apply(this, arguments);
  31699. }, fn);
  31700. }
  31701. var deprecations = {};
  31702. function deprecateSimple(name, msg) {
  31703. if (hooks.deprecationHandler != null) {
  31704. hooks.deprecationHandler(name, msg);
  31705. }
  31706. if (!deprecations[name]) {
  31707. warn(msg);
  31708. deprecations[name] = true;
  31709. }
  31710. }
  31711. hooks.suppressDeprecationWarnings = false;
  31712. hooks.deprecationHandler = null;
  31713. function isFunction(input) {
  31714. return (
  31715. (typeof Function !== 'undefined' && input instanceof Function) ||
  31716. Object.prototype.toString.call(input) === '[object Function]'
  31717. );
  31718. }
  31719. function set(config) {
  31720. var prop, i;
  31721. for (i in config) {
  31722. if (hasOwnProp(config, i)) {
  31723. prop = config[i];
  31724. if (isFunction(prop)) {
  31725. this[i] = prop;
  31726. } else {
  31727. this['_' + i] = prop;
  31728. }
  31729. }
  31730. }
  31731. this._config = config;
  31732. // Lenient ordinal parsing accepts just a number in addition to
  31733. // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
  31734. // TODO: Remove "ordinalParse" fallback in next major release.
  31735. this._dayOfMonthOrdinalParseLenient = new RegExp(
  31736. (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
  31737. '|' +
  31738. /\d{1,2}/.source
  31739. );
  31740. }
  31741. function mergeConfigs(parentConfig, childConfig) {
  31742. var res = extend({}, parentConfig),
  31743. prop;
  31744. for (prop in childConfig) {
  31745. if (hasOwnProp(childConfig, prop)) {
  31746. if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
  31747. res[prop] = {};
  31748. extend(res[prop], parentConfig[prop]);
  31749. extend(res[prop], childConfig[prop]);
  31750. } else if (childConfig[prop] != null) {
  31751. res[prop] = childConfig[prop];
  31752. } else {
  31753. delete res[prop];
  31754. }
  31755. }
  31756. }
  31757. for (prop in parentConfig) {
  31758. if (
  31759. hasOwnProp(parentConfig, prop) &&
  31760. !hasOwnProp(childConfig, prop) &&
  31761. isObject(parentConfig[prop])
  31762. ) {
  31763. // make sure changes to properties don't modify parent config
  31764. res[prop] = extend({}, res[prop]);
  31765. }
  31766. }
  31767. return res;
  31768. }
  31769. function Locale(config) {
  31770. if (config != null) {
  31771. this.set(config);
  31772. }
  31773. }
  31774. var keys;
  31775. if (Object.keys) {
  31776. keys = Object.keys;
  31777. } else {
  31778. keys = function (obj) {
  31779. var i,
  31780. res = [];
  31781. for (i in obj) {
  31782. if (hasOwnProp(obj, i)) {
  31783. res.push(i);
  31784. }
  31785. }
  31786. return res;
  31787. };
  31788. }
  31789. var defaultCalendar = {
  31790. sameDay: '[Today at] LT',
  31791. nextDay: '[Tomorrow at] LT',
  31792. nextWeek: 'dddd [at] LT',
  31793. lastDay: '[Yesterday at] LT',
  31794. lastWeek: '[Last] dddd [at] LT',
  31795. sameElse: 'L',
  31796. };
  31797. function calendar(key, mom, now) {
  31798. var output = this._calendar[key] || this._calendar['sameElse'];
  31799. return isFunction(output) ? output.call(mom, now) : output;
  31800. }
  31801. function zeroFill(number, targetLength, forceSign) {
  31802. var absNumber = '' + Math.abs(number),
  31803. zerosToFill = targetLength - absNumber.length,
  31804. sign = number >= 0;
  31805. return (
  31806. (sign ? (forceSign ? '+' : '') : '-') +
  31807. Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) +
  31808. absNumber
  31809. );
  31810. }
  31811. 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,
  31812. localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
  31813. formatFunctions = {},
  31814. formatTokenFunctions = {};
  31815. // token: 'M'
  31816. // padded: ['MM', 2]
  31817. // ordinal: 'Mo'
  31818. // callback: function () { this.month() + 1 }
  31819. function addFormatToken(token, padded, ordinal, callback) {
  31820. var func = callback;
  31821. if (typeof callback === 'string') {
  31822. func = function () {
  31823. return this[callback]();
  31824. };
  31825. }
  31826. if (token) {
  31827. formatTokenFunctions[token] = func;
  31828. }
  31829. if (padded) {
  31830. formatTokenFunctions[padded[0]] = function () {
  31831. return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
  31832. };
  31833. }
  31834. if (ordinal) {
  31835. formatTokenFunctions[ordinal] = function () {
  31836. return this.localeData().ordinal(
  31837. func.apply(this, arguments),
  31838. token
  31839. );
  31840. };
  31841. }
  31842. }
  31843. function removeFormattingTokens(input) {
  31844. if (input.match(/\[[\s\S]/)) {
  31845. return input.replace(/^\[|\]$/g, '');
  31846. }
  31847. return input.replace(/\\/g, '');
  31848. }
  31849. function makeFormatFunction(format) {
  31850. var array = format.match(formattingTokens),
  31851. i,
  31852. length;
  31853. for (i = 0, length = array.length; i < length; i++) {
  31854. if (formatTokenFunctions[array[i]]) {
  31855. array[i] = formatTokenFunctions[array[i]];
  31856. } else {
  31857. array[i] = removeFormattingTokens(array[i]);
  31858. }
  31859. }
  31860. return function (mom) {
  31861. var output = '',
  31862. i;
  31863. for (i = 0; i < length; i++) {
  31864. output += isFunction(array[i])
  31865. ? array[i].call(mom, format)
  31866. : array[i];
  31867. }
  31868. return output;
  31869. };
  31870. }
  31871. // format date using native date object
  31872. function formatMoment(m, format) {
  31873. if (!m.isValid()) {
  31874. return m.localeData().invalidDate();
  31875. }
  31876. format = expandFormat(format, m.localeData());
  31877. formatFunctions[format] =
  31878. formatFunctions[format] || makeFormatFunction(format);
  31879. return formatFunctions[format](m);
  31880. }
  31881. function expandFormat(format, locale) {
  31882. var i = 5;
  31883. function replaceLongDateFormatTokens(input) {
  31884. return locale.longDateFormat(input) || input;
  31885. }
  31886. localFormattingTokens.lastIndex = 0;
  31887. while (i >= 0 && localFormattingTokens.test(format)) {
  31888. format = format.replace(
  31889. localFormattingTokens,
  31890. replaceLongDateFormatTokens
  31891. );
  31892. localFormattingTokens.lastIndex = 0;
  31893. i -= 1;
  31894. }
  31895. return format;
  31896. }
  31897. var defaultLongDateFormat = {
  31898. LTS: 'h:mm:ss A',
  31899. LT: 'h:mm A',
  31900. L: 'MM/DD/YYYY',
  31901. LL: 'MMMM D, YYYY',
  31902. LLL: 'MMMM D, YYYY h:mm A',
  31903. LLLL: 'dddd, MMMM D, YYYY h:mm A',
  31904. };
  31905. function longDateFormat(key) {
  31906. var format = this._longDateFormat[key],
  31907. formatUpper = this._longDateFormat[key.toUpperCase()];
  31908. if (format || !formatUpper) {
  31909. return format;
  31910. }
  31911. this._longDateFormat[key] = formatUpper
  31912. .match(formattingTokens)
  31913. .map(function (tok) {
  31914. if (
  31915. tok === 'MMMM' ||
  31916. tok === 'MM' ||
  31917. tok === 'DD' ||
  31918. tok === 'dddd'
  31919. ) {
  31920. return tok.slice(1);
  31921. }
  31922. return tok;
  31923. })
  31924. .join('');
  31925. return this._longDateFormat[key];
  31926. }
  31927. var defaultInvalidDate = 'Invalid date';
  31928. function invalidDate() {
  31929. return this._invalidDate;
  31930. }
  31931. var defaultOrdinal = '%d',
  31932. defaultDayOfMonthOrdinalParse = /\d{1,2}/;
  31933. function ordinal(number) {
  31934. return this._ordinal.replace('%d', number);
  31935. }
  31936. var defaultRelativeTime = {
  31937. future: 'in %s',
  31938. past: '%s ago',
  31939. s: 'a few seconds',
  31940. ss: '%d seconds',
  31941. m: 'a minute',
  31942. mm: '%d minutes',
  31943. h: 'an hour',
  31944. hh: '%d hours',
  31945. d: 'a day',
  31946. dd: '%d days',
  31947. w: 'a week',
  31948. ww: '%d weeks',
  31949. M: 'a month',
  31950. MM: '%d months',
  31951. y: 'a year',
  31952. yy: '%d years',
  31953. };
  31954. function relativeTime(number, withoutSuffix, string, isFuture) {
  31955. var output = this._relativeTime[string];
  31956. return isFunction(output)
  31957. ? output(number, withoutSuffix, string, isFuture)
  31958. : output.replace(/%d/i, number);
  31959. }
  31960. function pastFuture(diff, output) {
  31961. var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
  31962. return isFunction(format) ? format(output) : format.replace(/%s/i, output);
  31963. }
  31964. var aliases = {};
  31965. function addUnitAlias(unit, shorthand) {
  31966. var lowerCase = unit.toLowerCase();
  31967. aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
  31968. }
  31969. function normalizeUnits(units) {
  31970. return typeof units === 'string'
  31971. ? aliases[units] || aliases[units.toLowerCase()]
  31972. : undefined;
  31973. }
  31974. function normalizeObjectUnits(inputObject) {
  31975. var normalizedInput = {},
  31976. normalizedProp,
  31977. prop;
  31978. for (prop in inputObject) {
  31979. if (hasOwnProp(inputObject, prop)) {
  31980. normalizedProp = normalizeUnits(prop);
  31981. if (normalizedProp) {
  31982. normalizedInput[normalizedProp] = inputObject[prop];
  31983. }
  31984. }
  31985. }
  31986. return normalizedInput;
  31987. }
  31988. var priorities = {};
  31989. function addUnitPriority(unit, priority) {
  31990. priorities[unit] = priority;
  31991. }
  31992. function getPrioritizedUnits(unitsObj) {
  31993. var units = [],
  31994. u;
  31995. for (u in unitsObj) {
  31996. if (hasOwnProp(unitsObj, u)) {
  31997. units.push({ unit: u, priority: priorities[u] });
  31998. }
  31999. }
  32000. units.sort(function (a, b) {
  32001. return a.priority - b.priority;
  32002. });
  32003. return units;
  32004. }
  32005. function isLeapYear(year) {
  32006. return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
  32007. }
  32008. function absFloor(number) {
  32009. if (number < 0) {
  32010. // -0 -> 0
  32011. return Math.ceil(number) || 0;
  32012. } else {
  32013. return Math.floor(number);
  32014. }
  32015. }
  32016. function toInt(argumentForCoercion) {
  32017. var coercedNumber = +argumentForCoercion,
  32018. value = 0;
  32019. if (coercedNumber !== 0 && isFinite(coercedNumber)) {
  32020. value = absFloor(coercedNumber);
  32021. }
  32022. return value;
  32023. }
  32024. function makeGetSet(unit, keepTime) {
  32025. return function (value) {
  32026. if (value != null) {
  32027. set$1(this, unit, value);
  32028. hooks.updateOffset(this, keepTime);
  32029. return this;
  32030. } else {
  32031. return get(this, unit);
  32032. }
  32033. };
  32034. }
  32035. function get(mom, unit) {
  32036. return mom.isValid()
  32037. ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]()
  32038. : NaN;
  32039. }
  32040. function set$1(mom, unit, value) {
  32041. if (mom.isValid() && !isNaN(value)) {
  32042. if (
  32043. unit === 'FullYear' &&
  32044. isLeapYear(mom.year()) &&
  32045. mom.month() === 1 &&
  32046. mom.date() === 29
  32047. ) {
  32048. value = toInt(value);
  32049. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](
  32050. value,
  32051. mom.month(),
  32052. daysInMonth(value, mom.month())
  32053. );
  32054. } else {
  32055. mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
  32056. }
  32057. }
  32058. }
  32059. // MOMENTS
  32060. function stringGet(units) {
  32061. units = normalizeUnits(units);
  32062. if (isFunction(this[units])) {
  32063. return this[units]();
  32064. }
  32065. return this;
  32066. }
  32067. function stringSet(units, value) {
  32068. if (typeof units === 'object') {
  32069. units = normalizeObjectUnits(units);
  32070. var prioritized = getPrioritizedUnits(units),
  32071. i;
  32072. for (i = 0; i < prioritized.length; i++) {
  32073. this[prioritized[i].unit](units[prioritized[i].unit]);
  32074. }
  32075. } else {
  32076. units = normalizeUnits(units);
  32077. if (isFunction(this[units])) {
  32078. return this[units](value);
  32079. }
  32080. }
  32081. return this;
  32082. }
  32083. var match1 = /\d/, // 0 - 9
  32084. match2 = /\d\d/, // 00 - 99
  32085. match3 = /\d{3}/, // 000 - 999
  32086. match4 = /\d{4}/, // 0000 - 9999
  32087. match6 = /[+-]?\d{6}/, // -999999 - 999999
  32088. match1to2 = /\d\d?/, // 0 - 99
  32089. match3to4 = /\d\d\d\d?/, // 999 - 9999
  32090. match5to6 = /\d\d\d\d\d\d?/, // 99999 - 999999
  32091. match1to3 = /\d{1,3}/, // 0 - 999
  32092. match1to4 = /\d{1,4}/, // 0 - 9999
  32093. match1to6 = /[+-]?\d{1,6}/, // -999999 - 999999
  32094. matchUnsigned = /\d+/, // 0 - inf
  32095. matchSigned = /[+-]?\d+/, // -inf - inf
  32096. matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z
  32097. matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z
  32098. matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
  32099. // any word (or two) characters or numbers including two/three word month in arabic.
  32100. // includes scottish gaelic two word and hyphenated months
  32101. 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,
  32102. regexes;
  32103. regexes = {};
  32104. function addRegexToken(token, regex, strictRegex) {
  32105. regexes[token] = isFunction(regex)
  32106. ? regex
  32107. : function (isStrict, localeData) {
  32108. return isStrict && strictRegex ? strictRegex : regex;
  32109. };
  32110. }
  32111. function getParseRegexForToken(token, config) {
  32112. if (!hasOwnProp(regexes, token)) {
  32113. return new RegExp(unescapeFormat(token));
  32114. }
  32115. return regexes[token](config._strict, config._locale);
  32116. }
  32117. // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
  32118. function unescapeFormat(s) {
  32119. return regexEscape(
  32120. s
  32121. .replace('\\', '')
  32122. .replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (
  32123. matched,
  32124. p1,
  32125. p2,
  32126. p3,
  32127. p4
  32128. ) {
  32129. return p1 || p2 || p3 || p4;
  32130. })
  32131. );
  32132. }
  32133. function regexEscape(s) {
  32134. return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
  32135. }
  32136. var tokens = {};
  32137. function addParseToken(token, callback) {
  32138. var i,
  32139. func = callback;
  32140. if (typeof token === 'string') {
  32141. token = [token];
  32142. }
  32143. if (isNumber(callback)) {
  32144. func = function (input, array) {
  32145. array[callback] = toInt(input);
  32146. };
  32147. }
  32148. for (i = 0; i < token.length; i++) {
  32149. tokens[token[i]] = func;
  32150. }
  32151. }
  32152. function addWeekParseToken(token, callback) {
  32153. addParseToken(token, function (input, array, config, token) {
  32154. config._w = config._w || {};
  32155. callback(input, config._w, config, token);
  32156. });
  32157. }
  32158. function addTimeToArrayFromToken(token, input, config) {
  32159. if (input != null && hasOwnProp(tokens, token)) {
  32160. tokens[token](input, config._a, config, token);
  32161. }
  32162. }
  32163. var YEAR = 0,
  32164. MONTH = 1,
  32165. DATE = 2,
  32166. HOUR = 3,
  32167. MINUTE = 4,
  32168. SECOND = 5,
  32169. MILLISECOND = 6,
  32170. WEEK = 7,
  32171. WEEKDAY = 8;
  32172. function mod(n, x) {
  32173. return ((n % x) + x) % x;
  32174. }
  32175. var indexOf;
  32176. if (Array.prototype.indexOf) {
  32177. indexOf = Array.prototype.indexOf;
  32178. } else {
  32179. indexOf = function (o) {
  32180. // I know
  32181. var i;
  32182. for (i = 0; i < this.length; ++i) {
  32183. if (this[i] === o) {
  32184. return i;
  32185. }
  32186. }
  32187. return -1;
  32188. };
  32189. }
  32190. function daysInMonth(year, month) {
  32191. if (isNaN(year) || isNaN(month)) {
  32192. return NaN;
  32193. }
  32194. var modMonth = mod(month, 12);
  32195. year += (month - modMonth) / 12;
  32196. return modMonth === 1
  32197. ? isLeapYear(year)
  32198. ? 29
  32199. : 28
  32200. : 31 - ((modMonth % 7) % 2);
  32201. }
  32202. // FORMATTING
  32203. addFormatToken('M', ['MM', 2], 'Mo', function () {
  32204. return this.month() + 1;
  32205. });
  32206. addFormatToken('MMM', 0, 0, function (format) {
  32207. return this.localeData().monthsShort(this, format);
  32208. });
  32209. addFormatToken('MMMM', 0, 0, function (format) {
  32210. return this.localeData().months(this, format);
  32211. });
  32212. // ALIASES
  32213. addUnitAlias('month', 'M');
  32214. // PRIORITY
  32215. addUnitPriority('month', 8);
  32216. // PARSING
  32217. addRegexToken('M', match1to2);
  32218. addRegexToken('MM', match1to2, match2);
  32219. addRegexToken('MMM', function (isStrict, locale) {
  32220. return locale.monthsShortRegex(isStrict);
  32221. });
  32222. addRegexToken('MMMM', function (isStrict, locale) {
  32223. return locale.monthsRegex(isStrict);
  32224. });
  32225. addParseToken(['M', 'MM'], function (input, array) {
  32226. array[MONTH] = toInt(input) - 1;
  32227. });
  32228. addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
  32229. var month = config._locale.monthsParse(input, token, config._strict);
  32230. // if we didn't find a month name, mark the date as invalid.
  32231. if (month != null) {
  32232. array[MONTH] = month;
  32233. } else {
  32234. getParsingFlags(config).invalidMonth = input;
  32235. }
  32236. });
  32237. // LOCALES
  32238. var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
  32239. '_'
  32240. ),
  32241. defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split(
  32242. '_'
  32243. ),
  32244. MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
  32245. defaultMonthsShortRegex = matchWord,
  32246. defaultMonthsRegex = matchWord;
  32247. function localeMonths(m, format) {
  32248. if (!m) {
  32249. return isArray(this._months)
  32250. ? this._months
  32251. : this._months['standalone'];
  32252. }
  32253. return isArray(this._months)
  32254. ? this._months[m.month()]
  32255. : this._months[
  32256. (this._months.isFormat || MONTHS_IN_FORMAT).test(format)
  32257. ? 'format'
  32258. : 'standalone'
  32259. ][m.month()];
  32260. }
  32261. function localeMonthsShort(m, format) {
  32262. if (!m) {
  32263. return isArray(this._monthsShort)
  32264. ? this._monthsShort
  32265. : this._monthsShort['standalone'];
  32266. }
  32267. return isArray(this._monthsShort)
  32268. ? this._monthsShort[m.month()]
  32269. : this._monthsShort[
  32270. MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'
  32271. ][m.month()];
  32272. }
  32273. function handleStrictParse(monthName, format, strict) {
  32274. var i,
  32275. ii,
  32276. mom,
  32277. llc = monthName.toLocaleLowerCase();
  32278. if (!this._monthsParse) {
  32279. // this is not used
  32280. this._monthsParse = [];
  32281. this._longMonthsParse = [];
  32282. this._shortMonthsParse = [];
  32283. for (i = 0; i < 12; ++i) {
  32284. mom = createUTC([2000, i]);
  32285. this._shortMonthsParse[i] = this.monthsShort(
  32286. mom,
  32287. ''
  32288. ).toLocaleLowerCase();
  32289. this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
  32290. }
  32291. }
  32292. if (strict) {
  32293. if (format === 'MMM') {
  32294. ii = indexOf.call(this._shortMonthsParse, llc);
  32295. return ii !== -1 ? ii : null;
  32296. } else {
  32297. ii = indexOf.call(this._longMonthsParse, llc);
  32298. return ii !== -1 ? ii : null;
  32299. }
  32300. } else {
  32301. if (format === 'MMM') {
  32302. ii = indexOf.call(this._shortMonthsParse, llc);
  32303. if (ii !== -1) {
  32304. return ii;
  32305. }
  32306. ii = indexOf.call(this._longMonthsParse, llc);
  32307. return ii !== -1 ? ii : null;
  32308. } else {
  32309. ii = indexOf.call(this._longMonthsParse, llc);
  32310. if (ii !== -1) {
  32311. return ii;
  32312. }
  32313. ii = indexOf.call(this._shortMonthsParse, llc);
  32314. return ii !== -1 ? ii : null;
  32315. }
  32316. }
  32317. }
  32318. function localeMonthsParse(monthName, format, strict) {
  32319. var i, mom, regex;
  32320. if (this._monthsParseExact) {
  32321. return handleStrictParse.call(this, monthName, format, strict);
  32322. }
  32323. if (!this._monthsParse) {
  32324. this._monthsParse = [];
  32325. this._longMonthsParse = [];
  32326. this._shortMonthsParse = [];
  32327. }
  32328. // TODO: add sorting
  32329. // Sorting makes sure if one month (or abbr) is a prefix of another
  32330. // see sorting in computeMonthsParse
  32331. for (i = 0; i < 12; i++) {
  32332. // make the regex if we don't have it already
  32333. mom = createUTC([2000, i]);
  32334. if (strict && !this._longMonthsParse[i]) {
  32335. this._longMonthsParse[i] = new RegExp(
  32336. '^' + this.months(mom, '').replace('.', '') + '$',
  32337. 'i'
  32338. );
  32339. this._shortMonthsParse[i] = new RegExp(
  32340. '^' + this.monthsShort(mom, '').replace('.', '') + '$',
  32341. 'i'
  32342. );
  32343. }
  32344. if (!strict && !this._monthsParse[i]) {
  32345. regex =
  32346. '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
  32347. this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
  32348. }
  32349. // test the regex
  32350. if (
  32351. strict &&
  32352. format === 'MMMM' &&
  32353. this._longMonthsParse[i].test(monthName)
  32354. ) {
  32355. return i;
  32356. } else if (
  32357. strict &&
  32358. format === 'MMM' &&
  32359. this._shortMonthsParse[i].test(monthName)
  32360. ) {
  32361. return i;
  32362. } else if (!strict && this._monthsParse[i].test(monthName)) {
  32363. return i;
  32364. }
  32365. }
  32366. }
  32367. // MOMENTS
  32368. function setMonth(mom, value) {
  32369. var dayOfMonth;
  32370. if (!mom.isValid()) {
  32371. // No op
  32372. return mom;
  32373. }
  32374. if (typeof value === 'string') {
  32375. if (/^\d+$/.test(value)) {
  32376. value = toInt(value);
  32377. } else {
  32378. value = mom.localeData().monthsParse(value);
  32379. // TODO: Another silent failure?
  32380. if (!isNumber(value)) {
  32381. return mom;
  32382. }
  32383. }
  32384. }
  32385. dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
  32386. mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
  32387. return mom;
  32388. }
  32389. function getSetMonth(value) {
  32390. if (value != null) {
  32391. setMonth(this, value);
  32392. hooks.updateOffset(this, true);
  32393. return this;
  32394. } else {
  32395. return get(this, 'Month');
  32396. }
  32397. }
  32398. function getDaysInMonth() {
  32399. return daysInMonth(this.year(), this.month());
  32400. }
  32401. function monthsShortRegex(isStrict) {
  32402. if (this._monthsParseExact) {
  32403. if (!hasOwnProp(this, '_monthsRegex')) {
  32404. computeMonthsParse.call(this);
  32405. }
  32406. if (isStrict) {
  32407. return this._monthsShortStrictRegex;
  32408. } else {
  32409. return this._monthsShortRegex;
  32410. }
  32411. } else {
  32412. if (!hasOwnProp(this, '_monthsShortRegex')) {
  32413. this._monthsShortRegex = defaultMonthsShortRegex;
  32414. }
  32415. return this._monthsShortStrictRegex && isStrict
  32416. ? this._monthsShortStrictRegex
  32417. : this._monthsShortRegex;
  32418. }
  32419. }
  32420. function monthsRegex(isStrict) {
  32421. if (this._monthsParseExact) {
  32422. if (!hasOwnProp(this, '_monthsRegex')) {
  32423. computeMonthsParse.call(this);
  32424. }
  32425. if (isStrict) {
  32426. return this._monthsStrictRegex;
  32427. } else {
  32428. return this._monthsRegex;
  32429. }
  32430. } else {
  32431. if (!hasOwnProp(this, '_monthsRegex')) {
  32432. this._monthsRegex = defaultMonthsRegex;
  32433. }
  32434. return this._monthsStrictRegex && isStrict
  32435. ? this._monthsStrictRegex
  32436. : this._monthsRegex;
  32437. }
  32438. }
  32439. function computeMonthsParse() {
  32440. function cmpLenRev(a, b) {
  32441. return b.length - a.length;
  32442. }
  32443. var shortPieces = [],
  32444. longPieces = [],
  32445. mixedPieces = [],
  32446. i,
  32447. mom;
  32448. for (i = 0; i < 12; i++) {
  32449. // make the regex if we don't have it already
  32450. mom = createUTC([2000, i]);
  32451. shortPieces.push(this.monthsShort(mom, ''));
  32452. longPieces.push(this.months(mom, ''));
  32453. mixedPieces.push(this.months(mom, ''));
  32454. mixedPieces.push(this.monthsShort(mom, ''));
  32455. }
  32456. // Sorting makes sure if one month (or abbr) is a prefix of another it
  32457. // will match the longer piece.
  32458. shortPieces.sort(cmpLenRev);
  32459. longPieces.sort(cmpLenRev);
  32460. mixedPieces.sort(cmpLenRev);
  32461. for (i = 0; i < 12; i++) {
  32462. shortPieces[i] = regexEscape(shortPieces[i]);
  32463. longPieces[i] = regexEscape(longPieces[i]);
  32464. }
  32465. for (i = 0; i < 24; i++) {
  32466. mixedPieces[i] = regexEscape(mixedPieces[i]);
  32467. }
  32468. this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  32469. this._monthsShortRegex = this._monthsRegex;
  32470. this._monthsStrictRegex = new RegExp(
  32471. '^(' + longPieces.join('|') + ')',
  32472. 'i'
  32473. );
  32474. this._monthsShortStrictRegex = new RegExp(
  32475. '^(' + shortPieces.join('|') + ')',
  32476. 'i'
  32477. );
  32478. }
  32479. // FORMATTING
  32480. addFormatToken('Y', 0, 0, function () {
  32481. var y = this.year();
  32482. return y <= 9999 ? zeroFill(y, 4) : '+' + y;
  32483. });
  32484. addFormatToken(0, ['YY', 2], 0, function () {
  32485. return this.year() % 100;
  32486. });
  32487. addFormatToken(0, ['YYYY', 4], 0, 'year');
  32488. addFormatToken(0, ['YYYYY', 5], 0, 'year');
  32489. addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
  32490. // ALIASES
  32491. addUnitAlias('year', 'y');
  32492. // PRIORITIES
  32493. addUnitPriority('year', 1);
  32494. // PARSING
  32495. addRegexToken('Y', matchSigned);
  32496. addRegexToken('YY', match1to2, match2);
  32497. addRegexToken('YYYY', match1to4, match4);
  32498. addRegexToken('YYYYY', match1to6, match6);
  32499. addRegexToken('YYYYYY', match1to6, match6);
  32500. addParseToken(['YYYYY', 'YYYYYY'], YEAR);
  32501. addParseToken('YYYY', function (input, array) {
  32502. array[YEAR] =
  32503. input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
  32504. });
  32505. addParseToken('YY', function (input, array) {
  32506. array[YEAR] = hooks.parseTwoDigitYear(input);
  32507. });
  32508. addParseToken('Y', function (input, array) {
  32509. array[YEAR] = parseInt(input, 10);
  32510. });
  32511. // HELPERS
  32512. function daysInYear(year) {
  32513. return isLeapYear(year) ? 366 : 365;
  32514. }
  32515. // HOOKS
  32516. hooks.parseTwoDigitYear = function (input) {
  32517. return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
  32518. };
  32519. // MOMENTS
  32520. var getSetYear = makeGetSet('FullYear', true);
  32521. function getIsLeapYear() {
  32522. return isLeapYear(this.year());
  32523. }
  32524. function createDate(y, m, d, h, M, s, ms) {
  32525. // can't just apply() to create a date:
  32526. // https://stackoverflow.com/q/181348
  32527. var date;
  32528. // the date constructor remaps years 0-99 to 1900-1999
  32529. if (y < 100 && y >= 0) {
  32530. // preserve leap years using a full 400 year cycle, then reset
  32531. date = new Date(y + 400, m, d, h, M, s, ms);
  32532. if (isFinite(date.getFullYear())) {
  32533. date.setFullYear(y);
  32534. }
  32535. } else {
  32536. date = new Date(y, m, d, h, M, s, ms);
  32537. }
  32538. return date;
  32539. }
  32540. function createUTCDate(y) {
  32541. var date, args;
  32542. // the Date.UTC function remaps years 0-99 to 1900-1999
  32543. if (y < 100 && y >= 0) {
  32544. args = Array.prototype.slice.call(arguments);
  32545. // preserve leap years using a full 400 year cycle, then reset
  32546. args[0] = y + 400;
  32547. date = new Date(Date.UTC.apply(null, args));
  32548. if (isFinite(date.getUTCFullYear())) {
  32549. date.setUTCFullYear(y);
  32550. }
  32551. } else {
  32552. date = new Date(Date.UTC.apply(null, arguments));
  32553. }
  32554. return date;
  32555. }
  32556. // start-of-first-week - start-of-year
  32557. function firstWeekOffset(year, dow, doy) {
  32558. var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
  32559. fwd = 7 + dow - doy,
  32560. // first-week day local weekday -- which local weekday is fwd
  32561. fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
  32562. return -fwdlw + fwd - 1;
  32563. }
  32564. // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
  32565. function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
  32566. var localWeekday = (7 + weekday - dow) % 7,
  32567. weekOffset = firstWeekOffset(year, dow, doy),
  32568. dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
  32569. resYear,
  32570. resDayOfYear;
  32571. if (dayOfYear <= 0) {
  32572. resYear = year - 1;
  32573. resDayOfYear = daysInYear(resYear) + dayOfYear;
  32574. } else if (dayOfYear > daysInYear(year)) {
  32575. resYear = year + 1;
  32576. resDayOfYear = dayOfYear - daysInYear(year);
  32577. } else {
  32578. resYear = year;
  32579. resDayOfYear = dayOfYear;
  32580. }
  32581. return {
  32582. year: resYear,
  32583. dayOfYear: resDayOfYear,
  32584. };
  32585. }
  32586. function weekOfYear(mom, dow, doy) {
  32587. var weekOffset = firstWeekOffset(mom.year(), dow, doy),
  32588. week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
  32589. resWeek,
  32590. resYear;
  32591. if (week < 1) {
  32592. resYear = mom.year() - 1;
  32593. resWeek = week + weeksInYear(resYear, dow, doy);
  32594. } else if (week > weeksInYear(mom.year(), dow, doy)) {
  32595. resWeek = week - weeksInYear(mom.year(), dow, doy);
  32596. resYear = mom.year() + 1;
  32597. } else {
  32598. resYear = mom.year();
  32599. resWeek = week;
  32600. }
  32601. return {
  32602. week: resWeek,
  32603. year: resYear,
  32604. };
  32605. }
  32606. function weeksInYear(year, dow, doy) {
  32607. var weekOffset = firstWeekOffset(year, dow, doy),
  32608. weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
  32609. return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
  32610. }
  32611. // FORMATTING
  32612. addFormatToken('w', ['ww', 2], 'wo', 'week');
  32613. addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
  32614. // ALIASES
  32615. addUnitAlias('week', 'w');
  32616. addUnitAlias('isoWeek', 'W');
  32617. // PRIORITIES
  32618. addUnitPriority('week', 5);
  32619. addUnitPriority('isoWeek', 5);
  32620. // PARSING
  32621. addRegexToken('w', match1to2);
  32622. addRegexToken('ww', match1to2, match2);
  32623. addRegexToken('W', match1to2);
  32624. addRegexToken('WW', match1to2, match2);
  32625. addWeekParseToken(['w', 'ww', 'W', 'WW'], function (
  32626. input,
  32627. week,
  32628. config,
  32629. token
  32630. ) {
  32631. week[token.substr(0, 1)] = toInt(input);
  32632. });
  32633. // HELPERS
  32634. // LOCALES
  32635. function localeWeek(mom) {
  32636. return weekOfYear(mom, this._week.dow, this._week.doy).week;
  32637. }
  32638. var defaultLocaleWeek = {
  32639. dow: 0, // Sunday is the first day of the week.
  32640. doy: 6, // The week that contains Jan 6th is the first week of the year.
  32641. };
  32642. function localeFirstDayOfWeek() {
  32643. return this._week.dow;
  32644. }
  32645. function localeFirstDayOfYear() {
  32646. return this._week.doy;
  32647. }
  32648. // MOMENTS
  32649. function getSetWeek(input) {
  32650. var week = this.localeData().week(this);
  32651. return input == null ? week : this.add((input - week) * 7, 'd');
  32652. }
  32653. function getSetISOWeek(input) {
  32654. var week = weekOfYear(this, 1, 4).week;
  32655. return input == null ? week : this.add((input - week) * 7, 'd');
  32656. }
  32657. // FORMATTING
  32658. addFormatToken('d', 0, 'do', 'day');
  32659. addFormatToken('dd', 0, 0, function (format) {
  32660. return this.localeData().weekdaysMin(this, format);
  32661. });
  32662. addFormatToken('ddd', 0, 0, function (format) {
  32663. return this.localeData().weekdaysShort(this, format);
  32664. });
  32665. addFormatToken('dddd', 0, 0, function (format) {
  32666. return this.localeData().weekdays(this, format);
  32667. });
  32668. addFormatToken('e', 0, 0, 'weekday');
  32669. addFormatToken('E', 0, 0, 'isoWeekday');
  32670. // ALIASES
  32671. addUnitAlias('day', 'd');
  32672. addUnitAlias('weekday', 'e');
  32673. addUnitAlias('isoWeekday', 'E');
  32674. // PRIORITY
  32675. addUnitPriority('day', 11);
  32676. addUnitPriority('weekday', 11);
  32677. addUnitPriority('isoWeekday', 11);
  32678. // PARSING
  32679. addRegexToken('d', match1to2);
  32680. addRegexToken('e', match1to2);
  32681. addRegexToken('E', match1to2);
  32682. addRegexToken('dd', function (isStrict, locale) {
  32683. return locale.weekdaysMinRegex(isStrict);
  32684. });
  32685. addRegexToken('ddd', function (isStrict, locale) {
  32686. return locale.weekdaysShortRegex(isStrict);
  32687. });
  32688. addRegexToken('dddd', function (isStrict, locale) {
  32689. return locale.weekdaysRegex(isStrict);
  32690. });
  32691. addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
  32692. var weekday = config._locale.weekdaysParse(input, token, config._strict);
  32693. // if we didn't get a weekday name, mark the date as invalid
  32694. if (weekday != null) {
  32695. week.d = weekday;
  32696. } else {
  32697. getParsingFlags(config).invalidWeekday = input;
  32698. }
  32699. });
  32700. addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
  32701. week[token] = toInt(input);
  32702. });
  32703. // HELPERS
  32704. function parseWeekday(input, locale) {
  32705. if (typeof input !== 'string') {
  32706. return input;
  32707. }
  32708. if (!isNaN(input)) {
  32709. return parseInt(input, 10);
  32710. }
  32711. input = locale.weekdaysParse(input);
  32712. if (typeof input === 'number') {
  32713. return input;
  32714. }
  32715. return null;
  32716. }
  32717. function parseIsoWeekday(input, locale) {
  32718. if (typeof input === 'string') {
  32719. return locale.weekdaysParse(input) % 7 || 7;
  32720. }
  32721. return isNaN(input) ? null : input;
  32722. }
  32723. // LOCALES
  32724. function shiftWeekdays(ws, n) {
  32725. return ws.slice(n, 7).concat(ws.slice(0, n));
  32726. }
  32727. var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
  32728. '_'
  32729. ),
  32730. defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  32731. defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  32732. defaultWeekdaysRegex = matchWord,
  32733. defaultWeekdaysShortRegex = matchWord,
  32734. defaultWeekdaysMinRegex = matchWord;
  32735. function localeWeekdays(m, format) {
  32736. var weekdays = isArray(this._weekdays)
  32737. ? this._weekdays
  32738. : this._weekdays[
  32739. m && m !== true && this._weekdays.isFormat.test(format)
  32740. ? 'format'
  32741. : 'standalone'
  32742. ];
  32743. return m === true
  32744. ? shiftWeekdays(weekdays, this._week.dow)
  32745. : m
  32746. ? weekdays[m.day()]
  32747. : weekdays;
  32748. }
  32749. function localeWeekdaysShort(m) {
  32750. return m === true
  32751. ? shiftWeekdays(this._weekdaysShort, this._week.dow)
  32752. : m
  32753. ? this._weekdaysShort[m.day()]
  32754. : this._weekdaysShort;
  32755. }
  32756. function localeWeekdaysMin(m) {
  32757. return m === true
  32758. ? shiftWeekdays(this._weekdaysMin, this._week.dow)
  32759. : m
  32760. ? this._weekdaysMin[m.day()]
  32761. : this._weekdaysMin;
  32762. }
  32763. function handleStrictParse$1(weekdayName, format, strict) {
  32764. var i,
  32765. ii,
  32766. mom,
  32767. llc = weekdayName.toLocaleLowerCase();
  32768. if (!this._weekdaysParse) {
  32769. this._weekdaysParse = [];
  32770. this._shortWeekdaysParse = [];
  32771. this._minWeekdaysParse = [];
  32772. for (i = 0; i < 7; ++i) {
  32773. mom = createUTC([2000, 1]).day(i);
  32774. this._minWeekdaysParse[i] = this.weekdaysMin(
  32775. mom,
  32776. ''
  32777. ).toLocaleLowerCase();
  32778. this._shortWeekdaysParse[i] = this.weekdaysShort(
  32779. mom,
  32780. ''
  32781. ).toLocaleLowerCase();
  32782. this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
  32783. }
  32784. }
  32785. if (strict) {
  32786. if (format === 'dddd') {
  32787. ii = indexOf.call(this._weekdaysParse, llc);
  32788. return ii !== -1 ? ii : null;
  32789. } else if (format === 'ddd') {
  32790. ii = indexOf.call(this._shortWeekdaysParse, llc);
  32791. return ii !== -1 ? ii : null;
  32792. } else {
  32793. ii = indexOf.call(this._minWeekdaysParse, llc);
  32794. return ii !== -1 ? ii : null;
  32795. }
  32796. } else {
  32797. if (format === 'dddd') {
  32798. ii = indexOf.call(this._weekdaysParse, llc);
  32799. if (ii !== -1) {
  32800. return ii;
  32801. }
  32802. ii = indexOf.call(this._shortWeekdaysParse, llc);
  32803. if (ii !== -1) {
  32804. return ii;
  32805. }
  32806. ii = indexOf.call(this._minWeekdaysParse, llc);
  32807. return ii !== -1 ? ii : null;
  32808. } else if (format === 'ddd') {
  32809. ii = indexOf.call(this._shortWeekdaysParse, llc);
  32810. if (ii !== -1) {
  32811. return ii;
  32812. }
  32813. ii = indexOf.call(this._weekdaysParse, llc);
  32814. if (ii !== -1) {
  32815. return ii;
  32816. }
  32817. ii = indexOf.call(this._minWeekdaysParse, llc);
  32818. return ii !== -1 ? ii : null;
  32819. } else {
  32820. ii = indexOf.call(this._minWeekdaysParse, llc);
  32821. if (ii !== -1) {
  32822. return ii;
  32823. }
  32824. ii = indexOf.call(this._weekdaysParse, llc);
  32825. if (ii !== -1) {
  32826. return ii;
  32827. }
  32828. ii = indexOf.call(this._shortWeekdaysParse, llc);
  32829. return ii !== -1 ? ii : null;
  32830. }
  32831. }
  32832. }
  32833. function localeWeekdaysParse(weekdayName, format, strict) {
  32834. var i, mom, regex;
  32835. if (this._weekdaysParseExact) {
  32836. return handleStrictParse$1.call(this, weekdayName, format, strict);
  32837. }
  32838. if (!this._weekdaysParse) {
  32839. this._weekdaysParse = [];
  32840. this._minWeekdaysParse = [];
  32841. this._shortWeekdaysParse = [];
  32842. this._fullWeekdaysParse = [];
  32843. }
  32844. for (i = 0; i < 7; i++) {
  32845. // make the regex if we don't have it already
  32846. mom = createUTC([2000, 1]).day(i);
  32847. if (strict && !this._fullWeekdaysParse[i]) {
  32848. this._fullWeekdaysParse[i] = new RegExp(
  32849. '^' + this.weekdays(mom, '').replace('.', '\\.?') + '$',
  32850. 'i'
  32851. );
  32852. this._shortWeekdaysParse[i] = new RegExp(
  32853. '^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$',
  32854. 'i'
  32855. );
  32856. this._minWeekdaysParse[i] = new RegExp(
  32857. '^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$',
  32858. 'i'
  32859. );
  32860. }
  32861. if (!this._weekdaysParse[i]) {
  32862. regex =
  32863. '^' +
  32864. this.weekdays(mom, '') +
  32865. '|^' +
  32866. this.weekdaysShort(mom, '') +
  32867. '|^' +
  32868. this.weekdaysMin(mom, '');
  32869. this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
  32870. }
  32871. // test the regex
  32872. if (
  32873. strict &&
  32874. format === 'dddd' &&
  32875. this._fullWeekdaysParse[i].test(weekdayName)
  32876. ) {
  32877. return i;
  32878. } else if (
  32879. strict &&
  32880. format === 'ddd' &&
  32881. this._shortWeekdaysParse[i].test(weekdayName)
  32882. ) {
  32883. return i;
  32884. } else if (
  32885. strict &&
  32886. format === 'dd' &&
  32887. this._minWeekdaysParse[i].test(weekdayName)
  32888. ) {
  32889. return i;
  32890. } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
  32891. return i;
  32892. }
  32893. }
  32894. }
  32895. // MOMENTS
  32896. function getSetDayOfWeek(input) {
  32897. if (!this.isValid()) {
  32898. return input != null ? this : NaN;
  32899. }
  32900. var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
  32901. if (input != null) {
  32902. input = parseWeekday(input, this.localeData());
  32903. return this.add(input - day, 'd');
  32904. } else {
  32905. return day;
  32906. }
  32907. }
  32908. function getSetLocaleDayOfWeek(input) {
  32909. if (!this.isValid()) {
  32910. return input != null ? this : NaN;
  32911. }
  32912. var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
  32913. return input == null ? weekday : this.add(input - weekday, 'd');
  32914. }
  32915. function getSetISODayOfWeek(input) {
  32916. if (!this.isValid()) {
  32917. return input != null ? this : NaN;
  32918. }
  32919. // behaves the same as moment#day except
  32920. // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
  32921. // as a setter, sunday should belong to the previous week.
  32922. if (input != null) {
  32923. var weekday = parseIsoWeekday(input, this.localeData());
  32924. return this.day(this.day() % 7 ? weekday : weekday - 7);
  32925. } else {
  32926. return this.day() || 7;
  32927. }
  32928. }
  32929. function weekdaysRegex(isStrict) {
  32930. if (this._weekdaysParseExact) {
  32931. if (!hasOwnProp(this, '_weekdaysRegex')) {
  32932. computeWeekdaysParse.call(this);
  32933. }
  32934. if (isStrict) {
  32935. return this._weekdaysStrictRegex;
  32936. } else {
  32937. return this._weekdaysRegex;
  32938. }
  32939. } else {
  32940. if (!hasOwnProp(this, '_weekdaysRegex')) {
  32941. this._weekdaysRegex = defaultWeekdaysRegex;
  32942. }
  32943. return this._weekdaysStrictRegex && isStrict
  32944. ? this._weekdaysStrictRegex
  32945. : this._weekdaysRegex;
  32946. }
  32947. }
  32948. function weekdaysShortRegex(isStrict) {
  32949. if (this._weekdaysParseExact) {
  32950. if (!hasOwnProp(this, '_weekdaysRegex')) {
  32951. computeWeekdaysParse.call(this);
  32952. }
  32953. if (isStrict) {
  32954. return this._weekdaysShortStrictRegex;
  32955. } else {
  32956. return this._weekdaysShortRegex;
  32957. }
  32958. } else {
  32959. if (!hasOwnProp(this, '_weekdaysShortRegex')) {
  32960. this._weekdaysShortRegex = defaultWeekdaysShortRegex;
  32961. }
  32962. return this._weekdaysShortStrictRegex && isStrict
  32963. ? this._weekdaysShortStrictRegex
  32964. : this._weekdaysShortRegex;
  32965. }
  32966. }
  32967. function weekdaysMinRegex(isStrict) {
  32968. if (this._weekdaysParseExact) {
  32969. if (!hasOwnProp(this, '_weekdaysRegex')) {
  32970. computeWeekdaysParse.call(this);
  32971. }
  32972. if (isStrict) {
  32973. return this._weekdaysMinStrictRegex;
  32974. } else {
  32975. return this._weekdaysMinRegex;
  32976. }
  32977. } else {
  32978. if (!hasOwnProp(this, '_weekdaysMinRegex')) {
  32979. this._weekdaysMinRegex = defaultWeekdaysMinRegex;
  32980. }
  32981. return this._weekdaysMinStrictRegex && isStrict
  32982. ? this._weekdaysMinStrictRegex
  32983. : this._weekdaysMinRegex;
  32984. }
  32985. }
  32986. function computeWeekdaysParse() {
  32987. function cmpLenRev(a, b) {
  32988. return b.length - a.length;
  32989. }
  32990. var minPieces = [],
  32991. shortPieces = [],
  32992. longPieces = [],
  32993. mixedPieces = [],
  32994. i,
  32995. mom,
  32996. minp,
  32997. shortp,
  32998. longp;
  32999. for (i = 0; i < 7; i++) {
  33000. // make the regex if we don't have it already
  33001. mom = createUTC([2000, 1]).day(i);
  33002. minp = regexEscape(this.weekdaysMin(mom, ''));
  33003. shortp = regexEscape(this.weekdaysShort(mom, ''));
  33004. longp = regexEscape(this.weekdays(mom, ''));
  33005. minPieces.push(minp);
  33006. shortPieces.push(shortp);
  33007. longPieces.push(longp);
  33008. mixedPieces.push(minp);
  33009. mixedPieces.push(shortp);
  33010. mixedPieces.push(longp);
  33011. }
  33012. // Sorting makes sure if one weekday (or abbr) is a prefix of another it
  33013. // will match the longer piece.
  33014. minPieces.sort(cmpLenRev);
  33015. shortPieces.sort(cmpLenRev);
  33016. longPieces.sort(cmpLenRev);
  33017. mixedPieces.sort(cmpLenRev);
  33018. this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  33019. this._weekdaysShortRegex = this._weekdaysRegex;
  33020. this._weekdaysMinRegex = this._weekdaysRegex;
  33021. this._weekdaysStrictRegex = new RegExp(
  33022. '^(' + longPieces.join('|') + ')',
  33023. 'i'
  33024. );
  33025. this._weekdaysShortStrictRegex = new RegExp(
  33026. '^(' + shortPieces.join('|') + ')',
  33027. 'i'
  33028. );
  33029. this._weekdaysMinStrictRegex = new RegExp(
  33030. '^(' + minPieces.join('|') + ')',
  33031. 'i'
  33032. );
  33033. }
  33034. // FORMATTING
  33035. function hFormat() {
  33036. return this.hours() % 12 || 12;
  33037. }
  33038. function kFormat() {
  33039. return this.hours() || 24;
  33040. }
  33041. addFormatToken('H', ['HH', 2], 0, 'hour');
  33042. addFormatToken('h', ['hh', 2], 0, hFormat);
  33043. addFormatToken('k', ['kk', 2], 0, kFormat);
  33044. addFormatToken('hmm', 0, 0, function () {
  33045. return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
  33046. });
  33047. addFormatToken('hmmss', 0, 0, function () {
  33048. return (
  33049. '' +
  33050. hFormat.apply(this) +
  33051. zeroFill(this.minutes(), 2) +
  33052. zeroFill(this.seconds(), 2)
  33053. );
  33054. });
  33055. addFormatToken('Hmm', 0, 0, function () {
  33056. return '' + this.hours() + zeroFill(this.minutes(), 2);
  33057. });
  33058. addFormatToken('Hmmss', 0, 0, function () {
  33059. return (
  33060. '' +
  33061. this.hours() +
  33062. zeroFill(this.minutes(), 2) +
  33063. zeroFill(this.seconds(), 2)
  33064. );
  33065. });
  33066. function meridiem(token, lowercase) {
  33067. addFormatToken(token, 0, 0, function () {
  33068. return this.localeData().meridiem(
  33069. this.hours(),
  33070. this.minutes(),
  33071. lowercase
  33072. );
  33073. });
  33074. }
  33075. meridiem('a', true);
  33076. meridiem('A', false);
  33077. // ALIASES
  33078. addUnitAlias('hour', 'h');
  33079. // PRIORITY
  33080. addUnitPriority('hour', 13);
  33081. // PARSING
  33082. function matchMeridiem(isStrict, locale) {
  33083. return locale._meridiemParse;
  33084. }
  33085. addRegexToken('a', matchMeridiem);
  33086. addRegexToken('A', matchMeridiem);
  33087. addRegexToken('H', match1to2);
  33088. addRegexToken('h', match1to2);
  33089. addRegexToken('k', match1to2);
  33090. addRegexToken('HH', match1to2, match2);
  33091. addRegexToken('hh', match1to2, match2);
  33092. addRegexToken('kk', match1to2, match2);
  33093. addRegexToken('hmm', match3to4);
  33094. addRegexToken('hmmss', match5to6);
  33095. addRegexToken('Hmm', match3to4);
  33096. addRegexToken('Hmmss', match5to6);
  33097. addParseToken(['H', 'HH'], HOUR);
  33098. addParseToken(['k', 'kk'], function (input, array, config) {
  33099. var kInput = toInt(input);
  33100. array[HOUR] = kInput === 24 ? 0 : kInput;
  33101. });
  33102. addParseToken(['a', 'A'], function (input, array, config) {
  33103. config._isPm = config._locale.isPM(input);
  33104. config._meridiem = input;
  33105. });
  33106. addParseToken(['h', 'hh'], function (input, array, config) {
  33107. array[HOUR] = toInt(input);
  33108. getParsingFlags(config).bigHour = true;
  33109. });
  33110. addParseToken('hmm', function (input, array, config) {
  33111. var pos = input.length - 2;
  33112. array[HOUR] = toInt(input.substr(0, pos));
  33113. array[MINUTE] = toInt(input.substr(pos));
  33114. getParsingFlags(config).bigHour = true;
  33115. });
  33116. addParseToken('hmmss', function (input, array, config) {
  33117. var pos1 = input.length - 4,
  33118. pos2 = input.length - 2;
  33119. array[HOUR] = toInt(input.substr(0, pos1));
  33120. array[MINUTE] = toInt(input.substr(pos1, 2));
  33121. array[SECOND] = toInt(input.substr(pos2));
  33122. getParsingFlags(config).bigHour = true;
  33123. });
  33124. addParseToken('Hmm', function (input, array, config) {
  33125. var pos = input.length - 2;
  33126. array[HOUR] = toInt(input.substr(0, pos));
  33127. array[MINUTE] = toInt(input.substr(pos));
  33128. });
  33129. addParseToken('Hmmss', function (input, array, config) {
  33130. var pos1 = input.length - 4,
  33131. pos2 = input.length - 2;
  33132. array[HOUR] = toInt(input.substr(0, pos1));
  33133. array[MINUTE] = toInt(input.substr(pos1, 2));
  33134. array[SECOND] = toInt(input.substr(pos2));
  33135. });
  33136. // LOCALES
  33137. function localeIsPM(input) {
  33138. // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
  33139. // Using charAt should be more compatible.
  33140. return (input + '').toLowerCase().charAt(0) === 'p';
  33141. }
  33142. var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i,
  33143. // Setting the hour should keep the time, because the user explicitly
  33144. // specified which hour they want. So trying to maintain the same hour (in
  33145. // a new timezone) makes sense. Adding/subtracting hours does not follow
  33146. // this rule.
  33147. getSetHour = makeGetSet('Hours', true);
  33148. function localeMeridiem(hours, minutes, isLower) {
  33149. if (hours > 11) {
  33150. return isLower ? 'pm' : 'PM';
  33151. } else {
  33152. return isLower ? 'am' : 'AM';
  33153. }
  33154. }
  33155. var baseConfig = {
  33156. calendar: defaultCalendar,
  33157. longDateFormat: defaultLongDateFormat,
  33158. invalidDate: defaultInvalidDate,
  33159. ordinal: defaultOrdinal,
  33160. dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
  33161. relativeTime: defaultRelativeTime,
  33162. months: defaultLocaleMonths,
  33163. monthsShort: defaultLocaleMonthsShort,
  33164. week: defaultLocaleWeek,
  33165. weekdays: defaultLocaleWeekdays,
  33166. weekdaysMin: defaultLocaleWeekdaysMin,
  33167. weekdaysShort: defaultLocaleWeekdaysShort,
  33168. meridiemParse: defaultLocaleMeridiemParse,
  33169. };
  33170. // internal storage for locale config files
  33171. var locales = {},
  33172. localeFamilies = {},
  33173. globalLocale;
  33174. function commonPrefix(arr1, arr2) {
  33175. var i,
  33176. minl = Math.min(arr1.length, arr2.length);
  33177. for (i = 0; i < minl; i += 1) {
  33178. if (arr1[i] !== arr2[i]) {
  33179. return i;
  33180. }
  33181. }
  33182. return minl;
  33183. }
  33184. function normalizeLocale(key) {
  33185. return key ? key.toLowerCase().replace('_', '-') : key;
  33186. }
  33187. // pick the locale from the array
  33188. // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
  33189. // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
  33190. function chooseLocale(names) {
  33191. var i = 0,
  33192. j,
  33193. next,
  33194. locale,
  33195. split;
  33196. while (i < names.length) {
  33197. split = normalizeLocale(names[i]).split('-');
  33198. j = split.length;
  33199. next = normalizeLocale(names[i + 1]);
  33200. next = next ? next.split('-') : null;
  33201. while (j > 0) {
  33202. locale = loadLocale(split.slice(0, j).join('-'));
  33203. if (locale) {
  33204. return locale;
  33205. }
  33206. if (
  33207. next &&
  33208. next.length >= j &&
  33209. commonPrefix(split, next) >= j - 1
  33210. ) {
  33211. //the next array item is better than a shallower substring of this one
  33212. break;
  33213. }
  33214. j--;
  33215. }
  33216. i++;
  33217. }
  33218. return globalLocale;
  33219. }
  33220. function loadLocale(name) {
  33221. var oldLocale = null,
  33222. aliasedRequire;
  33223. // TODO: Find a better way to register and load all the locales in Node
  33224. if (
  33225. locales[name] === undefined &&
  33226. typeof module !== 'undefined' &&
  33227. module &&
  33228. module.exports
  33229. ) {
  33230. try {
  33231. oldLocale = globalLocale._abbr;
  33232. aliasedRequire = require;
  33233. __webpack_require__("./node_modules/moment/locale sync recursive ^\\.\\/.*$")("./" + name);
  33234. getSetGlobalLocale(oldLocale);
  33235. } catch (e) {
  33236. // mark as not found to avoid repeating expensive file require call causing high CPU
  33237. // when trying to find en-US, en_US, en-us for every format call
  33238. locales[name] = null; // null means not found
  33239. }
  33240. }
  33241. return locales[name];
  33242. }
  33243. // This function will load locale and then set the global locale. If
  33244. // no arguments are passed in, it will simply return the current global
  33245. // locale key.
  33246. function getSetGlobalLocale(key, values) {
  33247. var data;
  33248. if (key) {
  33249. if (isUndefined(values)) {
  33250. data = getLocale(key);
  33251. } else {
  33252. data = defineLocale(key, values);
  33253. }
  33254. if (data) {
  33255. // moment.duration._locale = moment._locale = data;
  33256. globalLocale = data;
  33257. } else {
  33258. if (typeof console !== 'undefined' && console.warn) {
  33259. //warn user if arguments are passed but the locale could not be set
  33260. console.warn(
  33261. 'Locale ' + key + ' not found. Did you forget to load it?'
  33262. );
  33263. }
  33264. }
  33265. }
  33266. return globalLocale._abbr;
  33267. }
  33268. function defineLocale(name, config) {
  33269. if (config !== null) {
  33270. var locale,
  33271. parentConfig = baseConfig;
  33272. config.abbr = name;
  33273. if (locales[name] != null) {
  33274. deprecateSimple(
  33275. 'defineLocaleOverride',
  33276. 'use moment.updateLocale(localeName, config) to change ' +
  33277. 'an existing locale. moment.defineLocale(localeName, ' +
  33278. 'config) should only be used for creating a new locale ' +
  33279. 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'
  33280. );
  33281. parentConfig = locales[name]._config;
  33282. } else if (config.parentLocale != null) {
  33283. if (locales[config.parentLocale] != null) {
  33284. parentConfig = locales[config.parentLocale]._config;
  33285. } else {
  33286. locale = loadLocale(config.parentLocale);
  33287. if (locale != null) {
  33288. parentConfig = locale._config;
  33289. } else {
  33290. if (!localeFamilies[config.parentLocale]) {
  33291. localeFamilies[config.parentLocale] = [];
  33292. }
  33293. localeFamilies[config.parentLocale].push({
  33294. name: name,
  33295. config: config,
  33296. });
  33297. return null;
  33298. }
  33299. }
  33300. }
  33301. locales[name] = new Locale(mergeConfigs(parentConfig, config));
  33302. if (localeFamilies[name]) {
  33303. localeFamilies[name].forEach(function (x) {
  33304. defineLocale(x.name, x.config);
  33305. });
  33306. }
  33307. // backwards compat for now: also set the locale
  33308. // make sure we set the locale AFTER all child locales have been
  33309. // created, so we won't end up with the child locale set.
  33310. getSetGlobalLocale(name);
  33311. return locales[name];
  33312. } else {
  33313. // useful for testing
  33314. delete locales[name];
  33315. return null;
  33316. }
  33317. }
  33318. function updateLocale(name, config) {
  33319. if (config != null) {
  33320. var locale,
  33321. tmpLocale,
  33322. parentConfig = baseConfig;
  33323. if (locales[name] != null && locales[name].parentLocale != null) {
  33324. // Update existing child locale in-place to avoid memory-leaks
  33325. locales[name].set(mergeConfigs(locales[name]._config, config));
  33326. } else {
  33327. // MERGE
  33328. tmpLocale = loadLocale(name);
  33329. if (tmpLocale != null) {
  33330. parentConfig = tmpLocale._config;
  33331. }
  33332. config = mergeConfigs(parentConfig, config);
  33333. if (tmpLocale == null) {
  33334. // updateLocale is called for creating a new locale
  33335. // Set abbr so it will have a name (getters return
  33336. // undefined otherwise).
  33337. config.abbr = name;
  33338. }
  33339. locale = new Locale(config);
  33340. locale.parentLocale = locales[name];
  33341. locales[name] = locale;
  33342. }
  33343. // backwards compat for now: also set the locale
  33344. getSetGlobalLocale(name);
  33345. } else {
  33346. // pass null for config to unupdate, useful for tests
  33347. if (locales[name] != null) {
  33348. if (locales[name].parentLocale != null) {
  33349. locales[name] = locales[name].parentLocale;
  33350. if (name === getSetGlobalLocale()) {
  33351. getSetGlobalLocale(name);
  33352. }
  33353. } else if (locales[name] != null) {
  33354. delete locales[name];
  33355. }
  33356. }
  33357. }
  33358. return locales[name];
  33359. }
  33360. // returns locale data
  33361. function getLocale(key) {
  33362. var locale;
  33363. if (key && key._locale && key._locale._abbr) {
  33364. key = key._locale._abbr;
  33365. }
  33366. if (!key) {
  33367. return globalLocale;
  33368. }
  33369. if (!isArray(key)) {
  33370. //short-circuit everything else
  33371. locale = loadLocale(key);
  33372. if (locale) {
  33373. return locale;
  33374. }
  33375. key = [key];
  33376. }
  33377. return chooseLocale(key);
  33378. }
  33379. function listLocales() {
  33380. return keys(locales);
  33381. }
  33382. function checkOverflow(m) {
  33383. var overflow,
  33384. a = m._a;
  33385. if (a && getParsingFlags(m).overflow === -2) {
  33386. overflow =
  33387. a[MONTH] < 0 || a[MONTH] > 11
  33388. ? MONTH
  33389. : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])
  33390. ? DATE
  33391. : a[HOUR] < 0 ||
  33392. a[HOUR] > 24 ||
  33393. (a[HOUR] === 24 &&
  33394. (a[MINUTE] !== 0 ||
  33395. a[SECOND] !== 0 ||
  33396. a[MILLISECOND] !== 0))
  33397. ? HOUR
  33398. : a[MINUTE] < 0 || a[MINUTE] > 59
  33399. ? MINUTE
  33400. : a[SECOND] < 0 || a[SECOND] > 59
  33401. ? SECOND
  33402. : a[MILLISECOND] < 0 || a[MILLISECOND] > 999
  33403. ? MILLISECOND
  33404. : -1;
  33405. if (
  33406. getParsingFlags(m)._overflowDayOfYear &&
  33407. (overflow < YEAR || overflow > DATE)
  33408. ) {
  33409. overflow = DATE;
  33410. }
  33411. if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
  33412. overflow = WEEK;
  33413. }
  33414. if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
  33415. overflow = WEEKDAY;
  33416. }
  33417. getParsingFlags(m).overflow = overflow;
  33418. }
  33419. return m;
  33420. }
  33421. // iso 8601 regex
  33422. // 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)
  33423. 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)?)?$/,
  33424. 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)?)?$/,
  33425. tzRegex = /Z|[+-]\d\d(?::?\d\d)?/,
  33426. isoDates = [
  33427. ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
  33428. ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
  33429. ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
  33430. ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
  33431. ['YYYY-DDD', /\d{4}-\d{3}/],
  33432. ['YYYY-MM', /\d{4}-\d\d/, false],
  33433. ['YYYYYYMMDD', /[+-]\d{10}/],
  33434. ['YYYYMMDD', /\d{8}/],
  33435. ['GGGG[W]WWE', /\d{4}W\d{3}/],
  33436. ['GGGG[W]WW', /\d{4}W\d{2}/, false],
  33437. ['YYYYDDD', /\d{7}/],
  33438. ['YYYYMM', /\d{6}/, false],
  33439. ['YYYY', /\d{4}/, false],
  33440. ],
  33441. // iso time formats and regexes
  33442. isoTimes = [
  33443. ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
  33444. ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
  33445. ['HH:mm:ss', /\d\d:\d\d:\d\d/],
  33446. ['HH:mm', /\d\d:\d\d/],
  33447. ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
  33448. ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
  33449. ['HHmmss', /\d\d\d\d\d\d/],
  33450. ['HHmm', /\d\d\d\d/],
  33451. ['HH', /\d\d/],
  33452. ],
  33453. aspNetJsonRegex = /^\/?Date\((-?\d+)/i,
  33454. // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
  33455. 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}))$/,
  33456. obsOffsets = {
  33457. UT: 0,
  33458. GMT: 0,
  33459. EDT: -4 * 60,
  33460. EST: -5 * 60,
  33461. CDT: -5 * 60,
  33462. CST: -6 * 60,
  33463. MDT: -6 * 60,
  33464. MST: -7 * 60,
  33465. PDT: -7 * 60,
  33466. PST: -8 * 60,
  33467. };
  33468. // date from iso format
  33469. function configFromISO(config) {
  33470. var i,
  33471. l,
  33472. string = config._i,
  33473. match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
  33474. allowTime,
  33475. dateFormat,
  33476. timeFormat,
  33477. tzFormat;
  33478. if (match) {
  33479. getParsingFlags(config).iso = true;
  33480. for (i = 0, l = isoDates.length; i < l; i++) {
  33481. if (isoDates[i][1].exec(match[1])) {
  33482. dateFormat = isoDates[i][0];
  33483. allowTime = isoDates[i][2] !== false;
  33484. break;
  33485. }
  33486. }
  33487. if (dateFormat == null) {
  33488. config._isValid = false;
  33489. return;
  33490. }
  33491. if (match[3]) {
  33492. for (i = 0, l = isoTimes.length; i < l; i++) {
  33493. if (isoTimes[i][1].exec(match[3])) {
  33494. // match[2] should be 'T' or space
  33495. timeFormat = (match[2] || ' ') + isoTimes[i][0];
  33496. break;
  33497. }
  33498. }
  33499. if (timeFormat == null) {
  33500. config._isValid = false;
  33501. return;
  33502. }
  33503. }
  33504. if (!allowTime && timeFormat != null) {
  33505. config._isValid = false;
  33506. return;
  33507. }
  33508. if (match[4]) {
  33509. if (tzRegex.exec(match[4])) {
  33510. tzFormat = 'Z';
  33511. } else {
  33512. config._isValid = false;
  33513. return;
  33514. }
  33515. }
  33516. config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
  33517. configFromStringAndFormat(config);
  33518. } else {
  33519. config._isValid = false;
  33520. }
  33521. }
  33522. function extractFromRFC2822Strings(
  33523. yearStr,
  33524. monthStr,
  33525. dayStr,
  33526. hourStr,
  33527. minuteStr,
  33528. secondStr
  33529. ) {
  33530. var result = [
  33531. untruncateYear(yearStr),
  33532. defaultLocaleMonthsShort.indexOf(monthStr),
  33533. parseInt(dayStr, 10),
  33534. parseInt(hourStr, 10),
  33535. parseInt(minuteStr, 10),
  33536. ];
  33537. if (secondStr) {
  33538. result.push(parseInt(secondStr, 10));
  33539. }
  33540. return result;
  33541. }
  33542. function untruncateYear(yearStr) {
  33543. var year = parseInt(yearStr, 10);
  33544. if (year <= 49) {
  33545. return 2000 + year;
  33546. } else if (year <= 999) {
  33547. return 1900 + year;
  33548. }
  33549. return year;
  33550. }
  33551. function preprocessRFC2822(s) {
  33552. // Remove comments and folding whitespace and replace multiple-spaces with a single space
  33553. return s
  33554. .replace(/\([^)]*\)|[\n\t]/g, ' ')
  33555. .replace(/(\s\s+)/g, ' ')
  33556. .replace(/^\s\s*/, '')
  33557. .replace(/\s\s*$/, '');
  33558. }
  33559. function checkWeekday(weekdayStr, parsedInput, config) {
  33560. if (weekdayStr) {
  33561. // TODO: Replace the vanilla JS Date object with an independent day-of-week check.
  33562. var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
  33563. weekdayActual = new Date(
  33564. parsedInput[0],
  33565. parsedInput[1],
  33566. parsedInput[2]
  33567. ).getDay();
  33568. if (weekdayProvided !== weekdayActual) {
  33569. getParsingFlags(config).weekdayMismatch = true;
  33570. config._isValid = false;
  33571. return false;
  33572. }
  33573. }
  33574. return true;
  33575. }
  33576. function calculateOffset(obsOffset, militaryOffset, numOffset) {
  33577. if (obsOffset) {
  33578. return obsOffsets[obsOffset];
  33579. } else if (militaryOffset) {
  33580. // the only allowed military tz is Z
  33581. return 0;
  33582. } else {
  33583. var hm = parseInt(numOffset, 10),
  33584. m = hm % 100,
  33585. h = (hm - m) / 100;
  33586. return h * 60 + m;
  33587. }
  33588. }
  33589. // date and time from ref 2822 format
  33590. function configFromRFC2822(config) {
  33591. var match = rfc2822.exec(preprocessRFC2822(config._i)),
  33592. parsedArray;
  33593. if (match) {
  33594. parsedArray = extractFromRFC2822Strings(
  33595. match[4],
  33596. match[3],
  33597. match[2],
  33598. match[5],
  33599. match[6],
  33600. match[7]
  33601. );
  33602. if (!checkWeekday(match[1], parsedArray, config)) {
  33603. return;
  33604. }
  33605. config._a = parsedArray;
  33606. config._tzm = calculateOffset(match[8], match[9], match[10]);
  33607. config._d = createUTCDate.apply(null, config._a);
  33608. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  33609. getParsingFlags(config).rfc2822 = true;
  33610. } else {
  33611. config._isValid = false;
  33612. }
  33613. }
  33614. // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict
  33615. function configFromString(config) {
  33616. var matched = aspNetJsonRegex.exec(config._i);
  33617. if (matched !== null) {
  33618. config._d = new Date(+matched[1]);
  33619. return;
  33620. }
  33621. configFromISO(config);
  33622. if (config._isValid === false) {
  33623. delete config._isValid;
  33624. } else {
  33625. return;
  33626. }
  33627. configFromRFC2822(config);
  33628. if (config._isValid === false) {
  33629. delete config._isValid;
  33630. } else {
  33631. return;
  33632. }
  33633. if (config._strict) {
  33634. config._isValid = false;
  33635. } else {
  33636. // Final attempt, use Input Fallback
  33637. hooks.createFromInputFallback(config);
  33638. }
  33639. }
  33640. hooks.createFromInputFallback = deprecate(
  33641. 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
  33642. 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
  33643. 'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.',
  33644. function (config) {
  33645. config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
  33646. }
  33647. );
  33648. // Pick the first defined of two or three arguments.
  33649. function defaults(a, b, c) {
  33650. if (a != null) {
  33651. return a;
  33652. }
  33653. if (b != null) {
  33654. return b;
  33655. }
  33656. return c;
  33657. }
  33658. function currentDateArray(config) {
  33659. // hooks is actually the exported moment object
  33660. var nowValue = new Date(hooks.now());
  33661. if (config._useUTC) {
  33662. return [
  33663. nowValue.getUTCFullYear(),
  33664. nowValue.getUTCMonth(),
  33665. nowValue.getUTCDate(),
  33666. ];
  33667. }
  33668. return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
  33669. }
  33670. // convert an array to a date.
  33671. // the array should mirror the parameters below
  33672. // note: all values past the year are optional and will default to the lowest possible value.
  33673. // [year, month, day , hour, minute, second, millisecond]
  33674. function configFromArray(config) {
  33675. var i,
  33676. date,
  33677. input = [],
  33678. currentDate,
  33679. expectedWeekday,
  33680. yearToUse;
  33681. if (config._d) {
  33682. return;
  33683. }
  33684. currentDate = currentDateArray(config);
  33685. //compute day of the year from weeks and weekdays
  33686. if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
  33687. dayOfYearFromWeekInfo(config);
  33688. }
  33689. //if the day of the year is set, figure out what it is
  33690. if (config._dayOfYear != null) {
  33691. yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
  33692. if (
  33693. config._dayOfYear > daysInYear(yearToUse) ||
  33694. config._dayOfYear === 0
  33695. ) {
  33696. getParsingFlags(config)._overflowDayOfYear = true;
  33697. }
  33698. date = createUTCDate(yearToUse, 0, config._dayOfYear);
  33699. config._a[MONTH] = date.getUTCMonth();
  33700. config._a[DATE] = date.getUTCDate();
  33701. }
  33702. // Default to current date.
  33703. // * if no year, month, day of month are given, default to today
  33704. // * if day of month is given, default month and year
  33705. // * if month is given, default only year
  33706. // * if year is given, don't default anything
  33707. for (i = 0; i < 3 && config._a[i] == null; ++i) {
  33708. config._a[i] = input[i] = currentDate[i];
  33709. }
  33710. // Zero out whatever was not defaulted, including time
  33711. for (; i < 7; i++) {
  33712. config._a[i] = input[i] =
  33713. config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i];
  33714. }
  33715. // Check for 24:00:00.000
  33716. if (
  33717. config._a[HOUR] === 24 &&
  33718. config._a[MINUTE] === 0 &&
  33719. config._a[SECOND] === 0 &&
  33720. config._a[MILLISECOND] === 0
  33721. ) {
  33722. config._nextDay = true;
  33723. config._a[HOUR] = 0;
  33724. }
  33725. config._d = (config._useUTC ? createUTCDate : createDate).apply(
  33726. null,
  33727. input
  33728. );
  33729. expectedWeekday = config._useUTC
  33730. ? config._d.getUTCDay()
  33731. : config._d.getDay();
  33732. // Apply timezone offset from input. The actual utcOffset can be changed
  33733. // with parseZone.
  33734. if (config._tzm != null) {
  33735. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  33736. }
  33737. if (config._nextDay) {
  33738. config._a[HOUR] = 24;
  33739. }
  33740. // check for mismatching day of week
  33741. if (
  33742. config._w &&
  33743. typeof config._w.d !== 'undefined' &&
  33744. config._w.d !== expectedWeekday
  33745. ) {
  33746. getParsingFlags(config).weekdayMismatch = true;
  33747. }
  33748. }
  33749. function dayOfYearFromWeekInfo(config) {
  33750. var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
  33751. w = config._w;
  33752. if (w.GG != null || w.W != null || w.E != null) {
  33753. dow = 1;
  33754. doy = 4;
  33755. // TODO: We need to take the current isoWeekYear, but that depends on
  33756. // how we interpret now (local, utc, fixed offset). So create
  33757. // a now version of current config (take local/utc/offset flags, and
  33758. // create now).
  33759. weekYear = defaults(
  33760. w.GG,
  33761. config._a[YEAR],
  33762. weekOfYear(createLocal(), 1, 4).year
  33763. );
  33764. week = defaults(w.W, 1);
  33765. weekday = defaults(w.E, 1);
  33766. if (weekday < 1 || weekday > 7) {
  33767. weekdayOverflow = true;
  33768. }
  33769. } else {
  33770. dow = config._locale._week.dow;
  33771. doy = config._locale._week.doy;
  33772. curWeek = weekOfYear(createLocal(), dow, doy);
  33773. weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
  33774. // Default to current week.
  33775. week = defaults(w.w, curWeek.week);
  33776. if (w.d != null) {
  33777. // weekday -- low day numbers are considered next week
  33778. weekday = w.d;
  33779. if (weekday < 0 || weekday > 6) {
  33780. weekdayOverflow = true;
  33781. }
  33782. } else if (w.e != null) {
  33783. // local weekday -- counting starts from beginning of week
  33784. weekday = w.e + dow;
  33785. if (w.e < 0 || w.e > 6) {
  33786. weekdayOverflow = true;
  33787. }
  33788. } else {
  33789. // default to beginning of week
  33790. weekday = dow;
  33791. }
  33792. }
  33793. if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
  33794. getParsingFlags(config)._overflowWeeks = true;
  33795. } else if (weekdayOverflow != null) {
  33796. getParsingFlags(config)._overflowWeekday = true;
  33797. } else {
  33798. temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
  33799. config._a[YEAR] = temp.year;
  33800. config._dayOfYear = temp.dayOfYear;
  33801. }
  33802. }
  33803. // constant that refers to the ISO standard
  33804. hooks.ISO_8601 = function () {};
  33805. // constant that refers to the RFC 2822 form
  33806. hooks.RFC_2822 = function () {};
  33807. // date from string and format string
  33808. function configFromStringAndFormat(config) {
  33809. // TODO: Move this to another part of the creation flow to prevent circular deps
  33810. if (config._f === hooks.ISO_8601) {
  33811. configFromISO(config);
  33812. return;
  33813. }
  33814. if (config._f === hooks.RFC_2822) {
  33815. configFromRFC2822(config);
  33816. return;
  33817. }
  33818. config._a = [];
  33819. getParsingFlags(config).empty = true;
  33820. // This array is used to make a Date, either with `new Date` or `Date.UTC`
  33821. var string = '' + config._i,
  33822. i,
  33823. parsedInput,
  33824. tokens,
  33825. token,
  33826. skipped,
  33827. stringLength = string.length,
  33828. totalParsedInputLength = 0,
  33829. era;
  33830. tokens =
  33831. expandFormat(config._f, config._locale).match(formattingTokens) || [];
  33832. for (i = 0; i < tokens.length; i++) {
  33833. token = tokens[i];
  33834. parsedInput = (string.match(getParseRegexForToken(token, config)) ||
  33835. [])[0];
  33836. if (parsedInput) {
  33837. skipped = string.substr(0, string.indexOf(parsedInput));
  33838. if (skipped.length > 0) {
  33839. getParsingFlags(config).unusedInput.push(skipped);
  33840. }
  33841. string = string.slice(
  33842. string.indexOf(parsedInput) + parsedInput.length
  33843. );
  33844. totalParsedInputLength += parsedInput.length;
  33845. }
  33846. // don't parse if it's not a known token
  33847. if (formatTokenFunctions[token]) {
  33848. if (parsedInput) {
  33849. getParsingFlags(config).empty = false;
  33850. } else {
  33851. getParsingFlags(config).unusedTokens.push(token);
  33852. }
  33853. addTimeToArrayFromToken(token, parsedInput, config);
  33854. } else if (config._strict && !parsedInput) {
  33855. getParsingFlags(config).unusedTokens.push(token);
  33856. }
  33857. }
  33858. // add remaining unparsed input length to the string
  33859. getParsingFlags(config).charsLeftOver =
  33860. stringLength - totalParsedInputLength;
  33861. if (string.length > 0) {
  33862. getParsingFlags(config).unusedInput.push(string);
  33863. }
  33864. // clear _12h flag if hour is <= 12
  33865. if (
  33866. config._a[HOUR] <= 12 &&
  33867. getParsingFlags(config).bigHour === true &&
  33868. config._a[HOUR] > 0
  33869. ) {
  33870. getParsingFlags(config).bigHour = undefined;
  33871. }
  33872. getParsingFlags(config).parsedDateParts = config._a.slice(0);
  33873. getParsingFlags(config).meridiem = config._meridiem;
  33874. // handle meridiem
  33875. config._a[HOUR] = meridiemFixWrap(
  33876. config._locale,
  33877. config._a[HOUR],
  33878. config._meridiem
  33879. );
  33880. // handle era
  33881. era = getParsingFlags(config).era;
  33882. if (era !== null) {
  33883. config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);
  33884. }
  33885. configFromArray(config);
  33886. checkOverflow(config);
  33887. }
  33888. function meridiemFixWrap(locale, hour, meridiem) {
  33889. var isPm;
  33890. if (meridiem == null) {
  33891. // nothing to do
  33892. return hour;
  33893. }
  33894. if (locale.meridiemHour != null) {
  33895. return locale.meridiemHour(hour, meridiem);
  33896. } else if (locale.isPM != null) {
  33897. // Fallback
  33898. isPm = locale.isPM(meridiem);
  33899. if (isPm && hour < 12) {
  33900. hour += 12;
  33901. }
  33902. if (!isPm && hour === 12) {
  33903. hour = 0;
  33904. }
  33905. return hour;
  33906. } else {
  33907. // this is not supposed to happen
  33908. return hour;
  33909. }
  33910. }
  33911. // date from string and array of format strings
  33912. function configFromStringAndArray(config) {
  33913. var tempConfig,
  33914. bestMoment,
  33915. scoreToBeat,
  33916. i,
  33917. currentScore,
  33918. validFormatFound,
  33919. bestFormatIsValid = false;
  33920. if (config._f.length === 0) {
  33921. getParsingFlags(config).invalidFormat = true;
  33922. config._d = new Date(NaN);
  33923. return;
  33924. }
  33925. for (i = 0; i < config._f.length; i++) {
  33926. currentScore = 0;
  33927. validFormatFound = false;
  33928. tempConfig = copyConfig({}, config);
  33929. if (config._useUTC != null) {
  33930. tempConfig._useUTC = config._useUTC;
  33931. }
  33932. tempConfig._f = config._f[i];
  33933. configFromStringAndFormat(tempConfig);
  33934. if (isValid(tempConfig)) {
  33935. validFormatFound = true;
  33936. }
  33937. // if there is any input that was not parsed add a penalty for that format
  33938. currentScore += getParsingFlags(tempConfig).charsLeftOver;
  33939. //or tokens
  33940. currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
  33941. getParsingFlags(tempConfig).score = currentScore;
  33942. if (!bestFormatIsValid) {
  33943. if (
  33944. scoreToBeat == null ||
  33945. currentScore < scoreToBeat ||
  33946. validFormatFound
  33947. ) {
  33948. scoreToBeat = currentScore;
  33949. bestMoment = tempConfig;
  33950. if (validFormatFound) {
  33951. bestFormatIsValid = true;
  33952. }
  33953. }
  33954. } else {
  33955. if (currentScore < scoreToBeat) {
  33956. scoreToBeat = currentScore;
  33957. bestMoment = tempConfig;
  33958. }
  33959. }
  33960. }
  33961. extend(config, bestMoment || tempConfig);
  33962. }
  33963. function configFromObject(config) {
  33964. if (config._d) {
  33965. return;
  33966. }
  33967. var i = normalizeObjectUnits(config._i),
  33968. dayOrDate = i.day === undefined ? i.date : i.day;
  33969. config._a = map(
  33970. [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],
  33971. function (obj) {
  33972. return obj && parseInt(obj, 10);
  33973. }
  33974. );
  33975. configFromArray(config);
  33976. }
  33977. function createFromConfig(config) {
  33978. var res = new Moment(checkOverflow(prepareConfig(config)));
  33979. if (res._nextDay) {
  33980. // Adding is smart enough around DST
  33981. res.add(1, 'd');
  33982. res._nextDay = undefined;
  33983. }
  33984. return res;
  33985. }
  33986. function prepareConfig(config) {
  33987. var input = config._i,
  33988. format = config._f;
  33989. config._locale = config._locale || getLocale(config._l);
  33990. if (input === null || (format === undefined && input === '')) {
  33991. return createInvalid({ nullInput: true });
  33992. }
  33993. if (typeof input === 'string') {
  33994. config._i = input = config._locale.preparse(input);
  33995. }
  33996. if (isMoment(input)) {
  33997. return new Moment(checkOverflow(input));
  33998. } else if (isDate(input)) {
  33999. config._d = input;
  34000. } else if (isArray(format)) {
  34001. configFromStringAndArray(config);
  34002. } else if (format) {
  34003. configFromStringAndFormat(config);
  34004. } else {
  34005. configFromInput(config);
  34006. }
  34007. if (!isValid(config)) {
  34008. config._d = null;
  34009. }
  34010. return config;
  34011. }
  34012. function configFromInput(config) {
  34013. var input = config._i;
  34014. if (isUndefined(input)) {
  34015. config._d = new Date(hooks.now());
  34016. } else if (isDate(input)) {
  34017. config._d = new Date(input.valueOf());
  34018. } else if (typeof input === 'string') {
  34019. configFromString(config);
  34020. } else if (isArray(input)) {
  34021. config._a = map(input.slice(0), function (obj) {
  34022. return parseInt(obj, 10);
  34023. });
  34024. configFromArray(config);
  34025. } else if (isObject(input)) {
  34026. configFromObject(config);
  34027. } else if (isNumber(input)) {
  34028. // from milliseconds
  34029. config._d = new Date(input);
  34030. } else {
  34031. hooks.createFromInputFallback(config);
  34032. }
  34033. }
  34034. function createLocalOrUTC(input, format, locale, strict, isUTC) {
  34035. var c = {};
  34036. if (format === true || format === false) {
  34037. strict = format;
  34038. format = undefined;
  34039. }
  34040. if (locale === true || locale === false) {
  34041. strict = locale;
  34042. locale = undefined;
  34043. }
  34044. if (
  34045. (isObject(input) && isObjectEmpty(input)) ||
  34046. (isArray(input) && input.length === 0)
  34047. ) {
  34048. input = undefined;
  34049. }
  34050. // object construction must be done this way.
  34051. // https://github.com/moment/moment/issues/1423
  34052. c._isAMomentObject = true;
  34053. c._useUTC = c._isUTC = isUTC;
  34054. c._l = locale;
  34055. c._i = input;
  34056. c._f = format;
  34057. c._strict = strict;
  34058. return createFromConfig(c);
  34059. }
  34060. function createLocal(input, format, locale, strict) {
  34061. return createLocalOrUTC(input, format, locale, strict, false);
  34062. }
  34063. var prototypeMin = deprecate(
  34064. 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
  34065. function () {
  34066. var other = createLocal.apply(null, arguments);
  34067. if (this.isValid() && other.isValid()) {
  34068. return other < this ? this : other;
  34069. } else {
  34070. return createInvalid();
  34071. }
  34072. }
  34073. ),
  34074. prototypeMax = deprecate(
  34075. 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
  34076. function () {
  34077. var other = createLocal.apply(null, arguments);
  34078. if (this.isValid() && other.isValid()) {
  34079. return other > this ? this : other;
  34080. } else {
  34081. return createInvalid();
  34082. }
  34083. }
  34084. );
  34085. // Pick a moment m from moments so that m[fn](other) is true for all
  34086. // other. This relies on the function fn to be transitive.
  34087. //
  34088. // moments should either be an array of moment objects or an array, whose
  34089. // first element is an array of moment objects.
  34090. function pickBy(fn, moments) {
  34091. var res, i;
  34092. if (moments.length === 1 && isArray(moments[0])) {
  34093. moments = moments[0];
  34094. }
  34095. if (!moments.length) {
  34096. return createLocal();
  34097. }
  34098. res = moments[0];
  34099. for (i = 1; i < moments.length; ++i) {
  34100. if (!moments[i].isValid() || moments[i][fn](res)) {
  34101. res = moments[i];
  34102. }
  34103. }
  34104. return res;
  34105. }
  34106. // TODO: Use [].sort instead?
  34107. function min() {
  34108. var args = [].slice.call(arguments, 0);
  34109. return pickBy('isBefore', args);
  34110. }
  34111. function max() {
  34112. var args = [].slice.call(arguments, 0);
  34113. return pickBy('isAfter', args);
  34114. }
  34115. var now = function () {
  34116. return Date.now ? Date.now() : +new Date();
  34117. };
  34118. var ordering = [
  34119. 'year',
  34120. 'quarter',
  34121. 'month',
  34122. 'week',
  34123. 'day',
  34124. 'hour',
  34125. 'minute',
  34126. 'second',
  34127. 'millisecond',
  34128. ];
  34129. function isDurationValid(m) {
  34130. var key,
  34131. unitHasDecimal = false,
  34132. i;
  34133. for (key in m) {
  34134. if (
  34135. hasOwnProp(m, key) &&
  34136. !(
  34137. indexOf.call(ordering, key) !== -1 &&
  34138. (m[key] == null || !isNaN(m[key]))
  34139. )
  34140. ) {
  34141. return false;
  34142. }
  34143. }
  34144. for (i = 0; i < ordering.length; ++i) {
  34145. if (m[ordering[i]]) {
  34146. if (unitHasDecimal) {
  34147. return false; // only allow non-integers for smallest unit
  34148. }
  34149. if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
  34150. unitHasDecimal = true;
  34151. }
  34152. }
  34153. }
  34154. return true;
  34155. }
  34156. function isValid$1() {
  34157. return this._isValid;
  34158. }
  34159. function createInvalid$1() {
  34160. return createDuration(NaN);
  34161. }
  34162. function Duration(duration) {
  34163. var normalizedInput = normalizeObjectUnits(duration),
  34164. years = normalizedInput.year || 0,
  34165. quarters = normalizedInput.quarter || 0,
  34166. months = normalizedInput.month || 0,
  34167. weeks = normalizedInput.week || normalizedInput.isoWeek || 0,
  34168. days = normalizedInput.day || 0,
  34169. hours = normalizedInput.hour || 0,
  34170. minutes = normalizedInput.minute || 0,
  34171. seconds = normalizedInput.second || 0,
  34172. milliseconds = normalizedInput.millisecond || 0;
  34173. this._isValid = isDurationValid(normalizedInput);
  34174. // representation for dateAddRemove
  34175. this._milliseconds =
  34176. +milliseconds +
  34177. seconds * 1e3 + // 1000
  34178. minutes * 6e4 + // 1000 * 60
  34179. hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
  34180. // Because of dateAddRemove treats 24 hours as different from a
  34181. // day when working around DST, we need to store them separately
  34182. this._days = +days + weeks * 7;
  34183. // It is impossible to translate months into days without knowing
  34184. // which months you are are talking about, so we have to store
  34185. // it separately.
  34186. this._months = +months + quarters * 3 + years * 12;
  34187. this._data = {};
  34188. this._locale = getLocale();
  34189. this._bubble();
  34190. }
  34191. function isDuration(obj) {
  34192. return obj instanceof Duration;
  34193. }
  34194. function absRound(number) {
  34195. if (number < 0) {
  34196. return Math.round(-1 * number) * -1;
  34197. } else {
  34198. return Math.round(number);
  34199. }
  34200. }
  34201. // compare two arrays, return the number of differences
  34202. function compareArrays(array1, array2, dontConvert) {
  34203. var len = Math.min(array1.length, array2.length),
  34204. lengthDiff = Math.abs(array1.length - array2.length),
  34205. diffs = 0,
  34206. i;
  34207. for (i = 0; i < len; i++) {
  34208. if (
  34209. (dontConvert && array1[i] !== array2[i]) ||
  34210. (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))
  34211. ) {
  34212. diffs++;
  34213. }
  34214. }
  34215. return diffs + lengthDiff;
  34216. }
  34217. // FORMATTING
  34218. function offset(token, separator) {
  34219. addFormatToken(token, 0, 0, function () {
  34220. var offset = this.utcOffset(),
  34221. sign = '+';
  34222. if (offset < 0) {
  34223. offset = -offset;
  34224. sign = '-';
  34225. }
  34226. return (
  34227. sign +
  34228. zeroFill(~~(offset / 60), 2) +
  34229. separator +
  34230. zeroFill(~~offset % 60, 2)
  34231. );
  34232. });
  34233. }
  34234. offset('Z', ':');
  34235. offset('ZZ', '');
  34236. // PARSING
  34237. addRegexToken('Z', matchShortOffset);
  34238. addRegexToken('ZZ', matchShortOffset);
  34239. addParseToken(['Z', 'ZZ'], function (input, array, config) {
  34240. config._useUTC = true;
  34241. config._tzm = offsetFromString(matchShortOffset, input);
  34242. });
  34243. // HELPERS
  34244. // timezone chunker
  34245. // '+10:00' > ['10', '00']
  34246. // '-1530' > ['-15', '30']
  34247. var chunkOffset = /([\+\-]|\d\d)/gi;
  34248. function offsetFromString(matcher, string) {
  34249. var matches = (string || '').match(matcher),
  34250. chunk,
  34251. parts,
  34252. minutes;
  34253. if (matches === null) {
  34254. return null;
  34255. }
  34256. chunk = matches[matches.length - 1] || [];
  34257. parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
  34258. minutes = +(parts[1] * 60) + toInt(parts[2]);
  34259. return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;
  34260. }
  34261. // Return a moment from input, that is local/utc/zone equivalent to model.
  34262. function cloneWithOffset(input, model) {
  34263. var res, diff;
  34264. if (model._isUTC) {
  34265. res = model.clone();
  34266. diff =
  34267. (isMoment(input) || isDate(input)
  34268. ? input.valueOf()
  34269. : createLocal(input).valueOf()) - res.valueOf();
  34270. // Use low-level api, because this fn is low-level api.
  34271. res._d.setTime(res._d.valueOf() + diff);
  34272. hooks.updateOffset(res, false);
  34273. return res;
  34274. } else {
  34275. return createLocal(input).local();
  34276. }
  34277. }
  34278. function getDateOffset(m) {
  34279. // On Firefox.24 Date#getTimezoneOffset returns a floating point.
  34280. // https://github.com/moment/moment/pull/1871
  34281. return -Math.round(m._d.getTimezoneOffset());
  34282. }
  34283. // HOOKS
  34284. // This function will be called whenever a moment is mutated.
  34285. // It is intended to keep the offset in sync with the timezone.
  34286. hooks.updateOffset = function () {};
  34287. // MOMENTS
  34288. // keepLocalTime = true means only change the timezone, without
  34289. // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
  34290. // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
  34291. // +0200, so we adjust the time as needed, to be valid.
  34292. //
  34293. // Keeping the time actually adds/subtracts (one hour)
  34294. // from the actual represented time. That is why we call updateOffset
  34295. // a second time. In case it wants us to change the offset again
  34296. // _changeInProgress == true case, then we have to adjust, because
  34297. // there is no such time in the given timezone.
  34298. function getSetOffset(input, keepLocalTime, keepMinutes) {
  34299. var offset = this._offset || 0,
  34300. localAdjust;
  34301. if (!this.isValid()) {
  34302. return input != null ? this : NaN;
  34303. }
  34304. if (input != null) {
  34305. if (typeof input === 'string') {
  34306. input = offsetFromString(matchShortOffset, input);
  34307. if (input === null) {
  34308. return this;
  34309. }
  34310. } else if (Math.abs(input) < 16 && !keepMinutes) {
  34311. input = input * 60;
  34312. }
  34313. if (!this._isUTC && keepLocalTime) {
  34314. localAdjust = getDateOffset(this);
  34315. }
  34316. this._offset = input;
  34317. this._isUTC = true;
  34318. if (localAdjust != null) {
  34319. this.add(localAdjust, 'm');
  34320. }
  34321. if (offset !== input) {
  34322. if (!keepLocalTime || this._changeInProgress) {
  34323. addSubtract(
  34324. this,
  34325. createDuration(input - offset, 'm'),
  34326. 1,
  34327. false
  34328. );
  34329. } else if (!this._changeInProgress) {
  34330. this._changeInProgress = true;
  34331. hooks.updateOffset(this, true);
  34332. this._changeInProgress = null;
  34333. }
  34334. }
  34335. return this;
  34336. } else {
  34337. return this._isUTC ? offset : getDateOffset(this);
  34338. }
  34339. }
  34340. function getSetZone(input, keepLocalTime) {
  34341. if (input != null) {
  34342. if (typeof input !== 'string') {
  34343. input = -input;
  34344. }
  34345. this.utcOffset(input, keepLocalTime);
  34346. return this;
  34347. } else {
  34348. return -this.utcOffset();
  34349. }
  34350. }
  34351. function setOffsetToUTC(keepLocalTime) {
  34352. return this.utcOffset(0, keepLocalTime);
  34353. }
  34354. function setOffsetToLocal(keepLocalTime) {
  34355. if (this._isUTC) {
  34356. this.utcOffset(0, keepLocalTime);
  34357. this._isUTC = false;
  34358. if (keepLocalTime) {
  34359. this.subtract(getDateOffset(this), 'm');
  34360. }
  34361. }
  34362. return this;
  34363. }
  34364. function setOffsetToParsedOffset() {
  34365. if (this._tzm != null) {
  34366. this.utcOffset(this._tzm, false, true);
  34367. } else if (typeof this._i === 'string') {
  34368. var tZone = offsetFromString(matchOffset, this._i);
  34369. if (tZone != null) {
  34370. this.utcOffset(tZone);
  34371. } else {
  34372. this.utcOffset(0, true);
  34373. }
  34374. }
  34375. return this;
  34376. }
  34377. function hasAlignedHourOffset(input) {
  34378. if (!this.isValid()) {
  34379. return false;
  34380. }
  34381. input = input ? createLocal(input).utcOffset() : 0;
  34382. return (this.utcOffset() - input) % 60 === 0;
  34383. }
  34384. function isDaylightSavingTime() {
  34385. return (
  34386. this.utcOffset() > this.clone().month(0).utcOffset() ||
  34387. this.utcOffset() > this.clone().month(5).utcOffset()
  34388. );
  34389. }
  34390. function isDaylightSavingTimeShifted() {
  34391. if (!isUndefined(this._isDSTShifted)) {
  34392. return this._isDSTShifted;
  34393. }
  34394. var c = {},
  34395. other;
  34396. copyConfig(c, this);
  34397. c = prepareConfig(c);
  34398. if (c._a) {
  34399. other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
  34400. this._isDSTShifted =
  34401. this.isValid() && compareArrays(c._a, other.toArray()) > 0;
  34402. } else {
  34403. this._isDSTShifted = false;
  34404. }
  34405. return this._isDSTShifted;
  34406. }
  34407. function isLocal() {
  34408. return this.isValid() ? !this._isUTC : false;
  34409. }
  34410. function isUtcOffset() {
  34411. return this.isValid() ? this._isUTC : false;
  34412. }
  34413. function isUtc() {
  34414. return this.isValid() ? this._isUTC && this._offset === 0 : false;
  34415. }
  34416. // ASP.NET json date format regex
  34417. var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,
  34418. // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
  34419. // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
  34420. // and further modified to allow for strings containing both week and day
  34421. isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
  34422. function createDuration(input, key) {
  34423. var duration = input,
  34424. // matching against regexp is expensive, do it on demand
  34425. match = null,
  34426. sign,
  34427. ret,
  34428. diffRes;
  34429. if (isDuration(input)) {
  34430. duration = {
  34431. ms: input._milliseconds,
  34432. d: input._days,
  34433. M: input._months,
  34434. };
  34435. } else if (isNumber(input) || !isNaN(+input)) {
  34436. duration = {};
  34437. if (key) {
  34438. duration[key] = +input;
  34439. } else {
  34440. duration.milliseconds = +input;
  34441. }
  34442. } else if ((match = aspNetRegex.exec(input))) {
  34443. sign = match[1] === '-' ? -1 : 1;
  34444. duration = {
  34445. y: 0,
  34446. d: toInt(match[DATE]) * sign,
  34447. h: toInt(match[HOUR]) * sign,
  34448. m: toInt(match[MINUTE]) * sign,
  34449. s: toInt(match[SECOND]) * sign,
  34450. ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match
  34451. };
  34452. } else if ((match = isoRegex.exec(input))) {
  34453. sign = match[1] === '-' ? -1 : 1;
  34454. duration = {
  34455. y: parseIso(match[2], sign),
  34456. M: parseIso(match[3], sign),
  34457. w: parseIso(match[4], sign),
  34458. d: parseIso(match[5], sign),
  34459. h: parseIso(match[6], sign),
  34460. m: parseIso(match[7], sign),
  34461. s: parseIso(match[8], sign),
  34462. };
  34463. } else if (duration == null) {
  34464. // checks for null or undefined
  34465. duration = {};
  34466. } else if (
  34467. typeof duration === 'object' &&
  34468. ('from' in duration || 'to' in duration)
  34469. ) {
  34470. diffRes = momentsDifference(
  34471. createLocal(duration.from),
  34472. createLocal(duration.to)
  34473. );
  34474. duration = {};
  34475. duration.ms = diffRes.milliseconds;
  34476. duration.M = diffRes.months;
  34477. }
  34478. ret = new Duration(duration);
  34479. if (isDuration(input) && hasOwnProp(input, '_locale')) {
  34480. ret._locale = input._locale;
  34481. }
  34482. if (isDuration(input) && hasOwnProp(input, '_isValid')) {
  34483. ret._isValid = input._isValid;
  34484. }
  34485. return ret;
  34486. }
  34487. createDuration.fn = Duration.prototype;
  34488. createDuration.invalid = createInvalid$1;
  34489. function parseIso(inp, sign) {
  34490. // We'd normally use ~~inp for this, but unfortunately it also
  34491. // converts floats to ints.
  34492. // inp may be undefined, so careful calling replace on it.
  34493. var res = inp && parseFloat(inp.replace(',', '.'));
  34494. // apply sign while we're at it
  34495. return (isNaN(res) ? 0 : res) * sign;
  34496. }
  34497. function positiveMomentsDifference(base, other) {
  34498. var res = {};
  34499. res.months =
  34500. other.month() - base.month() + (other.year() - base.year()) * 12;
  34501. if (base.clone().add(res.months, 'M').isAfter(other)) {
  34502. --res.months;
  34503. }
  34504. res.milliseconds = +other - +base.clone().add(res.months, 'M');
  34505. return res;
  34506. }
  34507. function momentsDifference(base, other) {
  34508. var res;
  34509. if (!(base.isValid() && other.isValid())) {
  34510. return { milliseconds: 0, months: 0 };
  34511. }
  34512. other = cloneWithOffset(other, base);
  34513. if (base.isBefore(other)) {
  34514. res = positiveMomentsDifference(base, other);
  34515. } else {
  34516. res = positiveMomentsDifference(other, base);
  34517. res.milliseconds = -res.milliseconds;
  34518. res.months = -res.months;
  34519. }
  34520. return res;
  34521. }
  34522. // TODO: remove 'name' arg after deprecation is removed
  34523. function createAdder(direction, name) {
  34524. return function (val, period) {
  34525. var dur, tmp;
  34526. //invert the arguments, but complain about it
  34527. if (period !== null && !isNaN(+period)) {
  34528. deprecateSimple(
  34529. name,
  34530. 'moment().' +
  34531. name +
  34532. '(period, number) is deprecated. Please use moment().' +
  34533. name +
  34534. '(number, period). ' +
  34535. 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'
  34536. );
  34537. tmp = val;
  34538. val = period;
  34539. period = tmp;
  34540. }
  34541. dur = createDuration(val, period);
  34542. addSubtract(this, dur, direction);
  34543. return this;
  34544. };
  34545. }
  34546. function addSubtract(mom, duration, isAdding, updateOffset) {
  34547. var milliseconds = duration._milliseconds,
  34548. days = absRound(duration._days),
  34549. months = absRound(duration._months);
  34550. if (!mom.isValid()) {
  34551. // No op
  34552. return;
  34553. }
  34554. updateOffset = updateOffset == null ? true : updateOffset;
  34555. if (months) {
  34556. setMonth(mom, get(mom, 'Month') + months * isAdding);
  34557. }
  34558. if (days) {
  34559. set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
  34560. }
  34561. if (milliseconds) {
  34562. mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
  34563. }
  34564. if (updateOffset) {
  34565. hooks.updateOffset(mom, days || months);
  34566. }
  34567. }
  34568. var add = createAdder(1, 'add'),
  34569. subtract = createAdder(-1, 'subtract');
  34570. function isString(input) {
  34571. return typeof input === 'string' || input instanceof String;
  34572. }
  34573. // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined
  34574. function isMomentInput(input) {
  34575. return (
  34576. isMoment(input) ||
  34577. isDate(input) ||
  34578. isString(input) ||
  34579. isNumber(input) ||
  34580. isNumberOrStringArray(input) ||
  34581. isMomentInputObject(input) ||
  34582. input === null ||
  34583. input === undefined
  34584. );
  34585. }
  34586. function isMomentInputObject(input) {
  34587. var objectTest = isObject(input) && !isObjectEmpty(input),
  34588. propertyTest = false,
  34589. properties = [
  34590. 'years',
  34591. 'year',
  34592. 'y',
  34593. 'months',
  34594. 'month',
  34595. 'M',
  34596. 'days',
  34597. 'day',
  34598. 'd',
  34599. 'dates',
  34600. 'date',
  34601. 'D',
  34602. 'hours',
  34603. 'hour',
  34604. 'h',
  34605. 'minutes',
  34606. 'minute',
  34607. 'm',
  34608. 'seconds',
  34609. 'second',
  34610. 's',
  34611. 'milliseconds',
  34612. 'millisecond',
  34613. 'ms',
  34614. ],
  34615. i,
  34616. property;
  34617. for (i = 0; i < properties.length; i += 1) {
  34618. property = properties[i];
  34619. propertyTest = propertyTest || hasOwnProp(input, property);
  34620. }
  34621. return objectTest && propertyTest;
  34622. }
  34623. function isNumberOrStringArray(input) {
  34624. var arrayTest = isArray(input),
  34625. dataTypeTest = false;
  34626. if (arrayTest) {
  34627. dataTypeTest =
  34628. input.filter(function (item) {
  34629. return !isNumber(item) && isString(input);
  34630. }).length === 0;
  34631. }
  34632. return arrayTest && dataTypeTest;
  34633. }
  34634. function isCalendarSpec(input) {
  34635. var objectTest = isObject(input) && !isObjectEmpty(input),
  34636. propertyTest = false,
  34637. properties = [
  34638. 'sameDay',
  34639. 'nextDay',
  34640. 'lastDay',
  34641. 'nextWeek',
  34642. 'lastWeek',
  34643. 'sameElse',
  34644. ],
  34645. i,
  34646. property;
  34647. for (i = 0; i < properties.length; i += 1) {
  34648. property = properties[i];
  34649. propertyTest = propertyTest || hasOwnProp(input, property);
  34650. }
  34651. return objectTest && propertyTest;
  34652. }
  34653. function getCalendarFormat(myMoment, now) {
  34654. var diff = myMoment.diff(now, 'days', true);
  34655. return diff < -6
  34656. ? 'sameElse'
  34657. : diff < -1
  34658. ? 'lastWeek'
  34659. : diff < 0
  34660. ? 'lastDay'
  34661. : diff < 1
  34662. ? 'sameDay'
  34663. : diff < 2
  34664. ? 'nextDay'
  34665. : diff < 7
  34666. ? 'nextWeek'
  34667. : 'sameElse';
  34668. }
  34669. function calendar$1(time, formats) {
  34670. // Support for single parameter, formats only overload to the calendar function
  34671. if (arguments.length === 1) {
  34672. if (!arguments[0]) {
  34673. time = undefined;
  34674. formats = undefined;
  34675. } else if (isMomentInput(arguments[0])) {
  34676. time = arguments[0];
  34677. formats = undefined;
  34678. } else if (isCalendarSpec(arguments[0])) {
  34679. formats = arguments[0];
  34680. time = undefined;
  34681. }
  34682. }
  34683. // We want to compare the start of today, vs this.
  34684. // Getting start-of-today depends on whether we're local/utc/offset or not.
  34685. var now = time || createLocal(),
  34686. sod = cloneWithOffset(now, this).startOf('day'),
  34687. format = hooks.calendarFormat(this, sod) || 'sameElse',
  34688. output =
  34689. formats &&
  34690. (isFunction(formats[format])
  34691. ? formats[format].call(this, now)
  34692. : formats[format]);
  34693. return this.format(
  34694. output || this.localeData().calendar(format, this, createLocal(now))
  34695. );
  34696. }
  34697. function clone() {
  34698. return new Moment(this);
  34699. }
  34700. function isAfter(input, units) {
  34701. var localInput = isMoment(input) ? input : createLocal(input);
  34702. if (!(this.isValid() && localInput.isValid())) {
  34703. return false;
  34704. }
  34705. units = normalizeUnits(units) || 'millisecond';
  34706. if (units === 'millisecond') {
  34707. return this.valueOf() > localInput.valueOf();
  34708. } else {
  34709. return localInput.valueOf() < this.clone().startOf(units).valueOf();
  34710. }
  34711. }
  34712. function isBefore(input, units) {
  34713. var localInput = isMoment(input) ? input : createLocal(input);
  34714. if (!(this.isValid() && localInput.isValid())) {
  34715. return false;
  34716. }
  34717. units = normalizeUnits(units) || 'millisecond';
  34718. if (units === 'millisecond') {
  34719. return this.valueOf() < localInput.valueOf();
  34720. } else {
  34721. return this.clone().endOf(units).valueOf() < localInput.valueOf();
  34722. }
  34723. }
  34724. function isBetween(from, to, units, inclusivity) {
  34725. var localFrom = isMoment(from) ? from : createLocal(from),
  34726. localTo = isMoment(to) ? to : createLocal(to);
  34727. if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
  34728. return false;
  34729. }
  34730. inclusivity = inclusivity || '()';
  34731. return (
  34732. (inclusivity[0] === '('
  34733. ? this.isAfter(localFrom, units)
  34734. : !this.isBefore(localFrom, units)) &&
  34735. (inclusivity[1] === ')'
  34736. ? this.isBefore(localTo, units)
  34737. : !this.isAfter(localTo, units))
  34738. );
  34739. }
  34740. function isSame(input, units) {
  34741. var localInput = isMoment(input) ? input : createLocal(input),
  34742. inputMs;
  34743. if (!(this.isValid() && localInput.isValid())) {
  34744. return false;
  34745. }
  34746. units = normalizeUnits(units) || 'millisecond';
  34747. if (units === 'millisecond') {
  34748. return this.valueOf() === localInput.valueOf();
  34749. } else {
  34750. inputMs = localInput.valueOf();
  34751. return (
  34752. this.clone().startOf(units).valueOf() <= inputMs &&
  34753. inputMs <= this.clone().endOf(units).valueOf()
  34754. );
  34755. }
  34756. }
  34757. function isSameOrAfter(input, units) {
  34758. return this.isSame(input, units) || this.isAfter(input, units);
  34759. }
  34760. function isSameOrBefore(input, units) {
  34761. return this.isSame(input, units) || this.isBefore(input, units);
  34762. }
  34763. function diff(input, units, asFloat) {
  34764. var that, zoneDelta, output;
  34765. if (!this.isValid()) {
  34766. return NaN;
  34767. }
  34768. that = cloneWithOffset(input, this);
  34769. if (!that.isValid()) {
  34770. return NaN;
  34771. }
  34772. zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
  34773. units = normalizeUnits(units);
  34774. switch (units) {
  34775. case 'year':
  34776. output = monthDiff(this, that) / 12;
  34777. break;
  34778. case 'month':
  34779. output = monthDiff(this, that);
  34780. break;
  34781. case 'quarter':
  34782. output = monthDiff(this, that) / 3;
  34783. break;
  34784. case 'second':
  34785. output = (this - that) / 1e3;
  34786. break; // 1000
  34787. case 'minute':
  34788. output = (this - that) / 6e4;
  34789. break; // 1000 * 60
  34790. case 'hour':
  34791. output = (this - that) / 36e5;
  34792. break; // 1000 * 60 * 60
  34793. case 'day':
  34794. output = (this - that - zoneDelta) / 864e5;
  34795. break; // 1000 * 60 * 60 * 24, negate dst
  34796. case 'week':
  34797. output = (this - that - zoneDelta) / 6048e5;
  34798. break; // 1000 * 60 * 60 * 24 * 7, negate dst
  34799. default:
  34800. output = this - that;
  34801. }
  34802. return asFloat ? output : absFloor(output);
  34803. }
  34804. function monthDiff(a, b) {
  34805. if (a.date() < b.date()) {
  34806. // end-of-month calculations work correct when the start month has more
  34807. // days than the end month.
  34808. return -monthDiff(b, a);
  34809. }
  34810. // difference in months
  34811. var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),
  34812. // b is in (anchor - 1 month, anchor + 1 month)
  34813. anchor = a.clone().add(wholeMonthDiff, 'months'),
  34814. anchor2,
  34815. adjust;
  34816. if (b - anchor < 0) {
  34817. anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
  34818. // linear across the month
  34819. adjust = (b - anchor) / (anchor - anchor2);
  34820. } else {
  34821. anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
  34822. // linear across the month
  34823. adjust = (b - anchor) / (anchor2 - anchor);
  34824. }
  34825. //check for negative zero, return zero if negative zero
  34826. return -(wholeMonthDiff + adjust) || 0;
  34827. }
  34828. hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
  34829. hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
  34830. function toString() {
  34831. return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
  34832. }
  34833. function toISOString(keepOffset) {
  34834. if (!this.isValid()) {
  34835. return null;
  34836. }
  34837. var utc = keepOffset !== true,
  34838. m = utc ? this.clone().utc() : this;
  34839. if (m.year() < 0 || m.year() > 9999) {
  34840. return formatMoment(
  34841. m,
  34842. utc
  34843. ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'
  34844. : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'
  34845. );
  34846. }
  34847. if (isFunction(Date.prototype.toISOString)) {
  34848. // native implementation is ~50x faster, use it when we can
  34849. if (utc) {
  34850. return this.toDate().toISOString();
  34851. } else {
  34852. return new Date(this.valueOf() + this.utcOffset() * 60 * 1000)
  34853. .toISOString()
  34854. .replace('Z', formatMoment(m, 'Z'));
  34855. }
  34856. }
  34857. return formatMoment(
  34858. m,
  34859. utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'
  34860. );
  34861. }
  34862. /**
  34863. * Return a human readable representation of a moment that can
  34864. * also be evaluated to get a new moment which is the same
  34865. *
  34866. * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
  34867. */
  34868. function inspect() {
  34869. if (!this.isValid()) {
  34870. return 'moment.invalid(/* ' + this._i + ' */)';
  34871. }
  34872. var func = 'moment',
  34873. zone = '',
  34874. prefix,
  34875. year,
  34876. datetime,
  34877. suffix;
  34878. if (!this.isLocal()) {
  34879. func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
  34880. zone = 'Z';
  34881. }
  34882. prefix = '[' + func + '("]';
  34883. year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';
  34884. datetime = '-MM-DD[T]HH:mm:ss.SSS';
  34885. suffix = zone + '[")]';
  34886. return this.format(prefix + year + datetime + suffix);
  34887. }
  34888. function format(inputString) {
  34889. if (!inputString) {
  34890. inputString = this.isUtc()
  34891. ? hooks.defaultFormatUtc
  34892. : hooks.defaultFormat;
  34893. }
  34894. var output = formatMoment(this, inputString);
  34895. return this.localeData().postformat(output);
  34896. }
  34897. function from(time, withoutSuffix) {
  34898. if (
  34899. this.isValid() &&
  34900. ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
  34901. ) {
  34902. return createDuration({ to: this, from: time })
  34903. .locale(this.locale())
  34904. .humanize(!withoutSuffix);
  34905. } else {
  34906. return this.localeData().invalidDate();
  34907. }
  34908. }
  34909. function fromNow(withoutSuffix) {
  34910. return this.from(createLocal(), withoutSuffix);
  34911. }
  34912. function to(time, withoutSuffix) {
  34913. if (
  34914. this.isValid() &&
  34915. ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
  34916. ) {
  34917. return createDuration({ from: this, to: time })
  34918. .locale(this.locale())
  34919. .humanize(!withoutSuffix);
  34920. } else {
  34921. return this.localeData().invalidDate();
  34922. }
  34923. }
  34924. function toNow(withoutSuffix) {
  34925. return this.to(createLocal(), withoutSuffix);
  34926. }
  34927. // If passed a locale key, it will set the locale for this
  34928. // instance. Otherwise, it will return the locale configuration
  34929. // variables for this instance.
  34930. function locale(key) {
  34931. var newLocaleData;
  34932. if (key === undefined) {
  34933. return this._locale._abbr;
  34934. } else {
  34935. newLocaleData = getLocale(key);
  34936. if (newLocaleData != null) {
  34937. this._locale = newLocaleData;
  34938. }
  34939. return this;
  34940. }
  34941. }
  34942. var lang = deprecate(
  34943. 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
  34944. function (key) {
  34945. if (key === undefined) {
  34946. return this.localeData();
  34947. } else {
  34948. return this.locale(key);
  34949. }
  34950. }
  34951. );
  34952. function localeData() {
  34953. return this._locale;
  34954. }
  34955. var MS_PER_SECOND = 1000,
  34956. MS_PER_MINUTE = 60 * MS_PER_SECOND,
  34957. MS_PER_HOUR = 60 * MS_PER_MINUTE,
  34958. MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
  34959. // actual modulo - handles negative numbers (for dates before 1970):
  34960. function mod$1(dividend, divisor) {
  34961. return ((dividend % divisor) + divisor) % divisor;
  34962. }
  34963. function localStartOfDate(y, m, d) {
  34964. // the date constructor remaps years 0-99 to 1900-1999
  34965. if (y < 100 && y >= 0) {
  34966. // preserve leap years using a full 400 year cycle, then reset
  34967. return new Date(y + 400, m, d) - MS_PER_400_YEARS;
  34968. } else {
  34969. return new Date(y, m, d).valueOf();
  34970. }
  34971. }
  34972. function utcStartOfDate(y, m, d) {
  34973. // Date.UTC remaps years 0-99 to 1900-1999
  34974. if (y < 100 && y >= 0) {
  34975. // preserve leap years using a full 400 year cycle, then reset
  34976. return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
  34977. } else {
  34978. return Date.UTC(y, m, d);
  34979. }
  34980. }
  34981. function startOf(units) {
  34982. var time, startOfDate;
  34983. units = normalizeUnits(units);
  34984. if (units === undefined || units === 'millisecond' || !this.isValid()) {
  34985. return this;
  34986. }
  34987. startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
  34988. switch (units) {
  34989. case 'year':
  34990. time = startOfDate(this.year(), 0, 1);
  34991. break;
  34992. case 'quarter':
  34993. time = startOfDate(
  34994. this.year(),
  34995. this.month() - (this.month() % 3),
  34996. 1
  34997. );
  34998. break;
  34999. case 'month':
  35000. time = startOfDate(this.year(), this.month(), 1);
  35001. break;
  35002. case 'week':
  35003. time = startOfDate(
  35004. this.year(),
  35005. this.month(),
  35006. this.date() - this.weekday()
  35007. );
  35008. break;
  35009. case 'isoWeek':
  35010. time = startOfDate(
  35011. this.year(),
  35012. this.month(),
  35013. this.date() - (this.isoWeekday() - 1)
  35014. );
  35015. break;
  35016. case 'day':
  35017. case 'date':
  35018. time = startOfDate(this.year(), this.month(), this.date());
  35019. break;
  35020. case 'hour':
  35021. time = this._d.valueOf();
  35022. time -= mod$1(
  35023. time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
  35024. MS_PER_HOUR
  35025. );
  35026. break;
  35027. case 'minute':
  35028. time = this._d.valueOf();
  35029. time -= mod$1(time, MS_PER_MINUTE);
  35030. break;
  35031. case 'second':
  35032. time = this._d.valueOf();
  35033. time -= mod$1(time, MS_PER_SECOND);
  35034. break;
  35035. }
  35036. this._d.setTime(time);
  35037. hooks.updateOffset(this, true);
  35038. return this;
  35039. }
  35040. function endOf(units) {
  35041. var time, startOfDate;
  35042. units = normalizeUnits(units);
  35043. if (units === undefined || units === 'millisecond' || !this.isValid()) {
  35044. return this;
  35045. }
  35046. startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
  35047. switch (units) {
  35048. case 'year':
  35049. time = startOfDate(this.year() + 1, 0, 1) - 1;
  35050. break;
  35051. case 'quarter':
  35052. time =
  35053. startOfDate(
  35054. this.year(),
  35055. this.month() - (this.month() % 3) + 3,
  35056. 1
  35057. ) - 1;
  35058. break;
  35059. case 'month':
  35060. time = startOfDate(this.year(), this.month() + 1, 1) - 1;
  35061. break;
  35062. case 'week':
  35063. time =
  35064. startOfDate(
  35065. this.year(),
  35066. this.month(),
  35067. this.date() - this.weekday() + 7
  35068. ) - 1;
  35069. break;
  35070. case 'isoWeek':
  35071. time =
  35072. startOfDate(
  35073. this.year(),
  35074. this.month(),
  35075. this.date() - (this.isoWeekday() - 1) + 7
  35076. ) - 1;
  35077. break;
  35078. case 'day':
  35079. case 'date':
  35080. time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
  35081. break;
  35082. case 'hour':
  35083. time = this._d.valueOf();
  35084. time +=
  35085. MS_PER_HOUR -
  35086. mod$1(
  35087. time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
  35088. MS_PER_HOUR
  35089. ) -
  35090. 1;
  35091. break;
  35092. case 'minute':
  35093. time = this._d.valueOf();
  35094. time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
  35095. break;
  35096. case 'second':
  35097. time = this._d.valueOf();
  35098. time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
  35099. break;
  35100. }
  35101. this._d.setTime(time);
  35102. hooks.updateOffset(this, true);
  35103. return this;
  35104. }
  35105. function valueOf() {
  35106. return this._d.valueOf() - (this._offset || 0) * 60000;
  35107. }
  35108. function unix() {
  35109. return Math.floor(this.valueOf() / 1000);
  35110. }
  35111. function toDate() {
  35112. return new Date(this.valueOf());
  35113. }
  35114. function toArray() {
  35115. var m = this;
  35116. return [
  35117. m.year(),
  35118. m.month(),
  35119. m.date(),
  35120. m.hour(),
  35121. m.minute(),
  35122. m.second(),
  35123. m.millisecond(),
  35124. ];
  35125. }
  35126. function toObject() {
  35127. var m = this;
  35128. return {
  35129. years: m.year(),
  35130. months: m.month(),
  35131. date: m.date(),
  35132. hours: m.hours(),
  35133. minutes: m.minutes(),
  35134. seconds: m.seconds(),
  35135. milliseconds: m.milliseconds(),
  35136. };
  35137. }
  35138. function toJSON() {
  35139. // new Date(NaN).toJSON() === null
  35140. return this.isValid() ? this.toISOString() : null;
  35141. }
  35142. function isValid$2() {
  35143. return isValid(this);
  35144. }
  35145. function parsingFlags() {
  35146. return extend({}, getParsingFlags(this));
  35147. }
  35148. function invalidAt() {
  35149. return getParsingFlags(this).overflow;
  35150. }
  35151. function creationData() {
  35152. return {
  35153. input: this._i,
  35154. format: this._f,
  35155. locale: this._locale,
  35156. isUTC: this._isUTC,
  35157. strict: this._strict,
  35158. };
  35159. }
  35160. addFormatToken('N', 0, 0, 'eraAbbr');
  35161. addFormatToken('NN', 0, 0, 'eraAbbr');
  35162. addFormatToken('NNN', 0, 0, 'eraAbbr');
  35163. addFormatToken('NNNN', 0, 0, 'eraName');
  35164. addFormatToken('NNNNN', 0, 0, 'eraNarrow');
  35165. addFormatToken('y', ['y', 1], 'yo', 'eraYear');
  35166. addFormatToken('y', ['yy', 2], 0, 'eraYear');
  35167. addFormatToken('y', ['yyy', 3], 0, 'eraYear');
  35168. addFormatToken('y', ['yyyy', 4], 0, 'eraYear');
  35169. addRegexToken('N', matchEraAbbr);
  35170. addRegexToken('NN', matchEraAbbr);
  35171. addRegexToken('NNN', matchEraAbbr);
  35172. addRegexToken('NNNN', matchEraName);
  35173. addRegexToken('NNNNN', matchEraNarrow);
  35174. addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (
  35175. input,
  35176. array,
  35177. config,
  35178. token
  35179. ) {
  35180. var era = config._locale.erasParse(input, token, config._strict);
  35181. if (era) {
  35182. getParsingFlags(config).era = era;
  35183. } else {
  35184. getParsingFlags(config).invalidEra = input;
  35185. }
  35186. });
  35187. addRegexToken('y', matchUnsigned);
  35188. addRegexToken('yy', matchUnsigned);
  35189. addRegexToken('yyy', matchUnsigned);
  35190. addRegexToken('yyyy', matchUnsigned);
  35191. addRegexToken('yo', matchEraYearOrdinal);
  35192. addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);
  35193. addParseToken(['yo'], function (input, array, config, token) {
  35194. var match;
  35195. if (config._locale._eraYearOrdinalRegex) {
  35196. match = input.match(config._locale._eraYearOrdinalRegex);
  35197. }
  35198. if (config._locale.eraYearOrdinalParse) {
  35199. array[YEAR] = config._locale.eraYearOrdinalParse(input, match);
  35200. } else {
  35201. array[YEAR] = parseInt(input, 10);
  35202. }
  35203. });
  35204. function localeEras(m, format) {
  35205. var i,
  35206. l,
  35207. date,
  35208. eras = this._eras || getLocale('en')._eras;
  35209. for (i = 0, l = eras.length; i < l; ++i) {
  35210. switch (typeof eras[i].since) {
  35211. case 'string':
  35212. // truncate time
  35213. date = hooks(eras[i].since).startOf('day');
  35214. eras[i].since = date.valueOf();
  35215. break;
  35216. }
  35217. switch (typeof eras[i].until) {
  35218. case 'undefined':
  35219. eras[i].until = +Infinity;
  35220. break;
  35221. case 'string':
  35222. // truncate time
  35223. date = hooks(eras[i].until).startOf('day').valueOf();
  35224. eras[i].until = date.valueOf();
  35225. break;
  35226. }
  35227. }
  35228. return eras;
  35229. }
  35230. function localeErasParse(eraName, format, strict) {
  35231. var i,
  35232. l,
  35233. eras = this.eras(),
  35234. name,
  35235. abbr,
  35236. narrow;
  35237. eraName = eraName.toUpperCase();
  35238. for (i = 0, l = eras.length; i < l; ++i) {
  35239. name = eras[i].name.toUpperCase();
  35240. abbr = eras[i].abbr.toUpperCase();
  35241. narrow = eras[i].narrow.toUpperCase();
  35242. if (strict) {
  35243. switch (format) {
  35244. case 'N':
  35245. case 'NN':
  35246. case 'NNN':
  35247. if (abbr === eraName) {
  35248. return eras[i];
  35249. }
  35250. break;
  35251. case 'NNNN':
  35252. if (name === eraName) {
  35253. return eras[i];
  35254. }
  35255. break;
  35256. case 'NNNNN':
  35257. if (narrow === eraName) {
  35258. return eras[i];
  35259. }
  35260. break;
  35261. }
  35262. } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {
  35263. return eras[i];
  35264. }
  35265. }
  35266. }
  35267. function localeErasConvertYear(era, year) {
  35268. var dir = era.since <= era.until ? +1 : -1;
  35269. if (year === undefined) {
  35270. return hooks(era.since).year();
  35271. } else {
  35272. return hooks(era.since).year() + (year - era.offset) * dir;
  35273. }
  35274. }
  35275. function getEraName() {
  35276. var i,
  35277. l,
  35278. val,
  35279. eras = this.localeData().eras();
  35280. for (i = 0, l = eras.length; i < l; ++i) {
  35281. // truncate time
  35282. val = this.clone().startOf('day').valueOf();
  35283. if (eras[i].since <= val && val <= eras[i].until) {
  35284. return eras[i].name;
  35285. }
  35286. if (eras[i].until <= val && val <= eras[i].since) {
  35287. return eras[i].name;
  35288. }
  35289. }
  35290. return '';
  35291. }
  35292. function getEraNarrow() {
  35293. var i,
  35294. l,
  35295. val,
  35296. eras = this.localeData().eras();
  35297. for (i = 0, l = eras.length; i < l; ++i) {
  35298. // truncate time
  35299. val = this.clone().startOf('day').valueOf();
  35300. if (eras[i].since <= val && val <= eras[i].until) {
  35301. return eras[i].narrow;
  35302. }
  35303. if (eras[i].until <= val && val <= eras[i].since) {
  35304. return eras[i].narrow;
  35305. }
  35306. }
  35307. return '';
  35308. }
  35309. function getEraAbbr() {
  35310. var i,
  35311. l,
  35312. val,
  35313. eras = this.localeData().eras();
  35314. for (i = 0, l = eras.length; i < l; ++i) {
  35315. // truncate time
  35316. val = this.clone().startOf('day').valueOf();
  35317. if (eras[i].since <= val && val <= eras[i].until) {
  35318. return eras[i].abbr;
  35319. }
  35320. if (eras[i].until <= val && val <= eras[i].since) {
  35321. return eras[i].abbr;
  35322. }
  35323. }
  35324. return '';
  35325. }
  35326. function getEraYear() {
  35327. var i,
  35328. l,
  35329. dir,
  35330. val,
  35331. eras = this.localeData().eras();
  35332. for (i = 0, l = eras.length; i < l; ++i) {
  35333. dir = eras[i].since <= eras[i].until ? +1 : -1;
  35334. // truncate time
  35335. val = this.clone().startOf('day').valueOf();
  35336. if (
  35337. (eras[i].since <= val && val <= eras[i].until) ||
  35338. (eras[i].until <= val && val <= eras[i].since)
  35339. ) {
  35340. return (
  35341. (this.year() - hooks(eras[i].since).year()) * dir +
  35342. eras[i].offset
  35343. );
  35344. }
  35345. }
  35346. return this.year();
  35347. }
  35348. function erasNameRegex(isStrict) {
  35349. if (!hasOwnProp(this, '_erasNameRegex')) {
  35350. computeErasParse.call(this);
  35351. }
  35352. return isStrict ? this._erasNameRegex : this._erasRegex;
  35353. }
  35354. function erasAbbrRegex(isStrict) {
  35355. if (!hasOwnProp(this, '_erasAbbrRegex')) {
  35356. computeErasParse.call(this);
  35357. }
  35358. return isStrict ? this._erasAbbrRegex : this._erasRegex;
  35359. }
  35360. function erasNarrowRegex(isStrict) {
  35361. if (!hasOwnProp(this, '_erasNarrowRegex')) {
  35362. computeErasParse.call(this);
  35363. }
  35364. return isStrict ? this._erasNarrowRegex : this._erasRegex;
  35365. }
  35366. function matchEraAbbr(isStrict, locale) {
  35367. return locale.erasAbbrRegex(isStrict);
  35368. }
  35369. function matchEraName(isStrict, locale) {
  35370. return locale.erasNameRegex(isStrict);
  35371. }
  35372. function matchEraNarrow(isStrict, locale) {
  35373. return locale.erasNarrowRegex(isStrict);
  35374. }
  35375. function matchEraYearOrdinal(isStrict, locale) {
  35376. return locale._eraYearOrdinalRegex || matchUnsigned;
  35377. }
  35378. function computeErasParse() {
  35379. var abbrPieces = [],
  35380. namePieces = [],
  35381. narrowPieces = [],
  35382. mixedPieces = [],
  35383. i,
  35384. l,
  35385. eras = this.eras();
  35386. for (i = 0, l = eras.length; i < l; ++i) {
  35387. namePieces.push(regexEscape(eras[i].name));
  35388. abbrPieces.push(regexEscape(eras[i].abbr));
  35389. narrowPieces.push(regexEscape(eras[i].narrow));
  35390. mixedPieces.push(regexEscape(eras[i].name));
  35391. mixedPieces.push(regexEscape(eras[i].abbr));
  35392. mixedPieces.push(regexEscape(eras[i].narrow));
  35393. }
  35394. this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
  35395. this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');
  35396. this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');
  35397. this._erasNarrowRegex = new RegExp(
  35398. '^(' + narrowPieces.join('|') + ')',
  35399. 'i'
  35400. );
  35401. }
  35402. // FORMATTING
  35403. addFormatToken(0, ['gg', 2], 0, function () {
  35404. return this.weekYear() % 100;
  35405. });
  35406. addFormatToken(0, ['GG', 2], 0, function () {
  35407. return this.isoWeekYear() % 100;
  35408. });
  35409. function addWeekYearFormatToken(token, getter) {
  35410. addFormatToken(0, [token, token.length], 0, getter);
  35411. }
  35412. addWeekYearFormatToken('gggg', 'weekYear');
  35413. addWeekYearFormatToken('ggggg', 'weekYear');
  35414. addWeekYearFormatToken('GGGG', 'isoWeekYear');
  35415. addWeekYearFormatToken('GGGGG', 'isoWeekYear');
  35416. // ALIASES
  35417. addUnitAlias('weekYear', 'gg');
  35418. addUnitAlias('isoWeekYear', 'GG');
  35419. // PRIORITY
  35420. addUnitPriority('weekYear', 1);
  35421. addUnitPriority('isoWeekYear', 1);
  35422. // PARSING
  35423. addRegexToken('G', matchSigned);
  35424. addRegexToken('g', matchSigned);
  35425. addRegexToken('GG', match1to2, match2);
  35426. addRegexToken('gg', match1to2, match2);
  35427. addRegexToken('GGGG', match1to4, match4);
  35428. addRegexToken('gggg', match1to4, match4);
  35429. addRegexToken('GGGGG', match1to6, match6);
  35430. addRegexToken('ggggg', match1to6, match6);
  35431. addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (
  35432. input,
  35433. week,
  35434. config,
  35435. token
  35436. ) {
  35437. week[token.substr(0, 2)] = toInt(input);
  35438. });
  35439. addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
  35440. week[token] = hooks.parseTwoDigitYear(input);
  35441. });
  35442. // MOMENTS
  35443. function getSetWeekYear(input) {
  35444. return getSetWeekYearHelper.call(
  35445. this,
  35446. input,
  35447. this.week(),
  35448. this.weekday(),
  35449. this.localeData()._week.dow,
  35450. this.localeData()._week.doy
  35451. );
  35452. }
  35453. function getSetISOWeekYear(input) {
  35454. return getSetWeekYearHelper.call(
  35455. this,
  35456. input,
  35457. this.isoWeek(),
  35458. this.isoWeekday(),
  35459. 1,
  35460. 4
  35461. );
  35462. }
  35463. function getISOWeeksInYear() {
  35464. return weeksInYear(this.year(), 1, 4);
  35465. }
  35466. function getISOWeeksInISOWeekYear() {
  35467. return weeksInYear(this.isoWeekYear(), 1, 4);
  35468. }
  35469. function getWeeksInYear() {
  35470. var weekInfo = this.localeData()._week;
  35471. return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
  35472. }
  35473. function getWeeksInWeekYear() {
  35474. var weekInfo = this.localeData()._week;
  35475. return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
  35476. }
  35477. function getSetWeekYearHelper(input, week, weekday, dow, doy) {
  35478. var weeksTarget;
  35479. if (input == null) {
  35480. return weekOfYear(this, dow, doy).year;
  35481. } else {
  35482. weeksTarget = weeksInYear(input, dow, doy);
  35483. if (week > weeksTarget) {
  35484. week = weeksTarget;
  35485. }
  35486. return setWeekAll.call(this, input, week, weekday, dow, doy);
  35487. }
  35488. }
  35489. function setWeekAll(weekYear, week, weekday, dow, doy) {
  35490. var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
  35491. date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
  35492. this.year(date.getUTCFullYear());
  35493. this.month(date.getUTCMonth());
  35494. this.date(date.getUTCDate());
  35495. return this;
  35496. }
  35497. // FORMATTING
  35498. addFormatToken('Q', 0, 'Qo', 'quarter');
  35499. // ALIASES
  35500. addUnitAlias('quarter', 'Q');
  35501. // PRIORITY
  35502. addUnitPriority('quarter', 7);
  35503. // PARSING
  35504. addRegexToken('Q', match1);
  35505. addParseToken('Q', function (input, array) {
  35506. array[MONTH] = (toInt(input) - 1) * 3;
  35507. });
  35508. // MOMENTS
  35509. function getSetQuarter(input) {
  35510. return input == null
  35511. ? Math.ceil((this.month() + 1) / 3)
  35512. : this.month((input - 1) * 3 + (this.month() % 3));
  35513. }
  35514. // FORMATTING
  35515. addFormatToken('D', ['DD', 2], 'Do', 'date');
  35516. // ALIASES
  35517. addUnitAlias('date', 'D');
  35518. // PRIORITY
  35519. addUnitPriority('date', 9);
  35520. // PARSING
  35521. addRegexToken('D', match1to2);
  35522. addRegexToken('DD', match1to2, match2);
  35523. addRegexToken('Do', function (isStrict, locale) {
  35524. // TODO: Remove "ordinalParse" fallback in next major release.
  35525. return isStrict
  35526. ? locale._dayOfMonthOrdinalParse || locale._ordinalParse
  35527. : locale._dayOfMonthOrdinalParseLenient;
  35528. });
  35529. addParseToken(['D', 'DD'], DATE);
  35530. addParseToken('Do', function (input, array) {
  35531. array[DATE] = toInt(input.match(match1to2)[0]);
  35532. });
  35533. // MOMENTS
  35534. var getSetDayOfMonth = makeGetSet('Date', true);
  35535. // FORMATTING
  35536. addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
  35537. // ALIASES
  35538. addUnitAlias('dayOfYear', 'DDD');
  35539. // PRIORITY
  35540. addUnitPriority('dayOfYear', 4);
  35541. // PARSING
  35542. addRegexToken('DDD', match1to3);
  35543. addRegexToken('DDDD', match3);
  35544. addParseToken(['DDD', 'DDDD'], function (input, array, config) {
  35545. config._dayOfYear = toInt(input);
  35546. });
  35547. // HELPERS
  35548. // MOMENTS
  35549. function getSetDayOfYear(input) {
  35550. var dayOfYear =
  35551. Math.round(
  35552. (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5
  35553. ) + 1;
  35554. return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');
  35555. }
  35556. // FORMATTING
  35557. addFormatToken('m', ['mm', 2], 0, 'minute');
  35558. // ALIASES
  35559. addUnitAlias('minute', 'm');
  35560. // PRIORITY
  35561. addUnitPriority('minute', 14);
  35562. // PARSING
  35563. addRegexToken('m', match1to2);
  35564. addRegexToken('mm', match1to2, match2);
  35565. addParseToken(['m', 'mm'], MINUTE);
  35566. // MOMENTS
  35567. var getSetMinute = makeGetSet('Minutes', false);
  35568. // FORMATTING
  35569. addFormatToken('s', ['ss', 2], 0, 'second');
  35570. // ALIASES
  35571. addUnitAlias('second', 's');
  35572. // PRIORITY
  35573. addUnitPriority('second', 15);
  35574. // PARSING
  35575. addRegexToken('s', match1to2);
  35576. addRegexToken('ss', match1to2, match2);
  35577. addParseToken(['s', 'ss'], SECOND);
  35578. // MOMENTS
  35579. var getSetSecond = makeGetSet('Seconds', false);
  35580. // FORMATTING
  35581. addFormatToken('S', 0, 0, function () {
  35582. return ~~(this.millisecond() / 100);
  35583. });
  35584. addFormatToken(0, ['SS', 2], 0, function () {
  35585. return ~~(this.millisecond() / 10);
  35586. });
  35587. addFormatToken(0, ['SSS', 3], 0, 'millisecond');
  35588. addFormatToken(0, ['SSSS', 4], 0, function () {
  35589. return this.millisecond() * 10;
  35590. });
  35591. addFormatToken(0, ['SSSSS', 5], 0, function () {
  35592. return this.millisecond() * 100;
  35593. });
  35594. addFormatToken(0, ['SSSSSS', 6], 0, function () {
  35595. return this.millisecond() * 1000;
  35596. });
  35597. addFormatToken(0, ['SSSSSSS', 7], 0, function () {
  35598. return this.millisecond() * 10000;
  35599. });
  35600. addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
  35601. return this.millisecond() * 100000;
  35602. });
  35603. addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
  35604. return this.millisecond() * 1000000;
  35605. });
  35606. // ALIASES
  35607. addUnitAlias('millisecond', 'ms');
  35608. // PRIORITY
  35609. addUnitPriority('millisecond', 16);
  35610. // PARSING
  35611. addRegexToken('S', match1to3, match1);
  35612. addRegexToken('SS', match1to3, match2);
  35613. addRegexToken('SSS', match1to3, match3);
  35614. var token, getSetMillisecond;
  35615. for (token = 'SSSS'; token.length <= 9; token += 'S') {
  35616. addRegexToken(token, matchUnsigned);
  35617. }
  35618. function parseMs(input, array) {
  35619. array[MILLISECOND] = toInt(('0.' + input) * 1000);
  35620. }
  35621. for (token = 'S'; token.length <= 9; token += 'S') {
  35622. addParseToken(token, parseMs);
  35623. }
  35624. getSetMillisecond = makeGetSet('Milliseconds', false);
  35625. // FORMATTING
  35626. addFormatToken('z', 0, 0, 'zoneAbbr');
  35627. addFormatToken('zz', 0, 0, 'zoneName');
  35628. // MOMENTS
  35629. function getZoneAbbr() {
  35630. return this._isUTC ? 'UTC' : '';
  35631. }
  35632. function getZoneName() {
  35633. return this._isUTC ? 'Coordinated Universal Time' : '';
  35634. }
  35635. var proto = Moment.prototype;
  35636. proto.add = add;
  35637. proto.calendar = calendar$1;
  35638. proto.clone = clone;
  35639. proto.diff = diff;
  35640. proto.endOf = endOf;
  35641. proto.format = format;
  35642. proto.from = from;
  35643. proto.fromNow = fromNow;
  35644. proto.to = to;
  35645. proto.toNow = toNow;
  35646. proto.get = stringGet;
  35647. proto.invalidAt = invalidAt;
  35648. proto.isAfter = isAfter;
  35649. proto.isBefore = isBefore;
  35650. proto.isBetween = isBetween;
  35651. proto.isSame = isSame;
  35652. proto.isSameOrAfter = isSameOrAfter;
  35653. proto.isSameOrBefore = isSameOrBefore;
  35654. proto.isValid = isValid$2;
  35655. proto.lang = lang;
  35656. proto.locale = locale;
  35657. proto.localeData = localeData;
  35658. proto.max = prototypeMax;
  35659. proto.min = prototypeMin;
  35660. proto.parsingFlags = parsingFlags;
  35661. proto.set = stringSet;
  35662. proto.startOf = startOf;
  35663. proto.subtract = subtract;
  35664. proto.toArray = toArray;
  35665. proto.toObject = toObject;
  35666. proto.toDate = toDate;
  35667. proto.toISOString = toISOString;
  35668. proto.inspect = inspect;
  35669. if (typeof Symbol !== 'undefined' && Symbol.for != null) {
  35670. proto[Symbol.for('nodejs.util.inspect.custom')] = function () {
  35671. return 'Moment<' + this.format() + '>';
  35672. };
  35673. }
  35674. proto.toJSON = toJSON;
  35675. proto.toString = toString;
  35676. proto.unix = unix;
  35677. proto.valueOf = valueOf;
  35678. proto.creationData = creationData;
  35679. proto.eraName = getEraName;
  35680. proto.eraNarrow = getEraNarrow;
  35681. proto.eraAbbr = getEraAbbr;
  35682. proto.eraYear = getEraYear;
  35683. proto.year = getSetYear;
  35684. proto.isLeapYear = getIsLeapYear;
  35685. proto.weekYear = getSetWeekYear;
  35686. proto.isoWeekYear = getSetISOWeekYear;
  35687. proto.quarter = proto.quarters = getSetQuarter;
  35688. proto.month = getSetMonth;
  35689. proto.daysInMonth = getDaysInMonth;
  35690. proto.week = proto.weeks = getSetWeek;
  35691. proto.isoWeek = proto.isoWeeks = getSetISOWeek;
  35692. proto.weeksInYear = getWeeksInYear;
  35693. proto.weeksInWeekYear = getWeeksInWeekYear;
  35694. proto.isoWeeksInYear = getISOWeeksInYear;
  35695. proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
  35696. proto.date = getSetDayOfMonth;
  35697. proto.day = proto.days = getSetDayOfWeek;
  35698. proto.weekday = getSetLocaleDayOfWeek;
  35699. proto.isoWeekday = getSetISODayOfWeek;
  35700. proto.dayOfYear = getSetDayOfYear;
  35701. proto.hour = proto.hours = getSetHour;
  35702. proto.minute = proto.minutes = getSetMinute;
  35703. proto.second = proto.seconds = getSetSecond;
  35704. proto.millisecond = proto.milliseconds = getSetMillisecond;
  35705. proto.utcOffset = getSetOffset;
  35706. proto.utc = setOffsetToUTC;
  35707. proto.local = setOffsetToLocal;
  35708. proto.parseZone = setOffsetToParsedOffset;
  35709. proto.hasAlignedHourOffset = hasAlignedHourOffset;
  35710. proto.isDST = isDaylightSavingTime;
  35711. proto.isLocal = isLocal;
  35712. proto.isUtcOffset = isUtcOffset;
  35713. proto.isUtc = isUtc;
  35714. proto.isUTC = isUtc;
  35715. proto.zoneAbbr = getZoneAbbr;
  35716. proto.zoneName = getZoneName;
  35717. proto.dates = deprecate(
  35718. 'dates accessor is deprecated. Use date instead.',
  35719. getSetDayOfMonth
  35720. );
  35721. proto.months = deprecate(
  35722. 'months accessor is deprecated. Use month instead',
  35723. getSetMonth
  35724. );
  35725. proto.years = deprecate(
  35726. 'years accessor is deprecated. Use year instead',
  35727. getSetYear
  35728. );
  35729. proto.zone = deprecate(
  35730. 'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/',
  35731. getSetZone
  35732. );
  35733. proto.isDSTShifted = deprecate(
  35734. 'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information',
  35735. isDaylightSavingTimeShifted
  35736. );
  35737. function createUnix(input) {
  35738. return createLocal(input * 1000);
  35739. }
  35740. function createInZone() {
  35741. return createLocal.apply(null, arguments).parseZone();
  35742. }
  35743. function preParsePostFormat(string) {
  35744. return string;
  35745. }
  35746. var proto$1 = Locale.prototype;
  35747. proto$1.calendar = calendar;
  35748. proto$1.longDateFormat = longDateFormat;
  35749. proto$1.invalidDate = invalidDate;
  35750. proto$1.ordinal = ordinal;
  35751. proto$1.preparse = preParsePostFormat;
  35752. proto$1.postformat = preParsePostFormat;
  35753. proto$1.relativeTime = relativeTime;
  35754. proto$1.pastFuture = pastFuture;
  35755. proto$1.set = set;
  35756. proto$1.eras = localeEras;
  35757. proto$1.erasParse = localeErasParse;
  35758. proto$1.erasConvertYear = localeErasConvertYear;
  35759. proto$1.erasAbbrRegex = erasAbbrRegex;
  35760. proto$1.erasNameRegex = erasNameRegex;
  35761. proto$1.erasNarrowRegex = erasNarrowRegex;
  35762. proto$1.months = localeMonths;
  35763. proto$1.monthsShort = localeMonthsShort;
  35764. proto$1.monthsParse = localeMonthsParse;
  35765. proto$1.monthsRegex = monthsRegex;
  35766. proto$1.monthsShortRegex = monthsShortRegex;
  35767. proto$1.week = localeWeek;
  35768. proto$1.firstDayOfYear = localeFirstDayOfYear;
  35769. proto$1.firstDayOfWeek = localeFirstDayOfWeek;
  35770. proto$1.weekdays = localeWeekdays;
  35771. proto$1.weekdaysMin = localeWeekdaysMin;
  35772. proto$1.weekdaysShort = localeWeekdaysShort;
  35773. proto$1.weekdaysParse = localeWeekdaysParse;
  35774. proto$1.weekdaysRegex = weekdaysRegex;
  35775. proto$1.weekdaysShortRegex = weekdaysShortRegex;
  35776. proto$1.weekdaysMinRegex = weekdaysMinRegex;
  35777. proto$1.isPM = localeIsPM;
  35778. proto$1.meridiem = localeMeridiem;
  35779. function get$1(format, index, field, setter) {
  35780. var locale = getLocale(),
  35781. utc = createUTC().set(setter, index);
  35782. return locale[field](utc, format);
  35783. }
  35784. function listMonthsImpl(format, index, field) {
  35785. if (isNumber(format)) {
  35786. index = format;
  35787. format = undefined;
  35788. }
  35789. format = format || '';
  35790. if (index != null) {
  35791. return get$1(format, index, field, 'month');
  35792. }
  35793. var i,
  35794. out = [];
  35795. for (i = 0; i < 12; i++) {
  35796. out[i] = get$1(format, i, field, 'month');
  35797. }
  35798. return out;
  35799. }
  35800. // ()
  35801. // (5)
  35802. // (fmt, 5)
  35803. // (fmt)
  35804. // (true)
  35805. // (true, 5)
  35806. // (true, fmt, 5)
  35807. // (true, fmt)
  35808. function listWeekdaysImpl(localeSorted, format, index, field) {
  35809. if (typeof localeSorted === 'boolean') {
  35810. if (isNumber(format)) {
  35811. index = format;
  35812. format = undefined;
  35813. }
  35814. format = format || '';
  35815. } else {
  35816. format = localeSorted;
  35817. index = format;
  35818. localeSorted = false;
  35819. if (isNumber(format)) {
  35820. index = format;
  35821. format = undefined;
  35822. }
  35823. format = format || '';
  35824. }
  35825. var locale = getLocale(),
  35826. shift = localeSorted ? locale._week.dow : 0,
  35827. i,
  35828. out = [];
  35829. if (index != null) {
  35830. return get$1(format, (index + shift) % 7, field, 'day');
  35831. }
  35832. for (i = 0; i < 7; i++) {
  35833. out[i] = get$1(format, (i + shift) % 7, field, 'day');
  35834. }
  35835. return out;
  35836. }
  35837. function listMonths(format, index) {
  35838. return listMonthsImpl(format, index, 'months');
  35839. }
  35840. function listMonthsShort(format, index) {
  35841. return listMonthsImpl(format, index, 'monthsShort');
  35842. }
  35843. function listWeekdays(localeSorted, format, index) {
  35844. return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
  35845. }
  35846. function listWeekdaysShort(localeSorted, format, index) {
  35847. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
  35848. }
  35849. function listWeekdaysMin(localeSorted, format, index) {
  35850. return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
  35851. }
  35852. getSetGlobalLocale('en', {
  35853. eras: [
  35854. {
  35855. since: '0001-01-01',
  35856. until: +Infinity,
  35857. offset: 1,
  35858. name: 'Anno Domini',
  35859. narrow: 'AD',
  35860. abbr: 'AD',
  35861. },
  35862. {
  35863. since: '0000-12-31',
  35864. until: -Infinity,
  35865. offset: 1,
  35866. name: 'Before Christ',
  35867. narrow: 'BC',
  35868. abbr: 'BC',
  35869. },
  35870. ],
  35871. dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
  35872. ordinal: function (number) {
  35873. var b = number % 10,
  35874. output =
  35875. toInt((number % 100) / 10) === 1
  35876. ? 'th'
  35877. : b === 1
  35878. ? 'st'
  35879. : b === 2
  35880. ? 'nd'
  35881. : b === 3
  35882. ? 'rd'
  35883. : 'th';
  35884. return number + output;
  35885. },
  35886. });
  35887. // Side effect imports
  35888. hooks.lang = deprecate(
  35889. 'moment.lang is deprecated. Use moment.locale instead.',
  35890. getSetGlobalLocale
  35891. );
  35892. hooks.langData = deprecate(
  35893. 'moment.langData is deprecated. Use moment.localeData instead.',
  35894. getLocale
  35895. );
  35896. var mathAbs = Math.abs;
  35897. function abs() {
  35898. var data = this._data;
  35899. this._milliseconds = mathAbs(this._milliseconds);
  35900. this._days = mathAbs(this._days);
  35901. this._months = mathAbs(this._months);
  35902. data.milliseconds = mathAbs(data.milliseconds);
  35903. data.seconds = mathAbs(data.seconds);
  35904. data.minutes = mathAbs(data.minutes);
  35905. data.hours = mathAbs(data.hours);
  35906. data.months = mathAbs(data.months);
  35907. data.years = mathAbs(data.years);
  35908. return this;
  35909. }
  35910. function addSubtract$1(duration, input, value, direction) {
  35911. var other = createDuration(input, value);
  35912. duration._milliseconds += direction * other._milliseconds;
  35913. duration._days += direction * other._days;
  35914. duration._months += direction * other._months;
  35915. return duration._bubble();
  35916. }
  35917. // supports only 2.0-style add(1, 's') or add(duration)
  35918. function add$1(input, value) {
  35919. return addSubtract$1(this, input, value, 1);
  35920. }
  35921. // supports only 2.0-style subtract(1, 's') or subtract(duration)
  35922. function subtract$1(input, value) {
  35923. return addSubtract$1(this, input, value, -1);
  35924. }
  35925. function absCeil(number) {
  35926. if (number < 0) {
  35927. return Math.floor(number);
  35928. } else {
  35929. return Math.ceil(number);
  35930. }
  35931. }
  35932. function bubble() {
  35933. var milliseconds = this._milliseconds,
  35934. days = this._days,
  35935. months = this._months,
  35936. data = this._data,
  35937. seconds,
  35938. minutes,
  35939. hours,
  35940. years,
  35941. monthsFromDays;
  35942. // if we have a mix of positive and negative values, bubble down first
  35943. // check: https://github.com/moment/moment/issues/2166
  35944. if (
  35945. !(
  35946. (milliseconds >= 0 && days >= 0 && months >= 0) ||
  35947. (milliseconds <= 0 && days <= 0 && months <= 0)
  35948. )
  35949. ) {
  35950. milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
  35951. days = 0;
  35952. months = 0;
  35953. }
  35954. // The following code bubbles up values, see the tests for
  35955. // examples of what that means.
  35956. data.milliseconds = milliseconds % 1000;
  35957. seconds = absFloor(milliseconds / 1000);
  35958. data.seconds = seconds % 60;
  35959. minutes = absFloor(seconds / 60);
  35960. data.minutes = minutes % 60;
  35961. hours = absFloor(minutes / 60);
  35962. data.hours = hours % 24;
  35963. days += absFloor(hours / 24);
  35964. // convert days to months
  35965. monthsFromDays = absFloor(daysToMonths(days));
  35966. months += monthsFromDays;
  35967. days -= absCeil(monthsToDays(monthsFromDays));
  35968. // 12 months -> 1 year
  35969. years = absFloor(months / 12);
  35970. months %= 12;
  35971. data.days = days;
  35972. data.months = months;
  35973. data.years = years;
  35974. return this;
  35975. }
  35976. function daysToMonths(days) {
  35977. // 400 years have 146097 days (taking into account leap year rules)
  35978. // 400 years have 12 months === 4800
  35979. return (days * 4800) / 146097;
  35980. }
  35981. function monthsToDays(months) {
  35982. // the reverse of daysToMonths
  35983. return (months * 146097) / 4800;
  35984. }
  35985. function as(units) {
  35986. if (!this.isValid()) {
  35987. return NaN;
  35988. }
  35989. var days,
  35990. months,
  35991. milliseconds = this._milliseconds;
  35992. units = normalizeUnits(units);
  35993. if (units === 'month' || units === 'quarter' || units === 'year') {
  35994. days = this._days + milliseconds / 864e5;
  35995. months = this._months + daysToMonths(days);
  35996. switch (units) {
  35997. case 'month':
  35998. return months;
  35999. case 'quarter':
  36000. return months / 3;
  36001. case 'year':
  36002. return months / 12;
  36003. }
  36004. } else {
  36005. // handle milliseconds separately because of floating point math errors (issue #1867)
  36006. days = this._days + Math.round(monthsToDays(this._months));
  36007. switch (units) {
  36008. case 'week':
  36009. return days / 7 + milliseconds / 6048e5;
  36010. case 'day':
  36011. return days + milliseconds / 864e5;
  36012. case 'hour':
  36013. return days * 24 + milliseconds / 36e5;
  36014. case 'minute':
  36015. return days * 1440 + milliseconds / 6e4;
  36016. case 'second':
  36017. return days * 86400 + milliseconds / 1000;
  36018. // Math.floor prevents floating point math errors here
  36019. case 'millisecond':
  36020. return Math.floor(days * 864e5) + milliseconds;
  36021. default:
  36022. throw new Error('Unknown unit ' + units);
  36023. }
  36024. }
  36025. }
  36026. // TODO: Use this.as('ms')?
  36027. function valueOf$1() {
  36028. if (!this.isValid()) {
  36029. return NaN;
  36030. }
  36031. return (
  36032. this._milliseconds +
  36033. this._days * 864e5 +
  36034. (this._months % 12) * 2592e6 +
  36035. toInt(this._months / 12) * 31536e6
  36036. );
  36037. }
  36038. function makeAs(alias) {
  36039. return function () {
  36040. return this.as(alias);
  36041. };
  36042. }
  36043. var asMilliseconds = makeAs('ms'),
  36044. asSeconds = makeAs('s'),
  36045. asMinutes = makeAs('m'),
  36046. asHours = makeAs('h'),
  36047. asDays = makeAs('d'),
  36048. asWeeks = makeAs('w'),
  36049. asMonths = makeAs('M'),
  36050. asQuarters = makeAs('Q'),
  36051. asYears = makeAs('y');
  36052. function clone$1() {
  36053. return createDuration(this);
  36054. }
  36055. function get$2(units) {
  36056. units = normalizeUnits(units);
  36057. return this.isValid() ? this[units + 's']() : NaN;
  36058. }
  36059. function makeGetter(name) {
  36060. return function () {
  36061. return this.isValid() ? this._data[name] : NaN;
  36062. };
  36063. }
  36064. var milliseconds = makeGetter('milliseconds'),
  36065. seconds = makeGetter('seconds'),
  36066. minutes = makeGetter('minutes'),
  36067. hours = makeGetter('hours'),
  36068. days = makeGetter('days'),
  36069. months = makeGetter('months'),
  36070. years = makeGetter('years');
  36071. function weeks() {
  36072. return absFloor(this.days() / 7);
  36073. }
  36074. var round = Math.round,
  36075. thresholds = {
  36076. ss: 44, // a few seconds to seconds
  36077. s: 45, // seconds to minute
  36078. m: 45, // minutes to hour
  36079. h: 22, // hours to day
  36080. d: 26, // days to month/week
  36081. w: null, // weeks to month
  36082. M: 11, // months to year
  36083. };
  36084. // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
  36085. function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
  36086. return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
  36087. }
  36088. function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {
  36089. var duration = createDuration(posNegDuration).abs(),
  36090. seconds = round(duration.as('s')),
  36091. minutes = round(duration.as('m')),
  36092. hours = round(duration.as('h')),
  36093. days = round(duration.as('d')),
  36094. months = round(duration.as('M')),
  36095. weeks = round(duration.as('w')),
  36096. years = round(duration.as('y')),
  36097. a =
  36098. (seconds <= thresholds.ss && ['s', seconds]) ||
  36099. (seconds < thresholds.s && ['ss', seconds]) ||
  36100. (minutes <= 1 && ['m']) ||
  36101. (minutes < thresholds.m && ['mm', minutes]) ||
  36102. (hours <= 1 && ['h']) ||
  36103. (hours < thresholds.h && ['hh', hours]) ||
  36104. (days <= 1 && ['d']) ||
  36105. (days < thresholds.d && ['dd', days]);
  36106. if (thresholds.w != null) {
  36107. a =
  36108. a ||
  36109. (weeks <= 1 && ['w']) ||
  36110. (weeks < thresholds.w && ['ww', weeks]);
  36111. }
  36112. a = a ||
  36113. (months <= 1 && ['M']) ||
  36114. (months < thresholds.M && ['MM', months]) ||
  36115. (years <= 1 && ['y']) || ['yy', years];
  36116. a[2] = withoutSuffix;
  36117. a[3] = +posNegDuration > 0;
  36118. a[4] = locale;
  36119. return substituteTimeAgo.apply(null, a);
  36120. }
  36121. // This function allows you to set the rounding function for relative time strings
  36122. function getSetRelativeTimeRounding(roundingFunction) {
  36123. if (roundingFunction === undefined) {
  36124. return round;
  36125. }
  36126. if (typeof roundingFunction === 'function') {
  36127. round = roundingFunction;
  36128. return true;
  36129. }
  36130. return false;
  36131. }
  36132. // This function allows you to set a threshold for relative time strings
  36133. function getSetRelativeTimeThreshold(threshold, limit) {
  36134. if (thresholds[threshold] === undefined) {
  36135. return false;
  36136. }
  36137. if (limit === undefined) {
  36138. return thresholds[threshold];
  36139. }
  36140. thresholds[threshold] = limit;
  36141. if (threshold === 's') {
  36142. thresholds.ss = limit - 1;
  36143. }
  36144. return true;
  36145. }
  36146. function humanize(argWithSuffix, argThresholds) {
  36147. if (!this.isValid()) {
  36148. return this.localeData().invalidDate();
  36149. }
  36150. var withSuffix = false,
  36151. th = thresholds,
  36152. locale,
  36153. output;
  36154. if (typeof argWithSuffix === 'object') {
  36155. argThresholds = argWithSuffix;
  36156. argWithSuffix = false;
  36157. }
  36158. if (typeof argWithSuffix === 'boolean') {
  36159. withSuffix = argWithSuffix;
  36160. }
  36161. if (typeof argThresholds === 'object') {
  36162. th = Object.assign({}, thresholds, argThresholds);
  36163. if (argThresholds.s != null && argThresholds.ss == null) {
  36164. th.ss = argThresholds.s - 1;
  36165. }
  36166. }
  36167. locale = this.localeData();
  36168. output = relativeTime$1(this, !withSuffix, th, locale);
  36169. if (withSuffix) {
  36170. output = locale.pastFuture(+this, output);
  36171. }
  36172. return locale.postformat(output);
  36173. }
  36174. var abs$1 = Math.abs;
  36175. function sign(x) {
  36176. return (x > 0) - (x < 0) || +x;
  36177. }
  36178. function toISOString$1() {
  36179. // for ISO strings we do not use the normal bubbling rules:
  36180. // * milliseconds bubble up until they become hours
  36181. // * days do not bubble at all
  36182. // * months bubble up until they become years
  36183. // This is because there is no context-free conversion between hours and days
  36184. // (think of clock changes)
  36185. // and also not between days and months (28-31 days per month)
  36186. if (!this.isValid()) {
  36187. return this.localeData().invalidDate();
  36188. }
  36189. var seconds = abs$1(this._milliseconds) / 1000,
  36190. days = abs$1(this._days),
  36191. months = abs$1(this._months),
  36192. minutes,
  36193. hours,
  36194. years,
  36195. s,
  36196. total = this.asSeconds(),
  36197. totalSign,
  36198. ymSign,
  36199. daysSign,
  36200. hmsSign;
  36201. if (!total) {
  36202. // this is the same as C#'s (Noda) and python (isodate)...
  36203. // but not other JS (goog.date)
  36204. return 'P0D';
  36205. }
  36206. // 3600 seconds -> 60 minutes -> 1 hour
  36207. minutes = absFloor(seconds / 60);
  36208. hours = absFloor(minutes / 60);
  36209. seconds %= 60;
  36210. minutes %= 60;
  36211. // 12 months -> 1 year
  36212. years = absFloor(months / 12);
  36213. months %= 12;
  36214. // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
  36215. s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
  36216. totalSign = total < 0 ? '-' : '';
  36217. ymSign = sign(this._months) !== sign(total) ? '-' : '';
  36218. daysSign = sign(this._days) !== sign(total) ? '-' : '';
  36219. hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';
  36220. return (
  36221. totalSign +
  36222. 'P' +
  36223. (years ? ymSign + years + 'Y' : '') +
  36224. (months ? ymSign + months + 'M' : '') +
  36225. (days ? daysSign + days + 'D' : '') +
  36226. (hours || minutes || seconds ? 'T' : '') +
  36227. (hours ? hmsSign + hours + 'H' : '') +
  36228. (minutes ? hmsSign + minutes + 'M' : '') +
  36229. (seconds ? hmsSign + s + 'S' : '')
  36230. );
  36231. }
  36232. var proto$2 = Duration.prototype;
  36233. proto$2.isValid = isValid$1;
  36234. proto$2.abs = abs;
  36235. proto$2.add = add$1;
  36236. proto$2.subtract = subtract$1;
  36237. proto$2.as = as;
  36238. proto$2.asMilliseconds = asMilliseconds;
  36239. proto$2.asSeconds = asSeconds;
  36240. proto$2.asMinutes = asMinutes;
  36241. proto$2.asHours = asHours;
  36242. proto$2.asDays = asDays;
  36243. proto$2.asWeeks = asWeeks;
  36244. proto$2.asMonths = asMonths;
  36245. proto$2.asQuarters = asQuarters;
  36246. proto$2.asYears = asYears;
  36247. proto$2.valueOf = valueOf$1;
  36248. proto$2._bubble = bubble;
  36249. proto$2.clone = clone$1;
  36250. proto$2.get = get$2;
  36251. proto$2.milliseconds = milliseconds;
  36252. proto$2.seconds = seconds;
  36253. proto$2.minutes = minutes;
  36254. proto$2.hours = hours;
  36255. proto$2.days = days;
  36256. proto$2.weeks = weeks;
  36257. proto$2.months = months;
  36258. proto$2.years = years;
  36259. proto$2.humanize = humanize;
  36260. proto$2.toISOString = toISOString$1;
  36261. proto$2.toString = toISOString$1;
  36262. proto$2.toJSON = toISOString$1;
  36263. proto$2.locale = locale;
  36264. proto$2.localeData = localeData;
  36265. proto$2.toIsoString = deprecate(
  36266. 'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)',
  36267. toISOString$1
  36268. );
  36269. proto$2.lang = lang;
  36270. // FORMATTING
  36271. addFormatToken('X', 0, 0, 'unix');
  36272. addFormatToken('x', 0, 0, 'valueOf');
  36273. // PARSING
  36274. addRegexToken('x', matchSigned);
  36275. addRegexToken('X', matchTimestamp);
  36276. addParseToken('X', function (input, array, config) {
  36277. config._d = new Date(parseFloat(input) * 1000);
  36278. });
  36279. addParseToken('x', function (input, array, config) {
  36280. config._d = new Date(toInt(input));
  36281. });
  36282. //! moment.js
  36283. hooks.version = '2.29.1';
  36284. setHookCallback(createLocal);
  36285. hooks.fn = proto;
  36286. hooks.min = min;
  36287. hooks.max = max;
  36288. hooks.now = now;
  36289. hooks.utc = createUTC;
  36290. hooks.unix = createUnix;
  36291. hooks.months = listMonths;
  36292. hooks.isDate = isDate;
  36293. hooks.locale = getSetGlobalLocale;
  36294. hooks.invalid = createInvalid;
  36295. hooks.duration = createDuration;
  36296. hooks.isMoment = isMoment;
  36297. hooks.weekdays = listWeekdays;
  36298. hooks.parseZone = createInZone;
  36299. hooks.localeData = getLocale;
  36300. hooks.isDuration = isDuration;
  36301. hooks.monthsShort = listMonthsShort;
  36302. hooks.weekdaysMin = listWeekdaysMin;
  36303. hooks.defineLocale = defineLocale;
  36304. hooks.updateLocale = updateLocale;
  36305. hooks.locales = listLocales;
  36306. hooks.weekdaysShort = listWeekdaysShort;
  36307. hooks.normalizeUnits = normalizeUnits;
  36308. hooks.relativeTimeRounding = getSetRelativeTimeRounding;
  36309. hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
  36310. hooks.calendarFormat = getCalendarFormat;
  36311. hooks.prototype = proto;
  36312. // currently HTML5 input type only supports 24-hour formats
  36313. hooks.HTML5_FMT = {
  36314. DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" />
  36315. DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" />
  36316. DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" />
  36317. DATE: 'YYYY-MM-DD', // <input type="date" />
  36318. TIME: 'HH:mm', // <input type="time" />
  36319. TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" />
  36320. TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" />
  36321. WEEK: 'GGGG-[W]WW', // <input type="week" />
  36322. MONTH: 'YYYY-MM', // <input type="month" />
  36323. };
  36324. return hooks;
  36325. })));
  36326. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module)))
  36327. /***/ }),
  36328. /***/ "./node_modules/promise-polyfill/src/allSettled.js":
  36329. /*!*********************************************************!*\
  36330. !*** ./node_modules/promise-polyfill/src/allSettled.js ***!
  36331. \*********************************************************/
  36332. /*! exports provided: default */
  36333. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36334. "use strict";
  36335. __webpack_require__.r(__webpack_exports__);
  36336. function allSettled(arr) {
  36337. var P = this;
  36338. return new P(function(resolve, reject) {
  36339. if (!(arr && typeof arr.length !== 'undefined')) {
  36340. return reject(
  36341. new TypeError(
  36342. typeof arr +
  36343. ' ' +
  36344. arr +
  36345. ' is not iterable(cannot read property Symbol(Symbol.iterator))'
  36346. )
  36347. );
  36348. }
  36349. var args = Array.prototype.slice.call(arr);
  36350. if (args.length === 0) return resolve([]);
  36351. var remaining = args.length;
  36352. function res(i, val) {
  36353. if (val && (typeof val === 'object' || typeof val === 'function')) {
  36354. var then = val.then;
  36355. if (typeof then === 'function') {
  36356. then.call(
  36357. val,
  36358. function(val) {
  36359. res(i, val);
  36360. },
  36361. function(e) {
  36362. args[i] = { status: 'rejected', reason: e };
  36363. if (--remaining === 0) {
  36364. resolve(args);
  36365. }
  36366. }
  36367. );
  36368. return;
  36369. }
  36370. }
  36371. args[i] = { status: 'fulfilled', value: val };
  36372. if (--remaining === 0) {
  36373. resolve(args);
  36374. }
  36375. }
  36376. for (var i = 0; i < args.length; i++) {
  36377. res(i, args[i]);
  36378. }
  36379. });
  36380. }
  36381. /* harmony default export */ __webpack_exports__["default"] = (allSettled);
  36382. /***/ }),
  36383. /***/ "./node_modules/promise-polyfill/src/finally.js":
  36384. /*!******************************************************!*\
  36385. !*** ./node_modules/promise-polyfill/src/finally.js ***!
  36386. \******************************************************/
  36387. /*! exports provided: default */
  36388. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36389. "use strict";
  36390. __webpack_require__.r(__webpack_exports__);
  36391. /**
  36392. * @this {Promise}
  36393. */
  36394. function finallyConstructor(callback) {
  36395. var constructor = this.constructor;
  36396. return this.then(
  36397. function(value) {
  36398. // @ts-ignore
  36399. return constructor.resolve(callback()).then(function() {
  36400. return value;
  36401. });
  36402. },
  36403. function(reason) {
  36404. // @ts-ignore
  36405. return constructor.resolve(callback()).then(function() {
  36406. // @ts-ignore
  36407. return constructor.reject(reason);
  36408. });
  36409. }
  36410. );
  36411. }
  36412. /* harmony default export */ __webpack_exports__["default"] = (finallyConstructor);
  36413. /***/ }),
  36414. /***/ "./node_modules/promise-polyfill/src/index.js":
  36415. /*!****************************************************!*\
  36416. !*** ./node_modules/promise-polyfill/src/index.js ***!
  36417. \****************************************************/
  36418. /*! exports provided: default */
  36419. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36420. "use strict";
  36421. __webpack_require__.r(__webpack_exports__);
  36422. /* harmony import */ var _finally__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./finally */ "./node_modules/promise-polyfill/src/finally.js");
  36423. /* harmony import */ var _allSettled__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./allSettled */ "./node_modules/promise-polyfill/src/allSettled.js");
  36424. // Store setTimeout reference so promise-polyfill will be unaffected by
  36425. // other code modifying setTimeout (like sinon.useFakeTimers())
  36426. var setTimeoutFunc = setTimeout;
  36427. // @ts-ignore
  36428. var setImmediateFunc = typeof setImmediate !== 'undefined' ? setImmediate : null;
  36429. function isArray(x) {
  36430. return Boolean(x && typeof x.length !== 'undefined');
  36431. }
  36432. function noop() {}
  36433. // Polyfill for Function.prototype.bind
  36434. function bind(fn, thisArg) {
  36435. return function() {
  36436. fn.apply(thisArg, arguments);
  36437. };
  36438. }
  36439. /**
  36440. * @constructor
  36441. * @param {Function} fn
  36442. */
  36443. function Promise(fn) {
  36444. if (!(this instanceof Promise))
  36445. throw new TypeError('Promises must be constructed via new');
  36446. if (typeof fn !== 'function') throw new TypeError('not a function');
  36447. /** @type {!number} */
  36448. this._state = 0;
  36449. /** @type {!boolean} */
  36450. this._handled = false;
  36451. /** @type {Promise|undefined} */
  36452. this._value = undefined;
  36453. /** @type {!Array<!Function>} */
  36454. this._deferreds = [];
  36455. doResolve(fn, this);
  36456. }
  36457. function handle(self, deferred) {
  36458. while (self._state === 3) {
  36459. self = self._value;
  36460. }
  36461. if (self._state === 0) {
  36462. self._deferreds.push(deferred);
  36463. return;
  36464. }
  36465. self._handled = true;
  36466. Promise._immediateFn(function() {
  36467. var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
  36468. if (cb === null) {
  36469. (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
  36470. return;
  36471. }
  36472. var ret;
  36473. try {
  36474. ret = cb(self._value);
  36475. } catch (e) {
  36476. reject(deferred.promise, e);
  36477. return;
  36478. }
  36479. resolve(deferred.promise, ret);
  36480. });
  36481. }
  36482. function resolve(self, newValue) {
  36483. try {
  36484. // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
  36485. if (newValue === self)
  36486. throw new TypeError('A promise cannot be resolved with itself.');
  36487. if (
  36488. newValue &&
  36489. (typeof newValue === 'object' || typeof newValue === 'function')
  36490. ) {
  36491. var then = newValue.then;
  36492. if (newValue instanceof Promise) {
  36493. self._state = 3;
  36494. self._value = newValue;
  36495. finale(self);
  36496. return;
  36497. } else if (typeof then === 'function') {
  36498. doResolve(bind(then, newValue), self);
  36499. return;
  36500. }
  36501. }
  36502. self._state = 1;
  36503. self._value = newValue;
  36504. finale(self);
  36505. } catch (e) {
  36506. reject(self, e);
  36507. }
  36508. }
  36509. function reject(self, newValue) {
  36510. self._state = 2;
  36511. self._value = newValue;
  36512. finale(self);
  36513. }
  36514. function finale(self) {
  36515. if (self._state === 2 && self._deferreds.length === 0) {
  36516. Promise._immediateFn(function() {
  36517. if (!self._handled) {
  36518. Promise._unhandledRejectionFn(self._value);
  36519. }
  36520. });
  36521. }
  36522. for (var i = 0, len = self._deferreds.length; i < len; i++) {
  36523. handle(self, self._deferreds[i]);
  36524. }
  36525. self._deferreds = null;
  36526. }
  36527. /**
  36528. * @constructor
  36529. */
  36530. function Handler(onFulfilled, onRejected, promise) {
  36531. this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
  36532. this.onRejected = typeof onRejected === 'function' ? onRejected : null;
  36533. this.promise = promise;
  36534. }
  36535. /**
  36536. * Take a potentially misbehaving resolver function and make sure
  36537. * onFulfilled and onRejected are only called once.
  36538. *
  36539. * Makes no guarantees about asynchrony.
  36540. */
  36541. function doResolve(fn, self) {
  36542. var done = false;
  36543. try {
  36544. fn(
  36545. function(value) {
  36546. if (done) return;
  36547. done = true;
  36548. resolve(self, value);
  36549. },
  36550. function(reason) {
  36551. if (done) return;
  36552. done = true;
  36553. reject(self, reason);
  36554. }
  36555. );
  36556. } catch (ex) {
  36557. if (done) return;
  36558. done = true;
  36559. reject(self, ex);
  36560. }
  36561. }
  36562. Promise.prototype['catch'] = function(onRejected) {
  36563. return this.then(null, onRejected);
  36564. };
  36565. Promise.prototype.then = function(onFulfilled, onRejected) {
  36566. // @ts-ignore
  36567. var prom = new this.constructor(noop);
  36568. handle(this, new Handler(onFulfilled, onRejected, prom));
  36569. return prom;
  36570. };
  36571. Promise.prototype['finally'] = _finally__WEBPACK_IMPORTED_MODULE_0__["default"];
  36572. Promise.all = function(arr) {
  36573. return new Promise(function(resolve, reject) {
  36574. if (!isArray(arr)) {
  36575. return reject(new TypeError('Promise.all accepts an array'));
  36576. }
  36577. var args = Array.prototype.slice.call(arr);
  36578. if (args.length === 0) return resolve([]);
  36579. var remaining = args.length;
  36580. function res(i, val) {
  36581. try {
  36582. if (val && (typeof val === 'object' || typeof val === 'function')) {
  36583. var then = val.then;
  36584. if (typeof then === 'function') {
  36585. then.call(
  36586. val,
  36587. function(val) {
  36588. res(i, val);
  36589. },
  36590. reject
  36591. );
  36592. return;
  36593. }
  36594. }
  36595. args[i] = val;
  36596. if (--remaining === 0) {
  36597. resolve(args);
  36598. }
  36599. } catch (ex) {
  36600. reject(ex);
  36601. }
  36602. }
  36603. for (var i = 0; i < args.length; i++) {
  36604. res(i, args[i]);
  36605. }
  36606. });
  36607. };
  36608. Promise.allSettled = _allSettled__WEBPACK_IMPORTED_MODULE_1__["default"];
  36609. Promise.resolve = function(value) {
  36610. if (value && typeof value === 'object' && value.constructor === Promise) {
  36611. return value;
  36612. }
  36613. return new Promise(function(resolve) {
  36614. resolve(value);
  36615. });
  36616. };
  36617. Promise.reject = function(value) {
  36618. return new Promise(function(resolve, reject) {
  36619. reject(value);
  36620. });
  36621. };
  36622. Promise.race = function(arr) {
  36623. return new Promise(function(resolve, reject) {
  36624. if (!isArray(arr)) {
  36625. return reject(new TypeError('Promise.race accepts an array'));
  36626. }
  36627. for (var i = 0, len = arr.length; i < len; i++) {
  36628. Promise.resolve(arr[i]).then(resolve, reject);
  36629. }
  36630. });
  36631. };
  36632. // Use polyfill for setImmediate for performance gains
  36633. Promise._immediateFn =
  36634. // @ts-ignore
  36635. (typeof setImmediateFunc === 'function' &&
  36636. function(fn) {
  36637. // @ts-ignore
  36638. setImmediateFunc(fn);
  36639. }) ||
  36640. function(fn) {
  36641. setTimeoutFunc(fn, 0);
  36642. };
  36643. Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
  36644. if (typeof console !== 'undefined' && console) {
  36645. console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
  36646. }
  36647. };
  36648. /* harmony default export */ __webpack_exports__["default"] = (Promise);
  36649. /***/ }),
  36650. /***/ "./node_modules/promise-polyfill/src/polyfill.js":
  36651. /*!*******************************************************!*\
  36652. !*** ./node_modules/promise-polyfill/src/polyfill.js ***!
  36653. \*******************************************************/
  36654. /*! no exports provided */
  36655. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  36656. "use strict";
  36657. __webpack_require__.r(__webpack_exports__);
  36658. /* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index */ "./node_modules/promise-polyfill/src/index.js");
  36659. /* harmony import */ var _finally__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./finally */ "./node_modules/promise-polyfill/src/finally.js");
  36660. /* harmony import */ var _allSettled__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./allSettled */ "./node_modules/promise-polyfill/src/allSettled.js");
  36661. /** @suppress {undefinedVars} */
  36662. var globalNS = (function() {
  36663. // the only reliable means to get the global object is
  36664. // `Function('return this')()`
  36665. // However, this causes CSP violations in Chrome apps.
  36666. if (typeof self !== 'undefined') {
  36667. return self;
  36668. }
  36669. if (typeof window !== 'undefined') {
  36670. return window;
  36671. }
  36672. if (typeof global !== 'undefined') {
  36673. return global;
  36674. }
  36675. throw new Error('unable to locate global object');
  36676. })();
  36677. // Expose the polyfill if Promise is undefined or set to a
  36678. // non-function value. The latter can be due to a named HTMLElement
  36679. // being exposed by browsers for legacy reasons.
  36680. // https://github.com/taylorhakes/promise-polyfill/issues/114
  36681. if (typeof globalNS['Promise'] !== 'function') {
  36682. globalNS['Promise'] = _index__WEBPACK_IMPORTED_MODULE_0__["default"];
  36683. } else {
  36684. if (!globalNS.Promise.prototype['finally']) {
  36685. globalNS.Promise.prototype['finally'] = _finally__WEBPACK_IMPORTED_MODULE_1__["default"];
  36686. }
  36687. if (!globalNS.Promise.allSettled) {
  36688. globalNS.Promise.allSettled = _allSettled__WEBPACK_IMPORTED_MODULE_2__["default"];
  36689. }
  36690. }
  36691. /***/ }),
  36692. /***/ "./node_modules/webpack/buildin/amd-define.js":
  36693. /*!***************************************!*\
  36694. !*** (webpack)/buildin/amd-define.js ***!
  36695. \***************************************/
  36696. /*! no static exports found */
  36697. /***/ (function(module, exports) {
  36698. module.exports = function() {
  36699. throw new Error("define cannot be used indirect");
  36700. };
  36701. /***/ }),
  36702. /***/ "./node_modules/webpack/buildin/module.js":
  36703. /*!***********************************!*\
  36704. !*** (webpack)/buildin/module.js ***!
  36705. \***********************************/
  36706. /*! no static exports found */
  36707. /***/ (function(module, exports) {
  36708. module.exports = function(module) {
  36709. if (!module.webpackPolyfill) {
  36710. module.deprecate = function() {};
  36711. module.paths = [];
  36712. // module.parent = undefined by default
  36713. if (!module.children) module.children = [];
  36714. Object.defineProperty(module, "loaded", {
  36715. enumerable: true,
  36716. get: function() {
  36717. return module.l;
  36718. }
  36719. });
  36720. Object.defineProperty(module, "id", {
  36721. enumerable: true,
  36722. get: function() {
  36723. return module.i;
  36724. }
  36725. });
  36726. module.webpackPolyfill = 1;
  36727. }
  36728. return module;
  36729. };
  36730. /***/ }),
  36731. /***/ "./tests/test-streams.js":
  36732. /*!*******************************!*\
  36733. !*** ./tests/test-streams.js ***!
  36734. \*******************************/
  36735. /*! no static exports found */
  36736. /***/ (function(module, exports) {
  36737. /**
  36738. * Create test stream
  36739. * @param {string} url
  36740. * @param {string} description
  36741. * @param {boolean} [live]
  36742. * @param {boolean} [abr]
  36743. * @param {string[]} [skip_ua]
  36744. * @returns {{url: string, description: string, live: boolean, abr: boolean, skip_ua: string[]}}
  36745. */
  36746. function createTestStream(url, description, live, abr, skip_ua) {
  36747. if (live === void 0) {
  36748. live = false;
  36749. }
  36750. if (abr === void 0) {
  36751. abr = true;
  36752. }
  36753. if (skip_ua === void 0) {
  36754. skip_ua = [];
  36755. }
  36756. return {
  36757. url: url,
  36758. description: description,
  36759. live: live,
  36760. abr: abr,
  36761. skip_ua: skip_ua
  36762. };
  36763. }
  36764. /**
  36765. * @param {Object} target
  36766. * @param {Object} [config]
  36767. * @returns {{url: string, description: string, live: boolean, abr: boolean, skip_ua: string[]}}
  36768. */
  36769. function createTestStreamWithConfig(target, config) {
  36770. if (typeof target !== 'object') {
  36771. throw new Error('target should be object');
  36772. }
  36773. var testStream = createTestStream(target.url, target.description, target.live, target.abr, target.skip_ua);
  36774. testStream.config = config;
  36775. return testStream;
  36776. }
  36777. module.exports = {
  36778. bbb: {
  36779. url: 'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8',
  36780. description: 'Big Buck Bunny - adaptive qualities',
  36781. abr: true
  36782. },
  36783. fdr: {
  36784. url: 'https://cdn.jwplayer.com/manifests/pZxWPRg4.m3u8',
  36785. description: 'FDR - CDN packaged, 4s segments, 180p - 1080p',
  36786. abr: true
  36787. },
  36788. bigBuckBunny480p: {
  36789. url: 'https://test-streams.mux.dev/x36xhzz/url_6/193039199_mp4_h264_aac_hq_7.m3u8',
  36790. description: 'Big Buck Bunny - 480p only',
  36791. abr: false,
  36792. skip_ua: ['internet explorer']
  36793. },
  36794. arte: {
  36795. url: 'https://test-streams.mux.dev/test_001/stream.m3u8',
  36796. description: 'ARTE China,ABR',
  36797. abr: true
  36798. },
  36799. deltatreDAI: {
  36800. url: 'https://test-streams.mux.dev/dai-discontinuity-deltatre/manifest.m3u8',
  36801. description: 'Ad-insertion in event stream',
  36802. abr: false,
  36803. skip_ua: ['internet explorer']
  36804. },
  36805. issue666: {
  36806. url: 'https://playertest.longtailvideo.com/adaptive/issue666/playlists/cisq0gim60007xzvi505emlxx.m3u8',
  36807. description: 'Surveillance footage - https://github.com/video-dev/hls.js/issues/666',
  36808. abr: false,
  36809. skip_ua: ['internet explorer']
  36810. },
  36811. closedCaptions: {
  36812. url: 'https://playertest.longtailvideo.com/adaptive/captions/playlist.m3u8',
  36813. description: 'CNN special report, with CC',
  36814. abr: false
  36815. },
  36816. customIvBadDts: {
  36817. url: 'https://playertest.longtailvideo.com/adaptive/customIV/prog_index.m3u8',
  36818. description: 'Custom IV with bad PTS DTS',
  36819. abr: false
  36820. },
  36821. oceansAES: {
  36822. url: 'https://playertest.longtailvideo.com/adaptive/oceans_aes/oceans_aes.m3u8',
  36823. description: 'AES-128 encrypted, ABR',
  36824. abr: true
  36825. },
  36826. tracksWithAES: {
  36827. url: 'https://playertest.longtailvideo.com/adaptive/aes-with-tracks/master.m3u8',
  36828. description: 'AES-128 encrypted, TS main with AAC audio track',
  36829. abr: false
  36830. },
  36831. mp3Audio: {
  36832. url: 'https://playertest.longtailvideo.com/adaptive/vod-with-mp3/manifest.m3u8',
  36833. description: 'MP3 VOD demo',
  36834. abr: false
  36835. },
  36836. mpegAudioOnly: {
  36837. url: 'https://pl.streamingvideoprovider.com/mp3-playlist/playlist.m3u8',
  36838. description: 'MPEG Audio Only demo',
  36839. abr: false,
  36840. skip_ua: ['internet explorer', 'MicrosoftEdge', 'firefox']
  36841. },
  36842. fmp4: {
  36843. url: 'https://storage.googleapis.com/shaka-demo-assets/angel-one-hls/hls.m3u8',
  36844. description: 'HLS fMP4 Angel-One multiple audio-tracks',
  36845. abr: true,
  36846. skip_ua: ['internet explorer']
  36847. },
  36848. fmp4Bitmovin: {
  36849. url: 'https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s-fmp4/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8',
  36850. description: 'HLS fMP4 by Bitmovin',
  36851. abr: true,
  36852. skip_ua: ['internet explorer']
  36853. },
  36854. fmp4BitmovinHevc: {
  36855. url: 'https://bitmovin-a.akamaihd.net/content/dataset/multi-codec/hevc/stream_fmp4.m3u8',
  36856. description: 'HLS HEVC fMP4 by Bitmovin (Safari and Edge? only as of 2020-08)',
  36857. abr: true,
  36858. skip_ua: ['internet explorer'],
  36859. skipFunctionalTests: true
  36860. },
  36861. offset_pts: {
  36862. url: 'https://test-streams.mux.dev/pts_shift/master.m3u8',
  36863. description: 'DK Turntable, PTS shifted by 2.3s',
  36864. abr: true
  36865. },
  36866. angelOneShakaWidevine: createTestStreamWithConfig({
  36867. url: 'https://storage.googleapis.com/shaka-demo-assets/angel-one-widevine-hls/hls.m3u8',
  36868. description: 'Shaka-packager Widevine DRM (EME) HLS-fMP4 - Angel One Demo',
  36869. abr: true,
  36870. skip_ua: ['firefox', 'safari', 'internet explorer', {
  36871. name: 'chrome',
  36872. version: '69.0'
  36873. }]
  36874. }, {
  36875. widevineLicenseUrl: 'https://cwip-shaka-proxy.appspot.com/no_auth',
  36876. emeEnabled: true
  36877. }),
  36878. audioOnlyMultipleLevels: {
  36879. url: 'https://s3.amazonaws.com/qa.jwplayer.com/~alex/121628/new_master.m3u8',
  36880. description: 'Multiple non-alternate audio levels',
  36881. abr: true
  36882. },
  36883. pdtDuplicate: {
  36884. url: 'https://playertest.longtailvideo.com/adaptive/artbeats/manifest.m3u8',
  36885. description: 'Duplicate sequential PDT values',
  36886. abr: false
  36887. },
  36888. pdtLargeGap: {
  36889. url: 'https://playertest.longtailvideo.com/adaptive/boxee/playlist.m3u8',
  36890. description: 'PDTs with large gaps following discontinuities',
  36891. abr: false
  36892. },
  36893. pdtBadValues: {
  36894. url: 'https://playertest.longtailvideo.com/adaptive/progdatime/playlist2.m3u8',
  36895. description: 'PDTs with bad values',
  36896. abr: false
  36897. },
  36898. pdtOneValue: {
  36899. url: 'https://playertest.longtailvideo.com/adaptive/aviion/manifest.m3u8',
  36900. description: 'One PDT, no discontinuities',
  36901. abr: false
  36902. },
  36903. noTrackIntersection: createTestStreamWithConfig({
  36904. url: 'https://s3.amazonaws.com/qa.jwplayer.com/~alex/123633/new_master.m3u8',
  36905. description: 'Audio/video track PTS values do not intersect; 10 second start gap',
  36906. abr: false
  36907. }, {
  36908. avBufferOffset: 10.5
  36909. }),
  36910. altAudioAndTracks: {
  36911. // url: 'https://wowzaec2demo.streamlock.net/vod-multitrack/_definst_/smil:ElephantsDream/elephantsdream2.smil/playlist.m3u',
  36912. url: 'https://playertest.longtailvideo.com/adaptive/elephants_dream_v4/index.m3u8',
  36913. description: 'Alternate audio tracks, and multiple VTT tracks',
  36914. vendor: 'wowza',
  36915. abr: true
  36916. },
  36917. altAudioAudioOnly: createTestStreamWithConfig({
  36918. url: 'https://playertest.longtailvideo.com/adaptive/alt-audio-no-video/sintel/playlist.m3u8',
  36919. description: 'Audio only with alternate audio track (Sintel)',
  36920. abr: false
  36921. }, {
  36922. // the playlist segment durations are longer than the media. So much so, that when seeking near the end,
  36923. // the timeline shifts roughly 10 seconds seconds back, and as a result buffering skips several segments
  36924. // to adjust for the currentTime now being places at the very end of the stream.
  36925. allowedBufferedRangesInSeekTest: 3
  36926. }),
  36927. altAudioMultiAudioOnly: {
  36928. url: 'https://playertest.longtailvideo.com/adaptive/alt-audio-no-video/angel-one.m3u8',
  36929. description: 'Audio only with multiple alternate audio tracks (Angel One)',
  36930. abr: false
  36931. },
  36932. muxedFmp4: {
  36933. url: 'https://s3.amazonaws.com/qa.jwplayer.com/hlsjs/muxed-fmp4/hls.m3u8',
  36934. description: 'Muxed av fmp4 - appended to "audiovideo" SourceBuffer',
  36935. abr: false
  36936. },
  36937. altAudioWithPdtAndStartGap: {
  36938. url: 'https://playertest.longtailvideo.com/adaptive/hls-test-streams/test-audio-pdt/playlist.m3u8',
  36939. description: 'PDT before each segment, 1.59s start gap',
  36940. // Disable smooth switch on this stream. Test is flakey because of what looks like (auto)play issue. To be expected with this large a gap (for now).
  36941. // abr: true,
  36942. startSeek: true
  36943. },
  36944. AppleAdvancedHevcAvcHls: {
  36945. url: 'https://devstreaming-cdn.apple.com/videos/streaming/examples/bipbop_adv_example_hevc/master.m3u8',
  36946. description: 'Advanced stream (HEVC/H.264, AC-3/AAC, WebVTT, fMP4 segments)'
  36947. },
  36948. MuxLowLatencyHls: {
  36949. url: 'https://stream.mux.com/v69RSHhFelSm4701snP22dYz2jICy4E4FUyk02rW4gxRM.m3u8',
  36950. description: 'Low-Latency HLS sample of Big Buck Bunny loop and a timer. Restarts every 12 hours. (fMP4 segments)',
  36951. live: true
  36952. },
  36953. // AppleLowLatencyHls: {
  36954. // url: 'https://ll-hls-test.apple.com/master.m3u8',
  36955. // description: 'Apple Low-Latency HLS sample (TS segments)',
  36956. // live: true,
  36957. // },
  36958. // AppleLowLatencyCmafHls: {
  36959. // url: 'https://ll-hls-test.apple.com/cmaf/master.m3u8',
  36960. // description: 'Apple Low-Latency HLS sample (fMP4 segments)',
  36961. // live: true,
  36962. // },
  36963. groupIds: {
  36964. url: 'https://mtoczko.github.io/hls-test-streams/test-group/playlist.m3u8',
  36965. description: 'Group-id: subtitle and audio',
  36966. abr: true,
  36967. skipFunctionalTests: true
  36968. },
  36969. redundantLevelsWithTrackGroups: {
  36970. url: 'https://playertest.longtailvideo.com/adaptive/elephants_dream_v4/redundant.m3u8',
  36971. description: 'Redundant levels with subtitle and audio track groups',
  36972. abr: true,
  36973. skipFunctionalTests: true
  36974. }
  36975. };
  36976. /***/ })
  36977. /******/ })["default"];
  36978. });
  36979. //# sourceMappingURL=hls-demo.js.map