ngx-bootstrap-chronos.js 291 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863
  1. /**
  2. * @fileoverview added by tsickle
  3. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  4. */
  5. /**
  6. * @param {?} n
  7. * @param {?} x
  8. * @return {?}
  9. */
  10. function mod(n, x) {
  11. return (n % x + x) % x;
  12. }
  13. /**
  14. * @param {?} num
  15. * @return {?}
  16. */
  17. function absFloor(num) {
  18. return num < 0 ? Math.ceil(num) || 0 : Math.floor(num);
  19. }
  20. /**
  21. * @fileoverview added by tsickle
  22. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  23. */
  24. /**
  25. * @param {?} str
  26. * @return {?}
  27. */
  28. function isString(str) {
  29. return typeof str === 'string';
  30. }
  31. /**
  32. * @param {?} value
  33. * @return {?}
  34. */
  35. function isDate(value) {
  36. return value instanceof Date || Object.prototype.toString.call(value) === '[object Date]';
  37. }
  38. /**
  39. * @param {?} date
  40. * @return {?}
  41. */
  42. function isDateValid(date) {
  43. return date && date.getTime && !isNaN(date.getTime());
  44. }
  45. /**
  46. * @param {?} fn
  47. * @return {?}
  48. */
  49. function isFunction(fn) {
  50. return (fn instanceof Function ||
  51. Object.prototype.toString.call(fn) === '[object Function]');
  52. }
  53. /**
  54. * @param {?=} value
  55. * @return {?}
  56. */
  57. function isNumber(value) {
  58. return typeof value === 'number' || Object.prototype.toString.call(value) === '[object Number]';
  59. }
  60. /**
  61. * @template T
  62. * @param {?=} input
  63. * @return {?}
  64. */
  65. function isArray(input) {
  66. return (input instanceof Array ||
  67. Object.prototype.toString.call(input) === '[object Array]');
  68. }
  69. /**
  70. * @template T
  71. * @param {?} a
  72. * @param {?} b
  73. * @return {?}
  74. */
  75. function hasOwnProp(a /*object*/, b) {
  76. return Object.prototype.hasOwnProperty.call(a, b);
  77. }
  78. /**
  79. * @template T
  80. * @param {?} input
  81. * @return {?}
  82. */
  83. function isObject(input /*object*/) {
  84. // IE8 will treat undefined and null as object if it wasn't for
  85. // input != null
  86. return (input != null && Object.prototype.toString.call(input) === '[object Object]');
  87. }
  88. /**
  89. * @param {?} obj
  90. * @return {?}
  91. */
  92. function isObjectEmpty(obj) {
  93. if (Object.getOwnPropertyNames) {
  94. return (Object.getOwnPropertyNames(obj).length === 0);
  95. }
  96. /** @type {?} */
  97. let k;
  98. for (k in obj) {
  99. if (obj.hasOwnProperty(k)) {
  100. return false;
  101. }
  102. }
  103. return true;
  104. }
  105. /**
  106. * @param {?} input
  107. * @return {?}
  108. */
  109. function isUndefined(input) {
  110. return input === void 0;
  111. }
  112. /**
  113. * @template T
  114. * @param {?} argumentForCoercion
  115. * @return {?}
  116. */
  117. function toInt(argumentForCoercion) {
  118. /** @type {?} */
  119. const coercedNumber = +argumentForCoercion;
  120. /** @type {?} */
  121. let value = 0;
  122. if (coercedNumber !== 0 && isFinite(coercedNumber)) {
  123. value = absFloor(coercedNumber);
  124. }
  125. return value;
  126. }
  127. /**
  128. * @fileoverview added by tsickle
  129. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  130. */
  131. /** @type {?} */
  132. const aliases = {};
  133. /** @type {?} */
  134. const _mapUnits = {
  135. date: 'day',
  136. hour: 'hours',
  137. minute: 'minutes',
  138. second: 'seconds',
  139. millisecond: 'milliseconds'
  140. };
  141. /**
  142. * @param {?} unit
  143. * @param {?} shorthand
  144. * @return {?}
  145. */
  146. function addUnitAlias(unit, shorthand) {
  147. /** @type {?} */
  148. const lowerCase = unit.toLowerCase();
  149. /** @type {?} */
  150. let _unit = unit;
  151. if (lowerCase in _mapUnits) {
  152. _unit = _mapUnits[lowerCase];
  153. }
  154. aliases[lowerCase] = aliases[`${lowerCase}s`] = aliases[shorthand] = _unit;
  155. }
  156. /**
  157. * @param {?} units
  158. * @return {?}
  159. */
  160. function normalizeUnits(units) {
  161. return isString(units) ? aliases[units] || aliases[units.toLowerCase()] : undefined;
  162. }
  163. /**
  164. * @param {?} inputObject
  165. * @return {?}
  166. */
  167. function normalizeObjectUnits(inputObject) {
  168. /** @type {?} */
  169. const normalizedInput = {};
  170. /** @type {?} */
  171. let normalizedProp;
  172. /** @type {?} */
  173. let prop;
  174. for (prop in inputObject) {
  175. if (hasOwnProp(inputObject, prop)) {
  176. normalizedProp = normalizeUnits(prop);
  177. if (normalizedProp) {
  178. normalizedInput[normalizedProp] = inputObject[prop];
  179. }
  180. }
  181. }
  182. return (/** @type {?} */ (normalizedInput));
  183. }
  184. /**
  185. * @fileoverview added by tsickle
  186. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  187. */
  188. // place in new Date([array])
  189. /** @type {?} */
  190. const YEAR = 0;
  191. /** @type {?} */
  192. const MONTH = 1;
  193. /** @type {?} */
  194. const DATE = 2;
  195. /** @type {?} */
  196. const HOUR = 3;
  197. /** @type {?} */
  198. const MINUTE = 4;
  199. /** @type {?} */
  200. const SECOND = 5;
  201. /** @type {?} */
  202. const MILLISECOND = 6;
  203. /** @type {?} */
  204. const WEEK = 7;
  205. /** @type {?} */
  206. const WEEKDAY = 8;
  207. /**
  208. * @fileoverview added by tsickle
  209. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  210. */
  211. /**
  212. * @param {?} num
  213. * @param {?} targetLength
  214. * @param {?=} forceSign
  215. * @return {?}
  216. */
  217. function zeroFill(num, targetLength, forceSign) {
  218. /** @type {?} */
  219. const absNumber = `${Math.abs(num)}`;
  220. /** @type {?} */
  221. const zerosToFill = targetLength - absNumber.length;
  222. /** @type {?} */
  223. const sign = num >= 0;
  224. /** @type {?} */
  225. const _sign = sign ? (forceSign ? '+' : '') : '-';
  226. // todo: this is crazy slow
  227. /** @type {?} */
  228. const _zeros = Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1);
  229. return (_sign + _zeros + absNumber);
  230. }
  231. /**
  232. * @fileoverview added by tsickle
  233. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  234. */
  235. /** @type {?} */
  236. let formatFunctions = {};
  237. /** @type {?} */
  238. let formatTokenFunctions = {};
  239. // tslint:disable-next-line
  240. /** @type {?} */
  241. const formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
  242. // token: 'M'
  243. // padded: ['MM', 2]
  244. // ordinal: 'Mo'
  245. // callback: function () { this.month() + 1 }
  246. /**
  247. * @param {?} token
  248. * @param {?} padded
  249. * @param {?} ordinal
  250. * @param {?} callback
  251. * @return {?}
  252. */
  253. function addFormatToken(token, padded, ordinal, callback) {
  254. if (token) {
  255. formatTokenFunctions[token] = callback;
  256. }
  257. if (padded) {
  258. formatTokenFunctions[padded[0]] = (/**
  259. * @return {?}
  260. */
  261. function () {
  262. return zeroFill(callback.apply(null, arguments), padded[1], padded[2]);
  263. });
  264. }
  265. if (ordinal) {
  266. formatTokenFunctions[ordinal] = (/**
  267. * @param {?} date
  268. * @param {?} opts
  269. * @return {?}
  270. */
  271. function (date, opts) {
  272. return opts.locale.ordinal(callback.apply(null, arguments), token);
  273. });
  274. }
  275. }
  276. /**
  277. * @param {?} format
  278. * @return {?}
  279. */
  280. function makeFormatFunction(format) {
  281. /** @type {?} */
  282. const array = format.match(formattingTokens);
  283. /** @type {?} */
  284. const length = array.length;
  285. /** @type {?} */
  286. const formatArr = new Array(length);
  287. for (let i = 0; i < length; i++) {
  288. formatArr[i] = formatTokenFunctions[array[i]]
  289. ? formatTokenFunctions[array[i]]
  290. : removeFormattingTokens(array[i]);
  291. }
  292. return (/**
  293. * @param {?} date
  294. * @param {?} locale
  295. * @param {?} isUTC
  296. * @param {?=} offset
  297. * @return {?}
  298. */
  299. function (date, locale, isUTC, offset = 0) {
  300. /** @type {?} */
  301. let output = '';
  302. for (let j = 0; j < length; j++) {
  303. output += isFunction(formatArr[j])
  304. ? ((/** @type {?} */ (formatArr[j]))).call(null, date, { format, locale, isUTC, offset })
  305. : formatArr[j];
  306. }
  307. return output;
  308. });
  309. }
  310. /**
  311. * @param {?} input
  312. * @return {?}
  313. */
  314. function removeFormattingTokens(input) {
  315. if (input.match(/\[[\s\S]/)) {
  316. return input.replace(/^\[|\]$/g, '');
  317. }
  318. return input.replace(/\\/g, '');
  319. }
  320. /**
  321. * @fileoverview added by tsickle
  322. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  323. */
  324. /**
  325. * @param {?=} y
  326. * @param {?=} m
  327. * @param {?=} d
  328. * @return {?}
  329. */
  330. function createUTCDate(y, m, d) {
  331. /** @type {?} */
  332. const date = new Date(Date.UTC.apply(null, arguments));
  333. // the Date.UTC function remaps years 0-99 to 1900-1999
  334. if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) {
  335. date.setUTCFullYear(y);
  336. }
  337. return date;
  338. }
  339. /**
  340. * @param {?=} y
  341. * @param {?=} m
  342. * @param {?=} d
  343. * @param {?=} h
  344. * @param {?=} M
  345. * @param {?=} s
  346. * @param {?=} ms
  347. * @return {?}
  348. */
  349. function createDate(y, m = 0, d = 1, h = 0, M = 0, s = 0, ms = 0) {
  350. /** @type {?} */
  351. const date = new Date(y, m, d, h, M, s, ms);
  352. // the date constructor remaps years 0-99 to 1900-1999
  353. if (y < 100 && y >= 0 && isFinite(date.getFullYear())) {
  354. date.setFullYear(y);
  355. }
  356. return date;
  357. }
  358. /**
  359. * @fileoverview added by tsickle
  360. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  361. */
  362. /**
  363. * @param {?} date
  364. * @param {?=} isUTC
  365. * @return {?}
  366. */
  367. function getHours(date, isUTC = false) {
  368. return isUTC ? date.getUTCHours() : date.getHours();
  369. }
  370. /**
  371. * @param {?} date
  372. * @param {?=} isUTC
  373. * @return {?}
  374. */
  375. function getMinutes(date, isUTC = false) {
  376. return isUTC ? date.getUTCMinutes() : date.getMinutes();
  377. }
  378. /**
  379. * @param {?} date
  380. * @param {?=} isUTC
  381. * @return {?}
  382. */
  383. function getSeconds(date, isUTC = false) {
  384. return isUTC ? date.getUTCSeconds() : date.getSeconds();
  385. }
  386. /**
  387. * @param {?} date
  388. * @param {?=} isUTC
  389. * @return {?}
  390. */
  391. function getMilliseconds(date, isUTC = false) {
  392. return isUTC ? date.getUTCMilliseconds() : date.getMilliseconds();
  393. }
  394. /**
  395. * @param {?} date
  396. * @return {?}
  397. */
  398. function getTime(date) {
  399. return date.getTime();
  400. }
  401. /**
  402. * @param {?} date
  403. * @param {?=} isUTC
  404. * @return {?}
  405. */
  406. function getDay(date, isUTC = false) {
  407. return isUTC ? date.getUTCDay() : date.getDay();
  408. }
  409. /**
  410. * @param {?} date
  411. * @param {?=} isUTC
  412. * @return {?}
  413. */
  414. function getDate(date, isUTC = false) {
  415. return isUTC ? date.getUTCDate() : date.getDate();
  416. }
  417. /**
  418. * @param {?} date
  419. * @param {?=} isUTC
  420. * @return {?}
  421. */
  422. function getMonth(date, isUTC = false) {
  423. return isUTC ? date.getUTCMonth() : date.getMonth();
  424. }
  425. /**
  426. * @param {?} date
  427. * @param {?=} isUTC
  428. * @return {?}
  429. */
  430. function getFullYear(date, isUTC = false) {
  431. return isUTC ? date.getUTCFullYear() : date.getFullYear();
  432. }
  433. /**
  434. * @param {?} date
  435. * @return {?}
  436. */
  437. function unix(date) {
  438. return Math.floor(date.valueOf() / 1000);
  439. }
  440. /**
  441. * @param {?} date
  442. * @return {?}
  443. */
  444. function getFirstDayOfMonth(date) {
  445. return createDate(date.getFullYear(), date.getMonth(), 1, date.getHours(), date.getMinutes(), date.getSeconds());
  446. }
  447. /**
  448. * @param {?} date
  449. * @param {?} firstDayOfWeek
  450. * @return {?}
  451. */
  452. function isFirstDayOfWeek(date, firstDayOfWeek) {
  453. return date.getDay() === firstDayOfWeek;
  454. }
  455. /**
  456. * @param {?} date1
  457. * @param {?} date2
  458. * @return {?}
  459. */
  460. function isSameMonth(date1, date2) {
  461. if (!date1 || !date2) {
  462. return false;
  463. }
  464. return isSameYear(date1, date2) && getMonth(date1) === getMonth(date2);
  465. }
  466. /**
  467. * @param {?} date1
  468. * @param {?} date2
  469. * @return {?}
  470. */
  471. function isSameYear(date1, date2) {
  472. if (!date1 || !date2) {
  473. return false;
  474. }
  475. return getFullYear(date1) === getFullYear(date2);
  476. }
  477. /**
  478. * @param {?} date1
  479. * @param {?} date2
  480. * @return {?}
  481. */
  482. function isSameDay(date1, date2) {
  483. if (!date1 || !date2) {
  484. return false;
  485. }
  486. return (isSameYear(date1, date2) &&
  487. isSameMonth(date1, date2) &&
  488. getDate(date1) === getDate(date2));
  489. }
  490. /**
  491. * @fileoverview added by tsickle
  492. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  493. */
  494. /** @type {?} */
  495. const match1 = /\d/;
  496. // 0 - 9
  497. /** @type {?} */
  498. const match2 = /\d\d/;
  499. // 00 - 99
  500. /** @type {?} */
  501. const match3 = /\d{3}/;
  502. // 000 - 999
  503. /** @type {?} */
  504. const match4 = /\d{4}/;
  505. // 0000 - 9999
  506. /** @type {?} */
  507. const match6 = /[+-]?\d{6}/;
  508. // -999999 - 999999
  509. /** @type {?} */
  510. const match1to2 = /\d\d?/;
  511. // 0 - 99
  512. /** @type {?} */
  513. const match3to4 = /\d\d\d\d?/;
  514. // 999 - 9999
  515. /** @type {?} */
  516. const match5to6 = /\d\d\d\d\d\d?/;
  517. // 99999 - 999999
  518. /** @type {?} */
  519. const match1to3 = /\d{1,3}/;
  520. // 0 - 999
  521. /** @type {?} */
  522. const match1to4 = /\d{1,4}/;
  523. // 0 - 9999
  524. /** @type {?} */
  525. const match1to6 = /[+-]?\d{1,6}/;
  526. // -999999 - 999999
  527. /** @type {?} */
  528. const matchUnsigned = /\d+/;
  529. // 0 - inf
  530. /** @type {?} */
  531. const matchSigned = /[+-]?\d+/;
  532. // +00:00 -00:00 +0000 -0000 or Z
  533. /** @type {?} */
  534. const matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi;
  535. // +00 -00 +00:00 -00:00 +0000 -0000 or Z
  536. /** @type {?} */
  537. const matchTimestamp = /[+-]?\d+(\.\d{1,3})?/;
  538. // 123456789 123456789.123
  539. // any word (or two) characters or numbers including two/three word month in arabic.
  540. // includes scottish gaelic two word and hyphenated months
  541. // tslint:disable-next-line
  542. /** @type {?} */
  543. const matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;
  544. /** @type {?} */
  545. const regexes = {};
  546. /**
  547. * @param {?} token
  548. * @param {?} regex
  549. * @param {?=} strictRegex
  550. * @return {?}
  551. */
  552. function addRegexToken(token, regex, strictRegex) {
  553. if (isFunction(regex)) {
  554. regexes[token] = regex;
  555. return;
  556. }
  557. regexes[token] = (/**
  558. * @param {?} isStrict
  559. * @param {?} locale
  560. * @return {?}
  561. */
  562. function (isStrict, locale) {
  563. return (isStrict && strictRegex) ? strictRegex : regex;
  564. });
  565. }
  566. /**
  567. * @param {?} token
  568. * @param {?} locale
  569. * @return {?}
  570. */
  571. function getParseRegexForToken(token, locale) {
  572. /** @type {?} */
  573. const _strict = false;
  574. if (!hasOwnProp(regexes, token)) {
  575. return new RegExp(unescapeFormat(token));
  576. }
  577. return regexes[token](_strict, locale);
  578. }
  579. // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
  580. /**
  581. * @param {?} str
  582. * @return {?}
  583. */
  584. function unescapeFormat(str) {
  585. // tslint:disable-next-line
  586. return regexEscape(str
  587. .replace('\\', '')
  588. .replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, (/**
  589. * @param {?} matched
  590. * @param {?} p1
  591. * @param {?} p2
  592. * @param {?} p3
  593. * @param {?} p4
  594. * @return {?}
  595. */
  596. (matched, p1, p2, p3, p4) => p1 || p2 || p3 || p4)));
  597. }
  598. /**
  599. * @param {?} str
  600. * @return {?}
  601. */
  602. function regexEscape(str) {
  603. return str.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
  604. }
  605. /**
  606. * @fileoverview added by tsickle
  607. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  608. */
  609. /** @type {?} */
  610. const tokens = {};
  611. /**
  612. * @param {?} token
  613. * @param {?} callback
  614. * @return {?}
  615. */
  616. function addParseToken(token, callback) {
  617. /** @type {?} */
  618. const _token = isString(token) ? [token] : token;
  619. /** @type {?} */
  620. let func = callback;
  621. if (isNumber(callback)) {
  622. func = (/**
  623. * @param {?} input
  624. * @param {?} array
  625. * @param {?} config
  626. * @return {?}
  627. */
  628. function (input, array, config) {
  629. array[callback] = toInt(input);
  630. return config;
  631. });
  632. }
  633. if (isArray(_token) && isFunction(func)) {
  634. /** @type {?} */
  635. let i;
  636. for (i = 0; i < _token.length; i++) {
  637. tokens[_token[i]] = func;
  638. }
  639. }
  640. }
  641. /**
  642. * @param {?} token
  643. * @param {?} callback
  644. * @return {?}
  645. */
  646. function addWeekParseToken(token, callback) {
  647. addParseToken(token, (/**
  648. * @param {?} input
  649. * @param {?} array
  650. * @param {?} config
  651. * @param {?} _token
  652. * @return {?}
  653. */
  654. function (input, array, config, _token) {
  655. config._w = config._w || {};
  656. return callback(input, config._w, config, _token);
  657. }));
  658. }
  659. /**
  660. * @param {?} token
  661. * @param {?} input
  662. * @param {?} config
  663. * @return {?}
  664. */
  665. function addTimeToArrayFromToken(token, input, config) {
  666. if (input != null && hasOwnProp(tokens, token)) {
  667. tokens[token](input, config._a, config, token);
  668. }
  669. return config;
  670. }
  671. /**
  672. * @fileoverview added by tsickle
  673. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  674. */
  675. /**
  676. * @return {?}
  677. */
  678. function initDayOfMonth() {
  679. // FORMATTING
  680. addFormatToken('D', ['DD', 2, false], 'Do', (/**
  681. * @param {?} date
  682. * @param {?} opts
  683. * @return {?}
  684. */
  685. function (date, opts) {
  686. return getDate(date, opts.isUTC)
  687. .toString(10);
  688. }));
  689. // ALIASES
  690. addUnitAlias('date', 'D');
  691. // PARSING
  692. addRegexToken('D', match1to2);
  693. addRegexToken('DD', match1to2, match2);
  694. addRegexToken('Do', (/**
  695. * @param {?} isStrict
  696. * @param {?} locale
  697. * @return {?}
  698. */
  699. function (isStrict, locale) {
  700. return locale._dayOfMonthOrdinalParse || locale._ordinalParse;
  701. }));
  702. addParseToken(['D', 'DD'], DATE);
  703. addParseToken('Do', (/**
  704. * @param {?} input
  705. * @param {?} array
  706. * @param {?} config
  707. * @return {?}
  708. */
  709. function (input, array, config) {
  710. array[DATE] = toInt(input.match(match1to2)[0]);
  711. return config;
  712. }));
  713. }
  714. /**
  715. * @fileoverview added by tsickle
  716. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  717. */
  718. /**
  719. * @return {?}
  720. */
  721. function defaultParsingFlags() {
  722. // We need to deep clone this object.
  723. return {
  724. empty: false,
  725. unusedTokens: [],
  726. unusedInput: [],
  727. overflow: -2,
  728. charsLeftOver: 0,
  729. nullInput: false,
  730. invalidMonth: null,
  731. invalidFormat: false,
  732. userInvalidated: false,
  733. iso: false,
  734. parsedDateParts: [],
  735. meridiem: null,
  736. rfc2822: false,
  737. weekdayMismatch: false
  738. };
  739. }
  740. /**
  741. * @param {?} config
  742. * @return {?}
  743. */
  744. function getParsingFlags(config) {
  745. if (config._pf == null) {
  746. config._pf = defaultParsingFlags();
  747. }
  748. return config._pf;
  749. }
  750. /**
  751. * @fileoverview added by tsickle
  752. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  753. */
  754. // FORMATTING
  755. /**
  756. * @param {?} date
  757. * @param {?} opts
  758. * @return {?}
  759. */
  760. function getYear(date, opts) {
  761. return getFullYear(date, opts.isUTC).toString();
  762. }
  763. /**
  764. * @return {?}
  765. */
  766. function initYear() {
  767. addFormatToken('Y', null, null, (/**
  768. * @param {?} date
  769. * @param {?} opts
  770. * @return {?}
  771. */
  772. function (date, opts) {
  773. /** @type {?} */
  774. const y = getFullYear(date, opts.isUTC);
  775. return y <= 9999 ? y.toString(10) : `+${y}`;
  776. }));
  777. addFormatToken(null, ['YY', 2, false], null, (/**
  778. * @param {?} date
  779. * @param {?} opts
  780. * @return {?}
  781. */
  782. function (date, opts) {
  783. return (getFullYear(date, opts.isUTC) % 100).toString(10);
  784. }));
  785. addFormatToken(null, ['YYYY', 4, false], null, getYear);
  786. addFormatToken(null, ['YYYYY', 5, false], null, getYear);
  787. addFormatToken(null, ['YYYYYY', 6, true], null, getYear);
  788. // ALIASES
  789. addUnitAlias('year', 'y');
  790. // PARSING
  791. addRegexToken('Y', matchSigned);
  792. addRegexToken('YY', match1to2, match2);
  793. addRegexToken('YYYY', match1to4, match4);
  794. addRegexToken('YYYYY', match1to6, match6);
  795. addRegexToken('YYYYYY', match1to6, match6);
  796. addParseToken(['YYYYY', 'YYYYYY'], YEAR);
  797. addParseToken('YYYY', (/**
  798. * @param {?} input
  799. * @param {?} array
  800. * @param {?} config
  801. * @return {?}
  802. */
  803. function (input, array, config) {
  804. array[YEAR] = input.length === 2 ? parseTwoDigitYear(input) : toInt(input);
  805. return config;
  806. }));
  807. addParseToken('YY', (/**
  808. * @param {?} input
  809. * @param {?} array
  810. * @param {?} config
  811. * @return {?}
  812. */
  813. function (input, array, config) {
  814. array[YEAR] = parseTwoDigitYear(input);
  815. return config;
  816. }));
  817. addParseToken('Y', (/**
  818. * @param {?} input
  819. * @param {?} array
  820. * @param {?} config
  821. * @return {?}
  822. */
  823. function (input, array, config) {
  824. array[YEAR] = parseInt(input, 10);
  825. return config;
  826. }));
  827. }
  828. /**
  829. * @param {?} input
  830. * @return {?}
  831. */
  832. function parseTwoDigitYear(input) {
  833. return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
  834. }
  835. /**
  836. * @param {?} year
  837. * @return {?}
  838. */
  839. function daysInYear(year) {
  840. return isLeapYear(year) ? 366 : 365;
  841. }
  842. /**
  843. * @param {?} year
  844. * @return {?}
  845. */
  846. function isLeapYear(year) {
  847. return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
  848. }
  849. /**
  850. * @fileoverview added by tsickle
  851. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  852. */
  853. // todo: this is duplicate, source in date-getters.ts
  854. /**
  855. * @param {?} year
  856. * @param {?} month
  857. * @return {?}
  858. */
  859. function daysInMonth(year, month) {
  860. if (isNaN(year) || isNaN(month)) {
  861. return NaN;
  862. }
  863. /** @type {?} */
  864. const modMonth = mod(month, 12);
  865. /** @type {?} */
  866. const _year = year + (month - modMonth) / 12;
  867. return modMonth === 1
  868. ? isLeapYear(_year) ? 29 : 28
  869. : (31 - modMonth % 7 % 2);
  870. }
  871. /**
  872. * @return {?}
  873. */
  874. function initMonth() {
  875. // FORMATTING
  876. addFormatToken('M', ['MM', 2, false], 'Mo', (/**
  877. * @param {?} date
  878. * @param {?} opts
  879. * @return {?}
  880. */
  881. function (date, opts) {
  882. return (getMonth(date, opts.isUTC) + 1).toString(10);
  883. }));
  884. addFormatToken('MMM', null, null, (/**
  885. * @param {?} date
  886. * @param {?} opts
  887. * @return {?}
  888. */
  889. function (date, opts) {
  890. return opts.locale.monthsShort(date, opts.format, opts.isUTC);
  891. }));
  892. addFormatToken('MMMM', null, null, (/**
  893. * @param {?} date
  894. * @param {?} opts
  895. * @return {?}
  896. */
  897. function (date, opts) {
  898. return opts.locale.months(date, opts.format, opts.isUTC);
  899. }));
  900. // ALIASES
  901. addUnitAlias('month', 'M');
  902. // PARSING
  903. addRegexToken('M', match1to2);
  904. addRegexToken('MM', match1to2, match2);
  905. addRegexToken('MMM', (/**
  906. * @param {?} isStrict
  907. * @param {?} locale
  908. * @return {?}
  909. */
  910. function (isStrict, locale) {
  911. return locale.monthsShortRegex(isStrict);
  912. }));
  913. addRegexToken('MMMM', (/**
  914. * @param {?} isStrict
  915. * @param {?} locale
  916. * @return {?}
  917. */
  918. function (isStrict, locale) {
  919. return locale.monthsRegex(isStrict);
  920. }));
  921. addParseToken(['M', 'MM'], (/**
  922. * @param {?} input
  923. * @param {?} array
  924. * @param {?} config
  925. * @return {?}
  926. */
  927. function (input, array, config) {
  928. array[MONTH] = toInt(input) - 1;
  929. return config;
  930. }));
  931. addParseToken(['MMM', 'MMMM'], (/**
  932. * @param {?} input
  933. * @param {?} array
  934. * @param {?} config
  935. * @param {?} token
  936. * @return {?}
  937. */
  938. function (input, array, config, token) {
  939. /** @type {?} */
  940. const month = config._locale.monthsParse(input, token, config._strict);
  941. // if we didn't find a month name, mark the date as invalid.
  942. if (month != null) {
  943. array[MONTH] = month;
  944. }
  945. else {
  946. getParsingFlags(config).invalidMonth = !!input;
  947. }
  948. return config;
  949. }));
  950. }
  951. /**
  952. * @fileoverview added by tsickle
  953. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  954. */
  955. /** @type {?} */
  956. const defaultTimeUnit = {
  957. year: 0,
  958. month: 0,
  959. day: 0,
  960. hour: 0,
  961. minute: 0,
  962. seconds: 0
  963. };
  964. /**
  965. * @param {?} date
  966. * @param {?} unit
  967. * @return {?}
  968. */
  969. function shiftDate(date, unit) {
  970. /** @type {?} */
  971. const _unit = Object.assign({}, defaultTimeUnit, unit);
  972. /** @type {?} */
  973. const year = date.getFullYear() + (_unit.year || 0);
  974. /** @type {?} */
  975. const month = date.getMonth() + (_unit.month || 0);
  976. /** @type {?} */
  977. let day = date.getDate() + (_unit.day || 0);
  978. if (_unit.month && !_unit.day) {
  979. day = Math.min(day, daysInMonth(year, month));
  980. }
  981. return createDate(year, month, day, date.getHours() + (_unit.hour || 0), date.getMinutes() + (_unit.minute || 0), date.getSeconds() + (_unit.seconds || 0));
  982. }
  983. /**
  984. * @param {?} date
  985. * @param {?} unit
  986. * @return {?}
  987. */
  988. function setFullDate(date, unit) {
  989. return createDate(getNum(date.getFullYear(), unit.year), getNum(date.getMonth(), unit.month), 1, // day, to avoid issue with wrong months selection at the end of current month (#5371)
  990. getNum(date.getHours(), unit.hour), getNum(date.getMinutes(), unit.minute), getNum(date.getSeconds(), unit.seconds), getNum(date.getMilliseconds(), unit.milliseconds));
  991. }
  992. /**
  993. * @param {?} def
  994. * @param {?=} num
  995. * @return {?}
  996. */
  997. function getNum(def, num) {
  998. return isNumber(num) ? num : def;
  999. }
  1000. /**
  1001. * @param {?} date
  1002. * @param {?} value
  1003. * @param {?=} isUTC
  1004. * @return {?}
  1005. */
  1006. function setMonth(date, value, isUTC) {
  1007. /** @type {?} */
  1008. const dayOfMonth = Math.min(getDate(date), daysInMonth(getFullYear(date), value));
  1009. isUTC ? date.setUTCMonth(value, dayOfMonth) : date.setMonth(value, dayOfMonth);
  1010. return date;
  1011. }
  1012. /**
  1013. * @param {?} date
  1014. * @param {?} value
  1015. * @param {?=} isUTC
  1016. * @return {?}
  1017. */
  1018. function setHours(date, value, isUTC) {
  1019. isUTC ? date.setUTCHours(value) : date.setHours(value);
  1020. return date;
  1021. }
  1022. /**
  1023. * @param {?} date
  1024. * @param {?} value
  1025. * @param {?=} isUTC
  1026. * @return {?}
  1027. */
  1028. function setMinutes(date, value, isUTC) {
  1029. isUTC ? date.setUTCMinutes(value) : date.setMinutes(value);
  1030. return date;
  1031. }
  1032. /**
  1033. * @param {?} date
  1034. * @param {?} value
  1035. * @param {?=} isUTC
  1036. * @return {?}
  1037. */
  1038. function setSeconds(date, value, isUTC) {
  1039. isUTC ? date.setUTCSeconds(value) : date.setSeconds(value);
  1040. return date;
  1041. }
  1042. /**
  1043. * @param {?} date
  1044. * @param {?} value
  1045. * @param {?=} isUTC
  1046. * @return {?}
  1047. */
  1048. function setMilliseconds(date, value, isUTC) {
  1049. isUTC ? date.setUTCMilliseconds(value) : date.setMilliseconds(value);
  1050. return date;
  1051. }
  1052. /**
  1053. * @param {?} date
  1054. * @param {?} value
  1055. * @param {?=} isUTC
  1056. * @return {?}
  1057. */
  1058. function setDate(date, value, isUTC) {
  1059. isUTC ? date.setUTCDate(value) : date.setDate(value);
  1060. return date;
  1061. }
  1062. /**
  1063. * @param {?} date
  1064. * @param {?} value
  1065. * @return {?}
  1066. */
  1067. function setTime(date, value) {
  1068. date.setTime(value);
  1069. return date;
  1070. }
  1071. /**
  1072. * @fileoverview added by tsickle
  1073. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1074. */
  1075. // fastest way to clone date
  1076. // https://jsperf.com/clone-date-object2
  1077. /**
  1078. * @param {?} date
  1079. * @return {?}
  1080. */
  1081. function cloneDate(date) {
  1082. return new Date(date.getTime());
  1083. }
  1084. /**
  1085. * @fileoverview added by tsickle
  1086. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1087. */
  1088. /**
  1089. * @param {?} date
  1090. * @param {?} unit
  1091. * @param {?=} isUTC
  1092. * @return {?}
  1093. */
  1094. function startOf(date, unit, isUTC) {
  1095. /** @type {?} */
  1096. const _date = cloneDate(date);
  1097. // the following switch intentionally omits break keywords
  1098. // to utilize falling through the cases.
  1099. switch (unit) {
  1100. case 'year':
  1101. setMonth(_date, 0, isUTC);
  1102. /* falls through */
  1103. case 'quarter':
  1104. case 'month':
  1105. setDate(_date, 1, isUTC);
  1106. /* falls through */
  1107. case 'week':
  1108. case 'isoWeek':
  1109. case 'day':
  1110. case 'date':
  1111. setHours(_date, 0, isUTC);
  1112. /* falls through */
  1113. case 'hours':
  1114. setMinutes(_date, 0, isUTC);
  1115. /* falls through */
  1116. case 'minutes':
  1117. setSeconds(_date, 0, isUTC);
  1118. /* falls through */
  1119. case 'seconds':
  1120. setMilliseconds(_date, 0, isUTC);
  1121. }
  1122. // weeks are a special case
  1123. if (unit === 'week') {
  1124. setLocaleDayOfWeek(_date, 0, { isUTC });
  1125. }
  1126. if (unit === 'isoWeek') {
  1127. setISODayOfWeek(_date, 1);
  1128. }
  1129. // quarters are also special
  1130. if (unit === 'quarter') {
  1131. setMonth(_date, Math.floor(getMonth(_date, isUTC) / 3) * 3, isUTC);
  1132. }
  1133. return _date;
  1134. }
  1135. /**
  1136. * @param {?} date
  1137. * @param {?} unit
  1138. * @param {?=} isUTC
  1139. * @return {?}
  1140. */
  1141. function endOf(date, unit, isUTC) {
  1142. /** @type {?} */
  1143. let _unit = unit;
  1144. // 'date' is an alias for 'day', so it should be considered as such.
  1145. if (_unit === 'date') {
  1146. _unit = 'day';
  1147. }
  1148. /** @type {?} */
  1149. const start = startOf(date, _unit, isUTC);
  1150. /** @type {?} */
  1151. const _step = add(start, 1, _unit === 'isoWeek' ? 'week' : _unit, isUTC);
  1152. /** @type {?} */
  1153. const res = subtract(_step, 1, 'milliseconds', isUTC);
  1154. return res;
  1155. }
  1156. /**
  1157. * @fileoverview added by tsickle
  1158. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1159. */
  1160. /**
  1161. * @return {?}
  1162. */
  1163. function initDayOfYear() {
  1164. // FORMATTING
  1165. addFormatToken('DDD', ['DDDD', 3, false], 'DDDo', (/**
  1166. * @param {?} date
  1167. * @return {?}
  1168. */
  1169. function (date) {
  1170. return getDayOfYear(date)
  1171. .toString(10);
  1172. }));
  1173. // ALIASES
  1174. addUnitAlias('dayOfYear', 'DDD');
  1175. addRegexToken('DDD', match1to3);
  1176. addRegexToken('DDDD', match3);
  1177. addParseToken(['DDD', 'DDDD'], (/**
  1178. * @param {?} input
  1179. * @param {?} array
  1180. * @param {?} config
  1181. * @return {?}
  1182. */
  1183. function (input, array, config) {
  1184. config._dayOfYear = toInt(input);
  1185. return config;
  1186. }));
  1187. }
  1188. /**
  1189. * @param {?} date
  1190. * @param {?=} isUTC
  1191. * @return {?}
  1192. */
  1193. function getDayOfYear(date, isUTC) {
  1194. /** @type {?} */
  1195. const date1 = +startOf(date, 'day', isUTC);
  1196. /** @type {?} */
  1197. const date2 = +startOf(date, 'year', isUTC);
  1198. /** @type {?} */
  1199. const someDate = date1 - date2;
  1200. /** @type {?} */
  1201. const oneDay = 1000 * 60 * 60 * 24;
  1202. return Math.round(someDate / oneDay) + 1;
  1203. }
  1204. /**
  1205. * @fileoverview added by tsickle
  1206. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1207. */
  1208. /**
  1209. * @param {?} year
  1210. * @param {?} dow
  1211. * @param {?} doy
  1212. * @return {?}
  1213. */
  1214. function firstWeekOffset(year, dow, doy) {
  1215. // first-week day -- which january is always in the first week (4 for iso, 1 for other)
  1216. /** @type {?} */
  1217. const fwd = dow - doy + 7;
  1218. // first-week day local weekday -- which local weekday is fwd
  1219. /** @type {?} */
  1220. const fwdlw = (createUTCDate(year, 0, fwd).getUTCDay() - dow + 7) % 7;
  1221. return -fwdlw + fwd - 1;
  1222. }
  1223. // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
  1224. /**
  1225. * @param {?} year
  1226. * @param {?} week
  1227. * @param {?} weekday
  1228. * @param {?} dow
  1229. * @param {?} doy
  1230. * @return {?}
  1231. */
  1232. function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
  1233. /** @type {?} */
  1234. const localWeekday = (7 + weekday - dow) % 7;
  1235. /** @type {?} */
  1236. const weekOffset = firstWeekOffset(year, dow, doy);
  1237. /** @type {?} */
  1238. const dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset;
  1239. /** @type {?} */
  1240. let resYear;
  1241. /** @type {?} */
  1242. let resDayOfYear;
  1243. if (dayOfYear <= 0) {
  1244. resYear = year - 1;
  1245. resDayOfYear = daysInYear(resYear) + dayOfYear;
  1246. }
  1247. else if (dayOfYear > daysInYear(year)) {
  1248. resYear = year + 1;
  1249. resDayOfYear = dayOfYear - daysInYear(year);
  1250. }
  1251. else {
  1252. resYear = year;
  1253. resDayOfYear = dayOfYear;
  1254. }
  1255. return {
  1256. year: resYear,
  1257. dayOfYear: resDayOfYear
  1258. };
  1259. }
  1260. /**
  1261. * @param {?} date
  1262. * @param {?} dow
  1263. * @param {?} doy
  1264. * @param {?=} isUTC
  1265. * @return {?}
  1266. */
  1267. function weekOfYear(date, dow, doy, isUTC) {
  1268. /** @type {?} */
  1269. const weekOffset = firstWeekOffset(getFullYear(date, isUTC), dow, doy);
  1270. /** @type {?} */
  1271. const week = Math.floor((getDayOfYear(date, isUTC) - weekOffset - 1) / 7) + 1;
  1272. /** @type {?} */
  1273. let resWeek;
  1274. /** @type {?} */
  1275. let resYear;
  1276. if (week < 1) {
  1277. resYear = getFullYear(date, isUTC) - 1;
  1278. resWeek = week + weeksInYear(resYear, dow, doy);
  1279. }
  1280. else if (week > weeksInYear(getFullYear(date, isUTC), dow, doy)) {
  1281. resWeek = week - weeksInYear(getFullYear(date, isUTC), dow, doy);
  1282. resYear = getFullYear(date, isUTC) + 1;
  1283. }
  1284. else {
  1285. resYear = getFullYear(date, isUTC);
  1286. resWeek = week;
  1287. }
  1288. return {
  1289. week: resWeek,
  1290. year: resYear
  1291. };
  1292. }
  1293. /**
  1294. * @param {?} year
  1295. * @param {?} dow
  1296. * @param {?} doy
  1297. * @return {?}
  1298. */
  1299. function weeksInYear(year, dow, doy) {
  1300. /** @type {?} */
  1301. const weekOffset = firstWeekOffset(year, dow, doy);
  1302. /** @type {?} */
  1303. const weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
  1304. return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
  1305. }
  1306. /**
  1307. * @fileoverview added by tsickle
  1308. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  1309. */
  1310. /** @type {?} */
  1311. const MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/;
  1312. /** @type {?} */
  1313. const defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_');
  1314. /** @type {?} */
  1315. const defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_');
  1316. /** @type {?} */
  1317. const defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_');
  1318. /** @type {?} */
  1319. const defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_');
  1320. /** @type {?} */
  1321. const defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_');
  1322. /** @type {?} */
  1323. const defaultLongDateFormat = {
  1324. LTS: 'h:mm:ss A',
  1325. LT: 'h:mm A',
  1326. L: 'MM/DD/YYYY',
  1327. LL: 'MMMM D, YYYY',
  1328. LLL: 'MMMM D, YYYY h:mm A',
  1329. LLLL: 'dddd, MMMM D, YYYY h:mm A'
  1330. };
  1331. /** @type {?} */
  1332. const defaultOrdinal = '%d';
  1333. /** @type {?} */
  1334. const defaultDayOfMonthOrdinalParse = /\d{1,2}/;
  1335. /** @type {?} */
  1336. const defaultMonthsShortRegex = matchWord;
  1337. /** @type {?} */
  1338. const defaultMonthsRegex = matchWord;
  1339. class Locale {
  1340. /**
  1341. * @param {?} config
  1342. */
  1343. constructor(config) {
  1344. if (!!config) {
  1345. this.set(config);
  1346. }
  1347. }
  1348. /**
  1349. * @param {?} config
  1350. * @return {?}
  1351. */
  1352. set(config) {
  1353. /** @type {?} */
  1354. let confKey;
  1355. for (confKey in config) {
  1356. if (!config.hasOwnProperty(confKey)) {
  1357. continue;
  1358. }
  1359. /** @type {?} */
  1360. const prop = config[(/** @type {?} */ (confKey))];
  1361. /** @type {?} */
  1362. const key = (/** @type {?} */ ((isFunction(prop) ? confKey : `_${confKey}`)));
  1363. this[key] = (/** @type {?} */ (prop));
  1364. }
  1365. this._config = config;
  1366. }
  1367. /**
  1368. * @param {?} key
  1369. * @param {?} date
  1370. * @param {?} now
  1371. * @return {?}
  1372. */
  1373. calendar(key, date, now) {
  1374. /** @type {?} */
  1375. const output = this._calendar[key] || this._calendar.sameElse;
  1376. return isFunction(output) ? output.call(null, date, now) : output;
  1377. }
  1378. /**
  1379. * @param {?} key
  1380. * @return {?}
  1381. */
  1382. longDateFormat(key) {
  1383. /** @type {?} */
  1384. const format = this._longDateFormat[key];
  1385. /** @type {?} */
  1386. const formatUpper = this._longDateFormat[key.toUpperCase()];
  1387. if (format || !formatUpper) {
  1388. return format;
  1389. }
  1390. this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, (/**
  1391. * @param {?} val
  1392. * @return {?}
  1393. */
  1394. function (val) {
  1395. return val.slice(1);
  1396. }));
  1397. return this._longDateFormat[key];
  1398. }
  1399. /**
  1400. * @return {?}
  1401. */
  1402. get invalidDate() {
  1403. return this._invalidDate;
  1404. }
  1405. /**
  1406. * @param {?} val
  1407. * @return {?}
  1408. */
  1409. set invalidDate(val) {
  1410. this._invalidDate = val;
  1411. }
  1412. /**
  1413. * @param {?} num
  1414. * @param {?=} token
  1415. * @return {?}
  1416. */
  1417. ordinal(num, token) {
  1418. return this._ordinal.replace('%d', num.toString(10));
  1419. }
  1420. /**
  1421. * @param {?} str
  1422. * @return {?}
  1423. */
  1424. preparse(str) {
  1425. return str;
  1426. }
  1427. /**
  1428. * @param {?} str
  1429. * @return {?}
  1430. */
  1431. postformat(str) {
  1432. return str;
  1433. }
  1434. /**
  1435. * @param {?} num
  1436. * @param {?} withoutSuffix
  1437. * @param {?} str
  1438. * @param {?} isFuture
  1439. * @return {?}
  1440. */
  1441. relativeTime(num, withoutSuffix, str, isFuture) {
  1442. /** @type {?} */
  1443. const output = this._relativeTime[str];
  1444. return (isFunction(output)) ?
  1445. output(num, withoutSuffix, str, isFuture) :
  1446. output.replace(/%d/i, num.toString(10));
  1447. }
  1448. /**
  1449. * @param {?} diff
  1450. * @param {?} output
  1451. * @return {?}
  1452. */
  1453. pastFuture(diff, output) {
  1454. /** @type {?} */
  1455. const format = this._relativeTime[diff > 0 ? 'future' : 'past'];
  1456. return isFunction(format) ? format(output) : format.replace(/%s/i, output);
  1457. }
  1458. /**
  1459. * @param {?=} date
  1460. * @param {?=} format
  1461. * @param {?=} isUTC
  1462. * @return {?}
  1463. */
  1464. months(date, format, isUTC = false) {
  1465. if (!date) {
  1466. return isArray(this._months)
  1467. ? this._months
  1468. : this._months.standalone;
  1469. }
  1470. if (isArray(this._months)) {
  1471. return this._months[getMonth(date, isUTC)];
  1472. }
  1473. /** @type {?} */
  1474. const key = (this._months.isFormat || MONTHS_IN_FORMAT).test(format)
  1475. ? 'format'
  1476. : 'standalone';
  1477. return this._months[key][getMonth(date, isUTC)];
  1478. }
  1479. /**
  1480. * @param {?=} date
  1481. * @param {?=} format
  1482. * @param {?=} isUTC
  1483. * @return {?}
  1484. */
  1485. monthsShort(date, format, isUTC = false) {
  1486. if (!date) {
  1487. return isArray(this._monthsShort)
  1488. ? this._monthsShort
  1489. : this._monthsShort.standalone;
  1490. }
  1491. if (isArray(this._monthsShort)) {
  1492. return this._monthsShort[getMonth(date, isUTC)];
  1493. }
  1494. /** @type {?} */
  1495. const key = MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone';
  1496. return this._monthsShort[key][getMonth(date, isUTC)];
  1497. }
  1498. /**
  1499. * @param {?} monthName
  1500. * @param {?=} format
  1501. * @param {?=} strict
  1502. * @return {?}
  1503. */
  1504. monthsParse(monthName, format, strict) {
  1505. /** @type {?} */
  1506. let date;
  1507. /** @type {?} */
  1508. let regex;
  1509. if (this._monthsParseExact) {
  1510. return this.handleMonthStrictParse(monthName, format, strict);
  1511. }
  1512. if (!this._monthsParse) {
  1513. this._monthsParse = [];
  1514. this._longMonthsParse = [];
  1515. this._shortMonthsParse = [];
  1516. }
  1517. // TODO: add sorting
  1518. // Sorting makes sure if one month (or abbr) is a prefix of another
  1519. // see sorting in computeMonthsParse
  1520. /** @type {?} */
  1521. let i;
  1522. for (i = 0; i < 12; i++) {
  1523. // make the regex if we don't have it already
  1524. date = new Date(Date.UTC(2000, i));
  1525. if (strict && !this._longMonthsParse[i]) {
  1526. /** @type {?} */
  1527. const _months = this.months(date, '', true).replace('.', '');
  1528. /** @type {?} */
  1529. const _shortMonths = this.monthsShort(date, '', true).replace('.', '');
  1530. this._longMonthsParse[i] = new RegExp(`^${_months}$`, 'i');
  1531. this._shortMonthsParse[i] = new RegExp(`^${_shortMonths}$`, 'i');
  1532. }
  1533. if (!strict && !this._monthsParse[i]) {
  1534. regex = `^${this.months(date, '', true)}|^${this.monthsShort(date, '', true)}`;
  1535. this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
  1536. }
  1537. // test the regex
  1538. if (strict && format === 'MMMM' && ((/** @type {?} */ (this._longMonthsParse[i]))).test(monthName)) {
  1539. return i;
  1540. }
  1541. if (strict && format === 'MMM' && ((/** @type {?} */ (this._shortMonthsParse[i]))).test(monthName)) {
  1542. return i;
  1543. }
  1544. if (!strict && this._monthsParse[i].test(monthName)) {
  1545. return i;
  1546. }
  1547. }
  1548. }
  1549. /**
  1550. * @param {?} isStrict
  1551. * @return {?}
  1552. */
  1553. monthsRegex(isStrict) {
  1554. if (this._monthsParseExact) {
  1555. if (!hasOwnProp(this, '_monthsRegex')) {
  1556. this.computeMonthsParse();
  1557. }
  1558. if (isStrict) {
  1559. return this._monthsStrictRegex;
  1560. }
  1561. return this._monthsRegex;
  1562. }
  1563. if (!hasOwnProp(this, '_monthsRegex')) {
  1564. this._monthsRegex = defaultMonthsRegex;
  1565. }
  1566. return this._monthsStrictRegex && isStrict ?
  1567. this._monthsStrictRegex : this._monthsRegex;
  1568. }
  1569. /**
  1570. * @param {?} isStrict
  1571. * @return {?}
  1572. */
  1573. monthsShortRegex(isStrict) {
  1574. if (this._monthsParseExact) {
  1575. if (!hasOwnProp(this, '_monthsRegex')) {
  1576. this.computeMonthsParse();
  1577. }
  1578. if (isStrict) {
  1579. return this._monthsShortStrictRegex;
  1580. }
  1581. return this._monthsShortRegex;
  1582. }
  1583. if (!hasOwnProp(this, '_monthsShortRegex')) {
  1584. this._monthsShortRegex = defaultMonthsShortRegex;
  1585. }
  1586. return this._monthsShortStrictRegex && isStrict ?
  1587. this._monthsShortStrictRegex : this._monthsShortRegex;
  1588. }
  1589. /**
  1590. * Week
  1591. * @param {?} date
  1592. * @param {?=} isUTC
  1593. * @return {?}
  1594. */
  1595. week(date, isUTC) {
  1596. return weekOfYear(date, this._week.dow, this._week.doy, isUTC).week;
  1597. }
  1598. /**
  1599. * @return {?}
  1600. */
  1601. firstDayOfWeek() {
  1602. return this._week.dow;
  1603. }
  1604. /**
  1605. * @return {?}
  1606. */
  1607. firstDayOfYear() {
  1608. return this._week.doy;
  1609. }
  1610. /**
  1611. * @param {?=} date
  1612. * @param {?=} format
  1613. * @param {?=} isUTC
  1614. * @return {?}
  1615. */
  1616. weekdays(date, format, isUTC) {
  1617. if (!date) {
  1618. return isArray(this._weekdays)
  1619. ? this._weekdays
  1620. : this._weekdays.standalone;
  1621. }
  1622. if (isArray(this._weekdays)) {
  1623. return this._weekdays[getDay(date, isUTC)];
  1624. }
  1625. /** @type {?} */
  1626. const _key = this._weekdays.isFormat.test(format)
  1627. ? 'format'
  1628. : 'standalone';
  1629. return this._weekdays[_key][getDay(date, isUTC)];
  1630. }
  1631. /**
  1632. * @param {?=} date
  1633. * @param {?=} format
  1634. * @param {?=} isUTC
  1635. * @return {?}
  1636. */
  1637. weekdaysMin(date, format, isUTC) {
  1638. return date ? this._weekdaysMin[getDay(date, isUTC)] : this._weekdaysMin;
  1639. }
  1640. /**
  1641. * @param {?=} date
  1642. * @param {?=} format
  1643. * @param {?=} isUTC
  1644. * @return {?}
  1645. */
  1646. weekdaysShort(date, format, isUTC) {
  1647. return date ? this._weekdaysShort[getDay(date, isUTC)] : this._weekdaysShort;
  1648. }
  1649. // proto.weekdaysParse = localeWeekdaysParse;
  1650. /**
  1651. * @param {?=} weekdayName
  1652. * @param {?=} format
  1653. * @param {?=} strict
  1654. * @return {?}
  1655. */
  1656. weekdaysParse(weekdayName, format, strict) {
  1657. /** @type {?} */
  1658. let i;
  1659. /** @type {?} */
  1660. let regex;
  1661. if (this._weekdaysParseExact) {
  1662. return this.handleWeekStrictParse(weekdayName, format, strict);
  1663. }
  1664. if (!this._weekdaysParse) {
  1665. this._weekdaysParse = [];
  1666. this._minWeekdaysParse = [];
  1667. this._shortWeekdaysParse = [];
  1668. this._fullWeekdaysParse = [];
  1669. }
  1670. for (i = 0; i < 7; i++) {
  1671. // make the regex if we don't have it already
  1672. // fix: here is the issue
  1673. /** @type {?} */
  1674. const date = setDayOfWeek(new Date(Date.UTC(2000, 1)), i, null, true);
  1675. if (strict && !this._fullWeekdaysParse[i]) {
  1676. this._fullWeekdaysParse[i] = new RegExp(`^${this.weekdays(date, '', true).replace('.', '\.?')}$`, 'i');
  1677. this._shortWeekdaysParse[i] = new RegExp(`^${this.weekdaysShort(date, '', true).replace('.', '\.?')}$`, 'i');
  1678. this._minWeekdaysParse[i] = new RegExp(`^${this.weekdaysMin(date, '', true).replace('.', '\.?')}$`, 'i');
  1679. }
  1680. if (!this._weekdaysParse[i]) {
  1681. regex = `^${this.weekdays(date, '', true)}|^${this.weekdaysShort(date, '', true)}|^${this.weekdaysMin(date, '', true)}`;
  1682. this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
  1683. }
  1684. if (!isArray(this._fullWeekdaysParse)
  1685. || !isArray(this._shortWeekdaysParse)
  1686. || !isArray(this._minWeekdaysParse)
  1687. || !isArray(this._weekdaysParse)) {
  1688. return;
  1689. }
  1690. // test the regex
  1691. if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) {
  1692. return i;
  1693. }
  1694. else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) {
  1695. return i;
  1696. }
  1697. else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) {
  1698. return i;
  1699. }
  1700. else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
  1701. return i;
  1702. }
  1703. }
  1704. }
  1705. // proto.weekdaysRegex = weekdaysRegex;
  1706. /**
  1707. * @param {?} isStrict
  1708. * @return {?}
  1709. */
  1710. weekdaysRegex(isStrict) {
  1711. if (this._weekdaysParseExact) {
  1712. if (!hasOwnProp(this, '_weekdaysRegex')) {
  1713. this.computeWeekdaysParse();
  1714. }
  1715. if (isStrict) {
  1716. return this._weekdaysStrictRegex;
  1717. }
  1718. else {
  1719. return this._weekdaysRegex;
  1720. }
  1721. }
  1722. else {
  1723. if (!hasOwnProp(this, '_weekdaysRegex')) {
  1724. this._weekdaysRegex = matchWord;
  1725. }
  1726. return this._weekdaysStrictRegex && isStrict ?
  1727. this._weekdaysStrictRegex : this._weekdaysRegex;
  1728. }
  1729. }
  1730. // proto.weekdaysShortRegex = weekdaysShortRegex;
  1731. // proto.weekdaysMinRegex = weekdaysMinRegex;
  1732. /**
  1733. * @param {?=} isStrict
  1734. * @return {?}
  1735. */
  1736. weekdaysShortRegex(isStrict) {
  1737. if (this._weekdaysParseExact) {
  1738. if (!hasOwnProp(this, '_weekdaysRegex')) {
  1739. this.computeWeekdaysParse();
  1740. }
  1741. if (isStrict) {
  1742. return this._weekdaysShortStrictRegex;
  1743. }
  1744. else {
  1745. return this._weekdaysShortRegex;
  1746. }
  1747. }
  1748. else {
  1749. if (!hasOwnProp(this, '_weekdaysShortRegex')) {
  1750. this._weekdaysShortRegex = matchWord;
  1751. }
  1752. return this._weekdaysShortStrictRegex && isStrict ?
  1753. this._weekdaysShortStrictRegex : this._weekdaysShortRegex;
  1754. }
  1755. }
  1756. /**
  1757. * @param {?=} isStrict
  1758. * @return {?}
  1759. */
  1760. weekdaysMinRegex(isStrict) {
  1761. if (this._weekdaysParseExact) {
  1762. if (!hasOwnProp(this, '_weekdaysRegex')) {
  1763. this.computeWeekdaysParse();
  1764. }
  1765. if (isStrict) {
  1766. return this._weekdaysMinStrictRegex;
  1767. }
  1768. else {
  1769. return this._weekdaysMinRegex;
  1770. }
  1771. }
  1772. else {
  1773. if (!hasOwnProp(this, '_weekdaysMinRegex')) {
  1774. this._weekdaysMinRegex = matchWord;
  1775. }
  1776. return this._weekdaysMinStrictRegex && isStrict ?
  1777. this._weekdaysMinStrictRegex : this._weekdaysMinRegex;
  1778. }
  1779. }
  1780. /**
  1781. * @param {?} input
  1782. * @return {?}
  1783. */
  1784. isPM(input) {
  1785. // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
  1786. // Using charAt should be more compatible.
  1787. return input.toLowerCase().charAt(0) === 'p';
  1788. }
  1789. /**
  1790. * @param {?} hours
  1791. * @param {?} minutes
  1792. * @param {?} isLower
  1793. * @return {?}
  1794. */
  1795. meridiem(hours, minutes, isLower) {
  1796. if (hours > 11) {
  1797. return isLower ? 'pm' : 'PM';
  1798. }
  1799. return isLower ? 'am' : 'AM';
  1800. }
  1801. /**
  1802. * @param {?} key
  1803. * @return {?}
  1804. */
  1805. formatLongDate(key) {
  1806. this._longDateFormat = this._longDateFormat ? this._longDateFormat : defaultLongDateFormat;
  1807. /** @type {?} */
  1808. const format = this._longDateFormat[key];
  1809. /** @type {?} */
  1810. const formatUpper = this._longDateFormat[key.toUpperCase()];
  1811. if (format || !formatUpper) {
  1812. return format;
  1813. }
  1814. this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, (/**
  1815. * @param {?} val
  1816. * @return {?}
  1817. */
  1818. (val) => {
  1819. return val.slice(1);
  1820. }));
  1821. return this._longDateFormat[key];
  1822. }
  1823. /**
  1824. * @private
  1825. * @param {?} monthName
  1826. * @param {?} format
  1827. * @param {?=} strict
  1828. * @return {?}
  1829. */
  1830. handleMonthStrictParse(monthName, format, strict) {
  1831. /** @type {?} */
  1832. const llc = monthName.toLocaleLowerCase();
  1833. /** @type {?} */
  1834. let i;
  1835. /** @type {?} */
  1836. let ii;
  1837. /** @type {?} */
  1838. let mom;
  1839. if (!this._monthsParse) {
  1840. // this is not used
  1841. this._monthsParse = [];
  1842. this._longMonthsParse = [];
  1843. this._shortMonthsParse = [];
  1844. for (i = 0; i < 12; ++i) {
  1845. mom = new Date(2000, i);
  1846. this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase();
  1847. this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
  1848. }
  1849. }
  1850. if (strict) {
  1851. if (format === 'MMM') {
  1852. ii = ((/** @type {?} */ (this._shortMonthsParse))).indexOf(llc);
  1853. return ii !== -1 ? ii : null;
  1854. }
  1855. ii = ((/** @type {?} */ (this._longMonthsParse))).indexOf(llc);
  1856. return ii !== -1 ? ii : null;
  1857. }
  1858. if (format === 'MMM') {
  1859. ii = ((/** @type {?} */ (this._shortMonthsParse))).indexOf(llc);
  1860. if (ii !== -1) {
  1861. return ii;
  1862. }
  1863. ii = ((/** @type {?} */ (this._longMonthsParse))).indexOf(llc);
  1864. return ii !== -1 ? ii : null;
  1865. }
  1866. ii = ((/** @type {?} */ (this._longMonthsParse))).indexOf(llc);
  1867. if (ii !== -1) {
  1868. return ii;
  1869. }
  1870. ii = ((/** @type {?} */ (this._shortMonthsParse))).indexOf(llc);
  1871. return ii !== -1 ? ii : null;
  1872. }
  1873. /**
  1874. * @private
  1875. * @param {?} weekdayName
  1876. * @param {?} format
  1877. * @param {?} strict
  1878. * @return {?}
  1879. */
  1880. handleWeekStrictParse(weekdayName, format, strict) {
  1881. /** @type {?} */
  1882. let ii;
  1883. /** @type {?} */
  1884. const llc = weekdayName.toLocaleLowerCase();
  1885. if (!this._weekdaysParse) {
  1886. this._weekdaysParse = [];
  1887. this._shortWeekdaysParse = [];
  1888. this._minWeekdaysParse = [];
  1889. /** @type {?} */
  1890. let i;
  1891. for (i = 0; i < 7; ++i) {
  1892. /** @type {?} */
  1893. const date = setDayOfWeek(new Date(Date.UTC(2000, 1)), i, null, true);
  1894. this._minWeekdaysParse[i] = this.weekdaysMin(date).toLocaleLowerCase();
  1895. this._shortWeekdaysParse[i] = this.weekdaysShort(date).toLocaleLowerCase();
  1896. this._weekdaysParse[i] = this.weekdays(date, '').toLocaleLowerCase();
  1897. }
  1898. }
  1899. if (!isArray(this._weekdaysParse)
  1900. || !isArray(this._shortWeekdaysParse)
  1901. || !isArray(this._minWeekdaysParse)) {
  1902. return;
  1903. }
  1904. if (strict) {
  1905. if (format === 'dddd') {
  1906. ii = this._weekdaysParse.indexOf(llc);
  1907. return ii !== -1 ? ii : null;
  1908. }
  1909. else if (format === 'ddd') {
  1910. ii = this._shortWeekdaysParse.indexOf(llc);
  1911. return ii !== -1 ? ii : null;
  1912. }
  1913. else {
  1914. ii = this._minWeekdaysParse.indexOf(llc);
  1915. return ii !== -1 ? ii : null;
  1916. }
  1917. }
  1918. else {
  1919. if (format === 'dddd') {
  1920. ii = this._weekdaysParse.indexOf(llc);
  1921. if (ii !== -1) {
  1922. return ii;
  1923. }
  1924. ii = this._shortWeekdaysParse.indexOf(llc);
  1925. if (ii !== -1) {
  1926. return ii;
  1927. }
  1928. ii = this._minWeekdaysParse.indexOf(llc);
  1929. return ii !== -1 ? ii : null;
  1930. }
  1931. else if (format === 'ddd') {
  1932. ii = this._shortWeekdaysParse.indexOf(llc);
  1933. if (ii !== -1) {
  1934. return ii;
  1935. }
  1936. ii = this._weekdaysParse.indexOf(llc);
  1937. if (ii !== -1) {
  1938. return ii;
  1939. }
  1940. ii = this._minWeekdaysParse.indexOf(llc);
  1941. return ii !== -1 ? ii : null;
  1942. }
  1943. else {
  1944. ii = this._minWeekdaysParse.indexOf(llc);
  1945. if (ii !== -1) {
  1946. return ii;
  1947. }
  1948. ii = this._weekdaysParse.indexOf(llc);
  1949. if (ii !== -1) {
  1950. return ii;
  1951. }
  1952. ii = this._shortWeekdaysParse.indexOf(llc);
  1953. return ii !== -1 ? ii : null;
  1954. }
  1955. }
  1956. }
  1957. /**
  1958. * @private
  1959. * @return {?}
  1960. */
  1961. computeMonthsParse() {
  1962. /** @type {?} */
  1963. const shortPieces = [];
  1964. /** @type {?} */
  1965. const longPieces = [];
  1966. /** @type {?} */
  1967. const mixedPieces = [];
  1968. /** @type {?} */
  1969. let date;
  1970. /** @type {?} */
  1971. let i;
  1972. for (i = 0; i < 12; i++) {
  1973. // make the regex if we don't have it already
  1974. date = new Date(2000, i);
  1975. shortPieces.push(this.monthsShort(date, ''));
  1976. longPieces.push(this.months(date, ''));
  1977. mixedPieces.push(this.months(date, ''));
  1978. mixedPieces.push(this.monthsShort(date, ''));
  1979. }
  1980. // Sorting makes sure if one month (or abbr) is a prefix of another it
  1981. // will match the longer piece.
  1982. shortPieces.sort(cmpLenRev);
  1983. longPieces.sort(cmpLenRev);
  1984. mixedPieces.sort(cmpLenRev);
  1985. for (i = 0; i < 12; i++) {
  1986. shortPieces[i] = regexEscape(shortPieces[i]);
  1987. longPieces[i] = regexEscape(longPieces[i]);
  1988. }
  1989. for (i = 0; i < 24; i++) {
  1990. mixedPieces[i] = regexEscape(mixedPieces[i]);
  1991. }
  1992. this._monthsRegex = new RegExp(`^(${mixedPieces.join('|')})`, 'i');
  1993. this._monthsShortRegex = this._monthsRegex;
  1994. this._monthsStrictRegex = new RegExp(`^(${longPieces.join('|')})`, 'i');
  1995. this._monthsShortStrictRegex = new RegExp(`^(${shortPieces.join('|')})`, 'i');
  1996. }
  1997. /**
  1998. * @private
  1999. * @return {?}
  2000. */
  2001. computeWeekdaysParse() {
  2002. /** @type {?} */
  2003. const minPieces = [];
  2004. /** @type {?} */
  2005. const shortPieces = [];
  2006. /** @type {?} */
  2007. const longPieces = [];
  2008. /** @type {?} */
  2009. const mixedPieces = [];
  2010. /** @type {?} */
  2011. let i;
  2012. for (i = 0; i < 7; i++) {
  2013. // make the regex if we don't have it already
  2014. // let mom = createUTC([2000, 1]).day(i);
  2015. /** @type {?} */
  2016. const date = setDayOfWeek(new Date(Date.UTC(2000, 1)), i, null, true);
  2017. /** @type {?} */
  2018. const minp = this.weekdaysMin(date);
  2019. /** @type {?} */
  2020. const shortp = this.weekdaysShort(date);
  2021. /** @type {?} */
  2022. const longp = this.weekdays(date);
  2023. minPieces.push(minp);
  2024. shortPieces.push(shortp);
  2025. longPieces.push(longp);
  2026. mixedPieces.push(minp);
  2027. mixedPieces.push(shortp);
  2028. mixedPieces.push(longp);
  2029. }
  2030. // Sorting makes sure if one weekday (or abbr) is a prefix of another it
  2031. // will match the longer piece.
  2032. minPieces.sort(cmpLenRev);
  2033. shortPieces.sort(cmpLenRev);
  2034. longPieces.sort(cmpLenRev);
  2035. mixedPieces.sort(cmpLenRev);
  2036. for (i = 0; i < 7; i++) {
  2037. shortPieces[i] = regexEscape(shortPieces[i]);
  2038. longPieces[i] = regexEscape(longPieces[i]);
  2039. mixedPieces[i] = regexEscape(mixedPieces[i]);
  2040. }
  2041. this._weekdaysRegex = new RegExp(`^(${mixedPieces.join('|')})`, 'i');
  2042. this._weekdaysShortRegex = this._weekdaysRegex;
  2043. this._weekdaysMinRegex = this._weekdaysRegex;
  2044. this._weekdaysStrictRegex = new RegExp(`^(${longPieces.join('|')})`, 'i');
  2045. this._weekdaysShortStrictRegex = new RegExp(`^(${shortPieces.join('|')})`, 'i');
  2046. this._weekdaysMinStrictRegex = new RegExp(`^(${minPieces.join('|')})`, 'i');
  2047. }
  2048. }
  2049. /**
  2050. * @param {?} a
  2051. * @param {?} b
  2052. * @return {?}
  2053. */
  2054. function cmpLenRev(a, b) {
  2055. return b.length - a.length;
  2056. }
  2057. /**
  2058. * @fileoverview added by tsickle
  2059. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  2060. */
  2061. /** @type {?} */
  2062. const defaultCalendar = {
  2063. sameDay: '[Today at] LT',
  2064. nextDay: '[Tomorrow at] LT',
  2065. nextWeek: 'dddd [at] LT',
  2066. lastDay: '[Yesterday at] LT',
  2067. lastWeek: '[Last] dddd [at] LT',
  2068. sameElse: 'L'
  2069. };
  2070. /**
  2071. * @fileoverview added by tsickle
  2072. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  2073. */
  2074. /** @type {?} */
  2075. const defaultInvalidDate = 'Invalid date';
  2076. /** @type {?} */
  2077. const defaultLocaleWeek = {
  2078. dow: 0,
  2079. // Sunday is the first day of the week.
  2080. doy: 6 // The week that contains Jan 1st is the first week of the year.
  2081. };
  2082. /** @type {?} */
  2083. const defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i;
  2084. /** @type {?} */
  2085. const defaultRelativeTime = {
  2086. future: 'in %s',
  2087. past: '%s ago',
  2088. s: 'a few seconds',
  2089. ss: '%d seconds',
  2090. m: 'a minute',
  2091. mm: '%d minutes',
  2092. h: 'an hour',
  2093. hh: '%d hours',
  2094. d: 'a day',
  2095. dd: '%d days',
  2096. M: 'a month',
  2097. MM: '%d months',
  2098. y: 'a year',
  2099. yy: '%d years'
  2100. };
  2101. /** @type {?} */
  2102. const baseConfig = {
  2103. calendar: defaultCalendar,
  2104. longDateFormat: defaultLongDateFormat,
  2105. invalidDate: defaultInvalidDate,
  2106. ordinal: defaultOrdinal,
  2107. dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
  2108. relativeTime: defaultRelativeTime,
  2109. months: defaultLocaleMonths,
  2110. monthsShort: defaultLocaleMonthsShort,
  2111. week: defaultLocaleWeek,
  2112. weekdays: defaultLocaleWeekdays,
  2113. weekdaysMin: defaultLocaleWeekdaysMin,
  2114. weekdaysShort: defaultLocaleWeekdaysShort,
  2115. meridiemParse: defaultLocaleMeridiemParse
  2116. };
  2117. /**
  2118. * @fileoverview added by tsickle
  2119. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  2120. */
  2121. /**
  2122. * @template T
  2123. * @param {?} array1
  2124. * @param {?} array2
  2125. * @param {?} dontConvert
  2126. * @return {?}
  2127. */
  2128. function compareArrays(array1, array2, dontConvert) {
  2129. /** @type {?} */
  2130. const len = Math.min(array1.length, array2.length);
  2131. /** @type {?} */
  2132. const lengthDiff = Math.abs(array1.length - array2.length);
  2133. /** @type {?} */
  2134. let diffs = 0;
  2135. /** @type {?} */
  2136. let i;
  2137. for (i = 0; i < len; i++) {
  2138. if ((dontConvert && array1[i] !== array2[i])
  2139. || (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) {
  2140. diffs++;
  2141. }
  2142. }
  2143. return diffs + lengthDiff;
  2144. }
  2145. /**
  2146. * @fileoverview added by tsickle
  2147. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  2148. */
  2149. // FORMATTING
  2150. /**
  2151. * @return {?}
  2152. */
  2153. function initWeek() {
  2154. addFormatToken('w', ['ww', 2, false], 'wo', (/**
  2155. * @param {?} date
  2156. * @param {?} opts
  2157. * @return {?}
  2158. */
  2159. function (date, opts) {
  2160. return getWeek(date, opts.locale)
  2161. .toString(10);
  2162. }));
  2163. addFormatToken('W', ['WW', 2, false], 'Wo', (/**
  2164. * @param {?} date
  2165. * @return {?}
  2166. */
  2167. function (date) {
  2168. return getISOWeek(date)
  2169. .toString(10);
  2170. }));
  2171. // ALIASES
  2172. addUnitAlias('week', 'w');
  2173. addUnitAlias('isoWeek', 'W');
  2174. // PARSING
  2175. addRegexToken('w', match1to2);
  2176. addRegexToken('ww', match1to2, match2);
  2177. addRegexToken('W', match1to2);
  2178. addRegexToken('WW', match1to2, match2);
  2179. addWeekParseToken(['w', 'ww', 'W', 'WW'], (/**
  2180. * @param {?} input
  2181. * @param {?} week
  2182. * @param {?} config
  2183. * @param {?} token
  2184. * @return {?}
  2185. */
  2186. function (input, week, config, token) {
  2187. week[token.substr(0, 1)] = toInt(input);
  2188. return config;
  2189. }));
  2190. // export function getSetWeek (input) {
  2191. // var week = this.localeData().week(this);
  2192. // return input == null ? week : this.add((input - week) * 7, 'd');
  2193. // }
  2194. }
  2195. /**
  2196. * @param {?} date
  2197. * @param {?=} locale
  2198. * @param {?=} isUTC
  2199. * @return {?}
  2200. */
  2201. function getWeek(date, locale = getLocale(), isUTC) {
  2202. return locale.week(date, isUTC);
  2203. }
  2204. /**
  2205. * @param {?} date
  2206. * @param {?=} isUTC
  2207. * @return {?}
  2208. */
  2209. function getISOWeek(date, isUTC) {
  2210. return weekOfYear(date, 1, 4, isUTC).week;
  2211. }
  2212. /**
  2213. * @fileoverview added by tsickle
  2214. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  2215. */
  2216. // FORMATTING
  2217. /**
  2218. * @return {?}
  2219. */
  2220. function initWeekYear() {
  2221. addFormatToken(null, ['gg', 2, false], null, (/**
  2222. * @param {?} date
  2223. * @param {?} opts
  2224. * @return {?}
  2225. */
  2226. function (date, opts) {
  2227. // return this.weekYear() % 100;
  2228. return (getWeekYear(date, opts.locale) % 100).toString();
  2229. }));
  2230. addFormatToken(null, ['GG', 2, false], null, (/**
  2231. * @param {?} date
  2232. * @return {?}
  2233. */
  2234. function (date) {
  2235. // return this.isoWeekYear() % 100;
  2236. return (getISOWeekYear(date) % 100).toString();
  2237. }));
  2238. addWeekYearFormatToken('gggg', _getWeekYearFormatCb);
  2239. addWeekYearFormatToken('ggggg', _getWeekYearFormatCb);
  2240. addWeekYearFormatToken('GGGG', _getISOWeekYearFormatCb);
  2241. addWeekYearFormatToken('GGGGG', _getISOWeekYearFormatCb);
  2242. // ALIASES
  2243. addUnitAlias('weekYear', 'gg');
  2244. addUnitAlias('isoWeekYear', 'GG');
  2245. // PARSING
  2246. addRegexToken('G', matchSigned);
  2247. addRegexToken('g', matchSigned);
  2248. addRegexToken('GG', match1to2, match2);
  2249. addRegexToken('gg', match1to2, match2);
  2250. addRegexToken('GGGG', match1to4, match4);
  2251. addRegexToken('gggg', match1to4, match4);
  2252. addRegexToken('GGGGG', match1to6, match6);
  2253. addRegexToken('ggggg', match1to6, match6);
  2254. addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], (/**
  2255. * @param {?} input
  2256. * @param {?} week
  2257. * @param {?} config
  2258. * @param {?} token
  2259. * @return {?}
  2260. */
  2261. function (input, week, config, token) {
  2262. week[token.substr(0, 2)] = toInt(input);
  2263. return config;
  2264. }));
  2265. addWeekParseToken(['gg', 'GG'], (/**
  2266. * @param {?} input
  2267. * @param {?} week
  2268. * @param {?} config
  2269. * @param {?} token
  2270. * @return {?}
  2271. */
  2272. function (input, week, config, token) {
  2273. week[token] = parseTwoDigitYear(input);
  2274. return config;
  2275. }));
  2276. }
  2277. /**
  2278. * @param {?} token
  2279. * @param {?} getter
  2280. * @return {?}
  2281. */
  2282. function addWeekYearFormatToken(token, getter) {
  2283. addFormatToken(null, [token, token.length, false], null, getter);
  2284. }
  2285. /**
  2286. * @param {?} date
  2287. * @param {?} opts
  2288. * @return {?}
  2289. */
  2290. function _getWeekYearFormatCb(date, opts) {
  2291. return getWeekYear(date, opts.locale).toString();
  2292. }
  2293. /**
  2294. * @param {?} date
  2295. * @return {?}
  2296. */
  2297. function _getISOWeekYearFormatCb(date) {
  2298. return getISOWeekYear(date).toString();
  2299. }
  2300. /**
  2301. * @param {?} date
  2302. * @param {?=} locale
  2303. * @param {?=} isUTC
  2304. * @return {?}
  2305. */
  2306. function getWeekYear(date, locale = getLocale(), isUTC) {
  2307. return weekOfYear(date, locale.firstDayOfWeek(), locale.firstDayOfYear(), isUTC).year;
  2308. }
  2309. /**
  2310. * @param {?} date
  2311. * @param {?=} isUTC
  2312. * @return {?}
  2313. */
  2314. function getISOWeekYear(date, isUTC) {
  2315. return weekOfYear(date, 1, 4, isUTC).year;
  2316. }
  2317. /**
  2318. * @fileoverview added by tsickle
  2319. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  2320. */
  2321. // todo: add support for timezones
  2322. /**
  2323. * @return {?}
  2324. */
  2325. function initTimezone() {
  2326. // FORMATTING
  2327. addFormatToken('z', null, null, (/**
  2328. * @param {?} date
  2329. * @param {?} opts
  2330. * @return {?}
  2331. */
  2332. function (date, opts) {
  2333. return opts.isUTC ? 'UTC' : '';
  2334. }));
  2335. addFormatToken('zz', null, null, (/**
  2336. * @param {?} date
  2337. * @param {?} opts
  2338. * @return {?}
  2339. */
  2340. function (date, opts) {
  2341. return opts.isUTC ? 'Coordinated Universal Time' : '';
  2342. }));
  2343. }
  2344. /**
  2345. * @fileoverview added by tsickle
  2346. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  2347. */
  2348. /**
  2349. * @return {?}
  2350. */
  2351. function initTimestamp() {
  2352. // FORMATTING
  2353. addFormatToken('X', null, null, (/**
  2354. * @param {?} date
  2355. * @return {?}
  2356. */
  2357. function (date) {
  2358. return unix(date)
  2359. .toString(10);
  2360. }));
  2361. addFormatToken('x', null, null, (/**
  2362. * @param {?} date
  2363. * @return {?}
  2364. */
  2365. function (date) {
  2366. return date.valueOf()
  2367. .toString(10);
  2368. }));
  2369. // PARSING
  2370. addRegexToken('x', matchSigned);
  2371. addRegexToken('X', matchTimestamp);
  2372. addParseToken('X', (/**
  2373. * @param {?} input
  2374. * @param {?} array
  2375. * @param {?} config
  2376. * @return {?}
  2377. */
  2378. function (input, array, config) {
  2379. config._d = new Date(parseFloat(input) * 1000);
  2380. return config;
  2381. }));
  2382. addParseToken('x', (/**
  2383. * @param {?} input
  2384. * @param {?} array
  2385. * @param {?} config
  2386. * @return {?}
  2387. */
  2388. function (input, array, config) {
  2389. config._d = new Date(toInt(input));
  2390. return config;
  2391. }));
  2392. }
  2393. /**
  2394. * @fileoverview added by tsickle
  2395. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  2396. */
  2397. /**
  2398. * @return {?}
  2399. */
  2400. function initSecond() {
  2401. // FORMATTING
  2402. addFormatToken('s', ['ss', 2, false], null, (/**
  2403. * @param {?} date
  2404. * @param {?} opts
  2405. * @return {?}
  2406. */
  2407. function (date, opts) {
  2408. return getSeconds(date, opts.isUTC)
  2409. .toString(10);
  2410. }));
  2411. // ALIASES
  2412. addUnitAlias('second', 's');
  2413. // PARSING
  2414. addRegexToken('s', match1to2);
  2415. addRegexToken('ss', match1to2, match2);
  2416. addParseToken(['s', 'ss'], SECOND);
  2417. }
  2418. /**
  2419. * @fileoverview added by tsickle
  2420. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  2421. */
  2422. /**
  2423. * @return {?}
  2424. */
  2425. function initQuarter() {
  2426. // FORMATTING
  2427. addFormatToken('Q', null, 'Qo', (/**
  2428. * @param {?} date
  2429. * @param {?} opts
  2430. * @return {?}
  2431. */
  2432. function (date, opts) {
  2433. return getQuarter(date, opts.isUTC)
  2434. .toString(10);
  2435. }));
  2436. // ALIASES
  2437. addUnitAlias('quarter', 'Q');
  2438. // PARSING
  2439. addRegexToken('Q', match1);
  2440. addParseToken('Q', (/**
  2441. * @param {?} input
  2442. * @param {?} array
  2443. * @param {?} config
  2444. * @return {?}
  2445. */
  2446. function (input, array, config) {
  2447. array[MONTH] = (toInt(input) - 1) * 3;
  2448. return config;
  2449. }));
  2450. }
  2451. // MOMENTS
  2452. /**
  2453. * @param {?} date
  2454. * @param {?=} isUTC
  2455. * @return {?}
  2456. */
  2457. function getQuarter(date, isUTC = false) {
  2458. return Math.ceil((getMonth(date, isUTC) + 1) / 3);
  2459. }
  2460. /**
  2461. * @fileoverview added by tsickle
  2462. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  2463. */
  2464. /**
  2465. * @param {?} token
  2466. * @param {?} separator
  2467. * @return {?}
  2468. */
  2469. function addOffsetFormatToken(token, separator) {
  2470. addFormatToken(token, null, null, (/**
  2471. * @param {?} date
  2472. * @param {?} config
  2473. * @return {?}
  2474. */
  2475. function (date, config) {
  2476. /** @type {?} */
  2477. let offset = getUTCOffset(date, { _isUTC: config.isUTC, _offset: config.offset });
  2478. /** @type {?} */
  2479. let sign = '+';
  2480. if (offset < 0) {
  2481. offset = -offset;
  2482. sign = '-';
  2483. }
  2484. return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2);
  2485. }));
  2486. }
  2487. /**
  2488. * @return {?}
  2489. */
  2490. function initOffset() {
  2491. addOffsetFormatToken('Z', ':');
  2492. addOffsetFormatToken('ZZ', '');
  2493. // PARSING
  2494. addRegexToken('Z', matchShortOffset);
  2495. addRegexToken('ZZ', matchShortOffset);
  2496. addParseToken(['Z', 'ZZ'], (/**
  2497. * @param {?} input
  2498. * @param {?} array
  2499. * @param {?} config
  2500. * @return {?}
  2501. */
  2502. function (input, array, config) {
  2503. config._useUTC = true;
  2504. config._tzm = offsetFromString(matchShortOffset, input);
  2505. return config;
  2506. }));
  2507. }
  2508. // HELPERS
  2509. // timezone chunker
  2510. // '+10:00' > ['10', '00']
  2511. // '-1530' > ['-15', '30']
  2512. /** @type {?} */
  2513. const chunkOffset = /([\+\-]|\d\d)/gi;
  2514. /**
  2515. * @param {?} matcher
  2516. * @param {?} str
  2517. * @return {?}
  2518. */
  2519. function offsetFromString(matcher, str) {
  2520. /** @type {?} */
  2521. const matches = (str || '').match(matcher);
  2522. if (matches === null) {
  2523. return null;
  2524. }
  2525. /** @type {?} */
  2526. const chunk = matches[matches.length - 1];
  2527. /** @type {?} */
  2528. const parts = chunk.match(chunkOffset) || ['-', '0', '0'];
  2529. /** @type {?} */
  2530. const minutes = parseInt(parts[1], 10) * 60 + toInt(parts[2]);
  2531. /** @type {?} */
  2532. const _min = parts[0] === '+' ? minutes : -minutes;
  2533. return minutes === 0 ? 0 : _min;
  2534. }
  2535. // Return a moment from input, that is local/utc/zone equivalent to model.
  2536. /**
  2537. * @param {?} input
  2538. * @param {?} date
  2539. * @param {?=} config
  2540. * @return {?}
  2541. */
  2542. function cloneWithOffset(input, date, config = {}) {
  2543. if (!config._isUTC) {
  2544. return input;
  2545. }
  2546. /** @type {?} */
  2547. const res = cloneDate(date);
  2548. // todo: input._d - res._d + ((res._offset || 0) - (input._offset || 0))*60000
  2549. /** @type {?} */
  2550. const offsetDiff = (config._offset || 0) * 60000;
  2551. /** @type {?} */
  2552. const diff = input.valueOf() - res.valueOf() + offsetDiff;
  2553. // Use low-level api, because this fn is low-level api.
  2554. res.setTime(res.valueOf() + diff);
  2555. // todo: add timezone handling
  2556. // hooks.updateOffset(res, false);
  2557. return res;
  2558. }
  2559. /**
  2560. * @param {?} date
  2561. * @return {?}
  2562. */
  2563. function getDateOffset(date) {
  2564. // On Firefox.24 Date#getTimezoneOffset returns a floating point.
  2565. // https://github.com/moment/moment/pull/1871
  2566. return -Math.round(date.getTimezoneOffset() / 15) * 15;
  2567. }
  2568. // HOOKS
  2569. // This function will be called whenever a moment is mutated.
  2570. // It is intended to keep the offset in sync with the timezone.
  2571. // todo: it's from moment timezones
  2572. // hooks.updateOffset = function () {
  2573. // };
  2574. // MOMENTS
  2575. // keepLocalTime = true means only change the timezone, without
  2576. // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
  2577. // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
  2578. // +0200, so we adjust the time as needed, to be valid.
  2579. //
  2580. // Keeping the time actually adds/subtracts (one hour)
  2581. // from the actual represented time. That is why we call updateOffset
  2582. // a second time. In case it wants us to change the offset again
  2583. // _changeInProgress == true case, then we have to adjust, because
  2584. // there is no such time in the given timezone.
  2585. /**
  2586. * @param {?} date
  2587. * @param {?=} config
  2588. * @return {?}
  2589. */
  2590. function getUTCOffset(date, config = {}) {
  2591. /** @type {?} */
  2592. const _offset = config._offset || 0;
  2593. return config._isUTC ? _offset : getDateOffset(date);
  2594. }
  2595. /**
  2596. * @fileoverview added by tsickle
  2597. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  2598. */
  2599. /**
  2600. * @return {?}
  2601. */
  2602. function initMinute() {
  2603. // FORMATTING
  2604. addFormatToken('m', ['mm', 2, false], null, (/**
  2605. * @param {?} date
  2606. * @param {?} opts
  2607. * @return {?}
  2608. */
  2609. function (date, opts) {
  2610. return getMinutes(date, opts.isUTC)
  2611. .toString(10);
  2612. }));
  2613. // ALIASES
  2614. addUnitAlias('minute', 'm');
  2615. // PARSING
  2616. addRegexToken('m', match1to2);
  2617. addRegexToken('mm', match1to2, match2);
  2618. addParseToken(['m', 'mm'], MINUTE);
  2619. }
  2620. /**
  2621. * @fileoverview added by tsickle
  2622. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  2623. */
  2624. /**
  2625. * @return {?}
  2626. */
  2627. function initMillisecond() {
  2628. addFormatToken('S', null, null, (/**
  2629. * @param {?} date
  2630. * @param {?} opts
  2631. * @return {?}
  2632. */
  2633. function (date, opts) {
  2634. return (~~(getMilliseconds(date, opts.isUTC) / 100)).toString(10);
  2635. }));
  2636. addFormatToken(null, ['SS', 2, false], null, (/**
  2637. * @param {?} date
  2638. * @param {?} opts
  2639. * @return {?}
  2640. */
  2641. function (date, opts) {
  2642. return (~~(getMilliseconds(date, opts.isUTC) / 10)).toString(10);
  2643. }));
  2644. addFormatToken(null, ['SSS', 3, false], null, (/**
  2645. * @param {?} date
  2646. * @param {?} opts
  2647. * @return {?}
  2648. */
  2649. function (date, opts) {
  2650. return (getMilliseconds(date, opts.isUTC)).toString(10);
  2651. }));
  2652. addFormatToken(null, ['SSSS', 4, false], null, (/**
  2653. * @param {?} date
  2654. * @param {?} opts
  2655. * @return {?}
  2656. */
  2657. function (date, opts) {
  2658. return (getMilliseconds(date, opts.isUTC) * 10).toString(10);
  2659. }));
  2660. addFormatToken(null, ['SSSSS', 5, false], null, (/**
  2661. * @param {?} date
  2662. * @param {?} opts
  2663. * @return {?}
  2664. */
  2665. function (date, opts) {
  2666. return (getMilliseconds(date, opts.isUTC) * 100).toString(10);
  2667. }));
  2668. addFormatToken(null, ['SSSSSS', 6, false], null, (/**
  2669. * @param {?} date
  2670. * @param {?} opts
  2671. * @return {?}
  2672. */
  2673. function (date, opts) {
  2674. return (getMilliseconds(date, opts.isUTC) * 1000).toString(10);
  2675. }));
  2676. addFormatToken(null, ['SSSSSSS', 7, false], null, (/**
  2677. * @param {?} date
  2678. * @param {?} opts
  2679. * @return {?}
  2680. */
  2681. function (date, opts) {
  2682. return (getMilliseconds(date, opts.isUTC) * 10000).toString(10);
  2683. }));
  2684. addFormatToken(null, ['SSSSSSSS', 8, false], null, (/**
  2685. * @param {?} date
  2686. * @param {?} opts
  2687. * @return {?}
  2688. */
  2689. function (date, opts) {
  2690. return (getMilliseconds(date, opts.isUTC) * 100000).toString(10);
  2691. }));
  2692. addFormatToken(null, ['SSSSSSSSS', 9, false], null, (/**
  2693. * @param {?} date
  2694. * @param {?} opts
  2695. * @return {?}
  2696. */
  2697. function (date, opts) {
  2698. return (getMilliseconds(date, opts.isUTC) * 1000000).toString(10);
  2699. }));
  2700. // ALIASES
  2701. addUnitAlias('millisecond', 'ms');
  2702. // PARSING
  2703. addRegexToken('S', match1to3, match1);
  2704. addRegexToken('SS', match1to3, match2);
  2705. addRegexToken('SSS', match1to3, match3);
  2706. /** @type {?} */
  2707. let token;
  2708. for (token = 'SSSS'; token.length <= 9; token += 'S') {
  2709. addRegexToken(token, matchUnsigned);
  2710. }
  2711. /**
  2712. * @param {?} input
  2713. * @param {?} array
  2714. * @param {?} config
  2715. * @return {?}
  2716. */
  2717. function parseMs(input, array, config) {
  2718. array[MILLISECOND] = toInt(parseFloat(`0.${input}`) * 1000);
  2719. return config;
  2720. }
  2721. for (token = 'S'; token.length <= 9; token += 'S') {
  2722. addParseToken(token, parseMs);
  2723. }
  2724. // MOMENTS
  2725. }
  2726. /**
  2727. * @fileoverview added by tsickle
  2728. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  2729. */
  2730. /**
  2731. * @return {?}
  2732. */
  2733. function initHour() {
  2734. // FORMATTING
  2735. // FORMATTING
  2736. /**
  2737. * @param {?} date
  2738. * @param {?} isUTC
  2739. * @return {?}
  2740. */
  2741. function hFormat(date, isUTC) {
  2742. return getHours(date, isUTC) % 12 || 12;
  2743. }
  2744. /**
  2745. * @param {?} date
  2746. * @param {?} isUTC
  2747. * @return {?}
  2748. */
  2749. function kFormat(date, isUTC) {
  2750. return getHours(date, isUTC) || 24;
  2751. }
  2752. addFormatToken('H', ['HH', 2, false], null, (/**
  2753. * @param {?} date
  2754. * @param {?} opts
  2755. * @return {?}
  2756. */
  2757. function (date, opts) {
  2758. return getHours(date, opts.isUTC)
  2759. .toString(10);
  2760. }));
  2761. addFormatToken('h', ['hh', 2, false], null, (/**
  2762. * @param {?} date
  2763. * @param {?} opts
  2764. * @return {?}
  2765. */
  2766. function (date, opts) {
  2767. return hFormat(date, opts.isUTC)
  2768. .toString(10);
  2769. }));
  2770. addFormatToken('k', ['kk', 2, false], null, (/**
  2771. * @param {?} date
  2772. * @param {?} opts
  2773. * @return {?}
  2774. */
  2775. function (date, opts) {
  2776. return kFormat(date, opts.isUTC)
  2777. .toString(10);
  2778. }));
  2779. addFormatToken('hmm', null, null, (/**
  2780. * @param {?} date
  2781. * @param {?} opts
  2782. * @return {?}
  2783. */
  2784. function (date, opts) {
  2785. /** @type {?} */
  2786. const _h = hFormat(date, opts.isUTC);
  2787. /** @type {?} */
  2788. const _mm = zeroFill(getMinutes(date, opts.isUTC), 2);
  2789. return `${_h}${_mm}`;
  2790. }));
  2791. addFormatToken('hmmss', null, null, (/**
  2792. * @param {?} date
  2793. * @param {?} opts
  2794. * @return {?}
  2795. */
  2796. function (date, opts) {
  2797. /** @type {?} */
  2798. const _h = hFormat(date, opts.isUTC);
  2799. /** @type {?} */
  2800. const _mm = zeroFill(getMinutes(date, opts.isUTC), 2);
  2801. /** @type {?} */
  2802. const _ss = zeroFill(getSeconds(date, opts.isUTC), 2);
  2803. return `${_h}${_mm}${_ss}`;
  2804. }));
  2805. addFormatToken('Hmm', null, null, (/**
  2806. * @param {?} date
  2807. * @param {?} opts
  2808. * @return {?}
  2809. */
  2810. function (date, opts) {
  2811. /** @type {?} */
  2812. const _H = getHours(date, opts.isUTC);
  2813. /** @type {?} */
  2814. const _mm = zeroFill(getMinutes(date, opts.isUTC), 2);
  2815. return `${_H}${_mm}`;
  2816. }));
  2817. addFormatToken('Hmmss', null, null, (/**
  2818. * @param {?} date
  2819. * @param {?} opts
  2820. * @return {?}
  2821. */
  2822. function (date, opts) {
  2823. /** @type {?} */
  2824. const _H = getHours(date, opts.isUTC);
  2825. /** @type {?} */
  2826. const _mm = zeroFill(getMinutes(date, opts.isUTC), 2);
  2827. /** @type {?} */
  2828. const _ss = zeroFill(getSeconds(date, opts.isUTC), 2);
  2829. return `${_H}${_mm}${_ss}`;
  2830. }));
  2831. /**
  2832. * @param {?} token
  2833. * @param {?} lowercase
  2834. * @return {?}
  2835. */
  2836. function meridiem(token, lowercase) {
  2837. addFormatToken(token, null, null, (/**
  2838. * @param {?} date
  2839. * @param {?} opts
  2840. * @return {?}
  2841. */
  2842. function (date, opts) {
  2843. return opts.locale.meridiem(getHours(date, opts.isUTC), getMinutes(date, opts.isUTC), lowercase);
  2844. }));
  2845. }
  2846. meridiem('a', true);
  2847. meridiem('A', false);
  2848. // ALIASES
  2849. addUnitAlias('hour', 'h');
  2850. // PARSING
  2851. /**
  2852. * @param {?} isStrict
  2853. * @param {?} locale
  2854. * @return {?}
  2855. */
  2856. function matchMeridiem(isStrict, locale) {
  2857. return locale._meridiemParse;
  2858. }
  2859. addRegexToken('a', matchMeridiem);
  2860. addRegexToken('A', matchMeridiem);
  2861. addRegexToken('H', match1to2);
  2862. addRegexToken('h', match1to2);
  2863. addRegexToken('k', match1to2);
  2864. addRegexToken('HH', match1to2, match2);
  2865. addRegexToken('hh', match1to2, match2);
  2866. addRegexToken('kk', match1to2, match2);
  2867. addRegexToken('hmm', match3to4);
  2868. addRegexToken('hmmss', match5to6);
  2869. addRegexToken('Hmm', match3to4);
  2870. addRegexToken('Hmmss', match5to6);
  2871. addParseToken(['H', 'HH'], HOUR);
  2872. addParseToken(['k', 'kk'], (/**
  2873. * @param {?} input
  2874. * @param {?} array
  2875. * @param {?} config
  2876. * @return {?}
  2877. */
  2878. function (input, array, config) {
  2879. /** @type {?} */
  2880. const kInput = toInt(input);
  2881. array[HOUR] = kInput === 24 ? 0 : kInput;
  2882. return config;
  2883. }));
  2884. addParseToken(['a', 'A'], (/**
  2885. * @param {?} input
  2886. * @param {?} array
  2887. * @param {?} config
  2888. * @return {?}
  2889. */
  2890. function (input, array, config) {
  2891. config._isPm = config._locale.isPM(input);
  2892. config._meridiem = input;
  2893. return config;
  2894. }));
  2895. addParseToken(['h', 'hh'], (/**
  2896. * @param {?} input
  2897. * @param {?} array
  2898. * @param {?} config
  2899. * @return {?}
  2900. */
  2901. function (input, array, config) {
  2902. array[HOUR] = toInt(input);
  2903. getParsingFlags(config).bigHour = true;
  2904. return config;
  2905. }));
  2906. addParseToken('hmm', (/**
  2907. * @param {?} input
  2908. * @param {?} array
  2909. * @param {?} config
  2910. * @return {?}
  2911. */
  2912. function (input, array, config) {
  2913. /** @type {?} */
  2914. const pos = input.length - 2;
  2915. array[HOUR] = toInt(input.substr(0, pos));
  2916. array[MINUTE] = toInt(input.substr(pos));
  2917. getParsingFlags(config).bigHour = true;
  2918. return config;
  2919. }));
  2920. addParseToken('hmmss', (/**
  2921. * @param {?} input
  2922. * @param {?} array
  2923. * @param {?} config
  2924. * @return {?}
  2925. */
  2926. function (input, array, config) {
  2927. /** @type {?} */
  2928. const pos1 = input.length - 4;
  2929. /** @type {?} */
  2930. const pos2 = input.length - 2;
  2931. array[HOUR] = toInt(input.substr(0, pos1));
  2932. array[MINUTE] = toInt(input.substr(pos1, 2));
  2933. array[SECOND] = toInt(input.substr(pos2));
  2934. getParsingFlags(config).bigHour = true;
  2935. return config;
  2936. }));
  2937. addParseToken('Hmm', (/**
  2938. * @param {?} input
  2939. * @param {?} array
  2940. * @param {?} config
  2941. * @return {?}
  2942. */
  2943. function (input, array, config) {
  2944. /** @type {?} */
  2945. const pos = input.length - 2;
  2946. array[HOUR] = toInt(input.substr(0, pos));
  2947. array[MINUTE] = toInt(input.substr(pos));
  2948. return config;
  2949. }));
  2950. addParseToken('Hmmss', (/**
  2951. * @param {?} input
  2952. * @param {?} array
  2953. * @param {?} config
  2954. * @return {?}
  2955. */
  2956. function (input, array, config) {
  2957. /** @type {?} */
  2958. const pos1 = input.length - 4;
  2959. /** @type {?} */
  2960. const pos2 = input.length - 2;
  2961. array[HOUR] = toInt(input.substr(0, pos1));
  2962. array[MINUTE] = toInt(input.substr(pos1, 2));
  2963. array[SECOND] = toInt(input.substr(pos2));
  2964. return config;
  2965. }));
  2966. }
  2967. /**
  2968. * @fileoverview added by tsickle
  2969. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  2970. */
  2971. /** @type {?} */
  2972. const locales = {};
  2973. /** @type {?} */
  2974. const localeFamilies = {};
  2975. /** @type {?} */
  2976. let globalLocale;
  2977. /**
  2978. * @param {?} key
  2979. * @return {?}
  2980. */
  2981. function normalizeLocale(key) {
  2982. return key ? key.toLowerCase().replace('_', '-') : key;
  2983. }
  2984. // pick the locale from the array
  2985. // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
  2986. // substring from most specific to least,
  2987. // but move to the next array item if it's a more specific variant than the current root
  2988. /**
  2989. * @param {?} names
  2990. * @return {?}
  2991. */
  2992. function chooseLocale(names) {
  2993. /** @type {?} */
  2994. let next;
  2995. /** @type {?} */
  2996. let locale;
  2997. /** @type {?} */
  2998. let i = 0;
  2999. while (i < names.length) {
  3000. /** @type {?} */
  3001. const split = normalizeLocale(names[i]).split('-');
  3002. /** @type {?} */
  3003. let j = split.length;
  3004. next = normalizeLocale(names[i + 1]);
  3005. next = next ? next.split('-') : null;
  3006. while (j > 0) {
  3007. locale = loadLocale(split.slice(0, j).join('-'));
  3008. if (locale) {
  3009. return locale;
  3010. }
  3011. if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
  3012. // the next array item is better than a shallower substring of this one
  3013. break;
  3014. }
  3015. j--;
  3016. }
  3017. i++;
  3018. }
  3019. return null;
  3020. }
  3021. /**
  3022. * @param {?} parentConfig
  3023. * @param {?} childConfig
  3024. * @return {?}
  3025. */
  3026. function mergeConfigs(parentConfig, childConfig) {
  3027. /** @type {?} */
  3028. const res = Object.assign({}, parentConfig);
  3029. for (const childProp in childConfig) {
  3030. if (!hasOwnProp(childConfig, childProp)) {
  3031. continue;
  3032. }
  3033. if (isObject(parentConfig[childProp]) && isObject(childConfig[childProp])) {
  3034. res[(/** @type {?} */ (childProp))] = {};
  3035. Object.assign(res[childProp], parentConfig[childProp]);
  3036. Object.assign(res[childProp], childConfig[childProp]);
  3037. }
  3038. else if (childConfig[childProp] != null) {
  3039. res[(/** @type {?} */ (childProp))] = childConfig[childProp];
  3040. }
  3041. else {
  3042. delete res[(/** @type {?} */ (childProp))];
  3043. }
  3044. }
  3045. for (const parentProp in parentConfig) {
  3046. if (hasOwnProp(parentConfig, parentProp) &&
  3047. !hasOwnProp(childConfig, parentProp) &&
  3048. isObject(parentConfig[(/** @type {?} */ (parentProp))])) {
  3049. // make sure changes to properties don't modify parent config
  3050. res[(/** @type {?} */ (parentProp))] = Object.assign({}, res[(/** @type {?} */ (parentProp))]);
  3051. }
  3052. }
  3053. return res;
  3054. }
  3055. /**
  3056. * @param {?} name
  3057. * @return {?}
  3058. */
  3059. function loadLocale(name) {
  3060. // no way!
  3061. /* var oldLocale = null;
  3062. // TODO: Find a better way to register and load all the locales in Node
  3063. if (!locales[name] && (typeof module !== 'undefined') &&
  3064. module && module.exports) {
  3065. try {
  3066. oldLocale = globalLocale._abbr;
  3067. var aliasedRequire = require;
  3068. aliasedRequire('./locale/' + name);
  3069. getSetGlobalLocale(oldLocale);
  3070. } catch (e) {}
  3071. }*/
  3072. if (!locales[name]) {
  3073. // tslint:disable-next-line
  3074. console.error(`Khronos locale error: please load locale "${name}" before using it`);
  3075. // throw new Error(`Khronos locale error: please load locale "${name}" before using it`);
  3076. }
  3077. return locales[name];
  3078. }
  3079. // This function will load locale and then set the global locale. If
  3080. // no arguments are passed in, it will simply return the current global
  3081. // locale key.
  3082. /**
  3083. * @param {?=} key
  3084. * @param {?=} values
  3085. * @return {?}
  3086. */
  3087. function getSetGlobalLocale(key, values) {
  3088. /** @type {?} */
  3089. let data;
  3090. if (key) {
  3091. if (isUndefined(values)) {
  3092. data = getLocale(key);
  3093. }
  3094. else if (isString(key)) {
  3095. data = defineLocale(key, values);
  3096. }
  3097. if (data) {
  3098. globalLocale = data;
  3099. }
  3100. }
  3101. return globalLocale && globalLocale._abbr;
  3102. }
  3103. /**
  3104. * @param {?} name
  3105. * @param {?=} config
  3106. * @return {?}
  3107. */
  3108. function defineLocale(name, config) {
  3109. if (config === null) {
  3110. // useful for testing
  3111. delete locales[name];
  3112. globalLocale = getLocale('en');
  3113. return null;
  3114. }
  3115. if (!config) {
  3116. return;
  3117. }
  3118. /** @type {?} */
  3119. let parentConfig = baseConfig;
  3120. config.abbr = name;
  3121. if (config.parentLocale != null) {
  3122. if (locales[config.parentLocale] != null) {
  3123. parentConfig = locales[config.parentLocale]._config;
  3124. }
  3125. else {
  3126. if (!localeFamilies[config.parentLocale]) {
  3127. localeFamilies[config.parentLocale] = [];
  3128. }
  3129. localeFamilies[config.parentLocale].push({ name, config });
  3130. return null;
  3131. }
  3132. }
  3133. locales[name] = new Locale(mergeConfigs(parentConfig, config));
  3134. if (localeFamilies[name]) {
  3135. localeFamilies[name].forEach((/**
  3136. * @param {?} x
  3137. * @return {?}
  3138. */
  3139. function (x) {
  3140. defineLocale(x.name, x.config);
  3141. }));
  3142. }
  3143. // backwards compat for now: also set the locale
  3144. // make sure we set the locale AFTER all child locales have been
  3145. // created, so we won't end up with the child locale set.
  3146. getSetGlobalLocale(name);
  3147. return locales[name];
  3148. }
  3149. /**
  3150. * @param {?} name
  3151. * @param {?=} config
  3152. * @return {?}
  3153. */
  3154. function updateLocale(name, config) {
  3155. /** @type {?} */
  3156. let _config = config;
  3157. if (_config != null) {
  3158. /** @type {?} */
  3159. let parentConfig = baseConfig;
  3160. // MERGE
  3161. /** @type {?} */
  3162. const tmpLocale = loadLocale(name);
  3163. if (tmpLocale != null) {
  3164. parentConfig = tmpLocale._config;
  3165. }
  3166. _config = mergeConfigs(parentConfig, _config);
  3167. /** @type {?} */
  3168. const locale = new Locale(_config);
  3169. locale.parentLocale = locales[name];
  3170. locales[name] = locale;
  3171. // backwards compat for now: also set the locale
  3172. getSetGlobalLocale(name);
  3173. }
  3174. else {
  3175. // pass null for config to unupdate, useful for tests
  3176. if (locales[name] != null) {
  3177. if (locales[name].parentLocale != null) {
  3178. locales[name] = locales[name].parentLocale;
  3179. }
  3180. else if (locales[name] != null) {
  3181. delete locales[name];
  3182. }
  3183. }
  3184. }
  3185. return locales[name];
  3186. }
  3187. // returns locale data
  3188. /**
  3189. * @param {?=} key
  3190. * @return {?}
  3191. */
  3192. function getLocale(key) {
  3193. setDefaultLocale();
  3194. if (!key) {
  3195. return globalLocale;
  3196. }
  3197. // let locale;
  3198. /** @type {?} */
  3199. const _key = isArray(key) ? key : [key];
  3200. return chooseLocale(_key);
  3201. }
  3202. /**
  3203. * @return {?}
  3204. */
  3205. function listLocales() {
  3206. return Object.keys(locales);
  3207. }
  3208. /**
  3209. * @return {?}
  3210. */
  3211. function setDefaultLocale() {
  3212. if (locales[`en`]) {
  3213. return undefined;
  3214. }
  3215. getSetGlobalLocale('en', {
  3216. dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
  3217. /**
  3218. * @param {?} num
  3219. * @return {?}
  3220. */
  3221. ordinal(num) {
  3222. /** @type {?} */
  3223. const b = num % 10;
  3224. /** @type {?} */
  3225. const output = toInt((num % 100) / 10) === 1
  3226. ? 'th'
  3227. : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th';
  3228. return num + output;
  3229. }
  3230. });
  3231. initWeek();
  3232. initWeekYear();
  3233. initYear();
  3234. initTimezone();
  3235. initTimestamp();
  3236. initSecond();
  3237. initQuarter();
  3238. initOffset();
  3239. initMonth();
  3240. initMinute();
  3241. initMillisecond();
  3242. initHour();
  3243. initDayOfYear();
  3244. initDayOfWeek();
  3245. initDayOfMonth();
  3246. }
  3247. /**
  3248. * @fileoverview added by tsickle
  3249. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3250. */
  3251. /** @type {?} */
  3252. const ordering = ['year', 'quarter', 'month', 'week', 'day', 'hours', 'minutes', 'seconds', 'milliseconds'];
  3253. const ɵ0 = /**
  3254. * @param {?} mem
  3255. * @param {?} order
  3256. * @return {?}
  3257. */
  3258. (mem, order) => {
  3259. mem[order] = true;
  3260. return mem;
  3261. };
  3262. /** @type {?} */
  3263. const orderingHash = ordering.reduce((ɵ0), {});
  3264. /**
  3265. * @param {?} duration
  3266. * @return {?}
  3267. */
  3268. function isDurationValid(duration) {
  3269. /** @type {?} */
  3270. const durationKeys = Object.keys(duration);
  3271. if (durationKeys
  3272. .some((/**
  3273. * @param {?} key
  3274. * @return {?}
  3275. */
  3276. (key) => {
  3277. return (key in orderingHash)
  3278. && duration[key] === null
  3279. || isNaN(duration[key]);
  3280. }))) {
  3281. return false;
  3282. }
  3283. // for (let key in duration) {
  3284. // if (!(indexOf.call(ordering, key) !== -1 && (duration[key] == null || !isNaN(duration[key])))) {
  3285. // return false;
  3286. // }
  3287. // }
  3288. /** @type {?} */
  3289. let unitHasDecimal = false;
  3290. for (let i = 0; i < ordering.length; ++i) {
  3291. if (duration[ordering[i]]) {
  3292. // only allow non-integers for smallest unit
  3293. if (unitHasDecimal) {
  3294. return false;
  3295. }
  3296. if (duration[ordering[i]] !== toInt(duration[ordering[i]])) {
  3297. unitHasDecimal = true;
  3298. }
  3299. }
  3300. }
  3301. return true;
  3302. }
  3303. /**
  3304. * @fileoverview added by tsickle
  3305. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3306. */
  3307. /**
  3308. * @param {?} number
  3309. * @return {?}
  3310. */
  3311. function absCeil(number) {
  3312. return number < 0 ? Math.floor(number) : Math.ceil(number);
  3313. }
  3314. /**
  3315. * @fileoverview added by tsickle
  3316. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3317. */
  3318. /**
  3319. * @param {?} dur
  3320. * @return {?}
  3321. */
  3322. function bubble(dur) {
  3323. /** @type {?} */
  3324. let milliseconds = dur._milliseconds;
  3325. /** @type {?} */
  3326. let days = dur._days;
  3327. /** @type {?} */
  3328. let months = dur._months;
  3329. /** @type {?} */
  3330. const data = dur._data;
  3331. // if we have a mix of positive and negative values, bubble down first
  3332. // check: https://github.com/moment/moment/issues/2166
  3333. if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
  3334. (milliseconds <= 0 && days <= 0 && months <= 0))) {
  3335. milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
  3336. days = 0;
  3337. months = 0;
  3338. }
  3339. // The following code bubbles up values, see the tests for
  3340. // examples of what that means.
  3341. data.milliseconds = milliseconds % 1000;
  3342. /** @type {?} */
  3343. const seconds = absFloor(milliseconds / 1000);
  3344. data.seconds = seconds % 60;
  3345. /** @type {?} */
  3346. const minutes = absFloor(seconds / 60);
  3347. data.minutes = minutes % 60;
  3348. /** @type {?} */
  3349. const hours = absFloor(minutes / 60);
  3350. data.hours = hours % 24;
  3351. days += absFloor(hours / 24);
  3352. // convert days to months
  3353. /** @type {?} */
  3354. const monthsFromDays = absFloor(daysToMonths(days));
  3355. months += monthsFromDays;
  3356. days -= absCeil(monthsToDays(monthsFromDays));
  3357. // 12 months -> 1 year
  3358. /** @type {?} */
  3359. const years = absFloor(months / 12);
  3360. months %= 12;
  3361. data.day = days;
  3362. data.month = months;
  3363. data.year = years;
  3364. return dur;
  3365. }
  3366. /**
  3367. * @param {?} day
  3368. * @return {?}
  3369. */
  3370. function daysToMonths(day) {
  3371. // 400 years have 146097 days (taking into account leap year rules)
  3372. // 400 years have 12 months === 4800
  3373. return day * 4800 / 146097;
  3374. }
  3375. /**
  3376. * @param {?} month
  3377. * @return {?}
  3378. */
  3379. function monthsToDays(month) {
  3380. // the reverse of daysToMonths
  3381. return month * 146097 / 4800;
  3382. }
  3383. /**
  3384. * @fileoverview added by tsickle
  3385. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3386. */
  3387. /** @type {?} */
  3388. let round = Math.round;
  3389. /** @type {?} */
  3390. const thresholds = {
  3391. ss: 44,
  3392. // a few seconds to seconds
  3393. s: 45,
  3394. // seconds to minute
  3395. m: 45,
  3396. // minutes to hour
  3397. h: 22,
  3398. // hours to day
  3399. d: 26,
  3400. // days to month
  3401. M: 11 // months to year
  3402. };
  3403. // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
  3404. /**
  3405. * @param {?} str
  3406. * @param {?} num
  3407. * @param {?} withoutSuffix
  3408. * @param {?} isFuture
  3409. * @param {?} locale
  3410. * @return {?}
  3411. */
  3412. function substituteTimeAgo(str, num, withoutSuffix, isFuture, locale) {
  3413. return locale.relativeTime(num || 1, !!withoutSuffix, str, isFuture);
  3414. }
  3415. /**
  3416. * @param {?} posNegDuration
  3417. * @param {?} withoutSuffix
  3418. * @param {?} locale
  3419. * @return {?}
  3420. */
  3421. function relativeTime(posNegDuration, withoutSuffix, locale) {
  3422. /** @type {?} */
  3423. const duration = createDuration(posNegDuration).abs();
  3424. /** @type {?} */
  3425. const seconds = round(duration.as('s'));
  3426. /** @type {?} */
  3427. const minutes = round(duration.as('m'));
  3428. /** @type {?} */
  3429. const hours = round(duration.as('h'));
  3430. /** @type {?} */
  3431. const days = round(duration.as('d'));
  3432. /** @type {?} */
  3433. const months = round(duration.as('M'));
  3434. /** @type {?} */
  3435. const years = round(duration.as('y'));
  3436. /** @type {?} */
  3437. const a = seconds <= thresholds.ss && ['s', seconds] ||
  3438. seconds < thresholds.s && ['ss', seconds] ||
  3439. minutes <= 1 && ['m'] ||
  3440. minutes < thresholds.m && ['mm', minutes] ||
  3441. hours <= 1 && ['h'] ||
  3442. hours < thresholds.h && ['hh', hours] ||
  3443. days <= 1 && ['d'] ||
  3444. days < thresholds.d && ['dd', days] ||
  3445. months <= 1 && ['M'] ||
  3446. months < thresholds.M && ['MM', months] ||
  3447. years <= 1 && ['y'] || ['yy', years];
  3448. /** @type {?} */
  3449. const b = [a[0], a[1], withoutSuffix, +posNegDuration > 0, locale];
  3450. // a[2] = withoutSuffix;
  3451. // a[3] = +posNegDuration > 0;
  3452. // a[4] = locale;
  3453. return substituteTimeAgo.apply(null, b);
  3454. }
  3455. /**
  3456. * @fileoverview added by tsickle
  3457. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3458. */
  3459. class Duration {
  3460. /**
  3461. * @param {?} duration
  3462. * @param {?=} config
  3463. */
  3464. constructor(duration, config = {}) {
  3465. this._data = {};
  3466. this._locale = getLocale();
  3467. this._locale = config && config._locale || getLocale();
  3468. // const normalizedInput = normalizeObjectUnits(duration);
  3469. /** @type {?} */
  3470. const normalizedInput = duration;
  3471. /** @type {?} */
  3472. const years = normalizedInput.year || 0;
  3473. /** @type {?} */
  3474. const quarters = normalizedInput.quarter || 0;
  3475. /** @type {?} */
  3476. const months = normalizedInput.month || 0;
  3477. /** @type {?} */
  3478. const weeks = normalizedInput.week || 0;
  3479. /** @type {?} */
  3480. const days = normalizedInput.day || 0;
  3481. /** @type {?} */
  3482. const hours = normalizedInput.hours || 0;
  3483. /** @type {?} */
  3484. const minutes = normalizedInput.minutes || 0;
  3485. /** @type {?} */
  3486. const seconds = normalizedInput.seconds || 0;
  3487. /** @type {?} */
  3488. const milliseconds = normalizedInput.milliseconds || 0;
  3489. this._isValid = isDurationValid(normalizedInput);
  3490. // representation for dateAddRemove
  3491. this._milliseconds = +milliseconds +
  3492. seconds * 1000 +
  3493. minutes * 60 * 1000 + // 1000 * 60
  3494. hours * 1000 * 60 * 60; // using 1000 * 60 * 60
  3495. // instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
  3496. // Because of dateAddRemove treats 24 hours as different from a
  3497. // day when working around DST, we need to store them separately
  3498. this._days = +days +
  3499. weeks * 7;
  3500. // It is impossible to translate months into days without knowing
  3501. // which months you are are talking about, so we have to store
  3502. // it separately.
  3503. this._months = +months +
  3504. quarters * 3 +
  3505. years * 12;
  3506. // this._data = {};
  3507. // this._locale = getLocale();
  3508. // this._bubble();
  3509. return bubble(this);
  3510. }
  3511. /**
  3512. * @return {?}
  3513. */
  3514. isValid() {
  3515. return this._isValid;
  3516. }
  3517. /**
  3518. * @param {?=} withSuffix
  3519. * @return {?}
  3520. */
  3521. humanize(withSuffix) {
  3522. // throw new Error(`TODO: implement`);
  3523. if (!this.isValid()) {
  3524. return this.localeData().invalidDate;
  3525. }
  3526. /** @type {?} */
  3527. const locale = this.localeData();
  3528. /** @type {?} */
  3529. let output = relativeTime(this, !withSuffix, locale);
  3530. if (withSuffix) {
  3531. output = locale.pastFuture(+this, output);
  3532. }
  3533. return locale.postformat(output);
  3534. }
  3535. /**
  3536. * @return {?}
  3537. */
  3538. localeData() {
  3539. return this._locale;
  3540. }
  3541. /**
  3542. * @param {?=} localeKey
  3543. * @return {?}
  3544. */
  3545. locale(localeKey) {
  3546. if (!localeKey) {
  3547. return this._locale._abbr;
  3548. }
  3549. this._locale = getLocale(localeKey) || this._locale;
  3550. return this;
  3551. }
  3552. /**
  3553. * @return {?}
  3554. */
  3555. abs() {
  3556. /** @type {?} */
  3557. const mathAbs = Math.abs;
  3558. /** @type {?} */
  3559. const data = this._data;
  3560. this._milliseconds = mathAbs(this._milliseconds);
  3561. this._days = mathAbs(this._days);
  3562. this._months = mathAbs(this._months);
  3563. data.milliseconds = mathAbs(data.milliseconds);
  3564. data.seconds = mathAbs(data.seconds);
  3565. data.minutes = mathAbs(data.minutes);
  3566. data.hours = mathAbs(data.hours);
  3567. data.month = mathAbs(data.month);
  3568. data.year = mathAbs(data.year);
  3569. return this;
  3570. }
  3571. /**
  3572. * @param {?} _units
  3573. * @return {?}
  3574. */
  3575. as(_units) {
  3576. if (!this.isValid()) {
  3577. return NaN;
  3578. }
  3579. /** @type {?} */
  3580. let days;
  3581. /** @type {?} */
  3582. let months;
  3583. /** @type {?} */
  3584. const milliseconds = this._milliseconds;
  3585. /** @type {?} */
  3586. const units = normalizeUnits(_units);
  3587. if (units === 'month' || units === 'year') {
  3588. days = this._days + milliseconds / 864e5;
  3589. months = this._months + daysToMonths(days);
  3590. return units === 'month' ? months : months / 12;
  3591. }
  3592. // handle milliseconds separately because of floating point math errors (issue #1867)
  3593. days = this._days + Math.round(monthsToDays(this._months));
  3594. switch (units) {
  3595. case 'week':
  3596. return days / 7 + milliseconds / 6048e5;
  3597. case 'day':
  3598. return days + milliseconds / 864e5;
  3599. case 'hours':
  3600. return days * 24 + milliseconds / 36e5;
  3601. case 'minutes':
  3602. return days * 1440 + milliseconds / 6e4;
  3603. case 'seconds':
  3604. return days * 86400 + milliseconds / 1000;
  3605. // Math.floor prevents floating point math errors here
  3606. case 'milliseconds':
  3607. return Math.floor(days * 864e5) + milliseconds;
  3608. default:
  3609. throw new Error(`Unknown unit ${units}`);
  3610. }
  3611. }
  3612. /**
  3613. * @return {?}
  3614. */
  3615. valueOf() {
  3616. if (!this.isValid()) {
  3617. return NaN;
  3618. }
  3619. return (this._milliseconds +
  3620. this._days * 864e5 +
  3621. (this._months % 12) * 2592e6 +
  3622. toInt(this._months / 12) * 31536e6);
  3623. }
  3624. }
  3625. /**
  3626. * @param {?} obj
  3627. * @return {?}
  3628. */
  3629. function isDuration(obj) {
  3630. return obj instanceof Duration;
  3631. }
  3632. /**
  3633. * @fileoverview added by tsickle
  3634. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3635. */
  3636. /**
  3637. * @param {?} config
  3638. * @return {?}
  3639. */
  3640. function isValid(config) {
  3641. if (config._isValid == null) {
  3642. /** @type {?} */
  3643. const flags = getParsingFlags(config);
  3644. /** @type {?} */
  3645. const parsedParts = Array.prototype.some.call(flags.parsedDateParts, (/**
  3646. * @param {?} i
  3647. * @return {?}
  3648. */
  3649. function (i) {
  3650. return i != null;
  3651. }));
  3652. /** @type {?} */
  3653. let isNowValid = !isNaN(config._d && config._d.getTime()) &&
  3654. flags.overflow < 0 &&
  3655. !flags.empty &&
  3656. !flags.invalidMonth &&
  3657. !flags.invalidWeekday &&
  3658. !flags.weekdayMismatch &&
  3659. !flags.nullInput &&
  3660. !flags.invalidFormat &&
  3661. !flags.userInvalidated &&
  3662. (!flags.meridiem || (flags.meridiem && parsedParts));
  3663. if (config._strict) {
  3664. isNowValid = isNowValid &&
  3665. flags.charsLeftOver === 0 &&
  3666. flags.unusedTokens.length === 0 &&
  3667. flags.bigHour === undefined;
  3668. }
  3669. if (Object.isFrozen == null || !Object.isFrozen(config)) {
  3670. config._isValid = isNowValid;
  3671. }
  3672. else {
  3673. return isNowValid;
  3674. }
  3675. }
  3676. return config._isValid;
  3677. }
  3678. /**
  3679. * @param {?} config
  3680. * @param {?=} flags
  3681. * @return {?}
  3682. */
  3683. function createInvalid(config, flags) {
  3684. config._d = new Date(NaN);
  3685. Object.assign(getParsingFlags(config), flags || { userInvalidated: true });
  3686. return config;
  3687. }
  3688. /**
  3689. * @param {?} config
  3690. * @return {?}
  3691. */
  3692. function markInvalid(config) {
  3693. config._isValid = false;
  3694. return config;
  3695. }
  3696. /**
  3697. * @fileoverview added by tsickle
  3698. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3699. */
  3700. // iso 8601 regex
  3701. // 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)
  3702. // tslint:disable-next-line
  3703. /** @type {?} */
  3704. const 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)?)?$/;
  3705. // tslint:disable-next-line
  3706. /** @type {?} */
  3707. const 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)?)?$/;
  3708. /** @type {?} */
  3709. const tzRegex = /Z|[+-]\d\d(?::?\d\d)?/;
  3710. /** @type {?} */
  3711. const isoDates = [
  3712. ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/, true],
  3713. ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/, true],
  3714. ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/, true],
  3715. ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
  3716. ['YYYY-DDD', /\d{4}-\d{3}/, true],
  3717. ['YYYY-MM', /\d{4}-\d\d/, false],
  3718. ['YYYYYYMMDD', /[+-]\d{10}/, true],
  3719. ['YYYYMMDD', /\d{8}/, true],
  3720. // YYYYMM is NOT allowed by the standard
  3721. ['GGGG[W]WWE', /\d{4}W\d{3}/, true],
  3722. ['GGGG[W]WW', /\d{4}W\d{2}/, false],
  3723. ['YYYYDDD', /\d{7}/, true]
  3724. ];
  3725. // iso time formats and regexes
  3726. /** @type {?} */
  3727. const isoTimes = [
  3728. ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
  3729. ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
  3730. ['HH:mm:ss', /\d\d:\d\d:\d\d/],
  3731. ['HH:mm', /\d\d:\d\d/],
  3732. ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
  3733. ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
  3734. ['HHmmss', /\d\d\d\d\d\d/],
  3735. ['HHmm', /\d\d\d\d/],
  3736. ['HH', /\d\d/]
  3737. ];
  3738. /** @type {?} */
  3739. const aspNetJsonRegex = /^\/?Date\((\-?\d+)/i;
  3740. /** @type {?} */
  3741. const obsOffsets = {
  3742. UT: 0,
  3743. GMT: 0,
  3744. EDT: -4 * 60,
  3745. EST: -5 * 60,
  3746. CDT: -5 * 60,
  3747. CST: -6 * 60,
  3748. MDT: -6 * 60,
  3749. MST: -7 * 60,
  3750. PDT: -7 * 60,
  3751. PST: -8 * 60
  3752. };
  3753. // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
  3754. // tslint:disable-next-line
  3755. /** @type {?} */
  3756. const 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}))$/;
  3757. // date from iso format
  3758. /**
  3759. * @param {?} config
  3760. * @return {?}
  3761. */
  3762. function configFromISO(config) {
  3763. if (!isString(config._i)) {
  3764. return config;
  3765. }
  3766. /** @type {?} */
  3767. const input = config._i;
  3768. /** @type {?} */
  3769. const match = extendedIsoRegex.exec(input) || basicIsoRegex.exec(input);
  3770. /** @type {?} */
  3771. let allowTime;
  3772. /** @type {?} */
  3773. let dateFormat;
  3774. /** @type {?} */
  3775. let timeFormat;
  3776. /** @type {?} */
  3777. let tzFormat;
  3778. if (!match) {
  3779. config._isValid = false;
  3780. return config;
  3781. }
  3782. // getParsingFlags(config).iso = true;
  3783. /** @type {?} */
  3784. let i;
  3785. /** @type {?} */
  3786. let l;
  3787. for (i = 0, l = isoDates.length; i < l; i++) {
  3788. if (isoDates[i][1].exec(match[1])) {
  3789. dateFormat = isoDates[i][0];
  3790. allowTime = isoDates[i][2] !== false;
  3791. break;
  3792. }
  3793. }
  3794. if (dateFormat == null) {
  3795. config._isValid = false;
  3796. return config;
  3797. }
  3798. if (match[3]) {
  3799. for (i = 0, l = isoTimes.length; i < l; i++) {
  3800. if (isoTimes[i][1].exec(match[3])) {
  3801. // match[2] should be 'T' or space
  3802. timeFormat = (match[2] || ' ') + isoTimes[i][0];
  3803. break;
  3804. }
  3805. }
  3806. if (timeFormat == null) {
  3807. config._isValid = false;
  3808. return config;
  3809. }
  3810. }
  3811. if (!allowTime && timeFormat != null) {
  3812. config._isValid = false;
  3813. return config;
  3814. }
  3815. if (match[4]) {
  3816. if (tzRegex.exec(match[4])) {
  3817. tzFormat = 'Z';
  3818. }
  3819. else {
  3820. config._isValid = false;
  3821. return config;
  3822. }
  3823. }
  3824. config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
  3825. return configFromStringAndFormat(config);
  3826. }
  3827. // tslint:disable-next-line
  3828. /**
  3829. * @param {?} yearStr
  3830. * @param {?} monthStr
  3831. * @param {?} dayStr
  3832. * @param {?} hourStr
  3833. * @param {?} minuteStr
  3834. * @param {?} secondStr
  3835. * @return {?}
  3836. */
  3837. function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
  3838. /** @type {?} */
  3839. const result = [
  3840. untruncateYear(yearStr),
  3841. defaultLocaleMonthsShort.indexOf(monthStr),
  3842. parseInt(dayStr, 10),
  3843. parseInt(hourStr, 10),
  3844. parseInt(minuteStr, 10)
  3845. ];
  3846. if (secondStr) {
  3847. result.push(parseInt(secondStr, 10));
  3848. }
  3849. return result;
  3850. }
  3851. /**
  3852. * @param {?} yearStr
  3853. * @return {?}
  3854. */
  3855. function untruncateYear(yearStr) {
  3856. /** @type {?} */
  3857. const year = parseInt(yearStr, 10);
  3858. return year <= 49 ? year + 2000 : year;
  3859. }
  3860. /**
  3861. * @param {?} str
  3862. * @return {?}
  3863. */
  3864. function preprocessRFC2822(str) {
  3865. // Remove comments and folding whitespace and replace multiple-spaces with a single space
  3866. return str
  3867. .replace(/\([^)]*\)|[\n\t]/g, ' ')
  3868. .replace(/(\s\s+)/g, ' ').trim();
  3869. }
  3870. /**
  3871. * @param {?} weekdayStr
  3872. * @param {?} parsedInput
  3873. * @param {?} config
  3874. * @return {?}
  3875. */
  3876. function checkWeekday(weekdayStr, parsedInput, config) {
  3877. if (weekdayStr) {
  3878. // TODO: Replace the vanilla JS Date object with an indepentent day-of-week check.
  3879. /** @type {?} */
  3880. const weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr);
  3881. /** @type {?} */
  3882. const weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay();
  3883. if (weekdayProvided !== weekdayActual) {
  3884. getParsingFlags(config).weekdayMismatch = true;
  3885. config._isValid = false;
  3886. return false;
  3887. }
  3888. }
  3889. return true;
  3890. }
  3891. /**
  3892. * @param {?} obsOffset
  3893. * @param {?} militaryOffset
  3894. * @param {?} numOffset
  3895. * @return {?}
  3896. */
  3897. function calculateOffset(obsOffset, militaryOffset, numOffset) {
  3898. if (obsOffset) {
  3899. return obsOffsets[obsOffset];
  3900. }
  3901. else if (militaryOffset) {
  3902. // the only allowed military tz is Z
  3903. return 0;
  3904. }
  3905. else {
  3906. /** @type {?} */
  3907. const hm = parseInt(numOffset, 10);
  3908. /** @type {?} */
  3909. const m = hm % 100;
  3910. /** @type {?} */
  3911. const h = (hm - m) / 100;
  3912. return h * 60 + m;
  3913. }
  3914. }
  3915. // date and time from ref 2822 format
  3916. /**
  3917. * @param {?} config
  3918. * @return {?}
  3919. */
  3920. function configFromRFC2822(config) {
  3921. if (!isString(config._i)) {
  3922. return config;
  3923. }
  3924. /** @type {?} */
  3925. const match = rfc2822.exec(preprocessRFC2822(config._i));
  3926. if (!match) {
  3927. return markInvalid(config);
  3928. }
  3929. /** @type {?} */
  3930. const parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]);
  3931. if (!checkWeekday(match[1], parsedArray, config)) {
  3932. return config;
  3933. }
  3934. config._a = parsedArray;
  3935. config._tzm = calculateOffset(match[8], match[9], match[10]);
  3936. config._d = createUTCDate.apply(null, config._a);
  3937. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  3938. getParsingFlags(config).rfc2822 = true;
  3939. return config;
  3940. }
  3941. // date from iso format or fallback
  3942. /**
  3943. * @param {?} config
  3944. * @return {?}
  3945. */
  3946. function configFromString(config) {
  3947. if (!isString(config._i)) {
  3948. return config;
  3949. }
  3950. /** @type {?} */
  3951. const matched = aspNetJsonRegex.exec(config._i);
  3952. if (matched !== null) {
  3953. config._d = new Date(+matched[1]);
  3954. return config;
  3955. }
  3956. // todo: update logic processing
  3957. // isISO -> configFromISO
  3958. // isRFC -> configFromRFC
  3959. configFromISO(config);
  3960. if (config._isValid === false) {
  3961. delete config._isValid;
  3962. }
  3963. else {
  3964. return config;
  3965. }
  3966. configFromRFC2822(config);
  3967. if (config._isValid === false) {
  3968. delete config._isValid;
  3969. }
  3970. else {
  3971. return config;
  3972. }
  3973. // Final attempt, use Input Fallback
  3974. // hooks.createFromInputFallback(config);
  3975. return createInvalid(config);
  3976. }
  3977. /**
  3978. * @fileoverview added by tsickle
  3979. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  3980. */
  3981. /**
  3982. * @param {?} date
  3983. * @param {?} format
  3984. * @param {?=} locale
  3985. * @param {?=} isUTC
  3986. * @param {?=} offset
  3987. * @return {?}
  3988. */
  3989. function formatDate(date, format, locale, isUTC, offset = 0) {
  3990. /** @type {?} */
  3991. const _locale = getLocale(locale || 'en');
  3992. if (!_locale) {
  3993. throw new Error(`Locale "${locale}" is not defined, please add it with "defineLocale(...)"`);
  3994. }
  3995. /** @type {?} */
  3996. const _format = format || (isUTC ? 'YYYY-MM-DDTHH:mm:ss[Z]' : 'YYYY-MM-DDTHH:mm:ssZ');
  3997. /** @type {?} */
  3998. const output = formatMoment(date, _format, _locale, isUTC, offset);
  3999. if (!output) {
  4000. return output;
  4001. }
  4002. return _locale.postformat(output);
  4003. }
  4004. // format date using native date object
  4005. /**
  4006. * @param {?} date
  4007. * @param {?} _format
  4008. * @param {?} locale
  4009. * @param {?=} isUTC
  4010. * @param {?=} offset
  4011. * @return {?}
  4012. */
  4013. function formatMoment(date, _format, locale, isUTC, offset = 0) {
  4014. if (!isDateValid(date)) {
  4015. return locale.invalidDate;
  4016. }
  4017. /** @type {?} */
  4018. const format = expandFormat(_format, locale);
  4019. formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format);
  4020. return formatFunctions[format](date, locale, isUTC, offset);
  4021. }
  4022. /**
  4023. * @param {?} _format
  4024. * @param {?} locale
  4025. * @return {?}
  4026. */
  4027. function expandFormat(_format, locale) {
  4028. /** @type {?} */
  4029. let format = _format;
  4030. /** @type {?} */
  4031. let i = 5;
  4032. /** @type {?} */
  4033. const localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g;
  4034. /** @type {?} */
  4035. const replaceLongDateFormatTokens = (/**
  4036. * @param {?} input
  4037. * @return {?}
  4038. */
  4039. (input) => {
  4040. return locale.formatLongDate(input) || input;
  4041. });
  4042. localFormattingTokens.lastIndex = 0;
  4043. while (i >= 0 && localFormattingTokens.test(format)) {
  4044. format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
  4045. localFormattingTokens.lastIndex = 0;
  4046. i -= 1;
  4047. }
  4048. return format;
  4049. }
  4050. /**
  4051. * @fileoverview added by tsickle
  4052. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  4053. */
  4054. // Pick the first defined of two or three arguments.
  4055. /**
  4056. * @template T
  4057. * @param {?=} a
  4058. * @param {?=} b
  4059. * @param {?=} c
  4060. * @return {?}
  4061. */
  4062. function defaults(a, b, c) {
  4063. if (a != null) {
  4064. return a;
  4065. }
  4066. if (b != null) {
  4067. return b;
  4068. }
  4069. return c;
  4070. }
  4071. /**
  4072. * @fileoverview added by tsickle
  4073. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  4074. */
  4075. /**
  4076. * @param {?} config
  4077. * @return {?}
  4078. */
  4079. function currentDateArray(config) {
  4080. /** @type {?} */
  4081. const nowValue = new Date();
  4082. if (config._useUTC) {
  4083. return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()];
  4084. }
  4085. return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
  4086. }
  4087. // convert an array to a date.
  4088. // the array should mirror the parameters below
  4089. // note: all values past the year are optional and will default to the lowest possible value.
  4090. // [year, month, day , hour, minute, second, millisecond]
  4091. /**
  4092. * @param {?} config
  4093. * @return {?}
  4094. */
  4095. function configFromArray(config) {
  4096. /** @type {?} */
  4097. const input = [];
  4098. /** @type {?} */
  4099. let i;
  4100. /** @type {?} */
  4101. let date;
  4102. /** @type {?} */
  4103. let currentDate;
  4104. /** @type {?} */
  4105. let expectedWeekday;
  4106. /** @type {?} */
  4107. let yearToUse;
  4108. if (config._d) {
  4109. return config;
  4110. }
  4111. currentDate = currentDateArray(config);
  4112. // compute day of the year from weeks and weekdays
  4113. if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
  4114. dayOfYearFromWeekInfo(config);
  4115. }
  4116. // if the day of the year is set, figure out what it is
  4117. if (config._dayOfYear != null) {
  4118. yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
  4119. if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {
  4120. getParsingFlags(config)._overflowDayOfYear = true;
  4121. }
  4122. date = new Date(Date.UTC(yearToUse, 0, config._dayOfYear));
  4123. config._a[MONTH] = date.getUTCMonth();
  4124. config._a[DATE] = date.getUTCDate();
  4125. }
  4126. // Default to current date.
  4127. // * if no year, month, day of month are given, default to today
  4128. // * if day of month is given, default month and year
  4129. // * if month is given, default only year
  4130. // * if year is given, don't default anything
  4131. for (i = 0; i < 3 && config._a[i] == null; ++i) {
  4132. config._a[i] = input[i] = currentDate[i];
  4133. }
  4134. // Zero out whatever was not defaulted, including time
  4135. for (; i < 7; i++) {
  4136. config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i];
  4137. }
  4138. // Check for 24:00:00.000
  4139. if (config._a[HOUR] === 24 &&
  4140. config._a[MINUTE] === 0 &&
  4141. config._a[SECOND] === 0 &&
  4142. config._a[MILLISECOND] === 0) {
  4143. config._nextDay = true;
  4144. config._a[HOUR] = 0;
  4145. }
  4146. config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input);
  4147. expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay();
  4148. // Apply timezone offset from input. The actual utcOffset can be changed
  4149. // with parseZone.
  4150. if (config._tzm != null) {
  4151. config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
  4152. }
  4153. if (config._nextDay) {
  4154. config._a[HOUR] = 24;
  4155. }
  4156. // check for mismatching day of week
  4157. if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) {
  4158. getParsingFlags(config).weekdayMismatch = true;
  4159. }
  4160. return config;
  4161. }
  4162. /**
  4163. * @param {?} config
  4164. * @return {?}
  4165. */
  4166. function dayOfYearFromWeekInfo(config) {
  4167. /** @type {?} */
  4168. let w;
  4169. /** @type {?} */
  4170. let weekYear;
  4171. /** @type {?} */
  4172. let week;
  4173. /** @type {?} */
  4174. let weekday;
  4175. /** @type {?} */
  4176. let dow;
  4177. /** @type {?} */
  4178. let doy;
  4179. /** @type {?} */
  4180. let temp;
  4181. /** @type {?} */
  4182. let weekdayOverflow;
  4183. w = config._w;
  4184. if (w.GG != null || w.W != null || w.E != null) {
  4185. dow = 1;
  4186. doy = 4;
  4187. // TODO: We need to take the current isoWeekYear, but that depends on
  4188. // how we interpret now (local, utc, fixed offset). So create
  4189. // a now version of current config (take local/utc/offset flags, and
  4190. // create now).
  4191. weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(new Date(), 1, 4).year);
  4192. week = defaults(w.W, 1);
  4193. weekday = defaults(w.E, 1);
  4194. if (weekday < 1 || weekday > 7) {
  4195. weekdayOverflow = true;
  4196. }
  4197. }
  4198. else {
  4199. dow = config._locale._week.dow;
  4200. doy = config._locale._week.doy;
  4201. /** @type {?} */
  4202. const curWeek = weekOfYear(new Date(), dow, doy);
  4203. weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
  4204. // Default to current week.
  4205. week = defaults(w.w, curWeek.week);
  4206. if (w.d != null) {
  4207. // weekday -- low day numbers are considered next week
  4208. weekday = w.d;
  4209. if (weekday < 0 || weekday > 6) {
  4210. weekdayOverflow = true;
  4211. }
  4212. }
  4213. else if (w.e != null) {
  4214. // local weekday -- counting starts from begining of week
  4215. weekday = w.e + dow;
  4216. if (w.e < 0 || w.e > 6) {
  4217. weekdayOverflow = true;
  4218. }
  4219. }
  4220. else {
  4221. // default to begining of week
  4222. weekday = dow;
  4223. }
  4224. }
  4225. if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
  4226. getParsingFlags(config)._overflowWeeks = true;
  4227. }
  4228. else if (weekdayOverflow != null) {
  4229. getParsingFlags(config)._overflowWeekday = true;
  4230. }
  4231. else {
  4232. temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
  4233. config._a[YEAR] = temp.year;
  4234. config._dayOfYear = temp.dayOfYear;
  4235. }
  4236. return config;
  4237. }
  4238. /**
  4239. * @fileoverview added by tsickle
  4240. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  4241. */
  4242. /**
  4243. * @param {?} config
  4244. * @return {?}
  4245. */
  4246. function checkOverflow(config) {
  4247. /** @type {?} */
  4248. let overflow;
  4249. /** @type {?} */
  4250. const a = config._a;
  4251. if (a && getParsingFlags(config).overflow === -2) {
  4252. // todo: fix this sh*t
  4253. overflow =
  4254. a[MONTH] < 0 || a[MONTH] > 11 ? MONTH :
  4255. a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
  4256. a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
  4257. a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE :
  4258. a[SECOND] < 0 || a[SECOND] > 59 ? SECOND :
  4259. a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
  4260. -1;
  4261. if (getParsingFlags(config)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
  4262. overflow = DATE;
  4263. }
  4264. if (getParsingFlags(config)._overflowWeeks && overflow === -1) {
  4265. overflow = WEEK;
  4266. }
  4267. if (getParsingFlags(config)._overflowWeekday && overflow === -1) {
  4268. overflow = WEEKDAY;
  4269. }
  4270. getParsingFlags(config).overflow = overflow;
  4271. }
  4272. return config;
  4273. }
  4274. /**
  4275. * @fileoverview added by tsickle
  4276. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  4277. */
  4278. // constant that refers to the ISO standard
  4279. // hooks.ISO_8601 = function () {};
  4280. /** @type {?} */
  4281. const ISO_8601 = 'ISO_8601';
  4282. // constant that refers to the RFC 2822 form
  4283. // hooks.RFC_2822 = function () {};
  4284. /** @type {?} */
  4285. const RFC_2822 = 'RFC_2822';
  4286. // date from string and format string
  4287. /**
  4288. * @param {?} config
  4289. * @return {?}
  4290. */
  4291. function configFromStringAndFormat(config) {
  4292. // TODO: Move this to another part of the creation flow to prevent circular deps
  4293. if (config._f === ISO_8601) {
  4294. return configFromISO(config);
  4295. }
  4296. if (config._f === RFC_2822) {
  4297. return configFromRFC2822(config);
  4298. }
  4299. config._a = [];
  4300. getParsingFlags(config).empty = true;
  4301. if (isArray(config._f) || (!config._i && config._i !== 0)) {
  4302. return config;
  4303. }
  4304. // This array is used to make a Date, either with `new Date` or `Date.UTC`
  4305. /** @type {?} */
  4306. let input = config._i.toString();
  4307. /** @type {?} */
  4308. let totalParsedInputLength = 0;
  4309. /** @type {?} */
  4310. const inputLength = input.length;
  4311. /** @type {?} */
  4312. const tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
  4313. /** @type {?} */
  4314. let i;
  4315. /** @type {?} */
  4316. let token;
  4317. /** @type {?} */
  4318. let parsedInput;
  4319. /** @type {?} */
  4320. let skipped;
  4321. for (i = 0; i < tokens.length; i++) {
  4322. token = tokens[i];
  4323. parsedInput = (input.match(getParseRegexForToken(token, config._locale)) || [])[0];
  4324. if (parsedInput) {
  4325. skipped = input.substr(0, input.indexOf(parsedInput));
  4326. if (skipped.length > 0) {
  4327. getParsingFlags(config).unusedInput.push(skipped);
  4328. }
  4329. input = input.slice(input.indexOf(parsedInput) + parsedInput.length);
  4330. totalParsedInputLength += parsedInput.length;
  4331. }
  4332. // don't parse if it's not a known token
  4333. if (formatTokenFunctions[token]) {
  4334. if (parsedInput) {
  4335. getParsingFlags(config).empty = false;
  4336. }
  4337. else {
  4338. getParsingFlags(config).unusedTokens.push(token);
  4339. }
  4340. addTimeToArrayFromToken(token, parsedInput, config);
  4341. }
  4342. else if (config._strict && !parsedInput) {
  4343. getParsingFlags(config).unusedTokens.push(token);
  4344. }
  4345. }
  4346. // add remaining unparsed input length to the string
  4347. getParsingFlags(config).charsLeftOver = inputLength - totalParsedInputLength;
  4348. if (input.length > 0) {
  4349. getParsingFlags(config).unusedInput.push(input);
  4350. }
  4351. // clear _12h flag if hour is <= 12
  4352. if (config._a[HOUR] <= 12 &&
  4353. getParsingFlags(config).bigHour === true &&
  4354. config._a[HOUR] > 0) {
  4355. getParsingFlags(config).bigHour = void 0;
  4356. }
  4357. getParsingFlags(config).parsedDateParts = config._a.slice(0);
  4358. getParsingFlags(config).meridiem = config._meridiem;
  4359. // handle meridiem
  4360. config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem);
  4361. configFromArray(config);
  4362. return checkOverflow(config);
  4363. }
  4364. /**
  4365. * @param {?} locale
  4366. * @param {?} _hour
  4367. * @param {?} meridiem
  4368. * @return {?}
  4369. */
  4370. function meridiemFixWrap(locale, _hour, meridiem) {
  4371. /** @type {?} */
  4372. let hour = _hour;
  4373. if (meridiem == null) {
  4374. // nothing to do
  4375. return hour;
  4376. }
  4377. if (locale.meridiemHour != null) {
  4378. return locale.meridiemHour(hour, meridiem);
  4379. }
  4380. if (locale.isPM == null) {
  4381. // this is not supposed to happen
  4382. return hour;
  4383. }
  4384. // Fallback
  4385. /** @type {?} */
  4386. const isPm = locale.isPM(meridiem);
  4387. if (isPm && hour < 12) {
  4388. hour += 12;
  4389. }
  4390. if (!isPm && hour === 12) {
  4391. hour = 0;
  4392. }
  4393. return hour;
  4394. }
  4395. /**
  4396. * @fileoverview added by tsickle
  4397. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  4398. */
  4399. // date from string and array of format strings
  4400. /**
  4401. * @param {?} config
  4402. * @return {?}
  4403. */
  4404. function configFromStringAndArray(config) {
  4405. /** @type {?} */
  4406. let tempConfig;
  4407. /** @type {?} */
  4408. let bestMoment;
  4409. /** @type {?} */
  4410. let scoreToBeat;
  4411. /** @type {?} */
  4412. let currentScore;
  4413. if (!config._f || config._f.length === 0) {
  4414. getParsingFlags(config).invalidFormat = true;
  4415. return createInvalid(config);
  4416. }
  4417. /** @type {?} */
  4418. let i;
  4419. for (i = 0; i < config._f.length; i++) {
  4420. currentScore = 0;
  4421. tempConfig = Object.assign({}, config);
  4422. if (config._useUTC != null) {
  4423. tempConfig._useUTC = config._useUTC;
  4424. }
  4425. tempConfig._f = config._f[i];
  4426. configFromStringAndFormat(tempConfig);
  4427. if (!isValid(tempConfig)) {
  4428. continue;
  4429. }
  4430. // if there is any input that was not parsed add a penalty for that format
  4431. currentScore += getParsingFlags(tempConfig).charsLeftOver;
  4432. // or tokens
  4433. currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
  4434. getParsingFlags(tempConfig).score = currentScore;
  4435. if (scoreToBeat == null || currentScore < scoreToBeat) {
  4436. scoreToBeat = currentScore;
  4437. bestMoment = tempConfig;
  4438. }
  4439. }
  4440. return Object.assign(config, bestMoment || tempConfig);
  4441. }
  4442. /**
  4443. * @fileoverview added by tsickle
  4444. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  4445. */
  4446. /**
  4447. * @param {?} config
  4448. * @return {?}
  4449. */
  4450. function configFromObject(config) {
  4451. if (config._d) {
  4452. return config;
  4453. }
  4454. /** @type {?} */
  4455. const input = config._i;
  4456. if (isObject(input)) {
  4457. /** @type {?} */
  4458. const i = normalizeObjectUnits((/** @type {?} */ (input)));
  4459. config._a = [i.year, i.month, i.day, i.hours, i.minutes, i.seconds, i.milliseconds]
  4460. // todo: obsolete -> remove it
  4461. .map((/**
  4462. * @param {?} obj
  4463. * @return {?}
  4464. */
  4465. obj => isString(obj) ? parseInt(obj, 10) : obj));
  4466. }
  4467. return configFromArray(config);
  4468. }
  4469. /**
  4470. * @fileoverview added by tsickle
  4471. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  4472. */
  4473. /**
  4474. * @param {?} config
  4475. * @return {?}
  4476. */
  4477. function createFromConfig(config) {
  4478. /** @type {?} */
  4479. const res = checkOverflow(prepareConfig(config));
  4480. // todo: remove, in moment.js it's never called cuz of moment constructor
  4481. res._d = new Date(res._d != null ? res._d.getTime() : NaN);
  4482. if (!isValid(Object.assign({}, res, { _isValid: null }))) {
  4483. res._d = new Date(NaN);
  4484. }
  4485. // todo: update offset
  4486. /*if (res._nextDay) {
  4487. // Adding is smart enough around DST
  4488. res._d = add(res._d, 1, 'day');
  4489. res._nextDay = undefined;
  4490. }*/
  4491. return res;
  4492. }
  4493. /**
  4494. * @param {?} config
  4495. * @return {?}
  4496. */
  4497. function prepareConfig(config) {
  4498. /** @type {?} */
  4499. let input = config._i;
  4500. /** @type {?} */
  4501. const format = config._f;
  4502. config._locale = config._locale || getLocale(config._l);
  4503. if (input === null || (format === undefined && input === '')) {
  4504. return createInvalid(config, { nullInput: true });
  4505. }
  4506. if (isString(input)) {
  4507. config._i = input = config._locale.preparse(input);
  4508. }
  4509. if (isDate(input)) {
  4510. config._d = cloneDate(input);
  4511. return config;
  4512. }
  4513. // todo: add check for recursion
  4514. if (isArray(format)) {
  4515. configFromStringAndArray(config);
  4516. }
  4517. else if (format) {
  4518. configFromStringAndFormat(config);
  4519. }
  4520. else {
  4521. configFromInput(config);
  4522. }
  4523. if (!isValid(config)) {
  4524. config._d = null;
  4525. }
  4526. return config;
  4527. }
  4528. /**
  4529. * @param {?} config
  4530. * @return {?}
  4531. */
  4532. function configFromInput(config) {
  4533. /** @type {?} */
  4534. const input = config._i;
  4535. if (isUndefined(input)) {
  4536. config._d = new Date();
  4537. }
  4538. else if (isDate(input)) {
  4539. config._d = cloneDate(input);
  4540. }
  4541. else if (isString(input)) {
  4542. configFromString(config);
  4543. }
  4544. else if (isArray(input) && input.length) {
  4545. /** @type {?} */
  4546. const _arr = input.slice(0);
  4547. config._a = _arr.map((/**
  4548. * @param {?} obj
  4549. * @return {?}
  4550. */
  4551. obj => isString(obj) ? parseInt(obj, 10) : obj));
  4552. configFromArray(config);
  4553. }
  4554. else if (isObject(input)) {
  4555. configFromObject(config);
  4556. }
  4557. else if (isNumber(input)) {
  4558. // from milliseconds
  4559. config._d = new Date(input);
  4560. }
  4561. else {
  4562. // hooks.createFromInputFallback(config);
  4563. return createInvalid(config);
  4564. }
  4565. return config;
  4566. }
  4567. /**
  4568. * @param {?} input
  4569. * @param {?=} format
  4570. * @param {?=} localeKey
  4571. * @param {?=} strict
  4572. * @param {?=} isUTC
  4573. * @return {?}
  4574. */
  4575. function createLocalOrUTC(input, format, localeKey, strict, isUTC) {
  4576. /** @type {?} */
  4577. const config = {};
  4578. /** @type {?} */
  4579. let _input = input;
  4580. // params switch -> skip; test it well
  4581. // if (localeKey === true || localeKey === false) {
  4582. // strict = localeKey;
  4583. // localeKey = undefined;
  4584. // }
  4585. // todo: fail fast and return not valid date
  4586. if ((isObject(_input) && isObjectEmpty(_input)) || (isArray(_input) && _input.length === 0)) {
  4587. _input = undefined;
  4588. }
  4589. // object construction must be done this way.
  4590. // https://github.com/moment/moment/issues/1423
  4591. // config._isAMomentObject = true;
  4592. config._useUTC = config._isUTC = isUTC;
  4593. config._l = localeKey;
  4594. config._i = _input;
  4595. config._f = format;
  4596. config._strict = strict;
  4597. return createFromConfig(config);
  4598. }
  4599. /**
  4600. * @fileoverview added by tsickle
  4601. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  4602. */
  4603. /**
  4604. * @param {?} input
  4605. * @param {?=} format
  4606. * @param {?=} localeKey
  4607. * @param {?=} strict
  4608. * @param {?=} isUTC
  4609. * @return {?}
  4610. */
  4611. function parseDate(input, format, localeKey, strict, isUTC) {
  4612. if (isDate(input)) {
  4613. return input;
  4614. }
  4615. /** @type {?} */
  4616. const config = createLocalOrUTC(input, format, localeKey, strict, isUTC);
  4617. return config._d;
  4618. }
  4619. /**
  4620. * @param {?} date
  4621. * @return {?}
  4622. */
  4623. function utcAsLocal(date) {
  4624. if (!(date instanceof Date)) {
  4625. return null;
  4626. }
  4627. return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());
  4628. }
  4629. /**
  4630. * @fileoverview added by tsickle
  4631. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  4632. */
  4633. /**
  4634. * @param {?} num
  4635. * @return {?}
  4636. */
  4637. function absRound(num) {
  4638. return num < 0 ? Math.round(num * -1) * -1 : Math.round(num);
  4639. }
  4640. /**
  4641. * @fileoverview added by tsickle
  4642. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  4643. */
  4644. /**
  4645. * @param {?} date1
  4646. * @param {?} date2
  4647. * @param {?=} units
  4648. * @return {?}
  4649. */
  4650. function isAfter(date1, date2, units = 'milliseconds') {
  4651. if (!date1 || !date2) {
  4652. return false;
  4653. }
  4654. if (units === 'milliseconds') {
  4655. return date1.valueOf() > date2.valueOf();
  4656. }
  4657. return date2.valueOf() < startOf(date1, units).valueOf();
  4658. }
  4659. /**
  4660. * @param {?} date1
  4661. * @param {?} date2
  4662. * @param {?=} units
  4663. * @return {?}
  4664. */
  4665. function isBefore(date1, date2, units = 'milliseconds') {
  4666. if (!date1 || !date2) {
  4667. return false;
  4668. }
  4669. if (units === 'milliseconds') {
  4670. return date1.valueOf() < date2.valueOf();
  4671. }
  4672. return endOf(date1, units).valueOf() < date2.valueOf();
  4673. }
  4674. /**
  4675. * @param {?} date
  4676. * @param {?} daysDisabled
  4677. * @return {?}
  4678. */
  4679. function isDisabledDay(date, daysDisabled) {
  4680. if (daysDisabled === undefined || !daysDisabled || !daysDisabled.length) {
  4681. return false;
  4682. }
  4683. return daysDisabled.some((/**
  4684. * @param {?} day
  4685. * @return {?}
  4686. */
  4687. (day) => day === date.getDay()));
  4688. }
  4689. /**
  4690. * @param {?} date1
  4691. * @param {?} date2
  4692. * @param {?=} units
  4693. * @return {?}
  4694. */
  4695. function isSame(date1, date2, units = 'milliseconds') {
  4696. if (!date1 || !date2) {
  4697. return false;
  4698. }
  4699. if (units === 'milliseconds') {
  4700. return date1.valueOf() === date2.valueOf();
  4701. }
  4702. /** @type {?} */
  4703. const inputMs = date2.valueOf();
  4704. return (startOf(date1, units).valueOf() <= inputMs &&
  4705. inputMs <= endOf(date1, units).valueOf());
  4706. }
  4707. /**
  4708. * @fileoverview added by tsickle
  4709. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  4710. */
  4711. /** @type {?} */
  4712. const aspNetRegex = /^(\-|\+)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)(\.\d*)?)?$/;
  4713. // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
  4714. // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
  4715. // and further modified to allow for strings containing both week and day
  4716. // tslint:disable-next-line
  4717. /** @type {?} */
  4718. const isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
  4719. /**
  4720. * @param {?=} input
  4721. * @param {?=} key
  4722. * @param {?=} config
  4723. * @return {?}
  4724. */
  4725. function createDuration(input, key, config = {}) {
  4726. /** @type {?} */
  4727. const duration = convertDuration(input, key);
  4728. // matching against regexp is expensive, do it on demand
  4729. return new Duration(duration, config);
  4730. }
  4731. /**
  4732. * @param {?} input
  4733. * @param {?} key
  4734. * @return {?}
  4735. */
  4736. function convertDuration(input, key) {
  4737. // checks for null or undefined
  4738. if (input == null) {
  4739. return {};
  4740. }
  4741. if (isDuration(input)) {
  4742. return {
  4743. milliseconds: input._milliseconds,
  4744. day: input._days,
  4745. month: input._months
  4746. };
  4747. }
  4748. if (isNumber(input)) {
  4749. // duration = {};
  4750. return key ? { [key]: input } : { milliseconds: input };
  4751. }
  4752. if (isString(input)) {
  4753. /** @type {?} */
  4754. let match = aspNetRegex.exec(input);
  4755. if (match) {
  4756. /** @type {?} */
  4757. const sign = (match[1] === '-') ? -1 : 1;
  4758. return {
  4759. year: 0,
  4760. day: toInt(match[DATE]) * sign,
  4761. hours: toInt(match[HOUR]) * sign,
  4762. minutes: toInt(match[MINUTE]) * sign,
  4763. seconds: toInt(match[SECOND]) * sign,
  4764. // the millisecond decimal point is included in the match
  4765. milliseconds: toInt(absRound(toInt(match[MILLISECOND]) * 1000)) * sign
  4766. };
  4767. }
  4768. match = isoRegex.exec(input);
  4769. if (match) {
  4770. /** @type {?} */
  4771. const sign = (match[1] === '-') ? -1 : (match[1] === '+') ? 1 : 1;
  4772. return {
  4773. year: parseIso(match[2], sign),
  4774. month: parseIso(match[3], sign),
  4775. week: parseIso(match[4], sign),
  4776. day: parseIso(match[5], sign),
  4777. hours: parseIso(match[6], sign),
  4778. minutes: parseIso(match[7], sign),
  4779. seconds: parseIso(match[8], sign)
  4780. };
  4781. }
  4782. }
  4783. if (isObject(input) && ('from' in input || 'to' in input)) {
  4784. /** @type {?} */
  4785. const diffRes = momentsDifference(parseDate(input.from), parseDate(input.to));
  4786. return {
  4787. milliseconds: diffRes.milliseconds,
  4788. month: diffRes.months
  4789. };
  4790. }
  4791. return input;
  4792. }
  4793. // createDuration.fn = Duration.prototype;
  4794. // createDuration.invalid = invalid;
  4795. /**
  4796. * @param {?} inp
  4797. * @param {?} sign
  4798. * @return {?}
  4799. */
  4800. function parseIso(inp, sign) {
  4801. // We'd normally use ~~inp for this, but unfortunately it also
  4802. // converts floats to ints.
  4803. // inp may be undefined, so careful calling replace on it.
  4804. /** @type {?} */
  4805. const res = inp && parseFloat(inp.replace(',', '.'));
  4806. // apply sign while we're at it
  4807. return (isNaN(res) ? 0 : res) * sign;
  4808. }
  4809. /**
  4810. * @param {?} base
  4811. * @param {?} other
  4812. * @return {?}
  4813. */
  4814. function positiveMomentsDifference(base, other) {
  4815. /** @type {?} */
  4816. const res = { milliseconds: 0, months: 0 };
  4817. res.months = getMonth(other) - getMonth(base) +
  4818. (getFullYear(other) - getFullYear(base)) * 12;
  4819. /** @type {?} */
  4820. const _basePlus = add(cloneDate(base), res.months, 'month');
  4821. if (isAfter(_basePlus, other)) {
  4822. --res.months;
  4823. }
  4824. res.milliseconds = +other - +(add(cloneDate(base), res.months, 'month'));
  4825. return res;
  4826. }
  4827. /**
  4828. * @param {?} base
  4829. * @param {?} other
  4830. * @return {?}
  4831. */
  4832. function momentsDifference(base, other) {
  4833. if (!(isDateValid(base) && isDateValid(other))) {
  4834. return { milliseconds: 0, months: 0 };
  4835. }
  4836. /** @type {?} */
  4837. let res;
  4838. /** @type {?} */
  4839. const _other = cloneWithOffset(other, base, { _offset: base.getTimezoneOffset() });
  4840. if (isBefore(base, _other)) {
  4841. res = positiveMomentsDifference(base, _other);
  4842. }
  4843. else {
  4844. res = positiveMomentsDifference(_other, base);
  4845. res.milliseconds = -res.milliseconds;
  4846. res.months = -res.months;
  4847. }
  4848. return res;
  4849. }
  4850. /**
  4851. * @fileoverview added by tsickle
  4852. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  4853. */
  4854. /**
  4855. * @param {?} date
  4856. * @param {?} val
  4857. * @param {?} period
  4858. * @param {?=} isUTC
  4859. * @return {?}
  4860. */
  4861. function add(date, val, period, isUTC) {
  4862. /** @type {?} */
  4863. const dur = createDuration(val, period);
  4864. return addSubtract(date, dur, 1, isUTC);
  4865. }
  4866. /**
  4867. * @param {?} date
  4868. * @param {?} val
  4869. * @param {?} period
  4870. * @param {?=} isUTC
  4871. * @return {?}
  4872. */
  4873. function subtract(date, val, period, isUTC) {
  4874. /** @type {?} */
  4875. const dur = createDuration(val, period);
  4876. return addSubtract(date, dur, -1, isUTC);
  4877. }
  4878. /**
  4879. * @param {?} date
  4880. * @param {?} duration
  4881. * @param {?} isAdding
  4882. * @param {?=} isUTC
  4883. * @return {?}
  4884. */
  4885. function addSubtract(date, duration, isAdding, isUTC) {
  4886. /** @type {?} */
  4887. const milliseconds = duration._milliseconds;
  4888. /** @type {?} */
  4889. const days = absRound(duration._days);
  4890. /** @type {?} */
  4891. const months = absRound(duration._months);
  4892. // todo: add timezones support
  4893. // const _updateOffset = updateOffset == null ? true : updateOffset;
  4894. if (months) {
  4895. setMonth(date, getMonth(date, isUTC) + months * isAdding, isUTC);
  4896. }
  4897. if (days) {
  4898. setDate(date, getDate(date, isUTC) + days * isAdding, isUTC);
  4899. }
  4900. if (milliseconds) {
  4901. setTime(date, getTime(date) + milliseconds * isAdding);
  4902. }
  4903. return cloneDate(date);
  4904. // todo: add timezones support
  4905. // if (_updateOffset) {
  4906. // hooks.updateOffset(date, days || months);
  4907. // }
  4908. }
  4909. /**
  4910. * @fileoverview added by tsickle
  4911. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  4912. */
  4913. /**
  4914. * @return {?}
  4915. */
  4916. function initDayOfWeek() {
  4917. // FORMATTING
  4918. addFormatToken('d', null, 'do', (/**
  4919. * @param {?} date
  4920. * @param {?} opts
  4921. * @return {?}
  4922. */
  4923. function (date, opts) {
  4924. return getDay(date, opts.isUTC)
  4925. .toString(10);
  4926. }));
  4927. addFormatToken('dd', null, null, (/**
  4928. * @param {?} date
  4929. * @param {?} opts
  4930. * @return {?}
  4931. */
  4932. function (date, opts) {
  4933. return opts.locale.weekdaysMin(date, opts.format, opts.isUTC);
  4934. }));
  4935. addFormatToken('ddd', null, null, (/**
  4936. * @param {?} date
  4937. * @param {?} opts
  4938. * @return {?}
  4939. */
  4940. function (date, opts) {
  4941. return opts.locale.weekdaysShort(date, opts.format, opts.isUTC);
  4942. }));
  4943. addFormatToken('dddd', null, null, (/**
  4944. * @param {?} date
  4945. * @param {?} opts
  4946. * @return {?}
  4947. */
  4948. function (date, opts) {
  4949. return opts.locale.weekdays(date, opts.format, opts.isUTC);
  4950. }));
  4951. addFormatToken('e', null, null, (/**
  4952. * @param {?} date
  4953. * @param {?} opts
  4954. * @return {?}
  4955. */
  4956. function (date, opts) {
  4957. return getLocaleDayOfWeek(date, opts.locale, opts.isUTC)
  4958. .toString(10);
  4959. // return getDay(date, opts.isUTC).toString(10);
  4960. }));
  4961. addFormatToken('E', null, null, (/**
  4962. * @param {?} date
  4963. * @param {?} opts
  4964. * @return {?}
  4965. */
  4966. function (date, opts) {
  4967. return getISODayOfWeek(date, opts.isUTC)
  4968. .toString(10);
  4969. }));
  4970. // ALIASES
  4971. addUnitAlias('day', 'd');
  4972. addUnitAlias('weekday', 'e');
  4973. addUnitAlias('isoWeekday', 'E');
  4974. // PARSING
  4975. addRegexToken('d', match1to2);
  4976. addRegexToken('e', match1to2);
  4977. addRegexToken('E', match1to2);
  4978. addRegexToken('dd', (/**
  4979. * @param {?} isStrict
  4980. * @param {?} locale
  4981. * @return {?}
  4982. */
  4983. function (isStrict, locale) {
  4984. return locale.weekdaysMinRegex(isStrict);
  4985. }));
  4986. addRegexToken('ddd', (/**
  4987. * @param {?} isStrict
  4988. * @param {?} locale
  4989. * @return {?}
  4990. */
  4991. function (isStrict, locale) {
  4992. return locale.weekdaysShortRegex(isStrict);
  4993. }));
  4994. addRegexToken('dddd', (/**
  4995. * @param {?} isStrict
  4996. * @param {?} locale
  4997. * @return {?}
  4998. */
  4999. function (isStrict, locale) {
  5000. return locale.weekdaysRegex(isStrict);
  5001. }));
  5002. addWeekParseToken(['dd', 'ddd', 'dddd'], (/**
  5003. * @param {?} input
  5004. * @param {?} week
  5005. * @param {?} config
  5006. * @param {?} token
  5007. * @return {?}
  5008. */
  5009. function (input, week, config, token) {
  5010. /** @type {?} */
  5011. const weekday = config._locale.weekdaysParse(input, token, config._strict);
  5012. // if we didn't get a weekday name, mark the date as invalid
  5013. if (weekday != null) {
  5014. week.d = weekday;
  5015. }
  5016. else {
  5017. getParsingFlags(config).invalidWeekday = !!input;
  5018. }
  5019. return config;
  5020. }));
  5021. addWeekParseToken(['d', 'e', 'E'], (/**
  5022. * @param {?} input
  5023. * @param {?} week
  5024. * @param {?} config
  5025. * @param {?} token
  5026. * @return {?}
  5027. */
  5028. function (input, week, config, token) {
  5029. week[token] = toInt(input);
  5030. return config;
  5031. }));
  5032. }
  5033. // HELPERS
  5034. /**
  5035. * @param {?} input
  5036. * @param {?} locale
  5037. * @return {?}
  5038. */
  5039. function parseWeekday(input, locale) {
  5040. if (!isString(input)) {
  5041. return input;
  5042. }
  5043. /** @type {?} */
  5044. const _num = parseInt(input, 10);
  5045. if (!isNaN(_num)) {
  5046. return _num;
  5047. }
  5048. /** @type {?} */
  5049. const _weekDay = locale.weekdaysParse(input);
  5050. if (isNumber(_weekDay)) {
  5051. return _weekDay;
  5052. }
  5053. return null;
  5054. }
  5055. /**
  5056. * @param {?} input
  5057. * @param {?=} locale
  5058. * @return {?}
  5059. */
  5060. function parseIsoWeekday(input, locale = getLocale()) {
  5061. if (isString(input)) {
  5062. return locale.weekdaysParse(input) % 7 || 7;
  5063. }
  5064. return isNumber(input) && isNaN(input) ? null : input;
  5065. }
  5066. /**
  5067. * @param {?} date
  5068. * @param {?} input
  5069. * @param {?=} locale
  5070. * @param {?=} isUTC
  5071. * @return {?}
  5072. */
  5073. function setDayOfWeek(date, input, locale = getLocale(), isUTC) {
  5074. /** @type {?} */
  5075. const day = getDay(date, isUTC);
  5076. /** @type {?} */
  5077. const _input = parseWeekday(input, locale);
  5078. return add(date, _input - day, 'day');
  5079. }
  5080. /**
  5081. * @param {?} date
  5082. * @param {?=} isUTC
  5083. * @return {?}
  5084. */
  5085. function getDayOfWeek(date, isUTC) {
  5086. return getDay(date, isUTC);
  5087. }
  5088. /**
  5089. * ****************************************
  5090. * @param {?} date
  5091. * @param {?=} locale
  5092. * @param {?=} isUTC
  5093. * @return {?}
  5094. */
  5095. // todo: utc
  5096. // getSetLocaleDayOfWeek
  5097. function getLocaleDayOfWeek(date, locale = getLocale(), isUTC) {
  5098. return (getDay(date, isUTC) + 7 - locale.firstDayOfWeek()) % 7;
  5099. }
  5100. /**
  5101. * @param {?} date
  5102. * @param {?} input
  5103. * @param {?=} opts
  5104. * @return {?}
  5105. */
  5106. function setLocaleDayOfWeek(date, input, opts = {}) {
  5107. /** @type {?} */
  5108. const weekday = getLocaleDayOfWeek(date, opts.locale, opts.isUTC);
  5109. return add(date, input - weekday, 'day');
  5110. }
  5111. // getSetISODayOfWeek
  5112. /**
  5113. * @param {?} date
  5114. * @param {?=} isUTC
  5115. * @return {?}
  5116. */
  5117. function getISODayOfWeek(date, isUTC) {
  5118. return getDay(date, isUTC) || 7;
  5119. }
  5120. /**
  5121. * @param {?} date
  5122. * @param {?} input
  5123. * @param {?=} opts
  5124. * @return {?}
  5125. */
  5126. function setISODayOfWeek(date, input, opts = {}) {
  5127. // behaves the same as moment#day except
  5128. // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
  5129. // as a setter, sunday should belong to the previous week.
  5130. // behaves the same as moment#day except
  5131. // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
  5132. // as a setter, sunday should belong to the previous week.
  5133. /** @type {?} */
  5134. const weekday = parseIsoWeekday(input, opts.locale);
  5135. return setDayOfWeek(date, getDayOfWeek(date) % 7 ? weekday : weekday - 7);
  5136. }
  5137. /**
  5138. * @fileoverview added by tsickle
  5139. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  5140. */
  5141. // tslint:disable:comment-format binary-expression-operand-order max-line-length
  5142. //! moment.js locale configuration
  5143. //! locale : Arabic [ar]
  5144. //! author : Abdel Said: https://github.com/abdelsaid
  5145. //! author : Ahmed Elkhatib
  5146. //! author : forabi https://github.com/forabi
  5147. /** @type {?} */
  5148. const symbolMap = {
  5149. 1: '١',
  5150. 2: '٢',
  5151. 3: '٣',
  5152. 4: '٤',
  5153. 5: '٥',
  5154. 6: '٦',
  5155. 7: '٧',
  5156. 8: '٨',
  5157. 9: '٩',
  5158. 0: '٠'
  5159. };
  5160. /** @type {?} */
  5161. const numberMap = {
  5162. '١': '1',
  5163. '٢': '2',
  5164. '٣': '3',
  5165. '٤': '4',
  5166. '٥': '5',
  5167. '٦': '6',
  5168. '٧': '7',
  5169. '٨': '8',
  5170. '٩': '9',
  5171. '٠': '0'
  5172. };
  5173. /** @type {?} */
  5174. const pluralForm = (/**
  5175. * @param {?} num
  5176. * @return {?}
  5177. */
  5178. function (num) {
  5179. return num === 0 ? 0 : num === 1 ? 1 : num === 2 ? 2 : num % 100 >= 3 && num % 100 <= 10 ? 3 : num % 100 >= 11 ? 4 : 5;
  5180. });
  5181. /** @type {?} */
  5182. const plurals = {
  5183. s: ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'],
  5184. m: ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'],
  5185. h: ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'],
  5186. d: ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'],
  5187. M: ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'],
  5188. y: ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام']
  5189. };
  5190. /** @type {?} */
  5191. const pluralize = (/**
  5192. * @param {?} u
  5193. * @return {?}
  5194. */
  5195. function (u) {
  5196. return (/**
  5197. * @param {?} num
  5198. * @param {?} withoutSuffix
  5199. * @return {?}
  5200. */
  5201. function (num, withoutSuffix) {
  5202. /** @type {?} */
  5203. const f = pluralForm(num);
  5204. /** @type {?} */
  5205. let str = plurals[u][pluralForm(num)];
  5206. if (f === 2) {
  5207. str = str[withoutSuffix ? 0 : 1];
  5208. }
  5209. return ((/** @type {?} */ (str))).replace(/%d/i, num.toString());
  5210. });
  5211. });
  5212. /** @type {?} */
  5213. const months = [
  5214. 'يناير',
  5215. 'فبراير',
  5216. 'مارس',
  5217. 'أبريل',
  5218. 'مايو',
  5219. 'يونيو',
  5220. 'يوليو',
  5221. 'أغسطس',
  5222. 'سبتمبر',
  5223. 'أكتوبر',
  5224. 'نوفمبر',
  5225. 'ديسمبر'
  5226. ];
  5227. /** @type {?} */
  5228. const arLocale = {
  5229. abbr: 'ar',
  5230. months,
  5231. monthsShort: months,
  5232. weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'),
  5233. weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'),
  5234. weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'),
  5235. weekdaysParseExact: true,
  5236. longDateFormat: {
  5237. LT: 'HH:mm',
  5238. LTS: 'HH:mm:ss',
  5239. L: 'D/\u200FM/\u200FYYYY',
  5240. LL: 'D MMMM YYYY',
  5241. LLL: 'D MMMM YYYY HH:mm',
  5242. LLLL: 'dddd D MMMM YYYY HH:mm'
  5243. },
  5244. meridiemParse: /ص|م/,
  5245. /**
  5246. * @param {?} input
  5247. * @return {?}
  5248. */
  5249. isPM(input) {
  5250. return 'م' === input;
  5251. },
  5252. /**
  5253. * @param {?} hour
  5254. * @param {?} minute
  5255. * @param {?} isLower
  5256. * @return {?}
  5257. */
  5258. meridiem(hour, minute, isLower) {
  5259. if (hour < 12) {
  5260. return 'ص';
  5261. }
  5262. else {
  5263. return 'م';
  5264. }
  5265. },
  5266. calendar: {
  5267. sameDay: '[اليوم عند الساعة] LT',
  5268. nextDay: '[غدًا عند الساعة] LT',
  5269. nextWeek: 'dddd [عند الساعة] LT',
  5270. lastDay: '[أمس عند الساعة] LT',
  5271. lastWeek: 'dddd [عند الساعة] LT',
  5272. sameElse: 'L'
  5273. },
  5274. relativeTime: {
  5275. future: 'بعد %s',
  5276. past: 'منذ %s',
  5277. s: pluralize('s'),
  5278. ss: pluralize('s'),
  5279. m: pluralize('m'),
  5280. mm: pluralize('m'),
  5281. h: pluralize('h'),
  5282. hh: pluralize('h'),
  5283. d: pluralize('d'),
  5284. dd: pluralize('d'),
  5285. M: pluralize('M'),
  5286. MM: pluralize('M'),
  5287. y: pluralize('y'),
  5288. yy: pluralize('y')
  5289. },
  5290. /**
  5291. * @param {?} str
  5292. * @return {?}
  5293. */
  5294. preparse(str) {
  5295. return str.replace(/[١٢٣٤٥٦٧٨٩٠]/g, (/**
  5296. * @param {?} match
  5297. * @return {?}
  5298. */
  5299. function (match) {
  5300. return numberMap[match];
  5301. })).replace(/،/g, ',');
  5302. },
  5303. /**
  5304. * @param {?} str
  5305. * @return {?}
  5306. */
  5307. postformat(str) {
  5308. return str.replace(/\d/g, (/**
  5309. * @param {?} match
  5310. * @return {?}
  5311. */
  5312. function (match) {
  5313. return symbolMap[match];
  5314. })).replace(/,/g, '،');
  5315. },
  5316. week: {
  5317. dow: 6,
  5318. // Saturday is the first day of the week.
  5319. doy: 12 // The week that contains Jan 1st is the first week of the year.
  5320. }
  5321. };
  5322. /**
  5323. * @fileoverview added by tsickle
  5324. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  5325. */
  5326. // tslint:disable:comment-format binary-expression-operand-order max-line-length
  5327. // tslint:disable:no-bitwise prefer-template cyclomatic-complexity
  5328. // tslint:disable:no-shadowed-variable switch-default prefer-const
  5329. // tslint:disable:one-variable-per-declaration newline-before-return
  5330. //! moment.js locale configuration
  5331. //! locale : Bulgarian [bg]
  5332. //! author : Iskren Ivov Chernev : https://github.com/ichernev
  5333. //! author : Kunal Marwaha : https://github.com/marwahaha
  5334. //! author : Matt Grande : https://github.com/mattgrande
  5335. //! author : Isaac Cambron : https://github.com/icambron
  5336. //! author : Venelin Manchev : https://github.com/vmanchev
  5337. const ɵ0$1 = /**
  5338. * @param {?} d
  5339. * @return {?}
  5340. */
  5341. function (d) {
  5342. switch (d) {
  5343. case 0:
  5344. case 3:
  5345. case 6:
  5346. return '[В изминалата] dddd [в] LT';
  5347. case 1:
  5348. case 2:
  5349. case 4:
  5350. case 5:
  5351. return '[В изминалия] dddd [в] LT';
  5352. }
  5353. };
  5354. /** @type {?} */
  5355. const bgLocale = {
  5356. abbr: 'bg',
  5357. months: 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'),
  5358. monthsShort: 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'),
  5359. weekdays: 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'),
  5360. weekdaysShort: 'нед_пон_вто_сря_чет_пет_съб'.split('_'),
  5361. weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  5362. longDateFormat: {
  5363. LT: 'H:mm',
  5364. LTS: 'H:mm:ss',
  5365. L: 'D.MM.YYYY',
  5366. LL: 'D MMMM YYYY',
  5367. LLL: 'D MMMM YYYY H:mm',
  5368. LLLL: 'dddd, D MMMM YYYY H:mm'
  5369. },
  5370. calendar: {
  5371. sameDay: '[Днес в] LT',
  5372. nextDay: '[Утре в] LT',
  5373. nextWeek: 'dddd [в] LT',
  5374. lastDay: '[Вчера в] LT',
  5375. lastWeek: (ɵ0$1),
  5376. sameElse: 'L'
  5377. },
  5378. relativeTime: {
  5379. future: 'след %s',
  5380. past: 'преди %s',
  5381. s: 'няколко секунди',
  5382. ss: '%d секунди',
  5383. m: 'минута',
  5384. mm: '%d минути',
  5385. h: 'час',
  5386. hh: '%d часа',
  5387. d: 'ден',
  5388. dd: '%d дни',
  5389. M: 'месец',
  5390. MM: '%d месеца',
  5391. y: 'година',
  5392. yy: '%d години'
  5393. },
  5394. dayOfMonthOrdinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/,
  5395. ordinal: (/**
  5396. * @param {?} _num
  5397. * @return {?}
  5398. */
  5399. function (_num) {
  5400. /** @type {?} */
  5401. const number = Number(_num);
  5402. /** @type {?} */
  5403. let lastDigit = number % 10;
  5404. /** @type {?} */
  5405. let last2Digits = number % 100;
  5406. if (number === 0) {
  5407. return number + '-ев';
  5408. }
  5409. else if (last2Digits === 0) {
  5410. return number + '-ен';
  5411. }
  5412. else if (last2Digits > 10 && last2Digits < 20) {
  5413. return number + '-ти';
  5414. }
  5415. else if (lastDigit === 1) {
  5416. return number + '-ви';
  5417. }
  5418. else if (lastDigit === 2) {
  5419. return number + '-ри';
  5420. }
  5421. else if (lastDigit === 7 || lastDigit === 8) {
  5422. return number + '-ми';
  5423. }
  5424. else {
  5425. return number + '-ти';
  5426. }
  5427. }),
  5428. week: {
  5429. dow: 1,
  5430. // Monday is the first day of the week.
  5431. doy: 7 // The week that contains Jan 1st is the first week of the year.
  5432. }
  5433. };
  5434. /**
  5435. * @fileoverview added by tsickle
  5436. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  5437. */
  5438. //! moment.js locale configuration
  5439. //! locale : Catalan [ca]
  5440. //! author : Xavier Arbat : https://github.com/XavisaurusRex
  5441. /** @type {?} */
  5442. let monthsShortDot = 'gen._feb._mar._abr._mai._jun._jul._ago._set._oct._nov._des.'.split('_');
  5443. /** @type {?} */
  5444. let monthsShort = 'ene_feb_mar_abr_mai_jun_jul_ago_set_oct_nov_des'.split('_');
  5445. /** @type {?} */
  5446. let monthsParse = [/^gen/i, /^feb/i, /^mar/i, /^abr/i, /^mai/i, /^jun/i, /^jul/i, /^ago/i, /^set/i, /^oct/i, /^nov/i, /^des/i];
  5447. /** @type {?} */
  5448. let monthsRegex = /^(gener|febrer|març|abril|maig|juny|juliol|agost|setembre|octubre|novembre|desembre|gen\.?|feb\.?|mar\.?|abr\.?|mai\.?|jun\.?|jul\.?|ago\.?|set\.?|oct\.?|nov\.?|des\.?)/i;
  5449. /** @type {?} */
  5450. const caLocale = {
  5451. abbr: 'ca',
  5452. months: 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'),
  5453. /**
  5454. * @param {?} date
  5455. * @param {?} format
  5456. * @param {?=} isUTC
  5457. * @return {?}
  5458. */
  5459. monthsShort(date, format, isUTC) {
  5460. if (!date) {
  5461. return monthsShortDot;
  5462. }
  5463. if (/-MMM-/.test(format)) {
  5464. return monthsShort[getMonth(date, isUTC)];
  5465. }
  5466. return monthsShortDot[getMonth(date, isUTC)];
  5467. },
  5468. monthsRegex,
  5469. monthsShortRegex: monthsRegex,
  5470. monthsStrictRegex: /^(gener|febrer|març|abril|maig|juny|juliol|agost|setembre|octubre|novembre|desembre)/i,
  5471. monthsShortStrictRegex: /^(gen\.?|feb\.?|mar\.?|abr\.?|mai\.?|jun\.?|jul\.?|ago\.?|set\.?|oct\.?|nov\.?|des\.?)/i,
  5472. monthsParse,
  5473. longMonthsParse: monthsParse,
  5474. shortMonthsParse: monthsParse,
  5475. weekdays: 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split('_'),
  5476. weekdaysShort: 'diu._dil._dim._dix._dij._div._dis.'.split('_'),
  5477. weekdaysMin: 'dg_dl_dt_dc_dj_dv_ds'.split('_'),
  5478. weekdaysParseExact: true,
  5479. longDateFormat: {
  5480. LT: 'H:mm',
  5481. LTS: 'H:mm:ss',
  5482. L: 'DD/MM/YYYY',
  5483. LL: 'D [de] MMMM [de] YYYY',
  5484. LLL: 'D [de] MMMM [de] YYYY H:mm',
  5485. LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm'
  5486. },
  5487. calendar: {
  5488. /**
  5489. * @param {?} date
  5490. * @return {?}
  5491. */
  5492. sameDay(date) {
  5493. return '[avui a ' + ('la' + (getHours(date) !== 1) ? 'les' : '') + '] LT';
  5494. },
  5495. /**
  5496. * @param {?} date
  5497. * @return {?}
  5498. */
  5499. nextDay(date) {
  5500. return '[dema a ' + ('la' + (getHours(date) !== 1) ? 'les' : '') + '] LT';
  5501. },
  5502. /**
  5503. * @param {?} date
  5504. * @return {?}
  5505. */
  5506. nextWeek(date) {
  5507. return 'dddd [a ' + ('la' + (getHours(date) !== 1) ? 'les' : '') + '] LT';
  5508. },
  5509. /**
  5510. * @param {?} date
  5511. * @return {?}
  5512. */
  5513. lastDay(date) {
  5514. return '[ahir a ' + ('la' + (getHours(date) !== 1) ? 'les' : '') + '] LT';
  5515. },
  5516. /**
  5517. * @param {?} date
  5518. * @return {?}
  5519. */
  5520. lastWeek(date) {
  5521. return '[el] dddd [' + ('passada la ' + (getHours(date) !== 1) ? 'passades les' : '') + '] LT';
  5522. },
  5523. sameElse: 'L'
  5524. },
  5525. relativeTime: {
  5526. future: 'en %s',
  5527. past: 'fa %s',
  5528. s: 'uns segons',
  5529. ss: '%d segons',
  5530. m: 'un minut',
  5531. mm: '%d minuts',
  5532. h: 'una hora',
  5533. hh: '%d hores',
  5534. d: 'un dia',
  5535. dd: '%d dies',
  5536. M: 'un mes',
  5537. MM: '%d mesos',
  5538. y: 'un any',
  5539. yy: '%d anys'
  5540. },
  5541. dayOfMonthOrdinalParse: /\d{1,2}(er|on|er|rt|é)/,
  5542. /**
  5543. * @param {?} _num
  5544. * @return {?}
  5545. */
  5546. ordinal(_num) {
  5547. /** @type {?} */
  5548. const num = Number(_num);
  5549. /** @type {?} */
  5550. const output = (num > 4) ? 'é' :
  5551. (num === 1 || num === 3) ? 'r' :
  5552. (num === 2) ? 'n' :
  5553. (num === 4) ? 't' : 'é';
  5554. return num + output;
  5555. },
  5556. week: {
  5557. dow: 1,
  5558. // Monday is the first day of the week.
  5559. doy: 4 // The week that contains Jan 4th is the first week of the year.
  5560. }
  5561. };
  5562. /**
  5563. * @fileoverview added by tsickle
  5564. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  5565. */
  5566. //! moment.js locale configuration
  5567. //! locale : Czech [cs]
  5568. //! author : petrbela : https://github.com/petrbela
  5569. /** @type {?} */
  5570. const months$1 = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_');
  5571. /** @type {?} */
  5572. const monthsShort$1 = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_');
  5573. /**
  5574. * @param {?} num
  5575. * @return {?}
  5576. */
  5577. function plural(num) {
  5578. return (num > 1) && (num < 5) && (~~(num / 10) !== 1);
  5579. }
  5580. /**
  5581. * @param {?} num
  5582. * @param {?} withoutSuffix
  5583. * @param {?} key
  5584. * @param {?} isFuture
  5585. * @return {?}
  5586. */
  5587. function translate(num, withoutSuffix, key, isFuture) {
  5588. /** @type {?} */
  5589. const result = num + ' ';
  5590. switch (key) {
  5591. case 's': // a few seconds / in a few seconds / a few seconds ago
  5592. return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami';
  5593. case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago
  5594. if (withoutSuffix || isFuture) {
  5595. return result + (plural(num) ? 'sekundy' : 'sekund');
  5596. }
  5597. else {
  5598. return result + 'sekundami';
  5599. }
  5600. // break;
  5601. case 'm': // a minute / in a minute / a minute ago
  5602. return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou');
  5603. case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
  5604. if (withoutSuffix || isFuture) {
  5605. return result + (plural(num) ? 'minuty' : 'minut');
  5606. }
  5607. else {
  5608. return result + 'minutami';
  5609. }
  5610. // break;
  5611. case 'h': // an hour / in an hour / an hour ago
  5612. return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
  5613. case 'hh': // 9 hours / in 9 hours / 9 hours ago
  5614. if (withoutSuffix || isFuture) {
  5615. return result + (plural(num) ? 'hodiny' : 'hodin');
  5616. }
  5617. else {
  5618. return result + 'hodinami';
  5619. }
  5620. // break;
  5621. case 'd': // a day / in a day / a day ago
  5622. return (withoutSuffix || isFuture) ? 'den' : 'dnem';
  5623. case 'dd': // 9 days / in 9 days / 9 days ago
  5624. if (withoutSuffix || isFuture) {
  5625. return result + (plural(num) ? 'dny' : 'dní');
  5626. }
  5627. else {
  5628. return result + 'dny';
  5629. }
  5630. // break;
  5631. case 'M': // a month / in a month / a month ago
  5632. return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem';
  5633. case 'MM': // 9 months / in 9 months / 9 months ago
  5634. if (withoutSuffix || isFuture) {
  5635. return result + (plural(num) ? 'měsíce' : 'měsíců');
  5636. }
  5637. else {
  5638. return result + 'měsíci';
  5639. }
  5640. // break;
  5641. case 'y': // a year / in a year / a year ago
  5642. return (withoutSuffix || isFuture) ? 'rok' : 'rokem';
  5643. case 'yy': // 9 years / in 9 years / 9 years ago
  5644. if (withoutSuffix || isFuture) {
  5645. return result + (plural(num) ? 'roky' : 'let');
  5646. }
  5647. else {
  5648. return result + 'lety';
  5649. }
  5650. // break;
  5651. }
  5652. }
  5653. const ɵ0$2 = /**
  5654. * @param {?} months
  5655. * @param {?} monthsShort
  5656. * @return {?}
  5657. */
  5658. function (months, monthsShort) {
  5659. /** @type {?} */
  5660. let i;
  5661. /** @type {?} */
  5662. let _monthsParse = [];
  5663. for (i = 0; i < 12; i++) {
  5664. // use custom parser to solve problem with July (červenec)
  5665. _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i');
  5666. }
  5667. return _monthsParse;
  5668. }, ɵ1 = /**
  5669. * @param {?} monthsShort
  5670. * @return {?}
  5671. */
  5672. function (monthsShort) {
  5673. /** @type {?} */
  5674. let i;
  5675. /** @type {?} */
  5676. let _shortMonthsParse = [];
  5677. for (i = 0; i < 12; i++) {
  5678. _shortMonthsParse[i] = new RegExp('^' + monthsShort[i] + '$', 'i');
  5679. }
  5680. return _shortMonthsParse;
  5681. }, ɵ2 = /**
  5682. * @param {?} months
  5683. * @return {?}
  5684. */
  5685. function (months) {
  5686. /** @type {?} */
  5687. let i;
  5688. /** @type {?} */
  5689. let _longMonthsParse = [];
  5690. for (i = 0; i < 12; i++) {
  5691. _longMonthsParse[i] = new RegExp('^' + months[i] + '$', 'i');
  5692. }
  5693. return _longMonthsParse;
  5694. };
  5695. /** @type {?} */
  5696. const csLocale = {
  5697. abbr: 'cs',
  5698. months: months$1,
  5699. monthsShort: monthsShort$1,
  5700. monthsParse: ((ɵ0$2)(months$1, monthsShort$1)),
  5701. shortMonthsParse: ((ɵ1)(monthsShort$1)),
  5702. longMonthsParse: ((ɵ2)(months$1)),
  5703. weekdays: 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'),
  5704. weekdaysShort: 'ne_po_út_st_čt_pá_so'.split('_'),
  5705. weekdaysMin: 'ne_po_út_st_čt_pá_so'.split('_'),
  5706. longDateFormat: {
  5707. LT: 'H:mm',
  5708. LTS: 'H:mm:ss',
  5709. L: 'DD.MM.YYYY',
  5710. LL: 'D. MMMM YYYY',
  5711. LLL: 'D. MMMM YYYY H:mm',
  5712. LLLL: 'dddd D. MMMM YYYY H:mm',
  5713. l: 'D. M. YYYY'
  5714. },
  5715. calendar: {
  5716. sameDay: '[dnes v] LT',
  5717. nextDay: '[zítra v] LT',
  5718. /**
  5719. * @param {?} date
  5720. * @return {?}
  5721. */
  5722. nextWeek(date) {
  5723. switch (getDayOfWeek(date)) {
  5724. case 0:
  5725. return '[v neděli v] LT';
  5726. case 1:
  5727. case 2:
  5728. return '[v] dddd [v] LT';
  5729. case 3:
  5730. return '[ve středu v] LT';
  5731. case 4:
  5732. return '[ve čtvrtek v] LT';
  5733. case 5:
  5734. return '[v pátek v] LT';
  5735. case 6:
  5736. return '[v sobotu v] LT';
  5737. }
  5738. },
  5739. lastDay: '[včera v] LT',
  5740. /**
  5741. * @param {?} date
  5742. * @return {?}
  5743. */
  5744. lastWeek(date) {
  5745. switch (getDayOfWeek(date)) {
  5746. case 0:
  5747. return '[minulou neděli v] LT';
  5748. case 1:
  5749. case 2:
  5750. return '[minulé] dddd [v] LT';
  5751. case 3:
  5752. return '[minulou středu v] LT';
  5753. case 4:
  5754. case 5:
  5755. return '[minulý] dddd [v] LT';
  5756. case 6:
  5757. return '[minulou sobotu v] LT';
  5758. }
  5759. },
  5760. sameElse: 'L'
  5761. },
  5762. relativeTime: {
  5763. future: 'za %s',
  5764. past: 'před %s',
  5765. s: translate,
  5766. ss: translate,
  5767. m: translate,
  5768. mm: translate,
  5769. h: translate,
  5770. hh: translate,
  5771. d: translate,
  5772. dd: translate,
  5773. M: translate,
  5774. MM: translate,
  5775. y: translate,
  5776. yy: translate
  5777. },
  5778. dayOfMonthOrdinalParse: /\d{1,2}\./,
  5779. ordinal: '%d.',
  5780. week: {
  5781. dow: 1,
  5782. // Monday is the first day of the week.
  5783. doy: 4 // The week that contains Jan 4th is the first week of the year.
  5784. }
  5785. };
  5786. /**
  5787. * @fileoverview added by tsickle
  5788. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  5789. */
  5790. // tslint:disable:comment-format
  5791. //! moment.js locale configuration
  5792. //! locale : Danish (Denmark) [da]
  5793. //! author : Per Hansen : https://github.com/perhp
  5794. /** @type {?} */
  5795. const daLocale = {
  5796. abbr: 'da',
  5797. months: 'Januar_Februar_Marts_April_Maj_Juni_Juli_August_September_Oktober_November_December'.split('_'),
  5798. monthsShort: 'Jan_Feb_Mar_Apr_Maj_Jun_Jul_Aug_Sep_Okt_Nov_Dec'.split('_'),
  5799. weekdays: 'Søndag_Mandag_Tirsdag_Onsdag_Torsdag_Fredag_Lørdag'.split('_'),
  5800. weekdaysShort: 'Søn_Man_Tir_Ons_Tor_Fre_Lør'.split('_'),
  5801. weekdaysMin: 'Sø_Ma_Ti_On_To_Fr_Lø'.split('_'),
  5802. longDateFormat: {
  5803. LT: 'HH:mm',
  5804. LTS: 'HH:mm:ss',
  5805. L: 'DD/MM/YYYY',
  5806. LL: 'D. MMMM YYYY',
  5807. LLL: 'D. MMMM YYYY HH:mm',
  5808. LLLL: 'dddd [d.] D. MMMM YYYY [kl.] HH:mm'
  5809. },
  5810. calendar: {
  5811. sameDay: '[i dag kl.] LT',
  5812. nextDay: '[i morgen kl.] LT',
  5813. nextWeek: 'på dddd [kl.] LT',
  5814. lastDay: '[i går kl.] LT',
  5815. lastWeek: '[i] dddd[s kl.] LT',
  5816. sameElse: 'L'
  5817. },
  5818. relativeTime: {
  5819. future: 'om %s',
  5820. past: '%s siden',
  5821. s: 'få sekunder',
  5822. m: 'et minut',
  5823. mm: '%d minutter',
  5824. h: 'en time',
  5825. hh: '%d timer',
  5826. d: 'en dag',
  5827. dd: '%d dage',
  5828. M: 'en måned',
  5829. MM: '%d måneder',
  5830. y: 'et år',
  5831. yy: '%d år'
  5832. },
  5833. dayOfMonthOrdinalParse: /\d{1,2}\./,
  5834. ordinal: '%d.',
  5835. week: {
  5836. dow: 1,
  5837. // Monday is the first day of the week.
  5838. doy: 4 // The week that contains Jan 4th is the first week of the year.
  5839. }
  5840. };
  5841. /**
  5842. * @fileoverview added by tsickle
  5843. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  5844. */
  5845. // tslint:disable:comment-format binary-expression-operand-order max-line-length
  5846. // tslint:disable:no-bitwise prefer-template cyclomatic-complexity
  5847. // tslint:disable:no-shadowed-variable switch-default prefer-const
  5848. // tslint:disable:one-variable-per-declaration newline-before-return
  5849. // tslint:disable:object-literal-key-quotes
  5850. //! moment.js locale configuration
  5851. //! locale : German [de]
  5852. //! author : lluchs : https://github.com/lluchs
  5853. //! author: Menelion Elensúle: https://github.com/Oire
  5854. //! author : Mikolaj Dadela : https://github.com/mik01aj
  5855. /**
  5856. * @param {?} num
  5857. * @param {?} withoutSuffix
  5858. * @param {?} key
  5859. * @param {?} isFuture
  5860. * @return {?}
  5861. */
  5862. function processRelativeTime(num, withoutSuffix, key, isFuture) {
  5863. /** @type {?} */
  5864. const format = {
  5865. 'm': ['eine Minute', 'einer Minute'],
  5866. 'h': ['eine Stunde', 'einer Stunde'],
  5867. 'd': ['ein Tag', 'einem Tag'],
  5868. 'dd': [num + ' Tage', num + ' Tagen'],
  5869. 'M': ['ein Monat', 'einem Monat'],
  5870. 'MM': [num + ' Monate', num + ' Monaten'],
  5871. 'y': ['ein Jahr', 'einem Jahr'],
  5872. 'yy': [num + ' Jahre', num + ' Jahren']
  5873. };
  5874. return withoutSuffix ? format[key][0] : format[key][1];
  5875. }
  5876. /** @type {?} */
  5877. const deLocale = {
  5878. abbr: 'de',
  5879. months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
  5880. monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
  5881. monthsParseExact: true,
  5882. weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
  5883. weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
  5884. weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  5885. weekdaysParseExact: true,
  5886. longDateFormat: {
  5887. LT: 'HH:mm',
  5888. LTS: 'HH:mm:ss',
  5889. L: 'DD.MM.YYYY',
  5890. LL: 'D. MMMM YYYY',
  5891. LLL: 'D. MMMM YYYY HH:mm',
  5892. LLLL: 'dddd, D. MMMM YYYY HH:mm'
  5893. },
  5894. calendar: {
  5895. sameDay: '[heute um] LT [Uhr]',
  5896. sameElse: 'L',
  5897. nextDay: '[morgen um] LT [Uhr]',
  5898. nextWeek: 'dddd [um] LT [Uhr]',
  5899. lastDay: '[gestern um] LT [Uhr]',
  5900. lastWeek: '[letzten] dddd [um] LT [Uhr]'
  5901. },
  5902. relativeTime: {
  5903. future: 'in %s',
  5904. past: 'vor %s',
  5905. s: 'ein paar Sekunden',
  5906. ss: '%d Sekunden',
  5907. m: processRelativeTime,
  5908. mm: '%d Minuten',
  5909. h: processRelativeTime,
  5910. hh: '%d Stunden',
  5911. d: processRelativeTime,
  5912. dd: processRelativeTime,
  5913. M: processRelativeTime,
  5914. MM: processRelativeTime,
  5915. y: processRelativeTime,
  5916. yy: processRelativeTime
  5917. },
  5918. dayOfMonthOrdinalParse: /\d{1,2}\./,
  5919. ordinal: '%d.',
  5920. week: {
  5921. dow: 1,
  5922. // Monday is the first day of the week.
  5923. doy: 4 // The week that contains Jan 4th is the first week of the year.
  5924. }
  5925. };
  5926. /**
  5927. * @fileoverview added by tsickle
  5928. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  5929. */
  5930. // tslint:disable:comment-format binary-expression-operand-order max-line-length
  5931. // tslint:disable:no-bitwise prefer-template cyclomatic-complexity
  5932. // tslint:disable:no-shadowed-variable switch-default prefer-const
  5933. // tslint:disable:one-variable-per-declaration newline-before-return
  5934. //! moment.js locale configuration
  5935. //! locale : English (United Kingdom) [en-gb]
  5936. //! author : Chris Gedrim : https://github.com/chrisgedrim
  5937. /** @type {?} */
  5938. const enGbLocale = {
  5939. abbr: 'en-gb',
  5940. months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
  5941. monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
  5942. weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
  5943. weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
  5944. weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  5945. longDateFormat: {
  5946. LT: 'HH:mm',
  5947. LTS: 'HH:mm:ss',
  5948. L: 'DD/MM/YYYY',
  5949. LL: 'D MMMM YYYY',
  5950. LLL: 'D MMMM YYYY HH:mm',
  5951. LLLL: 'dddd, D MMMM YYYY HH:mm'
  5952. },
  5953. calendar: {
  5954. sameDay: '[Today at] LT',
  5955. nextDay: '[Tomorrow at] LT',
  5956. nextWeek: 'dddd [at] LT',
  5957. lastDay: '[Yesterday at] LT',
  5958. lastWeek: '[Last] dddd [at] LT',
  5959. sameElse: 'L'
  5960. },
  5961. relativeTime: {
  5962. future: 'in %s',
  5963. past: '%s ago',
  5964. s: 'a few seconds',
  5965. ss: '%d seconds',
  5966. m: 'a minute',
  5967. mm: '%d minutes',
  5968. h: 'an hour',
  5969. hh: '%d hours',
  5970. d: 'a day',
  5971. dd: '%d days',
  5972. M: 'a month',
  5973. MM: '%d months',
  5974. y: 'a year',
  5975. yy: '%d years'
  5976. },
  5977. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  5978. /**
  5979. * @param {?} _num
  5980. * @return {?}
  5981. */
  5982. ordinal(_num) {
  5983. /** @type {?} */
  5984. const num = Number(_num);
  5985. /** @type {?} */
  5986. const b = num % 10;
  5987. /** @type {?} */
  5988. const output = (~~(num % 100 / 10) === 1) ? 'th' :
  5989. (b === 1) ? 'st' :
  5990. (b === 2) ? 'nd' :
  5991. (b === 3) ? 'rd' : 'th';
  5992. return num + output;
  5993. },
  5994. week: {
  5995. dow: 1,
  5996. // Monday is the first day of the week.
  5997. doy: 4 // The week that contains Jan 4th is the first week of the year.
  5998. }
  5999. };
  6000. /**
  6001. * @fileoverview added by tsickle
  6002. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  6003. */
  6004. //! moment.js locale configuration
  6005. //! locale : Spanish (Dominican Republic) [es-do]
  6006. /** @type {?} */
  6007. let monthsShortDot$1 = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_');
  6008. /** @type {?} */
  6009. let monthsShort$2 = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
  6010. /** @type {?} */
  6011. let monthsParse$1 = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i];
  6012. /** @type {?} */
  6013. let monthsRegex$1 = /^(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;
  6014. /** @type {?} */
  6015. const esDoLocale = {
  6016. abbr: 'es-do',
  6017. months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
  6018. /**
  6019. * @param {?} date
  6020. * @param {?} format
  6021. * @param {?=} isUTC
  6022. * @return {?}
  6023. */
  6024. monthsShort(date, format, isUTC) {
  6025. if (!date) {
  6026. return monthsShortDot$1;
  6027. }
  6028. else if (/-MMM-/.test(format)) {
  6029. return monthsShort$2[getMonth(date, isUTC)];
  6030. }
  6031. else {
  6032. return monthsShortDot$1[getMonth(date, isUTC)];
  6033. }
  6034. },
  6035. monthsRegex: monthsRegex$1,
  6036. monthsShortRegex: monthsRegex$1,
  6037. monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
  6038. monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
  6039. monthsParse: monthsParse$1,
  6040. longMonthsParse: monthsParse$1,
  6041. shortMonthsParse: monthsParse$1,
  6042. weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  6043. weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  6044. weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  6045. weekdaysParseExact: true,
  6046. longDateFormat: {
  6047. LT: 'h:mm A',
  6048. LTS: 'h:mm:ss A',
  6049. L: 'DD/MM/YYYY',
  6050. LL: 'D [de] MMMM [de] YYYY',
  6051. LLL: 'D [de] MMMM [de] YYYY h:mm A',
  6052. LLLL: 'dddd, D [de] MMMM [de] YYYY h:mm A'
  6053. },
  6054. calendar: {
  6055. /**
  6056. * @param {?} date
  6057. * @return {?}
  6058. */
  6059. sameDay(date) {
  6060. return '[hoy a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
  6061. },
  6062. /**
  6063. * @param {?} date
  6064. * @return {?}
  6065. */
  6066. nextDay(date) {
  6067. return '[mañana a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
  6068. },
  6069. /**
  6070. * @param {?} date
  6071. * @return {?}
  6072. */
  6073. nextWeek(date) {
  6074. return 'dddd [a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
  6075. },
  6076. /**
  6077. * @param {?} date
  6078. * @return {?}
  6079. */
  6080. lastDay(date) {
  6081. return '[ayer a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
  6082. },
  6083. /**
  6084. * @param {?} date
  6085. * @return {?}
  6086. */
  6087. lastWeek(date) {
  6088. return '[el] dddd [pasado a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
  6089. },
  6090. sameElse: 'L'
  6091. },
  6092. relativeTime: {
  6093. future: 'en %s',
  6094. past: 'hace %s',
  6095. s: 'unos segundos',
  6096. ss: '%d segundos',
  6097. m: 'un minuto',
  6098. mm: '%d minutos',
  6099. h: 'una hora',
  6100. hh: '%d horas',
  6101. d: 'un día',
  6102. dd: '%d días',
  6103. M: 'un mes',
  6104. MM: '%d meses',
  6105. y: 'un año',
  6106. yy: '%d años'
  6107. },
  6108. dayOfMonthOrdinalParse: /\d{1,2}º/,
  6109. ordinal: '%dº',
  6110. week: {
  6111. dow: 1,
  6112. // Monday is the first day of the week.
  6113. doy: 4 // The week that contains Jan 4th is the first week of the year.
  6114. }
  6115. };
  6116. /**
  6117. * @fileoverview added by tsickle
  6118. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  6119. */
  6120. //! moment.js locale configuration
  6121. //! locale : Spanish [es]
  6122. //! author : Julio Napurí : https://github.com/julionc
  6123. /** @type {?} */
  6124. let monthsShortDot$2 = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_');
  6125. /** @type {?} */
  6126. let monthsShort$3 = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
  6127. /** @type {?} */
  6128. let monthsParse$2 = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i];
  6129. /** @type {?} */
  6130. let monthsRegex$2 = /^(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;
  6131. /** @type {?} */
  6132. const esLocale = {
  6133. abbr: 'es',
  6134. months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
  6135. /**
  6136. * @param {?} date
  6137. * @param {?} format
  6138. * @param {?=} isUTC
  6139. * @return {?}
  6140. */
  6141. monthsShort(date, format, isUTC) {
  6142. if (!date) {
  6143. return monthsShortDot$2;
  6144. }
  6145. if (/-MMM-/.test(format)) {
  6146. return monthsShort$3[getMonth(date, isUTC)];
  6147. }
  6148. return monthsShortDot$2[getMonth(date, isUTC)];
  6149. },
  6150. monthsRegex: monthsRegex$2,
  6151. monthsShortRegex: monthsRegex$2,
  6152. monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,
  6153. monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,
  6154. monthsParse: monthsParse$2,
  6155. longMonthsParse: monthsParse$2,
  6156. shortMonthsParse: monthsParse$2,
  6157. weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  6158. weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  6159. weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  6160. weekdaysParseExact: true,
  6161. longDateFormat: {
  6162. LT: 'H:mm',
  6163. LTS: 'H:mm:ss',
  6164. L: 'DD/MM/YYYY',
  6165. LL: 'D [de] MMMM [de] YYYY',
  6166. LLL: 'D [de] MMMM [de] YYYY H:mm',
  6167. LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm'
  6168. },
  6169. calendar: {
  6170. /**
  6171. * @param {?} date
  6172. * @return {?}
  6173. */
  6174. sameDay(date) {
  6175. return '[hoy a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
  6176. },
  6177. /**
  6178. * @param {?} date
  6179. * @return {?}
  6180. */
  6181. nextDay(date) {
  6182. return '[mañana a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
  6183. },
  6184. /**
  6185. * @param {?} date
  6186. * @return {?}
  6187. */
  6188. nextWeek(date) {
  6189. return 'dddd [a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
  6190. },
  6191. /**
  6192. * @param {?} date
  6193. * @return {?}
  6194. */
  6195. lastDay(date) {
  6196. return '[ayer a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
  6197. },
  6198. /**
  6199. * @param {?} date
  6200. * @return {?}
  6201. */
  6202. lastWeek(date) {
  6203. return '[el] dddd [pasado a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
  6204. },
  6205. sameElse: 'L'
  6206. },
  6207. relativeTime: {
  6208. future: 'en %s',
  6209. past: 'hace %s',
  6210. s: 'unos segundos',
  6211. ss: '%d segundos',
  6212. m: 'un minuto',
  6213. mm: '%d minutos',
  6214. h: 'una hora',
  6215. hh: '%d horas',
  6216. d: 'un día',
  6217. dd: '%d días',
  6218. M: 'un mes',
  6219. MM: '%d meses',
  6220. y: 'un año',
  6221. yy: '%d años'
  6222. },
  6223. dayOfMonthOrdinalParse: /\d{1,2}º/,
  6224. ordinal: '%dº',
  6225. week: {
  6226. dow: 1,
  6227. // Monday is the first day of the week.
  6228. doy: 4 // The week that contains Jan 4th is the first week of the year.
  6229. }
  6230. };
  6231. /**
  6232. * @fileoverview added by tsickle
  6233. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  6234. */
  6235. //! moment.js locale configuration
  6236. //! locale : Spanish (United States) [es-us]
  6237. //! author : bustta : https://github.com/bustta
  6238. /** @type {?} */
  6239. let monthsShortDot$3 = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_');
  6240. /** @type {?} */
  6241. let monthsShort$4 = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_');
  6242. /** @type {?} */
  6243. const esUsLocale = {
  6244. abbr: 'es-us',
  6245. months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'),
  6246. /**
  6247. * @param {?} date
  6248. * @param {?} format
  6249. * @param {?=} isUTC
  6250. * @return {?}
  6251. */
  6252. monthsShort(date, format, isUTC) {
  6253. if (!date) {
  6254. return monthsShortDot$3;
  6255. }
  6256. else if (/-MMM-/.test(format)) {
  6257. return monthsShort$4[getMonth(date, isUTC)];
  6258. }
  6259. else {
  6260. return monthsShortDot$3[getMonth(date, isUTC)];
  6261. }
  6262. },
  6263. monthsParseExact: true,
  6264. weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
  6265. weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
  6266. weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
  6267. weekdaysParseExact: true,
  6268. longDateFormat: {
  6269. LT: 'h:mm A',
  6270. LTS: 'h:mm:ss A',
  6271. L: 'MM/DD/YYYY',
  6272. LL: 'MMMM [de] D [de] YYYY',
  6273. LLL: 'MMMM [de] D [de] YYYY h:mm A',
  6274. LLLL: 'dddd, MMMM [de] D [de] YYYY h:mm A'
  6275. },
  6276. calendar: {
  6277. /**
  6278. * @param {?} date
  6279. * @return {?}
  6280. */
  6281. sameDay(date) {
  6282. return '[hoy a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
  6283. },
  6284. /**
  6285. * @param {?} date
  6286. * @return {?}
  6287. */
  6288. nextDay(date) {
  6289. return '[mañana a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
  6290. },
  6291. /**
  6292. * @param {?} date
  6293. * @return {?}
  6294. */
  6295. nextWeek(date) {
  6296. return 'dddd [a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
  6297. },
  6298. /**
  6299. * @param {?} date
  6300. * @return {?}
  6301. */
  6302. lastDay(date) {
  6303. return '[ayer a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
  6304. },
  6305. /**
  6306. * @param {?} date
  6307. * @return {?}
  6308. */
  6309. lastWeek(date) {
  6310. return '[el] dddd [pasado a la' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
  6311. },
  6312. sameElse: 'L'
  6313. },
  6314. relativeTime: {
  6315. future: 'en %s',
  6316. past: 'hace %s',
  6317. s: 'unos segundos',
  6318. ss: '%d segundos',
  6319. m: 'un minuto',
  6320. mm: '%d minutos',
  6321. h: 'una hora',
  6322. hh: '%d horas',
  6323. d: 'un día',
  6324. dd: '%d días',
  6325. M: 'un mes',
  6326. MM: '%d meses',
  6327. y: 'un año',
  6328. yy: '%d años'
  6329. },
  6330. dayOfMonthOrdinalParse: /\d{1,2}º/,
  6331. ordinal: '%dº',
  6332. week: {
  6333. dow: 0,
  6334. // Sunday is the first day of the week.
  6335. doy: 6 // The week that contains Jan 1st is the first week of the year.
  6336. }
  6337. };
  6338. /**
  6339. * @fileoverview added by tsickle
  6340. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  6341. */
  6342. // tslint:disable:comment-format binary-expression-operand-order max-line-length
  6343. // tslint:disable:no-bitwise prefer-template cyclomatic-complexity
  6344. // tslint:disable:no-shadowed-variable switch-default prefer-const
  6345. // tslint:disable:one-variable-per-declaration newline-before-return
  6346. //! moment.js locale configuration
  6347. //! locale : Estonian [et]
  6348. //! author : Chris Gedrim : https://github.com/a90machado
  6349. /** @type {?} */
  6350. const processRelativeTime$1 = (/**
  6351. * @param {?} num
  6352. * @param {?} withoutSuffix
  6353. * @param {?} key
  6354. * @param {?} isFuture
  6355. * @return {?}
  6356. */
  6357. function (num, withoutSuffix, key, isFuture) {
  6358. /** @type {?} */
  6359. const format = {
  6360. s: ['mõne sekundi', 'mõni sekund', 'paar sekundit'],
  6361. ss: [num + 'sekundi', num + 'sekundit'],
  6362. m: ['ühe minuti', 'üks minut'],
  6363. mm: [num + ' minuti', num + ' minutit'],
  6364. h: ['ühe tunni', 'tund aega', 'üks tund'],
  6365. hh: [num + ' tunni', num + ' tundi'],
  6366. d: ['ühe päeva', 'üks päev'],
  6367. M: ['kuu aja', 'kuu aega', 'üks kuu'],
  6368. MM: [num + ' kuu', num + ' kuud'],
  6369. y: ['ühe aasta', 'aasta', 'üks aasta'],
  6370. yy: [num + ' aasta', num + ' aastat']
  6371. };
  6372. if (withoutSuffix) {
  6373. return format[key][2] ? format[key][2] : format[key][1];
  6374. }
  6375. return isFuture ? format[key][0] : format[key][1];
  6376. });
  6377. /** @type {?} */
  6378. const etLocale = {
  6379. abbr: 'et',
  6380. months: 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split('_'),
  6381. monthsShort: 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'),
  6382. weekdays: 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split('_'),
  6383. weekdaysShort: 'P_E_T_K_N_R_L'.split('_'),
  6384. weekdaysMin: 'P_E_T_K_N_R_L'.split('_'),
  6385. longDateFormat: {
  6386. LT: 'H:mm',
  6387. LTS: 'H:mm:ss',
  6388. L: 'DD.MM.YYYY',
  6389. LL: 'D. MMMM YYYY',
  6390. LLL: 'D. MMMM YYYY H:mm',
  6391. LLLL: 'dddd, D. MMMM YYYY H:mm'
  6392. },
  6393. calendar: {
  6394. sameDay: '[Täna,] LT',
  6395. nextDay: '[Homme,] LT',
  6396. nextWeek: '[Järgmine] dddd LT',
  6397. lastDay: '[Eile,] LT',
  6398. lastWeek: '[Eelmine] dddd LT',
  6399. sameElse: 'L'
  6400. },
  6401. relativeTime: {
  6402. future: '%s pärast',
  6403. past: '%s tagasi',
  6404. s: processRelativeTime$1,
  6405. ss: processRelativeTime$1,
  6406. m: processRelativeTime$1,
  6407. mm: processRelativeTime$1,
  6408. h: processRelativeTime$1,
  6409. hh: processRelativeTime$1,
  6410. d: processRelativeTime$1,
  6411. dd: '%d päeva',
  6412. M: processRelativeTime$1,
  6413. MM: processRelativeTime$1,
  6414. y: processRelativeTime$1,
  6415. yy: processRelativeTime$1
  6416. },
  6417. dayOfMonthOrdinalParse: /\d{1,2}./,
  6418. ordinal: '%d.',
  6419. week: {
  6420. dow: 1,
  6421. // Monday is the first day of the week.
  6422. doy: 4 // The week that contains Jan 4th is the first week of the year.
  6423. }
  6424. };
  6425. /**
  6426. * @fileoverview added by tsickle
  6427. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  6428. */
  6429. // tslint:disable:comment-format binary-expression-operand-order max-line-length
  6430. // tslint:disable:no-bitwise prefer-template cyclomatic-complexity
  6431. // tslint:disable:no-shadowed-variable switch-default prefer-const
  6432. // tslint:disable:one-variable-per-declaration newline-before-return
  6433. //! moment.js locale configuration
  6434. // https://github.com/moment/moment/blob/develop/locale/fi.js
  6435. /** @type {?} */
  6436. var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' ');
  6437. /** @type {?} */
  6438. var numbersFuture = [
  6439. 'nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden',
  6440. numbersPast[7], numbersPast[8], numbersPast[9]
  6441. ];
  6442. /**
  6443. * @param {?} num
  6444. * @param {?} withoutSuffix
  6445. * @param {?} key
  6446. * @param {?} isFuture
  6447. * @return {?}
  6448. */
  6449. function translate$1(num, withoutSuffix, key, isFuture) {
  6450. /** @type {?} */
  6451. var result = '';
  6452. switch (key) {
  6453. case 's':
  6454. return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';
  6455. case 'ss':
  6456. return isFuture ? 'sekunnin' : 'sekuntia';
  6457. case 'm':
  6458. return isFuture ? 'minuutin' : 'minuutti';
  6459. case 'mm':
  6460. result = isFuture ? 'minuutin' : 'minuuttia';
  6461. break;
  6462. case 'h':
  6463. return isFuture ? 'tunnin' : 'tunti';
  6464. case 'hh':
  6465. result = isFuture ? 'tunnin' : 'tuntia';
  6466. break;
  6467. case 'd':
  6468. return isFuture ? 'päivän' : 'päivä';
  6469. case 'dd':
  6470. result = isFuture ? 'päivän' : 'päivää';
  6471. break;
  6472. case 'M':
  6473. return isFuture ? 'kuukauden' : 'kuukausi';
  6474. case 'MM':
  6475. result = isFuture ? 'kuukauden' : 'kuukautta';
  6476. break;
  6477. case 'y':
  6478. return isFuture ? 'vuoden' : 'vuosi';
  6479. case 'yy':
  6480. result = isFuture ? 'vuoden' : 'vuotta';
  6481. break;
  6482. }
  6483. result = verbalNumber(num, isFuture) + ' ' + result;
  6484. return result;
  6485. }
  6486. /**
  6487. * @param {?} num
  6488. * @param {?} isFuture
  6489. * @return {?}
  6490. */
  6491. function verbalNumber(num, isFuture) {
  6492. return num < 10 ? (isFuture ? numbersFuture[num] : numbersPast[num]) : num;
  6493. }
  6494. /** @type {?} */
  6495. const fiLocale = {
  6496. abbr: 'fi',
  6497. months: 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'),
  6498. monthsShort: 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'),
  6499. weekdays: 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'),
  6500. weekdaysShort: 'su_ma_ti_ke_to_pe_la'.split('_'),
  6501. weekdaysMin: 'su_ma_ti_ke_to_pe_la'.split('_'),
  6502. longDateFormat: {
  6503. LT: 'HH.mm',
  6504. LTS: 'HH.mm.ss',
  6505. L: 'DD.MM.YYYY',
  6506. LL: 'Do MMMM[ta] YYYY',
  6507. LLL: 'Do MMMM[ta] YYYY, [klo] HH.mm',
  6508. LLLL: 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm',
  6509. l: 'D.M.YYYY',
  6510. ll: 'Do MMM YYYY',
  6511. lll: 'Do MMM YYYY, [klo] HH.mm',
  6512. llll: 'ddd, Do MMM YYYY, [klo] HH.mm'
  6513. },
  6514. calendar: {
  6515. sameDay: '[tänään] [klo] LT',
  6516. nextDay: '[huomenna] [klo] LT',
  6517. nextWeek: 'dddd [klo] LT',
  6518. lastDay: '[eilen] [klo] LT',
  6519. lastWeek: '[viime] dddd[na] [klo] LT',
  6520. sameElse: 'L'
  6521. },
  6522. relativeTime: {
  6523. future: '%s päästä',
  6524. past: '%s sitten',
  6525. s: translate$1,
  6526. ss: translate$1,
  6527. m: translate$1,
  6528. mm: translate$1,
  6529. h: translate$1,
  6530. hh: translate$1,
  6531. d: translate$1,
  6532. dd: translate$1,
  6533. M: translate$1,
  6534. MM: translate$1,
  6535. y: translate$1,
  6536. yy: translate$1
  6537. },
  6538. dayOfMonthOrdinalParse: /\d{1,2}\./,
  6539. ordinal: '%d.',
  6540. week: {
  6541. dow: 1,
  6542. // Monday is the first day of the week.
  6543. doy: 4 // The week that contains Jan 4th is the first week of the year.
  6544. }
  6545. };
  6546. /**
  6547. * @fileoverview added by tsickle
  6548. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  6549. */
  6550. // tslint:disable:comment-format binary-expression-operand-order max-line-length
  6551. // tslint:disable:no-bitwise prefer-template cyclomatic-complexity
  6552. // tslint:disable:no-shadowed-variable switch-default prefer-const
  6553. // tslint:disable:one-variable-per-declaration newline-before-return
  6554. //! moment.js locale configuration
  6555. //! locale : French [fr]
  6556. //! author : John Fischer : https://github.com/jfroffice
  6557. /** @type {?} */
  6558. const frLocale = {
  6559. abbr: 'fr',
  6560. months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
  6561. monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
  6562. monthsParseExact: true,
  6563. weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
  6564. weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
  6565. weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
  6566. weekdaysParseExact: true,
  6567. longDateFormat: {
  6568. LT: 'HH:mm',
  6569. LTS: 'HH:mm:ss',
  6570. L: 'DD/MM/YYYY',
  6571. LL: 'D MMMM YYYY',
  6572. LLL: 'D MMMM YYYY HH:mm',
  6573. LLLL: 'dddd D MMMM YYYY HH:mm'
  6574. },
  6575. calendar: {
  6576. sameDay: '[Aujourd’hui à] LT',
  6577. nextDay: '[Demain à] LT',
  6578. nextWeek: 'dddd [à] LT',
  6579. lastDay: '[Hier à] LT',
  6580. lastWeek: 'dddd [dernier à] LT',
  6581. sameElse: 'L'
  6582. },
  6583. relativeTime: {
  6584. future: 'dans %s',
  6585. past: 'il y a %s',
  6586. s: 'quelques secondes',
  6587. ss: '%d secondes',
  6588. m: 'une minute',
  6589. mm: '%d minutes',
  6590. h: 'une heure',
  6591. hh: '%d heures',
  6592. d: 'un jour',
  6593. dd: '%d jours',
  6594. M: 'un mois',
  6595. MM: '%d mois',
  6596. y: 'un an',
  6597. yy: '%d ans'
  6598. },
  6599. dayOfMonthOrdinalParse: /\d{1,2}(er|)/,
  6600. /**
  6601. * @param {?} _num
  6602. * @param {?} period
  6603. * @return {?}
  6604. */
  6605. ordinal(_num, period) {
  6606. /** @type {?} */
  6607. const num = Number(_num);
  6608. switch (period) {
  6609. // TODO: Return 'e' when day of month > 1. Move this case inside
  6610. // block for masculine words below.
  6611. // See https://github.com/moment/moment/issues/3375
  6612. case 'D':
  6613. return num + (num === 1 ? 'er' : '');
  6614. // Words with masculine grammatical gender: mois, trimestre, jour
  6615. default:
  6616. case 'M':
  6617. case 'Q':
  6618. case 'DDD':
  6619. case 'd':
  6620. return num + (num === 1 ? 'er' : 'e');
  6621. // Words with feminine grammatical gender: semaine
  6622. case 'w':
  6623. case 'W':
  6624. return num + (num === 1 ? 're' : 'e');
  6625. }
  6626. },
  6627. week: {
  6628. dow: 1,
  6629. // Monday is the first day of the week.
  6630. doy: 4 // The week that contains Jan 4th is the first week of the year.
  6631. }
  6632. };
  6633. /**
  6634. * @fileoverview added by tsickle
  6635. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  6636. */
  6637. //! moment.js locale configuration
  6638. //! locale : Galician [gl]
  6639. //! author : Darío Beiró : https://github.com/quinobravo
  6640. /** @type {?} */
  6641. let monthsShortDot$4 = 'xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.'.split('_');
  6642. /** @type {?} */
  6643. let monthsShort$5 = 'xan_feb_mar_abr_mai_xuñ_xul_ago_set_out_nov_dec'.split('_');
  6644. /** @type {?} */
  6645. let monthsParse$3 = [/^xan/i, /^feb/i, /^mar/i, /^abr/i, /^mai/i, /^xuñ/i, /^xul/i, /^ago/i, /^set/i, /^out/i, /^nov/i, /^dec/i];
  6646. /** @type {?} */
  6647. let monthsRegex$3 = /^(xaneiro|febreiro|marzo|abril|maio|xuño|xullo|agosto|setembro|outubro|novembro|decembro|xan\.?|feb\.?|mar\.?|abr\.?|mai\.?|xuñ\.?|xul\.?|ago\.?|set\.?|out\.?|nov\.?|dec\.?)/i;
  6648. /** @type {?} */
  6649. const glLocale = {
  6650. abbr: 'gl',
  6651. months: 'xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro'.split('_'),
  6652. /**
  6653. * @param {?} date
  6654. * @param {?} format
  6655. * @param {?=} isUTC
  6656. * @return {?}
  6657. */
  6658. monthsShort(date, format, isUTC) {
  6659. if (!date) {
  6660. return monthsShortDot$4;
  6661. }
  6662. if (/-MMM-/.test(format)) {
  6663. return monthsShort$5[getMonth(date, isUTC)];
  6664. }
  6665. return monthsShortDot$4[getMonth(date, isUTC)];
  6666. },
  6667. monthsRegex: monthsRegex$3,
  6668. monthsShortRegex: monthsRegex$3,
  6669. monthsStrictRegex: /^(xaneiro|febreiro|marzo|abril|maio|xuño|xullo|agosto|setembro|outubro|novembro|decembro)/i,
  6670. monthsShortStrictRegex: /^(xan\.?|feb\.?|mar\.?|abr\.?|mai\.?|xuñ\.?|xul\.?|ago\.?|set\.?|out\.?|nov\.?|dec\.?)/i,
  6671. monthsParse: monthsParse$3,
  6672. longMonthsParse: monthsParse$3,
  6673. shortMonthsParse: monthsParse$3,
  6674. weekdays: 'domingo_luns_martes_mércores_xoves_venres_sábado'.split('_'),
  6675. weekdaysShort: 'dom._lun._mar._mér._xov._ven._sáb.'.split('_'),
  6676. weekdaysMin: 'do_lu_ma_mé_xo_ve_sá'.split('_'),
  6677. weekdaysParseExact: true,
  6678. longDateFormat: {
  6679. LT: 'H:mm',
  6680. LTS: 'H:mm:ss',
  6681. L: 'DD/MM/YYYY',
  6682. LL: 'D [de] MMMM [de] YYYY',
  6683. LLL: 'D [de] MMMM [de] YYYY H:mm',
  6684. LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm'
  6685. },
  6686. calendar: {
  6687. /**
  6688. * @param {?} date
  6689. * @return {?}
  6690. */
  6691. sameDay(date) {
  6692. return '[hoxe á' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
  6693. },
  6694. /**
  6695. * @param {?} date
  6696. * @return {?}
  6697. */
  6698. nextDay(date) {
  6699. return '[mañan á' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
  6700. },
  6701. /**
  6702. * @param {?} date
  6703. * @return {?}
  6704. */
  6705. nextWeek(date) {
  6706. return 'dddd [á' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
  6707. },
  6708. /**
  6709. * @param {?} date
  6710. * @return {?}
  6711. */
  6712. lastDay(date) {
  6713. return '[onte á' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
  6714. },
  6715. /**
  6716. * @param {?} date
  6717. * @return {?}
  6718. */
  6719. lastWeek(date) {
  6720. return '[o] dddd [pasado á' + ((getHours(date) !== 1) ? 's' : '') + '] LT';
  6721. },
  6722. sameElse: 'L'
  6723. },
  6724. relativeTime: {
  6725. future: 'en %s',
  6726. past: 'fai %s',
  6727. s: 'uns segundos',
  6728. ss: '%d segundos',
  6729. m: 'un minuto',
  6730. mm: '%d minutos',
  6731. h: 'unha hora',
  6732. hh: '%d horas',
  6733. d: 'un día',
  6734. dd: '%d días',
  6735. M: 'un mes',
  6736. MM: '%d meses',
  6737. y: 'un ano',
  6738. yy: '%d anos'
  6739. },
  6740. dayOfMonthOrdinalParse: /\d{1,2}º/,
  6741. ordinal: '%dº',
  6742. week: {
  6743. dow: 1,
  6744. // Monday is the first day of the week.
  6745. doy: 4 // The week that contains Jan 4th is the first week of the year.
  6746. }
  6747. };
  6748. /**
  6749. * @fileoverview added by tsickle
  6750. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  6751. */
  6752. // tslint:disable:comment-format binary-expression-operand-order max-line-length
  6753. // tslint:disable:no-bitwise prefer-template cyclomatic-complexity
  6754. // tslint:disable:no-shadowed-variable switch-default prefer-const
  6755. // tslint:disable:one-variable-per-declaration newline-before-return
  6756. //! moment.js locale configuration
  6757. //! locale : Hebrew [he]
  6758. //! author : Tomer Cohen : https://github.com/tomer
  6759. //! author : Moshe Simantov : https://github.com/DevelopmentIL
  6760. //! author : Tal Ater : https://github.com/TalAter
  6761. /** @type {?} */
  6762. const heLocale = {
  6763. abbr: 'he',
  6764. months: 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'),
  6765. monthsShort: 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'),
  6766. weekdays: 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'),
  6767. weekdaysShort: 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'),
  6768. weekdaysMin: 'א_ב_ג_ד_ה_ו_ש'.split('_'),
  6769. longDateFormat: {
  6770. LT: 'HH:mm',
  6771. LTS: 'HH:mm:ss',
  6772. L: 'DD/MM/YYYY',
  6773. LL: 'D [ב]MMMM YYYY',
  6774. LLL: 'D [ב]MMMM YYYY HH:mm',
  6775. LLLL: 'dddd, D [ב]MMMM YYYY HH:mm',
  6776. l: 'D/M/YYYY',
  6777. ll: 'D MMM YYYY',
  6778. lll: 'D MMM YYYY HH:mm',
  6779. llll: 'ddd, D MMM YYYY HH:mm'
  6780. },
  6781. calendar: {
  6782. sameDay: '[היום ב־]LT',
  6783. nextDay: '[מחר ב־]LT',
  6784. nextWeek: 'dddd [בשעה] LT',
  6785. lastDay: '[אתמול ב־]LT',
  6786. lastWeek: '[ביום] dddd [האחרון בשעה] LT',
  6787. sameElse: 'L'
  6788. },
  6789. relativeTime: {
  6790. future: 'בעוד %s',
  6791. past: 'לפני %s',
  6792. s: 'מספר שניות',
  6793. ss: '%d שניות',
  6794. m: 'דקה',
  6795. mm: '%d דקות',
  6796. h: 'שעה',
  6797. /**
  6798. * @param {?} num
  6799. * @return {?}
  6800. */
  6801. hh(num) {
  6802. if (num === 2) {
  6803. return 'שעתיים';
  6804. }
  6805. return num + ' שעות';
  6806. },
  6807. d: 'יום',
  6808. /**
  6809. * @param {?} num
  6810. * @return {?}
  6811. */
  6812. dd(num) {
  6813. if (num === 2) {
  6814. return 'יומיים';
  6815. }
  6816. return num + ' ימים';
  6817. },
  6818. M: 'חודש',
  6819. /**
  6820. * @param {?} num
  6821. * @return {?}
  6822. */
  6823. MM(num) {
  6824. if (num === 2) {
  6825. return 'חודשיים';
  6826. }
  6827. return num + ' חודשים';
  6828. },
  6829. y: 'שנה',
  6830. /**
  6831. * @param {?} num
  6832. * @return {?}
  6833. */
  6834. yy(num) {
  6835. if (num === 2) {
  6836. return 'שנתיים';
  6837. }
  6838. else if (num % 10 === 0 && num !== 10) {
  6839. return num + ' שנה';
  6840. }
  6841. return num + ' שנים';
  6842. }
  6843. },
  6844. meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i,
  6845. /**
  6846. * @param {?} input
  6847. * @return {?}
  6848. */
  6849. isPM(input) {
  6850. return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input);
  6851. },
  6852. /**
  6853. * @param {?} hour
  6854. * @param {?} minute
  6855. * @param {?} isLower
  6856. * @return {?}
  6857. */
  6858. meridiem(hour, minute, isLower) {
  6859. if (hour < 5) {
  6860. return 'לפנות בוקר';
  6861. }
  6862. else if (hour < 10) {
  6863. return 'בבוקר';
  6864. }
  6865. else if (hour < 12) {
  6866. return isLower ? 'לפנה"צ' : 'לפני הצהריים';
  6867. }
  6868. else if (hour < 18) {
  6869. return isLower ? 'אחה"צ' : 'אחרי הצהריים';
  6870. }
  6871. else {
  6872. return 'בערב';
  6873. }
  6874. }
  6875. };
  6876. /**
  6877. * @fileoverview added by tsickle
  6878. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  6879. */
  6880. // tslint:disable:comment-format binary-expression-operand-order max-line-length
  6881. // tslint:disable:no-bitwise prefer-template cyclomatic-complexity
  6882. // tslint:disable:no-shadowed-variable switch-default prefer-const
  6883. // tslint:disable:one-variable-per-declaration newline-before-return
  6884. // tslint:disable:no-parameter-reassignment prefer-switch
  6885. //! moment.js locale configuration
  6886. //! locale : Hindi [hi]
  6887. //! author : Mayank Singhal : https://github.com/mayanksinghal
  6888. /** @type {?} */
  6889. let symbolMap$1 = {
  6890. 1: '१',
  6891. 2: '२',
  6892. 3: '३',
  6893. 4: '४',
  6894. 5: '५',
  6895. 6: '६',
  6896. 7: '७',
  6897. 8: '८',
  6898. 9: '९',
  6899. 0: '०'
  6900. };
  6901. /** @type {?} */
  6902. let numberMap$1 = {
  6903. '१': '1',
  6904. '२': '2',
  6905. '३': '3',
  6906. '४': '4',
  6907. '५': '5',
  6908. '६': '6',
  6909. '७': '7',
  6910. '८': '8',
  6911. '९': '9',
  6912. '०': '0'
  6913. };
  6914. /** @type {?} */
  6915. const hiLocale = {
  6916. abbr: 'hi',
  6917. months: 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'),
  6918. monthsShort: 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'),
  6919. monthsParseExact: true,
  6920. weekdays: 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'),
  6921. weekdaysShort: 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'),
  6922. weekdaysMin: 'र_सो_मं_बु_गु_शु_श'.split('_'),
  6923. longDateFormat: {
  6924. LT: 'A h:mm बजे',
  6925. LTS: 'A h:mm:ss बजे',
  6926. L: 'DD/MM/YYYY',
  6927. LL: 'D MMMM YYYY',
  6928. LLL: 'D MMMM YYYY, A h:mm बजे',
  6929. LLLL: 'dddd, D MMMM YYYY, A h:mm बजे'
  6930. },
  6931. calendar: {
  6932. sameDay: '[आज] LT',
  6933. nextDay: '[कल] LT',
  6934. nextWeek: 'dddd, LT',
  6935. lastDay: '[कल] LT',
  6936. lastWeek: '[पिछले] dddd, LT',
  6937. sameElse: 'L'
  6938. },
  6939. relativeTime: {
  6940. future: '%s में',
  6941. past: '%s पहले',
  6942. s: 'कुछ ही क्षण',
  6943. ss: '%d सेकंड',
  6944. m: 'एक मिनट',
  6945. mm: '%d मिनट',
  6946. h: 'एक घंटा',
  6947. hh: '%d घंटे',
  6948. d: 'एक दिन',
  6949. dd: '%d दिन',
  6950. M: 'एक महीने',
  6951. MM: '%d महीने',
  6952. y: 'एक वर्ष',
  6953. yy: '%d वर्ष'
  6954. },
  6955. /**
  6956. * @param {?} str
  6957. * @return {?}
  6958. */
  6959. preparse(str) {
  6960. return str.replace(/[१२३४५६७८९०]/g, (/**
  6961. * @param {?} match
  6962. * @return {?}
  6963. */
  6964. function (match) {
  6965. return numberMap$1[match];
  6966. }));
  6967. },
  6968. /**
  6969. * @param {?} str
  6970. * @return {?}
  6971. */
  6972. postformat(str) {
  6973. return str.replace(/\d/g, (/**
  6974. * @param {?} match
  6975. * @return {?}
  6976. */
  6977. function (match) {
  6978. return symbolMap$1[match];
  6979. }));
  6980. },
  6981. // Hindi notation for meridiems are quite fuzzy in practice. While there exists
  6982. // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi.
  6983. meridiemParse: /रात|सुबह|दोपहर|शाम/,
  6984. /**
  6985. * @param {?} hour
  6986. * @param {?} meridiem
  6987. * @return {?}
  6988. */
  6989. meridiemHour(hour, meridiem) {
  6990. if (hour === 12) {
  6991. hour = 0;
  6992. }
  6993. if (meridiem === 'रात') {
  6994. return hour < 4 ? hour : hour + 12;
  6995. }
  6996. else if (meridiem === 'सुबह') {
  6997. return hour;
  6998. }
  6999. else if (meridiem === 'दोपहर') {
  7000. return hour >= 10 ? hour : hour + 12;
  7001. }
  7002. else if (meridiem === 'शाम') {
  7003. return hour + 12;
  7004. }
  7005. },
  7006. /**
  7007. * @param {?} hour
  7008. * @param {?} minute
  7009. * @param {?} isLower
  7010. * @return {?}
  7011. */
  7012. meridiem(hour, minute, isLower) {
  7013. if (hour < 4) {
  7014. return 'रात';
  7015. }
  7016. else if (hour < 10) {
  7017. return 'सुबह';
  7018. }
  7019. else if (hour < 17) {
  7020. return 'दोपहर';
  7021. }
  7022. else if (hour < 20) {
  7023. return 'शाम';
  7024. }
  7025. else {
  7026. return 'रात';
  7027. }
  7028. },
  7029. week: {
  7030. dow: 0,
  7031. // Sunday is the first day of the week.
  7032. doy: 6 // The week that contains Jan 1st is the first week of the year.
  7033. }
  7034. };
  7035. /**
  7036. * @fileoverview added by tsickle
  7037. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  7038. */
  7039. //! moment.js locale configuration
  7040. //! locale : Hungarian [hu]
  7041. //! author : Adam Brunner : https://github.com/adambrunner
  7042. /** @type {?} */
  7043. let weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' ');
  7044. /**
  7045. * @param {?} num
  7046. * @param {?} withoutSuffix
  7047. * @param {?} key
  7048. * @param {?} isFuture
  7049. * @return {?}
  7050. */
  7051. function translate$2(num, withoutSuffix, key, isFuture) {
  7052. switch (key) {
  7053. case 's':
  7054. return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce';
  7055. case 'ss':
  7056. return num + ((isFuture || withoutSuffix) ? ' másodperc' : ' másodperce');
  7057. case 'm':
  7058. return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce');
  7059. case 'mm':
  7060. return num + (isFuture || withoutSuffix ? ' perc' : ' perce');
  7061. case 'h':
  7062. return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája');
  7063. case 'hh':
  7064. return num + (isFuture || withoutSuffix ? ' óra' : ' órája');
  7065. case 'd':
  7066. return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja');
  7067. case 'dd':
  7068. return num + (isFuture || withoutSuffix ? ' nap' : ' napja');
  7069. case 'M':
  7070. return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
  7071. case 'MM':
  7072. return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja');
  7073. case 'y':
  7074. return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve');
  7075. case 'yy':
  7076. return num + (isFuture || withoutSuffix ? ' év' : ' éve');
  7077. }
  7078. return '';
  7079. }
  7080. /**
  7081. * @param {?} date
  7082. * @param {?} isFuture
  7083. * @return {?}
  7084. */
  7085. function week(date, isFuture) {
  7086. return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[getDayOfWeek(date)] + '] LT[-kor]';
  7087. }
  7088. /** @type {?} */
  7089. const huLocale = {
  7090. abbr: 'hu',
  7091. months: 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'),
  7092. monthsShort: 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'),
  7093. weekdays: 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'),
  7094. weekdaysShort: 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'),
  7095. weekdaysMin: 'v_h_k_sze_cs_p_szo'.split('_'),
  7096. longDateFormat: {
  7097. LT: 'H:mm',
  7098. LTS: 'H:mm:ss',
  7099. L: 'YYYY.MM.DD.',
  7100. LL: 'YYYY. MMMM D.',
  7101. LLL: 'YYYY. MMMM D. H:mm',
  7102. LLLL: 'YYYY. MMMM D., dddd H:mm'
  7103. },
  7104. meridiemParse: /de|du/i,
  7105. /**
  7106. * @param {?} input
  7107. * @return {?}
  7108. */
  7109. isPM(input) {
  7110. return input.charAt(1).toLowerCase() === 'u';
  7111. },
  7112. /**
  7113. * @param {?} hours
  7114. * @param {?} minutes
  7115. * @param {?} isLower
  7116. * @return {?}
  7117. */
  7118. meridiem(hours, minutes, isLower) {
  7119. if (hours < 12) {
  7120. return isLower === true ? 'de' : 'DE';
  7121. }
  7122. else {
  7123. return isLower === true ? 'du' : 'DU';
  7124. }
  7125. },
  7126. calendar: {
  7127. sameDay: '[ma] LT[-kor]',
  7128. nextDay: '[holnap] LT[-kor]',
  7129. /**
  7130. * @param {?} date
  7131. * @return {?}
  7132. */
  7133. nextWeek(date) {
  7134. return week(date, true);
  7135. },
  7136. lastDay: '[tegnap] LT[-kor]',
  7137. /**
  7138. * @param {?} date
  7139. * @return {?}
  7140. */
  7141. lastWeek(date) {
  7142. return week(date, false);
  7143. },
  7144. sameElse: 'L'
  7145. },
  7146. relativeTime: {
  7147. future: '%s múlva',
  7148. past: '%s',
  7149. s: translate$2,
  7150. ss: translate$2,
  7151. m: translate$2,
  7152. mm: translate$2,
  7153. h: translate$2,
  7154. hh: translate$2,
  7155. d: translate$2,
  7156. dd: translate$2,
  7157. M: translate$2,
  7158. MM: translate$2,
  7159. y: translate$2,
  7160. yy: translate$2
  7161. },
  7162. dayOfMonthOrdinalParse: /\d{1,2}\./,
  7163. ordinal: '%d.',
  7164. week: {
  7165. dow: 1,
  7166. // Monday is the first day of the week.
  7167. doy: 4 // The week that contains Jan 4th is the first week of the year.
  7168. }
  7169. };
  7170. /**
  7171. * @fileoverview added by tsickle
  7172. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  7173. */
  7174. // tslint:disable:comment-format binary-expression-operand-order max-line-length
  7175. // tslint:disable:no-bitwise prefer-template cyclomatic-complexity
  7176. // tslint:disable:no-shadowed-variable switch-default prefer-const
  7177. // tslint:disable:one-variable-per-declaration newline-before-return
  7178. //! moment.js locale configuration
  7179. //! locale : Croatian [hr]
  7180. //! author : Danijel Grmec : https://github.com/cobaltsis
  7181. /** @type {?} */
  7182. const hrLocale = {
  7183. abbr: 'hr',
  7184. months: 'Siječanj_Veljača_Ožujak_Travanj_Svibanj_Lipanj_Srpanj_Kolovoz_Rujan_Listopad_Studeni_Prosinac'.split('_'),
  7185. monthsShort: 'Sij_Velj_Ožu_Tra_Svi_Lip_Srp_Kol_Ruj_Lis_Stu_Pro'.split('_'),
  7186. weekdays: 'Nedjelja_Ponedjeljak_Utorak_Srijeda_Četvrtak_Petak_Subota'.split('_'),
  7187. weekdaysShort: 'Ned_Pon_Uto_Sri_Čet_Pet_Sub'.split('_'),
  7188. weekdaysMin: 'Ne_Po_Ut_Sr_Če_Pe_Su'.split('_'),
  7189. longDateFormat: {
  7190. LT: 'HH:mm',
  7191. LTS: 'HH:mm:ss',
  7192. L: 'DD/MM/YYYY',
  7193. LL: 'D MMMM YYYY',
  7194. LLL: 'D MMMM YYYY HH:mm',
  7195. LLLL: 'dddd, D MMMM YYYY HH:mm'
  7196. },
  7197. calendar: {
  7198. sameDay: '[Danas u] LT',
  7199. nextDay: '[Sutra u] LT',
  7200. nextWeek: 'dddd [u] LT',
  7201. lastDay: '[Jučer u] LT',
  7202. lastWeek: '[Zadnji] dddd [u] LT',
  7203. sameElse: 'L'
  7204. },
  7205. invalidDate: 'Neispravan datum',
  7206. relativeTime: {
  7207. future: 'za %s',
  7208. past: '%s prije',
  7209. s: 'nekoliko sekundi',
  7210. ss: '%d sekundi',
  7211. m: 'minuta',
  7212. mm: '%d minuta',
  7213. h: 'sat',
  7214. hh: '%d sati',
  7215. d: 'dan',
  7216. dd: '%d dana',
  7217. M: 'mjesec',
  7218. MM: '%d mjeseci',
  7219. y: 'godina',
  7220. yy: '%d godina'
  7221. },
  7222. dayOfMonthOrdinalParse: /\d{1,2}(st|nd|rd|th)/,
  7223. /**
  7224. * @param {?} _num
  7225. * @return {?}
  7226. */
  7227. ordinal(_num) {
  7228. /** @type {?} */
  7229. const num = Number(_num);
  7230. /** @type {?} */
  7231. const b = num % 10;
  7232. /** @type {?} */
  7233. const output = (~~(num % 100 / 10) === 1) ? '.' :
  7234. (b === 1) ? '.' :
  7235. (b === 2) ? '.' :
  7236. (b === 3) ? '.' : '.';
  7237. return num + output;
  7238. },
  7239. week: {
  7240. dow: 1,
  7241. // Monday is the first day of the week.
  7242. doy: 4 // The week that contains Jan 4th is the first week of the year.
  7243. }
  7244. };
  7245. /**
  7246. * @fileoverview added by tsickle
  7247. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  7248. */
  7249. // tslint:disable:comment-format binary-expression-operand-order max-line-length
  7250. // tslint:disable:no-bitwise prefer-template cyclomatic-complexity
  7251. // tslint:disable:no-shadowed-variable switch-default prefer-const
  7252. // tslint:disable:one-variable-per-declaration newline-before-return
  7253. // tslint:disable:no-parameter-reassignment prefer-switch
  7254. //! moment.js locale configuration
  7255. //! locale : Indonesia [id]
  7256. //! author : Romy Kusuma : https://github.com/rkusuma
  7257. //! reference: https://github.com/moment/moment/blob/develop/locale/id.js
  7258. /** @type {?} */
  7259. const idLocale = {
  7260. abbr: 'id',
  7261. months: 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'),
  7262. monthsShort: 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des'.split('_'),
  7263. weekdays: 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'),
  7264. weekdaysShort: 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'),
  7265. weekdaysMin: 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'),
  7266. longDateFormat: {
  7267. LT: 'HH.mm',
  7268. LTS: 'HH.mm.ss',
  7269. L: 'DD/MM/YYYY',
  7270. LL: 'D MMMM YYYY',
  7271. LLL: 'D MMMM YYYY [pukul] HH.mm',
  7272. LLLL: 'dddd, D MMMM YYYY [pukul] HH.mm'
  7273. },
  7274. meridiemParse: /pagi|siang|sore|malam/,
  7275. /**
  7276. * @param {?} hour
  7277. * @param {?} meridiem
  7278. * @return {?}
  7279. */
  7280. meridiemHour(hour, meridiem) {
  7281. if (hour === 12) {
  7282. hour = 0;
  7283. }
  7284. if (meridiem === 'pagi') {
  7285. return hour;
  7286. }
  7287. else if (meridiem === 'siang') {
  7288. return hour >= 11 ? hour : hour + 12;
  7289. }
  7290. else if (meridiem === 'sore' || meridiem === 'malam') {
  7291. return hour + 12;
  7292. }
  7293. },
  7294. /**
  7295. * @param {?} hours
  7296. * @param {?} minutes
  7297. * @param {?} isLower
  7298. * @return {?}
  7299. */
  7300. meridiem(hours, minutes, isLower) {
  7301. if (hours < 11) {
  7302. return 'pagi';
  7303. }
  7304. else if (hours < 15) {
  7305. return 'siang';
  7306. }
  7307. else if (hours < 19) {
  7308. return 'sore';
  7309. }
  7310. else {
  7311. return 'malam';
  7312. }
  7313. },
  7314. calendar: {
  7315. sameDay: '[Hari ini pukul] LT',
  7316. nextDay: '[Besok pukul] LT',
  7317. nextWeek: 'dddd [pukul] LT',
  7318. lastDay: '[Kemarin pukul] LT',
  7319. lastWeek: 'dddd [lalu pukul] LT',
  7320. sameElse: 'L'
  7321. },
  7322. relativeTime: {
  7323. future: 'dalam %s',
  7324. past: '%s yang lalu',
  7325. s: 'beberapa detik',
  7326. ss: '%d detik',
  7327. m: 'semenit',
  7328. mm: '%d menit',
  7329. h: 'sejam',
  7330. hh: '%d jam',
  7331. d: 'sehari',
  7332. dd: '%d hari',
  7333. M: 'sebulan',
  7334. MM: '%d bulan',
  7335. y: 'setahun',
  7336. yy: '%d tahun'
  7337. },
  7338. week: {
  7339. dow: 1,
  7340. // Monday is the first day of the week.
  7341. doy: 7 // The week that contains Jan 1st is the first week of the year.
  7342. }
  7343. };
  7344. /**
  7345. * @fileoverview added by tsickle
  7346. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  7347. */
  7348. //! moment.js locale configuration
  7349. //! locale : Italian [it]
  7350. //! author : Lorenzo : https://github.com/aliem
  7351. //! author: Mattia Larentis: https://github.com/nostalgiaz
  7352. /** @type {?} */
  7353. const itLocale = {
  7354. abbr: 'it',
  7355. months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),
  7356. monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
  7357. weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split('_'),
  7358. weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
  7359. weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),
  7360. longDateFormat: {
  7361. LT: 'HH:mm',
  7362. LTS: 'HH:mm:ss',
  7363. L: 'DD/MM/YYYY',
  7364. LL: 'D MMMM YYYY',
  7365. LLL: 'D MMMM YYYY HH:mm',
  7366. LLLL: 'dddd D MMMM YYYY HH:mm'
  7367. },
  7368. calendar: {
  7369. sameDay: '[Oggi alle] LT',
  7370. nextDay: '[Domani alle] LT',
  7371. nextWeek: 'dddd [alle] LT',
  7372. lastDay: '[Ieri alle] LT',
  7373. /**
  7374. * @param {?} date
  7375. * @return {?}
  7376. */
  7377. lastWeek(date) {
  7378. switch (getDayOfWeek(date)) {
  7379. case 0:
  7380. return '[la scorsa] dddd [alle] LT';
  7381. default:
  7382. return '[lo scorso] dddd [alle] LT';
  7383. }
  7384. },
  7385. sameElse: 'L'
  7386. },
  7387. relativeTime: {
  7388. /**
  7389. * @param {?} num
  7390. * @return {?}
  7391. */
  7392. future(num) {
  7393. return ((/^[0-9].+$/).test(num.toString(10)) ? 'tra' : 'in') + ' ' + num;
  7394. },
  7395. past: '%s fa',
  7396. s: 'alcuni secondi',
  7397. ss: '%d secondi',
  7398. m: 'un minuto',
  7399. mm: '%d minuti',
  7400. h: 'un\'ora',
  7401. hh: '%d ore',
  7402. d: 'un giorno',
  7403. dd: '%d giorni',
  7404. M: 'un mese',
  7405. MM: '%d mesi',
  7406. y: 'un anno',
  7407. yy: '%d anni'
  7408. },
  7409. dayOfMonthOrdinalParse: /\d{1,2}º/,
  7410. ordinal: '%dº',
  7411. week: {
  7412. dow: 1,
  7413. // Monday is the first day of the week.
  7414. doy: 4 // The week that contains Jan 4th is the first week of the year.
  7415. }
  7416. };
  7417. /**
  7418. * @fileoverview added by tsickle
  7419. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  7420. */
  7421. // tslint:disable:comment-format binary-expression-operand-order max-line-length
  7422. // tslint:disable:no-bitwise prefer-template cyclomatic-complexity
  7423. // tslint:disable:no-shadowed-variable switch-default prefer-const
  7424. // tslint:disable:one-variable-per-declaration newline-before-return
  7425. //! moment.js locale configuration
  7426. //! locale : Japanese [ja]
  7427. //! author : LI Long : https://github.com/baryon
  7428. /** @type {?} */
  7429. const jaLocale = {
  7430. abbr: 'ja',
  7431. months: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  7432. monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  7433. weekdays: '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'),
  7434. weekdaysShort: '日_月_火_水_木_金_土'.split('_'),
  7435. weekdaysMin: '日_月_火_水_木_金_土'.split('_'),
  7436. longDateFormat: {
  7437. LT: 'HH:mm',
  7438. LTS: 'HH:mm:ss',
  7439. L: 'YYYY/MM/DD',
  7440. LL: 'YYYY年M月D日',
  7441. LLL: 'YYYY年M月D日 HH:mm',
  7442. LLLL: 'YYYY年M月D日 HH:mm dddd',
  7443. l: 'YYYY/MM/DD',
  7444. ll: 'YYYY年M月D日',
  7445. lll: 'YYYY年M月D日 HH:mm',
  7446. llll: 'YYYY年M月D日 HH:mm dddd'
  7447. },
  7448. meridiemParse: /午前|午後/i,
  7449. /**
  7450. * @param {?} input
  7451. * @return {?}
  7452. */
  7453. isPM(input) {
  7454. return input === '午後';
  7455. },
  7456. /**
  7457. * @param {?} hour
  7458. * @param {?} minute
  7459. * @param {?} isLower
  7460. * @return {?}
  7461. */
  7462. meridiem(hour, minute, isLower) {
  7463. if (hour < 12) {
  7464. return '午前';
  7465. }
  7466. else {
  7467. return '午後';
  7468. }
  7469. },
  7470. calendar: {
  7471. sameDay: '[今日] LT',
  7472. nextDay: '[明日] LT',
  7473. nextWeek: '[来週]dddd LT',
  7474. lastDay: '[昨日] LT',
  7475. lastWeek: '[前週]dddd LT',
  7476. sameElse: 'L'
  7477. },
  7478. dayOfMonthOrdinalParse: /\d{1,2}日/,
  7479. /**
  7480. * @param {?} num
  7481. * @param {?} period
  7482. * @return {?}
  7483. */
  7484. ordinal(num, period) {
  7485. switch (period) {
  7486. case 'd':
  7487. case 'D':
  7488. case 'DDD':
  7489. return num + '日';
  7490. default:
  7491. return num.toString(10);
  7492. }
  7493. },
  7494. relativeTime: {
  7495. future: '%s後',
  7496. past: '%s前',
  7497. s: '数秒',
  7498. ss: '%d秒',
  7499. m: '1分',
  7500. mm: '%d分',
  7501. h: '1時間',
  7502. hh: '%d時間',
  7503. d: '1日',
  7504. dd: '%d日',
  7505. M: '1ヶ月',
  7506. MM: '%dヶ月',
  7507. y: '1年',
  7508. yy: '%d年'
  7509. }
  7510. };
  7511. /**
  7512. * @fileoverview added by tsickle
  7513. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  7514. */
  7515. // tslint:disable:comment-format binary-expression-operand-order max-line-length
  7516. // tslint:disable:no-bitwise prefer-template cyclomatic-complexity
  7517. // tslint:disable:no-shadowed-variable switch-default prefer-const
  7518. // tslint:disable:one-variable-per-declaration newline-before-return
  7519. // tslint:disable:object-literal-shorthand
  7520. //! moment.js locale configuration
  7521. //! locale : Korean [ko]
  7522. //! author : Kyungwook, Park : https://github.com/kyungw00k
  7523. //! author : Jeeeyul Lee <jeeeyul@gmail.com>
  7524. /** @type {?} */
  7525. const koLocale = {
  7526. abbr: 'ko',
  7527. months: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
  7528. monthsShort: '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'),
  7529. weekdays: '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'),
  7530. weekdaysShort: '일_월_화_수_목_금_토'.split('_'),
  7531. weekdaysMin: '일_월_화_수_목_금_토'.split('_'),
  7532. longDateFormat: {
  7533. LT: 'A h:mm',
  7534. LTS: 'A h:mm:ss',
  7535. L: 'YYYY.MM.DD',
  7536. LL: 'YYYY년 MMMM D일',
  7537. LLL: 'YYYY년 MMMM D일 A h:mm',
  7538. LLLL: 'YYYY년 MMMM D일 dddd A h:mm',
  7539. l: 'YYYY.MM.DD',
  7540. ll: 'YYYY년 MMMM D일',
  7541. lll: 'YYYY년 MMMM D일 A h:mm',
  7542. llll: 'YYYY년 MMMM D일 dddd A h:mm'
  7543. },
  7544. calendar: {
  7545. sameDay: '오늘 LT',
  7546. nextDay: '내일 LT',
  7547. nextWeek: 'dddd LT',
  7548. lastDay: '어제 LT',
  7549. lastWeek: '지난주 dddd LT',
  7550. sameElse: 'L'
  7551. },
  7552. relativeTime: {
  7553. future: '%s 후',
  7554. past: '%s 전',
  7555. s: '몇 초',
  7556. ss: '%d초',
  7557. m: '1분',
  7558. mm: '%d분',
  7559. h: '한 시간',
  7560. hh: '%d시간',
  7561. d: '하루',
  7562. dd: '%d일',
  7563. M: '한 달',
  7564. MM: '%d달',
  7565. y: '일 년',
  7566. yy: '%d년'
  7567. },
  7568. dayOfMonthOrdinalParse: /\d{1,2}(일|월|주)/,
  7569. ordinal: (/**
  7570. * @param {?} num
  7571. * @param {?} period
  7572. * @return {?}
  7573. */
  7574. function (num, period) {
  7575. switch (period) {
  7576. case 'd':
  7577. case 'D':
  7578. case 'DDD':
  7579. return num + '일';
  7580. case 'M':
  7581. return num + '월';
  7582. case 'w':
  7583. case 'W':
  7584. return num + '주';
  7585. default:
  7586. return num.toString(10);
  7587. }
  7588. }),
  7589. meridiemParse: /오전|오후/,
  7590. isPM: (/**
  7591. * @param {?} token
  7592. * @return {?}
  7593. */
  7594. function (token) {
  7595. return token === '오후';
  7596. }),
  7597. meridiem: (/**
  7598. * @param {?} hour
  7599. * @param {?} minute
  7600. * @param {?} isUpper
  7601. * @return {?}
  7602. */
  7603. function (hour, minute, isUpper) {
  7604. return hour < 12 ? '오전' : '오후';
  7605. })
  7606. };
  7607. /**
  7608. * @fileoverview added by tsickle
  7609. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  7610. */
  7611. // tslint:disable:comment-format binary-expression-operand-order max-line-length
  7612. // tslint:disable:no-bitwise prefer-template cyclomatic-complexity
  7613. // tslint:disable:no-shadowed-variable switch-default prefer-const
  7614. // tslint:disable:one-variable-per-declaration newline-before-return
  7615. //! moment.js locale configuration
  7616. //! locale : Lithuanian [lt]
  7617. //! author : Stanislavas Guk : https://github.com/ixoster
  7618. /** @type {?} */
  7619. const units = {
  7620. ss: 'sekundė_sekundžių_sekundes',
  7621. m: 'minutė_minutės_minutę',
  7622. mm: 'minutės_minučių_minutes',
  7623. h: 'valanda_valandos_valandą',
  7624. hh: 'valandos_valandų_valandas',
  7625. d: 'diena_dienos_dieną',
  7626. dd: 'dienos_dienų_dienas',
  7627. M: 'mėnuo_mėnesio_mėnesį',
  7628. MM: 'mėnesiai_mėnesių_mėnesius',
  7629. y: 'metai_metų_metus',
  7630. yy: 'metai_metų_metus'
  7631. };
  7632. /**
  7633. * @param {?} num
  7634. * @param {?} withoutSuffix
  7635. * @param {?} key
  7636. * @param {?} isFuture
  7637. * @return {?}
  7638. */
  7639. function translateSeconds(num, withoutSuffix, key, isFuture) {
  7640. if (withoutSuffix) {
  7641. return 'kelios sekundės';
  7642. }
  7643. else {
  7644. return isFuture ? 'kelių sekundžių' : 'kelias sekundes';
  7645. }
  7646. }
  7647. /**
  7648. * @param {?} num
  7649. * @param {?} withoutSuffix
  7650. * @param {?} key
  7651. * @param {?} isFuture
  7652. * @return {?}
  7653. */
  7654. function translateSingular(num, withoutSuffix, key, isFuture) {
  7655. return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]);
  7656. }
  7657. /**
  7658. * @param {?} num
  7659. * @return {?}
  7660. */
  7661. function special(num) {
  7662. return num % 10 === 0 || (num > 10 && num < 20);
  7663. }
  7664. /**
  7665. * @param {?} key
  7666. * @return {?}
  7667. */
  7668. function forms(key) {
  7669. return ((/** @type {?} */ (units)))[key].split('_');
  7670. }
  7671. /**
  7672. * @param {?} num
  7673. * @param {?} withoutSuffix
  7674. * @param {?} key
  7675. * @param {?} isFuture
  7676. * @return {?}
  7677. */
  7678. function translate$3(num, withoutSuffix, key, isFuture) {
  7679. /** @type {?} */
  7680. let result = num + ' ';
  7681. if (num === 1) {
  7682. return result + translateSingular(num, withoutSuffix, key[0], isFuture);
  7683. }
  7684. else if (withoutSuffix) {
  7685. return result + (special(num) ? forms(key)[1] : forms(key)[0]);
  7686. }
  7687. else {
  7688. if (isFuture) {
  7689. return result + forms(key)[1];
  7690. }
  7691. else {
  7692. return result + (special(num) ? forms(key)[1] : forms(key)[2]);
  7693. }
  7694. }
  7695. }
  7696. /** @type {?} */
  7697. const ltLocale = {
  7698. abbr: 'lt',
  7699. months: {
  7700. format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'),
  7701. standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_'),
  7702. isFormat: /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/
  7703. },
  7704. monthsShort: 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'),
  7705. weekdays: {
  7706. format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split('_'),
  7707. standalone: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'),
  7708. isFormat: /dddd HH:mm/
  7709. },
  7710. weekdaysShort: 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'),
  7711. weekdaysMin: 'S_P_A_T_K_Pn_Š'.split('_'),
  7712. weekdaysParseExact: true,
  7713. longDateFormat: {
  7714. LT: 'HH:mm',
  7715. LTS: 'HH:mm:ss',
  7716. L: 'YYYY-MM-DD',
  7717. LL: 'YYYY [m.] MMMM D [d.]',
  7718. LLL: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
  7719. LLLL: 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]',
  7720. l: 'YYYY-MM-DD',
  7721. ll: 'YYYY [m.] MMMM D [d.]',
  7722. lll: 'YYYY [m.] MMMM D [d.], HH:mm [val.]',
  7723. llll: 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]'
  7724. },
  7725. calendar: {
  7726. sameDay: '[Šiandien] LT',
  7727. nextDay: '[Rytoj] LT',
  7728. nextWeek: 'dddd LT',
  7729. lastDay: '[Vakar] LT',
  7730. lastWeek: '[Praėjusį] dddd LT',
  7731. sameElse: 'L'
  7732. },
  7733. relativeTime: {
  7734. future: 'po %s',
  7735. past: 'prieš %s',
  7736. s: translateSeconds,
  7737. ss: translate$3,
  7738. m: translateSingular,
  7739. mm: translate$3,
  7740. h: translateSingular,
  7741. hh: translate$3,
  7742. d: translateSingular,
  7743. dd: translate$3,
  7744. M: translateSingular,
  7745. MM: translate$3,
  7746. y: translateSingular,
  7747. yy: translate$3
  7748. },
  7749. dayOfMonthOrdinalParse: /\d{1,2}-oji/,
  7750. /**
  7751. * @param {?} num
  7752. * @return {?}
  7753. */
  7754. ordinal(num) {
  7755. return num + '-oji';
  7756. },
  7757. week: {
  7758. dow: 1,
  7759. // Monday is the first day of the week.
  7760. doy: 4 // The week that contains Jan 4th is the first week of the year.
  7761. }
  7762. };
  7763. /**
  7764. * @fileoverview added by tsickle
  7765. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  7766. */
  7767. // tslint:disable:comment-format binary-expression-operand-order max-line-length
  7768. // tslint:disable:no-bitwise prefer-template cyclomatic-complexity
  7769. // tslint:disable:no-shadowed-variable switch-default prefer-const
  7770. // tslint:disable:one-variable-per-declaration newline-before-return
  7771. //! moment.js locale configuration
  7772. //! locale : Latvian [lv]
  7773. //! author : Matiss Janis Aboltins : https://github.com/matissjanis
  7774. /** @type {?} */
  7775. const lvLocale = {
  7776. abbr: 'lv',
  7777. months: 'Janvāris_Februāris_Marts_Aprīlis_Maijs_Jūnijs_Jūlijs_Augusts_Septembris_Oktobris_Novembris_Decembris'.split('_'),
  7778. monthsShort: 'Jan_Feb_Mar_Apr_Mai_Jūn_Jūl_Aug_Sep_Okt_Nov_Dec'.split('_'),
  7779. weekdays: 'Svētdiena_Pirmdiena_Otrdiena_Trešdiena_Ceturtdiena_Piektdiena_Sestdiena'.split('_'),
  7780. weekdaysShort: 'Svētd_Pirmd_Otrd_Trešd_Ceturtd_Piektd_Sestd'.split('_'),
  7781. weekdaysMin: 'Sv_Pi_Ot_Tr_Ce_Pk_Se'.split('_'),
  7782. longDateFormat: {
  7783. LT: 'HH:mm',
  7784. LTS: 'HH:mm:ss',
  7785. L: 'DD/MM/YYYY',
  7786. LL: 'D MMMM YYYY',
  7787. LLL: 'D MMMM YYYY HH:mm',
  7788. LLLL: 'dddd, D MMMM YYYY HH:mm'
  7789. },
  7790. calendar: {
  7791. sameDay: '[Today at] LT',
  7792. nextDay: '[Tomorrow at] LT',
  7793. nextWeek: 'dddd [at] LT',
  7794. lastDay: '[Yesterday at] LT',
  7795. lastWeek: '[Last] dddd [at] LT',
  7796. sameElse: 'L'
  7797. },
  7798. relativeTime: {
  7799. future: 'pēc %s',
  7800. past: 'pirms %s',
  7801. s: 'dažām sekundēm',
  7802. ss: '%d sekundēm',
  7803. m: 'minūtes',
  7804. mm: '%d minūtēm',
  7805. h: 'stundas',
  7806. hh: '%d stundām',
  7807. d: 'dienas',
  7808. dd: '%d dienām',
  7809. M: 'mēneša',
  7810. MM: '%d mēnešiem',
  7811. y: 'gada',
  7812. yy: '%d gadiem'
  7813. },
  7814. dayOfMonthOrdinalParse: /\d{1,2}\./,
  7815. /**
  7816. * @param {?} num
  7817. * @return {?}
  7818. */
  7819. ordinal(num) {
  7820. return num + '.';
  7821. },
  7822. week: {
  7823. dow: 1,
  7824. // Monday is the first day of the week.
  7825. doy: 4 // The week that contains Jan 4th is the first week of the year.
  7826. }
  7827. };
  7828. /**
  7829. * @fileoverview added by tsickle
  7830. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  7831. */
  7832. // tslint:disable:comment-format binary-expression-operand-order max-line-length
  7833. // tslint:disable:no-bitwise prefer-template cyclomatic-complexity
  7834. // tslint:disable:no-shadowed-variable switch-default prefer-const
  7835. // tslint:disable:one-variable-per-declaration newline-before-return
  7836. // tslint:disable:object-literal-shorthand
  7837. //! moment.js locale configuration
  7838. //! locale : Mongolian [mn]
  7839. //! author : Javkhlantugs Nyamdorj : https://github.com/javkhaanj7
  7840. /**
  7841. * @param {?} num
  7842. * @param {?} withoutSuffix
  7843. * @param {?} key
  7844. * @param {?} isFuture
  7845. * @return {?}
  7846. */
  7847. function translate$4(num, withoutSuffix, key, isFuture) {
  7848. switch (key) {
  7849. case 's':
  7850. return withoutSuffix ? 'хэдхэн секунд' : 'хэдхэн секундын';
  7851. case 'ss':
  7852. return num + (withoutSuffix ? ' секунд' : ' секундын');
  7853. case 'm':
  7854. case 'mm':
  7855. return num + (withoutSuffix ? ' минут' : ' минутын');
  7856. case 'h':
  7857. case 'hh':
  7858. return num + (withoutSuffix ? ' цаг' : ' цагийн');
  7859. case 'd':
  7860. case 'dd':
  7861. return num + (withoutSuffix ? ' өдөр' : ' өдрийн');
  7862. case 'M':
  7863. case 'MM':
  7864. return num + (withoutSuffix ? ' сар' : ' сарын');
  7865. case 'y':
  7866. case 'yy':
  7867. return num + (withoutSuffix ? ' жил' : ' жилийн');
  7868. default:
  7869. return num.toString(10);
  7870. }
  7871. }
  7872. /** @type {?} */
  7873. const mnLocale = {
  7874. abbr: 'mn',
  7875. months: 'Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар'.split('_'),
  7876. monthsShort: '1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар'.split('_'),
  7877. monthsParseExact: true,
  7878. weekdays: 'Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба'.split('_'),
  7879. weekdaysShort: 'Ням_Дав_Мяг_Лха_Пүр_Баа_Бям'.split('_'),
  7880. weekdaysMin: 'Ня_Да_Мя_Лх_Пү_Ба_Бя'.split('_'),
  7881. weekdaysParseExact: true,
  7882. longDateFormat: {
  7883. LT: 'HH:mm',
  7884. LTS: 'HH:mm:ss',
  7885. L: 'YYYY-MM-DD',
  7886. LL: 'YYYY оны MMMMын D',
  7887. LLL: 'YYYY оны MMMMын D HH:mm',
  7888. LLLL: 'dddd, YYYY оны MMMMын D HH:mm'
  7889. },
  7890. meridiemParse: /ҮӨ|ҮХ/i,
  7891. isPM: (/**
  7892. * @param {?} input
  7893. * @return {?}
  7894. */
  7895. function (input) {
  7896. return input === 'ҮХ';
  7897. }),
  7898. meridiem: (/**
  7899. * @param {?} hour
  7900. * @param {?} minute
  7901. * @param {?} isLower
  7902. * @return {?}
  7903. */
  7904. function (hour, minute, isLower) {
  7905. if (hour < 12) {
  7906. return 'ҮӨ';
  7907. }
  7908. else {
  7909. return 'ҮХ';
  7910. }
  7911. }),
  7912. calendar: {
  7913. sameDay: '[Өнөөдөр] LT',
  7914. nextDay: '[Маргааш] LT',
  7915. nextWeek: '[Ирэх] dddd LT',
  7916. lastDay: '[Өчигдөр] LT',
  7917. lastWeek: '[Өнгөрсөн] dddd LT',
  7918. sameElse: 'L'
  7919. },
  7920. relativeTime: {
  7921. future: '%s дараа',
  7922. past: '%s өмнө',
  7923. s: translate$4,
  7924. ss: translate$4,
  7925. m: translate$4,
  7926. mm: translate$4,
  7927. h: translate$4,
  7928. hh: translate$4,
  7929. d: translate$4,
  7930. dd: translate$4,
  7931. M: translate$4,
  7932. MM: translate$4,
  7933. y: translate$4,
  7934. yy: translate$4
  7935. },
  7936. dayOfMonthOrdinalParse: /\d{1,2} өдөр/,
  7937. ordinal: (/**
  7938. * @param {?} num
  7939. * @param {?} period
  7940. * @return {?}
  7941. */
  7942. function (num, period) {
  7943. switch (period) {
  7944. case 'd':
  7945. case 'D':
  7946. case 'DDD':
  7947. return num + ' өдөр';
  7948. default:
  7949. return num.toString(10);
  7950. }
  7951. })
  7952. };
  7953. /**
  7954. * @fileoverview added by tsickle
  7955. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  7956. */
  7957. //! moment.js locale configuration
  7958. //! locale : Norwegian Bokmål [nb]
  7959. //! authors : Espen Hovlandsdal : https://github.com/rexxars
  7960. //! Sigurd Gartmann : https://github.com/sigurdga
  7961. /** @type {?} */
  7962. const nbLocale = {
  7963. abbr: 'nb',
  7964. months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
  7965. monthsShort: 'jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.'.split('_'),
  7966. monthsParseExact: true,
  7967. weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'),
  7968. weekdaysShort: 'sø._ma._ti._on._to._fr._lø.'.split('_'),
  7969. weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'),
  7970. weekdaysParseExact: true,
  7971. longDateFormat: {
  7972. LT: 'HH:mm',
  7973. LTS: 'HH:mm:ss',
  7974. L: 'DD.MM.YYYY',
  7975. LL: 'D. MMMM YYYY',
  7976. LLL: 'D. MMMM YYYY [kl.] HH:mm',
  7977. LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm'
  7978. },
  7979. calendar: {
  7980. sameDay: '[i dag kl.] LT',
  7981. nextDay: '[i morgen kl.] LT',
  7982. nextWeek: 'dddd [kl.] LT',
  7983. lastDay: '[i går kl.] LT',
  7984. lastWeek: '[forrige] dddd [kl.] LT',
  7985. sameElse: 'L'
  7986. },
  7987. relativeTime: {
  7988. future: 'om %s',
  7989. past: '%s siden',
  7990. s: 'noen sekunder',
  7991. ss: '%d sekunder',
  7992. m: 'ett minutt',
  7993. mm: '%d minutter',
  7994. h: 'en time',
  7995. hh: '%d timer',
  7996. d: 'en dag',
  7997. dd: '%d dager',
  7998. M: 'en måned',
  7999. MM: '%d måneder',
  8000. y: 'ett år',
  8001. yy: '%d år'
  8002. },
  8003. dayOfMonthOrdinalParse: /\d{1,2}\./,
  8004. ordinal: '%d.',
  8005. week: {
  8006. dow: 1,
  8007. // Monday is the first day of the week.
  8008. doy: 4 // The week that contains Jan 4th is the first week of the year.
  8009. }
  8010. };
  8011. /**
  8012. * @fileoverview added by tsickle
  8013. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  8014. */
  8015. //! moment.js locale configuration
  8016. //! locale : Dutch (Belgium) [nl-be]
  8017. //! author : Joris Röling : https://github.com/jorisroling
  8018. //! author : Jacob Middag : https://github.com/middagj
  8019. /** @type {?} */
  8020. let monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_');
  8021. /** @type {?} */
  8022. let monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');
  8023. /** @type {?} */
  8024. let monthsParse$4 = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i];
  8025. /** @type {?} */
  8026. let monthsRegex$4 = /^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;
  8027. /** @type {?} */
  8028. const nlBeLocale = {
  8029. abbr: 'nl-be',
  8030. months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),
  8031. /**
  8032. * @param {?} date
  8033. * @param {?} format
  8034. * @param {?=} isUTC
  8035. * @return {?}
  8036. */
  8037. monthsShort(date, format, isUTC) {
  8038. if (!date) {
  8039. return monthsShortWithDots;
  8040. }
  8041. else if (/-MMM-/.test(format)) {
  8042. return monthsShortWithoutDots[getMonth(date, isUTC)];
  8043. }
  8044. else {
  8045. return monthsShortWithDots[getMonth(date, isUTC)];
  8046. }
  8047. },
  8048. monthsRegex: monthsRegex$4,
  8049. monthsShortRegex: monthsRegex$4,
  8050. monthsStrictRegex: /^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,
  8051. monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
  8052. monthsParse: monthsParse$4,
  8053. longMonthsParse: monthsParse$4,
  8054. shortMonthsParse: monthsParse$4,
  8055. weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
  8056. weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),
  8057. weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),
  8058. weekdaysParseExact: true,
  8059. longDateFormat: {
  8060. LT: 'HH:mm',
  8061. LTS: 'HH:mm:ss',
  8062. L: 'DD/MM/YYYY',
  8063. LL: 'D MMMM YYYY',
  8064. LLL: 'D MMMM YYYY HH:mm',
  8065. LLLL: 'dddd D MMMM YYYY HH:mm'
  8066. },
  8067. calendar: {
  8068. sameDay: '[vandaag om] LT',
  8069. nextDay: '[morgen om] LT',
  8070. nextWeek: 'dddd [om] LT',
  8071. lastDay: '[gisteren om] LT',
  8072. lastWeek: '[afgelopen] dddd [om] LT',
  8073. sameElse: 'L'
  8074. },
  8075. relativeTime: {
  8076. future: 'over %s',
  8077. past: '%s geleden',
  8078. s: 'een paar seconden',
  8079. ss: '%d seconden',
  8080. m: 'één minuut',
  8081. mm: '%d minuten',
  8082. h: 'één uur',
  8083. hh: '%d uur',
  8084. d: 'één dag',
  8085. dd: '%d dagen',
  8086. M: 'één maand',
  8087. MM: '%d maanden',
  8088. y: 'één jaar',
  8089. yy: '%d jaar'
  8090. },
  8091. dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
  8092. /**
  8093. * @param {?} _num
  8094. * @return {?}
  8095. */
  8096. ordinal(_num) {
  8097. /** @type {?} */
  8098. const num = Number(_num);
  8099. return num + ((num === 1 || num === 8 || num >= 20) ? 'ste' : 'de');
  8100. },
  8101. week: {
  8102. dow: 1,
  8103. // Monday is the first day of the week.
  8104. doy: 4 // The week that contains Jan 4th is the first week of the year.
  8105. }
  8106. };
  8107. /**
  8108. * @fileoverview added by tsickle
  8109. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  8110. */
  8111. //! moment.js locale configuration
  8112. //! locale : Dutch [nl]
  8113. //! author : Joris Röling : https://github.com/jorisroling
  8114. //! author : Jacob Middag : https://github.com/middagj
  8115. /** @type {?} */
  8116. let monthsShortWithDots$1 = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_');
  8117. /** @type {?} */
  8118. let monthsShortWithoutDots$1 = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_');
  8119. /** @type {?} */
  8120. let monthsParse$5 = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i];
  8121. /** @type {?} */
  8122. let monthsRegex$5 = /^(januari|februari|maart|april|mei|april|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i;
  8123. /** @type {?} */
  8124. const nlLocale = {
  8125. abbr: 'nl',
  8126. months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'),
  8127. /**
  8128. * @param {?} date
  8129. * @param {?} format
  8130. * @param {?=} isUTC
  8131. * @return {?}
  8132. */
  8133. monthsShort(date, format, isUTC) {
  8134. if (!date) {
  8135. return monthsShortWithDots$1;
  8136. }
  8137. else if (/-MMM-/.test(format)) {
  8138. return monthsShortWithoutDots$1[getMonth(date, isUTC)];
  8139. }
  8140. else {
  8141. return monthsShortWithDots$1[getMonth(date, isUTC)];
  8142. }
  8143. },
  8144. monthsRegex: monthsRegex$5,
  8145. monthsShortRegex: monthsRegex$5,
  8146. monthsStrictRegex: /^(januari|februari|maart|mei|ju[nl]i|april|augustus|september|oktober|november|december)/i,
  8147. monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i,
  8148. monthsParse: monthsParse$5,
  8149. longMonthsParse: monthsParse$5,
  8150. shortMonthsParse: monthsParse$5,
  8151. weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'),
  8152. weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'),
  8153. weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'),
  8154. weekdaysParseExact: true,
  8155. longDateFormat: {
  8156. LT: 'HH:mm',
  8157. LTS: 'HH:mm:ss',
  8158. L: 'DD-MM-YYYY',
  8159. LL: 'D MMMM YYYY',
  8160. LLL: 'D MMMM YYYY HH:mm',
  8161. LLLL: 'dddd D MMMM YYYY HH:mm'
  8162. },
  8163. calendar: {
  8164. sameDay: '[vandaag om] LT',
  8165. nextDay: '[morgen om] LT',
  8166. nextWeek: 'dddd [om] LT',
  8167. lastDay: '[gisteren om] LT',
  8168. lastWeek: '[afgelopen] dddd [om] LT',
  8169. sameElse: 'L'
  8170. },
  8171. relativeTime: {
  8172. future: 'over %s',
  8173. past: '%s geleden',
  8174. s: 'een paar seconden',
  8175. ss: '%d seconden',
  8176. m: 'één minuut',
  8177. mm: '%d minuten',
  8178. h: 'één uur',
  8179. hh: '%d uur',
  8180. d: 'één dag',
  8181. dd: '%d dagen',
  8182. M: 'één maand',
  8183. MM: '%d maanden',
  8184. y: 'één jaar',
  8185. yy: '%d jaar'
  8186. },
  8187. dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/,
  8188. /**
  8189. * @param {?} _num
  8190. * @return {?}
  8191. */
  8192. ordinal(_num) {
  8193. /** @type {?} */
  8194. const num = Number(_num);
  8195. return num + ((num === 1 || num === 8 || num >= 20) ? 'ste' : 'de');
  8196. },
  8197. week: {
  8198. dow: 1,
  8199. // Monday is the first day of the week.
  8200. doy: 4 // The week that contains Jan 4th is the first week of the year.
  8201. }
  8202. };
  8203. /**
  8204. * @fileoverview added by tsickle
  8205. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  8206. */
  8207. //! moment.js locale configuration
  8208. //! locale : Polish [pl]
  8209. //! author : Rafal Hirsz : https://github.com/evoL
  8210. /** @type {?} */
  8211. let monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_');
  8212. /** @type {?} */
  8213. let monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_');
  8214. /**
  8215. * @param {?} num
  8216. * @return {?}
  8217. */
  8218. function plural$1(num) {
  8219. return (num % 10 < 5) && (num % 10 > 1) && ((~~(num / 10) % 10) !== 1);
  8220. }
  8221. /**
  8222. * @param {?} num
  8223. * @param {?} withoutSuffix
  8224. * @param {?} key
  8225. * @return {?}
  8226. */
  8227. function translate$5(num, withoutSuffix, key) {
  8228. /** @type {?} */
  8229. let result = num + ' ';
  8230. switch (key) {
  8231. case 'ss':
  8232. return result + (plural$1(num) ? 'sekundy' : 'sekund');
  8233. case 'm':
  8234. return withoutSuffix ? 'minuta' : 'minutę';
  8235. case 'mm':
  8236. return result + (plural$1(num) ? 'minuty' : 'minut');
  8237. case 'h':
  8238. return withoutSuffix ? 'godzina' : 'godzinę';
  8239. case 'hh':
  8240. return result + (plural$1(num) ? 'godziny' : 'godzin');
  8241. case 'MM':
  8242. return result + (plural$1(num) ? 'miesiące' : 'miesięcy');
  8243. case 'yy':
  8244. return result + (plural$1(num) ? 'lata' : 'lat');
  8245. }
  8246. }
  8247. /** @type {?} */
  8248. const plLocale = {
  8249. abbr: 'pl',
  8250. /**
  8251. * @param {?} date
  8252. * @param {?} format
  8253. * @param {?=} isUTC
  8254. * @return {?}
  8255. */
  8256. months(date, format, isUTC) {
  8257. if (!date) {
  8258. return monthsNominative;
  8259. }
  8260. else if (format === '') {
  8261. // Hack: if format empty we know this is used to generate
  8262. // RegExp by moment. Give then back both valid forms of months
  8263. // in RegExp ready format.
  8264. return '(' + monthsSubjective[getMonth(date, isUTC)] + '|' + monthsNominative[getMonth(date, isUTC)] + ')';
  8265. }
  8266. else if (/D MMMM/.test(format)) {
  8267. return monthsSubjective[getMonth(date, isUTC)];
  8268. }
  8269. else {
  8270. return monthsNominative[getMonth(date, isUTC)];
  8271. }
  8272. },
  8273. monthsShort: 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'),
  8274. weekdays: 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'),
  8275. weekdaysShort: 'ndz_pon_wt_śr_czw_pt_sob'.split('_'),
  8276. weekdaysMin: 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'),
  8277. longDateFormat: {
  8278. LT: 'HH:mm',
  8279. LTS: 'HH:mm:ss',
  8280. L: 'DD.MM.YYYY',
  8281. LL: 'D MMMM YYYY',
  8282. LLL: 'D MMMM YYYY HH:mm',
  8283. LLLL: 'dddd, D MMMM YYYY HH:mm'
  8284. },
  8285. calendar: {
  8286. sameDay: '[Dziś o] LT',
  8287. nextDay: '[Jutro o] LT',
  8288. /**
  8289. * @param {?} date
  8290. * @return {?}
  8291. */
  8292. nextWeek(date) {
  8293. switch (getDayOfWeek(date)) {
  8294. case 0:
  8295. return '[W niedzielę o] LT';
  8296. case 2:
  8297. return '[We wtorek o] LT';
  8298. case 3:
  8299. return '[W środę o] LT';
  8300. case 5:
  8301. return '[W piątek o] LT';
  8302. case 6:
  8303. return '[W sobotę o] LT';
  8304. default:
  8305. return '[W] dddd [o] LT';
  8306. }
  8307. },
  8308. lastDay: '[Wczoraj o] LT',
  8309. /**
  8310. * @param {?} date
  8311. * @return {?}
  8312. */
  8313. lastWeek(date) {
  8314. switch (getDayOfWeek(date)) {
  8315. case 0:
  8316. return '[W zeszłą niedzielę o] LT';
  8317. case 3:
  8318. return '[W zeszłą środę o] LT';
  8319. case 4:
  8320. return '[W zeszłą czwartek o] LT';
  8321. case 5:
  8322. return '[W zeszłą piątek o] LT';
  8323. case 6:
  8324. return '[W zeszłą sobotę o] LT';
  8325. default:
  8326. return '[W zeszły] dddd [o] LT';
  8327. }
  8328. },
  8329. sameElse: 'L'
  8330. },
  8331. relativeTime: {
  8332. future: 'za %s',
  8333. past: '%s temu',
  8334. s: 'kilka sekund',
  8335. ss: translate$5,
  8336. m: translate$5,
  8337. mm: translate$5,
  8338. h: translate$5,
  8339. hh: translate$5,
  8340. d: '1 dzień',
  8341. dd: '%d dni',
  8342. M: 'miesiąc',
  8343. MM: translate$5,
  8344. y: 'rok',
  8345. yy: translate$5
  8346. },
  8347. dayOfMonthOrdinalParse: /\d{1,2}\./,
  8348. ordinal: '%d.',
  8349. week: {
  8350. dow: 1,
  8351. // Monday is the first day of the week.
  8352. doy: 4 // The week that contains Jan 4th is the first week of the year.
  8353. }
  8354. };
  8355. /**
  8356. * @fileoverview added by tsickle
  8357. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  8358. */
  8359. //! moment.js locale configuration
  8360. //! locale : Portuguese (Brazil) [pt-br]
  8361. //! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira
  8362. /** @type {?} */
  8363. const ptBrLocale = {
  8364. abbr: 'pt-br',
  8365. months: 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'),
  8366. monthsShort: 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'),
  8367. weekdays: 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'),
  8368. weekdaysShort: 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'),
  8369. weekdaysMin: 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'),
  8370. weekdaysParseExact: true,
  8371. longDateFormat: {
  8372. LT: 'HH:mm',
  8373. LTS: 'HH:mm:ss',
  8374. L: 'DD/MM/YYYY',
  8375. LL: 'D [de] MMMM [de] YYYY',
  8376. LLL: 'D [de] MMMM [de] YYYY [às] HH:mm',
  8377. LLLL: 'dddd, D [de] MMMM [de] YYYY [às] HH:mm'
  8378. },
  8379. calendar: {
  8380. sameDay: '[Hoje às] LT',
  8381. nextDay: '[Amanhã às] LT',
  8382. nextWeek: 'dddd [às] LT',
  8383. lastDay: '[Ontem às] LT',
  8384. /**
  8385. * @param {?} date
  8386. * @return {?}
  8387. */
  8388. lastWeek(date) {
  8389. return (getDayOfWeek(date) === 0 || getDayOfWeek(date) === 6) ?
  8390. '[Último] dddd [às] LT' : // Saturday + Sunday
  8391. '[Última] dddd [às] LT'; // Monday - Friday
  8392. },
  8393. sameElse: 'L'
  8394. },
  8395. relativeTime: {
  8396. future: 'em %s',
  8397. past: '%s atrás',
  8398. s: 'poucos segundos',
  8399. ss: '%d segundos',
  8400. m: 'um minuto',
  8401. mm: '%d minutos',
  8402. h: 'uma hora',
  8403. hh: '%d horas',
  8404. d: 'um dia',
  8405. dd: '%d dias',
  8406. M: 'um mês',
  8407. MM: '%d meses',
  8408. y: 'um ano',
  8409. yy: '%d anos'
  8410. },
  8411. dayOfMonthOrdinalParse: /\d{1,2}º/,
  8412. ordinal: '%dº'
  8413. };
  8414. /**
  8415. * @fileoverview added by tsickle
  8416. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  8417. */
  8418. // ! moment.js locale configuration
  8419. // ! locale : Romanian [ro]
  8420. //! author : Vlad Gurdiga : https://github.com/gurdiga
  8421. //! author : Valentin Agachi : https://github.com/avaly
  8422. // ! author : Earle white: https://github.com/5earle
  8423. /**
  8424. * @param {?} num
  8425. * @param {?} withoutSuffix
  8426. * @param {?} key
  8427. * @return {?}
  8428. */
  8429. function relativeTimeWithPlural(num, withoutSuffix, key) {
  8430. /** @type {?} */
  8431. let format = {
  8432. ss: 'secunde',
  8433. mm: 'minute',
  8434. hh: 'ore',
  8435. dd: 'zile',
  8436. MM: 'luni',
  8437. yy: 'ani'
  8438. };
  8439. /** @type {?} */
  8440. let separator = ' ';
  8441. if (num % 100 >= 20 || (num >= 100 && num % 100 === 0)) {
  8442. separator = ' de ';
  8443. }
  8444. return num + separator + format[key];
  8445. }
  8446. /** @type {?} */
  8447. const roLocale = {
  8448. abbr: 'ro',
  8449. months: 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'),
  8450. monthsShort: 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'),
  8451. monthsParseExact: true,
  8452. weekdays: 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'),
  8453. weekdaysShort: 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'),
  8454. weekdaysMin: 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'),
  8455. longDateFormat: {
  8456. LT: 'H:mm',
  8457. LTS: 'H:mm:ss',
  8458. L: 'DD.MM.YYYY',
  8459. LL: 'D MMMM YYYY',
  8460. LLL: 'D MMMM YYYY H:mm',
  8461. LLLL: 'dddd, D MMMM YYYY H:mm'
  8462. },
  8463. calendar: {
  8464. sameDay: '[azi la] LT',
  8465. nextDay: '[mâine la] LT',
  8466. nextWeek: 'dddd [la] LT',
  8467. lastDay: '[ieri la] LT',
  8468. lastWeek: '[fosta] dddd [la] LT',
  8469. sameElse: 'L'
  8470. },
  8471. relativeTime: {
  8472. future: 'peste %s',
  8473. past: '%s în urmă',
  8474. s: 'câteva secunde',
  8475. ss: relativeTimeWithPlural,
  8476. m: 'un minut',
  8477. mm: relativeTimeWithPlural,
  8478. h: 'o oră',
  8479. hh: relativeTimeWithPlural,
  8480. d: 'o zi',
  8481. dd: relativeTimeWithPlural,
  8482. M: 'o lună',
  8483. MM: relativeTimeWithPlural,
  8484. y: 'un an',
  8485. yy: relativeTimeWithPlural
  8486. },
  8487. week: {
  8488. dow: 1,
  8489. // Monday is the first day of the week.
  8490. doy: 7 // The week that contains Jan 1st is the first week of the year.
  8491. }
  8492. };
  8493. /**
  8494. * @fileoverview added by tsickle
  8495. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  8496. */
  8497. //! moment.js locale configuration
  8498. //! locale : Russian [ru]
  8499. //! author : Viktorminator : https://github.com/Viktorminator
  8500. //! Author : Menelion Elensúle : https://github.com/Oire
  8501. //! author : Коренберг Марк : https://github.com/socketpair
  8502. /**
  8503. * @param {?} word
  8504. * @param {?} num
  8505. * @return {?}
  8506. */
  8507. function plural$2(word, num) {
  8508. /** @type {?} */
  8509. let forms = word.split('_');
  8510. return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
  8511. }
  8512. /**
  8513. * @param {?} num
  8514. * @param {?} withoutSuffix
  8515. * @param {?} key
  8516. * @return {?}
  8517. */
  8518. function relativeTimeWithPlural$1(num, withoutSuffix, key) {
  8519. /** @type {?} */
  8520. let format = {
  8521. ss: withoutSuffix ? 'секунда_секунды_секунд' : 'секунду_секунды_секунд',
  8522. mm: withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут',
  8523. hh: 'час_часа_часов',
  8524. dd: 'день_дня_дней',
  8525. MM: 'месяц_месяца_месяцев',
  8526. yy: 'год_года_лет'
  8527. };
  8528. if (key === 'm') {
  8529. return withoutSuffix ? 'минута' : 'минуту';
  8530. }
  8531. return num + ' ' + plural$2(format[key], +num);
  8532. }
  8533. /** @type {?} */
  8534. let monthsParse$6 = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[йя]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i];
  8535. // http://new.gramota.ru/spravka/rules/139-prop : § 103
  8536. // Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637
  8537. // CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753
  8538. /** @type {?} */
  8539. const ruLocale = {
  8540. abbr: 'ru',
  8541. months: {
  8542. format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_'),
  8543. standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_')
  8544. },
  8545. monthsShort: {
  8546. // по CLDR именно "июл." и "июн.", но какой смысл менять букву на точку ?
  8547. format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split('_'),
  8548. standalone: 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split('_')
  8549. },
  8550. weekdays: {
  8551. standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'),
  8552. format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_'),
  8553. isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/
  8554. },
  8555. weekdaysShort: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
  8556. weekdaysMin: 'вс_пн_вт_ср_чт_пт_сб'.split('_'),
  8557. monthsParse: monthsParse$6,
  8558. longMonthsParse: monthsParse$6,
  8559. shortMonthsParse: monthsParse$6,
  8560. // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки
  8561. monthsRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
  8562. // копия предыдущего
  8563. monthsShortRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,
  8564. // полные названия с падежами
  8565. monthsStrictRegex: /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,
  8566. // Выражение, которое соотвествует только сокращённым формам
  8567. monthsShortStrictRegex: /^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,
  8568. longDateFormat: {
  8569. LT: 'H:mm',
  8570. LTS: 'H:mm:ss',
  8571. L: 'DD.MM.YYYY',
  8572. LL: 'D MMMM YYYY г.',
  8573. LLL: 'D MMMM YYYY г., H:mm',
  8574. LLLL: 'dddd, D MMMM YYYY г., H:mm'
  8575. },
  8576. calendar: {
  8577. sameDay: '[Сегодня в] LT',
  8578. nextDay: '[Завтра в] LT',
  8579. lastDay: '[Вчера в] LT',
  8580. /**
  8581. * @param {?} date
  8582. * @param {?} now
  8583. * @return {?}
  8584. */
  8585. nextWeek(date, now) {
  8586. if (getWeek(now) !== getWeek(date)) {
  8587. switch (getDayOfWeek(date)) {
  8588. case 0:
  8589. return '[В следующее] dddd [в] LT';
  8590. case 1:
  8591. case 2:
  8592. case 4:
  8593. return '[В следующий] dddd [в] LT';
  8594. case 3:
  8595. case 5:
  8596. case 6:
  8597. return '[В следующую] dddd [в] LT';
  8598. }
  8599. }
  8600. else {
  8601. if (getDayOfWeek(date) === 2) {
  8602. return '[Во] dddd [в] LT';
  8603. }
  8604. else {
  8605. return '[В] dddd [в] LT';
  8606. }
  8607. }
  8608. },
  8609. /**
  8610. * @param {?} date
  8611. * @param {?} now
  8612. * @return {?}
  8613. */
  8614. lastWeek(date, now) {
  8615. if (getWeek(now) !== getWeek(date)) {
  8616. switch (getDayOfWeek(date)) {
  8617. case 0:
  8618. return '[В прошлое] dddd [в] LT';
  8619. case 1:
  8620. case 2:
  8621. case 4:
  8622. return '[В прошлый] dddd [в] LT';
  8623. case 3:
  8624. case 5:
  8625. case 6:
  8626. return '[В прошлую] dddd [в] LT';
  8627. }
  8628. }
  8629. else {
  8630. if (getDayOfWeek(date) === 2) {
  8631. return '[Во] dddd [в] LT';
  8632. }
  8633. else {
  8634. return '[В] dddd [в] LT';
  8635. }
  8636. }
  8637. },
  8638. sameElse: 'L'
  8639. },
  8640. relativeTime: {
  8641. future: 'через %s',
  8642. past: '%s назад',
  8643. s: 'несколько секунд',
  8644. ss: relativeTimeWithPlural$1,
  8645. m: relativeTimeWithPlural$1,
  8646. mm: relativeTimeWithPlural$1,
  8647. h: 'час',
  8648. hh: relativeTimeWithPlural$1,
  8649. d: 'день',
  8650. dd: relativeTimeWithPlural$1,
  8651. M: 'месяц',
  8652. MM: relativeTimeWithPlural$1,
  8653. y: 'год',
  8654. yy: relativeTimeWithPlural$1
  8655. },
  8656. meridiemParse: /ночи|утра|дня|вечера/i,
  8657. /**
  8658. * @param {?} input
  8659. * @return {?}
  8660. */
  8661. isPM(input) {
  8662. return /^(дня|вечера)$/.test(input);
  8663. },
  8664. /**
  8665. * @param {?} hour
  8666. * @param {?} minute
  8667. * @param {?} isLower
  8668. * @return {?}
  8669. */
  8670. meridiem(hour, minute, isLower) {
  8671. if (hour < 4) {
  8672. return 'ночи';
  8673. }
  8674. else if (hour < 12) {
  8675. return 'утра';
  8676. }
  8677. else if (hour < 17) {
  8678. return 'дня';
  8679. }
  8680. else {
  8681. return 'вечера';
  8682. }
  8683. },
  8684. dayOfMonthOrdinalParse: /\d{1,2}-(й|го|я)/,
  8685. /**
  8686. * @param {?} _num
  8687. * @param {?} period
  8688. * @return {?}
  8689. */
  8690. ordinal(_num, period) {
  8691. /** @type {?} */
  8692. const num = Number(_num);
  8693. switch (period) {
  8694. case 'M':
  8695. case 'd':
  8696. case 'DDD':
  8697. return num + '-й';
  8698. case 'D':
  8699. return num + '-го';
  8700. case 'w':
  8701. case 'W':
  8702. return num + '-я';
  8703. default:
  8704. return num.toString(10);
  8705. }
  8706. },
  8707. week: {
  8708. dow: 1,
  8709. // Monday is the first day of the week.
  8710. doy: 4 // The week that contains Jan 4th is the first week of the year.
  8711. }
  8712. };
  8713. /**
  8714. * @fileoverview added by tsickle
  8715. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  8716. */
  8717. //! moment.js locale configuration
  8718. //! locale : Slovak [sk]
  8719. //! author : Jozef Pažin : https://github.com/atiris
  8720. /** @type {?} */
  8721. const months$2 = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_');
  8722. /** @type {?} */
  8723. const monthsShort$6 = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_');
  8724. /**
  8725. * @param {?} num
  8726. * @return {?}
  8727. */
  8728. function plural$3(num) {
  8729. return (num > 1) && (num < 5) && (~~(num / 10) !== 1);
  8730. }
  8731. /**
  8732. * @param {?} num
  8733. * @param {?} withoutSuffix
  8734. * @param {?} key
  8735. * @param {?} isFuture
  8736. * @return {?}
  8737. */
  8738. function translate$6(num, withoutSuffix, key, isFuture) {
  8739. /** @type {?} */
  8740. const result = num + ' ';
  8741. switch (key) {
  8742. case 's': // a few seconds / in a few seconds / a few seconds ago
  8743. return (withoutSuffix || isFuture) ? 'pár sekúnd' : 'pár sekundami';
  8744. case 'ss': // 9 seconds / in 9 seconds / 9 seconds ago
  8745. if (withoutSuffix || isFuture) {
  8746. return result + (plural$3(num) ? 'sekundy' : 'sekúnd');
  8747. }
  8748. else {
  8749. return result + 'sekundami';
  8750. }
  8751. // break;
  8752. case 'm': // a minute / in a minute / a minute ago
  8753. return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou');
  8754. case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago
  8755. if (withoutSuffix || isFuture) {
  8756. return result + (plural$3(num) ? 'minúty' : 'minút');
  8757. }
  8758. else {
  8759. return result + 'minútami';
  8760. }
  8761. // break;
  8762. case 'h': // an hour / in an hour / an hour ago
  8763. return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou');
  8764. case 'hh': // 9 hours / in 9 hours / 9 hours ago
  8765. if (withoutSuffix || isFuture) {
  8766. return result + (plural$3(num) ? 'hodiny' : 'hodín');
  8767. }
  8768. else {
  8769. return result + 'hodinami';
  8770. }
  8771. // break;
  8772. case 'd': // a day / in a day / a day ago
  8773. return (withoutSuffix || isFuture) ? 'deň' : 'dňom';
  8774. case 'dd': // 9 days / in 9 days / 9 days ago
  8775. if (withoutSuffix || isFuture) {
  8776. return result + (plural$3(num) ? 'dni' : 'dní');
  8777. }
  8778. else {
  8779. return result + 'dňami';
  8780. }
  8781. // break;
  8782. case 'M': // a month / in a month / a month ago
  8783. return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom';
  8784. case 'MM': // 9 months / in 9 months / 9 months ago
  8785. if (withoutSuffix || isFuture) {
  8786. return result + (plural$3(num) ? 'mesiace' : 'mesiacov');
  8787. }
  8788. else {
  8789. return result + 'mesiacmi';
  8790. }
  8791. // break;
  8792. case 'y': // a year / in a year / a year ago
  8793. return (withoutSuffix || isFuture) ? 'rok' : 'rokom';
  8794. case 'yy': // 9 years / in 9 years / 9 years ago
  8795. if (withoutSuffix || isFuture) {
  8796. return result + (plural$3(num) ? 'roky' : 'rokov');
  8797. }
  8798. else {
  8799. return result + 'rokmi';
  8800. }
  8801. // break;
  8802. }
  8803. }
  8804. /** @type {?} */
  8805. const skLocale = {
  8806. abbr: 'sk',
  8807. months: months$2,
  8808. monthsShort: monthsShort$6,
  8809. weekdays: 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'),
  8810. weekdaysShort: 'ne_po_ut_st_št_pi_so'.split('_'),
  8811. weekdaysMin: 'ne_po_ut_st_št_pi_so'.split('_'),
  8812. longDateFormat: {
  8813. LT: 'H:mm',
  8814. LTS: 'H:mm:ss',
  8815. L: 'DD.MM.YYYY',
  8816. LL: 'D. MMMM YYYY',
  8817. LLL: 'D. MMMM YYYY H:mm',
  8818. LLLL: 'dddd D. MMMM YYYY H:mm',
  8819. l: 'D. M. YYYY'
  8820. },
  8821. calendar: {
  8822. sameDay: '[dnes o] LT',
  8823. nextDay: '[zajtra o] LT',
  8824. /**
  8825. * @param {?} date
  8826. * @return {?}
  8827. */
  8828. nextWeek(date) {
  8829. switch (getDayOfWeek(date)) {
  8830. case 0:
  8831. return '[v nedeľu o] LT';
  8832. case 1:
  8833. case 2:
  8834. return '[v] dddd [o] LT';
  8835. case 3:
  8836. return '[v stredu o] LT';
  8837. case 4:
  8838. return '[vo štvrtok o] LT';
  8839. case 5:
  8840. return '[v piatok o] LT';
  8841. case 6:
  8842. return '[v sobotu o] LT';
  8843. }
  8844. },
  8845. lastDay: '[včera o] LT',
  8846. /**
  8847. * @param {?} date
  8848. * @return {?}
  8849. */
  8850. lastWeek(date) {
  8851. switch (getDayOfWeek(date)) {
  8852. case 0:
  8853. return '[minulú nedeľu o] LT';
  8854. case 1:
  8855. case 2:
  8856. return '[minulý] dddd [o] LT';
  8857. case 3:
  8858. return '[minulú stredu o] LT';
  8859. case 4:
  8860. case 5:
  8861. return '[minulý] dddd [o] LT';
  8862. case 6:
  8863. return '[minulú sobotu o] LT';
  8864. }
  8865. },
  8866. sameElse: 'L'
  8867. },
  8868. relativeTime: {
  8869. future: 'o %s',
  8870. past: 'pred %s',
  8871. s: translate$6,
  8872. ss: translate$6,
  8873. m: translate$6,
  8874. mm: translate$6,
  8875. h: translate$6,
  8876. hh: translate$6,
  8877. d: translate$6,
  8878. dd: translate$6,
  8879. M: translate$6,
  8880. MM: translate$6,
  8881. y: translate$6,
  8882. yy: translate$6
  8883. },
  8884. dayOfMonthOrdinalParse: /\d{1,2}\./,
  8885. ordinal: '%d.',
  8886. week: {
  8887. dow: 1,
  8888. // Monday is the first day of the week.
  8889. doy: 4 // The week that contains Jan 4th is the first week of the year.
  8890. }
  8891. };
  8892. /**
  8893. * @fileoverview added by tsickle
  8894. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  8895. */
  8896. //! moment.js locale configuration
  8897. //! locale : Slovenian [sl]
  8898. //! author : mihan : https://github.com/mihan
  8899. /**
  8900. * @param {?} number
  8901. * @param {?} withoutSuffix
  8902. * @param {?} key
  8903. * @param {?} isFuture
  8904. * @return {?}
  8905. */
  8906. function processRelativeTime$2(number, withoutSuffix, key, isFuture) {
  8907. /** @type {?} */
  8908. var result = number + ' ';
  8909. switch (key) {
  8910. case 's':
  8911. return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami';
  8912. case 'ss':
  8913. if (number === 1) {
  8914. result += withoutSuffix ? 'sekundo' : 'sekundi';
  8915. }
  8916. else if (number === 2) {
  8917. result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah';
  8918. }
  8919. else if (number < 5) {
  8920. result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah';
  8921. }
  8922. else {
  8923. result += withoutSuffix || isFuture ? 'sekund' : 'sekund';
  8924. }
  8925. return result;
  8926. case 'm':
  8927. return withoutSuffix ? 'ena minuta' : 'eno minuto';
  8928. case 'mm':
  8929. if (number === 1) {
  8930. result += withoutSuffix ? 'minuta' : 'minuto';
  8931. }
  8932. else if (number === 2) {
  8933. result += withoutSuffix || isFuture ? 'minuti' : 'minutama';
  8934. }
  8935. else if (number < 5) {
  8936. result += withoutSuffix || isFuture ? 'minute' : 'minutami';
  8937. }
  8938. else {
  8939. result += withoutSuffix || isFuture ? 'minut' : 'minutami';
  8940. }
  8941. return result;
  8942. case 'h':
  8943. return withoutSuffix ? 'ena ura' : 'eno uro';
  8944. case 'hh':
  8945. if (number === 1) {
  8946. result += withoutSuffix ? 'ura' : 'uro';
  8947. }
  8948. else if (number === 2) {
  8949. result += withoutSuffix || isFuture ? 'uri' : 'urama';
  8950. }
  8951. else if (number < 5) {
  8952. result += withoutSuffix || isFuture ? 'ure' : 'urami';
  8953. }
  8954. else {
  8955. result += withoutSuffix || isFuture ? 'ur' : 'urami';
  8956. }
  8957. return result;
  8958. case 'd':
  8959. return withoutSuffix || isFuture ? 'en dan' : 'enim dnem';
  8960. case 'dd':
  8961. if (number === 1) {
  8962. result += withoutSuffix || isFuture ? 'dan' : 'dnem';
  8963. }
  8964. else if (number === 2) {
  8965. result += withoutSuffix || isFuture ? 'dni' : 'dnevoma';
  8966. }
  8967. else {
  8968. result += withoutSuffix || isFuture ? 'dni' : 'dnevi';
  8969. }
  8970. return result;
  8971. case 'M':
  8972. return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem';
  8973. case 'MM':
  8974. if (number === 1) {
  8975. result += withoutSuffix || isFuture ? 'mesec' : 'mesecem';
  8976. }
  8977. else if (number === 2) {
  8978. result += withoutSuffix || isFuture ? 'meseca' : 'mesecema';
  8979. }
  8980. else if (number < 5) {
  8981. result += withoutSuffix || isFuture ? 'mesece' : 'meseci';
  8982. }
  8983. else {
  8984. result += withoutSuffix || isFuture ? 'mesecev' : 'meseci';
  8985. }
  8986. return result;
  8987. case 'y':
  8988. return withoutSuffix || isFuture ? 'eno leto' : 'enim letom';
  8989. case 'yy':
  8990. if (number === 1) {
  8991. result += withoutSuffix || isFuture ? 'leto' : 'letom';
  8992. }
  8993. else if (number === 2) {
  8994. result += withoutSuffix || isFuture ? 'leti' : 'letoma';
  8995. }
  8996. else if (number < 5) {
  8997. result += withoutSuffix || isFuture ? 'leta' : 'leti';
  8998. }
  8999. else {
  9000. result += withoutSuffix || isFuture ? 'let' : 'leti';
  9001. }
  9002. return result;
  9003. }
  9004. }
  9005. /** @type {?} */
  9006. const slLocale = {
  9007. abbr: 'sl',
  9008. months: 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'),
  9009. monthsShort: 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'),
  9010. monthsParseExact: true,
  9011. weekdays: 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'),
  9012. weekdaysShort: 'ned._pon._tor._sre._čet._pet._sob.'.split('_'),
  9013. weekdaysMin: 'ne_po_to_sr_če_pe_so'.split('_'),
  9014. weekdaysParseExact: true,
  9015. longDateFormat: {
  9016. LT: 'H:mm',
  9017. LTS: 'H:mm:ss',
  9018. L: 'DD.MM.YYYY',
  9019. LL: 'D. MMMM YYYY',
  9020. LLL: 'D. MMMM YYYY H:mm',
  9021. LLLL: 'dddd, D. MMMM YYYY H:mm'
  9022. },
  9023. calendar: {
  9024. sameDay: '[danes ob] LT',
  9025. nextDay: '[jutri ob] LT',
  9026. /**
  9027. * @param {?} date
  9028. * @return {?}
  9029. */
  9030. nextWeek(date) {
  9031. switch (getDayOfWeek(date)) {
  9032. case 0:
  9033. return '[v] [nedeljo] [ob] LT';
  9034. case 3:
  9035. return '[v] [sredo] [ob] LT';
  9036. case 6:
  9037. return '[v] [soboto] [ob] LT';
  9038. case 1:
  9039. case 2:
  9040. case 4:
  9041. case 5:
  9042. return '[v] dddd [ob] LT';
  9043. }
  9044. },
  9045. lastDay: '[včeraj ob] LT',
  9046. /**
  9047. * @param {?} date
  9048. * @return {?}
  9049. */
  9050. lastWeek(date) {
  9051. switch (getDayOfWeek(date)) {
  9052. case 0:
  9053. return '[prejšnjo] [nedeljo] [ob] LT';
  9054. case 3:
  9055. return '[prejšnjo] [sredo] [ob] LT';
  9056. case 6:
  9057. return '[prejšnjo] [soboto] [ob] LT';
  9058. case 1:
  9059. case 2:
  9060. case 4:
  9061. case 5:
  9062. return '[prejšnji] dddd [ob] LT';
  9063. }
  9064. },
  9065. sameElse: 'L'
  9066. },
  9067. relativeTime: {
  9068. future: 'čez %s',
  9069. past: 'pred %s',
  9070. s: processRelativeTime$2,
  9071. ss: processRelativeTime$2,
  9072. m: processRelativeTime$2,
  9073. mm: processRelativeTime$2,
  9074. h: processRelativeTime$2,
  9075. hh: processRelativeTime$2,
  9076. d: processRelativeTime$2,
  9077. dd: processRelativeTime$2,
  9078. M: processRelativeTime$2,
  9079. MM: processRelativeTime$2,
  9080. y: processRelativeTime$2,
  9081. yy: processRelativeTime$2
  9082. },
  9083. dayOfMonthOrdinalParse: /\d{1,2}\./,
  9084. ordinal: '%d.',
  9085. week: {
  9086. dow: 1,
  9087. // Monday is the first day of the week.
  9088. doy: 7 // The week that contains Jan 1st is the first week of the year.
  9089. }
  9090. };
  9091. /**
  9092. * @fileoverview added by tsickle
  9093. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  9094. */
  9095. // tslint:disable:comment-format binary-expression-operand-order max-line-length
  9096. // tslint:disable:no-bitwise prefer-template cyclomatic-complexity
  9097. // tslint:disable:no-shadowed-variable switch-default prefer-const
  9098. // tslint:disable:one-variable-per-declaration newline-before-return
  9099. //! moment.js locale configuration
  9100. //! locale : Swedish [sv]
  9101. //! author : Jens Alm : https://github.com/ulmus
  9102. /** @type {?} */
  9103. const svLocale = {
  9104. abbr: 'sv',
  9105. months: 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'),
  9106. monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'),
  9107. weekdays: 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'),
  9108. weekdaysShort: 'sön_mån_tis_ons_tor_fre_lör'.split('_'),
  9109. weekdaysMin: 'sö_må_ti_on_to_fr_lö'.split('_'),
  9110. longDateFormat: {
  9111. LT: 'HH:mm',
  9112. LTS: 'HH:mm:ss',
  9113. L: 'YYYY-MM-DD',
  9114. LL: 'D MMMM YYYY',
  9115. LLL: 'D MMMM YYYY [kl.] HH:mm',
  9116. LLLL: 'dddd D MMMM YYYY [kl.] HH:mm',
  9117. lll: 'D MMM YYYY HH:mm',
  9118. llll: 'ddd D MMM YYYY HH:mm'
  9119. },
  9120. calendar: {
  9121. sameDay: '[Idag] LT',
  9122. nextDay: '[Imorgon] LT',
  9123. lastDay: '[Igår] LT',
  9124. nextWeek: '[På] dddd LT',
  9125. lastWeek: '[I] dddd[s] LT',
  9126. sameElse: 'L'
  9127. },
  9128. relativeTime: {
  9129. future: 'om %s',
  9130. past: 'för %s sedan',
  9131. s: 'några sekunder',
  9132. ss: '%d sekunder',
  9133. m: 'en minut',
  9134. mm: '%d minuter',
  9135. h: 'en timme',
  9136. hh: '%d timmar',
  9137. d: 'en dag',
  9138. dd: '%d dagar',
  9139. M: 'en månad',
  9140. MM: '%d månader',
  9141. y: 'ett år',
  9142. yy: '%d år'
  9143. },
  9144. dayOfMonthOrdinalParse: /\d{1,2}(e|a)/,
  9145. /**
  9146. * @param {?} _num
  9147. * @return {?}
  9148. */
  9149. ordinal(_num) {
  9150. /** @type {?} */
  9151. const num = Number(_num);
  9152. /** @type {?} */
  9153. let b = num % 10;
  9154. /** @type {?} */
  9155. let output = (~~(num % 100 / 10) === 1) ? 'e' :
  9156. (b === 1) ? 'a' :
  9157. (b === 2) ? 'a' :
  9158. (b === 3) ? 'e' : 'e';
  9159. return num + output;
  9160. },
  9161. week: {
  9162. dow: 1,
  9163. // Monday is the first day of the week.
  9164. doy: 4 // The week that contains Jan 4th is the first week of the year.
  9165. }
  9166. };
  9167. /**
  9168. * @fileoverview added by tsickle
  9169. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  9170. */
  9171. // tslint:disable:comment-format binary-expression-operand-order max-line-length
  9172. // tslint:disable:no-bitwise prefer-template cyclomatic-complexity
  9173. // tslint:disable:no-shadowed-variable switch-default prefer-const
  9174. // tslint:disable:one-variable-per-declaration newline-before-return
  9175. // moment.js locale configuration
  9176. // locale : Thai [th]
  9177. // author : Watcharapol Sanitwong : https://github.com/tumit
  9178. /** @type {?} */
  9179. const thLocale = {
  9180. abbr: 'th',
  9181. months: 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'),
  9182. monthsShort: 'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split('_'),
  9183. monthsParseExact: true,
  9184. weekdays: 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'),
  9185. weekdaysShort: 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),
  9186. // yes, three characters difference
  9187. weekdaysMin: 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'),
  9188. weekdaysParseExact: true,
  9189. longDateFormat: {
  9190. LT: 'H:mm',
  9191. LTS: 'H:mm:ss',
  9192. L: 'DD/MM/YYYY',
  9193. LL: 'D MMMM YYYY',
  9194. LLL: 'D MMMM YYYY เวลา H:mm',
  9195. LLLL: 'วันddddที่ D MMMM YYYY เวลา H:mm'
  9196. },
  9197. meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/,
  9198. /**
  9199. * @param {?} input
  9200. * @return {?}
  9201. */
  9202. isPM(input) {
  9203. return input === 'หลังเที่ยง';
  9204. },
  9205. /**
  9206. * @param {?} hour
  9207. * @param {?} minute
  9208. * @param {?} isLower
  9209. * @return {?}
  9210. */
  9211. meridiem(hour, minute, isLower) {
  9212. if (hour < 12) {
  9213. return 'ก่อนเที่ยง';
  9214. }
  9215. else {
  9216. return 'หลังเที่ยง';
  9217. }
  9218. },
  9219. calendar: {
  9220. sameDay: '[วันนี้ เวลา] LT',
  9221. nextDay: '[พรุ่งนี้ เวลา] LT',
  9222. nextWeek: 'dddd[หน้า เวลา] LT',
  9223. lastDay: '[เมื่อวานนี้ เวลา] LT',
  9224. lastWeek: '[วัน]dddd[ที่แล้ว เวลา] LT',
  9225. sameElse: 'L'
  9226. },
  9227. relativeTime: {
  9228. future: 'อีก %s',
  9229. past: '%sที่แล้ว',
  9230. s: 'ไม่กี่วินาที',
  9231. ss: '%d วินาที',
  9232. m: '1 นาที',
  9233. mm: '%d นาที',
  9234. h: '1 ชั่วโมง',
  9235. hh: '%d ชั่วโมง',
  9236. d: '1 วัน',
  9237. dd: '%d วัน',
  9238. M: '1 เดือน',
  9239. MM: '%d เดือน',
  9240. y: '1 ปี',
  9241. yy: '%d ปี'
  9242. }
  9243. };
  9244. /**
  9245. * @fileoverview added by tsickle
  9246. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  9247. */
  9248. // tslint:disable:comment-format binary-expression-operand-order max-line-length
  9249. // tslint:disable:no-bitwise prefer-template cyclomatic-complexity
  9250. // tslint:disable:no-shadowed-variable switch-default prefer-const
  9251. // tslint:disable:one-variable-per-declaration newline-before-return
  9252. //! moment.js locale configuration
  9253. //! locale : Turkish [tr]
  9254. //! authors : Erhan Gundogan : https://github.com/erhangundogan,
  9255. //! Burak Yiğit Kaya: https://github.com/BYK
  9256. /** @type {?} */
  9257. let suffixes = {
  9258. 1: '\'inci',
  9259. 5: '\'inci',
  9260. 8: '\'inci',
  9261. 70: '\'inci',
  9262. 80: '\'inci',
  9263. 2: '\'nci',
  9264. 7: '\'nci',
  9265. 20: '\'nci',
  9266. 50: '\'nci',
  9267. 3: '\'üncü',
  9268. 4: '\'üncü',
  9269. 100: '\'üncü',
  9270. 6: '\'ncı',
  9271. 9: '\'uncu',
  9272. 10: '\'uncu',
  9273. 30: '\'uncu',
  9274. 60: '\'ıncı',
  9275. 90: '\'ıncı'
  9276. };
  9277. /** @type {?} */
  9278. const trLocale = {
  9279. abbr: 'tr',
  9280. months: 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'),
  9281. monthsShort: 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'),
  9282. weekdays: 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'),
  9283. weekdaysShort: 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'),
  9284. weekdaysMin: 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'),
  9285. longDateFormat: {
  9286. LT: 'HH:mm',
  9287. LTS: 'HH:mm:ss',
  9288. L: 'DD.MM.YYYY',
  9289. LL: 'D MMMM YYYY',
  9290. LLL: 'D MMMM YYYY HH:mm',
  9291. LLLL: 'dddd, D MMMM YYYY HH:mm'
  9292. },
  9293. calendar: {
  9294. sameDay: '[bugün saat] LT',
  9295. nextDay: '[yarın saat] LT',
  9296. nextWeek: '[gelecek] dddd [saat] LT',
  9297. lastDay: '[dün] LT',
  9298. lastWeek: '[geçen] dddd [saat] LT',
  9299. sameElse: 'L'
  9300. },
  9301. relativeTime: {
  9302. future: '%s sonra',
  9303. past: '%s önce',
  9304. s: 'birkaç saniye',
  9305. ss: '%d saniye',
  9306. m: 'bir dakika',
  9307. mm: '%d dakika',
  9308. h: 'bir saat',
  9309. hh: '%d saat',
  9310. d: 'bir gün',
  9311. dd: '%d gün',
  9312. M: 'bir ay',
  9313. MM: '%d ay',
  9314. y: 'bir yıl',
  9315. yy: '%d yıl'
  9316. },
  9317. dayOfMonthOrdinalParse: /\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/,
  9318. /**
  9319. * @param {?} _num
  9320. * @return {?}
  9321. */
  9322. ordinal(_num) {
  9323. /** @type {?} */
  9324. const num = Number(_num);
  9325. if (num === 0) { // special case for zero
  9326. return num + '\'ıncı';
  9327. }
  9328. /** @type {?} */
  9329. let a = num % 10;
  9330. /** @type {?} */
  9331. let b = num % 100 - a;
  9332. /** @type {?} */
  9333. let c = num >= 100 ? 100 : null;
  9334. return num + (suffixes[a] || suffixes[b] || suffixes[c]);
  9335. },
  9336. week: {
  9337. dow: 1,
  9338. // Monday is the first day of the week.
  9339. doy: 7 // The week that contains Jan 1st is the first week of the year.
  9340. }
  9341. };
  9342. /**
  9343. * @fileoverview added by tsickle
  9344. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  9345. */
  9346. //! moment.js locale configuration
  9347. //! locale : Ukrainian [uk]
  9348. //! author : zemlanin : https://github.com/zemlanin
  9349. //! Author : Menelion Elensúle : https://github.com/Oire
  9350. /**
  9351. * @param {?} word
  9352. * @param {?} num
  9353. * @return {?}
  9354. */
  9355. function plural$4(word, num) {
  9356. /** @type {?} */
  9357. let forms = word.split('_');
  9358. return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
  9359. }
  9360. /**
  9361. * @param {?} num
  9362. * @param {?} withoutSuffix
  9363. * @param {?} key
  9364. * @return {?}
  9365. */
  9366. function relativeTimeWithPlural$2(num, withoutSuffix, key) {
  9367. /** @type {?} */
  9368. let format = {
  9369. ss: withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд',
  9370. mm: withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',
  9371. hh: withoutSuffix ? 'година_години_годин' : 'годину_години_годин',
  9372. dd: 'день_дні_днів',
  9373. MM: 'місяць_місяці_місяців',
  9374. yy: 'рік_роки_років'
  9375. };
  9376. if (key === 'm') {
  9377. return withoutSuffix ? 'хвилина' : 'хвилину';
  9378. }
  9379. if (key === 'h') {
  9380. return withoutSuffix ? 'година' : 'годину';
  9381. }
  9382. return num + ' ' + plural$4(format[key], +num);
  9383. }
  9384. /**
  9385. * @param {?} date
  9386. * @param {?} format
  9387. * @param {?=} isUTC
  9388. * @return {?}
  9389. */
  9390. function weekdaysCaseReplace(date, format, isUTC) {
  9391. /** @type {?} */
  9392. let weekdays = {
  9393. nominative: 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'),
  9394. accusative: 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'),
  9395. genitive: 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_')
  9396. };
  9397. if (!date) {
  9398. return weekdays.nominative;
  9399. }
  9400. /** @type {?} */
  9401. let nounCase = (/(\[[ВвУу]\]) ?dddd/).test(format) ?
  9402. 'accusative' :
  9403. ((/\[?(?:минулої|наступної)? ?\] ?dddd/).test(format) ?
  9404. 'genitive' :
  9405. 'nominative');
  9406. return weekdays[nounCase][getDayOfWeek(date, isUTC)];
  9407. }
  9408. /**
  9409. * @param {?} str
  9410. * @return {?}
  9411. */
  9412. function processHoursFunction(str) {
  9413. return (/**
  9414. * @param {?} date
  9415. * @return {?}
  9416. */
  9417. function (date) {
  9418. return str + 'о' + (getHours(date) === 11 ? 'б' : '') + '] LT';
  9419. });
  9420. }
  9421. /** @type {?} */
  9422. const ukLocale = {
  9423. abbr: 'uk',
  9424. months: {
  9425. format: 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_'),
  9426. standalone: 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_')
  9427. },
  9428. monthsShort: 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'),
  9429. weekdays: weekdaysCaseReplace,
  9430. weekdaysShort: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  9431. weekdaysMin: 'нд_пн_вт_ср_чт_пт_сб'.split('_'),
  9432. longDateFormat: {
  9433. LT: 'HH:mm',
  9434. LTS: 'HH:mm:ss',
  9435. L: 'DD.MM.YYYY',
  9436. LL: 'D MMMM YYYY р.',
  9437. LLL: 'D MMMM YYYY р., HH:mm',
  9438. LLLL: 'dddd, D MMMM YYYY р., HH:mm'
  9439. },
  9440. calendar: {
  9441. sameDay: processHoursFunction('[Сьогодні '),
  9442. nextDay: processHoursFunction('[Завтра '),
  9443. lastDay: processHoursFunction('[Вчора '),
  9444. nextWeek: processHoursFunction('[У] dddd ['),
  9445. /**
  9446. * @param {?} date
  9447. * @return {?}
  9448. */
  9449. lastWeek(date) {
  9450. switch (getDayOfWeek(date)) {
  9451. case 0:
  9452. case 3:
  9453. case 5:
  9454. case 6:
  9455. return processHoursFunction('[Минулої] dddd [')(date);
  9456. case 1:
  9457. case 2:
  9458. case 4:
  9459. return processHoursFunction('[Минулого] dddd [')(date);
  9460. }
  9461. },
  9462. sameElse: 'L'
  9463. },
  9464. relativeTime: {
  9465. future: 'за %s',
  9466. past: '%s тому',
  9467. s: 'декілька секунд',
  9468. ss: relativeTimeWithPlural$2,
  9469. m: relativeTimeWithPlural$2,
  9470. mm: relativeTimeWithPlural$2,
  9471. h: 'годину',
  9472. hh: relativeTimeWithPlural$2,
  9473. d: 'день',
  9474. dd: relativeTimeWithPlural$2,
  9475. M: 'місяць',
  9476. MM: relativeTimeWithPlural$2,
  9477. y: 'рік',
  9478. yy: relativeTimeWithPlural$2
  9479. },
  9480. // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason
  9481. meridiemParse: /ночі|ранку|дня|вечора/,
  9482. /**
  9483. * @param {?} input
  9484. * @return {?}
  9485. */
  9486. isPM(input) {
  9487. return /^(дня|вечора)$/.test(input);
  9488. },
  9489. /**
  9490. * @param {?} hour
  9491. * @param {?} minute
  9492. * @param {?} isLower
  9493. * @return {?}
  9494. */
  9495. meridiem(hour, minute, isLower) {
  9496. if (hour < 4) {
  9497. return 'ночі';
  9498. }
  9499. else if (hour < 12) {
  9500. return 'ранку';
  9501. }
  9502. else if (hour < 17) {
  9503. return 'дня';
  9504. }
  9505. else {
  9506. return 'вечора';
  9507. }
  9508. },
  9509. dayOfMonthOrdinalParse: /\d{1,2}-(й|го)/,
  9510. /**
  9511. * @param {?} _num
  9512. * @param {?} period
  9513. * @return {?}
  9514. */
  9515. ordinal(_num, period) {
  9516. /** @type {?} */
  9517. const num = Number(_num);
  9518. switch (period) {
  9519. case 'M':
  9520. case 'd':
  9521. case 'DDD':
  9522. case 'w':
  9523. case 'W':
  9524. return num + '-й';
  9525. case 'D':
  9526. return num + '-го';
  9527. default:
  9528. return num.toString();
  9529. }
  9530. },
  9531. week: {
  9532. dow: 1,
  9533. // Monday is the first day of the week.
  9534. doy: 7 // The week that contains Jan 1st is the first week of the year.
  9535. }
  9536. };
  9537. /**
  9538. * @fileoverview added by tsickle
  9539. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  9540. */
  9541. // tslint:disable:comment-format binary-expression-operand-order max-line-length
  9542. // tslint:disable:no-bitwise prefer-template cyclomatic-complexity
  9543. // tslint:disable:no-shadowed-variable switch-default prefer-const
  9544. // tslint:disable:one-variable-per-declaration newline-before-return
  9545. //! moment.js locale configuration
  9546. //! locale : Việt Nam [vi]
  9547. //! author : Chris Gedrim : https://github.com/chrisgedrim
  9548. /** @type {?} */
  9549. const viLocale = {
  9550. abbr: 'vi',
  9551. 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('_'),
  9552. monthsShort: 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'),
  9553. monthsParseExact: true,
  9554. weekdays: 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'),
  9555. weekdaysShort: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
  9556. weekdaysMin: 'CN_T2_T3_T4_T5_T6_T7'.split('_'),
  9557. weekdaysParseExact: true,
  9558. meridiemParse: /sa|ch/i,
  9559. /**
  9560. * @param {?} input
  9561. * @return {?}
  9562. */
  9563. isPM(input) {
  9564. return /^ch$/i.test(input);
  9565. },
  9566. /**
  9567. * @param {?} hours
  9568. * @param {?} minutes
  9569. * @param {?} isLower
  9570. * @return {?}
  9571. */
  9572. meridiem(hours, minutes, isLower) {
  9573. if (hours < 12) {
  9574. return isLower ? 'sa' : 'SA';
  9575. }
  9576. else {
  9577. return isLower ? 'ch' : 'CH';
  9578. }
  9579. },
  9580. longDateFormat: {
  9581. LT: 'HH:mm',
  9582. LTS: 'HH:mm:ss',
  9583. L: 'DD/MM/YYYY',
  9584. LL: 'D MMMM [năm] YYYY',
  9585. LLL: 'D MMMM [năm] YYYY HH:mm',
  9586. LLLL: 'dddd, D MMMM [năm] YYYY HH:mm',
  9587. l: 'DD/M/YYYY',
  9588. ll: 'D MMM YYYY',
  9589. lll: 'D MMM YYYY HH:mm',
  9590. llll: 'ddd, D MMM YYYY HH:mm'
  9591. },
  9592. calendar: {
  9593. sameDay: '[Hôm nay lúc] LT',
  9594. nextDay: '[Ngày mai lúc] LT',
  9595. nextWeek: 'dddd [tuần tới lúc] LT',
  9596. lastDay: '[Hôm qua lúc] LT',
  9597. lastWeek: 'dddd [tuần trước lúc] LT',
  9598. sameElse: 'L'
  9599. },
  9600. relativeTime: {
  9601. future: '%s tới',
  9602. past: '%s trước',
  9603. s: 'vài giây',
  9604. ss: '%d giây',
  9605. m: 'một phút',
  9606. mm: '%d phút',
  9607. h: 'một giờ',
  9608. hh: '%d giờ',
  9609. d: 'một ngày',
  9610. dd: '%d ngày',
  9611. M: 'một tháng',
  9612. MM: '%d tháng',
  9613. y: 'một năm',
  9614. yy: '%d năm'
  9615. },
  9616. dayOfMonthOrdinalParse: /\d{1,2}/,
  9617. /**
  9618. * @param {?} _num
  9619. * @return {?}
  9620. */
  9621. ordinal(_num) {
  9622. return '' + _num;
  9623. },
  9624. week: {
  9625. dow: 1,
  9626. // Thứ Hai là ngày đầu tuần.
  9627. doy: 4 // Tuần chứa ngày 4 tháng 1 là tuần đầu tiên trong năm.
  9628. }
  9629. };
  9630. /**
  9631. * @fileoverview added by tsickle
  9632. * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
  9633. */
  9634. // tslint:disable:comment-format binary-expression-operand-order max-line-length
  9635. // tslint:disable:no-bitwise prefer-template cyclomatic-complexity
  9636. // tslint:disable:no-shadowed-variable switch-default prefer-const
  9637. // tslint:disable:one-variable-per-declaration newline-before-return
  9638. // tslint:disable:no-parameter-reassignment prefer-switch
  9639. //! moment.js locale configuration
  9640. //! locale : Chinese (China) [zh-cn]
  9641. //! author : suupic : https://github.com/suupic
  9642. //! author : Zeno Zeng : https://github.com/zenozeng
  9643. /** @type {?} */
  9644. const zhCnLocale = {
  9645. abbr: 'zh-cn',
  9646. months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
  9647. monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
  9648. weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
  9649. weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'),
  9650. weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
  9651. longDateFormat: {
  9652. LT: 'HH:mm',
  9653. LTS: 'HH:mm:ss',
  9654. L: 'YYYY/MM/DD',
  9655. LL: 'YYYY年M月D日',
  9656. LLL: 'YYYY年M月D日Ah点mm分',
  9657. LLLL: 'YYYY年M月D日ddddAh点mm分',
  9658. l: 'YYYY/M/D',
  9659. ll: 'YYYY年M月D日',
  9660. lll: 'YYYY年M月D日 HH:mm',
  9661. llll: 'YYYY年M月D日dddd HH:mm'
  9662. },
  9663. meridiemParse: /凌晨|早上|上午|中午|下午|晚上/,
  9664. /**
  9665. * @param {?} hour
  9666. * @param {?} meridiem
  9667. * @return {?}
  9668. */
  9669. meridiemHour(hour, meridiem) {
  9670. if (hour === 12) {
  9671. hour = 0;
  9672. }
  9673. if (meridiem === '凌晨' || meridiem === '早上' ||
  9674. meridiem === '上午') {
  9675. return hour;
  9676. }
  9677. else if (meridiem === '下午' || meridiem === '晚上') {
  9678. return hour + 12;
  9679. }
  9680. else {
  9681. // '中午'
  9682. return hour >= 11 ? hour : hour + 12;
  9683. }
  9684. },
  9685. /**
  9686. * @param {?} hour
  9687. * @param {?} minute
  9688. * @param {?} isLower
  9689. * @return {?}
  9690. */
  9691. meridiem(hour, minute, isLower) {
  9692. /** @type {?} */
  9693. let hm = hour * 100 + minute;
  9694. if (hm < 600) {
  9695. return '凌晨';
  9696. }
  9697. else if (hm < 900) {
  9698. return '早上';
  9699. }
  9700. else if (hm < 1130) {
  9701. return '上午';
  9702. }
  9703. else if (hm < 1230) {
  9704. return '中午';
  9705. }
  9706. else if (hm < 1800) {
  9707. return '下午';
  9708. }
  9709. else {
  9710. return '晚上';
  9711. }
  9712. },
  9713. calendar: {
  9714. sameDay: '[今天]LT',
  9715. nextDay: '[明天]LT',
  9716. nextWeek: '[下]ddddLT',
  9717. lastDay: '[昨天]LT',
  9718. lastWeek: '[上]ddddLT',
  9719. sameElse: 'L'
  9720. },
  9721. dayOfMonthOrdinalParse: /\d{1,2}(日|月|周)/,
  9722. /**
  9723. * @param {?} _num
  9724. * @param {?} period
  9725. * @return {?}
  9726. */
  9727. ordinal(_num, period) {
  9728. /** @type {?} */
  9729. const num = Number(_num);
  9730. switch (period) {
  9731. case 'd':
  9732. case 'D':
  9733. case 'DDD':
  9734. return num + '日';
  9735. case 'M':
  9736. return num + '月';
  9737. case 'w':
  9738. case 'W':
  9739. return num + '周';
  9740. default:
  9741. return num.toString();
  9742. }
  9743. },
  9744. relativeTime: {
  9745. future: '%s内',
  9746. past: '%s前',
  9747. s: '几秒',
  9748. ss: '%d 秒',
  9749. m: '1 分钟',
  9750. mm: '%d 分钟',
  9751. h: '1 小时',
  9752. hh: '%d 小时',
  9753. d: '1 天',
  9754. dd: '%d 天',
  9755. M: '1 个月',
  9756. MM: '%d 个月',
  9757. y: '1 年',
  9758. yy: '%d 年'
  9759. },
  9760. week: {
  9761. // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效
  9762. dow: 1,
  9763. // Monday is the first day of the week.
  9764. doy: 4 // The week that contains Jan 4th is the first week of the year.
  9765. }
  9766. };
  9767. export { add, arLocale, bgLocale, caLocale, csLocale, daLocale, deLocale, defineLocale, enGbLocale, endOf, esDoLocale, esLocale, esUsLocale, etLocale, fiLocale, formatDate, frLocale, getDay, getFirstDayOfMonth, getFullYear, getLocale, getMonth, getSetGlobalLocale, glLocale, heLocale, hiLocale, hrLocale, huLocale, idLocale, isAfter, isArray, isBefore, isDate, isDateValid, isDisabledDay, isFirstDayOfWeek, isSame, isSameDay, isSameMonth, isSameYear, itLocale, jaLocale, koLocale, listLocales, ltLocale, lvLocale, mnLocale, nbLocale, nlBeLocale, nlLocale, parseDate, plLocale, ptBrLocale, roLocale, ruLocale, setFullDate, shiftDate, skLocale, slLocale, startOf, subtract, svLocale, thLocale, trLocale, ukLocale, updateLocale, utcAsLocal, viLocale, zhCnLocale, createDate as ɵa };
  9768. //# sourceMappingURL=ngx-bootstrap-chronos.js.map